diff --git a/api/get-balance.ts b/api/get-balance.ts index e82ba576..d5312931 100644 --- a/api/get-balance.ts +++ b/api/get-balance.ts @@ -9,7 +9,7 @@ import { ViewMethodsREFV1, IShadowRecordInfo, } from "../interfaces"; -import { lpTokenPrefix } from "../utils/config"; +import { lpTokenPrefix, NBTCTokenId } from "../utils/config"; export const getTokenContract = async (tokenContractAddress: string): Promise => { const { account } = await getBurrow(); @@ -47,6 +47,12 @@ const getBalance = async ( account_id: accountId, }, )) as string; + if ( + tokenId === NBTCTokenId && + window.selector?.store?.getState()?.selectedWalletId === "btc-wallet" + ) { + return Decimal.max(new Decimal(balanceInYocto || 0).minus(1000), "0").toFixed(); + } } return balanceInYocto; } catch (err: any) { diff --git a/utils/config.ts b/utils/config.ts index 674fd8aa..f46e608e 100644 --- a/utils/config.ts +++ b/utils/config.ts @@ -34,7 +34,10 @@ export const BRRR_LABS_TOKEN = { testnet: "brrr.ft.ref-labs.testnet", mainnet: "brrr.ft.ref-labs.testnet", }; - +export const NBTCTokenId = { + testnet: "nbtc-dev.testnet", + mainnet: "nbtc.bridge.near", +}[defaultNetwork]; export const WALLET_CONNECT_ID = process.env.NEXT_PUBLIC_WALLET_CONNECT_ID || ("87e549918631f833447b56c15354e450" as string);