From beab341f5571a1540506e8a3f06a06c5675c7bfb Mon Sep 17 00:00:00 2001 From: Yana Date: Mon, 20 Jan 2025 19:08:31 +0200 Subject: [PATCH] fix account balances typing --- .../src/app/(pages)/account/[address]/page.tsx | 6 +++--- explorer-nextjs/src/app/api/types.ts | 8 -------- .../accountPageComponents/AccountBalancesCard.tsx | 1 - 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/explorer-nextjs/src/app/(pages)/account/[address]/page.tsx b/explorer-nextjs/src/app/(pages)/account/[address]/page.tsx index 0fbb46a999..21419e011c 100644 --- a/explorer-nextjs/src/app/(pages)/account/[address]/page.tsx +++ b/explorer-nextjs/src/app/(pages)/account/[address]/page.tsx @@ -1,4 +1,4 @@ -import type { CurrencyRates, IAccountBalancesInfo } from "@/app/api/types"; +import type { IAccountBalancesInfo, NymTokenomics } from "@/app/api/types"; import type NodeData from "@/app/api/types"; import { NYM_ACCOUNT_ADDRESS, NYM_NODES, NYM_PRICES_API } from "@/app/api/urls"; import { AccountBalancesCard } from "@/components/accountPageComponents/AccountBalancesCard"; @@ -58,7 +58,7 @@ export default async function Account({ // refresh event list cache at given interval }); - const nymPriceData: CurrencyRates = await nymPrice.json(); + const nymPriceData: NymTokenomics = await nymPrice.json(); return ( @@ -92,7 +92,7 @@ export default async function Account({ diff --git a/explorer-nextjs/src/app/api/types.ts b/explorer-nextjs/src/app/api/types.ts index 611407c8f5..2abd88a41b 100644 --- a/explorer-nextjs/src/app/api/types.ts +++ b/explorer-nextjs/src/app/api/types.ts @@ -107,14 +107,6 @@ type NodeData = { export default NodeData; -export interface CurrencyRates { - btc: number; - chf: number; - eur: number; - timestamp: number; - usd: number; -} - // ACCOUNT BALANCES export interface IRewardDetails { diff --git a/explorer-nextjs/src/components/accountPageComponents/AccountBalancesCard.tsx b/explorer-nextjs/src/components/accountPageComponents/AccountBalancesCard.tsx index 71cfd3f745..00665bce86 100644 --- a/explorer-nextjs/src/components/accountPageComponents/AccountBalancesCard.tsx +++ b/explorer-nextjs/src/components/accountPageComponents/AccountBalancesCard.tsx @@ -52,7 +52,6 @@ export const AccountBalancesCard = (props: IAccountBalancesCardProps) => { Number(accountInfo.total_value.amount), nymPrice, ); - const spendableNYM = getNymsFormated(Number(accountInfo.balances[0].amount)); const spendableUSD = getPriceInUSD( Number(accountInfo.balances[0].amount),