@paraspell/sdk-core 10.10.5 → 10.10.6
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.cjs +18 -7
- package/dist/index.mjs +19 -8
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -7183,8 +7183,8 @@ var extractFeesFromDryRun = function extractFeesFromDryRun(chain, dryRunResult,
|
|
|
7183
7183
|
return fees;
|
|
7184
7184
|
};
|
|
7185
7185
|
var createXcmAndCall = /*#__PURE__*/function () {
|
|
7186
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
7187
|
-
var xcm, api, chain, exchangeChain, weight, call;
|
|
7186
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options, dryRunWeight) {
|
|
7187
|
+
var xcm, api, chain, exchangeChain, hasApiSupport, weight, call, _t;
|
|
7188
7188
|
return _regenerator().w(function (_context2) {
|
|
7189
7189
|
while (1) switch (_context2.n) {
|
|
7190
7190
|
case 0:
|
|
@@ -7193,10 +7193,21 @@ var createXcmAndCall = /*#__PURE__*/function () {
|
|
|
7193
7193
|
case 1:
|
|
7194
7194
|
xcm = _context2.v;
|
|
7195
7195
|
api = options.api, chain = options.chain, exchangeChain = options.exchangeChain;
|
|
7196
|
+
hasApiSupport = assets.hasXcmPaymentApiSupport(chain !== null && chain !== void 0 ? chain : exchangeChain);
|
|
7197
|
+
if (!hasApiSupport) {
|
|
7198
|
+
_context2.n = 3;
|
|
7199
|
+
break;
|
|
7200
|
+
}
|
|
7196
7201
|
_context2.n = 2;
|
|
7197
7202
|
return api.getXcmWeight(xcm);
|
|
7198
7203
|
case 2:
|
|
7199
|
-
|
|
7204
|
+
_t = _context2.v;
|
|
7205
|
+
_context2.n = 4;
|
|
7206
|
+
break;
|
|
7207
|
+
case 3:
|
|
7208
|
+
_t = dryRunWeight !== null && dryRunWeight !== void 0 ? dryRunWeight : MAX_WEIGHT;
|
|
7209
|
+
case 4:
|
|
7210
|
+
weight = _t;
|
|
7200
7211
|
call = createExecuteCall(chain !== null && chain !== void 0 ? chain : exchangeChain, xcm, weight);
|
|
7201
7212
|
return _context2.a(2, {
|
|
7202
7213
|
xcm: xcm,
|
|
@@ -7206,7 +7217,7 @@ var createXcmAndCall = /*#__PURE__*/function () {
|
|
|
7206
7217
|
}
|
|
7207
7218
|
}, _callee2);
|
|
7208
7219
|
}));
|
|
7209
|
-
return function createXcmAndCall(_x2) {
|
|
7220
|
+
return function createXcmAndCall(_x2, _x3) {
|
|
7210
7221
|
return _ref2.apply(this, arguments);
|
|
7211
7222
|
};
|
|
7212
7223
|
}();
|
|
@@ -7315,7 +7326,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7315
7326
|
return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
|
|
7316
7327
|
assetTo: updatedAssetTo,
|
|
7317
7328
|
fees: extractedFees
|
|
7318
|
-
}));
|
|
7329
|
+
}), firstDryRunResult.origin.success ? firstDryRunResult.origin.weight : undefined);
|
|
7319
7330
|
case 9:
|
|
7320
7331
|
_yield$createXcmAndCa2 = _context3.v;
|
|
7321
7332
|
secondCall = _yield$createXcmAndCa2.call;
|
|
@@ -7353,7 +7364,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7353
7364
|
return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
|
|
7354
7365
|
assetTo: finalAssetTo,
|
|
7355
7366
|
fees: finalFees
|
|
7356
|
-
}));
|
|
7367
|
+
}), secondDryRunResult.origin.success ? secondDryRunResult.origin.weight : undefined);
|
|
7357
7368
|
case 12:
|
|
7358
7369
|
_yield$createXcmAndCa3 = _context3.v;
|
|
7359
7370
|
finalCall = _yield$createXcmAndCa3.call;
|
|
@@ -7363,7 +7374,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7363
7374
|
}
|
|
7364
7375
|
}, _callee3);
|
|
7365
7376
|
}));
|
|
7366
|
-
return function handleSwapExecuteTransfer(
|
|
7377
|
+
return function handleSwapExecuteTransfer(_x4) {
|
|
7367
7378
|
return _ref3.apply(this, arguments);
|
|
7368
7379
|
};
|
|
7369
7380
|
}();
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { blake2b } from '@noble/hashes/blake2';
|
|
2
|
-
import { isNodeEvm, getAssetsObject, InvalidCurrencyError, getNativeAssetSymbol, getOtherAssets, extractMultiAssetLoc, isAssetEqual, isForeignAsset, findAssetForNodeOrThrow, getExistentialDeposit, findAsset, isTMultiAsset, getExistentialDepositOrThrow, isSymbolMatch, hasDryRunSupport, isOverrideMultiLocationSpecifier, findAssetByMultiLocation, findAssetOnDestOrThrow, hasSupportForAsset, getRelayChainSymbol, isSymbolSpecifier, normalizeMultiLocation, normalizeSymbol, getAssetId, getNativeAssets } from '@paraspell/assets';
|
|
2
|
+
import { isNodeEvm, getAssetsObject, InvalidCurrencyError, getNativeAssetSymbol, getOtherAssets, extractMultiAssetLoc, isAssetEqual, isForeignAsset, findAssetForNodeOrThrow, getExistentialDeposit, findAsset, isTMultiAsset, getExistentialDepositOrThrow, isSymbolMatch, hasDryRunSupport, isOverrideMultiLocationSpecifier, findAssetByMultiLocation, findAssetOnDestOrThrow, hasSupportForAsset, getRelayChainSymbol, isSymbolSpecifier, normalizeMultiLocation, normalizeSymbol, hasXcmPaymentApiSupport, getAssetId, getNativeAssets } from '@paraspell/assets';
|
|
3
3
|
export * from '@paraspell/assets';
|
|
4
4
|
import { base58 } from '@scure/base';
|
|
5
5
|
import { isAddress, createPublicClient, http, getContract } from 'viem';
|
|
@@ -7184,8 +7184,8 @@ var extractFeesFromDryRun = function extractFeesFromDryRun(chain, dryRunResult,
|
|
|
7184
7184
|
return fees;
|
|
7185
7185
|
};
|
|
7186
7186
|
var createXcmAndCall = /*#__PURE__*/function () {
|
|
7187
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
7188
|
-
var xcm, api, chain, exchangeChain, weight, call;
|
|
7187
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options, dryRunWeight) {
|
|
7188
|
+
var xcm, api, chain, exchangeChain, hasApiSupport, weight, call, _t;
|
|
7189
7189
|
return _regenerator().w(function (_context2) {
|
|
7190
7190
|
while (1) switch (_context2.n) {
|
|
7191
7191
|
case 0:
|
|
@@ -7194,10 +7194,21 @@ var createXcmAndCall = /*#__PURE__*/function () {
|
|
|
7194
7194
|
case 1:
|
|
7195
7195
|
xcm = _context2.v;
|
|
7196
7196
|
api = options.api, chain = options.chain, exchangeChain = options.exchangeChain;
|
|
7197
|
+
hasApiSupport = hasXcmPaymentApiSupport(chain !== null && chain !== void 0 ? chain : exchangeChain);
|
|
7198
|
+
if (!hasApiSupport) {
|
|
7199
|
+
_context2.n = 3;
|
|
7200
|
+
break;
|
|
7201
|
+
}
|
|
7197
7202
|
_context2.n = 2;
|
|
7198
7203
|
return api.getXcmWeight(xcm);
|
|
7199
7204
|
case 2:
|
|
7200
|
-
|
|
7205
|
+
_t = _context2.v;
|
|
7206
|
+
_context2.n = 4;
|
|
7207
|
+
break;
|
|
7208
|
+
case 3:
|
|
7209
|
+
_t = dryRunWeight !== null && dryRunWeight !== void 0 ? dryRunWeight : MAX_WEIGHT;
|
|
7210
|
+
case 4:
|
|
7211
|
+
weight = _t;
|
|
7201
7212
|
call = createExecuteCall(chain !== null && chain !== void 0 ? chain : exchangeChain, xcm, weight);
|
|
7202
7213
|
return _context2.a(2, {
|
|
7203
7214
|
xcm: xcm,
|
|
@@ -7207,7 +7218,7 @@ var createXcmAndCall = /*#__PURE__*/function () {
|
|
|
7207
7218
|
}
|
|
7208
7219
|
}, _callee2);
|
|
7209
7220
|
}));
|
|
7210
|
-
return function createXcmAndCall(_x2) {
|
|
7221
|
+
return function createXcmAndCall(_x2, _x3) {
|
|
7211
7222
|
return _ref2.apply(this, arguments);
|
|
7212
7223
|
};
|
|
7213
7224
|
}();
|
|
@@ -7316,7 +7327,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7316
7327
|
return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
|
|
7317
7328
|
assetTo: updatedAssetTo,
|
|
7318
7329
|
fees: extractedFees
|
|
7319
|
-
}));
|
|
7330
|
+
}), firstDryRunResult.origin.success ? firstDryRunResult.origin.weight : undefined);
|
|
7320
7331
|
case 9:
|
|
7321
7332
|
_yield$createXcmAndCa2 = _context3.v;
|
|
7322
7333
|
secondCall = _yield$createXcmAndCa2.call;
|
|
@@ -7354,7 +7365,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7354
7365
|
return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
|
|
7355
7366
|
assetTo: finalAssetTo,
|
|
7356
7367
|
fees: finalFees
|
|
7357
|
-
}));
|
|
7368
|
+
}), secondDryRunResult.origin.success ? secondDryRunResult.origin.weight : undefined);
|
|
7358
7369
|
case 12:
|
|
7359
7370
|
_yield$createXcmAndCa3 = _context3.v;
|
|
7360
7371
|
finalCall = _yield$createXcmAndCa3.call;
|
|
@@ -7364,7 +7375,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7364
7375
|
}
|
|
7365
7376
|
}, _callee3);
|
|
7366
7377
|
}));
|
|
7367
|
-
return function handleSwapExecuteTransfer(
|
|
7378
|
+
return function handleSwapExecuteTransfer(_x4) {
|
|
7368
7379
|
return _ref3.apply(this, arguments);
|
|
7369
7380
|
};
|
|
7370
7381
|
}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "10.10.
|
|
3
|
+
"version": "10.10.6",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@noble/hashes": "^1.8.0",
|
|
27
27
|
"@scure/base": "^1.2.6",
|
|
28
28
|
"viem": "^2.31.6",
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/pallets": "10.10.
|
|
31
|
-
"@paraspell/
|
|
29
|
+
"@paraspell/assets": "10.10.6",
|
|
30
|
+
"@paraspell/pallets": "10.10.6",
|
|
31
|
+
"@paraspell/sdk-common": "10.10.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|