Skip to content

Commit 91d4ddf

Browse files
committed
fix: user balance with native token
1 parent 374e9cd commit 91d4ddf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function TransactionPayment({
104104
const walletBalance = await getWalletBalance({
105105
address: activeAccount?.address,
106106
chain: uiOptions.transaction.chain,
107-
tokenAddress: erc20Value?.tokenAddress,
107+
tokenAddress: erc20Value?.tokenAddress.toLowerCase() !== NATIVE_TOKEN_ADDRESS ? erc20Value?.tokenAddress : undefined,
108108
client,
109109
});
110110

@@ -366,7 +366,7 @@ export function TransactionPayment({
366366
Math.max(
367367
0,
368368
Number(transactionDataQuery.data.totalCost) -
369-
Number(userBalance),
369+
Number(userBalance ?? "0"),
370370
).toString(),
371371
transactionDataQuery.data.tokenInfo,
372372
getAddress(activeAccount.address),

0 commit comments

Comments
 (0)