@paraspell/sdk-pjs 10.11.9 → 11.0.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
@@ -1,5 +1,5 @@
1
1
  import * as _paraspell_sdk_core from '@paraspell/sdk-core';
2
- import { TApiOrUrl, WithApi, TEvmNodeFrom, TNodeWithRelayChains, TCurrencyInputWithAmount, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, TNodeDotKsmWithRelayChains, GeneralBuilder as GeneralBuilder$1, TSendBaseOptions } from '@paraspell/sdk-core';
2
+ import { TApiOrUrl, WithApi, TEvmChainFrom, TChain, TCurrencyInputWithAmount, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, TSubstrateChain, TBuilderOptions, GeneralBuilder as GeneralBuilder$1, TSendBaseOptions } from '@paraspell/sdk-core';
3
3
  export * from '@paraspell/sdk-core';
4
4
  import * as _polkadot_api from '@polkadot/api';
5
5
  import { ApiPromise } from '@polkadot/api';
@@ -7,7 +7,7 @@ import { SubmittableExtrinsic } from '@polkadot/api/types';
7
7
  import * as ethers from 'ethers';
8
8
  import { Signer, AbstractProvider } from 'ethers';
9
9
  import { WalletClient } from 'viem';
10
- import { TEvmNodeFrom as TEvmNodeFrom$1 } from '@paraspell/sdk-core/src';
10
+ import { TEvmChainFrom as TEvmChainFrom$1 } from '@paraspell/sdk-core/src';
11
11
  import * as _snowbridge_api_dist_toPolkadot_v2 from '@snowbridge/api/dist/toPolkadot_v2';
12
12
 
13
13
  type TPjsApi = ApiPromise;
@@ -15,13 +15,13 @@ type TPjsApiOrUrl = TApiOrUrl<TPjsApi>;
15
15
  type Extrinsic = SubmittableExtrinsic<'promise'>;
16
16
  type TEvmBuilderOptionsBase = {
17
17
  /**
18
- * The source node. Can be either 'Ethereum', 'Moonbeam', 'Moonriver', or 'Darwinia'.
18
+ * The source chain. Can be either 'Ethereum', 'Moonbeam', 'Moonriver', or 'Darwinia'.
19
19
  */
20
- from: TEvmNodeFrom;
20
+ from: TEvmChainFrom;
21
21
  /**
22
- * The destination node on Polkadot network.
22
+ * The destination chain.
23
23
  */
24
- to: TNodeWithRelayChains;
24
+ to: TChain;
25
25
  /**
26
26
  * The currency to transfer. Symbol or ID.
27
27
  */
@@ -44,7 +44,7 @@ type TPjsEvmBuilderOptions<TApi, TRes> = WithApi<TEvmBuilderOptionsBase, TApi, T
44
44
  };
45
45
 
46
46
  /**
47
- * Retrieves the native balance for a given account on a specified node.
47
+ * Retrieves the native balance for a given account on a specified chain.
48
48
  *
49
49
  * @returns The native balance as a bigint.
50
50
  */
@@ -52,7 +52,7 @@ declare const getBalanceNative: (options: _paraspell_sdk_core.TGetBalanceNativeO
52
52
  api?: TPjsApiOrUrl;
53
53
  }) => Promise<bigint>;
54
54
  /**
55
- * Retrieves the balance of a foreign asset for a given account on a specified node.
55
+ * Retrieves the balance of a foreign asset for a given account on a specified chain.
56
56
  *
57
57
  * @returns The balance of the foreign asset as a bigint, or null if not found.
58
58
  */
@@ -60,7 +60,7 @@ declare const getBalanceForeign: (options: _paraspell_sdk_core.TGetBalanceForeig
60
60
  api?: TPjsApiOrUrl;
61
61
  }) => Promise<bigint>;
62
62
  /**
63
- * Retrieves the asset balance for a given account on a specified node.
63
+ * Retrieves the asset balance for a given account on a specified chain.
64
64
  *
65
65
  * @returns The asset balance as a bigint.
66
66
  */
