@moonbeam-network/xcm-sdk 1.0.0-dev.17 → 1.0.0-dev.171

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2022 PureStake
1
+ Copyright 2024 Moonbeam Foundation
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/README.md CHANGED
@@ -1,22 +1,10 @@
1
- ![Moonbeam](https://docs.moonbeam.network/images/builders/interoperability/xcm/sdk/xcm-sdk-banner.png)
2
-
3
1
  The Moonbeam XCM SDK enables developers to easily transfer assets between chains, either between parachains or between a parachain and the relay chain, within the Polkadot/Kusama ecosystem. With the SDK, you don't need to worry about determining the multilocation of the origin or destination assets or which extrinsics are used on which networks to send XCM transfers.
4
2
 
5
- The XCM SDK offers helper functions, that provide a very simple interface to execute XCM transfers between chains in the Polkadot/Kusama ecosystem. In addition, the XCM config package allows any parachain project to add their information in a standard way, so they can be immediately supported by the XCM SDK.
3
+ The XCM SDK offers helper functions that provide a very simple interface to execute XCM transfers between chains in the Polkadot/Kusama ecosystem. In addition, the XCM config package allows any parachain project to add their information in a standard way, so they can be immediately supported by the XCM SDK.
6
4
 
7
5
  # Documentation
8
6
 
9
- ## v1 (current)
10
-
11
- - [readme](https://github.com/PureStake/xcm-sdk/tree/main)
12
- - [usage](https://docs.moonbeam.network/builders/interoperability/xcm/xcm-sdk/v1/xcm-sdk/)
13
- - [reference](https://docs.moonbeam.network/builders/interoperability/xcm/xcm-sdk/v1/reference/)
14
-
15
- ## v0 (previous)
16
-
17
- - [readme](https://github.com/PureStake/xcm-sdk/tree/v0)
18
- - [usage](https://docs.moonbeam.network/builders/interoperability/xcm/xcm-sdk/v0/xcm-sdk/)
19
- - [reference](https://docs.moonbeam.network/builders/interoperability/xcm/xcm-sdk/v0/reference/)
7
+ You can find the documentation at [https://moonbeam-foundation.github.io/xcm-sdk/latest/](https://moonbeam-foundation.github.io/xcm-sdk/latest/).
20
8
 
21
9
  # Installation
22
10
 
@@ -27,40 +15,30 @@ npm i @moonbeam-network/xcm-sdk
27
15
  :warning: You need to have peer dependencies of SDK installed as well.
28
16
 
29
17
  ```bash
30
- npm i @polkadot/api @polkadot/api-augment @polkadot/types @polkadot/util @polkadot/util-crypto @polkadot/apps-config ethers
18
+ npm i @polkadot/api @polkadot/util-crypto
31
19
  ```
32
20
 
33
21
  # Usage
34
22
 
35
- The following sections contain basic examples of how to work with the XCM SDK to build transfer data to transfer an asset from one chain to another and how to submit the transfer. For a detailed overview on how to use each method, including a reference to the parameters and returned data of each method exposed by the SDK, please refer to the [XCM SDK v1 docs](https://docs.moonbeam.network/builders/interoperability/xcm/xcm-sdk/v1/).
23
+ The following sections contain basic examples of how to work with the XCM SDK to build transfer data to transfer an asset from one chain to another and how to submit the transfer. For a detailed overview on how to use it, please refer to the [XCM SDK docs](https://moonbeam-foundation.github.io/xcm-sdk/latest/example-usage/xcm).
36
24
 
37
25
  ## Build XCM Transfer Data
38
26
 
39
27
  ```js
40
28
  import { Sdk } from '@moonbeam-network/xcm-sdk';
41
29
 
42
- const { assets, getTransferData } = Sdk();
43
-
44
- // You can build the XCM transfer data via the assets function
45
- const dataViaAssetsMethod = await assets()
46
- .asset('INSERT_ASSET')
47
- .source('INSERT_SOURCE_CHAIN')
48
- .destination('INSERT_DESTINATION_CHAIN')
49
- .accounts('INSERT_SOURCE_ADDRESS', 'INSERT_DESTINATION_ADDRESS', {
50
- evmSigner?: 'INSERT_EVM_SIGNER',
51
- polkadotSigner?: 'INSERT_POLKADOT_SIGNER',
52
- });
53
-
54
- // Or via the getTransferData function
55
- const dataViaGetTransferDataMethod = await getTransferData({
56
- destinationAddress: 'INSERT_DESTINATION_ADDRESS',
57
- destinationKeyOrChain: 'INSERT_DESTINATION_CHAIN',
58
- evmSigner?: 'INSERT_EVM_SIGNER',
59
- keyOrAsset: 'INSERT_ASSET',
60
- polkadotSigner?: 'INSERT_POLKADOT_SIGNER',
61
- sourceAddress: 'INSERT_SOURCE_ADDRESS',
62
- sourceKeyOrChain: 'INSERT_SOURCE_CHAIN',
63
- });
30
+ const transferData = async () => {
31
+ const transferData = await Sdk()
32
+ .setAsset(INSERT_ASSET)
33
+ .setSource(INSERT_SOURCE_CHAIN)
34
+ .setDestination(INSERT_DESTINATION_CHAIN)
35
+ .setAddresses({
36
+ sourceAddress: INSERT_SOURCE_ADDRESS,
37
+ destinationAddress: INSERT_DESTINATION_ADDRESS,
38
+ });
39
+ };
40
+
41
+ fromPolkadot();
64
42
  ```
65
43
 
66
44
  ## Transfer
@@ -68,30 +46,37 @@ const dataViaGetTransferDataMethod = await getTransferData({
68
46
  ```js
69
47
  ...
70
48
 
71
- const hash = await dataViaGetTransferDataMethod.transfer('INSERT_TRANSFER_AMOUNT');
49
+ const hash = await transferData.transfer(INSERT_TRANSFER_AMOUNT, { INSERT_SIGNERS });
72
50
  ```
73
51
 
74
52
  # Examples
75
53
 
76
- - [sdk](https://github.com/PureStake/xcm-sdk/blob/main/examples/sdk-simple)
54
+ - [sdk](https://github.com/moonbeam-foundation/xcm-sdk/blob/main/examples/sdk-simple)
77
55
 
78
56
  ```bash
79
- git clone git@github.com:PureStake/xcm-sdk.git
57
+ git clone git@github.com:moonbeam-foundation/xcm-sdk.git
80
58
  cd xcm-sdk
81
- npm i
59
+ pnpm install
82
60
  cd examples/sdk-simple
83
61
 
84
62
  # edit index.ts by adding your accounts
85
63
 
86
- npm start
64
+ pnpm run start
87
65
  ```
88
66
 
89
67
  # Contributing
90
68
 
69
+ First fork the repository and clone it.
70
+
71
+ ```bash
72
+ git clone git@github.com:YOUR_GITHUB_USERNAME/xcm-sdk.git
73
+ pnpm install
74
+ ```
75
+
76
+ Optionally, you can install the `pre-commit` hook to run the linter and tests before committing:
77
+
91
78
  ```bash
92
- git clone git@github.com:PureStake/xcm-sdk.git
93
- npm i
94
- npm run dev
79
+ pnpm lefthook install
95
80
  ```
96
81
 
97
82
  # Tests
@@ -99,14 +84,49 @@ npm run dev
99
84
  ## Unit tests
100
85
 
101
86
  ```bash
102
- npm run test
87
+ pnpm run test
103
88
  ```
104
89
 
105
90
  ## Acceptance tests
106
91
 
107
92
  ```bash
108
- cp .env.example .env
109
- # add private key and suri to .env file
93
+ pnpm run test:acc
94
+ ```
95
+
96
+ # Release
97
+
98
+ To create a dev version go to GitHub actions and run `publish dev versions` workflow.
99
+
100
+ To create a release version run:
101
+
102
+ ```bash
103
+ pnpm run changeset
104
+ ```
105
+
106
+ # Testing the change in the SDK locally
107
+
108
+ Build the project:
109
+
110
+ ```bash
111
+ pnpm run build
112
+ ```
113
+
114
+ Link the SDK:
115
+
116
+ ```bash
117
+ pnpm run clean && pnpm run build && pnpm run link
118
+ ```
119
+
120
+ In your project where you would like to test the changes:
121
+
122
+ ```bash
123
+ pnpm link @moonbeam-network/xcm-types @moonbeam-network/xcm-utils @moonbeam-network/xcm-builder @moonbeam-network/xcm-config @moonbeam-network/xcm-sdk
124
+ ```
125
+
126
+ If you need you can link other packages too.
110
127
 
111
- npm run test:acc
128
+ After testing is done, unlink the SDK:
129
+
130
+ ```bash
131
+ pnpm unlink @moonbeam-network/xcm-types @moonbeam-network/xcm-utils @moonbeam-network/xcm-builder @moonbeam-network/xcm-config @moonbeam-network/xcm-sdk
112
132
  ```
package/build/index.d.ts CHANGED
@@ -1,215 +1,195 @@
1
- import {
2
- SubstrateQueryConfig,
3
- ExtrinsicConfig,
4
- ContractConfig,
5
- } from '@moonbeam-network/xcm-builder';
6
- import {
7
- TransferConfig,
8
- FeeAssetConfig,
9
- IConfigService,
10
- } from '@moonbeam-network/xcm-config';
11
- import {
12
- AnyParachain,
13
- Asset,
14
- AssetAmount,
15
- ChainAssetId,
16
- AnyChain,
17
- Ecosystem,
18
- } from '@moonbeam-network/xcm-types';
1
+ import { ContractConfig, ExtrinsicConfig, BalanceConfigBuilder, AssetMinConfigBuilder, FeeConfigBuilder, SubstrateQueryConfig, EvmQueryConfig } from '@moonbeam-network/xcm-builder';
2
+ import { AssetRoute, FeeConfig, ConfigService } from '@moonbeam-network/xcm-config';
3
+ import * as _moonbeam_network_xcm_types from '@moonbeam-network/xcm-types';
4
+ import { AssetAmount, AnyChain, AnyParachain, ChainAsset, Asset, EvmChain, EvmParachain, Ecosystem, AnyAsset } from '@moonbeam-network/xcm-types';
5
+ import { Signer, SubmittableExtrinsic } from '@polkadot/api/types';
6
+ import { IKeyringPair, ISubmittableResult } from '@polkadot/types/types';
7
+ import { WalletClient, PublicClient, HttpTransport, Hash } from 'viem';
19
8
  import { ApiPromise } from '@polkadot/api';
20
- import { Signer } from '@polkadot/api/types';
21
- import { IKeyringPair } from '@polkadot/types/types';
22
- import { Signer as Signer$1 } from 'ethers';
23
- import { WalletClient } from 'viem';
9
+ import { RuntimeDispatchInfo } from '@polkadot/types/interfaces';
10
+ import { HexString } from '@polkadot/util/types';
24
11
 
25
- declare class PolkadotService {
26
- #private;
27
- readonly api: ApiPromise;
28
- readonly chain: AnyParachain;
29
- constructor(api: ApiPromise, chain: AnyParachain);
30
- static create(chain: AnyParachain): Promise<PolkadotService>;
31
- static createMulti(chains: AnyParachain[]): Promise<PolkadotService[]>;
32
- get decimals(): number;
33
- get asset(): Asset;
34
- get existentialDeposit(): AssetAmount;
35
- getAssetMeta(asset: ChainAssetId): Promise<
36
- | {
37
- symbol: string;
38
- decimals: number;
39
- }
40
- | undefined
41
- >;
42
- getAssetDecimals(asset: Asset): Promise<number>;
43
- query(config: SubstrateQueryConfig): Promise<bigint>;
44
- getFee(account: string, config: ExtrinsicConfig): Promise<bigint>;
45
- transfer(
46
- account: string,
47
- config: ExtrinsicConfig,
48
- signer: Signer | IKeyringPair,
49
- ): Promise<string>;
50
- }
51
-
52
- type EvmSigner = Signer$1 | WalletClient;
12
+ type EvmSigner = WalletClient;
53
13
  interface Signers {
54
- /**
55
- * @deprecated ethersSigner - is deprecated and will be removed in v2, use evmSigner instead
56
- */
57
- ethersSigner?: Signer$1;
58
- evmSigner?: EvmSigner;
59
- polkadotSigner: Signer | IKeyringPair;
14
+ evmSigner?: EvmSigner;
15
+ polkadotSigner?: Signer | IKeyringPair;
60
16
  }
61
17
  interface TransferData {
62
- destination: DestinationChainTransferData;
63
- getEstimate(amount: number | string): AssetAmount;
64
- isSwapPossible: boolean;
65
- max: AssetAmount;
66
- min: AssetAmount;
67
- source: SourceChainTransferData;
68
- swap(): Promise<TransferData | undefined>;
69
- transfer(amount: bigint | number | string): Promise<string>;
18
+ destination: DestinationChainTransferData;
19
+ getEstimate(amount: number | string): AssetAmount;
20
+ max: AssetAmount;
21
+ min: AssetAmount;
22
+ source: SourceChainTransferData;
23
+ transfer(amount: bigint | number | string, signers: Signers): Promise<string>;
70
24
  }
71
25
  interface SourceChainTransferData extends ChainTransferData {
72
- destinationFeeBalance: AssetAmount;
73
- feeBalance: AssetAmount;
74
- max: AssetAmount;
26
+ destinationFee: AssetAmount;
27
+ destinationFeeBalance: AssetAmount;
28
+ feeBalance: AssetAmount;
29
+ max: AssetAmount;
30
+ }
31
+ interface SovereignAccountBalance {
32
+ feeAssetBalance: bigint | undefined;
33
+ transferAssetBalance: bigint;
34
+ }
35
+ interface DestinationChainTransferData extends ChainTransferData {
36
+ sovereignAccountBalances?: SovereignAccountBalance;
75
37
  }
76
- interface DestinationChainTransferData extends ChainTransferData {}
77
38
  interface ChainTransferData {
78
- balance: AssetAmount;
79
- chain: AnyChain;
80
- existentialDeposit: AssetAmount;
81
- fee: AssetAmount;
82
- min: AssetAmount;
39
+ balance: AssetAmount;
40
+ chain: AnyChain;
41
+ existentialDeposit?: AssetAmount;
42
+ fee: AssetAmount;
43
+ min: AssetAmount;
83
44
  }
84
45
 
85
46
  interface GetSourceDataParams {
86
- transferConfig: TransferConfig;
87
- destinationAddress: string;
88
- destinationFee: AssetAmount;
89
- evmSigner: EvmSigner;
90
- polkadot: PolkadotService;
91
- sourceAddress: string;
92
- }
93
- declare function getSourceData({
94
- transferConfig,
95
- destinationAddress,
96
- destinationFee,
97
- evmSigner,
98
- polkadot,
99
- sourceAddress,
100
- }: GetSourceDataParams): Promise<SourceChainTransferData>;
101
- interface GetBalancesParams {
102
- address: string;
103
- balance: bigint;
104
- feeConfig: FeeAssetConfig | undefined;
105
- polkadot: PolkadotService;
106
- }
107
- declare function getFeeBalances({
108
- address,
109
- balance,
110
- feeConfig,
111
- polkadot,
112
- }: GetBalancesParams): Promise<bigint>;
47
+ route: AssetRoute;
48
+ destinationAddress: string;
49
+ destinationFee: AssetAmount;
50
+ sourceAddress: string;
51
+ }
52
+ declare function getSourceData({ route, destinationAddress, destinationFee, sourceAddress, }: GetSourceDataParams): Promise<SourceChainTransferData>;
113
53
  interface GetFeeParams {
114
- balance: bigint;
115
- contract?: ContractConfig;
116
- decimals: number;
117
- evmSigner?: EvmSigner;
118
- extrinsic?: ExtrinsicConfig;
119
- polkadot: PolkadotService;
120
- sourceAddress: string;
121
- }
122
- declare function getFee({
123
- balance,
124
- contract,
125
- decimals,
126
- evmSigner,
127
- extrinsic,
128
- polkadot,
129
- sourceAddress,
130
- }: GetFeeParams): Promise<bigint>;
131
- declare function getContractFee(
132
- balance: bigint,
133
- config: ContractConfig,
134
- decimals: number,
135
- evmSigner: EvmSigner,
136
- ): Promise<bigint>;
137
- declare function getExtrinsicFee(
138
- balance: bigint,
139
- extrinsic: ExtrinsicConfig,
140
- polkadot: PolkadotService,
141
- sourceAddress: string,
142
- ): Promise<bigint>;
54
+ balance: AssetAmount;
55
+ feeBalance: AssetAmount;
56
+ contract?: ContractConfig;
57
+ chain: AnyParachain;
58
+ destinationFee: AssetAmount;
59
+ extrinsic?: ExtrinsicConfig;
60
+ feeConfig?: FeeConfig;
61
+ sourceAddress: string;
62
+ }
63
+ declare function getFee({ balance, feeBalance, chain, contract, destinationFee, extrinsic, feeConfig, sourceAddress, }: GetFeeParams): Promise<AssetAmount>;
64
+ interface GetAssetsBalancesParams {
65
+ address: string;
66
+ chain: AnyParachain;
67
+ routes: AssetRoute[];
68
+ evmSigner?: EvmSigner;
69
+ }
70
+ declare function getAssetsBalances({ address, chain, routes, }: GetAssetsBalancesParams): Promise<AssetAmount[]>;
71
+
72
+ interface GetDestinationDataParams {
73
+ route: AssetRoute;
74
+ destinationAddress: string;
75
+ }
76
+ declare function getDestinationData({ route, destinationAddress, }: GetDestinationDataParams): Promise<DestinationChainTransferData>;
77
+
78
+ interface GetBalancesParams {
79
+ address: string;
80
+ asset: ChainAsset;
81
+ builder: BalanceConfigBuilder;
82
+ chain: AnyChain;
83
+ }
84
+ declare function getBalance({ address, asset, builder, chain, }: GetBalancesParams): Promise<AssetAmount>;
85
+ interface GetMinParams {
86
+ asset: Asset;
87
+ builder?: AssetMinConfigBuilder;
88
+ chain: AnyChain;
89
+ }
90
+ declare function getAssetMin({ asset, builder, chain, }: GetMinParams): Promise<AssetAmount>;
91
+ declare function getMin({ balance, existentialDeposit, fee, min, }: DestinationChainTransferData): AssetAmount;
143
92
  interface GetMaxParams {
144
- balanceAmount: AssetAmount;
145
- existentialDeposit: AssetAmount;
146
- feeAmount: AssetAmount;
147
- minAmount: AssetAmount;
148
- }
149
- declare function getMax({
150
- balanceAmount,
151
- existentialDeposit,
152
- feeAmount,
153
- minAmount,
154
- }: GetMaxParams): AssetAmount;
93
+ balance: AssetAmount;
94
+ existentialDeposit?: AssetAmount;
95
+ fee: AssetAmount;
96
+ min: AssetAmount;
97
+ }
98
+ declare function getMax({ balance, existentialDeposit, fee, min, }: GetMaxParams): AssetAmount;
99
+ interface GetDestinationFeeParams {
100
+ address: string;
101
+ asset: Asset;
102
+ feeAsset: Asset;
103
+ destination: AnyChain;
104
+ fee: number | FeeConfigBuilder;
105
+ }
106
+ declare function getDestinationFee({ address, asset, destination, fee, feeAsset, }: GetDestinationFeeParams): Promise<AssetAmount>;
107
+ interface ConvertToChainDecimalsParams {
108
+ asset: AssetAmount;
109
+ target: ChainAsset;
110
+ }
111
+ declare function convertToChainDecimals({ asset, target, }: ConvertToChainDecimalsParams): AssetAmount;
112
+ declare function getExistentialDeposit(chain: AnyChain): Promise<AssetAmount | undefined>;
113
+ interface GetDestinationFeeBalanceParams {
114
+ balance: AssetAmount;
115
+ feeBalance: AssetAmount;
116
+ route: AssetRoute;
117
+ sourceAddress: string;
118
+ }
119
+ declare function getDestinationFeeBalance({ balance, feeBalance, route, sourceAddress, }: GetDestinationFeeBalanceParams): Promise<AssetAmount>;
120
+ interface GetExtrinsicFeeParams {
121
+ address: string;
122
+ balance: AssetAmount;
123
+ chain: AnyParachain;
124
+ extrinsic: ExtrinsicConfig;
125
+ feeBalance: AssetAmount;
126
+ feeConfig?: FeeConfig;
127
+ }
128
+ declare function getExtrinsicFee({ address, balance, chain, extrinsic, feeBalance, feeConfig, }: GetExtrinsicFeeParams): Promise<AssetAmount>;
129
+ interface GetContractFeeParams {
130
+ address: string;
131
+ balance: AssetAmount;
132
+ chain: EvmChain | EvmParachain;
133
+ contract: ContractConfig;
134
+ destinationFee: AssetAmount;
135
+ feeBalance: AssetAmount;
136
+ feeConfig?: FeeConfig;
137
+ }
138
+ declare function getContractFee({ address, balance, chain, contract, destinationFee, feeBalance, feeConfig, }: GetContractFeeParams): Promise<AssetAmount>;
139
+ interface ValidateSovereignAccountBalancesProps {
140
+ amount: bigint;
141
+ destinationData: DestinationChainTransferData;
142
+ sourceData: SourceChainTransferData;
143
+ }
144
+ declare function validateSovereignAccountBalances({ amount, sourceData, destinationData, }: ValidateSovereignAccountBalancesProps): void;
155
145
 
156
- interface SdkOptions extends Partial<Signers> {
157
- configService?: IConfigService;
158
- }
159
- declare function Sdk(options?: SdkOptions): {
160
- assets(ecosystem?: Ecosystem): {
161
- assets: Asset[];
162
- asset(keyOrAsset: string | Asset): {
163
- sourceChains: AnyChain[];
164
- source(keyOrChain: string | AnyChain): {
165
- destinationChains: AnyChain[];
166
- destination(destKeyOrChain: string | AnyChain): {
167
- accounts(
168
- sourceAddress: string,
169
- destinationAddress: string,
170
- signers?: Partial<Signers>,
171
- ): Promise<TransferData>;
146
+ interface SdkOptions {
147
+ configService?: ConfigService;
148
+ ecosystem?: Ecosystem;
149
+ }
150
+ declare function Sdk({ configService, ecosystem }?: SdkOptions): {
151
+ assets: _moonbeam_network_xcm_types.Asset[];
152
+ setAsset(asset: string | AnyAsset): {
153
+ sources: AnyChain[];
154
+ setSource(source: string | AnyChain): {
155
+ destinations: AnyChain[];
156
+ setDestination(destination: string | AnyChain): {
157
+ setAddresses({ sourceAddress, destinationAddress, }: {
158
+ sourceAddress: string;
159
+ destinationAddress: string;
160
+ }): Promise<TransferData>;
161
+ };
172
162
  };
173
- };
174
163
  };
175
- };
176
- getTransferData({
177
- destinationAddress,
178
- destinationKeyOrChain,
179
- ethersSigner,
180
- evmSigner,
181
- keyOrAsset,
182
- polkadotSigner,
183
- sourceAddress,
184
- sourceKeyOrChain,
185
- }: SdkTransferParams): Promise<TransferData>;
186
164
  };
187
- interface SdkTransferParams extends Partial<Signers> {
188
- destinationAddress: string;
189
- destinationKeyOrChain: string | AnyChain;
190
- keyOrAsset: string | Asset;
191
- sourceAddress: string;
192
- sourceKeyOrChain: string | AnyChain;
165
+ declare function getParachainBalances(chain: AnyParachain, address: string, service?: ConfigService): Promise<AssetAmount[]>;
166
+
167
+ declare class PolkadotService {
168
+ #private;
169
+ readonly api: ApiPromise;
170
+ readonly chain: AnyParachain;
171
+ constructor(api: ApiPromise, chain: AnyParachain);
172
+ static create(chain: AnyParachain): Promise<PolkadotService>;
173
+ static createMulti(chains: AnyParachain[]): Promise<PolkadotService[]>;
174
+ get decimals(): number;
175
+ get existentialDeposit(): AssetAmount;
176
+ query(config: SubstrateQueryConfig): Promise<bigint>;
177
+ getExtrinsic(config: ExtrinsicConfig): SubmittableExtrinsic<'promise', ISubmittableResult>;
178
+ getExtrinsicCallHash(config: ExtrinsicConfig): HexString;
179
+ getPaymentInfo(account: string, config: ExtrinsicConfig): Promise<RuntimeDispatchInfo>;
180
+ getFee(account: string, config: ExtrinsicConfig): Promise<bigint>;
181
+ transfer(account: string, config: ExtrinsicConfig, signer: Signer | IKeyringPair, statusCallback?: (params: ISubmittableResult) => void): Promise<string>;
193
182
  }
194
183
 
195
- export {
196
- ChainTransferData,
197
- DestinationChainTransferData,
198
- EvmSigner,
199
- GetBalancesParams,
200
- GetFeeParams,
201
- GetMaxParams,
202
- GetSourceDataParams,
203
- Sdk,
204
- SdkOptions,
205
- SdkTransferParams,
206
- Signers,
207
- SourceChainTransferData,
208
- TransferData,
209
- getContractFee,
210
- getExtrinsicFee,
211
- getFee,
212
- getFeeBalances,
213
- getMax,
214
- getSourceData,
215
- };
184
+ declare class EvmService {
185
+ readonly chain: EvmChain | EvmParachain;
186
+ readonly client: PublicClient<HttpTransport>;
187
+ static create(chain: EvmChain | EvmParachain): EvmService;
188
+ constructor(chain: EvmChain | EvmParachain);
189
+ query(query: EvmQueryConfig): Promise<bigint>;
190
+ getFee(address: string, contract: ContractConfig): Promise<bigint>;
191
+ getBalance(address: string, contract: ContractConfig): Promise<bigint>;
192
+ transfer(signer: EvmSigner, contract: ContractConfig): Promise<Hash>;
193
+ }
194
+
195
+ export { type ChainTransferData, type ConvertToChainDecimalsParams, type DestinationChainTransferData, EvmService, type EvmSigner, type GetAssetsBalancesParams, type GetBalancesParams, type GetContractFeeParams, type GetDestinationDataParams, type GetDestinationFeeBalanceParams, type GetDestinationFeeParams, type GetExtrinsicFeeParams, type GetFeeParams, type GetMaxParams, type GetMinParams, type GetSourceDataParams, PolkadotService, Sdk, type SdkOptions, type Signers, type SourceChainTransferData, type SovereignAccountBalance, type TransferData, convertToChainDecimals, getAssetMin, getAssetsBalances, getBalance, getContractFee, getDestinationData, getDestinationFee, getDestinationFeeBalance, getExistentialDeposit, getExtrinsicFee, getFee, getMax, getMin, getParachainBalances, getSourceData, validateSovereignAccountBalances };