@paraspell/assets 11.14.5 → 11.14.7
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 +115 -227
- package/dist/index.d.ts +2 -4
- package/dist/index.mjs +117 -228
- package/package.json +9 -10
package/dist/index.cjs
CHANGED
|
@@ -5117,86 +5117,6 @@ var Hydration = {
|
|
|
5117
5117
|
}
|
|
5118
5118
|
]
|
|
5119
5119
|
};
|
|
5120
|
-
var IntegriteePolkadot = {
|
|
5121
|
-
relaychainSymbol: "DOT",
|
|
5122
|
-
nativeAssetSymbol: "TEER",
|
|
5123
|
-
isEVM: false,
|
|
5124
|
-
ss58Prefix: 13,
|
|
5125
|
-
supportsDryRunApi: true,
|
|
5126
|
-
supportsXcmPaymentApi: true,
|
|
5127
|
-
nativeAssets: [
|
|
5128
|
-
{
|
|
5129
|
-
symbol: "TEER",
|
|
5130
|
-
isNative: true,
|
|
5131
|
-
decimals: 12,
|
|
5132
|
-
existentialDeposit: "1000000000",
|
|
5133
|
-
location: {
|
|
5134
|
-
parents: 1,
|
|
5135
|
-
interior: {
|
|
5136
|
-
X1: [
|
|
5137
|
-
{
|
|
5138
|
-
Parachain: 2039
|
|
5139
|
-
}
|
|
5140
|
-
]
|
|
5141
|
-
}
|
|
5142
|
-
}
|
|
5143
|
-
}
|
|
5144
|
-
],
|
|
5145
|
-
otherAssets: [
|
|
5146
|
-
{
|
|
5147
|
-
assetId: "0",
|
|
5148
|
-
symbol: "DOT",
|
|
5149
|
-
decimals: 10,
|
|
5150
|
-
existentialDeposit: "100000000",
|
|
5151
|
-
location: {
|
|
5152
|
-
parents: 1,
|
|
5153
|
-
interior: {
|
|
5154
|
-
Here: null
|
|
5155
|
-
}
|
|
5156
|
-
}
|
|
5157
|
-
}
|
|
5158
|
-
]
|
|
5159
|
-
};
|
|
5160
|
-
var IntegriteeKusama = {
|
|
5161
|
-
relaychainSymbol: "KSM",
|
|
5162
|
-
nativeAssetSymbol: "TEER",
|
|
5163
|
-
isEVM: false,
|
|
5164
|
-
ss58Prefix: 13,
|
|
5165
|
-
supportsDryRunApi: true,
|
|
5166
|
-
supportsXcmPaymentApi: true,
|
|
5167
|
-
nativeAssets: [
|
|
5168
|
-
{
|
|
5169
|
-
symbol: "TEER",
|
|
5170
|
-
isNative: true,
|
|
5171
|
-
decimals: 12,
|
|
5172
|
-
existentialDeposit: "1000000000",
|
|
5173
|
-
location: {
|
|
5174
|
-
parents: 1,
|
|
5175
|
-
interior: {
|
|
5176
|
-
X1: [
|
|
5177
|
-
{
|
|
5178
|
-
Parachain: 2015
|
|
5179
|
-
}
|
|
5180
|
-
]
|
|
5181
|
-
}
|
|
5182
|
-
}
|
|
5183
|
-
}
|
|
5184
|
-
],
|
|
5185
|
-
otherAssets: [
|
|
5186
|
-
{
|
|
5187
|
-
assetId: "0",
|
|
5188
|
-
symbol: "KSM",
|
|
5189
|
-
decimals: 12,
|
|
5190
|
-
existentialDeposit: "3333333",
|
|
5191
|
-
location: {
|
|
5192
|
-
parents: 1,
|
|
5193
|
-
interior: {
|
|
5194
|
-
Here: null
|
|
5195
|
-
}
|
|
5196
|
-
}
|
|
5197
|
-
}
|
|
5198
|
-
]
|
|
5199
|
-
};
|
|
5200
5120
|
var Interlay = {
|
|
5201
5121
|
relaychainSymbol: "DOT",
|
|
5202
5122
|
nativeAssetSymbol: "INTR",
|
|
@@ -15635,6 +15555,32 @@ var Ethereum = {
|
|
|
15635
15555
|
}
|
|
15636
15556
|
}
|
|
15637
15557
|
},
|
|
15558
|
+
{
|
|
15559
|
+
symbol: "CFG",
|
|
15560
|
+
assetId: "0xcccccccccc33d538dbc2ee4feab0a7a1ff4e8a94",
|
|
15561
|
+
decimals: 18,
|
|
15562
|
+
existentialDeposit: "1",
|
|
15563
|
+
location: {
|
|
15564
|
+
parents: 2,
|
|
15565
|
+
interior: {
|
|
15566
|
+
X2: [
|
|
15567
|
+
{
|
|
15568
|
+
GlobalConsensus: {
|
|
15569
|
+
Ethereum: {
|
|
15570
|
+
chainId: 1
|
|
15571
|
+
}
|
|
15572
|
+
}
|
|
15573
|
+
},
|
|
15574
|
+
{
|
|
15575
|
+
AccountKey20: {
|
|
15576
|
+
network: null,
|
|
15577
|
+
key: "0xcccccccccc33d538dbc2ee4feab0a7a1ff4e8a94"
|
|
15578
|
+
}
|
|
15579
|
+
}
|
|
15580
|
+
]
|
|
15581
|
+
}
|
|
15582
|
+
}
|
|
15583
|
+
},
|
|
15638
15584
|
{
|
|
15639
15585
|
symbol: "sUSDS",
|
|
15640
15586
|
assetId: "0xa3931d71877c0e7a3148cb7eb4463524fec27fbd",
|
|
@@ -15661,6 +15607,32 @@ var Ethereum = {
|
|
|
15661
15607
|
}
|
|
15662
15608
|
}
|
|
15663
15609
|
},
|
|
15610
|
+
{
|
|
15611
|
+
symbol: "WLD",
|
|
15612
|
+
assetId: "0x163f8c2467924be0ae7b5347228cabf260318753",
|
|
15613
|
+
decimals: 18,
|
|
15614
|
+
existentialDeposit: "1",
|
|
15615
|
+
location: {
|
|
15616
|
+
parents: 2,
|
|
15617
|
+
interior: {
|
|
15618
|
+
X2: [
|
|
15619
|
+
{
|
|
15620
|
+
GlobalConsensus: {
|
|
15621
|
+
Ethereum: {
|
|
15622
|
+
chainId: 1
|
|
15623
|
+
}
|
|
15624
|
+
}
|
|
15625
|
+
},
|
|
15626
|
+
{
|
|
15627
|
+
AccountKey20: {
|
|
15628
|
+
network: null,
|
|
15629
|
+
key: "0x163f8c2467924be0ae7b5347228cabf260318753"
|
|
15630
|
+
}
|
|
15631
|
+
}
|
|
15632
|
+
]
|
|
15633
|
+
}
|
|
15634
|
+
}
|
|
15635
|
+
},
|
|
15664
15636
|
{
|
|
15665
15637
|
symbol: "ENA",
|
|
15666
15638
|
assetId: "0x57e114b691db790c35207b2e685d4a43181e6061",
|
|
@@ -15921,6 +15893,32 @@ var Ethereum = {
|
|
|
15921
15893
|
}
|
|
15922
15894
|
}
|
|
15923
15895
|
},
|
|
15896
|
+
{
|
|
15897
|
+
symbol: "vTAO",
|
|
15898
|
+
assetId: "0xe9f6d9898f9269b519e1435e6ebaff766c7f46bf",
|
|
15899
|
+
decimals: 18,
|
|
15900
|
+
existentialDeposit: "1",
|
|
15901
|
+
location: {
|
|
15902
|
+
parents: 2,
|
|
15903
|
+
interior: {
|
|
15904
|
+
X2: [
|
|
15905
|
+
{
|
|
15906
|
+
GlobalConsensus: {
|
|
15907
|
+
Ethereum: {
|
|
15908
|
+
chainId: 1
|
|
15909
|
+
}
|
|
15910
|
+
}
|
|
15911
|
+
},
|
|
15912
|
+
{
|
|
15913
|
+
AccountKey20: {
|
|
15914
|
+
network: null,
|
|
15915
|
+
key: "0xe9f6d9898f9269b519e1435e6ebaff766c7f46bf"
|
|
15916
|
+
}
|
|
15917
|
+
}
|
|
15918
|
+
]
|
|
15919
|
+
}
|
|
15920
|
+
}
|
|
15921
|
+
},
|
|
15924
15922
|
{
|
|
15925
15923
|
symbol: "TONCOIN",
|
|
15926
15924
|
assetId: "0x582d872a1b094fc48f5de31d3b73f2d9be47def1",
|
|
@@ -20315,40 +20313,6 @@ var HydrationPaseo = {
|
|
|
20315
20313
|
}
|
|
20316
20314
|
]
|
|
20317
20315
|
};
|
|
20318
|
-
var IntegriteePaseo = {
|
|
20319
|
-
relaychainSymbol: "PAS",
|
|
20320
|
-
nativeAssetSymbol: "TEER",
|
|
20321
|
-
isEVM: false,
|
|
20322
|
-
ss58Prefix: 13,
|
|
20323
|
-
supportsDryRunApi: true,
|
|
20324
|
-
supportsXcmPaymentApi: true,
|
|
20325
|
-
nativeAssets: [
|
|
20326
|
-
{
|
|
20327
|
-
symbol: "TEER",
|
|
20328
|
-
isNative: true,
|
|
20329
|
-
decimals: 12,
|
|
20330
|
-
existentialDeposit: "1000000000",
|
|
20331
|
-
location: {
|
|
20332
|
-
parents: 1,
|
|
20333
|
-
interior: {
|
|
20334
|
-
X1: [
|
|
20335
|
-
{
|
|
20336
|
-
Parachain: 2039
|
|
20337
|
-
}
|
|
20338
|
-
]
|
|
20339
|
-
}
|
|
20340
|
-
}
|
|
20341
|
-
}
|
|
20342
|
-
],
|
|
20343
|
-
otherAssets: [
|
|
20344
|
-
{
|
|
20345
|
-
assetId: "0",
|
|
20346
|
-
symbol: "PAS",
|
|
20347
|
-
decimals: 10,
|
|
20348
|
-
existentialDeposit: "100000000"
|
|
20349
|
-
}
|
|
20350
|
-
]
|
|
20351
|
-
};
|
|
20352
20316
|
var KiltPaseo = {
|
|
20353
20317
|
relaychainSymbol: "PAS",
|
|
20354
20318
|
nativeAssetSymbol: "PILT",
|
|
@@ -20475,34 +20439,6 @@ var NeuroWebPaseo = {
|
|
|
20475
20439
|
}
|
|
20476
20440
|
]
|
|
20477
20441
|
};
|
|
20478
|
-
var NodlePaseo = {
|
|
20479
|
-
relaychainSymbol: "PAS",
|
|
20480
|
-
nativeAssetSymbol: "notNodl",
|
|
20481
|
-
isEVM: false,
|
|
20482
|
-
ss58Prefix: 37,
|
|
20483
|
-
supportsDryRunApi: false,
|
|
20484
|
-
supportsXcmPaymentApi: false,
|
|
20485
|
-
nativeAssets: [
|
|
20486
|
-
{
|
|
20487
|
-
symbol: "notNodl",
|
|
20488
|
-
isNative: true,
|
|
20489
|
-
decimals: 11,
|
|
20490
|
-
existentialDeposit: "10000",
|
|
20491
|
-
location: {
|
|
20492
|
-
parents: 1,
|
|
20493
|
-
interior: {
|
|
20494
|
-
X1: [
|
|
20495
|
-
{
|
|
20496
|
-
Parachain: 2026
|
|
20497
|
-
}
|
|
20498
|
-
]
|
|
20499
|
-
}
|
|
20500
|
-
}
|
|
20501
|
-
}
|
|
20502
|
-
],
|
|
20503
|
-
otherAssets: [
|
|
20504
|
-
]
|
|
20505
|
-
};
|
|
20506
20442
|
var ZeitgeistPaseo = {
|
|
20507
20443
|
relaychainSymbol: "PAS",
|
|
20508
20444
|
nativeAssetSymbol: "ZBS",
|
|
@@ -20634,8 +20570,6 @@ var assetsMapJson = {
|
|
|
20634
20570
|
Darwinia: Darwinia,
|
|
20635
20571
|
EnergyWebX: EnergyWebX,
|
|
20636
20572
|
Hydration: Hydration,
|
|
20637
|
-
IntegriteePolkadot: IntegriteePolkadot,
|
|
20638
|
-
IntegriteeKusama: IntegriteeKusama,
|
|
20639
20573
|
Interlay: Interlay,
|
|
20640
20574
|
Heima: Heima,
|
|
20641
20575
|
Moonbeam: Moonbeam,
|
|
@@ -20692,11 +20626,9 @@ var assetsMapJson = {
|
|
|
20692
20626
|
HeimaPaseo: HeimaPaseo,
|
|
20693
20627
|
EnergyWebXPaseo: EnergyWebXPaseo,
|
|
20694
20628
|
HydrationPaseo: HydrationPaseo,
|
|
20695
|
-
IntegriteePaseo: IntegriteePaseo,
|
|
20696
20629
|
KiltPaseo: KiltPaseo,
|
|
20697
20630
|
LaosPaseo: LaosPaseo,
|
|
20698
20631
|
NeuroWebPaseo: NeuroWebPaseo,
|
|
20699
|
-
NodlePaseo: NodlePaseo,
|
|
20700
20632
|
ZeitgeistPaseo: ZeitgeistPaseo
|
|
20701
20633
|
};
|
|
20702
20634
|
|
|
@@ -20708,8 +20640,10 @@ var assetsMapJson = {
|
|
|
20708
20640
|
*/
|
|
20709
20641
|
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
20710
20642
|
if (!symbol) return '';
|
|
20711
|
-
var
|
|
20712
|
-
|
|
20643
|
+
var s = symbol.toLowerCase();
|
|
20644
|
+
if (s.startsWith('xc')) s = s.substring(2);
|
|
20645
|
+
if (s.endsWith('.e')) s = s.slice(0, -2);
|
|
20646
|
+
return s;
|
|
20713
20647
|
};
|
|
20714
20648
|
|
|
20715
20649
|
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
@@ -20732,15 +20666,6 @@ var isTAsset = function isTAsset(value) {
|
|
|
20732
20666
|
return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
|
|
20733
20667
|
};
|
|
20734
20668
|
|
|
20735
|
-
var filterEthCompatibleAssets = function filterEthCompatibleAssets(assets) {
|
|
20736
|
-
var ethAssets = getOtherAssets('Ethereum');
|
|
20737
|
-
return assets.filter(function (asset) {
|
|
20738
|
-
var location = asset.location;
|
|
20739
|
-
if (!location) return false;
|
|
20740
|
-
return Boolean(findAssetInfoByLoc(ethAssets, location));
|
|
20741
|
-
});
|
|
20742
|
-
};
|
|
20743
|
-
|
|
20744
20669
|
/**
|
|
20745
20670
|
* Error thrown when multiple assets with the same symbol are found.
|
|
20746
20671
|
*/
|
|
@@ -20952,15 +20877,21 @@ var removePrefix = function removePrefix(symbol) {
|
|
|
20952
20877
|
var removeSuffix = function removeSuffix(symbol) {
|
|
20953
20878
|
return symbol.slice(0, -2);
|
|
20954
20879
|
};
|
|
20955
|
-
var findEthAssetBySymbol = function findEthAssetBySymbol(symbol) {
|
|
20956
|
-
var
|
|
20957
|
-
|
|
20880
|
+
var findEthAssetBySymbol = function findEthAssetBySymbol(symbol, otherAssets) {
|
|
20881
|
+
var ethCompatibleAssets = otherAssets.filter(function (asset) {
|
|
20882
|
+
return asset.location && sdkCommon.deepEqual(sdkCommon.getJunctionValue(asset.location, 'GlobalConsensus'), {
|
|
20883
|
+
Ethereum: {
|
|
20884
|
+
chainId: 1
|
|
20885
|
+
}
|
|
20886
|
+
});
|
|
20887
|
+
});
|
|
20888
|
+
return findBestMatches(ethCompatibleAssets, symbol)[0];
|
|
20958
20889
|
};
|
|
20959
|
-
var findEthMatch = function findEthMatch(symbol) {
|
|
20960
|
-
var match = findEthAssetBySymbol(symbol);
|
|
20890
|
+
var findEthMatch = function findEthMatch(symbol, otherAssets) {
|
|
20891
|
+
var match = findEthAssetBySymbol(symbol, otherAssets);
|
|
20961
20892
|
if (match) return match;
|
|
20962
20893
|
var altSymbol = symbol.toLowerCase().endsWith('.e') ? removeSuffix(symbol) : "".concat(symbol, ".e");
|
|
20963
|
-
return findEthAssetBySymbol(altSymbol.toLowerCase());
|
|
20894
|
+
return findEthAssetBySymbol(altSymbol.toLowerCase(), otherAssets);
|
|
20964
20895
|
};
|
|
20965
20896
|
var findWithXcVariant = function findWithXcVariant(items, value) {
|
|
20966
20897
|
var lower = value.toLowerCase();
|
|
@@ -20994,7 +20925,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
20994
20925
|
var lowerSymbol = value.toLowerCase();
|
|
20995
20926
|
var otherAssetsMatches = [];
|
|
20996
20927
|
if (destination === 'Ethereum') {
|
|
20997
|
-
return findEthMatch(value);
|
|
20928
|
+
return findEthMatch(value, otherAssets);
|
|
20998
20929
|
}
|
|
20999
20930
|
if (lowerSymbol.endsWith('.e')) {
|
|
21000
20931
|
// Symbol ends with '.e', indicating a Snowbridge asset
|
|
@@ -21006,7 +20937,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21006
20937
|
otherAssetsMatches = findWithXcVariant(otherAssets, value);
|
|
21007
20938
|
foundAsset = pickOtherOrThrow(value, otherAssetsMatches);
|
|
21008
20939
|
if (foundAsset) return foundAsset;
|
|
21009
|
-
var ethAsset = findEthAssetBySymbol(strippedSymbol);
|
|
20940
|
+
var ethAsset = findEthAssetBySymbol(strippedSymbol, otherAssets);
|
|
21010
20941
|
if (ethAsset) return ethAsset;
|
|
21011
20942
|
// If still not found, search normal assets without suffix
|
|
21012
20943
|
otherAssetsMatches = findBestMatches(otherAssets, strippedSymbol);
|
|
@@ -21030,7 +20961,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21030
20961
|
var _otherAssetsMatches = [];
|
|
21031
20962
|
var nativeAssetsMatches = [];
|
|
21032
20963
|
if (destination === 'Ethereum') {
|
|
21033
|
-
return findEthMatch(symbol);
|
|
20964
|
+
return findEthMatch(symbol, otherAssets);
|
|
21034
20965
|
}
|
|
21035
20966
|
if (_lowerSymbol.endsWith('.e')) {
|
|
21036
20967
|
// Symbol ends with '.e', indicating a Snowbridge asset
|
|
@@ -21045,7 +20976,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21045
20976
|
var _foundAsset = pickOtherOrThrow(symbol, _otherAssetsMatches);
|
|
21046
20977
|
if (_foundAsset) return _foundAsset;
|
|
21047
20978
|
// Search in Ethereum assets without the '.e' suffix
|
|
21048
|
-
var _ethAsset = findEthAssetBySymbol(_strippedSymbol);
|
|
20979
|
+
var _ethAsset = findEthAssetBySymbol(_strippedSymbol, otherAssets);
|
|
21049
20980
|
if (_ethAsset) return _ethAsset;
|
|
21050
20981
|
// If still not found, search normal assets without suffix
|
|
21051
20982
|
_otherAssetsMatches = findBestMatches(otherAssets, _strippedSymbol);
|
|
@@ -21074,34 +21005,22 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
|
|
|
21074
21005
|
var _getAssetsObject = getAssetsObject(chain),
|
|
21075
21006
|
otherAssets = _getAssetsObject.otherAssets,
|
|
21076
21007
|
nativeAssets = _getAssetsObject.nativeAssets;
|
|
21077
|
-
var isEthereumDestination = destination === 'Ethereum';
|
|
21078
|
-
var getEthereumAssets = function getEthereumAssets() {
|
|
21079
|
-
return getOtherAssets('Ethereum');
|
|
21080
|
-
};
|
|
21081
|
-
var getFilteredEthereumAssets = function getFilteredEthereumAssets() {
|
|
21082
|
-
return filterEthCompatibleAssets(otherAssets);
|
|
21083
|
-
};
|
|
21084
21008
|
var asset;
|
|
21085
21009
|
if ('symbol' in currency) {
|
|
21086
|
-
|
|
21087
|
-
// If not found, search Ethereum assets directly
|
|
21088
|
-
if (isEthereumDestination) {
|
|
21089
|
-
var _findAssetInfoBySymbo;
|
|
21090
|
-
asset = (_findAssetInfoBySymbo = findAssetInfoBySymbol(destination, getFilteredEthereumAssets(), nativeAssets, currency.symbol)) !== null && _findAssetInfoBySymbo !== void 0 ? _findAssetInfoBySymbo : findAssetInfoBySymbol(destination, getEthereumAssets(), nativeAssets, currency.symbol);
|
|
21091
|
-
} else {
|
|
21092
|
-
asset = findAssetInfoBySymbol(destination, otherAssets, nativeAssets, currency.symbol);
|
|
21093
|
-
}
|
|
21010
|
+
asset = findAssetInfoBySymbol(destination, otherAssets, nativeAssets, currency.symbol);
|
|
21094
21011
|
} else if ('location' in currency && !isOverrideLocationSpecifier(currency.location)) {
|
|
21095
21012
|
var _findAssetInfoByLoc;
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
|
|
21099
|
-
if (
|
|
21100
|
-
var
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21013
|
+
asset = (_findAssetInfoByLoc = findAssetInfoByLoc(otherAssets, currency.location)) !== null && _findAssetInfoByLoc !== void 0 ? _findAssetInfoByLoc : findAssetInfoByLoc(nativeAssets, currency.location);
|
|
21014
|
+
// Temporary condition for Mythos to allow selecting by Etheruem MYTH location
|
|
21015
|
+
// Will be removed in v12
|
|
21016
|
+
if (chain === 'Mythos') {
|
|
21017
|
+
var mythEthAsset = getOtherAssets('Ethereum').find(function (a) {
|
|
21018
|
+
return a.symbol === 'MYTH';
|
|
21019
|
+
});
|
|
21020
|
+
if (mythEthAsset && findAssetInfoByLoc([mythEthAsset], currency.location)) asset = nativeAssets[0];
|
|
21104
21021
|
}
|
|
21022
|
+
} else if ('id' in currency) {
|
|
21023
|
+
asset = findAssetInfoById(otherAssets, currency.id);
|
|
21105
21024
|
}
|
|
21106
21025
|
return asset !== null && asset !== void 0 ? asset : null;
|
|
21107
21026
|
};
|
|
@@ -21132,8 +21051,7 @@ var Override = function Override(location) {
|
|
|
21132
21051
|
};
|
|
21133
21052
|
|
|
21134
21053
|
var findAssetInfoOrThrow = function findAssetInfoOrThrow(chain, currency, destination) {
|
|
21135
|
-
var
|
|
21136
|
-
var asset = (_findAssetInfo = findAssetInfo(chain, currency, destination)) !== null && _findAssetInfo !== void 0 ? _findAssetInfo : chain === 'AssetHubPolkadot' || chain === 'Mythos' ? findAssetInfo('Ethereum', currency, null) : null;
|
|
21054
|
+
var asset = findAssetInfo(chain, currency, destination);
|
|
21137
21055
|
if (!asset) {
|
|
21138
21056
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency, sdkCommon.replaceBigInt), " not found on ").concat(chain));
|
|
21139
21057
|
}
|
|
@@ -21305,8 +21223,7 @@ var getNativeAssets = function getNativeAssets(chain) {
|
|
|
21305
21223
|
* @returns An array of other asset details.
|
|
21306
21224
|
*/
|
|
21307
21225
|
var getOtherAssets = function getOtherAssets(chain) {
|
|
21308
|
-
|
|
21309
|
-
return chain === 'AssetHubPolkadot' ? [].concat(_toConsumableArray(otherAssets), _toConsumableArray(getAssetsObject('Ethereum').otherAssets)) : otherAssets;
|
|
21226
|
+
return getAssetsObject(chain).otherAssets;
|
|
21310
21227
|
};
|
|
21311
21228
|
/**
|
|
21312
21229
|
* Retrieves the complete list of assets for a specified chain, including relay chain asset, native, and other assets.
|
|
@@ -21338,11 +21255,7 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
|
|
|
21338
21255
|
var symbol = _ref2.symbol;
|
|
21339
21256
|
return symbol;
|
|
21340
21257
|
});
|
|
21341
|
-
|
|
21342
|
-
var symbol = _ref3.symbol;
|
|
21343
|
-
return symbol;
|
|
21344
|
-
}) : [];
|
|
21345
|
-
return [].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols), _toConsumableArray(ethAssetsSymbols));
|
|
21258
|
+
return [].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols));
|
|
21346
21259
|
};
|
|
21347
21260
|
/**
|
|
21348
21261
|
* Retrieves the symbol of the native asset for a specified chain.
|
|
@@ -21351,7 +21264,6 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
|
|
|
21351
21264
|
* @returns The symbol of the native asset.
|
|
21352
21265
|
*/
|
|
21353
21266
|
var getNativeAssetSymbol = function getNativeAssetSymbol(chain) {
|
|
21354
|
-
if (chain === 'Ethereum') return 'ETH';
|
|
21355
21267
|
return getAssetsObject(chain).nativeAssetSymbol;
|
|
21356
21268
|
};
|
|
21357
21269
|
/**
|
|
@@ -21407,7 +21319,7 @@ var hasDryRunSupport = function hasDryRunSupport(chain) {
|
|
|
21407
21319
|
};
|
|
21408
21320
|
var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
21409
21321
|
// These chains have XcmPaymentApi but it's not working
|
|
21410
|
-
var DISABLED_CHAINS = ['
|
|
21322
|
+
var DISABLED_CHAINS = ['Basilisk', 'Jamton'];
|
|
21411
21323
|
return getAssetsObject(chain).supportsXcmPaymentApi && !DISABLED_CHAINS.includes(chain);
|
|
21412
21324
|
};
|
|
21413
21325
|
|
|
@@ -21421,21 +21333,8 @@ var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
|
21421
21333
|
var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
21422
21334
|
var originAssets = getAssets(origin);
|
|
21423
21335
|
var destinationAssets = getAssets(destination);
|
|
21424
|
-
|
|
21425
|
-
|
|
21426
|
-
var ethereumCompatibleAssets = filterEthCompatibleAssets(otherAssets);
|
|
21427
|
-
var ethereumAssets = getOtherAssets('Ethereum');
|
|
21428
|
-
if (origin === 'Moonbeam') {
|
|
21429
|
-
return ethereumCompatibleAssets;
|
|
21430
|
-
}
|
|
21431
|
-
if (origin === 'Mythos') {
|
|
21432
|
-
return ethereumAssets.filter(function (asset) {
|
|
21433
|
-
return isSymbolMatch(asset.symbol, getNativeAssetSymbol(origin));
|
|
21434
|
-
});
|
|
21435
|
-
}
|
|
21436
|
-
return [].concat(_toConsumableArray(ethereumCompatibleAssets), _toConsumableArray(ethereumAssets));
|
|
21437
|
-
}
|
|
21438
|
-
if (origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot') {
|
|
21336
|
+
var isSubBridge = sdkCommon.isSubstrateBridge(origin, destination);
|
|
21337
|
+
if (isSubBridge) {
|
|
21439
21338
|
return originAssets.filter(function (asset) {
|
|
21440
21339
|
return asset.symbol === 'KSM' || asset.symbol === 'DOT';
|
|
21441
21340
|
});
|
|
@@ -21445,16 +21344,6 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
|
21445
21344
|
return normalizeSymbol(a.symbol) === normalizeSymbol(asset.symbol);
|
|
21446
21345
|
});
|
|
21447
21346
|
});
|
|
21448
|
-
if (origin === 'AssetHubPolkadot' && destination === 'BifrostPolkadot') {
|
|
21449
|
-
var wethAsset = getOtherAssets('Ethereum').find(function (_ref) {
|
|
21450
|
-
var symbol = _ref.symbol;
|
|
21451
|
-
return symbol === 'WETH';
|
|
21452
|
-
});
|
|
21453
|
-
if (wethAsset) supportedAssets.push({
|
|
21454
|
-
assetId: wethAsset.assetId,
|
|
21455
|
-
symbol: "".concat(wethAsset.symbol, ".e")
|
|
21456
|
-
});
|
|
21457
|
-
}
|
|
21458
21347
|
return supportedAssets;
|
|
21459
21348
|
};
|
|
21460
21349
|
|
|
@@ -21508,7 +21397,6 @@ exports.Override = Override;
|
|
|
21508
21397
|
exports.assertEdDefined = assertEdDefined;
|
|
21509
21398
|
exports.compareLocations = compareLocations;
|
|
21510
21399
|
exports.extractAssetLocation = extractAssetLocation;
|
|
21511
|
-
exports.filterEthCompatibleAssets = filterEthCompatibleAssets;
|
|
21512
21400
|
exports.findAssetInfo = findAssetInfo;
|
|
21513
21401
|
exports.findAssetInfoById = findAssetInfoById;
|
|
21514
21402
|
exports.findAssetInfoByLoc = findAssetInfoByLoc;
|
package/dist/index.d.ts
CHANGED
|
@@ -188,8 +188,6 @@ declare const Foreign: (symbol: string) => TSymbolSpecifier;
|
|
|
188
188
|
declare const ForeignAbstract: (symbol: string) => TSymbolSpecifier;
|
|
189
189
|
declare const Override: (location: TLocation) => TOverrideLocationSpecifier;
|
|
190
190
|
|
|
191
|
-
declare const filterEthCompatibleAssets: (assets: TForeignAssetInfo[]) => TForeignAssetInfo[];
|
|
192
|
-
|
|
193
191
|
/**
|
|
194
192
|
* Retrieves the list of assets that are supported for transfers between two specified chains.
|
|
195
193
|
*
|
|
@@ -224,7 +222,7 @@ declare const normalizeLocation: (location: TLocation, version?: Version) => TLo
|
|
|
224
222
|
* @param symbol - The symbol to normalize.
|
|
225
223
|
* @returns The normalized symbol.
|
|
226
224
|
*/
|
|
227
|
-
declare const normalizeSymbol: (symbol
|
|
225
|
+
declare const normalizeSymbol: (symbol?: string) => string;
|
|
228
226
|
|
|
229
227
|
declare const findAssetInfo: (chain: TChain, currency: TCurrencyInput, destination: TChain | null) => TAssetInfo | null;
|
|
230
228
|
|
|
@@ -294,5 +292,5 @@ declare const extractAssetLocation: <T = bigint>(asset: TAsset<T>) => TLocation;
|
|
|
294
292
|
|
|
295
293
|
declare const getAssetLocation: (chain: TChain, currency: TCurrencyInput) => TLocation | null;
|
|
296
294
|
|
|
297
|
-
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, compareLocations, extractAssetLocation,
|
|
295
|
+
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, compareLocations, extractAssetLocation, 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 };
|
|
298
296
|
export type { TAmount, TAsset, TAssetInfo, TAssetJsonMap, TAssetV3, TAssetV4, TAssetWithFee, TAssetWithLocation, TBaseAssetInfo, TChainAssetsInfo, TCurrency, TCurrencyCore, TCurrencyInput, TCurrencyInputWithAmount, TCurrencySymbol, TCurrencySymbolValue, TForeignAssetInfo, TForeignAssetWithId, TLocationValue, TLocationValueWithOverride, TNativeAssetInfo, TOverrideLocationSpecifier, TSymbolSpecifier, WithAmount, WithComplexAmount };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Version, deepEqual, replaceBigInt, isSubstrateBridge, CHAINS } from '@paraspell/sdk-common';
|
|
1
|
+
import { Version, deepEqual, getJunctionValue, replaceBigInt, isSubstrateBridge, CHAINS } from '@paraspell/sdk-common';
|
|
2
2
|
|
|
3
3
|
function _arrayLikeToArray(r, a) {
|
|
4
4
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -5115,86 +5115,6 @@ var Hydration = {
|
|
|
5115
5115
|
}
|
|
5116
5116
|
]
|
|
5117
5117
|
};
|
|
5118
|
-
var IntegriteePolkadot = {
|
|
5119
|
-
relaychainSymbol: "DOT",
|
|
5120
|
-
nativeAssetSymbol: "TEER",
|
|
5121
|
-
isEVM: false,
|
|
5122
|
-
ss58Prefix: 13,
|
|
5123
|
-
supportsDryRunApi: true,
|
|
5124
|
-
supportsXcmPaymentApi: true,
|
|
5125
|
-
nativeAssets: [
|
|
5126
|
-
{
|
|
5127
|
-
symbol: "TEER",
|
|
5128
|
-
isNative: true,
|
|
5129
|
-
decimals: 12,
|
|
5130
|
-
existentialDeposit: "1000000000",
|
|
5131
|
-
location: {
|
|
5132
|
-
parents: 1,
|
|
5133
|
-
interior: {
|
|
5134
|
-
X1: [
|
|
5135
|
-
{
|
|
5136
|
-
Parachain: 2039
|
|
5137
|
-
}
|
|
5138
|
-
]
|
|
5139
|
-
}
|
|
5140
|
-
}
|
|
5141
|
-
}
|
|
5142
|
-
],
|
|
5143
|
-
otherAssets: [
|
|
5144
|
-
{
|
|
5145
|
-
assetId: "0",
|
|
5146
|
-
symbol: "DOT",
|
|
5147
|
-
decimals: 10,
|
|
5148
|
-
existentialDeposit: "100000000",
|
|
5149
|
-
location: {
|
|
5150
|
-
parents: 1,
|
|
5151
|
-
interior: {
|
|
5152
|
-
Here: null
|
|
5153
|
-
}
|
|
5154
|
-
}
|
|
5155
|
-
}
|
|
5156
|
-
]
|
|
5157
|
-
};
|
|
5158
|
-
var IntegriteeKusama = {
|
|
5159
|
-
relaychainSymbol: "KSM",
|
|
5160
|
-
nativeAssetSymbol: "TEER",
|
|
5161
|
-
isEVM: false,
|
|
5162
|
-
ss58Prefix: 13,
|
|
5163
|
-
supportsDryRunApi: true,
|
|
5164
|
-
supportsXcmPaymentApi: true,
|
|
5165
|
-
nativeAssets: [
|
|
5166
|
-
{
|
|
5167
|
-
symbol: "TEER",
|
|
5168
|
-
isNative: true,
|
|
5169
|
-
decimals: 12,
|
|
5170
|
-
existentialDeposit: "1000000000",
|
|
5171
|
-
location: {
|
|
5172
|
-
parents: 1,
|
|
5173
|
-
interior: {
|
|
5174
|
-
X1: [
|
|
5175
|
-
{
|
|
5176
|
-
Parachain: 2015
|
|
5177
|
-
}
|
|
5178
|
-
]
|
|
5179
|
-
}
|
|
5180
|
-
}
|
|
5181
|
-
}
|
|
5182
|
-
],
|
|
5183
|
-
otherAssets: [
|
|
5184
|
-
{
|
|
5185
|
-
assetId: "0",
|
|
5186
|
-
symbol: "KSM",
|
|
5187
|
-
decimals: 12,
|
|
5188
|
-
existentialDeposit: "3333333",
|
|
5189
|
-
location: {
|
|
5190
|
-
parents: 1,
|
|
5191
|
-
interior: {
|
|
5192
|
-
Here: null
|
|
5193
|
-
}
|
|
5194
|
-
}
|
|
5195
|
-
}
|
|
5196
|
-
]
|
|
5197
|
-
};
|
|
5198
5118
|
var Interlay = {
|
|
5199
5119
|
relaychainSymbol: "DOT",
|
|
5200
5120
|
nativeAssetSymbol: "INTR",
|
|
@@ -15633,6 +15553,32 @@ var Ethereum = {
|
|
|
15633
15553
|
}
|
|
15634
15554
|
}
|
|
15635
15555
|
},
|
|
15556
|
+
{
|
|
15557
|
+
symbol: "CFG",
|
|
15558
|
+
assetId: "0xcccccccccc33d538dbc2ee4feab0a7a1ff4e8a94",
|
|
15559
|
+
decimals: 18,
|
|
15560
|
+
existentialDeposit: "1",
|
|
15561
|
+
location: {
|
|
15562
|
+
parents: 2,
|
|
15563
|
+
interior: {
|
|
15564
|
+
X2: [
|
|
15565
|
+
{
|
|
15566
|
+
GlobalConsensus: {
|
|
15567
|
+
Ethereum: {
|
|
15568
|
+
chainId: 1
|
|
15569
|
+
}
|
|
15570
|
+
}
|
|
15571
|
+
},
|
|
15572
|
+
{
|
|
15573
|
+
AccountKey20: {
|
|
15574
|
+
network: null,
|
|
15575
|
+
key: "0xcccccccccc33d538dbc2ee4feab0a7a1ff4e8a94"
|
|
15576
|
+
}
|
|
15577
|
+
}
|
|
15578
|
+
]
|
|
15579
|
+
}
|
|
15580
|
+
}
|
|
15581
|
+
},
|
|
15636
15582
|
{
|
|
15637
15583
|
symbol: "sUSDS",
|
|
15638
15584
|
assetId: "0xa3931d71877c0e7a3148cb7eb4463524fec27fbd",
|
|
@@ -15659,6 +15605,32 @@ var Ethereum = {
|
|
|
15659
15605
|
}
|
|
15660
15606
|
}
|
|
15661
15607
|
},
|
|
15608
|
+
{
|
|
15609
|
+
symbol: "WLD",
|
|
15610
|
+
assetId: "0x163f8c2467924be0ae7b5347228cabf260318753",
|
|
15611
|
+
decimals: 18,
|
|
15612
|
+
existentialDeposit: "1",
|
|
15613
|
+
location: {
|
|
15614
|
+
parents: 2,
|
|
15615
|
+
interior: {
|
|
15616
|
+
X2: [
|
|
15617
|
+
{
|
|
15618
|
+
GlobalConsensus: {
|
|
15619
|
+
Ethereum: {
|
|
15620
|
+
chainId: 1
|
|
15621
|
+
}
|
|
15622
|
+
}
|
|
15623
|
+
},
|
|
15624
|
+
{
|
|
15625
|
+
AccountKey20: {
|
|
15626
|
+
network: null,
|
|
15627
|
+
key: "0x163f8c2467924be0ae7b5347228cabf260318753"
|
|
15628
|
+
}
|
|
15629
|
+
}
|
|
15630
|
+
]
|
|
15631
|
+
}
|
|
15632
|
+
}
|
|
15633
|
+
},
|
|
15662
15634
|
{
|
|
15663
15635
|
symbol: "ENA",
|
|
15664
15636
|
assetId: "0x57e114b691db790c35207b2e685d4a43181e6061",
|
|
@@ -15919,6 +15891,32 @@ var Ethereum = {
|
|
|
15919
15891
|
}
|
|
15920
15892
|
}
|
|
15921
15893
|
},
|
|
15894
|
+
{
|
|
15895
|
+
symbol: "vTAO",
|
|
15896
|
+
assetId: "0xe9f6d9898f9269b519e1435e6ebaff766c7f46bf",
|
|
15897
|
+
decimals: 18,
|
|
15898
|
+
existentialDeposit: "1",
|
|
15899
|
+
location: {
|
|
15900
|
+
parents: 2,
|
|
15901
|
+
interior: {
|
|
15902
|
+
X2: [
|
|
15903
|
+
{
|
|
15904
|
+
GlobalConsensus: {
|
|
15905
|
+
Ethereum: {
|
|
15906
|
+
chainId: 1
|
|
15907
|
+
}
|
|
15908
|
+
}
|
|
15909
|
+
},
|
|
15910
|
+
{
|
|
15911
|
+
AccountKey20: {
|
|
15912
|
+
network: null,
|
|
15913
|
+
key: "0xe9f6d9898f9269b519e1435e6ebaff766c7f46bf"
|
|
15914
|
+
}
|
|
15915
|
+
}
|
|
15916
|
+
]
|
|
15917
|
+
}
|
|
15918
|
+
}
|
|
15919
|
+
},
|
|
15922
15920
|
{
|
|
15923
15921
|
symbol: "TONCOIN",
|
|
15924
15922
|
assetId: "0x582d872a1b094fc48f5de31d3b73f2d9be47def1",
|
|
@@ -20313,40 +20311,6 @@ var HydrationPaseo = {
|
|
|
20313
20311
|
}
|
|
20314
20312
|
]
|
|
20315
20313
|
};
|
|
20316
|
-
var IntegriteePaseo = {
|
|
20317
|
-
relaychainSymbol: "PAS",
|
|
20318
|
-
nativeAssetSymbol: "TEER",
|
|
20319
|
-
isEVM: false,
|
|
20320
|
-
ss58Prefix: 13,
|
|
20321
|
-
supportsDryRunApi: true,
|
|
20322
|
-
supportsXcmPaymentApi: true,
|
|
20323
|
-
nativeAssets: [
|
|
20324
|
-
{
|
|
20325
|
-
symbol: "TEER",
|
|
20326
|
-
isNative: true,
|
|
20327
|
-
decimals: 12,
|
|
20328
|
-
existentialDeposit: "1000000000",
|
|
20329
|
-
location: {
|
|
20330
|
-
parents: 1,
|
|
20331
|
-
interior: {
|
|
20332
|
-
X1: [
|
|
20333
|
-
{
|
|
20334
|
-
Parachain: 2039
|
|
20335
|
-
}
|
|
20336
|
-
]
|
|
20337
|
-
}
|
|
20338
|
-
}
|
|
20339
|
-
}
|
|
20340
|
-
],
|
|
20341
|
-
otherAssets: [
|
|
20342
|
-
{
|
|
20343
|
-
assetId: "0",
|
|
20344
|
-
symbol: "PAS",
|
|
20345
|
-
decimals: 10,
|
|
20346
|
-
existentialDeposit: "100000000"
|
|
20347
|
-
}
|
|
20348
|
-
]
|
|
20349
|
-
};
|
|
20350
20314
|
var KiltPaseo = {
|
|
20351
20315
|
relaychainSymbol: "PAS",
|
|
20352
20316
|
nativeAssetSymbol: "PILT",
|
|
@@ -20473,34 +20437,6 @@ var NeuroWebPaseo = {
|
|
|
20473
20437
|
}
|
|
20474
20438
|
]
|
|
20475
20439
|
};
|
|
20476
|
-
var NodlePaseo = {
|
|
20477
|
-
relaychainSymbol: "PAS",
|
|
20478
|
-
nativeAssetSymbol: "notNodl",
|
|
20479
|
-
isEVM: false,
|
|
20480
|
-
ss58Prefix: 37,
|
|
20481
|
-
supportsDryRunApi: false,
|
|
20482
|
-
supportsXcmPaymentApi: false,
|
|
20483
|
-
nativeAssets: [
|
|
20484
|
-
{
|
|
20485
|
-
symbol: "notNodl",
|
|
20486
|
-
isNative: true,
|
|
20487
|
-
decimals: 11,
|
|
20488
|
-
existentialDeposit: "10000",
|
|
20489
|
-
location: {
|
|
20490
|
-
parents: 1,
|
|
20491
|
-
interior: {
|
|
20492
|
-
X1: [
|
|
20493
|
-
{
|
|
20494
|
-
Parachain: 2026
|
|
20495
|
-
}
|
|
20496
|
-
]
|
|
20497
|
-
}
|
|
20498
|
-
}
|
|
20499
|
-
}
|
|
20500
|
-
],
|
|
20501
|
-
otherAssets: [
|
|
20502
|
-
]
|
|
20503
|
-
};
|
|
20504
20440
|
var ZeitgeistPaseo = {
|
|
20505
20441
|
relaychainSymbol: "PAS",
|
|
20506
20442
|
nativeAssetSymbol: "ZBS",
|
|
@@ -20632,8 +20568,6 @@ var assetsMapJson = {
|
|
|
20632
20568
|
Darwinia: Darwinia,
|
|
20633
20569
|
EnergyWebX: EnergyWebX,
|
|
20634
20570
|
Hydration: Hydration,
|
|
20635
|
-
IntegriteePolkadot: IntegriteePolkadot,
|
|
20636
|
-
IntegriteeKusama: IntegriteeKusama,
|
|
20637
20571
|
Interlay: Interlay,
|
|
20638
20572
|
Heima: Heima,
|
|
20639
20573
|
Moonbeam: Moonbeam,
|
|
@@ -20690,11 +20624,9 @@ var assetsMapJson = {
|
|
|
20690
20624
|
HeimaPaseo: HeimaPaseo,
|
|
20691
20625
|
EnergyWebXPaseo: EnergyWebXPaseo,
|
|
20692
20626
|
HydrationPaseo: HydrationPaseo,
|
|
20693
|
-
IntegriteePaseo: IntegriteePaseo,
|
|
20694
20627
|
KiltPaseo: KiltPaseo,
|
|
20695
20628
|
LaosPaseo: LaosPaseo,
|
|
20696
20629
|
NeuroWebPaseo: NeuroWebPaseo,
|
|
20697
|
-
NodlePaseo: NodlePaseo,
|
|
20698
20630
|
ZeitgeistPaseo: ZeitgeistPaseo
|
|
20699
20631
|
};
|
|
20700
20632
|
|
|
@@ -20706,8 +20638,10 @@ var assetsMapJson = {
|
|
|
20706
20638
|
*/
|
|
20707
20639
|
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
20708
20640
|
if (!symbol) return '';
|
|
20709
|
-
var
|
|
20710
|
-
|
|
20641
|
+
var s = symbol.toLowerCase();
|
|
20642
|
+
if (s.startsWith('xc')) s = s.substring(2);
|
|
20643
|
+
if (s.endsWith('.e')) s = s.slice(0, -2);
|
|
20644
|
+
return s;
|
|
20711
20645
|
};
|
|
20712
20646
|
|
|
20713
20647
|
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
@@ -20730,15 +20664,6 @@ var isTAsset = function isTAsset(value) {
|
|
|
20730
20664
|
return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
|
|
20731
20665
|
};
|
|
20732
20666
|
|
|
20733
|
-
var filterEthCompatibleAssets = function filterEthCompatibleAssets(assets) {
|
|
20734
|
-
var ethAssets = getOtherAssets('Ethereum');
|
|
20735
|
-
return assets.filter(function (asset) {
|
|
20736
|
-
var location = asset.location;
|
|
20737
|
-
if (!location) return false;
|
|
20738
|
-
return Boolean(findAssetInfoByLoc(ethAssets, location));
|
|
20739
|
-
});
|
|
20740
|
-
};
|
|
20741
|
-
|
|
20742
20667
|
/**
|
|
20743
20668
|
* Error thrown when multiple assets with the same symbol are found.
|
|
20744
20669
|
*/
|
|
@@ -20950,15 +20875,21 @@ var removePrefix = function removePrefix(symbol) {
|
|
|
20950
20875
|
var removeSuffix = function removeSuffix(symbol) {
|
|
20951
20876
|
return symbol.slice(0, -2);
|
|
20952
20877
|
};
|
|
20953
|
-
var findEthAssetBySymbol = function findEthAssetBySymbol(symbol) {
|
|
20954
|
-
var
|
|
20955
|
-
|
|
20878
|
+
var findEthAssetBySymbol = function findEthAssetBySymbol(symbol, otherAssets) {
|
|
20879
|
+
var ethCompatibleAssets = otherAssets.filter(function (asset) {
|
|
20880
|
+
return asset.location && deepEqual(getJunctionValue(asset.location, 'GlobalConsensus'), {
|
|
20881
|
+
Ethereum: {
|
|
20882
|
+
chainId: 1
|
|
20883
|
+
}
|
|
20884
|
+
});
|
|
20885
|
+
});
|
|
20886
|
+
return findBestMatches(ethCompatibleAssets, symbol)[0];
|
|
20956
20887
|
};
|
|
20957
|
-
var findEthMatch = function findEthMatch(symbol) {
|
|
20958
|
-
var match = findEthAssetBySymbol(symbol);
|
|
20888
|
+
var findEthMatch = function findEthMatch(symbol, otherAssets) {
|
|
20889
|
+
var match = findEthAssetBySymbol(symbol, otherAssets);
|
|
20959
20890
|
if (match) return match;
|
|
20960
20891
|
var altSymbol = symbol.toLowerCase().endsWith('.e') ? removeSuffix(symbol) : "".concat(symbol, ".e");
|
|
20961
|
-
return findEthAssetBySymbol(altSymbol.toLowerCase());
|
|
20892
|
+
return findEthAssetBySymbol(altSymbol.toLowerCase(), otherAssets);
|
|
20962
20893
|
};
|
|
20963
20894
|
var findWithXcVariant = function findWithXcVariant(items, value) {
|
|
20964
20895
|
var lower = value.toLowerCase();
|
|
@@ -20992,7 +20923,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
20992
20923
|
var lowerSymbol = value.toLowerCase();
|
|
20993
20924
|
var otherAssetsMatches = [];
|
|
20994
20925
|
if (destination === 'Ethereum') {
|
|
20995
|
-
return findEthMatch(value);
|
|
20926
|
+
return findEthMatch(value, otherAssets);
|
|
20996
20927
|
}
|
|
20997
20928
|
if (lowerSymbol.endsWith('.e')) {
|
|
20998
20929
|
// Symbol ends with '.e', indicating a Snowbridge asset
|
|
@@ -21004,7 +20935,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21004
20935
|
otherAssetsMatches = findWithXcVariant(otherAssets, value);
|
|
21005
20936
|
foundAsset = pickOtherOrThrow(value, otherAssetsMatches);
|
|
21006
20937
|
if (foundAsset) return foundAsset;
|
|
21007
|
-
var ethAsset = findEthAssetBySymbol(strippedSymbol);
|
|
20938
|
+
var ethAsset = findEthAssetBySymbol(strippedSymbol, otherAssets);
|
|
21008
20939
|
if (ethAsset) return ethAsset;
|
|
21009
20940
|
// If still not found, search normal assets without suffix
|
|
21010
20941
|
otherAssetsMatches = findBestMatches(otherAssets, strippedSymbol);
|
|
@@ -21028,7 +20959,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21028
20959
|
var _otherAssetsMatches = [];
|
|
21029
20960
|
var nativeAssetsMatches = [];
|
|
21030
20961
|
if (destination === 'Ethereum') {
|
|
21031
|
-
return findEthMatch(symbol);
|
|
20962
|
+
return findEthMatch(symbol, otherAssets);
|
|
21032
20963
|
}
|
|
21033
20964
|
if (_lowerSymbol.endsWith('.e')) {
|
|
21034
20965
|
// Symbol ends with '.e', indicating a Snowbridge asset
|
|
@@ -21043,7 +20974,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21043
20974
|
var _foundAsset = pickOtherOrThrow(symbol, _otherAssetsMatches);
|
|
21044
20975
|
if (_foundAsset) return _foundAsset;
|
|
21045
20976
|
// Search in Ethereum assets without the '.e' suffix
|
|
21046
|
-
var _ethAsset = findEthAssetBySymbol(_strippedSymbol);
|
|
20977
|
+
var _ethAsset = findEthAssetBySymbol(_strippedSymbol, otherAssets);
|
|
21047
20978
|
if (_ethAsset) return _ethAsset;
|
|
21048
20979
|
// If still not found, search normal assets without suffix
|
|
21049
20980
|
_otherAssetsMatches = findBestMatches(otherAssets, _strippedSymbol);
|
|
@@ -21072,34 +21003,22 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
|
|
|
21072
21003
|
var _getAssetsObject = getAssetsObject(chain),
|
|
21073
21004
|
otherAssets = _getAssetsObject.otherAssets,
|
|
21074
21005
|
nativeAssets = _getAssetsObject.nativeAssets;
|
|
21075
|
-
var isEthereumDestination = destination === 'Ethereum';
|
|
21076
|
-
var getEthereumAssets = function getEthereumAssets() {
|
|
21077
|
-
return getOtherAssets('Ethereum');
|
|
21078
|
-
};
|
|
21079
|
-
var getFilteredEthereumAssets = function getFilteredEthereumAssets() {
|
|
21080
|
-
return filterEthCompatibleAssets(otherAssets);
|
|
21081
|
-
};
|
|
21082
21006
|
var asset;
|
|
21083
21007
|
if ('symbol' in currency) {
|
|
21084
|
-
|
|
21085
|
-
// If not found, search Ethereum assets directly
|
|
21086
|
-
if (isEthereumDestination) {
|
|
21087
|
-
var _findAssetInfoBySymbo;
|
|
21088
|
-
asset = (_findAssetInfoBySymbo = findAssetInfoBySymbol(destination, getFilteredEthereumAssets(), nativeAssets, currency.symbol)) !== null && _findAssetInfoBySymbo !== void 0 ? _findAssetInfoBySymbo : findAssetInfoBySymbol(destination, getEthereumAssets(), nativeAssets, currency.symbol);
|
|
21089
|
-
} else {
|
|
21090
|
-
asset = findAssetInfoBySymbol(destination, otherAssets, nativeAssets, currency.symbol);
|
|
21091
|
-
}
|
|
21008
|
+
asset = findAssetInfoBySymbol(destination, otherAssets, nativeAssets, currency.symbol);
|
|
21092
21009
|
} else if ('location' in currency && !isOverrideLocationSpecifier(currency.location)) {
|
|
21093
21010
|
var _findAssetInfoByLoc;
|
|
21094
|
-
|
|
21095
|
-
|
|
21096
|
-
|
|
21097
|
-
if (
|
|
21098
|
-
var
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21011
|
+
asset = (_findAssetInfoByLoc = findAssetInfoByLoc(otherAssets, currency.location)) !== null && _findAssetInfoByLoc !== void 0 ? _findAssetInfoByLoc : findAssetInfoByLoc(nativeAssets, currency.location);
|
|
21012
|
+
// Temporary condition for Mythos to allow selecting by Etheruem MYTH location
|
|
21013
|
+
// Will be removed in v12
|
|
21014
|
+
if (chain === 'Mythos') {
|
|
21015
|
+
var mythEthAsset = getOtherAssets('Ethereum').find(function (a) {
|
|
21016
|
+
return a.symbol === 'MYTH';
|
|
21017
|
+
});
|
|
21018
|
+
if (mythEthAsset && findAssetInfoByLoc([mythEthAsset], currency.location)) asset = nativeAssets[0];
|
|
21102
21019
|
}
|
|
21020
|
+
} else if ('id' in currency) {
|
|
21021
|
+
asset = findAssetInfoById(otherAssets, currency.id);
|
|
21103
21022
|
}
|
|
21104
21023
|
return asset !== null && asset !== void 0 ? asset : null;
|
|
21105
21024
|
};
|
|
@@ -21130,8 +21049,7 @@ var Override = function Override(location) {
|
|
|
21130
21049
|
};
|
|
21131
21050
|
|
|
21132
21051
|
var findAssetInfoOrThrow = function findAssetInfoOrThrow(chain, currency, destination) {
|
|
21133
|
-
var
|
|
21134
|
-
var asset = (_findAssetInfo = findAssetInfo(chain, currency, destination)) !== null && _findAssetInfo !== void 0 ? _findAssetInfo : chain === 'AssetHubPolkadot' || chain === 'Mythos' ? findAssetInfo('Ethereum', currency, null) : null;
|
|
21052
|
+
var asset = findAssetInfo(chain, currency, destination);
|
|
21135
21053
|
if (!asset) {
|
|
21136
21054
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency, replaceBigInt), " not found on ").concat(chain));
|
|
21137
21055
|
}
|
|
@@ -21303,8 +21221,7 @@ var getNativeAssets = function getNativeAssets(chain) {
|
|
|
21303
21221
|
* @returns An array of other asset details.
|
|
21304
21222
|
*/
|
|
21305
21223
|
var getOtherAssets = function getOtherAssets(chain) {
|
|
21306
|
-
|
|
21307
|
-
return chain === 'AssetHubPolkadot' ? [].concat(_toConsumableArray(otherAssets), _toConsumableArray(getAssetsObject('Ethereum').otherAssets)) : otherAssets;
|
|
21224
|
+
return getAssetsObject(chain).otherAssets;
|
|
21308
21225
|
};
|
|
21309
21226
|
/**
|
|
21310
21227
|
* Retrieves the complete list of assets for a specified chain, including relay chain asset, native, and other assets.
|
|
@@ -21336,11 +21253,7 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
|
|
|
21336
21253
|
var symbol = _ref2.symbol;
|
|
21337
21254
|
return symbol;
|
|
21338
21255
|
});
|
|
21339
|
-
|
|
21340
|
-
var symbol = _ref3.symbol;
|
|
21341
|
-
return symbol;
|
|
21342
|
-
}) : [];
|
|
21343
|
-
return [].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols), _toConsumableArray(ethAssetsSymbols));
|
|
21256
|
+
return [].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols));
|
|
21344
21257
|
};
|
|
21345
21258
|
/**
|
|
21346
21259
|
* Retrieves the symbol of the native asset for a specified chain.
|
|
@@ -21349,7 +21262,6 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
|
|
|
21349
21262
|
* @returns The symbol of the native asset.
|
|
21350
21263
|
*/
|
|
21351
21264
|
var getNativeAssetSymbol = function getNativeAssetSymbol(chain) {
|
|
21352
|
-
if (chain === 'Ethereum') return 'ETH';
|
|
21353
21265
|
return getAssetsObject(chain).nativeAssetSymbol;
|
|
21354
21266
|
};
|
|
21355
21267
|
/**
|
|
@@ -21405,7 +21317,7 @@ var hasDryRunSupport = function hasDryRunSupport(chain) {
|
|
|
21405
21317
|
};
|
|
21406
21318
|
var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
21407
21319
|
// These chains have XcmPaymentApi but it's not working
|
|
21408
|
-
var DISABLED_CHAINS = ['
|
|
21320
|
+
var DISABLED_CHAINS = ['Basilisk', 'Jamton'];
|
|
21409
21321
|
return getAssetsObject(chain).supportsXcmPaymentApi && !DISABLED_CHAINS.includes(chain);
|
|
21410
21322
|
};
|
|
21411
21323
|
|
|
@@ -21419,21 +21331,8 @@ var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
|
21419
21331
|
var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
21420
21332
|
var originAssets = getAssets(origin);
|
|
21421
21333
|
var destinationAssets = getAssets(destination);
|
|
21422
|
-
|
|
21423
|
-
|
|
21424
|
-
var ethereumCompatibleAssets = filterEthCompatibleAssets(otherAssets);
|
|
21425
|
-
var ethereumAssets = getOtherAssets('Ethereum');
|
|
21426
|
-
if (origin === 'Moonbeam') {
|
|
21427
|
-
return ethereumCompatibleAssets;
|
|
21428
|
-
}
|
|
21429
|
-
if (origin === 'Mythos') {
|
|
21430
|
-
return ethereumAssets.filter(function (asset) {
|
|
21431
|
-
return isSymbolMatch(asset.symbol, getNativeAssetSymbol(origin));
|
|
21432
|
-
});
|
|
21433
|
-
}
|
|
21434
|
-
return [].concat(_toConsumableArray(ethereumCompatibleAssets), _toConsumableArray(ethereumAssets));
|
|
21435
|
-
}
|
|
21436
|
-
if (origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot') {
|
|
21334
|
+
var isSubBridge = isSubstrateBridge(origin, destination);
|
|
21335
|
+
if (isSubBridge) {
|
|
21437
21336
|
return originAssets.filter(function (asset) {
|
|
21438
21337
|
return asset.symbol === 'KSM' || asset.symbol === 'DOT';
|
|
21439
21338
|
});
|
|
@@ -21443,16 +21342,6 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
|
21443
21342
|
return normalizeSymbol(a.symbol) === normalizeSymbol(asset.symbol);
|
|
21444
21343
|
});
|
|
21445
21344
|
});
|
|
21446
|
-
if (origin === 'AssetHubPolkadot' && destination === 'BifrostPolkadot') {
|
|
21447
|
-
var wethAsset = getOtherAssets('Ethereum').find(function (_ref) {
|
|
21448
|
-
var symbol = _ref.symbol;
|
|
21449
|
-
return symbol === 'WETH';
|
|
21450
|
-
});
|
|
21451
|
-
if (wethAsset) supportedAssets.push({
|
|
21452
|
-
assetId: wethAsset.assetId,
|
|
21453
|
-
symbol: "".concat(wethAsset.symbol, ".e")
|
|
21454
|
-
});
|
|
21455
|
-
}
|
|
21456
21345
|
return supportedAssets;
|
|
21457
21346
|
};
|
|
21458
21347
|
|
|
@@ -21496,4 +21385,4 @@ var isAssetXcEqual = function isAssetXcEqual(asset1, asset2) {
|
|
|
21496
21385
|
return isSymbolMatch(asset1.symbol, asset2.symbol);
|
|
21497
21386
|
};
|
|
21498
21387
|
|
|
21499
|
-
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, compareLocations, extractAssetLocation,
|
|
21388
|
+
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, compareLocations, extractAssetLocation, 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.14.
|
|
3
|
+
"version": "11.14.7",
|
|
4
4
|
"description": "Assets for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,25 +23,24 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@paraspell/sdk-common": "11.14.
|
|
26
|
+
"@paraspell/sdk-common": "11.14.7"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|
|
30
30
|
"@babel/preset-env": "^7.28.5",
|
|
31
31
|
"@codecov/rollup-plugin": "^1.9.1",
|
|
32
|
-
"@polkadot/api": "^16.
|
|
33
|
-
"@polkadot/types": "^16.
|
|
32
|
+
"@polkadot/api": "^16.5.3",
|
|
33
|
+
"@polkadot/types": "^16.5.3",
|
|
34
34
|
"@rollup/plugin-babel": "^6.1.0",
|
|
35
35
|
"@rollup/plugin-json": "^6.1.0",
|
|
36
36
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
37
|
-
"@snowbridge/registry": "^0.2.
|
|
38
|
-
"@vitest/coverage-v8": "^4.0.
|
|
37
|
+
"@snowbridge/registry": "^0.2.17",
|
|
38
|
+
"@vitest/coverage-v8": "^4.0.14",
|
|
39
39
|
"dotenv": "^17.2.3",
|
|
40
|
-
"
|
|
41
|
-
"rollup": "^
|
|
42
|
-
"rollup-plugin-dts": "^6.2.3",
|
|
40
|
+
"rollup": "^4.53.3",
|
|
41
|
+
"rollup-plugin-dts": "^6.3.0",
|
|
43
42
|
"ts-node": "^10.9.2",
|
|
44
|
-
"viem": "^2.
|
|
43
|
+
"viem": "^2.40.3"
|
|
45
44
|
},
|
|
46
45
|
"scripts": {
|
|
47
46
|
"compile": "tsc --noEmit",
|