@instadapp/avocado-base 0.0.0-dev.1264496 → 0.0.0-dev.14346a5
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 +1 -1
- package/abi/multisigAgnosticForwarder.json +937 -0
- package/abi/multisigForwarder.json +680 -680
- package/app.vue +5 -5
- package/assets/images/icons/check.svg +3 -0
- package/assets/images/icons/copy.svg +9 -2
- package/assets/images/icons/hammer.svg +5 -0
- package/assets/images/icons/stars.svg +4 -0
- package/components/ActionLogo.vue +33 -29
- package/components/ActionMetadata.vue +45 -29
- package/components/Address.vue +74 -0
- package/components/AuthorityAvatar.vue +4 -3
- package/components/ChainLogo.vue +22 -25
- package/components/CopyClipboard.vue +16 -38
- package/components/metadata/Bridge.vue +22 -23
- package/components/metadata/CrossTransfer.vue +35 -30
- package/components/metadata/GasTopup.vue +14 -15
- package/components/metadata/Permit2.vue +12 -13
- package/components/metadata/Signers.vue +11 -54
- package/components/metadata/Swap.vue +45 -53
- package/components/metadata/Transfer.vue +25 -27
- package/contracts/MultisigAgnosticForwarder.ts +1423 -0
- package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2135 -0
- package/contracts/factories/index.ts +1 -0
- package/contracts/index.ts +2 -0
- package/eslint.config.mjs +34 -0
- package/nuxt.config.ts +21 -12
- package/package.json +14 -14
- package/server/utils/index.ts +4 -4
- package/utils/avocado.ts +17 -17
- package/utils/bignumber.ts +47 -36
- package/utils/formatter.ts +55 -61
- package/utils/helper.ts +33 -30
- package/utils/metadata.ts +428 -300
- package/utils/network.ts +519 -203
- package/utils/services.ts +11 -13
- package/utils/utils.d.ts +120 -105
package/utils/network.ts
CHANGED
|
@@ -1,315 +1,625 @@
|
|
|
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'
|
|
2
22
|
import {
|
|
3
|
-
AVO_PROD_CHAIN_NAME,
|
|
4
23
|
AVO_PROD_CHAIN_ID,
|
|
5
|
-
|
|
24
|
+
AVO_PROD_CHAIN_NAME,
|
|
6
25
|
AVO_PROD_EXPLORER_URL,
|
|
7
|
-
|
|
26
|
+
AVO_PROD_RPC_URL,
|
|
8
27
|
AVO_STAGING_CHAIN_ID,
|
|
9
|
-
|
|
28
|
+
AVO_STAGING_CHAIN_NAME,
|
|
10
29
|
AVO_STAGING_EXPLORER_URL,
|
|
30
|
+
AVO_STAGING_RPC_URL,
|
|
11
31
|
} from './avocado'
|
|
12
32
|
|
|
13
|
-
export const bridgeDisabledNetworks = []
|
|
33
|
+
export const bridgeDisabledNetworks = []
|
|
14
34
|
|
|
15
35
|
export const networksSimulationNotSupported = [1313161554, 1101]
|
|
16
36
|
|
|
37
|
+
const avocado = defineChain({
|
|
38
|
+
id: AVO_PROD_CHAIN_ID,
|
|
39
|
+
name: AVO_PROD_CHAIN_NAME,
|
|
40
|
+
nativeCurrency: {
|
|
41
|
+
name: 'Avocado',
|
|
42
|
+
symbol: 'USDC',
|
|
43
|
+
decimals: 18,
|
|
44
|
+
},
|
|
45
|
+
rpcUrls: {
|
|
46
|
+
default: { http: [AVO_PROD_RPC_URL] },
|
|
47
|
+
},
|
|
48
|
+
blockExplorers: {
|
|
49
|
+
default: { name: 'Avoscan', url: AVO_PROD_EXPLORER_URL },
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const avocadoStaging = defineChain({
|
|
54
|
+
id: AVO_STAGING_CHAIN_ID,
|
|
55
|
+
name: AVO_STAGING_CHAIN_NAME,
|
|
56
|
+
nativeCurrency: {
|
|
57
|
+
name: 'Avocado',
|
|
58
|
+
symbol: 'USDC',
|
|
59
|
+
decimals: 18,
|
|
60
|
+
},
|
|
61
|
+
rpcUrls: {
|
|
62
|
+
default: { http: [AVO_STAGING_RPC_URL] },
|
|
63
|
+
},
|
|
64
|
+
blockExplorers: {
|
|
65
|
+
default: { name: 'Avoscan', url: AVO_STAGING_EXPLORER_URL },
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const sonic = defineChain({
|
|
71
|
+
id: 146,
|
|
72
|
+
name: 'Sonic',
|
|
73
|
+
nativeCurrency: {
|
|
74
|
+
decimals: 18,
|
|
75
|
+
name: 'Sonic',
|
|
76
|
+
symbol: 'S',
|
|
77
|
+
},
|
|
78
|
+
rpcUrls: {
|
|
79
|
+
default: { http: ['https://rpc.soniclabs.com'] },
|
|
80
|
+
},
|
|
81
|
+
blockExplorers: {
|
|
82
|
+
default: {
|
|
83
|
+
name: 'Sonic Explorer',
|
|
84
|
+
url: 'https://explorer.soniclabs.com',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
testnet: false,
|
|
88
|
+
contracts: {
|
|
89
|
+
multicall3: {
|
|
90
|
+
address: '0x266F33e4E7B44Af88F5B9171d3b5222cc1502b27',
|
|
91
|
+
blockCreated: 269715,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
|
|
17
96
|
export const networks: Network[] = [
|
|
18
97
|
{
|
|
19
|
-
name:
|
|
20
|
-
debankName:
|
|
21
|
-
ankrName:
|
|
22
|
-
zerionName:
|
|
23
|
-
color:
|
|
98
|
+
name: 'Polygon',
|
|
99
|
+
debankName: 'matic',
|
|
100
|
+
ankrName: 'polygon',
|
|
101
|
+
zerionName: 'polygon',
|
|
102
|
+
color: '#7A4ADD',
|
|
24
103
|
chainId: 137,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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',
|
|
29
112
|
get serverRpcUrl() {
|
|
30
|
-
return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0]
|
|
113
|
+
return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0]
|
|
31
114
|
},
|
|
32
115
|
params: {
|
|
33
|
-
chainName:
|
|
116
|
+
chainName: 'Matic(Polygon) Mainnet',
|
|
34
117
|
nativeCurrency: {
|
|
35
|
-
name:
|
|
36
|
-
symbol:
|
|
118
|
+
name: 'Matic',
|
|
119
|
+
symbol: 'MATIC',
|
|
37
120
|
decimals: 18,
|
|
38
121
|
},
|
|
39
|
-
rpcUrls: [
|
|
122
|
+
rpcUrls: ['https://polygon-rpc.com'],
|
|
40
123
|
},
|
|
41
124
|
},
|
|
42
125
|
{
|
|
43
|
-
name:
|
|
44
|
-
debankName:
|
|
45
|
-
ankrName:
|
|
46
|
-
zerionName:
|
|
47
|
-
|
|
126
|
+
name: 'Arbitrum',
|
|
127
|
+
debankName: 'arb',
|
|
128
|
+
ankrName: 'arbitrum',
|
|
129
|
+
zerionName: 'arbitrum',
|
|
130
|
+
legacySupported: true,
|
|
131
|
+
viemChain: arbitrum,
|
|
132
|
+
color: '#2D374B',
|
|
48
133
|
chainId: 42161,
|
|
49
|
-
usdcAddress:
|
|
50
|
-
balanceResolverAddress:
|
|
51
|
-
|
|
52
|
-
|
|
134
|
+
usdcAddress: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
|
|
135
|
+
balanceResolverAddress: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
|
|
136
|
+
fakeTransactionHash:
|
|
137
|
+
'0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843',
|
|
138
|
+
explorerUrl: 'https://arbiscan.io',
|
|
139
|
+
apiURL: 'https://api.arbiscan.io/api',
|
|
53
140
|
get serverRpcUrl() {
|
|
54
|
-
return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0]
|
|
141
|
+
return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0]
|
|
55
142
|
},
|
|
56
143
|
params: {
|
|
57
|
-
chainName:
|
|
144
|
+
chainName: 'Arbitrum One',
|
|
58
145
|
nativeCurrency: {
|
|
59
|
-
name:
|
|
60
|
-
symbol:
|
|
146
|
+
name: 'Ethereum',
|
|
147
|
+
symbol: 'ETH',
|
|
61
148
|
decimals: 18,
|
|
62
149
|
},
|
|
63
|
-
rpcUrls: [
|
|
150
|
+
rpcUrls: ['https://arb1.arbitrum.io/rpc'],
|
|
64
151
|
},
|
|
65
152
|
},
|
|
66
153
|
{
|
|
67
|
-
name:
|
|
68
|
-
debankName:
|
|
69
|
-
ankrName:
|
|
70
|
-
zerionName:
|
|
154
|
+
name: 'Ethereum',
|
|
155
|
+
debankName: 'eth',
|
|
156
|
+
ankrName: 'eth',
|
|
157
|
+
zerionName: 'ethereum',
|
|
158
|
+
viemChain: mainnet,
|
|
71
159
|
chainId: 1,
|
|
72
|
-
explorerUrl:
|
|
73
|
-
|
|
74
|
-
|
|
160
|
+
explorerUrl: 'https://etherscan.io',
|
|
161
|
+
legacySupported: true,
|
|
162
|
+
fakeTransactionHash:
|
|
163
|
+
'0x13232dd32cef2f641ead890a507710c96560c8c9c3d5fab6facb5ec563c49433',
|
|
164
|
+
apiURL: 'https://api.etherscan.io/api',
|
|
165
|
+
color: '#5D5FEF',
|
|
75
166
|
get serverRpcUrl() {
|
|
76
|
-
return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0]
|
|
167
|
+
return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0]
|
|
77
168
|
},
|
|
78
|
-
balanceResolverAddress:
|
|
79
|
-
usdcAddress:
|
|
169
|
+
balanceResolverAddress: '0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43',
|
|
170
|
+
usdcAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
80
171
|
params: {
|
|
81
|
-
rpcUrls: [
|
|
172
|
+
rpcUrls: ['https://rpc.ankr.com/eth'],
|
|
82
173
|
nativeCurrency: {
|
|
83
|
-
name:
|
|
84
|
-
symbol:
|
|
174
|
+
name: 'Ethereum',
|
|
175
|
+
symbol: 'ETH',
|
|
85
176
|
decimals: 18,
|
|
86
177
|
},
|
|
87
178
|
},
|
|
88
|
-
},
|
|
179
|
+
},
|
|
89
180
|
{
|
|
90
181
|
name: 'Base',
|
|
91
182
|
chainId: 8453,
|
|
92
183
|
color: '#1E2024',
|
|
93
|
-
ankrName:'base',
|
|
184
|
+
ankrName: 'base',
|
|
185
|
+
viemChain: base,
|
|
94
186
|
explorerUrl: 'https://basescan.org',
|
|
95
|
-
|
|
187
|
+
legacySupported: true,
|
|
188
|
+
fakeTransactionHash:
|
|
189
|
+
'0xf7833d80da33730c4fc5d4c64151f0eaa64c0c0535be022af0228a44cc4e9c8e',
|
|
190
|
+
apiURL: 'https://api.basescan.org/api',
|
|
96
191
|
get serverRpcUrl() {
|
|
97
|
-
return process.env?.BASE_RPC_URL || this.params.rpcUrls[0]
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
192
|
+
return process.env?.BASE_RPC_URL || this.params.rpcUrls[0]
|
|
193
|
+
},
|
|
194
|
+
usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
|
|
195
|
+
balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
|
|
196
|
+
params: {
|
|
102
197
|
rpcUrls: ['https://rpc.ankr.com/base'],
|
|
103
|
-
chainName:
|
|
198
|
+
chainName: 'Base',
|
|
104
199
|
nativeCurrency: {
|
|
105
|
-
name:
|
|
106
|
-
symbol:
|
|
200
|
+
name: 'Ethereum',
|
|
201
|
+
symbol: 'ETH',
|
|
107
202
|
decimals: 18,
|
|
108
203
|
},
|
|
109
|
-
}
|
|
204
|
+
},
|
|
110
205
|
},
|
|
111
206
|
{
|
|
112
|
-
name:
|
|
113
|
-
debankName:
|
|
114
|
-
ankrName:
|
|
115
|
-
zerionName:
|
|
116
|
-
color:
|
|
207
|
+
name: 'Optimism',
|
|
208
|
+
debankName: 'op',
|
|
209
|
+
ankrName: 'optimism',
|
|
210
|
+
zerionName: 'optimism',
|
|
211
|
+
color: '#FF0420',
|
|
212
|
+
legacySupported: true,
|
|
213
|
+
viemChain: optimism,
|
|
117
214
|
chainId: 10,
|
|
118
|
-
apiURL: 'https://api-optimistic.etherscan.io',
|
|
119
|
-
usdcAddress:
|
|
120
|
-
balanceResolverAddress:
|
|
121
|
-
|
|
215
|
+
apiURL: 'https://api-optimistic.etherscan.io/api',
|
|
216
|
+
usdcAddress: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
|
|
217
|
+
balanceResolverAddress: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
|
|
218
|
+
fakeTransactionHash:
|
|
219
|
+
'0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc',
|
|
220
|
+
explorerUrl: 'https://optimistic.etherscan.io',
|
|
122
221
|
get serverRpcUrl() {
|
|
123
|
-
return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0]
|
|
222
|
+
return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0]
|
|
124
223
|
},
|
|
125
224
|
params: {
|
|
126
|
-
chainName:
|
|
225
|
+
chainName: 'Optimistic Ethereum',
|
|
127
226
|
nativeCurrency: {
|
|
128
|
-
name:
|
|
129
|
-
symbol:
|
|
227
|
+
name: 'Ethereum',
|
|
228
|
+
symbol: 'ETH',
|
|
130
229
|
decimals: 18,
|
|
131
230
|
},
|
|
132
|
-
rpcUrls: [
|
|
231
|
+
rpcUrls: ['https://rpc.ankr.com/optimism'],
|
|
133
232
|
},
|
|
134
233
|
},
|
|
135
234
|
{
|
|
136
|
-
name:
|
|
235
|
+
name: 'Polygon zkEVM',
|
|
137
236
|
chainId: 1101,
|
|
138
|
-
color:
|
|
237
|
+
color: '#8544f6',
|
|
139
238
|
ankrName: 'polygon_zkevm',
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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',
|
|
144
247
|
get serverRpcUrl() {
|
|
145
|
-
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0]
|
|
248
|
+
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0]
|
|
146
249
|
},
|
|
147
250
|
params: {
|
|
148
|
-
chainName:
|
|
149
|
-
rpcUrls: [
|
|
251
|
+
chainName: 'polygon zkEVM',
|
|
252
|
+
rpcUrls: ['https://zkevm-rpc.com'],
|
|
150
253
|
nativeCurrency: {
|
|
151
|
-
name:
|
|
152
|
-
symbol:
|
|
254
|
+
name: 'Ethereum',
|
|
255
|
+
symbol: 'ETH',
|
|
153
256
|
decimals: 18,
|
|
154
257
|
},
|
|
155
258
|
},
|
|
156
259
|
},
|
|
157
260
|
{
|
|
158
|
-
name:
|
|
159
|
-
debankName:
|
|
160
|
-
ankrName:
|
|
161
|
-
zerionName:
|
|
162
|
-
color:
|
|
261
|
+
name: 'BSC',
|
|
262
|
+
debankName: 'bsc',
|
|
263
|
+
ankrName: 'bsc',
|
|
264
|
+
zerionName: 'binance-smart-chain',
|
|
265
|
+
color: '#F3BA2F',
|
|
163
266
|
chainId: 56,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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',
|
|
168
275
|
get serverRpcUrl() {
|
|
169
|
-
return process.env?.BSC_RPC_URL || this.params.rpcUrls[0]
|
|
276
|
+
return process.env?.BSC_RPC_URL || this.params.rpcUrls[0]
|
|
170
277
|
},
|
|
171
278
|
params: {
|
|
172
|
-
chainName:
|
|
173
|
-
rpcUrls: [
|
|
279
|
+
chainName: 'Binance Smart Chain',
|
|
280
|
+
rpcUrls: ['https://rpc.ankr.com/bsc'],
|
|
174
281
|
nativeCurrency: {
|
|
175
|
-
name:
|
|
176
|
-
symbol:
|
|
282
|
+
name: 'Binance Coin',
|
|
283
|
+
symbol: 'BNB',
|
|
177
284
|
decimals: 18,
|
|
178
285
|
},
|
|
179
286
|
},
|
|
180
287
|
},
|
|
181
288
|
{
|
|
182
|
-
name:
|
|
183
|
-
debankName:
|
|
184
|
-
ankrName:
|
|
185
|
-
zerionName:
|
|
186
|
-
color:
|
|
289
|
+
name: 'Avalanche',
|
|
290
|
+
debankName: 'avax',
|
|
291
|
+
ankrName: 'avalanche',
|
|
292
|
+
zerionName: 'avalanche',
|
|
293
|
+
color: '#EB5757',
|
|
294
|
+
viemChain: avalanche,
|
|
295
|
+
legacySupported: true,
|
|
187
296
|
chainId: 43114,
|
|
188
|
-
usdcAddress:
|
|
189
|
-
balanceResolverAddress:
|
|
190
|
-
explorerUrl:
|
|
191
|
-
|
|
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',
|
|
192
303
|
get serverRpcUrl() {
|
|
193
|
-
return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0]
|
|
304
|
+
return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0]
|
|
194
305
|
},
|
|
195
306
|
params: {
|
|
196
|
-
chainName:
|
|
307
|
+
chainName: 'Avalanche Network',
|
|
197
308
|
nativeCurrency: {
|
|
198
|
-
name:
|
|
199
|
-
symbol:
|
|
309
|
+
name: 'Avalanche',
|
|
310
|
+
symbol: 'AVAX',
|
|
200
311
|
decimals: 18,
|
|
201
312
|
},
|
|
202
|
-
rpcUrls: [
|
|
313
|
+
rpcUrls: ['https://rpc.ankr.com/avalanche'],
|
|
203
314
|
},
|
|
204
315
|
},
|
|
205
316
|
{
|
|
206
|
-
name:
|
|
317
|
+
name: 'Fantom',
|
|
207
318
|
chainId: 250,
|
|
208
|
-
zerionName:
|
|
209
|
-
explorerUrl:
|
|
210
|
-
|
|
211
|
-
|
|
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,
|
|
212
326
|
get serverRpcUrl() {
|
|
213
|
-
return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0]
|
|
327
|
+
return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0]
|
|
214
328
|
},
|
|
215
|
-
usdcAddress:
|
|
216
|
-
balanceResolverAddress:
|
|
329
|
+
usdcAddress: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
|
|
330
|
+
balanceResolverAddress: '0x929376c77a2fb8152375a089a4fccf84ff481479',
|
|
331
|
+
fakeTransactionHash:
|
|
332
|
+
'0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4',
|
|
217
333
|
params: {
|
|
218
|
-
rpcUrls: [
|
|
219
|
-
chainName:
|
|
334
|
+
rpcUrls: ['https://rpc.ankr.com/fantom'],
|
|
335
|
+
chainName: 'Fantom',
|
|
220
336
|
nativeCurrency: {
|
|
221
|
-
name:
|
|
222
|
-
symbol:
|
|
337
|
+
name: 'Fantom',
|
|
338
|
+
symbol: 'FTM',
|
|
223
339
|
decimals: 18,
|
|
224
340
|
},
|
|
225
341
|
},
|
|
226
342
|
},
|
|
227
343
|
{
|
|
228
|
-
name:
|
|
229
|
-
debankName:
|
|
230
|
-
zerionName:
|
|
231
|
-
color:
|
|
344
|
+
name: 'Gnosis',
|
|
345
|
+
debankName: 'xdai',
|
|
346
|
+
zerionName: 'xdai',
|
|
347
|
+
color: '#04795C',
|
|
232
348
|
ankrName: 'gnosis',
|
|
349
|
+
viemChain: gnosis,
|
|
350
|
+
legacySupported: true,
|
|
233
351
|
chainId: 100,
|
|
234
|
-
balanceResolverAddress:
|
|
235
|
-
explorerUrl:
|
|
236
|
-
|
|
237
|
-
|
|
352
|
+
balanceResolverAddress: '0xfaa244e276b1597f663975ed007ee4ff70d27849',
|
|
353
|
+
explorerUrl: 'https://gnosisscan.io',
|
|
354
|
+
fakeTransactionHash:
|
|
355
|
+
'0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b',
|
|
356
|
+
apiURL: 'https://api.gnosisscan.io/api',
|
|
357
|
+
usdcAddress: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83',
|
|
238
358
|
get serverRpcUrl() {
|
|
239
|
-
return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0]
|
|
359
|
+
return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0]
|
|
240
360
|
},
|
|
241
361
|
params: {
|
|
242
|
-
chainName:
|
|
243
|
-
rpcUrls: [
|
|
362
|
+
chainName: 'Gnosis Safe',
|
|
363
|
+
rpcUrls: ['https://rpc.ankr.com/gnosis'],
|
|
244
364
|
nativeCurrency: {
|
|
245
|
-
name:
|
|
246
|
-
symbol:
|
|
365
|
+
name: 'xdaistable',
|
|
366
|
+
symbol: 'xDAI',
|
|
247
367
|
decimals: 18,
|
|
248
368
|
},
|
|
249
369
|
},
|
|
250
370
|
},
|
|
251
371
|
{
|
|
252
|
-
name:
|
|
372
|
+
name: 'Aurora',
|
|
253
373
|
chainId: 1313161554,
|
|
254
|
-
zerionName:
|
|
255
|
-
color:
|
|
256
|
-
|
|
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',
|
|
382
|
+
get serverRpcUrl() {
|
|
383
|
+
return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0]
|
|
384
|
+
},
|
|
385
|
+
usdcAddress: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
|
|
386
|
+
balanceResolverAddress: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
|
|
387
|
+
params: {
|
|
388
|
+
rpcUrls: ['https://mainnet.aurora.dev'],
|
|
389
|
+
chainName: 'Aurora',
|
|
390
|
+
nativeCurrency: {
|
|
391
|
+
decimals: 18,
|
|
392
|
+
name: 'Aurora ETH',
|
|
393
|
+
symbol: 'AETH',
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
{
|
|
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',
|
|
408
|
+
get serverRpcUrl() {
|
|
409
|
+
return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0]
|
|
410
|
+
},
|
|
411
|
+
usdcAddress: '',
|
|
412
|
+
balanceResolverAddress: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
|
|
413
|
+
params: {
|
|
414
|
+
rpcUrls: ['https://fuse-mainnet.chainstacklabs.com'],
|
|
415
|
+
chainName: 'Fuse',
|
|
416
|
+
nativeCurrency: {
|
|
417
|
+
decimals: 18,
|
|
418
|
+
name: 'Fuse',
|
|
419
|
+
symbol: 'fuse',
|
|
420
|
+
},
|
|
421
|
+
},
|
|
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',
|
|
257
434
|
get serverRpcUrl() {
|
|
258
|
-
return process.env?.
|
|
435
|
+
return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0]
|
|
259
436
|
},
|
|
260
|
-
usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
261
|
-
balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
262
437
|
params: {
|
|
263
|
-
rpcUrls: [
|
|
264
|
-
chainName:
|
|
438
|
+
rpcUrls: ['https://rpc.scroll.io'],
|
|
439
|
+
chainName: 'Scroll',
|
|
265
440
|
nativeCurrency: {
|
|
441
|
+
name: 'Ethereum',
|
|
442
|
+
symbol: 'ETH',
|
|
266
443
|
decimals: 18,
|
|
267
|
-
name: "Aurora ETH",
|
|
268
|
-
symbol: "AETH",
|
|
269
444
|
},
|
|
270
445
|
},
|
|
271
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
|
+
name: sonic.name,
|
|
539
|
+
chainId: sonic.id,
|
|
540
|
+
explorerUrl: sonic.blockExplorers.default.url,
|
|
541
|
+
legacySupported: false,
|
|
542
|
+
viemChain: sonic,
|
|
543
|
+
color: '#78d64b',
|
|
544
|
+
apiURL: null,
|
|
545
|
+
fakeTransactionHash: '0xc8fe01a980987295c36e898b4681fa8c937eb8dfd48a3ae080956b36a66195ee',
|
|
546
|
+
get serverRpcUrl() {
|
|
547
|
+
return process.env?.SONIC_RPC_URL || this.params.rpcUrls[0]
|
|
548
|
+
},
|
|
549
|
+
params: {
|
|
550
|
+
rpcUrls: sonic.rpcUrls.default.http as any,
|
|
551
|
+
chainName: sonic.name,
|
|
552
|
+
nativeCurrency: sonic.nativeCurrency,
|
|
553
|
+
},
|
|
554
|
+
},
|
|
555
|
+
// {
|
|
556
|
+
// name: "Manta Pacific",
|
|
557
|
+
// chainId: 169,
|
|
558
|
+
// explorerUrl: "https://pacific-explorer.manta.network",
|
|
559
|
+
// params: {
|
|
560
|
+
// rpcUrls: ["https://pacific-rpc.manta.network/http"],
|
|
561
|
+
// chainName: "Manta Pacific",
|
|
562
|
+
// nativeCurrency: {
|
|
563
|
+
// name: "Ethereum",
|
|
564
|
+
// symbol: "ETH",
|
|
565
|
+
// decimals: 18,
|
|
566
|
+
// },
|
|
567
|
+
// },
|
|
568
|
+
// color: "#78d64b",
|
|
569
|
+
// fakeTransactionHash: "0x3fB128aA5AC254C8539996B11C587E521AE0d3ab",
|
|
570
|
+
// get serverRpcUrl() {
|
|
571
|
+
// return process.env?.MANTA_RPC_URL || this.params.rpcUrls[0];
|
|
572
|
+
// },
|
|
573
|
+
// },
|
|
272
574
|
{
|
|
273
575
|
name: AVO_PROD_CHAIN_NAME,
|
|
274
576
|
chainId: AVO_PROD_CHAIN_ID,
|
|
577
|
+
apiURL: null,
|
|
275
578
|
isAvocado: true,
|
|
276
|
-
balanceResolverAddress:
|
|
277
|
-
|
|
278
|
-
|
|
579
|
+
balanceResolverAddress: '',
|
|
580
|
+
fakeTransactionHash: '',
|
|
581
|
+
legacySupported: false,
|
|
582
|
+
viemChain: avocado,
|
|
583
|
+
color: '#16A34A',
|
|
584
|
+
usdcAddress: '',
|
|
279
585
|
serverRpcUrl: AVO_PROD_RPC_URL,
|
|
280
586
|
explorerUrl: AVO_PROD_EXPLORER_URL,
|
|
281
587
|
params: {
|
|
282
588
|
chainName: AVO_PROD_CHAIN_NAME,
|
|
283
589
|
nativeCurrency: {
|
|
284
|
-
name:
|
|
285
|
-
symbol:
|
|
590
|
+
name: 'Avocado',
|
|
591
|
+
symbol: 'USDC',
|
|
286
592
|
decimals: 18,
|
|
287
593
|
},
|
|
288
|
-
iconUrls: [
|
|
594
|
+
iconUrls: ['https://avocado.instadapp.io/logo.svg'],
|
|
289
595
|
rpcUrls: [AVO_PROD_RPC_URL],
|
|
290
596
|
},
|
|
291
597
|
},
|
|
292
598
|
{
|
|
293
599
|
name: AVO_STAGING_CHAIN_NAME,
|
|
600
|
+
apiURL: null,
|
|
294
601
|
chainId: AVO_STAGING_CHAIN_ID,
|
|
295
602
|
serverRpcUrl: AVO_STAGING_RPC_URL,
|
|
296
|
-
color:
|
|
603
|
+
color: '#16A34A',
|
|
297
604
|
explorerUrl: AVO_STAGING_EXPLORER_URL,
|
|
605
|
+
legacySupported: false,
|
|
606
|
+
viemChain: avocadoStaging,
|
|
607
|
+
fakeTransactionHash: '',
|
|
298
608
|
isAvocado: true,
|
|
299
|
-
balanceResolverAddress:
|
|
300
|
-
usdcAddress:
|
|
609
|
+
balanceResolverAddress: '',
|
|
610
|
+
usdcAddress: '',
|
|
301
611
|
params: {
|
|
302
612
|
chainName: AVO_STAGING_CHAIN_NAME,
|
|
303
613
|
nativeCurrency: {
|
|
304
|
-
name:
|
|
305
|
-
symbol:
|
|
614
|
+
name: 'Avocado',
|
|
615
|
+
symbol: 'USDC',
|
|
306
616
|
decimals: 18,
|
|
307
617
|
},
|
|
308
|
-
iconUrls: [
|
|
618
|
+
iconUrls: ['https://avocado.instadapp.io/logo.svg'],
|
|
309
619
|
rpcUrls: [AVO_STAGING_RPC_URL],
|
|
310
620
|
},
|
|
311
621
|
},
|
|
312
|
-
]
|
|
622
|
+
]
|
|
313
623
|
|
|
314
624
|
export const chainUsdcAddresses = [
|
|
315
625
|
{ chainId: 1, address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' },
|
|
@@ -317,74 +627,80 @@ export const chainUsdcAddresses = [
|
|
|
317
627
|
{ chainId: 56, address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d' },
|
|
318
628
|
{ chainId: 100, address: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83' },
|
|
319
629
|
{ chainId: 137, address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174' },
|
|
630
|
+
{ chainId: 137, address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359' },
|
|
320
631
|
{ chainId: 250, address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75' },
|
|
321
632
|
{ chainId: 42161, address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' },
|
|
322
633
|
{ chainId: 42161, address: '0xaf88d065e77c8cc2239327c5edb3a432268e5831' },
|
|
323
634
|
{ chainId: 43114, address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' },
|
|
324
635
|
{ chainId: 43114, address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664' },
|
|
325
636
|
{ chainId: 1101, address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035' },
|
|
326
|
-
{
|
|
327
|
-
|
|
328
|
-
|
|
637
|
+
{
|
|
638
|
+
chainId: 1313161554,
|
|
639
|
+
address: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
|
|
640
|
+
},
|
|
641
|
+
{ chainId: 8453, address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA' },
|
|
642
|
+
]
|
|
329
643
|
|
|
330
|
-
export
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
return networks.find((i) => i.chainId == chainId)!;
|
|
334
|
-
};
|
|
644
|
+
export function getNetworkByChainId(chainId: ChainId | number | string): Network {
|
|
645
|
+
return networks.find(i => i.chainId == chainId)!
|
|
646
|
+
}
|
|
335
647
|
|
|
336
648
|
export const availableNetworks = networks.filter(
|
|
337
|
-
|
|
338
|
-
)
|
|
649
|
+
network => !network.isAvocado,
|
|
650
|
+
)
|
|
339
651
|
|
|
340
|
-
export
|
|
341
|
-
const network = getNetworkByChainId(chainId)
|
|
342
|
-
return network
|
|
343
|
-
}
|
|
652
|
+
export function chainIdToName(chainId: ChainId | number | string) {
|
|
653
|
+
const network = getNetworkByChainId(chainId)
|
|
654
|
+
return network?.name
|
|
655
|
+
}
|
|
344
656
|
|
|
345
|
-
export
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
657
|
+
export function getRpcURLByChainId(chainId: ChainId | number | string) {
|
|
658
|
+
try {
|
|
659
|
+
const network = getNetworkByChainId(chainId)
|
|
660
|
+
return network.params.rpcUrls[0]
|
|
661
|
+
}
|
|
662
|
+
catch {
|
|
663
|
+
return ''
|
|
664
|
+
}
|
|
665
|
+
}
|
|
349
666
|
|
|
350
667
|
export const RPCMap = networks.reduce((acc, network) => {
|
|
351
|
-
acc[network.chainId] = network.params.rpcUrls[0]
|
|
352
|
-
return acc
|
|
353
|
-
}, {} as Record<number, string>)
|
|
668
|
+
acc[network.chainId] = network.params.rpcUrls[0]
|
|
669
|
+
return acc
|
|
670
|
+
}, {} as Record<number, string>)
|
|
354
671
|
|
|
355
|
-
export const networkIds = networks.map(
|
|
672
|
+
export const networkIds = networks.map(network => network.chainId)
|
|
356
673
|
|
|
357
|
-
const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {}
|
|
674
|
+
const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {}
|
|
358
675
|
const serverRpcInstances: Record<
|
|
359
676
|
string,
|
|
360
677
|
ethers.providers.StaticJsonRpcProvider
|
|
361
|
-
> = {}
|
|
678
|
+
> = {}
|
|
362
679
|
|
|
363
|
-
export
|
|
680
|
+
export function getServerRpcProvider(chainId: number | string) {
|
|
364
681
|
if (!rpcInstances[chainId]) {
|
|
365
|
-
const network = networks.find(
|
|
682
|
+
const network = networks.find(n => n.chainId == chainId)
|
|
366
683
|
serverRpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
|
|
367
|
-
network?.serverRpcUrl
|
|
368
|
-
)
|
|
684
|
+
network?.serverRpcUrl,
|
|
685
|
+
)
|
|
369
686
|
}
|
|
370
687
|
|
|
371
|
-
return serverRpcInstances[chainId]
|
|
372
|
-
}
|
|
688
|
+
return serverRpcInstances[chainId]
|
|
689
|
+
}
|
|
373
690
|
|
|
374
|
-
export
|
|
691
|
+
export function getRpcProvider(chainId: number | string) {
|
|
375
692
|
if (!rpcInstances[chainId]) {
|
|
376
693
|
rpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
|
|
377
|
-
getRpcURLByChainId(Number(chainId))
|
|
378
|
-
)
|
|
694
|
+
getRpcURLByChainId(Number(chainId)),
|
|
695
|
+
)
|
|
379
696
|
}
|
|
380
697
|
|
|
381
|
-
return rpcInstances[chainId]
|
|
382
|
-
}
|
|
698
|
+
return rpcInstances[chainId]
|
|
699
|
+
}
|
|
383
700
|
|
|
384
|
-
export
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
};
|
|
701
|
+
export function getExplorerUrl(chainId: ChainId | number | string, suffix: `/${string}` = '/') {
|
|
702
|
+
const network = getNetworkByChainId(chainId)
|
|
703
|
+
if (!network)
|
|
704
|
+
return ''
|
|
705
|
+
return `${network.explorerUrl}${suffix}`
|
|
706
|
+
}
|