@paraspell/sdk-dedot 13.7.1 → 13.8.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/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ type TDedotSigner = IKeyringPair$1;
13
13
  *
14
14
  * @returns The asset balance as a bigint.
15
15
  */
16
- declare const getBalance: (options: _paraspell_sdk_core.TGetBalanceCommonOptions & {
16
+ declare const getBalance: (options: _paraspell_sdk_core.TGetBalanceCommonOptions<never> & {
17
17
  currency?: _paraspell_sdk_core.TCurrencyCore;
18
18
  } & {
19
19
  api?: _paraspell_sdk_core.TApiOrUrl<TDedotApi>;
@@ -75,10 +75,10 @@ declare const convertSs58: (address: string, chain: TSubstrateChain) => string;
75
75
  declare const Builder: <const TOpts extends TBuilderOptions<TApiOrUrl<TDedotApi>>>(options?: TOpts) => GeneralBuilder$1<DedotClient<GenericSubstrateApi>, ChainSubmittableExtrinsic, IKeyringPair, object, TCustomChainFrom<TOpts>>;
76
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
- declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<ChainSubmittableExtrinsic> & {
78
+ declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<ChainSubmittableExtrinsic, never> & {
79
79
  api?: TApiOrUrl<TDedotApi>;
80
80
  }) => Promise<_paraspell_sdk_core.TDryRunResult>;
81
- declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<ChainSubmittableExtrinsic> & {
81
+ declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<ChainSubmittableExtrinsic, never> & {
82
82
  api?: TApiOrUrl<TDedotApi>;
83
83
  }) => Promise<_paraspell_sdk_core.TDryRunChainResult>;
84
84
  declare const getParaEthTransferFees: (api?: TApiOrUrl<TDedotApi>) => Promise<[bigint, bigint]>;
package/dist/index.mjs CHANGED
@@ -1,7 +1,8 @@
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';
1
+ import { getEvmPrivateKeyHex, getNativeAssetSymbol, getOtherAssets, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, isCustomChain, 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';
5
+ import { snakeToCamel, lowercaseFirstLetter } from '@paraspell/sdk-common';
5
6
  import { DedotClient, WsProvider } from 'dedot';
6
7
 
7
8
  function _arrayLikeToArray(r, a) {
@@ -427,15 +428,6 @@ var createKeyringPair = function createKeyringPair(path) {
427
428
  return evmPrivateKey ? keyring.createFromUri(evmPrivateKey, undefined, "ethereum") : keyring.addFromUri(path);
428
429
  };
429
430
 
430
- var lowercaseFirstLetter = function lowercaseFirstLetter(value) {
431
- return value.charAt(0).toLowerCase() + value.slice(1);
432
- };
433
- var snakeToCamel = function snakeToCamel(str) {
434
- return str.replace(/([-_][a-z])/g, function (group) {
435
- return group.toUpperCase().replace("-", "").replace("_", "");
436
- });
437
- };
438
-
439
431
  /* eslint-disable @typescript-eslint/no-explicit-any */
440
432
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
441
433
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
@@ -1730,9 +1722,10 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1730
1722
  value: function disconnect() {
1731
1723
  var _this$_config$apiOver;
1732
1724
  var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1733
- if (!this._chain) return Promise.resolve();
1725
+ var chain = this._chain;
1726
+ if (!chain) return Promise.resolve();
1734
1727
  if (!force && !this.disconnectAllowed) return Promise.resolve();
1735
- var api = isConfig(this._config) ? (_this$_config$apiOver = this._config.apiOverrides) === null || _this$_config$apiOver === void 0 ? void 0 : _this$_config$apiOver[this._chain] : this._config;
1728
+ var api = isConfig(this._config) ? isCustomChain(chain) ? undefined : (_this$_config$apiOver = this._config.apiOverrides) === null || _this$_config$apiOver === void 0 ? void 0 : _this$_config$apiOver[chain] : this._config;
1736
1729
  // Own client provided, destroy only if force true
1737
1730
  if (force && _typeof(api) === "object") {
1738
1731
  void this.api.disconnect();
@@ -1742,7 +1735,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1742
1735
  if (force) {
1743
1736
  void this.api.disconnect();
1744
1737
  } else {
1745
- var key = api === undefined ? getChainProvidersImpl(this._chain, this._customCtx) : api;
1738
+ var key = api === undefined ? getChainProvidersImpl(chain, this._customCtx) : api;
1746
1739
  releaseClient(key);
1747
1740
  }
1748
1741
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-dedot",
3
- "version": "13.7.1",
3
+ "version": "13.8.0",
4
4
  "description": "Dedot-based SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,8 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@paraspell/sdk-core": "13.7.1"
25
+ "@paraspell/sdk-core": "13.8.0",
26
+ "@paraspell/sdk-common": "13.8.0"
26
27
  },
27
28
  "peerDependencies": {
28
29
  "dedot": ">= 1.3.0",
@@ -38,8 +39,7 @@
38
39
  "@vitest/coverage-v8": "^4.1.7",
39
40
  "dotenv": "^17.4.2",
40
41
  "rollup": "^4.60.4",
41
- "rollup-plugin-dts": "^6.4.1",
42
- "tslib": "^2.8.1"
42
+ "rollup-plugin-dts": "^6.4.1"
43
43
  },
44
44
  "scripts": {
45
45
  "compile": "tsc --noEmit",