@chainflip/utils 2.1.2-beta.1 → 2.1.2-beta.2
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 +12 -8
- package/dist/chainflip.d.cts +44 -2
- package/dist/chainflip.d.mts +44 -2
- package/dist/chainflip.mjs +12 -9
- package/package.json +1 -1
package/dist/chainflip.cjs
CHANGED
|
@@ -167,14 +167,6 @@ const chainConstants = {
|
|
|
167
167
|
addressType: "Eth",
|
|
168
168
|
blockTimeSeconds: 12
|
|
169
169
|
},
|
|
170
|
-
Polkadot: {
|
|
171
|
-
chainflipAssets: ["Dot"],
|
|
172
|
-
assets: ["DOT"],
|
|
173
|
-
rpcAssets: ["DOT"],
|
|
174
|
-
gasAsset: "Dot",
|
|
175
|
-
addressType: "Dot",
|
|
176
|
-
blockTimeSeconds: 6
|
|
177
|
-
},
|
|
178
170
|
Bitcoin: {
|
|
179
171
|
chainflipAssets: ["Btc"],
|
|
180
172
|
assets: ["BTC"],
|
|
@@ -244,6 +236,17 @@ const chainConstants = {
|
|
|
244
236
|
blockTimeSeconds: 12
|
|
245
237
|
}
|
|
246
238
|
};
|
|
239
|
+
const anyChainConstants = {
|
|
240
|
+
...chainConstants,
|
|
241
|
+
Polkadot: {
|
|
242
|
+
chainflipAssets: ["Dot"],
|
|
243
|
+
assets: ["DOT"],
|
|
244
|
+
rpcAssets: ["DOT"],
|
|
245
|
+
gasAsset: "Dot",
|
|
246
|
+
addressType: "Dot",
|
|
247
|
+
blockTimeSeconds: 6
|
|
248
|
+
}
|
|
249
|
+
};
|
|
247
250
|
const internalAssetToRpcAsset = {
|
|
248
251
|
Eth: {
|
|
249
252
|
chain: "Ethereum",
|
|
@@ -418,6 +421,7 @@ function isAnyChainflipAsset(asset) {
|
|
|
418
421
|
//#endregion
|
|
419
422
|
exports.addressTypes = addressTypes;
|
|
420
423
|
exports.anyAssetConstants = anyAssetConstants;
|
|
424
|
+
exports.anyChainConstants = anyChainConstants;
|
|
421
425
|
exports.anyInternalAssetToRpcAsset = anyInternalAssetToRpcAsset;
|
|
422
426
|
exports.assetConstants = assetConstants;
|
|
423
427
|
exports.assetContractId = assetContractId;
|
package/dist/chainflip.d.cts
CHANGED
|
@@ -25,7 +25,7 @@ declare const legacyAddressTypes: readonly ["Dot"];
|
|
|
25
25
|
type LegacyAddressType = (typeof legacyAddressTypes)[number];
|
|
26
26
|
type AnyAddressType = AddressType | LegacyAddressType;
|
|
27
27
|
type AssetOfChain<C extends ChainflipChain> = (typeof chainConstants)[C]['assets'][number];
|
|
28
|
-
type AnyAssetOfChain<C extends AnyChainflipChain> = (typeof
|
|
28
|
+
type AnyAssetOfChain<C extends AnyChainflipChain> = (typeof anyChainConstants)[C]['assets'][number];
|
|
29
29
|
type ChainAssetMap<T> = { [C in ChainflipChain]: { [A in AssetOfChain<C>]: T } };
|
|
30
30
|
type AnyChainAssetMap<T> = { [C in AnyChainflipChain]: { [A in AnyAssetOfChain<C>]: T } };
|
|
31
31
|
type BaseChainAssetMap<T> = { [C in ChainflipChain]: { [A in BaseChainflipAsset as Extract<(typeof assetConstants)[A], {
|
|
@@ -235,6 +235,40 @@ declare const chainConstants: {
|
|
|
235
235
|
readonly addressType: "Eth";
|
|
236
236
|
readonly blockTimeSeconds: 12;
|
|
237
237
|
};
|
|
238
|
+
readonly Bitcoin: {
|
|
239
|
+
readonly chainflipAssets: ["Btc"];
|
|
240
|
+
readonly assets: ["BTC"];
|
|
241
|
+
readonly rpcAssets: ["BTC"];
|
|
242
|
+
readonly gasAsset: "Btc";
|
|
243
|
+
readonly addressType: "Btc";
|
|
244
|
+
readonly blockTimeSeconds: number;
|
|
245
|
+
};
|
|
246
|
+
readonly Arbitrum: {
|
|
247
|
+
readonly chainflipAssets: ["ArbUsdc", "ArbUsdt", "ArbEth"];
|
|
248
|
+
readonly assets: ["USDC", "USDT", "ETH"];
|
|
249
|
+
readonly rpcAssets: ["USDC", "USDT", "ETH"];
|
|
250
|
+
readonly gasAsset: "ArbEth";
|
|
251
|
+
readonly addressType: "Arb";
|
|
252
|
+
readonly blockTimeSeconds: 0.26;
|
|
253
|
+
};
|
|
254
|
+
readonly Solana: {
|
|
255
|
+
readonly chainflipAssets: ["Sol", "SolUsdc", "SolUsdt"];
|
|
256
|
+
readonly assets: ["SOL", "USDC", "USDT"];
|
|
257
|
+
readonly rpcAssets: ["SOL", "USDC", "USDT"];
|
|
258
|
+
readonly gasAsset: "Sol";
|
|
259
|
+
readonly addressType: "Sol";
|
|
260
|
+
readonly blockTimeSeconds: 0.8;
|
|
261
|
+
};
|
|
262
|
+
readonly Assethub: {
|
|
263
|
+
readonly chainflipAssets: ["HubDot", "HubUsdt", "HubUsdc"];
|
|
264
|
+
readonly assets: ["DOT", "USDT", "USDC"];
|
|
265
|
+
readonly rpcAssets: ["DOT", "USDT", "USDC"];
|
|
266
|
+
readonly gasAsset: "HubDot";
|
|
267
|
+
readonly addressType: "Hub";
|
|
268
|
+
readonly blockTimeSeconds: 12;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
declare const anyChainConstants: {
|
|
238
272
|
readonly Polkadot: {
|
|
239
273
|
readonly chainflipAssets: ["Dot"];
|
|
240
274
|
readonly assets: ["DOT"];
|
|
@@ -243,6 +277,14 @@ declare const chainConstants: {
|
|
|
243
277
|
readonly addressType: "Dot";
|
|
244
278
|
readonly blockTimeSeconds: 6;
|
|
245
279
|
};
|
|
280
|
+
readonly Ethereum: {
|
|
281
|
+
readonly chainflipAssets: ["Eth", "Flip", "Usdc", "Usdt", "Wbtc"];
|
|
282
|
+
readonly assets: ["ETH", "FLIP", "USDC", "USDT", "WBTC"];
|
|
283
|
+
readonly rpcAssets: ["ETH", "FLIP", "USDC", "USDT", "WBTC"];
|
|
284
|
+
readonly gasAsset: "Eth";
|
|
285
|
+
readonly addressType: "Eth";
|
|
286
|
+
readonly blockTimeSeconds: 12;
|
|
287
|
+
};
|
|
246
288
|
readonly Bitcoin: {
|
|
247
289
|
readonly chainflipAssets: ["Btc"];
|
|
248
290
|
readonly assets: ["BTC"];
|
|
@@ -321,4 +363,4 @@ declare function isChainflipAsset(asset: string): asset is ChainflipAsset;
|
|
|
321
363
|
declare function isLegacyChainflipAsset(asset: string): asset is LegacyChainflipAsset;
|
|
322
364
|
declare function isAnyChainflipAsset(asset: string): asset is AnyChainflipAsset;
|
|
323
365
|
//#endregion
|
|
324
|
-
export { AddressType, AnyAddressType, AnyAssetAndChain, AnyAssetOfChain, AnyBaseAssetAndChain, AnyBaseChainAssetMap, AnyBaseChainflipAsset, AnyChainAssetMap, AnyChainMap, AnyChainflipAsset, AnyChainflipChain, AnyInternalAssetMap, AnyUncheckedAssetAndChain, AssetAndChain, AssetOfChain, AssetSymbol, BaseAssetAndChain, BaseChainAssetMap, BaseChainflipAsset, ChainAssetMap, ChainMap, ChainflipAsset, ChainflipChain, ChainflipEvmChain, ChainflipNetwork, InternalAssetMap, LegacyAddressType, LegacyChainflipAsset, LegacyChainflipChain, NonDeprecatedBaseChainflipAsset, PriceAsset, UncheckedAssetAndChain, addressTypes, anyAssetConstants, anyInternalAssetToRpcAsset, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssetToPriceAssetMap, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getAnyInternalAsset, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isAnyChainflipAsset, isChainflipAsset, isLegacyChainflipAsset, isValidAssetAndChain, legacyAddressTypes, legacyChainflipAssets, legacyChainflipChains, priceAssets, readAssetValue };
|
|
366
|
+
export { AddressType, AnyAddressType, AnyAssetAndChain, AnyAssetOfChain, AnyBaseAssetAndChain, AnyBaseChainAssetMap, AnyBaseChainflipAsset, AnyChainAssetMap, AnyChainMap, AnyChainflipAsset, AnyChainflipChain, AnyInternalAssetMap, AnyUncheckedAssetAndChain, AssetAndChain, AssetOfChain, AssetSymbol, BaseAssetAndChain, BaseChainAssetMap, BaseChainflipAsset, ChainAssetMap, ChainMap, ChainflipAsset, ChainflipChain, ChainflipEvmChain, ChainflipNetwork, InternalAssetMap, LegacyAddressType, LegacyChainflipAsset, LegacyChainflipChain, NonDeprecatedBaseChainflipAsset, PriceAsset, UncheckedAssetAndChain, addressTypes, anyAssetConstants, anyChainConstants, anyInternalAssetToRpcAsset, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssetToPriceAssetMap, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getAnyInternalAsset, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isAnyChainflipAsset, isChainflipAsset, isLegacyChainflipAsset, isValidAssetAndChain, legacyAddressTypes, legacyChainflipAssets, legacyChainflipChains, priceAssets, readAssetValue };
|
package/dist/chainflip.d.mts
CHANGED
|
@@ -25,7 +25,7 @@ declare const legacyAddressTypes: readonly ["Dot"];
|
|
|
25
25
|
type LegacyAddressType = (typeof legacyAddressTypes)[number];
|
|
26
26
|
type AnyAddressType = AddressType | LegacyAddressType;
|
|
27
27
|
type AssetOfChain<C extends ChainflipChain> = (typeof chainConstants)[C]['assets'][number];
|
|
28
|
-
type AnyAssetOfChain<C extends AnyChainflipChain> = (typeof
|
|
28
|
+
type AnyAssetOfChain<C extends AnyChainflipChain> = (typeof anyChainConstants)[C]['assets'][number];
|
|
29
29
|
type ChainAssetMap<T> = { [C in ChainflipChain]: { [A in AssetOfChain<C>]: T } };
|
|
30
30
|
type AnyChainAssetMap<T> = { [C in AnyChainflipChain]: { [A in AnyAssetOfChain<C>]: T } };
|
|
31
31
|
type BaseChainAssetMap<T> = { [C in ChainflipChain]: { [A in BaseChainflipAsset as Extract<(typeof assetConstants)[A], {
|
|
@@ -235,6 +235,40 @@ declare const chainConstants: {
|
|
|
235
235
|
readonly addressType: "Eth";
|
|
236
236
|
readonly blockTimeSeconds: 12;
|
|
237
237
|
};
|
|
238
|
+
readonly Bitcoin: {
|
|
239
|
+
readonly chainflipAssets: ["Btc"];
|
|
240
|
+
readonly assets: ["BTC"];
|
|
241
|
+
readonly rpcAssets: ["BTC"];
|
|
242
|
+
readonly gasAsset: "Btc";
|
|
243
|
+
readonly addressType: "Btc";
|
|
244
|
+
readonly blockTimeSeconds: number;
|
|
245
|
+
};
|
|
246
|
+
readonly Arbitrum: {
|
|
247
|
+
readonly chainflipAssets: ["ArbUsdc", "ArbUsdt", "ArbEth"];
|
|
248
|
+
readonly assets: ["USDC", "USDT", "ETH"];
|
|
249
|
+
readonly rpcAssets: ["USDC", "USDT", "ETH"];
|
|
250
|
+
readonly gasAsset: "ArbEth";
|
|
251
|
+
readonly addressType: "Arb";
|
|
252
|
+
readonly blockTimeSeconds: 0.26;
|
|
253
|
+
};
|
|
254
|
+
readonly Solana: {
|
|
255
|
+
readonly chainflipAssets: ["Sol", "SolUsdc", "SolUsdt"];
|
|
256
|
+
readonly assets: ["SOL", "USDC", "USDT"];
|
|
257
|
+
readonly rpcAssets: ["SOL", "USDC", "USDT"];
|
|
258
|
+
readonly gasAsset: "Sol";
|
|
259
|
+
readonly addressType: "Sol";
|
|
260
|
+
readonly blockTimeSeconds: 0.8;
|
|
261
|
+
};
|
|
262
|
+
readonly Assethub: {
|
|
263
|
+
readonly chainflipAssets: ["HubDot", "HubUsdt", "HubUsdc"];
|
|
264
|
+
readonly assets: ["DOT", "USDT", "USDC"];
|
|
265
|
+
readonly rpcAssets: ["DOT", "USDT", "USDC"];
|
|
266
|
+
readonly gasAsset: "HubDot";
|
|
267
|
+
readonly addressType: "Hub";
|
|
268
|
+
readonly blockTimeSeconds: 12;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
declare const anyChainConstants: {
|
|
238
272
|
readonly Polkadot: {
|
|
239
273
|
readonly chainflipAssets: ["Dot"];
|
|
240
274
|
readonly assets: ["DOT"];
|
|
@@ -243,6 +277,14 @@ declare const chainConstants: {
|
|
|
243
277
|
readonly addressType: "Dot";
|
|
244
278
|
readonly blockTimeSeconds: 6;
|
|
245
279
|
};
|
|
280
|
+
readonly Ethereum: {
|
|
281
|
+
readonly chainflipAssets: ["Eth", "Flip", "Usdc", "Usdt", "Wbtc"];
|
|
282
|
+
readonly assets: ["ETH", "FLIP", "USDC", "USDT", "WBTC"];
|
|
283
|
+
readonly rpcAssets: ["ETH", "FLIP", "USDC", "USDT", "WBTC"];
|
|
284
|
+
readonly gasAsset: "Eth";
|
|
285
|
+
readonly addressType: "Eth";
|
|
286
|
+
readonly blockTimeSeconds: 12;
|
|
287
|
+
};
|
|
246
288
|
readonly Bitcoin: {
|
|
247
289
|
readonly chainflipAssets: ["Btc"];
|
|
248
290
|
readonly assets: ["BTC"];
|
|
@@ -321,4 +363,4 @@ declare function isChainflipAsset(asset: string): asset is ChainflipAsset;
|
|
|
321
363
|
declare function isLegacyChainflipAsset(asset: string): asset is LegacyChainflipAsset;
|
|
322
364
|
declare function isAnyChainflipAsset(asset: string): asset is AnyChainflipAsset;
|
|
323
365
|
//#endregion
|
|
324
|
-
export { AddressType, AnyAddressType, AnyAssetAndChain, AnyAssetOfChain, AnyBaseAssetAndChain, AnyBaseChainAssetMap, AnyBaseChainflipAsset, AnyChainAssetMap, AnyChainMap, AnyChainflipAsset, AnyChainflipChain, AnyInternalAssetMap, AnyUncheckedAssetAndChain, AssetAndChain, AssetOfChain, AssetSymbol, BaseAssetAndChain, BaseChainAssetMap, BaseChainflipAsset, ChainAssetMap, ChainMap, ChainflipAsset, ChainflipChain, ChainflipEvmChain, ChainflipNetwork, InternalAssetMap, LegacyAddressType, LegacyChainflipAsset, LegacyChainflipChain, NonDeprecatedBaseChainflipAsset, PriceAsset, UncheckedAssetAndChain, addressTypes, anyAssetConstants, anyInternalAssetToRpcAsset, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssetToPriceAssetMap, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getAnyInternalAsset, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isAnyChainflipAsset, isChainflipAsset, isLegacyChainflipAsset, isValidAssetAndChain, legacyAddressTypes, legacyChainflipAssets, legacyChainflipChains, priceAssets, readAssetValue };
|
|
366
|
+
export { AddressType, AnyAddressType, AnyAssetAndChain, AnyAssetOfChain, AnyBaseAssetAndChain, AnyBaseChainAssetMap, AnyBaseChainflipAsset, AnyChainAssetMap, AnyChainMap, AnyChainflipAsset, AnyChainflipChain, AnyInternalAssetMap, AnyUncheckedAssetAndChain, AssetAndChain, AssetOfChain, AssetSymbol, BaseAssetAndChain, BaseChainAssetMap, BaseChainflipAsset, ChainAssetMap, ChainMap, ChainflipAsset, ChainflipChain, ChainflipEvmChain, ChainflipNetwork, InternalAssetMap, LegacyAddressType, LegacyChainflipAsset, LegacyChainflipChain, NonDeprecatedBaseChainflipAsset, PriceAsset, UncheckedAssetAndChain, addressTypes, anyAssetConstants, anyChainConstants, anyInternalAssetToRpcAsset, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssetToPriceAssetMap, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getAnyInternalAsset, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isAnyChainflipAsset, isChainflipAsset, isLegacyChainflipAsset, isValidAssetAndChain, legacyAddressTypes, legacyChainflipAssets, legacyChainflipChains, priceAssets, readAssetValue };
|
package/dist/chainflip.mjs
CHANGED
|
@@ -165,14 +165,6 @@ const chainConstants = {
|
|
|
165
165
|
addressType: "Eth",
|
|
166
166
|
blockTimeSeconds: 12
|
|
167
167
|
},
|
|
168
|
-
Polkadot: {
|
|
169
|
-
chainflipAssets: ["Dot"],
|
|
170
|
-
assets: ["DOT"],
|
|
171
|
-
rpcAssets: ["DOT"],
|
|
172
|
-
gasAsset: "Dot",
|
|
173
|
-
addressType: "Dot",
|
|
174
|
-
blockTimeSeconds: 6
|
|
175
|
-
},
|
|
176
168
|
Bitcoin: {
|
|
177
169
|
chainflipAssets: ["Btc"],
|
|
178
170
|
assets: ["BTC"],
|
|
@@ -242,6 +234,17 @@ const chainConstants = {
|
|
|
242
234
|
blockTimeSeconds: 12
|
|
243
235
|
}
|
|
244
236
|
};
|
|
237
|
+
const anyChainConstants = {
|
|
238
|
+
...chainConstants,
|
|
239
|
+
Polkadot: {
|
|
240
|
+
chainflipAssets: ["Dot"],
|
|
241
|
+
assets: ["DOT"],
|
|
242
|
+
rpcAssets: ["DOT"],
|
|
243
|
+
gasAsset: "Dot",
|
|
244
|
+
addressType: "Dot",
|
|
245
|
+
blockTimeSeconds: 6
|
|
246
|
+
}
|
|
247
|
+
};
|
|
245
248
|
const internalAssetToRpcAsset = {
|
|
246
249
|
Eth: {
|
|
247
250
|
chain: "Ethereum",
|
|
@@ -414,4 +417,4 @@ function isAnyChainflipAsset(asset) {
|
|
|
414
417
|
}
|
|
415
418
|
|
|
416
419
|
//#endregion
|
|
417
|
-
export { addressTypes, anyAssetConstants, anyInternalAssetToRpcAsset, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssetToPriceAssetMap, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getAnyInternalAsset, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isAnyChainflipAsset, isChainflipAsset, isLegacyChainflipAsset, isValidAssetAndChain, legacyAddressTypes, legacyChainflipAssets, legacyChainflipChains, priceAssets, readAssetValue };
|
|
420
|
+
export { addressTypes, anyAssetConstants, anyChainConstants, anyInternalAssetToRpcAsset, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssetToPriceAssetMap, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getAnyInternalAsset, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isAnyChainflipAsset, isChainflipAsset, isLegacyChainflipAsset, isValidAssetAndChain, legacyAddressTypes, legacyChainflipAssets, legacyChainflipChains, priceAssets, readAssetValue };
|