-
Notifications
You must be signed in to change notification settings - Fork 0
/
connectors.ts
69 lines (55 loc) · 2.4 KB
/
connectors.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { InjectedConnector } from '@web3-react/injected-connector'
import { NetworkConnector } from '@web3-react/network-connector'
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
import { WalletLinkConnector } from '@web3-react/walletlink-connector'
import { LedgerConnector } from '@web3-react/ledger-connector'
import { TrezorConnector } from '@web3-react/trezor-connector'
import { LatticeConnector } from '@web3-react/lattice-connector'
import { FrameConnector } from '@web3-react/frame-connector'
import { AuthereumConnector } from '@web3-react/authereum-connector'
import { FortmaticConnector } from '@web3-react/fortmatic-connector'
import { MagicConnector } from '@web3-react/magic-connector'
import { PortisConnector } from '@web3-react/portis-connector'
import { TorusConnector } from '@web3-react/torus-connector'
const POLLING_INTERVAL = 12000
const RPC_URLS: { [chainId: number]: string } = {
1: process.env.RPC_URL_1 as string,
4: process.env.RPC_URL_4 as string
}
export const injected = new InjectedConnector({ supportedChainIds: [1, 3, 4, 5, 42] })
export const network = new NetworkConnector({
urls: { 1: RPC_URLS[1], 4: RPC_URLS[4] },
defaultChainId: 1
})
export const walletconnect = new WalletConnectConnector({
rpc: { 1: RPC_URLS[1] },
qrcode: true
})
export const walletlink = new WalletLinkConnector({
url: RPC_URLS[1],
appName: 'web3-react example',
supportedChainIds: [1, 3, 4, 5, 42, 10, 137, 69, 420, 80001]
})
export const ledger = new LedgerConnector({ chainId: 1, url: RPC_URLS[1], pollingInterval: POLLING_INTERVAL })
export const trezor = new TrezorConnector({
chainId: 1,
url: RPC_URLS[1],
pollingInterval: POLLING_INTERVAL,
manifestEmail: 'dummy@abc.xyz',
manifestAppUrl: 'http://localhost:1234'
})
export const lattice = new LatticeConnector({
chainId: 4,
appName: 'web3-react',
url: RPC_URLS[4]
})
export const frame = new FrameConnector({ supportedChainIds: [1] })
export const authereum = new AuthereumConnector({ chainId: 42 })
export const fortmatic = new FortmaticConnector({ apiKey: process.env.FORTMATIC_API_KEY as string, chainId: 4 })
export const magic = new MagicConnector({
apiKey: process.env.MAGIC_API_KEY as string,
chainId: 4,
email: 'hello@example.org'
})
export const portis = new PortisConnector({ dAppId: process.env.PORTIS_DAPP_ID as string, networks: [1, 100] })
export const torus = new TorusConnector({ chainId: 1 })