getGatewayVaults

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

getGatewayVaults does not require authentication.

Parameters

ParameterTypeDescriptionRequired
addressstringThe wallet address to query for vaultsYes
cursorstringCursor for paginated resultsNo
limitnumberMaximum number of results to return (max: 1000)No
sortBystringProperty to sort results byNo
sortOrderstringSort direction (valid values: 'desc' or 'asc')No

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
    }
  ]
}