getGateways

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

getGateways does not require authentication.

Parameters

← Swipe to see more →
ParameterTypeDescriptionOptionalDefault
cursorstring

The gateway address to use as the starting point for pagination

trueNone
limitnumber

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

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

Examples

getGateways

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

async function main() {
  const ario = ARIO.init();
  const gateways = await ario.getGateways({
    limit: 10,
    sortBy: 'operatorStake',
    sortOrder: 'desc'
  });

  console.log(gateways);
}

main();

Output

{
  "items": [
    {
      "gatewayAddress": "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
      "observerWallet": "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
      "operatorStake": 500000000000,
      "totalDelegatedStake": 250000000000,
      "settings": {
        "label": "AR.IO Test Gateway",
        "fqdn": "testgateway.ar.io",
        "port": 443,
        "protocol": "https",
        "allowDelegatedStaking": true,
        "minDelegatedStake": 100000000,
        "delegateRewardShareRatio": 10
      },
      "status": "joined",
      "startTimestamp": 1706227200000,
      "stats": {
        "prescribedEpochCount": 150,
        "observedEpochCount": 148,
        "passedEpochCount": 148,
        "failedEpochCount": 2
      }
    }
  ],
  "hasMore": true,
  "nextCursor": "anotherGatewayAddress",
  "totalItems": 567,
  "sortBy": "operatorStake",
  "sortOrder": "desc"
}