@instadapp/avocado-base 0.0.0-dev.991c44c → 0.0.0-dev.9d4ed5b
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/abi/multisigAgnosticForwarder.json +1 -0
- package/assets/images/icons/stars.svg +4 -0
- package/components/ActionLogo.vue +32 -30
- package/components/ActionMetadata.vue +29 -23
- package/components/AuthorityAvatar.vue +4 -5
- package/components/ChainLogo.vue +10 -17
- package/components/CopyClipboard.vue +5 -11
- package/components/metadata/CrossTransfer.vue +11 -3
- package/components/metadata/Signers.vue +26 -23
- package/components/metadata/Swap.vue +22 -29
- package/contracts/MultisigAgnosticForwarder.ts +1413 -0
- package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2051 -0
- package/contracts/factories/index.ts +1 -0
- package/contracts/index.ts +2 -0
- package/package.json +10 -7
- package/utils/formatter.ts +1 -1
- package/utils/metadata.ts +143 -14
- package/utils/network.ts +216 -17
- package/utils/utils.d.ts +15 -2
package/utils/network.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
|
+
import {
|
|
3
|
+
polygon,
|
|
4
|
+
arbitrum,
|
|
5
|
+
mainnet,
|
|
6
|
+
base,
|
|
7
|
+
optimism,
|
|
8
|
+
polygonZkEvm,
|
|
9
|
+
bsc,
|
|
10
|
+
avalanche,
|
|
11
|
+
fantom,
|
|
12
|
+
gnosis,
|
|
13
|
+
aurora,
|
|
14
|
+
fuse,
|
|
15
|
+
scroll,
|
|
16
|
+
opBNB,
|
|
17
|
+
mode,
|
|
18
|
+
blast
|
|
19
|
+
} from "viem/chains";
|
|
2
20
|
import {
|
|
3
21
|
AVO_PROD_CHAIN_NAME,
|
|
4
22
|
AVO_PROD_CHAIN_ID,
|
|
@@ -9,11 +27,44 @@ import {
|
|
|
9
27
|
AVO_STAGING_RPC_URL,
|
|
10
28
|
AVO_STAGING_EXPLORER_URL,
|
|
11
29
|
} from "./avocado";
|
|
30
|
+
import { defineChain } from "viem";
|
|
12
31
|
|
|
13
32
|
export const bridgeDisabledNetworks = [];
|
|
14
33
|
|
|
15
34
|
export const networksSimulationNotSupported = [1313161554, 1101];
|
|
16
35
|
|
|
36
|
+
const avocado = defineChain({
|
|
37
|
+
id: AVO_PROD_CHAIN_ID,
|
|
38
|
+
name: AVO_PROD_CHAIN_NAME,
|
|
39
|
+
nativeCurrency: {
|
|
40
|
+
name: "Avocado",
|
|
41
|
+
symbol: "USDC",
|
|
42
|
+
decimals: 18,
|
|
43
|
+
},
|
|
44
|
+
rpcUrls: {
|
|
45
|
+
default: { http: [AVO_PROD_RPC_URL] },
|
|
46
|
+
},
|
|
47
|
+
blockExplorers: {
|
|
48
|
+
default: { name: "Avoscan", url: AVO_PROD_EXPLORER_URL },
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const avocadoStaging = defineChain({
|
|
53
|
+
id: AVO_STAGING_CHAIN_ID,
|
|
54
|
+
name: AVO_STAGING_CHAIN_NAME,
|
|
55
|
+
nativeCurrency: {
|
|
56
|
+
name: "Avocado",
|
|
57
|
+
symbol: "USDC",
|
|
58
|
+
decimals: 18,
|
|
59
|
+
},
|
|
60
|
+
rpcUrls: {
|
|
61
|
+
default: { http: [AVO_STAGING_RPC_URL] },
|
|
62
|
+
},
|
|
63
|
+
blockExplorers: {
|
|
64
|
+
default: { name: "Avoscan", url: AVO_STAGING_EXPLORER_URL },
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
17
68
|
export const networks: Network[] = [
|
|
18
69
|
{
|
|
19
70
|
name: "Polygon",
|
|
@@ -22,10 +73,13 @@ export const networks: Network[] = [
|
|
|
22
73
|
zerionName: "polygon",
|
|
23
74
|
color: "#7A4ADD",
|
|
24
75
|
chainId: 137,
|
|
76
|
+
viemChain: polygon,
|
|
25
77
|
balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
|
|
26
78
|
usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
|
27
79
|
explorerUrl: "https://polygonscan.com",
|
|
28
80
|
apiURL: "https://api.polygonscan.com",
|
|
81
|
+
fakeTransactionHash:
|
|
82
|
+
"0x906c551abd5873a428505b6530ac14d91367820706c7ee525f6d7313265d1c92",
|
|
29
83
|
get serverRpcUrl() {
|
|
30
84
|
return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
|
|
31
85
|
},
|
|
@@ -44,10 +98,13 @@ export const networks: Network[] = [
|
|
|
44
98
|
debankName: "arb",
|
|
45
99
|
ankrName: "arbitrum",
|
|
46
100
|
zerionName: "arbitrum",
|
|
101
|
+
viemChain: arbitrum,
|
|
47
102
|
color: "#2D374B",
|
|
48
103
|
chainId: 42161,
|
|
49
104
|
usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
|
|
50
105
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
106
|
+
fakeTransactionHash:
|
|
107
|
+
"0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843",
|
|
51
108
|
explorerUrl: "https://arbiscan.io",
|
|
52
109
|
apiURL: "https://api.arbiscan.io",
|
|
53
110
|
get serverRpcUrl() {
|
|
@@ -68,8 +125,11 @@ export const networks: Network[] = [
|
|
|
68
125
|
debankName: "eth",
|
|
69
126
|
ankrName: "eth",
|
|
70
127
|
zerionName: "ethereum",
|
|
128
|
+
viemChain: mainnet,
|
|
71
129
|
chainId: 1,
|
|
72
130
|
explorerUrl: "https://etherscan.io",
|
|
131
|
+
fakeTransactionHash:
|
|
132
|
+
"0x13232dd32cef2f641ead890a507710c96560c8c9c3d5fab6facb5ec563c49433",
|
|
73
133
|
apiURL: "https://api.etherscan.io",
|
|
74
134
|
color: "#5D5FEF",
|
|
75
135
|
get serverRpcUrl() {
|
|
@@ -91,7 +151,10 @@ export const networks: Network[] = [
|
|
|
91
151
|
chainId: 8453,
|
|
92
152
|
color: "#1E2024",
|
|
93
153
|
ankrName: "base",
|
|
154
|
+
viemChain: base,
|
|
94
155
|
explorerUrl: "https://basescan.org",
|
|
156
|
+
fakeTransactionHash:
|
|
157
|
+
"0xf7833d80da33730c4fc5d4c64151f0eaa64c0c0535be022af0228a44cc4e9c8e",
|
|
95
158
|
apiURL: "https://api.basescan.org",
|
|
96
159
|
get serverRpcUrl() {
|
|
97
160
|
return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -114,10 +177,13 @@ export const networks: Network[] = [
|
|
|
114
177
|
ankrName: "optimism",
|
|
115
178
|
zerionName: "optimism",
|
|
116
179
|
color: "#FF0420",
|
|
180
|
+
viemChain: optimism,
|
|
117
181
|
chainId: 10,
|
|
118
182
|
apiURL: "https://api-optimistic.etherscan.io",
|
|
119
183
|
usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
|
|
120
184
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
185
|
+
fakeTransactionHash:
|
|
186
|
+
"0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc",
|
|
121
187
|
explorerUrl: "https://optimistic.etherscan.io",
|
|
122
188
|
get serverRpcUrl() {
|
|
123
189
|
return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -137,9 +203,12 @@ export const networks: Network[] = [
|
|
|
137
203
|
chainId: 1101,
|
|
138
204
|
color: "#8544f6",
|
|
139
205
|
ankrName: "polygon_zkevm",
|
|
206
|
+
viemChain: polygonZkEvm,
|
|
140
207
|
explorerUrl: "https://zkevm.polygonscan.com",
|
|
141
208
|
apiURL: "https://api-zkevm.polygonscan.com",
|
|
142
209
|
balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
|
|
210
|
+
fakeTransactionHash:
|
|
211
|
+
"0x1077130463ade91ad4e9c43c3195298e26a99970975238128912490eea12bf41",
|
|
143
212
|
usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
|
|
144
213
|
get serverRpcUrl() {
|
|
145
214
|
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -162,6 +231,9 @@ export const networks: Network[] = [
|
|
|
162
231
|
color: "#F3BA2F",
|
|
163
232
|
chainId: 56,
|
|
164
233
|
explorerUrl: "https://bscscan.com",
|
|
234
|
+
viemChain: bsc,
|
|
235
|
+
fakeTransactionHash:
|
|
236
|
+
"0x897d54bf8e492f840bd4d8f1e743bfcab8226ab4d5a899e47ee433dcd6d6abf7",
|
|
165
237
|
apiURL: "https://api.bscscan.com",
|
|
166
238
|
usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
167
239
|
balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
|
|
@@ -184,10 +256,13 @@ export const networks: Network[] = [
|
|
|
184
256
|
ankrName: "avalanche",
|
|
185
257
|
zerionName: "avalanche",
|
|
186
258
|
color: "#EB5757",
|
|
259
|
+
viemChain: avalanche,
|
|
187
260
|
chainId: 43114,
|
|
188
261
|
usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
|
|
189
262
|
balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
|
|
190
263
|
explorerUrl: "https://snowtrace.io",
|
|
264
|
+
fakeTransactionHash:
|
|
265
|
+
"0x233aac7402558dd4e23f938a50f983e67f5c9604233981c7ac74e63737b8294e",
|
|
191
266
|
apiURL: "https://api.snowtrace.io",
|
|
192
267
|
get serverRpcUrl() {
|
|
193
268
|
return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -209,11 +284,14 @@ export const networks: Network[] = [
|
|
|
209
284
|
explorerUrl: "https://ftmscan.com",
|
|
210
285
|
ankrName: "fantom",
|
|
211
286
|
color: "#1969ff",
|
|
287
|
+
viemChain: fantom,
|
|
212
288
|
get serverRpcUrl() {
|
|
213
289
|
return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
|
|
214
290
|
},
|
|
215
291
|
usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
|
|
216
292
|
balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
|
|
293
|
+
fakeTransactionHash:
|
|
294
|
+
"0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4",
|
|
217
295
|
params: {
|
|
218
296
|
rpcUrls: ["https://rpc.ankr.com/fantom"],
|
|
219
297
|
chainName: "Fantom",
|
|
@@ -230,9 +308,12 @@ export const networks: Network[] = [
|
|
|
230
308
|
zerionName: "xdai",
|
|
231
309
|
color: "#04795C",
|
|
232
310
|
ankrName: "gnosis",
|
|
311
|
+
viemChain: gnosis,
|
|
233
312
|
chainId: 100,
|
|
234
313
|
balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
|
|
235
314
|
explorerUrl: "https://gnosisscan.io",
|
|
315
|
+
fakeTransactionHash:
|
|
316
|
+
"0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b",
|
|
236
317
|
apiURL: "https://api.gnosisscan.io",
|
|
237
318
|
usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
|
|
238
319
|
get serverRpcUrl() {
|
|
@@ -253,7 +334,10 @@ export const networks: Network[] = [
|
|
|
253
334
|
chainId: 1313161554,
|
|
254
335
|
zerionName: "aurora",
|
|
255
336
|
color: "#78d64b",
|
|
337
|
+
viemChain: aurora,
|
|
256
338
|
explorerUrl: "https://explorer.mainnet.aurora.dev",
|
|
339
|
+
fakeTransactionHash:
|
|
340
|
+
"0x0923401c5a80c39a5cd57c098a6c4729edbefd0db6894def7d349493f4ff3ec6",
|
|
257
341
|
get serverRpcUrl() {
|
|
258
342
|
return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
|
|
259
343
|
},
|
|
@@ -269,32 +353,139 @@ export const networks: Network[] = [
|
|
|
269
353
|
},
|
|
270
354
|
},
|
|
271
355
|
},
|
|
356
|
+
{
|
|
357
|
+
name: "Fuse",
|
|
358
|
+
chainId: 122,
|
|
359
|
+
zerionName: "fuse",
|
|
360
|
+
color: "#78d64b",
|
|
361
|
+
explorerUrl: "https://explorer.fuse.io",
|
|
362
|
+
viemChain: fuse,
|
|
363
|
+
fakeTransactionHash:
|
|
364
|
+
"0xf22a8031de9b978a57c728e18c6b54633356c39db4d0466e53b9b7c3ee7f8def",
|
|
365
|
+
get serverRpcUrl() {
|
|
366
|
+
return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0];
|
|
367
|
+
},
|
|
368
|
+
usdcAddress: "",
|
|
369
|
+
balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
370
|
+
params: {
|
|
371
|
+
rpcUrls: ["https://fuse-mainnet.chainstacklabs.com"],
|
|
372
|
+
chainName: "Fuse",
|
|
373
|
+
nativeCurrency: {
|
|
374
|
+
decimals: 18,
|
|
375
|
+
name: "Fuse",
|
|
376
|
+
symbol: "fuse",
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: "Scroll",
|
|
382
|
+
chainId: 534352,
|
|
383
|
+
color: "#78d64b",
|
|
384
|
+
ankrName: 'scroll',
|
|
385
|
+
explorerUrl: "https://scrollscan.com",
|
|
386
|
+
viemChain: scroll,
|
|
387
|
+
fakeTransactionHash:
|
|
388
|
+
"0x6bf297c414264fc8cddd47224632b4426a02138df2f50fe891eca87f6aefea01",
|
|
389
|
+
get serverRpcUrl() {
|
|
390
|
+
return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0];
|
|
391
|
+
},
|
|
392
|
+
params: {
|
|
393
|
+
rpcUrls: ["https://rpc.scroll.io"],
|
|
394
|
+
chainName: "Scroll",
|
|
395
|
+
nativeCurrency: {
|
|
396
|
+
name: "Ethereum",
|
|
397
|
+
symbol: "ETH",
|
|
398
|
+
decimals: 18,
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: "opBNB",
|
|
404
|
+
chainId: 204,
|
|
405
|
+
color: "#78d64b",
|
|
406
|
+
explorerUrl: "https://opbnbscan.com",
|
|
407
|
+
viemChain: opBNB,
|
|
408
|
+
fakeTransactionHash:
|
|
409
|
+
"0xb9438a3eae61442bc7d419d79930370ce09ac0f46e0695025751e3bfe1a931e7",
|
|
410
|
+
get serverRpcUrl() {
|
|
411
|
+
return process.env?.OPBNB_RPC_URL || this.params.rpcUrls[0];
|
|
412
|
+
},
|
|
413
|
+
params: {
|
|
414
|
+
rpcUrls: ["https://opbnb-mainnet-rpc.bnbchain.org"],
|
|
415
|
+
chainName: "opBNB",
|
|
416
|
+
nativeCurrency: {
|
|
417
|
+
name: "BNB",
|
|
418
|
+
symbol: "BNB",
|
|
419
|
+
decimals: 18,
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
chainId: 34443,
|
|
425
|
+
name: "Mode",
|
|
426
|
+
color: "#d7ff00",
|
|
427
|
+
explorerUrl: 'https://explorer.mode.network',
|
|
428
|
+
fakeTransactionHash: '0xb58002db3481f2c51855a91280ec940d0bebec075c4b362b9f90c21a2b14edbe',
|
|
429
|
+
params: {
|
|
430
|
+
rpcUrls: ["https://1rpc.io/mode"],
|
|
431
|
+
chainName: "Mode",
|
|
432
|
+
nativeCurrency: {
|
|
433
|
+
name: "Ethereum",
|
|
434
|
+
symbol: "ETH",
|
|
435
|
+
decimals: 18,
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
get serverRpcUrl() {
|
|
439
|
+
return process.env?.MODE_RPC_URL || this.params.rpcUrls[0];
|
|
440
|
+
},
|
|
441
|
+
viemChain: mode,
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
chainId: 81457,
|
|
445
|
+
name: "Blast",
|
|
446
|
+
color: "#78d64b",
|
|
447
|
+
explorerUrl: 'https://blastscan.io',
|
|
448
|
+
fakeTransactionHash: '0x934ed8516242f8c08bb9e0e90bb1f989d92ceb6b0333e86ac2d555f25ac27e58',
|
|
449
|
+
params: {
|
|
450
|
+
rpcUrls: ['https://rpc.ankr.com/blast'],
|
|
451
|
+
chainName: "Blast",
|
|
452
|
+
nativeCurrency: {
|
|
453
|
+
name: "Ethereum",
|
|
454
|
+
symbol: "ETH",
|
|
455
|
+
decimals: 18,
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
get serverRpcUrl() {
|
|
459
|
+
return process.env?.BLAST_RPC_URL || this.params.rpcUrls[0];
|
|
460
|
+
},
|
|
461
|
+
viemChain: blast,
|
|
462
|
+
},
|
|
272
463
|
// {
|
|
273
|
-
// name: "
|
|
274
|
-
// chainId:
|
|
275
|
-
//
|
|
276
|
-
// color: "#78d64b",
|
|
277
|
-
// explorerUrl: "https://explorer.fuse.io",
|
|
278
|
-
// get serverRpcUrl() {
|
|
279
|
-
// return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0];
|
|
280
|
-
// },
|
|
281
|
-
// usdcAddress: "",
|
|
282
|
-
// balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
464
|
+
// name: "Manta Pacific",
|
|
465
|
+
// chainId: 169,
|
|
466
|
+
// explorerUrl: "https://pacific-explorer.manta.network",
|
|
283
467
|
// params: {
|
|
284
|
-
// rpcUrls: ["https://
|
|
285
|
-
// chainName: "
|
|
468
|
+
// rpcUrls: ["https://pacific-rpc.manta.network/http"],
|
|
469
|
+
// chainName: "Manta Pacific",
|
|
286
470
|
// nativeCurrency: {
|
|
471
|
+
// name: "Ethereum",
|
|
472
|
+
// symbol: "ETH",
|
|
287
473
|
// decimals: 18,
|
|
288
|
-
// name: "Fuse",
|
|
289
|
-
// symbol: "fuse",
|
|
290
474
|
// },
|
|
291
475
|
// },
|
|
476
|
+
// color: "#78d64b",
|
|
477
|
+
// fakeTransactionHash: "0x3fB128aA5AC254C8539996B11C587E521AE0d3ab",
|
|
478
|
+
// get serverRpcUrl() {
|
|
479
|
+
// return process.env?.MANTA_RPC_URL || this.params.rpcUrls[0];
|
|
480
|
+
// },
|
|
292
481
|
// },
|
|
293
482
|
{
|
|
294
483
|
name: AVO_PROD_CHAIN_NAME,
|
|
295
484
|
chainId: AVO_PROD_CHAIN_ID,
|
|
296
485
|
isAvocado: true,
|
|
297
486
|
balanceResolverAddress: "",
|
|
487
|
+
fakeTransactionHash: "",
|
|
488
|
+
viemChain: avocado,
|
|
298
489
|
color: "#16A34A",
|
|
299
490
|
usdcAddress: "",
|
|
300
491
|
serverRpcUrl: AVO_PROD_RPC_URL,
|
|
@@ -316,6 +507,8 @@ export const networks: Network[] = [
|
|
|
316
507
|
serverRpcUrl: AVO_STAGING_RPC_URL,
|
|
317
508
|
color: "#16A34A",
|
|
318
509
|
explorerUrl: AVO_STAGING_EXPLORER_URL,
|
|
510
|
+
viemChain: avocadoStaging,
|
|
511
|
+
fakeTransactionHash: "",
|
|
319
512
|
isAvocado: true,
|
|
320
513
|
balanceResolverAddress: "",
|
|
321
514
|
usdcAddress: "",
|
|
@@ -338,6 +531,7 @@ export const chainUsdcAddresses = [
|
|
|
338
531
|
{ chainId: 56, address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d" },
|
|
339
532
|
{ chainId: 100, address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83" },
|
|
340
533
|
{ chainId: 137, address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174" },
|
|
534
|
+
{ chainId: 137, address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359" },
|
|
341
535
|
{ chainId: 250, address: "0x04068da6c83afcfa0e13ba15a6696662335d5b75" },
|
|
342
536
|
{ chainId: 42161, address: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8" },
|
|
343
537
|
{ chainId: 42161, address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831" },
|
|
@@ -363,12 +557,16 @@ export const availableNetworks = networks.filter(
|
|
|
363
557
|
|
|
364
558
|
export const chainIdToName = (chainId: ChainId | number | string) => {
|
|
365
559
|
const network = getNetworkByChainId(chainId);
|
|
366
|
-
return network
|
|
560
|
+
return network?.name;
|
|
367
561
|
};
|
|
368
562
|
|
|
369
563
|
export const getRpcURLByChainId = (chainId: ChainId | number | string) => {
|
|
370
|
-
|
|
371
|
-
|
|
564
|
+
try {
|
|
565
|
+
const network = getNetworkByChainId(chainId);
|
|
566
|
+
return network.params.rpcUrls[0];
|
|
567
|
+
} catch (e) {
|
|
568
|
+
return "";
|
|
569
|
+
}
|
|
372
570
|
};
|
|
373
571
|
|
|
374
572
|
export const RPCMap = networks.reduce((acc, network) => {
|
|
@@ -410,5 +608,6 @@ export const getExplorerUrl = (
|
|
|
410
608
|
suffix: `/${string}` = "/"
|
|
411
609
|
) => {
|
|
412
610
|
const network = getNetworkByChainId(chainId);
|
|
611
|
+
if (!network) return "";
|
|
413
612
|
return `${network.explorerUrl}${suffix}`;
|
|
414
613
|
};
|
package/utils/utils.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Chain } from "viem";
|
|
2
|
+
|
|
1
3
|
declare global {
|
|
2
4
|
type ChainId =
|
|
3
5
|
| 1
|
|
@@ -13,7 +15,12 @@ declare global {
|
|
|
13
15
|
| 1313161554
|
|
14
16
|
| 8453
|
|
15
17
|
| 122
|
|
16
|
-
|
|
|
18
|
+
| 534352
|
|
19
|
+
| 204
|
|
20
|
+
| 63400
|
|
21
|
+
| 169
|
|
22
|
+
| 34443
|
|
23
|
+
| 81457
|
|
17
24
|
|
|
18
25
|
type ISlackMessageType = "danger" | "error" | "success" | "banner";
|
|
19
26
|
|
|
@@ -33,8 +40,10 @@ declare global {
|
|
|
33
40
|
isAvocado?: boolean;
|
|
34
41
|
serverRpcUrl: string | undefined;
|
|
35
42
|
balanceResolverAddress?: string;
|
|
36
|
-
usdcAddress
|
|
43
|
+
usdcAddress?: string;
|
|
37
44
|
explorerUrl: string;
|
|
45
|
+
fakeTransactionHash: string;
|
|
46
|
+
viemChain: Chain;
|
|
38
47
|
apiURL?: string;
|
|
39
48
|
params: {
|
|
40
49
|
chainName?: string;
|
|
@@ -72,8 +81,10 @@ declare global {
|
|
|
72
81
|
toChainId: string;
|
|
73
82
|
amount: string;
|
|
74
83
|
receiver: string;
|
|
84
|
+
provider?: string;
|
|
75
85
|
};
|
|
76
86
|
|
|
87
|
+
|
|
77
88
|
type AuthMetadataProps = {
|
|
78
89
|
address: string;
|
|
79
90
|
chainId: string;
|
|
@@ -99,6 +110,8 @@ declare global {
|
|
|
99
110
|
toChainId: string;
|
|
100
111
|
bridgeFee: string;
|
|
101
112
|
nativeToken: string;
|
|
113
|
+
version?: string;
|
|
114
|
+
provider: string;
|
|
102
115
|
};
|
|
103
116
|
|
|
104
117
|
type SwapMetadataProps = {
|