@shapeshiftoss/utils 1.0.5 → 1.1.0
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/LICENSE.md +21 -0
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/assetData/baseAssets.d.ts +24 -1
- package/dist/cjs/assetData/baseAssets.js +383 -17
- package/dist/cjs/assetData/decodeAssetData.js +2 -2
- package/dist/cjs/assetData/getBaseAsset.js +48 -2
- package/dist/cjs/bigAmount/bigAmount.d.ts +82 -0
- package/dist/cjs/bigAmount/bigAmount.js +276 -0
- package/dist/cjs/bigAmount/bigAmount.test.d.ts +1 -0
- package/dist/cjs/bigAmount/bigAmount.test.js +1194 -0
- package/dist/cjs/chainIdToFeeAssetId.js +48 -2
- package/dist/cjs/encoding.d.ts +2 -0
- package/dist/cjs/encoding.js +13 -0
- package/dist/cjs/getAssetNamespaceFromChainId.js +25 -1
- package/dist/cjs/getChainShortName.d.ts +1 -1
- package/dist/cjs/getChainShortName.js +48 -2
- package/dist/cjs/getNativeFeeAssetReference.js +53 -2
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +7 -3
- package/dist/cjs/treasury.d.ts +10 -6
- package/dist/cjs/treasury.js +13 -6
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/assetData/baseAssets.d.ts +24 -1
- package/dist/esm/assetData/baseAssets.js +381 -16
- package/dist/esm/assetData/decodeAssetData.js +1 -1
- package/dist/esm/assetData/getBaseAsset.js +49 -3
- package/dist/esm/bigAmount/bigAmount.d.ts +82 -0
- package/dist/esm/bigAmount/bigAmount.js +272 -0
- package/dist/esm/bigAmount/bigAmount.test.d.ts +1 -0
- package/dist/esm/bigAmount/bigAmount.test.js +1192 -0
- package/dist/esm/chainIdToFeeAssetId.js +49 -3
- package/dist/esm/encoding.d.ts +2 -0
- package/dist/esm/encoding.js +8 -0
- package/dist/esm/getAssetNamespaceFromChainId.js +25 -1
- package/dist/esm/getChainShortName.d.ts +1 -1
- package/dist/esm/getChainShortName.js +48 -2
- package/dist/esm/getNativeFeeAssetReference.js +53 -2
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/treasury.d.ts +10 -6
- package/dist/esm/treasury.js +12 -5
- package/package.json +15 -16
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Asset } from '@shapeshiftoss/types';
|
|
2
|
+
export declare const abstract: Readonly<Asset>;
|
|
2
3
|
export declare const ethereum: Readonly<Asset>;
|
|
3
4
|
export declare const bitcoin: Readonly<Asset>;
|
|
4
5
|
export declare const bitcoincash: Readonly<Asset>;
|
|
@@ -17,14 +18,36 @@ export declare const bnbsmartchain: Readonly<Asset>;
|
|
|
17
18
|
export declare const polygon: Readonly<Asset>;
|
|
18
19
|
export declare const gnosis: Readonly<Asset>;
|
|
19
20
|
export declare const arbitrum: Readonly<Asset>;
|
|
20
|
-
export declare const arbitrumNova: Readonly<Asset>;
|
|
21
21
|
export declare const base: Readonly<Asset>;
|
|
22
22
|
export declare const monad: Readonly<Asset>;
|
|
23
23
|
export declare const hyperevm: Readonly<Asset>;
|
|
24
24
|
export declare const plasma: Readonly<Asset>;
|
|
25
|
+
export declare const plume: Readonly<Asset>;
|
|
26
|
+
export declare const worldchain: Readonly<Asset>;
|
|
27
|
+
export declare const mantle: Readonly<Asset>;
|
|
28
|
+
export declare const ink: Readonly<Asset>;
|
|
29
|
+
export declare const cronos: Readonly<Asset>;
|
|
30
|
+
export declare const megaeth: Readonly<Asset>;
|
|
31
|
+
export declare const berachain: Readonly<Asset>;
|
|
25
32
|
export declare const katana: Readonly<Asset>;
|
|
33
|
+
export declare const flowEvm: Readonly<Asset>;
|
|
34
|
+
export declare const ethereal: Readonly<Asset>;
|
|
35
|
+
export declare const celo: Readonly<Asset>;
|
|
36
|
+
export declare const story: Readonly<Asset>;
|
|
37
|
+
export declare const zkSyncEra: Readonly<Asset>;
|
|
38
|
+
export declare const blast: Readonly<Asset>;
|
|
39
|
+
export declare const hemi: Readonly<Asset>;
|
|
40
|
+
export declare const sei: Readonly<Asset>;
|
|
41
|
+
export declare const linea: Readonly<Asset>;
|
|
42
|
+
export declare const scroll: Readonly<Asset>;
|
|
43
|
+
export declare const sonic: Readonly<Asset>;
|
|
44
|
+
export declare const unichainChain: Readonly<Asset>;
|
|
45
|
+
export declare const bobChain: Readonly<Asset>;
|
|
46
|
+
export declare const modeChain: Readonly<Asset>;
|
|
47
|
+
export declare const soneium: Readonly<Asset>;
|
|
26
48
|
export declare const solana: Readonly<Asset>;
|
|
27
49
|
export declare const tron: Readonly<Asset>;
|
|
28
50
|
export declare const sui: Readonly<Asset>;
|
|
29
51
|
export declare const near: Readonly<Asset>;
|
|
30
52
|
export declare const starknet: Readonly<Asset>;
|
|
53
|
+
export declare const ton: Readonly<Asset>;
|
|
@@ -23,8 +23,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.near = exports.sui = exports.tron = exports.solana = exports.soneium = exports.modeChain = exports.bobChain = exports.unichainChain = exports.sonic = exports.scroll = exports.linea = exports.sei = exports.hemi = exports.blast = exports.zkSyncEra = exports.story = exports.celo = exports.ethereal = exports.flowEvm = exports.katana = exports.berachain = exports.megaeth = exports.cronos = exports.ink = exports.mantle = exports.worldchain = exports.plume = exports.plasma = exports.hyperevm = exports.monad = exports.base = exports.arbitrum = exports.gnosis = exports.polygon = exports.bnbsmartchain = exports.optimism = exports.mayachain = exports.maya = exports.ruji = exports.tcy = exports.thorchain = exports.avax = exports.atom = exports.zcash = exports.litecoin = exports.dogecoin = exports.bitcoincash = exports.bitcoin = exports.ethereum = exports.abstract = void 0;
|
|
27
|
+
exports.ton = exports.starknet = void 0;
|
|
27
28
|
const caip = __importStar(require("@shapeshiftoss/caip"));
|
|
29
|
+
exports.abstract = Object.freeze({
|
|
30
|
+
assetId: caip.abstractAssetId,
|
|
31
|
+
chainId: caip.abstractChainId,
|
|
32
|
+
name: 'Ethereum',
|
|
33
|
+
networkName: 'Abstract',
|
|
34
|
+
symbol: 'ETH',
|
|
35
|
+
precision: 18,
|
|
36
|
+
color: '#00D4AA',
|
|
37
|
+
networkColor: '#00D4AA',
|
|
38
|
+
icon: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
|
|
39
|
+
networkIcon: 'https://assets.relay.link/icons/2741/light.png',
|
|
40
|
+
explorer: 'https://abscan.org',
|
|
41
|
+
explorerAddressLink: 'https://abscan.org/address/',
|
|
42
|
+
explorerTxLink: 'https://abscan.org/tx/',
|
|
43
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
44
|
+
});
|
|
28
45
|
const mayaTokenAssetId = 'cosmos:mayachain-mainnet-v1/slip44:maya';
|
|
29
46
|
exports.ethereum = Object.freeze({
|
|
30
47
|
assetId: caip.ethAssetId,
|
|
@@ -285,22 +302,6 @@ exports.arbitrum = Object.freeze({
|
|
|
285
302
|
explorerTxLink: 'https://arbiscan.io/tx/',
|
|
286
303
|
relatedAssetKey: 'eip155:1/slip44:60',
|
|
287
304
|
});
|
|
288
|
-
exports.arbitrumNova = Object.freeze({
|
|
289
|
-
assetId: caip.arbitrumNovaAssetId,
|
|
290
|
-
chainId: caip.arbitrumNovaChainId,
|
|
291
|
-
name: 'Ethereum',
|
|
292
|
-
networkName: 'Arbitrum Nova',
|
|
293
|
-
symbol: 'ETH',
|
|
294
|
-
precision: 18,
|
|
295
|
-
color: '#5C6BC0',
|
|
296
|
-
networkColor: '#E67408',
|
|
297
|
-
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
298
|
-
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/93/large/AN_logomark.png?1695026131',
|
|
299
|
-
explorer: 'https://nova.arbiscan.io',
|
|
300
|
-
explorerAddressLink: 'https://nova.arbiscan.io/address/',
|
|
301
|
-
explorerTxLink: 'https://nova.arbiscan.io/tx/',
|
|
302
|
-
relatedAssetKey: 'eip155:1/slip44:60',
|
|
303
|
-
});
|
|
304
305
|
exports.base = Object.freeze({
|
|
305
306
|
assetId: caip.baseAssetId,
|
|
306
307
|
chainId: caip.baseChainId,
|
|
@@ -365,6 +366,116 @@ exports.plasma = Object.freeze({
|
|
|
365
366
|
explorerTxLink: 'https://plasmascan.to/tx/',
|
|
366
367
|
relatedAssetKey: null,
|
|
367
368
|
});
|
|
369
|
+
exports.plume = Object.freeze({
|
|
370
|
+
assetId: caip.plumeAssetId,
|
|
371
|
+
chainId: caip.plumeChainId,
|
|
372
|
+
name: 'Plume',
|
|
373
|
+
networkName: 'Plume',
|
|
374
|
+
symbol: 'PLUME',
|
|
375
|
+
precision: 18,
|
|
376
|
+
color: '#6C5DD3',
|
|
377
|
+
networkColor: '#6C5DD3',
|
|
378
|
+
icon: 'https://assets.coingecko.com/coins/images/70470/large/plume.jpg',
|
|
379
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/70470/small/plume.jpg',
|
|
380
|
+
explorer: 'https://explorer.plume.org',
|
|
381
|
+
explorerAddressLink: 'https://explorer.plume.org/address/',
|
|
382
|
+
explorerTxLink: 'https://explorer.plume.org/tx/',
|
|
383
|
+
relatedAssetKey: null,
|
|
384
|
+
});
|
|
385
|
+
exports.worldchain = Object.freeze({
|
|
386
|
+
assetId: caip.worldChainAssetId,
|
|
387
|
+
chainId: caip.worldChainChainId,
|
|
388
|
+
name: 'Ethereum',
|
|
389
|
+
networkName: 'World Chain',
|
|
390
|
+
symbol: 'ETH',
|
|
391
|
+
precision: 18,
|
|
392
|
+
color: '#000000',
|
|
393
|
+
networkColor: '#000000',
|
|
394
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
395
|
+
networkIcon: 'https://assets.relay.link/icons/480/light.png',
|
|
396
|
+
explorer: 'https://worldscan.org',
|
|
397
|
+
explorerAddressLink: 'https://worldscan.org/address/',
|
|
398
|
+
explorerTxLink: 'https://worldscan.org/tx/',
|
|
399
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
400
|
+
});
|
|
401
|
+
exports.mantle = Object.freeze({
|
|
402
|
+
assetId: caip.mantleAssetId,
|
|
403
|
+
chainId: caip.mantleChainId,
|
|
404
|
+
symbol: 'MNT',
|
|
405
|
+
name: 'Mantle',
|
|
406
|
+
networkName: 'Mantle',
|
|
407
|
+
precision: 18,
|
|
408
|
+
color: '#000000',
|
|
409
|
+
icon: 'https://assets.relay.link/icons/5000/light.png',
|
|
410
|
+
explorer: 'https://mantlescan.xyz',
|
|
411
|
+
explorerAddressLink: 'https://mantlescan.xyz/address/',
|
|
412
|
+
explorerTxLink: 'https://mantlescan.xyz/tx/',
|
|
413
|
+
relatedAssetKey: null,
|
|
414
|
+
});
|
|
415
|
+
exports.ink = Object.freeze({
|
|
416
|
+
assetId: caip.inkAssetId,
|
|
417
|
+
chainId: caip.inkChainId,
|
|
418
|
+
name: 'Ether',
|
|
419
|
+
networkName: 'Ink',
|
|
420
|
+
symbol: 'ETH',
|
|
421
|
+
precision: 18,
|
|
422
|
+
color: '#5A5AFF',
|
|
423
|
+
networkColor: '#5A5AFF',
|
|
424
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
425
|
+
networkIcon: 'https://assets.relay.link/icons/57073/light.png',
|
|
426
|
+
explorer: 'https://explorer.inkonchain.com',
|
|
427
|
+
explorerAddressLink: 'https://explorer.inkonchain.com/address/',
|
|
428
|
+
explorerTxLink: 'https://explorer.inkonchain.com/tx/',
|
|
429
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
430
|
+
});
|
|
431
|
+
exports.cronos = Object.freeze({
|
|
432
|
+
assetId: caip.cronosAssetId,
|
|
433
|
+
chainId: caip.cronosChainId,
|
|
434
|
+
name: 'Cronos',
|
|
435
|
+
networkName: 'Cronos',
|
|
436
|
+
symbol: 'CRO',
|
|
437
|
+
precision: 18,
|
|
438
|
+
color: '#002D74',
|
|
439
|
+
networkColor: '#002D74',
|
|
440
|
+
icon: 'https://assets.relay.link/icons/25/light.png',
|
|
441
|
+
networkIcon: 'https://assets.relay.link/icons/25/light.png',
|
|
442
|
+
explorer: 'https://explorer.cronos.org',
|
|
443
|
+
explorerAddressLink: 'https://explorer.cronos.org/address/',
|
|
444
|
+
explorerTxLink: 'https://explorer.cronos.org/tx/',
|
|
445
|
+
relatedAssetKey: null,
|
|
446
|
+
});
|
|
447
|
+
exports.megaeth = Object.freeze({
|
|
448
|
+
assetId: caip.megaethAssetId,
|
|
449
|
+
chainId: caip.megaethChainId,
|
|
450
|
+
name: 'Ethereum',
|
|
451
|
+
networkName: 'MegaETH',
|
|
452
|
+
symbol: 'ETH',
|
|
453
|
+
precision: 18,
|
|
454
|
+
color: '#FF6B35',
|
|
455
|
+
networkColor: '#FF6B35',
|
|
456
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
457
|
+
networkIcon: 'https://coin-images.coingecko.com/asset_platforms/images/32266/small/megaeth.jpg?1762329010',
|
|
458
|
+
explorer: 'https://megaeth.blockscout.com',
|
|
459
|
+
explorerAddressLink: 'https://megaeth.blockscout.com/address/',
|
|
460
|
+
explorerTxLink: 'https://megaeth.blockscout.com/tx/',
|
|
461
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
462
|
+
});
|
|
463
|
+
exports.berachain = Object.freeze({
|
|
464
|
+
assetId: caip.berachainAssetId,
|
|
465
|
+
chainId: caip.berachainChainId,
|
|
466
|
+
name: 'Berachain',
|
|
467
|
+
networkName: 'Berachain',
|
|
468
|
+
symbol: 'BERA',
|
|
469
|
+
precision: 18,
|
|
470
|
+
color: '#6B4226',
|
|
471
|
+
networkColor: '#6B4226',
|
|
472
|
+
icon: 'https://assets.relay.link/icons/80094/light.png',
|
|
473
|
+
networkIcon: 'https://assets.relay.link/icons/80094/light.png',
|
|
474
|
+
explorer: 'https://berascan.com',
|
|
475
|
+
explorerAddressLink: 'https://berascan.com/address/',
|
|
476
|
+
explorerTxLink: 'https://berascan.com/tx/',
|
|
477
|
+
relatedAssetKey: null,
|
|
478
|
+
});
|
|
368
479
|
exports.katana = Object.freeze({
|
|
369
480
|
assetId: caip.katanaAssetId,
|
|
370
481
|
chainId: caip.katanaChainId,
|
|
@@ -381,6 +492,246 @@ exports.katana = Object.freeze({
|
|
|
381
492
|
explorerTxLink: 'https://katanascan.com/tx/',
|
|
382
493
|
relatedAssetKey: 'eip155:1/slip44:60',
|
|
383
494
|
});
|
|
495
|
+
exports.flowEvm = Object.freeze({
|
|
496
|
+
assetId: caip.flowEvmAssetId,
|
|
497
|
+
chainId: caip.flowEvmChainId,
|
|
498
|
+
name: 'Flow',
|
|
499
|
+
networkName: 'Flow EVM',
|
|
500
|
+
symbol: 'FLOW',
|
|
501
|
+
precision: 18,
|
|
502
|
+
color: '#00EF8B',
|
|
503
|
+
networkColor: '#00EF8B',
|
|
504
|
+
icon: 'https://assets.coingecko.com/coins/images/13446/large/5f6294c0c7a8cda55cb1c936_Flow_Wordmark.png',
|
|
505
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/13446/small/5f6294c0c7a8cda55cb1c936_Flow_Wordmark.png',
|
|
506
|
+
explorer: 'https://evm.flowscan.io',
|
|
507
|
+
explorerAddressLink: 'https://evm.flowscan.io/address/',
|
|
508
|
+
explorerTxLink: 'https://evm.flowscan.io/tx/',
|
|
509
|
+
relatedAssetKey: null,
|
|
510
|
+
});
|
|
511
|
+
exports.ethereal = Object.freeze({
|
|
512
|
+
assetId: caip.etherealAssetId,
|
|
513
|
+
chainId: caip.etherealChainId,
|
|
514
|
+
name: 'USDe',
|
|
515
|
+
networkName: 'Ethereal',
|
|
516
|
+
symbol: 'USDe',
|
|
517
|
+
precision: 18,
|
|
518
|
+
color: '#4A90D9',
|
|
519
|
+
networkColor: '#4A90D9',
|
|
520
|
+
icon: 'https://assets.coingecko.com/coins/images/33613/large/USDE.png',
|
|
521
|
+
networkIcon: 'https://assets.relay.link/icons/5064014/light.png',
|
|
522
|
+
explorer: 'https://explorer.ethereal.global',
|
|
523
|
+
explorerAddressLink: 'https://explorer.ethereal.global/address/',
|
|
524
|
+
explorerTxLink: 'https://explorer.ethereal.global/tx/',
|
|
525
|
+
relatedAssetKey: null,
|
|
526
|
+
});
|
|
527
|
+
exports.celo = Object.freeze({
|
|
528
|
+
assetId: caip.celoAssetId,
|
|
529
|
+
chainId: caip.celoChainId,
|
|
530
|
+
name: 'Celo',
|
|
531
|
+
networkName: 'Celo',
|
|
532
|
+
symbol: 'CELO',
|
|
533
|
+
precision: 18,
|
|
534
|
+
color: '#35D07F',
|
|
535
|
+
networkColor: '#35D07F',
|
|
536
|
+
icon: 'https://assets.coingecko.com/asset_platforms/images/21/large/celo.jpeg',
|
|
537
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/21/small/celo.jpeg',
|
|
538
|
+
explorer: 'https://celoscan.io',
|
|
539
|
+
explorerAddressLink: 'https://celoscan.io/address/',
|
|
540
|
+
explorerTxLink: 'https://celoscan.io/tx/',
|
|
541
|
+
relatedAssetKey: null,
|
|
542
|
+
});
|
|
543
|
+
exports.story = Object.freeze({
|
|
544
|
+
assetId: caip.storyAssetId,
|
|
545
|
+
chainId: caip.storyChainId,
|
|
546
|
+
name: 'Story',
|
|
547
|
+
networkName: 'Story',
|
|
548
|
+
symbol: 'IP',
|
|
549
|
+
precision: 18,
|
|
550
|
+
color: '#EA580C',
|
|
551
|
+
networkColor: '#EA580C',
|
|
552
|
+
icon: 'https://assets.coingecko.com/asset_platforms/images/22207/large/story.jpg',
|
|
553
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/22207/small/story.jpg',
|
|
554
|
+
explorer: 'https://storyscan.xyz',
|
|
555
|
+
explorerAddressLink: 'https://storyscan.xyz/address/',
|
|
556
|
+
explorerTxLink: 'https://storyscan.xyz/tx/',
|
|
557
|
+
relatedAssetKey: null,
|
|
558
|
+
});
|
|
559
|
+
exports.zkSyncEra = Object.freeze({
|
|
560
|
+
assetId: caip.zkSyncEraAssetId,
|
|
561
|
+
chainId: caip.zkSyncEraChainId,
|
|
562
|
+
name: 'Ethereum',
|
|
563
|
+
networkName: 'zkSync Era',
|
|
564
|
+
symbol: 'ETH',
|
|
565
|
+
precision: 18,
|
|
566
|
+
color: '#8C8DFC',
|
|
567
|
+
networkColor: '#8C8DFC',
|
|
568
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
569
|
+
networkIcon: 'https://assets.relay.link/icons/324/light.png',
|
|
570
|
+
explorer: 'https://explorer.zksync.io',
|
|
571
|
+
explorerAddressLink: 'https://explorer.zksync.io/address/',
|
|
572
|
+
explorerTxLink: 'https://explorer.zksync.io/tx/',
|
|
573
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
574
|
+
});
|
|
575
|
+
exports.blast = Object.freeze({
|
|
576
|
+
assetId: caip.blastAssetId,
|
|
577
|
+
chainId: caip.blastChainId,
|
|
578
|
+
name: 'Ethereum',
|
|
579
|
+
networkName: 'Blast',
|
|
580
|
+
symbol: 'ETH',
|
|
581
|
+
precision: 18,
|
|
582
|
+
color: '#FCFC03',
|
|
583
|
+
networkColor: '#FCFC03',
|
|
584
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
585
|
+
networkIcon: 'https://assets.relay.link/icons/81457/light.png',
|
|
586
|
+
explorer: 'https://blastscan.io',
|
|
587
|
+
explorerAddressLink: 'https://blastscan.io/address/',
|
|
588
|
+
explorerTxLink: 'https://blastscan.io/tx/',
|
|
589
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
590
|
+
});
|
|
591
|
+
exports.hemi = Object.freeze({
|
|
592
|
+
assetId: caip.hemiAssetId,
|
|
593
|
+
chainId: caip.hemiChainId,
|
|
594
|
+
name: 'Ethereum',
|
|
595
|
+
networkName: 'Hemi',
|
|
596
|
+
symbol: 'ETH',
|
|
597
|
+
precision: 18,
|
|
598
|
+
color: '#FF6B35',
|
|
599
|
+
networkColor: '#FF6B35',
|
|
600
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
601
|
+
networkIcon: 'https://assets.relay.link/icons/43111/light.png',
|
|
602
|
+
explorer: 'https://explorer.hemi.xyz',
|
|
603
|
+
explorerAddressLink: 'https://explorer.hemi.xyz/address/',
|
|
604
|
+
explorerTxLink: 'https://explorer.hemi.xyz/tx/',
|
|
605
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
606
|
+
});
|
|
607
|
+
exports.sei = Object.freeze({
|
|
608
|
+
assetId: caip.seiAssetId,
|
|
609
|
+
chainId: caip.seiChainId,
|
|
610
|
+
name: 'SEI',
|
|
611
|
+
networkName: 'Sei',
|
|
612
|
+
symbol: 'SEI',
|
|
613
|
+
precision: 18,
|
|
614
|
+
color: '#9B1B30',
|
|
615
|
+
networkColor: '#9B1B30',
|
|
616
|
+
icon: 'https://assets.coingecko.com/coins/images/28205/large/Sei_Logo_-_Transparent.png',
|
|
617
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/28205/small/Sei_Logo_-_Transparent.png',
|
|
618
|
+
explorer: 'https://seitrace.com',
|
|
619
|
+
explorerAddressLink: 'https://seitrace.com/address/',
|
|
620
|
+
explorerTxLink: 'https://seitrace.com/tx/',
|
|
621
|
+
relatedAssetKey: null,
|
|
622
|
+
});
|
|
623
|
+
exports.linea = Object.freeze({
|
|
624
|
+
assetId: caip.lineaAssetId,
|
|
625
|
+
chainId: caip.lineaChainId,
|
|
626
|
+
name: 'Ethereum',
|
|
627
|
+
networkName: 'Linea',
|
|
628
|
+
symbol: 'ETH',
|
|
629
|
+
precision: 18,
|
|
630
|
+
color: '#5C6BC0',
|
|
631
|
+
networkColor: '#121212',
|
|
632
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
633
|
+
networkIcon: 'https://assets.relay.link/icons/59144/light.png',
|
|
634
|
+
explorer: 'https://lineascan.build',
|
|
635
|
+
explorerAddressLink: 'https://lineascan.build/address/',
|
|
636
|
+
explorerTxLink: 'https://lineascan.build/tx/',
|
|
637
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
638
|
+
});
|
|
639
|
+
exports.scroll = Object.freeze({
|
|
640
|
+
assetId: caip.scrollAssetId,
|
|
641
|
+
chainId: caip.scrollChainId,
|
|
642
|
+
name: 'Ether',
|
|
643
|
+
networkName: 'Scroll',
|
|
644
|
+
symbol: 'ETH',
|
|
645
|
+
precision: 18,
|
|
646
|
+
color: '#FFEEDA',
|
|
647
|
+
networkColor: '#FFEEDA',
|
|
648
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
649
|
+
networkIcon: 'https://scroll-tech.github.io/token-list/scroll.png',
|
|
650
|
+
explorer: 'https://scrollscan.com',
|
|
651
|
+
explorerAddressLink: 'https://scrollscan.com/address/',
|
|
652
|
+
explorerTxLink: 'https://scrollscan.com/tx/',
|
|
653
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
654
|
+
});
|
|
655
|
+
exports.sonic = Object.freeze({
|
|
656
|
+
assetId: caip.sonicAssetId,
|
|
657
|
+
chainId: caip.sonicChainId,
|
|
658
|
+
name: 'Sonic (S)',
|
|
659
|
+
networkName: 'Sonic',
|
|
660
|
+
symbol: 'S',
|
|
661
|
+
precision: 18,
|
|
662
|
+
color: '#1B1464',
|
|
663
|
+
networkColor: '#1B1464',
|
|
664
|
+
icon: 'https://assets.coingecko.com/coins/images/38108/standard/200x200_Sonic_Logo.png',
|
|
665
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/38108/standard/200x200_Sonic_Logo.png',
|
|
666
|
+
explorer: 'https://sonicscan.org',
|
|
667
|
+
explorerAddressLink: 'https://sonicscan.org/address/',
|
|
668
|
+
explorerTxLink: 'https://sonicscan.org/tx/',
|
|
669
|
+
relatedAssetKey: null,
|
|
670
|
+
});
|
|
671
|
+
exports.unichainChain = Object.freeze({
|
|
672
|
+
assetId: caip.unichainAssetId,
|
|
673
|
+
chainId: caip.unichainChainId,
|
|
674
|
+
name: 'Ether',
|
|
675
|
+
networkName: 'Unichain',
|
|
676
|
+
symbol: 'ETH',
|
|
677
|
+
precision: 18,
|
|
678
|
+
color: '#5C6BC0',
|
|
679
|
+
networkColor: '#F50DB4',
|
|
680
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
681
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/22206/small/unichain.png',
|
|
682
|
+
explorer: 'https://uniscan.xyz',
|
|
683
|
+
explorerAddressLink: 'https://uniscan.xyz/address/',
|
|
684
|
+
explorerTxLink: 'https://uniscan.xyz/tx/',
|
|
685
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
686
|
+
});
|
|
687
|
+
exports.bobChain = Object.freeze({
|
|
688
|
+
assetId: caip.bobAssetId,
|
|
689
|
+
chainId: caip.bobChainId,
|
|
690
|
+
name: 'Ethereum',
|
|
691
|
+
networkName: 'BOB',
|
|
692
|
+
symbol: 'ETH',
|
|
693
|
+
precision: 18,
|
|
694
|
+
color: '#5C6BC0',
|
|
695
|
+
networkColor: '#F25D00',
|
|
696
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
697
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/255/small/bob.jpeg',
|
|
698
|
+
explorer: 'https://explorer.gobob.xyz',
|
|
699
|
+
explorerAddressLink: 'https://explorer.gobob.xyz/address/',
|
|
700
|
+
explorerTxLink: 'https://explorer.gobob.xyz/tx/',
|
|
701
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
702
|
+
});
|
|
703
|
+
exports.modeChain = Object.freeze({
|
|
704
|
+
assetId: caip.modeAssetId,
|
|
705
|
+
chainId: caip.modeChainId,
|
|
706
|
+
name: 'Ethereum',
|
|
707
|
+
networkName: 'Mode',
|
|
708
|
+
symbol: 'ETH',
|
|
709
|
+
precision: 18,
|
|
710
|
+
color: '#5C6BC0',
|
|
711
|
+
networkColor: '#DFFE00',
|
|
712
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
713
|
+
networkIcon: 'https://assets.relay.link/icons/34443/light.png',
|
|
714
|
+
explorer: 'https://modescan.io',
|
|
715
|
+
explorerAddressLink: 'https://modescan.io/address/',
|
|
716
|
+
explorerTxLink: 'https://modescan.io/tx/',
|
|
717
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
718
|
+
});
|
|
719
|
+
exports.soneium = Object.freeze({
|
|
720
|
+
assetId: caip.soneiumAssetId,
|
|
721
|
+
chainId: caip.soneiumChainId,
|
|
722
|
+
name: 'Ethereum',
|
|
723
|
+
networkName: 'Soneium',
|
|
724
|
+
symbol: 'ETH',
|
|
725
|
+
precision: 18,
|
|
726
|
+
color: '#627EEA',
|
|
727
|
+
networkColor: '#1A1A2E',
|
|
728
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
729
|
+
networkIcon: 'https://assets.relay.link/icons/1868/light.png',
|
|
730
|
+
explorer: 'https://soneium.blockscout.com',
|
|
731
|
+
explorerAddressLink: 'https://soneium.blockscout.com/address/',
|
|
732
|
+
explorerTxLink: 'https://soneium.blockscout.com/tx/',
|
|
733
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
734
|
+
});
|
|
384
735
|
exports.solana = Object.freeze({
|
|
385
736
|
assetId: caip.solAssetId,
|
|
386
737
|
chainId: caip.solanaChainId,
|
|
@@ -456,3 +807,18 @@ exports.starknet = Object.freeze({
|
|
|
456
807
|
explorerTxLink: 'https://starkscan.co/tx/',
|
|
457
808
|
relatedAssetKey: null,
|
|
458
809
|
});
|
|
810
|
+
exports.ton = Object.freeze({
|
|
811
|
+
assetId: caip.tonAssetId,
|
|
812
|
+
chainId: caip.tonChainId,
|
|
813
|
+
name: 'Toncoin',
|
|
814
|
+
networkName: 'TON',
|
|
815
|
+
symbol: 'TON',
|
|
816
|
+
precision: 9,
|
|
817
|
+
color: '#0098EA',
|
|
818
|
+
networkColor: '#0098EA',
|
|
819
|
+
icon: 'https://assets.coingecko.com/coins/images/17980/large/ton_symbol.png?1696517498',
|
|
820
|
+
explorer: 'https://tonscan.org',
|
|
821
|
+
explorerAddressLink: 'https://tonscan.org/address/',
|
|
822
|
+
explorerTxLink: 'https://tonscan.org/tx/',
|
|
823
|
+
relatedAssetKey: null,
|
|
824
|
+
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decodeAssetData = void 0;
|
|
4
4
|
const caip_1 = require("@shapeshiftoss/caip");
|
|
5
|
-
const
|
|
5
|
+
const lodash_es_1 = require("lodash-es");
|
|
6
6
|
const assertUnreachable_1 = require("../assertUnreachable");
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
8
|
const getBaseAsset_1 = require("./getBaseAsset");
|
|
@@ -34,7 +34,7 @@ const decodeAssetData = (encodedAssetData, shouldAddNetworkName = false) => {
|
|
|
34
34
|
explorerAddressLink: '',
|
|
35
35
|
explorerTxLink: '',
|
|
36
36
|
relatedAssetKey: null,
|
|
37
|
-
}, (0,
|
|
37
|
+
}, (0, lodash_es_1.pick)(baseAsset, ['explorer', 'explorerAddressLink', 'explorerTxLink']));
|
|
38
38
|
if (assetId === baseAsset?.assetId) {
|
|
39
39
|
asset.networkName = baseAsset.networkName;
|
|
40
40
|
asset.networkIcon = baseAsset.networkIcon;
|
|
@@ -21,8 +21,6 @@ const getBaseAsset = (chainId) => {
|
|
|
21
21
|
return baseAssets_1.gnosis;
|
|
22
22
|
case types_1.KnownChainIds.ArbitrumMainnet:
|
|
23
23
|
return baseAssets_1.arbitrum;
|
|
24
|
-
case types_1.KnownChainIds.ArbitrumNovaMainnet:
|
|
25
|
-
return baseAssets_1.arbitrumNova;
|
|
26
24
|
case types_1.KnownChainIds.BaseMainnet:
|
|
27
25
|
return baseAssets_1.base;
|
|
28
26
|
case types_1.KnownChainIds.SolanaMainnet:
|
|
@@ -53,12 +51,60 @@ const getBaseAsset = (chainId) => {
|
|
|
53
51
|
return baseAssets_1.hyperevm;
|
|
54
52
|
case types_1.KnownChainIds.PlasmaMainnet:
|
|
55
53
|
return baseAssets_1.plasma;
|
|
54
|
+
case types_1.KnownChainIds.PlumeMainnet:
|
|
55
|
+
return baseAssets_1.plume;
|
|
56
|
+
case types_1.KnownChainIds.MantleMainnet:
|
|
57
|
+
return baseAssets_1.mantle;
|
|
58
|
+
case types_1.KnownChainIds.InkMainnet:
|
|
59
|
+
return baseAssets_1.ink;
|
|
60
|
+
case types_1.KnownChainIds.MegaEthMainnet:
|
|
61
|
+
return baseAssets_1.megaeth;
|
|
62
|
+
case types_1.KnownChainIds.BerachainMainnet:
|
|
63
|
+
return baseAssets_1.berachain;
|
|
64
|
+
case types_1.KnownChainIds.CronosMainnet:
|
|
65
|
+
return baseAssets_1.cronos;
|
|
56
66
|
case types_1.KnownChainIds.KatanaMainnet:
|
|
57
67
|
return baseAssets_1.katana;
|
|
68
|
+
case types_1.KnownChainIds.EtherealMainnet:
|
|
69
|
+
return baseAssets_1.ethereal;
|
|
70
|
+
case types_1.KnownChainIds.FlowEvmMainnet:
|
|
71
|
+
return baseAssets_1.flowEvm;
|
|
72
|
+
case types_1.KnownChainIds.CeloMainnet:
|
|
73
|
+
return baseAssets_1.celo;
|
|
74
|
+
case types_1.KnownChainIds.StoryMainnet:
|
|
75
|
+
return baseAssets_1.story;
|
|
76
|
+
case types_1.KnownChainIds.ZkSyncEraMainnet:
|
|
77
|
+
return baseAssets_1.zkSyncEra;
|
|
78
|
+
case types_1.KnownChainIds.BlastMainnet:
|
|
79
|
+
return baseAssets_1.blast;
|
|
80
|
+
case types_1.KnownChainIds.WorldChainMainnet:
|
|
81
|
+
return baseAssets_1.worldchain;
|
|
82
|
+
case types_1.KnownChainIds.HemiMainnet:
|
|
83
|
+
return baseAssets_1.hemi;
|
|
84
|
+
case types_1.KnownChainIds.SeiMainnet:
|
|
85
|
+
return baseAssets_1.sei;
|
|
86
|
+
case types_1.KnownChainIds.LineaMainnet:
|
|
87
|
+
return baseAssets_1.linea;
|
|
88
|
+
case types_1.KnownChainIds.ScrollMainnet:
|
|
89
|
+
return baseAssets_1.scroll;
|
|
90
|
+
case types_1.KnownChainIds.SonicMainnet:
|
|
91
|
+
return baseAssets_1.sonic;
|
|
92
|
+
case types_1.KnownChainIds.UnichainMainnet:
|
|
93
|
+
return baseAssets_1.unichainChain;
|
|
94
|
+
case types_1.KnownChainIds.BobMainnet:
|
|
95
|
+
return baseAssets_1.bobChain;
|
|
96
|
+
case types_1.KnownChainIds.ModeMainnet:
|
|
97
|
+
return baseAssets_1.modeChain;
|
|
98
|
+
case types_1.KnownChainIds.SoneiumMainnet:
|
|
99
|
+
return baseAssets_1.soneium;
|
|
58
100
|
case types_1.KnownChainIds.NearMainnet:
|
|
59
101
|
return baseAssets_1.near;
|
|
60
102
|
case types_1.KnownChainIds.ZcashMainnet:
|
|
61
103
|
return baseAssets_1.zcash;
|
|
104
|
+
case types_1.KnownChainIds.TonMainnet:
|
|
105
|
+
return baseAssets_1.ton;
|
|
106
|
+
case types_1.KnownChainIds.AbstractMainnet:
|
|
107
|
+
return baseAssets_1.abstract;
|
|
62
108
|
default:
|
|
63
109
|
return (0, assertUnreachable_1.assertUnreachable)(knownChainId);
|
|
64
110
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type BigNumber from 'bignumber.js';
|
|
2
|
+
type NullableScalar = BigNumber.Value | null | undefined;
|
|
3
|
+
type WithPrecision = {
|
|
4
|
+
value: BigNumber.Value | null | undefined;
|
|
5
|
+
precision: number;
|
|
6
|
+
assetId?: never;
|
|
7
|
+
};
|
|
8
|
+
type WithAssetId = {
|
|
9
|
+
value: BigNumber.Value | null | undefined;
|
|
10
|
+
assetId: string;
|
|
11
|
+
precision?: never;
|
|
12
|
+
};
|
|
13
|
+
type FactoryArgs = WithPrecision | WithAssetId;
|
|
14
|
+
export type BigAmountConfig = {
|
|
15
|
+
resolvePrecision: (assetId: string) => number;
|
|
16
|
+
resolvePrice: (assetId: string) => string;
|
|
17
|
+
resolvePriceUsd: (assetId: string) => string;
|
|
18
|
+
};
|
|
19
|
+
export declare class BigAmount {
|
|
20
|
+
private readonly value;
|
|
21
|
+
readonly precision: number;
|
|
22
|
+
readonly assetId?: string;
|
|
23
|
+
private static config?;
|
|
24
|
+
private constructor();
|
|
25
|
+
static configure(config: BigAmountConfig): void;
|
|
26
|
+
static getConfig(): BigAmountConfig | undefined;
|
|
27
|
+
static resetConfig(): void;
|
|
28
|
+
static fromBaseUnit(args: FactoryArgs): BigAmount;
|
|
29
|
+
static fromPrecision(args: FactoryArgs): BigAmount;
|
|
30
|
+
static zero({ precision, assetId }: {
|
|
31
|
+
precision: number;
|
|
32
|
+
assetId?: string;
|
|
33
|
+
}): BigAmount;
|
|
34
|
+
static fromBN({ value, precision, assetId, }: {
|
|
35
|
+
value: BigNumber;
|
|
36
|
+
precision: number;
|
|
37
|
+
assetId?: string;
|
|
38
|
+
}): BigAmount;
|
|
39
|
+
static fromJSON({ value, precision, assetId, }: {
|
|
40
|
+
value: string;
|
|
41
|
+
precision: number;
|
|
42
|
+
assetId?: string;
|
|
43
|
+
}): BigAmount;
|
|
44
|
+
static min(...amounts: BigAmount[]): BigAmount;
|
|
45
|
+
static max(...amounts: BigAmount[]): BigAmount;
|
|
46
|
+
static isBigAmount(value: unknown): value is BigAmount;
|
|
47
|
+
plus(other: BigAmount | NullableScalar): BigAmount;
|
|
48
|
+
minus(other: BigAmount | NullableScalar): BigAmount;
|
|
49
|
+
times(scalar: NullableScalar): BigAmount;
|
|
50
|
+
div(scalar: NullableScalar): BigAmount;
|
|
51
|
+
abs(): BigAmount;
|
|
52
|
+
negated(): BigAmount;
|
|
53
|
+
positiveOrZero(): BigAmount;
|
|
54
|
+
decimalPlaces(n: number, rm?: BigNumber.RoundingMode): BigAmount;
|
|
55
|
+
gt(other: BigAmount | NullableScalar): boolean;
|
|
56
|
+
gte(other: BigAmount | NullableScalar): boolean;
|
|
57
|
+
lt(other: BigAmount | NullableScalar): boolean;
|
|
58
|
+
lte(other: BigAmount | NullableScalar): boolean;
|
|
59
|
+
eq(other: BigAmount | NullableScalar): boolean;
|
|
60
|
+
isZero(): boolean;
|
|
61
|
+
isPositive(): boolean;
|
|
62
|
+
isNegative(): boolean;
|
|
63
|
+
isFinite(): boolean;
|
|
64
|
+
toBaseUnit(): string;
|
|
65
|
+
toPrecision(): string;
|
|
66
|
+
toBN(): BigNumber;
|
|
67
|
+
toFixed(decimals?: number): string;
|
|
68
|
+
toString(): string;
|
|
69
|
+
toNumber(): number;
|
|
70
|
+
toSignificant(digits: number): string;
|
|
71
|
+
toUserCurrency(decimals?: number): string;
|
|
72
|
+
toUSD(decimals?: number): string;
|
|
73
|
+
static fromThorBaseUnit(value: BigNumber.Value | null | undefined): BigAmount;
|
|
74
|
+
toThorBaseUnit(): string;
|
|
75
|
+
toJSON(): {
|
|
76
|
+
value: string;
|
|
77
|
+
precision: number;
|
|
78
|
+
assetId?: string;
|
|
79
|
+
};
|
|
80
|
+
private static resolveConfigPrecision;
|
|
81
|
+
}
|
|
82
|
+
export {};
|