@moonbeam-network/xcm-builder 2.6.2 → 3.0.1
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 +519 -227
- package/build/index.mjs +4525 -1
- package/build/index.mjs.map +1 -1
- package/package.json +26 -33
- package/build/index.cjs +0 -2
- package/build/index.cjs.map +0 -1
- package/build/index.d.cts +0 -267
package/build/index.d.ts
CHANGED
|
@@ -1,327 +1,619 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
AnyChain,
|
|
5
|
-
AnyParachain,
|
|
6
|
-
} from '@moonbeam-network/xcm-types';
|
|
7
|
-
import {
|
|
8
|
-
FrameSystemAccountInfo,
|
|
9
|
-
StagingXcmV3MultiLocation,
|
|
10
|
-
} from '@polkadot/types/lookup';
|
|
1
|
+
import { Chain, AnyParachain, AssetAmount, ChainAssetId, ChainAsset, AnyChain, EvmParachain } from '@moonbeam-network/xcm-types';
|
|
2
|
+
import { ApiPromise } from '@polkadot/api';
|
|
3
|
+
import { FrameSystemAccountInfo, StagingXcmV3MultiLocation } from '@polkadot/types/lookup';
|
|
11
4
|
import { Struct, u128, Enum } from '@polkadot/types';
|
|
5
|
+
import { Abi, PublicClient, HttpTransport } from 'viem';
|
|
12
6
|
import { SubmittableExtrinsicFunction } from '@polkadot/api/types';
|
|
13
|
-
import {
|
|
7
|
+
import { HexString } from '@polkadot/util/types';
|
|
8
|
+
import { Wormhole, Network } from '@wormhole-foundation/sdk-connect';
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
interface ConfigBuilder<Config, Params = BuilderParams> {
|
|
11
|
+
build: (params: Params) => Config;
|
|
12
|
+
}
|
|
13
|
+
interface BuilderParams<IChain extends Chain = AnyParachain> {
|
|
14
|
+
asset: AssetAmount;
|
|
15
|
+
destination: IChain;
|
|
16
|
+
destinationAddress: string;
|
|
17
|
+
destinationApi?: ApiPromise;
|
|
18
|
+
fee: AssetAmount;
|
|
19
|
+
source: IChain;
|
|
20
|
+
sourceAddress: string;
|
|
21
|
+
sourceApi?: ApiPromise;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
interface BaseConfigConstructorParams {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
type: CallType;
|
|
25
|
+
module: string;
|
|
26
|
+
func: string;
|
|
24
27
|
}
|
|
25
28
|
declare class BaseConfig {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
constructor({ module, func, type }: BaseConfigConstructorParams);
|
|
29
|
+
readonly module: string;
|
|
30
|
+
readonly func: string;
|
|
31
|
+
constructor({ module, func }: BaseConfigConstructorParams);
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
interface QueryConfigConstructorParams
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
transform: (data: any) => Promise<bigint>;
|
|
34
|
+
interface QueryConfigConstructorParams extends BaseConfigConstructorParams {
|
|
35
|
+
args?: unknown[];
|
|
36
|
+
transform: (data: any) => Promise<bigint>;
|
|
36
37
|
}
|
|
37
38
|
declare class SubstrateQueryConfig extends BaseConfig {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
args,
|
|
42
|
-
transform,
|
|
43
|
-
type,
|
|
44
|
-
...other
|
|
45
|
-
}: QueryConfigConstructorParams);
|
|
39
|
+
readonly args: unknown[];
|
|
40
|
+
readonly transform: (data: unknown) => Promise<bigint>;
|
|
41
|
+
static is(obj: unknown): obj is SubstrateQueryConfig;
|
|
42
|
+
constructor({ args, transform, ...other }: QueryConfigConstructorParams);
|
|
46
43
|
}
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
asset: ChainAssetId;
|
|
45
|
+
type AssetMinConfigBuilder = ConfigBuilder<SubstrateQueryConfig, AssetMinConfigBuilderParams>;
|
|
46
|
+
interface AssetMinConfigBuilderParams {
|
|
47
|
+
address?: string;
|
|
48
|
+
asset: ChainAssetId;
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
declare function AssetMinBuilder(): {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
assetRegistry: typeof assetRegistry;
|
|
53
|
+
assets: typeof assets$1;
|
|
54
|
+
foreignAssets: typeof foreignAssets$1;
|
|
59
55
|
};
|
|
60
56
|
declare function assetRegistry(): {
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
assetMetadatas: () => AssetMinConfigBuilder;
|
|
58
|
+
currencyMetadatas: () => AssetMinConfigBuilder;
|
|
63
59
|
};
|
|
64
60
|
declare function assets$1(): {
|
|
65
|
-
|
|
61
|
+
asset: () => AssetMinConfigBuilder;
|
|
66
62
|
};
|
|
67
63
|
declare function foreignAssets$1(): {
|
|
68
|
-
|
|
64
|
+
asset: () => AssetMinConfigBuilder;
|
|
69
65
|
};
|
|
70
66
|
|
|
71
|
-
interface ContractConfigConstructorParams
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
interface ContractConfigConstructorParams extends BaseConfigConstructorParams {
|
|
68
|
+
address: string;
|
|
69
|
+
abi: Abi;
|
|
70
|
+
args: any[];
|
|
75
71
|
}
|
|
76
72
|
declare class ContractConfig extends BaseConfig {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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}`;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
build: (params: ContractConfigBuilderPrams) => ContractConfig;
|
|
84
|
-
}
|
|
85
|
-
interface ContractConfigBuilderPrams {
|
|
86
|
-
address: string;
|
|
87
|
-
amount: bigint;
|
|
88
|
-
asset: ChainAssetId;
|
|
89
|
-
destination: AnyChain;
|
|
90
|
-
fee: bigint;
|
|
91
|
-
feeAsset: ChainAssetId;
|
|
92
|
-
}
|
|
81
|
+
type ContractConfigBuilder = ConfigBuilder<ContractConfig>;
|
|
93
82
|
|
|
94
83
|
declare function Xtokens(): {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
transfer: (weight?: bigint) => ContractConfigBuilder;
|
|
85
|
+
transferMultiCurrencies: (shouldTransferAssetPrecedeFeeAsset?: boolean, weight?: bigint) => ContractConfigBuilder;
|
|
86
|
+
transferWithEvmTo32: (weight?: bigint) => ContractConfigBuilder;
|
|
98
87
|
};
|
|
99
88
|
|
|
100
89
|
declare function ContractBuilder(): {
|
|
101
|
-
|
|
90
|
+
Xtokens: typeof Xtokens;
|
|
102
91
|
};
|
|
103
92
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
93
|
+
type EvmQueryFunctions = 'getBalance';
|
|
94
|
+
type EvmFunctionArgs = Parameters<PublicClient<HttpTransport>[EvmQueryFunctions]>;
|
|
95
|
+
interface EvmQueryConfigParams {
|
|
96
|
+
readonly args: EvmFunctionArgs;
|
|
97
|
+
readonly func: EvmQueryFunctions;
|
|
108
98
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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;
|
|
112
110
|
}
|
|
113
111
|
interface PalletBalancesAccountDataOld extends Struct {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
readonly free: u128;
|
|
113
|
+
readonly reserved: u128;
|
|
114
|
+
readonly miscFrozen: u128;
|
|
115
|
+
readonly feeFrozen: u128;
|
|
118
116
|
}
|
|
119
117
|
interface TokensPalletAccountData {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
free: u128;
|
|
119
|
+
reserved: u128;
|
|
120
|
+
frozen: u128;
|
|
123
121
|
}
|
|
124
|
-
type EquilibriumSystemBalanceData = Array<
|
|
125
|
-
[
|
|
122
|
+
type EquilibriumSystemBalanceData = Array<[
|
|
126
123
|
number,
|
|
127
124
|
{
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
>;
|
|
125
|
+
positive: number;
|
|
126
|
+
}
|
|
127
|
+
]>;
|
|
132
128
|
|
|
133
129
|
declare function BalanceBuilder(): {
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
evm: typeof evm;
|
|
131
|
+
substrate: typeof substrate;
|
|
136
132
|
};
|
|
137
133
|
declare function evm(): {
|
|
138
|
-
|
|
134
|
+
erc20: typeof erc20;
|
|
135
|
+
native: typeof native;
|
|
139
136
|
};
|
|
137
|
+
declare function erc20(): BalanceConfigBuilder;
|
|
138
|
+
declare function native(): BalanceConfigBuilder;
|
|
140
139
|
declare function substrate(): {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
assets: typeof assets;
|
|
141
|
+
foreignAssets: typeof foreignAssets;
|
|
142
|
+
system: typeof system;
|
|
143
|
+
tokens: typeof tokens;
|
|
145
144
|
};
|
|
146
|
-
declare function erc20(): BalanceConfigBuilder;
|
|
147
145
|
declare function assets(): {
|
|
148
|
-
|
|
146
|
+
account: () => BalanceConfigBuilder;
|
|
149
147
|
};
|
|
150
148
|
declare function foreignAssets(): {
|
|
151
|
-
|
|
149
|
+
account: () => BalanceConfigBuilder;
|
|
152
150
|
};
|
|
153
151
|
declare function system(): {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
account: () => BalanceConfigBuilder;
|
|
153
|
+
accountEquilibrium: () => BalanceConfigBuilder;
|
|
154
|
+
accountEvmTo32: () => BalanceConfigBuilder;
|
|
157
155
|
};
|
|
158
156
|
declare function tokens(): {
|
|
159
|
-
|
|
157
|
+
accounts: () => BalanceConfigBuilder;
|
|
160
158
|
};
|
|
161
|
-
declare function calculateSystemAccountBalance(
|
|
162
|
-
response: FrameSystemAccountInfo,
|
|
163
|
-
): Promise<bigint>;
|
|
159
|
+
declare function calculateSystemAccountBalance(response: FrameSystemAccountInfo): Promise<bigint>;
|
|
164
160
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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[];
|
|
168
332
|
}
|
|
169
333
|
declare class ExtrinsicConfig extends BaseConfig {
|
|
170
|
-
|
|
171
|
-
|
|
334
|
+
getArgs: (func?: SubmittableExtrinsicFunction<'promise'>) => any[];
|
|
335
|
+
static is(obj: unknown): obj is ExtrinsicConfig;
|
|
336
|
+
constructor({ getArgs, ...other }: ExtrinsicConfigConstructorParams);
|
|
172
337
|
}
|
|
173
338
|
|
|
174
|
-
|
|
175
|
-
build: (params: ExtrinsicConfigBuilderPrams) => ExtrinsicConfig;
|
|
176
|
-
}
|
|
177
|
-
interface ExtrinsicConfigBuilderPrams {
|
|
178
|
-
address: string;
|
|
179
|
-
amount: bigint;
|
|
180
|
-
asset: ChainAssetId;
|
|
181
|
-
destination: AnyChain;
|
|
182
|
-
fee: bigint;
|
|
183
|
-
feeAsset: ChainAssetId;
|
|
184
|
-
palletInstance?: number;
|
|
185
|
-
source: AnyChain;
|
|
186
|
-
}
|
|
339
|
+
type ExtrinsicConfigBuilder = ConfigBuilder<ExtrinsicConfig>;
|
|
187
340
|
declare enum XcmVersion {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
341
|
+
v1 = "V1",
|
|
342
|
+
v2 = "V2",
|
|
343
|
+
v3 = "V3",
|
|
344
|
+
v4 = "V4",
|
|
345
|
+
v5 = "V5"
|
|
192
346
|
}
|
|
193
347
|
type Parents = 0 | 1;
|
|
194
348
|
|
|
195
349
|
declare function eqBalances(): {
|
|
196
|
-
|
|
197
|
-
|
|
350
|
+
xcmTransfer: () => ExtrinsicConfigBuilder;
|
|
351
|
+
transferXcm: () => ExtrinsicConfigBuilder;
|
|
198
352
|
};
|
|
199
353
|
|
|
200
|
-
declare function polkadotXcm(): {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
+
};
|
|
215
370
|
};
|
|
216
371
|
|
|
217
372
|
declare function xTokens(): {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
373
|
+
transfer: () => ExtrinsicConfigBuilder;
|
|
374
|
+
transferMultiAsset: (originParachainId: number) => {
|
|
375
|
+
here: () => ExtrinsicConfigBuilder;
|
|
376
|
+
X1: () => ExtrinsicConfigBuilder;
|
|
377
|
+
X2: () => ExtrinsicConfigBuilder;
|
|
378
|
+
};
|
|
379
|
+
transferMultiCurrencies: () => ExtrinsicConfigBuilder;
|
|
225
380
|
};
|
|
226
381
|
|
|
227
382
|
declare function xTransfer(): {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
383
|
+
transfer: () => {
|
|
384
|
+
here: () => ExtrinsicConfigBuilder;
|
|
385
|
+
X2: () => ExtrinsicConfigBuilder;
|
|
386
|
+
};
|
|
232
387
|
};
|
|
233
388
|
|
|
234
389
|
declare function xcmPallet(): {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
390
|
+
limitedReserveTransferAssets: (parents?: Parents) => {
|
|
391
|
+
here: () => ExtrinsicConfigBuilder;
|
|
392
|
+
};
|
|
393
|
+
transferAssetsUsingTypeAndThen: () => {
|
|
394
|
+
here: () => ExtrinsicConfigBuilder;
|
|
395
|
+
};
|
|
241
396
|
};
|
|
242
397
|
|
|
243
398
|
declare function ExtrinsicBuilder(): {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
399
|
+
eqBalances: typeof eqBalances;
|
|
400
|
+
xTokens: typeof xTokens;
|
|
401
|
+
xTransfer: typeof xTransfer;
|
|
402
|
+
polkadotXcm: typeof polkadotXcm$1;
|
|
403
|
+
xcmPallet: typeof xcmPallet;
|
|
249
404
|
};
|
|
250
405
|
|
|
251
406
|
interface SubstrateCallConfigConstructorParams {
|
|
252
|
-
|
|
253
|
-
|
|
407
|
+
api: ApiPromise;
|
|
408
|
+
call: () => Promise<bigint>;
|
|
254
409
|
}
|
|
255
410
|
declare class SubstrateCallConfig {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
411
|
+
readonly api: ApiPromise;
|
|
412
|
+
readonly call: () => Promise<any>;
|
|
413
|
+
static is(obj: unknown): obj is SubstrateCallConfig;
|
|
414
|
+
constructor({ api, call }: SubstrateCallConfigConstructorParams);
|
|
260
415
|
}
|
|
261
416
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
transferAsset: ChainAssetId;
|
|
270
|
-
chain: AnyParachain;
|
|
417
|
+
type FeeConfigBuilder = ConfigBuilder<SubstrateCallConfig, FeeConfigBuilderParams>;
|
|
418
|
+
interface FeeConfigBuilderParams {
|
|
419
|
+
address: string;
|
|
420
|
+
api: ApiPromise;
|
|
421
|
+
asset: ChainAsset;
|
|
422
|
+
destination: AnyParachain;
|
|
423
|
+
feeAsset: ChainAsset;
|
|
271
424
|
}
|
|
272
425
|
interface XcmPaymentFeeProps {
|
|
273
|
-
|
|
274
|
-
|
|
426
|
+
isAssetReserveChain: boolean;
|
|
427
|
+
shouldTransferAssetPrecedeFeeAsset?: boolean;
|
|
275
428
|
}
|
|
276
429
|
interface MoonbeamRuntimeXcmConfigAssetType extends Enum {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
430
|
+
readonly isXcm: boolean;
|
|
431
|
+
readonly asXcm: StagingXcmV3MultiLocation;
|
|
432
|
+
readonly type: 'Xcm';
|
|
280
433
|
}
|
|
281
434
|
|
|
282
435
|
declare function FeeBuilder(): {
|
|
283
|
-
|
|
436
|
+
xcmPaymentApi: typeof xcmPaymentApi;
|
|
284
437
|
};
|
|
285
438
|
declare function xcmPaymentApi(): {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
export {
|
|
293
|
-
AssetMinBuilder,
|
|
294
|
-
type AssetMinConfigBuilder,
|
|
295
|
-
type AssetMinConfigBuilderPrams,
|
|
296
|
-
BalanceBuilder,
|
|
297
|
-
type BalanceConfigBuilder,
|
|
298
|
-
type BalanceConfigBuilderPrams,
|
|
299
|
-
BaseConfig,
|
|
300
|
-
type BaseConfigConstructorParams,
|
|
301
|
-
CallType,
|
|
302
|
-
ContractBuilder,
|
|
303
|
-
ContractConfig,
|
|
304
|
-
type ContractConfigBuilder,
|
|
305
|
-
type ContractConfigBuilderPrams,
|
|
306
|
-
type ContractConfigConstructorParams,
|
|
307
|
-
type EquilibriumSystemBalanceData,
|
|
308
|
-
ExtrinsicBuilder,
|
|
309
|
-
ExtrinsicConfig,
|
|
310
|
-
type ExtrinsicConfigBuilder,
|
|
311
|
-
type ExtrinsicConfigBuilderPrams,
|
|
312
|
-
type ExtrinsicConfigConstructorParams,
|
|
313
|
-
FeeBuilder,
|
|
314
|
-
type FeeConfigBuilder,
|
|
315
|
-
type FeeConfigBuilderPrams,
|
|
316
|
-
type MoonbeamRuntimeXcmConfigAssetType,
|
|
317
|
-
type PalletBalancesAccountDataOld,
|
|
318
|
-
type Parents,
|
|
319
|
-
type QueryConfigConstructorParams,
|
|
320
|
-
SubstrateQueryConfig,
|
|
321
|
-
type TokensPalletAccountData,
|
|
322
|
-
type XcmPaymentFeeProps,
|
|
323
|
-
XcmVersion,
|
|
324
|
-
calculateSystemAccountBalance,
|
|
325
|
-
evm,
|
|
326
|
-
substrate,
|
|
439
|
+
xcmPaymentFee: ({ isAssetReserveChain, shouldTransferAssetPrecedeFeeAsset, }: XcmPaymentFeeProps) => FeeConfigBuilder;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
declare function wormhole$1(): {
|
|
443
|
+
tokenTransfer: () => MrlConfigBuilder;
|
|
327
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 };
|