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