@paraspell/sdk-pjs 10.2.0 → 10.3.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/dist/index.d.ts CHANGED
@@ -1,18 +1,47 @@
1
1
  import * as _paraspell_sdk_core from '@paraspell/sdk-core';
2
- import { TApiOrUrl, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, TNodeDotKsmWithRelayChains, TEvmBuilderOptions, TNodeWithRelayChains, TCurrencyInputWithAmount, GeneralBuilder as GeneralBuilder$1, TSendBaseOptions } 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';
3
3
  export * from '@paraspell/sdk-core';
4
4
  import * as _polkadot_api from '@polkadot/api';
5
5
  import { ApiPromise } from '@polkadot/api';
6
6
  import { SubmittableExtrinsic } from '@polkadot/api/types';
7
- import { TEvmNodeFrom } from '@paraspell/sdk-core/src';
8
7
  import * as ethers from 'ethers';
9
8
  import { Signer, AbstractProvider } from 'ethers';
10
9
  import { WalletClient } from 'viem';
10
+ import { TEvmNodeFrom as TEvmNodeFrom$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;
14
14
  type TPjsApiOrUrl = TApiOrUrl<TPjsApi>;
15
15
  type Extrinsic = SubmittableExtrinsic<'promise'>;
16
+ type TEvmBuilderOptionsBase = {
17
+ /**
18
+ * The source node. Can be either 'Ethereum', 'Moonbeam', 'Moonriver', or 'Darwinia'.
19
+ */
20
+ from: TEvmNodeFrom;
21
+ /**
22
+ * The destination node on Polkadot network.
23
+ */
24
+ to: TNodeWithRelayChains;
25
+ /**
26
+ * The currency to transfer. Symbol or ID.
27
+ */
28
+ currency: TCurrencyInputWithAmount;
29
+ /**
30
+ * The Polkadot destination address.
31
+ */
32
+ address: string;
33
+ /**
34
+ * The AssetHub address
35
+ */
36
+ ahAddress?: string;
37
+ /**
38
+ * The Ethereum signer.
39
+ */
40
+ signer: Signer | WalletClient;
41
+ };
42
+ type TPjsEvmBuilderOptions<TApi, TRes> = WithApi<TEvmBuilderOptionsBase, TApi, TRes> & {
43
+ provider?: AbstractProvider;
44
+ };
16
45
 
17
46
  /**
18
47
  * Retrieves the native balance for a given account on a specified node.
@@ -115,11 +144,11 @@ declare const convertSs58: (address: string, node: TNodeDotKsmWithRelayChains) =
115
144
  /**
116
145
  * Builder class for constructing transfers from Ethereum to Polkadot.
117
146
  */
118
- declare class EvmBuilderCore<TApi, TRes, T extends Partial<TEvmBuilderOptions<TApi, TRes>> = object> {
147
+ declare class EvmBuilderCore<TApi, TRes, T extends Partial<TPjsEvmBuilderOptions<TApi, TRes>> = object> {
119
148
  protected readonly _options: T;
120
149
  constructor(options: T);
121
- from(node: TEvmNodeFrom): EvmBuilderCore<TApi, TRes, T & {
122
- from: TEvmNodeFrom;
150
+ from(node: TEvmNodeFrom$1): EvmBuilderCore<TApi, TRes, T & {
151
+ from: TEvmNodeFrom$1;
123
152
  }>;
124
153
  /**
125
154
  * Specifies the destination node on Polkadot.
@@ -171,7 +200,7 @@ declare class EvmBuilderCore<TApi, TRes, T extends Partial<TEvmBuilderOptions<TA
171
200
  *
172
201
  * @throws Error if any required parameters are missing.
173
202
  */
174
- build(this: EvmBuilderCore<TApi, TRes, TEvmBuilderOptions<TApi, TRes>>): Promise<string>;
203
+ build(this: EvmBuilderCore<TApi, TRes, TPjsEvmBuilderOptions<TApi, TRes>>): Promise<string>;
175
204
  }
176
205
 
177
206
  /**
@@ -213,7 +242,7 @@ declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<Extrinsic
213
242
  declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<Extrinsic> & {
214
243
  api?: TPjsApiOrUrl;
215
244
  }) => Promise<_paraspell_sdk_core.TDryRunNodeResult>;
216
- declare const transferEthToPolkadot: (options: Omit<TEvmBuilderOptions<TPjsApi, Extrinsic>, "api">) => Promise<{
245
+ declare const transferEthToPolkadot: (options: Omit<TPjsEvmBuilderOptions<TPjsApi, Extrinsic>, "api">) => Promise<{
217
246
  response: ethers.TransactionResponse;
218
247
  messageReceipt: _snowbridge_api_dist_toPolkadot_v2.MessageReceipt;
219
248
  }>;
@@ -249,4 +278,4 @@ declare namespace transfer {
249
278
  declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<_polkadot_api.ApiPromise>;
250
279
 
251
280
  export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, send, transferEthToPolkadot, transfer as xcmPallet };
252
- export type { Extrinsic, GeneralBuilder, TPjsApi, TPjsApiOrUrl };
281
+ export type { Extrinsic, GeneralBuilder, TPjsApi, TPjsApiOrUrl, TPjsEvmBuilderOptions };