diff --git a/root/schema.graphql b/root/schema.graphql index e16061c..bfab554 100644 --- a/root/schema.graphql +++ b/root/schema.graphql @@ -239,6 +239,7 @@ type DelegatorUnbond @entity { unbondStartedTimeStamp: BigInt unbondClaimedTxHash: Bytes unbondClaimedTimeStamp: BigInt + activeStake: BigInt! } type MaticTransfer @entity { @@ -267,4 +268,5 @@ type Delegation @entity { # delegated amount in that transaction amount: BigInt! block: BigInt! + activeStake: BigInt! } diff --git a/root/src/mappings/staking-info.ts b/root/src/mappings/staking-info.ts index 6c27921..b2a2f4e 100644 --- a/root/src/mappings/staking-info.ts +++ b/root/src/mappings/staking-info.ts @@ -325,6 +325,7 @@ export function handleShareMinted(event: ShareMinted): void { delegation.timestamp = event.block.timestamp delegation.transactionHash = event.transaction.hash delegation.amount = event.params.amount + delegation.activeStake = delegator.delegatedAmount delegation.save() // -- Saving updation @@ -383,6 +384,7 @@ export function handleShareBurnedWithId(event: ShareBurnedWithId): void { delegatorUnbond.tokens = event.params.tokens delegatorUnbond.unbondStartedTxHash = event.transaction.hash delegatorUnbond.unbondStartedTimeStamp = event.block.timestamp + delegatorUnbond.activeStake = delegator.delegatedAmount // save entity delegatorUnbond.save()