@chainflip/utils 0.8.15 → 0.8.17
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 -20
- package/dist/chainflip.d.cts +3 -2
- package/dist/chainflip.d.ts +3 -2
- package/dist/chainflip.js +3 -3
- package/dist/{chunk-WGOAWQFT.js → chunk-DR3WTOBQ.js} +2 -19
- package/dist/consts.cjs +4 -0
- package/dist/consts.js +4 -0
- package/dist/tickMath.cjs +0 -18
- package/dist/tickMath.js +1 -1
- package/package.json +1 -1
package/dist/chainflip.cjs
CHANGED
|
@@ -35,7 +35,7 @@ __export(chainflip_exports, {
|
|
|
35
35
|
getInternalAssets: () => getInternalAssets,
|
|
36
36
|
internalAssetToRpcAsset: () => internalAssetToRpcAsset,
|
|
37
37
|
isValidAssetAndChain: () => isValidAssetAndChain,
|
|
38
|
-
|
|
38
|
+
priceAssets: () => priceAssets,
|
|
39
39
|
readAssetValue: () => readAssetValue,
|
|
40
40
|
rpcAssets: () => rpcAssets
|
|
41
41
|
});
|
|
@@ -62,6 +62,7 @@ var chainflipAssets = [
|
|
|
62
62
|
"HubUsdc"
|
|
63
63
|
];
|
|
64
64
|
var assetSymbols = ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
|
|
65
|
+
var priceAssets = ["Btc", "Eth", "Sol", "Usdc", "Usdt", "Usd"];
|
|
65
66
|
var rpcAssets = assetSymbols;
|
|
66
67
|
var baseChainflipAssets = chainflipAssets.filter(
|
|
67
68
|
(asset) => asset !== "Usdc"
|
|
@@ -80,24 +81,6 @@ function readAssetValue(map, asset) {
|
|
|
80
81
|
const chainValues = map[assetConstants[asset].chain];
|
|
81
82
|
return chainValues[assetConstants[asset].symbol];
|
|
82
83
|
}
|
|
83
|
-
function requireAllChainflipAssets(assets) {
|
|
84
|
-
return assets;
|
|
85
|
-
}
|
|
86
|
-
var orderedChainflipAssets = requireAllChainflipAssets([
|
|
87
|
-
"Btc",
|
|
88
|
-
"Eth",
|
|
89
|
-
"Sol",
|
|
90
|
-
"Usdt",
|
|
91
|
-
"Usdc",
|
|
92
|
-
"Flip",
|
|
93
|
-
"SolUsdc",
|
|
94
|
-
"ArbUsdc",
|
|
95
|
-
"ArbEth",
|
|
96
|
-
"Dot",
|
|
97
|
-
"HubDot",
|
|
98
|
-
"HubUsdt",
|
|
99
|
-
"HubUsdc"
|
|
100
|
-
]);
|
|
101
84
|
var assetConstants = {
|
|
102
85
|
Eth: {
|
|
103
86
|
chain: "Ethereum",
|
|
@@ -332,7 +315,7 @@ function getInternalAssets({
|
|
|
332
315
|
getInternalAssets,
|
|
333
316
|
internalAssetToRpcAsset,
|
|
334
317
|
isValidAssetAndChain,
|
|
335
|
-
|
|
318
|
+
priceAssets,
|
|
336
319
|
readAssetValue,
|
|
337
320
|
rpcAssets
|
|
338
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];
|
|
@@ -54,7 +56,6 @@ type UncheckedAssetAndChain = {
|
|
|
54
56
|
declare function readAssetValue<T>(map: ChainAssetMap<T>, asset: ChainflipAsset | BaseChainflipAsset): T;
|
|
55
57
|
declare function readAssetValue<T>(map: BaseChainAssetMap<T>, asset: BaseChainflipAsset): T;
|
|
56
58
|
declare function readAssetValue<T>(map: ChainAssetMap<T> | BaseChainAssetMap<T>, asset: BaseChainflipAsset): T;
|
|
57
|
-
declare const orderedChainflipAssets: ("Usdc" | "Usdt" | "Flip" | "Eth" | "Dot" | "Btc" | "ArbUsdc" | "ArbEth" | "Sol" | "SolUsdc" | "HubDot" | "HubUsdt" | "HubUsdc")[];
|
|
58
59
|
declare const assetConstants: {
|
|
59
60
|
readonly Eth: {
|
|
60
61
|
readonly chain: "Ethereum";
|
|
@@ -222,4 +223,4 @@ declare function getInternalAssets(data: {
|
|
|
222
223
|
destAsset: ChainflipAsset | null;
|
|
223
224
|
};
|
|
224
225
|
|
|
225
|
-
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,
|
|
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];
|
|
@@ -54,7 +56,6 @@ type UncheckedAssetAndChain = {
|
|
|
54
56
|
declare function readAssetValue<T>(map: ChainAssetMap<T>, asset: ChainflipAsset | BaseChainflipAsset): T;
|
|
55
57
|
declare function readAssetValue<T>(map: BaseChainAssetMap<T>, asset: BaseChainflipAsset): T;
|
|
56
58
|
declare function readAssetValue<T>(map: ChainAssetMap<T> | BaseChainAssetMap<T>, asset: BaseChainflipAsset): T;
|
|
57
|
-
declare const orderedChainflipAssets: ("Usdc" | "Usdt" | "Flip" | "Eth" | "Dot" | "Btc" | "ArbUsdc" | "ArbEth" | "Sol" | "SolUsdc" | "HubDot" | "HubUsdt" | "HubUsdc")[];
|
|
58
59
|
declare const assetConstants: {
|
|
59
60
|
readonly Eth: {
|
|
60
61
|
readonly chain: "Ethereum";
|
|
@@ -222,4 +223,4 @@ declare function getInternalAssets(data: {
|
|
|
222
223
|
destAsset: ChainflipAsset | null;
|
|
223
224
|
};
|
|
224
225
|
|
|
225
|
-
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,
|
|
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,10 +14,10 @@ import {
|
|
|
14
14
|
getInternalAssets,
|
|
15
15
|
internalAssetToRpcAsset,
|
|
16
16
|
isValidAssetAndChain,
|
|
17
|
-
|
|
17
|
+
priceAssets,
|
|
18
18
|
readAssetValue,
|
|
19
19
|
rpcAssets
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DR3WTOBQ.js";
|
|
21
21
|
export {
|
|
22
22
|
addressTypes,
|
|
23
23
|
assetConstants,
|
|
@@ -34,7 +34,7 @@ export {
|
|
|
34
34
|
getInternalAssets,
|
|
35
35
|
internalAssetToRpcAsset,
|
|
36
36
|
isValidAssetAndChain,
|
|
37
|
-
|
|
37
|
+
priceAssets,
|
|
38
38
|
readAssetValue,
|
|
39
39
|
rpcAssets
|
|
40
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"
|
|
@@ -39,24 +40,6 @@ function readAssetValue(map, asset) {
|
|
|
39
40
|
const chainValues = map[assetConstants[asset].chain];
|
|
40
41
|
return chainValues[assetConstants[asset].symbol];
|
|
41
42
|
}
|
|
42
|
-
function requireAllChainflipAssets(assets) {
|
|
43
|
-
return assets;
|
|
44
|
-
}
|
|
45
|
-
var orderedChainflipAssets = requireAllChainflipAssets([
|
|
46
|
-
"Btc",
|
|
47
|
-
"Eth",
|
|
48
|
-
"Sol",
|
|
49
|
-
"Usdt",
|
|
50
|
-
"Usdc",
|
|
51
|
-
"Flip",
|
|
52
|
-
"SolUsdc",
|
|
53
|
-
"ArbUsdc",
|
|
54
|
-
"ArbEth",
|
|
55
|
-
"Dot",
|
|
56
|
-
"HubDot",
|
|
57
|
-
"HubUsdt",
|
|
58
|
-
"HubUsdc"
|
|
59
|
-
]);
|
|
60
43
|
var assetConstants = {
|
|
61
44
|
Eth: {
|
|
62
45
|
chain: "Ethereum",
|
|
@@ -278,6 +261,7 @@ function getInternalAssets({
|
|
|
278
261
|
export {
|
|
279
262
|
chainflipAssets,
|
|
280
263
|
assetSymbols,
|
|
264
|
+
priceAssets,
|
|
281
265
|
rpcAssets,
|
|
282
266
|
baseChainflipAssets,
|
|
283
267
|
chainflipEvmChains,
|
|
@@ -285,7 +269,6 @@ export {
|
|
|
285
269
|
chainflipNetworks,
|
|
286
270
|
addressTypes,
|
|
287
271
|
readAssetValue,
|
|
288
|
-
orderedChainflipAssets,
|
|
289
272
|
assetConstants,
|
|
290
273
|
chainConstants,
|
|
291
274
|
internalAssetToRpcAsset,
|
package/dist/consts.cjs
CHANGED
|
@@ -60,6 +60,10 @@ var brokerAliasMap = {
|
|
|
60
60
|
name: "Chainflip Swapping",
|
|
61
61
|
twitter: "@Chainflip"
|
|
62
62
|
},
|
|
63
|
+
cFJySAo3RbrtKWWb9J86jqnfTjpDCXAQ4bcJR9kt6S37i7eey: {
|
|
64
|
+
name: "swap.chainflip.io",
|
|
65
|
+
twitter: "@Chainflip"
|
|
66
|
+
},
|
|
63
67
|
cFN1AfNQBEBCkuNAV37WWw34bCAdiW5e5sHTY4LaaRWiBSh7B: {
|
|
64
68
|
name: "BlockSwap",
|
|
65
69
|
twitter: "@BlockswapBot"
|
package/dist/consts.js
CHANGED
|
@@ -26,6 +26,10 @@ var brokerAliasMap = {
|
|
|
26
26
|
name: "Chainflip Swapping",
|
|
27
27
|
twitter: "@Chainflip"
|
|
28
28
|
},
|
|
29
|
+
cFJySAo3RbrtKWWb9J86jqnfTjpDCXAQ4bcJR9kt6S37i7eey: {
|
|
30
|
+
name: "swap.chainflip.io",
|
|
31
|
+
twitter: "@Chainflip"
|
|
32
|
+
},
|
|
29
33
|
cFN1AfNQBEBCkuNAV37WWw34bCAdiW5e5sHTY4LaaRWiBSh7B: {
|
|
30
34
|
name: "BlockSwap",
|
|
31
35
|
twitter: "@BlockswapBot"
|
package/dist/tickMath.cjs
CHANGED
|
@@ -74,24 +74,6 @@ var chainflipChains = [
|
|
|
74
74
|
"Solana",
|
|
75
75
|
"Assethub"
|
|
76
76
|
];
|
|
77
|
-
function requireAllChainflipAssets(assets) {
|
|
78
|
-
return assets;
|
|
79
|
-
}
|
|
80
|
-
var orderedChainflipAssets = requireAllChainflipAssets([
|
|
81
|
-
"Btc",
|
|
82
|
-
"Eth",
|
|
83
|
-
"Sol",
|
|
84
|
-
"Usdt",
|
|
85
|
-
"Usdc",
|
|
86
|
-
"Flip",
|
|
87
|
-
"SolUsdc",
|
|
88
|
-
"ArbUsdc",
|
|
89
|
-
"ArbEth",
|
|
90
|
-
"Dot",
|
|
91
|
-
"HubDot",
|
|
92
|
-
"HubUsdt",
|
|
93
|
-
"HubUsdc"
|
|
94
|
-
]);
|
|
95
77
|
var assetConstants = {
|
|
96
78
|
Eth: {
|
|
97
79
|
chain: "Ethereum",
|
package/dist/tickMath.js
CHANGED