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