avm.getAddressTxs

Returns all transactions that change the balance of the given address. Note: Indexing (index-transactions) must be enabled in the X-chain config.

A transaction is said to change an address's balance if either is true:

  • A UTXO that the transaction consumes was at least partially owned by the address.

  • A UTXO that the transaction produces is at least partially owned by the address.

Parameters:

  • address - string - The address for which we're fetching related transactions

  • cursor - uint64 - (optional) The page number or offset. Leave empty to get the first page.

  • assetID - string - Only return transactions that changed the balance of this asset. Must be an ID or an alias for an asset.

  • pageSize - uint64 - (optional) The number of items to return per page. Optional. Defaults to 1024.

Returned Value:

  • txIDs - []string - The list of transaction IDs that affected the balance of this address.

  • cursor - uint64 - The page number or offset. Use this in request to get the next page.

Example Response:

{
  "jsonrpc": "2.0",
  "result": {
    "txIDs": ["SsJF7KKwxiUJkczygwmgLqo3XVRotmpKP8rMp74cpLuNLfwf6"],
    "cursor": "1"
  },
  "id": 1
}
curl https://mainnet.avalanche.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ext/bc/X \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
  "jsonrpc":"2.0",
  "id"     : 1,
  "method" :"avm.getAddressTxs",
  "params" :{
      "address":"X-local1kpprmfpzzm5lxyene32f6lr7j0aj7gxsu6hp9y",
      "assetID":"AVAX",
      "pageSize":20
  }
}'

Last updated