@instadapp/avocado-base 0.0.0-dev.f24809a → 0.0.0-dev.f307ae7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm-publish-dev.yml +2 -5
- package/.vscode/settings.json +67 -0
- package/abi/avoFactoryProxy.json +1 -1
- package/abi/forwarder.json +1252 -148
- package/abi/multisigAgnosticForwarder.json +937 -0
- package/abi/multisigForwarder.json +697 -0
- package/app.vue +9 -2
- package/assets/images/icons/arrow-left.svg +5 -0
- package/assets/images/icons/arrow-right.svg +5 -0
- package/assets/images/icons/avocado.svg +4 -0
- package/assets/images/icons/bridge-2.svg +3 -0
- package/assets/images/icons/bridge.svg +7 -0
- package/assets/images/icons/calendar.svg +8 -0
- package/assets/images/icons/change-threshold.svg +4 -0
- package/assets/images/icons/check-circle.svg +4 -0
- package/assets/images/icons/check.svg +3 -0
- package/assets/images/icons/chevron-down.svg +4 -0
- package/assets/images/icons/clipboard.svg +7 -0
- package/assets/images/icons/clock-circle.svg +5 -0
- package/assets/images/icons/copy.svg +12 -0
- package/assets/images/icons/cross-transfer.svg +7 -0
- package/assets/images/icons/dapp.svg +4 -0
- package/assets/images/icons/deploy.svg +12 -0
- package/assets/images/icons/error-circle.svg +6 -0
- package/assets/images/icons/exclamation-circle.svg +13 -0
- package/assets/images/icons/exclamation-octagon.svg +13 -0
- package/assets/images/icons/exclamation-triangle.svg +5 -0
- package/assets/images/icons/external-link.svg +6 -0
- package/assets/images/icons/eye.svg +4 -0
- package/assets/images/icons/flowers.svg +8 -0
- package/assets/images/icons/gas-emoji.svg +193 -0
- package/assets/images/icons/gas.svg +14 -0
- package/assets/images/icons/gift.svg +153 -0
- package/assets/images/icons/globe.svg +110 -0
- package/assets/images/icons/hamburger.svg +6 -0
- package/assets/images/icons/hammer.svg +5 -0
- package/assets/images/icons/info-2.svg +12 -0
- package/assets/images/icons/instadapp-pro.svg +4 -0
- package/assets/images/icons/logout.svg +3 -0
- package/assets/images/icons/moon.svg +3 -0
- package/assets/images/icons/multi-send.svg +7 -0
- package/assets/images/icons/network.svg +13 -0
- package/assets/images/icons/options.svg +5 -0
- package/assets/images/icons/permit-sign.svg +11 -0
- package/assets/images/icons/plus-circle.svg +6 -0
- package/assets/images/icons/plus.svg +5 -0
- package/assets/images/icons/power-off-bg.svg +24 -0
- package/assets/images/icons/power-off.svg +19 -0
- package/assets/images/icons/power-on.svg +19 -0
- package/assets/images/icons/qr.svg +20 -0
- package/assets/images/icons/question-circle.svg +14 -0
- package/assets/images/icons/refresh.svg +6 -0
- package/assets/images/icons/reject-proposal.svg +6 -0
- package/assets/images/icons/search.svg +12 -0
- package/assets/images/icons/stars.svg +4 -0
- package/assets/images/icons/sun.svg +3 -0
- package/assets/images/icons/transfer.svg +5 -0
- package/assets/images/icons/trash-2.svg +8 -0
- package/assets/images/icons/upgrade.svg +4 -0
- package/assets/images/icons/wave.svg +214 -0
- package/assets/images/icons/x.svg +5 -0
- package/components/ActionLogo.vue +42 -0
- package/components/ActionMetadata.vue +88 -0
- package/components/Address.vue +74 -0
- package/components/AuthorityAvatar.vue +39 -0
- package/components/ChainLogo.vue +18 -563
- package/components/CopyClipboard.vue +42 -0
- package/components/metadata/Bridge.vue +58 -0
- package/components/metadata/CrossTransfer.vue +76 -0
- package/components/metadata/GasTopup.vue +38 -0
- package/components/metadata/Permit2.vue +41 -0
- package/components/metadata/Signers.vue +19 -0
- package/components/metadata/Swap.vue +66 -0
- package/components/metadata/Transfer.vue +49 -0
- package/components.d.ts +13 -0
- package/contracts/Forwarder.ts +856 -2
- package/contracts/MultisigAgnosticForwarder.ts +1423 -0
- package/contracts/MultisigForwarder.ts +859 -0
- package/contracts/factories/Forwarder__factory.ts +816 -16
- package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2135 -0
- package/contracts/factories/MultisigForwarder__factory.ts +721 -0
- package/contracts/factories/index.ts +2 -0
- package/contracts/index.ts +4 -0
- package/eslint.config.mjs +34 -0
- package/nuxt.config.ts +27 -2
- package/package.json +17 -12
- package/server/utils/index.ts +4 -4
- package/utils/avocado.ts +18 -16
- package/utils/bignumber.ts +60 -29
- package/utils/formatter.ts +63 -26
- package/utils/helper.ts +39 -28
- package/utils/metadata.ts +582 -251
- package/utils/network.ts +591 -173
- package/utils/services.ts +19 -0
- package/utils/utils.d.ts +147 -98
package/utils/network.ts
CHANGED
|
@@ -1,311 +1,729 @@
|
|
|
1
|
-
import { ethers } from
|
|
1
|
+
import { ethers } from 'ethers'
|
|
2
|
+
import { defineChain } from 'viem'
|
|
3
|
+
import {
|
|
4
|
+
arbitrum,
|
|
5
|
+
aurora,
|
|
6
|
+
avalanche,
|
|
7
|
+
base,
|
|
8
|
+
blast,
|
|
9
|
+
bsc,
|
|
10
|
+
fantom,
|
|
11
|
+
fuse,
|
|
12
|
+
gnosis,
|
|
13
|
+
linea,
|
|
14
|
+
mainnet,
|
|
15
|
+
mode,
|
|
16
|
+
opBNB,
|
|
17
|
+
optimism,
|
|
18
|
+
polygon,
|
|
19
|
+
polygonZkEvm,
|
|
20
|
+
scroll,
|
|
21
|
+
} from 'viem/chains'
|
|
22
|
+
import {
|
|
23
|
+
AVO_PROD_CHAIN_ID,
|
|
24
|
+
AVO_PROD_CHAIN_NAME,
|
|
25
|
+
AVO_PROD_EXPLORER_URL,
|
|
26
|
+
AVO_PROD_RPC_URL,
|
|
27
|
+
AVO_STAGING_CHAIN_ID,
|
|
28
|
+
AVO_STAGING_CHAIN_NAME,
|
|
29
|
+
AVO_STAGING_EXPLORER_URL,
|
|
30
|
+
AVO_STAGING_RPC_URL,
|
|
31
|
+
} from './avocado'
|
|
2
32
|
|
|
3
|
-
export const bridgeDisabledNetworks = [
|
|
33
|
+
export const bridgeDisabledNetworks = []
|
|
34
|
+
|
|
35
|
+
export const networksSimulationNotSupported = [1313161554, 1101]
|
|
36
|
+
|
|
37
|
+
const plasma = defineChain({
|
|
38
|
+
id: 9745,
|
|
39
|
+
name: 'Plasma',
|
|
40
|
+
nativeCurrency: {
|
|
41
|
+
name: 'Plasma',
|
|
42
|
+
symbol: 'XPL',
|
|
43
|
+
decimals: 18,
|
|
44
|
+
},
|
|
45
|
+
rpcUrls: {
|
|
46
|
+
default: {
|
|
47
|
+
http: ['https://rpc.plasma.to'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
blockExplorers: {
|
|
51
|
+
default: {
|
|
52
|
+
name: 'PlasmaScan',
|
|
53
|
+
url: 'https://plasmascan.to',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
contracts: {
|
|
57
|
+
multicall3: {
|
|
58
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const avocado = defineChain({
|
|
64
|
+
id: AVO_PROD_CHAIN_ID,
|
|
65
|
+
name: AVO_PROD_CHAIN_NAME,
|
|
66
|
+
nativeCurrency: {
|
|
67
|
+
name: 'Avocado',
|
|
68
|
+
symbol: 'USDC',
|
|
69
|
+
decimals: 18,
|
|
70
|
+
},
|
|
71
|
+
rpcUrls: {
|
|
72
|
+
default: { http: [AVO_PROD_RPC_URL] },
|
|
73
|
+
},
|
|
74
|
+
blockExplorers: {
|
|
75
|
+
default: { name: 'Avoscan', url: AVO_PROD_EXPLORER_URL },
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const avocadoStaging = defineChain({
|
|
80
|
+
id: AVO_STAGING_CHAIN_ID,
|
|
81
|
+
name: AVO_STAGING_CHAIN_NAME,
|
|
82
|
+
nativeCurrency: {
|
|
83
|
+
name: 'Avocado',
|
|
84
|
+
symbol: 'USDC',
|
|
85
|
+
decimals: 18,
|
|
86
|
+
},
|
|
87
|
+
rpcUrls: {
|
|
88
|
+
default: { http: [AVO_STAGING_RPC_URL] },
|
|
89
|
+
},
|
|
90
|
+
blockExplorers: {
|
|
91
|
+
default: { name: 'Avoscan', url: AVO_STAGING_EXPLORER_URL },
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
})
|
|
4
95
|
|
|
5
96
|
export const networks: Network[] = [
|
|
6
97
|
{
|
|
7
|
-
name:
|
|
8
|
-
debankName:
|
|
9
|
-
ankrName:
|
|
10
|
-
|
|
11
|
-
|
|
98
|
+
name: 'Polygon',
|
|
99
|
+
debankName: 'matic',
|
|
100
|
+
ankrName: 'polygon',
|
|
101
|
+
zerionName: 'polygon',
|
|
102
|
+
color: '#7A4ADD',
|
|
103
|
+
chainId: 137,
|
|
104
|
+
legacySupported: true,
|
|
105
|
+
viemChain: polygon,
|
|
106
|
+
balanceResolverAddress: '0x58632D23120b20650262b8A629a14e4F4043E0D9',
|
|
107
|
+
usdcAddress: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
|
|
108
|
+
explorerUrl: 'https://polygonscan.com',
|
|
109
|
+
apiURL: 'https://api.polygonscan.com/api',
|
|
110
|
+
fakeTransactionHash:
|
|
111
|
+
'0x906c551abd5873a428505b6530ac14d91367820706c7ee525f6d7313265d1c92',
|
|
12
112
|
get serverRpcUrl() {
|
|
13
|
-
return process.env?.
|
|
113
|
+
return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0]
|
|
14
114
|
},
|
|
15
|
-
balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
|
|
16
|
-
usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
17
115
|
params: {
|
|
18
|
-
|
|
116
|
+
chainName: 'Matic(Polygon) Mainnet',
|
|
19
117
|
nativeCurrency: {
|
|
20
|
-
name:
|
|
21
|
-
symbol:
|
|
118
|
+
name: 'POL (ex-MATIC)',
|
|
119
|
+
symbol: 'POL',
|
|
22
120
|
decimals: 18,
|
|
23
121
|
},
|
|
122
|
+
rpcUrls: ['https://polygon-rpc.com'],
|
|
24
123
|
},
|
|
25
124
|
},
|
|
26
125
|
{
|
|
27
|
-
name:
|
|
28
|
-
debankName:
|
|
29
|
-
ankrName:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
126
|
+
name: 'Arbitrum',
|
|
127
|
+
debankName: 'arb',
|
|
128
|
+
ankrName: 'arbitrum',
|
|
129
|
+
zerionName: 'arbitrum',
|
|
130
|
+
legacySupported: true,
|
|
131
|
+
viemChain: arbitrum,
|
|
132
|
+
color: '#2D374B',
|
|
133
|
+
chainId: 42161,
|
|
134
|
+
usdcAddress: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
|
|
135
|
+
balanceResolverAddress: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
|
|
136
|
+
fakeTransactionHash:
|
|
137
|
+
'0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843',
|
|
138
|
+
explorerUrl: 'https://arbiscan.io',
|
|
139
|
+
apiURL: 'https://api.arbiscan.io/api',
|
|
34
140
|
get serverRpcUrl() {
|
|
35
|
-
return process.env?.
|
|
141
|
+
return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0]
|
|
36
142
|
},
|
|
37
143
|
params: {
|
|
38
|
-
chainName:
|
|
144
|
+
chainName: 'Arbitrum One',
|
|
39
145
|
nativeCurrency: {
|
|
40
|
-
name:
|
|
41
|
-
symbol:
|
|
146
|
+
name: 'Ethereum',
|
|
147
|
+
symbol: 'ETH',
|
|
42
148
|
decimals: 18,
|
|
43
149
|
},
|
|
44
|
-
rpcUrls: [
|
|
150
|
+
rpcUrls: ['https://arb1.arbitrum.io/rpc'],
|
|
45
151
|
},
|
|
46
152
|
},
|
|
47
153
|
{
|
|
48
|
-
name:
|
|
49
|
-
debankName:
|
|
50
|
-
ankrName:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
explorerUrl:
|
|
154
|
+
name: 'Ethereum',
|
|
155
|
+
debankName: 'eth',
|
|
156
|
+
ankrName: 'eth',
|
|
157
|
+
zerionName: 'ethereum',
|
|
158
|
+
viemChain: mainnet,
|
|
159
|
+
chainId: 1,
|
|
160
|
+
explorerUrl: 'https://etherscan.io',
|
|
161
|
+
legacySupported: true,
|
|
162
|
+
fakeTransactionHash:
|
|
163
|
+
'0x13232dd32cef2f641ead890a507710c96560c8c9c3d5fab6facb5ec563c49433',
|
|
164
|
+
apiURL: 'https://api.etherscan.io/api',
|
|
165
|
+
color: '#5D5FEF',
|
|
166
|
+
get serverRpcUrl() {
|
|
167
|
+
return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0]
|
|
168
|
+
},
|
|
169
|
+
balanceResolverAddress: '0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43',
|
|
170
|
+
usdcAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
171
|
+
params: {
|
|
172
|
+
rpcUrls: ['https://rpc.ankr.com/eth'],
|
|
173
|
+
nativeCurrency: {
|
|
174
|
+
name: 'Ethereum',
|
|
175
|
+
symbol: 'ETH',
|
|
176
|
+
decimals: 18,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'Base',
|
|
182
|
+
chainId: 8453,
|
|
183
|
+
color: '#1E2024',
|
|
184
|
+
ankrName: 'base',
|
|
185
|
+
viemChain: base,
|
|
186
|
+
explorerUrl: 'https://basescan.org',
|
|
187
|
+
legacySupported: true,
|
|
188
|
+
fakeTransactionHash:
|
|
189
|
+
'0xf7833d80da33730c4fc5d4c64151f0eaa64c0c0535be022af0228a44cc4e9c8e',
|
|
190
|
+
apiURL: 'https://api.basescan.org/api',
|
|
55
191
|
get serverRpcUrl() {
|
|
56
|
-
return process.env?.
|
|
192
|
+
return process.env?.BASE_RPC_URL || this.params.rpcUrls[0]
|
|
57
193
|
},
|
|
194
|
+
usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
|
|
195
|
+
balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
|
|
58
196
|
params: {
|
|
59
|
-
|
|
197
|
+
rpcUrls: ['https://rpc.ankr.com/base'],
|
|
198
|
+
chainName: 'Base',
|
|
60
199
|
nativeCurrency: {
|
|
61
|
-
name:
|
|
62
|
-
symbol:
|
|
200
|
+
name: 'Ethereum',
|
|
201
|
+
symbol: 'ETH',
|
|
63
202
|
decimals: 18,
|
|
64
203
|
},
|
|
65
|
-
rpcUrls: ["https://arb1.arbitrum.io/rpc"],
|
|
66
204
|
},
|
|
67
205
|
},
|
|
68
206
|
{
|
|
69
|
-
name:
|
|
70
|
-
debankName:
|
|
71
|
-
ankrName:
|
|
207
|
+
name: 'Optimism',
|
|
208
|
+
debankName: 'op',
|
|
209
|
+
ankrName: 'optimism',
|
|
210
|
+
zerionName: 'optimism',
|
|
211
|
+
color: '#FF0420',
|
|
212
|
+
legacySupported: true,
|
|
213
|
+
viemChain: optimism,
|
|
72
214
|
chainId: 10,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
215
|
+
apiURL: 'https://api-optimistic.etherscan.io/api',
|
|
216
|
+
usdcAddress: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
|
|
217
|
+
balanceResolverAddress: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
|
|
218
|
+
fakeTransactionHash:
|
|
219
|
+
'0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc',
|
|
220
|
+
explorerUrl: 'https://optimistic.etherscan.io',
|
|
76
221
|
get serverRpcUrl() {
|
|
77
|
-
return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0]
|
|
222
|
+
return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0]
|
|
78
223
|
},
|
|
79
224
|
params: {
|
|
80
|
-
chainName:
|
|
225
|
+
chainName: 'Optimistic Ethereum',
|
|
81
226
|
nativeCurrency: {
|
|
82
|
-
name:
|
|
83
|
-
symbol:
|
|
227
|
+
name: 'Ethereum',
|
|
228
|
+
symbol: 'ETH',
|
|
84
229
|
decimals: 18,
|
|
85
230
|
},
|
|
86
|
-
rpcUrls: [
|
|
231
|
+
rpcUrls: ['https://rpc.ankr.com/optimism'],
|
|
87
232
|
},
|
|
88
233
|
},
|
|
89
234
|
{
|
|
90
|
-
name:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
explorerUrl:
|
|
235
|
+
name: 'Polygon zkEVM',
|
|
236
|
+
chainId: 1101,
|
|
237
|
+
color: '#8544f6',
|
|
238
|
+
ankrName: 'polygon_zkevm',
|
|
239
|
+
viemChain: polygonZkEvm,
|
|
240
|
+
legacySupported: true,
|
|
241
|
+
explorerUrl: 'https://zkevm.polygonscan.com',
|
|
242
|
+
apiURL: 'https://api-zkevm.polygonscan.com/api',
|
|
243
|
+
balanceResolverAddress: '0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01',
|
|
244
|
+
fakeTransactionHash:
|
|
245
|
+
'0x1077130463ade91ad4e9c43c3195298e26a99970975238128912490eea12bf41',
|
|
246
|
+
usdcAddress: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035',
|
|
97
247
|
get serverRpcUrl() {
|
|
98
|
-
return process.env?.
|
|
248
|
+
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0]
|
|
99
249
|
},
|
|
100
250
|
params: {
|
|
101
|
-
chainName:
|
|
251
|
+
chainName: 'polygon zkEVM',
|
|
252
|
+
rpcUrls: ['https://zkevm-rpc.com'],
|
|
102
253
|
nativeCurrency: {
|
|
103
|
-
name:
|
|
104
|
-
symbol:
|
|
254
|
+
name: 'Ethereum',
|
|
255
|
+
symbol: 'ETH',
|
|
105
256
|
decimals: 18,
|
|
106
257
|
},
|
|
107
|
-
rpcUrls: ["https://api.avax.network/ext/bc/C/rpc"],
|
|
108
258
|
},
|
|
109
259
|
},
|
|
110
260
|
{
|
|
111
|
-
name:
|
|
112
|
-
debankName:
|
|
113
|
-
ankrName:
|
|
261
|
+
name: 'BSC',
|
|
262
|
+
debankName: 'bsc',
|
|
263
|
+
ankrName: 'bsc',
|
|
264
|
+
zerionName: 'binance-smart-chain',
|
|
265
|
+
color: '#F3BA2F',
|
|
114
266
|
chainId: 56,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
267
|
+
legacySupported: true,
|
|
268
|
+
explorerUrl: 'https://bscscan.com',
|
|
269
|
+
viemChain: bsc,
|
|
270
|
+
fakeTransactionHash:
|
|
271
|
+
'0x897d54bf8e492f840bd4d8f1e743bfcab8226ab4d5a899e47ee433dcd6d6abf7',
|
|
272
|
+
apiURL: 'https://api.bscscan.com/api',
|
|
273
|
+
usdcAddress: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
|
|
274
|
+
balanceResolverAddress: '0xb808cff38706e267067b0af427726aa099f69f89',
|
|
118
275
|
get serverRpcUrl() {
|
|
119
|
-
return process.env?.BSC_RPC_URL || this.params.rpcUrls[0]
|
|
276
|
+
return process.env?.BSC_RPC_URL || this.params.rpcUrls[0]
|
|
120
277
|
},
|
|
121
278
|
params: {
|
|
122
|
-
chainName:
|
|
123
|
-
rpcUrls: [
|
|
279
|
+
chainName: 'Binance Smart Chain',
|
|
280
|
+
rpcUrls: ['https://rpc.ankr.com/bsc'],
|
|
124
281
|
nativeCurrency: {
|
|
125
|
-
name:
|
|
126
|
-
symbol:
|
|
282
|
+
name: 'Binance Coin',
|
|
283
|
+
symbol: 'BNB',
|
|
127
284
|
decimals: 18,
|
|
128
285
|
},
|
|
129
286
|
},
|
|
130
287
|
},
|
|
131
288
|
{
|
|
132
|
-
name:
|
|
133
|
-
debankName:
|
|
134
|
-
ankrName:
|
|
289
|
+
name: 'Avalanche',
|
|
290
|
+
debankName: 'avax',
|
|
291
|
+
ankrName: 'avalanche',
|
|
292
|
+
zerionName: 'avalanche',
|
|
293
|
+
color: '#EB5757',
|
|
294
|
+
viemChain: avalanche,
|
|
295
|
+
legacySupported: true,
|
|
296
|
+
chainId: 43114,
|
|
297
|
+
usdcAddress: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
|
|
298
|
+
balanceResolverAddress: '0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E',
|
|
299
|
+
explorerUrl: 'https://snowtrace.io',
|
|
300
|
+
fakeTransactionHash:
|
|
301
|
+
'0x233aac7402558dd4e23f938a50f983e67f5c9604233981c7ac74e63737b8294e',
|
|
302
|
+
apiURL: 'https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan/api',
|
|
303
|
+
get serverRpcUrl() {
|
|
304
|
+
return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0]
|
|
305
|
+
},
|
|
306
|
+
params: {
|
|
307
|
+
chainName: 'Avalanche Network',
|
|
308
|
+
nativeCurrency: {
|
|
309
|
+
name: 'Avalanche',
|
|
310
|
+
symbol: 'AVAX',
|
|
311
|
+
decimals: 18,
|
|
312
|
+
},
|
|
313
|
+
rpcUrls: ['https://rpc.ankr.com/avalanche'],
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: 'Fantom',
|
|
318
|
+
chainId: 250,
|
|
319
|
+
zerionName: 'fantom',
|
|
320
|
+
explorerUrl: 'https://ftmscan.com',
|
|
321
|
+
apiURL: 'https://api.ftmscan.com/api',
|
|
322
|
+
ankrName: 'fantom',
|
|
323
|
+
color: '#1969ff',
|
|
324
|
+
legacySupported: true,
|
|
325
|
+
viemChain: fantom,
|
|
326
|
+
get serverRpcUrl() {
|
|
327
|
+
return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0]
|
|
328
|
+
},
|
|
329
|
+
usdcAddress: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
|
|
330
|
+
balanceResolverAddress: '0x929376c77a2fb8152375a089a4fccf84ff481479',
|
|
331
|
+
fakeTransactionHash:
|
|
332
|
+
'0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4',
|
|
333
|
+
params: {
|
|
334
|
+
rpcUrls: ['https://rpc.ankr.com/fantom'],
|
|
335
|
+
chainName: 'Fantom',
|
|
336
|
+
nativeCurrency: {
|
|
337
|
+
name: 'Fantom',
|
|
338
|
+
symbol: 'FTM',
|
|
339
|
+
decimals: 18,
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'Gnosis',
|
|
345
|
+
debankName: 'xdai',
|
|
346
|
+
zerionName: 'xdai',
|
|
347
|
+
color: '#04795C',
|
|
348
|
+
ankrName: 'gnosis',
|
|
349
|
+
viemChain: gnosis,
|
|
350
|
+
legacySupported: true,
|
|
135
351
|
chainId: 100,
|
|
136
|
-
balanceResolverAddress:
|
|
137
|
-
explorerUrl:
|
|
138
|
-
|
|
352
|
+
balanceResolverAddress: '0xfaa244e276b1597f663975ed007ee4ff70d27849',
|
|
353
|
+
explorerUrl: 'https://gnosisscan.io',
|
|
354
|
+
fakeTransactionHash:
|
|
355
|
+
'0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b',
|
|
356
|
+
apiURL: 'https://api.gnosisscan.io/api',
|
|
357
|
+
usdcAddress: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83',
|
|
139
358
|
get serverRpcUrl() {
|
|
140
|
-
return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0]
|
|
359
|
+
return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0]
|
|
141
360
|
},
|
|
142
361
|
params: {
|
|
143
|
-
chainName:
|
|
144
|
-
rpcUrls: [
|
|
362
|
+
chainName: 'Gnosis Safe',
|
|
363
|
+
rpcUrls: ['https://rpc.ankr.com/gnosis'],
|
|
145
364
|
nativeCurrency: {
|
|
146
|
-
name:
|
|
147
|
-
symbol:
|
|
365
|
+
name: 'xdaistable',
|
|
366
|
+
symbol: 'xDAI',
|
|
148
367
|
decimals: 18,
|
|
149
368
|
},
|
|
150
369
|
},
|
|
151
370
|
},
|
|
152
371
|
{
|
|
153
|
-
name:
|
|
154
|
-
chainId:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
372
|
+
name: 'Aurora',
|
|
373
|
+
chainId: 1313161554,
|
|
374
|
+
zerionName: 'aurora',
|
|
375
|
+
color: '#78d64b',
|
|
376
|
+
viemChain: aurora,
|
|
377
|
+
legacySupported: true,
|
|
378
|
+
explorerUrl: 'https://explorer.mainnet.aurora.dev',
|
|
379
|
+
apiURL: 'https://explorer.mainnet.aurora.dev/api/v2',
|
|
380
|
+
fakeTransactionHash:
|
|
381
|
+
'0x0923401c5a80c39a5cd57c098a6c4729edbefd0db6894def7d349493f4ff3ec6',
|
|
158
382
|
get serverRpcUrl() {
|
|
159
|
-
return process.env?.
|
|
383
|
+
return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0]
|
|
160
384
|
},
|
|
385
|
+
usdcAddress: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
|
|
386
|
+
balanceResolverAddress: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
|
|
161
387
|
params: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
388
|
+
rpcUrls: ['https://mainnet.aurora.dev'],
|
|
389
|
+
chainName: 'Aurora',
|
|
165
390
|
nativeCurrency: {
|
|
166
|
-
name: "Ethereum",
|
|
167
|
-
symbol: "ETH",
|
|
168
391
|
decimals: 18,
|
|
392
|
+
name: 'Aurora ETH',
|
|
393
|
+
symbol: 'AETH',
|
|
169
394
|
},
|
|
170
395
|
},
|
|
171
396
|
},
|
|
172
|
-
// {
|
|
173
|
-
// name: "Aurora",
|
|
174
|
-
// chainId: 1313161554,
|
|
175
|
-
// explorerUrl: "https://explorer.mainnet.aurora.dev",
|
|
176
|
-
// get serverRpcUrl() {
|
|
177
|
-
// return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
|
|
178
|
-
// },
|
|
179
|
-
// usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
180
|
-
// balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
181
|
-
// params: {
|
|
182
|
-
// rpcUrls: ["https://mainnet.aurora.dev"],
|
|
183
|
-
// chainName: "Aurora",
|
|
184
|
-
// nativeCurrency: {
|
|
185
|
-
// decimals: 18,
|
|
186
|
-
// name: "Aurora ETH",
|
|
187
|
-
// symbol: "AETH",
|
|
188
|
-
// },
|
|
189
|
-
// },
|
|
190
|
-
// },
|
|
191
397
|
{
|
|
192
|
-
name:
|
|
193
|
-
chainId:
|
|
194
|
-
|
|
195
|
-
|
|
398
|
+
name: 'Fuse',
|
|
399
|
+
chainId: 122,
|
|
400
|
+
zerionName: 'fuse',
|
|
401
|
+
color: '#78d64b',
|
|
402
|
+
explorerUrl: 'https://explorer.fuse.io',
|
|
403
|
+
apiURL: 'https://explorer.fuse.io/api/v2',
|
|
404
|
+
viemChain: fuse,
|
|
405
|
+
legacySupported: false,
|
|
406
|
+
fakeTransactionHash:
|
|
407
|
+
'0xf22a8031de9b978a57c728e18c6b54633356c39db4d0466e53b9b7c3ee7f8def',
|
|
196
408
|
get serverRpcUrl() {
|
|
197
|
-
return process.env?.
|
|
409
|
+
return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0]
|
|
198
410
|
},
|
|
199
|
-
usdcAddress:
|
|
200
|
-
balanceResolverAddress:
|
|
411
|
+
usdcAddress: '',
|
|
412
|
+
balanceResolverAddress: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
|
|
201
413
|
params: {
|
|
202
|
-
rpcUrls: [
|
|
203
|
-
chainName:
|
|
414
|
+
rpcUrls: ['https://fuse-mainnet.chainstacklabs.com'],
|
|
415
|
+
chainName: 'Fuse',
|
|
204
416
|
nativeCurrency: {
|
|
205
|
-
name: "Fantom",
|
|
206
|
-
symbol: "FTM",
|
|
207
417
|
decimals: 18,
|
|
418
|
+
name: 'Fuse',
|
|
419
|
+
symbol: 'fuse',
|
|
208
420
|
},
|
|
209
421
|
},
|
|
210
422
|
},
|
|
423
|
+
{
|
|
424
|
+
name: 'Scroll',
|
|
425
|
+
chainId: 534352,
|
|
426
|
+
color: '#78d64b',
|
|
427
|
+
ankrName: 'scroll',
|
|
428
|
+
legacySupported: false,
|
|
429
|
+
explorerUrl: 'https://scrollscan.com',
|
|
430
|
+
apiURL: 'https://api.scrollscan.com/api',
|
|
431
|
+
viemChain: scroll,
|
|
432
|
+
fakeTransactionHash:
|
|
433
|
+
'0x6bf297c414264fc8cddd47224632b4426a02138df2f50fe891eca87f6aefea01',
|
|
434
|
+
get serverRpcUrl() {
|
|
435
|
+
return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0]
|
|
436
|
+
},
|
|
437
|
+
params: {
|
|
438
|
+
rpcUrls: ['https://rpc.scroll.io'],
|
|
439
|
+
chainName: 'Scroll',
|
|
440
|
+
nativeCurrency: {
|
|
441
|
+
name: 'Ethereum',
|
|
442
|
+
symbol: 'ETH',
|
|
443
|
+
decimals: 18,
|
|
444
|
+
},
|
|
445
|
+
},
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
name: 'opBNB',
|
|
449
|
+
chainId: 204,
|
|
450
|
+
color: '#78d64b',
|
|
451
|
+
explorerUrl: 'https://opbnbscan.com',
|
|
452
|
+
apiURL: null,
|
|
453
|
+
viemChain: opBNB,
|
|
454
|
+
legacySupported: false,
|
|
455
|
+
fakeTransactionHash:
|
|
456
|
+
'0xb9438a3eae61442bc7d419d79930370ce09ac0f46e0695025751e3bfe1a931e7',
|
|
457
|
+
get serverRpcUrl() {
|
|
458
|
+
return process.env?.OPBNB_RPC_URL || this.params.rpcUrls[0]
|
|
459
|
+
},
|
|
460
|
+
params: {
|
|
461
|
+
rpcUrls: ['https://opbnb-mainnet-rpc.bnbchain.org'],
|
|
462
|
+
chainName: 'opBNB',
|
|
463
|
+
nativeCurrency: {
|
|
464
|
+
name: 'BNB',
|
|
465
|
+
symbol: 'BNB',
|
|
466
|
+
decimals: 18,
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
chainId: 34443,
|
|
472
|
+
name: 'Mode',
|
|
473
|
+
color: '#d7ff00',
|
|
474
|
+
explorerUrl: 'https://explorer.mode.network',
|
|
475
|
+
legacySupported: false,
|
|
476
|
+
fakeTransactionHash: '0xb58002db3481f2c51855a91280ec940d0bebec075c4b362b9f90c21a2b14edbe',
|
|
477
|
+
apiURL: 'https://explorer.mode.network/api/v2',
|
|
478
|
+
params: {
|
|
479
|
+
rpcUrls: ['https://1rpc.io/mode'],
|
|
480
|
+
chainName: 'Mode',
|
|
481
|
+
nativeCurrency: {
|
|
482
|
+
name: 'Ethereum',
|
|
483
|
+
symbol: 'ETH',
|
|
484
|
+
decimals: 18,
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
get serverRpcUrl() {
|
|
488
|
+
return process.env?.MODE_RPC_URL || this.params.rpcUrls[0]
|
|
489
|
+
},
|
|
490
|
+
viemChain: mode,
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
chainId: 81457,
|
|
494
|
+
name: 'Blast',
|
|
495
|
+
color: '#78d64b',
|
|
496
|
+
explorerUrl: 'https://blastscan.io',
|
|
497
|
+
apiURL: 'https://api.blastscan.io/api',
|
|
498
|
+
legacySupported: false,
|
|
499
|
+
fakeTransactionHash: '0x934ed8516242f8c08bb9e0e90bb1f989d92ceb6b0333e86ac2d555f25ac27e58',
|
|
500
|
+
params: {
|
|
501
|
+
rpcUrls: ['https://rpc.ankr.com/blast'],
|
|
502
|
+
chainName: 'Blast',
|
|
503
|
+
nativeCurrency: {
|
|
504
|
+
name: 'Ethereum',
|
|
505
|
+
symbol: 'ETH',
|
|
506
|
+
decimals: 18,
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
get serverRpcUrl() {
|
|
510
|
+
return process.env?.BLAST_RPC_URL || this.params.rpcUrls[0]
|
|
511
|
+
},
|
|
512
|
+
viemChain: blast,
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
chainId: 59144,
|
|
516
|
+
name: 'Linea',
|
|
517
|
+
apiURL: 'https://api.lineascan.build/api',
|
|
518
|
+
color: '#78d64b',
|
|
519
|
+
explorerUrl: 'https://lineascan.build',
|
|
520
|
+
legacySupported: false,
|
|
521
|
+
params: {
|
|
522
|
+
rpcUrls: ['https://linea-mainnet.public.blastapi.io'],
|
|
523
|
+
chainName: 'Linea',
|
|
524
|
+
nativeCurrency: {
|
|
525
|
+
name: 'Linea Ether',
|
|
526
|
+
symbol: 'ETH',
|
|
527
|
+
decimals: 18,
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
fakeTransactionHash: '0x62d068a66eb1515a09e993200e8a495c7fead512689ba78e50523c8e83bbf5b5',
|
|
531
|
+
get serverRpcUrl() {
|
|
532
|
+
return process.env?.LINEA_RPC_URL || this.params.rpcUrls[0]
|
|
533
|
+
},
|
|
534
|
+
viemChain: linea,
|
|
535
|
+
ankrName: 'linea',
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
chainId: plasma.id,
|
|
539
|
+
name: plasma.name,
|
|
540
|
+
apiURL: null,
|
|
541
|
+
color: '#78d64b',
|
|
542
|
+
explorerUrl: plasma.blockExplorers.default.url,
|
|
543
|
+
fakeTransactionHash: '0x3523aad6a790c81ef57e1afd4320760b7cea6dd3424ccd582e00ffc9bdc316e6',
|
|
544
|
+
legacySupported: false,
|
|
545
|
+
get serverRpcUrl() {
|
|
546
|
+
return process.env?.PLASMA_RPC_URL || this.params.rpcUrls[0]
|
|
547
|
+
},
|
|
548
|
+
viemChain: plasma,
|
|
549
|
+
params: {
|
|
550
|
+
rpcUrls: plasma.rpcUrls.default.http,
|
|
551
|
+
chainName: plasma.name,
|
|
552
|
+
nativeCurrency: {
|
|
553
|
+
name: plasma.nativeCurrency.name,
|
|
554
|
+
symbol: plasma.nativeCurrency.symbol,
|
|
555
|
+
decimals: plasma.nativeCurrency.decimals,
|
|
556
|
+
},
|
|
557
|
+
},
|
|
558
|
+
|
|
559
|
+
},
|
|
560
|
+
// {
|
|
561
|
+
// name: sonic.name,
|
|
562
|
+
// chainId: sonic.id,
|
|
563
|
+
// explorerUrl: sonic.blockExplorers.default.url,
|
|
564
|
+
// legacySupported: false,
|
|
565
|
+
// viemChain: sonic,
|
|
566
|
+
// color: '#78d64b',
|
|
567
|
+
// apiURL: null,
|
|
568
|
+
// fakeTransactionHash: '0xc8fe01a980987295c36e898b4681fa8c937eb8dfd48a3ae080956b36a66195ee',
|
|
569
|
+
// get serverRpcUrl() {
|
|
570
|
+
// return process.env?.SONIC_RPC_URL || this.params.rpcUrls[0]
|
|
571
|
+
// },
|
|
572
|
+
// params: {
|
|
573
|
+
// rpcUrls: sonic.rpcUrls.default.http as any,
|
|
574
|
+
// chainName: sonic.name,
|
|
575
|
+
// nativeCurrency: sonic.nativeCurrency,
|
|
576
|
+
// },
|
|
577
|
+
// },
|
|
578
|
+
// {
|
|
579
|
+
// name: "Manta Pacific",
|
|
580
|
+
// chainId: 169,
|
|
581
|
+
// explorerUrl: "https://pacific-explorer.manta.network",
|
|
582
|
+
// params: {
|
|
583
|
+
// rpcUrls: ["https://pacific-rpc.manta.network/http"],
|
|
584
|
+
// chainName: "Manta Pacific",
|
|
585
|
+
// nativeCurrency: {
|
|
586
|
+
// name: "Ethereum",
|
|
587
|
+
// symbol: "ETH",
|
|
588
|
+
// decimals: 18,
|
|
589
|
+
// },
|
|
590
|
+
// },
|
|
591
|
+
// color: "#78d64b",
|
|
592
|
+
// fakeTransactionHash: "0x3fB128aA5AC254C8539996B11C587E521AE0d3ab",
|
|
593
|
+
// get serverRpcUrl() {
|
|
594
|
+
// return process.env?.MANTA_RPC_URL || this.params.rpcUrls[0];
|
|
595
|
+
// },
|
|
596
|
+
// },
|
|
211
597
|
{
|
|
212
598
|
name: AVO_PROD_CHAIN_NAME,
|
|
213
599
|
chainId: AVO_PROD_CHAIN_ID,
|
|
600
|
+
apiURL: null,
|
|
214
601
|
isAvocado: true,
|
|
215
|
-
balanceResolverAddress:
|
|
216
|
-
|
|
602
|
+
balanceResolverAddress: '',
|
|
603
|
+
fakeTransactionHash: '',
|
|
604
|
+
legacySupported: false,
|
|
605
|
+
viemChain: avocado,
|
|
606
|
+
color: '#16A34A',
|
|
607
|
+
usdcAddress: '',
|
|
217
608
|
serverRpcUrl: AVO_PROD_RPC_URL,
|
|
218
609
|
explorerUrl: AVO_PROD_EXPLORER_URL,
|
|
219
610
|
params: {
|
|
220
611
|
chainName: AVO_PROD_CHAIN_NAME,
|
|
221
612
|
nativeCurrency: {
|
|
222
|
-
name:
|
|
223
|
-
symbol:
|
|
613
|
+
name: 'Avocado',
|
|
614
|
+
symbol: 'USDC',
|
|
224
615
|
decimals: 18,
|
|
225
616
|
},
|
|
226
|
-
iconUrls: [
|
|
617
|
+
iconUrls: ['https://avocado.instadapp.io/logo.svg'],
|
|
227
618
|
rpcUrls: [AVO_PROD_RPC_URL],
|
|
228
619
|
},
|
|
229
620
|
},
|
|
230
621
|
{
|
|
231
622
|
name: AVO_STAGING_CHAIN_NAME,
|
|
623
|
+
apiURL: null,
|
|
232
624
|
chainId: AVO_STAGING_CHAIN_ID,
|
|
233
625
|
serverRpcUrl: AVO_STAGING_RPC_URL,
|
|
626
|
+
color: '#16A34A',
|
|
234
627
|
explorerUrl: AVO_STAGING_EXPLORER_URL,
|
|
628
|
+
legacySupported: false,
|
|
629
|
+
viemChain: avocadoStaging,
|
|
630
|
+
fakeTransactionHash: '',
|
|
235
631
|
isAvocado: true,
|
|
236
|
-
balanceResolverAddress:
|
|
237
|
-
usdcAddress:
|
|
632
|
+
balanceResolverAddress: '',
|
|
633
|
+
usdcAddress: '',
|
|
238
634
|
params: {
|
|
239
635
|
chainName: AVO_STAGING_CHAIN_NAME,
|
|
240
636
|
nativeCurrency: {
|
|
241
|
-
name:
|
|
242
|
-
symbol:
|
|
637
|
+
name: 'Avocado',
|
|
638
|
+
symbol: 'USDC',
|
|
243
639
|
decimals: 18,
|
|
244
640
|
},
|
|
245
|
-
iconUrls: [
|
|
641
|
+
iconUrls: ['https://avocado.instadapp.io/logo.svg'],
|
|
246
642
|
rpcUrls: [AVO_STAGING_RPC_URL],
|
|
247
643
|
},
|
|
248
644
|
},
|
|
249
|
-
]
|
|
645
|
+
]
|
|
646
|
+
|
|
647
|
+
export const chainUsdcAddresses = [
|
|
648
|
+
{ chainId: 1, address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' },
|
|
649
|
+
{ chainId: 10, address: '0x7f5c764cbc14f9669b88837ca1490cca17c31607' },
|
|
650
|
+
{ chainId: 56, address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d' },
|
|
651
|
+
{ chainId: 100, address: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83' },
|
|
652
|
+
{ chainId: 137, address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174' },
|
|
653
|
+
{ chainId: 137, address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359' },
|
|
654
|
+
{ chainId: 250, address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75' },
|
|
655
|
+
{ chainId: 42161, address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' },
|
|
656
|
+
{ chainId: 42161, address: '0xaf88d065e77c8cc2239327c5edb3a432268e5831' },
|
|
657
|
+
{ chainId: 43114, address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' },
|
|
658
|
+
{ chainId: 43114, address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664' },
|
|
659
|
+
{ chainId: 1101, address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035' },
|
|
660
|
+
{
|
|
661
|
+
chainId: 1313161554,
|
|
662
|
+
address: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
|
|
663
|
+
},
|
|
664
|
+
{ chainId: 8453, address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA' },
|
|
665
|
+
]
|
|
250
666
|
|
|
251
|
-
export
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
return networks.find((i) => i.chainId == chainId)!;
|
|
255
|
-
};
|
|
667
|
+
export function getNetworkByChainId(chainId: ChainId | number | string): Network {
|
|
668
|
+
return networks.find(i => i.chainId == chainId)!
|
|
669
|
+
}
|
|
256
670
|
|
|
257
671
|
export const availableNetworks = networks.filter(
|
|
258
|
-
|
|
259
|
-
)
|
|
672
|
+
network => !network.isAvocado,
|
|
673
|
+
)
|
|
260
674
|
|
|
261
|
-
export
|
|
262
|
-
const network = getNetworkByChainId(chainId)
|
|
263
|
-
return network
|
|
264
|
-
}
|
|
675
|
+
export function chainIdToName(chainId: ChainId | number | string) {
|
|
676
|
+
const network = getNetworkByChainId(chainId)
|
|
677
|
+
return network?.name
|
|
678
|
+
}
|
|
265
679
|
|
|
266
|
-
export
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
680
|
+
export function getRpcURLByChainId(chainId: ChainId | number | string) {
|
|
681
|
+
try {
|
|
682
|
+
const network = getNetworkByChainId(chainId)
|
|
683
|
+
return network.params.rpcUrls[0]
|
|
684
|
+
}
|
|
685
|
+
catch {
|
|
686
|
+
return ''
|
|
687
|
+
}
|
|
688
|
+
}
|
|
270
689
|
|
|
271
690
|
export const RPCMap = networks.reduce((acc, network) => {
|
|
272
|
-
acc[network.chainId] = network.params.rpcUrls[0]
|
|
273
|
-
return acc
|
|
274
|
-
}, {} as Record<number, string>)
|
|
691
|
+
acc[network.chainId] = network.params.rpcUrls[0]
|
|
692
|
+
return acc
|
|
693
|
+
}, {} as Record<number, string>)
|
|
275
694
|
|
|
276
|
-
export const networkIds = networks.map(
|
|
695
|
+
export const networkIds = networks.map(network => network.chainId)
|
|
277
696
|
|
|
278
|
-
const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {}
|
|
697
|
+
const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {}
|
|
279
698
|
const serverRpcInstances: Record<
|
|
280
699
|
string,
|
|
281
700
|
ethers.providers.StaticJsonRpcProvider
|
|
282
|
-
> = {}
|
|
701
|
+
> = {}
|
|
283
702
|
|
|
284
|
-
export
|
|
703
|
+
export function getServerRpcProvider(chainId: number | string) {
|
|
285
704
|
if (!rpcInstances[chainId]) {
|
|
286
|
-
const network = networks.find(
|
|
705
|
+
const network = networks.find(n => n.chainId == chainId)
|
|
287
706
|
serverRpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
|
|
288
|
-
network?.serverRpcUrl
|
|
289
|
-
)
|
|
707
|
+
network?.serverRpcUrl,
|
|
708
|
+
)
|
|
290
709
|
}
|
|
291
710
|
|
|
292
|
-
return serverRpcInstances[chainId]
|
|
293
|
-
}
|
|
711
|
+
return serverRpcInstances[chainId]
|
|
712
|
+
}
|
|
294
713
|
|
|
295
|
-
export
|
|
714
|
+
export function getRpcProvider(chainId: number | string) {
|
|
296
715
|
if (!rpcInstances[chainId]) {
|
|
297
716
|
rpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
|
|
298
|
-
getRpcURLByChainId(Number(chainId))
|
|
299
|
-
)
|
|
717
|
+
getRpcURLByChainId(Number(chainId)),
|
|
718
|
+
)
|
|
300
719
|
}
|
|
301
720
|
|
|
302
|
-
return rpcInstances[chainId]
|
|
303
|
-
}
|
|
721
|
+
return rpcInstances[chainId]
|
|
722
|
+
}
|
|
304
723
|
|
|
305
|
-
export
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
};
|
|
724
|
+
export function getExplorerUrl(chainId: ChainId | number | string, suffix: `/${string}` = '/') {
|
|
725
|
+
const network = getNetworkByChainId(chainId)
|
|
726
|
+
if (!network)
|
|
727
|
+
return ''
|
|
728
|
+
return `${network.explorerUrl}${suffix}`
|
|
729
|
+
}
|