File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
packages/thirdweb/src/react/core/hooks/transaction Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Fix ERC20 balance read when showing pay modal
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import type { WaitForReceiptOptions } from "../../../../transaction/actions/wait
10
10
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js" ;
11
11
import { resolvePromisedValue } from "../../../../utils/promise/resolve-promised-value.js" ;
12
12
import type { Wallet } from "../../../../wallets/interfaces/wallet.js" ;
13
+ import { getTokenBalance } from "../../../../wallets/utils/getTokenBalance.js" ;
13
14
import { getWalletBalance } from "../../../../wallets/utils/getWalletBalance.js" ;
14
15
import type { LocaleId } from "../../../web/ui/types.js" ;
15
16
import type { Theme } from "../../design-system/index.js" ;
@@ -175,10 +176,11 @@ export function useSendTransactionCore(args: {
175
176
chain : tx . chain ,
176
177
} ) ,
177
178
_erc20Value ?. tokenAddress
178
- ? getWalletBalance ( {
179
+ ? getTokenBalance ( {
179
180
client : tx . client ,
180
- address : account . address ,
181
+ account,
181
182
chain : tx . chain ,
183
+ tokenAddress : _erc20Value . tokenAddress ,
182
184
} )
183
185
: undefined ,
184
186
getTotalTxCostForBuy ( tx , account . address ) ,
You can’t perform that action at this time.
0 commit comments