getGatewayDelegates

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

getGatewayDelegates does not require authentication.

Parameters

← Swipe to see more →
ParameterTypeDescriptionRequired
addressstringThe gateway address to query for delegatesYes
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
← Swipe to see more →

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

Was this page helpful?