@moonbeam-network/xcm-builder 1.0.0-dev.2 → 1.0.0-dev.200

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/build/index.d.ts CHANGED
@@ -1,277 +1,647 @@
1
- import { ChainAssetId, AnyChain } from '@moonbeam-network/xcm-types';
2
- import { SetOptional } from 'type-fest';
3
- import { Struct, u128 } from '@polkadot/types';
4
- import { SubmittableExtrinsicFunction } from '@polkadot/api/types';
1
+ import { Chain, AnyParachain, AssetAmount, ChainAssetId, ChainAsset, AnyChain, EvmParachain } from '@moonbeam-network/xcm-types';
5
2
  import { ApiPromise } from '@polkadot/api';
3
+ import { FrameSystemAccountInfo, StagingXcmV3MultiLocation } from '@polkadot/types/lookup';
4
+ import { Struct, u128, Enum } from '@polkadot/types';
5
+ import { Abi, PublicClient, HttpTransport } from 'viem';
6
+ import { SubmittableExtrinsicFunction } from '@polkadot/api/types';
7
+ import { HexString } from '@polkadot/util/types';
8
+ import { Wormhole, Network } from '@wormhole-foundation/sdk-connect';
6
9
 
7
- declare enum CallType {
8
- Evm = 'Evm',
9
- Substrate = 'Substrate',
10
+ interface ConfigBuilder<Config, Params = BuilderParams> {
11
+ build: (params: Params) => Config;
12
+ }
13
+ interface BuilderParams<IChain extends Chain = AnyParachain> {
14
+ asset: AssetAmount;
15
+ destination: IChain;
16
+ destinationAddress: string;
17
+ destinationApi?: ApiPromise;
18
+ fee: AssetAmount;
19
+ source: IChain;
20
+ sourceAddress: string;
21
+ sourceApi?: ApiPromise;
10
22
  }
11
23
 
12
24
  interface BaseConfigConstructorParams {
13
- module: string;
14
- func: string;
15
- type: CallType;
25
+ module: string;
26
+ func: string;
16
27
  }
17
28
  declare class BaseConfig {
18
- readonly module: string;
19
- readonly func: string;
20
- readonly type: CallType;
21
- constructor({ module, func, type }: BaseConfigConstructorParams);
29
+ readonly module: string;
30
+ readonly func: string;
31
+ constructor({ module, func }: BaseConfigConstructorParams);
22
32
  }
23
33
 
24
- interface QueryConfigConstructorParams
25
- extends SetOptional<BaseConfigConstructorParams, 'type'> {
26
- args?: any[];
27
- transform: (data: any) => Promise<bigint>;
34
+ interface QueryConfigConstructorParams extends BaseConfigConstructorParams {
35
+ args?: unknown[];
36
+ transform: (data: any) => Promise<bigint>;
28
37
  }
29
38
  declare class SubstrateQueryConfig extends BaseConfig {
30
- readonly args: any[];
31
- readonly transform: (data: any) => Promise<bigint>;
32
- constructor({
33
- args,
34
- transform,
35
- type,
36
- ...other
37
- }: QueryConfigConstructorParams);
39
+ readonly args: unknown[];
40
+ readonly transform: (data: unknown) => Promise<bigint>;
41
+ static is(obj: unknown): obj is SubstrateQueryConfig;
42
+ constructor({ args, transform, ...other }: QueryConfigConstructorParams);
38
43
  }
39
44
 
40
- interface AssetMinConfigBuilder {
41
- build: (params: AssetMinConfigBuilderPrams) => SubstrateQueryConfig;
42
- }
43
- interface AssetMinConfigBuilderPrams {
44
- asset: ChainAssetId;
45
+ type AssetMinConfigBuilder = ConfigBuilder<SubstrateQueryConfig, AssetMinConfigBuilderParams>;
46
+ interface AssetMinConfigBuilderParams {
47
+ address?: string;
48
+ asset: ChainAssetId;
45
49
  }
46
50
 
47
51
  declare function AssetMinBuilder(): {
48
- assetRegistry: typeof assetRegistry;
49
- assets: typeof assets$1;
52
+ assetRegistry: typeof assetRegistry;
53
+ assets: typeof assets$1;
54
+ foreignAssets: typeof foreignAssets$1;
50
55
  };
51
56
  declare function assetRegistry(): {
52
- assetMetadatas: () => AssetMinConfigBuilder;
53
- currencyMetadatas: () => AssetMinConfigBuilder;
57
+ assetMetadatas: () => AssetMinConfigBuilder;
58
+ currencyMetadatas: () => AssetMinConfigBuilder;
59
+ metadata: () => AssetMinConfigBuilder;
54
60
  };
55
61
  declare function assets$1(): {
56
- asset: () => AssetMinConfigBuilder;
62
+ asset: () => AssetMinConfigBuilder;
63
+ };
64
+ declare function foreignAssets$1(): {
65
+ asset: () => AssetMinConfigBuilder;
57
66
  };
58
67
 
59
- interface ContractConfigConstructorParams
60
- extends Omit<BaseConfigConstructorParams, 'type'> {
61
- args: any[];
62
- address?: string;
68
+ interface ContractConfigConstructorParams extends BaseConfigConstructorParams {
69
+ address: string;
70
+ abi: Abi;
71
+ args: any[];
63
72
  }
64
73
  declare class ContractConfig extends BaseConfig {
65
- readonly args: any[];
66
- readonly address?: string;
67
- constructor({ args, address, ...other }: ContractConfigConstructorParams);
74
+ readonly address: string;
75
+ readonly abi: Abi;
76
+ readonly args: any[];
77
+ static is(obj: unknown): obj is ContractConfig;
78
+ constructor({ address, abi, args, ...other }: ContractConfigConstructorParams);
79
+ encodeFunctionData(): `0x${string}`;
68
80
  }
69
81
 
70
- interface ContractConfigBuilder {
71
- build: (params: ContractConfigBuilderPrams) => ContractConfig;
72
- }
73
- interface ContractConfigBuilderPrams {
74
- address: string;
75
- amount: bigint;
76
- asset: ChainAssetId;
77
- destination: AnyChain;
78
- fee: bigint;
79
- feeAsset: ChainAssetId;
80
- }
82
+ type ContractConfigBuilder = ConfigBuilder<ContractConfig>;
83
+
84
+ declare function XcmPrecompile(): {
85
+ transferAssetsToPara20: (shouldTransferAssetPrecedeFeeAsset?: boolean) => ContractConfigBuilder;
86
+ transferAssetsToPara32: (shouldTransferAssetPrecedeFeeAsset?: boolean) => ContractConfigBuilder;
87
+ transferAssetsToRelay: () => ContractConfigBuilder;
88
+ };
81
89
 
82
90
  declare function Xtokens(): {
83
- transfer: (weight?: number) => ContractConfigBuilder;
84
- transferMultiCurrencies: (weight?: number) => ContractConfigBuilder;
91
+ transfer: (weight?: bigint) => ContractConfigBuilder;
92
+ transferMultiCurrencies: (shouldTransferAssetPrecedeFeeAsset?: boolean, weight?: bigint) => ContractConfigBuilder;
93
+ transferWithEvmTo32: (weight?: bigint) => ContractConfigBuilder;
85
94
  };
86
95
 
87
96
  declare function ContractBuilder(): {
88
- Xtokens: typeof Xtokens;
97
+ Xtokens: typeof Xtokens;
98
+ XcmPrecompile: typeof XcmPrecompile;
89
99
  };
90
100
 
91
- interface BalanceConfigBuilder {
92
- build: (
93
- params: BalanceConfigBuilderPrams,
94
- ) => SubstrateQueryConfig | ContractConfig;
101
+ type EvmQueryFunctions = 'getBalance';
102
+ type EvmFunctionArgs = Parameters<PublicClient<HttpTransport>[EvmQueryFunctions]>;
103
+ interface EvmQueryConfigParams {
104
+ readonly args: EvmFunctionArgs;
105
+ readonly func: EvmQueryFunctions;
95
106
  }
96
- interface BalanceConfigBuilderPrams {
97
- address: string;
98
- asset: ChainAssetId;
107
+ declare class EvmQueryConfig {
108
+ readonly args: EvmFunctionArgs;
109
+ readonly func: EvmQueryFunctions;
110
+ static is(obj: unknown): obj is EvmQueryConfig;
111
+ constructor({ args, func }: EvmQueryConfigParams);
112
+ }
113
+
114
+ type BalanceConfigBuilder = ConfigBuilder<ContractConfig | SubstrateQueryConfig | EvmQueryConfig, BalanceBuilderParams>;
115
+ interface BalanceBuilderParams {
116
+ address: string;
117
+ asset: ChainAsset;
99
118
  }
100
119
  interface PalletBalancesAccountDataOld extends Struct {
101
- readonly free: u128;
102
- readonly reserved: u128;
103
- readonly miscFrozen: u128;
104
- readonly feeFrozen: u128;
120
+ readonly free: u128;
121
+ readonly reserved: u128;
122
+ readonly miscFrozen: u128;
123
+ readonly feeFrozen: u128;
105
124
  }
106
125
  interface TokensPalletAccountData {
107
- free: u128;
108
- reserved: u128;
109
- frozen: u128;
126
+ free: u128;
127
+ reserved: u128;
128
+ frozen: u128;
110
129
  }
111
- type EquilibriumSystemBalanceData = Array<
112
- [
130
+ type EquilibriumSystemBalanceData = Array<[
113
131
  number,
114
132
  {
115
- positive: number;
116
- },
117
- ]
118
- >;
133
+ positive: number;
134
+ }
135
+ ]>;
119
136
 
120
137
  declare function BalanceBuilder(): {
121
- evm: typeof evm;
122
- substrate: typeof substrate;
138
+ evm: typeof evm;
139
+ substrate: typeof substrate;
123
140
  };
124
141
  declare function evm(): {
125
- erc20: typeof erc20;
142
+ erc20: typeof erc20;
143
+ native: typeof native;
126
144
  };
145
+ declare function erc20(): BalanceConfigBuilder;
146
+ declare function native(): BalanceConfigBuilder;
127
147
  declare function substrate(): {
128
- assets: typeof assets;
129
- system: typeof system;
130
- tokens: typeof tokens;
148
+ assets: typeof assets;
149
+ foreignAssets: typeof foreignAssets;
150
+ system: typeof system;
151
+ tokens: typeof tokens;
131
152
  };
132
- declare function erc20(): BalanceConfigBuilder;
133
153
  declare function assets(): {
134
- account: () => BalanceConfigBuilder;
154
+ account: () => BalanceConfigBuilder;
155
+ };
156
+ declare function foreignAssets(): {
157
+ account: () => BalanceConfigBuilder;
135
158
  };
136
159
  declare function system(): {
137
- account: () => BalanceConfigBuilder;
138
- accountEquilibrium: () => BalanceConfigBuilder;
160
+ account: () => BalanceConfigBuilder;
161
+ accountEquilibrium: () => BalanceConfigBuilder;
162
+ accountEvmTo32: () => BalanceConfigBuilder;
139
163
  };
140
164
  declare function tokens(): {
141
- accounts: () => BalanceConfigBuilder;
165
+ accounts: () => BalanceConfigBuilder;
142
166
  };
167
+ declare function calculateSystemAccountBalance(response: FrameSystemAccountInfo): Promise<bigint>;
143
168
 
144
- interface ExtrinsicConfigConstructorParams
145
- extends Omit<BaseConfigConstructorParams, 'type'> {
146
- getArgs: (func?: SubmittableExtrinsicFunction<'promise'>) => any[];
169
+ declare const ERC20_ABI: readonly [{
170
+ readonly constant: true;
171
+ readonly inputs: readonly [];
172
+ readonly name: "name";
173
+ readonly outputs: readonly [{
174
+ readonly name: "";
175
+ readonly type: "string";
176
+ }];
177
+ readonly payable: false;
178
+ readonly stateMutability: "view";
179
+ readonly type: "function";
180
+ }, {
181
+ readonly constant: false;
182
+ readonly inputs: readonly [{
183
+ readonly name: "_spender";
184
+ readonly type: "address";
185
+ }, {
186
+ readonly name: "_value";
187
+ readonly type: "uint256";
188
+ }];
189
+ readonly name: "approve";
190
+ readonly outputs: readonly [{
191
+ readonly name: "";
192
+ readonly type: "bool";
193
+ }];
194
+ readonly payable: false;
195
+ readonly stateMutability: "nonpayable";
196
+ readonly type: "function";
197
+ }, {
198
+ readonly constant: true;
199
+ readonly inputs: readonly [];
200
+ readonly name: "totalSupply";
201
+ readonly outputs: readonly [{
202
+ readonly name: "";
203
+ readonly type: "uint256";
204
+ }];
205
+ readonly payable: false;
206
+ readonly stateMutability: "view";
207
+ readonly type: "function";
208
+ }, {
209
+ readonly constant: false;
210
+ readonly inputs: readonly [{
211
+ readonly name: "_from";
212
+ readonly type: "address";
213
+ }, {
214
+ readonly name: "_to";
215
+ readonly type: "address";
216
+ }, {
217
+ readonly name: "_value";
218
+ readonly type: "uint256";
219
+ }];
220
+ readonly name: "transferFrom";
221
+ readonly outputs: readonly [{
222
+ readonly name: "";
223
+ readonly type: "bool";
224
+ }];
225
+ readonly payable: false;
226
+ readonly stateMutability: "nonpayable";
227
+ readonly type: "function";
228
+ }, {
229
+ readonly constant: true;
230
+ readonly inputs: readonly [];
231
+ readonly name: "decimals";
232
+ readonly outputs: readonly [{
233
+ readonly name: "";
234
+ readonly type: "uint8";
235
+ }];
236
+ readonly payable: false;
237
+ readonly stateMutability: "view";
238
+ readonly type: "function";
239
+ }, {
240
+ readonly constant: true;
241
+ readonly inputs: readonly [{
242
+ readonly name: "_owner";
243
+ readonly type: "address";
244
+ }];
245
+ readonly name: "balanceOf";
246
+ readonly outputs: readonly [{
247
+ readonly name: "balance";
248
+ readonly type: "uint256";
249
+ }];
250
+ readonly payable: false;
251
+ readonly stateMutability: "view";
252
+ readonly type: "function";
253
+ }, {
254
+ readonly constant: true;
255
+ readonly inputs: readonly [];
256
+ readonly name: "symbol";
257
+ readonly outputs: readonly [{
258
+ readonly name: "";
259
+ readonly type: "string";
260
+ }];
261
+ readonly payable: false;
262
+ readonly stateMutability: "view";
263
+ readonly type: "function";
264
+ }, {
265
+ readonly constant: false;
266
+ readonly inputs: readonly [{
267
+ readonly name: "_to";
268
+ readonly type: "address";
269
+ }, {
270
+ readonly name: "_value";
271
+ readonly type: "uint256";
272
+ }];
273
+ readonly name: "transfer";
274
+ readonly outputs: readonly [{
275
+ readonly name: "";
276
+ readonly type: "bool";
277
+ }];
278
+ readonly payable: false;
279
+ readonly stateMutability: "nonpayable";
280
+ readonly type: "function";
281
+ }, {
282
+ readonly constant: true;
283
+ readonly inputs: readonly [{
284
+ readonly name: "_owner";
285
+ readonly type: "address";
286
+ }, {
287
+ readonly name: "_spender";
288
+ readonly type: "address";
289
+ }];
290
+ readonly name: "allowance";
291
+ readonly outputs: readonly [{
292
+ readonly name: "";
293
+ readonly type: "uint256";
294
+ }];
295
+ readonly payable: false;
296
+ readonly stateMutability: "view";
297
+ readonly type: "function";
298
+ }, {
299
+ readonly payable: true;
300
+ readonly stateMutability: "payable";
301
+ readonly type: "fallback";
302
+ }, {
303
+ readonly anonymous: false;
304
+ readonly inputs: readonly [{
305
+ readonly indexed: true;
306
+ readonly name: "owner";
307
+ readonly type: "address";
308
+ }, {
309
+ readonly indexed: true;
310
+ readonly name: "spender";
311
+ readonly type: "address";
312
+ }, {
313
+ readonly indexed: false;
314
+ readonly name: "value";
315
+ readonly type: "uint256";
316
+ }];
317
+ readonly name: "Approval";
318
+ readonly type: "event";
319
+ }, {
320
+ readonly anonymous: false;
321
+ readonly inputs: readonly [{
322
+ readonly indexed: true;
323
+ readonly name: "from";
324
+ readonly type: "address";
325
+ }, {
326
+ readonly indexed: true;
327
+ readonly name: "to";
328
+ readonly type: "address";
329
+ }, {
330
+ readonly indexed: false;
331
+ readonly name: "value";
332
+ readonly type: "uint256";
333
+ }];
334
+ readonly name: "Transfer";
335
+ readonly type: "event";
336
+ }];
337
+
338
+ interface ExtrinsicConfigConstructorParams extends Omit<BaseConfigConstructorParams, 'type'> {
339
+ getArgs: (func?: SubmittableExtrinsicFunction<'promise'>) => any[];
147
340
  }
148
341
  declare class ExtrinsicConfig extends BaseConfig {
149
- getArgs: (func?: SubmittableExtrinsicFunction<'promise'>) => any[];
150
- constructor({ getArgs, ...other }: ExtrinsicConfigConstructorParams);
342
+ getArgs: (func?: SubmittableExtrinsicFunction<'promise'>) => any[];
343
+ static is(obj: unknown): obj is ExtrinsicConfig;
344
+ constructor({ getArgs, ...other }: ExtrinsicConfigConstructorParams);
151
345
  }
152
346
 
153
- interface ExtrinsicConfigBuilder {
154
- build: (params: ExtrinsicConfigBuilderPrams) => ExtrinsicConfig;
155
- }
156
- interface ExtrinsicConfigBuilderPrams {
157
- address: string;
158
- amount: bigint;
159
- asset: ChainAssetId;
160
- destination: AnyChain;
161
- fee: bigint;
162
- feeAsset: ChainAssetId;
163
- palletInstance?: number;
164
- source: AnyChain;
165
- }
347
+ type ExtrinsicConfigBuilder = ConfigBuilder<ExtrinsicConfig>;
166
348
  declare enum XcmVersion {
167
- v1 = 'V1',
168
- v2 = 'V2',
169
- v3 = 'V3',
349
+ v1 = "V1",
350
+ v2 = "V2",
351
+ v3 = "V3",
352
+ v4 = "V4",
353
+ v5 = "V5"
170
354
  }
171
355
  type Parents = 0 | 1;
172
356
 
173
357
  declare function eqBalances(): {
174
- xcmTransfer: () => ExtrinsicConfigBuilder;
175
- transferXcm: () => ExtrinsicConfigBuilder;
358
+ xcmTransfer: () => ExtrinsicConfigBuilder;
359
+ transferXcm: () => ExtrinsicConfigBuilder;
176
360
  };
177
361
 
178
- declare function polkadotXcm(): {
179
- limitedReserveTransferAssets: () => {
180
- here: () => ExtrinsicConfigBuilder;
181
- X1: () => ExtrinsicConfigBuilder;
182
- X2: () => ExtrinsicConfigBuilder;
183
- };
184
- limitedReserveWithdrawAssets: () => {
185
- X2: () => ExtrinsicConfigBuilder;
186
- };
362
+ declare function polkadotXcm$1(): {
363
+ limitedReserveTransferAssets: () => {
364
+ here: () => ExtrinsicConfigBuilder;
365
+ X1: () => ExtrinsicConfigBuilder;
366
+ X2: () => ExtrinsicConfigBuilder;
367
+ };
368
+ limitedReserveWithdrawAssets: () => {
369
+ X2: () => ExtrinsicConfigBuilder;
370
+ };
371
+ transferAssets: () => {
372
+ here: (parents?: number) => ExtrinsicConfigBuilder;
373
+ X2AndFeeHere: () => ExtrinsicConfigBuilder;
374
+ };
375
+ transferAssetsUsingTypeAndThen: () => {
376
+ here: () => ExtrinsicConfigBuilder;
377
+ globalConsensusEthereum: () => ExtrinsicConfigBuilder;
378
+ };
379
+ transferAssetsToEcosystem: () => {
380
+ X1: () => ExtrinsicConfigBuilder;
381
+ X3: () => ExtrinsicConfigBuilder;
382
+ };
187
383
  };
188
384
 
189
385
  declare function xTokens(): {
190
- transfer: () => ExtrinsicConfigBuilder;
191
- transferMultiAsset: (originParachainId: number) => {
192
- X1: () => ExtrinsicConfigBuilder;
193
- X2: () => ExtrinsicConfigBuilder;
194
- };
195
- transferMultiCurrencies: () => ExtrinsicConfigBuilder;
386
+ transfer: () => ExtrinsicConfigBuilder;
387
+ transferMultiAsset: (originParachainId: number) => {
388
+ here: () => ExtrinsicConfigBuilder;
389
+ X1: () => ExtrinsicConfigBuilder;
390
+ X2: () => ExtrinsicConfigBuilder;
391
+ };
392
+ transferMultiCurrencies: () => ExtrinsicConfigBuilder;
196
393
  };
197
394
 
198
395
  declare function xTransfer(): {
199
- transfer: () => {
200
- here: () => ExtrinsicConfigBuilder;
201
- X2: () => ExtrinsicConfigBuilder;
202
- };
396
+ transfer: () => {
397
+ here: () => ExtrinsicConfigBuilder;
398
+ X2: () => ExtrinsicConfigBuilder;
399
+ };
203
400
  };
204
401
 
205
402
  declare function xcmPallet(): {
206
- limitedReserveTransferAssets: (parents?: Parents) => {
207
- here: () => ExtrinsicConfigBuilder;
208
- };
403
+ limitedReserveTransferAssets: (parents?: Parents) => {
404
+ here: () => ExtrinsicConfigBuilder;
405
+ };
406
+ transferAssetsUsingTypeAndThen: () => {
407
+ here: () => ExtrinsicConfigBuilder;
408
+ };
209
409
  };
210
410
 
211
411
  declare function ExtrinsicBuilder(): {
212
- eqBalances: typeof eqBalances;
213
- xTokens: typeof xTokens;
214
- xTransfer: typeof xTransfer;
215
- polkadotXcm: typeof polkadotXcm;
216
- xcmPallet: typeof xcmPallet;
412
+ eqBalances: typeof eqBalances;
413
+ xTokens: typeof xTokens;
414
+ xTransfer: typeof xTransfer;
415
+ polkadotXcm: typeof polkadotXcm$1;
416
+ xcmPallet: typeof xcmPallet;
217
417
  };
218
418
 
219
419
  interface SubstrateCallConfigConstructorParams {
220
- api: ApiPromise;
221
- call: () => Promise<bigint>;
420
+ api: ApiPromise;
421
+ call: () => Promise<bigint>;
222
422
  }
223
423
  declare class SubstrateCallConfig {
224
- readonly api: ApiPromise;
225
- readonly call: () => Promise<any>;
226
- readonly type = CallType.Substrate;
227
- constructor({ api, call }: SubstrateCallConfigConstructorParams);
424
+ readonly api: ApiPromise;
425
+ readonly call: () => Promise<any>;
426
+ static is(obj: unknown): obj is SubstrateCallConfig;
427
+ constructor({ api, call }: SubstrateCallConfigConstructorParams);
228
428
  }
229
429
 
230
- interface FeeConfigBuilder {
231
- build: (params: FeeConfigBuilderPrams) => SubstrateCallConfig;
430
+ type FeeConfigBuilder = ConfigBuilder<SubstrateCallConfig, FeeConfigBuilderParams>;
431
+ interface FeeConfigBuilderParams {
432
+ address: string;
433
+ api: ApiPromise;
434
+ asset: ChainAsset;
435
+ destination: AnyParachain;
436
+ feeAsset: ChainAsset;
437
+ source: AnyChain;
232
438
  }
233
- interface FeeConfigBuilderPrams {
234
- asset: ChainAssetId;
235
- api: ApiPromise;
439
+ interface XcmPaymentFeeProps {
440
+ isAssetReserveChain: boolean;
441
+ shouldTransferAssetPrecedeFeeAsset?: boolean;
442
+ parents?: number;
236
443
  }
444
+ interface MoonbeamRuntimeXcmConfigAssetType extends Enum {
445
+ readonly isXcm: boolean;
446
+ readonly asXcm: StagingXcmV3MultiLocation;
447
+ readonly type: 'Xcm';
448
+ }
449
+ type GetVersionedAssetId = (params: FeeConfigBuilderParams) => Promise<object> | object;
450
+
451
+ declare function xcmPaymentApi(): {
452
+ fromCurrencyIdToLocations: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
453
+ fromAssetIdQuery: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
454
+ fromSourceAccountKey20: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
455
+ fromSourcePalletInstance: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
456
+ fromHere: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
457
+ fromHereAndGeneralIndex: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
458
+ fromPalletInstanceAndGeneralIndex: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
459
+ fromHereAndSourceGeneralIndex: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
460
+ fromGeneralIndex: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
461
+ fromPalletInstance: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
462
+ fromPalletInstanceAndAccountKey20: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
463
+ fromGlobalConsensus: (options: XcmPaymentFeeProps) => FeeConfigBuilder;
464
+ };
237
465
 
238
466
  declare function FeeBuilder(): {
239
- assetManager: typeof assetManager;
240
- };
241
- declare function assetManager(): {
242
- assetTypeUnitsPerSecond: (weight?: number) => FeeConfigBuilder;
243
- };
244
-
245
- export {
246
- AssetMinBuilder,
247
- AssetMinConfigBuilder,
248
- AssetMinConfigBuilderPrams,
249
- BalanceBuilder,
250
- BalanceConfigBuilder,
251
- BalanceConfigBuilderPrams,
252
- BaseConfig,
253
- BaseConfigConstructorParams,
254
- CallType,
255
- ContractBuilder,
256
- ContractConfig,
257
- ContractConfigBuilder,
258
- ContractConfigBuilderPrams,
259
- ContractConfigConstructorParams,
260
- EquilibriumSystemBalanceData,
261
- ExtrinsicBuilder,
262
- ExtrinsicConfig,
263
- ExtrinsicConfigBuilder,
264
- ExtrinsicConfigBuilderPrams,
265
- ExtrinsicConfigConstructorParams,
266
- FeeBuilder,
267
- FeeConfigBuilder,
268
- FeeConfigBuilderPrams,
269
- PalletBalancesAccountDataOld,
270
- Parents,
271
- QueryConfigConstructorParams,
272
- SubstrateQueryConfig,
273
- TokensPalletAccountData,
274
- XcmVersion,
275
- evm,
276
- substrate,
467
+ xcmPaymentApi: typeof xcmPaymentApi;
277
468
  };
469
+
470
+ declare function wormhole$1(): {
471
+ tokenTransfer: () => MrlConfigBuilder;
472
+ };
473
+
474
+ type WormholeTransferFunctions = 'tokenTransfer';
475
+ type WormholeFunctionArgs = Parameters<Wormhole<Network>[WormholeTransferFunctions]>;
476
+ interface WormholeConfigConstructorParams {
477
+ args: WormholeFunctionArgs;
478
+ func: WormholeTransferFunctions;
479
+ }
480
+ declare class WormholeConfig {
481
+ readonly args: WormholeFunctionArgs;
482
+ readonly func: WormholeTransferFunctions;
483
+ static is(obj: unknown): obj is WormholeConfig;
484
+ constructor({ args, func }: WormholeConfigConstructorParams);
485
+ }
486
+
487
+ declare function wormholeFactory(chain: AnyChain): Wormhole<"Mainnet" | "Testnet">;
488
+
489
+ type MrlConfigBuilder = ConfigBuilder<ContractConfig | ExtrinsicConfig | WormholeConfig, MrlBuilderParams>;
490
+ type MrlExecuteConfigBuilder = ConfigBuilder<ContractConfig, MrlExecuteBuilderParams>;
491
+ interface MrlBuilderParams extends BuilderParams<AnyChain> {
492
+ isAutomatic: boolean;
493
+ moonApi: ApiPromise;
494
+ moonAsset: ChainAsset;
495
+ moonChain: EvmParachain;
496
+ moonGasLimit?: bigint;
497
+ sendOnlyRemoteExecution?: boolean;
498
+ transact?: Transact;
499
+ }
500
+ interface MrlExecuteBuilderParams {
501
+ bytes?: Uint8Array;
502
+ }
503
+ interface Transact {
504
+ call: HexString;
505
+ txWeight: {
506
+ refTime: bigint;
507
+ proofSize: bigint;
508
+ };
509
+ }
510
+
511
+ declare function Batch(): {
512
+ transferAssetsAndMessage: () => MrlConfigBuilder;
513
+ };
514
+
515
+ declare function Gmp(): {
516
+ wormholeTransferERC20: () => MrlExecuteConfigBuilder;
517
+ };
518
+
519
+ declare function TokenBridge(): {
520
+ transferTokens: () => MrlConfigBuilder;
521
+ };
522
+
523
+ declare function TokenBridgeRelayer(): {
524
+ transferTokensWithRelay: () => MrlConfigBuilder;
525
+ };
526
+
527
+ declare function contract(): {
528
+ Batch: typeof Batch;
529
+ Gmp: typeof Gmp;
530
+ TokenBridge: typeof TokenBridge;
531
+ TokenBridgeRelayer: typeof TokenBridgeRelayer;
532
+ };
533
+
534
+ declare function ethereumXcm(): {
535
+ transact: () => MrlConfigBuilder;
536
+ };
537
+
538
+ declare function polkadotXcm(): {
539
+ send: () => MrlConfigBuilder;
540
+ };
541
+
542
+ declare function extrinsic(): {
543
+ ethereumXcm: typeof ethereumXcm;
544
+ polkadotXcm: typeof polkadotXcm;
545
+ };
546
+
547
+ declare const BATCH_CONTRACT_ABI: readonly [{
548
+ readonly anonymous: false;
549
+ readonly inputs: readonly [{
550
+ readonly indexed: false;
551
+ readonly internalType: "uint256";
552
+ readonly name: "index";
553
+ readonly type: "uint256";
554
+ }];
555
+ readonly name: "SubcallFailed";
556
+ readonly type: "event";
557
+ }, {
558
+ readonly anonymous: false;
559
+ readonly inputs: readonly [{
560
+ readonly indexed: false;
561
+ readonly internalType: "uint256";
562
+ readonly name: "index";
563
+ readonly type: "uint256";
564
+ }];
565
+ readonly name: "SubcallSucceeded";
566
+ readonly type: "event";
567
+ }, {
568
+ readonly inputs: readonly [{
569
+ readonly internalType: "address[]";
570
+ readonly name: "to";
571
+ readonly type: "address[]";
572
+ }, {
573
+ readonly internalType: "uint256[]";
574
+ readonly name: "value";
575
+ readonly type: "uint256[]";
576
+ }, {
577
+ readonly internalType: "bytes[]";
578
+ readonly name: "callData";
579
+ readonly type: "bytes[]";
580
+ }, {
581
+ readonly internalType: "uint64[]";
582
+ readonly name: "gasLimit";
583
+ readonly type: "uint64[]";
584
+ }];
585
+ readonly name: "batchAll";
586
+ readonly outputs: readonly [];
587
+ readonly stateMutability: "nonpayable";
588
+ readonly type: "function";
589
+ }, {
590
+ readonly inputs: readonly [{
591
+ readonly internalType: "address[]";
592
+ readonly name: "to";
593
+ readonly type: "address[]";
594
+ }, {
595
+ readonly internalType: "uint256[]";
596
+ readonly name: "value";
597
+ readonly type: "uint256[]";
598
+ }, {
599
+ readonly internalType: "bytes[]";
600
+ readonly name: "callData";
601
+ readonly type: "bytes[]";
602
+ }, {
603
+ readonly internalType: "uint64[]";
604
+ readonly name: "gasLimit";
605
+ readonly type: "uint64[]";
606
+ }];
607
+ readonly name: "batchSome";
608
+ readonly outputs: readonly [];
609
+ readonly stateMutability: "nonpayable";
610
+ readonly type: "function";
611
+ }, {
612
+ readonly inputs: readonly [{
613
+ readonly internalType: "address[]";
614
+ readonly name: "to";
615
+ readonly type: "address[]";
616
+ }, {
617
+ readonly internalType: "uint256[]";
618
+ readonly name: "value";
619
+ readonly type: "uint256[]";
620
+ }, {
621
+ readonly internalType: "bytes[]";
622
+ readonly name: "callData";
623
+ readonly type: "bytes[]";
624
+ }, {
625
+ readonly internalType: "uint64[]";
626
+ readonly name: "gasLimit";
627
+ readonly type: "uint64[]";
628
+ }];
629
+ readonly name: "batchSomeUntilFailure";
630
+ readonly outputs: readonly [];
631
+ readonly stateMutability: "nonpayable";
632
+ readonly type: "function";
633
+ }];
634
+
635
+ declare function wormhole(): {
636
+ contract: typeof contract;
637
+ extrinsic: typeof extrinsic;
638
+ wormhole: typeof wormhole$1;
639
+ };
640
+
641
+ declare function MrlBuilder(): {
642
+ wormhole: typeof wormhole;
643
+ };
644
+
645
+ declare const BATCH_CONTRACT_ADDRESS = "0x0000000000000000000000000000000000000808";
646
+
647
+ export { AssetMinBuilder, type AssetMinConfigBuilder, type AssetMinConfigBuilderParams, BATCH_CONTRACT_ABI, BATCH_CONTRACT_ADDRESS, BalanceBuilder, type BalanceBuilderParams, type BalanceConfigBuilder, type BuilderParams, type ConfigBuilder, ContractBuilder, ContractConfig, type ContractConfigBuilder, type ContractConfigConstructorParams, ERC20_ABI, type EquilibriumSystemBalanceData, type EvmFunctionArgs, EvmQueryConfig, type EvmQueryConfigParams, type EvmQueryFunctions, ExtrinsicBuilder, ExtrinsicConfig, type ExtrinsicConfigBuilder, type ExtrinsicConfigConstructorParams, FeeBuilder, type FeeConfigBuilder, type FeeConfigBuilderParams, type GetVersionedAssetId, type MoonbeamRuntimeXcmConfigAssetType, MrlBuilder, type MrlBuilderParams, type MrlConfigBuilder, type MrlExecuteBuilderParams, type MrlExecuteConfigBuilder, type PalletBalancesAccountDataOld, type Parents, type QueryConfigConstructorParams, SubstrateCallConfig, type SubstrateCallConfigConstructorParams, SubstrateQueryConfig, type TokensPalletAccountData, type Transact, WormholeConfig, type WormholeConfigConstructorParams, type WormholeFunctionArgs, type WormholeTransferFunctions, type XcmPaymentFeeProps, XcmVersion, calculateSystemAccountBalance, evm, substrate, wormhole, wormholeFactory };