@chainflip/utils 0.8.16 → 0.8.18
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/chainflip.cjs +3 -0
- package/dist/chainflip.d.cts +3 -1
- package/dist/chainflip.d.ts +3 -1
- package/dist/chainflip.js +3 -1
- package/dist/{chunk-4DFBUXHM.js → chunk-DR3WTOBQ.js} +2 -0
- package/dist/ss58.cjs +1 -4
- package/dist/ss58.js +1 -4
- package/dist/tickMath.js +1 -1
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
package/dist/chainflip.cjs
CHANGED
|
@@ -35,6 +35,7 @@ __export(chainflip_exports, {
|
|
|
35
35
|
getInternalAssets: () => getInternalAssets,
|
|
36
36
|
internalAssetToRpcAsset: () => internalAssetToRpcAsset,
|
|
37
37
|
isValidAssetAndChain: () => isValidAssetAndChain,
|
|
38
|
+
priceAssets: () => priceAssets,
|
|
38
39
|
readAssetValue: () => readAssetValue,
|
|
39
40
|
rpcAssets: () => rpcAssets
|
|
40
41
|
});
|
|
@@ -61,6 +62,7 @@ var chainflipAssets = [
|
|
|
61
62
|
"HubUsdc"
|
|
62
63
|
];
|
|
63
64
|
var assetSymbols = ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
|
|
65
|
+
var priceAssets = ["Btc", "Eth", "Sol", "Usdc", "Usdt", "Usd"];
|
|
64
66
|
var rpcAssets = assetSymbols;
|
|
65
67
|
var baseChainflipAssets = chainflipAssets.filter(
|
|
66
68
|
(asset) => asset !== "Usdc"
|
|
@@ -313,6 +315,7 @@ function getInternalAssets({
|
|
|
313
315
|
getInternalAssets,
|
|
314
316
|
internalAssetToRpcAsset,
|
|
315
317
|
isValidAssetAndChain,
|
|
318
|
+
priceAssets,
|
|
316
319
|
readAssetValue,
|
|
317
320
|
rpcAssets
|
|
318
321
|
});
|
package/dist/chainflip.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const chainflipAssets: readonly ["Usdc", "Usdt", "Flip", "Eth", "Dot", "Btc", "ArbUsdc", "ArbEth", "Sol", "SolUsdc", "HubDot", "HubUsdt", "HubUsdc"];
|
|
2
2
|
type ChainflipAsset = (typeof chainflipAssets)[number];
|
|
3
3
|
declare const assetSymbols: readonly ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
|
|
4
|
+
declare const priceAssets: readonly ["Btc", "Eth", "Sol", "Usdc", "Usdt", "Usd"];
|
|
5
|
+
type PriceAsset = (typeof priceAssets)[number];
|
|
4
6
|
/** @deprecated use `assetSymbols` instead */
|
|
5
7
|
declare const rpcAssets: readonly ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
|
|
6
8
|
type AssetSymbol = (typeof assetSymbols)[number];
|
|
@@ -221,4 +223,4 @@ declare function getInternalAssets(data: {
|
|
|
221
223
|
destAsset: ChainflipAsset | null;
|
|
222
224
|
};
|
|
223
225
|
|
|
224
|
-
export { type AddressType, type AssetAndChain, type AssetOfChain, type AssetSymbol, type BaseAssetAndChain, type BaseChainAssetMap, type BaseChainflipAsset, type ChainAssetMap, type ChainMap, type ChainflipAsset, type ChainflipChain, type ChainflipEvmChain, type ChainflipNetwork, type InternalAssetMap, type RpcAsset, type UncheckedAssetAndChain, addressTypes, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isValidAssetAndChain, readAssetValue, rpcAssets };
|
|
226
|
+
export { type AddressType, type AssetAndChain, type AssetOfChain, type AssetSymbol, type BaseAssetAndChain, type BaseChainAssetMap, type BaseChainflipAsset, type ChainAssetMap, type ChainMap, type ChainflipAsset, type ChainflipChain, type ChainflipEvmChain, type ChainflipNetwork, type InternalAssetMap, type PriceAsset, type RpcAsset, type UncheckedAssetAndChain, addressTypes, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isValidAssetAndChain, priceAssets, readAssetValue, rpcAssets };
|
package/dist/chainflip.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const chainflipAssets: readonly ["Usdc", "Usdt", "Flip", "Eth", "Dot", "Btc", "ArbUsdc", "ArbEth", "Sol", "SolUsdc", "HubDot", "HubUsdt", "HubUsdc"];
|
|
2
2
|
type ChainflipAsset = (typeof chainflipAssets)[number];
|
|
3
3
|
declare const assetSymbols: readonly ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
|
|
4
|
+
declare const priceAssets: readonly ["Btc", "Eth", "Sol", "Usdc", "Usdt", "Usd"];
|
|
5
|
+
type PriceAsset = (typeof priceAssets)[number];
|
|
4
6
|
/** @deprecated use `assetSymbols` instead */
|
|
5
7
|
declare const rpcAssets: readonly ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
|
|
6
8
|
type AssetSymbol = (typeof assetSymbols)[number];
|
|
@@ -221,4 +223,4 @@ declare function getInternalAssets(data: {
|
|
|
221
223
|
destAsset: ChainflipAsset | null;
|
|
222
224
|
};
|
|
223
225
|
|
|
224
|
-
export { type AddressType, type AssetAndChain, type AssetOfChain, type AssetSymbol, type BaseAssetAndChain, type BaseChainAssetMap, type BaseChainflipAsset, type ChainAssetMap, type ChainMap, type ChainflipAsset, type ChainflipChain, type ChainflipEvmChain, type ChainflipNetwork, type InternalAssetMap, type RpcAsset, type UncheckedAssetAndChain, addressTypes, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isValidAssetAndChain, readAssetValue, rpcAssets };
|
|
226
|
+
export { type AddressType, type AssetAndChain, type AssetOfChain, type AssetSymbol, type BaseAssetAndChain, type BaseChainAssetMap, type BaseChainflipAsset, type ChainAssetMap, type ChainMap, type ChainflipAsset, type ChainflipChain, type ChainflipEvmChain, type ChainflipNetwork, type InternalAssetMap, type PriceAsset, type RpcAsset, type UncheckedAssetAndChain, addressTypes, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isValidAssetAndChain, priceAssets, readAssetValue, rpcAssets };
|
package/dist/chainflip.js
CHANGED
|
@@ -14,9 +14,10 @@ import {
|
|
|
14
14
|
getInternalAssets,
|
|
15
15
|
internalAssetToRpcAsset,
|
|
16
16
|
isValidAssetAndChain,
|
|
17
|
+
priceAssets,
|
|
17
18
|
readAssetValue,
|
|
18
19
|
rpcAssets
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DR3WTOBQ.js";
|
|
20
21
|
export {
|
|
21
22
|
addressTypes,
|
|
22
23
|
assetConstants,
|
|
@@ -33,6 +34,7 @@ export {
|
|
|
33
34
|
getInternalAssets,
|
|
34
35
|
internalAssetToRpcAsset,
|
|
35
36
|
isValidAssetAndChain,
|
|
37
|
+
priceAssets,
|
|
36
38
|
readAssetValue,
|
|
37
39
|
rpcAssets
|
|
38
40
|
};
|
|
@@ -21,6 +21,7 @@ var chainflipAssets = [
|
|
|
21
21
|
"HubUsdc"
|
|
22
22
|
];
|
|
23
23
|
var assetSymbols = ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
|
|
24
|
+
var priceAssets = ["Btc", "Eth", "Sol", "Usdc", "Usdt", "Usd"];
|
|
24
25
|
var rpcAssets = assetSymbols;
|
|
25
26
|
var baseChainflipAssets = chainflipAssets.filter(
|
|
26
27
|
(asset) => asset !== "Usdc"
|
|
@@ -260,6 +261,7 @@ function getInternalAssets({
|
|
|
260
261
|
export {
|
|
261
262
|
chainflipAssets,
|
|
262
263
|
assetSymbols,
|
|
264
|
+
priceAssets,
|
|
263
265
|
rpcAssets,
|
|
264
266
|
baseChainflipAssets,
|
|
265
267
|
chainflipEvmChains,
|
package/dist/ss58.cjs
CHANGED
|
@@ -660,9 +660,6 @@ var BLAKE2b = class extends BLAKE2 {
|
|
|
660
660
|
};
|
|
661
661
|
var blake2b = /* @__PURE__ */ createOptHasher((opts) => new BLAKE2b(opts));
|
|
662
662
|
|
|
663
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/blake2b.js
|
|
664
|
-
var blake2b2 = blake2b;
|
|
665
|
-
|
|
666
663
|
// src/guard.ts
|
|
667
664
|
var createIsGuard = (type) => (value) => typeof value === type;
|
|
668
665
|
var isString = createIsGuard("string");
|
|
@@ -737,7 +734,7 @@ var MAX_PREFIX = 16383;
|
|
|
737
734
|
var RESERVED_PREFIXES = [46, 47];
|
|
738
735
|
var computeChecksum = (data) => {
|
|
739
736
|
const checksumPrefix = [83, 83, 53, 56, 80, 82, 69];
|
|
740
|
-
const checksum =
|
|
737
|
+
const checksum = blake2b(new Uint8Array([...checksumPrefix, ...data]));
|
|
741
738
|
return checksum.slice(0, CHECKSUM_BYTE_LENGTH);
|
|
742
739
|
};
|
|
743
740
|
var decode2 = (input) => {
|
package/dist/ss58.js
CHANGED
|
@@ -645,9 +645,6 @@ var BLAKE2b = class extends BLAKE2 {
|
|
|
645
645
|
};
|
|
646
646
|
var blake2b = /* @__PURE__ */ createOptHasher((opts) => new BLAKE2b(opts));
|
|
647
647
|
|
|
648
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/blake2b.js
|
|
649
|
-
var blake2b2 = blake2b;
|
|
650
|
-
|
|
651
648
|
// src/ss58.ts
|
|
652
649
|
var CHECKSUM_BYTE_LENGTH = 2;
|
|
653
650
|
var DATA_LENGTH = 32;
|
|
@@ -656,7 +653,7 @@ var MAX_PREFIX = 16383;
|
|
|
656
653
|
var RESERVED_PREFIXES = [46, 47];
|
|
657
654
|
var computeChecksum = (data) => {
|
|
658
655
|
const checksumPrefix = [83, 83, 53, 56, 80, 82, 69];
|
|
659
|
-
const checksum =
|
|
656
|
+
const checksum = blake2b(new Uint8Array([...checksumPrefix, ...data]));
|
|
660
657
|
return checksum.slice(0, CHECKSUM_BYTE_LENGTH);
|
|
661
658
|
};
|
|
662
659
|
var decode2 = (input) => {
|
package/dist/tickMath.js
CHANGED
package/dist/types.d.cts
CHANGED
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/utils",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@vitest/ui": "3.1.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@date-fns/utc": "^2.1.
|
|
33
|
+
"@date-fns/utc": "^2.1.1",
|
|
34
34
|
"bignumber.js": "^9.3.1",
|
|
35
35
|
"date-fns": "4.1.0"
|
|
36
36
|
},
|