diff --git a/src/pages/AddressPage/StakingDelegations.tsx b/src/pages/AddressPage/StakingDelegations.tsx index 2a024c7..b4269a6 100644 --- a/src/pages/AddressPage/StakingDelegations.tsx +++ b/src/pages/AddressPage/StakingDelegations.tsx @@ -32,10 +32,16 @@ function StakingDelegations(props: { delegations: StakingDelegation[] }) { let totalAmountBig = Big(0) let totalRewardsBig = Big(0) + let totalUndelegated = Big(0) delegations.forEach(delegation => { totalAmountBig = totalAmountBig.plus(Big(delegation.amount)) totalRewardsBig = totalRewardsBig.plus(Big(delegation.reward)) + + const undelegated = delegation.undelegations.reduce((acc, item) => { + return acc.plus(Big(item.amount)) + }, Big(0)) + totalUndelegated = totalUndelegated.plus(undelegated) }) const totalAmount = totalAmountBig.div(Big(10 ** 18)).round(2).toString() @@ -84,6 +90,12 @@ function StakingDelegations(props: { delegations: StakingDelegation[] }) { {items.length > 0 && } + {totalUndelegated.gt(0) && + + Undelegated: + + + } } }