Skip to content

Commit 66fbe30

Browse files
committed
fallback to legacy if no baseBlockFee in last block
1 parent f4a26e1 commit 66fbe30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/thirdweb/src/gas/fee-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ async function getDynamicFeeData(
169169
eth_maxPriorityFeePerGas(rpcRequest).catch(() => null),
170170
]);
171171

172-
const baseBlockFee = block?.baseFeePerGas ?? 0n;
172+
const baseBlockFee = block?.baseFeePerGas;
173173

174174
const chainId = chain.id;
175175
// flag chain testnet & flag chain
@@ -187,7 +187,7 @@ async function getDynamicFeeData(
187187
maxPriorityFeePerGas_ = maxPriorityFeePerGas;
188188
}
189189

190-
if (maxPriorityFeePerGas_ == null) {
190+
if (maxPriorityFeePerGas_ == null || baseBlockFee == null) {
191191
// chain does not support eip-1559, return null for both
192192
return { maxFeePerGas: null, maxPriorityFeePerGas: null };
193193
}

0 commit comments

Comments
 (0)