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