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 →
Parameter | Type | Description | Optional | Default |
---|---|---|---|---|
cursor | string | The gateway address to use as the starting point for pagination | true | None |
limit | number | The maximum number of gateways to return (max: 1000) | true | 100 |
sortBy | string | The property to sort gateways by | true | startTimestamp |
sortOrder | string | The sort direction ('desc' or 'asc') | true | desc |
← 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"
}