@paraspell/sdk-core 8.4.1 → 8.4.2

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 CHANGED
@@ -13921,7 +13921,7 @@ var resolveParaId = function resolveParaId(paraId, destination) {
13921
13921
 
13922
13922
  var calculateFee = /*#__PURE__*/function () {
13923
13923
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
13924
- var DEFAULT_FEE, feeStorageItem, leFeeHex, leFee, transfer_bridge_fee, transfer_assethub_execution_fee;
13924
+ var DEFAULT_FEE, feeStorageItem, leFeeHex, bytes, reversedHex, validReversedHex, leFee, transferBridgeFee, transferAssethubExecutionFee, totalFee, finalFee;
13925
13925
  return _regeneratorRuntime().wrap(function _callee$(_context) {
13926
13926
  while (1) switch (_context.prev = _context.next) {
13927
13927
  case 0:
@@ -13934,11 +13934,16 @@ var calculateFee = /*#__PURE__*/function () {
13934
13934
  _context.next = 7;
13935
13935
  return ahApi.disconnect();
13936
13936
  case 7:
13937
- leFee = BigInt('0x' + leFeeHex.split('').reverse().join(''));
13938
- transfer_bridge_fee = leFee === 0n ? DEFAULT_FEE : BigInt(leFee.toString());
13939
- transfer_assethub_execution_fee = 2200000000n;
13940
- return _context.abrupt("return", (transfer_bridge_fee + transfer_assethub_execution_fee).toString());
13941
- case 11:
13937
+ bytes = leFeeHex.match(/.{1,2}/g) || [];
13938
+ reversedHex = bytes.reverse().join('');
13939
+ validReversedHex = reversedHex === '' ? '0' : reversedHex;
13940
+ leFee = BigInt('0x' + validReversedHex);
13941
+ transferBridgeFee = leFee === 0n ? DEFAULT_FEE : BigInt(leFee.toString());
13942
+ transferAssethubExecutionFee = 2200000000n;
13943
+ totalFee = transferBridgeFee + transferAssethubExecutionFee; // Adding a 10% margin
13944
+ finalFee = totalFee * 110n / 100n;
13945
+ return _context.abrupt("return", finalFee.toString());
13946
+ case 16:
13942
13947
  case "end":
13943
13948
  return _context.stop();
13944
13949
  }
package/dist/index.mjs CHANGED
@@ -13919,7 +13919,7 @@ var resolveParaId = function resolveParaId(paraId, destination) {
13919
13919
 
13920
13920
  var calculateFee = /*#__PURE__*/function () {
13921
13921
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
13922
- var DEFAULT_FEE, feeStorageItem, leFeeHex, leFee, transfer_bridge_fee, transfer_assethub_execution_fee;
13922
+ var DEFAULT_FEE, feeStorageItem, leFeeHex, bytes, reversedHex, validReversedHex, leFee, transferBridgeFee, transferAssethubExecutionFee, totalFee, finalFee;
13923
13923
  return _regeneratorRuntime().wrap(function _callee$(_context) {
13924
13924
  while (1) switch (_context.prev = _context.next) {
13925
13925
  case 0:
@@ -13932,11 +13932,16 @@ var calculateFee = /*#__PURE__*/function () {
13932
13932
  _context.next = 7;
13933
13933
  return ahApi.disconnect();
13934
13934
  case 7:
13935
- leFee = BigInt('0x' + leFeeHex.split('').reverse().join(''));
13936
- transfer_bridge_fee = leFee === 0n ? DEFAULT_FEE : BigInt(leFee.toString());
13937
- transfer_assethub_execution_fee = 2200000000n;
13938
- return _context.abrupt("return", (transfer_bridge_fee + transfer_assethub_execution_fee).toString());
13939
- case 11:
13935
+ bytes = leFeeHex.match(/.{1,2}/g) || [];
13936
+ reversedHex = bytes.reverse().join('');
13937
+ validReversedHex = reversedHex === '' ? '0' : reversedHex;
13938
+ leFee = BigInt('0x' + validReversedHex);
13939
+ transferBridgeFee = leFee === 0n ? DEFAULT_FEE : BigInt(leFee.toString());
13940
+ transferAssethubExecutionFee = 2200000000n;
13941
+ totalFee = transferBridgeFee + transferAssethubExecutionFee; // Adding a 10% margin
13942
+ finalFee = totalFee * 110n / 100n;
13943
+ return _context.abrupt("return", finalFee.toString());
13944
+ case 16:
13940
13945
  case "end":
13941
13946
  return _context.stop();
13942
13947
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-core",
3
- "version": "8.4.1",
3
+ "version": "8.4.2",
4
4
  "description": "SDK core for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",