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