Skip to content

Commit

Permalink
Merge pull request #14 from bnb-chain/feat-upgrade-ledgerhq
Browse files Browse the repository at this point in the history
feat: upgrade ledgerhq version
  • Loading branch information
constwz authored Dec 15, 2023
2 parents ff2819b + 30f3e3b commit 66732ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/wallets/consts.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/wallets/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
Expand Down
18 changes: 9 additions & 9 deletions src/services/pairing/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 66732ef

Please sign in to comment.