getGatewayDelegates

getGatewayDelegates is a method on the ARIO class that retrieves all delegates for a specific gateway, paginated and sorted by the specified criteria. The cursor used for pagination is the last delegate address from the previous request.

getGatewayDelegates does not require authentication.

Parameters

ParameterTypeDescriptionOptional
addressstring - WalletAddressGateway wallet address to receive delegates for.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

getGatewayDelegates

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

async function main() {
  const ario = ARIO.init();
  const delegates = await ario.getGatewayDelegates({
    address: 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ',
    limit: 3,
    sortBy: 'startTimestamp',
    sortOrder: 'desc',
  });

  console.log(delegates);
}

main();

Output

{
  "nextCursor": "ScEtph9-vfY7lgqlUWwUwOmm99ySeZGQhOX0MFAyFEs",
  "limit": 3,
  "sortBy": "startTimestamp",
  "totalItems": 32,
  "sortOrder": "desc",
  "hasMore": true,
  "items": [
    {
      "delegatedStake": 600000000,
      "address": "qD5VLaMYyIHlT6vH59TgYIs6g3EFlVjlPqljo6kqVxk",
      "startTimestamp": 1732716956301
    },
    {
      "delegatedStake": 508999038,
      "address": "KG8TlcWk-8pvroCjiLD2J5zkG9rqC6yYaBuZNqHEyY4",
      "startTimestamp": 1731828123742
    },
    {
      "delegatedStake": 510926479,
      "address": "ScEtph9-vfY7lgqlUWwUwOmm99ySeZGQhOX0MFAyFEs",
      "startTimestamp": 1731689356040
    }
  ]
}