@@ -2,7 +2,6 @@ import { Panel, SkeletonLoading, Stack } from "@namada/components";
22import { FiatCurrency } from "App/Common/FiatCurrency" ;
33import { NamCurrency } from "App/Common/NamCurrency" ;
44import { UnclaimedRewardsCard } from "App/Staking/UnclaimedRewardsCard" ;
5- import { namadaTransparentAssetsAtom } from "atoms/balance" ;
65import { tokenPricesFamily } from "atoms/prices/atoms" ;
76import BigNumber from "bignumber.js" ;
87import clsx from "clsx" ;
@@ -12,14 +11,9 @@ import { namadaAsset } from "utils";
1211
1312export const TotalStakeBanner = ( ) : JSX . Element => {
1413 const { bondedAmount, isLoading : bondedAmountIsLoading } = useBalances ( ) ;
15- const shieldedAssets = useAtomValue ( namadaTransparentAssetsAtom ) ;
16- const tokenPrices = useAtomValue (
17- tokenPricesFamily (
18- Object . values ( shieldedAssets . data ?? { } ) . map ( ( { asset } ) => asset . address )
19- )
20- ) ;
21- const namPrice =
22- tokenPrices . data ?. [ namadaAsset ( ) . address ?? "" ] ?? BigNumber ( 0 ) ;
14+ const nativeAsset = namadaAsset ( ) ;
15+ const tokenPrices = useAtomValue ( tokenPricesFamily ( [ nativeAsset . address ! ] ) ) ;
16+ const namPrice = tokenPrices . data ?. [ nativeAsset . address ! ] ?? BigNumber ( 0 ) ;
2317
2418 return (
2519 < Panel className = "py-4 min-w-full" >
@@ -45,7 +39,7 @@ export const TotalStakeBanner = (): JSX.Element => {
4539 "flex items-center text-2xl leading-none mt-8"
4640 ) }
4741 >
48- < FiatCurrency amount = { namPrice } />
42+ < FiatCurrency amount = { bondedAmount . times ( namPrice ) } />
4943 </ div >
5044 ) }
5145 </ >
0 commit comments