Marketplace has launched, further enabling blockchain developers! Learn more

Contents

avax.getUTXOs RPC method

The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. addresses - []string - A list of addresses.
  2. limit - Int - (optional) The limit of UTXOs to return. If limit is omitted or greater than 1024, it is set to 1024.
  3. startIndex - Object - (optional) If startIndex is omitted, will fetch all UTXOs up to limit. When using pagination (i.e when startIndex is provided), UTXOs are not guaranteed to be unique across multiple calls. That is, a UTXO may appear in the result of the first call, and then again in the second call.
  4. address - String

    utxo - String

  5. sourceChain - String - The ID or alias of the chain the asset is being imported from.
  6. encoding - String - (optional) Encoding sets the format for the returned UTXOs. Can be either "cb58" or "hex". Defaults to "cb58".

Returns:

  1. numFetched - Int - (optional) Number of UTXOs fetched.
  2. utxos - []string - a list of UTXOs such that each UTXO references at least one address in addresses.
  3. endIndex - Object - Denotes the last UTXO returned. To get the next set of UTXOs, use the value of endIndex as startIndex in the next call.
  4. address - String

    utxo - String

Code Examples:

const ethers = require("ethers");

(async () => {
  const provider = new ethers.providers.JsonRpcProvider(
    "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/avax"
  );
  const params = {
    "addresses": ["C-avax1uqsts4n6j0fwmdhu4p8acmjksemtqu7vedhdks"],
    "sourceChain": "X",
    "limit": 5,
    "encoding": "cb58",
  };
  const result = await provider.send("avax.getUTXOs", params);
  console.log(result);
})();
Ready to get started? Create a free account