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