@paraspell/swap 14.1.0-rc → 14.1.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 +29 -6
- package/package.json +19 -22
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createChainClient as createChainClient$1,
|
|
1
|
+
import { createChainClient as createChainClient$1, registerSwapExtension } from '@paraspell/sdk';
|
|
2
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, deepEqual, normalizeExchange, EXCHANGE_CHAINS, reverseTransformLocation, getAssetsImpl, isAssetEqual, isExternalChain, isSystemAsset, ScenarioNotSupportedError, applyDecimalAbstraction, findAssetInfo, getRelayChainOf, Builder, isChainEvm, convertBuilderConfig, handleSwapExecuteTransfer, getXcmFee, getOriginXcmFee as getOriginXcmFee$1, InvalidAddressError, MissingParameterError, BatchMode, createChainClient as createChainClient$2, getExistentialDepositOrThrow, buildHopInfo, getRelayChainSymbol, aggregateHopFees, buildDestInfo, buildOriginInfo } from '@paraspell/sdk-core';
|
|
3
3
|
import { toHex } from 'polkadot-api/utils';
|
|
4
4
|
import 'polkadot-api';
|
|
@@ -451,7 +451,7 @@ var calculateTxFeePjs = /*#__PURE__*/function () {
|
|
|
451
451
|
}();
|
|
452
452
|
|
|
453
453
|
var isPapiTransaction = function isPapiTransaction(tx) {
|
|
454
|
-
return _typeof(tx) === 'object' && tx !== null && 'getEncodedData' in tx && typeof tx.getEncodedData === 'function' && '
|
|
454
|
+
return _typeof(tx) === 'object' && tx !== null && 'getEncodedData' in tx && typeof tx.getEncodedData === 'function' && 'signSubmitAndWatch' in tx && typeof tx.signSubmitAndWatch === 'function';
|
|
455
455
|
};
|
|
456
456
|
|
|
457
457
|
var isPjsExtrinsic = function isPjsExtrinsic(tx) {
|
|
@@ -928,6 +928,19 @@ var AssetHubPolkadot = {
|
|
|
928
928
|
]
|
|
929
929
|
}
|
|
930
930
|
},
|
|
931
|
+
{
|
|
932
|
+
parents: 1,
|
|
933
|
+
interior: {
|
|
934
|
+
X2: [
|
|
935
|
+
{
|
|
936
|
+
Parachain: 2034
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
GeneralIndex: 222
|
|
940
|
+
}
|
|
941
|
+
]
|
|
942
|
+
}
|
|
943
|
+
},
|
|
931
944
|
{
|
|
932
945
|
parents: 2,
|
|
933
946
|
interior: {
|
|
@@ -1144,6 +1157,16 @@ var AssetHubPolkadot = {
|
|
|
1144
1157
|
]
|
|
1145
1158
|
}
|
|
1146
1159
|
},
|
|
1160
|
+
{
|
|
1161
|
+
parents: 1,
|
|
1162
|
+
interior: {
|
|
1163
|
+
X1: [
|
|
1164
|
+
{
|
|
1165
|
+
Parachain: 3388
|
|
1166
|
+
}
|
|
1167
|
+
]
|
|
1168
|
+
}
|
|
1169
|
+
},
|
|
1147
1170
|
{
|
|
1148
1171
|
parents: 1,
|
|
1149
1172
|
interior: {
|
|
@@ -9301,7 +9324,7 @@ var BifrostExchange = /*#__PURE__*/function (_ExchangeChain) {
|
|
|
9301
9324
|
|
|
9302
9325
|
var calculateFee = /*#__PURE__*/function () {
|
|
9303
9326
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref, tradeRouter, txBuilderFactory, currencyFromInfo, currencyToInfo, currencyFromDecimals, chain, toDestTransactionFee) {
|
|
9304
|
-
var amount, slippagePct, feeCalcAddress, sender, trade, nativeAsset, substrateTx, tx, _yield$
|
|
9327
|
+
var amount, slippagePct, feeCalcAddress, sender, trade, nativeAsset, substrateTx, tx, _yield$tx$getPaymentI, swapFee, feeNative, currencyFromPriceInfo, currencyFromPrice, feeInCurrencyFrom, finalFee;
|
|
9305
9328
|
return _regenerator().w(function (_context) {
|
|
9306
9329
|
while (1) switch (_context.n) {
|
|
9307
9330
|
case 0:
|
|
@@ -9317,10 +9340,10 @@ var calculateFee = /*#__PURE__*/function () {
|
|
|
9317
9340
|
substrateTx = _context.v;
|
|
9318
9341
|
tx = substrateTx.get();
|
|
9319
9342
|
_context.n = 3;
|
|
9320
|
-
return getPaymentInfo(
|
|
9343
|
+
return tx.getPaymentInfo(feeCalcAddress);
|
|
9321
9344
|
case 3:
|
|
9322
|
-
_yield$
|
|
9323
|
-
swapFee = _yield$
|
|
9345
|
+
_yield$tx$getPaymentI = _context.v;
|
|
9346
|
+
swapFee = _yield$tx$getPaymentI.partial_fee;
|
|
9324
9347
|
feeNative = swapFee + toDestTransactionFee + toDestTransactionFee;
|
|
9325
9348
|
Logger.log('XCM to exch. fee:', toDestTransactionFee, nativeAsset.symbol);
|
|
9326
9349
|
Logger.log('XCM to dest. fee:', toDestTransactionFee, nativeAsset.symbol);
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/swap",
|
|
3
|
-
"version": "14.1.0
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "Tool for XCM cross-chain asset exchanging across Polkadot and Kusama ecosystems",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/paraspell/xcm-tools.git",
|
|
8
|
+
"directory": "packages/swap"
|
|
9
|
+
},
|
|
5
10
|
"type": "module",
|
|
6
11
|
"exports": {
|
|
7
12
|
".": {
|
|
@@ -20,12 +25,10 @@
|
|
|
20
25
|
"license": "MIT",
|
|
21
26
|
"dependencies": {
|
|
22
27
|
"@acala-network/api": "^6.3.0",
|
|
23
|
-
"@acala-network/app-util": "^4.1.8-14",
|
|
24
28
|
"@acala-network/eth-providers": "^2.10.0",
|
|
25
29
|
"@acala-network/sdk": "4.1.15",
|
|
26
30
|
"@acala-network/sdk-core": "4.1.15",
|
|
27
31
|
"@acala-network/sdk-swap": "4.1.15",
|
|
28
|
-
"@acala-network/sdk-wallet": "4.1.8-14",
|
|
29
32
|
"@crypto-dex-sdk/amm": "^0.1.5",
|
|
30
33
|
"@crypto-dex-sdk/chain": "^0.1.4",
|
|
31
34
|
"@crypto-dex-sdk/currency": "^0.1.5",
|
|
@@ -33,27 +36,21 @@
|
|
|
33
36
|
"@crypto-dex-sdk/math": "^0.1.5",
|
|
34
37
|
"@crypto-dex-sdk/parachains-bifrost": "^0.1.5",
|
|
35
38
|
"@crypto-dex-sdk/token-lists": "^0.1.4",
|
|
36
|
-
"@galacticcouncil/descriptors": "^2.
|
|
37
|
-
"@galacticcouncil/sdk-next": "^1.
|
|
39
|
+
"@galacticcouncil/descriptors": "^2.6.0",
|
|
40
|
+
"@galacticcouncil/sdk-next": "^1.5.1",
|
|
38
41
|
"@polkadot/api": "^16.5.6",
|
|
39
|
-
"@polkadot/api-base": "^16.5.6",
|
|
40
42
|
"@polkadot/types": "^16.5.6",
|
|
41
|
-
"@polkadot/types-codec": "^16.5.6",
|
|
42
43
|
"@polkadot/util": "^14.0.3",
|
|
43
44
|
"@zenlink-types/bifrost": "^1.7.7",
|
|
44
|
-
"
|
|
45
|
-
"ethers": "
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"lodash-es": "^4.18.1",
|
|
49
|
-
"polkadot-api": "3.0.0-rc.4",
|
|
50
|
-
"postcss": "^8.5.16",
|
|
51
|
-
"react": "^19.2.7",
|
|
45
|
+
"ethers": "~5.7.0",
|
|
46
|
+
"ethers-v6": "npm:ethers@6.17.0",
|
|
47
|
+
"polkadot-api": "^2.2.1",
|
|
48
|
+
"react": "^19.2.8",
|
|
52
49
|
"rxjs": "^7.8.2",
|
|
53
|
-
"@paraspell/sdk": "14.1.0
|
|
54
|
-
"@paraspell/sdk-
|
|
55
|
-
"@paraspell/sdk-
|
|
56
|
-
"@paraspell/sdk-pjs": "14.1.0
|
|
50
|
+
"@paraspell/sdk": "14.1.0",
|
|
51
|
+
"@paraspell/sdk-core": "14.1.0",
|
|
52
|
+
"@paraspell/sdk-common": "14.1.0",
|
|
53
|
+
"@paraspell/sdk-pjs": "14.1.0"
|
|
57
54
|
},
|
|
58
55
|
"devDependencies": {
|
|
59
56
|
"@babel/plugin-syntax-import-attributes": "^7.29.7",
|
|
@@ -62,11 +59,11 @@
|
|
|
62
59
|
"@rollup/plugin-babel": "^7.1.0",
|
|
63
60
|
"@rollup/plugin-json": "^6.1.0",
|
|
64
61
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
65
|
-
"@vitest/coverage-v8": "^4.1.
|
|
62
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
66
63
|
"dotenv": "^17.4.2",
|
|
67
|
-
"rollup": "^4.62.
|
|
64
|
+
"rollup": "^4.62.3",
|
|
68
65
|
"rollup-plugin-dts": "^6.4.1",
|
|
69
|
-
"tsx": "^4.
|
|
66
|
+
"tsx": "^4.23.1"
|
|
70
67
|
},
|
|
71
68
|
"scripts": {
|
|
72
69
|
"compile": "tsc --noEmit",
|