@paraspell/swap 14.4.4 → 14.5.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.mjs +93 -11
- package/package.json +14 -14
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createChainClient as createChainClient$1, getPaymentInfo, registerSwapExtension } from '@paraspell/sdk';
|
|
2
|
-
import { UnsupportedOperationError, assertCurrencyCore, dryRun, getDryRunError, DryRunFailedError, isConfig, getNativeAssets, RoutingResolutionError, findAssetInfoById, getOtherAssets, getChainProviders, parseUnits, getNativeAssetSymbol, padValueBy, formatUnits as formatUnits$1, AmountTooLowError, getBalance, localizeLocation, getAssets, Parents, isSymbolMatch, getParaId, UnableToComputeError, findNativeAssetInfoOrThrow, InvalidCurrencyError, findAssetInfoOrThrow, findAssetInfoByLoc, isSymbolSpecifier, findBestMatches, findAssetInfoBySymbol, getSupportedAssetsImpl, isAssetEqual, findAssetInfoOnDestImpl, normalizeExchange, EXCHANGE_CHAINS, deepEqual, reverseTransformLocation, getAssetsImpl, ScenarioNotSupportedError, applyDecimalAbstraction, findAssetInfo, Builder, isChainEvm, convertBuilderConfig, handleSwapExecuteTransfer, getXcmFee, getOriginXcmFee as getOriginXcmFee$1, InvalidAddressError, MissingParameterError, BatchMode, createChainClient as createChainClient$2, getExistentialDeposit, buildHopInfo, getRelayChainSymbol, aggregateHopFees, buildDestInfo, buildOriginInfo } from '@paraspell/sdk-core';
|
|
2
|
+
import { UnsupportedOperationError, assertCurrencyCore, dryRun, getDryRunError, DryRunFailedError, isConfig, getNativeAssets, RoutingResolutionError, findAssetInfoById, getOtherAssets, getChainProviders, parseUnits, getNativeAssetSymbol, padValueBy, formatUnits as formatUnits$1, AmountTooLowError, getBalance, localizeLocation, getAssets, Parents, isSymbolMatch, getParaId, UnableToComputeError, findNativeAssetInfoOrThrow, InvalidCurrencyError, findAssetInfoOrThrow, findAssetInfoByLoc, isSymbolSpecifier, findBestMatches, findAssetInfoBySymbol, getSupportedAssetsImpl, isAssetEqual, findAssetInfoOnDestImpl, normalizeExchange, EXCHANGE_CHAINS, deepEqual, reverseTransformLocation, getAssetsImpl, ScenarioNotSupportedError, applyDecimalAbstraction, findAssetInfo, replaceBigInt, Builder, isChainEvm, convertBuilderConfig, handleSwapExecuteTransfer, getXcmFee, getOriginXcmFee as getOriginXcmFee$1, InvalidAddressError, MissingParameterError, BatchMode, createChainClient as createChainClient$2, getExistentialDeposit, buildHopInfo, getRelayChainSymbol, aggregateHopFees, buildDestInfo, buildOriginInfo } from '@paraspell/sdk-core';
|
|
3
3
|
import { toHex } from 'polkadot-api/utils';
|
|
4
4
|
import 'polkadot-api';
|
|
5
5
|
import { Wallet } from '@acala-network/sdk';
|
|
@@ -1733,6 +1733,31 @@ var Hydration = {
|
|
|
1733
1733
|
]
|
|
1734
1734
|
}
|
|
1735
1735
|
},
|
|
1736
|
+
{
|
|
1737
|
+
parents: 1,
|
|
1738
|
+
interior: {
|
|
1739
|
+
X4: [
|
|
1740
|
+
{
|
|
1741
|
+
Parachain: 2034
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
GeneralKey: {
|
|
1745
|
+
length: 2,
|
|
1746
|
+
data: "0x7768000000000000000000000000000000000000000000000000000000000000"
|
|
1747
|
+
}
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
GeneralIndex: 72
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
GeneralKey: {
|
|
1754
|
+
length: 32,
|
|
1755
|
+
data: "0x000000000000000000000000117cc2133c37b721f49de2a7a74833232b3b4c0c"
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
]
|
|
1759
|
+
}
|
|
1760
|
+
},
|
|
1736
1761
|
{
|
|
1737
1762
|
parents: 1,
|
|
1738
1763
|
interior: {
|
|
@@ -1976,6 +2001,47 @@ var Hydration = {
|
|
|
1976
2001
|
]
|
|
1977
2002
|
}
|
|
1978
2003
|
},
|
|
2004
|
+
{
|
|
2005
|
+
parents: 1,
|
|
2006
|
+
interior: {
|
|
2007
|
+
X4: [
|
|
2008
|
+
{
|
|
2009
|
+
Parachain: 2034
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
GeneralKey: {
|
|
2013
|
+
length: 2,
|
|
2014
|
+
data: "0x7768000000000000000000000000000000000000000000000000000000000000"
|
|
2015
|
+
}
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
GeneralIndex: 15
|
|
2019
|
+
},
|
|
2020
|
+
{
|
|
2021
|
+
GeneralKey: {
|
|
2022
|
+
length: 32,
|
|
2023
|
+
data: "0x3174446b8cc98197d6f2c9e504d6d229f0adb00d2b7566af0e54a84a876fef0f"
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
]
|
|
2027
|
+
}
|
|
2028
|
+
},
|
|
2029
|
+
{
|
|
2030
|
+
parents: 1,
|
|
2031
|
+
interior: {
|
|
2032
|
+
X2: [
|
|
2033
|
+
{
|
|
2034
|
+
Parachain: 2034
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
AccountKey20: {
|
|
2038
|
+
network: null,
|
|
2039
|
+
key: "0xc29286aa0ed2fcb4fc581c8f0a068328e18ef075"
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
]
|
|
2043
|
+
}
|
|
2044
|
+
},
|
|
1979
2045
|
{
|
|
1980
2046
|
parents: 1,
|
|
1981
2047
|
interior: {
|
|
@@ -2503,6 +2569,22 @@ var Hydration = {
|
|
|
2503
2569
|
]
|
|
2504
2570
|
}
|
|
2505
2571
|
},
|
|
2572
|
+
{
|
|
2573
|
+
parents: 1,
|
|
2574
|
+
interior: {
|
|
2575
|
+
X2: [
|
|
2576
|
+
{
|
|
2577
|
+
Parachain: 2034
|
|
2578
|
+
},
|
|
2579
|
+
{
|
|
2580
|
+
AccountKey20: {
|
|
2581
|
+
network: null,
|
|
2582
|
+
key: "0xa8f540fb7852024da35d30947be0899299ba42f1"
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
]
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2506
2588
|
{
|
|
2507
2589
|
parents: 1,
|
|
2508
2590
|
interior: {
|
|
@@ -9697,7 +9779,7 @@ var selectBestExchangeCommon = /*#__PURE__*/function () {
|
|
|
9697
9779
|
_context2.n = 1;
|
|
9698
9780
|
break;
|
|
9699
9781
|
}
|
|
9700
|
-
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(options.currencyFrom), " not found in ").concat(options.from, "."));
|
|
9782
|
+
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(options.currencyFrom, replaceBigInt), " not found in ").concat(options.from, "."));
|
|
9701
9783
|
case 1:
|
|
9702
9784
|
if (!('id' in currencyTo)) {
|
|
9703
9785
|
_context2.n = 2;
|
|
@@ -9976,31 +10058,31 @@ var resolveAssets = function resolveAssets(dex, _ref) {
|
|
|
9976
10058
|
var destinationSpecified = to && to !== dex.chain;
|
|
9977
10059
|
var assetFromOrigin = originSpecified ? findAssetInfo(from, currencyFrom, dex.chain) : undefined;
|
|
9978
10060
|
if (originSpecified && !assetFromOrigin) {
|
|
9979
|
-
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom), " not found in ").concat(from, "."));
|
|
10061
|
+
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom, replaceBigInt), " not found in ").concat(from, "."));
|
|
9980
10062
|
}
|
|
9981
10063
|
var assetFromExchange = originSpecified && assetFromOrigin ? getExchangeAssetByOriginAsset(from, dex.chain, assetFromOrigin) : getExchangeAsset(dex.chain, currencyFrom);
|
|
9982
10064
|
if (!assetFromExchange) {
|
|
9983
10065
|
if (!originSpecified && findAssetInfo(dex.chain, currencyFrom)) {
|
|
9984
|
-
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom), " exists in ").concat(dex.chain, " but is not swappable on ").concat(dex.chain, "."));
|
|
10066
|
+
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom, replaceBigInt), " exists in ").concat(dex.chain, " but is not swappable on ").concat(dex.chain, "."));
|
|
9985
10067
|
}
|
|
9986
|
-
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom), " not found in ").concat(dex.chain, "."));
|
|
10068
|
+
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom, replaceBigInt), " not found in ").concat(dex.chain, "."));
|
|
9987
10069
|
}
|
|
9988
10070
|
var assetTo = getExchangeAsset(dex.chain, currencyTo);
|
|
9989
10071
|
if (!assetTo) {
|
|
9990
|
-
throw new RoutingResolutionError("Currency to ".concat(JSON.stringify(currencyTo), " not found in ").concat(dex.chain, "."));
|
|
10072
|
+
throw new RoutingResolutionError("Currency to ".concat(JSON.stringify(currencyTo, replaceBigInt), " not found in ").concat(dex.chain, "."));
|
|
9991
10073
|
}
|
|
9992
10074
|
if (destinationSpecified && !getSupportedAssetsImpl(dex.chain, to).some(function (asset) {
|
|
9993
10075
|
return isAssetEqual(asset, assetTo);
|
|
9994
10076
|
})) {
|
|
9995
|
-
throw new RoutingResolutionError("Currency to ".concat(JSON.stringify(currencyTo), " not supported by ").concat(to, "."));
|
|
10077
|
+
throw new RoutingResolutionError("Currency to ".concat(JSON.stringify(currencyTo, replaceBigInt), " not supported by ").concat(to, "."));
|
|
9996
10078
|
}
|
|
9997
10079
|
var feeAssetFromOrigin = feeAsset && originSpecified ? (_findAssetInfo = findAssetInfo(from, feeAsset, dex.chain)) !== null && _findAssetInfo !== void 0 ? _findAssetInfo : undefined : undefined;
|
|
9998
10080
|
if (feeAsset && originSpecified && !feeAssetFromOrigin) {
|
|
9999
|
-
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset), " not found in ").concat(from, "."));
|
|
10081
|
+
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset, replaceBigInt), " not found in ").concat(from, "."));
|
|
10000
10082
|
}
|
|
10001
10083
|
var feeAssetFromExchange = feeAsset ? from && feeAssetFromOrigin ? getExchangeAssetByOriginAsset(from, dex.chain, feeAssetFromOrigin) : (_getExchangeAsset = getExchangeAsset(dex.chain, feeAsset)) !== null && _getExchangeAsset !== void 0 ? _getExchangeAsset : undefined : undefined;
|
|
10002
10084
|
if (feeAsset && !feeAssetFromOrigin && !feeAssetFromExchange) {
|
|
10003
|
-
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset), " not found in ").concat(dex.chain, "."));
|
|
10085
|
+
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset, replaceBigInt), " not found in ").concat(dex.chain, "."));
|
|
10004
10086
|
}
|
|
10005
10087
|
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;
|
|
10006
10088
|
if (feeAsset && resolvedFeeAssetLocation) {
|
|
@@ -10008,7 +10090,7 @@ var resolveAssets = function resolveAssets(dex, _ref) {
|
|
|
10008
10090
|
location: resolvedFeeAssetLocation
|
|
10009
10091
|
}, null);
|
|
10010
10092
|
if (!sdkAsset.isFeeAsset) {
|
|
10011
|
-
throw new RoutingResolutionError("Asset ".concat(JSON.stringify(feeAsset), " is not a valid fee asset in ").concat(from !== null && from !== void 0 ? from : dex.chain, "."));
|
|
10093
|
+
throw new RoutingResolutionError("Asset ".concat(JSON.stringify(feeAsset, replaceBigInt), " is not a valid fee asset in ").concat(from !== null && from !== void 0 ? from : dex.chain, "."));
|
|
10012
10094
|
}
|
|
10013
10095
|
}
|
|
10014
10096
|
return {
|
|
@@ -11773,7 +11855,7 @@ var SwapBuilderCore = /*#__PURE__*/function () {
|
|
|
11773
11855
|
key: "amount",
|
|
11774
11856
|
value: function amount(_amount) {
|
|
11775
11857
|
return new SwapBuilderCore(this._api, _objectSpread2(_objectSpread2({}, this._options), {}, {
|
|
11776
|
-
amount: _amount
|
|
11858
|
+
amount: _amount
|
|
11777
11859
|
}));
|
|
11778
11860
|
}
|
|
11779
11861
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/swap",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.5.0",
|
|
4
4
|
"description": "Tool for XCM cross-chain asset exchanging across Polkadot and Kusama ecosystems",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"@crypto-dex-sdk/parachains-bifrost": "^0.1.5",
|
|
38
38
|
"@crypto-dex-sdk/token-lists": "^0.1.4",
|
|
39
39
|
"@galacticcouncil/descriptors": "^2.9.0",
|
|
40
|
-
"@galacticcouncil/sdk-next": "^2.
|
|
41
|
-
"@paraspell/sdk": "14.
|
|
42
|
-
"@paraspell/sdk-common": "14.
|
|
43
|
-
"@paraspell/sdk-core": "14.
|
|
44
|
-
"@paraspell/sdk-pjs": "14.
|
|
45
|
-
"@polkadot/api": "^17.0.
|
|
46
|
-
"@polkadot/types": "^17.0.
|
|
40
|
+
"@galacticcouncil/sdk-next": "^2.5.0",
|
|
41
|
+
"@paraspell/sdk": "14.5.0",
|
|
42
|
+
"@paraspell/sdk-common": "14.5.0",
|
|
43
|
+
"@paraspell/sdk-core": "14.5.0",
|
|
44
|
+
"@paraspell/sdk-pjs": "14.5.0",
|
|
45
|
+
"@polkadot/api": "^17.0.2",
|
|
46
|
+
"@polkadot/types": "^17.0.2",
|
|
47
47
|
"@polkadot/util": "^14.0.3",
|
|
48
48
|
"@zenlink-types/bifrost": "^1.7.7",
|
|
49
49
|
"ethers": "^5.8.0",
|
|
50
50
|
"ethers-v6": "npm:ethers@6.17.0",
|
|
51
|
-
"polkadot-api": "^3.
|
|
52
|
-
"react": "^19.3.
|
|
51
|
+
"polkadot-api": "^3.3.0",
|
|
52
|
+
"react": "^19.3.1",
|
|
53
53
|
"rxjs": "^7.8.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"@codecov/rollup-plugin": "^2.0.1",
|
|
59
59
|
"@rollup/plugin-babel": "^7.1.0",
|
|
60
60
|
"@rollup/plugin-json": "^6.1.0",
|
|
61
|
-
"@rollup/plugin-typescript": "^12.3.
|
|
62
|
-
"@vitest/coverage-v8": "^5.0.
|
|
63
|
-
"dotenv": "^18.0.
|
|
64
|
-
"rollup": "^4.
|
|
61
|
+
"@rollup/plugin-typescript": "^12.3.1",
|
|
62
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
63
|
+
"dotenv": "^18.0.9",
|
|
64
|
+
"rollup": "^4.66.0",
|
|
65
65
|
"rollup-plugin-dts": "^6.5.1",
|
|
66
66
|
"tsx": "^4.23.15"
|
|
67
67
|
},
|