@paraspell/sdk-dedot 13.5.0 → 13.7.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
@@ -317,6 +317,77 @@ const tx = await builder.buildBatch({
317
317
  await builder.disconnect()
318
318
  ```
319
319
 
320
+ #### Adding chain and/or assets
321
+ SDK features ability to add custom chain and/or custom assets simply by adding its config to the Builder.
322
+
323
+ ```ts
324
+ const tx = await Builder({
325
+ // Adding custom chain
326
+ customChains: {
327
+ MyChain: {
328
+ paraId: 4242,
329
+ ecosystem: 'Polkadot',
330
+ xcmVersion: Version.V5,
331
+ providers: [{ name: 'Primary', endpoint: 'wss://rpc.mychain.example/ws' }],
332
+ // Everything below is optional — auto-fetched from runtime `system.properties` when omitted
333
+ nativeAssetSymbol: 'MYC',
334
+ nativeAssetDecimals: 12,
335
+ ss58Prefix: 42,
336
+ pallets: {
337
+ nativeAssets: "Balances”,
338
+ otherAssets: "Assets",
339
+ }
340
+ assets: [
341
+ {
342
+ symbol: 'USDC',
343
+ decimals: 6,
344
+ existentialDeposit: 0.1,
345
+ location: {
346
+ parents: 1,
347
+ interior: { X3: [{ Parachain: 1000 }, { PalletInstance: 50 }, {
348
+ GeneralIndex: 1337 }] }
349
+ },
350
+ assetId: '1337'
351
+ }
352
+ ]
353
+ }
354
+ },
355
+
356
+ // Adding assets to existing chains
357
+ customAssets: {
358
+ AssetHubPolkadot: [
359
+ {
360
+ symbol: 'MYNEWUSD',
361
+ decimals: 6,
362
+ assetId: '9999',
363
+ existentialDeposit: 0.1,
364
+ location: {
365
+ parents: 0,
366
+ interior: { X2: [{ PalletInstance: 50 }, { GeneralIndex: 9999 }] }
367
+ }
368
+ },
369
+ {
370
+ // Replace an existing registry asset that shares the same location
371
+ symbol: 'USDT',
372
+ decimals: 6,
373
+ assetId: '1984',
374
+ existentialDeposit: 0.1,
375
+ location: {
376
+ parents: 0,
377
+ interior: { X2: [{ PalletInstance: 50 }, { GeneralIndex: 1984 }] }
378
+ },
379
+ forceOverride: true
380
+ }
381
+ ]
382
+ }
383
+ })
384
+ .from('MyChain') // custom chain name — TS-autocompletes
385
+ .to('AssetHubPolkadot') // could be any of the existing or also the new ones added
386
+ .currency({ symbol: 'USDC', amount: amount })
387
+ .recipient(address)
388
+ .build()
389
+ ```
390
+
320
391
  ### Localhost test setup
321
392
 
322
393
  ```ts
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _paraspell_sdk_core from '@paraspell/sdk-core';
2
- import { Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, TSubstrateChain, TBuilderOptions, TApiOrUrl, GeneralBuilder as GeneralBuilder$1, TTransferBaseOptions } from '@paraspell/sdk-core';
2
+ import { Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, TSubstrateChain, TBuilderOptions, TApiOrUrl, GeneralBuilder as GeneralBuilder$1, TCustomChainFrom, TTransferBaseOptions } from '@paraspell/sdk-core';
3
3
  export * from '@paraspell/sdk-core';
4
4
  import { DedotClient as DedotClient$1 } from 'dedot';
5
5
  import { GenericSubstrateApi as GenericSubstrateApi$1, ChainSubmittableExtrinsic as ChainSubmittableExtrinsic$1, IKeyringPair as IKeyringPair$1 } from 'dedot/types';
@@ -67,13 +67,13 @@ declare namespace assets {
67
67
  declare const convertSs58: (address: string, chain: TSubstrateChain) => string;
68
68
 
69
69
  /**
70
- * Creates a new Builder instance using the Dedot client.
70
+ * Creates a new Builder instance.
71
71
  *
72
- * @param api - The API instance or options to use for building transactions.
72
+ * @param options - Either an existing API instance, a WS URL, or a config object.
73
73
  * @returns A new Builder instance.
74
74
  */
75
- declare const Builder: (api?: TBuilderOptions<TApiOrUrl<TDedotApi>>) => GeneralBuilder$1<DedotClient<GenericSubstrateApi>, ChainSubmittableExtrinsic, IKeyringPair, object>;
76
- type GeneralBuilder<T extends Partial<TTransferBaseOptions<TDedotApi, TDedotExtrinsic, TDedotSigner>> = object> = GeneralBuilder$1<TDedotApi, TDedotExtrinsic, TDedotSigner, T>;
75
+ declare const Builder: <const TOpts extends TBuilderOptions<TApiOrUrl<TDedotApi>>>(options?: TOpts) => GeneralBuilder$1<DedotClient<GenericSubstrateApi>, ChainSubmittableExtrinsic, IKeyringPair, object, TCustomChainFrom<TOpts>>;
76
+ type GeneralBuilder<T extends Partial<TTransferBaseOptions<TDedotApi, TDedotExtrinsic, TDedotSigner>> = object, TCustomChain extends string = never> = GeneralBuilder$1<TDedotApi, TDedotExtrinsic, TDedotSigner, T, TCustomChain>;
77
77
 
78
78
  declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<ChainSubmittableExtrinsic> & {
79
79
  api?: TApiOrUrl<TDedotApi>;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { getEvmPrivateKeyHex, getNativeAssetSymbol, getOtherAssets, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, findNativeAssetInfoOrThrow, getChainProviders, isSenderSigner, PolkadotApi, UnsupportedOperationError, findAssetInfoOrThrow, hasXcmPaymentApiSupport, resolveModuleError, getAssetsObject, RuntimeApiUnavailableError, wrapTxBypass, localizeLocation, createAssetId, addXcmVersionHeader, isAssetXcEqual, RELAY_LOCATION, getRelayChainOf, replaceBigInt, createChainClient as createChainClient$1, getBalance as getBalance$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, Builder as Builder$1, getBridgeStatus as getBridgeStatus$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
1
+ import { getEvmPrivateKeyHex, getNativeAssetSymbol, getOtherAssets, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, getChainProvidersImpl, isSenderSigner, PolkadotApi, UnsupportedOperationError, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, resolveModuleError, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, localizeLocation, createAssetId, addXcmVersionHeader, isAssetXcEqual, RELAY_LOCATION, getRelayChainOfImpl, replaceBigInt, createChainClient as createChainClient$1, getBalance as getBalance$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, Builder as Builder$1, getBridgeStatus as getBridgeStatus$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
2
2
  export * from '@paraspell/sdk-core';
3
3
  import { stringPascalCase, isEvmAddress, decodeAddress, isHex, u8aToHex, hexToU8a, stringToU8a, blake2AsHex } from 'dedot/utils';
4
4
  import { Keyring } from '@polkadot/keyring';
@@ -936,10 +936,38 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
936
936
  }, {
937
937
  key: "hasMethod",
938
938
  value: function hasMethod(pallet, method) {
939
- var _this$api$tx$palletFo;
940
939
  var palletFormatted = lowercaseFirstLetter(pallet);
941
940
  var methodFormatted = snakeToCamel(method);
942
- return Promise.resolve(((_this$api$tx$palletFo = this.api.tx[palletFormatted]) === null || _this$api$tx$palletFo === void 0 ? void 0 : _this$api$tx$palletFo[methodFormatted]) !== undefined);
941
+ try {
942
+ var _this$api$tx$palletFo;
943
+ return Promise.resolve(((_this$api$tx$palletFo = this.api.tx[palletFormatted]) === null || _this$api$tx$palletFo === void 0 ? void 0 : _this$api$tx$palletFo[methodFormatted]) !== undefined);
944
+ } catch (_unused) {
945
+ return Promise.resolve(false);
946
+ }
947
+ }
948
+ }, {
949
+ key: "hasRuntimeApi",
950
+ value: function hasRuntimeApi(runtimeApi) {
951
+ return Promise.resolve(this.api.call[lowercaseFirstLetter(runtimeApi)] !== undefined);
952
+ }
953
+ }, {
954
+ key: "fetchPalletList",
955
+ value: function fetchPalletList() {
956
+ var entries = this.api.metadata.latest.pallets.map(function (p) {
957
+ return {
958
+ name: p.name,
959
+ index: p.index,
960
+ hasExtrinsics: p.calls !== undefined
961
+ };
962
+ });
963
+ return Promise.resolve(entries);
964
+ }
965
+ }, {
966
+ key: "isEvmChain",
967
+ value: function isEvmChain() {
968
+ var _this$api$metadata$la, _path$includes;
969
+ var path = (_this$api$metadata$la = this.api.metadata.latest.types[0]) === null || _this$api$metadata$la === void 0 ? void 0 : _this$api$metadata$la.path;
970
+ return Promise.resolve((_path$includes = path === null || path === void 0 ? void 0 : path.includes("AccountId20")) !== null && _path$includes !== void 0 ? _path$includes : false);
943
971
  }
944
972
  }, {
945
973
  key: "getFromRpc",
@@ -1004,7 +1032,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1004
1032
  value: function resolveDefaultFeeAsset(_ref0) {
1005
1033
  var chain = _ref0.chain,
1006
1034
  feeAsset = _ref0.feeAsset;
1007
- return feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrow(chain);
1035
+ return feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrowImpl(chain, this._customCtx);
1008
1036
  }
1009
1037
  }, {
1010
1038
  key: "resolveFeeAsset",
@@ -1039,9 +1067,9 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1039
1067
  case 3:
1040
1068
  return _context6.a(2, {
1041
1069
  isCustomAsset: true,
1042
- asset: findAssetInfoOrThrow(chain, {
1070
+ asset: findAssetInfoOrThrowImpl(chain, {
1043
1071
  id: assetId
1044
- })
1072
+ }, undefined, this._customCtx)
1045
1073
  });
1046
1074
  }
1047
1075
  }, _callee6, this);
@@ -1059,12 +1087,12 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1059
1087
  _result,
1060
1088
  _resValue$executionRe,
1061
1089
  _execRes$actualWeight;
1062
- var tx, address, feeAsset, chain, destination, version, _options$useRootOrigi, useRootOrigin, bypassOptions, _getAssetsObject, supportsDryRunApi, basePayload, resolvedTx, resolvedFeeAsset, performDryRunCall, findFailingEventInResult, getExecutionSuccessFromResult, extractFailureReasonFromResult, result, isSuccess, failureErr, shouldRetryWithVersion, msg, _msg, resValue, execRes, forwardedXcms, actualWeight, weight, destParaId, localXcm, USE_XCM_PAYMENT_API_CHAINS, overriddenWeight, xcmFee, _yield$this$getPaymen, executionFee, fee, _t, _t2, _t3, _t4;
1090
+ var tx, address, feeAsset, chain, destination, version, _options$useRootOrigi, useRootOrigin, bypassOptions, supportsDryRunApi, basePayload, resolvedTx, resolvedFeeAsset, performDryRunCall, findFailingEventInResult, getExecutionSuccessFromResult, extractFailureReasonFromResult, result, isSuccess, failureErr, shouldRetryWithVersion, msg, _msg, resValue, execRes, forwardedXcms, actualWeight, weight, destParaId, localXcm, USE_XCM_PAYMENT_API_CHAINS, overriddenWeight, xcmFee, _yield$this$getPaymen, executionFee, fee, _t, _t2, _t3, _t4;
1063
1091
  return _regenerator().w(function (_context7) {
1064
1092
  while (1) switch (_context7.p = _context7.n) {
1065
1093
  case 0:
1066
1094
  tx = options.tx, address = options.address, feeAsset = options.feeAsset, chain = options.chain, destination = options.destination, version = options.version, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi, bypassOptions = options.bypassOptions;
1067
- _getAssetsObject = getAssetsObject(chain), supportsDryRunApi = _getAssetsObject.supportsDryRunApi;
1095
+ supportsDryRunApi = hasDryRunSupportImpl(chain, this._customCtx);
1068
1096
  if (supportsDryRunApi) {
1069
1097
  _context7.n = 1;
1070
1098
  break;
@@ -1253,7 +1281,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1253
1281
  destParaId = this.extractDestParaId(forwardedXcms);
1254
1282
  localXcm = resValue === null || resValue === void 0 ? void 0 : resValue.localXcm;
1255
1283
  USE_XCM_PAYMENT_API_CHAINS = ["Astar"];
1256
- if (!(hasXcmPaymentApiSupport(chain) && localXcm && (feeAsset || USE_XCM_PAYMENT_API_CHAINS.includes(chain) || chain.startsWith("AssetHub") && destination === "Ethereum") || resolvedFeeAsset.isCustomAsset)) {
1284
+ if (!(hasXcmPaymentApiSupportImpl(chain, this._customCtx) && localXcm && (feeAsset || USE_XCM_PAYMENT_API_CHAINS.includes(chain) || chain.startsWith("AssetHub") && destination === "Ethereum") || resolvedFeeAsset.isCustomAsset)) {
1257
1285
  _context7.n = 21;
1258
1286
  break;
1259
1287
  }
@@ -1450,7 +1478,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1450
1478
  case 6:
1451
1479
  assets = (_deliveryFeeRes = deliveryFeeRes) === null || _deliveryFeeRes === void 0 || (_deliveryFeeRes = _deliveryFeeRes.value) === null || _deliveryFeeRes === void 0 ? void 0 : _deliveryFeeRes.value;
1452
1480
  deliveryFeeResolved = deliveryFeeRes && (assets === null || assets === void 0 ? void 0 : assets.length) > 0 ? (_assets$0$fun$value = (_assets$ = assets[0]) === null || _assets$ === void 0 || (_assets$ = _assets$.fun) === null || _assets$ === void 0 ? void 0 : _assets$.value) !== null && _assets$0$fun$value !== void 0 ? _assets$0$fun$value : 0n : 0n;
1453
- nativeAsset = findNativeAssetInfoOrThrow(chain);
1481
+ nativeAsset = findNativeAssetInfoOrThrowImpl(chain, this._customCtx);
1454
1482
  if (!(isAssetXcEqual(asset, nativeAsset) || usedThirdParam)) {
1455
1483
  _context0.n = 7;
1456
1484
  break;
@@ -1500,7 +1528,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1500
1528
  return _context1.a(2, undefined);
1501
1529
  case 2:
1502
1530
  ahApi = this.clone();
1503
- assetHubChain = "AssetHub".concat(getRelayChainOf(chain));
1531
+ assetHubChain = "AssetHub".concat(getRelayChainOfImpl(this, chain));
1504
1532
  _context1.n = 3;
1505
1533
  return ahApi.init(assetHubChain);
1506
1534
  case 3:
@@ -1567,12 +1595,12 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1567
1595
  value: function () {
1568
1596
  var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(_ref10) {
1569
1597
  var _result$value5;
1570
- var originLocation, xcm, asset, chain, version, _getAssetsObject2, supportsDryRunApi, transformedOriginLocation, result, executionResult, isSuccess, actualWeight, weight, forwardedXcms, destParaId, fee;
1598
+ var originLocation, xcm, asset, chain, version, supportsDryRunApi, transformedOriginLocation, result, executionResult, isSuccess, actualWeight, weight, forwardedXcms, destParaId, fee;
1571
1599
  return _regenerator().w(function (_context11) {
1572
1600
  while (1) switch (_context11.n) {
1573
1601
  case 0:
1574
1602
  originLocation = _ref10.originLocation, xcm = _ref10.xcm, asset = _ref10.asset, chain = _ref10.chain, version = _ref10.version;
1575
- _getAssetsObject2 = getAssetsObject(chain), supportsDryRunApi = _getAssetsObject2.supportsDryRunApi;
1603
+ supportsDryRunApi = hasDryRunSupportImpl(chain, this._customCtx);
1576
1604
  if (supportsDryRunApi) {
1577
1605
  _context11.n = 1;
1578
1606
  break;
@@ -1600,7 +1628,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1600
1628
  weight = actualWeight ? actualWeight : undefined;
1601
1629
  forwardedXcms = result.value.forwardedXcms.length > 0 ? result.value.forwardedXcms[0] : [];
1602
1630
  destParaId = this.extractDestParaId(forwardedXcms);
1603
- if (!hasXcmPaymentApiSupport(chain)) {
1631
+ if (!hasXcmPaymentApiSupportImpl(chain, this._customCtx)) {
1604
1632
  _context11.n = 6;
1605
1633
  break;
1606
1634
  }
@@ -1661,6 +1689,42 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1661
1689
  }
1662
1690
  return getBridgeStatus;
1663
1691
  }()
1692
+ }, {
1693
+ key: "getConstant",
1694
+ value: function getConstant(pallet, name) {
1695
+ try {
1696
+ var palletConsts = this.api.consts[lowercaseFirstLetter(pallet)];
1697
+ var value = palletConsts ? palletConsts[lowercaseFirstLetter(name)] : undefined;
1698
+ return Promise.resolve(value);
1699
+ } catch (_unused2) {
1700
+ return Promise.resolve(undefined);
1701
+ }
1702
+ }
1703
+ }, {
1704
+ key: "getSystemProperties",
1705
+ value: function () {
1706
+ var _getSystemProperties = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
1707
+ var props;
1708
+ return _regenerator().w(function (_context13) {
1709
+ while (1) switch (_context13.n) {
1710
+ case 0:
1711
+ _context13.n = 1;
1712
+ return this.api.rpc.system_properties();
1713
+ case 1:
1714
+ props = _context13.v;
1715
+ return _context13.a(2, {
1716
+ ss58Format: typeof (props === null || props === void 0 ? void 0 : props.ss58Format) === "number" ? props.ss58Format : undefined,
1717
+ tokenSymbol: [props === null || props === void 0 ? void 0 : props.tokenSymbol].flat()[0],
1718
+ tokenDecimals: [props === null || props === void 0 ? void 0 : props.tokenDecimals].flat()[0]
1719
+ });
1720
+ }
1721
+ }, _callee13, this);
1722
+ }));
1723
+ function getSystemProperties() {
1724
+ return _getSystemProperties.apply(this, arguments);
1725
+ }
1726
+ return getSystemProperties;
1727
+ }()
1664
1728
  }, {
1665
1729
  key: "disconnect",
1666
1730
  value: function disconnect() {
@@ -1678,7 +1742,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1678
1742
  if (force) {
1679
1743
  void this.api.disconnect();
1680
1744
  } else {
1681
- var key = api === undefined ? getChainProviders(this._chain) : api;
1745
+ var key = api === undefined ? getChainProvidersImpl(this._chain, this._customCtx) : api;
1682
1746
  releaseClient(key);
1683
1747
  }
1684
1748
  }
@@ -1690,7 +1754,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1690
1754
  try {
1691
1755
  decodeAddress(address);
1692
1756
  return true;
1693
- } catch (_unused) {
1757
+ } catch (_unused3) {
1694
1758
  return false;
1695
1759
  }
1696
1760
  }
@@ -1705,18 +1769,18 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1705
1769
  }, {
1706
1770
  key: "signAndSubmit",
1707
1771
  value: function () {
1708
- var _signAndSubmit = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13(tx, sender) {
1772
+ var _signAndSubmit = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(tx, sender) {
1709
1773
  var account;
1710
- return _regenerator().w(function (_context13) {
1711
- while (1) switch (_context13.n) {
1774
+ return _regenerator().w(function (_context14) {
1775
+ while (1) switch (_context14.n) {
1712
1776
  case 0:
1713
1777
  account = isSenderSigner(sender) ? sender : createKeyringPair(sender);
1714
- _context13.n = 1;
1778
+ _context14.n = 1;
1715
1779
  return tx.signAndSend(account);
1716
1780
  case 1:
1717
- return _context13.a(2, _context13.v);
1781
+ return _context14.a(2, _context14.v);
1718
1782
  }
1719
- }, _callee13);
1783
+ }, _callee14);
1720
1784
  }));
1721
1785
  function signAndSubmit(_x25, _x26) {
1722
1786
  return _signAndSubmit.apply(this, arguments);
@@ -1726,19 +1790,19 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1726
1790
  }, {
1727
1791
  key: "signAndSubmitFinalized",
1728
1792
  value: function () {
1729
- var _signAndSubmitFinalized = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(tx, sender) {
1793
+ var _signAndSubmitFinalized = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(tx, sender) {
1730
1794
  var account, result;
1731
- return _regenerator().w(function (_context14) {
1732
- while (1) switch (_context14.n) {
1795
+ return _regenerator().w(function (_context15) {
1796
+ while (1) switch (_context15.n) {
1733
1797
  case 0:
1734
1798
  account = isSenderSigner(sender) ? sender : createKeyringPair(sender);
1735
- _context14.n = 1;
1799
+ _context15.n = 1;
1736
1800
  return tx.signAndSend(account).untilFinalized();
1737
1801
  case 1:
1738
- result = _context14.v;
1739
- return _context14.a(2, result.txHash);
1802
+ result = _context15.v;
1803
+ return _context15.a(2, result.txHash);
1740
1804
  }
1741
- }, _callee14);
1805
+ }, _callee15);
1742
1806
  }));
1743
1807
  function signAndSubmitFinalized(_x27, _x28) {
1744
1808
  return _signAndSubmitFinalized.apply(this, arguments);
@@ -1810,13 +1874,13 @@ var convertSs58 = function convertSs58(address, chain) {
1810
1874
  };
1811
1875
 
1812
1876
  /**
1813
- * Creates a new Builder instance using the Dedot client.
1877
+ * Creates a new Builder instance.
1814
1878
  *
1815
- * @param api - The API instance or options to use for building transactions.
1879
+ * @param options - Either an existing API instance, a WS URL, or a config object.
1816
1880
  * @returns A new Builder instance.
1817
1881
  */
1818
- var Builder = function Builder(api) {
1819
- var dedotApi = new DedotApi(api);
1882
+ var Builder = function Builder(options) {
1883
+ var dedotApi = new DedotApi(options);
1820
1884
  return Builder$1(dedotApi);
1821
1885
  };
1822
1886
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-dedot",
3
- "version": "13.5.0",
3
+ "version": "13.7.0",
4
4
  "description": "Dedot-based SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,22 +22,22 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@paraspell/sdk-core": "13.5.0"
25
+ "@paraspell/sdk-core": "13.7.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "dedot": ">= 1.3.0",
29
29
  "@polkadot/keyring": ">= 14"
30
30
  },
31
31
  "devDependencies": {
32
- "@babel/plugin-syntax-import-attributes": "^7.28.6",
33
- "@babel/preset-env": "^7.29.2",
32
+ "@babel/plugin-syntax-import-attributes": "^7.29.7",
33
+ "@babel/preset-env": "^7.29.7",
34
34
  "@codecov/rollup-plugin": "^2.0.1",
35
35
  "@rollup/plugin-babel": "^7.0.0",
36
36
  "@rollup/plugin-json": "^6.1.0",
37
37
  "@rollup/plugin-typescript": "^12.3.0",
38
- "@vitest/coverage-v8": "^4.1.5",
38
+ "@vitest/coverage-v8": "^4.1.7",
39
39
  "dotenv": "^17.4.2",
40
- "rollup": "^4.60.2",
40
+ "rollup": "^4.60.4",
41
41
  "rollup-plugin-dts": "^6.4.1",
42
42
  "tslib": "^2.8.1"
43
43
  },