@paraspell/assets 10.5.2 → 10.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +34 -4
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +34 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -11640,6 +11640,31 @@ var Ethereum = {
|
|
|
11640
11640
|
]
|
|
11641
11641
|
}
|
|
11642
11642
|
}
|
|
11643
|
+
},
|
|
11644
|
+
{
|
|
11645
|
+
symbol: "MYTH",
|
|
11646
|
+
assetId: "0xba41ddf06b7ffd89d1267b5a93bfef2424eb2003",
|
|
11647
|
+
existentialDeposit: "1",
|
|
11648
|
+
multiLocation: {
|
|
11649
|
+
parents: 2,
|
|
11650
|
+
interior: {
|
|
11651
|
+
X2: [
|
|
11652
|
+
{
|
|
11653
|
+
GlobalConsensus: {
|
|
11654
|
+
Ethereum: {
|
|
11655
|
+
chainId: 1
|
|
11656
|
+
}
|
|
11657
|
+
}
|
|
11658
|
+
},
|
|
11659
|
+
{
|
|
11660
|
+
AccountKey20: {
|
|
11661
|
+
network: null,
|
|
11662
|
+
key: "0xba41ddf06b7ffd89d1267b5a93bfef2424eb2003"
|
|
11663
|
+
}
|
|
11664
|
+
}
|
|
11665
|
+
]
|
|
11666
|
+
}
|
|
11667
|
+
}
|
|
11643
11668
|
}
|
|
11644
11669
|
]
|
|
11645
11670
|
};
|
|
@@ -12473,6 +12498,10 @@ var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
|
12473
12498
|
return lowerSymbol.startsWith('xc') ? lowerSymbol.substring(2) : lowerSymbol;
|
|
12474
12499
|
};
|
|
12475
12500
|
|
|
12501
|
+
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
12502
|
+
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
12503
|
+
};
|
|
12504
|
+
|
|
12476
12505
|
/**
|
|
12477
12506
|
* Retrieves the list of assets that are supported for transfers between two specified nodes.
|
|
12478
12507
|
*
|
|
@@ -12490,6 +12519,11 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
|
12490
12519
|
if (origin === 'Moonbeam') {
|
|
12491
12520
|
return ethereumCompatibleAssets;
|
|
12492
12521
|
}
|
|
12522
|
+
if (origin === 'Mythos') {
|
|
12523
|
+
return ethereumAssets.filter(function (asset) {
|
|
12524
|
+
return isSymbolMatch(asset.symbol, getNativeAssetSymbol(origin));
|
|
12525
|
+
});
|
|
12526
|
+
}
|
|
12493
12527
|
return [].concat(_toConsumableArray(ethereumCompatibleAssets), _toConsumableArray(ethereumAssets));
|
|
12494
12528
|
}
|
|
12495
12529
|
if (origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot') {
|
|
@@ -12548,10 +12582,6 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
|
|
|
12548
12582
|
return asset1.symbol.toLowerCase() === asset2.symbol.toLowerCase();
|
|
12549
12583
|
};
|
|
12550
12584
|
|
|
12551
|
-
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
12552
|
-
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
12553
|
-
};
|
|
12554
|
-
|
|
12555
12585
|
var extractMultiAssetLoc = function extractMultiAssetLoc(multiAsset) {
|
|
12556
12586
|
return 'Concrete' in multiAsset.id ? multiAsset.id.Concrete : multiAsset.id;
|
|
12557
12587
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ type TForeignAsset = TBaseAsset & AtLeastOne<{
|
|
|
20
20
|
multiLocation?: TMultiLocation;
|
|
21
21
|
}>;
|
|
22
22
|
type TAsset = TNativeAsset | TForeignAsset;
|
|
23
|
+
type TAssetWithLocation = TAsset & {
|
|
24
|
+
multiLocation: TMultiLocation;
|
|
25
|
+
};
|
|
23
26
|
type TNodeAssets = {
|
|
24
27
|
relayChainAssetSymbol: TRelayChainSymbol;
|
|
25
28
|
nativeAssetSymbol: string;
|
|
@@ -288,4 +291,4 @@ declare const extractMultiAssetLoc: (multiAsset: TMultiAsset) => TMultiLocation;
|
|
|
288
291
|
declare const getAssetMultiLocation: (node: TNodeWithRelayChains, currency: TCurrencyInput) => TMultiLocation | null;
|
|
289
292
|
|
|
290
293
|
export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, compareMultiLocations, extractMultiAssetLoc, filterEthCompatibleAssets, findAsset, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findAssetForNodeOrThrow, findAssetOnDest, findAssetOnDestOrThrow, findBestMatches, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getExistentialDeposit, getExistentialDepositOrThrow, getFeeAssets, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getSupportedDestinations, hasDryRunSupport, hasSupportForAsset, hasXcmPaymentApiSupport, isAssetEqual, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isSymbolMatch, isSymbolSpecifier, isTMultiAsset, normalizeMultiLocation, normalizeSymbol };
|
|
291
|
-
export type { TAmount, TAsset, TAssetJsonMap, TCurrency, TCurrencyCore, TCurrencyInput, TCurrencyInputWithAmount, TCurrencySymbol, TCurrencySymbolValue, TForeignAsset, TMultiAsset, TMultiAssetV3, TMultiAssetV4, TMultiAssetWithFee, TMultiLocationValue, TMultiLocationValueWithOverride, TNativeAsset, TNodeAssets, TOverrideMultiLocationSpecifier, TSymbolSpecifier, WithAmount };
|
|
294
|
+
export type { TAmount, TAsset, TAssetJsonMap, TAssetWithLocation, TCurrency, TCurrencyCore, TCurrencyInput, TCurrencyInputWithAmount, TCurrencySymbol, TCurrencySymbolValue, TForeignAsset, TMultiAsset, TMultiAssetV3, TMultiAssetV4, TMultiAssetWithFee, TMultiLocationValue, TMultiLocationValueWithOverride, TNativeAsset, TNodeAssets, TOverrideMultiLocationSpecifier, TSymbolSpecifier, WithAmount };
|
package/dist/index.mjs
CHANGED
|
@@ -11638,6 +11638,31 @@ var Ethereum = {
|
|
|
11638
11638
|
]
|
|
11639
11639
|
}
|
|
11640
11640
|
}
|
|
11641
|
+
},
|
|
11642
|
+
{
|
|
11643
|
+
symbol: "MYTH",
|
|
11644
|
+
assetId: "0xba41ddf06b7ffd89d1267b5a93bfef2424eb2003",
|
|
11645
|
+
existentialDeposit: "1",
|
|
11646
|
+
multiLocation: {
|
|
11647
|
+
parents: 2,
|
|
11648
|
+
interior: {
|
|
11649
|
+
X2: [
|
|
11650
|
+
{
|
|
11651
|
+
GlobalConsensus: {
|
|
11652
|
+
Ethereum: {
|
|
11653
|
+
chainId: 1
|
|
11654
|
+
}
|
|
11655
|
+
}
|
|
11656
|
+
},
|
|
11657
|
+
{
|
|
11658
|
+
AccountKey20: {
|
|
11659
|
+
network: null,
|
|
11660
|
+
key: "0xba41ddf06b7ffd89d1267b5a93bfef2424eb2003"
|
|
11661
|
+
}
|
|
11662
|
+
}
|
|
11663
|
+
]
|
|
11664
|
+
}
|
|
11665
|
+
}
|
|
11641
11666
|
}
|
|
11642
11667
|
]
|
|
11643
11668
|
};
|
|
@@ -12471,6 +12496,10 @@ var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
|
12471
12496
|
return lowerSymbol.startsWith('xc') ? lowerSymbol.substring(2) : lowerSymbol;
|
|
12472
12497
|
};
|
|
12473
12498
|
|
|
12499
|
+
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
12500
|
+
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
12501
|
+
};
|
|
12502
|
+
|
|
12474
12503
|
/**
|
|
12475
12504
|
* Retrieves the list of assets that are supported for transfers between two specified nodes.
|
|
12476
12505
|
*
|
|
@@ -12488,6 +12517,11 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
|
12488
12517
|
if (origin === 'Moonbeam') {
|
|
12489
12518
|
return ethereumCompatibleAssets;
|
|
12490
12519
|
}
|
|
12520
|
+
if (origin === 'Mythos') {
|
|
12521
|
+
return ethereumAssets.filter(function (asset) {
|
|
12522
|
+
return isSymbolMatch(asset.symbol, getNativeAssetSymbol(origin));
|
|
12523
|
+
});
|
|
12524
|
+
}
|
|
12491
12525
|
return [].concat(_toConsumableArray(ethereumCompatibleAssets), _toConsumableArray(ethereumAssets));
|
|
12492
12526
|
}
|
|
12493
12527
|
if (origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot') {
|
|
@@ -12546,10 +12580,6 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
|
|
|
12546
12580
|
return asset1.symbol.toLowerCase() === asset2.symbol.toLowerCase();
|
|
12547
12581
|
};
|
|
12548
12582
|
|
|
12549
|
-
var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
12550
|
-
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
12551
|
-
};
|
|
12552
|
-
|
|
12553
12583
|
var extractMultiAssetLoc = function extractMultiAssetLoc(multiAsset) {
|
|
12554
12584
|
return 'Concrete' in multiAsset.id ? multiAsset.id.Concrete : multiAsset.id;
|
|
12555
12585
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/assets",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"description": "Assets for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@paraspell/sdk-common": "10.
|
|
26
|
+
"@paraspell/sdk-common": "10.6.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|