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