Skip to content

Commit 552e2ba

Browse files
fix: bonded amount dollar value (#2214)
1 parent ca3291c commit 552e2ba

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

apps/namadillo/src/App/AccountOverview/TotalStakeBanner.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Panel, SkeletonLoading, Stack } from "@namada/components";
22
import { FiatCurrency } from "App/Common/FiatCurrency";
33
import { NamCurrency } from "App/Common/NamCurrency";
44
import { UnclaimedRewardsCard } from "App/Staking/UnclaimedRewardsCard";
5-
import { namadaTransparentAssetsAtom } from "atoms/balance";
65
import { tokenPricesFamily } from "atoms/prices/atoms";
76
import BigNumber from "bignumber.js";
87
import clsx from "clsx";
@@ -12,14 +11,9 @@ import { namadaAsset } from "utils";
1211

1312
export 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
</>

apps/namadillo/src/App/Transfer/TransferModule.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const isValidDestinationAddress = ({
137137
if (!customAddress || !chain || !chain.bech32_prefix) return true;
138138

139139
// Check shielded/transparent address requirements for Namada
140-
if (chain.bech32_prefix === "nam") {
140+
if (chain.bech32_prefix === "tnam") {
141141
return (
142142
isTransparentAddress(customAddress) || isShieldedAddress(customAddress)
143143
);

0 commit comments

Comments
 (0)