@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.
@@ -0,0 +1,1676 @@
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
+ * Parameters for sending a cross-chain message.
9
+ */
10
+ export interface MessagingParams {
11
+ /**
12
+ * Destination endpoint ID (chain identifier).
13
+ */
14
+ dst_eid: u32;
15
+ /**
16
+ * The message payload to send.
17
+ */
18
+ message: Buffer;
19
+ /**
20
+ * Encoded executor and DVN options.
21
+ */
22
+ options: Buffer;
23
+ /**
24
+ * Whether to pay fees in ZRO token instead of native token.
25
+ */
26
+ pay_in_zro: boolean;
27
+ /**
28
+ * Receiver address on the destination chain (32 bytes).
29
+ */
30
+ receiver: Buffer;
31
+ }
32
+ /**
33
+ * Source message information identifying where a cross-chain message came from.
34
+ */
35
+ export interface Origin {
36
+ /**
37
+ * Nonce for this pathway.
38
+ */
39
+ nonce: u64;
40
+ /**
41
+ * Sender address on the source chain (32 bytes).
42
+ */
43
+ sender: Buffer;
44
+ /**
45
+ * Source endpoint ID (chain identifier).
46
+ */
47
+ src_eid: u32;
48
+ }
49
+ /**
50
+ * Fee structure for cross-chain messaging.
51
+ */
52
+ export interface MessagingFee {
53
+ /**
54
+ * Fee paid in native token (XLM).
55
+ */
56
+ native_fee: i128;
57
+ /**
58
+ * Fee paid in ZRO token (LayerZero token).
59
+ */
60
+ zro_fee: i128;
61
+ }
62
+ /**
63
+ * Receipt returned after successfully sending a cross-chain message.
64
+ */
65
+ export interface MessagingReceipt {
66
+ /**
67
+ * The fees charged for sending the message.
68
+ */
69
+ fee: MessagingFee;
70
+ /**
71
+ * Globally unique identifier for the message.
72
+ */
73
+ guid: Buffer;
74
+ /**
75
+ * The outbound nonce for this pathway.
76
+ */
77
+ nonce: u64;
78
+ }
79
+ /**
80
+ * Type of message library indicating supported operations.
81
+ */
82
+ export type MessageLibType = {
83
+ tag: "Send";
84
+ values: void;
85
+ } | {
86
+ tag: "Receive";
87
+ values: void;
88
+ } | {
89
+ tag: "SendAndReceive";
90
+ values: void;
91
+ };
92
+ /**
93
+ * Version information for a message library.
94
+ *
95
+ * Note: `minor` and `endpoint_version` use `u32` instead of `u8` because Stellar does not
96
+ * support `u8` types in contract interface functions.
97
+ */
98
+ export interface MessageLibVersion {
99
+ /**
100
+ * Endpoint version (should not exceed u8::MAX = 255).
101
+ */
102
+ endpoint_version: u32;
103
+ /**
104
+ * Major version number.
105
+ */
106
+ major: u64;
107
+ /**
108
+ * Minor version number (should not exceed u8::MAX = 255).
109
+ */
110
+ minor: u32;
111
+ }
112
+ /**
113
+ * Timeout configuration for receive library transitions.
114
+ */
115
+ export interface Timeout {
116
+ /**
117
+ * Unix timestamp when the timeout expires.
118
+ */
119
+ expiry: u64;
120
+ /**
121
+ * The new library address to transition to.
122
+ */
123
+ lib: string;
124
+ }
125
+ /**
126
+ * Parameters for setting message library configuration.
127
+ */
128
+ export interface SetConfigParam {
129
+ /**
130
+ * XDR-encoded configuration data.
131
+ */
132
+ config: Buffer;
133
+ /**
134
+ * The type of configuration (e.g., executor, ULN).
135
+ */
136
+ config_type: u32;
137
+ /**
138
+ * The endpoint ID this config applies to.
139
+ */
140
+ eid: u32;
141
+ }
142
+ /**
143
+ * Resolved library information with default status.
144
+ */
145
+ export interface ResolvedLibrary {
146
+ /**
147
+ * Whether this is the default library (true) or OApp-specific (false).
148
+ */
149
+ is_default: boolean;
150
+ /**
151
+ * The resolved library address.
152
+ */
153
+ lib: string;
154
+ }
155
+ /**
156
+ * Outbound packet containing all information for cross-chain transmission.
157
+ */
158
+ export interface OutboundPacket {
159
+ /**
160
+ * Destination endpoint ID.
161
+ */
162
+ dst_eid: u32;
163
+ /**
164
+ * Globally unique identifier for this message.
165
+ */
166
+ guid: Buffer;
167
+ /**
168
+ * The message payload.
169
+ */
170
+ message: Buffer;
171
+ /**
172
+ * Outbound nonce for this pathway.
173
+ */
174
+ nonce: u64;
175
+ /**
176
+ * Receiver address on destination chain (32 bytes).
177
+ */
178
+ receiver: Buffer;
179
+ /**
180
+ * Sender address on source chain.
181
+ */
182
+ sender: string;
183
+ /**
184
+ * Source endpoint ID.
185
+ */
186
+ src_eid: u32;
187
+ }
188
+ /**
189
+ * A fee recipient with the amount to be paid.
190
+ */
191
+ export interface FeeRecipient {
192
+ /**
193
+ * Address to receive the fee.
194
+ */
195
+ address: string;
196
+ /**
197
+ * Amount of fee to pay.
198
+ */
199
+ amount: i128;
200
+ }
201
+ /**
202
+ * Result of send operation containing fees and encoded packet.
203
+ */
204
+ export interface FeesAndPacket {
205
+ /**
206
+ * The encoded packet ready for transmission.
207
+ */
208
+ encoded_packet: Buffer;
209
+ /**
210
+ * List of native token fee recipients (executor, DVNs, treasury).
211
+ */
212
+ native_fee_recipients: Array<FeeRecipient>;
213
+ /**
214
+ * List of ZRO token fee recipients (treasury).
215
+ */
216
+ zro_fee_recipients: Array<FeeRecipient>;
217
+ }
218
+ export type EndpointStorage = {
219
+ tag: "ZRO";
220
+ values: void;
221
+ } | {
222
+ tag: "Delegate";
223
+ values: readonly [string];
224
+ } | {
225
+ tag: "LazyInboundNonce";
226
+ values: readonly [string, u32, Buffer];
227
+ } | {
228
+ tag: "InboundPayloadHash";
229
+ values: readonly [string, u32, Buffer, u64];
230
+ } | {
231
+ tag: "OutboundNonce";
232
+ values: readonly [string, u32, Buffer];
233
+ } | {
234
+ tag: "RegisteredLibraryCount";
235
+ values: void;
236
+ } | {
237
+ tag: "LibraryToIndex";
238
+ values: readonly [string];
239
+ } | {
240
+ tag: "IndexToLibrary";
241
+ values: readonly [u32];
242
+ } | {
243
+ tag: "DefaultSendLibrary";
244
+ values: readonly [u32];
245
+ } | {
246
+ tag: "DefaultReceiveLibrary";
247
+ values: readonly [u32];
248
+ } | {
249
+ tag: "DefaultReceiveLibraryTimeout";
250
+ values: readonly [u32];
251
+ } | {
252
+ tag: "SendLibrary";
253
+ values: readonly [string, u32];
254
+ } | {
255
+ tag: "ReceiveLibrary";
256
+ values: readonly [string, u32];
257
+ } | {
258
+ tag: "ReceiveLibraryTimeout";
259
+ values: readonly [string, u32];
260
+ } | {
261
+ tag: "ComposeQueue";
262
+ values: readonly [string, string, Buffer, u32];
263
+ };
264
+ export declare const EndpointError: {
265
+ 1: {
266
+ message: string;
267
+ };
268
+ 2: {
269
+ message: string;
270
+ };
271
+ 3: {
272
+ message: string;
273
+ };
274
+ 4: {
275
+ message: string;
276
+ };
277
+ 5: {
278
+ message: string;
279
+ };
280
+ 6: {
281
+ message: string;
282
+ };
283
+ 7: {
284
+ message: string;
285
+ };
286
+ 8: {
287
+ message: string;
288
+ };
289
+ 9: {
290
+ message: string;
291
+ };
292
+ 10: {
293
+ message: string;
294
+ };
295
+ 11: {
296
+ message: string;
297
+ };
298
+ 12: {
299
+ message: string;
300
+ };
301
+ 13: {
302
+ message: string;
303
+ };
304
+ 14: {
305
+ message: string;
306
+ };
307
+ 15: {
308
+ message: string;
309
+ };
310
+ 16: {
311
+ message: string;
312
+ };
313
+ 17: {
314
+ message: string;
315
+ };
316
+ 18: {
317
+ message: string;
318
+ };
319
+ 19: {
320
+ message: string;
321
+ };
322
+ 20: {
323
+ message: string;
324
+ };
325
+ 21: {
326
+ message: string;
327
+ };
328
+ 22: {
329
+ message: string;
330
+ };
331
+ 23: {
332
+ message: string;
333
+ };
334
+ 24: {
335
+ message: string;
336
+ };
337
+ };
338
+ export declare const BufferReaderError: {
339
+ 10000: {
340
+ message: string;
341
+ };
342
+ 10001: {
343
+ message: string;
344
+ };
345
+ };
346
+ export declare const BufferWriterError: {
347
+ 10100: {
348
+ message: string;
349
+ };
350
+ };
351
+ export declare const TtlError: {
352
+ 10200: {
353
+ message: string;
354
+ };
355
+ 10201: {
356
+ message: string;
357
+ };
358
+ 10202: {
359
+ message: string;
360
+ };
361
+ };
362
+ export declare const OwnableError: {
363
+ 10300: {
364
+ message: string;
365
+ };
366
+ 10301: {
367
+ message: string;
368
+ };
369
+ };
370
+ export declare const BytesExtError: {
371
+ 10400: {
372
+ message: string;
373
+ };
374
+ };
375
+ export type DefaultOwnableStorage = {
376
+ tag: "Owner";
377
+ values: void;
378
+ };
379
+ /**
380
+ * A pair of TTL values: threshold (when to trigger extension) and extend_to (target TTL).
381
+ */
382
+ export interface TtlConfig {
383
+ /**
384
+ * Target TTL after extension (in ledgers).
385
+ */
386
+ extend_to: u32;
387
+ /**
388
+ * TTL threshold that triggers extension (in ledgers).
389
+ */
390
+ threshold: u32;
391
+ }
392
+ export type TtlConfigData = {
393
+ tag: "Frozen";
394
+ values: void;
395
+ } | {
396
+ tag: "Instance";
397
+ values: void;
398
+ } | {
399
+ tag: "Persistent";
400
+ values: void;
401
+ } | {
402
+ tag: "Temporary";
403
+ values: void;
404
+ };
405
+ export interface Client {
406
+ /**
407
+ * Construct and simulate a send_compose 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.
408
+ * Sends a composed message from an OApp to a composer.
409
+ *
410
+ * The composer MUST assert the sender because anyone can send compose msg with this function.
411
+ * With the same GUID, the OApp can send compose to multiple composers at the same time.
412
+ */
413
+ send_compose: ({ from, to, guid, index, message }: {
414
+ from: string;
415
+ to: string;
416
+ guid: Buffer;
417
+ index: u32;
418
+ message: Buffer;
419
+ }, txnOptions?: {
420
+ /**
421
+ * The fee to pay for the transaction. Default: BASE_FEE
422
+ */
423
+ fee?: number;
424
+ /**
425
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
426
+ */
427
+ timeoutInSeconds?: number;
428
+ /**
429
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
430
+ */
431
+ simulate?: boolean;
432
+ }) => Promise<AssembledTransaction<null>>;
433
+ /**
434
+ * Construct and simulate a clear_compose 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.
435
+ * Clears a composed message by the composer.
436
+ *
437
+ * This is a PULL mode versus the PUSH mode of `lz_compose`.
438
+ */
439
+ clear_compose: ({ composer, from, guid, index, message }: {
440
+ composer: string;
441
+ from: string;
442
+ guid: Buffer;
443
+ index: u32;
444
+ message: Buffer;
445
+ }, txnOptions?: {
446
+ /**
447
+ * The fee to pay for the transaction. Default: BASE_FEE
448
+ */
449
+ fee?: number;
450
+ /**
451
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
452
+ */
453
+ timeoutInSeconds?: number;
454
+ /**
455
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
456
+ */
457
+ simulate?: boolean;
458
+ }) => Promise<AssembledTransaction<null>>;
459
+ /**
460
+ * Construct and simulate a lz_compose_alert 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.
461
+ * Emits an alert event when `lz_compose` execution fails.
462
+ *
463
+ * Called by the executor to notify about failed compose message delivery attempts.
464
+ */
465
+ lz_compose_alert: ({ executor, from, to, guid, index, gas, value, message, extra_data, reason }: {
466
+ executor: string;
467
+ from: string;
468
+ to: string;
469
+ guid: Buffer;
470
+ index: u32;
471
+ gas: i128;
472
+ value: i128;
473
+ message: Buffer;
474
+ extra_data: Buffer;
475
+ reason: Buffer;
476
+ }, txnOptions?: {
477
+ /**
478
+ * The fee to pay for the transaction. Default: BASE_FEE
479
+ */
480
+ fee?: number;
481
+ /**
482
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
483
+ */
484
+ timeoutInSeconds?: number;
485
+ /**
486
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
487
+ */
488
+ simulate?: boolean;
489
+ }) => Promise<AssembledTransaction<null>>;
490
+ /**
491
+ * Construct and simulate a compose_queue 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.
492
+ * Returns the stored hash for a composed message, or `None` if not queued.
493
+ */
494
+ compose_queue: ({ from, to, guid, index }: {
495
+ from: string;
496
+ to: string;
497
+ guid: Buffer;
498
+ index: u32;
499
+ }, txnOptions?: {
500
+ /**
501
+ * The fee to pay for the transaction. Default: BASE_FEE
502
+ */
503
+ fee?: number;
504
+ /**
505
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
506
+ */
507
+ timeoutInSeconds?: number;
508
+ /**
509
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
510
+ */
511
+ simulate?: boolean;
512
+ }) => Promise<AssembledTransaction<Option<Buffer>>>;
513
+ /**
514
+ * Construct and simulate a skip 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.
515
+ * Skips the next expected inbound nonce without verifying.
516
+ *
517
+ * The nonce to skip must be the next expected nonce.
518
+ */
519
+ skip: ({ caller, receiver, src_eid, sender, nonce }: {
520
+ caller: string;
521
+ receiver: string;
522
+ src_eid: u32;
523
+ sender: Buffer;
524
+ nonce: u64;
525
+ }, txnOptions?: {
526
+ /**
527
+ * The fee to pay for the transaction. Default: BASE_FEE
528
+ */
529
+ fee?: number;
530
+ /**
531
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
532
+ */
533
+ timeoutInSeconds?: number;
534
+ /**
535
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
536
+ */
537
+ simulate?: boolean;
538
+ }) => Promise<AssembledTransaction<null>>;
539
+ /**
540
+ * Construct and simulate a nilify 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.
541
+ * Marks a packet as verified, but disallows execution until it is re-verified.
542
+ *
543
+ * Requires the payload hash not been executed.
544
+ */
545
+ nilify: ({ caller, receiver, src_eid, sender, nonce, payload_hash }: {
546
+ caller: string;
547
+ receiver: string;
548
+ src_eid: u32;
549
+ sender: Buffer;
550
+ nonce: u64;
551
+ payload_hash: Option<Buffer>;
552
+ }, txnOptions?: {
553
+ /**
554
+ * The fee to pay for the transaction. Default: BASE_FEE
555
+ */
556
+ fee?: number;
557
+ /**
558
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
559
+ */
560
+ timeoutInSeconds?: number;
561
+ /**
562
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
563
+ */
564
+ simulate?: boolean;
565
+ }) => Promise<AssembledTransaction<null>>;
566
+ /**
567
+ * Construct and simulate a burn 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.
568
+ * Marks a nonce as unexecutable and un-verifiable. The nonce can never be re-verified or executed.
569
+ */
570
+ burn: ({ caller, receiver, src_eid, sender, nonce, payload_hash }: {
571
+ caller: string;
572
+ receiver: string;
573
+ src_eid: u32;
574
+ sender: Buffer;
575
+ nonce: u64;
576
+ payload_hash: Buffer;
577
+ }, txnOptions?: {
578
+ /**
579
+ * The fee to pay for the transaction. Default: BASE_FEE
580
+ */
581
+ fee?: number;
582
+ /**
583
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
584
+ */
585
+ timeoutInSeconds?: number;
586
+ /**
587
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
588
+ */
589
+ simulate?: boolean;
590
+ }) => Promise<AssembledTransaction<null>>;
591
+ /**
592
+ * Construct and simulate a next_guid 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.
593
+ * Generates the next GUID for an outbound packet.
594
+ */
595
+ next_guid: ({ sender, dst_eid, receiver }: {
596
+ sender: string;
597
+ dst_eid: u32;
598
+ receiver: Buffer;
599
+ }, txnOptions?: {
600
+ /**
601
+ * The fee to pay for the transaction. Default: BASE_FEE
602
+ */
603
+ fee?: number;
604
+ /**
605
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
606
+ */
607
+ timeoutInSeconds?: number;
608
+ /**
609
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
610
+ */
611
+ simulate?: boolean;
612
+ }) => Promise<AssembledTransaction<Buffer>>;
613
+ /**
614
+ * Construct and simulate a outbound_nonce 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.
615
+ * Returns the current outbound nonce for a specific destination.
616
+ */
617
+ outbound_nonce: ({ sender, dst_eid, receiver }: {
618
+ sender: string;
619
+ dst_eid: u32;
620
+ receiver: Buffer;
621
+ }, txnOptions?: {
622
+ /**
623
+ * The fee to pay for the transaction. Default: BASE_FEE
624
+ */
625
+ fee?: number;
626
+ /**
627
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
628
+ */
629
+ timeoutInSeconds?: number;
630
+ /**
631
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
632
+ */
633
+ simulate?: boolean;
634
+ }) => Promise<AssembledTransaction<u64>>;
635
+ /**
636
+ * Construct and simulate a inbound_nonce 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.
637
+ * Returns the max index of the longest gapless sequence of verified message nonces.
638
+ *
639
+ * The uninitialized value is 0. The first nonce is always 1.
640
+ * It starts from the `lazy_inbound_nonce` (last checkpoint) and iteratively checks
641
+ * if the next nonce has been verified.
642
+ *
643
+ * Note: OApp explicitly skipped nonces count as "verified" for these purposes.
644
+ *
645
+ * Examples: `[1,2,3,4,6,7] => 4`, `[1,2,6,8,10] => 2`, `[1,3,4,5,6] => 1`
646
+ */
647
+ inbound_nonce: ({ receiver, src_eid, sender }: {
648
+ receiver: string;
649
+ src_eid: u32;
650
+ sender: Buffer;
651
+ }, txnOptions?: {
652
+ /**
653
+ * The fee to pay for the transaction. Default: BASE_FEE
654
+ */
655
+ fee?: number;
656
+ /**
657
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
658
+ */
659
+ timeoutInSeconds?: number;
660
+ /**
661
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
662
+ */
663
+ simulate?: boolean;
664
+ }) => Promise<AssembledTransaction<u64>>;
665
+ /**
666
+ * Construct and simulate a lazy_inbound_nonce 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.
667
+ * Returns the lazy inbound nonce (last checkpoint) for a specific path.
668
+ */
669
+ lazy_inbound_nonce: ({ receiver, src_eid, sender }: {
670
+ receiver: string;
671
+ src_eid: u32;
672
+ sender: Buffer;
673
+ }, txnOptions?: {
674
+ /**
675
+ * The fee to pay for the transaction. Default: BASE_FEE
676
+ */
677
+ fee?: number;
678
+ /**
679
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
680
+ */
681
+ timeoutInSeconds?: number;
682
+ /**
683
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
684
+ */
685
+ simulate?: boolean;
686
+ }) => Promise<AssembledTransaction<u64>>;
687
+ /**
688
+ * Construct and simulate a inbound_payload_hash 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.
689
+ * Returns the payload hash for a specific inbound nonce.
690
+ */
691
+ inbound_payload_hash: ({ receiver, src_eid, sender, nonce }: {
692
+ receiver: string;
693
+ src_eid: u32;
694
+ sender: Buffer;
695
+ nonce: u64;
696
+ }, txnOptions?: {
697
+ /**
698
+ * The fee to pay for the transaction. Default: BASE_FEE
699
+ */
700
+ fee?: number;
701
+ /**
702
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
703
+ */
704
+ timeoutInSeconds?: number;
705
+ /**
706
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
707
+ */
708
+ simulate?: boolean;
709
+ }) => Promise<AssembledTransaction<Option<Buffer>>>;
710
+ /**
711
+ * Construct and simulate a register_library 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.
712
+ * Registers a new message library with the endpoint.
713
+ */
714
+ register_library: ({ new_lib }: {
715
+ new_lib: string;
716
+ }, txnOptions?: {
717
+ /**
718
+ * The fee to pay for the transaction. Default: BASE_FEE
719
+ */
720
+ fee?: number;
721
+ /**
722
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
723
+ */
724
+ timeoutInSeconds?: number;
725
+ /**
726
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
727
+ */
728
+ simulate?: boolean;
729
+ }) => Promise<AssembledTransaction<null>>;
730
+ /**
731
+ * Construct and simulate a set_default_send_library 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.
732
+ * Sets the default send library for a destination endpoint.
733
+ */
734
+ set_default_send_library: ({ dst_eid, new_lib }: {
735
+ dst_eid: u32;
736
+ new_lib: string;
737
+ }, txnOptions?: {
738
+ /**
739
+ * The fee to pay for the transaction. Default: BASE_FEE
740
+ */
741
+ fee?: number;
742
+ /**
743
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
744
+ */
745
+ timeoutInSeconds?: number;
746
+ /**
747
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
748
+ */
749
+ simulate?: boolean;
750
+ }) => Promise<AssembledTransaction<null>>;
751
+ /**
752
+ * Construct and simulate a set_default_receive_library 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.
753
+ * Sets the default receive library for a source endpoint.
754
+ *
755
+ * If a grace period is provided and there was a previous library, the old library
756
+ * remains valid until the grace period expires.
757
+ */
758
+ set_default_receive_library: ({ src_eid, new_lib, grace_period }: {
759
+ src_eid: u32;
760
+ new_lib: string;
761
+ grace_period: u64;
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<null>>;
776
+ /**
777
+ * Construct and simulate a set_default_receive_lib_timeout 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
+ * Sets or removes the default receive library timeout for a source endpoint.
779
+ *
780
+ * If a timeout is provided, it must be valid and not expired. If no timeout is provided,
781
+ * the default receive library timeout is removed.
782
+ */
783
+ set_default_receive_lib_timeout: ({ src_eid, timeout }: {
784
+ src_eid: u32;
785
+ timeout: Option<Timeout>;
786
+ }, txnOptions?: {
787
+ /**
788
+ * The fee to pay for the transaction. Default: BASE_FEE
789
+ */
790
+ fee?: number;
791
+ /**
792
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
793
+ */
794
+ timeoutInSeconds?: number;
795
+ /**
796
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
797
+ */
798
+ simulate?: boolean;
799
+ }) => Promise<AssembledTransaction<null>>;
800
+ /**
801
+ * Construct and simulate a set_send_library 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.
802
+ * Sets or removes a custom send library for an OApp to a specific destination endpoint.
803
+ */
804
+ set_send_library: ({ caller, sender, dst_eid, new_lib }: {
805
+ caller: string;
806
+ sender: string;
807
+ dst_eid: u32;
808
+ new_lib: Option<string>;
809
+ }, txnOptions?: {
810
+ /**
811
+ * The fee to pay for the transaction. Default: BASE_FEE
812
+ */
813
+ fee?: number;
814
+ /**
815
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
816
+ */
817
+ timeoutInSeconds?: number;
818
+ /**
819
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
820
+ */
821
+ simulate?: boolean;
822
+ }) => Promise<AssembledTransaction<null>>;
823
+ /**
824
+ * Construct and simulate a set_receive_library 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.
825
+ * Sets or removes a custom receive library for an OApp to a specific source endpoint.
826
+ *
827
+ * If a grace period is provided and there was a previous library, the old library
828
+ * remains valid until the grace period expires.
829
+ */
830
+ set_receive_library: ({ caller, receiver, src_eid, new_lib, grace_period }: {
831
+ caller: string;
832
+ receiver: string;
833
+ src_eid: u32;
834
+ new_lib: Option<string>;
835
+ grace_period: u64;
836
+ }, txnOptions?: {
837
+ /**
838
+ * The fee to pay for the transaction. Default: BASE_FEE
839
+ */
840
+ fee?: number;
841
+ /**
842
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
843
+ */
844
+ timeoutInSeconds?: number;
845
+ /**
846
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
847
+ */
848
+ simulate?: boolean;
849
+ }) => Promise<AssembledTransaction<null>>;
850
+ /**
851
+ * Construct and simulate a set_receive_library_timeout 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.
852
+ * Sets or removes the custom receive library timeout for an OApp.
853
+ *
854
+ * Allows an OApp to extend or remove the validity period of a previously set library
855
+ * after switching to a new one.
856
+ */
857
+ set_receive_library_timeout: ({ caller, receiver, src_eid, timeout }: {
858
+ caller: string;
859
+ receiver: string;
860
+ src_eid: u32;
861
+ timeout: Option<Timeout>;
862
+ }, txnOptions?: {
863
+ /**
864
+ * The fee to pay for the transaction. Default: BASE_FEE
865
+ */
866
+ fee?: number;
867
+ /**
868
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
869
+ */
870
+ timeoutInSeconds?: number;
871
+ /**
872
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
873
+ */
874
+ simulate?: boolean;
875
+ }) => Promise<AssembledTransaction<null>>;
876
+ /**
877
+ * 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.
878
+ * Sets the configuration for a message library.
879
+ *
880
+ * Requires the caller to be the OApp or its delegate and the library to be registered.
881
+ */
882
+ set_config: ({ caller, oapp, lib, params }: {
883
+ caller: string;
884
+ oapp: string;
885
+ lib: string;
886
+ params: Array<SetConfigParam>;
887
+ }, txnOptions?: {
888
+ /**
889
+ * The fee to pay for the transaction. Default: BASE_FEE
890
+ */
891
+ fee?: number;
892
+ /**
893
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
894
+ */
895
+ timeoutInSeconds?: number;
896
+ /**
897
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
898
+ */
899
+ simulate?: boolean;
900
+ }) => Promise<AssembledTransaction<null>>;
901
+ /**
902
+ * Construct and simulate a is_registered_library 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.
903
+ * Checks if a message library is registered.
904
+ */
905
+ is_registered_library: ({ lib }: {
906
+ lib: string;
907
+ }, txnOptions?: {
908
+ /**
909
+ * The fee to pay for the transaction. Default: BASE_FEE
910
+ */
911
+ fee?: number;
912
+ /**
913
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
914
+ */
915
+ timeoutInSeconds?: number;
916
+ /**
917
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
918
+ */
919
+ simulate?: boolean;
920
+ }) => Promise<AssembledTransaction<boolean>>;
921
+ /**
922
+ * Construct and simulate a get_library_index 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.
923
+ * Returns the index of a message library.
924
+ */
925
+ get_library_index: ({ lib }: {
926
+ lib: string;
927
+ }, txnOptions?: {
928
+ /**
929
+ * The fee to pay for the transaction. Default: BASE_FEE
930
+ */
931
+ fee?: number;
932
+ /**
933
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
934
+ */
935
+ timeoutInSeconds?: number;
936
+ /**
937
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
938
+ */
939
+ simulate?: boolean;
940
+ }) => Promise<AssembledTransaction<Option<u32>>>;
941
+ /**
942
+ * Construct and simulate a registered_libraries_count 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.
943
+ * Returns the number of registered message libraries.
944
+ */
945
+ registered_libraries_count: (txnOptions?: {
946
+ /**
947
+ * The fee to pay for the transaction. Default: BASE_FEE
948
+ */
949
+ fee?: number;
950
+ /**
951
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
952
+ */
953
+ timeoutInSeconds?: number;
954
+ /**
955
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
956
+ */
957
+ simulate?: boolean;
958
+ }) => Promise<AssembledTransaction<u32>>;
959
+ /**
960
+ * Construct and simulate a get_registered_libraries 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.
961
+ * Returns a list of registered message libraries within the specified range.
962
+ */
963
+ get_registered_libraries: ({ start, max_count }: {
964
+ start: u32;
965
+ max_count: u32;
966
+ }, txnOptions?: {
967
+ /**
968
+ * The fee to pay for the transaction. Default: BASE_FEE
969
+ */
970
+ fee?: number;
971
+ /**
972
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
973
+ */
974
+ timeoutInSeconds?: number;
975
+ /**
976
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
977
+ */
978
+ simulate?: boolean;
979
+ }) => Promise<AssembledTransaction<Array<string>>>;
980
+ /**
981
+ * 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.
982
+ * Checks if an endpoint ID is supported.
983
+ * Returns true only if both the default send/receive libraries are set for the given eid
984
+ */
985
+ is_supported_eid: ({ eid }: {
986
+ eid: u32;
987
+ }, txnOptions?: {
988
+ /**
989
+ * The fee to pay for the transaction. Default: BASE_FEE
990
+ */
991
+ fee?: number;
992
+ /**
993
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
994
+ */
995
+ timeoutInSeconds?: number;
996
+ /**
997
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
998
+ */
999
+ simulate?: boolean;
1000
+ }) => Promise<AssembledTransaction<boolean>>;
1001
+ /**
1002
+ * Construct and simulate a default_send_library 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.
1003
+ * Returns the default send library for a destination endpoint.
1004
+ */
1005
+ default_send_library: ({ dst_eid }: {
1006
+ dst_eid: u32;
1007
+ }, txnOptions?: {
1008
+ /**
1009
+ * The fee to pay for the transaction. Default: BASE_FEE
1010
+ */
1011
+ fee?: number;
1012
+ /**
1013
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1014
+ */
1015
+ timeoutInSeconds?: number;
1016
+ /**
1017
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1018
+ */
1019
+ simulate?: boolean;
1020
+ }) => Promise<AssembledTransaction<Option<string>>>;
1021
+ /**
1022
+ * Construct and simulate a default_receive_library 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.
1023
+ * Returns the default receive library for a source endpoint.
1024
+ */
1025
+ default_receive_library: ({ src_eid }: {
1026
+ src_eid: u32;
1027
+ }, txnOptions?: {
1028
+ /**
1029
+ * The fee to pay for the transaction. Default: BASE_FEE
1030
+ */
1031
+ fee?: number;
1032
+ /**
1033
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1034
+ */
1035
+ timeoutInSeconds?: number;
1036
+ /**
1037
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1038
+ */
1039
+ simulate?: boolean;
1040
+ }) => Promise<AssembledTransaction<Option<string>>>;
1041
+ /**
1042
+ * Construct and simulate a default_receive_library_timeout 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.
1043
+ * Returns the default receive library timeout for a source endpoint.
1044
+ */
1045
+ default_receive_library_timeout: ({ src_eid }: {
1046
+ src_eid: u32;
1047
+ }, txnOptions?: {
1048
+ /**
1049
+ * The fee to pay for the transaction. Default: BASE_FEE
1050
+ */
1051
+ fee?: number;
1052
+ /**
1053
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1054
+ */
1055
+ timeoutInSeconds?: number;
1056
+ /**
1057
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1058
+ */
1059
+ simulate?: boolean;
1060
+ }) => Promise<AssembledTransaction<Option<Timeout>>>;
1061
+ /**
1062
+ * Construct and simulate a get_send_library 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.
1063
+ * Returns the effective send library for an OApp and destination endpoint.
1064
+ */
1065
+ get_send_library: ({ sender, dst_eid }: {
1066
+ sender: string;
1067
+ dst_eid: u32;
1068
+ }, txnOptions?: {
1069
+ /**
1070
+ * The fee to pay for the transaction. Default: BASE_FEE
1071
+ */
1072
+ fee?: number;
1073
+ /**
1074
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1075
+ */
1076
+ timeoutInSeconds?: number;
1077
+ /**
1078
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1079
+ */
1080
+ simulate?: boolean;
1081
+ }) => Promise<AssembledTransaction<ResolvedLibrary>>;
1082
+ /**
1083
+ * Construct and simulate a get_receive_library 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.
1084
+ * Returns the effective receive library for an OApp and source endpoint.
1085
+ */
1086
+ get_receive_library: ({ receiver, src_eid }: {
1087
+ receiver: string;
1088
+ src_eid: u32;
1089
+ }, txnOptions?: {
1090
+ /**
1091
+ * The fee to pay for the transaction. Default: BASE_FEE
1092
+ */
1093
+ fee?: number;
1094
+ /**
1095
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1096
+ */
1097
+ timeoutInSeconds?: number;
1098
+ /**
1099
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1100
+ */
1101
+ simulate?: boolean;
1102
+ }) => Promise<AssembledTransaction<ResolvedLibrary>>;
1103
+ /**
1104
+ * Construct and simulate a receive_library_timeout 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.
1105
+ * Returns the receive library timeout for an OApp and source endpoint.
1106
+ */
1107
+ receive_library_timeout: ({ receiver, src_eid }: {
1108
+ receiver: string;
1109
+ src_eid: u32;
1110
+ }, txnOptions?: {
1111
+ /**
1112
+ * The fee to pay for the transaction. Default: BASE_FEE
1113
+ */
1114
+ fee?: number;
1115
+ /**
1116
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1117
+ */
1118
+ timeoutInSeconds?: number;
1119
+ /**
1120
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1121
+ */
1122
+ simulate?: boolean;
1123
+ }) => Promise<AssembledTransaction<Option<Timeout>>>;
1124
+ /**
1125
+ * Construct and simulate a is_valid_receive_library 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.
1126
+ * Checks if a receive library is valid for an OApp and source endpoint.
1127
+ */
1128
+ is_valid_receive_library: ({ receiver, src_eid, actual_lib }: {
1129
+ receiver: string;
1130
+ src_eid: u32;
1131
+ actual_lib: string;
1132
+ }, txnOptions?: {
1133
+ /**
1134
+ * The fee to pay for the transaction. Default: BASE_FEE
1135
+ */
1136
+ fee?: number;
1137
+ /**
1138
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1139
+ */
1140
+ timeoutInSeconds?: number;
1141
+ /**
1142
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1143
+ */
1144
+ simulate?: boolean;
1145
+ }) => Promise<AssembledTransaction<boolean>>;
1146
+ /**
1147
+ * 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.
1148
+ * Returns the configuration for a message library for a specific endpoint ID and configuration type.
1149
+ */
1150
+ get_config: ({ oapp, lib, eid, config_type }: {
1151
+ oapp: string;
1152
+ lib: string;
1153
+ eid: u32;
1154
+ config_type: u32;
1155
+ }, txnOptions?: {
1156
+ /**
1157
+ * The fee to pay for the transaction. Default: BASE_FEE
1158
+ */
1159
+ fee?: number;
1160
+ /**
1161
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1162
+ */
1163
+ timeoutInSeconds?: number;
1164
+ /**
1165
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1166
+ */
1167
+ simulate?: boolean;
1168
+ }) => Promise<AssembledTransaction<Buffer>>;
1169
+ /**
1170
+ * 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.
1171
+ * Quotes the messaging fee for sending a cross-chain message.
1172
+ */
1173
+ quote: ({ sender, params }: {
1174
+ sender: string;
1175
+ params: MessagingParams;
1176
+ }, txnOptions?: {
1177
+ /**
1178
+ * The fee to pay for the transaction. Default: BASE_FEE
1179
+ */
1180
+ fee?: number;
1181
+ /**
1182
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1183
+ */
1184
+ timeoutInSeconds?: number;
1185
+ /**
1186
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1187
+ */
1188
+ simulate?: boolean;
1189
+ }) => Promise<AssembledTransaction<MessagingFee>>;
1190
+ /**
1191
+ * 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.
1192
+ * Sends a cross-chain message to a destination endpoint.
1193
+ *
1194
+ * OApp sender needs to transfer the fees to the endpoint before sending the message
1195
+ */
1196
+ send: ({ sender, params, refund_address }: {
1197
+ sender: string;
1198
+ params: MessagingParams;
1199
+ refund_address: string;
1200
+ }, txnOptions?: {
1201
+ /**
1202
+ * The fee to pay for the transaction. Default: BASE_FEE
1203
+ */
1204
+ fee?: number;
1205
+ /**
1206
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1207
+ */
1208
+ timeoutInSeconds?: number;
1209
+ /**
1210
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1211
+ */
1212
+ simulate?: boolean;
1213
+ }) => Promise<AssembledTransaction<MessagingReceipt>>;
1214
+ /**
1215
+ * 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.
1216
+ * Verifies an inbound cross-chain message from a configured receive library.
1217
+ */
1218
+ verify: ({ receive_lib, origin, receiver, payload_hash }: {
1219
+ receive_lib: string;
1220
+ origin: Origin;
1221
+ receiver: string;
1222
+ payload_hash: Buffer;
1223
+ }, txnOptions?: {
1224
+ /**
1225
+ * The fee to pay for the transaction. Default: BASE_FEE
1226
+ */
1227
+ fee?: number;
1228
+ /**
1229
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1230
+ */
1231
+ timeoutInSeconds?: number;
1232
+ /**
1233
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1234
+ */
1235
+ simulate?: boolean;
1236
+ }) => Promise<AssembledTransaction<null>>;
1237
+ /**
1238
+ * Construct and simulate a clear 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.
1239
+ * Clears a verified message from the endpoint.
1240
+ *
1241
+ * This is a PULL mode versus the PUSH mode of `lz_receive`.
1242
+ */
1243
+ clear: ({ caller, origin, receiver, guid, message }: {
1244
+ caller: string;
1245
+ origin: Origin;
1246
+ receiver: string;
1247
+ guid: Buffer;
1248
+ message: Buffer;
1249
+ }, txnOptions?: {
1250
+ /**
1251
+ * The fee to pay for the transaction. Default: BASE_FEE
1252
+ */
1253
+ fee?: number;
1254
+ /**
1255
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1256
+ */
1257
+ timeoutInSeconds?: number;
1258
+ /**
1259
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1260
+ */
1261
+ simulate?: boolean;
1262
+ }) => Promise<AssembledTransaction<null>>;
1263
+ /**
1264
+ * Construct and simulate a lz_receive_alert 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.
1265
+ * Emits an alert event when `lz_receive` execution fails.
1266
+ *
1267
+ * Called by the executor to notify about failed message delivery attempts.
1268
+ */
1269
+ lz_receive_alert: ({ executor, origin, receiver, guid, gas, value, message, extra_data, reason }: {
1270
+ executor: string;
1271
+ origin: Origin;
1272
+ receiver: string;
1273
+ guid: Buffer;
1274
+ gas: i128;
1275
+ value: i128;
1276
+ message: Buffer;
1277
+ extra_data: Buffer;
1278
+ reason: Buffer;
1279
+ }, txnOptions?: {
1280
+ /**
1281
+ * The fee to pay for the transaction. Default: BASE_FEE
1282
+ */
1283
+ fee?: number;
1284
+ /**
1285
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1286
+ */
1287
+ timeoutInSeconds?: number;
1288
+ /**
1289
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1290
+ */
1291
+ simulate?: boolean;
1292
+ }) => Promise<AssembledTransaction<null>>;
1293
+ /**
1294
+ * Construct and simulate a set_zro 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.
1295
+ * Sets the ZRO token address for fee payments.
1296
+ */
1297
+ set_zro: ({ zro }: {
1298
+ zro: string;
1299
+ }, txnOptions?: {
1300
+ /**
1301
+ * The fee to pay for the transaction. Default: BASE_FEE
1302
+ */
1303
+ fee?: number;
1304
+ /**
1305
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1306
+ */
1307
+ timeoutInSeconds?: number;
1308
+ /**
1309
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1310
+ */
1311
+ simulate?: boolean;
1312
+ }) => Promise<AssembledTransaction<null>>;
1313
+ /**
1314
+ * Construct and simulate a set_delegate 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.
1315
+ * Sets or removes a delegate address that can act on behalf of the OApp.
1316
+ */
1317
+ set_delegate: ({ oapp, new_delegate }: {
1318
+ oapp: string;
1319
+ new_delegate: Option<string>;
1320
+ }, txnOptions?: {
1321
+ /**
1322
+ * The fee to pay for the transaction. Default: BASE_FEE
1323
+ */
1324
+ fee?: number;
1325
+ /**
1326
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1327
+ */
1328
+ timeoutInSeconds?: number;
1329
+ /**
1330
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1331
+ */
1332
+ simulate?: boolean;
1333
+ }) => Promise<AssembledTransaction<null>>;
1334
+ /**
1335
+ * Construct and simulate a 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.
1336
+ * Returns the endpoint ID.
1337
+ */
1338
+ eid: (txnOptions?: {
1339
+ /**
1340
+ * The fee to pay for the transaction. Default: BASE_FEE
1341
+ */
1342
+ fee?: number;
1343
+ /**
1344
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1345
+ */
1346
+ timeoutInSeconds?: number;
1347
+ /**
1348
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1349
+ */
1350
+ simulate?: boolean;
1351
+ }) => Promise<AssembledTransaction<u32>>;
1352
+ /**
1353
+ * Construct and simulate a initializable 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.
1354
+ * Checks if a messaging path can be/has been initialized for the given origin and receiver.
1355
+ */
1356
+ initializable: ({ origin, receiver }: {
1357
+ origin: Origin;
1358
+ receiver: string;
1359
+ }, txnOptions?: {
1360
+ /**
1361
+ * The fee to pay for the transaction. Default: BASE_FEE
1362
+ */
1363
+ fee?: number;
1364
+ /**
1365
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1366
+ */
1367
+ timeoutInSeconds?: number;
1368
+ /**
1369
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1370
+ */
1371
+ simulate?: boolean;
1372
+ }) => Promise<AssembledTransaction<boolean>>;
1373
+ /**
1374
+ * 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.
1375
+ * Checks if a message can be verified for the given origin and receiver.
1376
+ */
1377
+ verifiable: ({ origin, receiver }: {
1378
+ origin: Origin;
1379
+ receiver: string;
1380
+ }, txnOptions?: {
1381
+ /**
1382
+ * The fee to pay for the transaction. Default: BASE_FEE
1383
+ */
1384
+ fee?: number;
1385
+ /**
1386
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1387
+ */
1388
+ timeoutInSeconds?: number;
1389
+ /**
1390
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1391
+ */
1392
+ simulate?: boolean;
1393
+ }) => Promise<AssembledTransaction<boolean>>;
1394
+ /**
1395
+ * Construct and simulate a native_token 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.
1396
+ * Returns the native token address used for fee payments.
1397
+ */
1398
+ native_token: (txnOptions?: {
1399
+ /**
1400
+ * The fee to pay for the transaction. Default: BASE_FEE
1401
+ */
1402
+ fee?: number;
1403
+ /**
1404
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1405
+ */
1406
+ timeoutInSeconds?: number;
1407
+ /**
1408
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1409
+ */
1410
+ simulate?: boolean;
1411
+ }) => Promise<AssembledTransaction<string>>;
1412
+ /**
1413
+ * Construct and simulate a zro 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.
1414
+ * Returns the ZRO token address if set.
1415
+ */
1416
+ zro: (txnOptions?: {
1417
+ /**
1418
+ * The fee to pay for the transaction. Default: BASE_FEE
1419
+ */
1420
+ fee?: number;
1421
+ /**
1422
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1423
+ */
1424
+ timeoutInSeconds?: number;
1425
+ /**
1426
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1427
+ */
1428
+ simulate?: boolean;
1429
+ }) => Promise<AssembledTransaction<Option<string>>>;
1430
+ /**
1431
+ * Construct and simulate a delegate 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.
1432
+ * Returns the delegate address for an OApp if set.
1433
+ */
1434
+ delegate: ({ oapp }: {
1435
+ oapp: string;
1436
+ }, txnOptions?: {
1437
+ /**
1438
+ * The fee to pay for the transaction. Default: BASE_FEE
1439
+ */
1440
+ fee?: number;
1441
+ /**
1442
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1443
+ */
1444
+ timeoutInSeconds?: number;
1445
+ /**
1446
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1447
+ */
1448
+ simulate?: boolean;
1449
+ }) => Promise<AssembledTransaction<Option<string>>>;
1450
+ /**
1451
+ * Construct and simulate a recover_token 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.
1452
+ * Recovers tokens sent to this contract by mistake.
1453
+ *
1454
+ * # Arguments
1455
+ * * `token` - The token address to recover
1456
+ * * `to` - The address to send the token to
1457
+ * * `amount` - The amount to send
1458
+ */
1459
+ recover_token: ({ token, to, amount }: {
1460
+ token: string;
1461
+ to: string;
1462
+ amount: i128;
1463
+ }, txnOptions?: {
1464
+ /**
1465
+ * The fee to pay for the transaction. Default: BASE_FEE
1466
+ */
1467
+ fee?: number;
1468
+ /**
1469
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1470
+ */
1471
+ timeoutInSeconds?: number;
1472
+ /**
1473
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1474
+ */
1475
+ simulate?: boolean;
1476
+ }) => Promise<AssembledTransaction<null>>;
1477
+ /**
1478
+ * 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.
1479
+ */
1480
+ owner: (txnOptions?: {
1481
+ /**
1482
+ * The fee to pay for the transaction. Default: BASE_FEE
1483
+ */
1484
+ fee?: number;
1485
+ /**
1486
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1487
+ */
1488
+ timeoutInSeconds?: number;
1489
+ /**
1490
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1491
+ */
1492
+ simulate?: boolean;
1493
+ }) => Promise<AssembledTransaction<Option<string>>>;
1494
+ /**
1495
+ * 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.
1496
+ */
1497
+ transfer_ownership: ({ new_owner }: {
1498
+ new_owner: string;
1499
+ }, txnOptions?: {
1500
+ /**
1501
+ * The fee to pay for the transaction. Default: BASE_FEE
1502
+ */
1503
+ fee?: number;
1504
+ /**
1505
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1506
+ */
1507
+ timeoutInSeconds?: number;
1508
+ /**
1509
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1510
+ */
1511
+ simulate?: boolean;
1512
+ }) => Promise<AssembledTransaction<null>>;
1513
+ /**
1514
+ * 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.
1515
+ */
1516
+ renounce_ownership: (txnOptions?: {
1517
+ /**
1518
+ * The fee to pay for the transaction. Default: BASE_FEE
1519
+ */
1520
+ fee?: number;
1521
+ /**
1522
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1523
+ */
1524
+ timeoutInSeconds?: number;
1525
+ /**
1526
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1527
+ */
1528
+ simulate?: boolean;
1529
+ }) => Promise<AssembledTransaction<null>>;
1530
+ /**
1531
+ * 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.
1532
+ */
1533
+ set_ttl_config: ({ instance, persistent, temporary }: {
1534
+ instance: Option<TtlConfig>;
1535
+ persistent: Option<TtlConfig>;
1536
+ temporary: Option<TtlConfig>;
1537
+ }, txnOptions?: {
1538
+ /**
1539
+ * The fee to pay for the transaction. Default: BASE_FEE
1540
+ */
1541
+ fee?: number;
1542
+ /**
1543
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1544
+ */
1545
+ timeoutInSeconds?: number;
1546
+ /**
1547
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1548
+ */
1549
+ simulate?: boolean;
1550
+ }) => Promise<AssembledTransaction<null>>;
1551
+ /**
1552
+ * 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.
1553
+ */
1554
+ ttl_config: (txnOptions?: {
1555
+ /**
1556
+ * The fee to pay for the transaction. Default: BASE_FEE
1557
+ */
1558
+ fee?: number;
1559
+ /**
1560
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1561
+ */
1562
+ timeoutInSeconds?: number;
1563
+ /**
1564
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1565
+ */
1566
+ simulate?: boolean;
1567
+ }) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>, Option<TtlConfig>]>>;
1568
+ /**
1569
+ * 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.
1570
+ */
1571
+ freeze_ttl_config: (txnOptions?: {
1572
+ /**
1573
+ * The fee to pay for the transaction. Default: BASE_FEE
1574
+ */
1575
+ fee?: number;
1576
+ /**
1577
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1578
+ */
1579
+ timeoutInSeconds?: number;
1580
+ /**
1581
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1582
+ */
1583
+ simulate?: boolean;
1584
+ }) => Promise<AssembledTransaction<null>>;
1585
+ /**
1586
+ * 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.
1587
+ */
1588
+ is_ttl_config_frozen: (txnOptions?: {
1589
+ /**
1590
+ * The fee to pay for the transaction. Default: BASE_FEE
1591
+ */
1592
+ fee?: number;
1593
+ /**
1594
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1595
+ */
1596
+ timeoutInSeconds?: number;
1597
+ /**
1598
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1599
+ */
1600
+ simulate?: boolean;
1601
+ }) => Promise<AssembledTransaction<boolean>>;
1602
+ }
1603
+ export declare class Client extends ContractClient {
1604
+ readonly options: ContractClientOptions;
1605
+ static deploy<T = Client>(
1606
+ /** Constructor/Initialization Args for the contract's `__constructor` method */
1607
+ { owner }: {
1608
+ owner: string;
1609
+ },
1610
+ /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
1611
+ options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
1612
+ /** The hash of the Wasm blob, which must already be installed on-chain. */
1613
+ wasmHash: Buffer | string;
1614
+ /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
1615
+ salt?: Buffer | Uint8Array;
1616
+ /** The format used to decode `wasmHash`, if it's provided as a string. */
1617
+ format?: "hex" | "base64";
1618
+ }): Promise<AssembledTransaction<T>>;
1619
+ constructor(options: ContractClientOptions);
1620
+ readonly fromJSON: {
1621
+ send_compose: (json: string) => AssembledTransaction<null>;
1622
+ clear_compose: (json: string) => AssembledTransaction<null>;
1623
+ lz_compose_alert: (json: string) => AssembledTransaction<null>;
1624
+ compose_queue: (json: string) => AssembledTransaction<Option<Buffer<ArrayBufferLike>>>;
1625
+ skip: (json: string) => AssembledTransaction<null>;
1626
+ nilify: (json: string) => AssembledTransaction<null>;
1627
+ burn: (json: string) => AssembledTransaction<null>;
1628
+ next_guid: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
1629
+ outbound_nonce: (json: string) => AssembledTransaction<bigint>;
1630
+ inbound_nonce: (json: string) => AssembledTransaction<bigint>;
1631
+ lazy_inbound_nonce: (json: string) => AssembledTransaction<bigint>;
1632
+ inbound_payload_hash: (json: string) => AssembledTransaction<Option<Buffer<ArrayBufferLike>>>;
1633
+ register_library: (json: string) => AssembledTransaction<null>;
1634
+ set_default_send_library: (json: string) => AssembledTransaction<null>;
1635
+ set_default_receive_library: (json: string) => AssembledTransaction<null>;
1636
+ set_default_receive_lib_timeout: (json: string) => AssembledTransaction<null>;
1637
+ set_send_library: (json: string) => AssembledTransaction<null>;
1638
+ set_receive_library: (json: string) => AssembledTransaction<null>;
1639
+ set_receive_library_timeout: (json: string) => AssembledTransaction<null>;
1640
+ set_config: (json: string) => AssembledTransaction<null>;
1641
+ is_registered_library: (json: string) => AssembledTransaction<boolean>;
1642
+ get_library_index: (json: string) => AssembledTransaction<Option<number>>;
1643
+ registered_libraries_count: (json: string) => AssembledTransaction<number>;
1644
+ get_registered_libraries: (json: string) => AssembledTransaction<string[]>;
1645
+ is_supported_eid: (json: string) => AssembledTransaction<boolean>;
1646
+ default_send_library: (json: string) => AssembledTransaction<Option<string>>;
1647
+ default_receive_library: (json: string) => AssembledTransaction<Option<string>>;
1648
+ default_receive_library_timeout: (json: string) => AssembledTransaction<Option<Timeout>>;
1649
+ get_send_library: (json: string) => AssembledTransaction<ResolvedLibrary>;
1650
+ get_receive_library: (json: string) => AssembledTransaction<ResolvedLibrary>;
1651
+ receive_library_timeout: (json: string) => AssembledTransaction<Option<Timeout>>;
1652
+ is_valid_receive_library: (json: string) => AssembledTransaction<boolean>;
1653
+ get_config: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
1654
+ quote: (json: string) => AssembledTransaction<MessagingFee>;
1655
+ send: (json: string) => AssembledTransaction<MessagingReceipt>;
1656
+ verify: (json: string) => AssembledTransaction<null>;
1657
+ clear: (json: string) => AssembledTransaction<null>;
1658
+ lz_receive_alert: (json: string) => AssembledTransaction<null>;
1659
+ set_zro: (json: string) => AssembledTransaction<null>;
1660
+ set_delegate: (json: string) => AssembledTransaction<null>;
1661
+ eid: (json: string) => AssembledTransaction<number>;
1662
+ initializable: (json: string) => AssembledTransaction<boolean>;
1663
+ verifiable: (json: string) => AssembledTransaction<boolean>;
1664
+ native_token: (json: string) => AssembledTransaction<string>;
1665
+ zro: (json: string) => AssembledTransaction<Option<string>>;
1666
+ delegate: (json: string) => AssembledTransaction<Option<string>>;
1667
+ recover_token: (json: string) => AssembledTransaction<null>;
1668
+ owner: (json: string) => AssembledTransaction<Option<string>>;
1669
+ transfer_ownership: (json: string) => AssembledTransaction<null>;
1670
+ renounce_ownership: (json: string) => AssembledTransaction<null>;
1671
+ set_ttl_config: (json: string) => AssembledTransaction<null>;
1672
+ ttl_config: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>, Option<TtlConfig>]>;
1673
+ freeze_ttl_config: (json: string) => AssembledTransaction<null>;
1674
+ is_ttl_config_frozen: (json: string) => AssembledTransaction<boolean>;
1675
+ };
1676
+ }