From 18b6ef3a0785f115651eec5afcbe25ab433af386 Mon Sep 17 00:00:00 2001 From: Iaroslav Gryshaiev Date: Mon, 30 Dec 2024 15:11:40 +0100 Subject: [PATCH] fix(billing): fix usdc balance calculation --- apps/deploy-web/src/hooks/useWalletBalance.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/deploy-web/src/hooks/useWalletBalance.ts b/apps/deploy-web/src/hooks/useWalletBalance.ts index a7baece2b..5d3c834ec 100644 --- a/apps/deploy-web/src/hooks/useWalletBalance.ts +++ b/apps/deploy-web/src/hooks/useWalletBalance.ts @@ -64,22 +64,22 @@ export const useWalletBalance = (): WalletBalanceReturnType => { udenomToUsd(d.escrowAccount.balance.amount, d.escrowAccount.balance.denom), 0 ); - const { deploymentGrant, deploymentGrantsUAKT, deploymentEscrowUAKT } = balances; + const { deploymentGrant } = balances; const totalDeploymentGrantsUSD = deploymentGrant ? udenomToUsd(deploymentGrant.authorization.spend_limit.amount, deploymentGrant.authorization.spend_limit.denom) : 0; setWalletBalance({ totalUsd: aktUsdValue + totalUsdcValue + totalDeploymentEscrowUSD + totalDeploymentGrantsUSD, - balanceUAKT: balances.balanceUAKT + deploymentGrantsUAKT, - balanceUUSDC: balances.balanceUUSDC + deploymentEscrowUAKT, - totalUAKT: balances.balanceUAKT + balances.deploymentEscrowUAKT + deploymentGrantsUAKT, - totalUUSDC: balances.balanceUUSDC + balances.deploymentEscrowUUSDC + deploymentEscrowUAKT, + balanceUAKT: balances.balanceUAKT + balances.deploymentGrantsUAKT, + balanceUUSDC: balances.balanceUUSDC + balances.deploymentGrantsUUSDC, + totalUAKT: balances.balanceUAKT + balances.deploymentEscrowUAKT + balances.deploymentGrantsUAKT, + totalUUSDC: balances.balanceUUSDC + balances.deploymentEscrowUUSDC + balances.deploymentGrantsUUSDC, totalDeploymentEscrowUAKT: balances.deploymentEscrowUAKT, totalDeploymentEscrowUUSDC: balances.deploymentEscrowUUSDC, - totalDeploymentEscrowUSD: totalDeploymentEscrowUSD, - totalDeploymentGrantsUAKT: deploymentGrantsUAKT, - totalDeploymentGrantsUUSDC: deploymentEscrowUAKT, + totalDeploymentEscrowUSD: balances.totalDeploymentEscrowUSD, + totalDeploymentGrantsUAKT: balances.deploymentGrantsUAKT, + totalDeploymentGrantsUUSDC: balances.deploymentEscrowUAKT, totalDeploymentGrantsUSD: totalDeploymentGrantsUSD }); }