fix account balances typing

This commit is contained in:
Yana
2025-01-20 19:08:31 +02:00
parent 3d6803928b
commit beab341f55
3 changed files with 3 additions and 12 deletions
@@ -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 (
<ContentLayout>
@@ -92,7 +92,7 @@ export default async function Account({
<Grid size={8}>
<AccountBalancesCard
accountInfo={nymAccountBalancesData}
nymPrice={nymPriceData.usd}
nymPrice={nymPriceData.quotes.USD.price}
/>
</Grid>
</Grid>
-8
View File
@@ -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 {
@@ -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),