From aed8f7b8fcb539401848720854688b41675b5a37 Mon Sep 17 00:00:00 2001 From: AricRedemption Date: Sat, 11 May 2024 23:02:44 +0800 Subject: [PATCH] fix: btc balance --- src/queries/balance.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/queries/balance.ts b/src/queries/balance.ts index f55aea3c..6b6aa188 100644 --- a/src/queries/balance.ts +++ b/src/queries/balance.ts @@ -30,8 +30,8 @@ export const fetchBtcBalance = async (address: string): Promise => { const data = await metaletApiV3(`/address/btc-balance`).get({ net, address }) return { total: new Decimal(data.balance).mul(1e8).toNumber(), - confirmed: new Decimal(data.block.incomeFee).mul(1e8).toNumber(), - unconfirmed: new Decimal(data.mempool.incomeFee).mul(1e8).toNumber(), + confirmed: new Decimal(data.block.incomeFee - data.block.spendFee).mul(1e8).toNumber(), + unconfirmed: new Decimal(data.mempool.incomeFee - data.mempool.spendFee).mul(1e8).toNumber(), } }