@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>;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import * as caip from '@shapeshiftoss/caip';
|
|
2
|
+
export const abstract = Object.freeze({
|
|
3
|
+
assetId: caip.abstractAssetId,
|
|
4
|
+
chainId: caip.abstractChainId,
|
|
5
|
+
name: 'Ethereum',
|
|
6
|
+
networkName: 'Abstract',
|
|
7
|
+
symbol: 'ETH',
|
|
8
|
+
precision: 18,
|
|
9
|
+
color: '#00D4AA',
|
|
10
|
+
networkColor: '#00D4AA',
|
|
11
|
+
icon: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
|
|
12
|
+
networkIcon: 'https://assets.relay.link/icons/2741/light.png',
|
|
13
|
+
explorer: 'https://abscan.org',
|
|
14
|
+
explorerAddressLink: 'https://abscan.org/address/',
|
|
15
|
+
explorerTxLink: 'https://abscan.org/tx/',
|
|
16
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
17
|
+
});
|
|
2
18
|
const mayaTokenAssetId = 'cosmos:mayachain-mainnet-v1/slip44:maya';
|
|
3
19
|
export const ethereum = Object.freeze({
|
|
4
20
|
assetId: caip.ethAssetId,
|
|
@@ -259,22 +275,6 @@ export const arbitrum = Object.freeze({
|
|
|
259
275
|
explorerTxLink: 'https://arbiscan.io/tx/',
|
|
260
276
|
relatedAssetKey: 'eip155:1/slip44:60',
|
|
261
277
|
});
|
|
262
|
-
export const arbitrumNova = Object.freeze({
|
|
263
|
-
assetId: caip.arbitrumNovaAssetId,
|
|
264
|
-
chainId: caip.arbitrumNovaChainId,
|
|
265
|
-
name: 'Ethereum',
|
|
266
|
-
networkName: 'Arbitrum Nova',
|
|
267
|
-
symbol: 'ETH',
|
|
268
|
-
precision: 18,
|
|
269
|
-
color: '#5C6BC0',
|
|
270
|
-
networkColor: '#E67408',
|
|
271
|
-
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
272
|
-
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/93/large/AN_logomark.png?1695026131',
|
|
273
|
-
explorer: 'https://nova.arbiscan.io',
|
|
274
|
-
explorerAddressLink: 'https://nova.arbiscan.io/address/',
|
|
275
|
-
explorerTxLink: 'https://nova.arbiscan.io/tx/',
|
|
276
|
-
relatedAssetKey: 'eip155:1/slip44:60',
|
|
277
|
-
});
|
|
278
278
|
export const base = Object.freeze({
|
|
279
279
|
assetId: caip.baseAssetId,
|
|
280
280
|
chainId: caip.baseChainId,
|
|
@@ -339,6 +339,116 @@ export const plasma = Object.freeze({
|
|
|
339
339
|
explorerTxLink: 'https://plasmascan.to/tx/',
|
|
340
340
|
relatedAssetKey: null,
|
|
341
341
|
});
|
|
342
|
+
export const plume = Object.freeze({
|
|
343
|
+
assetId: caip.plumeAssetId,
|
|
344
|
+
chainId: caip.plumeChainId,
|
|
345
|
+
name: 'Plume',
|
|
346
|
+
networkName: 'Plume',
|
|
347
|
+
symbol: 'PLUME',
|
|
348
|
+
precision: 18,
|
|
349
|
+
color: '#6C5DD3',
|
|
350
|
+
networkColor: '#6C5DD3',
|
|
351
|
+
icon: 'https://assets.coingecko.com/coins/images/70470/large/plume.jpg',
|
|
352
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/70470/small/plume.jpg',
|
|
353
|
+
explorer: 'https://explorer.plume.org',
|
|
354
|
+
explorerAddressLink: 'https://explorer.plume.org/address/',
|
|
355
|
+
explorerTxLink: 'https://explorer.plume.org/tx/',
|
|
356
|
+
relatedAssetKey: null,
|
|
357
|
+
});
|
|
358
|
+
export const worldchain = Object.freeze({
|
|
359
|
+
assetId: caip.worldChainAssetId,
|
|
360
|
+
chainId: caip.worldChainChainId,
|
|
361
|
+
name: 'Ethereum',
|
|
362
|
+
networkName: 'World Chain',
|
|
363
|
+
symbol: 'ETH',
|
|
364
|
+
precision: 18,
|
|
365
|
+
color: '#000000',
|
|
366
|
+
networkColor: '#000000',
|
|
367
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
368
|
+
networkIcon: 'https://assets.relay.link/icons/480/light.png',
|
|
369
|
+
explorer: 'https://worldscan.org',
|
|
370
|
+
explorerAddressLink: 'https://worldscan.org/address/',
|
|
371
|
+
explorerTxLink: 'https://worldscan.org/tx/',
|
|
372
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
373
|
+
});
|
|
374
|
+
export const mantle = Object.freeze({
|
|
375
|
+
assetId: caip.mantleAssetId,
|
|
376
|
+
chainId: caip.mantleChainId,
|
|
377
|
+
symbol: 'MNT',
|
|
378
|
+
name: 'Mantle',
|
|
379
|
+
networkName: 'Mantle',
|
|
380
|
+
precision: 18,
|
|
381
|
+
color: '#000000',
|
|
382
|
+
icon: 'https://assets.relay.link/icons/5000/light.png',
|
|
383
|
+
explorer: 'https://mantlescan.xyz',
|
|
384
|
+
explorerAddressLink: 'https://mantlescan.xyz/address/',
|
|
385
|
+
explorerTxLink: 'https://mantlescan.xyz/tx/',
|
|
386
|
+
relatedAssetKey: null,
|
|
387
|
+
});
|
|
388
|
+
export const ink = Object.freeze({
|
|
389
|
+
assetId: caip.inkAssetId,
|
|
390
|
+
chainId: caip.inkChainId,
|
|
391
|
+
name: 'Ether',
|
|
392
|
+
networkName: 'Ink',
|
|
393
|
+
symbol: 'ETH',
|
|
394
|
+
precision: 18,
|
|
395
|
+
color: '#5A5AFF',
|
|
396
|
+
networkColor: '#5A5AFF',
|
|
397
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
398
|
+
networkIcon: 'https://assets.relay.link/icons/57073/light.png',
|
|
399
|
+
explorer: 'https://explorer.inkonchain.com',
|
|
400
|
+
explorerAddressLink: 'https://explorer.inkonchain.com/address/',
|
|
401
|
+
explorerTxLink: 'https://explorer.inkonchain.com/tx/',
|
|
402
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
403
|
+
});
|
|
404
|
+
export const cronos = Object.freeze({
|
|
405
|
+
assetId: caip.cronosAssetId,
|
|
406
|
+
chainId: caip.cronosChainId,
|
|
407
|
+
name: 'Cronos',
|
|
408
|
+
networkName: 'Cronos',
|
|
409
|
+
symbol: 'CRO',
|
|
410
|
+
precision: 18,
|
|
411
|
+
color: '#002D74',
|
|
412
|
+
networkColor: '#002D74',
|
|
413
|
+
icon: 'https://assets.relay.link/icons/25/light.png',
|
|
414
|
+
networkIcon: 'https://assets.relay.link/icons/25/light.png',
|
|
415
|
+
explorer: 'https://explorer.cronos.org',
|
|
416
|
+
explorerAddressLink: 'https://explorer.cronos.org/address/',
|
|
417
|
+
explorerTxLink: 'https://explorer.cronos.org/tx/',
|
|
418
|
+
relatedAssetKey: null,
|
|
419
|
+
});
|
|
420
|
+
export const megaeth = Object.freeze({
|
|
421
|
+
assetId: caip.megaethAssetId,
|
|
422
|
+
chainId: caip.megaethChainId,
|
|
423
|
+
name: 'Ethereum',
|
|
424
|
+
networkName: 'MegaETH',
|
|
425
|
+
symbol: 'ETH',
|
|
426
|
+
precision: 18,
|
|
427
|
+
color: '#FF6B35',
|
|
428
|
+
networkColor: '#FF6B35',
|
|
429
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
430
|
+
networkIcon: 'https://coin-images.coingecko.com/asset_platforms/images/32266/small/megaeth.jpg?1762329010',
|
|
431
|
+
explorer: 'https://megaeth.blockscout.com',
|
|
432
|
+
explorerAddressLink: 'https://megaeth.blockscout.com/address/',
|
|
433
|
+
explorerTxLink: 'https://megaeth.blockscout.com/tx/',
|
|
434
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
435
|
+
});
|
|
436
|
+
export const berachain = Object.freeze({
|
|
437
|
+
assetId: caip.berachainAssetId,
|
|
438
|
+
chainId: caip.berachainChainId,
|
|
439
|
+
name: 'Berachain',
|
|
440
|
+
networkName: 'Berachain',
|
|
441
|
+
symbol: 'BERA',
|
|
442
|
+
precision: 18,
|
|
443
|
+
color: '#6B4226',
|
|
444
|
+
networkColor: '#6B4226',
|
|
445
|
+
icon: 'https://assets.relay.link/icons/80094/light.png',
|
|
446
|
+
networkIcon: 'https://assets.relay.link/icons/80094/light.png',
|
|
447
|
+
explorer: 'https://berascan.com',
|
|
448
|
+
explorerAddressLink: 'https://berascan.com/address/',
|
|
449
|
+
explorerTxLink: 'https://berascan.com/tx/',
|
|
450
|
+
relatedAssetKey: null,
|
|
451
|
+
});
|
|
342
452
|
export const katana = Object.freeze({
|
|
343
453
|
assetId: caip.katanaAssetId,
|
|
344
454
|
chainId: caip.katanaChainId,
|
|
@@ -355,6 +465,246 @@ export const katana = Object.freeze({
|
|
|
355
465
|
explorerTxLink: 'https://katanascan.com/tx/',
|
|
356
466
|
relatedAssetKey: 'eip155:1/slip44:60',
|
|
357
467
|
});
|
|
468
|
+
export const flowEvm = Object.freeze({
|
|
469
|
+
assetId: caip.flowEvmAssetId,
|
|
470
|
+
chainId: caip.flowEvmChainId,
|
|
471
|
+
name: 'Flow',
|
|
472
|
+
networkName: 'Flow EVM',
|
|
473
|
+
symbol: 'FLOW',
|
|
474
|
+
precision: 18,
|
|
475
|
+
color: '#00EF8B',
|
|
476
|
+
networkColor: '#00EF8B',
|
|
477
|
+
icon: 'https://assets.coingecko.com/coins/images/13446/large/5f6294c0c7a8cda55cb1c936_Flow_Wordmark.png',
|
|
478
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/13446/small/5f6294c0c7a8cda55cb1c936_Flow_Wordmark.png',
|
|
479
|
+
explorer: 'https://evm.flowscan.io',
|
|
480
|
+
explorerAddressLink: 'https://evm.flowscan.io/address/',
|
|
481
|
+
explorerTxLink: 'https://evm.flowscan.io/tx/',
|
|
482
|
+
relatedAssetKey: null,
|
|
483
|
+
});
|
|
484
|
+
export const ethereal = Object.freeze({
|
|
485
|
+
assetId: caip.etherealAssetId,
|
|
486
|
+
chainId: caip.etherealChainId,
|
|
487
|
+
name: 'USDe',
|
|
488
|
+
networkName: 'Ethereal',
|
|
489
|
+
symbol: 'USDe',
|
|
490
|
+
precision: 18,
|
|
491
|
+
color: '#4A90D9',
|
|
492
|
+
networkColor: '#4A90D9',
|
|
493
|
+
icon: 'https://assets.coingecko.com/coins/images/33613/large/USDE.png',
|
|
494
|
+
networkIcon: 'https://assets.relay.link/icons/5064014/light.png',
|
|
495
|
+
explorer: 'https://explorer.ethereal.global',
|
|
496
|
+
explorerAddressLink: 'https://explorer.ethereal.global/address/',
|
|
497
|
+
explorerTxLink: 'https://explorer.ethereal.global/tx/',
|
|
498
|
+
relatedAssetKey: null,
|
|
499
|
+
});
|
|
500
|
+
export const celo = Object.freeze({
|
|
501
|
+
assetId: caip.celoAssetId,
|
|
502
|
+
chainId: caip.celoChainId,
|
|
503
|
+
name: 'Celo',
|
|
504
|
+
networkName: 'Celo',
|
|
505
|
+
symbol: 'CELO',
|
|
506
|
+
precision: 18,
|
|
507
|
+
color: '#35D07F',
|
|
508
|
+
networkColor: '#35D07F',
|
|
509
|
+
icon: 'https://assets.coingecko.com/asset_platforms/images/21/large/celo.jpeg',
|
|
510
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/21/small/celo.jpeg',
|
|
511
|
+
explorer: 'https://celoscan.io',
|
|
512
|
+
explorerAddressLink: 'https://celoscan.io/address/',
|
|
513
|
+
explorerTxLink: 'https://celoscan.io/tx/',
|
|
514
|
+
relatedAssetKey: null,
|
|
515
|
+
});
|
|
516
|
+
export const story = Object.freeze({
|
|
517
|
+
assetId: caip.storyAssetId,
|
|
518
|
+
chainId: caip.storyChainId,
|
|
519
|
+
name: 'Story',
|
|
520
|
+
networkName: 'Story',
|
|
521
|
+
symbol: 'IP',
|
|
522
|
+
precision: 18,
|
|
523
|
+
color: '#EA580C',
|
|
524
|
+
networkColor: '#EA580C',
|
|
525
|
+
icon: 'https://assets.coingecko.com/asset_platforms/images/22207/large/story.jpg',
|
|
526
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/22207/small/story.jpg',
|
|
527
|
+
explorer: 'https://storyscan.xyz',
|
|
528
|
+
explorerAddressLink: 'https://storyscan.xyz/address/',
|
|
529
|
+
explorerTxLink: 'https://storyscan.xyz/tx/',
|
|
530
|
+
relatedAssetKey: null,
|
|
531
|
+
});
|
|
532
|
+
export const zkSyncEra = Object.freeze({
|
|
533
|
+
assetId: caip.zkSyncEraAssetId,
|
|
534
|
+
chainId: caip.zkSyncEraChainId,
|
|
535
|
+
name: 'Ethereum',
|
|
536
|
+
networkName: 'zkSync Era',
|
|
537
|
+
symbol: 'ETH',
|
|
538
|
+
precision: 18,
|
|
539
|
+
color: '#8C8DFC',
|
|
540
|
+
networkColor: '#8C8DFC',
|
|
541
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
542
|
+
networkIcon: 'https://assets.relay.link/icons/324/light.png',
|
|
543
|
+
explorer: 'https://explorer.zksync.io',
|
|
544
|
+
explorerAddressLink: 'https://explorer.zksync.io/address/',
|
|
545
|
+
explorerTxLink: 'https://explorer.zksync.io/tx/',
|
|
546
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
547
|
+
});
|
|
548
|
+
export const blast = Object.freeze({
|
|
549
|
+
assetId: caip.blastAssetId,
|
|
550
|
+
chainId: caip.blastChainId,
|
|
551
|
+
name: 'Ethereum',
|
|
552
|
+
networkName: 'Blast',
|
|
553
|
+
symbol: 'ETH',
|
|
554
|
+
precision: 18,
|
|
555
|
+
color: '#FCFC03',
|
|
556
|
+
networkColor: '#FCFC03',
|
|
557
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
558
|
+
networkIcon: 'https://assets.relay.link/icons/81457/light.png',
|
|
559
|
+
explorer: 'https://blastscan.io',
|
|
560
|
+
explorerAddressLink: 'https://blastscan.io/address/',
|
|
561
|
+
explorerTxLink: 'https://blastscan.io/tx/',
|
|
562
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
563
|
+
});
|
|
564
|
+
export const hemi = Object.freeze({
|
|
565
|
+
assetId: caip.hemiAssetId,
|
|
566
|
+
chainId: caip.hemiChainId,
|
|
567
|
+
name: 'Ethereum',
|
|
568
|
+
networkName: 'Hemi',
|
|
569
|
+
symbol: 'ETH',
|
|
570
|
+
precision: 18,
|
|
571
|
+
color: '#FF6B35',
|
|
572
|
+
networkColor: '#FF6B35',
|
|
573
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
574
|
+
networkIcon: 'https://assets.relay.link/icons/43111/light.png',
|
|
575
|
+
explorer: 'https://explorer.hemi.xyz',
|
|
576
|
+
explorerAddressLink: 'https://explorer.hemi.xyz/address/',
|
|
577
|
+
explorerTxLink: 'https://explorer.hemi.xyz/tx/',
|
|
578
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
579
|
+
});
|
|
580
|
+
export const sei = Object.freeze({
|
|
581
|
+
assetId: caip.seiAssetId,
|
|
582
|
+
chainId: caip.seiChainId,
|
|
583
|
+
name: 'SEI',
|
|
584
|
+
networkName: 'Sei',
|
|
585
|
+
symbol: 'SEI',
|
|
586
|
+
precision: 18,
|
|
587
|
+
color: '#9B1B30',
|
|
588
|
+
networkColor: '#9B1B30',
|
|
589
|
+
icon: 'https://assets.coingecko.com/coins/images/28205/large/Sei_Logo_-_Transparent.png',
|
|
590
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/28205/small/Sei_Logo_-_Transparent.png',
|
|
591
|
+
explorer: 'https://seitrace.com',
|
|
592
|
+
explorerAddressLink: 'https://seitrace.com/address/',
|
|
593
|
+
explorerTxLink: 'https://seitrace.com/tx/',
|
|
594
|
+
relatedAssetKey: null,
|
|
595
|
+
});
|
|
596
|
+
export const linea = Object.freeze({
|
|
597
|
+
assetId: caip.lineaAssetId,
|
|
598
|
+
chainId: caip.lineaChainId,
|
|
599
|
+
name: 'Ethereum',
|
|
600
|
+
networkName: 'Linea',
|
|
601
|
+
symbol: 'ETH',
|
|
602
|
+
precision: 18,
|
|
603
|
+
color: '#5C6BC0',
|
|
604
|
+
networkColor: '#121212',
|
|
605
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
606
|
+
networkIcon: 'https://assets.relay.link/icons/59144/light.png',
|
|
607
|
+
explorer: 'https://lineascan.build',
|
|
608
|
+
explorerAddressLink: 'https://lineascan.build/address/',
|
|
609
|
+
explorerTxLink: 'https://lineascan.build/tx/',
|
|
610
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
611
|
+
});
|
|
612
|
+
export const scroll = Object.freeze({
|
|
613
|
+
assetId: caip.scrollAssetId,
|
|
614
|
+
chainId: caip.scrollChainId,
|
|
615
|
+
name: 'Ether',
|
|
616
|
+
networkName: 'Scroll',
|
|
617
|
+
symbol: 'ETH',
|
|
618
|
+
precision: 18,
|
|
619
|
+
color: '#FFEEDA',
|
|
620
|
+
networkColor: '#FFEEDA',
|
|
621
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
622
|
+
networkIcon: 'https://scroll-tech.github.io/token-list/scroll.png',
|
|
623
|
+
explorer: 'https://scrollscan.com',
|
|
624
|
+
explorerAddressLink: 'https://scrollscan.com/address/',
|
|
625
|
+
explorerTxLink: 'https://scrollscan.com/tx/',
|
|
626
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
627
|
+
});
|
|
628
|
+
export const sonic = Object.freeze({
|
|
629
|
+
assetId: caip.sonicAssetId,
|
|
630
|
+
chainId: caip.sonicChainId,
|
|
631
|
+
name: 'Sonic (S)',
|
|
632
|
+
networkName: 'Sonic',
|
|
633
|
+
symbol: 'S',
|
|
634
|
+
precision: 18,
|
|
635
|
+
color: '#1B1464',
|
|
636
|
+
networkColor: '#1B1464',
|
|
637
|
+
icon: 'https://assets.coingecko.com/coins/images/38108/standard/200x200_Sonic_Logo.png',
|
|
638
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/38108/standard/200x200_Sonic_Logo.png',
|
|
639
|
+
explorer: 'https://sonicscan.org',
|
|
640
|
+
explorerAddressLink: 'https://sonicscan.org/address/',
|
|
641
|
+
explorerTxLink: 'https://sonicscan.org/tx/',
|
|
642
|
+
relatedAssetKey: null,
|
|
643
|
+
});
|
|
644
|
+
export const unichainChain = Object.freeze({
|
|
645
|
+
assetId: caip.unichainAssetId,
|
|
646
|
+
chainId: caip.unichainChainId,
|
|
647
|
+
name: 'Ether',
|
|
648
|
+
networkName: 'Unichain',
|
|
649
|
+
symbol: 'ETH',
|
|
650
|
+
precision: 18,
|
|
651
|
+
color: '#5C6BC0',
|
|
652
|
+
networkColor: '#F50DB4',
|
|
653
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
654
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/22206/small/unichain.png',
|
|
655
|
+
explorer: 'https://uniscan.xyz',
|
|
656
|
+
explorerAddressLink: 'https://uniscan.xyz/address/',
|
|
657
|
+
explorerTxLink: 'https://uniscan.xyz/tx/',
|
|
658
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
659
|
+
});
|
|
660
|
+
export const bobChain = Object.freeze({
|
|
661
|
+
assetId: caip.bobAssetId,
|
|
662
|
+
chainId: caip.bobChainId,
|
|
663
|
+
name: 'Ethereum',
|
|
664
|
+
networkName: 'BOB',
|
|
665
|
+
symbol: 'ETH',
|
|
666
|
+
precision: 18,
|
|
667
|
+
color: '#5C6BC0',
|
|
668
|
+
networkColor: '#F25D00',
|
|
669
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
670
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/255/small/bob.jpeg',
|
|
671
|
+
explorer: 'https://explorer.gobob.xyz',
|
|
672
|
+
explorerAddressLink: 'https://explorer.gobob.xyz/address/',
|
|
673
|
+
explorerTxLink: 'https://explorer.gobob.xyz/tx/',
|
|
674
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
675
|
+
});
|
|
676
|
+
export const modeChain = Object.freeze({
|
|
677
|
+
assetId: caip.modeAssetId,
|
|
678
|
+
chainId: caip.modeChainId,
|
|
679
|
+
name: 'Ethereum',
|
|
680
|
+
networkName: 'Mode',
|
|
681
|
+
symbol: 'ETH',
|
|
682
|
+
precision: 18,
|
|
683
|
+
color: '#5C6BC0',
|
|
684
|
+
networkColor: '#DFFE00',
|
|
685
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
686
|
+
networkIcon: 'https://assets.relay.link/icons/34443/light.png',
|
|
687
|
+
explorer: 'https://modescan.io',
|
|
688
|
+
explorerAddressLink: 'https://modescan.io/address/',
|
|
689
|
+
explorerTxLink: 'https://modescan.io/tx/',
|
|
690
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
691
|
+
});
|
|
692
|
+
export const soneium = Object.freeze({
|
|
693
|
+
assetId: caip.soneiumAssetId,
|
|
694
|
+
chainId: caip.soneiumChainId,
|
|
695
|
+
name: 'Ethereum',
|
|
696
|
+
networkName: 'Soneium',
|
|
697
|
+
symbol: 'ETH',
|
|
698
|
+
precision: 18,
|
|
699
|
+
color: '#627EEA',
|
|
700
|
+
networkColor: '#1A1A2E',
|
|
701
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
702
|
+
networkIcon: 'https://assets.relay.link/icons/1868/light.png',
|
|
703
|
+
explorer: 'https://soneium.blockscout.com',
|
|
704
|
+
explorerAddressLink: 'https://soneium.blockscout.com/address/',
|
|
705
|
+
explorerTxLink: 'https://soneium.blockscout.com/tx/',
|
|
706
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
707
|
+
});
|
|
358
708
|
export const solana = Object.freeze({
|
|
359
709
|
assetId: caip.solAssetId,
|
|
360
710
|
chainId: caip.solanaChainId,
|
|
@@ -430,3 +780,18 @@ export const starknet = Object.freeze({
|
|
|
430
780
|
explorerTxLink: 'https://starkscan.co/tx/',
|
|
431
781
|
relatedAssetKey: null,
|
|
432
782
|
});
|
|
783
|
+
export const ton = Object.freeze({
|
|
784
|
+
assetId: caip.tonAssetId,
|
|
785
|
+
chainId: caip.tonChainId,
|
|
786
|
+
name: 'Toncoin',
|
|
787
|
+
networkName: 'TON',
|
|
788
|
+
symbol: 'TON',
|
|
789
|
+
precision: 9,
|
|
790
|
+
color: '#0098EA',
|
|
791
|
+
networkColor: '#0098EA',
|
|
792
|
+
icon: 'https://assets.coingecko.com/coins/images/17980/large/ton_symbol.png?1696517498',
|
|
793
|
+
explorer: 'https://tonscan.org',
|
|
794
|
+
explorerAddressLink: 'https://tonscan.org/address/',
|
|
795
|
+
explorerTxLink: 'https://tonscan.org/tx/',
|
|
796
|
+
relatedAssetKey: null,
|
|
797
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fromAssetId } from '@shapeshiftoss/caip';
|
|
2
|
-
import { pick } from 'lodash';
|
|
2
|
+
import { pick } from 'lodash-es';
|
|
3
3
|
import { assertUnreachable } from '../assertUnreachable.js';
|
|
4
4
|
import { FIELDS } from './constants.js';
|
|
5
5
|
import { getBaseAsset } from './getBaseAsset.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KnownChainIds } from '@shapeshiftoss/types';
|
|
2
2
|
import { assertUnreachable } from '../assertUnreachable.js';
|
|
3
|
-
import {
|
|
3
|
+
import { abstract, arbitrum, atom, avax, base, berachain, bitcoin, bitcoincash, blast, bnbsmartchain, bobChain, celo, cronos, dogecoin, ethereal, ethereum, flowEvm, gnosis, hemi, hyperevm, ink, katana, linea, litecoin, mantle, mayachain, megaeth, modeChain, monad, near, optimism, plasma, plume, polygon, scroll, sei, solana, soneium, sonic, starknet, story, sui, thorchain, ton, tron, unichainChain, worldchain, zcash, zkSyncEra, } from './baseAssets.js';
|
|
4
4
|
export const getBaseAsset = (chainId) => {
|
|
5
5
|
const knownChainId = chainId;
|
|
6
6
|
switch (knownChainId) {
|
|
@@ -18,8 +18,6 @@ export const getBaseAsset = (chainId) => {
|
|
|
18
18
|
return gnosis;
|
|
19
19
|
case KnownChainIds.ArbitrumMainnet:
|
|
20
20
|
return arbitrum;
|
|
21
|
-
case KnownChainIds.ArbitrumNovaMainnet:
|
|
22
|
-
return arbitrumNova;
|
|
23
21
|
case KnownChainIds.BaseMainnet:
|
|
24
22
|
return base;
|
|
25
23
|
case KnownChainIds.SolanaMainnet:
|
|
@@ -50,12 +48,60 @@ export const getBaseAsset = (chainId) => {
|
|
|
50
48
|
return hyperevm;
|
|
51
49
|
case KnownChainIds.PlasmaMainnet:
|
|
52
50
|
return plasma;
|
|
51
|
+
case KnownChainIds.PlumeMainnet:
|
|
52
|
+
return plume;
|
|
53
|
+
case KnownChainIds.MantleMainnet:
|
|
54
|
+
return mantle;
|
|
55
|
+
case KnownChainIds.InkMainnet:
|
|
56
|
+
return ink;
|
|
57
|
+
case KnownChainIds.MegaEthMainnet:
|
|
58
|
+
return megaeth;
|
|
59
|
+
case KnownChainIds.BerachainMainnet:
|
|
60
|
+
return berachain;
|
|
61
|
+
case KnownChainIds.CronosMainnet:
|
|
62
|
+
return cronos;
|
|
53
63
|
case KnownChainIds.KatanaMainnet:
|
|
54
64
|
return katana;
|
|
65
|
+
case KnownChainIds.EtherealMainnet:
|
|
66
|
+
return ethereal;
|
|
67
|
+
case KnownChainIds.FlowEvmMainnet:
|
|
68
|
+
return flowEvm;
|
|
69
|
+
case KnownChainIds.CeloMainnet:
|
|
70
|
+
return celo;
|
|
71
|
+
case KnownChainIds.StoryMainnet:
|
|
72
|
+
return story;
|
|
73
|
+
case KnownChainIds.ZkSyncEraMainnet:
|
|
74
|
+
return zkSyncEra;
|
|
75
|
+
case KnownChainIds.BlastMainnet:
|
|
76
|
+
return blast;
|
|
77
|
+
case KnownChainIds.WorldChainMainnet:
|
|
78
|
+
return worldchain;
|
|
79
|
+
case KnownChainIds.HemiMainnet:
|
|
80
|
+
return hemi;
|
|
81
|
+
case KnownChainIds.SeiMainnet:
|
|
82
|
+
return sei;
|
|
83
|
+
case KnownChainIds.LineaMainnet:
|
|
84
|
+
return linea;
|
|
85
|
+
case KnownChainIds.ScrollMainnet:
|
|
86
|
+
return scroll;
|
|
87
|
+
case KnownChainIds.SonicMainnet:
|
|
88
|
+
return sonic;
|
|
89
|
+
case KnownChainIds.UnichainMainnet:
|
|
90
|
+
return unichainChain;
|
|
91
|
+
case KnownChainIds.BobMainnet:
|
|
92
|
+
return bobChain;
|
|
93
|
+
case KnownChainIds.ModeMainnet:
|
|
94
|
+
return modeChain;
|
|
95
|
+
case KnownChainIds.SoneiumMainnet:
|
|
96
|
+
return soneium;
|
|
55
97
|
case KnownChainIds.NearMainnet:
|
|
56
98
|
return near;
|
|
57
99
|
case KnownChainIds.ZcashMainnet:
|
|
58
100
|
return zcash;
|
|
101
|
+
case KnownChainIds.TonMainnet:
|
|
102
|
+
return ton;
|
|
103
|
+
case KnownChainIds.AbstractMainnet:
|
|
104
|
+
return abstract;
|
|
59
105
|
default:
|
|
60
106
|
return assertUnreachable(knownChainId);
|
|
61
107
|
}
|
|
@@ -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 {};
|