From 5aedf5077a68faec8d86281a401ab2f4d6daf142 Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Tue, 27 Aug 2024 06:53:11 -0600 Subject: [PATCH] fix(types): update types for epoch distributions The new snapshots set eligible rewards at the beginning of the epoch. Distributions are added after the epoch ends --- src/io.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/io.ts b/src/io.ts index 47df5fca..d57f0126 100644 --- a/src/io.ts +++ b/src/io.ts @@ -96,11 +96,26 @@ export type AoVaultData = { endTimestamp: Timestamp; }; +export type AoEpochDistributionRewards = { + eligible: Record< + WalletAddress, + { + delegateRewards: Record; + operatorReward: number; + } + >; + // TODO: we could create a new type for this + distributed?: Record; +}; + export type AoEpochDistributionData = { - rewards: Record; - distributedTimestamp: Timestamp; - totalDistributedRewards: number; + rewards: AoEpochDistributionRewards; totalEligibleRewards: number; + totalEligibleObserverReward: number; + totalEligibleGatewayReward: number; + // TODO: we could create a new type for this + distributedTimestamp?: Timestamp; // only set if rewards have been distributed + totalDistributedRewards?: number; // only set if rewards have been distributed }; export type AoArNSReservedNameData = {