@shapeshiftoss/utils 1.0.4 → 1.0.5
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 +6 -0
- package/dist/cjs/assetData/baseAssets.js +94 -1
- package/dist/cjs/assetData/getBaseAsset.js +12 -0
- package/dist/cjs/chainIdToFeeAssetId.js +12 -0
- package/dist/cjs/getAssetNamespaceFromChainId.js +11 -2
- package/dist/cjs/getChainShortName.d.ts +1 -1
- package/dist/cjs/getChainShortName.js +12 -0
- package/dist/cjs/getNativeFeeAssetReference.js +22 -0
- package/dist/cjs/index.d.ts +13 -13
- package/dist/cjs/index.js +15 -13
- package/dist/cjs/treasury.d.ts +3 -2
- package/dist/cjs/treasury.js +3 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/assetData/baseAssets.d.ts +6 -0
- package/dist/esm/assetData/baseAssets.js +93 -0
- package/dist/esm/assetData/getBaseAsset.js +13 -1
- package/dist/esm/chainIdToFeeAssetId.js +13 -1
- package/dist/esm/getAssetNamespaceFromChainId.js +11 -2
- package/dist/esm/getChainShortName.d.ts +1 -1
- package/dist/esm/getChainShortName.js +12 -0
- package/dist/esm/getNativeFeeAssetReference.js +22 -0
- package/dist/esm/index.d.ts +13 -13
- package/dist/esm/index.js +15 -13
- package/dist/esm/treasury.d.ts +3 -2
- package/dist/esm/treasury.js +2 -0
- package/package.json +3 -3
|
@@ -4,6 +4,7 @@ export declare const bitcoin: Readonly<Asset>;
|
|
|
4
4
|
export declare const bitcoincash: Readonly<Asset>;
|
|
5
5
|
export declare const dogecoin: Readonly<Asset>;
|
|
6
6
|
export declare const litecoin: Readonly<Asset>;
|
|
7
|
+
export declare const zcash: Readonly<Asset>;
|
|
7
8
|
export declare const atom: Readonly<Asset>;
|
|
8
9
|
export declare const avax: Readonly<Asset>;
|
|
9
10
|
export declare const thorchain: Readonly<Asset>;
|
|
@@ -19,6 +20,11 @@ export declare const arbitrum: Readonly<Asset>;
|
|
|
19
20
|
export declare const arbitrumNova: Readonly<Asset>;
|
|
20
21
|
export declare const base: Readonly<Asset>;
|
|
21
22
|
export declare const monad: Readonly<Asset>;
|
|
23
|
+
export declare const hyperevm: Readonly<Asset>;
|
|
24
|
+
export declare const plasma: Readonly<Asset>;
|
|
25
|
+
export declare const katana: Readonly<Asset>;
|
|
22
26
|
export declare const solana: Readonly<Asset>;
|
|
23
27
|
export declare const tron: Readonly<Asset>;
|
|
24
28
|
export declare const sui: Readonly<Asset>;
|
|
29
|
+
export declare const near: Readonly<Asset>;
|
|
30
|
+
export declare const starknet: 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.sui = exports.tron = exports.solana = exports.monad = exports.base = exports.arbitrumNova = 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.litecoin = exports.dogecoin = exports.bitcoincash = exports.bitcoin = exports.ethereum = void 0;
|
|
26
|
+
exports.starknet = exports.near = exports.sui = exports.tron = exports.solana = exports.katana = exports.plasma = exports.hyperevm = exports.monad = exports.base = exports.arbitrumNova = 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({
|
|
@@ -96,6 +96,21 @@ exports.litecoin = Object.freeze({
|
|
|
96
96
|
explorerTxLink: 'https://live.blockcypher.com/ltc/tx/',
|
|
97
97
|
relatedAssetKey: null,
|
|
98
98
|
});
|
|
99
|
+
exports.zcash = Object.freeze({
|
|
100
|
+
assetId: caip.zecAssetId,
|
|
101
|
+
chainId: caip.zecChainId,
|
|
102
|
+
name: 'Zcash',
|
|
103
|
+
networkName: 'Zcash',
|
|
104
|
+
symbol: 'ZEC',
|
|
105
|
+
precision: 8,
|
|
106
|
+
color: '#f4b728',
|
|
107
|
+
networkColor: '#f4b728',
|
|
108
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/fb59e296f64fe3df5afdf8148e88603851b613ae/blockchains/zcash/info/logo.png',
|
|
109
|
+
explorer: 'https://blockchair.com',
|
|
110
|
+
explorerAddressLink: 'https://blockchair.com/zcash/address/',
|
|
111
|
+
explorerTxLink: 'https://blockchair.com/zcash/transaction/',
|
|
112
|
+
relatedAssetKey: null,
|
|
113
|
+
});
|
|
99
114
|
exports.atom = Object.freeze({
|
|
100
115
|
assetId: caip.cosmosAssetId,
|
|
101
116
|
chainId: caip.cosmosChainId,
|
|
@@ -318,6 +333,54 @@ exports.monad = Object.freeze({
|
|
|
318
333
|
explorerTxLink: 'https://monadvision.com/tx/',
|
|
319
334
|
relatedAssetKey: null,
|
|
320
335
|
});
|
|
336
|
+
exports.hyperevm = Object.freeze({
|
|
337
|
+
assetId: caip.hyperEvmAssetId,
|
|
338
|
+
chainId: caip.hyperEvmChainId,
|
|
339
|
+
name: 'HyperEVM',
|
|
340
|
+
networkName: 'HyperEVM',
|
|
341
|
+
symbol: 'HYPE',
|
|
342
|
+
precision: 18,
|
|
343
|
+
color: '#000000',
|
|
344
|
+
networkColor: '#000000',
|
|
345
|
+
icon: 'https://assets.coingecko.com/coins/images/50882/standard/hyperliquid.jpg?1729431300',
|
|
346
|
+
networkIcon: 'https://assets.coingecko.com/coins/images/50882/standard/hyperliquid.jpg?1729431300',
|
|
347
|
+
explorer: 'https://hyperevmscan.io',
|
|
348
|
+
explorerAddressLink: 'https://hyperevmscan.io/address/',
|
|
349
|
+
explorerTxLink: 'https://hyperevmscan.io/tx/',
|
|
350
|
+
relatedAssetKey: null,
|
|
351
|
+
});
|
|
352
|
+
exports.plasma = Object.freeze({
|
|
353
|
+
assetId: caip.plasmaAssetId,
|
|
354
|
+
chainId: caip.plasmaChainId,
|
|
355
|
+
name: 'Plasma',
|
|
356
|
+
networkName: 'Plasma',
|
|
357
|
+
symbol: 'XPL',
|
|
358
|
+
precision: 18,
|
|
359
|
+
color: '#8B5CF6',
|
|
360
|
+
networkColor: '#8B5CF6',
|
|
361
|
+
icon: 'https://assets.coingecko.com/coins/images/66489/standard/Plasma-symbol-green-1.png?1755142558',
|
|
362
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/32256/small/plasma.jpg?1758000963',
|
|
363
|
+
explorer: 'https://plasmascan.to',
|
|
364
|
+
explorerAddressLink: 'https://plasmascan.to/address/',
|
|
365
|
+
explorerTxLink: 'https://plasmascan.to/tx/',
|
|
366
|
+
relatedAssetKey: null,
|
|
367
|
+
});
|
|
368
|
+
exports.katana = Object.freeze({
|
|
369
|
+
assetId: caip.katanaAssetId,
|
|
370
|
+
chainId: caip.katanaChainId,
|
|
371
|
+
name: 'Ethereum',
|
|
372
|
+
networkName: 'Katana',
|
|
373
|
+
symbol: 'ETH',
|
|
374
|
+
precision: 18,
|
|
375
|
+
color: '#5C6BC0',
|
|
376
|
+
networkColor: '#E11D48',
|
|
377
|
+
icon: 'https://rawcdn.githack.com/trustwallet/assets/32e51d582a890b3dd3135fe3ee7c20c2fd699a6d/blockchains/ethereum/info/logo.png',
|
|
378
|
+
networkIcon: 'https://assets.coingecko.com/asset_platforms/images/32239/small/katana.jpg',
|
|
379
|
+
explorer: 'https://katanascan.com',
|
|
380
|
+
explorerAddressLink: 'https://katanascan.com/address/',
|
|
381
|
+
explorerTxLink: 'https://katanascan.com/tx/',
|
|
382
|
+
relatedAssetKey: 'eip155:1/slip44:60',
|
|
383
|
+
});
|
|
321
384
|
exports.solana = Object.freeze({
|
|
322
385
|
assetId: caip.solAssetId,
|
|
323
386
|
chainId: caip.solanaChainId,
|
|
@@ -363,3 +426,33 @@ exports.sui = Object.freeze({
|
|
|
363
426
|
explorerTxLink: 'https://suiscan.xyz/mainnet/tx/',
|
|
364
427
|
relatedAssetKey: null,
|
|
365
428
|
});
|
|
429
|
+
exports.near = Object.freeze({
|
|
430
|
+
assetId: caip.nearAssetId,
|
|
431
|
+
chainId: caip.nearChainId,
|
|
432
|
+
name: 'NEAR Protocol',
|
|
433
|
+
networkName: 'NEAR',
|
|
434
|
+
symbol: 'NEAR',
|
|
435
|
+
precision: 24,
|
|
436
|
+
color: '#00C08B',
|
|
437
|
+
networkColor: '#00C08B',
|
|
438
|
+
icon: 'https://assets.coingecko.com/coins/images/10365/large/near.jpg?1696510367',
|
|
439
|
+
explorer: 'https://nearblocks.io',
|
|
440
|
+
explorerAddressLink: 'https://nearblocks.io/address/',
|
|
441
|
+
explorerTxLink: 'https://nearblocks.io/txns/',
|
|
442
|
+
relatedAssetKey: null,
|
|
443
|
+
});
|
|
444
|
+
exports.starknet = Object.freeze({
|
|
445
|
+
assetId: caip.starknetAssetId,
|
|
446
|
+
chainId: caip.starknetChainId,
|
|
447
|
+
name: 'Starknet',
|
|
448
|
+
networkName: 'Starknet',
|
|
449
|
+
symbol: 'STRK',
|
|
450
|
+
precision: 18,
|
|
451
|
+
color: '#EC796B',
|
|
452
|
+
networkColor: '#EC796B',
|
|
453
|
+
icon: 'https://assets.coingecko.com/coins/images/26433/large/starknet.png',
|
|
454
|
+
explorer: 'https://starkscan.co',
|
|
455
|
+
explorerAddressLink: 'https://starkscan.co/contract/',
|
|
456
|
+
explorerTxLink: 'https://starkscan.co/tx/',
|
|
457
|
+
relatedAssetKey: null,
|
|
458
|
+
});
|
|
@@ -29,6 +29,8 @@ const getBaseAsset = (chainId) => {
|
|
|
29
29
|
return baseAssets_1.solana;
|
|
30
30
|
case types_1.KnownChainIds.SuiMainnet:
|
|
31
31
|
return baseAssets_1.sui;
|
|
32
|
+
case types_1.KnownChainIds.StarknetMainnet:
|
|
33
|
+
return baseAssets_1.starknet;
|
|
32
34
|
case types_1.KnownChainIds.BitcoinMainnet:
|
|
33
35
|
return baseAssets_1.bitcoin;
|
|
34
36
|
case types_1.KnownChainIds.BitcoinCashMainnet:
|
|
@@ -47,6 +49,16 @@ const getBaseAsset = (chainId) => {
|
|
|
47
49
|
return baseAssets_1.tron;
|
|
48
50
|
case types_1.KnownChainIds.MonadMainnet:
|
|
49
51
|
return baseAssets_1.monad;
|
|
52
|
+
case types_1.KnownChainIds.HyperEvmMainnet:
|
|
53
|
+
return baseAssets_1.hyperevm;
|
|
54
|
+
case types_1.KnownChainIds.PlasmaMainnet:
|
|
55
|
+
return baseAssets_1.plasma;
|
|
56
|
+
case types_1.KnownChainIds.KatanaMainnet:
|
|
57
|
+
return baseAssets_1.katana;
|
|
58
|
+
case types_1.KnownChainIds.NearMainnet:
|
|
59
|
+
return baseAssets_1.near;
|
|
60
|
+
case types_1.KnownChainIds.ZcashMainnet:
|
|
61
|
+
return baseAssets_1.zcash;
|
|
50
62
|
default:
|
|
51
63
|
return (0, assertUnreachable_1.assertUnreachable)(knownChainId);
|
|
52
64
|
}
|
|
@@ -45,8 +45,20 @@ const chainIdToFeeAssetId = (_chainId) => {
|
|
|
45
45
|
return caip_1.tronAssetId;
|
|
46
46
|
case types_1.KnownChainIds.SuiMainnet:
|
|
47
47
|
return caip_1.suiAssetId;
|
|
48
|
+
case types_1.KnownChainIds.StarknetMainnet:
|
|
49
|
+
return caip_1.starknetAssetId;
|
|
48
50
|
case types_1.KnownChainIds.MonadMainnet:
|
|
49
51
|
return caip_1.monadAssetId;
|
|
52
|
+
case types_1.KnownChainIds.HyperEvmMainnet:
|
|
53
|
+
return caip_1.hyperEvmAssetId;
|
|
54
|
+
case types_1.KnownChainIds.PlasmaMainnet:
|
|
55
|
+
return caip_1.plasmaAssetId;
|
|
56
|
+
case types_1.KnownChainIds.KatanaMainnet:
|
|
57
|
+
return caip_1.katanaAssetId;
|
|
58
|
+
case types_1.KnownChainIds.ZcashMainnet:
|
|
59
|
+
return caip_1.zecAssetId;
|
|
60
|
+
case types_1.KnownChainIds.NearMainnet:
|
|
61
|
+
return caip_1.nearAssetId;
|
|
50
62
|
default:
|
|
51
63
|
return (0, assertUnreachable_1.assertUnreachable)(chainId);
|
|
52
64
|
}
|
|
@@ -9,7 +9,11 @@ const getAssetNamespaceFromChainId = (chainId) => {
|
|
|
9
9
|
case types_1.KnownChainIds.SolanaMainnet:
|
|
10
10
|
return caip_1.ASSET_NAMESPACE.splToken;
|
|
11
11
|
case types_1.KnownChainIds.SuiMainnet:
|
|
12
|
-
return caip_1.ASSET_NAMESPACE.
|
|
12
|
+
return caip_1.ASSET_NAMESPACE.suiCoin;
|
|
13
|
+
case types_1.KnownChainIds.NearMainnet:
|
|
14
|
+
return caip_1.ASSET_NAMESPACE.nep141;
|
|
15
|
+
case types_1.KnownChainIds.TronMainnet:
|
|
16
|
+
return caip_1.ASSET_NAMESPACE.trc20;
|
|
13
17
|
case types_1.KnownChainIds.EthereumMainnet:
|
|
14
18
|
case types_1.KnownChainIds.AvalancheMainnet:
|
|
15
19
|
case types_1.KnownChainIds.OptimismMainnet:
|
|
@@ -20,15 +24,20 @@ const getAssetNamespaceFromChainId = (chainId) => {
|
|
|
20
24
|
case types_1.KnownChainIds.BaseMainnet:
|
|
21
25
|
case types_1.KnownChainIds.BnbSmartChainMainnet:
|
|
22
26
|
case types_1.KnownChainIds.MonadMainnet:
|
|
27
|
+
case types_1.KnownChainIds.HyperEvmMainnet:
|
|
28
|
+
case types_1.KnownChainIds.PlasmaMainnet:
|
|
29
|
+
case types_1.KnownChainIds.KatanaMainnet:
|
|
23
30
|
return caip_1.ASSET_NAMESPACE.erc20;
|
|
31
|
+
case types_1.KnownChainIds.StarknetMainnet:
|
|
32
|
+
return caip_1.ASSET_NAMESPACE.starknetToken;
|
|
24
33
|
case types_1.KnownChainIds.CosmosMainnet:
|
|
25
34
|
case types_1.KnownChainIds.BitcoinMainnet:
|
|
26
35
|
case types_1.KnownChainIds.BitcoinCashMainnet:
|
|
27
36
|
case types_1.KnownChainIds.DogecoinMainnet:
|
|
28
37
|
case types_1.KnownChainIds.LitecoinMainnet:
|
|
38
|
+
case types_1.KnownChainIds.ZcashMainnet:
|
|
29
39
|
case types_1.KnownChainIds.ThorchainMainnet:
|
|
30
40
|
case types_1.KnownChainIds.MayachainMainnet:
|
|
31
|
-
case types_1.KnownChainIds.TronMainnet:
|
|
32
41
|
throw Error(`Unhandled case '${chainId}'`);
|
|
33
42
|
default:
|
|
34
43
|
return (0, assertUnreachable_1.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" | "ARB-Nova" | "BAS" | "BTC" | "BCH" | "COSM" | "THOR" | "MAYA" | "DOGE" | "LTC" | "SOL" | "TRX" | "SUI" | "MON" | undefined;
|
|
2
|
+
export declare const getChainShortName: (chainId: KnownChainIds) => "AVA" | "OP" | "ETH" | "POLY" | "GNO" | "BNB" | "ARB" | "ARB-Nova" | "BAS" | "BTC" | "BCH" | "COSM" | "THOR" | "MAYA" | "DOGE" | "LTC" | "SOL" | "TRX" | "SUI" | "STRK" | "MON" | "HYPE" | "XPL" | "KAT" | "ZEC" | "NEAR" | undefined;
|
|
@@ -43,8 +43,20 @@ const getChainShortName = (chainId) => {
|
|
|
43
43
|
return 'TRX';
|
|
44
44
|
case types_1.KnownChainIds.SuiMainnet:
|
|
45
45
|
return 'SUI';
|
|
46
|
+
case types_1.KnownChainIds.StarknetMainnet:
|
|
47
|
+
return 'STRK';
|
|
46
48
|
case types_1.KnownChainIds.MonadMainnet:
|
|
47
49
|
return 'MON';
|
|
50
|
+
case types_1.KnownChainIds.HyperEvmMainnet:
|
|
51
|
+
return 'HYPE';
|
|
52
|
+
case types_1.KnownChainIds.PlasmaMainnet:
|
|
53
|
+
return 'XPL';
|
|
54
|
+
case types_1.KnownChainIds.KatanaMainnet:
|
|
55
|
+
return 'KAT';
|
|
56
|
+
case types_1.KnownChainIds.ZcashMainnet:
|
|
57
|
+
return 'ZEC';
|
|
58
|
+
case types_1.KnownChainIds.NearMainnet:
|
|
59
|
+
return 'NEAR';
|
|
48
60
|
default: {
|
|
49
61
|
(0, assertUnreachable_1.assertUnreachable)(chainId);
|
|
50
62
|
}
|
|
@@ -15,6 +15,8 @@ const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
15
15
|
return caip_1.ASSET_REFERENCE.Dogecoin;
|
|
16
16
|
case caip_1.CHAIN_REFERENCE.LitecoinMainnet:
|
|
17
17
|
return caip_1.ASSET_REFERENCE.Litecoin;
|
|
18
|
+
case caip_1.CHAIN_REFERENCE.ZcashMainnet:
|
|
19
|
+
return caip_1.ASSET_REFERENCE.Zcash;
|
|
18
20
|
default:
|
|
19
21
|
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
20
22
|
}
|
|
@@ -40,6 +42,12 @@ const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
40
42
|
return caip_1.ASSET_REFERENCE.Base;
|
|
41
43
|
case caip_1.CHAIN_REFERENCE.MonadMainnet:
|
|
42
44
|
return caip_1.ASSET_REFERENCE.Monad;
|
|
45
|
+
case caip_1.CHAIN_REFERENCE.HyperEvmMainnet:
|
|
46
|
+
return caip_1.ASSET_REFERENCE.HyperEvm;
|
|
47
|
+
case caip_1.CHAIN_REFERENCE.PlasmaMainnet:
|
|
48
|
+
return caip_1.ASSET_REFERENCE.Plasma;
|
|
49
|
+
case caip_1.CHAIN_REFERENCE.KatanaMainnet:
|
|
50
|
+
return caip_1.ASSET_REFERENCE.Katana;
|
|
43
51
|
default:
|
|
44
52
|
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
45
53
|
}
|
|
@@ -75,6 +83,20 @@ const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
|
|
|
75
83
|
default:
|
|
76
84
|
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
77
85
|
}
|
|
86
|
+
case caip_1.CHAIN_NAMESPACE.Near:
|
|
87
|
+
switch (chainReference) {
|
|
88
|
+
case caip_1.CHAIN_REFERENCE.NearMainnet:
|
|
89
|
+
return caip_1.ASSET_REFERENCE.Near;
|
|
90
|
+
default:
|
|
91
|
+
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
92
|
+
}
|
|
93
|
+
case caip_1.CHAIN_NAMESPACE.Starknet:
|
|
94
|
+
switch (chainReference) {
|
|
95
|
+
case caip_1.CHAIN_REFERENCE.StarknetMainnet:
|
|
96
|
+
return caip_1.ASSET_REFERENCE.Starknet;
|
|
97
|
+
default:
|
|
98
|
+
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
99
|
+
}
|
|
78
100
|
default:
|
|
79
101
|
throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
|
|
80
102
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import type { AssetId } from '@shapeshiftoss/caip';
|
|
2
|
-
export * from './makeAsset/makeAsset';
|
|
3
2
|
export * from './assertUnreachable';
|
|
4
|
-
export * from './
|
|
3
|
+
export * from './assetData';
|
|
4
|
+
export * from './baseUnits/baseUnits';
|
|
5
|
+
export * from './basisPoints';
|
|
6
|
+
export * from './bignumber/bignumber';
|
|
5
7
|
export * from './chainIdToFeeAsset';
|
|
6
8
|
export * from './chainIdToFeeAssetId';
|
|
7
|
-
export * from './utxo';
|
|
8
|
-
export * from './bignumber/bignumber';
|
|
9
|
-
export * from './basisPoints';
|
|
10
|
-
export * from './baseUnits/baseUnits';
|
|
11
|
-
export * from './promises';
|
|
12
|
-
export * from './treasury';
|
|
13
|
-
export * from './timeout';
|
|
14
9
|
export * from './createThrottle';
|
|
15
|
-
export * from './historyTimeframe';
|
|
16
|
-
export * from './getNativeFeeAssetReference';
|
|
17
|
-
export * from './assetData';
|
|
18
|
-
export * from './unfreeze';
|
|
19
10
|
export * from './getAssetNamespaceFromChainId';
|
|
20
11
|
export * from './getChainShortName';
|
|
12
|
+
export * from './getNativeFeeAssetReference';
|
|
13
|
+
export * from './historyTimeframe';
|
|
14
|
+
export * from './makeAsset/makeAsset';
|
|
15
|
+
export * from './promises';
|
|
16
|
+
export * from './sha256';
|
|
17
|
+
export * from './timeout';
|
|
18
|
+
export * from './treasury';
|
|
19
|
+
export * from './unfreeze';
|
|
20
|
+
export * from './utxo';
|
|
21
21
|
export declare const isSome: <T>(option: T | null | undefined) => option is T;
|
|
22
22
|
export declare const isToken: (assetId: AssetId) => boolean;
|
|
23
23
|
export declare const isSplToken: (assetId: AssetId) => boolean;
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,25 +17,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.contractAddressOrUndefined = exports.isSplToken = exports.isToken = exports.isSome = void 0;
|
|
18
18
|
const caip_1 = require("@shapeshiftoss/caip");
|
|
19
19
|
const lodash_1 = require("lodash");
|
|
20
|
-
__exportStar(require("./makeAsset/makeAsset"), exports);
|
|
21
20
|
__exportStar(require("./assertUnreachable"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./assetData"), exports);
|
|
22
|
+
__exportStar(require("./baseUnits/baseUnits"), exports);
|
|
23
|
+
__exportStar(require("./basisPoints"), exports);
|
|
24
|
+
__exportStar(require("./bignumber/bignumber"), exports);
|
|
23
25
|
__exportStar(require("./chainIdToFeeAsset"), exports);
|
|
24
26
|
__exportStar(require("./chainIdToFeeAssetId"), exports);
|
|
25
|
-
__exportStar(require("./utxo"), exports);
|
|
26
|
-
__exportStar(require("./bignumber/bignumber"), exports);
|
|
27
|
-
__exportStar(require("./basisPoints"), exports);
|
|
28
|
-
__exportStar(require("./baseUnits/baseUnits"), exports);
|
|
29
|
-
__exportStar(require("./promises"), exports);
|
|
30
|
-
__exportStar(require("./treasury"), exports);
|
|
31
|
-
__exportStar(require("./timeout"), exports);
|
|
32
27
|
__exportStar(require("./createThrottle"), exports);
|
|
33
|
-
__exportStar(require("./historyTimeframe"), exports);
|
|
34
|
-
__exportStar(require("./getNativeFeeAssetReference"), exports);
|
|
35
|
-
__exportStar(require("./assetData"), exports);
|
|
36
|
-
__exportStar(require("./unfreeze"), exports);
|
|
37
28
|
__exportStar(require("./getAssetNamespaceFromChainId"), exports);
|
|
38
29
|
__exportStar(require("./getChainShortName"), exports);
|
|
30
|
+
__exportStar(require("./getNativeFeeAssetReference"), exports);
|
|
31
|
+
__exportStar(require("./historyTimeframe"), exports);
|
|
32
|
+
__exportStar(require("./makeAsset/makeAsset"), exports);
|
|
33
|
+
__exportStar(require("./promises"), exports);
|
|
34
|
+
__exportStar(require("./sha256"), exports);
|
|
35
|
+
__exportStar(require("./timeout"), exports);
|
|
36
|
+
__exportStar(require("./treasury"), exports);
|
|
37
|
+
__exportStar(require("./unfreeze"), exports);
|
|
38
|
+
__exportStar(require("./utxo"), exports);
|
|
39
39
|
const isSome = (option) => !(0, lodash_1.isUndefined)(option) && !(0, lodash_1.isNull)(option);
|
|
40
40
|
exports.isSome = isSome;
|
|
41
41
|
const isToken = (assetId) => {
|
|
@@ -46,6 +46,8 @@ const isToken = (assetId) => {
|
|
|
46
46
|
case caip_1.ASSET_NAMESPACE.splToken:
|
|
47
47
|
case caip_1.ASSET_NAMESPACE.trc20:
|
|
48
48
|
case caip_1.ASSET_NAMESPACE.suiCoin:
|
|
49
|
+
case caip_1.ASSET_NAMESPACE.starknetToken:
|
|
50
|
+
case caip_1.ASSET_NAMESPACE.nep141:
|
|
49
51
|
return true;
|
|
50
52
|
default:
|
|
51
53
|
return false;
|
package/dist/cjs/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];
|
|
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];
|
|
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;
|
|
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;
|
|
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";
|
|
@@ -14,3 +14,4 @@ export declare const DAO_TREASURY_BASE = "0x9c9aA90363630d4ab1D9dbF416cc3BBC8d3E
|
|
|
14
14
|
export declare const DAO_TREASURY_SOLANA = "Bh7R3MeJ98D7Ersxh7TgVQVQUSmDMqwrFVHH9DLfb4u3";
|
|
15
15
|
export declare const DAO_TREASURY_BITCOIN = "bc1qr2whxtd0gvqnctcxlynwejp6fvntv0mtxkv0dlv02vyale8h69ysm6l32n";
|
|
16
16
|
export declare const DAO_TREASURY_NEAR = "f471d0b0f90593d85125f38aaf5458748d6f23fd5b437b844d293d8e87557070";
|
|
17
|
+
export declare const DAO_TREASURY_STARKNET = "0x052a1132ea4db81Bde863AFb18a4d4CE5de9d3efdfda6b3DaA6484e26425D467";
|
package/dist/cjs/treasury.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Wallets relating to the ShapeShift DAO Treasury
|
|
3
3
|
// https://forum.shapeshift.com/thread/dao-treasuries-and-multisigs-43646
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.DAO_TREASURY_NEAR = exports.DAO_TREASURY_BITCOIN = exports.DAO_TREASURY_SOLANA = exports.DAO_TREASURY_BASE = exports.DAO_TREASURY_ARBITRUM = exports.DAO_TREASURY_BSC = exports.DAO_TREASURY_GNOSIS = exports.DAO_TREASURY_POLYGON = exports.DAO_TREASURY_AVALANCHE = exports.DAO_TREASURY_OPTIMISM = exports.DAO_TREASURY_ETHEREUM_MAINNET = exports.isTreasuryChainId = exports.treasuryChainIds = void 0;
|
|
5
|
+
exports.DAO_TREASURY_STARKNET = exports.DAO_TREASURY_NEAR = exports.DAO_TREASURY_BITCOIN = exports.DAO_TREASURY_SOLANA = exports.DAO_TREASURY_BASE = exports.DAO_TREASURY_ARBITRUM = exports.DAO_TREASURY_BSC = exports.DAO_TREASURY_GNOSIS = exports.DAO_TREASURY_POLYGON = exports.DAO_TREASURY_AVALANCHE = exports.DAO_TREASURY_OPTIMISM = exports.DAO_TREASURY_ETHEREUM_MAINNET = exports.isTreasuryChainId = exports.treasuryChainIds = void 0;
|
|
6
6
|
const types_1 = require("@shapeshiftoss/types");
|
|
7
7
|
exports.treasuryChainIds = [
|
|
8
8
|
types_1.KnownChainIds.EthereumMainnet,
|
|
@@ -15,6 +15,7 @@ exports.treasuryChainIds = [
|
|
|
15
15
|
types_1.KnownChainIds.BaseMainnet,
|
|
16
16
|
types_1.KnownChainIds.SolanaMainnet,
|
|
17
17
|
types_1.KnownChainIds.BitcoinMainnet,
|
|
18
|
+
types_1.KnownChainIds.StarknetMainnet,
|
|
18
19
|
];
|
|
19
20
|
const isTreasuryChainId = (chainId) => {
|
|
20
21
|
return exports.treasuryChainIds.includes(chainId);
|
|
@@ -32,3 +33,4 @@ exports.DAO_TREASURY_BASE = '0x9c9aA90363630d4ab1D9dbF416cc3BBC8d3Ed502';
|
|
|
32
33
|
exports.DAO_TREASURY_SOLANA = 'Bh7R3MeJ98D7Ersxh7TgVQVQUSmDMqwrFVHH9DLfb4u3';
|
|
33
34
|
exports.DAO_TREASURY_BITCOIN = 'bc1qr2whxtd0gvqnctcxlynwejp6fvntv0mtxkv0dlv02vyale8h69ysm6l32n';
|
|
34
35
|
exports.DAO_TREASURY_NEAR = 'f471d0b0f90593d85125f38aaf5458748d6f23fd5b437b844d293d8e87557070';
|
|
36
|
+
exports.DAO_TREASURY_STARKNET = '0x052a1132ea4db81Bde863AFb18a4d4CE5de9d3efdfda6b3DaA6484e26425D467';
|