@paraspell/sdk 10.10.8 → 10.10.10

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/README.md CHANGED
@@ -475,13 +475,19 @@ console.log(SUPPORTED_PALLETS)
475
475
 
476
476
  XCM SDK can be tested in [Playground](https://playground.paraspell.xyz/xcm-sdk/xcm-transfer).
477
477
 
478
+ ## Get Support 🚑
479
+
480
+ - Contact form on our [landing page](https://paraspell.xyz/#contact-us).
481
+ - Message us on our [X](https://x.com/paraspell).
482
+ - Support channel on [telegram](https://t.me/paraspell).
483
+
478
484
  ## License
479
485
 
480
486
  Made with 💛 by [ParaSpell✨](https://paraspell.xyz/)
481
487
 
482
488
  Published under [MIT License](https://github.com/paraspell/xcm-tools/blob/main/packages/sdk/LICENSE).
483
489
 
484
- ## Support
490
+ ## Supported by
485
491
 
486
492
  <div align="center">
487
493
  <p align="center">
package/dist/index.cjs CHANGED
@@ -319,14 +319,15 @@ function _unsupportedIterableToArray(r, a) {
319
319
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
320
320
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
321
321
  /* eslint-disable @typescript-eslint/no-explicit-any */
322
- var processAssetsDepositedEvents = function processAssetsDepositedEvents(events, amount) {
322
+ var processAssetsDepositedEvents = function processAssetsDepositedEvents(events, amount, pallet, method) {
323
+ var returnOnOneEvent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
323
324
  var assetsDepositedEvents = events.filter(function (event) {
324
- return event.type === 'Assets' && event.value.type === 'Deposited';
325
+ return event.type === pallet && event.value.type === method;
325
326
  });
326
327
  if (assetsDepositedEvents.length === 0) {
327
328
  return undefined;
328
329
  }
329
- if (assetsDepositedEvents.length === 1) {
330
+ if (assetsDepositedEvents.length === 1 && returnOnOneEvent) {
330
331
  return BigInt(assetsDepositedEvents[0].value.value.amount);
331
332
  }
332
333
  // Start with all events
@@ -1494,7 +1495,7 @@ var PapiApi = /*#__PURE__*/function () {
1494
1495
  key: "getDryRunXcm",
1495
1496
  value: function () {
1496
1497
  var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(_ref9) {
1497
- var _ref0, _ref1, _ref10, _ref11, _ref12, _ref13;
1498
+ var _ref0, _processAssetsDeposit, _ref1, _ref10, _ref11, _ref12, _ref13;
1498
1499
  var originLocation, xcm, node, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
1499
1500
  return _regenerator().w(function (_context21) {
1500
1501
  while (1) switch (_context21.n) {
@@ -1559,7 +1560,7 @@ var PapiApi = /*#__PURE__*/function () {
1559
1560
  }) : undefined) !== null && _ref0 !== void 0 ? _ref0 : isFeeAsset ? _toConsumableArray(emitted).find(function (event) {
1560
1561
  return event.type === 'Tokens' && event.value.type === 'Deposited';
1561
1562
  }) : undefined;
1562
- processedAssetsAmount = node === 'AssetHubPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== 'DOT' ? processAssetsDepositedEvents(emitted, amount) : undefined;
1563
+ processedAssetsAmount = node === 'AssetHubPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== 'DOT' ? processAssetsDepositedEvents(emitted, amount, 'Assets', 'Deposited', true) : (_processAssetsDeposit = processAssetsDepositedEvents(emitted, amount, 'Balances', 'Minted', false)) !== null && _processAssetsDeposit !== void 0 ? _processAssetsDeposit : processAssetsDepositedEvents(emitted, amount, 'Balances', 'Issued', false);
1563
1564
  feeEvent = (_ref1 = (_ref10 = (_ref11 = (_ref12 = (_ref13 = feeAssetFeeEvent !== null && feeAssetFeeEvent !== void 0 ? feeAssetFeeEvent :
1564
1565
  //
1565
1566
  processedAssetsAmount !== undefined ? {
package/dist/index.mjs CHANGED
@@ -318,14 +318,15 @@ function _unsupportedIterableToArray(r, a) {
318
318
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
319
319
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
320
320
  /* eslint-disable @typescript-eslint/no-explicit-any */
321
- var processAssetsDepositedEvents = function processAssetsDepositedEvents(events, amount) {
321
+ var processAssetsDepositedEvents = function processAssetsDepositedEvents(events, amount, pallet, method) {
322
+ var returnOnOneEvent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
322
323
  var assetsDepositedEvents = events.filter(function (event) {
323
- return event.type === 'Assets' && event.value.type === 'Deposited';
324
+ return event.type === pallet && event.value.type === method;
324
325
  });
325
326
  if (assetsDepositedEvents.length === 0) {
326
327
  return undefined;
327
328
  }
328
- if (assetsDepositedEvents.length === 1) {
329
+ if (assetsDepositedEvents.length === 1 && returnOnOneEvent) {
329
330
  return BigInt(assetsDepositedEvents[0].value.value.amount);
330
331
  }
331
332
  // Start with all events
@@ -1493,7 +1494,7 @@ var PapiApi = /*#__PURE__*/function () {
1493
1494
  key: "getDryRunXcm",
1494
1495
  value: function () {
1495
1496
  var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(_ref9) {
1496
- var _ref0, _ref1, _ref10, _ref11, _ref12, _ref13;
1497
+ var _ref0, _processAssetsDeposit, _ref1, _ref10, _ref11, _ref12, _ref13;
1497
1498
  var originLocation, xcm, node, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
1498
1499
  return _regenerator().w(function (_context21) {
1499
1500
  while (1) switch (_context21.n) {
@@ -1558,7 +1559,7 @@ var PapiApi = /*#__PURE__*/function () {
1558
1559
  }) : undefined) !== null && _ref0 !== void 0 ? _ref0 : isFeeAsset ? _toConsumableArray(emitted).find(function (event) {
1559
1560
  return event.type === 'Tokens' && event.value.type === 'Deposited';
1560
1561
  }) : undefined;
1561
- processedAssetsAmount = node === 'AssetHubPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== 'DOT' ? processAssetsDepositedEvents(emitted, amount) : undefined;
1562
+ processedAssetsAmount = node === 'AssetHubPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== 'DOT' ? processAssetsDepositedEvents(emitted, amount, 'Assets', 'Deposited', true) : (_processAssetsDeposit = processAssetsDepositedEvents(emitted, amount, 'Balances', 'Minted', false)) !== null && _processAssetsDeposit !== void 0 ? _processAssetsDeposit : processAssetsDepositedEvents(emitted, amount, 'Balances', 'Issued', false);
1562
1563
  feeEvent = (_ref1 = (_ref10 = (_ref11 = (_ref12 = (_ref13 = feeAssetFeeEvent !== null && feeAssetFeeEvent !== void 0 ? feeAssetFeeEvent :
1563
1564
  //
1564
1565
  processedAssetsAmount !== undefined ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "10.10.8",
3
+ "version": "10.10.10",
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.31.6",
28
- "@paraspell/sdk-core": "10.10.8"
28
+ "@paraspell/sdk-core": "10.10.10"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "polkadot-api": ">= 1.14.1 < 2"