-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconnectors.ts
26 lines (21 loc) · 939 Bytes
/
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
import { InjectedConnector } from '@web3-react/injected-connector'
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
import { WalletLinkConnector } from '@web3-react/walletlink-connector'
import { FortmaticConnector } from '@web3-react/fortmatic-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 walletconnect = new WalletConnectConnector({
rpc: { 1: RPC_URLS[1] },
bridge: 'https://bridge.walletconnect.org',
qrcode: true,
pollingInterval: POLLING_INTERVAL
})
export const walletlink = new WalletLinkConnector({
url: RPC_URLS[1],
appName: 'web3-react example'
})
export const fortmatic = new FortmaticConnector({ apiKey: process.env.FORTMATIC_API_KEY as string, chainId: 4 })