POST
/
#particle_aa_getBTCAccountsByAddress
curl --request POST \
  --url 'https://rpc.particle.network/evm-chain/#particle_aa_getBTCAccountsByAddress' \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "particle_aa_getBTCAccountsByAddress",
  "params": [
    {
      "btcAddress": "<string>"
    }
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": [
    {
      "btcAddress": "<string>",
      "chainId": 123,
      "version": "<string>",
      "aaAddress": "<string>",
      "createdAt": "<string>",
      "publicKey": "<string>",
      "updatedAt": "<string>"
    }
  ]
}

Understanding getBTCAccountsByAddress

  • getBTCAccountsByAddressreturn smart account btcAddress and it’s smart account address.
    • address - string, optional, smart account to query btc address
    • btcAddress - string, optional, btc address to query evm smart account address

Query example

{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "particle_aa_getBTCAccountsByAddress",
    "params": [
        {
            "btcAddress": "bc1qlyv3djgklwe0lm02a0265u4y8gg252cmut3j2u"
        }
    ]
}

{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "particle_aa_getBTCAccountsByAddress",
    "params": [
        {
            "address": "0x94727c34b2409cC5424368cF2D029c3fe3c2b1B7"
        }
    ]
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
Request to return smart account btcAddress and its smart account address.

Request schema for getBTCAccountsByAddress method.

jsonrpc
string
default:
2.0
required

JSON-RPC protocol version, should be 2.0.

id
integer
default:
1
required

Identifier for the request.

method
string
default:
particle_aa_getBTCAccountsByAddress
required

The method to be invoked on the RPC server.

params
object[]
required

Array containing parameters for querying BTC accounts by address.

Response

200 - application/json
Successful response with BTC and smart account addresses.

Response schema for getBTCAccountsByAddress.

jsonrpc
string

JSON-RPC protocol version used in the response.

id
integer

Identifier matching the request.

result
object[]

List of BTC and smart account addresses associated with the queried address.