diff --git a/patches/@web3-onboard+ledger+2.3.2.patch b/patches/@web3-onboard+ledger+2.3.2.patch index 509b671e8..989f297de 100644 --- a/patches/@web3-onboard+ledger+2.3.2.patch +++ b/patches/@web3-onboard+ledger+2.3.2.patch @@ -1,23 +1,27 @@ diff --git a/node_modules/@web3-onboard/ledger/dist/index.js b/node_modules/@web3-onboard/ledger/dist/index.js -index 12bf9df..64071cf 100644 +index 12bf9df..2e183ec 100644 --- a/node_modules/@web3-onboard/ledger/dist/index.js +++ b/node_modules/@web3-onboard/ledger/dist/index.js -@@ -1,7 +1,11 @@ +@@ -1,7 +1,14 @@ // these cannot be dynamically imported import { TypedDataUtils } from '@metamask/eth-sig-util'; +import { stripHexPrefix, keccak } from 'ethereumjs-util' + const LEDGER_LIVE_PATH = `m/44'/60'`; 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 = `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 +14,44 @@ const DEFAULT_BASE_PATHS = [ +@@ -10,16 +17,52 @@ const DEFAULT_BASE_PATHS = [ { label: 'Ledger Legacy', value: LEDGER_DEFAULT_PATH +- } + }, + { + label: 'Rootstock Path', @@ -26,7 +30,15 @@ index 12bf9df..64071cf 100644 + { + label: 'Rootstock Testnet Path', + value: ROOTSTOCK_TEST - } ++ }, ++ { ++ label: 'RSK Legacy', ++ value: ROOTSTOCK_LEGACY ++ }, ++ { ++ label: 'RSK Test Legacy', ++ value: ROOTSTOCK_TEST_LEGACY ++ }, ]; const assets = [ { @@ -60,7 +72,7 @@ index 12bf9df..64071cf 100644 /** * Returns the correct ledger transport based on browser compatibility for webUSB. * @returns -@@ -31,7 +63,9 @@ const getAccount = async (derivationPath, asset, index, provider, eth) => { +@@ -31,7 +74,9 @@ const getAccount = async (derivationPath, asset, index, provider, eth) => { const dPath = derivationPath === LEDGER_LIVE_PATH ? `${derivationPath}/${index}'/0/0` : `${derivationPath}/${index}`; @@ -71,14 +83,20 @@ index 12bf9df..64071cf 100644 return { derivationPath: dPath, address, -@@ -95,7 +129,9 @@ function ledger({ customNetwork, filter } = {}) { +@@ -95,8 +140,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 && - derivationPath !== LEDGER_DEFAULT_PATH) { +- const { address } = await eth.getAddress(derivationPath); + derivationPath !== LEDGER_DEFAULT_PATH && + derivationPath !== ROOTSTOCK && -+ derivationPath !== ROOTSTOCK_TEST) { - const { address } = await eth.getAddress(derivationPath); ++ derivationPath !== ROOTSTOCK_TEST && ++ derivationPath !== ROOTSTOCK_LEGACY && ++ derivationPath !== ROOTSTOCK_TEST_LEGACY ++ ) { ++ let { address } = await eth.getAddress(derivationPath); ++ address = toChecksumAddress(address); return [ { + derivationPath,