From 30f3e3be5babbaf4609e8a8296fac12b34caca3a Mon Sep 17 00:00:00 2001 From: constwz Date: Fri, 15 Dec 2023 14:47:24 +0800 Subject: [PATCH] feat: upgrade ledgerhq version --- package.json | 3 ++- src/hooks/wallets/consts.ts | 4 ++-- src/hooks/wallets/wallets.ts | 2 +- src/services/pairing/hooks.ts | 18 +++++++++--------- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 0cae7e9755..4580f33eda 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "node": ">=16" }, "resolutions": { - "@web3-onboard/trezor/**/protobufjs": "^7.2.4" + "@web3-onboard/trezor/**/protobufjs": "^7.2.4", + "**/**/@ledgerhq/connect-kit-loader": "1.1.8" }, "dependencies": { "@date-io/date-fns": "^2.15.0", diff --git a/src/hooks/wallets/consts.ts b/src/hooks/wallets/consts.ts index 9b0bb6b8b2..ee485d9d05 100644 --- a/src/hooks/wallets/consts.ts +++ b/src/hooks/wallets/consts.ts @@ -1,6 +1,6 @@ export const enum WALLET_KEYS { INJECTED = 'INJECTED', - WALLETCONNECT_V2 = 'WALLETCONNECT_V2', + //WALLETCONNECT_V2 = 'WALLETCONNECT_V2', COINBASE = 'COINBASE', LEDGER = 'LEDGER', TREZOR = 'TREZOR', @@ -9,7 +9,7 @@ export const enum WALLET_KEYS { export const CGW_NAMES: { [key in WALLET_KEYS]: string | undefined } = { [WALLET_KEYS.INJECTED]: 'detectedwallet', - [WALLET_KEYS.WALLETCONNECT_V2]: 'walletConnect_v2', + //[WALLET_KEYS.WALLETCONNECT_V2]: 'walletConnect_v2', [WALLET_KEYS.COINBASE]: 'coinbase', [WALLET_KEYS.LEDGER]: 'ledger', [WALLET_KEYS.TREZOR]: 'trezor', diff --git a/src/hooks/wallets/wallets.ts b/src/hooks/wallets/wallets.ts index 57fb7d9d6f..82d13bc4b6 100644 --- a/src/hooks/wallets/wallets.ts +++ b/src/hooks/wallets/wallets.ts @@ -38,7 +38,7 @@ const walletConnectV2 = (chain: ChainInfo): WalletInit => { const WALLET_MODULES: { [key in WALLET_KEYS]: (chain: ChainInfo) => WalletInit } = { [WALLET_KEYS.INJECTED]: () => injectedWalletModule(), - [WALLET_KEYS.WALLETCONNECT_V2]: (chain) => walletConnectV2(chain), + //[WALLET_KEYS.WALLETCONNECT_V2]: (chain) => walletConnectV2(chain), [WALLET_KEYS.COINBASE]: () => coinbaseModule({ darkMode: prefersDarkMode() }), [WALLET_KEYS.LEDGER]: () => ledgerModule(), [WALLET_KEYS.TREZOR]: () => trezorModule({ appUrl: TREZOR_APP_URL, email: TREZOR_EMAIL }), diff --git a/src/services/pairing/hooks.ts b/src/services/pairing/hooks.ts index 07292eb0f8..3ef713b3e0 100644 --- a/src/services/pairing/hooks.ts +++ b/src/services/pairing/hooks.ts @@ -38,15 +38,15 @@ export const useInitPairing = () => { const canConnect = !connector?.connected && !isConnecting const isSupported = isPairingSupported(chain?.disabledWallets) - useEffect(() => { - const _pairingConnector = new WalletConnect({ - bridge: WC_BRIDGE, - storageId: local.getPrefixedKey(PAIRING_MODULE_STORAGE_ID), - clientMeta: getClientMeta(), - }) - - setPairingConnector(_pairingConnector) - }, []) + //useEffect(() => { + // const _pairingConnector = new WalletConnect({ + // bridge: WC_BRIDGE, + // storageId: local.getPrefixedKey(PAIRING_MODULE_STORAGE_ID), + // clientMeta: getClientMeta(), + // }) + + //setPairingConnector(_pairingConnector) + //}, []) const createSession = useCallback(() => { if (!canConnect || !chain || !isSupported || !onboard) {