Skip to content

Commit

Permalink
fix(dashboard): account's "ready to claim" calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidsowardx committed Jan 23, 2024
1 parent ecb51e6 commit 38e2b6c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/ui/src/api/utils/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ export const getUnstakeAndClaimInfo =
(validators: ValidatorListItem[]) =>
(nfts: NonFungible[]) =>
(account: Account, currentEpoch: number) => {
const claimNfts = account.resources.nonFungible
.map((resource) =>
nfts.find((nft) => nft.address.resourceAddress === resource.address)
)
.filter((nft): nft is NonNullable<typeof nft> => !isNil(nft))
.flat()
.filter((nft): nft is ClaimNft => nft.type === 'claimNft')
const claimNfts = nfts.filter(
(nft): nft is ClaimNft => nft.type === 'claimNft'
)

let unstaking: UnstakingInfo[] = []
let readyToClaim: ReadyToClaimInfo[] = []
Expand Down

0 comments on commit 38e2b6c

Please sign in to comment.