@paraspell/sdk 11.5.0 → 11.5.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 +8 -4
- package/dist/index.mjs +8 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1051,7 +1051,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1051
1051
|
}, {
|
|
1052
1052
|
key: "getMethod",
|
|
1053
1053
|
value: function getMethod(tx) {
|
|
1054
|
-
return tx.decodedCall.value.
|
|
1054
|
+
return tx.decodedCall.value.type;
|
|
1055
1055
|
}
|
|
1056
1056
|
}, {
|
|
1057
1057
|
key: "calculateTransactionFee",
|
|
@@ -1615,11 +1615,11 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1615
1615
|
value: function () {
|
|
1616
1616
|
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(_ref8) {
|
|
1617
1617
|
var _ref9, _processAssetsDeposit, _ref0, _ref1, _ref10, _ref11, _ref12;
|
|
1618
|
-
var originLocation, xcm, chain, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, symbol, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
|
|
1618
|
+
var originLocation, xcm, chain, origin, asset, tx, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, symbol, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, txMethod, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
|
|
1619
1619
|
return _regenerator().w(function (_context23) {
|
|
1620
1620
|
while (1) switch (_context23.n) {
|
|
1621
1621
|
case 0:
|
|
1622
|
-
originLocation = _ref8.originLocation, xcm = _ref8.xcm, chain = _ref8.chain, origin = _ref8.origin, asset = _ref8.asset, feeAsset = _ref8.feeAsset, originFee = _ref8.originFee, amount = _ref8.amount;
|
|
1622
|
+
originLocation = _ref8.originLocation, xcm = _ref8.xcm, chain = _ref8.chain, origin = _ref8.origin, asset = _ref8.asset, tx = _ref8.tx, feeAsset = _ref8.feeAsset, originFee = _ref8.originFee, amount = _ref8.amount;
|
|
1623
1623
|
supportsDryRunApi = sdkCore.getAssetsObject(chain).supportsDryRunApi;
|
|
1624
1624
|
if (supportsDryRunApi) {
|
|
1625
1625
|
_context23.n = 1;
|
|
@@ -1653,7 +1653,11 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1653
1653
|
} : undefined;
|
|
1654
1654
|
forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
|
|
1655
1655
|
destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
|
|
1656
|
-
|
|
1656
|
+
txMethod = this.getMethod(tx);
|
|
1657
|
+
if (!(sdkCore.hasXcmPaymentApiSupport(chain) && asset && (
|
|
1658
|
+
// Do not use XcmPaymentApi if method is `execute` on AssetHub or Polkadot
|
|
1659
|
+
// as fee calculation would be incorrect
|
|
1660
|
+
txMethod !== 'execute' || chain !== 'AssetHubPolkadot' && chain !== 'Polkadot'))) {
|
|
1657
1661
|
_context23.n = 5;
|
|
1658
1662
|
break;
|
|
1659
1663
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1050,7 +1050,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1050
1050
|
}, {
|
|
1051
1051
|
key: "getMethod",
|
|
1052
1052
|
value: function getMethod(tx) {
|
|
1053
|
-
return tx.decodedCall.value.
|
|
1053
|
+
return tx.decodedCall.value.type;
|
|
1054
1054
|
}
|
|
1055
1055
|
}, {
|
|
1056
1056
|
key: "calculateTransactionFee",
|
|
@@ -1614,11 +1614,11 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1614
1614
|
value: function () {
|
|
1615
1615
|
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(_ref8) {
|
|
1616
1616
|
var _ref9, _processAssetsDeposit, _ref0, _ref1, _ref10, _ref11, _ref12;
|
|
1617
|
-
var originLocation, xcm, chain, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, symbol, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
|
|
1617
|
+
var originLocation, xcm, chain, origin, asset, tx, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, symbol, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, txMethod, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
|
|
1618
1618
|
return _regenerator().w(function (_context23) {
|
|
1619
1619
|
while (1) switch (_context23.n) {
|
|
1620
1620
|
case 0:
|
|
1621
|
-
originLocation = _ref8.originLocation, xcm = _ref8.xcm, chain = _ref8.chain, origin = _ref8.origin, asset = _ref8.asset, feeAsset = _ref8.feeAsset, originFee = _ref8.originFee, amount = _ref8.amount;
|
|
1621
|
+
originLocation = _ref8.originLocation, xcm = _ref8.xcm, chain = _ref8.chain, origin = _ref8.origin, asset = _ref8.asset, tx = _ref8.tx, feeAsset = _ref8.feeAsset, originFee = _ref8.originFee, amount = _ref8.amount;
|
|
1622
1622
|
supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
|
|
1623
1623
|
if (supportsDryRunApi) {
|
|
1624
1624
|
_context23.n = 1;
|
|
@@ -1652,7 +1652,11 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1652
1652
|
} : undefined;
|
|
1653
1653
|
forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
|
|
1654
1654
|
destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
|
|
1655
|
-
|
|
1655
|
+
txMethod = this.getMethod(tx);
|
|
1656
|
+
if (!(hasXcmPaymentApiSupport(chain) && asset && (
|
|
1657
|
+
// Do not use XcmPaymentApi if method is `execute` on AssetHub or Polkadot
|
|
1658
|
+
// as fee calculation would be incorrect
|
|
1659
|
+
txMethod !== 'execute' || chain !== 'AssetHubPolkadot' && chain !== 'Polkadot'))) {
|
|
1656
1660
|
_context23.n = 5;
|
|
1657
1661
|
break;
|
|
1658
1662
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "11.5.
|
|
3
|
+
"version": "11.5.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.36.0",
|
|
28
|
-
"@paraspell/sdk-core": "11.5.
|
|
28
|
+
"@paraspell/sdk-core": "11.5.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"polkadot-api": ">= 1.16.3 < 2"
|