@paraspell/sdk-pjs 8.12.0 → 8.13.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
@@ -87,10 +87,11 @@ const builder = Builder(/*node api/ws_url_string/ws_url_array - optional*/)
87
87
  .from(NODE)
88
88
  .to(NODE /*,customParaId - optional*/ | Multilocation object /*Only works for PolkadotXCM pallet*/)
89
89
  .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {multilocation: AssetMultilocationString, amount: amount | AssetMultilocationJson, amount: amount} | {multilocation: Override('Custom Multilocation'), amount: amount} | {multiasset: {currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or multilocation: multilocation*/, amount: amount}})
90
- .address(address | Multilocation object /*If you are sending through xTokens, you need to pass the destination and address multilocation in one object (x2)*/, /*senderAddress - OPTIONAL - used when origin is AssetHub and feeAsset parameter is provided*/)
91
- /*.feeAsset({symbol: 'symbol'} || {id: 'id'} || {multilocation: 'multilocation'}) // Optional parameter used when multiasset is provided or when origin is AssetHub - so user can pay in fees different than DOT
92
- .xcmVersion(Version.V1/V2/V3/V4) //Optional parameter for manual override of XCM Version used in call
93
- .customPallet('Pallet','pallet_function') //Optional parameter for manual override of XCM Pallet and function used in call (If they are named differently on some node but syntax stays the same). Both pallet name and function required. Pallet name must be CamelCase, function name snake_case.*/
90
+ .address(address | Multilocation object /*If you are sending through xTokens, you need to pass the destination and address multilocation in one object (x2)*/)
91
+ /*.senderAddress(address) - OPTIONAL - used when origin is AssetHub and feeAsset parameter is provided
92
+ .feeAsset({symbol: 'symbol'} || {id: 'id'} || {multilocation: 'multilocation'}) // Optional parameter used when multiasset is provided or when origin is AssetHub - so user can pay in fees different than DOT
93
+ .xcmVersion(Version.V1/V2/V3/V4) //Optional parameter for manual override of XCM Version used in call
94
+ .customPallet('Pallet','pallet_function') //Optional parameter for manual override of XCM Pallet and function used in call (If they are named differently on some node but syntax stays the same). Both pallet name and function required. Pallet name must be CamelCase, function name snake_case.*/
94
95
 
95
96
  const tx = await builder.build()
96
97
 
@@ -212,7 +213,8 @@ const result = await Builder(API /*optional*/)
212
213
  .to(NODE_2)
213
214
  .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {multilocation: AssetMultilocationString, amount: amount | AssetMultilocationJson, amount: amount} | {multilocation: Override('Custom Multilocation'), amount: amount} | {multiasset: {currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or multilocation: multilocation*/, amount: amount}})
214
215
  .address(ADDRESS)
215
- .dryRun(SENDER_ADDRESS)
216
+ .senderAddress(SENDER_ADDRESS)
217
+ .dryRun()
216
218
 
217
219
  //Function pattern
218
220
  await getDryRun({api /*optional*/, node, address /*sender address*/, tx /* Extrinsic object */})
@@ -238,7 +240,8 @@ const fee = await Builder(/*node api/ws_url_string/ws_url_array - optional*/)
238
240
  .from(ORIGIN_CHAIN)
239
241
  .to(DESTINATION_CHAIN)
240
242
  .currency(CURRENCY)
241
- .address(RECIPIENT_ADDRESS, SENDER_ADDRESS) // Both sender and recipient addresses are required!
243
+ .address(RECIPIENT_ADDRESS)
244
+ .senderAddress(SENDER_ADDRESS)
242
245
  .getXcmFee({disableFallback: true / false}) //When fallback is disabled, you only get notified of DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin or Destination chain do not support DryRun out of the box.
243
246
  ```
244
247
 
@@ -254,7 +257,8 @@ const fee = await Builder(/*node api/ws_url_string/ws_url_array - optional*/)
254
257
  .from(ORIGIN_CHAIN)
255
258
  .to(DESTINATION_CHAIN)
256
259
  .currency(CURRENCY)
257
- .address(RECIPIENT_ADDRESS, SENDER_ADDRESS) // Both sender and recipient addresses are required!
260
+ .address(RECIPIENT_ADDRESS)
261
+ .senderAddress(SENDER_ADDRESS)
258
262
  .getXcmFeeEstimate()
259
263
  ```
