getVaults

getVaults is a method on the ARIO class that retrieves all vaults with optional pagination and filtering support.

getVaults does not require authentication.

Parameters

← Swipe to see more →
ParameterTypeDescriptionOptionalDefault
cursorstring

The vault ID to use as the starting point for pagination

trueNone
limitnumber

The maximum number of vaults to return (max: 1000)

true100
sortBystringThe property to sort vaults bytruestartTimestamp
sortOrderstringThe sort direction ('desc' or 'asc')truedesc
← Swipe to see more →

Examples

getVaults

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

async function main() {
  const ario = ARIO.init();
  const vaults = await ario.getVaults({
    limit: 10,
    sortBy: 'balance',
    sortOrder: 'desc'
  });

  console.log(vaults);
}

main();

Output

{
  "items": [
    {
      "vaultId": "vault_123",
      "balance": 1000000000,
      "startTimestamp": 1726243200000,
      "endTimestamp": 1726329600000
    },
    {
      "vaultId": "vault_456",
      "balance": 500000000,
      "startTimestamp": 1726243200000,
      "endTimestamp": 1726329600000
    }
  ],
  "hasMore": true,
  "nextCursor": "vault_456",
  "totalItems": 789,
  "sortBy": "balance",
  "sortOrder": "desc"
}

Was this page helpful?