diff --git a/libs/coin-modules/coin-evm/src/api/node/ledger.ts b/libs/coin-modules/coin-evm/src/api/node/ledger.ts index 835b6fda0f32..02598d249ff2 100644 --- a/libs/coin-modules/coin-evm/src/api/node/ledger.ts +++ b/libs/coin-modules/coin-evm/src/api/node/ledger.ts @@ -244,7 +244,7 @@ export const getFeeData: NodeApi["getFeeData"] = async (currency, transaction) = * cf. libs/coin-evm/src/createTransaction.ts:23 */ options: { - useEIP1559: transaction.type === 2, + useEIP1559: getEnv("EVM_FORCE_LEGACY_TRANSACTIONS") ? false : transaction.type === 2, overrideGasTracker: { type: "ledger", explorerId: node.explorerId }, }, }); diff --git a/libs/coin-modules/coin-evm/src/api/node/rpc.common.ts b/libs/coin-modules/coin-evm/src/api/node/rpc.common.ts index 15d5b51b36bf..9a3ce7b7c84e 100644 --- a/libs/coin-modules/coin-evm/src/api/node/rpc.common.ts +++ b/libs/coin-modules/coin-evm/src/api/node/rpc.common.ts @@ -2,6 +2,7 @@ import { ethers } from "ethers"; import BigNumber from "bignumber.js"; import { log } from "@ledgerhq/logs"; +import { getEnv } from "@ledgerhq/live-env"; import { delay } from "@ledgerhq/live-promise"; import { CryptoCurrency } from "@ledgerhq/types-cryptoassets"; import { makeLRUCache } from "@ledgerhq/live-network/cache"; @@ -151,7 +152,9 @@ export const getGasEstimation: NodeApi["getGasEstimation"] = (account, transacti export const getFeeData: NodeApi["getFeeData"] = currency => withApi(currency, async api => { const block = await api.getBlock("latest"); - const currencySupports1559 = Boolean(block.baseFeePerGas); + const currencySupports1559 = getEnv("EVM_FORCE_LEGACY_TRANSACTIONS") + ? false + : Boolean(block.baseFeePerGas); const feeData = await (async (): Promise< | { diff --git a/libs/env/src/env.ts b/libs/env/src/env.ts index 176d733c707b..e7df1199368f 100644 --- a/libs/env/src/env.ts +++ b/libs/env/src/env.ts @@ -828,6 +828,11 @@ const envDefinitions = { parser: floatParser, desc: "Replace transaction max priority fee factor for EIP1559 evm transaction. This value should be 1.1 minimum since this is the minimum increase required by most nodes", }, + EVM_FORCE_LEGACY_TRANSACTIONS: { + def: false, + parser: boolParser, + desc: "Force transaction type 0 on EVM networks", + }, ENABLE_NETWORK_LOGS: { def: false, parser: boolParser,