@paraspell/sdk 11.4.1 → 11.5.0

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
@@ -345,6 +345,18 @@ const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_u
345
345
  .getTransferableAmount()
346
346
  ```
347
347
 
348
+ #### Minimal transferable amount
349
+ ```ts
350
+ const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
351
+ .from(ORIGIN_CHAIN)
352
+ .to(DESTINATION_CHAIN)
353
+ .currency(CURRENCY)
354
+ /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
355
+ .address(RECIPIENT_ADDRESS)
356
+ .senderAddress(SENDER_ADDRESS)
357
+ .getMinTransferableAmount()
358
+ ```
359
+
348
360
  #### Verify ED on destination
349
361
  ```ts
350
362
  const ed = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
package/dist/index.cjs CHANGED
@@ -1482,9 +1482,7 @@ var PapiApi = /*#__PURE__*/function () {
1482
1482
  failureOutputReason = '';
1483
1483
  }
1484
1484
  case 7:
1485
- usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : sdkCore.findAssetInfoOrThrow(chain, {
1486
- symbol: sdkCore.Native(sdkCore.getNativeAssetSymbol(chain))
1487
- }, null);
1485
+ usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : sdkCore.findNativeAssetInfoOrThrow(chain);
1488
1486
  usedSymbol = usedAsset.symbol;
1489
1487
  if (isSuccess) {
1490
1488
  _context20.n = 8;
@@ -1508,11 +1506,9 @@ var PapiApi = /*#__PURE__*/function () {
1508
1506
  return this.calculateTransactionFee(resolvedTx, address);
1509
1507
  case 9:
1510
1508
  executionFee = _context20.v;
1511
- nativeAsset = sdkCore.findAssetInfo(chain, {
1512
- symbol: sdkCore.Native(sdkCore.getNativeAssetSymbol(chain))
1513
- }, null);
1509
+ nativeAsset = sdkCore.findNativeAssetInfoOrThrow(chain);
1514
1510
  hasLocation = feeAsset ? Boolean(feeAsset.location) : Boolean(nativeAsset === null || nativeAsset === void 0 ? void 0 : nativeAsset.location);
1515
- if (!(sdkCore.hasXcmPaymentApiSupport(chain) && result.value.local_xcm && hasLocation && nativeAsset && chain !== 'AssetHubPolkadot' && chain !== 'Kusama')) {
1511
+ if (!(sdkCore.hasXcmPaymentApiSupport(chain) && result.value.local_xcm && hasLocation && chain !== 'AssetHubPolkadot' && chain !== 'Kusama')) {
1516
1512
  _context20.n = 11;
1517
1513
  break;
1518
1514
  }
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { InvalidParameterError, isConfig, BatchMode, getChainProviders, MissingChainApiError, ChainNotSupportedError, createChainClient as createChainClient$1, Parents, Version, getChain, isForeignAsset, assertHasId, computeFeeFromDryRun, findAssetInfo, Native, getNativeAssetSymbol, hasXcmPaymentApiSupport, findAssetInfoOrThrow, replaceBigInt, getAssetsObject, wrapTxBypass, assertHasLocation, localizeLocation, isRelayChain, padFeeBy, isAssetEqual, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Override, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, getXcmFee as getXcmFee$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1, handleSwapExecuteTransfer as handleSwapExecuteTransfer$1 } from '@paraspell/sdk-core';
1
+ import { InvalidParameterError, isConfig, BatchMode, getChainProviders, MissingChainApiError, ChainNotSupportedError, createChainClient as createChainClient$1, Parents, Version, getChain, isForeignAsset, assertHasId, computeFeeFromDryRun, findNativeAssetInfoOrThrow, hasXcmPaymentApiSupport, replaceBigInt, getAssetsObject, wrapTxBypass, assertHasLocation, localizeLocation, isRelayChain, padFeeBy, 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, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, getXcmFee as getXcmFee$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1, handleSwapExecuteTransfer as handleSwapExecuteTransfer$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';
@@ -1481,9 +1481,7 @@ var PapiApi = /*#__PURE__*/function () {
1481
1481
  failureOutputReason = '';
1482
1482
  }
1483
1483
  case 7:
1484
- usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : findAssetInfoOrThrow(chain, {
1485
- symbol: Native(getNativeAssetSymbol(chain))
1486
- }, null);
1484
+ usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrow(chain);
1487
1485
  usedSymbol = usedAsset.symbol;
1488
1486
  if (isSuccess) {
1489
1487
  _context20.n = 8;
@@ -1507,11 +1505,9 @@ var PapiApi = /*#__PURE__*/function () {
1507
1505
  return this.calculateTransactionFee(resolvedTx, address);
1508
1506
  case 9:
1509
1507
  executionFee = _context20.v;
1510
- nativeAsset = findAssetInfo(chain, {
1511
- symbol: Native(getNativeAssetSymbol(chain))
1512
- }, null);
1508
+ nativeAsset = findNativeAssetInfoOrThrow(chain);
1513
1509
  hasLocation = feeAsset ? Boolean(feeAsset.location) : Boolean(nativeAsset === null || nativeAsset === void 0 ? void 0 : nativeAsset.location);
1514
- if (!(hasXcmPaymentApiSupport(chain) && result.value.local_xcm && hasLocation && nativeAsset && chain !== 'AssetHubPolkadot' && chain !== 'Kusama')) {
1510
+ if (!(hasXcmPaymentApiSupport(chain) && result.value.local_xcm && hasLocation && chain !== 'AssetHubPolkadot' && chain !== 'Kusama')) {
1515
1511
  _context20.n = 11;
1516
1512
  break;
1517
1513
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "11.4.1",
3
+ "version": "11.5.0",
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.4.1"
28
+ "@paraspell/sdk-core": "11.5.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "polkadot-api": ">= 1.16.3 < 2"