Skip to content

Commit

Permalink
Merge pull request #128 from multiversx/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
radumojic authored Sep 13, 2024
2 parents 9ba2d8c + 115219e commit e5e68e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions src/helpers/getValue/getAccountDelegationDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,15 @@ export const getAccountDelegationDetails = (
(a, b) => new BigNumber(a).plus(b),
new BigNumber(ZERO)
);
const bNunbondable = delegation
.map(({ userUnBondable }) => userUnBondable)
.reduce((a, b) => new BigNumber(a).plus(b), new BigNumber(ZERO));

const activePlusUnStaked = bNactive.plus(bNunstaked);
const bNlocked = activePlusUnStaked
.plus(bNclaimableRewards)
.plus(bNunbondable);
const bNlocked = activePlusUnStaked.plus(bNclaimableRewards);

const show = bNlocked.isGreaterThan(0);

return {
active: bNactive,
unstaked: bNunstaked.plus(bNunbondable),
unstaked: bNunstaked,
claimable: bNclaimableRewards,
locked: bNlocked,
show
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ export const prepareChartData = ({
({ provider }) => delegation.contract === provider
);
if (provider) {
const {
userActiveStake,
claimableRewards,
userUnBondable,
userUndelegatedList
} = delegation;
const { userActiveStake, claimableRewards, userUndelegatedList } =
delegation;

const undelegatedAmounts =
userUndelegatedList && userUndelegatedList.length > 0
Expand All @@ -60,7 +56,6 @@ export const prepareChartData = ({

const bNLocked = new BigNumber(userActiveStake)
.plus(claimableRewards)
.plus(userUnBondable)
.plus(bNtotalUserUnStakedValue);

const amount = formatAmount({
Expand Down

0 comments on commit e5e68e7

Please sign in to comment.