@paraspell/swap 14.4.4 → 14.5.1
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 +141 -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,47 @@ var Hydration = {
|
|
|
1733
1733
|
]
|
|
1734
1734
|
}
|
|
1735
1735
|
},
|
|
1736
|
+
{
|
|
1737
|
+
parents: 1,
|
|
1738
|
+
interior: {
|
|
1739
|
+
X2: [
|
|
1740
|
+
{
|
|
1741
|
+
Parachain: 2034
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
AccountKey20: {
|
|
1745
|
+
network: null,
|
|
1746
|
+
key: "0x2d01a621e4fa1cb9ae59c43b7fce2471ed0104d7"
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
]
|
|
1750
|
+
}
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
parents: 1,
|
|
1754
|
+
interior: {
|
|
1755
|
+
X4: [
|
|
1756
|
+
{
|
|
1757
|
+
Parachain: 2034
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
GeneralKey: {
|
|
1761
|
+
length: 2,
|
|
1762
|
+
data: "0x7768000000000000000000000000000000000000000000000000000000000000"
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
GeneralIndex: 72
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
GeneralKey: {
|
|
1770
|
+
length: 32,
|
|
1771
|
+
data: "0x000000000000000000000000117cc2133c37b721f49de2a7a74833232b3b4c0c"
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
]
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1736
1777
|
{
|
|
1737
1778
|
parents: 1,
|
|
1738
1779
|
interior: {
|
|
@@ -1976,6 +2017,47 @@ var Hydration = {
|
|
|
1976
2017
|
]
|
|
1977
2018
|
}
|
|
1978
2019
|
},
|
|
2020
|
+
{
|
|
2021
|
+
parents: 1,
|
|
2022
|
+
interior: {
|
|
2023
|
+
X4: [
|
|
2024
|
+
{
|
|
2025
|
+
Parachain: 2034
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
GeneralKey: {
|
|
2029
|
+
length: 2,
|
|
2030
|
+
data: "0x7768000000000000000000000000000000000000000000000000000000000000"
|
|
2031
|
+
}
|
|
2032
|
+
},
|
|
2033
|
+
{
|
|
2034
|
+
GeneralIndex: 15
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
GeneralKey: {
|
|
2038
|
+
length: 32,
|
|
2039
|
+
data: "0x3174446b8cc98197d6f2c9e504d6d229f0adb00d2b7566af0e54a84a876fef0f"
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
]
|
|
2043
|
+
}
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
parents: 1,
|
|
2047
|
+
interior: {
|
|
2048
|
+
X2: [
|
|
2049
|
+
{
|
|
2050
|
+
Parachain: 2034
|
|
2051
|
+
},
|
|
2052
|
+
{
|
|
2053
|
+
AccountKey20: {
|
|
2054
|
+
network: null,
|
|
2055
|
+
key: "0xc29286aa0ed2fcb4fc581c8f0a068328e18ef075"
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
]
|
|
2059
|
+
}
|
|
2060
|
+
},
|
|
1979
2061
|
{
|
|
1980
2062
|
parents: 1,
|
|
1981
2063
|
interior: {
|
|
@@ -2125,6 +2207,22 @@ var Hydration = {
|
|
|
2125
2207
|
]
|
|
2126
2208
|
}
|
|
2127
2209
|
},
|
|
2210
|
+
{
|
|
2211
|
+
parents: 1,
|
|
2212
|
+
interior: {
|
|
2213
|
+
X2: [
|
|
2214
|
+
{
|
|
2215
|
+
Parachain: 2034
|
|
2216
|
+
},
|
|
2217
|
+
{
|
|
2218
|
+
AccountKey20: {
|
|
2219
|
+
network: null,
|
|
2220
|
+
key: "0x6250c75785e21190e9fe2bec56540fda4fbd8c6a"
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
]
|
|
2224
|
+
}
|
|
2225
|
+
},
|
|
2128
2226
|
{
|
|
2129
2227
|
parents: 2,
|
|
2130
2228
|
interior: {
|
|
@@ -2503,6 +2601,22 @@ var Hydration = {
|
|
|
2503
2601
|
]
|
|
2504
2602
|
}
|
|
2505
2603
|
},
|
|
2604
|
+
{
|
|
2605
|
+
parents: 1,
|
|
2606
|
+
interior: {
|
|
2607
|
+
X2: [
|
|
2608
|
+
{
|
|
2609
|
+
Parachain: 2034
|
|
2610
|
+
},
|
|
2611
|
+
{
|
|
2612
|
+
AccountKey20: {
|
|
2613
|
+
network: null,
|
|
2614
|
+
key: "0xa8f540fb7852024da35d30947be0899299ba42f1"
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
]
|
|
2618
|
+
}
|
|
2619
|
+
},
|
|
2506
2620
|
{
|
|
2507
2621
|
parents: 1,
|
|
2508
2622
|
interior: {
|
|
@@ -2734,6 +2848,22 @@ var Hydration = {
|
|
|
2734
2848
|
]
|
|
2735
2849
|
}
|
|
2736
2850
|
},
|
|
2851
|
+
{
|
|
2852
|
+
parents: 1,
|
|
2853
|
+
interior: {
|
|
2854
|
+
X2: [
|
|
2855
|
+
{
|
|
2856
|
+
Parachain: 2034
|
|
2857
|
+
},
|
|
2858
|
+
{
|
|
2859
|
+
AccountKey20: {
|
|
2860
|
+
network: null,
|
|
2861
|
+
key: "0xa538acee9d185683e14face48bc9ee2a0759f2a0"
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
]
|
|
2865
|
+
}
|
|
2866
|
+
},
|
|
2737
2867
|
{
|
|
2738
2868
|
parents: 1,
|
|
2739
2869
|
interior: {
|
|
@@ -9697,7 +9827,7 @@ var selectBestExchangeCommon = /*#__PURE__*/function () {
|
|
|
9697
9827
|
_context2.n = 1;
|
|
9698
9828
|
break;
|
|
9699
9829
|
}
|
|
9700
|
-
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(options.currencyFrom), " not found in ").concat(options.from, "."));
|
|
9830
|
+
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(options.currencyFrom, replaceBigInt), " not found in ").concat(options.from, "."));
|
|
9701
9831
|
case 1:
|
|
9702
9832
|
if (!('id' in currencyTo)) {
|
|
9703
9833
|
_context2.n = 2;
|
|
@@ -9976,31 +10106,31 @@ var resolveAssets = function resolveAssets(dex, _ref) {
|
|
|
9976
10106
|
var destinationSpecified = to && to !== dex.chain;
|
|
9977
10107
|
var assetFromOrigin = originSpecified ? findAssetInfo(from, currencyFrom, dex.chain) : undefined;
|
|
9978
10108
|
if (originSpecified && !assetFromOrigin) {
|
|
9979
|
-
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom), " not found in ").concat(from, "."));
|
|
10109
|
+
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom, replaceBigInt), " not found in ").concat(from, "."));
|
|
9980
10110
|
}
|
|
9981
10111
|
var assetFromExchange = originSpecified && assetFromOrigin ? getExchangeAssetByOriginAsset(from, dex.chain, assetFromOrigin) : getExchangeAsset(dex.chain, currencyFrom);
|
|
9982
10112
|
if (!assetFromExchange) {
|
|
9983
10113
|
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, "."));
|
|
10114
|
+
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom, replaceBigInt), " exists in ").concat(dex.chain, " but is not swappable on ").concat(dex.chain, "."));
|
|
9985
10115
|
}
|
|
9986
|
-
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom), " not found in ").concat(dex.chain, "."));
|
|
10116
|
+
throw new RoutingResolutionError("Currency from ".concat(JSON.stringify(currencyFrom, replaceBigInt), " not found in ").concat(dex.chain, "."));
|
|
9987
10117
|
}
|
|
9988
10118
|
var assetTo = getExchangeAsset(dex.chain, currencyTo);
|
|
9989
10119
|
if (!assetTo) {
|
|
9990
|
-
throw new RoutingResolutionError("Currency to ".concat(JSON.stringify(currencyTo), " not found in ").concat(dex.chain, "."));
|
|
10120
|
+
throw new RoutingResolutionError("Currency to ".concat(JSON.stringify(currencyTo, replaceBigInt), " not found in ").concat(dex.chain, "."));
|
|
9991
10121
|
}
|
|
9992
10122
|
if (destinationSpecified && !getSupportedAssetsImpl(dex.chain, to).some(function (asset) {
|
|
9993
10123
|
return isAssetEqual(asset, assetTo);
|
|
9994
10124
|
})) {
|
|
9995
|
-
throw new RoutingResolutionError("Currency to ".concat(JSON.stringify(currencyTo), " not supported by ").concat(to, "."));
|
|
10125
|
+
throw new RoutingResolutionError("Currency to ".concat(JSON.stringify(currencyTo, replaceBigInt), " not supported by ").concat(to, "."));
|
|
9996
10126
|
}
|
|
9997
10127
|
var feeAssetFromOrigin = feeAsset && originSpecified ? (_findAssetInfo = findAssetInfo(from, feeAsset, dex.chain)) !== null && _findAssetInfo !== void 0 ? _findAssetInfo : undefined : undefined;
|
|
9998
10128
|
if (feeAsset && originSpecified && !feeAssetFromOrigin) {
|
|
9999
|
-
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset), " not found in ").concat(from, "."));
|
|
10129
|
+
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset, replaceBigInt), " not found in ").concat(from, "."));
|
|
10000
10130
|
}
|
|
10001
10131
|
var feeAssetFromExchange = feeAsset ? from && feeAssetFromOrigin ? getExchangeAssetByOriginAsset(from, dex.chain, feeAssetFromOrigin) : (_getExchangeAsset = getExchangeAsset(dex.chain, feeAsset)) !== null && _getExchangeAsset !== void 0 ? _getExchangeAsset : undefined : undefined;
|
|
10002
10132
|
if (feeAsset && !feeAssetFromOrigin && !feeAssetFromExchange) {
|
|
10003
|
-
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset), " not found in ").concat(dex.chain, "."));
|
|
10133
|
+
throw new RoutingResolutionError("Fee asset ".concat(JSON.stringify(feeAsset, replaceBigInt), " not found in ").concat(dex.chain, "."));
|
|
10004
10134
|
}
|
|
10005
10135
|
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
10136
|
if (feeAsset && resolvedFeeAssetLocation) {
|
|
@@ -10008,7 +10138,7 @@ var resolveAssets = function resolveAssets(dex, _ref) {
|
|
|
10008
10138
|
location: resolvedFeeAssetLocation
|
|
10009
10139
|
}, null);
|
|
10010
10140
|
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, "."));
|
|
10141
|
+
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
10142
|
}
|
|
10013
10143
|
}
|
|
10014
10144
|
return {
|
|
@@ -11773,7 +11903,7 @@ var SwapBuilderCore = /*#__PURE__*/function () {
|
|
|
11773
11903
|
key: "amount",
|
|
11774
11904
|
value: function amount(_amount) {
|
|
11775
11905
|
return new SwapBuilderCore(this._api, _objectSpread2(_objectSpread2({}, this._options), {}, {
|
|
11776
|
-
amount: _amount
|
|
11906
|
+
amount: _amount
|
|
11777
11907
|
}));
|
|
11778
11908
|
}
|
|
11779
11909
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/swap",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.5.1",
|
|
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.1",
|
|
42
|
+
"@paraspell/sdk-common": "14.5.1",
|
|
43
|
+
"@paraspell/sdk-core": "14.5.1",
|
|
44
|
+
"@paraspell/sdk-pjs": "14.5.1",
|
|
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
|
},
|