260
264
 
package/dist/index.cjs CHANGED
@@ -1752,7 +1752,8 @@ var EvmBuilder = function EvmBuilder(provider) {
1752
1752
  * @returns An extrinsic to be signed and sent.
1753
1753
  */
1754
1754
  var send = createPolkadotJsApiCall(sdkCore.send);
1755
- var getDryRun = createPolkadotJsApiCall(sdkCore.getDryRun);
1755
+ var dryRun = createPolkadotJsApiCall(sdkCore.dryRun);
1756
+ var dryRunOrigin = createPolkadotJsApiCall(sdkCore.dryRunOrigin);
1756
1757
  var transferEthToPolkadot = function transferEthToPolkadot(options) {
1757
1758
  return transferEthToPolkadot$1(_objectSpread2(_objectSpread2({}, options), {}, {
1758
1759
  api: new PolkadotJsApi()
@@ -1807,8 +1808,9 @@ var transfer = /*#__PURE__*/Object.freeze({
1807
1808
  __proto__: null,
1808
1809
  approveToken: approveToken,
1809
1810
  depositToken: depositToken,
1811
+ dryRun: dryRun,
1812
+ dryRunOrigin: dryRunOrigin,
1810
1813
  getBridgeStatus: getBridgeStatus,
1811
- getDryRun: getDryRun,
1812
1814
  getParaEthTransferFees: getParaEthTransferFees,
1813
1815
  getTokenBalance: getTokenBalance,
1814
1816
  send: send,
@@ -1822,11 +1824,12 @@ exports.assets = assets;
1822
1824
  exports.claimAssets = claimAssets;
1823
1825
  exports.createApiInstanceForNode = createApiInstanceForNode;
1824
1826
  exports.depositToken = depositToken;
1827
+ exports.dryRun = dryRun;
1828
+ exports.dryRunOrigin = dryRunOrigin;
1825
1829
  exports.getAssetBalance = getAssetBalance;
1826
1830
  exports.getBalanceForeign = getBalanceForeign;
1827
1831
  exports.getBalanceNative = getBalanceNative;
1828
1832
  exports.getBridgeStatus = getBridgeStatus;
1829
- exports.getDryRun = getDryRun;
1830
1833
  exports.getMaxForeignTransferableAmount = getMaxForeignTransferableAmount;
1831
1834
  exports.getMaxNativeTransferableAmount = getMaxNativeTransferableAmount;
1832
1835
  exports.getOriginFeeDetails = getOriginFeeDetails;
package/dist/index.d.ts CHANGED
@@ -219,9 +219,12 @@ declare const getTokenBalance: (signer: Signer, symbol: string) => Promise<bigin
219
219
  declare const send: (options: _paraspell_sdk_core.TSendBaseOptions & {
220
220
  api?: TPjsApiOrUrl;
221
221
  }) => Promise<Extrinsic>;
222
- declare const getDryRun: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<Extrinsic> & {
222
+ declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<Extrinsic> & {
223
223
  api?: TPjsApiOrUrl;
224
224
  }) => Promise<_paraspell_sdk_core.TDryRunResult>;
225
+ declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<Extrinsic> & {
226
+ api?: TPjsApiOrUrl;
227
+ }) => Promise<_paraspell_sdk_core.TDryRunNodeResult>;
225
228
  declare const transferEthToPolkadot: (options: Omit<TEvmBuilderOptions<TPjsApi, Extrinsic>, "api">) => Promise<{
226
229
  response: ethers.TransactionResponse;
227
230
  messageReceipt: _snowbridge_api_dist_toPolkadot_v2.MessageReceipt;
@@ -234,8 +237,9 @@ declare const getBridgeStatus: (api?: TPjsApiOrUrl) => Promise<_paraspell_sdk_co
234
237
 
235
238
  declare const transfer_approveToken: typeof approveToken;
236
239
  declare const transfer_depositToken: typeof depositToken;
240
+ declare const transfer_dryRun: typeof dryRun;
241
+ declare const transfer_dryRunOrigin: typeof dryRunOrigin;
237
242
  declare const transfer_getBridgeStatus: typeof getBridgeStatus;
238
- declare const transfer_getDryRun: typeof getDryRun;
239
243
  declare const transfer_getParaEthTransferFees: typeof getParaEthTransferFees;
240
244
  declare const transfer_getTokenBalance: typeof getTokenBalance;
241
245
  declare const transfer_send: typeof send;
@@ -244,8 +248,9 @@ declare namespace transfer {
244
248
  export {
245
249
  transfer_approveToken as approveToken,
246
250
  transfer_depositToken as depositToken,
251
+ transfer_dryRun as dryRun,
252
+ transfer_dryRunOrigin as dryRunOrigin,
247
253
  transfer_getBridgeStatus as getBridgeStatus,
248
- transfer_getDryRun as getDryRun,
249
254
  transfer_getParaEthTransferFees as getParaEthTransferFees,
250
255
  transfer_getTokenBalance as getTokenBalance,
251
256
  transfer_send as send,
@@ -255,5 +260,5 @@ declare namespace transfer {
255
260
 
256
261
  declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<_polkadot_api.ApiPromise>;
257
262
 
258
- export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
263
+ export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
259
264
  export type { Extrinsic, GeneralBuilder, TPjsApi, TPjsApiOrUrl };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, getNode, isForeignAsset, computeFeeFromDryRunPjs, resolveModuleError, getAssetsObject, NodeNotSupportedError, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getTransferInfo as getTransferInfo$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, getMaxNativeTransferableAmount as getMaxNativeTransferableAmount$1, getMaxForeignTransferableAmount as getMaxForeignTransferableAmount$1, getTransferableAmount as getTransferableAmount$1, verifyEdOnDestination as verifyEdOnDestination$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, getParaId, ETH_CHAIN_ID, InvalidCurrencyError, isEthersSigner, isOverrideMultiLocationSpecifier, validateAddress, transferMoonbeamToEth, transferMoonbeamEvm, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, send as send$1, getDryRun as getDryRun$1 } from '@paraspell/sdk-core';
1
+ import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, getNode, isForeignAsset, computeFeeFromDryRunPjs, resolveModuleError, getAssetsObject, NodeNotSupportedError, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getTransferInfo as getTransferInfo$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, getMaxNativeTransferableAmount as getMaxNativeTransferableAmount$1, getMaxForeignTransferableAmount as getMaxForeignTransferableAmount$1, getTransferableAmount as getTransferableAmount$1, verifyEdOnDestination as verifyEdOnDestination$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, getParaId, ETH_CHAIN_ID, InvalidCurrencyError, isEthersSigner, isOverrideMultiLocationSpecifier, validateAddress, transferMoonbeamToEth, transferMoonbeamEvm, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, 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';
@@ -1751,7 +1751,8 @@ var EvmBuilder = function EvmBuilder(provider) {
1751
1751
  * @returns An extrinsic to be signed and sent.
1752
1752
  */
1753
1753
  var send = createPolkadotJsApiCall(send$1);
1754
- var getDryRun = createPolkadotJsApiCall(getDryRun$1);
1754
+ var dryRun = createPolkadotJsApiCall(dryRun$1);
1755
+ var dryRunOrigin = createPolkadotJsApiCall(dryRunOrigin$1);
1755
1756
  var transferEthToPolkadot = function transferEthToPolkadot(options) {
1756
1757
  return transferEthToPolkadot$1(_objectSpread2(_objectSpread2({}, options), {}, {
1757
1758
  api: new PolkadotJsApi()
@@ -1806,12 +1807,13 @@ var transfer = /*#__PURE__*/Object.freeze({
1806
1807
  __proto__: null,
1807
1808
  approveToken: approveToken,
1808
1809
  depositToken: depositToken,
1810
+ dryRun: dryRun,
1811
+ dryRunOrigin: dryRunOrigin,
1809
1812
  getBridgeStatus: getBridgeStatus,
1810
- getDryRun: getDryRun,
1811
1813
  getParaEthTransferFees: getParaEthTransferFees,
1812
1814
  getTokenBalance: getTokenBalance,
1813
1815
  send: send,
1814
1816
  transferEthToPolkadot: transferEthToPolkadot
1815
1817
  });
1816
1818
 
1817
- export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
1819
+ export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-pjs",
3
- "version": "8.12.0",
3
+ "version": "8.13.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.1.50",
28
28
  "ethers": "^6.13.7",
29
29
  "viem": "^2.28.1",
30
- "@paraspell/sdk-core": "8.12.0"
30
+ "@paraspell/sdk-core": "8.13.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@polkadot/api": ">= 15.0 < 16",