@paraspell/sdk 8.4.2 → 8.5.1

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
@@ -11,7 +11,7 @@
11
11
  <img alt="downloads" src="https://img.shields.io/npm/dm/@paraspell/sdk?style=flat-square" />
12
12
  </a>
13
13
  <a href="https://github.com/paraspell/xcm-sdk/actions">
14
- <img alt="build" src="https://github.com/paraspell/xcm-sdk/actions/workflows/release.yml/badge.svg" />
14
+ <img alt="build" src="https://github.com/paraspell/xcm-tools/actions/workflows/ci.yml/badge.svg" />
15
15
  </a>
16
16
  <a href="https://snyk.io/test/github/paraspell/sdk">
17
17
  <img alt="snyk" src="https://snyk.io/test/github/paraspell/sdk/badge.svg" />
@@ -225,7 +225,7 @@ const result = await Builder(API /*optional*/)
225
225
  .dryRun(SENDER_ADDRESS)
226
226
 
227
227
  //Function pattern
228
- getDryRun({api /*optional*/, node, address /*sender address*/, tx /* Extrinsic object */})
228
+ await getDryRun({api /*optional*/, node, address /*sender address*/, tx /* Extrinsic object */})
229
229
  ```
230
230
 
231
231
  ### Asset claim:
@@ -333,6 +333,9 @@ await getTransferableAmount({address, node, currency /*- {id: currencyID} | {sym
333
333
 
334
334
  //Get all the information about XCM transfer
335
335
  await getTransferInfo({from, to, address, destinationAddress, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: AssetMultilocationString | AssetMultilocationJson}*/, amount, api /* api/ws_url_string optional */})
336
+
337
+ //Get bridge and execution fee for transfer from Parachain to Ethereum. Returns as an object of 2 values - [bridgeFee, executionFee]
338
+ await getParaEthTransferFees(/*api - optional (Can also be WS port string or array o WS ports. Must be AssetHubPolkadot WS!)*/)
336
339
  ```
337
340
 
338
341
  ## 💻 Tests
package/dist/index.cjs CHANGED
@@ -1201,10 +1201,33 @@ var createPapiApiCall = function createPapiApiCall(apiCall) {
1201
1201
  */
1202
1202
  var send = createPapiApiCall(sdkCore.send);
1203
1203
  var getDryRun = createPapiApiCall(sdkCore.getDryRun);
1204
+ var getParaEthTransferFees = /*#__PURE__*/function () {
1205
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
1206
+ var papiApi;
1207
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1208
+ while (1) switch (_context.prev = _context.next) {
1209
+ case 0:
1210
+ papiApi = new PapiApi();
1211
+ papiApi.setApi(ahApi);
1212
+ _context.next = 4;
1213
+ return papiApi.init('AssetHubPolkadot');
1214
+ case 4:
1215
+ return _context.abrupt("return", sdkCore.getParaEthTransferFees(papiApi));
1216
+ case 5:
1217
+ case "end":
1218
+ return _context.stop();
1219
+ }
1220
+ }, _callee);
1221
+ }));
1222
+ return function getParaEthTransferFees(_x) {
1223
+ return _ref.apply(this, arguments);
1224
+ };
1225
+ }();
1204
1226
 
1205
1227
  var transfer = /*#__PURE__*/Object.freeze({
1206
1228
  __proto__: null,
1207
1229
  getDryRun: getDryRun,
1230
+ getParaEthTransferFees: getParaEthTransferFees,
1208
1231
  send: send
1209
1232
  });
1210
1233
 
@@ -1426,6 +1449,7 @@ exports.getDryRun = getDryRun;
1426
1449
  exports.getMaxForeignTransferableAmount = getMaxForeignTransferableAmount;
1427
1450
  exports.getMaxNativeTransferableAmount = getMaxNativeTransferableAmount;
1428
1451
  exports.getOriginFeeDetails = getOriginFeeDetails;
1452
+ exports.getParaEthTransferFees = getParaEthTransferFees;
1429
1453
  exports.getTransferInfo = getTransferInfo;
1430
1454
  exports.getTransferableAmount = getTransferableAmount;
1431
1455
  exports.send = send;
