@shapeshiftoss/utils 1.0.6 → 1.1.1
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 +4 -0
- package/dist/cjs/assetData/baseAssets.js +73 -8
- package/dist/cjs/assetData/getBaseAsset.js +8 -0
- package/dist/cjs/chainIdToFeeAssetId.js +8 -0
- package/dist/cjs/getAssetNamespaceFromChainId.js +6 -1
- package/dist/cjs/getChainShortName.d.ts +1 -1
- package/dist/cjs/getChainShortName.js +8 -0
- package/dist/cjs/getNativeFeeAssetReference.js +8 -0
- package/dist/cjs/treasury.d.ts +10 -9
- package/dist/cjs/treasury.js +10 -9
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/assetData/baseAssets.d.ts +4 -0
- package/dist/esm/assetData/baseAssets.js +71 -7
- package/dist/esm/assetData/getBaseAsset.js +9 -1
- package/dist/esm/chainIdToFeeAssetId.js +9 -1
- package/dist/esm/getAssetNamespaceFromChainId.js +6 -1
- package/dist/esm/getChainShortName.d.ts +1 -1
- package/dist/esm/getChainShortName.js +8 -0
- package/dist/esm/getNativeFeeAssetReference.js +8 -0
- package/dist/esm/treasury.d.ts +10 -9
- package/dist/esm/treasury.js +9 -8
- package/package.json +12 -13
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Asset } from '@shapeshiftoss/types';
|
|
2
|
+
export declare const robinhood: Readonly<Asset>;
|
|
3
|
+
export declare const abstract: Readonly<Asset>;
|
|
2
4
|
export declare const ethereum: Readonly<Asset>;
|
|
3
5
|
export declare const bitcoin: Readonly<Asset>;
|
|
4
6
|
export declare const bitcoincash: Readonly<Asset>;
|
|
@@ -30,11 +32,13 @@ export declare const megaeth: Readonly<Asset>;
|
|
|
30
32
|
export declare const berachain: Readonly<Asset>;
|
|
31
33
|
export declare const katana: Readonly<Asset>;
|
|
32
34
|
export declare const flowEvm: Readonly<Asset>;
|
|
35
|
+
export declare const ethereal: Readonly<Asset>;
|
|
33
36
|
export declare const celo: Readonly<Asset>;
|
|
34
37
|
export declare const story: Readonly<Asset>;
|
|
35
38
|
export declare const zkSyncEra: Readonly<Asset>;
|
|
36
39
|
export declare const blast: Readonly<Asset>;
|
|
37
40
|
export declare const hemi: Readonly<Asset>;
|
|
41
|
+
export declare const sei: Readonly<Asset>;
|
|
38
42
|
export declare const linea: Readonly<Asset>;
|
|
39
43
|
export declare const scroll: Readonly<Asset>;
|
|
40
44
|
export declare const sonic: Readonly<Asset>;
|
|
@@ -1,4 +1,36 @@
|
|
|
1
1
|
import * as caip from '@shapeshiftoss/caip';
|
|
2
|
+
export const robinhood = Object.freeze({
|
|
3
|
+
assetId: caip.robinhoodAssetId,
|
|
4
|
+
chainId: caip.robinhoodChainId,
|
|
5
|
+
name: 'Ethereum',
|
|
6
|
+
networkName: 'Robinhood',
|
|
7
|
+
symbol: 'ETH',
|
|
8
|
+
precision: 18,
|
|
9
|
+
color: '#00C805',
|
|
10
|
+
networkColor: '#00C805',
|
|
11
|
+
icon: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
|
|
12
|
+
networkIcon: 'https://assets.relay.link/icons/4663/light.png',
|
|
13
|
+
explorer: 'https://robinhoodchain.blockscout.com',
|
|
14
|
+
explorerAddressLink: 'https://robinhoodchain.blockscout.com/address/',
|
|
15
|
+
explorerTxLink: 'https://robinhoodchain.blockscout.com/tx/',
|
|
16
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
17
|
+
});
|
|
18
|
+
export const abstract = Object.freeze({
|
|
19
|
+
assetId: caip.abstractAssetId,
|
|
20
|
+
chainId: caip.abstractChainId,
|
|
21
|
+
name: 'Ethereum',
|
|
22
|
+
networkName: 'Abstract',
|
|
23
|
+
symbol: 'ETH',
|
|
24
|
+
precision: 18,
|
|
25
|
+
color: '#00D4AA',
|
|
26
|
+
networkColor: '#00D4AA',
|
|
27
|
+
icon: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
|
|
28
|
+
networkIcon: 'https://assets.relay.link/icons/2741/light.png',
|
|
29
|
+
explorer: 'https://abscan.org',
|
|
30
|
+
explorerAddressLink: 'https://abscan.org/address/',
|
|
31
|
+
explorerTxLink: 'https://abscan.org/tx/',
|
|
32
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
33
|
+
});
|
|
2
34
|
const mayaTokenAssetId = 'cosmos:mayachain-mainnet-v1/slip44:maya';
|
|
3
35
|
export const ethereum = Object.freeze({
|
|
4
36
|
assetId: caip.ethAssetId,
|
|
@@ -332,8 +364,8 @@ export const plume = Object.freeze({
|
|
|
332
364
|
precision: 18,
|
|
333
365
|
color: '#6C5DD3',
|
|
334
366
|
networkColor: '#6C5DD3',
|
|
335
|
-
icon: 'https://assets.coingecko.com/coins/images/
|
|
336
|
-
networkIcon: 'https://assets.coingecko.com/coins/images/
|
|
367
|
+
icon: 'https://assets.coingecko.com/coins/images/70470/large/plume.jpg',
|
|
368
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/70470/small/plume.jpg',
|
|
337
369
|
explorer: 'https://explorer.plume.org',
|
|
338
370
|
explorerAddressLink: 'https://explorer.plume.org/address/',
|
|
339
371
|
explorerTxLink: 'https://explorer.plume.org/tx/',
|
|
@@ -404,7 +436,7 @@ export const cronos = Object.freeze({
|
|
|
404
436
|
export const megaeth = Object.freeze({
|
|
405
437
|
assetId: caip.megaethAssetId,
|
|
406
438
|
chainId: caip.megaethChainId,
|
|
407
|
-
name: '
|
|
439
|
+
name: 'Ethereum',
|
|
408
440
|
networkName: 'MegaETH',
|
|
409
441
|
symbol: 'ETH',
|
|
410
442
|
precision: 18,
|
|
@@ -465,6 +497,22 @@ export const flowEvm = Object.freeze({
|
|
|
465
497
|
explorerTxLink: 'https://evm.flowscan.io/tx/',
|
|
466
498
|
relatedAssetKey: null,
|
|
467
499
|
});
|
|
500
|
+
export const ethereal = Object.freeze({
|
|
501
|
+
assetId: caip.etherealAssetId,
|
|
502
|
+
chainId: caip.etherealChainId,
|
|
503
|
+
name: 'USDe',
|
|
504
|
+
networkName: 'Ethereal',
|
|
505
|
+
symbol: 'USDe',
|
|
506
|
+
precision: 18,
|
|
507
|
+
color: '#4A90D9',
|
|
508
|
+
networkColor: '#4A90D9',
|
|
509
|
+
icon: 'https://assets.coingecko.com/coins/images/33613/large/USDE.png',
|
|
510
|
+
networkIcon: 'https://assets.relay.link/icons/5064014/light.png',
|
|
511
|
+
explorer: 'https://explorer.ethereal.global',
|
|
512
|
+
explorerAddressLink: 'https://explorer.ethereal.global/address/',
|
|
513
|
+
explorerTxLink: 'https://explorer.ethereal.global/tx/',
|
|
514
|
+
relatedAssetKey: null,
|
|
515
|
+
});
|
|
468
516
|
export const celo = Object.freeze({
|
|
469
517
|
assetId: caip.celoAssetId,
|
|
470
518
|
chainId: caip.celoChainId,
|
|
@@ -474,8 +522,8 @@ export const celo = Object.freeze({
|
|
|
474
522
|
precision: 18,
|
|
475
523
|
color: '#35D07F',
|
|
476
524
|
networkColor: '#35D07F',
|
|
477
|
-
icon: 'https://assets.coingecko.com/
|
|
478
|
-
networkIcon: 'https://assets.coingecko.com/
|
|
525
|
+
icon: 'https://assets.coingecko.com/asset_platforms/images/21/large/celo.jpeg',
|
|
526
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/21/small/celo.jpeg',
|
|
479
527
|
explorer: 'https://celoscan.io',
|
|
480
528
|
explorerAddressLink: 'https://celoscan.io/address/',
|
|
481
529
|
explorerTxLink: 'https://celoscan.io/tx/',
|
|
@@ -490,8 +538,8 @@ export const story = Object.freeze({
|
|
|
490
538
|
precision: 18,
|
|
491
539
|
color: '#EA580C',
|
|
492
540
|
networkColor: '#EA580C',
|
|
493
|
-
icon: 'https://assets.coingecko.com/
|
|
494
|
-
networkIcon: 'https://assets.coingecko.com/
|
|
541
|
+
icon: 'https://assets.coingecko.com/asset_platforms/images/22207/large/story.jpg',
|
|
542
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/22207/small/story.jpg',
|
|
495
543
|
explorer: 'https://storyscan.xyz',
|
|
496
544
|
explorerAddressLink: 'https://storyscan.xyz/address/',
|
|
497
545
|
explorerTxLink: 'https://storyscan.xyz/tx/',
|
|
@@ -545,6 +593,22 @@ export const hemi = Object.freeze({
|
|
|
545
593
|
explorerTxLink: 'https://explorer.hemi.xyz/tx/',
|
|
546
594
|
relatedAssetKey: 'eip155:1/slip44:60',
|
|
547
595
|
});
|
|
596
|
+
export const sei = Object.freeze({
|
|
597
|
+
assetId: caip.seiAssetId,
|
|
598
|
+
chainId: caip.seiChainId,
|
|
599
|
+
name: 'SEI',
|
|
600
|
+
networkName: 'Sei',
|
|
601
|
+
symbol: 'SEI',
|
|
602
|
+
precision: 18,
|
|
603
|
+
color: '#9B1B30',
|
|
604
|
+
networkColor: '#9B1B30',
|
|
605
|
+
icon: 'https://assets.coingecko.com/coins/images/28205/large/Sei_Logo_-_Transparent.png',
|
|
606
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/28205/small/Sei_Logo_-_Transparent.png',
|
|
607
|
+
explorer: 'https://seitrace.com',
|
|
608
|
+
explorerAddressLink: 'https://seitrace.com/address/',
|
|
609
|
+
explorerTxLink: 'https://seitrace.com/tx/',
|
|
610
|
+
relatedAssetKey: null,
|
|
611
|
+
});
|
|
548
612
|
export const linea = Object.freeze({
|
|
549
613
|
assetId: caip.lineaAssetId,
|
|
550
614
|
chainId: caip.lineaChainId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KnownChainIds } from '@shapeshiftoss/types';
|
|
2
2
|
import { assertUnreachable } from '../assertUnreachable.js';
|
|
3
|
-
import { arbitrum, atom, avax, base, berachain, bitcoin, bitcoincash, blast, bnbsmartchain, bobChain, celo, cronos, dogecoin, ethereum, flowEvm, gnosis, hemi, hyperevm, ink, katana, linea, litecoin, mantle, mayachain, megaeth, modeChain, monad, near, optimism, plasma, plume, polygon, scroll, solana, soneium, sonic, starknet, story, sui, thorchain, ton, tron, unichainChain, worldchain, zcash, zkSyncEra, } from './baseAssets.js';
|
|
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, robinhood, 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) {
|
|
@@ -62,6 +62,8 @@ export const getBaseAsset = (chainId) => {
|
|
|
62
62
|
return cronos;
|
|
63
63
|
case KnownChainIds.KatanaMainnet:
|
|
64
64
|
return katana;
|
|
65
|
+
case KnownChainIds.EtherealMainnet:
|
|
66
|
+
return ethereal;
|
|
65
67
|
case KnownChainIds.FlowEvmMainnet:
|
|
66
68
|
return flowEvm;
|
|
67
69
|
case KnownChainIds.CeloMainnet:
|
|
@@ -76,6 +78,8 @@ export const getBaseAsset = (chainId) => {
|
|
|
76
78
|
return worldchain;
|
|
77
79
|
case KnownChainIds.HemiMainnet:
|
|
78
80
|
return hemi;
|
|
81
|
+
case KnownChainIds.SeiMainnet:
|
|
82
|
+
return sei;
|
|
79
83
|
case KnownChainIds.LineaMainnet:
|
|
80
84
|
return linea;
|
|
81
85
|
case KnownChainIds.ScrollMainnet:
|
|
@@ -96,6 +100,10 @@ export const getBaseAsset = (chainId) => {
|
|
|
96
100
|
return zcash;
|
|
97
101
|
case KnownChainIds.TonMainnet:
|
|
98
102
|
return ton;
|
|
103
|
+
case KnownChainIds.AbstractMainnet:
|
|
104
|
+
return abstract;
|
|
105
|
+
case KnownChainIds.RobinhoodMainnet:
|
|
106
|
+
return robinhood;
|
|
99
107
|
default:
|
|
100
108
|
return assertUnreachable(knownChainId);
|
|
101
109
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { arbitrumAssetId, avalancheAssetId, baseAssetId, bchAssetId, berachainAssetId, blastAssetId, bobAssetId, bscAssetId, btcAssetId, celoAssetId, cosmosAssetId, cronosAssetId, dogeAssetId, ethAssetId, flowEvmAssetId, gnosisAssetId, hemiAssetId, hyperEvmAssetId, inkAssetId, katanaAssetId, lineaAssetId, ltcAssetId, mantleAssetId, mayachainAssetId, megaethAssetId, modeAssetId, monadAssetId, nearAssetId, optimismAssetId, plasmaAssetId, plumeAssetId, polygonAssetId, scrollAssetId, solAssetId, soneiumAssetId, sonicAssetId, starknetAssetId, storyAssetId, suiAssetId, thorchainAssetId, tonAssetId, tronAssetId, unichainAssetId, worldChainAssetId, zecAssetId, zkSyncEraAssetId, } from '@shapeshiftoss/caip';
|
|
1
|
+
import { abstractAssetId, arbitrumAssetId, avalancheAssetId, baseAssetId, bchAssetId, berachainAssetId, blastAssetId, bobAssetId, bscAssetId, btcAssetId, celoAssetId, cosmosAssetId, cronosAssetId, dogeAssetId, ethAssetId, etherealAssetId, flowEvmAssetId, gnosisAssetId, hemiAssetId, hyperEvmAssetId, inkAssetId, katanaAssetId, lineaAssetId, ltcAssetId, mantleAssetId, mayachainAssetId, megaethAssetId, modeAssetId, monadAssetId, nearAssetId, optimismAssetId, plasmaAssetId, plumeAssetId, polygonAssetId, robinhoodAssetId, scrollAssetId, seiAssetId, solAssetId, soneiumAssetId, sonicAssetId, starknetAssetId, storyAssetId, suiAssetId, thorchainAssetId, tonAssetId, tronAssetId, unichainAssetId, worldChainAssetId, zecAssetId, zkSyncEraAssetId, } from '@shapeshiftoss/caip';
|
|
2
2
|
import { KnownChainIds } from '@shapeshiftoss/types';
|
|
3
3
|
import { assertUnreachable } from './assertUnreachable.js';
|
|
4
4
|
export const chainIdToFeeAssetId = (_chainId) => {
|
|
@@ -62,6 +62,8 @@ export const chainIdToFeeAssetId = (_chainId) => {
|
|
|
62
62
|
return cronosAssetId;
|
|
63
63
|
case KnownChainIds.KatanaMainnet:
|
|
64
64
|
return katanaAssetId;
|
|
65
|
+
case KnownChainIds.EtherealMainnet:
|
|
66
|
+
return etherealAssetId;
|
|
65
67
|
case KnownChainIds.FlowEvmMainnet:
|
|
66
68
|
return flowEvmAssetId;
|
|
67
69
|
case KnownChainIds.CeloMainnet:
|
|
@@ -76,6 +78,8 @@ export const chainIdToFeeAssetId = (_chainId) => {
|
|
|
76
78
|
return worldChainAssetId;
|
|
77
79
|
case KnownChainIds.HemiMainnet:
|
|
78
80
|
return hemiAssetId;
|
|
81
|
+
case KnownChainIds.SeiMainnet:
|
|
82
|
+
return seiAssetId;
|
|
79
83
|
case KnownChainIds.LineaMainnet:
|
|
80
84
|
return lineaAssetId;
|
|
81
85
|
case KnownChainIds.ScrollMainnet:
|
|
@@ -96,6 +100,10 @@ export const chainIdToFeeAssetId = (_chainId) => {
|
|
|
96
100
|
return nearAssetId;
|
|
97
101
|
case KnownChainIds.TonMainnet:
|
|
98
102
|
return tonAssetId;
|
|
103
|
+
case KnownChainIds.AbstractMainnet:
|
|
104
|
+
return abstractAssetId;
|
|
105
|
+
case KnownChainIds.RobinhoodMainnet:
|
|
106
|
+
return robinhoodAssetId;
|
|
99
107
|
default:
|
|
100
108
|
return assertUnreachable(chainId);
|
|
101
109
|
}
|
|
@@ -34,6 +34,7 @@ export const getAssetNamespaceFromChainId = (chainId) => {
|
|
|
34
34
|
case KnownChainIds.BlastMainnet:
|
|
35
35
|
case KnownChainIds.WorldChainMainnet:
|
|
36
36
|
case KnownChainIds.HemiMainnet:
|
|
37
|
+
case KnownChainIds.SeiMainnet:
|
|
37
38
|
case KnownChainIds.LineaMainnet:
|
|
38
39
|
case KnownChainIds.ScrollMainnet:
|
|
39
40
|
case KnownChainIds.SonicMainnet:
|
|
@@ -41,11 +42,16 @@ export const getAssetNamespaceFromChainId = (chainId) => {
|
|
|
41
42
|
case KnownChainIds.BobMainnet:
|
|
42
43
|
case KnownChainIds.ModeMainnet:
|
|
43
44
|
case KnownChainIds.SoneiumMainnet:
|
|
45
|
+
case KnownChainIds.EtherealMainnet:
|
|
44
46
|
case KnownChainIds.FlowEvmMainnet:
|
|
45
47
|
case KnownChainIds.CeloMainnet:
|
|
48
|
+
case KnownChainIds.AbstractMainnet:
|
|
49
|
+
case KnownChainIds.RobinhoodMainnet:
|
|
46
50
|
return ASSET_NAMESPACE.erc20;
|
|
47
51
|
case KnownChainIds.StarknetMainnet:
|
|
48
52
|
return ASSET_NAMESPACE.starknetToken;
|
|
53
|
+
case KnownChainIds.TonMainnet:
|
|
54
|
+
return ASSET_NAMESPACE.jetton;
|
|
49
55
|
case KnownChainIds.CosmosMainnet:
|
|
50
56
|
case KnownChainIds.BitcoinMainnet:
|
|
51
57
|
case KnownChainIds.BitcoinCashMainnet:
|
|
@@ -54,7 +60,6 @@ export const getAssetNamespaceFromChainId = (chainId) => {
|
|
|
54
60
|
case KnownChainIds.ZcashMainnet:
|
|
55
61
|
case KnownChainIds.ThorchainMainnet:
|
|
56
62
|
case KnownChainIds.MayachainMainnet:
|
|
57
|
-
case KnownChainIds.TonMainnet:
|
|
58
63
|
throw Error(`Unhandled case '${chainId}'`);
|
|
59
64
|
default:
|
|
60
65
|
return assertUnreachable(chainId);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { KnownChainIds } from '@shapeshiftoss/types';
|
|
2
|
-
export declare const getChainShortName: (chainId: KnownChainIds) => "AVA" | "OP" | "ETH" | "POLY" | "GNO" | "BNB" | "ARB" | "BAS" | "BTC" | "BCH" | "COSM" | "THOR" | "MAYA" | "DOGE" | "LTC" | "SOL" | "TRX" | "SUI" | "STRK" | "MON" | "HYPE" | "XPL" | "MNT" | "INK" | "MEGA" | "BERA" | "CRO" | "KAT" | "FLOW" | "CELO" | "PLUME" | "STORY" | "ZKS" | "BLAST" | "WLD" | "HEM" | "LIN" | "SCR" | "S" | "UNI" | "BOB" | "MODE" | "SON" | "ZEC" | "NEAR" | "TON" | undefined;
|
|
2
|
+
export declare const getChainShortName: (chainId: KnownChainIds) => "AVA" | "OP" | "ETH" | "POLY" | "GNO" | "BNB" | "ARB" | "BAS" | "BTC" | "BCH" | "COSM" | "THOR" | "MAYA" | "DOGE" | "LTC" | "SOL" | "TRX" | "SUI" | "STRK" | "MON" | "HYPE" | "XPL" | "MNT" | "INK" | "MEGA" | "BERA" | "CRO" | "KAT" | "ETRL" | "FLOW" | "CELO" | "PLUME" | "STORY" | "ZKS" | "BLAST" | "WLD" | "HEM" | "SEI" | "LIN" | "SCR" | "S" | "UNI" | "BOB" | "MODE" | "SON" | "ZEC" | "NEAR" | "TON" | "ABS" | "RH" | undefined;
|
|
@@ -58,6 +58,8 @@ export const getChainShortName = (chainId) => {
|
|
|
58
58
|
return 'CRO';
|
|
59
59
|
case KnownChainIds.KatanaMainnet:
|
|
60
60
|
return 'KAT';
|
|
61
|
+
case KnownChainIds.EtherealMainnet:
|
|
62
|
+
return 'ETRL';
|
|
61
63
|
case KnownChainIds.FlowEvmMainnet:
|
|
62
64
|
return 'FLOW';
|
|
63
65
|
case KnownChainIds.CeloMainnet:
|
|
@@ -74,6 +76,8 @@ export const getChainShortName = (chainId) => {
|
|
|
74
76
|
return 'WLD';
|
|
75
77
|
case KnownChainIds.HemiMainnet:
|
|
76
78
|
return 'HEM';
|
|
79
|
+
case KnownChainIds.SeiMainnet:
|
|
80
|
+
return 'SEI';
|
|
77
81
|
case KnownChainIds.LineaMainnet:
|
|
78
82
|
return 'LIN';
|
|
79
83
|
case KnownChainIds.ScrollMainnet:
|
|
@@ -94,6 +98,10 @@ export const getChainShortName = (chainId) => {
|
|
|
94
98
|
return 'NEAR';
|
|
95
99
|
case KnownChainIds.TonMainnet:
|
|
96
100
|
return 'TON';
|
|
101
|
+
case KnownChainIds.AbstractMainnet:
|
|
102
|
+
return 'ABS';
|
|
103
|
+
case KnownChainIds.RobinhoodMainnet:
|
|
104
|
+
return 'RH';
|
|
97
105
|
default: {
|
|
98
106
|
assertUnreachable(chainId);
|
|
99
107
|
}
|
|
@@ -53,6 +53,8 @@ export const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
53
53
|
return ASSET_REFERENCE.Cronos;
|
|
54
54
|
case CHAIN_REFERENCE.KatanaMainnet:
|
|
55
55
|
return ASSET_REFERENCE.Katana;
|
|
56
|
+
case CHAIN_REFERENCE.EtherealMainnet:
|
|
57
|
+
return ASSET_REFERENCE.Ethereal;
|
|
56
58
|
case CHAIN_REFERENCE.FlowEvmMainnet:
|
|
57
59
|
return ASSET_REFERENCE.FlowEvm;
|
|
58
60
|
case CHAIN_REFERENCE.CeloMainnet:
|
|
@@ -65,10 +67,14 @@ export const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
65
67
|
return ASSET_REFERENCE.ZkSyncEra;
|
|
66
68
|
case CHAIN_REFERENCE.BlastMainnet:
|
|
67
69
|
return ASSET_REFERENCE.Blast;
|
|
70
|
+
case CHAIN_REFERENCE.AbstractMainnet:
|
|
71
|
+
return ASSET_REFERENCE.Abstract;
|
|
68
72
|
case CHAIN_REFERENCE.WorldChainMainnet:
|
|
69
73
|
return ASSET_REFERENCE.WorldChain;
|
|
70
74
|
case CHAIN_REFERENCE.HemiMainnet:
|
|
71
75
|
return ASSET_REFERENCE.Hemi;
|
|
76
|
+
case CHAIN_REFERENCE.SeiMainnet:
|
|
77
|
+
return ASSET_REFERENCE.Sei;
|
|
72
78
|
case CHAIN_REFERENCE.LineaMainnet:
|
|
73
79
|
return ASSET_REFERENCE.Linea;
|
|
74
80
|
case CHAIN_REFERENCE.ScrollMainnet:
|
|
@@ -83,6 +89,8 @@ export const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
83
89
|
return ASSET_REFERENCE.Mode;
|
|
84
90
|
case CHAIN_REFERENCE.SoneiumMainnet:
|
|
85
91
|
return ASSET_REFERENCE.Soneium;
|
|
92
|
+
case CHAIN_REFERENCE.RobinhoodMainnet:
|
|
93
|
+
return ASSET_REFERENCE.Robinhood;
|
|
86
94
|
default:
|
|
87
95
|
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
88
96
|
}
|
package/dist/esm/treasury.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ChainId } from '@shapeshiftoss/caip';
|
|
2
2
|
import { KnownChainIds } from '@shapeshiftoss/types';
|
|
3
|
-
export declare const treasuryChainIds: readonly [KnownChainIds.EthereumMainnet, KnownChainIds.AvalancheMainnet, KnownChainIds.OptimismMainnet, KnownChainIds.BnbSmartChainMainnet, KnownChainIds.PolygonMainnet, KnownChainIds.GnosisMainnet, KnownChainIds.ArbitrumMainnet, KnownChainIds.BaseMainnet, KnownChainIds.SolanaMainnet, KnownChainIds.BitcoinMainnet, KnownChainIds.StarknetMainnet, KnownChainIds.TonMainnet, KnownChainIds.MonadMainnet, KnownChainIds.HyperEvmMainnet];
|
|
3
|
+
export declare const treasuryChainIds: readonly [KnownChainIds.EthereumMainnet, KnownChainIds.AvalancheMainnet, KnownChainIds.OptimismMainnet, KnownChainIds.BnbSmartChainMainnet, KnownChainIds.PolygonMainnet, KnownChainIds.GnosisMainnet, KnownChainIds.ArbitrumMainnet, KnownChainIds.BaseMainnet, KnownChainIds.SolanaMainnet, KnownChainIds.BitcoinMainnet, KnownChainIds.StarknetMainnet, KnownChainIds.TonMainnet, KnownChainIds.MonadMainnet, KnownChainIds.HyperEvmMainnet, KnownChainIds.BobMainnet];
|
|
4
4
|
export type TreasuryChainId = (typeof treasuryChainIds)[number];
|
|
5
|
-
export declare const isTreasuryChainId: (chainId: ChainId) => chainId is KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.BaseMainnet | KnownChainIds.MonadMainnet | KnownChainIds.HyperEvmMainnet | KnownChainIds.BitcoinMainnet | KnownChainIds.SolanaMainnet | KnownChainIds.StarknetMainnet | KnownChainIds.TonMainnet;
|
|
5
|
+
export declare const isTreasuryChainId: (chainId: ChainId) => chainId is KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.BaseMainnet | KnownChainIds.MonadMainnet | KnownChainIds.HyperEvmMainnet | KnownChainIds.BobMainnet | KnownChainIds.BitcoinMainnet | KnownChainIds.SolanaMainnet | KnownChainIds.StarknetMainnet | KnownChainIds.TonMainnet;
|
|
6
6
|
export declare const DAO_TREASURY_ETHEREUM_MAINNET = "0x90a48d5cf7343b08da12e067680b4c6dbfe551be";
|
|
7
7
|
export declare const DAO_TREASURY_OPTIMISM = "0x6268d07327f4fb7380732dc6d63d95F88c0E083b";
|
|
8
8
|
export declare const DAO_TREASURY_AVALANCHE = "0x74d63F31C2335b5b3BA7ad2812357672b2624cEd";
|
|
@@ -11,10 +11,11 @@ export declare const DAO_TREASURY_GNOSIS = "0xb0E3175341794D1dc8E5F02a02F9D26989
|
|
|
11
11
|
export declare const DAO_TREASURY_BSC = "0x8b92b1698b57bEDF2142297e9397875ADBb2297E";
|
|
12
12
|
export declare const DAO_TREASURY_ARBITRUM = "0x38276553F8fbf2A027D901F8be45f00373d8Dd48";
|
|
13
13
|
export declare const DAO_TREASURY_BASE = "0x9c9aA90363630d4ab1D9dbF416cc3BBC8d3Ed502";
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
14
|
+
export declare const DAO_TREASURY_BITCOIN = "bc1q9xrjfet2a05r3jvsxx66rru7pysevk5dvqasdw9eeea3rfqlk33qr4hghh";
|
|
15
|
+
export declare const DAO_TREASURY_NEAR = "shapeshifttokenomics.sputnik-dao.near";
|
|
16
|
+
export declare const DAO_TREASURY_SOLANA = "FxXyPB5RH4uHLPPJR5H89zGwZp19juBetmRwrxfsLj2j";
|
|
17
|
+
export declare const DAO_TREASURY_MONAD = "0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC";
|
|
18
|
+
export declare const DAO_TREASURY_HYPEREVM = "0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC";
|
|
19
|
+
export declare const DAO_TREASURY_BOB = "0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC";
|
|
20
|
+
export declare const DAO_TREASURY_STARKNET = "0x07ac2252f2da7cbf085e7a5ddc1318243aa818607cdd430dd2e17dd5d487606a";
|
|
21
|
+
export declare const DAO_TREASURY_TON = "UQAHHeOhXst-zSGGigQ8KgDzz89nACBR4TxXwXNjU4DsriLb";
|
package/dist/esm/treasury.js
CHANGED
|
@@ -16,11 +16,11 @@ export const treasuryChainIds = [
|
|
|
16
16
|
KnownChainIds.TonMainnet,
|
|
17
17
|
KnownChainIds.MonadMainnet,
|
|
18
18
|
KnownChainIds.HyperEvmMainnet,
|
|
19
|
+
KnownChainIds.BobMainnet,
|
|
19
20
|
];
|
|
20
21
|
export const isTreasuryChainId = (chainId) => {
|
|
21
22
|
return treasuryChainIds.includes(chainId);
|
|
22
23
|
};
|
|
23
|
-
// Safes
|
|
24
24
|
export const DAO_TREASURY_ETHEREUM_MAINNET = '0x90a48d5cf7343b08da12e067680b4c6dbfe551be';
|
|
25
25
|
export const DAO_TREASURY_OPTIMISM = '0x6268d07327f4fb7380732dc6d63d95F88c0E083b';
|
|
26
26
|
export const DAO_TREASURY_AVALANCHE = '0x74d63F31C2335b5b3BA7ad2812357672b2624cEd';
|
|
@@ -29,10 +29,11 @@ export const DAO_TREASURY_GNOSIS = '0xb0E3175341794D1dc8E5F02a02F9D26989EbedB3';
|
|
|
29
29
|
export const DAO_TREASURY_BSC = '0x8b92b1698b57bEDF2142297e9397875ADBb2297E';
|
|
30
30
|
export const DAO_TREASURY_ARBITRUM = '0x38276553F8fbf2A027D901F8be45f00373d8Dd48';
|
|
31
31
|
export const DAO_TREASURY_BASE = '0x9c9aA90363630d4ab1D9dbF416cc3BBC8d3Ed502';
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
32
|
+
export const DAO_TREASURY_BITCOIN = 'bc1q9xrjfet2a05r3jvsxx66rru7pysevk5dvqasdw9eeea3rfqlk33qr4hghh';
|
|
33
|
+
export const DAO_TREASURY_NEAR = 'shapeshifttokenomics.sputnik-dao.near';
|
|
34
|
+
export const DAO_TREASURY_SOLANA = 'FxXyPB5RH4uHLPPJR5H89zGwZp19juBetmRwrxfsLj2j';
|
|
35
|
+
export const DAO_TREASURY_MONAD = '0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC';
|
|
36
|
+
export const DAO_TREASURY_HYPEREVM = '0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC';
|
|
37
|
+
export const DAO_TREASURY_BOB = '0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC';
|
|
38
|
+
export const DAO_TREASURY_STARKNET = '0x07ac2252f2da7cbf085e7a5ddc1318243aa818607cdd430dd2e17dd5d487606a';
|
|
39
|
+
export const DAO_TREASURY_TON = 'UQAHHeOhXst-zSGGigQ8KgDzz89nACBR4TxXwXNjU4DsriLb';
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/utils",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"packageManager": "yarn@3.5.0",
|
|
3
|
+
"version": "1.1.1",
|
|
5
4
|
"repository": "https://github.com/shapeshift/web",
|
|
6
5
|
"license": "MIT",
|
|
7
6
|
"type": "module",
|
|
@@ -21,23 +20,23 @@
|
|
|
21
20
|
"publishConfig": {
|
|
22
21
|
"access": "public"
|
|
23
22
|
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "yarn clean && yarn run -T tsc --build && yarn postbuild",
|
|
26
|
-
"clean": "rm -rf dist",
|
|
27
|
-
"dev": "yarn run -T tsc --build --watch",
|
|
28
|
-
"postbuild": "yarn postbuild:esm && yarn postbuild:cjs",
|
|
29
|
-
"postbuild:esm": "yarn run -T tsc-esm-fix --target=dist/esm --ext=.js",
|
|
30
|
-
"postbuild:cjs": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json"
|
|
31
|
-
},
|
|
32
23
|
"dependencies": {
|
|
33
|
-
"@shapeshiftoss/caip": "^8.16.8",
|
|
34
|
-
"@shapeshiftoss/types": "^8.6.7",
|
|
35
24
|
"@sniptt/monads": "^0.5.10",
|
|
36
25
|
"bignumber.js": "^9.3.1",
|
|
37
26
|
"dayjs": "^1.11.3",
|
|
38
|
-
"lodash-es": "^4.17.23"
|
|
27
|
+
"lodash-es": "^4.17.23",
|
|
28
|
+
"@shapeshiftoss/caip": "^8.16.10",
|
|
29
|
+
"@shapeshiftoss/types": "^9.0.1"
|
|
39
30
|
},
|
|
40
31
|
"devDependencies": {
|
|
41
32
|
"@types/lodash-es": "^4.17.12"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "rm -rf dist && pnpm exec tsc --build && pnpm run postbuild",
|
|
36
|
+
"clean": "rm -rf dist node_modules",
|
|
37
|
+
"dev": "pnpm exec tsc --build --watch",
|
|
38
|
+
"postbuild": "pnpm run postbuild:esm && pnpm run postbuild:cjs",
|
|
39
|
+
"postbuild:esm": "pnpm exec tsc-esm-fix --target=dist/esm --ext=.js",
|
|
40
|
+
"postbuild:cjs": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json"
|
|
42
41
|
}
|
|
43
42
|
}
|