Skip to content

fix gasPrice for legacy chain 88/89 #7638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/thirdweb/src/gas/fee-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
2020, // Ronin Mainnet
2021, // Ronin Testnet (Saigon)
98866, // Plume mainnet
89, // Viction Testnet
88, // Viction Mainnet
];

/**
Expand Down Expand Up @@ -135,8 +137,20 @@
resolvedFeeType === "legacy" ||
FORCE_GAS_PRICE_CHAIN_IDS.includes(chain.id)
) {
const gasPrice = await getGasPrice({
chain,
client,
percentMultiplier: 10,
});
if (chain.id === 88 || chain.id === 89) {
return {
maxPriorityFeePerGas: gasPrice || 0n,
maxFeePerGas: gasPrice || 0n,
};
}

Check warning on line 150 in packages/thirdweb/src/gas/fee-data.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/gas/fee-data.ts#L140-L150

Added lines #L140 - L150 were not covered by tests

return {
gasPrice: await getGasPrice({ chain, client, percentMultiplier: 10 }),
gasPrice,

Check warning on line 153 in packages/thirdweb/src/gas/fee-data.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L153 was not covered by tests
};
}
const feeData = await getDynamicFeeData(client, chain);
Expand Down
Loading