Skip to content

Commit

Permalink
add flag chain overrides to alpha sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls committed Feb 2, 2024
1 parent fa72fb5 commit 98279bc
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/thirdweb/src/gas/fee-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,19 @@ async function getDynamicFeeData(
block && block.baseFeePerGas ? block.baseFeePerGas : 100n;

const chainId = getChainIdFromChain(chain);
// mumbai & polygon
if (chainId === 80001n || chainId === 137n) {
// flag chain testnet & flag chain
if (chainId === 220n || chainId === 1220n) {
// these does not support eip-1559, for some reason even though `eth_maxPriorityFeePerGas` is available?!?
// return null because otherwise TX break
return { maxFeePerGas: null, maxPriorityFeePerGas: null };
// mumbai & polygon
} else if (chainId === 80001n || chainId === 137n) {
// for polygon, get fee data from gas station
maxPriorityFeePerGas_ = await getPolygonGasPriorityFee(chainId);
} else if (maxPriorityFeePerGas) {
// prioritize fee from eth_maxPriorityFeePerGas
maxPriorityFeePerGas_ = maxPriorityFeePerGas;
}
// TODO bring back(?)
else {
// // if eth_maxPriorityFeePerGas is not available, use 1.5 gwei default
// const feeData = await provider.getFeeData();
// maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;
}

if (!maxPriorityFeePerGas_) {
// chain does not support eip-1559, return null for both
Expand Down

0 comments on commit 98279bc

Please sign in to comment.