From 10a1c7c02499ea6e8b2bc5ba64c62aab6343928e Mon Sep 17 00:00:00 2001 From: nischit Date: Thu, 17 Jul 2025 15:36:50 +0545 Subject: [PATCH 1/6] fix gasPrice for legacy chain 88/89 --- packages/thirdweb/src/wallets/smart/lib/userop.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/thirdweb/src/wallets/smart/lib/userop.ts b/packages/thirdweb/src/wallets/smart/lib/userop.ts index a0c3dbc6a87..16ba324d87f 100644 --- a/packages/thirdweb/src/wallets/smart/lib/userop.ts +++ b/packages/thirdweb/src/wallets/smart/lib/userop.ts @@ -269,6 +269,11 @@ async function getGasFees(args: { maxPriorityFeePerGas = resolvedMaxPriorityFeePerGas ?? feeData.maxPriorityFeePerGas ?? 0n; maxFeePerGas = resolvedMaxFeePerGas ?? feeData.maxFeePerGas ?? 0n; + + if(chain.id === 88 || chain.id === 89) { + maxPriorityFeePerGas = maxPriorityFeePerGas ?? feeData.gasPrice ?? 0n + maxFeePerGas = maxFeePerGas ?? feeData.gasPrice ?? 0n + } } } return { maxFeePerGas, maxPriorityFeePerGas }; From 2e19c16b1c0603367c1f121d83b22afc6dd0568d Mon Sep 17 00:00:00 2001 From: nischit Date: Thu, 17 Jul 2025 15:52:25 +0545 Subject: [PATCH 2/6] minor change --- packages/thirdweb/src/wallets/smart/lib/userop.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/thirdweb/src/wallets/smart/lib/userop.ts b/packages/thirdweb/src/wallets/smart/lib/userop.ts index 16ba324d87f..dbe749476f3 100644 --- a/packages/thirdweb/src/wallets/smart/lib/userop.ts +++ b/packages/thirdweb/src/wallets/smart/lib/userop.ts @@ -271,8 +271,8 @@ async function getGasFees(args: { maxFeePerGas = resolvedMaxFeePerGas ?? feeData.maxFeePerGas ?? 0n; if(chain.id === 88 || chain.id === 89) { - maxPriorityFeePerGas = maxPriorityFeePerGas ?? feeData.gasPrice ?? 0n - maxFeePerGas = maxFeePerGas ?? feeData.gasPrice ?? 0n + maxPriorityFeePerGas = maxPriorityFeePerGas || feeData.gasPrice || 0n + maxFeePerGas = maxFeePerGas || feeData.gasPrice || 0n } } } From 26b6a67d101446782b599e807884114075f13b99 Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Thu, 17 Jul 2025 13:41:38 -0700 Subject: [PATCH 3/6] lint --- packages/thirdweb/src/wallets/smart/lib/userop.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/thirdweb/src/wallets/smart/lib/userop.ts b/packages/thirdweb/src/wallets/smart/lib/userop.ts index dbe749476f3..c99aa7185a2 100644 --- a/packages/thirdweb/src/wallets/smart/lib/userop.ts +++ b/packages/thirdweb/src/wallets/smart/lib/userop.ts @@ -270,9 +270,9 @@ async function getGasFees(args: { resolvedMaxPriorityFeePerGas ?? feeData.maxPriorityFeePerGas ?? 0n; maxFeePerGas = resolvedMaxFeePerGas ?? feeData.maxFeePerGas ?? 0n; - if(chain.id === 88 || chain.id === 89) { - maxPriorityFeePerGas = maxPriorityFeePerGas || feeData.gasPrice || 0n - maxFeePerGas = maxFeePerGas || feeData.gasPrice || 0n + if (chain.id === 88 || chain.id === 89) { + maxPriorityFeePerGas = maxPriorityFeePerGas || feeData.gasPrice || 0n; + maxFeePerGas = maxFeePerGas || feeData.gasPrice || 0n; } } } From bcab0b472491857a1a5bc2ac84d03a7d09892b98 Mon Sep 17 00:00:00 2001 From: nischit Date: Fri, 18 Jul 2025 13:33:32 +0545 Subject: [PATCH 4/6] moved 89/88 override to defaultGasOverride --- packages/thirdweb/src/gas/fee-data.ts | 12 +++++++++++- packages/thirdweb/src/wallets/smart/lib/userop.ts | 5 ----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/thirdweb/src/gas/fee-data.ts b/packages/thirdweb/src/gas/fee-data.ts index 16ab15862bd..02baa2d5e4d 100644 --- a/packages/thirdweb/src/gas/fee-data.ts +++ b/packages/thirdweb/src/gas/fee-data.ts @@ -47,6 +47,8 @@ const FORCE_GAS_PRICE_CHAIN_IDS = [ 2020, // Ronin Mainnet 2021, // Ronin Testnet (Saigon) 98866, // Plume mainnet + 89, // Viction Testnet + 88, // Viction Mainnet ]; /** @@ -135,8 +137,16 @@ export async function getDefaultGasOverrides( 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 + } + } + return { - gasPrice: await getGasPrice({ chain, client, percentMultiplier: 10 }), + gasPrice, }; } const feeData = await getDynamicFeeData(client, chain); diff --git a/packages/thirdweb/src/wallets/smart/lib/userop.ts b/packages/thirdweb/src/wallets/smart/lib/userop.ts index dbe749476f3..a0c3dbc6a87 100644 --- a/packages/thirdweb/src/wallets/smart/lib/userop.ts +++ b/packages/thirdweb/src/wallets/smart/lib/userop.ts @@ -269,11 +269,6 @@ async function getGasFees(args: { maxPriorityFeePerGas = resolvedMaxPriorityFeePerGas ?? feeData.maxPriorityFeePerGas ?? 0n; maxFeePerGas = resolvedMaxFeePerGas ?? feeData.maxFeePerGas ?? 0n; - - if(chain.id === 88 || chain.id === 89) { - maxPriorityFeePerGas = maxPriorityFeePerGas || feeData.gasPrice || 0n - maxFeePerGas = maxFeePerGas || feeData.gasPrice || 0n - } } } return { maxFeePerGas, maxPriorityFeePerGas }; From 497deab8cfca50a0bad1b61d942ef97c61c6ab02 Mon Sep 17 00:00:00 2001 From: nischit Date: Fri, 18 Jul 2025 13:48:23 +0545 Subject: [PATCH 5/6] lint fix --- packages/thirdweb/src/gas/fee-data.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/thirdweb/src/gas/fee-data.ts b/packages/thirdweb/src/gas/fee-data.ts index 02baa2d5e4d..8a8dc677391 100644 --- a/packages/thirdweb/src/gas/fee-data.ts +++ b/packages/thirdweb/src/gas/fee-data.ts @@ -137,12 +137,16 @@ export async function getDefaultGasOverrides( 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) { + const gasPrice = await getGasPrice({ + chain, + client, + percentMultiplier: 10, + }) + if (chain.id === 88 || chain.id === 89) { return { maxPriorityFeePerGas: gasPrice || 0n, - maxFeePerGas: gasPrice || 0n - } + maxFeePerGas: gasPrice || 0n, + }; } return { From 341b427154785581cb0d2577a33549ace2d31864 Mon Sep 17 00:00:00 2001 From: nischit Date: Fri, 18 Jul 2025 13:52:01 +0545 Subject: [PATCH 6/6] lint --- packages/thirdweb/src/gas/fee-data.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/thirdweb/src/gas/fee-data.ts b/packages/thirdweb/src/gas/fee-data.ts index 8a8dc677391..1baa5572501 100644 --- a/packages/thirdweb/src/gas/fee-data.ts +++ b/packages/thirdweb/src/gas/fee-data.ts @@ -137,11 +137,11 @@ export async function getDefaultGasOverrides( resolvedFeeType === "legacy" || FORCE_GAS_PRICE_CHAIN_IDS.includes(chain.id) ) { - const gasPrice = await getGasPrice({ - chain, - client, + const gasPrice = await getGasPrice({ + chain, + client, percentMultiplier: 10, - }) + }); if (chain.id === 88 || chain.id === 89) { return { maxPriorityFeePerGas: gasPrice || 0n,