@tria-sdk/constants 5.2.1 → 5.2.4
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 +164 -79
- package/dist/cjs/config.js +26 -1
- package/dist/cjs/txn.js +21 -10
- package/dist/cjs/web3Platforms.js +4 -0
- package/dist/esm/chains.d.ts +12 -6
- package/dist/esm/chains.js +162 -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/esm/web3Platforms.d.ts +3 -1
- package/dist/esm/web3Platforms.js +4 -0
- package/dist/esm/web3Platforms.js.map +1 -1
- package/dist/types/chains.d.ts +12 -6
- package/dist/types/config.d.ts +4 -0
- package/dist/types/txn.d.ts +11 -10
- package/dist/types/web3Platforms.d.ts +3 -1
- package/package.json +1 -1
- package/src/chains.ts +169 -79
- package/src/config.ts +35 -0
- package/src/txn.ts +24 -10
- package/src/web3Platforms.ts +4 -0
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,32 @@ 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,
|
|
123
130
|
];
|
|
124
131
|
|
|
132
|
+
export const EIP7702_ENABLED_CHAINS = [sepolia, binance];
|
|
133
|
+
|
|
125
134
|
export const ALLCHAINS = [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"FANTOM",
|
|
135
|
+
ethereum,
|
|
136
|
+
polygon,
|
|
137
|
+
avalanche,
|
|
138
|
+
arbitrum,
|
|
139
|
+
binance,
|
|
140
|
+
optimism,
|
|
141
|
+
// "FANTOM",
|
|
133
142
|
"FUSE",
|
|
134
143
|
"FUSESPARK",
|
|
135
144
|
"MUMBAI",
|
|
@@ -140,7 +149,7 @@ export const ALLCHAINS = [
|
|
|
140
149
|
"METIS-TESTNET",
|
|
141
150
|
"MANTLE",
|
|
142
151
|
"MANTLE-TESTNET",
|
|
143
|
-
|
|
152
|
+
solana,
|
|
144
153
|
solanaDevnet,
|
|
145
154
|
zkLink,
|
|
146
155
|
zkLinkTestnet,
|
|
@@ -163,6 +172,7 @@ export const ALLCHAINS = [
|
|
|
163
172
|
imx,
|
|
164
173
|
eosg,
|
|
165
174
|
skale,
|
|
175
|
+
sei,
|
|
166
176
|
];
|
|
167
177
|
|
|
168
178
|
const baseLogoUrl = "https://static.tria.so/chain-logo-w";
|
|
@@ -170,7 +180,7 @@ const baseLogoUrlBlack = "https://static.tria.so/chain-logo-b";
|
|
|
170
180
|
|
|
171
181
|
export const networks = [
|
|
172
182
|
{
|
|
173
|
-
chainName:
|
|
183
|
+
chainName: ethereum,
|
|
174
184
|
logo: `${baseLogoUrl}/Ethereum.webp`,
|
|
175
185
|
type: "mainnet",
|
|
176
186
|
},
|
|
@@ -179,13 +189,13 @@ export const networks = [
|
|
|
179
189
|
logo: `${baseLogoUrl}/Ethereum.webp`,
|
|
180
190
|
type: "testnet",
|
|
181
191
|
},
|
|
192
|
+
// {
|
|
193
|
+
// chainName: "FANTOM",
|
|
194
|
+
// logo: `${baseLogoUrl}/Fantom.webp`,
|
|
195
|
+
// type: "mainnet",
|
|
196
|
+
// },
|
|
182
197
|
{
|
|
183
|
-
chainName:
|
|
184
|
-
logo: `${baseLogoUrl}/Fantom.webp`,
|
|
185
|
-
type: "mainnet",
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
chainName: "POLYGON",
|
|
198
|
+
chainName: polygon,
|
|
189
199
|
logo: `${baseLogoUrl}/Polygon.svg`,
|
|
190
200
|
type: "mainnet",
|
|
191
201
|
},
|
|
@@ -195,17 +205,17 @@ export const networks = [
|
|
|
195
205
|
type: "testnet",
|
|
196
206
|
},
|
|
197
207
|
{
|
|
198
|
-
chainName:
|
|
208
|
+
chainName: avalanche,
|
|
199
209
|
logo: `${baseLogoUrl}/Avalanche.webp`,
|
|
200
210
|
type: "mainnet",
|
|
201
211
|
},
|
|
202
212
|
{
|
|
203
|
-
chainName:
|
|
213
|
+
chainName: optimism,
|
|
204
214
|
logo: `${baseLogoUrl}/Optimism.webp`,
|
|
205
215
|
type: "mainnet",
|
|
206
216
|
},
|
|
207
217
|
{
|
|
208
|
-
chainName:
|
|
218
|
+
chainName: arbitrum,
|
|
209
219
|
logo: `${baseLogoUrl}/Arbitrum.webp`,
|
|
210
220
|
type: "mainnet",
|
|
211
221
|
},
|
|
@@ -225,7 +235,7 @@ export const networks = [
|
|
|
225
235
|
type: "testnet",
|
|
226
236
|
},
|
|
227
237
|
{
|
|
228
|
-
chainName:
|
|
238
|
+
chainName: binance,
|
|
229
239
|
logo: `${baseLogoUrl}/Binance.svg`,
|
|
230
240
|
type: "mainnet",
|
|
231
241
|
},
|
|
@@ -264,7 +274,7 @@ export const networks = [
|
|
|
264
274
|
type: "testnet",
|
|
265
275
|
},
|
|
266
276
|
{
|
|
267
|
-
chainName:
|
|
277
|
+
chainName: solana,
|
|
268
278
|
logo: `${baseLogoUrl}/Solana.webp`,
|
|
269
279
|
type: "mainnet",
|
|
270
280
|
},
|
|
@@ -373,29 +383,34 @@ export const networks = [
|
|
|
373
383
|
logo: `${baseLogoUrl}/skale.webp`,
|
|
374
384
|
type: "mainnet",
|
|
375
385
|
},
|
|
386
|
+
{
|
|
387
|
+
chainName: sei,
|
|
388
|
+
logo: `${baseLogoUrl}/Sei.webp`,
|
|
389
|
+
type: "mainnet",
|
|
390
|
+
},
|
|
376
391
|
];
|
|
377
392
|
|
|
378
393
|
export const chainNameToLogo = {
|
|
379
|
-
|
|
394
|
+
[ethereum]: `${baseLogoUrl}/Ethereum.webp`,
|
|
380
395
|
[sepolia]: `${baseLogoUrl}/Ethereum.webp`,
|
|
381
|
-
FANTOM: `${baseLogoUrl}/Fantom.webp`,
|
|
382
|
-
|
|
396
|
+
// FANTOM: `${baseLogoUrl}/Fantom.webp`,
|
|
397
|
+
[polygon]: `${baseLogoUrl}/Polygon.webp`,
|
|
383
398
|
[polygonAmoy]: `${baseLogoUrl}/Polygon.webp`,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
399
|
+
[avalanche]: `${baseLogoUrl}/Avalanche.webp`,
|
|
400
|
+
[optimism]: `${baseLogoUrl}/Optimism.webp`,
|
|
401
|
+
[arbitrum]: `${baseLogoUrl}/Arbitrum.webp`,
|
|
387
402
|
LINEA: `${baseLogoUrl}/Linea.webp`,
|
|
388
403
|
MUMBAI: `${baseLogoUrl}/Polygon.webp`,
|
|
389
404
|
FUSE: `${baseLogoUrl}/Fuse.webp`,
|
|
390
405
|
FUSESPARK: `${baseLogoUrl}/Fuse.webp`,
|
|
391
|
-
|
|
406
|
+
[binance]: `${baseLogoUrl}/Binance.svg`,
|
|
392
407
|
MANTA: `${baseLogoUrl}/Manta.webp`,
|
|
393
408
|
"MANTA-TESTNET": `${baseLogoUrl}/Manta.webp`,
|
|
394
409
|
METIS: `${baseLogoUrl}/Metis.webp`,
|
|
395
410
|
"METIS-TESTNET": `${baseLogoUrl}/Metis.webp`,
|
|
396
411
|
MANTLE: `${baseLogoUrl}/Mantle.webp`,
|
|
397
412
|
"MANTLE-TESTNET": `${baseLogoUrl}/Mantle.webp`,
|
|
398
|
-
|
|
413
|
+
[solana]: `${baseLogoUrl}/Solana.webp`,
|
|
399
414
|
[solanaDevnet]: `${baseLogoUrl}/Solana.webp`,
|
|
400
415
|
[zkLink]: `${baseLogoUrl}/zklink.webp`,
|
|
401
416
|
[zkLinkTestnet]: `${baseLogoUrl}/zklink.webp`,
|
|
@@ -417,17 +432,18 @@ export const chainNameToLogo = {
|
|
|
417
432
|
[imx]: `${baseLogoUrl}/IMX.webp`,
|
|
418
433
|
[eosg]: `${baseLogoUrl}/EOSG.webp`,
|
|
419
434
|
[skale]: `${baseLogoUrl}/skale.webp`,
|
|
435
|
+
[sei]: `${baseLogoUrl}/Sei.webp`,
|
|
420
436
|
};
|
|
421
437
|
export const chainNameToLogoAverageColor: { [key: string]: string } = {
|
|
422
|
-
|
|
423
|
-
|
|
438
|
+
[ethereum]: "rgba(98,126,235,0.7)",
|
|
439
|
+
[polygon]: "rgba(131,69,231,0.7)",
|
|
424
440
|
SEPOLIA: "rgba(98,126,235,0.7)",
|
|
425
|
-
FANTOM: "rgba(19,181,235,0.7)",
|
|
441
|
+
// FANTOM: "rgba(19,181,235,0.7)",
|
|
426
442
|
AMOY: "rgba(131,69,231,0.7)",
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
LINEA: "
|
|
443
|
+
[avalanche]: "rgba(232,65,67,0.7)",
|
|
444
|
+
[arbitrum]: "rgba(17,170,255,0.7)",
|
|
445
|
+
[optimism]: "rgba(255,5,32,0.7)",
|
|
446
|
+
LINEA: "rgba(51,51,51,0.7)",
|
|
431
447
|
MUMBAI: "rgba(131,69,231,0.7)",
|
|
432
448
|
FUSESPARK: "rgba(180,249,185,0.7)",
|
|
433
449
|
FUSE: "rgba(180,249,185,0.7)",
|
|
@@ -435,27 +451,44 @@ export const chainNameToLogoAverageColor: { [key: string]: string } = {
|
|
|
435
451
|
"MANTA-TESTNET": "rgba(98,126,235,0.7)",
|
|
436
452
|
"METIS-TESTNET": "rgba(18,171,225,0.7)",
|
|
437
453
|
METIS: "rgba(18,171,225,0.7)",
|
|
438
|
-
|
|
439
|
-
"MANTLE-TESTNET": "
|
|
440
|
-
MANTLE: "
|
|
454
|
+
[solana]: "rgba(20,241,149,0.7)",
|
|
455
|
+
"MANTLE-TESTNET": "rgba(66,66,66,0.7)",
|
|
456
|
+
MANTLE: "rgba(66,66,66,0.7)",
|
|
441
457
|
"BITLAYER-TESTNET": "rgba(226,110,26,0.7)",
|
|
442
|
-
"ZKLINK-NOVA": "
|
|
443
|
-
"ZKLINK-NOVA-TESTNET": "
|
|
458
|
+
"ZKLINK-NOVA": "rgba(63,81,181,0.7)",
|
|
459
|
+
"ZKLINK-NOVA-TESTNET": "rgba(63,81,181,0.7)",
|
|
444
460
|
"NEOX-TESTNET": "rgba(1,229,155,0.7)",
|
|
445
461
|
"VANGUARD-VANAR-TESTNET": "rgba(71, 51, 147,0.7)",
|
|
446
|
-
|
|
462
|
+
[binance]: "rgba(240,185,11,0.7)",
|
|
463
|
+
|
|
464
|
+
[base]: "rgba(0,82,255,0.7)",
|
|
465
|
+
[bitlayerMainnet]: "rgba(226,110,26,0.7)",
|
|
466
|
+
[injective]: "rgba(40,44,52,0.7)",
|
|
467
|
+
[matChain]: "rgba(98,126,235,0.7)",
|
|
468
|
+
[saakuru]: "rgba(98,73,227,0.7)",
|
|
469
|
+
[oasys]: "rgba(20,175,125,0.7)",
|
|
470
|
+
[xlayer]: "rgba(30,143,217,0.7)",
|
|
471
|
+
[imx]: "rgba(86,35,180,0.7)",
|
|
472
|
+
[eosg]: "rgba(0,0,0,0.7)",
|
|
473
|
+
[skale]: "rgba(72,138,240,0.7)",
|
|
474
|
+
[solanaDevnet]: "rgba(20,241,149,0.7)",
|
|
475
|
+
[skaleTestnet]: "rgba(72,138,240,0.7)",
|
|
476
|
+
[injectiveTestnet]: "rgba(40,44,52,0.7)",
|
|
477
|
+
[matChainTestnet]: "rgba(98,126,235,0.7)",
|
|
478
|
+
[baseTestnet]: "rgba(0,82,255,0.7)",
|
|
479
|
+
[berachainBartio]: "rgba(252,186,3,0.7)",
|
|
447
480
|
};
|
|
448
481
|
|
|
449
482
|
export const chainNameToLogoBlack = {
|
|
450
|
-
|
|
483
|
+
[ethereum]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
451
484
|
[sepolia]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
452
|
-
|
|
453
|
-
FANTOM: `${baseLogoUrlBlack}/Fantom.webp`,
|
|
454
|
-
|
|
485
|
+
[binance]: `${baseLogoUrlBlack}/binance.svg`,
|
|
486
|
+
// FANTOM: `${baseLogoUrlBlack}/Fantom.webp`,
|
|
487
|
+
[polygon]: `${baseLogoUrlBlack}/Polygon.webp`,
|
|
455
488
|
[polygonAmoy]: `${baseLogoUrlBlack}/Polygon.webp`,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
489
|
+
[avalanche]: `${baseLogoUrlBlack}/Avalanche.webp`,
|
|
490
|
+
[optimism]: `${baseLogoUrlBlack}/Optimism.webp`,
|
|
491
|
+
[arbitrum]: `${baseLogoUrlBlack}/Arbitrum.webp`,
|
|
459
492
|
LINEA: `${baseLogoUrlBlack}/Linea.webp`,
|
|
460
493
|
MUMBAI: `${baseLogoUrlBlack}/Polygon.webp`,
|
|
461
494
|
FUSE: `${baseLogoUrlBlack}/fuse.webp`,
|
|
@@ -466,7 +499,7 @@ export const chainNameToLogoBlack = {
|
|
|
466
499
|
"METIS-TESTNET": `${baseLogoUrlBlack}/Metis.webp`,
|
|
467
500
|
MANTLE: `${baseLogoUrlBlack}/Mantle.webp`,
|
|
468
501
|
"MANTLE-TESTNET": `${baseLogoUrlBlack}/Mantle.webp`,
|
|
469
|
-
|
|
502
|
+
[solana]: `${baseLogoUrlBlack}/Solana.webp`,
|
|
470
503
|
[solanaDevnet]: `${baseLogoUrlBlack}/Solana.webp`,
|
|
471
504
|
[zkLink]: `${baseLogoUrlBlack}/zklink.webp`,
|
|
472
505
|
[zkLinkTestnet]: `${baseLogoUrlBlack}/zklink.webp`,
|
|
@@ -488,18 +521,19 @@ export const chainNameToLogoBlack = {
|
|
|
488
521
|
[imx]: `${baseLogoUrlBlack}/IMX.webp`,
|
|
489
522
|
[eosg]: `${baseLogoUrlBlack}/EOSG.webp`,
|
|
490
523
|
[skale]: `${baseLogoUrlBlack}/skale.webp`,
|
|
524
|
+
[sei]: `${baseLogoUrlBlack}/Sei.webp`,
|
|
491
525
|
};
|
|
492
526
|
|
|
493
527
|
export const chainNameToLogoBlackAverageColor = {
|
|
494
|
-
FANTOM: [
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
],
|
|
501
|
-
|
|
502
|
-
|
|
528
|
+
// FANTOM: [
|
|
529
|
+
// { color: "rgb(255,255,255)", count: 25004 },
|
|
530
|
+
// { color: "rgb(132,132,132)", count: 3219 },
|
|
531
|
+
// { color: "rgb(143,143,143)", count: 2392 },
|
|
532
|
+
// { color: "rgb(114,114,114)", count: 2283 },
|
|
533
|
+
// { color: "rgb(254,254,254)", count: 2250 },
|
|
534
|
+
// ],
|
|
535
|
+
|
|
536
|
+
[polygon]: [
|
|
503
537
|
{ color: "rgb(255,255,255)", count: 26414 },
|
|
504
538
|
{ color: "rgb(132,132,132)", count: 3390 },
|
|
505
539
|
{ color: "rgb(128,128,128)", count: 2783 },
|
|
@@ -507,7 +541,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
507
541
|
{ color: "rgb(118,118,118)", count: 2387 },
|
|
508
542
|
],
|
|
509
543
|
|
|
510
|
-
|
|
544
|
+
[ethereum]: [
|
|
511
545
|
{ color: "rgb(255,255,255)", count: 23340 },
|
|
512
546
|
{ color: "rgb(132,132,132)", count: 2559 },
|
|
513
547
|
{ color: "rgb(111,111,111)", count: 2372 },
|
|
@@ -531,7 +565,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
531
565
|
{ color: "rgb(118,118,118)", count: 2387 },
|
|
532
566
|
],
|
|
533
567
|
|
|
534
|
-
|
|
568
|
+
[arbitrum]: [
|
|
535
569
|
{ color: "rgb(255,255,255)", count: 37899 },
|
|
536
570
|
{ color: "rgb(143,143,143)", count: 2422 },
|
|
537
571
|
{ color: "rgb(111,111,111)", count: 2106 },
|
|
@@ -539,7 +573,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
539
573
|
{ color: "rgb(254,254,254)", count: 1913 },
|
|
540
574
|
],
|
|
541
575
|
|
|
542
|
-
|
|
576
|
+
[optimism]: [
|
|
543
577
|
{ color: "rgb(255,255,255)", count: 27023 },
|
|
544
578
|
{ color: "rgb(132,132,132)", count: 3031 },
|
|
545
579
|
{ color: "rgb(111,111,111)", count: 2578 },
|
|
@@ -555,7 +589,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
555
589
|
{ color: "rgb(143,143,143)", count: 2740 },
|
|
556
590
|
],
|
|
557
591
|
|
|
558
|
-
|
|
592
|
+
[avalanche]: [
|
|
559
593
|
{ color: "rgb(255,255,255)", count: 28225 },
|
|
560
594
|
{ color: "rgb(132,132,132)", count: 3609 },
|
|
561
595
|
{ color: "rgb(111,111,111)", count: 2934 },
|
|
@@ -619,7 +653,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
619
653
|
{ color: "rgb(16,16,157)", count: 758 },
|
|
620
654
|
],
|
|
621
655
|
|
|
622
|
-
|
|
656
|
+
[solana]: [
|
|
623
657
|
{ color: "rgb(255,255,255)", count: 32241 },
|
|
624
658
|
{ color: "rgb(132,132,132)", count: 3455 },
|
|
625
659
|
{ color: "rgb(254,254,254)", count: 2440 },
|
|
@@ -683,7 +717,7 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
683
717
|
{ color: "rgb(255,0,255)", count: 2892 },
|
|
684
718
|
],
|
|
685
719
|
|
|
686
|
-
|
|
720
|
+
[binance]: [
|
|
687
721
|
{ color: "rgb(0,0,0)", count: 2614 },
|
|
688
722
|
{ color: "rgb(255,255,255)", count: 1676 },
|
|
689
723
|
{ color: "rgb(15,15,15)", count: 974 },
|
|
@@ -691,3 +725,59 @@ export const chainNameToLogoBlackAverageColor = {
|
|
|
691
725
|
{ color: "rgb(17,17,17)", count: 56 },
|
|
692
726
|
],
|
|
693
727
|
};
|
|
728
|
+
export const getCoingeckoPlatformIdFromChainName = (
|
|
729
|
+
chainName: string
|
|
730
|
+
): string | undefined => {
|
|
731
|
+
const map: Record<string, string> = {
|
|
732
|
+
ETH: "ethereum",
|
|
733
|
+
POLYGON: "polygon-pos",
|
|
734
|
+
AVALANCHE: "avalanche",
|
|
735
|
+
OPTIMISM: "optimistic-ethereum",
|
|
736
|
+
ARBITRUM: "arbitrum-one",
|
|
737
|
+
BINANCE: "binance-smart-chain",
|
|
738
|
+
FUSE: "fuse",
|
|
739
|
+
METIS: "metis-andromeda",
|
|
740
|
+
MANTA: "manta",
|
|
741
|
+
MANTLE: "mantle",
|
|
742
|
+
SOLANA: "solana",
|
|
743
|
+
ZKLINK: "zklink",
|
|
744
|
+
BITLAYERMAINNET: "bitlayer",
|
|
745
|
+
INJECTIVE: "injective",
|
|
746
|
+
MATCHAIN: "matchain",
|
|
747
|
+
BASE: "base",
|
|
748
|
+
SAAKURU: "saakuru",
|
|
749
|
+
OASYS: "oasys",
|
|
750
|
+
XLAYER: "xlayer",
|
|
751
|
+
IMX: "immutable-x",
|
|
752
|
+
EOSG: "eos",
|
|
753
|
+
SKALE: "skale",
|
|
754
|
+
SEI: "sei-network",
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
return map[chainName.toUpperCase()];
|
|
758
|
+
};
|
|
759
|
+
export const nativeTokenIdMap: Record<string, string> = {
|
|
760
|
+
ETH: "ethereum",
|
|
761
|
+
OPTIMISM: "ethereum",
|
|
762
|
+
ARBITRUM: "ethereum",
|
|
763
|
+
BASE: "ethereum",
|
|
764
|
+
MANTLE: "ethereum",
|
|
765
|
+
METIS: "ethereum",
|
|
766
|
+
ZKLINK: "ethereum",
|
|
767
|
+
XLAYER: "ethereum",
|
|
768
|
+
BITLAYERMAINNET: "ethereum",
|
|
769
|
+
POLYGON: "matic-network",
|
|
770
|
+
AVALANCHE: "avalanche-2",
|
|
771
|
+
FUSE: "fuse-network-token",
|
|
772
|
+
BINANCE: "binancecoin",
|
|
773
|
+
MANTA: "manta-network",
|
|
774
|
+
SOLANA: "solana",
|
|
775
|
+
INJECTIVE: "injective-protocol",
|
|
776
|
+
MATCHAIN: "matchain",
|
|
777
|
+
SAAKURU: "saakuru",
|
|
778
|
+
OASYS: "oasys",
|
|
779
|
+
IMX: "immutable-x",
|
|
780
|
+
EOSG: "eos",
|
|
781
|
+
SKALE: "skale",
|
|
782
|
+
SEI: "sei",
|
|
783
|
+
};
|
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
|
};
|
package/src/web3Platforms.ts
CHANGED
|
@@ -4,6 +4,8 @@ export enum Web3Platform {
|
|
|
4
4
|
RABBYWALLET = "rabbywallet",
|
|
5
5
|
PHANTOMWALLET = "phantomwallet",
|
|
6
6
|
KEPLRWALLET = "keplrwallet",
|
|
7
|
+
METAMASK_DUMMY = "metamask_dummy",
|
|
8
|
+
PHANTOM_DUMMY = "phantom_dummy",
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export const Web3PlatformNames: Record<Web3Platform, string> = {
|
|
@@ -12,4 +14,6 @@ export const Web3PlatformNames: Record<Web3Platform, string> = {
|
|
|
12
14
|
[Web3Platform.RABBYWALLET]: "Rabby Wallet",
|
|
13
15
|
[Web3Platform.PHANTOMWALLET]: "Phantom Wallet",
|
|
14
16
|
[Web3Platform.KEPLRWALLET]: "Keplr Wallet",
|
|
17
|
+
[Web3Platform.METAMASK_DUMMY]: "MetaMask",
|
|
18
|
+
[Web3Platform.PHANTOM_DUMMY]: "MetaMask",
|
|
15
19
|
};
|