@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,4 @@
|
|
|
1
|
-
import {
|
|
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, 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) => {
|
|
@@ -8,8 +8,6 @@ export const chainIdToFeeAssetId = (_chainId) => {
|
|
|
8
8
|
return arbitrumAssetId;
|
|
9
9
|
case KnownChainIds.AvalancheMainnet:
|
|
10
10
|
return avalancheAssetId;
|
|
11
|
-
case KnownChainIds.ArbitrumNovaMainnet:
|
|
12
|
-
return arbitrumNovaAssetId;
|
|
13
11
|
case KnownChainIds.BaseMainnet:
|
|
14
12
|
return baseAssetId;
|
|
15
13
|
case KnownChainIds.BitcoinCashMainnet:
|
|
@@ -50,12 +48,60 @@ export const chainIdToFeeAssetId = (_chainId) => {
|
|
|
50
48
|
return hyperEvmAssetId;
|
|
51
49
|
case KnownChainIds.PlasmaMainnet:
|
|
52
50
|
return plasmaAssetId;
|
|
51
|
+
case KnownChainIds.PlumeMainnet:
|
|
52
|
+
return plumeAssetId;
|
|
53
|
+
case KnownChainIds.MantleMainnet:
|
|
54
|
+
return mantleAssetId;
|
|
55
|
+
case KnownChainIds.InkMainnet:
|
|
56
|
+
return inkAssetId;
|
|
57
|
+
case KnownChainIds.MegaEthMainnet:
|
|
58
|
+
return megaethAssetId;
|
|
59
|
+
case KnownChainIds.BerachainMainnet:
|
|
60
|
+
return berachainAssetId;
|
|
61
|
+
case KnownChainIds.CronosMainnet:
|
|
62
|
+
return cronosAssetId;
|
|
53
63
|
case KnownChainIds.KatanaMainnet:
|
|
54
64
|
return katanaAssetId;
|
|
65
|
+
case KnownChainIds.EtherealMainnet:
|
|
66
|
+
return etherealAssetId;
|
|
67
|
+
case KnownChainIds.FlowEvmMainnet:
|
|
68
|
+
return flowEvmAssetId;
|
|
69
|
+
case KnownChainIds.CeloMainnet:
|
|
70
|
+
return celoAssetId;
|
|
71
|
+
case KnownChainIds.StoryMainnet:
|
|
72
|
+
return storyAssetId;
|
|
73
|
+
case KnownChainIds.ZkSyncEraMainnet:
|
|
74
|
+
return zkSyncEraAssetId;
|
|
75
|
+
case KnownChainIds.BlastMainnet:
|
|
76
|
+
return blastAssetId;
|
|
77
|
+
case KnownChainIds.WorldChainMainnet:
|
|
78
|
+
return worldChainAssetId;
|
|
79
|
+
case KnownChainIds.HemiMainnet:
|
|
80
|
+
return hemiAssetId;
|
|
81
|
+
case KnownChainIds.SeiMainnet:
|
|
82
|
+
return seiAssetId;
|
|
83
|
+
case KnownChainIds.LineaMainnet:
|
|
84
|
+
return lineaAssetId;
|
|
85
|
+
case KnownChainIds.ScrollMainnet:
|
|
86
|
+
return scrollAssetId;
|
|
87
|
+
case KnownChainIds.SonicMainnet:
|
|
88
|
+
return sonicAssetId;
|
|
89
|
+
case KnownChainIds.UnichainMainnet:
|
|
90
|
+
return unichainAssetId;
|
|
91
|
+
case KnownChainIds.BobMainnet:
|
|
92
|
+
return bobAssetId;
|
|
93
|
+
case KnownChainIds.ModeMainnet:
|
|
94
|
+
return modeAssetId;
|
|
95
|
+
case KnownChainIds.SoneiumMainnet:
|
|
96
|
+
return soneiumAssetId;
|
|
55
97
|
case KnownChainIds.ZcashMainnet:
|
|
56
98
|
return zecAssetId;
|
|
57
99
|
case KnownChainIds.NearMainnet:
|
|
58
100
|
return nearAssetId;
|
|
101
|
+
case KnownChainIds.TonMainnet:
|
|
102
|
+
return tonAssetId;
|
|
103
|
+
case KnownChainIds.AbstractMainnet:
|
|
104
|
+
return abstractAssetId;
|
|
59
105
|
default:
|
|
60
106
|
return assertUnreachable(chainId);
|
|
61
107
|
}
|
|
@@ -17,16 +17,40 @@ export const getAssetNamespaceFromChainId = (chainId) => {
|
|
|
17
17
|
case KnownChainIds.PolygonMainnet:
|
|
18
18
|
case KnownChainIds.GnosisMainnet:
|
|
19
19
|
case KnownChainIds.ArbitrumMainnet:
|
|
20
|
-
case KnownChainIds.ArbitrumNovaMainnet:
|
|
21
20
|
case KnownChainIds.BaseMainnet:
|
|
22
21
|
case KnownChainIds.BnbSmartChainMainnet:
|
|
23
22
|
case KnownChainIds.MonadMainnet:
|
|
24
23
|
case KnownChainIds.HyperEvmMainnet:
|
|
25
24
|
case KnownChainIds.PlasmaMainnet:
|
|
25
|
+
case KnownChainIds.MantleMainnet:
|
|
26
|
+
case KnownChainIds.InkMainnet:
|
|
27
|
+
case KnownChainIds.MegaEthMainnet:
|
|
28
|
+
case KnownChainIds.BerachainMainnet:
|
|
29
|
+
case KnownChainIds.CronosMainnet:
|
|
26
30
|
case KnownChainIds.KatanaMainnet:
|
|
31
|
+
case KnownChainIds.PlumeMainnet:
|
|
32
|
+
case KnownChainIds.StoryMainnet:
|
|
33
|
+
case KnownChainIds.ZkSyncEraMainnet:
|
|
34
|
+
case KnownChainIds.BlastMainnet:
|
|
35
|
+
case KnownChainIds.WorldChainMainnet:
|
|
36
|
+
case KnownChainIds.HemiMainnet:
|
|
37
|
+
case KnownChainIds.SeiMainnet:
|
|
38
|
+
case KnownChainIds.LineaMainnet:
|
|
39
|
+
case KnownChainIds.ScrollMainnet:
|
|
40
|
+
case KnownChainIds.SonicMainnet:
|
|
41
|
+
case KnownChainIds.UnichainMainnet:
|
|
42
|
+
case KnownChainIds.BobMainnet:
|
|
43
|
+
case KnownChainIds.ModeMainnet:
|
|
44
|
+
case KnownChainIds.SoneiumMainnet:
|
|
45
|
+
case KnownChainIds.EtherealMainnet:
|
|
46
|
+
case KnownChainIds.FlowEvmMainnet:
|
|
47
|
+
case KnownChainIds.CeloMainnet:
|
|
48
|
+
case KnownChainIds.AbstractMainnet:
|
|
27
49
|
return ASSET_NAMESPACE.erc20;
|
|
28
50
|
case KnownChainIds.StarknetMainnet:
|
|
29
51
|
return ASSET_NAMESPACE.starknetToken;
|
|
52
|
+
case KnownChainIds.TonMainnet:
|
|
53
|
+
return ASSET_NAMESPACE.jetton;
|
|
30
54
|
case KnownChainIds.CosmosMainnet:
|
|
31
55
|
case KnownChainIds.BitcoinMainnet:
|
|
32
56
|
case KnownChainIds.BitcoinCashMainnet:
|
|
@@ -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" | "
|
|
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" | undefined;
|
|
@@ -16,8 +16,6 @@ export const getChainShortName = (chainId) => {
|
|
|
16
16
|
return 'BNB';
|
|
17
17
|
case KnownChainIds.ArbitrumMainnet:
|
|
18
18
|
return 'ARB';
|
|
19
|
-
case KnownChainIds.ArbitrumNovaMainnet:
|
|
20
|
-
return 'ARB-Nova';
|
|
21
19
|
case KnownChainIds.BaseMainnet:
|
|
22
20
|
return 'BAS';
|
|
23
21
|
case KnownChainIds.BitcoinMainnet:
|
|
@@ -48,12 +46,60 @@ export const getChainShortName = (chainId) => {
|
|
|
48
46
|
return 'HYPE';
|
|
49
47
|
case KnownChainIds.PlasmaMainnet:
|
|
50
48
|
return 'XPL';
|
|
49
|
+
case KnownChainIds.MantleMainnet:
|
|
50
|
+
return 'MNT';
|
|
51
|
+
case KnownChainIds.InkMainnet:
|
|
52
|
+
return 'INK';
|
|
53
|
+
case KnownChainIds.MegaEthMainnet:
|
|
54
|
+
return 'MEGA';
|
|
55
|
+
case KnownChainIds.BerachainMainnet:
|
|
56
|
+
return 'BERA';
|
|
57
|
+
case KnownChainIds.CronosMainnet:
|
|
58
|
+
return 'CRO';
|
|
51
59
|
case KnownChainIds.KatanaMainnet:
|
|
52
60
|
return 'KAT';
|
|
61
|
+
case KnownChainIds.EtherealMainnet:
|
|
62
|
+
return 'ETRL';
|
|
63
|
+
case KnownChainIds.FlowEvmMainnet:
|
|
64
|
+
return 'FLOW';
|
|
65
|
+
case KnownChainIds.CeloMainnet:
|
|
66
|
+
return 'CELO';
|
|
67
|
+
case KnownChainIds.PlumeMainnet:
|
|
68
|
+
return 'PLUME';
|
|
69
|
+
case KnownChainIds.StoryMainnet:
|
|
70
|
+
return 'STORY';
|
|
71
|
+
case KnownChainIds.ZkSyncEraMainnet:
|
|
72
|
+
return 'ZKS';
|
|
73
|
+
case KnownChainIds.BlastMainnet:
|
|
74
|
+
return 'BLAST';
|
|
75
|
+
case KnownChainIds.WorldChainMainnet:
|
|
76
|
+
return 'WLD';
|
|
77
|
+
case KnownChainIds.HemiMainnet:
|
|
78
|
+
return 'HEM';
|
|
79
|
+
case KnownChainIds.SeiMainnet:
|
|
80
|
+
return 'SEI';
|
|
81
|
+
case KnownChainIds.LineaMainnet:
|
|
82
|
+
return 'LIN';
|
|
83
|
+
case KnownChainIds.ScrollMainnet:
|
|
84
|
+
return 'SCR';
|
|
85
|
+
case KnownChainIds.SonicMainnet:
|
|
86
|
+
return 'S';
|
|
87
|
+
case KnownChainIds.UnichainMainnet:
|
|
88
|
+
return 'UNI';
|
|
89
|
+
case KnownChainIds.BobMainnet:
|
|
90
|
+
return 'BOB';
|
|
91
|
+
case KnownChainIds.ModeMainnet:
|
|
92
|
+
return 'MODE';
|
|
93
|
+
case KnownChainIds.SoneiumMainnet:
|
|
94
|
+
return 'SON';
|
|
53
95
|
case KnownChainIds.ZcashMainnet:
|
|
54
96
|
return 'ZEC';
|
|
55
97
|
case KnownChainIds.NearMainnet:
|
|
56
98
|
return 'NEAR';
|
|
99
|
+
case KnownChainIds.TonMainnet:
|
|
100
|
+
return 'TON';
|
|
101
|
+
case KnownChainIds.AbstractMainnet:
|
|
102
|
+
return 'ABS';
|
|
57
103
|
default: {
|
|
58
104
|
assertUnreachable(chainId);
|
|
59
105
|
}
|
|
@@ -33,8 +33,6 @@ export const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
33
33
|
return ASSET_REFERENCE.Gnosis;
|
|
34
34
|
case CHAIN_REFERENCE.ArbitrumMainnet:
|
|
35
35
|
return ASSET_REFERENCE.Arbitrum;
|
|
36
|
-
case CHAIN_REFERENCE.ArbitrumNovaMainnet:
|
|
37
|
-
return ASSET_REFERENCE.ArbitrumNova;
|
|
38
36
|
case CHAIN_REFERENCE.BaseMainnet:
|
|
39
37
|
return ASSET_REFERENCE.Base;
|
|
40
38
|
case CHAIN_REFERENCE.MonadMainnet:
|
|
@@ -43,8 +41,54 @@ export const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
43
41
|
return ASSET_REFERENCE.HyperEvm;
|
|
44
42
|
case CHAIN_REFERENCE.PlasmaMainnet:
|
|
45
43
|
return ASSET_REFERENCE.Plasma;
|
|
44
|
+
case CHAIN_REFERENCE.MantleMainnet:
|
|
45
|
+
return ASSET_REFERENCE.Mantle;
|
|
46
|
+
case CHAIN_REFERENCE.InkMainnet:
|
|
47
|
+
return ASSET_REFERENCE.Ink;
|
|
48
|
+
case CHAIN_REFERENCE.MegaEthMainnet:
|
|
49
|
+
return ASSET_REFERENCE.MegaEth;
|
|
50
|
+
case CHAIN_REFERENCE.BerachainMainnet:
|
|
51
|
+
return ASSET_REFERENCE.Berachain;
|
|
52
|
+
case CHAIN_REFERENCE.CronosMainnet:
|
|
53
|
+
return ASSET_REFERENCE.Cronos;
|
|
46
54
|
case CHAIN_REFERENCE.KatanaMainnet:
|
|
47
55
|
return ASSET_REFERENCE.Katana;
|
|
56
|
+
case CHAIN_REFERENCE.EtherealMainnet:
|
|
57
|
+
return ASSET_REFERENCE.Ethereal;
|
|
58
|
+
case CHAIN_REFERENCE.FlowEvmMainnet:
|
|
59
|
+
return ASSET_REFERENCE.FlowEvm;
|
|
60
|
+
case CHAIN_REFERENCE.CeloMainnet:
|
|
61
|
+
return ASSET_REFERENCE.Celo;
|
|
62
|
+
case CHAIN_REFERENCE.PlumeMainnet:
|
|
63
|
+
return ASSET_REFERENCE.Plume;
|
|
64
|
+
case CHAIN_REFERENCE.StoryMainnet:
|
|
65
|
+
return ASSET_REFERENCE.Story;
|
|
66
|
+
case CHAIN_REFERENCE.ZkSyncEraMainnet:
|
|
67
|
+
return ASSET_REFERENCE.ZkSyncEra;
|
|
68
|
+
case CHAIN_REFERENCE.BlastMainnet:
|
|
69
|
+
return ASSET_REFERENCE.Blast;
|
|
70
|
+
case CHAIN_REFERENCE.AbstractMainnet:
|
|
71
|
+
return ASSET_REFERENCE.Abstract;
|
|
72
|
+
case CHAIN_REFERENCE.WorldChainMainnet:
|
|
73
|
+
return ASSET_REFERENCE.WorldChain;
|
|
74
|
+
case CHAIN_REFERENCE.HemiMainnet:
|
|
75
|
+
return ASSET_REFERENCE.Hemi;
|
|
76
|
+
case CHAIN_REFERENCE.SeiMainnet:
|
|
77
|
+
return ASSET_REFERENCE.Sei;
|
|
78
|
+
case CHAIN_REFERENCE.LineaMainnet:
|
|
79
|
+
return ASSET_REFERENCE.Linea;
|
|
80
|
+
case CHAIN_REFERENCE.ScrollMainnet:
|
|
81
|
+
return ASSET_REFERENCE.Scroll;
|
|
82
|
+
case CHAIN_REFERENCE.SonicMainnet:
|
|
83
|
+
return ASSET_REFERENCE.Sonic;
|
|
84
|
+
case CHAIN_REFERENCE.UnichainMainnet:
|
|
85
|
+
return ASSET_REFERENCE.Unichain;
|
|
86
|
+
case CHAIN_REFERENCE.BobMainnet:
|
|
87
|
+
return ASSET_REFERENCE.Bob;
|
|
88
|
+
case CHAIN_REFERENCE.ModeMainnet:
|
|
89
|
+
return ASSET_REFERENCE.Mode;
|
|
90
|
+
case CHAIN_REFERENCE.SoneiumMainnet:
|
|
91
|
+
return ASSET_REFERENCE.Soneium;
|
|
48
92
|
default:
|
|
49
93
|
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
50
94
|
}
|
|
@@ -94,6 +138,13 @@ export const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
94
138
|
default:
|
|
95
139
|
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
96
140
|
}
|
|
141
|
+
case CHAIN_NAMESPACE.Ton:
|
|
142
|
+
switch (chainReference) {
|
|
143
|
+
case CHAIN_REFERENCE.TonMainnet:
|
|
144
|
+
return ASSET_REFERENCE.Ton;
|
|
145
|
+
default:
|
|
146
|
+
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
147
|
+
}
|
|
97
148
|
default:
|
|
98
149
|
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
99
150
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { AssetId } from '@shapeshiftoss/caip';
|
|
2
2
|
export * from './assertUnreachable.js';
|
|
3
|
+
export * from './encoding.js';
|
|
3
4
|
export * from './assetData/index.js';
|
|
4
5
|
export * from './baseUnits/baseUnits.js';
|
|
6
|
+
export { BigAmount } from './bigAmount/bigAmount.js';
|
|
7
|
+
export type { BigAmountConfig } from './bigAmount/bigAmount.js';
|
|
5
8
|
export * from './basisPoints.js';
|
|
6
9
|
export * from './bignumber/bignumber.js';
|
|
7
10
|
export * from './chainIdToFeeAsset.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ASSET_NAMESPACE, fromAssetId } from '@shapeshiftoss/caip';
|
|
2
|
-
import { isNull, isUndefined } from 'lodash';
|
|
2
|
+
import { isNull, isUndefined } from 'lodash-es';
|
|
3
3
|
export * from './assertUnreachable.js';
|
|
4
|
+
export * from './encoding.js';
|
|
4
5
|
export * from './assetData/index.js';
|
|
5
6
|
export * from './baseUnits/baseUnits.js';
|
|
7
|
+
export { BigAmount } from './bigAmount/bigAmount.js';
|
|
6
8
|
export * from './basisPoints.js';
|
|
7
9
|
export * from './bignumber/bignumber.js';
|
|
8
10
|
export * from './chainIdToFeeAsset.js';
|
|
@@ -30,6 +32,7 @@ export const isToken = (assetId) => {
|
|
|
30
32
|
case ASSET_NAMESPACE.suiCoin:
|
|
31
33
|
case ASSET_NAMESPACE.starknetToken:
|
|
32
34
|
case ASSET_NAMESPACE.nep141:
|
|
35
|
+
case ASSET_NAMESPACE.jetton:
|
|
33
36
|
return true;
|
|
34
37
|
default:
|
|
35
38
|
return false;
|
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];
|
|
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.BitcoinMainnet | KnownChainIds.SolanaMainnet | KnownChainIds.StarknetMainnet;
|
|
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,7 +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
|
|
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
|
@@ -13,11 +13,14 @@ export const treasuryChainIds = [
|
|
|
13
13
|
KnownChainIds.SolanaMainnet,
|
|
14
14
|
KnownChainIds.BitcoinMainnet,
|
|
15
15
|
KnownChainIds.StarknetMainnet,
|
|
16
|
+
KnownChainIds.TonMainnet,
|
|
17
|
+
KnownChainIds.MonadMainnet,
|
|
18
|
+
KnownChainIds.HyperEvmMainnet,
|
|
19
|
+
KnownChainIds.BobMainnet,
|
|
16
20
|
];
|
|
17
21
|
export const isTreasuryChainId = (chainId) => {
|
|
18
22
|
return treasuryChainIds.includes(chainId);
|
|
19
23
|
};
|
|
20
|
-
// Safes
|
|
21
24
|
export const DAO_TREASURY_ETHEREUM_MAINNET = '0x90a48d5cf7343b08da12e067680b4c6dbfe551be';
|
|
22
25
|
export const DAO_TREASURY_OPTIMISM = '0x6268d07327f4fb7380732dc6d63d95F88c0E083b';
|
|
23
26
|
export const DAO_TREASURY_AVALANCHE = '0x74d63F31C2335b5b3BA7ad2812357672b2624cEd';
|
|
@@ -26,7 +29,11 @@ export const DAO_TREASURY_GNOSIS = '0xb0E3175341794D1dc8E5F02a02F9D26989EbedB3';
|
|
|
26
29
|
export const DAO_TREASURY_BSC = '0x8b92b1698b57bEDF2142297e9397875ADBb2297E';
|
|
27
30
|
export const DAO_TREASURY_ARBITRUM = '0x38276553F8fbf2A027D901F8be45f00373d8Dd48';
|
|
28
31
|
export const DAO_TREASURY_BASE = '0x9c9aA90363630d4ab1D9dbF416cc3BBC8d3Ed502';
|
|
29
|
-
export const
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
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.0
|
|
4
|
-
"packageManager": "yarn@3.5.0",
|
|
3
|
+
"version": "1.1.0",
|
|
5
4
|
"repository": "https://github.com/shapeshift/web",
|
|
6
5
|
"license": "MIT",
|
|
7
6
|
"type": "module",
|
|
@@ -10,9 +9,9 @@
|
|
|
10
9
|
"types": "dist/esm/index.d.ts",
|
|
11
10
|
"exports": {
|
|
12
11
|
".": {
|
|
12
|
+
"types": "./dist/esm/index.d.ts",
|
|
13
13
|
"import": "./dist/esm/index.js",
|
|
14
|
-
"require": "./dist/cjs/index.js"
|
|
15
|
-
"types": "./dist/esm/index.d.ts"
|
|
14
|
+
"require": "./dist/cjs/index.js"
|
|
16
15
|
}
|
|
17
16
|
},
|
|
18
17
|
"files": [
|
|
@@ -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.6",
|
|
34
|
-
"@shapeshiftoss/types": "^8.6.6",
|
|
35
24
|
"@sniptt/monads": "^0.5.10",
|
|
36
25
|
"bignumber.js": "^9.3.1",
|
|
37
26
|
"dayjs": "^1.11.3",
|
|
38
|
-
"lodash": "^4.17.
|
|
27
|
+
"lodash-es": "^4.17.23",
|
|
28
|
+
"@shapeshiftoss/caip": "^8.16.9",
|
|
29
|
+
"@shapeshiftoss/types": "^8.6.8"
|
|
39
30
|
},
|
|
40
31
|
"devDependencies": {
|
|
41
|
-
"@types/lodash": "^4.
|
|
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
|
}
|