@@ -78,7 +78,7 @@ declare const claimAssets: (options: _paraspell_sdk_core.TAssetClaimOptionsBase
78
78
  /**
79
79
  * @deprecated This function is deprecated and will be removed in a future version.
80
80
  * Please use `builder.getOriginXcmFee()` or `builder.getOriginXcmFeeEstimate()` instead,
81
- * where `builder` is an instance of `Builder()`.
81
+ * where `builder` is an instance of `Builder()`. Will be removed in v12
82
82
  * For more details, please refer to the documentation:
83
83
  * {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
84
84
  */
@@ -91,7 +91,7 @@ declare const assets_ForeignAbstract: typeof ForeignAbstract;
91
91
  declare const assets_Native: typeof Native;
92
92
  declare const assets_Override: typeof Override;
93
93
  declare const assets_claimAssets: typeof claimAssets;
94
- declare const assets_findAsset: typeof findAsset;
94
+ declare const assets_findAssetInfo: typeof findAssetInfo;
95
95
  declare const assets_getAllAssetsSymbols: typeof getAllAssetsSymbols;
96
96
  declare const assets_getAssetBalance: typeof getAssetBalance;
97
97
  declare const assets_getAssetDecimals: typeof getAssetDecimals;
@@ -107,9 +107,9 @@ declare const assets_getOriginFeeDetails: typeof getOriginFeeDetails;
107
107
  declare const assets_getOtherAssets: typeof getOtherAssets;
108
108
  declare const assets_getRelayChainSymbol: typeof getRelayChainSymbol;
109
109
  declare const assets_getSupportedAssets: typeof getSupportedAssets;
110
- declare const assets_getTNode: typeof getTNode;
110
+ declare const assets_getTChain: typeof getTChain;
111
111
  declare const assets_hasSupportForAsset: typeof hasSupportForAsset;
112
- declare const assets_isNodeEvm: typeof isNodeEvm;
112
+ declare const assets_isChainEvm: typeof isChainEvm;
113
113
  declare namespace assets {
114
114
  export {
115
115
  assets_Foreign as Foreign,
@@ -117,7 +117,7 @@ declare namespace assets {
117
117
  assets_Native as Native,
118
118
  assets_Override as Override,
119
119
  assets_claimAssets as claimAssets,
120
- assets_findAsset as findAsset,
120
+ assets_findAssetInfo as findAssetInfo,
121
121
  assets_getAllAssetsSymbols as getAllAssetsSymbols,
122
122
  assets_getAssetBalance as getAssetBalance,
123
123
  assets_getAssetDecimals as getAssetDecimals,
@@ -133,13 +133,13 @@ declare namespace assets {
133
133
  assets_getOtherAssets as getOtherAssets,
134
134
  assets_getRelayChainSymbol as getRelayChainSymbol,
135
135
  assets_getSupportedAssets as getSupportedAssets,
136
- assets_getTNode as getTNode,
136
+ assets_getTChain as getTChain,
137
137
  assets_hasSupportForAsset as hasSupportForAsset,
138
- assets_isNodeEvm as isNodeEvm,
138
+ assets_isChainEvm as isChainEvm,
139
139
  };
140
140
  }
141
141
 
142
- declare const convertSs58: (address: string, node: TNodeDotKsmWithRelayChains) => string;
142
+ declare const convertSs58: (address: string, chain: TSubstrateChain) => string;
143
143
 
144
144
  /**
145
145
  * Builder class for constructing transfers from Ethereum to Polkadot.
@@ -147,17 +147,17 @@ declare const convertSs58: (address: string, node: TNodeDotKsmWithRelayChains) =
147
147
  declare class EvmBuilderCore<TApi, TRes, T extends Partial<TPjsEvmBuilderOptions<TApi, TRes>> = object> {
148
148
  protected readonly _options: T;
149
149
  constructor(options: T);
150
- from(node: TEvmNodeFrom$1): EvmBuilderCore<TApi, TRes, T & {
151
- from: TEvmNodeFrom$1;
150
+ from(chain: TEvmChainFrom$1): EvmBuilderCore<TApi, TRes, T & {
151
+ from: TEvmChainFrom$1;
152
152
  }>;
153
153
  /**
154
- * Specifies the destination node on Polkadot.
154
+ * Specifies the destination chain on Polkadot.
155
155
  *
156
- * @param node - The Polkadot node to which the transfer will be made.
156
+ * @param chain - The Polkadot chain to which the transfer will be made.
157
157
  * @returns An instance of EvmBuilder
158
158
  */
159
- to(node: TNodeWithRelayChains): EvmBuilderCore<TApi, TRes, T & {
160
- to: TNodeWithRelayChains;
159
+ to(chain: TChain): EvmBuilderCore<TApi, TRes, T & {
160
+ to: TChain;
161
161
  }>;
162
162
  /**
163
163
  * Specifies the currency to transfer.
@@ -209,9 +209,9 @@ declare class EvmBuilderCore<TApi, TRes, T extends Partial<TPjsEvmBuilderOptions
209
209
  * @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
210
210
  * @returns A new Builder instance.
211
211
  */
212
- declare const Builder: (api?: TPjsApiOrUrl) => GeneralBuilder$1<_polkadot_api.ApiPromise, Extrinsic, object>;
212
+ declare const Builder: (api?: TBuilderOptions<TPjsApiOrUrl>) => GeneralBuilder$1<_polkadot_api.ApiPromise, Extrinsic, object>;
213
213
  type GeneralBuilder<T extends Partial<TSendBaseOptions> = object> = GeneralBuilder$1<TPjsApi, Extrinsic, T>;
214
- declare const EvmBuilder: (provider?: AbstractProvider) => EvmBuilderCore<unknown, unknown, {
214
+ declare const EvmBuilder: (provider?: AbstractProvider, api?: TBuilderOptions<TPjsApiOrUrl>) => EvmBuilderCore<unknown, unknown, {
215
215
  api: _paraspell_sdk_core.IPolkadotApi<_polkadot_api.ApiPromise, Extrinsic>;
216
216
  provider: AbstractProvider | undefined;
217
217
  }>;
@@ -241,7 +241,7 @@ declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<Extrinsic
241
241
  }) => Promise<_paraspell_sdk_core.TDryRunResult>;
242
242
  declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<Extrinsic> & {
243
243
  api?: TPjsApiOrUrl;
244
- }) => Promise<_paraspell_sdk_core.TDryRunNodeResult>;
244
+ }) => Promise<_paraspell_sdk_core.TDryRunChainResult>;
245
245
  declare const transferEthToPolkadot: (options: Omit<TPjsEvmBuilderOptions<TPjsApi, Extrinsic>, "api">) => Promise<{
246
246
  response: ethers.TransactionResponse;
247
247
  messageReceipt: _snowbridge_api_dist_toPolkadot_v2.MessageReceipt;
@@ -275,7 +275,7 @@ declare namespace transfer {
275
275
  };
276
276
  }
277
277
 
278
- declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<_polkadot_api.ApiPromise>;
278
+ declare const createChainClient: (chain: TSubstrateChain) => Promise<_polkadot_api.ApiPromise>;
279
279
 
280
- export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, send, transferEthToPolkadot, transfer as xcmPallet };
280
+ export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createChainClient, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, send, transferEthToPolkadot, transfer as xcmPallet };
281
281
  export type { Extrinsic, GeneralBuilder, TPjsApi, TPjsApiOrUrl, TPjsEvmBuilderOptions };