diff --git a/patches/@web3-onboard+ledger+2.3.2.patch b/patches/@web3-onboard+ledger+2.3.2.patch index 989f297de..c694c3877 100644 --- a/patches/@web3-onboard+ledger+2.3.2.patch +++ b/patches/@web3-onboard+ledger+2.3.2.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/@web3-onboard/ledger/dist/index.js b/node_modules/@web3-onboard/ledger/dist/index.js -index 12bf9df..2e183ec 100644 +index 12bf9df..01fb4f1 100644 --- a/node_modules/@web3-onboard/ledger/dist/index.js +++ b/node_modules/@web3-onboard/ledger/dist/index.js -@@ -1,7 +1,14 @@ +@@ -1,7 +1,12 @@ // these cannot be dynamically imported import { TypedDataUtils } from '@metamask/eth-sig-util'; +import { stripHexPrefix, keccak } from 'ethereumjs-util' @@ -11,13 +11,11 @@ index 12bf9df..2e183ec 100644 const LEDGER_DEFAULT_PATH = `m/44'/60'/0'`; +const ROOTSTOCK = `m/44'/137'/0'/0`; +const ROOTSTOCK_TEST = `m/44'/37310'/0'/0`; -+const ROOTSTOCK_LEGACY = `m/44'/137'/0'/0'`; -+const ROOTSTOCK_TEST_LEGACY = `m/44'/37310'/0'/0'`; + const DEFAULT_BASE_PATHS = [ { label: 'Ledger Live', -@@ -10,16 +17,52 @@ const DEFAULT_BASE_PATHS = [ +@@ -10,16 +15,44 @@ const DEFAULT_BASE_PATHS = [ { label: 'Ledger Legacy', value: LEDGER_DEFAULT_PATH @@ -30,14 +28,6 @@ index 12bf9df..2e183ec 100644 + { + label: 'Rootstock Testnet Path', + value: ROOTSTOCK_TEST -+ }, -+ { -+ label: 'RSK Legacy', -+ value: ROOTSTOCK_LEGACY -+ }, -+ { -+ label: 'RSK Test Legacy', -+ value: ROOTSTOCK_TEST_LEGACY + }, ]; const assets = [ @@ -72,7 +62,7 @@ index 12bf9df..2e183ec 100644 /** * Returns the correct ledger transport based on browser compatibility for webUSB. * @returns -@@ -31,7 +74,9 @@ const getAccount = async (derivationPath, asset, index, provider, eth) => { +@@ -31,7 +64,9 @@ const getAccount = async (derivationPath, asset, index, provider, eth) => { const dPath = derivationPath === LEDGER_LIVE_PATH ? `${derivationPath}/${index}'/0/0` : `${derivationPath}/${index}`; @@ -83,7 +73,7 @@ index 12bf9df..2e183ec 100644 return { derivationPath: dPath, address, -@@ -95,8 +140,14 @@ function ledger({ customNetwork, filter } = {}) { +@@ -95,8 +130,14 @@ function ledger({ customNetwork, filter } = {}) { // Checks to see if this is a custom derivation path // If it is then just return the single account if (derivationPath !== LEDGER_LIVE_PATH && @@ -91,12 +81,12 @@ index 12bf9df..2e183ec 100644 - const { address } = await eth.getAddress(derivationPath); + derivationPath !== LEDGER_DEFAULT_PATH && + derivationPath !== ROOTSTOCK && -+ derivationPath !== ROOTSTOCK_TEST && -+ derivationPath !== ROOTSTOCK_LEGACY && -+ derivationPath !== ROOTSTOCK_TEST_LEGACY ++ derivationPath !== ROOTSTOCK_TEST + ) { + let { address } = await eth.getAddress(derivationPath); -+ address = toChecksumAddress(address); ++ if(derivationPath.includes("m/44'/137") || derivationPath.includes("m/44'/37310")){ ++ address = toChecksumAddress(address) ++ } return [ { derivationPath,