getAllowedDelegates

getAllowedDelegates is a method on the ARIO class that retrieves all allowed delegates for a specific address. The cursor used for pagination is the last address from the previous request.

getAllowedDelegates does not require authentication.

Parameters

ParameterTypeDescriptionOptional
addressstring - WalletAddressTarget gateway address to receive allowed delegates.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

getAllowedDelegates

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

async function main() {
  const ario = ARIO.init();
  const allowedDelegates = await ario.getAllowedDelegates({
        address: 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ',
    });

  console.log(allowdDelegates);
}

main();

Output

{
  "sortOrder": "desc",
  "hasMore": false,
  "totalItems": 4,
  "limit": 100,
  "items": [
    "PZ5vIhHf8VY969TxBPQN-rYY9CNFP9ggNsMBqlWUzWM",
    "N4h8M9A9hasa3tF47qQyNvcKjm4APBKuFs7vqUVm-SI",
    "JcC4ZLUY76vmWha5y6RwKsFqYTrMZhbockl8iM9p5lQ",
    "31LPFYoow2G7j-eSSsrIh8OlNaARZ84-80J-8ba68d8"
  ]
}