@paraspell/swap 12.9.3 → 12.9.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.d.ts +3 -3
- package/dist/index.mjs +13 -9
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -251,7 +251,7 @@ declare const getExchangePairs: (exchange: TExchangeInput) => [TAssetInfo, TAsse
|
|
|
251
251
|
* @param exchange - The exchange chain or 'Auto select'.
|
|
252
252
|
* @returns An array of supported assets.
|
|
253
253
|
*/
|
|
254
|
-
declare const getSupportedAssetsFrom: (from: TChain | undefined,
|
|
254
|
+
declare const getSupportedAssetsFrom: (from: TChain | undefined, exchangeInput: TExchangeInput) => TAssetInfo[];
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
257
|
* Retrieves the list of assets supported for transfer to the destination chain.
|
|
@@ -261,7 +261,7 @@ declare const getSupportedAssetsFrom: (from: TChain | undefined, exchange: TExch
|
|
|
261
261
|
* @param to - The destination chain.
|
|
262
262
|
* @returns An array of supported assets.
|
|
263
263
|
*/
|
|
264
|
-
declare const getSupportedAssetsTo: (
|
|
264
|
+
declare const getSupportedAssetsTo: (exchangeInput: TExchangeInput, to: TChain | undefined) => TAssetInfo[];
|
|
265
265
|
|
|
266
266
|
/**
|
|
267
267
|
* Retrieves the list of assets that can be used to pay for fees on the origin chain.
|
|
@@ -270,7 +270,7 @@ declare const getSupportedAssetsTo: (exchange: TExchangeInput, to: TChain | unde
|
|
|
270
270
|
* @param exchange - The exchange chain or 'Auto select'.
|
|
271
271
|
* @returns An array of fee-eligible assets.
|
|
272
272
|
*/
|
|
273
|
-
declare const getSupportedFeeAssets: (from: TChain | undefined,
|
|
273
|
+
declare const getSupportedFeeAssets: (from: TChain | undefined, exchangeInput: TExchangeInput) => TAssetInfo[];
|
|
274
274
|
|
|
275
275
|
/**
|
|
276
276
|
* Builder class for constructing and executing cross-chain transfers using the XCM Router.
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UnsupportedOperationError, createChainClient as createChainClient$1, getNativeAssets, RoutingResolutionError, findAssetInfoById, getOtherAssets, getChainProviders, parseUnits, getNativeAssetSymbol, padValueBy, formatUnits as formatUnits$1, AmountTooLowError, getBalance, localizeLocation, getAssets, transform, Parents, isSymbolMatch, getParaId, UnableToComputeError, getAssetDecimals, InvalidCurrencyError, findAssetInfoOrThrow, isOverrideLocationSpecifier, isSymbolSpecifier, findBestMatches, findAssetInfoBySymbol, findAssetInfoByLoc, deepEqual, EXCHANGE_CHAINS, reverseTransformLocation, isAssetEqual, isExternalChain, isSystemAsset, TransferToAhNotSupported, ScenarioNotSupportedError, applyDecimalAbstraction, findAssetInfo, getRelayChainOf, hasSupportForAsset, Builder, isChainEvm, InvalidAddressError, MissingParameterError, DryRunFailedError, handleSwapExecuteTransfer, dryRun, getFailureInfo, getOriginXcmFee, getXcmFee, getExistentialDepositOrThrow,
|
|
1
|
+
import { UnsupportedOperationError, createChainClient as createChainClient$1, getNativeAssets, RoutingResolutionError, findAssetInfoById, getOtherAssets, getChainProviders, parseUnits, getNativeAssetSymbol, padValueBy, formatUnits as formatUnits$1, AmountTooLowError, getBalance, localizeLocation, getAssets, transform, Parents, isSymbolMatch, getParaId, UnableToComputeError, getAssetDecimals, InvalidCurrencyError, findAssetInfoOrThrow, isOverrideLocationSpecifier, isSymbolSpecifier, findBestMatches, findAssetInfoBySymbol, findAssetInfoByLoc, deepEqual, normalizeExchange, EXCHANGE_CHAINS, reverseTransformLocation, isAssetEqual, isExternalChain, isSystemAsset, TransferToAhNotSupported, ScenarioNotSupportedError, applyDecimalAbstraction, findAssetInfo, getRelayChainOf, hasSupportForAsset, Builder, isChainEvm, InvalidAddressError, MissingParameterError, DryRunFailedError, handleSwapExecuteTransfer, dryRun, getFailureInfo, getOriginXcmFee, getXcmFee, getExistentialDepositOrThrow, registerSwapExtension } from '@paraspell/sdk';
|
|
2
2
|
export { EXCHANGE_CHAINS } from '@paraspell/sdk';
|
|
3
3
|
import { InvalidTxError, Binary } from 'polkadot-api';
|
|
4
4
|
import { Wallet } from '@acala-network/sdk';
|
|
@@ -9010,7 +9010,8 @@ var resolvePairAsset = function resolvePairAsset(exchange, location) {
|
|
|
9010
9010
|
return found;
|
|
9011
9011
|
};
|
|
9012
9012
|
var asArray$1 = function asArray(ex) {
|
|
9013
|
-
|
|
9013
|
+
var normalized = normalizeExchange(ex);
|
|
9014
|
+
return normalized === undefined ? EXCHANGE_CHAINS : Array.isArray(normalized) ? normalized : [normalized];
|
|
9014
9015
|
};
|
|
9015
9016
|
var getExchangePairs = function getExchangePairs(exchange) {
|
|
9016
9017
|
return asArray$1(exchange).flatMap(function (ex) {
|
|
@@ -9041,7 +9042,8 @@ var getExchangePairs = function getExchangePairs(exchange) {
|
|
|
9041
9042
|
* @param exchange - The exchange chain or 'Auto select'.
|
|
9042
9043
|
* @returns An array of supported assets.
|
|
9043
9044
|
*/
|
|
9044
|
-
var getSupportedAssetsFrom = function getSupportedAssetsFrom(from,
|
|
9045
|
+
var getSupportedAssetsFrom = function getSupportedAssetsFrom(from, exchangeInput) {
|
|
9046
|
+
var exchange = normalizeExchange(exchangeInput);
|
|
9045
9047
|
if (exchange === undefined) {
|
|
9046
9048
|
if (!from) return [];
|
|
9047
9049
|
return getAssets(from);
|
|
@@ -9068,7 +9070,8 @@ var getSupportedAssetsFrom = function getSupportedAssetsFrom(from, exchange) {
|
|
|
9068
9070
|
* @param to - The destination chain.
|
|
9069
9071
|
* @returns An array of supported assets.
|
|
9070
9072
|
*/
|
|
9071
|
-
var getSupportedAssetsTo = function getSupportedAssetsTo(
|
|
9073
|
+
var getSupportedAssetsTo = function getSupportedAssetsTo(exchangeInput, to) {
|
|
9074
|
+
var exchange = normalizeExchange(exchangeInput);
|
|
9072
9075
|
if (exchange === undefined) {
|
|
9073
9076
|
var allExchangeAssets = EXCHANGE_CHAINS.map(function (exchangeChain) {
|
|
9074
9077
|
return getExchangeAssets(exchangeChain);
|
|
@@ -9116,7 +9119,8 @@ var getSupportedAssetsTo = function getSupportedAssetsTo(exchange, to) {
|
|
|
9116
9119
|
* @param exchange - The exchange chain or 'Auto select'.
|
|
9117
9120
|
* @returns An array of fee-eligible assets.
|
|
9118
9121
|
*/
|
|
9119
|
-
var getSupportedFeeAssets = function getSupportedFeeAssets(from,
|
|
9122
|
+
var getSupportedFeeAssets = function getSupportedFeeAssets(from, exchangeInput) {
|
|
9123
|
+
var exchange = normalizeExchange(exchangeInput);
|
|
9120
9124
|
var supportedAssets = getSupportedAssetsFrom(from, exchange);
|
|
9121
9125
|
var chains = from ? [from] : (exchange === undefined ? _toConsumableArray(EXCHANGE_CHAINS) : Array.isArray(exchange) ? exchange : [exchange]).map(function (ex) {
|
|
9122
9126
|
return createExchangeInstance(ex).chain;
|
|
@@ -9368,7 +9372,7 @@ var selectBestExchange = /*#__PURE__*/function () {
|
|
|
9368
9372
|
case 0:
|
|
9369
9373
|
return _context2.a(2, selectBestExchangeCommon(options, originApi, /*#__PURE__*/function () {
|
|
9370
9374
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(dex, assetFromExchange, assetTo, options) {
|
|
9371
|
-
var modifiedOptions, toDestTxFee, _yield$dex$
|
|
9375
|
+
var modifiedOptions, toDestTxFee, _yield$dex$handleMult, amountOut, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10;
|
|
9372
9376
|
return _regenerator().w(function (_context) {
|
|
9373
9377
|
while (1) switch (_context.n) {
|
|
9374
9378
|
case 0:
|
|
@@ -9407,15 +9411,15 @@ var selectBestExchange = /*#__PURE__*/function () {
|
|
|
9407
9411
|
case 3:
|
|
9408
9412
|
toDestTxFee = _context.v;
|
|
9409
9413
|
_context.n = 4;
|
|
9410
|
-
return dex.
|
|
9414
|
+
return dex.handleMultiSwap(modifiedOptions.exchange.api, _objectSpread2(_objectSpread2({}, modifiedOptions), {}, {
|
|
9411
9415
|
papiApi: modifiedOptions.exchange.apiPapi,
|
|
9412
9416
|
assetFrom: modifiedOptions.exchange.assetFrom,
|
|
9413
9417
|
assetTo: modifiedOptions.exchange.assetTo,
|
|
9414
9418
|
isForFeeEstimation: isForFeeEstimation
|
|
9415
9419
|
}), toDestTxFee);
|
|
9416
9420
|
case 4:
|
|
9417
|
-
_yield$dex$
|
|
9418
|
-
amountOut = _yield$dex$
|
|
9421
|
+
_yield$dex$handleMult = _context.v;
|
|
9422
|
+
amountOut = _yield$dex$handleMult.amountOut;
|
|
9419
9423
|
return _context.a(2, amountOut);
|
|
9420
9424
|
}
|
|
9421
9425
|
}, _callee);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/swap",
|
|
3
|
-
"version": "12.9.
|
|
3
|
+
"version": "12.9.4",
|
|
4
4
|
"description": "Tool for XCM cross-chain asset exchanging across Polkadot and Kusama ecosystems",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"postcss": "^8.5.6",
|
|
51
51
|
"react": "^19.2.4",
|
|
52
52
|
"rxjs": "^7.8.2",
|
|
53
|
-
"@paraspell/sdk": "12.9.
|
|
54
|
-
"@paraspell/sdk-pjs": "12.9.
|
|
53
|
+
"@paraspell/sdk": "12.9.4",
|
|
54
|
+
"@paraspell/sdk-pjs": "12.9.4"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@babel/core": "^7.29.0",
|