> ## Documentation Index
> Fetch the complete documentation index at: https://uasdev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getBTCAccountsByAddress

> Learn how to use the getBTCAccountsByAddress JSON-RPC method.

## Understanding `getBTCAccountsByAddress`

* `getBTCAccountsByAddress`return 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

<CodeGroup>
  ```json JSON theme={null}
  {
      "jsonrpc": "2.0",
      "id": "1",
      "method": "particle_aa_getBTCAccountsByAddress",
      "params": [
          {
              "btcAddress": "bc1qlyv3djgklwe0lm02a0265u4y8gg252cmut3j2u"
          }
      ]
  }

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

  ```js JavaScript theme={null}
  const axios = require('axios');

  (async () => {
      const response = await axios.post('https://rpc.particle.network/evm-chain', {
          chainId: 1,
          jsonrpc: '2.0',
          id: 1,
          method: 'particle_aa_getBTCAccountsByAddress',
          params: [{
             	btcAddress: 'bc1qlyv3djgklwe0lm02a0265u4y8gg252cmut3j2u'
          }],
      }, {
          auth: {
              username: 'Your Project Id',
              password: 'Your Project Server Key',
          }
      });

      console.log(response.data);
  })();
  ```
</CodeGroup>


## OpenAPI

````yaml openapi-btc POST /#particle_aa_getBTCAccountsByAddress
openapi: 3.0.1
info:
  title: Particle Network BTC Connect
  version: 1.6.0
servers:
  - url: https://rpc.particle.network/evm-chain
security:
  - basicAuth: []
paths:
  /#particle_aa_getBTCAccountsByAddress:
    post:
      summary: Get BTC Accounts By Address
      operationId: getBTCAccountsByAddress
      requestBody:
        description: >-
          Request to return smart account btcAddress and its smart account
          address.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/getBTCAccountsByAddressRequest'
      responses:
        '200':
          description: Successful response with BTC and smart account addresses.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getBTCAccountsByAddressResponse'
      security:
        - basicAuth: []
components:
  schemas:
    getBTCAccountsByAddressRequest:
      type: object
      description: Request schema for getBTCAccountsByAddress method.
      properties:
        jsonrpc:
          type: string
          default: '2.0'
          description: JSON-RPC protocol version, should be 2.0.
        id:
          type: integer
          default: 1
          description: Identifier for the request.
        method:
          type: string
          default: particle_aa_getBTCAccountsByAddress
          description: The method to be invoked on the RPC server.
        params:
          type: array
          description: Array containing parameters for querying BTC accounts by address.
          items:
            type: object
            properties:
              btcAddress:
                type: string
                description: BTC address to query for associated smart account address.
            required:
              - btcAddress
      required:
        - jsonrpc
        - id
        - method
        - params
    getBTCAccountsByAddressResponse:
      type: object
      description: Response schema for getBTCAccountsByAddress.
      properties:
        jsonrpc:
          type: string
          description: JSON-RPC protocol version used in the response.
        id:
          type: integer
          description: Identifier matching the request.
        result:
          type: array
          description: >-
            List of BTC and smart account addresses associated with the queried
            address.
          items:
            type: object
            properties:
              btcAddress:
                type: string
                description: BTC address associated with the smart account.
              chainId:
                type: integer
                description: Blockchain chain ID where the account is deployed.
              version:
                type: string
                description: Version of the smart account system used.
              aaAddress:
                type: string
                description: Smart account address associated with the BTC address.
              createdAt:
                type: string
                description: Timestamp of when the smart account was created.
              publicKey:
                type: string
                description: Public key associated with the smart account.
              updatedAt:
                type: string
                description: Timestamp of the last update to the smart account.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````