@shapeshiftoss/utils 1.0.5 → 1.0.6
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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/assetData/baseAssets.d.ts +21 -1
- package/dist/cjs/assetData/baseAssets.js +334 -17
- package/dist/cjs/assetData/decodeAssetData.js +2 -2
- package/dist/cjs/assetData/getBaseAsset.js +42 -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 +42 -2
- package/dist/cjs/encoding.d.ts +2 -0
- package/dist/cjs/encoding.js +13 -0
- package/dist/cjs/getAssetNamespaceFromChainId.js +21 -1
- package/dist/cjs/getChainShortName.d.ts +1 -1
- package/dist/cjs/getChainShortName.js +42 -2
- package/dist/cjs/getNativeFeeAssetReference.js +47 -2
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +7 -3
- package/dist/cjs/treasury.d.ts +5 -2
- package/dist/cjs/treasury.js +7 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/assetData/baseAssets.d.ts +21 -1
- package/dist/esm/assetData/baseAssets.js +333 -16
- package/dist/esm/assetData/decodeAssetData.js +1 -1
- package/dist/esm/assetData/getBaseAsset.js +43 -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 +43 -3
- package/dist/esm/encoding.d.ts +2 -0
- package/dist/esm/encoding.js +8 -0
- package/dist/esm/getAssetNamespaceFromChainId.js +21 -1
- package/dist/esm/getChainShortName.d.ts +1 -1
- package/dist/esm/getChainShortName.js +42 -2
- package/dist/esm/getNativeFeeAssetReference.js +47 -2
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/treasury.d.ts +5 -2
- package/dist/esm/treasury.js +6 -0
- package/package.json +7 -7
|
@@ -17,14 +17,34 @@ export declare const bnbsmartchain: Readonly<Asset>;
|
|
|
17
17
|
export declare const polygon: Readonly<Asset>;
|
|
18
18
|
export declare const gnosis: Readonly<Asset>;
|
|
19
19
|
export declare const arbitrum: Readonly<Asset>;
|
|
20
|
-
export declare const arbitrumNova: Readonly<Asset>;
|
|
21
20
|
export declare const base: Readonly<Asset>;
|
|
22
21
|
export declare const monad: Readonly<Asset>;
|
|
23
22
|
export declare const hyperevm: Readonly<Asset>;
|
|
24
23
|
export declare const plasma: Readonly<Asset>;
|
|
24
|
+
export declare const plume: Readonly<Asset>;
|
|
25
|
+
export declare const worldchain: Readonly<Asset>;
|
|
26
|
+
export declare const mantle: Readonly<Asset>;
|
|
27
|
+
export declare const ink: Readonly<Asset>;
|
|
28
|
+
export declare const cronos: Readonly<Asset>;
|
|
29
|
+
export declare const megaeth: Readonly<Asset>;
|
|
30
|
+
export declare const berachain: Readonly<Asset>;
|
|
25
31
|
export declare const katana: Readonly<Asset>;
|
|
32
|
+
export declare const flowEvm: Readonly<Asset>;
|
|
33
|
+
export declare const celo: Readonly<Asset>;
|
|
34
|
+
export declare const story: Readonly<Asset>;
|
|
35
|
+
export declare const zkSyncEra: Readonly<Asset>;
|
|
36
|
+
export declare const blast: Readonly<Asset>;
|
|
37
|
+
export declare const hemi: Readonly<Asset>;
|
|
38
|
+
export declare const linea: Readonly<Asset>;
|
|
39
|
+
export declare const scroll: Readonly<Asset>;
|
|
40
|
+
export declare const sonic: Readonly<Asset>;
|
|
41
|
+
export declare const unichainChain: Readonly<Asset>;
|
|
42
|
+
export declare const bobChain: Readonly<Asset>;
|
|
43
|
+
export declare const modeChain: Readonly<Asset>;
|
|
44
|
+
export declare const soneium: Readonly<Asset>;
|
|
26
45
|
export declare const solana: Readonly<Asset>;
|
|
27
46
|
export declare const tron: Readonly<Asset>;
|
|
28
47
|
export declare const sui: Readonly<Asset>;
|
|
29
48
|
export declare const near: Readonly<Asset>;
|
|
30
49
|
export declare const starknet: Readonly<Asset>;
|
|
50
|
+
export declare const ton: Readonly<Asset>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.starknet = exports.near = exports.sui = exports.tron = exports.solana = exports.katana = exports.
|
|
26
|
+
exports.ton = exports.starknet = exports.near = exports.sui = exports.tron = exports.solana = exports.soneium = exports.modeChain = exports.bobChain = exports.unichainChain = exports.sonic = exports.scroll = exports.linea = exports.hemi = exports.blast = exports.zkSyncEra = exports.story = exports.celo = 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 = void 0;
|
|
27
27
|
const caip = __importStar(require("@shapeshiftoss/caip"));
|
|
28
28
|
const mayaTokenAssetId = 'cosmos:mayachain-mainnet-v1/slip44:maya';
|
|
29
29
|
exports.ethereum = Object.freeze({
|
|
@@ -285,22 +285,6 @@ exports.arbitrum = Object.freeze({
|
|
|
285
285
|
explorerTxLink: 'https://arbiscan.io/tx/',
|
|
286
286
|
relatedAssetKey: 'eip155:1/slip44:60',
|
|
287
287
|
});
|
|
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
288
|
exports.base = Object.freeze({
|
|
305
289
|
assetId: caip.baseAssetId,
|
|
306
290
|
chainId: caip.baseChainId,
|
|
@@ -365,6 +349,116 @@ exports.plasma = Object.freeze({
|
|
|
365
349
|
explorerTxLink: 'https://plasmascan.to/tx/',
|
|
366
350
|
relatedAssetKey: null,
|
|
367
351
|
});
|
|
352
|
+
exports.plume = Object.freeze({
|
|
353
|
+
assetId: caip.plumeAssetId,
|
|
354
|
+
chainId: caip.plumeChainId,
|
|
355
|
+
name: 'Plume',
|
|
356
|
+
networkName: 'Plume',
|
|
357
|
+
symbol: 'PLUME',
|
|
358
|
+
precision: 18,
|
|
359
|
+
color: '#6C5DD3',
|
|
360
|
+
networkColor: '#6C5DD3',
|
|
361
|
+
icon: 'https://assets.coingecko.com/coins/images/49459/large/plume.jpg',
|
|
362
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/49459/small/plume.jpg',
|
|
363
|
+
explorer: 'https://explorer.plume.org',
|
|
364
|
+
explorerAddressLink: 'https://explorer.plume.org/address/',
|
|
365
|
+
explorerTxLink: 'https://explorer.plume.org/tx/',
|
|
366
|
+
relatedAssetKey: null,
|
|
367
|
+
});
|
|
368
|
+
exports.worldchain = Object.freeze({
|
|
369
|
+
assetId: caip.worldChainAssetId,
|
|
370
|
+
chainId: caip.worldChainChainId,
|
|
371
|
+
name: 'Ethereum',
|
|
372
|
+
networkName: 'World Chain',
|
|
373
|
+
symbol: 'ETH',
|
|
374
|
+
precision: 18,
|
|
375
|
+
color: '#000000',
|
|
376
|
+
networkColor: '#000000',
|
|
377
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
378
|
+
networkIcon: 'https://assets.relay.link/icons/480/light.png',
|
|
379
|
+
explorer: 'https://worldscan.org',
|
|
380
|
+
explorerAddressLink: 'https://worldscan.org/address/',
|
|
381
|
+
explorerTxLink: 'https://worldscan.org/tx/',
|
|
382
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
383
|
+
});
|
|
384
|
+
exports.mantle = Object.freeze({
|
|
385
|
+
assetId: caip.mantleAssetId,
|
|
386
|
+
chainId: caip.mantleChainId,
|
|
387
|
+
symbol: 'MNT',
|
|
388
|
+
name: 'Mantle',
|
|
389
|
+
networkName: 'Mantle',
|
|
390
|
+
precision: 18,
|
|
391
|
+
color: '#000000',
|
|
392
|
+
icon: 'https://assets.relay.link/icons/5000/light.png',
|
|
393
|
+
explorer: 'https://mantlescan.xyz',
|
|
394
|
+
explorerAddressLink: 'https://mantlescan.xyz/address/',
|
|
395
|
+
explorerTxLink: 'https://mantlescan.xyz/tx/',
|
|
396
|
+
relatedAssetKey: null,
|
|
397
|
+
});
|
|
398
|
+
exports.ink = Object.freeze({
|
|
399
|
+
assetId: caip.inkAssetId,
|
|
400
|
+
chainId: caip.inkChainId,
|
|
401
|
+
name: 'Ether',
|
|
402
|
+
networkName: 'Ink',
|
|
403
|
+
symbol: 'ETH',
|
|
404
|
+
precision: 18,
|
|
405
|
+
color: '#5A5AFF',
|
|
406
|
+
networkColor: '#5A5AFF',
|
|
407
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
408
|
+
networkIcon: 'https://assets.relay.link/icons/57073/light.png',
|
|
409
|
+
explorer: 'https://explorer.inkonchain.com',
|
|
410
|
+
explorerAddressLink: 'https://explorer.inkonchain.com/address/',
|
|
411
|
+
explorerTxLink: 'https://explorer.inkonchain.com/tx/',
|
|
412
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
413
|
+
});
|
|
414
|
+
exports.cronos = Object.freeze({
|
|
415
|
+
assetId: caip.cronosAssetId,
|
|
416
|
+
chainId: caip.cronosChainId,
|
|
417
|
+
name: 'Cronos',
|
|
418
|
+
networkName: 'Cronos',
|
|
419
|
+
symbol: 'CRO',
|
|
420
|
+
precision: 18,
|
|
421
|
+
color: '#002D74',
|
|
422
|
+
networkColor: '#002D74',
|
|
423
|
+
icon: 'https://assets.relay.link/icons/25/light.png',
|
|
424
|
+
networkIcon: 'https://assets.relay.link/icons/25/light.png',
|
|
425
|
+
explorer: 'https://explorer.cronos.org',
|
|
426
|
+
explorerAddressLink: 'https://explorer.cronos.org/address/',
|
|
427
|
+
explorerTxLink: 'https://explorer.cronos.org/tx/',
|
|
428
|
+
relatedAssetKey: null,
|
|
429
|
+
});
|
|
430
|
+
exports.megaeth = Object.freeze({
|
|
431
|
+
assetId: caip.megaethAssetId,
|
|
432
|
+
chainId: caip.megaethChainId,
|
|
433
|
+
name: 'Ether',
|
|
434
|
+
networkName: 'MegaETH',
|
|
435
|
+
symbol: 'ETH',
|
|
436
|
+
precision: 18,
|
|
437
|
+
color: '#FF6B35',
|
|
438
|
+
networkColor: '#FF6B35',
|
|
439
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
440
|
+
networkIcon: 'https://coin-images.coingecko.com/asset_platforms/images/32266/small/megaeth.jpg?1762329010',
|
|
441
|
+
explorer: 'https://megaeth.blockscout.com',
|
|
442
|
+
explorerAddressLink: 'https://megaeth.blockscout.com/address/',
|
|
443
|
+
explorerTxLink: 'https://megaeth.blockscout.com/tx/',
|
|
444
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
445
|
+
});
|
|
446
|
+
exports.berachain = Object.freeze({
|
|
447
|
+
assetId: caip.berachainAssetId,
|
|
448
|
+
chainId: caip.berachainChainId,
|
|
449
|
+
name: 'Berachain',
|
|
450
|
+
networkName: 'Berachain',
|
|
451
|
+
symbol: 'BERA',
|
|
452
|
+
precision: 18,
|
|
453
|
+
color: '#6B4226',
|
|
454
|
+
networkColor: '#6B4226',
|
|
455
|
+
icon: 'https://assets.relay.link/icons/80094/light.png',
|
|
456
|
+
networkIcon: 'https://assets.relay.link/icons/80094/light.png',
|
|
457
|
+
explorer: 'https://berascan.com',
|
|
458
|
+
explorerAddressLink: 'https://berascan.com/address/',
|
|
459
|
+
explorerTxLink: 'https://berascan.com/tx/',
|
|
460
|
+
relatedAssetKey: null,
|
|
461
|
+
});
|
|
368
462
|
exports.katana = Object.freeze({
|
|
369
463
|
assetId: caip.katanaAssetId,
|
|
370
464
|
chainId: caip.katanaChainId,
|
|
@@ -381,6 +475,214 @@ exports.katana = Object.freeze({
|
|
|
381
475
|
explorerTxLink: 'https://katanascan.com/tx/',
|
|
382
476
|
relatedAssetKey: 'eip155:1/slip44:60',
|
|
383
477
|
});
|
|
478
|
+
exports.flowEvm = Object.freeze({
|
|
479
|
+
assetId: caip.flowEvmAssetId,
|
|
480
|
+
chainId: caip.flowEvmChainId,
|
|
481
|
+
name: 'Flow',
|
|
482
|
+
networkName: 'Flow EVM',
|
|
483
|
+
symbol: 'FLOW',
|
|
484
|
+
precision: 18,
|
|
485
|
+
color: '#00EF8B',
|
|
486
|
+
networkColor: '#00EF8B',
|
|
487
|
+
icon: 'https://assets.coingecko.com/coins/images/13446/large/5f6294c0c7a8cda55cb1c936_Flow_Wordmark.png',
|
|
488
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/13446/small/5f6294c0c7a8cda55cb1c936_Flow_Wordmark.png',
|
|
489
|
+
explorer: 'https://evm.flowscan.io',
|
|
490
|
+
explorerAddressLink: 'https://evm.flowscan.io/address/',
|
|
491
|
+
explorerTxLink: 'https://evm.flowscan.io/tx/',
|
|
492
|
+
relatedAssetKey: null,
|
|
493
|
+
});
|
|
494
|
+
exports.celo = Object.freeze({
|
|
495
|
+
assetId: caip.celoAssetId,
|
|
496
|
+
chainId: caip.celoChainId,
|
|
497
|
+
name: 'Celo',
|
|
498
|
+
networkName: 'Celo',
|
|
499
|
+
symbol: 'CELO',
|
|
500
|
+
precision: 18,
|
|
501
|
+
color: '#35D07F',
|
|
502
|
+
networkColor: '#35D07F',
|
|
503
|
+
icon: 'https://assets.coingecko.com/coins/images/11090/large/celo.png',
|
|
504
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/11090/small/celo.png',
|
|
505
|
+
explorer: 'https://celoscan.io',
|
|
506
|
+
explorerAddressLink: 'https://celoscan.io/address/',
|
|
507
|
+
explorerTxLink: 'https://celoscan.io/tx/',
|
|
508
|
+
relatedAssetKey: null,
|
|
509
|
+
});
|
|
510
|
+
exports.story = Object.freeze({
|
|
511
|
+
assetId: caip.storyAssetId,
|
|
512
|
+
chainId: caip.storyChainId,
|
|
513
|
+
name: 'Story',
|
|
514
|
+
networkName: 'Story',
|
|
515
|
+
symbol: 'IP',
|
|
516
|
+
precision: 18,
|
|
517
|
+
color: '#EA580C',
|
|
518
|
+
networkColor: '#EA580C',
|
|
519
|
+
icon: 'https://assets.coingecko.com/coins/images/51994/large/story-2.png',
|
|
520
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/51994/small/story-2.png',
|
|
521
|
+
explorer: 'https://storyscan.xyz',
|
|
522
|
+
explorerAddressLink: 'https://storyscan.xyz/address/',
|
|
523
|
+
explorerTxLink: 'https://storyscan.xyz/tx/',
|
|
524
|
+
relatedAssetKey: null,
|
|
525
|
+
});
|
|
526
|
+
exports.zkSyncEra = Object.freeze({
|
|
527
|
+
assetId: caip.zkSyncEraAssetId,
|
|
528
|
+
chainId: caip.zkSyncEraChainId,
|
|
529
|
+
name: 'Ethereum',
|
|
530
|
+
networkName: 'zkSync Era',
|
|
531
|
+
symbol: 'ETH',
|
|
532
|
+
precision: 18,
|
|
533
|
+
color: '#8C8DFC',
|
|
534
|
+
networkColor: '#8C8DFC',
|
|
535
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
536
|
+
networkIcon: 'https://assets.relay.link/icons/324/light.png',
|
|
537
|
+
explorer: 'https://explorer.zksync.io',
|
|
538
|
+
explorerAddressLink: 'https://explorer.zksync.io/address/',
|
|
539
|
+
explorerTxLink: 'https://explorer.zksync.io/tx/',
|
|
540
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
541
|
+
});
|
|
542
|
+
exports.blast = Object.freeze({
|
|
543
|
+
assetId: caip.blastAssetId,
|
|
544
|
+
chainId: caip.blastChainId,
|
|
545
|
+
name: 'Ethereum',
|
|
546
|
+
networkName: 'Blast',
|
|
547
|
+
symbol: 'ETH',
|
|
548
|
+
precision: 18,
|
|
549
|
+
color: '#FCFC03',
|
|
550
|
+
networkColor: '#FCFC03',
|
|
551
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
552
|
+
networkIcon: 'https://assets.relay.link/icons/81457/light.png',
|
|
553
|
+
explorer: 'https://blastscan.io',
|
|
554
|
+
explorerAddressLink: 'https://blastscan.io/address/',
|
|
555
|
+
explorerTxLink: 'https://blastscan.io/tx/',
|
|
556
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
557
|
+
});
|
|
558
|
+
exports.hemi = Object.freeze({
|
|
559
|
+
assetId: caip.hemiAssetId,
|
|
560
|
+
chainId: caip.hemiChainId,
|
|
561
|
+
name: 'Ethereum',
|
|
562
|
+
networkName: 'Hemi',
|
|
563
|
+
symbol: 'ETH',
|
|
564
|
+
precision: 18,
|
|
565
|
+
color: '#FF6B35',
|
|
566
|
+
networkColor: '#FF6B35',
|
|
567
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
568
|
+
networkIcon: 'https://assets.relay.link/icons/43111/light.png',
|
|
569
|
+
explorer: 'https://explorer.hemi.xyz',
|
|
570
|
+
explorerAddressLink: 'https://explorer.hemi.xyz/address/',
|
|
571
|
+
explorerTxLink: 'https://explorer.hemi.xyz/tx/',
|
|
572
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
573
|
+
});
|
|
574
|
+
exports.linea = Object.freeze({
|
|
575
|
+
assetId: caip.lineaAssetId,
|
|
576
|
+
chainId: caip.lineaChainId,
|
|
577
|
+
name: 'Ethereum',
|
|
578
|
+
networkName: 'Linea',
|
|
579
|
+
symbol: 'ETH',
|
|
580
|
+
precision: 18,
|
|
581
|
+
color: '#5C6BC0',
|
|
582
|
+
networkColor: '#121212',
|
|
583
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
584
|
+
networkIcon: 'https://assets.relay.link/icons/59144/light.png',
|
|
585
|
+
explorer: 'https://lineascan.build',
|
|
586
|
+
explorerAddressLink: 'https://lineascan.build/address/',
|
|
587
|
+
explorerTxLink: 'https://lineascan.build/tx/',
|
|
588
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
589
|
+
});
|
|
590
|
+
exports.scroll = Object.freeze({
|
|
591
|
+
assetId: caip.scrollAssetId,
|
|
592
|
+
chainId: caip.scrollChainId,
|
|
593
|
+
name: 'Ether',
|
|
594
|
+
networkName: 'Scroll',
|
|
595
|
+
symbol: 'ETH',
|
|
596
|
+
precision: 18,
|
|
597
|
+
color: '#FFEEDA',
|
|
598
|
+
networkColor: '#FFEEDA',
|
|
599
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
600
|
+
networkIcon: 'https://scroll-tech.github.io/token-list/scroll.png',
|
|
601
|
+
explorer: 'https://scrollscan.com',
|
|
602
|
+
explorerAddressLink: 'https://scrollscan.com/address/',
|
|
603
|
+
explorerTxLink: 'https://scrollscan.com/tx/',
|
|
604
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
605
|
+
});
|
|
606
|
+
exports.sonic = Object.freeze({
|
|
607
|
+
assetId: caip.sonicAssetId,
|
|
608
|
+
chainId: caip.sonicChainId,
|
|
609
|
+
name: 'Sonic (S)',
|
|
610
|
+
networkName: 'Sonic',
|
|
611
|
+
symbol: 'S',
|
|
612
|
+
precision: 18,
|
|
613
|
+
color: '#1B1464',
|
|
614
|
+
networkColor: '#1B1464',
|
|
615
|
+
icon: 'https://assets.coingecko.com/coins/images/38108/standard/200x200_Sonic_Logo.png',
|
|
616
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/38108/standard/200x200_Sonic_Logo.png',
|
|
617
|
+
explorer: 'https://sonicscan.org',
|
|
618
|
+
explorerAddressLink: 'https://sonicscan.org/address/',
|
|
619
|
+
explorerTxLink: 'https://sonicscan.org/tx/',
|
|
620
|
+
relatedAssetKey: null,
|
|
621
|
+
});
|
|
622
|
+
exports.unichainChain = Object.freeze({
|
|
623
|
+
assetId: caip.unichainAssetId,
|
|
624
|
+
chainId: caip.unichainChainId,
|
|
625
|
+
name: 'Ether',
|
|
626
|
+
networkName: 'Unichain',
|
|
627
|
+
symbol: 'ETH',
|
|
628
|
+
precision: 18,
|
|
629
|
+
color: '#5C6BC0',
|
|
630
|
+
networkColor: '#F50DB4',
|
|
631
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
632
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/22206/small/unichain.png',
|
|
633
|
+
explorer: 'https://uniscan.xyz',
|
|
634
|
+
explorerAddressLink: 'https://uniscan.xyz/address/',
|
|
635
|
+
explorerTxLink: 'https://uniscan.xyz/tx/',
|
|
636
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
637
|
+
});
|
|
638
|
+
exports.bobChain = Object.freeze({
|
|
639
|
+
assetId: caip.bobAssetId,
|
|
640
|
+
chainId: caip.bobChainId,
|
|
641
|
+
name: 'Ethereum',
|
|
642
|
+
networkName: 'BOB',
|
|
643
|
+
symbol: 'ETH',
|
|
644
|
+
precision: 18,
|
|
645
|
+
color: '#5C6BC0',
|
|
646
|
+
networkColor: '#F25D00',
|
|
647
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
648
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/255/small/bob.jpeg',
|
|
649
|
+
explorer: 'https://explorer.gobob.xyz',
|
|
650
|
+
explorerAddressLink: 'https://explorer.gobob.xyz/address/',
|
|
651
|
+
explorerTxLink: 'https://explorer.gobob.xyz/tx/',
|
|
652
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
653
|
+
});
|
|
654
|
+
exports.modeChain = Object.freeze({
|
|
655
|
+
assetId: caip.modeAssetId,
|
|
656
|
+
chainId: caip.modeChainId,
|
|
657
|
+
name: 'Ethereum',
|
|
658
|
+
networkName: 'Mode',
|
|
659
|
+
symbol: 'ETH',
|
|
660
|
+
precision: 18,
|
|
661
|
+
color: '#5C6BC0',
|
|
662
|
+
networkColor: '#DFFE00',
|
|
663
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
664
|
+
networkIcon: 'https://assets.relay.link/icons/34443/light.png',
|
|
665
|
+
explorer: 'https://modescan.io',
|
|
666
|
+
explorerAddressLink: 'https://modescan.io/address/',
|
|
667
|
+
explorerTxLink: 'https://modescan.io/tx/',
|
|
668
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
669
|
+
});
|
|
670
|
+
exports.soneium = Object.freeze({
|
|
671
|
+
assetId: caip.soneiumAssetId,
|
|
672
|
+
chainId: caip.soneiumChainId,
|
|
673
|
+
name: 'Ethereum',
|
|
674
|
+
networkName: 'Soneium',
|
|
675
|
+
symbol: 'ETH',
|
|
676
|
+
precision: 18,
|
|
677
|
+
color: '#627EEA',
|
|
678
|
+
networkColor: '#1A1A2E',
|
|
679
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
680
|
+
networkIcon: 'https://assets.relay.link/icons/1868/light.png',
|
|
681
|
+
explorer: 'https://soneium.blockscout.com',
|
|
682
|
+
explorerAddressLink: 'https://soneium.blockscout.com/address/',
|
|
683
|
+
explorerTxLink: 'https://soneium.blockscout.com/tx/',
|
|
684
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
685
|
+
});
|
|
384
686
|
exports.solana = Object.freeze({
|
|
385
687
|
assetId: caip.solAssetId,
|
|
386
688
|
chainId: caip.solanaChainId,
|
|
@@ -456,3 +758,18 @@ exports.starknet = Object.freeze({
|
|
|
456
758
|
explorerTxLink: 'https://starkscan.co/tx/',
|
|
457
759
|
relatedAssetKey: null,
|
|
458
760
|
});
|
|
761
|
+
exports.ton = Object.freeze({
|
|
762
|
+
assetId: caip.tonAssetId,
|
|
763
|
+
chainId: caip.tonChainId,
|
|
764
|
+
name: 'Toncoin',
|
|
765
|
+
networkName: 'TON',
|
|
766
|
+
symbol: 'TON',
|
|
767
|
+
precision: 9,
|
|
768
|
+
color: '#0098EA',
|
|
769
|
+
networkColor: '#0098EA',
|
|
770
|
+
icon: 'https://assets.coingecko.com/coins/images/17980/large/ton_symbol.png?1696517498',
|
|
771
|
+
explorer: 'https://tonscan.org',
|
|
772
|
+
explorerAddressLink: 'https://tonscan.org/address/',
|
|
773
|
+
explorerTxLink: 'https://tonscan.org/tx/',
|
|
774
|
+
relatedAssetKey: null,
|
|
775
|
+
});
|
|
@@ -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,54 @@ 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.FlowEvmMainnet:
|
|
69
|
+
return baseAssets_1.flowEvm;
|
|
70
|
+
case types_1.KnownChainIds.CeloMainnet:
|
|
71
|
+
return baseAssets_1.celo;
|
|
72
|
+
case types_1.KnownChainIds.StoryMainnet:
|
|
73
|
+
return baseAssets_1.story;
|
|
74
|
+
case types_1.KnownChainIds.ZkSyncEraMainnet:
|
|
75
|
+
return baseAssets_1.zkSyncEra;
|
|
76
|
+
case types_1.KnownChainIds.BlastMainnet:
|
|
77
|
+
return baseAssets_1.blast;
|
|
78
|
+
case types_1.KnownChainIds.WorldChainMainnet:
|
|
79
|
+
return baseAssets_1.worldchain;
|
|
80
|
+
case types_1.KnownChainIds.HemiMainnet:
|
|
81
|
+
return baseAssets_1.hemi;
|
|
82
|
+
case types_1.KnownChainIds.LineaMainnet:
|
|
83
|
+
return baseAssets_1.linea;
|
|
84
|
+
case types_1.KnownChainIds.ScrollMainnet:
|
|
85
|
+
return baseAssets_1.scroll;
|
|
86
|
+
case types_1.KnownChainIds.SonicMainnet:
|
|
87
|
+
return baseAssets_1.sonic;
|
|
88
|
+
case types_1.KnownChainIds.UnichainMainnet:
|
|
89
|
+
return baseAssets_1.unichainChain;
|
|
90
|
+
case types_1.KnownChainIds.BobMainnet:
|
|
91
|
+
return baseAssets_1.bobChain;
|
|
92
|
+
case types_1.KnownChainIds.ModeMainnet:
|
|
93
|
+
return baseAssets_1.modeChain;
|
|
94
|
+
case types_1.KnownChainIds.SoneiumMainnet:
|
|
95
|
+
return baseAssets_1.soneium;
|
|
58
96
|
case types_1.KnownChainIds.NearMainnet:
|
|
59
97
|
return baseAssets_1.near;
|
|
60
98
|
case types_1.KnownChainIds.ZcashMainnet:
|
|
61
99
|
return baseAssets_1.zcash;
|
|
100
|
+
case types_1.KnownChainIds.TonMainnet:
|
|
101
|
+
return baseAssets_1.ton;
|
|
62
102
|
default:
|
|
63
103
|
return (0, assertUnreachable_1.assertUnreachable)(knownChainId);
|
|
64
104
|
}
|
|
@@ -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 {};
|