@paraspell/assets 11.4.2 → 11.5.1
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/index.cjs +28 -8
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +26 -9
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -4909,8 +4909,8 @@ var IntegriteeKusama = {
|
|
|
4909
4909
|
nativeAssetSymbol: "TEER",
|
|
4910
4910
|
isEVM: false,
|
|
4911
4911
|
ss58Prefix: 13,
|
|
4912
|
-
supportsDryRunApi:
|
|
4913
|
-
supportsXcmPaymentApi:
|
|
4912
|
+
supportsDryRunApi: true,
|
|
4913
|
+
supportsXcmPaymentApi: true,
|
|
4914
4914
|
nativeAssets: [
|
|
4915
4915
|
{
|
|
4916
4916
|
symbol: "TEER",
|
|
@@ -18020,6 +18020,9 @@ var findNativeAssetInfoOrThrow = function findNativeAssetInfoOrThrow(chain) {
|
|
|
18020
18020
|
return findAssetInfoOrThrow(chain, createSelection(chain), null);
|
|
18021
18021
|
};
|
|
18022
18022
|
|
|
18023
|
+
var extractEdFromAsset = function extractEdFromAsset(asset) {
|
|
18024
|
+
return asset.existentialDeposit ? BigInt(asset.existentialDeposit) : null;
|
|
18025
|
+
};
|
|
18023
18026
|
/**
|
|
18024
18027
|
* Retrieves the existential deposit value for a given chain.
|
|
18025
18028
|
*
|
|
@@ -18027,7 +18030,6 @@ var findNativeAssetInfoOrThrow = function findNativeAssetInfoOrThrow(chain) {
|
|
|
18027
18030
|
* @returns The existential deposit as a bigint if available; otherwise, null.
|
|
18028
18031
|
*/
|
|
18029
18032
|
var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
|
|
18030
|
-
var _asset;
|
|
18031
18033
|
var asset;
|
|
18032
18034
|
if (!currency) {
|
|
18033
18035
|
var _findAssetInfo;
|
|
@@ -18040,13 +18042,21 @@ var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
|
|
|
18040
18042
|
} else {
|
|
18041
18043
|
asset = findAssetInfoOrThrow(chain, currency, null);
|
|
18042
18044
|
}
|
|
18043
|
-
return (
|
|
18045
|
+
return extractEdFromAsset(asset);
|
|
18046
|
+
};
|
|
18047
|
+
var assertEdDefined = function assertEdDefined(ed, chain, currency) {
|
|
18048
|
+
if (ed === undefined || ed === null) {
|
|
18049
|
+
throw new InvalidCurrencyError("Existential deposit not found for currency ".concat(JSON.stringify(currency, sdkCommon.replaceBigInt)).concat(chain ? " on chain ".concat(chain, ".") : '.'));
|
|
18050
|
+
}
|
|
18044
18051
|
};
|
|
18045
18052
|
var getExistentialDepositOrThrow = function getExistentialDepositOrThrow(chain, currency) {
|
|
18046
18053
|
var ed = getExistentialDeposit(chain, currency);
|
|
18047
|
-
|
|
18048
|
-
|
|
18049
|
-
|
|
18054
|
+
assertEdDefined(ed, chain, currency);
|
|
18055
|
+
return ed;
|
|
18056
|
+
};
|
|
18057
|
+
var getEdFromAssetOrThrow = function getEdFromAssetOrThrow(asset) {
|
|
18058
|
+
var ed = extractEdFromAsset(asset);
|
|
18059
|
+
assertEdDefined(ed, undefined, asset);
|
|
18050
18060
|
return ed;
|
|
18051
18061
|
};
|
|
18052
18062
|
|
|
@@ -18326,7 +18336,14 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
|
|
|
18326
18336
|
var ml2 = asset2.location;
|
|
18327
18337
|
if (ml1 && ml2 && sdkCommon.deepEqual(ml1, ml2)) return true;
|
|
18328
18338
|
if (isForeignAsset(asset1) && isForeignAsset(asset2) && asset1.assetId === asset2.assetId) return true;
|
|
18329
|
-
return asset1.symbol
|
|
18339
|
+
return isSymbolMatch(asset1.symbol, asset2.symbol);
|
|
18340
|
+
};
|
|
18341
|
+
|
|
18342
|
+
var isAssetXcEqual = function isAssetXcEqual(asset1, asset2) {
|
|
18343
|
+
var ml1 = asset1.location;
|
|
18344
|
+
var ml2 = asset2.location;
|
|
18345
|
+
if (ml1 && ml2 && sdkCommon.deepEqual(ml1, ml2)) return true;
|
|
18346
|
+
return isSymbolMatch(asset1.symbol, asset2.symbol);
|
|
18330
18347
|
};
|
|
18331
18348
|
|
|
18332
18349
|
exports.DuplicateAssetError = DuplicateAssetError;
|
|
@@ -18336,6 +18353,7 @@ exports.ForeignAbstract = ForeignAbstract;
|
|
|
18336
18353
|
exports.InvalidCurrencyError = InvalidCurrencyError;
|
|
18337
18354
|
exports.Native = Native;
|
|
18338
18355
|
exports.Override = Override;
|
|
18356
|
+
exports.assertEdDefined = assertEdDefined;
|
|
18339
18357
|
exports.compareLocations = compareLocations;
|
|
18340
18358
|
exports.extractAssetLocation = extractAssetLocation;
|
|
18341
18359
|
exports.filterEthCompatibleAssets = filterEthCompatibleAssets;
|
|
@@ -18355,6 +18373,7 @@ exports.getAssetId = getAssetId;
|
|
|
18355
18373
|
exports.getAssetLocation = getAssetLocation;
|
|
18356
18374
|
exports.getAssets = getAssets;
|
|
18357
18375
|
exports.getAssetsObject = getAssetsObject;
|
|
18376
|
+
exports.getEdFromAssetOrThrow = getEdFromAssetOrThrow;
|
|
18358
18377
|
exports.getExistentialDeposit = getExistentialDeposit;
|
|
18359
18378
|
exports.getExistentialDepositOrThrow = getExistentialDepositOrThrow;
|
|
18360
18379
|
exports.getFeeAssets = getFeeAssets;
|
|
@@ -18368,6 +18387,7 @@ exports.hasDryRunSupport = hasDryRunSupport;
|
|
|
18368
18387
|
exports.hasSupportForAsset = hasSupportForAsset;
|
|
18369
18388
|
exports.hasXcmPaymentApiSupport = hasXcmPaymentApiSupport;
|
|
18370
18389
|
exports.isAssetEqual = isAssetEqual;
|
|
18390
|
+
exports.isAssetXcEqual = isAssetXcEqual;
|
|
18371
18391
|
exports.isChainEvm = isChainEvm;
|
|
18372
18392
|
exports.isForeignAsset = isForeignAsset;
|
|
18373
18393
|
exports.isOverrideLocationSpecifier = isOverrideLocationSpecifier;
|
package/dist/index.d.ts
CHANGED
|
@@ -100,7 +100,9 @@ type WithComplexAmount<TBase> = WithAmount<TBase, TAmount>;
|
|
|
100
100
|
* @returns The existential deposit as a bigint if available; otherwise, null.
|
|
101
101
|
*/
|
|
102
102
|
declare const getExistentialDeposit: (chain: TChain, currency?: TCurrencyCore) => bigint | null;
|
|
103
|
+
declare const assertEdDefined: (ed: bigint | null, chain?: TChain, currency?: TCurrencyCore) => asserts ed is bigint;
|
|
103
104
|
declare const getExistentialDepositOrThrow: (chain: TChain, currency?: TCurrencyCore) => bigint;
|
|
105
|
+
declare const getEdFromAssetOrThrow: (asset: TAssetInfo) => bigint;
|
|
104
106
|
|
|
105
107
|
declare const getFeeAssets: (chain: TChain) => Omit<TAssetInfo, "isFeeAsset">[];
|
|
106
108
|
|
|
@@ -201,6 +203,8 @@ declare const getSupportedDestinations: (origin: TChain, currency: TCurrencyCore
|
|
|
201
203
|
|
|
202
204
|
declare const isAssetEqual: (asset1: TAssetInfo, asset2: TAssetInfo) => boolean;
|
|
203
205
|
|
|
206
|
+
declare const isAssetXcEqual: (asset1: TAssetInfo, asset2: TAssetInfo) => boolean;
|
|
207
|
+
|
|
204
208
|
declare const isSymbolMatch: (symbolA: string, symbolB: string) => boolean;
|
|
205
209
|
|
|
206
210
|
/**
|
|
@@ -293,5 +297,5 @@ declare const extractAssetLocation: <T = bigint>(asset: TAsset<T>) => TLocation;
|
|
|
293
297
|
|
|
294
298
|
declare const getAssetLocation: (chain: TChain, currency: TCurrencyInput) => TLocation | null;
|
|
295
299
|
|
|
296
|
-
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, compareLocations, extractAssetLocation, filterEthCompatibleAssets, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoOnDest, findAssetInfoOrThrow, findAssetOnDestOrThrow, findBestMatches, findNativeAssetInfo, findNativeAssetInfoOrThrow, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetLocation, getAssets, getAssetsObject, getExistentialDeposit, getExistentialDepositOrThrow, getFeeAssets, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getSupportedDestinations, hasDryRunSupport, hasSupportForAsset, hasXcmPaymentApiSupport, isAssetEqual, isChainEvm, isForeignAsset, isOverrideLocationSpecifier, isSymbolMatch, isSymbolSpecifier, isTAsset, normalizeLocation, normalizeSymbol };
|
|
300
|
+
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, compareLocations, extractAssetLocation, filterEthCompatibleAssets, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoOnDest, findAssetInfoOrThrow, findAssetOnDestOrThrow, findBestMatches, findNativeAssetInfo, findNativeAssetInfoOrThrow, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetLocation, getAssets, getAssetsObject, getEdFromAssetOrThrow, getExistentialDeposit, getExistentialDepositOrThrow, getFeeAssets, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getSupportedDestinations, hasDryRunSupport, hasSupportForAsset, hasXcmPaymentApiSupport, isAssetEqual, isAssetXcEqual, isChainEvm, isForeignAsset, isOverrideLocationSpecifier, isSymbolMatch, isSymbolSpecifier, isTAsset, normalizeLocation, normalizeSymbol };
|
|
297
301
|
export type { TAmount, TAsset, TAssetInfo, TAssetJsonMap, TAssetV3, TAssetV4, TAssetWithFee, TAssetWithLocation, TChainAssetsInfo, TCurrency, TCurrencyCore, TCurrencyInput, TCurrencyInputWithAmount, TCurrencySymbol, TCurrencySymbolValue, TForeignAssetInfo, TForeignAssetWithId, TLocationValue, TLocationValueWithOverride, TNativeAssetInfo, TOverrideLocationSpecifier, TSymbolSpecifier, WithAmount, WithComplexAmount };
|
package/dist/index.mjs
CHANGED
|
@@ -4907,8 +4907,8 @@ var IntegriteeKusama = {
|
|
|
4907
4907
|
nativeAssetSymbol: "TEER",
|
|
4908
4908
|
isEVM: false,
|
|
4909
4909
|
ss58Prefix: 13,
|
|
4910
|
-
supportsDryRunApi:
|
|
4911
|
-
supportsXcmPaymentApi:
|
|
4910
|
+
supportsDryRunApi: true,
|
|
4911
|
+
supportsXcmPaymentApi: true,
|
|
4912
4912
|
nativeAssets: [
|
|
4913
4913
|
{
|
|
4914
4914
|
symbol: "TEER",
|
|
@@ -18018,6 +18018,9 @@ var findNativeAssetInfoOrThrow = function findNativeAssetInfoOrThrow(chain) {
|
|
|
18018
18018
|
return findAssetInfoOrThrow(chain, createSelection(chain), null);
|
|
18019
18019
|
};
|
|
18020
18020
|
|
|
18021
|
+
var extractEdFromAsset = function extractEdFromAsset(asset) {
|
|
18022
|
+
return asset.existentialDeposit ? BigInt(asset.existentialDeposit) : null;
|
|
18023
|
+
};
|
|
18021
18024
|
/**
|
|
18022
18025
|
* Retrieves the existential deposit value for a given chain.
|
|
18023
18026
|
*
|
|
@@ -18025,7 +18028,6 @@ var findNativeAssetInfoOrThrow = function findNativeAssetInfoOrThrow(chain) {
|
|
|
18025
18028
|
* @returns The existential deposit as a bigint if available; otherwise, null.
|
|
18026
18029
|
*/
|
|
18027
18030
|
var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
|
|
18028
|
-
var _asset;
|
|
18029
18031
|
var asset;
|
|
18030
18032
|
if (!currency) {
|
|
18031
18033
|
var _findAssetInfo;
|
|
@@ -18038,13 +18040,21 @@ var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
|
|
|
18038
18040
|
} else {
|
|
18039
18041
|
asset = findAssetInfoOrThrow(chain, currency, null);
|
|
18040
18042
|
}
|
|
18041
|
-
return (
|
|
18043
|
+
return extractEdFromAsset(asset);
|
|
18044
|
+
};
|
|
18045
|
+
var assertEdDefined = function assertEdDefined(ed, chain, currency) {
|
|
18046
|
+
if (ed === undefined || ed === null) {
|
|
18047
|
+
throw new InvalidCurrencyError("Existential deposit not found for currency ".concat(JSON.stringify(currency, replaceBigInt)).concat(chain ? " on chain ".concat(chain, ".") : '.'));
|
|
18048
|
+
}
|
|
18042
18049
|
};
|
|
18043
18050
|
var getExistentialDepositOrThrow = function getExistentialDepositOrThrow(chain, currency) {
|
|
18044
18051
|
var ed = getExistentialDeposit(chain, currency);
|
|
18045
|
-
|
|
18046
|
-
|
|
18047
|
-
|
|
18052
|
+
assertEdDefined(ed, chain, currency);
|
|
18053
|
+
return ed;
|
|
18054
|
+
};
|
|
18055
|
+
var getEdFromAssetOrThrow = function getEdFromAssetOrThrow(asset) {
|
|
18056
|
+
var ed = extractEdFromAsset(asset);
|
|
18057
|
+
assertEdDefined(ed, undefined, asset);
|
|
18048
18058
|
return ed;
|
|
18049
18059
|
};
|
|
18050
18060
|
|
|
@@ -18324,7 +18334,14 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
|
|
|
18324
18334
|
var ml2 = asset2.location;
|
|
18325
18335
|
if (ml1 && ml2 && deepEqual(ml1, ml2)) return true;
|
|
18326
18336
|
if (isForeignAsset(asset1) && isForeignAsset(asset2) && asset1.assetId === asset2.assetId) return true;
|
|
18327
|
-
return asset1.symbol
|
|
18337
|
+
return isSymbolMatch(asset1.symbol, asset2.symbol);
|
|
18338
|
+
};
|
|
18339
|
+
|
|
18340
|
+
var isAssetXcEqual = function isAssetXcEqual(asset1, asset2) {
|
|
18341
|
+
var ml1 = asset1.location;
|
|
18342
|
+
var ml2 = asset2.location;
|
|
18343
|
+
if (ml1 && ml2 && deepEqual(ml1, ml2)) return true;
|
|
18344
|
+
return isSymbolMatch(asset1.symbol, asset2.symbol);
|
|
18328
18345
|
};
|
|
18329
18346
|
|
|
18330
|
-
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, compareLocations, extractAssetLocation, filterEthCompatibleAssets, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoOnDest, findAssetInfoOrThrow, findAssetOnDestOrThrow, findBestMatches, findNativeAssetInfo, findNativeAssetInfoOrThrow, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetLocation, getAssets, getAssetsObject, getExistentialDeposit, getExistentialDepositOrThrow, getFeeAssets, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getSupportedDestinations, hasDryRunSupport, hasSupportForAsset, hasXcmPaymentApiSupport, isAssetEqual, isChainEvm, isForeignAsset, isOverrideLocationSpecifier, isSymbolMatch, isSymbolSpecifier, isTAsset, normalizeLocation, normalizeSymbol };
|
|
18347
|
+
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, compareLocations, extractAssetLocation, filterEthCompatibleAssets, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoOnDest, findAssetInfoOrThrow, findAssetOnDestOrThrow, findBestMatches, findNativeAssetInfo, findNativeAssetInfoOrThrow, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetLocation, getAssets, getAssetsObject, getEdFromAssetOrThrow, getExistentialDeposit, getExistentialDepositOrThrow, getFeeAssets, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getSupportedDestinations, hasDryRunSupport, hasSupportForAsset, hasXcmPaymentApiSupport, isAssetEqual, isAssetXcEqual, isChainEvm, isForeignAsset, isOverrideLocationSpecifier, isSymbolMatch, isSymbolSpecifier, isTAsset, normalizeLocation, normalizeSymbol };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/assets",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.1",
|
|
4
4
|
"description": "Assets for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@paraspell/sdk-common": "11.
|
|
26
|
+
"@paraspell/sdk-common": "11.5.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|