@paraspell/swap 14.3.3 → 14.3.4
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.mjs +13 -21
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1647,10 +1647,7 @@ var Hydration = {
|
|
|
1647
1647
|
Parachain: 2034
|
|
1648
1648
|
},
|
|
1649
1649
|
{
|
|
1650
|
-
|
|
1651
|
-
network: null,
|
|
1652
|
-
key: "0x531a654d1696ed52e7275a8cede955e82620f99a"
|
|
1653
|
-
}
|
|
1650
|
+
GeneralIndex: 222
|
|
1654
1651
|
}
|
|
1655
1652
|
]
|
|
1656
1653
|
}
|
|
@@ -9525,20 +9522,8 @@ var getSupportedAssetsTo = function getSupportedAssetsTo(exchangeInput, to) {
|
|
|
9525
9522
|
};
|
|
9526
9523
|
|
|
9527
9524
|
var getSupportedFeeAssetsImpl = function getSupportedFeeAssetsImpl(from, exchangeInput, ctx) {
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
var chains = from ? [from] : (exchange === undefined ? EXCHANGE_CHAINS : Array.isArray(exchange) ? exchange : [exchange]).map(function (ex) {
|
|
9531
|
-
return createExchangeInstance(ex).chain;
|
|
9532
|
-
}).filter(function (chain, i, arr) {
|
|
9533
|
-
return arr.indexOf(chain) === i;
|
|
9534
|
-
});
|
|
9535
|
-
var chainAssets = chains.flatMap(function (chain) {
|
|
9536
|
-
return getAssetsImpl(chain, ctx);
|
|
9537
|
-
});
|
|
9538
|
-
return supportedAssets.filter(function (asset) {
|
|
9539
|
-
return chainAssets.some(function (chainAsset) {
|
|
9540
|
-
return chainAsset.isFeeAsset && isAssetEqual(asset, chainAsset);
|
|
9541
|
-
});
|
|
9525
|
+
return getSupportedAssetsFromImpl(from, exchangeInput, ctx).filter(function (asset) {
|
|
9526
|
+
return asset.isFeeAsset;
|
|
9542
9527
|
});
|
|
9543
9528
|
};
|
|
9544
9529
|
/**
|
|
@@ -9955,6 +9940,9 @@ var resolveAssets = function resolveAssets(dex, _ref) {
|
|
|
9955
9940
|
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset), " not found in ").concat(from, "."));
|
|
9956
9941
|
}
|
|
9957
9942
|
var feeAssetFromExchange = feeAsset ? from && feeAssetFromOrigin ? getExchangeAssetByOriginAsset(from, dex.chain, feeAssetFromOrigin) : (_getExchangeAsset = getExchangeAsset(dex.chain, feeAsset)) !== null && _getExchangeAsset !== void 0 ? _getExchangeAsset : undefined : undefined;
|
|
9943
|
+
if (feeAsset && !feeAssetFromOrigin && !feeAssetFromExchange) {
|
|
9944
|
+
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset), " not found in ").concat(dex.chain, "."));
|
|
9945
|
+
}
|
|
9958
9946
|
var resolvedFeeAssetLocation = (_feeAssetFromOrigin$l = feeAssetFromOrigin === null || feeAssetFromOrigin === void 0 ? void 0 : feeAssetFromOrigin.location) !== null && _feeAssetFromOrigin$l !== void 0 ? _feeAssetFromOrigin$l : feeAssetFromExchange === null || feeAssetFromExchange === void 0 ? void 0 : feeAssetFromExchange.location;
|
|
9959
9947
|
if (feeAsset && resolvedFeeAssetLocation) {
|
|
9960
9948
|
var sdkAsset = findAssetInfoOrThrow(from !== null && from !== void 0 ? from : dex.chain, {
|
|
@@ -10756,8 +10744,8 @@ var getSwapFee = /*#__PURE__*/function () {
|
|
|
10756
10744
|
|
|
10757
10745
|
var getRouterFees = /*#__PURE__*/function () {
|
|
10758
10746
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(dex, options, disableFallback) {
|
|
10759
|
-
var _sendingChain$hops, _receivingChain$origi, _receivingChain$hops, _sendingChain$origin, _receivingChain$desti, _sendingChain$dryRunE;
|
|
10760
|
-
var api, origin, exchange, destination, sender, _yield$getSwapExecute, result, transformedHops, sendingChain, _yield$getSwapFee, swapChain, amountOut, receivingChain, mergedHops, finalOrigin, finalDestination, dryRunError, _t, _t2, _t3;
|
|
10747
|
+
var _sendingChain$hops, _receivingChain$origi, _receivingChain$hops, _sendingChain$origin, _receivingChain$desti, _ref2, _sendingChain$dryRunE;
|
|
10748
|
+
var api, origin, exchange, destination, sender, _yield$getSwapExecute, result, transformedHops, sendingChain, _yield$getSwapFee, swapChain, amountOut, receivingChain, mergedHops, finalOrigin, finalDestination, swapDryRunError, dryRunError, _t, _t2, _t3;
|
|
10761
10749
|
return _regenerator().w(function (_context) {
|
|
10762
10750
|
while (1) switch (_context.p = _context.n) {
|
|
10763
10751
|
case 0:
|
|
@@ -10855,7 +10843,11 @@ var getRouterFees = /*#__PURE__*/function () {
|
|
|
10855
10843
|
}), !origin && !destination && {
|
|
10856
10844
|
fee: 0n
|
|
10857
10845
|
});
|
|
10858
|
-
|
|
10846
|
+
swapDryRunError = swapChain.dryRunError && _objectSpread2(_objectSpread2({}, swapChain.dryRunError), {}, {
|
|
10847
|
+
chainKind: !sendingChain ? 'origin' : !receivingChain ? 'destination' : 'hop',
|
|
10848
|
+
chain: exchange.chain
|
|
10849
|
+
});
|
|
10850
|
+
dryRunError = (_ref2 = (_sendingChain$dryRunE = sendingChain === null || sendingChain === void 0 ? void 0 : sendingChain.dryRunError) !== null && _sendingChain$dryRunE !== void 0 ? _sendingChain$dryRunE : swapDryRunError) !== null && _ref2 !== void 0 ? _ref2 : receivingChain === null || receivingChain === void 0 ? void 0 : receivingChain.dryRunError;
|
|
10859
10851
|
return _context.a(2, {
|
|
10860
10852
|
success: !dryRunError,
|
|
10861
10853
|
dryRunError: dryRunError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/swap",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.4",
|
|
4
4
|
"description": "Tool for XCM cross-chain asset exchanging across Polkadot and Kusama ecosystems",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"@crypto-dex-sdk/token-lists": "^0.1.4",
|
|
39
39
|
"@galacticcouncil/descriptors": "^2.7.0",
|
|
40
40
|
"@galacticcouncil/sdk-next": "^2.1.0",
|
|
41
|
-
"@paraspell/sdk": "14.3.
|
|
42
|
-
"@paraspell/sdk-common": "14.3.
|
|
43
|
-
"@paraspell/sdk-core": "14.3.
|
|
44
|
-
"@paraspell/sdk-pjs": "14.3.
|
|
41
|
+
"@paraspell/sdk": "14.3.4",
|
|
42
|
+
"@paraspell/sdk-common": "14.3.4",
|
|
43
|
+
"@paraspell/sdk-core": "14.3.4",
|
|
44
|
+
"@paraspell/sdk-pjs": "14.3.4",
|
|
45
45
|
"@polkadot/api": "^16.5.6",
|
|
46
46
|
"@polkadot/types": "^16.5.6",
|
|
47
47
|
"@polkadot/util": "^14.0.3",
|