@paraspell/assets 12.9.6 → 13.0.0-rc.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.d.ts CHANGED
@@ -103,6 +103,8 @@ declare const isChainEvm: (chain: TChain) => boolean;
103
103
  /**
104
104
  * Retrieves the asset ID for a given symbol on a specified chain.
105
105
  *
106
+ * @deprecated Use `findAssetInfo` instead. Will be removed in v14.
107
+ *
106
108
  * @param chain - The chain to search for the asset.
107
109
  * @param symbol - The symbol of the asset.
108
110
  * @returns The asset ID if found; otherwise, null.
@@ -153,6 +155,8 @@ declare const getNativeAssetSymbol: (chain: TChain) => string;
153
155
  /**
154
156
  * Determines whether a specified chain supports an asset with the given symbol.
155
157
  *
158
+ * @deprecated Use `findAssetInfo` instead. Will be removed in v14.
159
+ *
156
160
  * @param chain - The chain to check for asset support.
157
161
  * @param symbol - The symbol of the asset to check.
158
162
  * @returns True if the asset is supported; otherwise, false.
@@ -161,6 +165,8 @@ declare const hasSupportForAsset: (chain: TChain, symbol: string) => boolean;
161
165
  /**
162
166
  * Retrieves the number of decimals for an asset with the given symbol on a specified chain.
163
167
  *
168
+ * @deprecated Use `findAssetInfo` instead. Will be removed in v14.
169
+ *
164
170
  * @param chain - The chain where the asset is located.
165
171
  * @param symbol - The symbol of the asset.
166
172
  * @returns The number of decimals if the asset is found; otherwise, null.
@@ -215,18 +221,18 @@ declare const normalizeLocation: (location: TLocation, version?: Version) => TLo
215
221
  */
216
222
  declare const normalizeSymbol: (symbol?: string) => string;
217
223
 
218
- declare const findAssetInfo: (chain: TChain, currency: TCurrencyInput, destination: TChain | null) => TAssetInfo | null;
224
+ declare const findAssetInfo: (chain: TChain, currency: TCurrencyInput, destination?: TChain | null) => TAssetInfo | null;
219
225
 
220
226
  declare const findAssetInfoById: (assets: TAssetInfo[], assetId: TCurrency) => TAssetInfo;
221
227
 
222
228
  declare const findAssetInfoByLoc: (foreignAssets: TAssetInfo[], location: string | TLocation) => TAssetInfo | undefined;
223
229
 
224
- declare const findAssetInfoBySymbol: (destination: TChain | null, otherAssets: TAssetInfo[], nativeAssets: TAssetInfo[], symbol: TCurrencySymbolValue) => TAssetInfo | undefined;
230
+ declare const findAssetInfoBySymbol: (otherAssets: TAssetInfo[], nativeAssets: TAssetInfo[], symbol: TCurrencySymbolValue, destination?: TChain) => TAssetInfo | undefined;
225
231
 
226
232
  declare const findAssetInfoOnDest: (origin: TChain, destination: TChain, currency: TCurrencyInput, originAsset?: TAssetInfo | null) => TAssetInfo | null;
227
233
  declare const findAssetOnDestOrThrow: (origin: TChain, destination: TChain, currency: TCurrencyInput) => TAssetInfo;
228
234
 
229
- declare const findAssetInfoOrThrow: (chain: TChain, currency: TCurrencyInput, destination: TChain | null) => TAssetInfo;
235
+ declare const findAssetInfoOrThrow: (chain: TChain, currency: TCurrencyInput, destination?: TChain | null) => TAssetInfo;
230
236
 
231
237
  declare const findBestMatches: (assets: TAssetInfo[], value: string, property?: "symbol" | "alias") => TAssetInfo[];
232
238
 
package/dist/index.mjs CHANGED
@@ -19485,7 +19485,7 @@ var extractAssetLocation = function extractAssetLocation(asset) {
19485
19485
 
19486
19486
  var getAssetLocation = function getAssetLocation(chain, currency) {
19487
19487
  var _asset$location;
19488
- var asset = findAssetInfo(chain, currency, null);
19488
+ var asset = findAssetInfo(chain, currency);
19489
19489
  return (_asset$location = asset === null || asset === void 0 ? void 0 : asset.location) !== null && _asset$location !== void 0 ? _asset$location : null;
19490
19490
  };
19491
19491
 
@@ -19630,7 +19630,7 @@ var throwIfDuplicate = function throwIfDuplicate(input, nativeMatches, otherMatc
19630
19630
  throwDuplicateAssetError(input, nativeMatches, otherMatches);
19631
19631
  }
19632
19632
  };
