@layerzerolabs/lz-v2-stellar-sdk 0.2.8
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/.turbo/turbo-build.log +4 -0
- package/dist/generated/bml.d.ts +452 -0
- package/dist/generated/bml.js +72 -0
- package/dist/generated/counter.d.ts +824 -0
- package/dist/generated/counter.js +125 -0
- package/dist/generated/endpoint.d.ts +1676 -0
- package/dist/generated/endpoint.js +216 -0
- package/dist/generated/sml.d.ts +810 -0
- package/dist/generated/sml.js +132 -0
- package/dist/generated/uln302.d.ts +1227 -0
- package/dist/generated/uln302.js +185 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/package.json +40 -0
- package/src/generated/bml.ts +506 -0
- package/src/generated/counter.ts +869 -0
- package/src/generated/endpoint.ts +1697 -0
- package/src/generated/sml.ts +864 -0
- package/src/generated/uln302.ts +1274 -0
- package/src/index.ts +5 -0
- package/test/index.test.ts +271 -0
- package/test/suites/constants.ts +13 -0
- package/test/suites/deploy.ts +277 -0
- package/test/suites/localnet.ts +42 -0
- package/test/suites/scan.ts +189 -0
- package/tsconfig.json +106 -0
|
@@ -0,0 +1,1227 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/contract';
|
|
3
|
+
import type { u32, u64, i128, Option } from '@stellar/stellar-sdk/contract';
|
|
4
|
+
export * from '@stellar/stellar-sdk';
|
|
5
|
+
export * as contract from '@stellar/stellar-sdk/contract';
|
|
6
|
+
export * as rpc from '@stellar/stellar-sdk/rpc';
|
|
7
|
+
/**
|
|
8
|
+
* Ultra Light Node configuration for message verification.
|
|
9
|
+
*/
|
|
10
|
+
export interface UlnConfig {
|
|
11
|
+
/**
|
|
12
|
+
* Number of block confirmations required before message verification begins.
|
|
13
|
+
*/
|
|
14
|
+
confirmations: u64;
|
|
15
|
+
/**
|
|
16
|
+
* Minimum number of optional DVNs required to verify.
|
|
17
|
+
*/
|
|
18
|
+
optional_dvn_threshold: u32;
|
|
19
|
+
/**
|
|
20
|
+
* List of DVN addresses from which a threshold number must verify.
|
|
21
|
+
*/
|
|
22
|
+
optional_dvns: Array<string>;
|
|
23
|
+
/**
|
|
24
|
+
* List of DVN addresses that must ALL verify the message (no threshold).
|
|
25
|
+
*/
|
|
26
|
+
required_dvns: Array<string>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* OApp-specific ULN configuration with default override flags.
|
|
30
|
+
*/
|
|
31
|
+
export interface OAppUlnConfig {
|
|
32
|
+
/**
|
|
33
|
+
* OApp-specific ULN configuration (used when defaults are not applied).
|
|
34
|
+
*/
|
|
35
|
+
uln_config: UlnConfig;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to use default confirmations.
|
|
38
|
+
*/
|
|
39
|
+
use_default_confirmations: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether to use default optional DVNs.
|
|
42
|
+
*/
|
|
43
|
+
use_default_optional_dvns: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether to use default required DVNs.
|
|
46
|
+
*/
|
|
47
|
+
use_default_required_dvns: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Parameter for setting default ULN configuration for a destination/source endpoint.
|
|
51
|
+
*/
|
|
52
|
+
export interface SetDefaultUlnConfigParam {
|
|
53
|
+
/**
|
|
54
|
+
* The ULN configuration to set as default.
|
|
55
|
+
*/
|
|
56
|
+
config: UlnConfig;
|
|
57
|
+
/**
|
|
58
|
+
* The destination endpoint ID (for send) or source endpoint ID (for receive).
|
|
59
|
+
*/
|
|
60
|
+
dst_eid: u32;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Executor configuration for message delivery.
|
|
64
|
+
*/
|
|
65
|
+
export interface ExecutorConfig {
|
|
66
|
+
/**
|
|
67
|
+
* Address of the executor contract responsible for message execution.
|
|
68
|
+
*/
|
|
69
|
+
executor: string;
|
|
70
|
+
/**
|
|
71
|
+
* Maximum size of messages that can be executed (in bytes).
|
|
72
|
+
*/
|
|
73
|
+
max_message_size: u32;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* OApp-specific executor configuration.
|
|
77
|
+
*
|
|
78
|
+
* If executor is `None`, the default executor is used.
|
|
79
|
+
*/
|
|
80
|
+
export interface OAppExecutorConfig {
|
|
81
|
+
/**
|
|
82
|
+
* Address of the executor contract to be used for message execution. None means use default configuration.
|
|
83
|
+
*/
|
|
84
|
+
executor: Option<string>;
|
|
85
|
+
/**
|
|
86
|
+
* Maximum size of messages that can be executed (in bytes). 0 means use default configuration.
|
|
87
|
+
*/
|
|
88
|
+
max_message_size: u32;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Parameter for setting default executor configuration for a destination endpoint.
|
|
92
|
+
*/
|
|
93
|
+
export interface SetDefaultExecutorConfigParam {
|
|
94
|
+
/**
|
|
95
|
+
* The executor configuration to set as default.
|
|
96
|
+
*/
|
|
97
|
+
config: ExecutorConfig;
|
|
98
|
+
/**
|
|
99
|
+
* The destination endpoint ID.
|
|
100
|
+
*/
|
|
101
|
+
dst_eid: u32;
|
|
102
|
+
}
|
|
103
|
+
export type UlnStorage = {
|
|
104
|
+
tag: "Endpoint";
|
|
105
|
+
values: void;
|
|
106
|
+
} | {
|
|
107
|
+
tag: "Treasury";
|
|
108
|
+
values: void;
|
|
109
|
+
} | {
|
|
110
|
+
tag: "DefaultExecutorConfigs";
|
|
111
|
+
values: readonly [u32];
|
|
112
|
+
} | {
|
|
113
|
+
tag: "DefaultSendUlnConfigs";
|
|
114
|
+
values: readonly [u32];
|
|
115
|
+
} | {
|
|
116
|
+
tag: "DefaultReceiveUlnConfigs";
|
|
117
|
+
values: readonly [u32];
|
|
118
|
+
} | {
|
|
119
|
+
tag: "OAppSendUlnConfigs";
|
|
120
|
+
values: readonly [string, u32];
|
|
121
|
+
} | {
|
|
122
|
+
tag: "OAppReceiveUlnConfigs";
|
|
123
|
+
values: readonly [string, u32];
|
|
124
|
+
} | {
|
|
125
|
+
tag: "OAppExecutorConfigs";
|
|
126
|
+
values: readonly [string, u32];
|
|
127
|
+
} | {
|
|
128
|
+
tag: "Confirmations";
|
|
129
|
+
values: readonly [string, Buffer, Buffer];
|
|
130
|
+
};
|
|
131
|
+
export declare const Uln302Error: {
|
|
132
|
+
1: {
|
|
133
|
+
message: string;
|
|
134
|
+
};
|
|
135
|
+
2: {
|
|
136
|
+
message: string;
|
|
137
|
+
};
|
|
138
|
+
3: {
|
|
139
|
+
message: string;
|
|
140
|
+
};
|
|
141
|
+
4: {
|
|
142
|
+
message: string;
|
|
143
|
+
};
|
|
144
|
+
5: {
|
|
145
|
+
message: string;
|
|
146
|
+
};
|
|
147
|
+
6: {
|
|
148
|
+
message: string;
|
|
149
|
+
};
|
|
150
|
+
7: {
|
|
151
|
+
message: string;
|
|
152
|
+
};
|
|
153
|
+
8: {
|
|
154
|
+
message: string;
|
|
155
|
+
};
|
|
156
|
+
9: {
|
|
157
|
+
message: string;
|
|
158
|
+
};
|
|
159
|
+
10: {
|
|
160
|
+
message: string;
|
|
161
|
+
};
|
|
162
|
+
11: {
|
|
163
|
+
message: string;
|
|
164
|
+
};
|
|
165
|
+
12: {
|
|
166
|
+
message: string;
|
|
167
|
+
};
|
|
168
|
+
13: {
|
|
169
|
+
message: string;
|
|
170
|
+
};
|
|
171
|
+
14: {
|
|
172
|
+
message: string;
|
|
173
|
+
};
|
|
174
|
+
15: {
|
|
175
|
+
message: string;
|
|
176
|
+
};
|
|
177
|
+
16: {
|
|
178
|
+
message: string;
|
|
179
|
+
};
|
|
180
|
+
17: {
|
|
181
|
+
message: string;
|
|
182
|
+
};
|
|
183
|
+
18: {
|
|
184
|
+
message: string;
|
|
185
|
+
};
|
|
186
|
+
19: {
|
|
187
|
+
message: string;
|
|
188
|
+
};
|
|
189
|
+
20: {
|
|
190
|
+
message: string;
|
|
191
|
+
};
|
|
192
|
+
21: {
|
|
193
|
+
message: string;
|
|
194
|
+
};
|
|
195
|
+
22: {
|
|
196
|
+
message: string;
|
|
197
|
+
};
|
|
198
|
+
23: {
|
|
199
|
+
message: string;
|
|
200
|
+
};
|
|
201
|
+
24: {
|
|
202
|
+
message: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Parameters for sending a cross-chain message.
|
|
207
|
+
*/
|
|
208
|
+
export interface MessagingParams {
|
|
209
|
+
/**
|
|
210
|
+
* Destination endpoint ID (chain identifier).
|
|
211
|
+
*/
|
|
212
|
+
dst_eid: u32;
|
|
213
|
+
/**
|
|
214
|
+
* The message payload to send.
|
|
215
|
+
*/
|
|
216
|
+
message: Buffer;
|
|
217
|
+
/**
|
|
218
|
+
* Encoded executor and DVN options.
|
|
219
|
+
*/
|
|
220
|
+
options: Buffer;
|
|
221
|
+
/**
|
|
222
|
+
* Whether to pay fees in ZRO token instead of native token.
|
|
223
|
+
*/
|
|
224
|
+
pay_in_zro: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Receiver address on the destination chain (32 bytes).
|
|
227
|
+
*/
|
|
228
|
+
receiver: Buffer;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Source message information identifying where a cross-chain message came from.
|
|
232
|
+
*/
|
|
233
|
+
export interface Origin {
|
|
234
|
+
/**
|
|
235
|
+
* Nonce for this pathway.
|
|
236
|
+
*/
|
|
237
|
+
nonce: u64;
|
|
238
|
+
/**
|
|
239
|
+
* Sender address on the source chain (32 bytes).
|
|
240
|
+
*/
|
|
241
|
+
sender: Buffer;
|
|
242
|
+
/**
|
|
243
|
+
* Source endpoint ID (chain identifier).
|
|
244
|
+
*/
|
|
245
|
+
src_eid: u32;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Fee structure for cross-chain messaging.
|
|
249
|
+
*/
|
|
250
|
+
export interface MessagingFee {
|
|
251
|
+
/**
|
|
252
|
+
* Fee paid in native token (XLM).
|
|
253
|
+
*/
|
|
254
|
+
native_fee: i128;
|
|
255
|
+
/**
|
|
256
|
+
* Fee paid in ZRO token (LayerZero token).
|
|
257
|
+
*/
|
|
258
|
+
zro_fee: i128;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Receipt returned after successfully sending a cross-chain message.
|
|
262
|
+
*/
|
|
263
|
+
export interface MessagingReceipt {
|
|
264
|
+
/**
|
|
265
|
+
* The fees charged for sending the message.
|
|
266
|
+
*/
|
|
267
|
+
fee: MessagingFee;
|
|
268
|
+
/**
|
|
269
|
+
* Globally unique identifier for the message.
|
|
270
|
+
*/
|
|
271
|
+
guid: Buffer;
|
|
272
|
+
/**
|
|
273
|
+
* The outbound nonce for this pathway.
|
|
274
|
+
*/
|
|
275
|
+
nonce: u64;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Type of message library indicating supported operations.
|
|
279
|
+
*/
|
|
280
|
+
export type MessageLibType = {
|
|
281
|
+
tag: "Send";
|
|
282
|
+
values: void;
|
|
283
|
+
} | {
|
|
284
|
+
tag: "Receive";
|
|
285
|
+
values: void;
|
|
286
|
+
} | {
|
|
287
|
+
tag: "SendAndReceive";
|
|
288
|
+
values: void;
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* Version information for a message library.
|
|
292
|
+
*
|
|
293
|
+
* Note: `minor` and `endpoint_version` use `u32` instead of `u8` because Stellar does not
|
|
294
|
+
* support `u8` types in contract interface functions.
|
|
295
|
+
*/
|
|
296
|
+
export interface MessageLibVersion {
|
|
297
|
+
/**
|
|
298
|
+
* Endpoint version (should not exceed u8::MAX = 255).
|
|
299
|
+
*/
|
|
300
|
+
endpoint_version: u32;
|
|
301
|
+
/**
|
|
302
|
+
* Major version number.
|
|
303
|
+
*/
|
|
304
|
+
major: u64;
|
|
305
|
+
/**
|
|
306
|
+
* Minor version number (should not exceed u8::MAX = 255).
|
|
307
|
+
*/
|
|
308
|
+
minor: u32;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Timeout configuration for receive library transitions.
|
|
312
|
+
*/
|
|
313
|
+
export interface Timeout {
|
|
314
|
+
/**
|
|
315
|
+
* Unix timestamp when the timeout expires.
|
|
316
|
+
*/
|
|
317
|
+
expiry: u64;
|
|
318
|
+
/**
|
|
319
|
+
* The new library address to transition to.
|
|
320
|
+
*/
|
|
321
|
+
lib: string;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Parameters for setting message library configuration.
|
|
325
|
+
*/
|
|
326
|
+
export interface SetConfigParam {
|
|
327
|
+
/**
|
|
328
|
+
* XDR-encoded configuration data.
|
|
329
|
+
*/
|
|
330
|
+
config: Buffer;
|
|
331
|
+
/**
|
|
332
|
+
* The type of configuration (e.g., executor, ULN).
|
|
333
|
+
*/
|
|
334
|
+
config_type: u32;
|
|
335
|
+
/**
|
|
336
|
+
* The endpoint ID this config applies to.
|
|
337
|
+
*/
|
|
338
|
+
eid: u32;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Resolved library information with default status.
|
|
342
|
+
*/
|
|
343
|
+
export interface ResolvedLibrary {
|
|
344
|
+
/**
|
|
345
|
+
* Whether this is the default library (true) or OApp-specific (false).
|
|
346
|
+
*/
|
|
347
|
+
is_default: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* The resolved library address.
|
|
350
|
+
*/
|
|
351
|
+
lib: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Outbound packet containing all information for cross-chain transmission.
|
|
355
|
+
*/
|
|
356
|
+
export interface OutboundPacket {
|
|
357
|
+
/**
|
|
358
|
+
* Destination endpoint ID.
|
|
359
|
+
*/
|
|
360
|
+
dst_eid: u32;
|
|
361
|
+
/**
|
|
362
|
+
* Globally unique identifier for this message.
|
|
363
|
+
*/
|
|
364
|
+
guid: Buffer;
|
|
365
|
+
/**
|
|
366
|
+
* The message payload.
|
|
367
|
+
*/
|
|
368
|
+
message: Buffer;
|
|
369
|
+
/**
|
|
370
|
+
* Outbound nonce for this pathway.
|
|
371
|
+
*/
|
|
372
|
+
nonce: u64;
|
|
373
|
+
/**
|
|
374
|
+
* Receiver address on destination chain (32 bytes).
|
|
375
|
+
*/
|
|
376
|
+
receiver: Buffer;
|
|
377
|
+
/**
|
|
378
|
+
* Sender address on source chain.
|
|
379
|
+
*/
|
|
380
|
+
sender: string;
|
|
381
|
+
/**
|
|
382
|
+
* Source endpoint ID.
|
|
383
|
+
*/
|
|
384
|
+
src_eid: u32;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* A fee recipient with the amount to be paid.
|
|
388
|
+
*/
|
|
389
|
+
export interface FeeRecipient {
|
|
390
|
+
/**
|
|
391
|
+
* Address to receive the fee.
|
|
392
|
+
*/
|
|
393
|
+
address: string;
|
|
394
|
+
/**
|
|
395
|
+
* Amount of fee to pay.
|
|
396
|
+
*/
|
|
397
|
+
amount: i128;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Result of send operation containing fees and encoded packet.
|
|
401
|
+
*/
|
|
402
|
+
export interface FeesAndPacket {
|
|
403
|
+
/**
|
|
404
|
+
* The encoded packet ready for transmission.
|
|
405
|
+
*/
|
|
406
|
+
encoded_packet: Buffer;
|
|
407
|
+
/**
|
|
408
|
+
* List of native token fee recipients (executor, DVNs, treasury).
|
|
409
|
+
*/
|
|
410
|
+
native_fee_recipients: Array<FeeRecipient>;
|
|
411
|
+
/**
|
|
412
|
+
* List of ZRO token fee recipients (treasury).
|
|
413
|
+
*/
|
|
414
|
+
zro_fee_recipients: Array<FeeRecipient>;
|
|
415
|
+
}
|
|
416
|
+
export declare const PacketCodecV1Error: {
|
|
417
|
+
11001: {
|
|
418
|
+
message: string;
|
|
419
|
+
};
|
|
420
|
+
11002: {
|
|
421
|
+
message: string;
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
export declare const WorkerOptionsError: {
|
|
425
|
+
11101: {
|
|
426
|
+
message: string;
|
|
427
|
+
};
|
|
428
|
+
11102: {
|
|
429
|
+
message: string;
|
|
430
|
+
};
|
|
431
|
+
11103: {
|
|
432
|
+
message: string;
|
|
433
|
+
};
|
|
434
|
+
11104: {
|
|
435
|
+
message: string;
|
|
436
|
+
};
|
|
437
|
+
11105: {
|
|
438
|
+
message: string;
|
|
439
|
+
};
|
|
440
|
+
11106: {
|
|
441
|
+
message: string;
|
|
442
|
+
};
|
|
443
|
+
11107: {
|
|
444
|
+
message: string;
|
|
445
|
+
};
|
|
446
|
+
11108: {
|
|
447
|
+
message: string;
|
|
448
|
+
};
|
|
449
|
+
11109: {
|
|
450
|
+
message: string;
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
export declare const BufferReaderError: {
|
|
454
|
+
10000: {
|
|
455
|
+
message: string;
|
|
456
|
+
};
|
|
457
|
+
10001: {
|
|
458
|
+
message: string;
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
export declare const BufferWriterError: {
|
|
462
|
+
10100: {
|
|
463
|
+
message: string;
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
export declare const TtlError: {
|
|
467
|
+
10200: {
|
|
468
|
+
message: string;
|
|
469
|
+
};
|
|
470
|
+
10201: {
|
|
471
|
+
message: string;
|
|
472
|
+
};
|
|
473
|
+
10202: {
|
|
474
|
+
message: string;
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
export declare const OwnableError: {
|
|
478
|
+
10300: {
|
|
479
|
+
message: string;
|
|
480
|
+
};
|
|
481
|
+
10301: {
|
|
482
|
+
message: string;
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
export declare const BytesExtError: {
|
|
486
|
+
10400: {
|
|
487
|
+
message: string;
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
export type DefaultOwnableStorage = {
|
|
491
|
+
tag: "Owner";
|
|
492
|
+
values: void;
|
|
493
|
+
};
|
|
494
|
+
/**
|
|
495
|
+
* A pair of TTL values: threshold (when to trigger extension) and extend_to (target TTL).
|
|
496
|
+
*/
|
|
497
|
+
export interface TtlConfig {
|
|
498
|
+
/**
|
|
499
|
+
* Target TTL after extension (in ledgers).
|
|
500
|
+
*/
|
|
501
|
+
extend_to: u32;
|
|
502
|
+
/**
|
|
503
|
+
* TTL threshold that triggers extension (in ledgers).
|
|
504
|
+
*/
|
|
505
|
+
threshold: u32;
|
|
506
|
+
}
|
|
507
|
+
export type TtlConfigData = {
|
|
508
|
+
tag: "Frozen";
|
|
509
|
+
values: void;
|
|
510
|
+
} | {
|
|
511
|
+
tag: "Instance";
|
|
512
|
+
values: void;
|
|
513
|
+
} | {
|
|
514
|
+
tag: "Persistent";
|
|
515
|
+
values: void;
|
|
516
|
+
} | {
|
|
517
|
+
tag: "Temporary";
|
|
518
|
+
values: void;
|
|
519
|
+
};
|
|
520
|
+
export interface Client {
|
|
521
|
+
/**
|
|
522
|
+
* Construct and simulate a verify transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
523
|
+
* Called by a DVN to verify a message with a specific number of block confirmations.
|
|
524
|
+
*
|
|
525
|
+
* Stores the DVN's verification attestation which will be checked during commit_verification.
|
|
526
|
+
*/
|
|
527
|
+
verify: ({ dvn, packet_header, payload_hash, confirmations }: {
|
|
528
|
+
dvn: string;
|
|
529
|
+
packet_header: Buffer;
|
|
530
|
+
payload_hash: Buffer;
|
|
531
|
+
confirmations: u64;
|
|
532
|
+
}, txnOptions?: {
|
|
533
|
+
/**
|
|
534
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
535
|
+
*/
|
|
536
|
+
fee?: number;
|
|
537
|
+
/**
|
|
538
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
539
|
+
*/
|
|
540
|
+
timeoutInSeconds?: number;
|
|
541
|
+
/**
|
|
542
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
543
|
+
*/
|
|
544
|
+
simulate?: boolean;
|
|
545
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
546
|
+
/**
|
|
547
|
+
* Construct and simulate a commit_verification transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
548
|
+
* Permissonless to commit a verified message to the endpoint after sufficient DVN verification.
|
|
549
|
+
*
|
|
550
|
+
* Validates the packet header and checks that enough DVNs have verified the message
|
|
551
|
+
* (all required DVNs + optional DVN threshold). Once verified, cleans up DVN confirmation
|
|
552
|
+
* storage and calls the endpoint to mark the message as verified and executable.
|
|
553
|
+
*/
|
|
554
|
+
commit_verification: ({ packet_header, payload_hash }: {
|
|
555
|
+
packet_header: Buffer;
|
|
556
|
+
payload_hash: Buffer;
|
|
557
|
+
}, txnOptions?: {
|
|
558
|
+
/**
|
|
559
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
560
|
+
*/
|
|
561
|
+
fee?: number;
|
|
562
|
+
/**
|
|
563
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
564
|
+
*/
|
|
565
|
+
timeoutInSeconds?: number;
|
|
566
|
+
/**
|
|
567
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
568
|
+
*/
|
|
569
|
+
simulate?: boolean;
|
|
570
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
571
|
+
/**
|
|
572
|
+
* Construct and simulate a set_default_receive_uln_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
573
|
+
* Sets default receive ULN configurations for multiple source endpoints.
|
|
574
|
+
*
|
|
575
|
+
* Validates each config and stores it as the default for the specified source EID.
|
|
576
|
+
*/
|
|
577
|
+
set_default_receive_uln_configs: ({ params }: {
|
|
578
|
+
params: Array<SetDefaultUlnConfigParam>;
|
|
579
|
+
}, txnOptions?: {
|
|
580
|
+
/**
|
|
581
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
582
|
+
*/
|
|
583
|
+
fee?: number;
|
|
584
|
+
/**
|
|
585
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
586
|
+
*/
|
|
587
|
+
timeoutInSeconds?: number;
|
|
588
|
+
/**
|
|
589
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
590
|
+
*/
|
|
591
|
+
simulate?: boolean;
|
|
592
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
593
|
+
/**
|
|
594
|
+
* Construct and simulate a confirmations transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
595
|
+
* Returns the number of block confirmations a DVN has submitted for a specific message.
|
|
596
|
+
*/
|
|
597
|
+
confirmations: ({ dvn, header_hash, payload_hash }: {
|
|
598
|
+
dvn: string;
|
|
599
|
+
header_hash: Buffer;
|
|
600
|
+
payload_hash: Buffer;
|
|
601
|
+
}, txnOptions?: {
|
|
602
|
+
/**
|
|
603
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
604
|
+
*/
|
|
605
|
+
fee?: number;
|
|
606
|
+
/**
|
|
607
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
608
|
+
*/
|
|
609
|
+
timeoutInSeconds?: number;
|
|
610
|
+
/**
|
|
611
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
612
|
+
*/
|
|
613
|
+
simulate?: boolean;
|
|
614
|
+
}) => Promise<AssembledTransaction<Option<u64>>>;
|
|
615
|
+
/**
|
|
616
|
+
* Construct and simulate a verifiable transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
617
|
+
* Checks if a message has been sufficiently verified by DVNs and is ready to commit.
|
|
618
|
+
*/
|
|
619
|
+
verifiable: ({ packet_header, payload_hash }: {
|
|
620
|
+
packet_header: Buffer;
|
|
621
|
+
payload_hash: Buffer;
|
|
622
|
+
}, txnOptions?: {
|
|
623
|
+
/**
|
|
624
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
625
|
+
*/
|
|
626
|
+
fee?: number;
|
|
627
|
+
/**
|
|
628
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
629
|
+
*/
|
|
630
|
+
timeoutInSeconds?: number;
|
|
631
|
+
/**
|
|
632
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
633
|
+
*/
|
|
634
|
+
simulate?: boolean;
|
|
635
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
636
|
+
/**
|
|
637
|
+
* Construct and simulate a default_receive_uln_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
638
|
+
* Returns the default receive ULN configuration for a source endpoint.
|
|
639
|
+
*/
|
|
640
|
+
default_receive_uln_config: ({ src_eid }: {
|
|
641
|
+
src_eid: u32;
|
|
642
|
+
}, txnOptions?: {
|
|
643
|
+
/**
|
|
644
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
645
|
+
*/
|
|
646
|
+
fee?: number;
|
|
647
|
+
/**
|
|
648
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
649
|
+
*/
|
|
650
|
+
timeoutInSeconds?: number;
|
|
651
|
+
/**
|
|
652
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
653
|
+
*/
|
|
654
|
+
simulate?: boolean;
|
|
655
|
+
}) => Promise<AssembledTransaction<Option<UlnConfig>>>;
|
|
656
|
+
/**
|
|
657
|
+
* Construct and simulate a oapp_receive_uln_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
658
|
+
* Returns the OApp-specific receive ULN configuration override for a source endpoint.
|
|
659
|
+
*/
|
|
660
|
+
oapp_receive_uln_config: ({ receiver, src_eid }: {
|
|
661
|
+
receiver: string;
|
|
662
|
+
src_eid: u32;
|
|
663
|
+
}, txnOptions?: {
|
|
664
|
+
/**
|
|
665
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
666
|
+
*/
|
|
667
|
+
fee?: number;
|
|
668
|
+
/**
|
|
669
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
670
|
+
*/
|
|
671
|
+
timeoutInSeconds?: number;
|
|
672
|
+
/**
|
|
673
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
674
|
+
*/
|
|
675
|
+
simulate?: boolean;
|
|
676
|
+
}) => Promise<AssembledTransaction<Option<OAppUlnConfig>>>;
|
|
677
|
+
/**
|
|
678
|
+
* Construct and simulate a effective_receive_uln_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
679
|
+
* Returns the effective receive ULN configuration by merging OApp config with defaults.
|
|
680
|
+
*/
|
|
681
|
+
effective_receive_uln_config: ({ receiver, src_eid }: {
|
|
682
|
+
receiver: string;
|
|
683
|
+
src_eid: u32;
|
|
684
|
+
}, txnOptions?: {
|
|
685
|
+
/**
|
|
686
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
687
|
+
*/
|
|
688
|
+
fee?: number;
|
|
689
|
+
/**
|
|
690
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
691
|
+
*/
|
|
692
|
+
timeoutInSeconds?: number;
|
|
693
|
+
/**
|
|
694
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
695
|
+
*/
|
|
696
|
+
simulate?: boolean;
|
|
697
|
+
}) => Promise<AssembledTransaction<UlnConfig>>;
|
|
698
|
+
/**
|
|
699
|
+
* Construct and simulate a set_default_executor_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
700
|
+
* Sets default executor configurations for multiple destination endpoints.
|
|
701
|
+
*/
|
|
702
|
+
set_default_executor_configs: ({ params }: {
|
|
703
|
+
params: Array<SetDefaultExecutorConfigParam>;
|
|
704
|
+
}, txnOptions?: {
|
|
705
|
+
/**
|
|
706
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
707
|
+
*/
|
|
708
|
+
fee?: number;
|
|
709
|
+
/**
|
|
710
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
711
|
+
*/
|
|
712
|
+
timeoutInSeconds?: number;
|
|
713
|
+
/**
|
|
714
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
715
|
+
*/
|
|
716
|
+
simulate?: boolean;
|
|
717
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
718
|
+
/**
|
|
719
|
+
* Construct and simulate a set_default_send_uln_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
720
|
+
* Sets default send ULN configurations for multiple destination endpoints.
|
|
721
|
+
*/
|
|
722
|
+
set_default_send_uln_configs: ({ params }: {
|
|
723
|
+
params: Array<SetDefaultUlnConfigParam>;
|
|
724
|
+
}, txnOptions?: {
|
|
725
|
+
/**
|
|
726
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
727
|
+
*/
|
|
728
|
+
fee?: number;
|
|
729
|
+
/**
|
|
730
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
731
|
+
*/
|
|
732
|
+
timeoutInSeconds?: number;
|
|
733
|
+
/**
|
|
734
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
735
|
+
*/
|
|
736
|
+
simulate?: boolean;
|
|
737
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
738
|
+
/**
|
|
739
|
+
* Construct and simulate a treasury transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
740
|
+
* Returns the treasury address for fee collection.
|
|
741
|
+
*/
|
|
742
|
+
treasury: (txnOptions?: {
|
|
743
|
+
/**
|
|
744
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
745
|
+
*/
|
|
746
|
+
fee?: number;
|
|
747
|
+
/**
|
|
748
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
749
|
+
*/
|
|
750
|
+
timeoutInSeconds?: number;
|
|
751
|
+
/**
|
|
752
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
753
|
+
*/
|
|
754
|
+
simulate?: boolean;
|
|
755
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
756
|
+
/**
|
|
757
|
+
* Construct and simulate a default_executor_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
758
|
+
* Returns the default executor configuration for a destination endpoint.
|
|
759
|
+
*/
|
|
760
|
+
default_executor_config: ({ dst_eid }: {
|
|
761
|
+
dst_eid: u32;
|
|
762
|
+
}, txnOptions?: {
|
|
763
|
+
/**
|
|
764
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
765
|
+
*/
|
|
766
|
+
fee?: number;
|
|
767
|
+
/**
|
|
768
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
769
|
+
*/
|
|
770
|
+
timeoutInSeconds?: number;
|
|
771
|
+
/**
|
|
772
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
773
|
+
*/
|
|
774
|
+
simulate?: boolean;
|
|
775
|
+
}) => Promise<AssembledTransaction<Option<ExecutorConfig>>>;
|
|
776
|
+
/**
|
|
777
|
+
* Construct and simulate a oapp_executor_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
778
|
+
* Returns the OApp-specific executor configuration for a destination endpoint.
|
|
779
|
+
*/
|
|
780
|
+
oapp_executor_config: ({ sender, dst_eid }: {
|
|
781
|
+
sender: string;
|
|
782
|
+
dst_eid: u32;
|
|
783
|
+
}, txnOptions?: {
|
|
784
|
+
/**
|
|
785
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
786
|
+
*/
|
|
787
|
+
fee?: number;
|
|
788
|
+
/**
|
|
789
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
790
|
+
*/
|
|
791
|
+
timeoutInSeconds?: number;
|
|
792
|
+
/**
|
|
793
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
794
|
+
*/
|
|
795
|
+
simulate?: boolean;
|
|
796
|
+
}) => Promise<AssembledTransaction<Option<OAppExecutorConfig>>>;
|
|
797
|
+
/**
|
|
798
|
+
* Construct and simulate a effective_executor_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
799
|
+
* Returns the effective executor configuration by merging OApp config with default.
|
|
800
|
+
*/
|
|
801
|
+
effective_executor_config: ({ sender, dst_eid }: {
|
|
802
|
+
sender: string;
|
|
803
|
+
dst_eid: u32;
|
|
804
|
+
}, txnOptions?: {
|
|
805
|
+
/**
|
|
806
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
807
|
+
*/
|
|
808
|
+
fee?: number;
|
|
809
|
+
/**
|
|
810
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
811
|
+
*/
|
|
812
|
+
timeoutInSeconds?: number;
|
|
813
|
+
/**
|
|
814
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
815
|
+
*/
|
|
816
|
+
simulate?: boolean;
|
|
817
|
+
}) => Promise<AssembledTransaction<ExecutorConfig>>;
|
|
818
|
+
/**
|
|
819
|
+
* Construct and simulate a default_send_uln_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
820
|
+
* Returns the default send ULN configuration for a destination endpoint.
|
|
821
|
+
*/
|
|
822
|
+
default_send_uln_config: ({ dst_eid }: {
|
|
823
|
+
dst_eid: u32;
|
|
824
|
+
}, txnOptions?: {
|
|
825
|
+
/**
|
|
826
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
827
|
+
*/
|
|
828
|
+
fee?: number;
|
|
829
|
+
/**
|
|
830
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
831
|
+
*/
|
|
832
|
+
timeoutInSeconds?: number;
|
|
833
|
+
/**
|
|
834
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
835
|
+
*/
|
|
836
|
+
simulate?: boolean;
|
|
837
|
+
}) => Promise<AssembledTransaction<Option<UlnConfig>>>;
|
|
838
|
+
/**
|
|
839
|
+
* Construct and simulate a oapp_send_uln_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
840
|
+
* Returns the OApp-specific send ULN configuration for a destination endpoint.
|
|
841
|
+
*/
|
|
842
|
+
oapp_send_uln_config: ({ sender, dst_eid }: {
|
|
843
|
+
sender: string;
|
|
844
|
+
dst_eid: u32;
|
|
845
|
+
}, txnOptions?: {
|
|
846
|
+
/**
|
|
847
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
848
|
+
*/
|
|
849
|
+
fee?: number;
|
|
850
|
+
/**
|
|
851
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
852
|
+
*/
|
|
853
|
+
timeoutInSeconds?: number;
|
|
854
|
+
/**
|
|
855
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
856
|
+
*/
|
|
857
|
+
simulate?: boolean;
|
|
858
|
+
}) => Promise<AssembledTransaction<Option<OAppUlnConfig>>>;
|
|
859
|
+
/**
|
|
860
|
+
* Construct and simulate a effective_send_uln_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
861
|
+
* Returns the effective send ULN configuration by merging OApp config with default.
|
|
862
|
+
*/
|
|
863
|
+
effective_send_uln_config: ({ sender, dst_eid }: {
|
|
864
|
+
sender: string;
|
|
865
|
+
dst_eid: u32;
|
|
866
|
+
}, txnOptions?: {
|
|
867
|
+
/**
|
|
868
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
869
|
+
*/
|
|
870
|
+
fee?: number;
|
|
871
|
+
/**
|
|
872
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
873
|
+
*/
|
|
874
|
+
timeoutInSeconds?: number;
|
|
875
|
+
/**
|
|
876
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
877
|
+
*/
|
|
878
|
+
simulate?: boolean;
|
|
879
|
+
}) => Promise<AssembledTransaction<UlnConfig>>;
|
|
880
|
+
/**
|
|
881
|
+
* Construct and simulate a quote transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
882
|
+
* Quotes the total fee for sending a cross-chain message.
|
|
883
|
+
*
|
|
884
|
+
* Calculates fees from: executor (message execution), DVNs (verification), and treasury (protocol fee).
|
|
885
|
+
*/
|
|
886
|
+
quote: ({ packet, options, pay_in_zro }: {
|
|
887
|
+
packet: OutboundPacket;
|
|
888
|
+
options: Buffer;
|
|
889
|
+
pay_in_zro: boolean;
|
|
890
|
+
}, txnOptions?: {
|
|
891
|
+
/**
|
|
892
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
893
|
+
*/
|
|
894
|
+
fee?: number;
|
|
895
|
+
/**
|
|
896
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
897
|
+
*/
|
|
898
|
+
timeoutInSeconds?: number;
|
|
899
|
+
/**
|
|
900
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
901
|
+
*/
|
|
902
|
+
simulate?: boolean;
|
|
903
|
+
}) => Promise<AssembledTransaction<MessagingFee>>;
|
|
904
|
+
/**
|
|
905
|
+
* Construct and simulate a send transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
906
|
+
* Sends a cross-chain message and returns fee recipients for payment.
|
|
907
|
+
*
|
|
908
|
+
* Assigns executor and DVNs, calculates fees, and encodes the packet for transmission.
|
|
909
|
+
*/
|
|
910
|
+
send: ({ packet, options, pay_in_zro }: {
|
|
911
|
+
packet: OutboundPacket;
|
|
912
|
+
options: Buffer;
|
|
913
|
+
pay_in_zro: boolean;
|
|
914
|
+
}, txnOptions?: {
|
|
915
|
+
/**
|
|
916
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
917
|
+
*/
|
|
918
|
+
fee?: number;
|
|
919
|
+
/**
|
|
920
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
921
|
+
*/
|
|
922
|
+
timeoutInSeconds?: number;
|
|
923
|
+
/**
|
|
924
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
925
|
+
*/
|
|
926
|
+
simulate?: boolean;
|
|
927
|
+
}) => Promise<AssembledTransaction<FeesAndPacket>>;
|
|
928
|
+
/**
|
|
929
|
+
* Construct and simulate a set_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
930
|
+
* Sets OApp-specific configuration parameters for the message library.
|
|
931
|
+
*
|
|
932
|
+
* Called by the endpoint on behalf of the OApp to configure executor and ULN settings.
|
|
933
|
+
* Supports three config types: EXECUTOR, SEND_ULN, and RECEIVE_ULN.
|
|
934
|
+
*/
|
|
935
|
+
set_config: ({ oapp, params }: {
|
|
936
|
+
oapp: string;
|
|
937
|
+
params: Array<SetConfigParam>;
|
|
938
|
+
}, txnOptions?: {
|
|
939
|
+
/**
|
|
940
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
941
|
+
*/
|
|
942
|
+
fee?: number;
|
|
943
|
+
/**
|
|
944
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
945
|
+
*/
|
|
946
|
+
timeoutInSeconds?: number;
|
|
947
|
+
/**
|
|
948
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
949
|
+
*/
|
|
950
|
+
simulate?: boolean;
|
|
951
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
952
|
+
/**
|
|
953
|
+
* Construct and simulate a get_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
954
|
+
* Returns the XDR-encoded effective configuration bytes.
|
|
955
|
+
*/
|
|
956
|
+
get_config: ({ eid, oapp, config_type }: {
|
|
957
|
+
eid: u32;
|
|
958
|
+
oapp: string;
|
|
959
|
+
config_type: u32;
|
|
960
|
+
}, txnOptions?: {
|
|
961
|
+
/**
|
|
962
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
963
|
+
*/
|
|
964
|
+
fee?: number;
|
|
965
|
+
/**
|
|
966
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
967
|
+
*/
|
|
968
|
+
timeoutInSeconds?: number;
|
|
969
|
+
/**
|
|
970
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
971
|
+
*/
|
|
972
|
+
simulate?: boolean;
|
|
973
|
+
}) => Promise<AssembledTransaction<Buffer>>;
|
|
974
|
+
/**
|
|
975
|
+
* Construct and simulate a is_supported_eid transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
976
|
+
* Returns true if the message library has default send and receive ULN configurations for the endpoint ID.
|
|
977
|
+
*/
|
|
978
|
+
is_supported_eid: ({ eid }: {
|
|
979
|
+
eid: u32;
|
|
980
|
+
}, txnOptions?: {
|
|
981
|
+
/**
|
|
982
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
983
|
+
*/
|
|
984
|
+
fee?: number;
|
|
985
|
+
/**
|
|
986
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
987
|
+
*/
|
|
988
|
+
timeoutInSeconds?: number;
|
|
989
|
+
/**
|
|
990
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
991
|
+
*/
|
|
992
|
+
simulate?: boolean;
|
|
993
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
994
|
+
/**
|
|
995
|
+
* Construct and simulate a version transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
996
|
+
* Returns the version of the message library.
|
|
997
|
+
*/
|
|
998
|
+
version: (txnOptions?: {
|
|
999
|
+
/**
|
|
1000
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1001
|
+
*/
|
|
1002
|
+
fee?: number;
|
|
1003
|
+
/**
|
|
1004
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1005
|
+
*/
|
|
1006
|
+
timeoutInSeconds?: number;
|
|
1007
|
+
/**
|
|
1008
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1009
|
+
*/
|
|
1010
|
+
simulate?: boolean;
|
|
1011
|
+
}) => Promise<AssembledTransaction<MessageLibVersion>>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Construct and simulate a message_lib_type transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1014
|
+
* Returns the type of the message library.
|
|
1015
|
+
*/
|
|
1016
|
+
message_lib_type: (txnOptions?: {
|
|
1017
|
+
/**
|
|
1018
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1019
|
+
*/
|
|
1020
|
+
fee?: number;
|
|
1021
|
+
/**
|
|
1022
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1023
|
+
*/
|
|
1024
|
+
timeoutInSeconds?: number;
|
|
1025
|
+
/**
|
|
1026
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1027
|
+
*/
|
|
1028
|
+
simulate?: boolean;
|
|
1029
|
+
}) => Promise<AssembledTransaction<MessageLibType>>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Construct and simulate a endpoint transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1032
|
+
* Returns the LayerZero endpoint contract address.
|
|
1033
|
+
*/
|
|
1034
|
+
endpoint: (txnOptions?: {
|
|
1035
|
+
/**
|
|
1036
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1037
|
+
*/
|
|
1038
|
+
fee?: number;
|
|
1039
|
+
/**
|
|
1040
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1041
|
+
*/
|
|
1042
|
+
timeoutInSeconds?: number;
|
|
1043
|
+
/**
|
|
1044
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1045
|
+
*/
|
|
1046
|
+
simulate?: boolean;
|
|
1047
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Construct and simulate a owner transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1050
|
+
*/
|
|
1051
|
+
owner: (txnOptions?: {
|
|
1052
|
+
/**
|
|
1053
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1054
|
+
*/
|
|
1055
|
+
fee?: number;
|
|
1056
|
+
/**
|
|
1057
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1058
|
+
*/
|
|
1059
|
+
timeoutInSeconds?: number;
|
|
1060
|
+
/**
|
|
1061
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1062
|
+
*/
|
|
1063
|
+
simulate?: boolean;
|
|
1064
|
+
}) => Promise<AssembledTransaction<Option<string>>>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Construct and simulate a transfer_ownership transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1067
|
+
*/
|
|
1068
|
+
transfer_ownership: ({ new_owner }: {
|
|
1069
|
+
new_owner: string;
|
|
1070
|
+
}, txnOptions?: {
|
|
1071
|
+
/**
|
|
1072
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1073
|
+
*/
|
|
1074
|
+
fee?: number;
|
|
1075
|
+
/**
|
|
1076
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1077
|
+
*/
|
|
1078
|
+
timeoutInSeconds?: number;
|
|
1079
|
+
/**
|
|
1080
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1081
|
+
*/
|
|
1082
|
+
simulate?: boolean;
|
|
1083
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1084
|
+
/**
|
|
1085
|
+
* Construct and simulate a renounce_ownership transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1086
|
+
*/
|
|
1087
|
+
renounce_ownership: (txnOptions?: {
|
|
1088
|
+
/**
|
|
1089
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1090
|
+
*/
|
|
1091
|
+
fee?: number;
|
|
1092
|
+
/**
|
|
1093
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1094
|
+
*/
|
|
1095
|
+
timeoutInSeconds?: number;
|
|
1096
|
+
/**
|
|
1097
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1098
|
+
*/
|
|
1099
|
+
simulate?: boolean;
|
|
1100
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Construct and simulate a set_ttl_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1103
|
+
*/
|
|
1104
|
+
set_ttl_config: ({ instance, persistent, temporary }: {
|
|
1105
|
+
instance: Option<TtlConfig>;
|
|
1106
|
+
persistent: Option<TtlConfig>;
|
|
1107
|
+
temporary: Option<TtlConfig>;
|
|
1108
|
+
}, txnOptions?: {
|
|
1109
|
+
/**
|
|
1110
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1111
|
+
*/
|
|
1112
|
+
fee?: number;
|
|
1113
|
+
/**
|
|
1114
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1115
|
+
*/
|
|
1116
|
+
timeoutInSeconds?: number;
|
|
1117
|
+
/**
|
|
1118
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1119
|
+
*/
|
|
1120
|
+
simulate?: boolean;
|
|
1121
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1122
|
+
/**
|
|
1123
|
+
* Construct and simulate a ttl_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1124
|
+
*/
|
|
1125
|
+
ttl_config: (txnOptions?: {
|
|
1126
|
+
/**
|
|
1127
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1128
|
+
*/
|
|
1129
|
+
fee?: number;
|
|
1130
|
+
/**
|
|
1131
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1132
|
+
*/
|
|
1133
|
+
timeoutInSeconds?: number;
|
|
1134
|
+
/**
|
|
1135
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1136
|
+
*/
|
|
1137
|
+
simulate?: boolean;
|
|
1138
|
+
}) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>, Option<TtlConfig>]>>;
|
|
1139
|
+
/**
|
|
1140
|
+
* Construct and simulate a freeze_ttl_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1141
|
+
*/
|
|
1142
|
+
freeze_ttl_config: (txnOptions?: {
|
|
1143
|
+
/**
|
|
1144
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1145
|
+
*/
|
|
1146
|
+
fee?: number;
|
|
1147
|
+
/**
|
|
1148
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1149
|
+
*/
|
|
1150
|
+
timeoutInSeconds?: number;
|
|
1151
|
+
/**
|
|
1152
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1153
|
+
*/
|
|
1154
|
+
simulate?: boolean;
|
|
1155
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Construct and simulate a is_ttl_config_frozen transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1158
|
+
*/
|
|
1159
|
+
is_ttl_config_frozen: (txnOptions?: {
|
|
1160
|
+
/**
|
|
1161
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1162
|
+
*/
|
|
1163
|
+
fee?: number;
|
|
1164
|
+
/**
|
|
1165
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1166
|
+
*/
|
|
1167
|
+
timeoutInSeconds?: number;
|
|
1168
|
+
/**
|
|
1169
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1170
|
+
*/
|
|
1171
|
+
simulate?: boolean;
|
|
1172
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
1173
|
+
}
|
|
1174
|
+
export declare class Client extends ContractClient {
|
|
1175
|
+
readonly options: ContractClientOptions;
|
|
1176
|
+
static deploy<T = Client>(
|
|
1177
|
+
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
1178
|
+
{ owner, endpoint, treasury }: {
|
|
1179
|
+
owner: string;
|
|
1180
|
+
endpoint: string;
|
|
1181
|
+
treasury: string;
|
|
1182
|
+
},
|
|
1183
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
1184
|
+
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
1185
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
1186
|
+
wasmHash: Buffer | string;
|
|
1187
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
1188
|
+
salt?: Buffer | Uint8Array;
|
|
1189
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
1190
|
+
format?: "hex" | "base64";
|
|
1191
|
+
}): Promise<AssembledTransaction<T>>;
|
|
1192
|
+
constructor(options: ContractClientOptions);
|
|
1193
|
+
readonly fromJSON: {
|
|
1194
|
+
verify: (json: string) => AssembledTransaction<null>;
|
|
1195
|
+
commit_verification: (json: string) => AssembledTransaction<null>;
|
|
1196
|
+
set_default_receive_uln_configs: (json: string) => AssembledTransaction<null>;
|
|
1197
|
+
confirmations: (json: string) => AssembledTransaction<Option<bigint>>;
|
|
1198
|
+
verifiable: (json: string) => AssembledTransaction<boolean>;
|
|
1199
|
+
default_receive_uln_config: (json: string) => AssembledTransaction<Option<UlnConfig>>;
|
|
1200
|
+
oapp_receive_uln_config: (json: string) => AssembledTransaction<Option<OAppUlnConfig>>;
|
|
1201
|
+
effective_receive_uln_config: (json: string) => AssembledTransaction<UlnConfig>;
|
|
1202
|
+
set_default_executor_configs: (json: string) => AssembledTransaction<null>;
|
|
1203
|
+
set_default_send_uln_configs: (json: string) => AssembledTransaction<null>;
|
|
1204
|
+
treasury: (json: string) => AssembledTransaction<string>;
|
|
1205
|
+
default_executor_config: (json: string) => AssembledTransaction<Option<ExecutorConfig>>;
|
|
1206
|
+
oapp_executor_config: (json: string) => AssembledTransaction<Option<OAppExecutorConfig>>;
|
|
1207
|
+
effective_executor_config: (json: string) => AssembledTransaction<ExecutorConfig>;
|
|
1208
|
+
default_send_uln_config: (json: string) => AssembledTransaction<Option<UlnConfig>>;
|
|
1209
|
+
oapp_send_uln_config: (json: string) => AssembledTransaction<Option<OAppUlnConfig>>;
|
|
1210
|
+
effective_send_uln_config: (json: string) => AssembledTransaction<UlnConfig>;
|
|
1211
|
+
quote: (json: string) => AssembledTransaction<MessagingFee>;
|
|
1212
|
+
send: (json: string) => AssembledTransaction<FeesAndPacket>;
|
|
1213
|
+
set_config: (json: string) => AssembledTransaction<null>;
|
|
1214
|
+
get_config: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
|
|
1215
|
+
is_supported_eid: (json: string) => AssembledTransaction<boolean>;
|
|
1216
|
+
version: (json: string) => AssembledTransaction<MessageLibVersion>;
|
|
1217
|
+
message_lib_type: (json: string) => AssembledTransaction<MessageLibType>;
|
|
1218
|
+
endpoint: (json: string) => AssembledTransaction<string>;
|
|
1219
|
+
owner: (json: string) => AssembledTransaction<Option<string>>;
|
|
1220
|
+
transfer_ownership: (json: string) => AssembledTransaction<null>;
|
|
1221
|
+
renounce_ownership: (json: string) => AssembledTransaction<null>;
|
|
1222
|
+
set_ttl_config: (json: string) => AssembledTransaction<null>;
|
|
1223
|
+
ttl_config: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>, Option<TtlConfig>]>;
|
|
1224
|
+
freeze_ttl_config: (json: string) => AssembledTransaction<null>;
|
|
1225
|
+
is_ttl_config_frozen: (json: string) => AssembledTransaction<boolean>;
|
|
1226
|
+
};
|
|
1227
|
+
}
|