@moonbeam-network/xcm-builder 1.0.0-dev.145 → 1.0.0-dev.147

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