19633
- var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAssets, nativeAssets, symbol) {
19633
+ var findAssetInfoBySymbol = function findAssetInfoBySymbol(otherAssets, nativeAssets, symbol, destination) {
19634
19634
  var isSpecifier = isSymbolSpecifier(symbol);
19635
19635
  var assetsMatches = [];
19636
19636
  if (isSpecifier) {
@@ -19724,7 +19724,7 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
19724
19724
  var assets = [].concat(_toConsumableArray(nativeAssets), _toConsumableArray(otherAssets));
19725
19725
  var asset;
19726
19726
  if ('symbol' in currency) {
19727
- asset = findAssetInfoBySymbol(destination, otherAssets, nativeAssets, currency.symbol);
19727
+ asset = findAssetInfoBySymbol(otherAssets, nativeAssets, currency.symbol, destination !== null && destination !== void 0 ? destination : undefined);
19728
19728
  } else if ('location' in currency && !isOverrideLocationSpecifier(currency.location)) {
19729
19729
  asset = findAssetInfoByLoc(assets, currency.location);
19730
19730
  } else if ('id' in currency) {
@@ -19836,12 +19836,12 @@ var findAssetInfoOnDest = function findAssetInfoOnDest(origin, destination, curr
19836
19836
  if (isSb && isSystemAsset(resolvedOriginAsset)) {
19837
19837
  var match = findAssetInfo(destination, {
19838
19838
  symbol: resolvedOriginAsset.symbol
19839
- }, null);
19839
+ });
19840
19840
  if (match) return match;
19841
19841
  }
19842
19842
  return findAssetInfo(destination, {
19843
19843
  location: resolvedOriginAsset.location
19844
- }, null);
19844
+ });
19845
19845
  };
19846
19846
  var findAssetOnDestOrThrow = function findAssetOnDestOrThrow(origin, destination, currency) {
19847
19847
  var asset = findAssetInfoOnDest(origin, destination, currency);
@@ -19858,10 +19858,10 @@ var createSelection = function createSelection(chain) {
19858
19858
  };
19859
19859
  };
19860
19860
  var findNativeAssetInfo = function findNativeAssetInfo(chain) {
19861
- return findAssetInfo(chain, createSelection(chain), null);
19861
+ return findAssetInfo(chain, createSelection(chain));
19862
19862
  };
19863
19863
  var findNativeAssetInfoOrThrow = function findNativeAssetInfoOrThrow(chain) {
19864
- return findAssetInfoOrThrow(chain, createSelection(chain), null);
19864
+ return findAssetInfoOrThrow(chain, createSelection(chain));
19865
19865
  };
19866
19866
 
19867
19867
  var extractEdFromAsset = function extractEdFromAsset(asset) {
@@ -19880,11 +19880,11 @@ var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
19880
19880
  var nativeAssetSymbol = getNativeAssetSymbol(chain);
19881
19881
  asset = (_findAssetInfo = findAssetInfo(chain, {
19882
19882
  symbol: Native(nativeAssetSymbol)
19883
- }, null)) !== null && _findAssetInfo !== void 0 ? _findAssetInfo : findAssetInfoOrThrow(chain, {
19883
+ })) !== null && _findAssetInfo !== void 0 ? _findAssetInfo : findAssetInfoOrThrow(chain, {
19884
19884
  symbol: nativeAssetSymbol
19885
- }, null);
19885
+ });
19886
19886
  } else {
19887
- asset = findAssetInfoOrThrow(chain, currency, null);
19887
+ asset = findAssetInfoOrThrow(chain, currency);
19888
19888
  }
19889
19889
  return extractEdFromAsset(asset);
19890
19890
  };
@@ -19946,6 +19946,8 @@ var isChainEvm = function isChainEvm(chain) {
19946
19946
  /**
19947
19947
  * Retrieves the asset ID for a given symbol on a specified chain.
19948
19948
  *
19949
+ * @deprecated Use `findAssetInfo` instead. Will be removed in v14.
19950
+ *
19949
19951
  * @param chain - The chain to search for the asset.
19950
19952
  * @param symbol - The symbol of the asset.
19951
19953
  * @returns The asset ID if found; otherwise, null.
@@ -20024,6 +20026,8 @@ var getNativeAssetSymbol = function getNativeAssetSymbol(chain) {
20024
20026
  /**
20025
20027
  * Determines whether a specified chain supports an asset with the given symbol.
20026
20028
  *
20029
+ * @deprecated Use `findAssetInfo` instead. Will be removed in v14.
20030
+ *
20027
20031
  * @param chain - The chain to check for asset support.
20028
20032
  * @param symbol - The symbol of the asset to check.
20029
20033
  * @returns True if the asset is supported; otherwise, false.
@@ -20052,6 +20056,8 @@ var hasSupportForAsset = function hasSupportForAsset(chain, symbol) {
20052
20056
  /**
20053
20057
  * Retrieves the number of decimals for an asset with the given symbol on a specified chain.
20054
20058
  *
20059
+ * @deprecated Use `findAssetInfo` instead. Will be removed in v14.
20060
+ *
20055
20061
  * @param chain - The chain where the asset is located.
20056
20062
  * @param symbol - The symbol of the asset.
20057
20063
  * @returns The number of decimals if the asset is found; otherwise, null.
@@ -20124,7 +20130,7 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
20124
20130
  };
20125
20131
 
20126
20132
  var getSupportedDestinations = function getSupportedDestinations(origin, currency) {
20127
- findAssetInfoOrThrow(origin, currency, null);
20133
+ findAssetInfoOrThrow(origin, currency);
20128
20134
  return CHAINS.filter(function (destination) {
20129
20135
  if (destination === origin) return false;
20130
20136
  // Check if we still can find asset if we specify destination
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/assets",
3
- "version": "12.9.6",
3
+ "version": "13.0.0-rc.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": "12.9.6"
26
+ "@paraspell/sdk-common": "13.0.0-rc.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@babel/plugin-syntax-import-attributes": "^7.28.6",