@paraspell/sdk 10.6.0 → 10.7.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.cjs +11 -10
- package/dist/index.mjs +12 -11
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1343,12 +1343,12 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1343
1343
|
case 6:
|
|
1344
1344
|
executionFee = _context18.v;
|
|
1345
1345
|
hasMultiLocation = feeAsset ? Boolean(feeAsset.multiLocation) : Boolean(asset === null || asset === void 0 ? void 0 : asset.multiLocation);
|
|
1346
|
-
if (!(sdkCore.hasXcmPaymentApiSupport(node) && result.value.local_xcm && hasMultiLocation)) {
|
|
1346
|
+
if (!(sdkCore.hasXcmPaymentApiSupport(node) && result.value.local_xcm && hasMultiLocation && node !== 'AssetHubPolkadot')) {
|
|
1347
1347
|
_context18.n = 8;
|
|
1348
1348
|
break;
|
|
1349
1349
|
}
|
|
1350
1350
|
_context18.n = 7;
|
|
1351
|
-
return this.getXcmPaymentApiFee(result.value.local_xcm, feeAsset !== null && feeAsset !== void 0 ? feeAsset : asset);
|
|
1351
|
+
return this.getXcmPaymentApiFee(node, result.value.local_xcm, feeAsset !== null && feeAsset !== void 0 ? feeAsset : asset);
|
|
1352
1352
|
case 7:
|
|
1353
1353
|
xcmFee = _context18.v;
|
|
1354
1354
|
if (!(typeof xcmFee === 'bigint')) {
|
|
@@ -1407,8 +1407,8 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1407
1407
|
}, {
|
|
1408
1408
|
key: "getXcmPaymentApiFee",
|
|
1409
1409
|
value: function () {
|
|
1410
|
-
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(xcm, asset) {
|
|
1411
|
-
var weight,
|
|
1410
|
+
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(node, xcm, asset) {
|
|
1411
|
+
var weight, transformedLocation, transformedPapiLocation, feeResult;
|
|
1412
1412
|
return _regenerator().w(function (_context20) {
|
|
1413
1413
|
while (1) switch (_context20.n) {
|
|
1414
1414
|
case 0:
|
|
@@ -1422,11 +1422,12 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
throw new sdkCore.InvalidCurrencyError('This asset does not have a multiLocation defined. Cannot determine destination fee.');
|
|
1424
1424
|
case 2:
|
|
1425
|
-
|
|
1425
|
+
transformedLocation = node === 'AssetHubPolkadot' || node === 'AssetHubKusama' || sdkCore.isRelayChain(node) ? sdkCore.localizeLocation(node, asset.multiLocation) : asset.multiLocation;
|
|
1426
|
+
transformedPapiLocation = _transform(transformedLocation);
|
|
1426
1427
|
_context20.n = 3;
|
|
1427
1428
|
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_weight_to_asset_fee(weight.value, {
|
|
1428
1429
|
type: sdkCore.Version.V4,
|
|
1429
|
-
value:
|
|
1430
|
+
value: transformedPapiLocation
|
|
1430
1431
|
});
|
|
1431
1432
|
case 3:
|
|
1432
1433
|
feeResult = _context20.v;
|
|
@@ -1434,7 +1435,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1434
1435
|
}
|
|
1435
1436
|
}, _callee20, this);
|
|
1436
1437
|
}));
|
|
1437
|
-
function getXcmPaymentApiFee(_x34, _x35) {
|
|
1438
|
+
function getXcmPaymentApiFee(_x34, _x35, _x36) {
|
|
1438
1439
|
return _getXcmPaymentApiFee.apply(this, arguments);
|
|
1439
1440
|
}
|
|
1440
1441
|
return getXcmPaymentApiFee;
|
|
@@ -1479,12 +1480,12 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1479
1480
|
} : undefined;
|
|
1480
1481
|
forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
|
|
1481
1482
|
destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
|
|
1482
|
-
if (!(sdkCore.hasXcmPaymentApiSupport(node) && asset)) {
|
|
1483
|
+
if (!(sdkCore.hasXcmPaymentApiSupport(node) && asset && node !== 'AssetHubPolkadot')) {
|
|
1483
1484
|
_context21.n = 5;
|
|
1484
1485
|
break;
|
|
1485
1486
|
}
|
|
1486
1487
|
_context21.n = 4;
|
|
1487
|
-
return this.getXcmPaymentApiFee(xcm, asset);
|
|
1488
|
+
return this.getXcmPaymentApiFee(node, xcm, asset);
|
|
1488
1489
|
case 4:
|
|
1489
1490
|
_fee = _context21.v;
|
|
1490
1491
|
if (!(typeof _fee === 'bigint')) {
|
|
@@ -1544,7 +1545,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1544
1545
|
}
|
|
1545
1546
|
}, _callee21, this);
|
|
1546
1547
|
}));
|
|
1547
|
-
function getDryRunXcm(
|
|
1548
|
+
function getDryRunXcm(_x37) {
|
|
1548
1549
|
return _getDryRunXcm.apply(this, arguments);
|
|
1549
1550
|
}
|
|
1550
1551
|
return getDryRunXcm;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvalidParameterError, BatchMode, getNodeProviders, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, Parents, Version, getNode, isForeignAsset, computeFeeFromDryRun, hasXcmPaymentApiSupport, getAssetsObject,
|
|
1
|
+
import { InvalidParameterError, BatchMode, getNodeProviders, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, Parents, Version, getNode, isForeignAsset, computeFeeFromDryRun, hasXcmPaymentApiSupport, getAssetsObject, localizeLocation, isRelayChain, InvalidCurrencyError, isAssetEqual, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { blake2b } from '@noble/hashes/blake2';
|
|
4
4
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
@@ -1342,12 +1342,12 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1342
1342
|
case 6:
|
|
1343
1343
|
executionFee = _context18.v;
|
|
1344
1344
|
hasMultiLocation = feeAsset ? Boolean(feeAsset.multiLocation) : Boolean(asset === null || asset === void 0 ? void 0 : asset.multiLocation);
|
|
1345
|
-
if (!(hasXcmPaymentApiSupport(node) && result.value.local_xcm && hasMultiLocation)) {
|
|
1345
|
+
if (!(hasXcmPaymentApiSupport(node) && result.value.local_xcm && hasMultiLocation && node !== 'AssetHubPolkadot')) {
|
|
1346
1346
|
_context18.n = 8;
|
|
1347
1347
|
break;
|
|
1348
1348
|
}
|
|
1349
1349
|
_context18.n = 7;
|
|
1350
|
-
return this.getXcmPaymentApiFee(result.value.local_xcm, feeAsset !== null && feeAsset !== void 0 ? feeAsset : asset);
|
|
1350
|
+
return this.getXcmPaymentApiFee(node, result.value.local_xcm, feeAsset !== null && feeAsset !== void 0 ? feeAsset : asset);
|
|
1351
1351
|
case 7:
|
|
1352
1352
|
xcmFee = _context18.v;
|
|
1353
1353
|
if (!(typeof xcmFee === 'bigint')) {
|
|
@@ -1406,8 +1406,8 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1406
1406
|
}, {
|
|
1407
1407
|
key: "getXcmPaymentApiFee",
|
|
1408
1408
|
value: function () {
|
|
1409
|
-
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(xcm, asset) {
|
|
1410
|
-
var weight,
|
|
1409
|
+
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(node, xcm, asset) {
|
|
1410
|
+
var weight, transformedLocation, transformedPapiLocation, feeResult;
|
|
1411
1411
|
return _regenerator().w(function (_context20) {
|
|
1412
1412
|
while (1) switch (_context20.n) {
|
|
1413
1413
|
case 0:
|
|
@@ -1421,11 +1421,12 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1421
1421
|
}
|
|
1422
1422
|
throw new InvalidCurrencyError('This asset does not have a multiLocation defined. Cannot determine destination fee.');
|
|
1423
1423
|
case 2:
|
|
1424
|
-
|
|
1424
|
+
transformedLocation = node === 'AssetHubPolkadot' || node === 'AssetHubKusama' || isRelayChain(node) ? localizeLocation(node, asset.multiLocation) : asset.multiLocation;
|
|
1425
|
+
transformedPapiLocation = _transform(transformedLocation);
|
|
1425
1426
|
_context20.n = 3;
|
|
1426
1427
|
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_weight_to_asset_fee(weight.value, {
|
|
1427
1428
|
type: Version.V4,
|
|
1428
|
-
value:
|
|
1429
|
+
value: transformedPapiLocation
|
|
1429
1430
|
});
|
|
1430
1431
|
case 3:
|
|
1431
1432
|
feeResult = _context20.v;
|
|
@@ -1433,7 +1434,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1433
1434
|
}
|
|
1434
1435
|
}, _callee20, this);
|
|
1435
1436
|
}));
|
|
1436
|
-
function getXcmPaymentApiFee(_x34, _x35) {
|
|
1437
|
+
function getXcmPaymentApiFee(_x34, _x35, _x36) {
|
|
1437
1438
|
return _getXcmPaymentApiFee.apply(this, arguments);
|
|
1438
1439
|
}
|
|
1439
1440
|
return getXcmPaymentApiFee;
|
|
@@ -1478,12 +1479,12 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1478
1479
|
} : undefined;
|
|
1479
1480
|
forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
|
|
1480
1481
|
destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
|
|
1481
|
-
if (!(hasXcmPaymentApiSupport(node) && asset)) {
|
|
1482
|
+
if (!(hasXcmPaymentApiSupport(node) && asset && node !== 'AssetHubPolkadot')) {
|
|
1482
1483
|
_context21.n = 5;
|
|
1483
1484
|
break;
|
|
1484
1485
|
}
|
|
1485
1486
|
_context21.n = 4;
|
|
1486
|
-
return this.getXcmPaymentApiFee(xcm, asset);
|
|
1487
|
+
return this.getXcmPaymentApiFee(node, xcm, asset);
|
|
1487
1488
|
case 4:
|
|
1488
1489
|
_fee = _context21.v;
|
|
1489
1490
|
if (!(typeof _fee === 'bigint')) {
|
|
@@ -1543,7 +1544,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1543
1544
|
}
|
|
1544
1545
|
}, _callee21, this);
|
|
1545
1546
|
}));
|
|
1546
|
-
function getDryRunXcm(
|
|
1547
|
+
function getDryRunXcm(_x37) {
|
|
1547
1548
|
return _getDryRunXcm.apply(this, arguments);
|
|
1548
1549
|
}
|
|
1549
1550
|
return getDryRunXcm;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.7.1",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@noble/hashes": "^1.8.0",
|
|
27
27
|
"viem": "^2.30.5",
|
|
28
|
-
"@paraspell/sdk-core": "10.
|
|
28
|
+
"@paraspell/sdk-core": "10.7.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"polkadot-api": ">= 1.13.0 < 2"
|