@paraspell/assets 11.4.1 → 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 +34 -7
- package/dist/index.d.ts +6 -1
- package/dist/index.mjs +31 -8
- 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",
|
|
@@ -18007,6 +18007,22 @@ var findAssetOnDestOrThrow = function findAssetOnDestOrThrow(origin, destination
|
|
|
18007
18007
|
return asset;
|
|
18008
18008
|
};
|
|
18009
18009
|
|
|
18010
|
+
var createSelection = function createSelection(chain) {
|
|
18011
|
+
var nativeSymbol = getNativeAssetSymbol(chain);
|
|
18012
|
+
return {
|
|
18013
|
+
symbol: chain === 'Ethereum' ? nativeSymbol : Native(nativeSymbol)
|
|
18014
|
+
};
|
|
18015
|
+
};
|
|
18016
|
+
var findNativeAssetInfo = function findNativeAssetInfo(chain) {
|
|
18017
|
+
return findAssetInfo(chain, createSelection(chain), null);
|
|
18018
|
+
};
|
|
18019
|
+
var findNativeAssetInfoOrThrow = function findNativeAssetInfoOrThrow(chain) {
|
|
18020
|
+
return findAssetInfoOrThrow(chain, createSelection(chain), null);
|
|
18021
|
+
};
|
|
18022
|
+
|
|
18023
|
+
var extractEdFromAsset = function extractEdFromAsset(asset) {
|
|
18024
|
+
return asset.existentialDeposit ? BigInt(asset.existentialDeposit) : null;
|
|
18025
|
+
};
|
|
18010
18026
|
/**
|
|
18011
18027
|
* Retrieves the existential deposit value for a given chain.
|
|
18012
18028
|
*
|
|
@@ -18014,7 +18030,6 @@ var findAssetOnDestOrThrow = function findAssetOnDestOrThrow(origin, destination
|
|
|
18014
18030
|
* @returns The existential deposit as a bigint if available; otherwise, null.
|
|
18015
18031
|
*/
|
|
18016
18032
|
var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
|
|
18017
|
-
var _asset;
|
|
18018
18033
|
var asset;
|
|
18019
18034
|
if (!currency) {
|
|
18020
18035
|
var _findAssetInfo;
|
|
@@ -18027,13 +18042,21 @@ var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
|
|
|
18027
18042
|
} else {
|
|
18028
18043
|
asset = findAssetInfoOrThrow(chain, currency, null);
|
|
18029
18044
|
}
|
|
18030
|
-
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
|
+
}
|
|
18031
18051
|
};
|
|
18032
18052
|
var getExistentialDepositOrThrow = function getExistentialDepositOrThrow(chain, currency) {
|
|
18033
18053
|
var ed = getExistentialDeposit(chain, currency);
|
|
18034
|
-
|
|
18035
|
-
|
|
18036
|
-
|
|
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);
|
|
18037
18060
|
return ed;
|
|
18038
18061
|
};
|
|
18039
18062
|
|
|
@@ -18323,6 +18346,7 @@ exports.ForeignAbstract = ForeignAbstract;
|
|
|
18323
18346
|
exports.InvalidCurrencyError = InvalidCurrencyError;
|
|
18324
18347
|
exports.Native = Native;
|
|
18325
18348
|
exports.Override = Override;
|
|
18349
|
+
exports.assertEdDefined = assertEdDefined;
|
|
18326
18350
|
exports.compareLocations = compareLocations;
|
|
18327
18351
|
exports.extractAssetLocation = extractAssetLocation;
|
|
18328
18352
|
exports.filterEthCompatibleAssets = filterEthCompatibleAssets;
|
|
@@ -18334,12 +18358,15 @@ exports.findAssetInfoOnDest = findAssetInfoOnDest;
|
|
|
18334
18358
|
exports.findAssetInfoOrThrow = findAssetInfoOrThrow;
|
|
18335
18359
|
exports.findAssetOnDestOrThrow = findAssetOnDestOrThrow;
|
|
18336
18360
|
exports.findBestMatches = findBestMatches;
|
|
18361
|
+
exports.findNativeAssetInfo = findNativeAssetInfo;
|
|
18362
|
+
exports.findNativeAssetInfoOrThrow = findNativeAssetInfoOrThrow;
|
|
18337
18363
|
exports.getAllAssetsSymbols = getAllAssetsSymbols;
|
|
18338
18364
|
exports.getAssetDecimals = getAssetDecimals;
|
|
18339
18365
|
exports.getAssetId = getAssetId;
|
|
18340
18366
|
exports.getAssetLocation = getAssetLocation;
|
|
18341
18367
|
exports.getAssets = getAssets;
|
|
18342
18368
|
exports.getAssetsObject = getAssetsObject;
|
|
18369
|
+
exports.getEdFromAssetOrThrow = getEdFromAssetOrThrow;
|
|
18343
18370
|
exports.getExistentialDeposit = getExistentialDeposit;
|
|
18344
18371
|
exports.getExistentialDepositOrThrow = getExistentialDepositOrThrow;
|
|
18345
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
|
|
|
@@ -240,6 +242,9 @@ declare const findBestMatches: <T extends {
|
|
|
240
242
|
alias?: string;
|
|
241
243
|
}>(assets: T[], value: string, property?: "symbol" | "alias") => T[];
|
|
242
244
|
|
|
245
|
+
declare const findNativeAssetInfo: (chain: TChain) => TAssetInfo | null;
|
|
246
|
+
declare const findNativeAssetInfoOrThrow: (chain: TChain) => TAssetInfo;
|
|
247
|
+
|
|
243
248
|
/**
|
|
244
249
|
* Error thrown when multiple assets with the same symbol are found.
|
|
245
250
|
*/
|
|
@@ -290,5 +295,5 @@ declare const extractAssetLocation: <T = bigint>(asset: TAsset<T>) => TLocation;
|
|
|
290
295
|
|
|
291
296
|
declare const getAssetLocation: (chain: TChain, currency: TCurrencyInput) => TLocation | null;
|
|
292
297
|
|
|
293
|
-
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, compareLocations, extractAssetLocation, filterEthCompatibleAssets, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoOnDest, findAssetInfoOrThrow, findAssetOnDestOrThrow, findBestMatches, 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 };
|
|
294
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:
|
|
4911
|
-
supportsXcmPaymentApi:
|
|
4910
|
+
supportsDryRunApi: true,
|
|
4911
|
+
supportsXcmPaymentApi: true,
|
|
4912
4912
|
nativeAssets: [
|
|
4913
4913
|
{
|
|
4914
4914
|
symbol: "TEER",
|
|
@@ -18005,6 +18005,22 @@ var findAssetOnDestOrThrow = function findAssetOnDestOrThrow(origin, destination
|
|
|
18005
18005
|
return asset;
|
|
18006
18006
|
};
|
|
18007
18007
|
|
|
18008
|
+
var createSelection = function createSelection(chain) {
|
|
18009
|
+
var nativeSymbol = getNativeAssetSymbol(chain);
|
|
18010
|
+
return {
|
|
18011
|
+
symbol: chain === 'Ethereum' ? nativeSymbol : Native(nativeSymbol)
|
|
18012
|
+
};
|
|
18013
|
+
};
|
|
18014
|
+
var findNativeAssetInfo = function findNativeAssetInfo(chain) {
|
|
18015
|
+
return findAssetInfo(chain, createSelection(chain), null);
|
|
18016
|
+
};
|
|
18017
|
+
var findNativeAssetInfoOrThrow = function findNativeAssetInfoOrThrow(chain) {
|
|
18018
|
+
return findAssetInfoOrThrow(chain, createSelection(chain), null);
|
|
18019
|
+
};
|
|
18020
|
+
|
|
18021
|
+
var extractEdFromAsset = function extractEdFromAsset(asset) {
|
|
18022
|
+
return asset.existentialDeposit ? BigInt(asset.existentialDeposit) : null;
|
|
18023
|
+
};
|
|
18008
18024
|
/**
|
|
18009
18025
|
* Retrieves the existential deposit value for a given chain.
|
|
18010
18026
|
*
|
|
@@ -18012,7 +18028,6 @@ var findAssetOnDestOrThrow = function findAssetOnDestOrThrow(origin, destination
|
|
|
18012
18028
|
* @returns The existential deposit as a bigint if available; otherwise, null.
|
|
18013
18029
|
*/
|
|
18014
18030
|
var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
|
|
18015
|
-
var _asset;
|
|
18016
18031
|
var asset;
|
|
18017
18032
|
if (!currency) {
|
|
18018
18033
|
var _findAssetInfo;
|
|
@@ -18025,13 +18040,21 @@ var getExistentialDeposit = function getExistentialDeposit(chain, currency) {
|
|
|
18025
18040
|
} else {
|
|
18026
18041
|
asset = findAssetInfoOrThrow(chain, currency, null);
|
|
18027
18042
|
}
|
|
18028
|
-
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
|
+
}
|
|
18029
18049
|
};
|
|
18030
18050
|
var getExistentialDepositOrThrow = function getExistentialDepositOrThrow(chain, currency) {
|
|
18031
18051
|
var ed = getExistentialDeposit(chain, currency);
|
|
18032
|
-
|
|
18033
|
-
|
|
18034
|
-
|
|
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);
|
|
18035
18058
|
return ed;
|
|
18036
18059
|
};
|
|
18037
18060
|
|
|
@@ -18314,4 +18337,4 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
|
|
|
18314
18337
|
return asset1.symbol.toLowerCase() === asset2.symbol.toLowerCase();
|
|
18315
18338
|
};
|
|
18316
18339
|
|
|
18317
|
-
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, compareLocations, extractAssetLocation, filterEthCompatibleAssets, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoOnDest, findAssetInfoOrThrow, findAssetOnDestOrThrow, findBestMatches, 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.
|
|
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.
|
|
26
|
+
"@paraspell/sdk-common": "11.5.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|