getGatewayVaults

getGatewayVaults is a method on the ARIO class that retrieves all vaults across all gateways for a specific address, paginated and sorted by the specified criteria. The cursor used for pagination is the last vaultId from the previous request.

getGatewayVaults does not require authentication.

Parameters

ParameterTypeDescriptionOptional
addressstring - WalletAddressPublic wallet address for which to receive vaults.false
cursorstringCursor used for paginated resultstrue
limitnumberMax number of results to return in a single search. Max is 1000.true
sortBystringProperty used to sort returned resultstrue
sortOrderstringOrder in which sorted results are returned. valid values are `desc` or `asc`true

Example

getGatewayVaults

const { ARIO } = require('@ar.io/sdk');

async function main() {
  const ario = ARIO.init();
  const vaults = await ario.getGatewayVaults({
        address: '"PZ5vIhHf8VY969TxBPQN-rYY9CNFP9ggNsMBqlWUzWM',
    });

  console.log(vaults);
}

main();

Output

{
  "sortOrder": "desc",
  "hasMore": false,
  "totalItems": 1,
  "limit": 100,
  "sortBy": "endTimestamp",
  "items": [
    {
      "cursorId": "PZ5vIhHf8VY969TxBPQN-rYY9CNFP9ggNsMBqlWUzWM_1728067635857",
      "startTimestamp": 1728067635857,
      "balance": 50000000000,
      "vaultId": "PZ5vIhHf8VY969TxBPQN-rYY9CNFP9ggNsMBqlWUzWM",
      "endTimestamp": 1735843635857
    }
  ]
}