Skip to content

Commit

Permalink
Merge branch 'btc-wallet-v' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
naturexie committed Feb 18, 2025
2 parents 8b1d5a1 + cd18479 commit 2ae0b9c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion api/get-balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Contract> => {
const { account } = await getBurrow();
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2ae0b9c

Please sign in to comment.