@paraspell/swap 14.4.0 → 14.4.2
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 +21 -4
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -806,6 +806,22 @@ var AssetHubPolkadot = {
|
|
|
806
806
|
]
|
|
807
807
|
}
|
|
808
808
|
},
|
|
809
|
+
{
|
|
810
|
+
parents: 1,
|
|
811
|
+
interior: {
|
|
812
|
+
X3: [
|
|
813
|
+
{
|
|
814
|
+
Parachain: 1000
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
PalletInstance: 50
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
GeneralIndex: 31337
|
|
821
|
+
}
|
|
822
|
+
]
|
|
823
|
+
}
|
|
824
|
+
},
|
|
809
825
|
{
|
|
810
826
|
parents: 1,
|
|
811
827
|
interior: {
|
|
@@ -7932,11 +7948,11 @@ var AcalaExchange = /*#__PURE__*/function (_ExchangeChain) {
|
|
|
7932
7948
|
key: "swapCurrency",
|
|
7933
7949
|
value: function () {
|
|
7934
7950
|
var _swapCurrency = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, toDestTransactionFee) {
|
|
7935
|
-
var api, apiPjs, assetFrom, assetTo, amount, sender, origin, isForFeeEstimation, wallet, fromToken, toToken, acalaDex, dex, swapFee, totalNativeCurrencyFee, balance, pctDestFee, amountWithoutFee, tradeResult, tx, amountOutRes, amountOut, nativeAssetSymbol, amountOutWithFee;
|
|
7951
|
+
var api, apiPjs, assetFrom, assetTo, amount, sender, origin, slippagePct, isForFeeEstimation, wallet, fromToken, toToken, acalaDex, dex, swapFee, totalNativeCurrencyFee, balance, pctDestFee, amountWithoutFee, tradeResult, tx, amountOutRes, amountOut, nativeAssetSymbol, amountOutWithFee;
|
|
7936
7952
|
return _regenerator().w(function (_context) {
|
|
7937
7953
|
while (1) switch (_context.n) {
|
|
7938
7954
|
case 0:
|
|
7939
|
-
api = options.api, apiPjs = options.apiPjs, assetFrom = options.assetFrom, assetTo = options.assetTo, amount = options.amount, sender = options.sender, origin = options.origin, isForFeeEstimation = options.isForFeeEstimation;
|
|
7955
|
+
api = options.api, apiPjs = options.apiPjs, assetFrom = options.assetFrom, assetTo = options.assetTo, amount = options.amount, sender = options.sender, origin = options.origin, slippagePct = options.slippagePct, isForFeeEstimation = options.isForFeeEstimation;
|
|
7940
7956
|
wallet = new Wallet(apiPjs);
|
|
7941
7957
|
_context.n = 1;
|
|
7942
7958
|
return wallet.isReady;
|
|
@@ -7988,7 +8004,8 @@ var AcalaExchange = /*#__PURE__*/function (_ExchangeChain) {
|
|
|
7988
8004
|
path: [fromToken, toToken],
|
|
7989
8005
|
source: 'aggregate',
|
|
7990
8006
|
mode: 'EXACT_INPUT',
|
|
7991
|
-
input: new FixedPointNumber(formatUnits$1(amountWithoutFee, fromToken.decimals), fromToken.decimals)
|
|
8007
|
+
input: new FixedPointNumber(formatUnits$1(amountWithoutFee, fromToken.decimals), fromToken.decimals),
|
|
8008
|
+
acceptiveSlippage: Number(slippagePct) / 100
|
|
7992
8009
|
}));
|
|
7993
8010
|
case 6:
|
|
7994
8011
|
tradeResult = _context.v;
|
|
@@ -9167,7 +9184,7 @@ var HydrationExchange = /*#__PURE__*/function (_ExchangeChain) {
|
|
|
9167
9184
|
throw new UnableToComputeError('Price not found');
|
|
9168
9185
|
case 14:
|
|
9169
9186
|
currencyToPrice = priceInfo.amount;
|
|
9170
|
-
feeInCurrencyTo = toDestTransactionFee * pow10n(priceInfo.decimals + currencyToInfo.decimals)
|
|
9187
|
+
feeInCurrencyTo = padValueBy(toDestTransactionFee * pow10n(priceInfo.decimals + currencyToInfo.decimals) / (currencyToPrice * pow10n(nativeCurrencyDecimals)), FEE_BUFFER_PCT);
|
|
9171
9188
|
Logger.log('Amount out fee', feeInCurrencyTo, nativeCurrencyInfo.symbol);
|
|
9172
9189
|
amountOutModified = amountOut - feeInCurrencyTo;
|
|
9173
9190
|
if (!(amountOutModified <= 0n)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/swap",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.2",
|
|
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.9.0",
|
|
40
40
|
"@galacticcouncil/sdk-next": "^2.3.2",
|
|
41
|
-
"@paraspell/sdk": "14.4.
|
|
42
|
-
"@paraspell/sdk-common": "14.4.
|
|
43
|
-
"@paraspell/sdk-core": "14.4.
|
|
44
|
-
"@paraspell/sdk-pjs": "14.4.
|
|
41
|
+
"@paraspell/sdk": "14.4.2",
|
|
42
|
+
"@paraspell/sdk-common": "14.4.2",
|
|
43
|
+
"@paraspell/sdk-core": "14.4.2",
|
|
44
|
+
"@paraspell/sdk-pjs": "14.4.2",
|
|
45
45
|
"@polkadot/api": "^17.0.1",
|
|
46
46
|
"@polkadot/types": "^17.0.1",
|
|
47
47
|
"@polkadot/util": "^14.0.3",
|