@tria-sdk/constants 5.2.3 → 5.2.5
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/.turbo/turbo-build.log +4 -4
- package/dist/cjs/chains.js +166 -79
- package/dist/cjs/config.js +26 -1
- package/dist/cjs/txn.js +21 -10
- package/dist/esm/chains.d.ts +13 -6
- package/dist/esm/chains.js +164 -78
- package/dist/esm/chains.js.map +1 -1
- package/dist/esm/config.d.ts +4 -0
- package/dist/esm/config.js +24 -0
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/txn.d.ts +11 -10
- package/dist/esm/txn.js +22 -11
- package/dist/esm/txn.js.map +1 -1
- package/dist/types/chains.d.ts +13 -6
- package/dist/types/config.d.ts +4 -0
- package/dist/types/txn.d.ts +11 -10
- package/package.json +1 -1
- package/src/chains.ts +172 -79
- package/src/config.ts +35 -0
- package/src/txn.ts +24 -10
package/src/chains.ts
CHANGED
|
@@ -14,6 +14,7 @@ export const xlayer = "XLAYER";
|
|
|
14
14
|
export const imx = "IMX";
|
|
15
15
|
export const eosg = "EOSG";
|
|
16
16
|
export const skale = "SKALE";
|
|
17
|
+
export const sei = "SEI";
|
|
17
18
|
|
|
18
19
|
export const zkLink: string = "ZKLINK-NOVA";
|
|
19
20
|
export const zkLinkTestnet: string = "ZKLINK-NOVA-TESTNET";
|
|
@@ -25,8 +26,13 @@ export const polygonAmoy: string = "AMOY";
|
|
|
25
26
|
export const vanarTestnet: string = "VANGUARD-VANAR-TESTNET";
|
|
26
27
|
export const skaleTestnet: string = "SKALE-TESTNET";
|
|
27
28
|
export const solanaDevnet = "SOLANA-DEVNET";
|
|
29
|
+
export const solana = "SOLANA";
|
|
28
30
|
export const injective = "INJECTIVE";
|
|
29
31
|
export const injectiveTestnet = "INJECTIVE-TESTNET";
|
|
32
|
+
export const binance = "BINANCE";
|
|
33
|
+
export const arbitrum = "ARBITRUM";
|
|
34
|
+
export const optimism = "OPTIMISM";
|
|
35
|
+
export const avalanche = "AVALANCHE";
|
|
30
36
|
|
|
31
37
|
export type ZKLINK = "ZKLINK-NOVA";
|
|
32
38
|
export type ZKLINK_TESTNET = "ZKLINK-NOVA-TESTNET";
|
|
@@ -48,6 +54,7 @@ export type XLAYER = "XLAYER";
|
|
|
48
54
|
export type IMX = "IMX";
|
|
49
55
|
export type EOSG = "EOSG";
|
|
50
56
|
export type SKALE = "SKALE";
|
|
57
|
+
export type SEI = "SEI";
|
|
51
58
|
|
|
52
59
|
export const TESTNET_CHAINS = [
|
|
53
60
|
sepolia,
|
|
@@ -70,13 +77,13 @@ export const TESTNET_CHAINS = [
|
|
|
70
77
|
];
|
|
71
78
|
|
|
72
79
|
export const SUPPORTED_EVM_CHAINS = [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"FANTOM",
|
|
80
|
+
ethereum,
|
|
81
|
+
polygon,
|
|
82
|
+
avalanche,
|
|
83
|
+
arbitrum,
|
|
84
|
+
binance,
|
|
85
|
+
optimism,
|
|
86
|
+
// "FANTOM",
|
|
80
87
|
"FUSE",
|
|
81
88
|
"FUSESPARK",
|
|
82
89
|
"MUMBAI",
|
|
@@ -106,30 +113,34 @@ export const SUPPORTED_EVM_CHAINS = [
|
|
|
106
113
|
imx,
|
|
107
114
|
eosg,
|
|
108
115
|
skale,
|
|
116
|
+
sei,
|
|
109
117
|
];
|
|
110
118
|
|
|
111
|
-
export const GAS_ABS_ENABLED_CHAINS = [sepolia,
|
|
119
|
+
export const GAS_ABS_ENABLED_CHAINS = [sepolia, polygon];
|
|
112
120
|
|
|
113
121
|
export const AA_SUPPORTED_EVM_CHAINS = [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"BINANCE",
|
|
122
|
+
arbitrum,
|
|
123
|
+
polygon,
|
|
117
124
|
"MUMBAI",
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
125
|
+
binance,
|
|
126
|
+
optimism,
|
|
127
|
+
avalanche,
|
|
121
128
|
"MANTLE",
|
|
122
|
-
|
|
129
|
+
base,
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
export const EIP7702_ENABLED_CHAINS: string[] = [
|
|
133
|
+
// sepolia, binance
|
|
123
134
|
];
|
|
124
135
|
|
|
125
136
|
export const ALLCHAINS = [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"FANTOM",
|
|
137
|
+
ethereum,
|
|
138
|
+
polygon,
|
|
139
|
+
avalanche,
|
|
140
|
+
arbitrum,
|
|
141
|
+
binance,
|
|
142
|
+
optimism,
|
|
143
|
+
// "FANTOM",
|
|
133
144
|
"FUSE",
|
|
134
145
|
"FUSESPARK",
|
|
135
146
|
"MUMBAI",
|
|
@@ -140,7 +151,7 @@ export const ALLCHAINS = [
|
|
|
140
151
|
"METIS-TESTNET",
|
|
141
152
|
"MANTLE",
|
|
142
153
|
"MANTLE-TESTNET",
|
|
143
|
-
|
|
154
|
+
solana,
|
|
144
155
|
solanaDevnet,
|
|
145
156
|
zkLink,
|
|
146
157
|
zkLinkTestnet,
|
|
@@ -163,6 +174,7 @@ export const ALLCHAINS = [
|
|
|
163
174
|
imx,
|
|
164
175
|
eosg,
|
|
165
176
|
skale,
|
|
177
|
+
sei,
|
|
166
178
|
];
|
|
167
179
|
|
|
168
180
|
const baseLogoUrl = "https://static.tria.so/chain-logo-w";
|
|
@@ -170,7 +182,7 @@ const baseLogoUrlBlack = "https://static.tria.so/chain-logo-b";
|
|
|
170
182
|
|
|
171
183
|
export const networks = [
|
|
172
184
|
{
|
|
173
|
-
chainName:
|
|
185
|
+
chainName: ethereum,
|
|
174
186
|
logo: `${baseLogoUrl}/Ethereum.webp`,
|
|
175
187
|
type: "mainnet",
|
|
176
188
|
},
|
|
@@ -179,13 +191,13 @@ export const networks = [
|
|
|
179
191
|
logo: `${baseLogoUrl}/Ethereum.webp`,
|
|
180
192
|
type: "testnet",
|
|
181
193
|
},
|
|
194
|
+
// {
|
|
195
|
+
// chainName: "FANTOM",
|
|
196
|
+
// logo: `${baseLogoUrl}/Fantom.webp`,
|
|
197
|
+
// type: "mainnet",
|
|
198
|
+
// },
|
|
182
199
|
{
|
|
183
|
-
chainName:
|
|
184
|
-
logo: `${baseLogoUrl}/Fantom.webp`,
|
|
185
|
-
type: "mainnet",
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
chainName: "POLYGON",
|
|
200
|
+
chainName: polygon,
|
|
189
201
|
logo: `${baseLogoUrl}/Polygon.svg`,
|
|
190
202
|
type: "mainnet",
|
|
191
203
|
},
|
|
@@ -195,17 +207,17 @@ export const networks = [
|
|
|
195
207
|
type: "testnet",
|
|
196
208
|
},
|
|
197
209
|
{
|
|
198
|
-
chainName:
|
|
210
|
+
chainName: avalanche,
|
|
199
211
|
logo: `${baseLogoUrl}/Avalanche.webp`,
|
|
200
212
|
type: "mainnet",
|
|
201
213
|
},
|
|
202
214
|
{
|
|
203
|
-
chainName:
|
|
215
|
+
chainName: optimism,
|
|
204
216
|
logo: `${baseLogoUrl}/Optimism.webp`,
|
|
205
217
|
type: "mainnet",
|
|
206
218
|
},
|
|
207
219
|
{
|
|
208
|
-
chainName:
|
|
220
|
+
chainName: arbitrum,
|
|
209
221
|
logo: `${baseLogoUrl}/Arbitrum.webp`,
|
|
210
222
|
type: "mainnet",
|
|
211
223
|
},
|
|
@@ -225,7 +237,7 @@ export const networks = [
|
|
|
225
237
|
type: "testnet",
|
|
226
238
|
},
|
|
227
239
|
{
|
|
228
|
-
chainName:
|
|
240
|
+
chainName: binance,
|
|
229
241
|
logo: `${baseLogoUrl}/Binance.svg`,
|
|
230
242
|
type: "mainnet",
|
|
231
243
|
},
|
|
@@ -264,7 +276,7 @@ export const networks = [
|
|
|
264
276
|
type: "testnet",
|
|
265
277
|
},
|
|
266
278
|
{
|
|
267
|
-
chainName:
|
|
279
|
+
chainName: solana,
|
|
268
280
|
logo: `${baseLogoUrl}/Solana.webp`,
|
|
269
281
|
type: "mainnet",
|
|
270
282
|
},
|
|
@@ -373,29 +385,34 @@ export const networks = [
|
|
|
373
385
|
logo: `${baseLogoUrl}/skale.webp`,
|
|
374
386
|
type: "mainnet",
|
|
375
387
|
},
|
|
388
|
+
{
|
|
389
|
+
chainName: sei,
|
|
390
|
+
logo: `${baseLogoUrl}/Sei.webp`,
|
|
391
|
+
type: "mainnet",
|
|
392
|
+
},
|
|
376
393
|
];
|
|
377
394
|
|
|
378
395
|
export const chainNameToLogo = {
|
|
379
|
-
|
|
396
|
+
[ethereum]: `${baseLogoUrl}/Ethereum.webp`,
|
|
380
397
|
[sepolia]: `${baseLogoUrl}/Ethereum.webp`,
|
|
381
|
-
FANTOM: `${baseLogoUrl}/Fantom.webp`,
|
|
382
|
-
|
|
398
|
+
// FANTOM: `${baseLogoUrl}/Fantom.webp`,
|
|
399
|
+
[polygon]: `${baseLogoUrl}/Polygon.webp`,
|
|
383
400
|
[polygonAmoy]: `${baseLogoUrl}/Polygon.webp`,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
401
|
+
[avalanche]: `${baseLogoUrl}/Avalanche.webp`,
|
|
402
|
+
[optimism]: `${baseLogoUrl}/Optimism.webp`,
|
|
403
|
+
[arbitrum]: `${baseLogoUrl}/Arbitrum.webp`,
|
|
387
404
|
LINEA: `${baseLogoUrl}/Linea.webp`,
|
|
388
405
|
MUMBAI: `${baseLogoUrl}/Polygon.webp`,
|
|
389
406
|
FUSE: `${baseLogoUrl}/Fuse.webp`,
|
|
390
407
|
FUSESPARK: `${baseLogoUrl}/Fuse.webp`,
|
|
391
|
-
|
|
408
|
+
[binance]: `${baseLogoUrl}/Binance.svg`,
|
|
392
409
|
MANTA: `${baseLogoUrl}/Manta.webp`,
|
|
393
410
|
"MANTA-TESTNET": `${baseLogoUrl}/Manta.webp`,
|
|
394
411
|
METIS: `${baseLogoUrl}/Metis.webp`,
|
|
395
412
|
"METIS-TESTNET": `${baseLogoUrl}/Metis.webp`,
|
|
396
413
|
MANTLE: `${baseLogoUrl}/Mantle.webp`,
|
|
397
414
|
"MANTLE-TESTNET": `${baseLogoUrl}/Mantle.webp`,
|
|
398
|
-
|
|
415
|
+
[solana]: `${baseLogoUrl}/Solana.webp`,
|
|
399
416
|
[solanaDevnet]: `${baseLogoUrl}/Solana.webp`,
|
|
400
417
|
[zkLink]: `${baseLogoUrl}/zklink.webp`,
|
|
401
418
|
[zkLinkTestnet]: `${baseLogoUrl}/zklink.webp`,
|
|
@@ -417,17 +434,18 @@ export const chainNameToLogo = {
|
|
|
417
434
|
[imx]: `${baseLogoUrl}/IMX.webp`,
|
|
418
435
|
[eosg]: `${baseLogoUrl}/EOSG.webp`,
|
|
419
436
|
[skale]: `${baseLogoUrl}/skale.webp`,
|
|
437
|
+
[sei]: `${baseLogoUrl}/Sei.webp`,
|
|
420
438
|
};
|
|
421
439
|
export const chainNameToLogoAverageColor: { [key: string]: string } = {
|
|
422
|
-
|
|
423
|
-
|
|
440
|
+
[ethereum]: "rgba(98,126,235,0.7)",
|
|
441
|
+
[polygon]: "rgba(131,69,231,0.7)",
|
|
424
442
|
SEPOLIA: "rgba(98,126,235,0.7)",
|
|
425
|
-
FANTOM: "rgba(19,181,235,0.7)",
|
|
443
|
+
// FANTOM: "rgba(19,181,235,0.7)",
|
|
426
444
|
AMOY: "rgba(131,69,231,0.7)",
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
LINEA: "
|
|
445
|
+
[avalanche]: "rgba(232,65,67,0.7)",
|
|
446
|
+
[arbitrum]: "rgba(17,170,255,0.7)",
|
|
447
|
+
[optimism]: "rgba(255,5,32,0.7)",
|
|
448
|
+
LINEA: "rgba(51,51,51,0.7)",
|
|
431
449
|
MUMBAI: "rgba(131,69,231,0.7)",
|
|
432
450
|
FUSESPARK: "rgba(180,249,185,0.7)",
|
|
433
451
|
FUSE: "rgba(180,249,185,0.7)",
|
|
@@ -435,27 +453,44 @@ export const chainNameToLogoAverageColor: { [key: string]: string } = {
|
|
|
435
453
|
"MANTA-TESTNET": "rgba(98,126,235,0.7)",
|
|
436
454
|
"METIS-TESTNET": "rgba(18,171,225,0.7)",
|
|
437
455
|
METIS: "rgba(18,171,225,0.7)",
|
|
438
|
-
|
|
439
|
-
"MANTLE-TESTNET": "
|
|
440
|
-
MANTLE: "
|
|
456
|
+
[solana]: "rgba(131, 83, 238, 0.7)",
|
|
457
|
+
"MANTLE-TESTNET": "rgba(66,66,66,0.7)",
|
|
458
|
+
MANTLE: "rgba(66,66,66,0.7)",
|
|
441
459
|
"BITLAYER-TESTNET": "rgba(226,110,26,0.7)",
|
|
442
|
-
"ZKLINK-NOVA": "
|
|
443
|
-
"ZKLINK-NOVA-TESTNET": "
|
|
460
|
+
"ZKLINK-NOVA": "rgba(63,81,181,0.7)",
|
|
461
|
+
"ZKLINK-NOVA-TESTNET": "rgba(63,81,181,0.7)",
|
|
444
462
|
"NEOX-TESTNET": "rgba(1,229,155,0.7)",
|
|
445
463
|
"VANGUARD-VANAR-TESTNET": "rgba(71, 51, 147,0.7)",
|
|
446
|
-
|
|
464
|
+
[binance]: "rgba(240,185,11,0.7)",
|
|
465
|
+
|
|
466
|
+
[base]: "rgba(0,82,255,0.7)",
|
|
467
|
+
[bitlayerMainnet]: "rgba(226,110,26,0.7)",
|
|
468
|
+
[injective]: "rgba(40,44,52,0.7)",
|
|
469
|
+
[matChain]: "rgba(98,126,235,0.7)",
|
|
470
|
+
[saakuru]: "rgba(98,73,227,0.7)",
|
|
471
|
+
[oasys]: "rgba(20,175,125,0.7)",
|
|
472
|
+
[xlayer]: "rgba(30,143,217,0.7)",
|
|
473
|
+
[imx]: "rgba(86,35,180,0.7)",
|
|
474
|
+
[eosg]: "rgba(0,0,0,0.7)",
|
|
475
|
+
[skale]: "rgba(72,138,240,0.7)",
|
|
476
|
+
[solanaDevnet]: "rgba(20,241,149,0.7)",
|
|
477
|
+
[skaleTestnet]: "rgba(72,138,240,0.7)",
|
|
478
|
+
[injectiveTestnet]: "rgba(40,44,52,0.7)",
|
|
479
|
+
[matChainTestnet]: "rgba(98,126,235,0.7)",
|
|
480
|
+
[baseTestnet]: "rgba(0,82,255,0.7)",
|
|
481
|
+
[berachainBartio]: "rgba(252,186,3,0.7)",
|
|
447
482
|
};
|
|
448
483
|
|
|
449
484
|
export const chainNameToLogoBlack = {
|
|
450
|
-
|
|
485
|
+
[ethereum]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
451
486
|
[sepolia]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
452
|
-
|
|
453
|
-
FANTOM: `${baseLogoUrlBlack}/Fantom.webp`,
|
|
454
|
-
|
|
487
|
+
[binance]: `${baseLogoUrlBlack}/binance.svg`,
|
|
488
|
+
// FANTOM: `${baseLogoUrlBlack}/Fantom.webp`,
|
|
489
|
+
[polygon]: `${baseLogoUrlBlack}/Polygon.webp`,
|
|
455
490
|
[polygonAmoy]: `${baseLogoUrlBlack}/Polygon.webp`,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
491
|
+
[avalanche]: `${baseLogoUrlBlack}/Avalanche.webp`,
|
|
492
|
+
[optimism]: `${baseLogoUrlBlack}/Optimism.webp`,
|
|
493
|
+
[arbitrum]: `${baseLogoUrlBlack}/Arbitrum.webp`,
|
|
459
494
|
LINEA: `${baseLogoUrlBlack}/Linea.webp`,
|
|
460
495
|
MUMBAI: `${baseLogoUrlBlack}/Polygon.webp`,
|
|
461
496
|
FUSE: `${baseLogoUrlBlack}/fuse.webp`,
|
|
@@ -466,7 +501,7 @@ export const chainNameToLogoBlack = {
|
|
|
466
501
|
"METIS-TESTNET": `${baseLogoUrlBlack}/Metis.webp`,
|
|
467
502
|
MANTLE: `${baseLogoUrlBlack}/Mantle.webp`,
|
|
468
503
|
"MANTLE-TESTNET": `${baseLogoUrlBlack}/Mantle.webp`,
|
|
469
|
-
|
|
504
|
+
[solana]: `${baseLogoUrlBlack}/Solana.webp`,
|
|
470
505
|
[solanaDevnet]: `${baseLogoUrlBlack}/Solana.webp`,
|
|
471
506
|
[zkLink]: `${baseLogoUrlBlack}/zklink.webp`,
|
|
472
507
|
[zkLinkTestnet]: `${baseLogoUrlBlack}/zklink.webp`,
|
|
@@ -488,18 +523,19 @@ export const chainNameToLogoBlack = {
|
|
|
488
523
|
[imx]: `${baseLogoUrlBlack}/IMX.webp`,
|
|
489
524
|
[eosg]: `${baseLogoUrlBlack}/EOSG.webp`,
|
|
490
525
|
[skale]: `${baseLogoUrlBlack}/skale.webp`,
|
|
526
|
+
[sei]: `${baseLogoUrlBlack}/Sei.webp`,
|
|
491
527
|
};
|
|
492
528
|
|
|
493
529
|
export const chainNameToLogoBlackAverageColor = {
|
|
494
|
-
FANTOM: [
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
],
|
|
501
|
-
|
|
502
|
-
|
|
530
|
+
// FANTOM: [
|
|
531
|
+
// { color: "rgb(255,255,255)", count: 25004 },
|
|
532
|
+
// { color: "rgb(132,132,132)", count: 3219 },
|
|
533
|
+
// { color: "rgb(143,143,143)", count: 2392 },
|
|
534
|
+
// { color: "rgb(114,114,114)", count: 2283 },
|
|
535
|
+
// { color: "rgb(254,254,254)", count: 2250 },
|
|
536
|
+
// ],
|
|
537
|
+
|
|
538
|
+
[polygon]: [
|
|
503
539
|
{ color: "rgb(255,255,255)", count: 26414 },
|
|
504
540
|
{ color: "rgb(132,132,132)", count: 3390 },
|
|
505
541
|
{ color: "rgb(128,128,128)", count: 2783 },
|
|
@@ -507,7 +543,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
507
543
|
{ color: "rgb(118,118,118)", count: 2387 },
|
|
508
544
|
],
|
|
509
545
|
|
|
510
|
-
|
|
546
|
+
[ethereum]: [
|
|
511
547
|
{ color: "rgb(255,255,255)", count: 23340 },
|
|
512
548
|
{ color: "rgb(132,132,132)", count: 2559 },
|
|
513
549
|
{ color: "rgb(111,111,111)", count: 2372 },
|
|
@@ -531,7 +567,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
531
567
|
{ color: "rgb(118,118,118)", count: 2387 },
|
|
532
568
|
],
|
|
533
569
|
|
|
534
|
-
|
|
570
|
+
[arbitrum]: [
|
|
535
571
|
{ color: "rgb(255,255,255)", count: 37899 },
|
|
536
572
|
{ color: "rgb(143,143,143)", count: 2422 },
|
|
537
573
|
{ color: "rgb(111,111,111)", count: 2106 },
|
|
@@ -539,7 +575,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
539
575
|
{ color: "rgb(254,254,254)", count: 1913 },
|
|
540
576
|
],
|
|
541
577
|
|
|
542
|
-
|
|
578
|
+
[optimism]: [
|
|
543
579
|
{ color: "rgb(255,255,255)", count: 27023 },
|
|
544
580
|
{ color: "rgb(132,132,132)", count: 3031 },
|
|
545
581
|
{ color: "rgb(111,111,111)", count: 2578 },
|
|
@@ -555,7 +591,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
555
591
|
{ color: "rgb(143,143,143)", count: 2740 },
|
|
556
592
|
],
|
|
557
593
|
|
|
558
|
-
|
|
594
|
+
[avalanche]: [
|
|
559
595
|
{ color: "rgb(255,255,255)", count: 28225 },
|
|
560
596
|
{ color: "rgb(132,132,132)", count: 3609 },
|
|
561
597
|
{ color: "rgb(111,111,111)", count: 2934 },
|
|
@@ -619,7 +655,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
619
655
|
{ color: "rgb(16,16,157)", count: 758 },
|
|
620
656
|
],
|
|
621
657
|
|
|
622
|
-
|
|
658
|
+
[solana]: [
|
|
623
659
|
{ color: "rgb(255,255,255)", count: 32241 },
|
|
624
660
|
{ color: "rgb(132,132,132)", count: 3455 },
|
|
625
661
|
{ color: "rgb(254,254,254)", count: 2440 },
|
|
@@ -683,7 +719,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
683
719
|
{ color: "rgb(255,0,255)", count: 2892 },
|
|
684
720
|
],
|
|
685
721
|
|
|
686
|
-
|
|
722
|
+
[binance]: [
|
|
687
723
|
{ color: "rgb(0,0,0)", count: 2614 },
|
|
688
724
|
{ color: "rgb(255,255,255)", count: 1676 },
|
|
689
725
|
{ color: "rgb(15,15,15)", count: 974 },
|
|
@@ -691,3 +727,60 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
691
727
|
{ color: "rgb(17,17,17)", count: 56 },
|
|
692
728
|
],
|
|
693
729
|
};
|
|
730
|
+
export const coingeckoPlatformMap: Record<string, string> = {
|
|
731
|
+
ETH: "ethereum",
|
|
732
|
+
POLYGON: "polygon-pos",
|
|
733
|
+
AVALANCHE: "avalanche",
|
|
734
|
+
OPTIMISM: "optimistic-ethereum",
|
|
735
|
+
ARBITRUM: "arbitrum-one",
|
|
736
|
+
BINANCE: "binance-smart-chain",
|
|
737
|
+
FUSE: "fuse",
|
|
738
|
+
METIS: "metis-andromeda",
|
|
739
|
+
MANTA: "manta",
|
|
740
|
+
MANTLE: "mantle",
|
|
741
|
+
SOLANA: "solana",
|
|
742
|
+
ZKLINK: "zklink",
|
|
743
|
+
BITLAYERMAINNET: "bitlayer",
|
|
744
|
+
INJECTIVE: "injective",
|
|
745
|
+
MATCHAIN: "matchain",
|
|
746
|
+
BASE: "base",
|
|
747
|
+
SAAKURU: "saakuru",
|
|
748
|
+
OASYS: "oasys",
|
|
749
|
+
XLAYER: "xlayer",
|
|
750
|
+
IMX: "immutable-x",
|
|
751
|
+
EOSG: "eos",
|
|
752
|
+
SKALE: "skale",
|
|
753
|
+
SEI: "sei-network",
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
export const getCoingeckoPlatformIdFromChainName = (
|
|
757
|
+
chainName: string
|
|
758
|
+
): string | undefined => {
|
|
759
|
+
return coingeckoPlatformMap[chainName.toUpperCase()];
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
export const nativeTokenIdMap: Record<string, string> = {
|
|
763
|
+
ETH: "ethereum",
|
|
764
|
+
OPTIMISM: "ethereum",
|
|
765
|
+
ARBITRUM: "ethereum",
|
|
766
|
+
BASE: "ethereum",
|
|
767
|
+
MANTLE: "ethereum",
|
|
768
|
+
METIS: "ethereum",
|
|
769
|
+
ZKLINK: "ethereum",
|
|
770
|
+
XLAYER: "ethereum",
|
|
771
|
+
BITLAYERMAINNET: "ethereum",
|
|
772
|
+
POLYGON: "matic-network",
|
|
773
|
+
AVALANCHE: "avalanche-2",
|
|
774
|
+
FUSE: "fuse-network-token",
|
|
775
|
+
BINANCE: "binancecoin",
|
|
776
|
+
MANTA: "manta-network",
|
|
777
|
+
SOLANA: "solana",
|
|
778
|
+
INJECTIVE: "injective-protocol",
|
|
779
|
+
MATCHAIN: "matchain",
|
|
780
|
+
SAAKURU: "saakuru",
|
|
781
|
+
OASYS: "oasys",
|
|
782
|
+
IMX: "immutable-x",
|
|
783
|
+
EOSG: "eos",
|
|
784
|
+
SKALE: "skale",
|
|
785
|
+
SEI: "sei",
|
|
786
|
+
};
|
package/src/config.ts
CHANGED
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
} from "./chains";
|
|
8
8
|
|
|
9
9
|
export const prodApiUrl = "https://production.tria.so";
|
|
10
|
+
const solanaRegex = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
|
|
11
|
+
const injectiveRegex = /^inj1[a-zA-Z0-9]{38}$/;
|
|
10
12
|
|
|
11
13
|
export const isEvmChain = (chainName: string) => {
|
|
12
14
|
return SUPPORTED_EVM_CHAINS.includes(chainName) || chainName == "EVM";
|
|
@@ -27,3 +29,36 @@ export const isTestnetChain = (chainName: string) => {
|
|
|
27
29
|
export const isGasAbsEnabled = (chainName: string) => {
|
|
28
30
|
return GAS_ABS_ENABLED_CHAINS.includes(chainName);
|
|
29
31
|
};
|
|
32
|
+
|
|
33
|
+
export const getChainNameFromAddress = (
|
|
34
|
+
address?: string
|
|
35
|
+
): {
|
|
36
|
+
isValidAddress: boolean;
|
|
37
|
+
chainName: "EVM" | "TRIANAME" | "SOLANA" | "INJECTIVE" | "NONE";
|
|
38
|
+
} => {
|
|
39
|
+
if (!address) {
|
|
40
|
+
return { isValidAddress: false, chainName: "NONE" };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const isTriaName = address?.includes("@");
|
|
44
|
+
if (isTriaName) {
|
|
45
|
+
return { isValidAddress: true, chainName: "TRIANAME" };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const isSolanaAddress = solanaRegex.test(address);
|
|
49
|
+
if (isSolanaAddress) {
|
|
50
|
+
return { isValidAddress: true, chainName: "SOLANA" };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const isInjectiveAddress = injectiveRegex.test(address);
|
|
54
|
+
if (isInjectiveAddress) {
|
|
55
|
+
return { isValidAddress: true, chainName: "INJECTIVE" };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const isEvmAddress = address.startsWith("0x");
|
|
59
|
+
if (isEvmAddress) {
|
|
60
|
+
return { isValidAddress: true, chainName: "EVM" };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return { isValidAddress: false, chainName: "NONE" };
|
|
64
|
+
};
|
package/src/txn.ts
CHANGED
|
@@ -22,6 +22,8 @@ import {
|
|
|
22
22
|
imx,
|
|
23
23
|
eosg,
|
|
24
24
|
skale,
|
|
25
|
+
solana,
|
|
26
|
+
sei,
|
|
25
27
|
} from "./chains";
|
|
26
28
|
|
|
27
29
|
export const explorerBaseUrls = {
|
|
@@ -33,7 +35,7 @@ export const explorerBaseUrls = {
|
|
|
33
35
|
ARBITRUM: "https://arbiscan.io",
|
|
34
36
|
BINANCE: "https://bscscan.com",
|
|
35
37
|
OPTIMISM: "https://optimistic.etherscan.io",
|
|
36
|
-
FANTOM: "https://ftmscan.com",
|
|
38
|
+
// FANTOM: "https://ftmscan.com",
|
|
37
39
|
SOLANA: "https://solscan.io",
|
|
38
40
|
[solanaDevnet]: "https://solscan.io",
|
|
39
41
|
APTOS: "https://explorer.aptoslabs.com",
|
|
@@ -69,6 +71,7 @@ export const explorerBaseUrls = {
|
|
|
69
71
|
[imx]: "https://explorer.immutable.com",
|
|
70
72
|
[eosg]: "https://empireofsight-2732633231529000-1.sagaexplorer.io",
|
|
71
73
|
[skale]: "https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com",
|
|
74
|
+
[sei]: "https://seitrace.com",
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
export const txnBaseUrl = {
|
|
@@ -80,7 +83,7 @@ export const txnBaseUrl = {
|
|
|
80
83
|
ARBITRUM: `${explorerBaseUrls.ARBITRUM}/tx`,
|
|
81
84
|
BINANCE: `${explorerBaseUrls.BINANCE}/tx`,
|
|
82
85
|
OPTIMISM: `${explorerBaseUrls.OPTIMISM}/tx`,
|
|
83
|
-
FANTOM: `${explorerBaseUrls.FANTOM}/tx`,
|
|
86
|
+
// FANTOM: `${explorerBaseUrls.FANTOM}/tx`,
|
|
84
87
|
FUSE: `${explorerBaseUrls.FUSE}/tx`,
|
|
85
88
|
FUSESPARK: `${explorerBaseUrls.FUSESPARK}/tx`,
|
|
86
89
|
MUMBAI: `${explorerBaseUrls.MUMBAI}/tx`,
|
|
@@ -112,6 +115,7 @@ export const txnBaseUrl = {
|
|
|
112
115
|
[imx]: `${explorerBaseUrls[imx]}/tx`,
|
|
113
116
|
[eosg]: `${explorerBaseUrls[eosg]}/tx`,
|
|
114
117
|
[skale]: `${explorerBaseUrls[skale]}/tx`,
|
|
118
|
+
[sei]: `${explorerBaseUrls[sei]}/tx`,
|
|
115
119
|
};
|
|
116
120
|
|
|
117
121
|
export const nativeTokenDetails = {
|
|
@@ -160,11 +164,11 @@ export const nativeTokenDetails = {
|
|
|
160
164
|
logoUrl:
|
|
161
165
|
"https://www.datocms-assets.com/86369/1670347461-optimisim-colour.png",
|
|
162
166
|
},
|
|
163
|
-
FANTOM: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
},
|
|
167
|
+
// FANTOM: {
|
|
168
|
+
// name: "Fantom",
|
|
169
|
+
// symbol: "FTM",
|
|
170
|
+
// logoUrl: "https://www.datocms-assets.com/86369/1669925359-fantom-1.png",
|
|
171
|
+
// },
|
|
168
172
|
FUSE: {
|
|
169
173
|
name: "Fuse",
|
|
170
174
|
symbol: "FUSE",
|
|
@@ -327,6 +331,12 @@ export const nativeTokenDetails = {
|
|
|
327
331
|
logoUrl:
|
|
328
332
|
"https://assets.coingecko.com/coins/images/13564/standard/SFUEL.png?1696513318",
|
|
329
333
|
},
|
|
334
|
+
[sei]: {
|
|
335
|
+
name: "SEI",
|
|
336
|
+
symbol: "SEI",
|
|
337
|
+
logoUrl:
|
|
338
|
+
"https://static.tria.so/chain-logo-w/Sei.webp",
|
|
339
|
+
},
|
|
330
340
|
};
|
|
331
341
|
|
|
332
342
|
const alchemyKey = "kcuWVV9ss_iLWJ2Lw6xdHbmtZYixfY7Z";
|
|
@@ -341,7 +351,7 @@ export const rpcUrls = {
|
|
|
341
351
|
ARBITRUM: `https://arb-mainnet.g.alchemy.com/v2/${alchemyKey}`, //"https://arbitrum-one.publicnode.com",
|
|
342
352
|
BINANCE: `https://bnb-mainnet.g.alchemy.com/v2/${alchemyKey}`, //"https://bsc.publicnode.com",
|
|
343
353
|
OPTIMISM: `https://opt-mainnet.g.alchemy.com/v2/${alchemyKey}`, //"https://optimism.meowrpc.com",
|
|
344
|
-
FANTOM: `https://fantom-mainnet.g.alchemy.com/v2/${alchemyKey}`, //"https://fantom.publicnode.com",
|
|
354
|
+
// FANTOM: `https://fantom-mainnet.g.alchemy.com/v2/${alchemyKey}`, //"https://fantom.publicnode.com",
|
|
345
355
|
FUSE: "https://rpc.fuse.io",
|
|
346
356
|
FUSESPARK: "https://rpc.fusespark.io",
|
|
347
357
|
MANTA: "https://1rpc.io/manta",
|
|
@@ -368,6 +378,7 @@ export const rpcUrls = {
|
|
|
368
378
|
[imx]: "https://rpc.immutable.com",
|
|
369
379
|
[eosg]: "https://empireofsight-2732633231529000-1.jsonrpc.sagarpc.io",
|
|
370
380
|
[skale]: "https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague",
|
|
381
|
+
[sei]: `https://sei-mainnet.g.alchemy.com/v2/${alchemyKey}`,
|
|
371
382
|
};
|
|
372
383
|
|
|
373
384
|
export const chainNameToChainId = {
|
|
@@ -380,7 +391,7 @@ export const chainNameToChainId = {
|
|
|
380
391
|
ARBITRUM: 42161,
|
|
381
392
|
BINANCE: 56,
|
|
382
393
|
OPTIMISM: 10,
|
|
383
|
-
FANTOM: 250,
|
|
394
|
+
// FANTOM: 250,
|
|
384
395
|
FUSE: 122,
|
|
385
396
|
FUSESPARK: 123,
|
|
386
397
|
MANTA: 169,
|
|
@@ -407,6 +418,7 @@ export const chainNameToChainId = {
|
|
|
407
418
|
[imx]: 13371,
|
|
408
419
|
[eosg]: 2732633231529000,
|
|
409
420
|
[skale]: 1564830818,
|
|
421
|
+
[sei]: 1329,
|
|
410
422
|
};
|
|
411
423
|
|
|
412
424
|
export const chainIdToChainName = {
|
|
@@ -419,7 +431,7 @@ export const chainIdToChainName = {
|
|
|
419
431
|
42161: "ARBITRUM",
|
|
420
432
|
56: "BINANCE",
|
|
421
433
|
10: "OPTIMISM",
|
|
422
|
-
250: "FANTOM",
|
|
434
|
+
// 250: "FANTOM",
|
|
423
435
|
122: "FUSE",
|
|
424
436
|
123: "FUSESPARK",
|
|
425
437
|
5000: "MANTLE",
|
|
@@ -446,4 +458,6 @@ export const chainIdToChainName = {
|
|
|
446
458
|
13371: imx,
|
|
447
459
|
2732633231529000: eosg,
|
|
448
460
|
1564830818: skale,
|
|
461
|
+
1151111081099710: solana,
|
|
462
|
+
1329: sei,
|
|
449
463
|
};
|