@paraspell/assets 11.4.2 → 11.5.0

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 CHANGED
@@ -4909,8 +4909,8 @@ var IntegriteeKusama = {
4909
4909
  nativeAssetSymbol: "TEER",
4910
4910
  isEVM: false,
4911
4911
  ss58Prefix: 13,
4912
- supportsDryRunApi: false,
4913
- supportsXcmPaymentApi: false,
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 (_asset = asset) !== null && _asset !== void 0 && _asset.existentialDeposit ? BigInt(asset.existentialDeposit) : null;
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
- if (ed === null) {
18048
- throw new InvalidCurrencyError("Existential deposit not found for currency ".concat(JSON.stringify(currency, sdkCommon.replaceBigInt), " on chain ").concat(chain, "."));
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
 
@@ -18336,6 +18346,7 @@ exports.ForeignAbstract = ForeignAbstract;
18336
18346
  exports.InvalidCurrencyError = InvalidCurrencyError;
18337
18347
  exports.Native = Native;
18338
18348
  exports.Override = Override;
18349
+ exports.assertEdDefined = assertEdDefined;
18339
18350
  exports.compareLocations = compareLocations;
18340
18351
  exports.extractAssetLocation = extractAssetLocation;
18341
18352
  exports.filterEthCompatibleAssets = filterEthCompatibleAssets;
@@ -18355,6 +18366,7 @@ exports.getAssetId = getAssetId;
18355
18366
  exports.getAssetLocation = getAssetLocation;
18356
18367
  exports.getAssets = getAssets;
18357
18368
  exports.getAssetsObject = getAssetsObject;
18369
+ exports.getEdFromAssetOrThrow = getEdFromAssetOrThrow;
18358
18370
  exports.getExistentialDeposit = getExistentialDeposit;
18359
18371
  exports.getExistentialDepositOrThrow = getExistentialDepositOrThrow;
18360
18372
  exports.getFeeAssets = getFeeAssets;
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
 
@@ -293,5 +295,5 @@ declare const extractAssetLocation: <T = bigint>(asset: TAsset<T>) => TLocation;
293
295
 
294
296
  declare const getAssetLocation: (chain: TChain, currency: TCurrencyInput) => TLocation | null;
295
297
 
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 };
298
+ 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, isChainEvm, isForeignAsset, isOverrideLocationSpecifier, isSymbolMatch, isSymbolSpecifier, isTAsset, normalizeLocation, normalizeSymbol };
297
299
  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: false,
4911
- supportsXcmPaymentApi: false,
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 (_asset = asset) !== null && _asset !== void 0 && _asset.existentialDeposit ? BigInt(asset.existentialDeposit) : null;
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
- if (ed === null) {
18046
- throw new InvalidCurrencyError("Existential deposit not found for currency ".concat(JSON.stringify(currency, replaceBigInt), " on chain ").concat(chain, "."));
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
 
@@ -18327,4 +18337,4 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
18327
18337
  return asset1.symbol.toLowerCase() === asset2.symbol.toLowerCase();
18328
18338
  };
18329
18339
 
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 };
18340
+ 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, 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.4.2",
3
+ "version": "11.5.0",
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.4.2"
26
+ "@paraspell/sdk-common": "11.5.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@babel/plugin-syntax-import-attributes": "^7.27.1",