@paraspell/sdk 6.2.1 → 6.2.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
@@ -12826,35 +12826,41 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
12826
12826
  destXcmFee = _yield$getOriginFeeDe.xcmFee;
12827
12827
  expectedBalanceAfterXCMDelivery = originBalance - destXcmFee;
12828
12828
  asset = getAssetBySymbolOrId(origin, currency);
12829
+ if (asset) {
12830
+ _context.next = 14;
12831
+ break;
12832
+ }
12833
+ throw new InvalidCurrencyError("Asset ".concat('symbol' in currency ? currency.symbol : currency.id, " not found on ").concat(origin));
12834
+ case 14:
12829
12835
  _context.t0 = {
12830
12836
  origin: origin,
12831
12837
  destination: destination,
12832
12838
  ecosystem: determineRelayChainSymbol(origin)
12833
12839
  };
12834
- _context.next = 15;
12840
+ _context.next = 17;
12835
12841
  return getAssetBalance(accountOrigin, origin, currency);
12836
- case 15:
12842
+ case 17:
12837
12843
  _context.t1 = _context.sent;
12838
12844
  _context.t2 = (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : '';
12839
12845
  _context.t3 = {
12840
12846
  balance: _context.t1,
12841
12847
  currency: _context.t2
12842
12848
  };
12843
- _context.next = 20;
12849
+ _context.next = 22;
12844
12850
  return getBalanceNative(accountOrigin, origin, originApi);
12845
- case 20:
12851
+ case 22:
12846
12852
  _context.t4 = _context.sent;
12847
12853
  _context.t5 = expectedBalanceAfterXCMDelivery;
12848
- _context.next = 24;
12854
+ _context.next = 26;
12849
12855
  return getOriginFeeDetails(origin, destination, currency, amount, accountOrigin, originApi);
12850
- case 24:
12856
+ case 26:
12851
12857
  _context.t6 = _context.sent;
12852
12858
  _context.t7 = BigInt((_b = getExistentialDeposit(origin)) !== null && _b !== void 0 ? _b : 0);
12853
12859
  _context.t8 = getNativeAssetSymbol(origin);
12854
12860
  _context.t9 = getMinNativeTransferableAmount(origin);
12855
- _context.next = 30;
12861
+ _context.next = 32;
12856
12862
  return getMaxNativeTransferableAmount(accountOrigin, origin);
12857
- case 30:
12863
+ case 32:
12858
12864
  _context.t10 = _context.sent;
12859
12865
  _context.t11 = {
12860
12866
  balance: _context.t4,
@@ -12865,9 +12871,9 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
12865
12871
  minNativeTransferableAmount: _context.t9,
12866
12872
  maxNativeTransferableAmount: _context.t10
12867
12873
  };
12868
- _context.next = 34;
12874
+ _context.next = 36;
12869
12875
  return getBalanceNative(accountDestination, destination);
12870
- case 34:
12876
+ case 36:
12871
12877
  _context.t12 = _context.sent;
12872
12878
  _context.t13 = getNativeAssetSymbol(destination);
12873
12879
  _context.t14 = getExistentialDeposit(destination);
@@ -12882,7 +12888,7 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
12882
12888
  originFeeBalance: _context.t11,
12883
12889
  destinationFeeBalance: _context.t15
12884
12890
  });
12885
- case 39:
12891
+ case 41:
12886
12892
  case "end":
12887
12893
  return _context.stop();
12888
12894
  }
package/dist/index.mjs CHANGED
@@ -12824,35 +12824,41 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
12824
12824
  destXcmFee = _yield$getOriginFeeDe.xcmFee;
12825
12825
  expectedBalanceAfterXCMDelivery = originBalance - destXcmFee;
12826
12826
  asset = getAssetBySymbolOrId(origin, currency);
12827
+ if (asset) {
12828
+ _context.next = 14;
12829
+ break;
12830
+ }
12831
+ throw new InvalidCurrencyError("Asset ".concat('symbol' in currency ? currency.symbol : currency.id, " not found on ").concat(origin));
12832
+ case 14:
12827
12833
  _context.t0 = {
12828
12834
  origin: origin,
12829
12835
  destination: destination,
12830
12836
  ecosystem: determineRelayChainSymbol(origin)
12831
12837
  };
12832
- _context.next = 15;
12838
+ _context.next = 17;
12833
12839
  return getAssetBalance(accountOrigin, origin, currency);
12834
- case 15:
12840
+ case 17:
12835
12841
  _context.t1 = _context.sent;
12836
12842
  _context.t2 = (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : '';
12837
12843
  _context.t3 = {
12838
12844
  balance: _context.t1,
12839
12845
  currency: _context.t2
12840
12846
  };
12841
- _context.next = 20;
12847
+ _context.next = 22;
12842
12848
  return getBalanceNative(accountOrigin, origin, originApi);
12843
- case 20:
12849
+ case 22:
12844
12850
  _context.t4 = _context.sent;
12845
12851
  _context.t5 = expectedBalanceAfterXCMDelivery;
12846
- _context.next = 24;
12852
+ _context.next = 26;
12847
12853
  return getOriginFeeDetails(origin, destination, currency, amount, accountOrigin, originApi);
12848
- case 24:
12854
+ case 26:
12849
12855
  _context.t6 = _context.sent;
12850
12856
  _context.t7 = BigInt((_b = getExistentialDeposit(origin)) !== null && _b !== void 0 ? _b : 0);
12851
12857
  _context.t8 = getNativeAssetSymbol(origin);
12852
12858
  _context.t9 = getMinNativeTransferableAmount(origin);
12853
- _context.next = 30;
12859
+ _context.next = 32;
12854
12860
  return getMaxNativeTransferableAmount(accountOrigin, origin);
12855
- case 30:
12861
+ case 32:
12856
12862
  _context.t10 = _context.sent;
12857
12863
  _context.t11 = {
12858
12864
  balance: _context.t4,
@@ -12863,9 +12869,9 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
12863
12869
  minNativeTransferableAmount: _context.t9,
12864
12870
  maxNativeTransferableAmount: _context.t10
12865
12871
  };
12866
- _context.next = 34;
12872
+ _context.next = 36;
12867
12873
  return getBalanceNative(accountDestination, destination);
12868
- case 34:
12874
+ case 36:
12869
12875
  _context.t12 = _context.sent;
12870
12876
  _context.t13 = getNativeAssetSymbol(destination);
12871
12877
  _context.t14 = getExistentialDeposit(destination);
@@ -12880,7 +12886,7 @@ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigi
12880
12886
  originFeeBalance: _context.t11,
12881
12887
  destinationFeeBalance: _context.t15
12882
12888
  });
12883
- case 39:
12889
+ case 41:
12884
12890
  case "end":
12885
12891
  return _context.stop();
12886
12892
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "description": "SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": "@paraspell/sdk",
6
6
  "license": "MIT",