forked from Txio-labs/txio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
113 lines (106 loc) · 2.45 KB
/
Copy pathconfig.ts
File metadata and controls
113 lines (106 loc) · 2.45 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import {
coinbaseWallet,
metaMask,
walletConnect
} from 'wagmi/connectors';
import {
createConfig,
http
} from 'wagmi';
import {
arbitrum,
arbitrumSepolia,
avalanche,
avalancheFuji,
base,
baseSepolia,
bsc,
bscTestnet,
mainnet,
optimism,
optimismSepolia,
polygon,
polygonAmoy,
sepolia,
zora
} from 'wagmi/chains';
export const EVM_CHAINS = [
mainnet,
base,
polygon,
arbitrum,
optimism,
avalanche,
bsc,
zora,
sepolia,
baseSepolia,
polygonAmoy,
arbitrumSepolia,
optimismSepolia,
avalancheFuji,
bscTestnet
] as const;
const walletConnectProjectId =
process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID;
export const isWalletConnectConfigured =
Boolean(walletConnectProjectId);
export const EVM_CONNECTOR_IDS = {
metamask: 'metaMaskSDK',
walletconnect: 'walletConnect',
'coinbase-wallet': 'coinbaseWalletSDK',
phantom: 'app.phantom',
'trust-wallet': 'com.trustwallet.app',
rainbow: 'me.rainbow',
'okx-wallet': 'com.okex.wallet',
'brave-wallet': 'com.brave.wallet'
} as const;
const connectors = [
metaMask(),
coinbaseWallet({
appName: 'txio'
}),
...(walletConnectProjectId
? [
walletConnect({
projectId:
walletConnectProjectId,
showQrModal: true,
metadata: {
name: 'txio',
description:
'Multi-chain wallet session for txio workspace.',
url:
'https://txio.dev',
icons: []
}
})
]
: [])
] as const;
export const wagmiConfig = createConfig({
chains: EVM_CHAINS,
connectors,
ssr: true,
multiInjectedProviderDiscovery: true,
syncConnectedChain: true,
transports: {
[mainnet.id]: http(),
[base.id]: http(),
[polygon.id]: http(),
[arbitrum.id]: http(),
[optimism.id]: http(),
[avalanche.id]: http(),
[bsc.id]: http(),
[zora.id]: http(),
[sepolia.id]: http(),
[baseSepolia.id]: http(),
[polygonAmoy.id]: http(),
[arbitrumSepolia.id]: http(),
[optimismSepolia.id]: http(),
[avalancheFuji.id]: http(),
[bscTestnet.id]: http()
}
});
export const DEFAULT_EVM_CHAIN_ID =
mainnet.id;