@layerzerolabs/lz-v2-stellar-sdk 0.2.8 → 0.2.10

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.
@@ -8,16 +8,13 @@ export type SmlStorage = {
8
8
  tag: "Endpoint";
9
9
  values: void;
10
10
  } | {
11
- tag: "Treasury";
12
- values: void;
13
- } | {
14
- tag: "LocalEID";
11
+ tag: "LocalEid";
15
12
  values: void;
16
13
  } | {
17
14
  tag: "NativeFee";
18
15
  values: void;
19
16
  } | {
20
- tag: "ZROFee";
17
+ tag: "ZroFee";
21
18
  values: void;
22
19
  } | {
23
20
  tag: "FeeRecipient";
@@ -33,6 +30,14 @@ export declare const SimpleMessageLibError: {
33
30
  2: {
34
31
  message: string;
35
32
  };
33
+ };
34
+ export declare const EndpointError: {
35
+ 1: {
36
+ message: string;
37
+ };
38
+ 2: {
39
+ message: string;
40
+ };
36
41
  3: {
37
42
  message: string;
38
43
  };
@@ -45,6 +50,60 @@ export declare const SimpleMessageLibError: {
45
50
  6: {
46
51
  message: string;
47
52
  };
53
+ 7: {
54
+ message: string;
55
+ };
56
+ 8: {
57
+ message: string;
58
+ };
59
+ 9: {
60
+ message: string;
61
+ };
62
+ 10: {
63
+ message: string;
64
+ };
65
+ 11: {
66
+ message: string;
67
+ };
68
+ 12: {
69
+ message: string;
70
+ };
71
+ 13: {
72
+ message: string;
73
+ };
74
+ 14: {
75
+ message: string;
76
+ };
77
+ 15: {
78
+ message: string;
79
+ };
80
+ 16: {
81
+ message: string;
82
+ };
83
+ 17: {
84
+ message: string;
85
+ };
86
+ 18: {
87
+ message: string;
88
+ };
89
+ 19: {
90
+ message: string;
91
+ };
92
+ 20: {
93
+ message: string;
94
+ };
95
+ 21: {
96
+ message: string;
97
+ };
98
+ 22: {
99
+ message: string;
100
+ };
101
+ 23: {
102
+ message: string;
103
+ };
104
+ 24: {
105
+ message: string;
106
+ };
48
107
  };
49
108
  /**
50
109
  * Parameters for sending a cross-chain message.
@@ -232,13 +291,13 @@ export interface OutboundPacket {
232
291
  */
233
292
  export interface FeeRecipient {
234
293
  /**
235
- * Address to receive the fee.
236
- */
237
- address: string;
238
- /**
239
294
  * Amount of fee to pay.
240
295
  */
241
296
  amount: i128;
297
+ /**
298
+ * The address to send the fee to.
299
+ */
300
+ to: string;
242
301
  }
243
302
  /**
244
303
  * Result of send operation containing fees and encoded packet.
@@ -258,76 +317,76 @@ export interface FeesAndPacket {
258
317
  zro_fee_recipients: Array<FeeRecipient>;
259
318
  }
260
319
  export declare const PacketCodecV1Error: {
261
- 11001: {
320
+ 1001: {
262
321
  message: string;
263
322
  };
264
- 11002: {
323
+ 1002: {
265
324
  message: string;
266
325
  };
267
326
  };
268
327
  export declare const WorkerOptionsError: {
269
- 11101: {
328
+ 1101: {
270
329
  message: string;
271
330
  };
272
- 11102: {
331
+ 1102: {
273
332
  message: string;
274
333
  };
275
- 11103: {
334
+ 1103: {
276
335
  message: string;
277
336
  };
278
- 11104: {
337
+ 1104: {
279
338
  message: string;
280
339
  };
281
- 11105: {
340
+ 1105: {
282
341
  message: string;
283
342
  };
284
- 11106: {
343
+ 1106: {
285
344
  message: string;
286
345
  };
287
- 11107: {
346
+ 1107: {
288
347
  message: string;
289
348
  };
290
- 11108: {
349
+ 1108: {
291
350
  message: string;
292
351
  };
293
- 11109: {
352
+ 1109: {
294
353
  message: string;
295
354
  };
296
355
  };
297
356
  export declare const BufferReaderError: {
298
- 10000: {
357
+ 1000: {
299
358
  message: string;
300
359
  };
301
- 10001: {
360
+ 1001: {
302
361
  message: string;
303
362
  };
304
363
  };
305
364
  export declare const BufferWriterError: {
306
- 10100: {
365
+ 1100: {
307
366
  message: string;
308
367
  };
309
368
  };
310
369
  export declare const TtlError: {
311
- 10200: {
370
+ 1200: {
312
371
  message: string;
313
372
  };
314
- 10201: {
373
+ 1201: {
315
374
  message: string;
316
375
  };
317
- 10202: {
376
+ 1202: {
318
377
  message: string;
319
378
  };
320
379
  };
321
380
  export declare const OwnableError: {
322
- 10300: {
381
+ 1300: {
323
382
  message: string;
324
383
  };
325
- 10301: {
384
+ 1301: {
326
385
  message: string;
327
386
  };
328
387
  };
329
388
  export declare const BytesExtError: {
330
- 10400: {
389
+ 1400: {
331
390
  message: string;
332
391
  };
333
392
  };
@@ -348,7 +407,7 @@ export interface TtlConfig {
348
407
  */
349
408
  threshold: u32;
350
409
  }
351
- export type TtlConfigData = {
410
+ export type TtlConfigStorage = {
352
411
  tag: "Frozen";
353
412
  values: void;
354
413
  } | {
@@ -357,9 +416,6 @@ export type TtlConfigData = {
357
416
  } | {
358
417
  tag: "Persistent";
359
418
  values: void;
360
- } | {
361
- tag: "Temporary";
362
- values: void;
363
419
  };
364
420
  export interface Client {
365
421
  /**
@@ -501,8 +557,7 @@ export interface Client {
501
557
  /**
502
558
  * Construct and simulate a validate_packet 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.
503
559
  */
504
- validate_packet: ({ caller, header_bytes, payload_hash }: {
505
- caller: string;
560
+ validate_packet: ({ header_bytes, payload_hash }: {
506
561
  header_bytes: Buffer;
507
562
  payload_hash: Buffer;
508
563
  }, txnOptions?: {
@@ -520,9 +575,11 @@ export interface Client {
520
575
  simulate?: boolean;
521
576
  }) => Promise<AssembledTransaction<null>>;
522
577
  /**
523
- * Construct and simulate a fee_recipient 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.
578
+ * Construct and simulate a set_fee_recipient 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.
524
579
  */
525
- fee_recipient: (txnOptions?: {
580
+ set_fee_recipient: ({ fee_recipient }: {
581
+ fee_recipient: string;
582
+ }, txnOptions?: {
526
583
  /**
527
584
  * The fee to pay for the transaction. Default: BASE_FEE
528
585
  */
@@ -535,11 +592,13 @@ export interface Client {
535
592
  * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
536
593
  */
537
594
  simulate?: boolean;
538
- }) => Promise<AssembledTransaction<string>>;
595
+ }) => Promise<AssembledTransaction<null>>;
539
596
  /**
540
- * Construct and simulate a native_fee 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.
597
+ * Construct and simulate a set_native_fee 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
598
  */
542
- native_fee: (txnOptions?: {
599
+ set_native_fee: ({ native_fee }: {
600
+ native_fee: i128;
601
+ }, txnOptions?: {
543
602
  /**
544
603
  * The fee to pay for the transaction. Default: BASE_FEE
545
604
  */
@@ -552,11 +611,13 @@ export interface Client {
552
611
  * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
553
612
  */
554
613
  simulate?: boolean;
555
- }) => Promise<AssembledTransaction<i128>>;
614
+ }) => Promise<AssembledTransaction<null>>;
556
615
  /**
557
- * Construct and simulate a zro_fee 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.
616
+ * Construct and simulate a set_zro_fee 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.
558
617
  */
559
- zro_fee: (txnOptions?: {
618
+ set_zro_fee: ({ zro_fee }: {
619
+ zro_fee: i128;
620
+ }, txnOptions?: {
560
621
  /**
561
622
  * The fee to pay for the transaction. Default: BASE_FEE
562
623
  */
@@ -569,11 +630,13 @@ export interface Client {
569
630
  * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
570
631
  */
571
632
  simulate?: boolean;
572
- }) => Promise<AssembledTransaction<i128>>;
633
+ }) => Promise<AssembledTransaction<null>>;
573
634
  /**
574
- * Construct and simulate a whitelisted_caller 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.
635
+ * Construct and simulate a set_whitelisted_caller 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.
575
636
  */
576
- whitelisted_caller: (txnOptions?: {
637
+ set_whitelisted_caller: ({ whitelisted_caller }: {
638
+ whitelisted_caller: string;
639
+ }, txnOptions?: {
577
640
  /**
578
641
  * The fee to pay for the transaction. Default: BASE_FEE
579
642
  */
@@ -586,7 +649,7 @@ export interface Client {
586
649
  * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
587
650
  */
588
651
  simulate?: boolean;
589
- }) => Promise<AssembledTransaction<string>>;
652
+ }) => Promise<AssembledTransaction<null>>;
590
653
  /**
591
654
  * 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.
592
655
  */
@@ -605,9 +668,9 @@ export interface Client {
605
668
  simulate?: boolean;
606
669
  }) => Promise<AssembledTransaction<string>>;
607
670
  /**
608
- * 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.
671
+ * Construct and simulate a local_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.
609
672
  */
610
- eid: (txnOptions?: {
673
+ local_eid: (txnOptions?: {
611
674
  /**
612
675
  * The fee to pay for the transaction. Default: BASE_FEE
613
676
  */
@@ -622,9 +685,60 @@ export interface Client {
622
685
  simulate?: boolean;
623
686
  }) => Promise<AssembledTransaction<u32>>;
624
687
  /**
625
- * 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.
688
+ * Construct and simulate a native_fee 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.
626
689
  */
627
- treasury: (txnOptions?: {
690
+ native_fee: (txnOptions?: {
691
+ /**
692
+ * The fee to pay for the transaction. Default: BASE_FEE
693
+ */
694
+ fee?: number;
695
+ /**
696
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
697
+ */
698
+ timeoutInSeconds?: number;
699
+ /**
700
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
701
+ */
702
+ simulate?: boolean;
703
+ }) => Promise<AssembledTransaction<i128>>;
704
+ /**
705
+ * Construct and simulate a zro_fee 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.
706
+ */
707
+ zro_fee: (txnOptions?: {
708
+ /**
709
+ * The fee to pay for the transaction. Default: BASE_FEE
710
+ */
711
+ fee?: number;
712
+ /**
713
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
714
+ */
715
+ timeoutInSeconds?: number;
716
+ /**
717
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
718
+ */
719
+ simulate?: boolean;
720
+ }) => Promise<AssembledTransaction<i128>>;
721
+ /**
722
+ * Construct and simulate a fee_recipient 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.
723
+ */
724
+ fee_recipient: (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<string>>;
738
+ /**
739
+ * Construct and simulate a whitelisted_caller 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
+ */
741
+ whitelisted_caller: (txnOptions?: {
628
742
  /**
629
743
  * The fee to pay for the transaction. Default: BASE_FEE
630
744
  */
@@ -692,12 +806,11 @@ export interface Client {
692
806
  simulate?: boolean;
693
807
  }) => Promise<AssembledTransaction<null>>;
694
808
  /**
695
- * 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.
809
+ * Construct and simulate a set_ttl_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.
696
810
  */
697
- set_ttl_config: ({ instance, persistent, temporary }: {
811
+ set_ttl_configs: ({ instance, persistent }: {
698
812
  instance: Option<TtlConfig>;
699
813
  persistent: Option<TtlConfig>;
700
- temporary: Option<TtlConfig>;
701
814
  }, txnOptions?: {
702
815
  /**
703
816
  * The fee to pay for the transaction. Default: BASE_FEE
@@ -713,9 +826,9 @@ export interface Client {
713
826
  simulate?: boolean;
714
827
  }) => Promise<AssembledTransaction<null>>;
715
828
  /**
716
- * 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.
829
+ * Construct and simulate a ttl_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.
717
830
  */
718
- ttl_config: (txnOptions?: {
831
+ ttl_configs: (txnOptions?: {
719
832
  /**
720
833
  * The fee to pay for the transaction. Default: BASE_FEE
721
834
  */
@@ -728,11 +841,11 @@ export interface Client {
728
841
  * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
729
842
  */
730
843
  simulate?: boolean;
731
- }) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>, Option<TtlConfig>]>>;
844
+ }) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>>;
732
845
  /**
733
- * 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.
846
+ * Construct and simulate a freeze_ttl_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.
734
847
  */
735
- freeze_ttl_config: (txnOptions?: {
848
+ freeze_ttl_configs: (txnOptions?: {
736
849
  /**
737
850
  * The fee to pay for the transaction. Default: BASE_FEE
738
851
  */
@@ -747,9 +860,9 @@ export interface Client {
747
860
  simulate?: boolean;
748
861
  }) => Promise<AssembledTransaction<null>>;
749
862
  /**
750
- * 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.
863
+ * Construct and simulate a is_ttl_configs_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.
751
864
  */
752
- is_ttl_config_frozen: (txnOptions?: {
865
+ is_ttl_configs_frozen: (txnOptions?: {
753
866
  /**
754
867
  * The fee to pay for the transaction. Default: BASE_FEE
755
868
  */
@@ -763,6 +876,32 @@ export interface Client {
763
876
  */
764
877
  simulate?: boolean;
765
878
  }) => Promise<AssembledTransaction<boolean>>;
879
+ /**
880
+ * Construct and simulate a extend_instance_ttl 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.
881
+ * Extends the instance TTL.
882
+ *
883
+ * # Arguments
884
+ *
885
+ * * `threshold` - The threshold to extend the TTL.
886
+ * * `extend_to` - The TTL to extend to.
887
+ */
888
+ extend_instance_ttl: ({ threshold, extend_to }: {
889
+ threshold: u32;
890
+ extend_to: u32;
891
+ }, txnOptions?: {
892
+ /**
893
+ * The fee to pay for the transaction. Default: BASE_FEE
894
+ */
895
+ fee?: number;
896
+ /**
897
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
898
+ */
899
+ timeoutInSeconds?: number;
900
+ /**
901
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
902
+ */
903
+ simulate?: boolean;
904
+ }) => Promise<AssembledTransaction<null>>;
766
905
  }
767
906
  export declare class Client extends ContractClient {
768
907
  readonly options: ContractClientOptions;
@@ -792,19 +931,23 @@ export declare class Client extends ContractClient {
792
931
  set_config: (json: string) => AssembledTransaction<null>;
793
932
  version: (json: string) => AssembledTransaction<MessageLibVersion>;
794
933
  validate_packet: (json: string) => AssembledTransaction<null>;
795
- fee_recipient: (json: string) => AssembledTransaction<string>;
934
+ set_fee_recipient: (json: string) => AssembledTransaction<null>;
935
+ set_native_fee: (json: string) => AssembledTransaction<null>;
936
+ set_zro_fee: (json: string) => AssembledTransaction<null>;
937
+ set_whitelisted_caller: (json: string) => AssembledTransaction<null>;
938
+ endpoint: (json: string) => AssembledTransaction<string>;
939
+ local_eid: (json: string) => AssembledTransaction<number>;
796
940
  native_fee: (json: string) => AssembledTransaction<bigint>;
797
941
  zro_fee: (json: string) => AssembledTransaction<bigint>;
942
+ fee_recipient: (json: string) => AssembledTransaction<string>;
798
943
  whitelisted_caller: (json: string) => AssembledTransaction<string>;
799
- endpoint: (json: string) => AssembledTransaction<string>;
800
- eid: (json: string) => AssembledTransaction<number>;
801
- treasury: (json: string) => AssembledTransaction<string>;
802
944
  owner: (json: string) => AssembledTransaction<Option<string>>;
803
945
  transfer_ownership: (json: string) => AssembledTransaction<null>;
804
946
  renounce_ownership: (json: string) => AssembledTransaction<null>;
805
- set_ttl_config: (json: string) => AssembledTransaction<null>;
806
- ttl_config: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>, Option<TtlConfig>]>;
807
- freeze_ttl_config: (json: string) => AssembledTransaction<null>;
808
- is_ttl_config_frozen: (json: string) => AssembledTransaction<boolean>;
947
+ set_ttl_configs: (json: string) => AssembledTransaction<null>;
948
+ ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
949
+ freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
950
+ is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
951
+ extend_instance_ttl: (json: string) => AssembledTransaction<null>;
809
952
  };
810
953
  }