diff --git a/README.md b/README.md index f6951f07..35b239db 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ const gateways = await io.getGateways(); "failedConsecutiveEpochs": 0, "passedEpochCount": 30, "submittedEpochCount": 30, - "totalEpochParticipationCount": 31, + "totalEpochCount": 31, "totalEpochsPrescribedCount": 31 }, "status": "joined", @@ -364,7 +364,7 @@ const gateway = await io.getGateway({ "failedConsecutiveEpochs": 0, "passedEpochCount": 30, "submittedEpochCount": 30, - "totalEpochParticipationCount": 31, + "totalEpochCount": 31, "totalEpochsPrescribedCount": 31 }, "status": "joined", @@ -412,7 +412,7 @@ Available `sortBy` options are any of the keys on the gateway object, e.g. `oper "failedConsecutiveEpochs": 0, "passedEpochCount": 30, "submittedEpochCount": 30, - "totalEpochParticipationCount": 31, + "totalEpochCount": 31, "totalEpochsPrescribedCount": 31 }, "status": "joined", diff --git a/src/contract-state.ts b/src/contract-state.ts index 0ba06f82..c17ae4d2 100644 --- a/src/contract-state.ts +++ b/src/contract-state.ts @@ -135,7 +135,7 @@ export type GatewayStats = { failedConsecutiveEpochs: number; passedEpochCount: number; submittedEpochCount: number; - totalEpochParticipationCount: number; + totalEpochCount: number; totalEpochsPrescribedCount: number; }; diff --git a/src/io.ts b/src/io.ts index 38d21633..9f48ea68 100644 --- a/src/io.ts +++ b/src/io.ts @@ -390,7 +390,7 @@ export type AoEpochData = { export type AoGatewayStats = { passedConsecutiveEpochs: number; failedConsecutiveEpochs: number; - totalEpochParticipationCount: number; + totalEpochCount: number; passedEpochCount: number; failedEpochCount: number; observedEpochCount: number; diff --git a/src/utils/processes.ts b/src/utils/processes.ts index dbb7ea79..fa7d0230 100644 --- a/src/utils/processes.ts +++ b/src/utils/processes.ts @@ -115,7 +115,13 @@ export class ArNSEventEmitter extends EventEmitter { this.logger = logger; } - async fetchProcessesOwnedByWallet({ address }: { address: WalletAddress }) { + async fetchProcessesOwnedByWallet({ + address, + pageSize, + }: { + address: WalletAddress; + pageSize?: number; + }) { const uniqueContractProcessIds: Record< string, { @@ -126,7 +132,7 @@ export class ArNSEventEmitter extends EventEmitter { await timeout( this.timeoutMs, - fetchAllArNSRecords({ contract: this.contract, emitter: this }), + fetchAllArNSRecords({ contract: this.contract, emitter: this, pageSize }), ) .catch((e) => { this.emit('error', `Error getting ArNS records: ${e}`); @@ -201,17 +207,19 @@ export const fetchAllArNSRecords = async ({ }), emitter, logger = Logger.default, + pageSize = 50_000, }: { contract?: AoIORead; emitter?: EventEmitter; logger?: ILogger; + pageSize?: number; }): Promise> => { let cursor: string | undefined; const startTimestamp = Date.now(); const records: Record = {}; do { const pageResult = await contract - .getArNSRecords({ cursor }) + .getArNSRecords({ cursor, limit: pageSize }) .catch((e: any) => { logger?.error(`Error getting ArNS records`, { message: e?.message,