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
Parameter | Type | Description | Optional |
---|---|---|---|
address | string - WalletAddress | Gateway wallet address to receive delegates for. | false |
cursor | string | Cursor used for paginated results | true |
limit | number | Max number of results to return in a single search. Max is 1000. | true |
sortBy | string | Property used to sort returned results | true |
sortOrder | string | Order 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
}
]
}