@paraspell/sdk 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
@@ -16,7 +16,7 @@ type TSwapEvent = TSwapEvent$1<TPapiApi, TPapiTransaction>;
16
16
  *
17
17
  * @returns The asset balance as a bigint.
18
18
  */
19
- declare const getBalance: (options: _paraspell_sdk_core.TGetBalanceCommonOptions & {
19
+ declare const getBalance: (options: _paraspell_sdk_core.TGetBalanceCommonOptions<never> & {
20
20
  currency?: _paraspell_sdk_core.TCurrencyCore;
21
21
  } & {
22
22
  api?: _paraspell_sdk_core.TApiOrUrl<TPapiApi>;
@@ -143,15 +143,22 @@ declare const Builder: <const TOpts extends TBuilderOptions<TApiOrUrl<TPapiApi>>
143
143
  type GeneralBuilder<T extends Partial<TTransferBaseOptions<TPapiApi, TPapiTransaction, TPapiSigner>> = object, TCustomChain extends string = never> = GeneralBuilder$1<PolkadotClient, TPapiTransaction, PolkadotSigner, T, TCustomChain>;
144
144
  /** @deprecated EvmBuilder is deprecated. Please use the Builder class instead. */
145
145
  declare const EvmBuilder: (api?: TBuilderOptions<TApiOrUrl<TPapiApi>>) => EvmBuilderCore<unknown, unknown, unknown, {
146
- api: _paraspell_sdk_core.PolkadotApi<PolkadotClient, TPapiTransaction, PolkadotSigner, never>;
146
+ api: _paraspell_sdk_core.PolkadotApi<PolkadotClient, polkadot_api.Transaction<any, Record<string, {
147
+ value: any;
148
+ additionalSigned: any;
149
+ } | {
150
+ value: any;
151
+ } | {
152
+ additionalSigned: any;
153
+ }> | Partial<any>>, any, never>;
147
154
  }>;
148
155
 
149
- declare const hydrateCustomChain: (name: string, input: TCustomChainInput) => Promise<TChainAssetsInfo>;
156
+ declare const hydrateCustomChain: <TCustomChain extends string>(name: TCustomChain, input: TCustomChainInput) => Promise<TChainAssetsInfo>;
150
157
 
151
- declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<TPapiTransaction> & {
158
+ declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<TPapiTransaction, never> & {
152
159
  api?: TApiOrUrl<TPapiApi>;
153
160
  }) => Promise<_paraspell_sdk_core.TDryRunResult>;
154
- declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<TPapiTransaction> & {
161
+ declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<TPapiTransaction, never> & {
155
162
  api?: TApiOrUrl<TPapiApi>;
156
163
  }) => Promise<_paraspell_sdk_core.TDryRunChainResult>;
157
164
  declare const getParaEthTransferFees: (ahApi?: TApiOrUrl<TPapiApi>) => Promise<[bigint, bigint]>;
@@ -159,11 +166,18 @@ declare const getParaEthTransferFees: (ahApi?: TApiOrUrl<TPapiApi>) => Promise<[
159
166
  * Gets the Ethereum bridge status.
160
167
  */
161
168
  declare const getBridgeStatus: (ahApi?: TApiOrUrl<TPapiApi>) => Promise<_paraspell_sdk_core.TBridgeStatus>;
162
- declare const getOriginXcmFee: (options: _paraspell_sdk_core.TGetOriginXcmFeeBaseOptions<TPapiTransaction, boolean> & {
169
+ declare const getOriginXcmFee: (options: _paraspell_sdk_core.TGetOriginXcmFeeBaseOptions<TPapiTransaction, boolean, never> & {
163
170
  api?: TApiOrUrl<TPapiApi>;
164
171
  }) => Promise<_paraspell_sdk_core.TXcmFeeDetailWithForwardedXcm<boolean>>;
165
172
  declare const getXcmFee: <TDisableFallback extends boolean>(options: TGetXcmFeeBaseOptions<TPapiTransaction, TDisableFallback>, builderOptions?: TBuilderOptions<TApiOrUrl<TPapiApi>>) => Promise<_paraspell_sdk_core.TGetXcmFeeResult<TDisableFallback>>;
166
- declare const handleSwapExecuteTransfer: (options: TCreateBaseSwapXcmOptions, builderOptions?: TBuilderOptions<TApiOrUrl<TPapiApi>>) => Promise<TPapiTransaction>;
173
+ declare const handleSwapExecuteTransfer: (options: TCreateBaseSwapXcmOptions, builderOptions?: TBuilderOptions<TApiOrUrl<TPapiApi>>) => Promise<polkadot_api.Transaction<any, Record<string, {
174
+ value: any;
175
+ additionalSigned: any;
176
+ } | {
177
+ value: any;
178
+ } | {
179
+ additionalSigned: any;
180
+ }> | Partial<any>>>;
167
181
 
168
182
  declare const transfer_dryRun: typeof dryRun;
169
183
  declare const transfer_dryRunOrigin: typeof dryRunOrigin;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { getNativeAssetSymbol, getOtherAssets, isSenderSigner, getEvmPrivateKeyHex, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, InvalidAddressError, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, getChainProvidersImpl, PolkadotApi, Parents, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, replaceBigInt, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, RuntimeApiError, localizeLocation, isAssetXcEqual, createAssetId, addXcmVersionHeader, RELAY_LOCATION, getRelayChainOfImpl, isRelayChain, padValueBy, isAssetEqual, SubmitTransactionError, 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, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, CustomChainInvalidError, handleSwapExecuteTransfer as handleSwapExecuteTransfer$1, getBridgeStatus as getBridgeStatus$1, getParaEthTransferFees as getParaEthTransferFees$1, getXcmFee as getXcmFee$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1 } from '@paraspell/sdk-core';
1
+ import { getNativeAssetSymbol, getOtherAssets, isSenderSigner, getEvmPrivateKeyHex, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, InvalidAddressError, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, isCustomChain, getChainProvidersImpl, PolkadotApi, Parents, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, replaceBigInt, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, RuntimeApiError, localizeLocation, isAssetXcEqual, createAssetId, addXcmVersionHeader, RELAY_LOCATION, getRelayChainOfImpl, isRelayChain, padValueBy, isAssetEqual, SubmitTransactionError, 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, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, CustomChainInvalidError, handleSwapExecuteTransfer as handleSwapExecuteTransfer$1, getBridgeStatus as getBridgeStatus$1, getParaEthTransferFees as getParaEthTransferFees$1, getXcmFee as getXcmFee$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1 } from '@paraspell/sdk-core';
2
2
  export * from '@paraspell/sdk-core';
3
3
  import { secp256k1 } from '@noble/curves/secp256k1.js';
4
4
  import { keccak_256 } from '@noble/hashes/sha3.js';
@@ -693,6 +693,37 @@ var _transform = function transform(obj) {
693
693
  }
694
694
  };
695
695
 
696
+ var fetchPalletList = /*#__PURE__*/function () {
697
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(client) {
698
+ var _yield$client$getFina, hash, bytes, meta;
699
+ return _regenerator().w(function (_context) {
700
+ while (1) switch (_context.n) {
701
+ case 0:
702
+ _context.n = 1;
703
+ return client.getFinalizedBlock();
704
+ case 1:
705
+ _yield$client$getFina = _context.v;
706
+ hash = _yield$client$getFina.hash;
707
+ _context.n = 2;
708
+ return client.getMetadata(hash);
709
+ case 2:
710
+ bytes = _context.v;
711
+ meta = unifyMetadata(decAnyMetadata(bytes));
712
+ return _context.a(2, meta.pallets.map(function (p) {
713
+ return {
714
+ name: p.name,
715
+ index: p.index,
716
+ hasExtrinsics: p.calls !== undefined
717
+ };
718
+ }));
719
+ }
720
+ }, _callee);
721
+ }));
722
+ return function fetchPalletList(_x) {
723
+ return _ref.apply(this, arguments);
724
+ };
725
+ }();
726
+
696
727
  var clientPool = createClientCache(MAX_CLIENTS, /*#__PURE__*/function () {
697
728
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(client) {
698
729
  return _regenerator().w(function (_context) {
@@ -1005,35 +1036,18 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1005
1036
  }, {
1006
1037
  key: "fetchPalletList",
1007
1038
  value: function () {
1008
- var _fetchPalletList = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
1009
- var _yield$this$api$getFi2, hash, bytes, meta;
1039
+ var _fetchPalletList2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
1010
1040
  return _regenerator().w(function (_context7) {
1011
1041
  while (1) switch (_context7.n) {
1012
1042
  case 0:
1013
- _context7.n = 1;
1014
- return this.api.getFinalizedBlock();
1015
- case 1:
1016
- _yield$this$api$getFi2 = _context7.v;
1017
- hash = _yield$this$api$getFi2.hash;
1018
- _context7.n = 2;
1019
- return this.api.getMetadata(hash);
1020
- case 2:
1021
- bytes = _context7.v;
1022
- meta = unifyMetadata(decAnyMetadata(bytes));
1023
- return _context7.a(2, meta.pallets.map(function (p) {
1024
- return {
1025
- name: p.name,
1026
- index: p.index,
1027
- hasExtrinsics: p.calls !== undefined
1028
- };
1029
- }));
1043
+ return _context7.a(2, fetchPalletList(this.api));
1030
1044
  }
1031
1045
  }, _callee7, this);
1032
1046
  }));
1033
- function fetchPalletList() {
1034
- return _fetchPalletList.apply(this, arguments);
1047
+ function fetchPalletList$1() {
1048
+ return _fetchPalletList2.apply(this, arguments);
1035
1049
  }
1036
- return fetchPalletList;
1050
+ return fetchPalletList$1;
1037
1051
  }()
1038
1052
  }, {
1039
1053
  key: "getMethod",
@@ -1861,9 +1875,10 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1861
1875
  value: function disconnect() {
1862
1876
  var _this$_config$apiOver;
1863
1877
  var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1864
- if (!this._chain) return Promise.resolve();
1878
+ var chain = this._chain;
1879
+ if (!chain) return Promise.resolve();
1865
1880
  if (!force && !this.disconnectAllowed) return Promise.resolve();
1866
- 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;
1881
+ 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;
1867
1882
  // Own client provided, destroy only if force true
1868
1883
  if (force && _typeof(api) === 'object') {
1869
1884
  this.api.destroy();
@@ -1873,7 +1888,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1873
1888
  if (force) {
1874
1889
  this.api.destroy();
1875
1890
  } else {
1876
- var key = api === undefined ? getChainProvidersImpl(this._chain, this._customCtx) : api;
1891
+ var key = api === undefined ? getChainProvidersImpl(chain, this._customCtx) : api;
1877
1892
  releaseClient(key);
1878
1893
  }
1879
1894
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "13.7.1",
3
+ "version": "13.8.0",
4
4
  "description": "SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "@polkadot-labs/hdkd": "^0.0.28",
28
28
  "@polkadot-labs/hdkd-helpers": "^0.0.30",
29
29
  "viem": "^2.51.3",
30
- "@paraspell/sdk-core": "13.7.1"
30
+ "@paraspell/sdk-core": "13.8.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "polkadot-api": ">= 2 < 3"
@@ -44,11 +44,9 @@
44
44
  "@scure/bip32": "^2.2.0",
45
45
  "@scure/bip39": "^2.2.0",
46
46
  "@vitest/coverage-v8": "^4.1.7",
47
- "axios": "^1.16.1",
48
47
  "dotenv": "^17.4.2",
49
48
  "rollup": "^4.60.4",
50
- "rollup-plugin-dts": "^6.4.1",
51
- "tslib": "^2.8.1"
49
+ "rollup-plugin-dts": "^6.4.1"
52
50
  },
53
51
  "scripts": {
54
52
  "compile": "tsc --noEmit",