@paraspell/assets 11.12.5 → 11.12.6
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 +128 -71
- package/dist/index.mjs +128 -71
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -327,8 +327,8 @@ var Acala = {
|
|
|
327
327
|
nativeAssetSymbol: "ACA",
|
|
328
328
|
isEVM: false,
|
|
329
329
|
ss58Prefix: 10,
|
|
330
|
-
supportsDryRunApi:
|
|
331
|
-
supportsXcmPaymentApi:
|
|
330
|
+
supportsDryRunApi: true,
|
|
331
|
+
supportsXcmPaymentApi: true,
|
|
332
332
|
nativeAssets: [
|
|
333
333
|
{
|
|
334
334
|
symbol: "ACA",
|
|
@@ -3797,6 +3797,12 @@ var Hydration = {
|
|
|
3797
3797
|
},
|
|
3798
3798
|
isFeeAsset: true
|
|
3799
3799
|
},
|
|
3800
|
+
{
|
|
3801
|
+
assetId: "105",
|
|
3802
|
+
symbol: "3-Pool-MRL",
|
|
3803
|
+
decimals: 18,
|
|
3804
|
+
existentialDeposit: "20000000000000000"
|
|
3805
|
+
},
|
|
3800
3806
|
{
|
|
3801
3807
|
assetId: "1008",
|
|
3802
3808
|
symbol: "a3-Pool",
|
|
@@ -7793,6 +7799,29 @@ var AssetHubPolkadot = {
|
|
|
7793
7799
|
},
|
|
7794
7800
|
existentialDeposit: "1000000"
|
|
7795
7801
|
},
|
|
7802
|
+
{
|
|
7803
|
+
assetId: "22222037",
|
|
7804
|
+
symbol: "KSM",
|
|
7805
|
+
decimals: 12,
|
|
7806
|
+
location: {
|
|
7807
|
+
parents: 1,
|
|
7808
|
+
interior: {
|
|
7809
|
+
X3: [
|
|
7810
|
+
{
|
|
7811
|
+
Parachain: 1000
|
|
7812
|
+
},
|
|
7813
|
+
{
|
|
7814
|
+
PalletInstance: 50
|
|
7815
|
+
},
|
|
7816
|
+
{
|
|
7817
|
+
GeneralIndex: 22222037
|
|
7818
|
+
}
|
|
7819
|
+
]
|
|
7820
|
+
}
|
|
7821
|
+
},
|
|
7822
|
+
existentialDeposit: "1000000000000",
|
|
7823
|
+
alias: "KSM1"
|
|
7824
|
+
},
|
|
7796
7825
|
{
|
|
7797
7826
|
assetId: "201",
|
|
7798
7827
|
symbol: "WUD",
|
|
@@ -8288,7 +8317,8 @@ var AssetHubPolkadot = {
|
|
|
8288
8317
|
}
|
|
8289
8318
|
},
|
|
8290
8319
|
existentialDeposit: "1000000000",
|
|
8291
|
-
isFeeAsset: true
|
|
8320
|
+
isFeeAsset: true,
|
|
8321
|
+
alias: "KSM2"
|
|
8292
8322
|
},
|
|
8293
8323
|
{
|
|
8294
8324
|
symbol: "sUSDS",
|
|
@@ -12696,6 +12726,29 @@ var AssetHubKusama = {
|
|
|
12696
12726
|
},
|
|
12697
12727
|
existentialDeposit: "10000000000"
|
|
12698
12728
|
},
|
|
12729
|
+
{
|
|
12730
|
+
assetId: "14",
|
|
12731
|
+
symbol: "DOT",
|
|
12732
|
+
decimals: 10,
|
|
12733
|
+
location: {
|
|
12734
|
+
parents: 1,
|
|
12735
|
+
interior: {
|
|
12736
|
+
X3: [
|
|
12737
|
+
{
|
|
12738
|
+
Parachain: 1000
|
|
12739
|
+
},
|
|
12740
|
+
{
|
|
12741
|
+
PalletInstance: 50
|
|
12742
|
+
},
|
|
12743
|
+
{
|
|
12744
|
+
GeneralIndex: 14
|
|
12745
|
+
}
|
|
12746
|
+
]
|
|
12747
|
+
}
|
|
12748
|
+
},
|
|
12749
|
+
existentialDeposit: "100000000",
|
|
12750
|
+
alias: "DOT1"
|
|
12751
|
+
},
|
|
12699
12752
|
{
|
|
12700
12753
|
assetId: "360",
|
|
12701
12754
|
symbol: "uni",
|
|
@@ -13458,7 +13511,8 @@ var AssetHubKusama = {
|
|
|
13458
13511
|
}
|
|
13459
13512
|
},
|
|
13460
13513
|
existentialDeposit: "10000000",
|
|
13461
|
-
isFeeAsset: true
|
|
13514
|
+
isFeeAsset: true,
|
|
13515
|
+
alias: "DOT2"
|
|
13462
13516
|
},
|
|
13463
13517
|
{
|
|
13464
13518
|
symbol: "vKSM",
|
|
@@ -17886,7 +17940,8 @@ var AssetHubPaseo = {
|
|
|
17886
17940
|
]
|
|
17887
17941
|
}
|
|
17888
17942
|
},
|
|
17889
|
-
existentialDeposit: "15000000000000"
|
|
17943
|
+
existentialDeposit: "15000000000000",
|
|
17944
|
+
isFeeAsset: true
|
|
17890
17945
|
},
|
|
17891
17946
|
{
|
|
17892
17947
|
symbol: "MERC",
|
|
@@ -20810,6 +20865,47 @@ var assetsMapJson = {
|
|
|
20810
20865
|
ZeitgeistPaseo: ZeitgeistPaseo
|
|
20811
20866
|
};
|
|
20812
20867
|
|
|
20868
|
+
/**
|
|
20869
|
+
* Normalizes an asset symbol by stripping the 'xc' prefix (if present) and converting it to lowercase.
|
|
20870
|
+
*
|
|
20871
|
+
* @param symbol - The symbol to normalize.
|
|
20872
|
+
* @returns The normalized symbol.
|
|
20873
|
+
*/
|
|
20874
|
+
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
20875
|
+
if (!symbol) return '';
|
|
20876
|
+
var lowerSymbol = symbol.toLowerCase();
|
|
20877
|
+
return lowerSymbol.startsWith('xc') ? lowerSymbol.substring(2) : lowerSymbol;
|
|
20878
|
+
};
|
|
20879
|
+
|
|
20880
|
+
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
20881
|
+
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
20882
|
+
};
|
|
20883
|
+
|
|
20884
|
+
var isForeignAsset = function isForeignAsset(asset) {
|
|
20885
|
+
return _typeof(asset) === 'object' && asset !== null && ('assetId' in asset || 'location' in asset) && !('isNative' in asset);
|
|
20886
|
+
};
|
|
20887
|
+
|
|
20888
|
+
var isOverrideLocationSpecifier = function isOverrideLocationSpecifier(locationSpecifier) {
|
|
20889
|
+
return _typeof(locationSpecifier) === 'object' && 'type' in locationSpecifier && 'value' in locationSpecifier;
|
|
20890
|
+
};
|
|
20891
|
+
|
|
20892
|
+
var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
|
|
20893
|
+
return _typeof(currencySymbolValue) === 'object' && 'type' in currencySymbolValue && 'value' in currencySymbolValue;
|
|
20894
|
+
};
|
|
20895
|
+
|
|
20896
|
+
var isTAsset = function isTAsset(value) {
|
|
20897
|
+
return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
|
|
20898
|
+
};
|
|
20899
|
+
|
|
20900
|
+
var filterEthCompatibleAssets = function filterEthCompatibleAssets(assets) {
|
|
20901
|
+
var ethAssets = getOtherAssets('Ethereum');
|
|
20902
|
+
return assets.filter(function (asset) {
|
|
20903
|
+
var location = asset.location;
|
|
20904
|
+
if (!location) return false;
|
|
20905
|
+
return Boolean(findAssetInfoByLoc(ethAssets, location));
|
|
20906
|
+
});
|
|
20907
|
+
};
|
|
20908
|
+
|
|
20813
20909
|
/**
|
|
20814
20910
|
* Error thrown when multiple assets with the same symbol are found.
|
|
20815
20911
|
*/
|
|
@@ -20870,56 +20966,6 @@ var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
|
20870
20966
|
return _createClass(InvalidCurrencyError);
|
|
20871
20967
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
20872
20968
|
|
|
20873
|
-
var Native = function Native(symbol) {
|
|
20874
|
-
return {
|
|
20875
|
-
type: 'Native',
|
|
20876
|
-
value: symbol
|
|
20877
|
-
};
|
|
20878
|
-
};
|
|
20879
|
-
var Foreign = function Foreign(symbol) {
|
|
20880
|
-
return {
|
|
20881
|
-
type: 'Foreign',
|
|
20882
|
-
value: symbol
|
|
20883
|
-
};
|
|
20884
|
-
};
|
|
20885
|
-
var ForeignAbstract = function ForeignAbstract(symbol) {
|
|
20886
|
-
return {
|
|
20887
|
-
type: 'ForeignAbstract',
|
|
20888
|
-
value: symbol
|
|
20889
|
-
};
|
|
20890
|
-
};
|
|
20891
|
-
var Override = function Override(location) {
|
|
20892
|
-
return {
|
|
20893
|
-
type: 'Override',
|
|
20894
|
-
value: location
|
|
20895
|
-
};
|
|
20896
|
-
};
|
|
20897
|
-
|
|
20898
|
-
var isForeignAsset = function isForeignAsset(asset) {
|
|
20899
|
-
return _typeof(asset) === 'object' && asset !== null && ('assetId' in asset || 'location' in asset) && !('isNative' in asset);
|
|
20900
|
-
};
|
|
20901
|
-
|
|
20902
|
-
var isOverrideLocationSpecifier = function isOverrideLocationSpecifier(locationSpecifier) {
|
|
20903
|
-
return _typeof(locationSpecifier) === 'object' && 'type' in locationSpecifier && 'value' in locationSpecifier;
|
|
20904
|
-
};
|
|
20905
|
-
|
|
20906
|
-
var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
|
|
20907
|
-
return _typeof(currencySymbolValue) === 'object' && 'type' in currencySymbolValue && 'value' in currencySymbolValue;
|
|
20908
|
-
};
|
|
20909
|
-
|
|
20910
|
-
var isTAsset = function isTAsset(value) {
|
|
20911
|
-
return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
|
|
20912
|
-
};
|
|
20913
|
-
|
|
20914
|
-
var filterEthCompatibleAssets = function filterEthCompatibleAssets(assets) {
|
|
20915
|
-
var ethAssets = getOtherAssets('Ethereum');
|
|
20916
|
-
return assets.filter(function (asset) {
|
|
20917
|
-
var location = asset.location;
|
|
20918
|
-
if (!location) return false;
|
|
20919
|
-
return Boolean(findAssetInfoByLoc(ethAssets, location));
|
|
20920
|
-
});
|
|
20921
|
-
};
|
|
20922
|
-
|
|
20923
20969
|
var findAssetInfoById = function findAssetInfoById(assets, assetId) {
|
|
20924
20970
|
var otherAssetsMatches = assets.filter(function (_ref) {
|
|
20925
20971
|
var currentAssetId = _ref.assetId;
|
|
@@ -21225,6 +21271,31 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
|
|
|
21225
21271
|
return asset !== null && asset !== void 0 ? asset : null;
|
|
21226
21272
|
};
|
|
21227
21273
|
|
|
21274
|
+
var Native = function Native(symbol) {
|
|
21275
|
+
return {
|
|
21276
|
+
type: 'Native',
|
|
21277
|
+
value: symbol
|
|
21278
|
+
};
|
|
21279
|
+
};
|
|
21280
|
+
var Foreign = function Foreign(symbol) {
|
|
21281
|
+
return {
|
|
21282
|
+
type: 'Foreign',
|
|
21283
|
+
value: symbol
|
|
21284
|
+
};
|
|
21285
|
+
};
|
|
21286
|
+
var ForeignAbstract = function ForeignAbstract(symbol) {
|
|
21287
|
+
return {
|
|
21288
|
+
type: 'ForeignAbstract',
|
|
21289
|
+
value: symbol
|
|
21290
|
+
};
|
|
21291
|
+
};
|
|
21292
|
+
var Override = function Override(location) {
|
|
21293
|
+
return {
|
|
21294
|
+
type: 'Override',
|
|
21295
|
+
value: location
|
|
21296
|
+
};
|
|
21297
|
+
};
|
|
21298
|
+
|
|
21228
21299
|
var findAssetInfoOrThrow = function findAssetInfoOrThrow(chain, currency, destination) {
|
|
21229
21300
|
var _findAssetInfo;
|
|
21230
21301
|
var asset = (_findAssetInfo = findAssetInfo(chain, currency, destination)) !== null && _findAssetInfo !== void 0 ? _findAssetInfo : chain === 'AssetHubPolkadot' || chain === 'Mythos' ? findAssetInfo('Ethereum', currency, null) : null;
|
|
@@ -21487,6 +21558,8 @@ var getAssetDecimals = function getAssetDecimals(chain, symbol) {
|
|
|
21487
21558
|
var _getAssetsObject3 = getAssetsObject(chain),
|
|
21488
21559
|
otherAssets = _getAssetsObject3.otherAssets,
|
|
21489
21560
|
nativeAssets = _getAssetsObject3.nativeAssets;
|
|
21561
|
+
var isMainNativeAsset = isSymbolMatch(symbol, getNativeAssetSymbol(chain));
|
|
21562
|
+
if (isMainNativeAsset) return findNativeAssetInfoOrThrow(chain).decimals;
|
|
21490
21563
|
var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (o) {
|
|
21491
21564
|
return o.symbol === symbol;
|
|
21492
21565
|
});
|
|
@@ -21503,22 +21576,6 @@ var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
|
21503
21576
|
return getAssetsObject(chain).supportsXcmPaymentApi && !DISABLED_CHAINS.includes(chain);
|
|
21504
21577
|
};
|
|
21505
21578
|
|
|
21506
|
-
/**
|
|
21507
|
-
* Normalizes an asset symbol by stripping the 'xc' prefix (if present) and converting it to lowercase.
|
|
21508
|
-
*
|
|
21509
|
-
* @param symbol - The symbol to normalize.
|
|
21510
|
-
* @returns The normalized symbol.
|
|
21511
|
-
*/
|
|
21512
|
-
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
21513
|
-
if (!symbol) return '';
|
|
21514
|
-
var lowerSymbol = symbol.toLowerCase();
|
|
21515
|
-
return lowerSymbol.startsWith('xc') ? lowerSymbol.substring(2) : lowerSymbol;
|
|
21516
|
-
};
|
|
21517
|
-
|
|
21518
|
-
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
21519
|
-
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
21520
|
-
};
|
|
21521
|
-
|
|
21522
21579
|
/**
|
|
21523
21580
|
* Retrieves the list of assets that are supported for transfers between two specified chains.
|
|
21524
21581
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -325,8 +325,8 @@ var Acala = {
|
|
|
325
325
|
nativeAssetSymbol: "ACA",
|
|
326
326
|
isEVM: false,
|
|
327
327
|
ss58Prefix: 10,
|
|
328
|
-
supportsDryRunApi:
|
|
329
|
-
supportsXcmPaymentApi:
|
|
328
|
+
supportsDryRunApi: true,
|
|
329
|
+
supportsXcmPaymentApi: true,
|
|
330
330
|
nativeAssets: [
|
|
331
331
|
{
|
|
332
332
|
symbol: "ACA",
|
|
@@ -3795,6 +3795,12 @@ var Hydration = {
|
|
|
3795
3795
|
},
|
|
3796
3796
|
isFeeAsset: true
|
|
3797
3797
|
},
|
|
3798
|
+
{
|
|
3799
|
+
assetId: "105",
|
|
3800
|
+
symbol: "3-Pool-MRL",
|
|
3801
|
+
decimals: 18,
|
|
3802
|
+
existentialDeposit: "20000000000000000"
|
|
3803
|
+
},
|
|
3798
3804
|
{
|
|
3799
3805
|
assetId: "1008",
|
|
3800
3806
|
symbol: "a3-Pool",
|
|
@@ -7791,6 +7797,29 @@ var AssetHubPolkadot = {
|
|
|
7791
7797
|
},
|
|
7792
7798
|
existentialDeposit: "1000000"
|
|
7793
7799
|
},
|
|
7800
|
+
{
|
|
7801
|
+
assetId: "22222037",
|
|
7802
|
+
symbol: "KSM",
|
|
7803
|
+
decimals: 12,
|
|
7804
|
+
location: {
|
|
7805
|
+
parents: 1,
|
|
7806
|
+
interior: {
|
|
7807
|
+
X3: [
|
|
7808
|
+
{
|
|
7809
|
+
Parachain: 1000
|
|
7810
|
+
},
|
|
7811
|
+
{
|
|
7812
|
+
PalletInstance: 50
|
|
7813
|
+
},
|
|
7814
|
+
{
|
|
7815
|
+
GeneralIndex: 22222037
|
|
7816
|
+
}
|
|
7817
|
+
]
|
|
7818
|
+
}
|
|
7819
|
+
},
|
|
7820
|
+
existentialDeposit: "1000000000000",
|
|
7821
|
+
alias: "KSM1"
|
|
7822
|
+
},
|
|
7794
7823
|
{
|
|
7795
7824
|
assetId: "201",
|
|
7796
7825
|
symbol: "WUD",
|
|
@@ -8286,7 +8315,8 @@ var AssetHubPolkadot = {
|
|
|
8286
8315
|
}
|
|
8287
8316
|
},
|
|
8288
8317
|
existentialDeposit: "1000000000",
|
|
8289
|
-
isFeeAsset: true
|
|
8318
|
+
isFeeAsset: true,
|
|
8319
|
+
alias: "KSM2"
|
|
8290
8320
|
},
|
|
8291
8321
|
{
|
|
8292
8322
|
symbol: "sUSDS",
|
|
@@ -12694,6 +12724,29 @@ var AssetHubKusama = {
|
|
|
12694
12724
|
},
|
|
12695
12725
|
existentialDeposit: "10000000000"
|
|
12696
12726
|
},
|
|
12727
|
+
{
|
|
12728
|
+
assetId: "14",
|
|
12729
|
+
symbol: "DOT",
|
|
12730
|
+
decimals: 10,
|
|
12731
|
+
location: {
|
|
12732
|
+
parents: 1,
|
|
12733
|
+
interior: {
|
|
12734
|
+
X3: [
|
|
12735
|
+
{
|
|
12736
|
+
Parachain: 1000
|
|
12737
|
+
},
|
|
12738
|
+
{
|
|
12739
|
+
PalletInstance: 50
|
|
12740
|
+
},
|
|
12741
|
+
{
|
|
12742
|
+
GeneralIndex: 14
|
|
12743
|
+
}
|
|
12744
|
+
]
|
|
12745
|
+
}
|
|
12746
|
+
},
|
|
12747
|
+
existentialDeposit: "100000000",
|
|
12748
|
+
alias: "DOT1"
|
|
12749
|
+
},
|
|
12697
12750
|
{
|
|
12698
12751
|
assetId: "360",
|
|
12699
12752
|
symbol: "uni",
|
|
@@ -13456,7 +13509,8 @@ var AssetHubKusama = {
|
|
|
13456
13509
|
}
|
|
13457
13510
|
},
|
|
13458
13511
|
existentialDeposit: "10000000",
|
|
13459
|
-
isFeeAsset: true
|
|
13512
|
+
isFeeAsset: true,
|
|
13513
|
+
alias: "DOT2"
|
|
13460
13514
|
},
|
|
13461
13515
|
{
|
|
13462
13516
|
symbol: "vKSM",
|
|
@@ -17884,7 +17938,8 @@ var AssetHubPaseo = {
|
|
|
17884
17938
|
]
|
|
17885
17939
|
}
|
|
17886
17940
|
},
|
|
17887
|
-
existentialDeposit: "15000000000000"
|
|
17941
|
+
existentialDeposit: "15000000000000",
|
|
17942
|
+
isFeeAsset: true
|
|
17888
17943
|
},
|
|
17889
17944
|
{
|
|
17890
17945
|
symbol: "MERC",
|
|
@@ -20808,6 +20863,47 @@ var assetsMapJson = {
|
|
|
20808
20863
|
ZeitgeistPaseo: ZeitgeistPaseo
|
|
20809
20864
|
};
|
|
20810
20865
|
|
|
20866
|
+
/**
|
|
20867
|
+
* Normalizes an asset symbol by stripping the 'xc' prefix (if present) and converting it to lowercase.
|
|
20868
|
+
*
|
|
20869
|
+
* @param symbol - The symbol to normalize.
|
|
20870
|
+
* @returns The normalized symbol.
|
|
20871
|
+
*/
|
|
20872
|
+
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
20873
|
+
if (!symbol) return '';
|
|
20874
|
+
var lowerSymbol = symbol.toLowerCase();
|
|
20875
|
+
return lowerSymbol.startsWith('xc') ? lowerSymbol.substring(2) : lowerSymbol;
|
|
20876
|
+
};
|
|
20877
|
+
|
|
20878
|
+
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
20879
|
+
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
20880
|
+
};
|
|
20881
|
+
|
|
20882
|
+
var isForeignAsset = function isForeignAsset(asset) {
|
|
20883
|
+
return _typeof(asset) === 'object' && asset !== null && ('assetId' in asset || 'location' in asset) && !('isNative' in asset);
|
|
20884
|
+
};
|
|
20885
|
+
|
|
20886
|
+
var isOverrideLocationSpecifier = function isOverrideLocationSpecifier(locationSpecifier) {
|
|
20887
|
+
return _typeof(locationSpecifier) === 'object' && 'type' in locationSpecifier && 'value' in locationSpecifier;
|
|
20888
|
+
};
|
|
20889
|
+
|
|
20890
|
+
var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
|
|
20891
|
+
return _typeof(currencySymbolValue) === 'object' && 'type' in currencySymbolValue && 'value' in currencySymbolValue;
|
|
20892
|
+
};
|
|
20893
|
+
|
|
20894
|
+
var isTAsset = function isTAsset(value) {
|
|
20895
|
+
return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
|
|
20896
|
+
};
|
|
20897
|
+
|
|
20898
|
+
var filterEthCompatibleAssets = function filterEthCompatibleAssets(assets) {
|
|
20899
|
+
var ethAssets = getOtherAssets('Ethereum');
|
|
20900
|
+
return assets.filter(function (asset) {
|
|
20901
|
+
var location = asset.location;
|
|
20902
|
+
if (!location) return false;
|
|
20903
|
+
return Boolean(findAssetInfoByLoc(ethAssets, location));
|
|
20904
|
+
});
|
|
20905
|
+
};
|
|
20906
|
+
|
|
20811
20907
|
/**
|
|
20812
20908
|
* Error thrown when multiple assets with the same symbol are found.
|
|
20813
20909
|
*/
|
|
@@ -20868,56 +20964,6 @@ var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
|
20868
20964
|
return _createClass(InvalidCurrencyError);
|
|
20869
20965
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
20870
20966
|
|
|
20871
|
-
var Native = function Native(symbol) {
|
|
20872
|
-
return {
|
|
20873
|
-
type: 'Native',
|
|
20874
|
-
value: symbol
|
|
20875
|
-
};
|
|
20876
|
-
};
|
|
20877
|
-
var Foreign = function Foreign(symbol) {
|
|
20878
|
-
return {
|
|
20879
|
-
type: 'Foreign',
|
|
20880
|
-
value: symbol
|
|
20881
|
-
};
|
|
20882
|
-
};
|
|
20883
|
-
var ForeignAbstract = function ForeignAbstract(symbol) {
|
|
20884
|
-
return {
|
|
20885
|
-
type: 'ForeignAbstract',
|
|
20886
|
-
value: symbol
|
|
20887
|
-
};
|
|
20888
|
-
};
|
|
20889
|
-
var Override = function Override(location) {
|
|
20890
|
-
return {
|
|
20891
|
-
type: 'Override',
|
|
20892
|
-
value: location
|
|
20893
|
-
};
|
|
20894
|
-
};
|
|
20895
|
-
|
|
20896
|
-
var isForeignAsset = function isForeignAsset(asset) {
|
|
20897
|
-
return _typeof(asset) === 'object' && asset !== null && ('assetId' in asset || 'location' in asset) && !('isNative' in asset);
|
|
20898
|
-
};
|
|
20899
|
-
|
|
20900
|
-
var isOverrideLocationSpecifier = function isOverrideLocationSpecifier(locationSpecifier) {
|
|
20901
|
-
return _typeof(locationSpecifier) === 'object' && 'type' in locationSpecifier && 'value' in locationSpecifier;
|
|
20902
|
-
};
|
|
20903
|
-
|
|
20904
|
-
var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
|
|
20905
|
-
return _typeof(currencySymbolValue) === 'object' && 'type' in currencySymbolValue && 'value' in currencySymbolValue;
|
|
20906
|
-
};
|
|
20907
|
-
|
|
20908
|
-
var isTAsset = function isTAsset(value) {
|
|
20909
|
-
return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
|
|
20910
|
-
};
|
|
20911
|
-
|
|
20912
|
-
var filterEthCompatibleAssets = function filterEthCompatibleAssets(assets) {
|
|
20913
|
-
var ethAssets = getOtherAssets('Ethereum');
|
|
20914
|
-
return assets.filter(function (asset) {
|
|
20915
|
-
var location = asset.location;
|
|
20916
|
-
if (!location) return false;
|
|
20917
|
-
return Boolean(findAssetInfoByLoc(ethAssets, location));
|
|
20918
|
-
});
|
|
20919
|
-
};
|
|
20920
|
-
|
|
20921
20967
|
var findAssetInfoById = function findAssetInfoById(assets, assetId) {
|
|
20922
20968
|
var otherAssetsMatches = assets.filter(function (_ref) {
|
|
20923
20969
|
var currentAssetId = _ref.assetId;
|
|
@@ -21223,6 +21269,31 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
|
|
|
21223
21269
|
return asset !== null && asset !== void 0 ? asset : null;
|
|
21224
21270
|
};
|
|
21225
21271
|
|
|
21272
|
+
var Native = function Native(symbol) {
|
|
21273
|
+
return {
|
|
21274
|
+
type: 'Native',
|
|
21275
|
+
value: symbol
|
|
21276
|
+
};
|
|
21277
|
+
};
|
|
21278
|
+
var Foreign = function Foreign(symbol) {
|
|
21279
|
+
return {
|
|
21280
|
+
type: 'Foreign',
|
|
21281
|
+
value: symbol
|
|
21282
|
+
};
|
|
21283
|
+
};
|
|
21284
|
+
var ForeignAbstract = function ForeignAbstract(symbol) {
|
|
21285
|
+
return {
|
|
21286
|
+
type: 'ForeignAbstract',
|
|
21287
|
+
value: symbol
|
|
21288
|
+
};
|
|
21289
|
+
};
|
|
21290
|
+
var Override = function Override(location) {
|
|
21291
|
+
return {
|
|
21292
|
+
type: 'Override',
|
|
21293
|
+
value: location
|
|
21294
|
+
};
|
|
21295
|
+
};
|
|
21296
|
+
|
|
21226
21297
|
var findAssetInfoOrThrow = function findAssetInfoOrThrow(chain, currency, destination) {
|
|
21227
21298
|
var _findAssetInfo;
|
|
21228
21299
|
var asset = (_findAssetInfo = findAssetInfo(chain, currency, destination)) !== null && _findAssetInfo !== void 0 ? _findAssetInfo : chain === 'AssetHubPolkadot' || chain === 'Mythos' ? findAssetInfo('Ethereum', currency, null) : null;
|
|
@@ -21485,6 +21556,8 @@ var getAssetDecimals = function getAssetDecimals(chain, symbol) {
|
|
|
21485
21556
|
var _getAssetsObject3 = getAssetsObject(chain),
|
|
21486
21557
|
otherAssets = _getAssetsObject3.otherAssets,
|
|
21487
21558
|
nativeAssets = _getAssetsObject3.nativeAssets;
|
|
21559
|
+
var isMainNativeAsset = isSymbolMatch(symbol, getNativeAssetSymbol(chain));
|
|
21560
|
+
if (isMainNativeAsset) return findNativeAssetInfoOrThrow(chain).decimals;
|
|
21488
21561
|
var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (o) {
|
|
21489
21562
|
return o.symbol === symbol;
|
|
21490
21563
|
});
|
|
@@ -21501,22 +21574,6 @@ var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
|
21501
21574
|
return getAssetsObject(chain).supportsXcmPaymentApi && !DISABLED_CHAINS.includes(chain);
|
|
21502
21575
|
};
|
|
21503
21576
|
|
|
21504
|
-
/**
|
|
21505
|
-
* Normalizes an asset symbol by stripping the 'xc' prefix (if present) and converting it to lowercase.
|
|
21506
|
-
*
|
|
21507
|
-
* @param symbol - The symbol to normalize.
|
|
21508
|
-
* @returns The normalized symbol.
|
|
21509
|
-
*/
|
|
21510
|
-
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
21511
|
-
if (!symbol) return '';
|
|
21512
|
-
var lowerSymbol = symbol.toLowerCase();
|
|
21513
|
-
return lowerSymbol.startsWith('xc') ? lowerSymbol.substring(2) : lowerSymbol;
|
|
21514
|
-
};
|
|
21515
|
-
|
|
21516
|
-
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
21517
|
-
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
21518
|
-
};
|
|
21519
|
-
|
|
21520
21577
|
/**
|
|
21521
21578
|
* Retrieves the list of assets that are supported for transfers between two specified chains.
|
|
21522
21579
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/assets",
|
|
3
|
-
"version": "11.12.
|
|
3
|
+
"version": "11.12.6",
|
|
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.12.
|
|
26
|
+
"@paraspell/sdk-common": "11.12.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|