@paraspell/sdk-pjs 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
@@ -344,6 +344,18 @@ const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_u
344
344
  .getTransferableAmount()
345
345
  ```
346
346
 
347
+ #### Minimal transferable amount
348
+ ```ts
349
+ const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
350
+ .from(ORIGIN_CHAIN)
351
+ .to(DESTINATION_CHAIN)
352
+ .currency(CURRENCY)
353
+ /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
354
+ .address(RECIPIENT_ADDRESS)
355
+ .senderAddress(SENDER_ADDRESS)
356
+ .getMinTransferableAmount()
357
+ ```
358
+
347
359
  #### Verify ED on destination
348
360
  ```ts
349
361
  const ed = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
package/dist/index.cjs CHANGED
@@ -791,9 +791,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
791
791
  throw new sdkCore.ChainNotSupportedError("DryRunApi is not available on chain ".concat(chain));
792
792
  case 1:
793
793
  DEFAULT_XCM_VERSION = 3;
794
- usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : sdkCore.findAssetInfoOrThrow(chain, {
795
- symbol: sdkCore.Native(sdkCore.getNativeAssetSymbol(chain))
796
- }, null);
794
+ usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : sdkCore.findNativeAssetInfoOrThrow(chain);
797
795
  usedSymbol = usedAsset.symbol;
798
796
  performDryRunCall = /*#__PURE__*/function () {
799
797
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(includeVersion) {
package/dist/index.d.ts CHANGED
@@ -42,6 +42,10 @@ type TEvmBuilderOptionsBase = {
42
42
  type TPjsEvmBuilderOptions<TApi, TRes> = WithApi<TEvmBuilderOptionsBase, TApi, TRes> & {
43
43
  provider?: AbstractProvider;
44
44
  };
45
+ type TBalanceResponse = {
46
+ free?: string;
47
+ balance?: string;
48
+ };
45
49
 
46
50
  /**
47
51
  * Retrieves the native balance for a given account on a specified chain.
@@ -280,4 +284,4 @@ declare namespace transfer {
280
284
  declare const createChainClient: (chain: TSubstrateChain) => Promise<_polkadot_api.ApiPromise>;
281
285
 
282
286
  export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createChainClient, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, send, transferEthToPolkadot, transfer as xcmPallet };
283
- export type { Extrinsic, GeneralBuilder, TPjsApi, TPjsApiOrUrl, TPjsEvmBuilderOptions };
287
+ export type { Extrinsic, GeneralBuilder, TBalanceResponse, TPjsApi, TPjsApiOrUrl, TPjsEvmBuilderOptions };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { isConfig, BatchMode, MissingChainApiError, createChainClient as createChainClient$1, getChain, isForeignAsset, InvalidParameterError, computeFeeFromDryRunPjs, findAssetInfoOrThrow, Native, getNativeAssetSymbol, resolveModuleError, getAssetsObject, ChainNotSupportedError, assertHasLocation, localizeLocation, isRelayChain, addXcmVersionHeader, Version, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, getParaId, ETH_CHAIN_ID, abstractDecimals, assertHasId, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
1
+ import { isConfig, BatchMode, MissingChainApiError, createChainClient as createChainClient$1, getChain, isForeignAsset, InvalidParameterError, computeFeeFromDryRunPjs, findNativeAssetInfoOrThrow, resolveModuleError, getAssetsObject, ChainNotSupportedError, assertHasLocation, localizeLocation, isRelayChain, addXcmVersionHeader, Version, 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, getParaId, ETH_CHAIN_ID, findAssetInfoOrThrow, abstractDecimals, assertHasId, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
2
2
  export * from '@paraspell/sdk-core';
3
3
  import { WsProvider, ApiPromise } from '@polkadot/api';
4
4
  import { u32 } from '@polkadot/types';
@@ -790,9 +790,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
790
790
  throw new ChainNotSupportedError("DryRunApi is not available on chain ".concat(chain));
791
791
  case 1:
792
792
  DEFAULT_XCM_VERSION = 3;
793
- usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : findAssetInfoOrThrow(chain, {
794
- symbol: Native(getNativeAssetSymbol(chain))
795
- }, null);
793
+ usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrow(chain);
796
794
  usedSymbol = usedAsset.symbol;
797
795
  performDryRunCall = /*#__PURE__*/function () {
798
796
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(includeVersion) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-pjs",
3
- "version": "11.4.1",
3
+ "version": "11.5.0",
4
4
  "description": "Polkadot.js based SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "@snowbridge/contract-types": "0.2.0",
28
28
  "ethers": "^6.15.0",
29
29
  "viem": "^2.36.0",
30
- "@paraspell/sdk-core": "11.4.1"
30
+ "@paraspell/sdk-core": "11.5.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@polkadot/api": ">= 16.0 < 17",