package/dist/index.d.ts CHANGED
@@ -24,11 +24,13 @@ declare const send: (options: _paraspell_sdk_core.TSendBaseOptions & {
24
24
  declare const getDryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<TPapiTransaction> & {
25
25
  api?: TPapiApiOrUrl;
26
26
  }) => Promise<_paraspell_sdk_core.TDryRunResult>;
27
+ declare const getParaEthTransferFees: (ahApi?: TPapiApiOrUrl) => Promise<[bigint, bigint]>;
27
28
 
28
29
  declare const transfer_getDryRun: typeof getDryRun;
30
+ declare const transfer_getParaEthTransferFees: typeof getParaEthTransferFees;
29
31
  declare const transfer_send: typeof send;
30
32
  declare namespace transfer {
31
- export { transfer_getDryRun as getDryRun, transfer_send as send };
33
+ export { transfer_getDryRun as getDryRun, transfer_getParaEthTransferFees as getParaEthTransferFees, transfer_send as send };
32
34
  }
33
35
 
34
36
  /**
@@ -185,4 +187,4 @@ type IFinalBuilderWithOptions = IFinalBuilderWithOptions$1<TPapiApi, TPapiTransa
185
187
 
186
188
  declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<polkadot_api.PolkadotClient>;
187
189
 
188
- export { Builder, EvmBuilder, GeneralBuilder, type IFinalBuilderWithOptions, type TPapiApi, type TPapiApiOrUrl, type TPapiTransaction, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getTransferInfo, getTransferableAmount, send, transfer as xcmPallet };
190
+ export { Builder, EvmBuilder, GeneralBuilder, type IFinalBuilderWithOptions, type TPapiApi, type TPapiApiOrUrl, type TPapiTransaction, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, transfer as xcmPallet };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, send as send$1, getDryRun as getDryRun$1, 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, Foreign, ForeignAbstract, Native, Override, getAllAssetsSymbols, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, transferMoonbeamEvm, Builder as Builder$1, GeneralBuilder as GeneralBuilder$1 } from '@paraspell/sdk-core';
1
+ import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, send as send$1, getDryRun as getDryRun$1, getParaEthTransferFees as getParaEthTransferFees$1, 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, Foreign, ForeignAbstract, Native, Override, getAllAssetsSymbols, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, transferMoonbeamEvm, Builder as Builder$1, GeneralBuilder as GeneralBuilder$1 } from '@paraspell/sdk-core';
2
2
  export * from '@paraspell/sdk-core';
3
3
  import { withPolkadotSdkCompat } from 'polkadot-api/polkadot-sdk-compat';
4
4
  import { FixedSizeBinary, createClient } from 'polkadot-api';
@@ -1200,10 +1200,33 @@ var createPapiApiCall = function createPapiApiCall(apiCall) {
1200
1200
  */
1201
1201
  var send = createPapiApiCall(send$1);
1202
1202
  var getDryRun = createPapiApiCall(getDryRun$1);
1203
+ var getParaEthTransferFees = /*#__PURE__*/function () {
1204
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
1205
+ var papiApi;
1206
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1207
+ while (1) switch (_context.prev = _context.next) {
1208
+ case 0:
1209
+ papiApi = new PapiApi();
1210
+ papiApi.setApi(ahApi);
1211
+ _context.next = 4;
1212
+ return papiApi.init('AssetHubPolkadot');
1213
+ case 4:
1214
+ return _context.abrupt("return", getParaEthTransferFees$1(papiApi));
1215
+ case 5:
1216
+ case "end":
1217
+ return _context.stop();
1218
+ }
1219
+ }, _callee);
1220
+ }));
1221
+ return function getParaEthTransferFees(_x) {
1222
+ return _ref.apply(this, arguments);
1223
+ };
1224
+ }();
1203
1225
 
1204
1226
  var transfer = /*#__PURE__*/Object.freeze({
1205
1227
  __proto__: null,
1206
1228
  getDryRun: getDryRun,
1229
+ getParaEthTransferFees: getParaEthTransferFees,
1207
1230
  send: send
1208
1231
  });
1209
1232
 
@@ -1412,4 +1435,4 @@ var EvmBuilder = function EvmBuilder() {
1412
1435
  return EvmBuilder$1(papiApi);
1413
1436
  };
1414
1437
 
1415
- export { Builder, EvmBuilder, GeneralBuilder, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getTransferInfo, getTransferableAmount, send, transfer as xcmPallet };
1438
+ export { Builder, EvmBuilder, GeneralBuilder, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, transfer as xcmPallet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "8.4.2",
3
+ "version": "8.5.1",
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
  "ethers": "^6.13.5",
27
27
  "viem": "^2.22.22",
28
- "@paraspell/sdk-core": "8.4.2"
28
+ "@paraspell/sdk-core": "8.5.1"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "polkadot-api": ">= 1.8.4 < 2"