getGateways
getGateways
is a method on the ARIO
class that retrieves registered gateways from the ar.io Network. Results are paginated, and can be sorted by any attribute of the gateway object.
getGateways
does not require authentication.
Parameters
Parameter | Type | Description | Optional | Default |
---|---|---|---|---|
cursor | String | Cursor used for paginated results | true | None |
limit | Number | Max number of results to return in a single search. Max is 1000. | true | 100 |
sortBy | String | Property used to sort returned results | true | startTimestamp |
sortOrder | String | Order in which sorted results are returned. valid values are `desc` or `asc` | true | desc |
Example
getGateways
const { ARIO } = require('@ar.io/sdk');
async function main() {
const ario = ARIO.init();
const gateway = await ario.getGateway({
address: 'f_EcJ8tYOFYjBMCIi-dlmzg8AiWZ2hELrXRFWPKCv9I',
});
console.log(gateway);
}
main();
Output
{
"items": [
{
"gatewayAddress": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
"observerAddress": "IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs",
"operatorStake": 250000000000,
"settings": {
"fqdn": "ar-io.dev",
"label": "AR.IO Test",
"note": "Test Gateway operated by PDS for the AR.IO ecosystem.",
"port": 443,
"properties": "raJgvbFU-YAnku-WsupIdbTsqqGLQiYpGzoqk9SCVgY",
"protocol": "https"
},
"startTimestamp": 1720720620813,
"stats": {
"failedConsecutiveEpochs": 0,
"passedEpochCount": 30,
"submittedEpochCount": 30,
"totalEpochCount": 31,
"totalEpochsPrescribedCount": 31
},
"status": "joined",
"vaults": {},
"weights": {
"compositeWeight": 0.97688888893556,
"gatewayRewardRatioWeight": 1,
"tenureWeight": 0.19444444444444,
"observerRewardRatioWeight": 1,
"normalizedCompositeWeight": 0.19247316211083,
"stakeWeight": 5.02400000024
}
}
],
"hasMore": true,
"nextCursor": "-4xgjroXENKYhTWqrBo57HQwvDL51mMdfsdsxJy6Y2Z_sA",
"totalItems": 316,
"sortBy": "operatorStake",
"sortOrder": "desc"
}