@paraspell/assets 11.14.6 → 11.14.8
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 +122 -228
- package/dist/index.d.ts +2 -4
- package/dist/index.mjs +124 -229
- package/package.json +9 -10
package/dist/index.cjs
CHANGED
|
@@ -2900,7 +2900,7 @@ var Xode = {
|
|
|
2900
2900
|
otherAssets: [
|
|
2901
2901
|
{
|
|
2902
2902
|
assetId: "1000000002",
|
|
2903
|
-
symbol: "
|
|
2903
|
+
symbol: "gXON",
|
|
2904
2904
|
decimals: 12,
|
|
2905
2905
|
existentialDeposit: "1000000000"
|
|
2906
2906
|
},
|
|
@@ -4266,6 +4266,12 @@ var Hydration = {
|
|
|
4266
4266
|
},
|
|
4267
4267
|
isFeeAsset: true
|
|
4268
4268
|
},
|
|
4269
|
+
{
|
|
4270
|
+
assetId: "42",
|
|
4271
|
+
symbol: "EURC",
|
|
4272
|
+
decimals: 6,
|
|
4273
|
+
existentialDeposit: "14000"
|
|
4274
|
+
},
|
|
4269
4275
|
{
|
|
4270
4276
|
assetId: "102",
|
|
4271
4277
|
symbol: "2-Pool",
|
|
@@ -5117,86 +5123,6 @@ var Hydration = {
|
|
|
5117
5123
|
}
|
|
5118
5124
|
]
|
|
5119
5125
|
};
|
|
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
5126
|
var Interlay = {
|
|
5201
5127
|
relaychainSymbol: "DOT",
|
|
5202
5128
|
nativeAssetSymbol: "INTR",
|
|
@@ -15635,6 +15561,32 @@ var Ethereum = {
|
|
|
15635
15561
|
}
|
|
15636
15562
|
}
|
|
15637
15563
|
},
|
|
15564
|
+
{
|
|
15565
|
+
symbol: "CFG",
|
|
15566
|
+
assetId: "0xcccccccccc33d538dbc2ee4feab0a7a1ff4e8a94",
|
|
15567
|
+
decimals: 18,
|
|
15568
|
+
existentialDeposit: "1",
|
|
15569
|
+
location: {
|
|
15570
|
+
parents: 2,
|
|
15571
|
+
interior: {
|
|
15572
|
+
X2: [
|
|
15573
|
+
{
|
|
15574
|
+
GlobalConsensus: {
|
|
15575
|
+
Ethereum: {
|
|
15576
|
+
chainId: 1
|
|
15577
|
+
}
|
|
15578
|
+
}
|
|
15579
|
+
},
|
|
15580
|
+
{
|
|
15581
|
+
AccountKey20: {
|
|
15582
|
+
network: null,
|
|
15583
|
+
key: "0xcccccccccc33d538dbc2ee4feab0a7a1ff4e8a94"
|
|
15584
|
+
}
|
|
15585
|
+
}
|
|
15586
|
+
]
|
|
15587
|
+
}
|
|
15588
|
+
}
|
|
15589
|
+
},
|
|
15638
15590
|
{
|
|
15639
15591
|
symbol: "sUSDS",
|
|
15640
15592
|
assetId: "0xa3931d71877c0e7a3148cb7eb4463524fec27fbd",
|
|
@@ -15661,6 +15613,32 @@ var Ethereum = {
|
|
|
15661
15613
|
}
|
|
15662
15614
|
}
|
|
15663
15615
|
},
|
|
15616
|
+
{
|
|
15617
|
+
symbol: "WLD",
|
|
15618
|
+
assetId: "0x163f8c2467924be0ae7b5347228cabf260318753",
|
|
15619
|
+
decimals: 18,
|
|
15620
|
+
existentialDeposit: "1",
|
|
15621
|
+
location: {
|
|
15622
|
+
parents: 2,
|
|
15623
|
+
interior: {
|
|
15624
|
+
X2: [
|
|
15625
|
+
{
|
|
15626
|
+
GlobalConsensus: {
|
|
15627
|
+
Ethereum: {
|
|
15628
|
+
chainId: 1
|
|
15629
|
+
}
|
|
15630
|
+
}
|
|
15631
|
+
},
|
|
15632
|
+
{
|
|
15633
|
+
AccountKey20: {
|
|
15634
|
+
network: null,
|
|
15635
|
+
key: "0x163f8c2467924be0ae7b5347228cabf260318753"
|
|
15636
|
+
}
|
|
15637
|
+
}
|
|
15638
|
+
]
|
|
15639
|
+
}
|
|
15640
|
+
}
|
|
15641
|
+
},
|
|
15664
15642
|
{
|
|
15665
15643
|
symbol: "ENA",
|
|
15666
15644
|
assetId: "0x57e114b691db790c35207b2e685d4a43181e6061",
|
|
@@ -15921,6 +15899,32 @@ var Ethereum = {
|
|
|
15921
15899
|
}
|
|
15922
15900
|
}
|
|
15923
15901
|
},
|
|
15902
|
+
{
|
|
15903
|
+
symbol: "vTAO",
|
|
15904
|
+
assetId: "0xe9f6d9898f9269b519e1435e6ebaff766c7f46bf",
|
|
15905
|
+
decimals: 18,
|
|
15906
|
+
existentialDeposit: "1",
|
|
15907
|
+
location: {
|
|
15908
|
+
parents: 2,
|
|
15909
|
+
interior: {
|
|
15910
|
+
X2: [
|
|
15911
|
+
{
|
|
15912
|
+
GlobalConsensus: {
|
|
15913
|
+
Ethereum: {
|
|
15914
|
+
chainId: 1
|
|
15915
|
+
}
|
|
15916
|
+
}
|
|
15917
|
+
},
|
|
15918
|
+
{
|
|
15919
|
+
AccountKey20: {
|
|
15920
|
+
network: null,
|
|
15921
|
+
key: "0xe9f6d9898f9269b519e1435e6ebaff766c7f46bf"
|
|
15922
|
+
}
|
|
15923
|
+
}
|
|
15924
|
+
]
|
|
15925
|
+
}
|
|
15926
|
+
}
|
|
15927
|
+
},
|
|
15924
15928
|
{
|
|
15925
15929
|
symbol: "TONCOIN",
|
|
15926
15930
|
assetId: "0x582d872a1b094fc48f5de31d3b73f2d9be47def1",
|
|
@@ -20315,40 +20319,6 @@ var HydrationPaseo = {
|
|
|
20315
20319
|
}
|
|
20316
20320
|
]
|
|
20317
20321
|
};
|
|
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
20322
|
var KiltPaseo = {
|
|
20353
20323
|
relaychainSymbol: "PAS",
|
|
20354
20324
|
nativeAssetSymbol: "PILT",
|
|
@@ -20475,34 +20445,6 @@ var NeuroWebPaseo = {
|
|
|
20475
20445
|
}
|
|
20476
20446
|
]
|
|
20477
20447
|
};
|
|
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
20448
|
var ZeitgeistPaseo = {
|
|
20507
20449
|
relaychainSymbol: "PAS",
|
|
20508
20450
|
nativeAssetSymbol: "ZBS",
|
|
@@ -20634,8 +20576,6 @@ var assetsMapJson = {
|
|
|
20634
20576
|
Darwinia: Darwinia,
|
|
20635
20577
|
EnergyWebX: EnergyWebX,
|
|
20636
20578
|
Hydration: Hydration,
|
|
20637
|
-
IntegriteePolkadot: IntegriteePolkadot,
|
|
20638
|
-
IntegriteeKusama: IntegriteeKusama,
|
|
20639
20579
|
Interlay: Interlay,
|
|
20640
20580
|
Heima: Heima,
|
|
20641
20581
|
Moonbeam: Moonbeam,
|
|
@@ -20692,11 +20632,9 @@ var assetsMapJson = {
|
|
|
20692
20632
|
HeimaPaseo: HeimaPaseo,
|
|
20693
20633
|
EnergyWebXPaseo: EnergyWebXPaseo,
|
|
20694
20634
|
HydrationPaseo: HydrationPaseo,
|
|
20695
|
-
IntegriteePaseo: IntegriteePaseo,
|
|
20696
20635
|
KiltPaseo: KiltPaseo,
|
|
20697
20636
|
LaosPaseo: LaosPaseo,
|
|
20698
20637
|
NeuroWebPaseo: NeuroWebPaseo,
|
|
20699
|
-
NodlePaseo: NodlePaseo,
|
|
20700
20638
|
ZeitgeistPaseo: ZeitgeistPaseo
|
|
20701
20639
|
};
|
|
20702
20640
|
|
|
@@ -20708,8 +20646,10 @@ var assetsMapJson = {
|
|
|
20708
20646
|
*/
|
|
20709
20647
|
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
20710
20648
|
if (!symbol) return '';
|
|
20711
|
-
var
|
|
20712
|
-
|
|
20649
|
+
var s = symbol.toLowerCase();
|
|
20650
|
+
if (s.startsWith('xc')) s = s.substring(2);
|
|
20651
|
+
if (s.endsWith('.e')) s = s.slice(0, -2);
|
|
20652
|
+
return s;
|
|
20713
20653
|
};
|
|
20714
20654
|
|
|
20715
20655
|
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
@@ -20732,15 +20672,6 @@ var isTAsset = function isTAsset(value) {
|
|
|
20732
20672
|
return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
|
|
20733
20673
|
};
|
|
20734
20674
|
|
|
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
20675
|
/**
|
|
20745
20676
|
* Error thrown when multiple assets with the same symbol are found.
|
|
20746
20677
|
*/
|
|
@@ -20952,15 +20883,21 @@ var removePrefix = function removePrefix(symbol) {
|
|
|
20952
20883
|
var removeSuffix = function removeSuffix(symbol) {
|
|
20953
20884
|
return symbol.slice(0, -2);
|
|
20954
20885
|
};
|
|
20955
|
-
var findEthAssetBySymbol = function findEthAssetBySymbol(symbol) {
|
|
20956
|
-
var
|
|
20957
|
-
|
|
20886
|
+
var findEthAssetBySymbol = function findEthAssetBySymbol(symbol, otherAssets) {
|
|
20887
|
+
var ethCompatibleAssets = otherAssets.filter(function (asset) {
|
|
20888
|
+
return asset.location && sdkCommon.deepEqual(sdkCommon.getJunctionValue(asset.location, 'GlobalConsensus'), {
|
|
20889
|
+
Ethereum: {
|
|
20890
|
+
chainId: 1
|
|
20891
|
+
}
|
|
20892
|
+
});
|
|
20893
|
+
});
|
|
20894
|
+
return findBestMatches(ethCompatibleAssets, symbol)[0];
|
|
20958
20895
|
};
|
|
20959
|
-
var findEthMatch = function findEthMatch(symbol) {
|
|
20960
|
-
var match = findEthAssetBySymbol(symbol);
|
|
20896
|
+
var findEthMatch = function findEthMatch(symbol, otherAssets) {
|
|
20897
|
+
var match = findEthAssetBySymbol(symbol, otherAssets);
|
|
20961
20898
|
if (match) return match;
|
|
20962
20899
|
var altSymbol = symbol.toLowerCase().endsWith('.e') ? removeSuffix(symbol) : "".concat(symbol, ".e");
|
|
20963
|
-
return findEthAssetBySymbol(altSymbol.toLowerCase());
|
|
20900
|
+
return findEthAssetBySymbol(altSymbol.toLowerCase(), otherAssets);
|
|
20964
20901
|
};
|
|
20965
20902
|
var findWithXcVariant = function findWithXcVariant(items, value) {
|
|
20966
20903
|
var lower = value.toLowerCase();
|
|
@@ -20994,7 +20931,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
20994
20931
|
var lowerSymbol = value.toLowerCase();
|
|
20995
20932
|
var otherAssetsMatches = [];
|
|
20996
20933
|
if (destination === 'Ethereum') {
|
|
20997
|
-
return findEthMatch(value);
|
|
20934
|
+
return findEthMatch(value, otherAssets);
|
|
20998
20935
|
}
|
|
20999
20936
|
if (lowerSymbol.endsWith('.e')) {
|
|
21000
20937
|
// Symbol ends with '.e', indicating a Snowbridge asset
|
|
@@ -21006,7 +20943,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21006
20943
|
otherAssetsMatches = findWithXcVariant(otherAssets, value);
|
|
21007
20944
|
foundAsset = pickOtherOrThrow(value, otherAssetsMatches);
|
|
21008
20945
|
if (foundAsset) return foundAsset;
|
|
21009
|
-
var ethAsset = findEthAssetBySymbol(strippedSymbol);
|
|
20946
|
+
var ethAsset = findEthAssetBySymbol(strippedSymbol, otherAssets);
|
|
21010
20947
|
if (ethAsset) return ethAsset;
|
|
21011
20948
|
// If still not found, search normal assets without suffix
|
|
21012
20949
|
otherAssetsMatches = findBestMatches(otherAssets, strippedSymbol);
|
|
@@ -21030,7 +20967,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21030
20967
|
var _otherAssetsMatches = [];
|
|
21031
20968
|
var nativeAssetsMatches = [];
|
|
21032
20969
|
if (destination === 'Ethereum') {
|
|
21033
|
-
return findEthMatch(symbol);
|
|
20970
|
+
return findEthMatch(symbol, otherAssets);
|
|
21034
20971
|
}
|
|
21035
20972
|
if (_lowerSymbol.endsWith('.e')) {
|
|
21036
20973
|
// Symbol ends with '.e', indicating a Snowbridge asset
|
|
@@ -21045,7 +20982,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21045
20982
|
var _foundAsset = pickOtherOrThrow(symbol, _otherAssetsMatches);
|
|
21046
20983
|
if (_foundAsset) return _foundAsset;
|
|
21047
20984
|
// Search in Ethereum assets without the '.e' suffix
|
|
21048
|
-
var _ethAsset = findEthAssetBySymbol(_strippedSymbol);
|
|
20985
|
+
var _ethAsset = findEthAssetBySymbol(_strippedSymbol, otherAssets);
|
|
21049
20986
|
if (_ethAsset) return _ethAsset;
|
|
21050
20987
|
// If still not found, search normal assets without suffix
|
|
21051
20988
|
_otherAssetsMatches = findBestMatches(otherAssets, _strippedSymbol);
|
|
@@ -21074,34 +21011,22 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
|
|
|
21074
21011
|
var _getAssetsObject = getAssetsObject(chain),
|
|
21075
21012
|
otherAssets = _getAssetsObject.otherAssets,
|
|
21076
21013
|
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
21014
|
var asset;
|
|
21085
21015
|
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
|
-
}
|
|
21016
|
+
asset = findAssetInfoBySymbol(destination, otherAssets, nativeAssets, currency.symbol);
|
|
21094
21017
|
} else if ('location' in currency && !isOverrideLocationSpecifier(currency.location)) {
|
|
21095
21018
|
var _findAssetInfoByLoc;
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
|
|
21099
|
-
if (
|
|
21100
|
-
var
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21019
|
+
asset = (_findAssetInfoByLoc = findAssetInfoByLoc(otherAssets, currency.location)) !== null && _findAssetInfoByLoc !== void 0 ? _findAssetInfoByLoc : findAssetInfoByLoc(nativeAssets, currency.location);
|
|
21020
|
+
// Temporary condition for Mythos to allow selecting by Etheruem MYTH location
|
|
21021
|
+
// Will be removed in v12
|
|
21022
|
+
if (chain === 'Mythos') {
|
|
21023
|
+
var mythEthAsset = getOtherAssets('Ethereum').find(function (a) {
|
|
21024
|
+
return a.symbol === 'MYTH';
|
|
21025
|
+
});
|
|
21026
|
+
if (mythEthAsset && findAssetInfoByLoc([mythEthAsset], currency.location)) asset = nativeAssets[0];
|
|
21104
21027
|
}
|
|
21028
|
+
} else if ('id' in currency) {
|
|
21029
|
+
asset = findAssetInfoById(otherAssets, currency.id);
|
|
21105
21030
|
}
|
|
21106
21031
|
return asset !== null && asset !== void 0 ? asset : null;
|
|
21107
21032
|
};
|
|
@@ -21132,8 +21057,7 @@ var Override = function Override(location) {
|
|
|
21132
21057
|
};
|
|
21133
21058
|
|
|
21134
21059
|
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;
|
|
21060
|
+
var asset = findAssetInfo(chain, currency, destination);
|
|
21137
21061
|
if (!asset) {
|
|
21138
21062
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency, sdkCommon.replaceBigInt), " not found on ").concat(chain));
|
|
21139
21063
|
}
|
|
@@ -21305,8 +21229,7 @@ var getNativeAssets = function getNativeAssets(chain) {
|
|
|
21305
21229
|
* @returns An array of other asset details.
|
|
21306
21230
|
*/
|
|
21307
21231
|
var getOtherAssets = function getOtherAssets(chain) {
|
|
21308
|
-
|
|
21309
|
-
return chain === 'AssetHubPolkadot' ? [].concat(_toConsumableArray(otherAssets), _toConsumableArray(getAssetsObject('Ethereum').otherAssets)) : otherAssets;
|
|
21232
|
+
return getAssetsObject(chain).otherAssets;
|
|
21310
21233
|
};
|
|
21311
21234
|
/**
|
|
21312
21235
|
* Retrieves the complete list of assets for a specified chain, including relay chain asset, native, and other assets.
|
|
@@ -21338,11 +21261,7 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
|
|
|
21338
21261
|
var symbol = _ref2.symbol;
|
|
21339
21262
|
return symbol;
|
|
21340
21263
|
});
|
|
21341
|
-
|
|
21342
|
-
var symbol = _ref3.symbol;
|
|
21343
|
-
return symbol;
|
|
21344
|
-
}) : [];
|
|
21345
|
-
return [].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols), _toConsumableArray(ethAssetsSymbols));
|
|
21264
|
+
return [].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols));
|
|
21346
21265
|
};
|
|
21347
21266
|
/**
|
|
21348
21267
|
* Retrieves the symbol of the native asset for a specified chain.
|
|
@@ -21351,7 +21270,6 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
|
|
|
21351
21270
|
* @returns The symbol of the native asset.
|
|
21352
21271
|
*/
|
|
21353
21272
|
var getNativeAssetSymbol = function getNativeAssetSymbol(chain) {
|
|
21354
|
-
if (chain === 'Ethereum') return 'ETH';
|
|
21355
21273
|
return getAssetsObject(chain).nativeAssetSymbol;
|
|
21356
21274
|
};
|
|
21357
21275
|
/**
|
|
@@ -21407,7 +21325,7 @@ var hasDryRunSupport = function hasDryRunSupport(chain) {
|
|
|
21407
21325
|
};
|
|
21408
21326
|
var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
21409
21327
|
// These chains have XcmPaymentApi but it's not working
|
|
21410
|
-
var DISABLED_CHAINS = ['
|
|
21328
|
+
var DISABLED_CHAINS = ['Basilisk', 'Jamton'];
|
|
21411
21329
|
return getAssetsObject(chain).supportsXcmPaymentApi && !DISABLED_CHAINS.includes(chain);
|
|
21412
21330
|
};
|
|
21413
21331
|
|
|
@@ -21421,21 +21339,8 @@ var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
|
21421
21339
|
var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
21422
21340
|
var originAssets = getAssets(origin);
|
|
21423
21341
|
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') {
|
|
21342
|
+
var isSubBridge = sdkCommon.isSubstrateBridge(origin, destination);
|
|
21343
|
+
if (isSubBridge) {
|
|
21439
21344
|
return originAssets.filter(function (asset) {
|
|
21440
21345
|
return asset.symbol === 'KSM' || asset.symbol === 'DOT';
|
|
21441
21346
|
});
|
|
@@ -21445,16 +21350,6 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
|
21445
21350
|
return normalizeSymbol(a.symbol) === normalizeSymbol(asset.symbol);
|
|
21446
21351
|
});
|
|
21447
21352
|
});
|
|
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
21353
|
return supportedAssets;
|
|
21459
21354
|
};
|
|
21460
21355
|
|
|
@@ -21508,7 +21403,6 @@ exports.Override = Override;
|
|
|
21508
21403
|
exports.assertEdDefined = assertEdDefined;
|
|
21509
21404
|
exports.compareLocations = compareLocations;
|
|
21510
21405
|
exports.extractAssetLocation = extractAssetLocation;
|
|
21511
|
-
exports.filterEthCompatibleAssets = filterEthCompatibleAssets;
|
|
21512
21406
|
exports.findAssetInfo = findAssetInfo;
|
|
21513
21407
|
exports.findAssetInfoById = findAssetInfoById;
|
|
21514
21408
|
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);
|
|
@@ -2898,7 +2898,7 @@ var Xode = {
|
|
|
2898
2898
|
otherAssets: [
|
|
2899
2899
|
{
|
|
2900
2900
|
assetId: "1000000002",
|
|
2901
|
-
symbol: "
|
|
2901
|
+
symbol: "gXON",
|
|
2902
2902
|
decimals: 12,
|
|
2903
2903
|
existentialDeposit: "1000000000"
|
|
2904
2904
|
},
|
|
@@ -4264,6 +4264,12 @@ var Hydration = {
|
|
|
4264
4264
|
},
|
|
4265
4265
|
isFeeAsset: true
|
|
4266
4266
|
},
|
|
4267
|
+
{
|
|
4268
|
+
assetId: "42",
|
|
4269
|
+
symbol: "EURC",
|
|
4270
|
+
decimals: 6,
|
|
4271
|
+
existentialDeposit: "14000"
|
|
4272
|
+
},
|
|
4267
4273
|
{
|
|
4268
4274
|
assetId: "102",
|
|
4269
4275
|
symbol: "2-Pool",
|
|
@@ -5115,86 +5121,6 @@ var Hydration = {
|
|
|
5115
5121
|
}
|
|
5116
5122
|
]
|
|
5117
5123
|
};
|
|
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
5124
|
var Interlay = {
|
|
5199
5125
|
relaychainSymbol: "DOT",
|
|
5200
5126
|
nativeAssetSymbol: "INTR",
|
|
@@ -15633,6 +15559,32 @@ var Ethereum = {
|
|
|
15633
15559
|
}
|
|
15634
15560
|
}
|
|
15635
15561
|
},
|
|
15562
|
+
{
|
|
15563
|
+
symbol: "CFG",
|
|
15564
|
+
assetId: "0xcccccccccc33d538dbc2ee4feab0a7a1ff4e8a94",
|
|
15565
|
+
decimals: 18,
|
|
15566
|
+
existentialDeposit: "1",
|
|
15567
|
+
location: {
|
|
15568
|
+
parents: 2,
|
|
15569
|
+
interior: {
|
|
15570
|
+
X2: [
|
|
15571
|
+
{
|
|
15572
|
+
GlobalConsensus: {
|
|
15573
|
+
Ethereum: {
|
|
15574
|
+
chainId: 1
|
|
15575
|
+
}
|
|
15576
|
+
}
|
|
15577
|
+
},
|
|
15578
|
+
{
|
|
15579
|
+
AccountKey20: {
|
|
15580
|
+
network: null,
|
|
15581
|
+
key: "0xcccccccccc33d538dbc2ee4feab0a7a1ff4e8a94"
|
|
15582
|
+
}
|
|
15583
|
+
}
|
|
15584
|
+
]
|
|
15585
|
+
}
|
|
15586
|
+
}
|
|
15587
|
+
},
|
|
15636
15588
|
{
|
|
15637
15589
|
symbol: "sUSDS",
|
|
15638
15590
|
assetId: "0xa3931d71877c0e7a3148cb7eb4463524fec27fbd",
|
|
@@ -15659,6 +15611,32 @@ var Ethereum = {
|
|
|
15659
15611
|
}
|
|
15660
15612
|
}
|
|
15661
15613
|
},
|
|
15614
|
+
{
|
|
15615
|
+
symbol: "WLD",
|
|
15616
|
+
assetId: "0x163f8c2467924be0ae7b5347228cabf260318753",
|
|
15617
|
+
decimals: 18,
|
|
15618
|
+
existentialDeposit: "1",
|
|
15619
|
+
location: {
|
|
15620
|
+
parents: 2,
|
|
15621
|
+
interior: {
|
|
15622
|
+
X2: [
|
|
15623
|
+
{
|
|
15624
|
+
GlobalConsensus: {
|
|
15625
|
+
Ethereum: {
|
|
15626
|
+
chainId: 1
|
|
15627
|
+
}
|
|
15628
|
+
}
|
|
15629
|
+
},
|
|
15630
|
+
{
|
|
15631
|
+
AccountKey20: {
|
|
15632
|
+
network: null,
|
|
15633
|
+
key: "0x163f8c2467924be0ae7b5347228cabf260318753"
|
|
15634
|
+
}
|
|
15635
|
+
}
|
|
15636
|
+
]
|
|
15637
|
+
}
|
|
15638
|
+
}
|
|
15639
|
+
},
|
|
15662
15640
|
{
|
|
15663
15641
|
symbol: "ENA",
|
|
15664
15642
|
assetId: "0x57e114b691db790c35207b2e685d4a43181e6061",
|
|
@@ -15919,6 +15897,32 @@ var Ethereum = {
|
|
|
15919
15897
|
}
|
|
15920
15898
|
}
|
|
15921
15899
|
},
|
|
15900
|
+
{
|
|
15901
|
+
symbol: "vTAO",
|
|
15902
|
+
assetId: "0xe9f6d9898f9269b519e1435e6ebaff766c7f46bf",
|
|
15903
|
+
decimals: 18,
|
|
15904
|
+
existentialDeposit: "1",
|
|
15905
|
+
location: {
|
|
15906
|
+
parents: 2,
|
|
15907
|
+
interior: {
|
|
15908
|
+
X2: [
|
|
15909
|
+
{
|
|
15910
|
+
GlobalConsensus: {
|
|
15911
|
+
Ethereum: {
|
|
15912
|
+
chainId: 1
|
|
15913
|
+
}
|
|
15914
|
+
}
|
|
15915
|
+
},
|
|
15916
|
+
{
|
|
15917
|
+
AccountKey20: {
|
|
15918
|
+
network: null,
|
|
15919
|
+
key: "0xe9f6d9898f9269b519e1435e6ebaff766c7f46bf"
|
|
15920
|
+
}
|
|
15921
|
+
}
|
|
15922
|
+
]
|
|
15923
|
+
}
|
|
15924
|
+
}
|
|
15925
|
+
},
|
|
15922
15926
|
{
|
|
15923
15927
|
symbol: "TONCOIN",
|
|
15924
15928
|
assetId: "0x582d872a1b094fc48f5de31d3b73f2d9be47def1",
|
|
@@ -20313,40 +20317,6 @@ var HydrationPaseo = {
|
|
|
20313
20317
|
}
|
|
20314
20318
|
]
|
|
20315
20319
|
};
|
|
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
20320
|
var KiltPaseo = {
|
|
20351
20321
|
relaychainSymbol: "PAS",
|
|
20352
20322
|
nativeAssetSymbol: "PILT",
|
|
@@ -20473,34 +20443,6 @@ var NeuroWebPaseo = {
|
|
|
20473
20443
|
}
|
|
20474
20444
|
]
|
|
20475
20445
|
};
|
|
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
20446
|
var ZeitgeistPaseo = {
|
|
20505
20447
|
relaychainSymbol: "PAS",
|
|
20506
20448
|
nativeAssetSymbol: "ZBS",
|
|
@@ -20632,8 +20574,6 @@ var assetsMapJson = {
|
|
|
20632
20574
|
Darwinia: Darwinia,
|
|
20633
20575
|
EnergyWebX: EnergyWebX,
|
|
20634
20576
|
Hydration: Hydration,
|
|
20635
|
-
IntegriteePolkadot: IntegriteePolkadot,
|
|
20636
|
-
IntegriteeKusama: IntegriteeKusama,
|
|
20637
20577
|
Interlay: Interlay,
|
|
20638
20578
|
Heima: Heima,
|
|
20639
20579
|
Moonbeam: Moonbeam,
|
|
@@ -20690,11 +20630,9 @@ var assetsMapJson = {
|
|
|
20690
20630
|
HeimaPaseo: HeimaPaseo,
|
|
20691
20631
|
EnergyWebXPaseo: EnergyWebXPaseo,
|
|
20692
20632
|
HydrationPaseo: HydrationPaseo,
|
|
20693
|
-
IntegriteePaseo: IntegriteePaseo,
|
|
20694
20633
|
KiltPaseo: KiltPaseo,
|
|
20695
20634
|
LaosPaseo: LaosPaseo,
|
|
20696
20635
|
NeuroWebPaseo: NeuroWebPaseo,
|
|
20697
|
-
NodlePaseo: NodlePaseo,
|
|
20698
20636
|
ZeitgeistPaseo: ZeitgeistPaseo
|
|
20699
20637
|
};
|
|
20700
20638
|
|
|
@@ -20706,8 +20644,10 @@ var assetsMapJson = {
|
|
|
20706
20644
|
*/
|
|
20707
20645
|
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
20708
20646
|
if (!symbol) return '';
|
|
20709
|
-
var
|
|
20710
|
-
|
|
20647
|
+
var s = symbol.toLowerCase();
|
|
20648
|
+
if (s.startsWith('xc')) s = s.substring(2);
|
|
20649
|
+
if (s.endsWith('.e')) s = s.slice(0, -2);
|
|
20650
|
+
return s;
|
|
20711
20651
|
};
|
|
20712
20652
|
|
|
20713
20653
|
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
@@ -20730,15 +20670,6 @@ var isTAsset = function isTAsset(value) {
|
|
|
20730
20670
|
return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
|
|
20731
20671
|
};
|
|
20732
20672
|
|
|
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
20673
|
/**
|
|
20743
20674
|
* Error thrown when multiple assets with the same symbol are found.
|
|
20744
20675
|
*/
|
|
@@ -20950,15 +20881,21 @@ var removePrefix = function removePrefix(symbol) {
|
|
|
20950
20881
|
var removeSuffix = function removeSuffix(symbol) {
|
|
20951
20882
|
return symbol.slice(0, -2);
|
|
20952
20883
|
};
|
|
20953
|
-
var findEthAssetBySymbol = function findEthAssetBySymbol(symbol) {
|
|
20954
|
-
var
|
|
20955
|
-
|
|
20884
|
+
var findEthAssetBySymbol = function findEthAssetBySymbol(symbol, otherAssets) {
|
|
20885
|
+
var ethCompatibleAssets = otherAssets.filter(function (asset) {
|
|
20886
|
+
return asset.location && deepEqual(getJunctionValue(asset.location, 'GlobalConsensus'), {
|
|
20887
|
+
Ethereum: {
|
|
20888
|
+
chainId: 1
|
|
20889
|
+
}
|
|
20890
|
+
});
|
|
20891
|
+
});
|
|
20892
|
+
return findBestMatches(ethCompatibleAssets, symbol)[0];
|
|
20956
20893
|
};
|
|
20957
|
-
var findEthMatch = function findEthMatch(symbol) {
|
|
20958
|
-
var match = findEthAssetBySymbol(symbol);
|
|
20894
|
+
var findEthMatch = function findEthMatch(symbol, otherAssets) {
|
|
20895
|
+
var match = findEthAssetBySymbol(symbol, otherAssets);
|
|
20959
20896
|
if (match) return match;
|
|
20960
20897
|
var altSymbol = symbol.toLowerCase().endsWith('.e') ? removeSuffix(symbol) : "".concat(symbol, ".e");
|
|
20961
|
-
return findEthAssetBySymbol(altSymbol.toLowerCase());
|
|
20898
|
+
return findEthAssetBySymbol(altSymbol.toLowerCase(), otherAssets);
|
|
20962
20899
|
};
|
|
20963
20900
|
var findWithXcVariant = function findWithXcVariant(items, value) {
|
|
20964
20901
|
var lower = value.toLowerCase();
|
|
@@ -20992,7 +20929,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
20992
20929
|
var lowerSymbol = value.toLowerCase();
|
|
20993
20930
|
var otherAssetsMatches = [];
|
|
20994
20931
|
if (destination === 'Ethereum') {
|
|
20995
|
-
return findEthMatch(value);
|
|
20932
|
+
return findEthMatch(value, otherAssets);
|
|
20996
20933
|
}
|
|
20997
20934
|
if (lowerSymbol.endsWith('.e')) {
|
|
20998
20935
|
// Symbol ends with '.e', indicating a Snowbridge asset
|
|
@@ -21004,7 +20941,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21004
20941
|
otherAssetsMatches = findWithXcVariant(otherAssets, value);
|
|
21005
20942
|
foundAsset = pickOtherOrThrow(value, otherAssetsMatches);
|
|
21006
20943
|
if (foundAsset) return foundAsset;
|
|
21007
|
-
var ethAsset = findEthAssetBySymbol(strippedSymbol);
|
|
20944
|
+
var ethAsset = findEthAssetBySymbol(strippedSymbol, otherAssets);
|
|
21008
20945
|
if (ethAsset) return ethAsset;
|
|
21009
20946
|
// If still not found, search normal assets without suffix
|
|
21010
20947
|
otherAssetsMatches = findBestMatches(otherAssets, strippedSymbol);
|
|
@@ -21028,7 +20965,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21028
20965
|
var _otherAssetsMatches = [];
|
|
21029
20966
|
var nativeAssetsMatches = [];
|
|
21030
20967
|
if (destination === 'Ethereum') {
|
|
21031
|
-
return findEthMatch(symbol);
|
|
20968
|
+
return findEthMatch(symbol, otherAssets);
|
|
21032
20969
|
}
|
|
21033
20970
|
if (_lowerSymbol.endsWith('.e')) {
|
|
21034
20971
|
// Symbol ends with '.e', indicating a Snowbridge asset
|
|
@@ -21043,7 +20980,7 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(destination, otherAss
|
|
|
21043
20980
|
var _foundAsset = pickOtherOrThrow(symbol, _otherAssetsMatches);
|
|
21044
20981
|
if (_foundAsset) return _foundAsset;
|
|
21045
20982
|
// Search in Ethereum assets without the '.e' suffix
|
|
21046
|
-
var _ethAsset = findEthAssetBySymbol(_strippedSymbol);
|
|
20983
|
+
var _ethAsset = findEthAssetBySymbol(_strippedSymbol, otherAssets);
|
|
21047
20984
|
if (_ethAsset) return _ethAsset;
|
|
21048
20985
|
// If still not found, search normal assets without suffix
|
|
21049
20986
|
_otherAssetsMatches = findBestMatches(otherAssets, _strippedSymbol);
|
|
@@ -21072,34 +21009,22 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
|
|
|
21072
21009
|
var _getAssetsObject = getAssetsObject(chain),
|
|
21073
21010
|
otherAssets = _getAssetsObject.otherAssets,
|
|
21074
21011
|
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
21012
|
var asset;
|
|
21083
21013
|
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
|
-
}
|
|
21014
|
+
asset = findAssetInfoBySymbol(destination, otherAssets, nativeAssets, currency.symbol);
|
|
21092
21015
|
} else if ('location' in currency && !isOverrideLocationSpecifier(currency.location)) {
|
|
21093
21016
|
var _findAssetInfoByLoc;
|
|
21094
|
-
|
|
21095
|
-
|
|
21096
|
-
|
|
21097
|
-
if (
|
|
21098
|
-
var
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21017
|
+
asset = (_findAssetInfoByLoc = findAssetInfoByLoc(otherAssets, currency.location)) !== null && _findAssetInfoByLoc !== void 0 ? _findAssetInfoByLoc : findAssetInfoByLoc(nativeAssets, currency.location);
|
|
21018
|
+
// Temporary condition for Mythos to allow selecting by Etheruem MYTH location
|
|
21019
|
+
// Will be removed in v12
|
|
21020
|
+
if (chain === 'Mythos') {
|
|
21021
|
+
var mythEthAsset = getOtherAssets('Ethereum').find(function (a) {
|
|
21022
|
+
return a.symbol === 'MYTH';
|
|
21023
|
+
});
|
|
21024
|
+
if (mythEthAsset && findAssetInfoByLoc([mythEthAsset], currency.location)) asset = nativeAssets[0];
|
|
21102
21025
|
}
|
|
21026
|
+
} else if ('id' in currency) {
|
|
21027
|
+
asset = findAssetInfoById(otherAssets, currency.id);
|
|
21103
21028
|
}
|
|
21104
21029
|
return asset !== null && asset !== void 0 ? asset : null;
|
|
21105
21030
|
};
|
|
@@ -21130,8 +21055,7 @@ var Override = function Override(location) {
|
|
|
21130
21055
|
};
|
|
21131
21056
|
|
|
21132
21057
|
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;
|
|
21058
|
+
var asset = findAssetInfo(chain, currency, destination);
|
|
21135
21059
|
if (!asset) {
|
|
21136
21060
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency, replaceBigInt), " not found on ").concat(chain));
|
|
21137
21061
|
}
|
|
@@ -21303,8 +21227,7 @@ var getNativeAssets = function getNativeAssets(chain) {
|
|
|
21303
21227
|
* @returns An array of other asset details.
|
|
21304
21228
|
*/
|
|
21305
21229
|
var getOtherAssets = function getOtherAssets(chain) {
|
|
21306
|
-
|
|
21307
|
-
return chain === 'AssetHubPolkadot' ? [].concat(_toConsumableArray(otherAssets), _toConsumableArray(getAssetsObject('Ethereum').otherAssets)) : otherAssets;
|
|
21230
|
+
return getAssetsObject(chain).otherAssets;
|
|
21308
21231
|
};
|
|
21309
21232
|
/**
|
|
21310
21233
|
* Retrieves the complete list of assets for a specified chain, including relay chain asset, native, and other assets.
|
|
@@ -21336,11 +21259,7 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
|
|
|
21336
21259
|
var symbol = _ref2.symbol;
|
|
21337
21260
|
return symbol;
|
|
21338
21261
|
});
|
|
21339
|
-
|
|
21340
|
-
var symbol = _ref3.symbol;
|
|
21341
|
-
return symbol;
|
|
21342
|
-
}) : [];
|
|
21343
|
-
return [].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols), _toConsumableArray(ethAssetsSymbols));
|
|
21262
|
+
return [].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols));
|
|
21344
21263
|
};
|
|
21345
21264
|
/**
|
|
21346
21265
|
* Retrieves the symbol of the native asset for a specified chain.
|
|
@@ -21349,7 +21268,6 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
|
|
|
21349
21268
|
* @returns The symbol of the native asset.
|
|
21350
21269
|
*/
|
|
21351
21270
|
var getNativeAssetSymbol = function getNativeAssetSymbol(chain) {
|
|
21352
|
-
if (chain === 'Ethereum') return 'ETH';
|
|
21353
21271
|
return getAssetsObject(chain).nativeAssetSymbol;
|
|
21354
21272
|
};
|
|
21355
21273
|
/**
|
|
@@ -21405,7 +21323,7 @@ var hasDryRunSupport = function hasDryRunSupport(chain) {
|
|
|
21405
21323
|
};
|
|
21406
21324
|
var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
21407
21325
|
// These chains have XcmPaymentApi but it's not working
|
|
21408
|
-
var DISABLED_CHAINS = ['
|
|
21326
|
+
var DISABLED_CHAINS = ['Basilisk', 'Jamton'];
|
|
21409
21327
|
return getAssetsObject(chain).supportsXcmPaymentApi && !DISABLED_CHAINS.includes(chain);
|
|
21410
21328
|
};
|
|
21411
21329
|
|
|
@@ -21419,21 +21337,8 @@ var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
|
21419
21337
|
var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
21420
21338
|
var originAssets = getAssets(origin);
|
|
21421
21339
|
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') {
|
|
21340
|
+
var isSubBridge = isSubstrateBridge(origin, destination);
|
|
21341
|
+
if (isSubBridge) {
|
|
21437
21342
|
return originAssets.filter(function (asset) {
|
|
21438
21343
|
return asset.symbol === 'KSM' || asset.symbol === 'DOT';
|
|
21439
21344
|
});
|
|
@@ -21443,16 +21348,6 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
|
21443
21348
|
return normalizeSymbol(a.symbol) === normalizeSymbol(asset.symbol);
|
|
21444
21349
|
});
|
|
21445
21350
|
});
|
|
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
21351
|
return supportedAssets;
|
|
21457
21352
|
};
|
|
21458
21353
|
|
|
@@ -21496,4 +21391,4 @@ var isAssetXcEqual = function isAssetXcEqual(asset1, asset2) {
|
|
|
21496
21391
|
return isSymbolMatch(asset1.symbol, asset2.symbol);
|
|
21497
21392
|
};
|
|
21498
21393
|
|
|
21499
|
-
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, compareLocations, extractAssetLocation,
|
|
21394
|
+
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.8",
|
|
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.8"
|
|
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",
|