@paraspell/swap 14.3.0 → 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 -72
- 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
|
}
|
|
@@ -2128,22 +2125,6 @@ var Hydration = {
|
|
|
2128
2125
|
]
|
|
2129
2126
|
}
|
|
2130
2127
|
},
|
|
2131
|
-
{
|
|
2132
|
-
parents: 1,
|
|
2133
|
-
interior: {
|
|
2134
|
-
X2: [
|
|
2135
|
-
{
|
|
2136
|
-
Parachain: 2030
|
|
2137
|
-
},
|
|
2138
|
-
{
|
|
2139
|
-
GeneralKey: {
|
|
2140
|
-
length: 2,
|
|
2141
|
-
data: "0x0903000000000000000000000000000000000000000000000000000000000000"
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
]
|
|
2145
|
-
}
|
|
2146
|
-
},
|
|
2147
2128
|
{
|
|
2148
2129
|
parents: 1,
|
|
2149
2130
|
interior: {
|
|
@@ -2349,31 +2330,6 @@ var Hydration = {
|
|
|
2349
2330
|
]
|
|
2350
2331
|
}
|
|
2351
2332
|
},
|
|
2352
|
-
{
|
|
2353
|
-
parents: 1,
|
|
2354
|
-
interior: {
|
|
2355
|
-
X4: [
|
|
2356
|
-
{
|
|
2357
|
-
Parachain: 2034
|
|
2358
|
-
},
|
|
2359
|
-
{
|
|
2360
|
-
GeneralKey: {
|
|
2361
|
-
length: 2,
|
|
2362
|
-
data: "0x7768000000000000000000000000000000000000000000000000000000000000"
|
|
2363
|
-
}
|
|
2364
|
-
},
|
|
2365
|
-
{
|
|
2366
|
-
GeneralIndex: 21
|
|
2367
|
-
},
|
|
2368
|
-
{
|
|
2369
|
-
GeneralKey: {
|
|
2370
|
-
length: 32,
|
|
2371
|
-
data: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3"
|
|
2372
|
-
}
|
|
2373
|
-
}
|
|
2374
|
-
]
|
|
2375
|
-
}
|
|
2376
|
-
},
|
|
2377
2333
|
{
|
|
2378
2334
|
parents: 1,
|
|
2379
2335
|
interior: {
|
|
@@ -2793,16 +2749,6 @@ var Hydration = {
|
|
|
2793
2749
|
]
|
|
2794
2750
|
}
|
|
2795
2751
|
},
|
|
2796
|
-
{
|
|
2797
|
-
parents: 1,
|
|
2798
|
-
interior: {
|
|
2799
|
-
X1: [
|
|
2800
|
-
{
|
|
2801
|
-
Parachain: 2006
|
|
2802
|
-
}
|
|
2803
|
-
]
|
|
2804
|
-
}
|
|
2805
|
-
},
|
|
2806
2752
|
{
|
|
2807
2753
|
parents: 1,
|
|
2808
2754
|
interior: {
|
|
@@ -9576,20 +9522,8 @@ var getSupportedAssetsTo = function getSupportedAssetsTo(exchangeInput, to) {
|
|
|
9576
9522
|
};
|
|
9577
9523
|
|
|
9578
9524
|
var getSupportedFeeAssetsImpl = function getSupportedFeeAssetsImpl(from, exchangeInput, ctx) {
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
var chains = from ? [from] : (exchange === undefined ? EXCHANGE_CHAINS : Array.isArray(exchange) ? exchange : [exchange]).map(function (ex) {
|
|
9582
|
-
return createExchangeInstance(ex).chain;
|
|
9583
|
-
}).filter(function (chain, i, arr) {
|
|
9584
|
-
return arr.indexOf(chain) === i;
|
|
9585
|
-
});
|
|
9586
|
-
var chainAssets = chains.flatMap(function (chain) {
|
|
9587
|
-
return getAssetsImpl(chain, ctx);
|
|
9588
|
-
});
|
|
9589
|
-
return supportedAssets.filter(function (asset) {
|
|
9590
|
-
return chainAssets.some(function (chainAsset) {
|
|
9591
|
-
return chainAsset.isFeeAsset && isAssetEqual(asset, chainAsset);
|
|
9592
|
-
});
|
|
9525
|
+
return getSupportedAssetsFromImpl(from, exchangeInput, ctx).filter(function (asset) {
|
|
9526
|
+
return asset.isFeeAsset;
|
|
9593
9527
|
});
|
|
9594
9528
|
};
|
|
9595
9529
|
/**
|
|
@@ -10006,6 +9940,9 @@ var resolveAssets = function resolveAssets(dex, _ref) {
|
|
|
10006
9940
|
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset), " not found in ").concat(from, "."));
|
|
10007
9941
|
}
|
|
10008
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
|
+
}
|
|
10009
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;
|
|
10010
9947
|
if (feeAsset && resolvedFeeAssetLocation) {
|
|
10011
9948
|
var sdkAsset = findAssetInfoOrThrow(from !== null && from !== void 0 ? from : dex.chain, {
|
|
@@ -10807,8 +10744,8 @@ var getSwapFee = /*#__PURE__*/function () {
|
|
|
10807
10744
|
|
|
10808
10745
|
var getRouterFees = /*#__PURE__*/function () {
|
|
10809
10746
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(dex, options, disableFallback) {
|
|
10810
|
-
var _sendingChain$hops, _receivingChain$origi, _receivingChain$hops, _sendingChain$origin, _receivingChain$desti, _sendingChain$dryRunE;
|
|
10811
|
-
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;
|
|
10812
10749
|
return _regenerator().w(function (_context) {
|
|
10813
10750
|
while (1) switch (_context.p = _context.n) {
|
|
10814
10751
|
case 0:
|
|
@@ -10906,7 +10843,11 @@ var getRouterFees = /*#__PURE__*/function () {
|
|
|
10906
10843
|
}), !origin && !destination && {
|
|
10907
10844
|
fee: 0n
|
|
10908
10845
|
});
|
|
10909
|
-
|
|
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;
|
|
10910
10851
|
return _context.a(2, {
|
|
10911
10852
|
success: !dryRunError,
|
|
10912
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",
|