forked from Uniswap/web3-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.ts
17 lines (16 loc) · 855 Bytes
/
utils.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { CoinbaseWallet } from '@web3-react/coinbase-wallet'
import { GnosisSafe } from '@web3-react/gnosis-safe'
import { MetaMask } from '@web3-react/metamask'
import { Network } from '@web3-react/network'
import type { Connector } from '@web3-react/types'
import { WalletConnect as WalletConnect } from '@web3-react/walletconnect'
import { WalletConnect as WalletConnectV2 } from '@web3-react/walletconnect-v2'
export function getName(connector: Connector) {
if (connector instanceof MetaMask) return 'MetaMask'
if (connector instanceof WalletConnectV2) return 'WalletConnect V2'
if (connector instanceof WalletConnect) return 'WalletConnect'
if (connector instanceof CoinbaseWallet) return 'Coinbase Wallet'
if (connector instanceof Network) return 'Network'
if (connector instanceof GnosisSafe) return 'Gnosis Safe'
return 'Unknown'
}