Skip to content

Commit

Permalink
fix:switch wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
constwz committed Oct 26, 2023
1 parent d43780f commit 8611945
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/common/TokenIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import css from './styles.module.css'
const FALLBACK_ICON = '/images/common/token-placeholder.svg'

const CUSTOM_LOGO_MAP: Record<string, string> = {
BNB: `https://www.bnbchainlist.org/static/images/rsz_bnb.svg`,
TCBNB: `https://www.bnbchainlist.org/static/images/rsz_bnb.svg`,
BNB: `https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png`,
TCBNB: `https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png`,
BTC: `https://raw.githubusercontent.com/bnb-chain/opbnb-bridge-tokens/main/data/BTCB/logo.svg`,
BTCB: `https://raw.githubusercontent.com/bnb-chain/opbnb-bridge-tokens/main/data/BTCB/logo.svg`,
USDT: `https://raw.githubusercontent.com/bnb-chain/opbnb-bridge-tokens/main/data/USDT/logo.svg`,
Expand Down
2 changes: 0 additions & 2 deletions src/hooks/wallets/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export const enum WALLET_KEYS {
INJECTED = 'INJECTED',
WALLETCONNECT_V2 = 'WALLETCONNECT_V2',
COINBASE = 'COINBASE',
PAIRING = 'PAIRING',
LEDGER = 'LEDGER',
TREZOR = 'TREZOR',
KEYSTONE = 'KEYSTONE',
Expand All @@ -12,7 +11,6 @@ export const CGW_NAMES: { [key in WALLET_KEYS]: string | undefined } = {
[WALLET_KEYS.INJECTED]: 'detectedwallet',
[WALLET_KEYS.WALLETCONNECT_V2]: 'walletConnect_v2',
[WALLET_KEYS.COINBASE]: 'coinbase',
[WALLET_KEYS.PAIRING]: 'safeMobile',
[WALLET_KEYS.LEDGER]: 'ledger',
[WALLET_KEYS.TREZOR]: 'trezor',
[WALLET_KEYS.KEYSTONE]: 'keystone',
Expand Down
2 changes: 0 additions & 2 deletions src/hooks/wallets/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import ledgerModule from '@web3-onboard/ledger/dist/index'
import trezorModule from '@web3-onboard/trezor'
import walletConnect from '@web3-onboard/walletconnect'

import pairingModule from '@/services/pairing/module'
import e2eWalletModule from '@/tests/e2e-wallet'
import { CGW_NAMES, WALLET_KEYS } from './consts'

Expand Down Expand Up @@ -41,7 +40,6 @@ const WALLET_MODULES: { [key in WALLET_KEYS]: (chain: ChainInfo) => WalletInit }
[WALLET_KEYS.INJECTED]: () => injectedWalletModule(),
[WALLET_KEYS.WALLETCONNECT_V2]: (chain) => walletConnectV2(chain),
[WALLET_KEYS.COINBASE]: () => coinbaseModule({ darkMode: prefersDarkMode() }),
[WALLET_KEYS.PAIRING]: () => pairingModule(),
[WALLET_KEYS.LEDGER]: () => ledgerModule(),
[WALLET_KEYS.TREZOR]: () => trezorModule({ appUrl: TREZOR_APP_URL, email: TREZOR_EMAIL }),
[WALLET_KEYS.KEYSTONE]: () => keystoneModule(),
Expand Down
3 changes: 1 addition & 2 deletions src/services/pairing/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { addDays, isAfter } from 'date-fns'
import type { IWalletConnectSession } from '@walletconnect/types'
import type WalletConnect from '@walletconnect/client'

import { CGW_NAMES, WALLET_KEYS } from '@/hooks/wallets/consts'
import local from '@/services/local-storage/local'
import { PAIRING_MODULE_STORAGE_ID } from '@/services/pairing/connector'

Expand Down Expand Up @@ -30,7 +29,7 @@ export const killPairingSession = (connector: InstanceType<typeof WalletConnect>
}

export const isPairingSupported = (disabledWallets?: string[]) => {
return disabledWallets && !disabledWallets.includes(CGW_NAMES[WALLET_KEYS.PAIRING] as string)
return false
}

export const _isPairingSessionExpired = (session: IWalletConnectSession): boolean => {
Expand Down

0 comments on commit 8611945

Please sign in to comment.