lumina-node-wasm 0.8.5 → 0.10.0

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,6 +8,324 @@ export function setup_logging(): void;
8
8
  * A helper to encode the SignDoc with protobuf to get bytes to sign directly.
9
9
  */
10
10
  export function protoEncodeSignDoc(sign_doc: SignDoc): Uint8Array;
11
+ /**
12
+ * Attack type for the associated evidence
13
+ */
14
+ export enum AttackType {
15
+ /**
16
+ * Duplicate vote
17
+ */
18
+ DuplicateVote = 0,
19
+ /**
20
+ * LightClient attack
21
+ */
22
+ LightClient = 1,
23
+ }
24
+ export enum CommitVoteType {
25
+ /**
26
+ * no vote was received from a validator.
27
+ */
28
+ BlockIdFlagAbsent = 0,
29
+ /**
30
+ * voted for the Commit.BlockID.
31
+ */
32
+ BlockIdFlagCommit = 1,
33
+ /**
34
+ * voted for nil
35
+ */
36
+ BlockIdFlagNil = 2,
37
+ }
38
+ /**
39
+ * Error codes associated with transaction responses.
40
+ */
41
+ export enum ErrorCode {
42
+ /**
43
+ * No error
44
+ */
45
+ Success = 0,
46
+ /**
47
+ * Cannot parse a transaction
48
+ */
49
+ TxDecode = 2,
50
+ /**
51
+ * Sequence number (nonce) is incorrect for the signature
52
+ */
53
+ InvalidSequence = 3,
54
+ /**
55
+ * Request without sufficient authorization is handled
56
+ */
57
+ Unauthorized = 4,
58
+ /**
59
+ * Account cannot pay requested amount
60
+ */
61
+ InsufficientFunds = 5,
62
+ /**
63
+ * Request is unknown
64
+ */
65
+ UnknownRequest = 6,
66
+ /**
67
+ * Address is invalid
68
+ */
69
+ InvalidAddress = 7,
70
+ /**
71
+ * Pubkey is invalid
72
+ */
73
+ InvalidPubKey = 8,
74
+ /**
75
+ * Address is unknown
76
+ */
77
+ UnknownAddress = 9,
78
+ /**
79
+ * Coin is invalid
80
+ */
81
+ InvalidCoins = 10,
82
+ /**
83
+ * Gas exceeded
84
+ */
85
+ OutOfGas = 11,
86
+ /**
87
+ * Memo too large
88
+ */
89
+ MemoTooLarge = 12,
90
+ /**
91
+ * Fee is insufficient
92
+ */
93
+ InsufficientFee = 13,
94
+ /**
95
+ * Too many signatures
96
+ */
97
+ TooManySignatures = 14,
98
+ /**
99
+ * No signatures in transaction
100
+ */
101
+ NoSignatures = 15,
102
+ /**
103
+ * Error converting to json
104
+ */
105
+ JSONMarshal = 16,
106
+ /**
107
+ * Error converting from json
108
+ */
109
+ JSONUnmarshal = 17,
110
+ /**
111
+ * Request contains invalid data
112
+ */
113
+ InvalidRequest = 18,
114
+ /**
115
+ * Tx already exists in the mempool
116
+ */
117
+ TxInMempoolCache = 19,
118
+ /**
119
+ * Mempool is full
120
+ */
121
+ MempoolIsFull = 20,
122
+ /**
123
+ * Tx is too large
124
+ */
125
+ TxTooLarge = 21,
126
+ /**
127
+ * Key doesn't exist
128
+ */
129
+ KeyNotFound = 22,
130
+ /**
131
+ * Key password is invalid
132
+ */
133
+ WrongPassword = 23,
134
+ /**
135
+ * Tx intended signer does not match the given signer
136
+ */
137
+ InvalidSigner = 24,
138
+ /**
139
+ * Invalid gas adjustment
140
+ */
141
+ InvalidGasAdjustment = 25,
142
+ /**
143
+ * Invalid height
144
+ */
145
+ InvalidHeight = 26,
146
+ /**
147
+ * Invalid version
148
+ */
149
+ InvalidVersion = 27,
150
+ /**
151
+ * Chain-id is invalid
152
+ */
153
+ InvalidChainID = 28,
154
+ /**
155
+ * Invalid type
156
+ */
157
+ InvalidType = 29,
158
+ /**
159
+ * Tx rejected due to an explicitly set timeout height
160
+ */
161
+ TxTimeoutHeight = 30,
162
+ /**
163
+ * Unknown extension options.
164
+ */
165
+ UnknownExtensionOptions = 31,
166
+ /**
167
+ * Account sequence defined in the signer info doesn't match the account's actual sequence
168
+ */
169
+ WrongSequence = 32,
170
+ /**
171
+ * Packing a protobuf message to Any failed
172
+ */
173
+ PackAny = 33,
174
+ /**
175
+ * Unpacking a protobuf message from Any failed
176
+ */
177
+ UnpackAny = 34,
178
+ /**
179
+ * Internal logic error, e.g. an invariant or assertion that is violated
180
+ */
181
+ Logic = 35,
182
+ /**
183
+ * Conflict error, e.g. when two goroutines try to access the same resource and one of them fails
184
+ */
185
+ Conflict = 36,
186
+ /**
187
+ * Called a branch of a code which is currently not supported
188
+ */
189
+ NotSupported = 37,
190
+ /**
191
+ * Requested entity doesn't exist in the state
192
+ */
193
+ NotFound = 38,
194
+ /**
195
+ * Internal errors caused by external operation
196
+ */
197
+ IO = 39,
198
+ /**
199
+ * Min-gas-prices field in BaseConfig is empty
200
+ */
201
+ AppConfig = 40,
202
+ /**
203
+ * Invalid GasWanted value is supplied
204
+ */
205
+ InvalidGasLimit = 41,
206
+ /**
207
+ * Node recovered from panic
208
+ */
209
+ Panic = 111222,
210
+ /**
211
+ * cannot use reserved namespace IDs
212
+ */
213
+ ReservedNamespace = 11110,
214
+ /**
215
+ * invalid namespace length
216
+ */
217
+ InvalidNamespaceLen = 11111,
218
+ /**
219
+ * data must be multiple of shareSize
220
+ */
221
+ InvalidDataSize = 11112,
222
+ /**
223
+ * actual blob size differs from that specified in the MsgPayForBlob
224
+ */
225
+ BlobSizeMismatch = 11113,
226
+ /**
227
+ * committed to invalid square size: must be power of two
228
+ */
229
+ CommittedSquareSizeNotPowOf2 = 11114,
230
+ /**
231
+ * unexpected error calculating commitment for share
232
+ */
233
+ CalculateCommitment = 11115,
234
+ /**
235
+ * invalid commitment for share
236
+ */
237
+ InvalidShareCommitment = 11116,
238
+ /**
239
+ * cannot use parity shares namespace ID
240
+ */
241
+ ParitySharesNamespace = 11117,
242
+ /**
243
+ * cannot use tail padding namespace ID
244
+ */
245
+ TailPaddingNamespace = 11118,
246
+ /**
247
+ * cannot use transaction namespace ID
248
+ */
249
+ TxNamespace = 11119,
250
+ /**
251
+ * invalid share commitments: all relevant square sizes must be committed to
252
+ */
253
+ InvalidShareCommitments = 11122,
254
+ /**
255
+ * unsupported share version
256
+ */
257
+ UnsupportedShareVersion = 11123,
258
+ /**
259
+ * cannot use zero blob size
260
+ */
261
+ ZeroBlobSize = 11124,
262
+ /**
263
+ * mismatched number of blobs per MsgPayForBlob
264
+ */
265
+ MismatchedNumberOfPFBorBlob = 11125,
266
+ /**
267
+ * no MsgPayForBlobs found in blob transaction
268
+ */
269
+ NoPFB = 11126,
270
+ /**
271
+ * namespace of blob and its respective MsgPayForBlobs differ
272
+ */
273
+ NamespaceMismatch = 11127,
274
+ /**
275
+ * failure to parse a transaction from its protobuf representation
276
+ */
277
+ ProtoParsing = 11128,
278
+ /**
279
+ * not yet supported: multiple sdk.Msgs found in BlobTx
280
+ */
281
+ MultipleMsgsInBlobTx = 11129,
282
+ /**
283
+ * number of each component in a MsgPayForBlobs must be identical
284
+ */
285
+ MismatchedNumberOfPFBComponent = 11130,
286
+ /**
287
+ * no blobs provided
288
+ */
289
+ NoBlobs = 11131,
290
+ /**
291
+ * no namespaces provided
292
+ */
293
+ NoNamespaces = 11132,
294
+ /**
295
+ * no share versions provided
296
+ */
297
+ NoShareVersions = 11133,
298
+ /**
299
+ * no blob sizes provided
300
+ */
301
+ NoBlobSizes = 11134,
302
+ /**
303
+ * no share commitments provided
304
+ */
305
+ NoShareCommitments = 11135,
306
+ /**
307
+ * invalid namespace
308
+ */
309
+ InvalidNamespace = 11136,
310
+ /**
311
+ * invalid namespace version
312
+ */
313
+ InvalidNamespaceVersion = 11137,
314
+ /**
315
+ * total blob size too large
316
+ *
317
+ * TotalBlobSize is deprecated, use BlobsTooLarge instead.
318
+ */
319
+ TotalBlobSizeTooLarge = 11138,
320
+ /**
321
+ * blob(s) too large
322
+ */
323
+ BlobsTooLarge = 11139,
324
+ /**
325
+ * invalid blob signer
326
+ */
327
+ InvalidBlobSigner = 11140,
328
+ }
11
329
  /**
12
330
  * Supported Celestia networks.
13
331
  */
@@ -29,22 +347,60 @@ export enum Network {
29
347
  */
30
348
  Private = 3,
31
349
  }
350
+ export enum SignatureMode {
351
+ Single = 0,
352
+ Multi = 1,
353
+ }
354
+ /**
355
+ * TxPriority is the priority level of the requested gas price.
356
+ */
357
+ export enum TxPriority {
358
+ /**
359
+ * Estimated gas price is the value at the end of the lowest 10% of gas prices from the last 5 blocks.
360
+ */
361
+ Low = 1,
362
+ /**
363
+ * Estimated gas price is the mean of all gas prices from the last 5 blocks.
364
+ */
365
+ Medium = 2,
366
+ /**
367
+ * Estimated gas price is the price at the start of the top 10% of transactions’ gas prices from the last 5 blocks.
368
+ */
369
+ High = 3,
370
+ }
32
371
  /**
33
- * Sampling status for a block.
372
+ * Represents state of the transaction in the mempool
34
373
  */
35
- export enum SamplingStatus {
374
+ export enum TxStatus {
36
375
  /**
37
- * Sampling is not done.
376
+ * The transaction is not known to the node, it could be never sent.
38
377
  */
39
378
  Unknown = 0,
40
379
  /**
41
- * Sampling is done and block is accepted.
380
+ * The transaction is still pending.
381
+ */
382
+ Pending = 1,
383
+ /**
384
+ * The transaction was evicted from the mempool.
42
385
  */
43
- Accepted = 1,
386
+ Evicted = 2,
44
387
  /**
45
- * Sampling is done and block is rejected.
388
+ * The transaction was committed into the block.
46
389
  */
47
- Rejected = 2,
390
+ Committed = 3,
391
+ }
392
+ /**
393
+ * Types of votes
394
+ */
395
+ export enum VoteType {
396
+ /**
397
+ * Prevote
398
+ */
399
+ Prevote = 0,
400
+ /**
401
+ * Precommit
402
+ */
403
+ Precommit = 1,
48
404
  }
49
405
  /**
50
406
  * The `ReadableStreamType` enum.
@@ -53,6 +409,26 @@ export enum SamplingStatus {
53
409
  */
54
410
  type ReadableStreamType = "bytes";
55
411
 
412
+ /**
413
+ * Coin
414
+ */
415
+ export interface Coin {
416
+ denom: string,
417
+ amount: bigint
418
+ }
419
+
420
+
421
+
422
+ /**
423
+ * Protobuf Any type
424
+ */
425
+ export interface ProtoAny {
426
+ typeUrl: string;
427
+ value: Uint8Array;
428
+ }
429
+
430
+
431
+
56
432
  /**
57
433
  * Public key
58
434
  */
@@ -84,16 +460,6 @@ type ReadableStreamType = "bytes";
84
460
 
85
461
 
86
462
 
87
- /**
88
- * Coin
89
- */
90
- export interface Coin {
91
- denom: string,
92
- amount: bigint
93
- }
94
-
95
-
96
-
97
463
  /**
98
464
  * A payload to be signed
99
465
  */
@@ -111,21 +477,17 @@ export type SignerFn = ((arg: SignDoc) => Uint8Array) | ((arg: SignDoc) => Promi
111
477
 
112
478
 
113
479
 
114
- /**
115
- * Protobuf Any type
116
- */
117
- export interface ProtoAny {
118
- typeUrl: string;
119
- value: Uint8Array;
120
- }
121
-
122
-
123
-
124
480
  /**
125
481
  * Transaction info
126
482
  */
127
483
  export interface TxInfo {
484
+ /**
485
+ * Hash of the transaction.
486
+ */
128
487
  hash: string;
488
+ /**
489
+ * Height at which transaction was submitted.
490
+ */
129
491
  height: bigint;
130
492
  }
131
493
 
@@ -133,12 +495,98 @@ export interface ProtoAny {
133
495
  * Transaction config.
134
496
  */
135
497
  export interface TxConfig {
498
+ /**
499
+ * Custom gas limit for the transaction (in `utia`). By default, client will
500
+ * query gas estimation service to get estimate gas limit.
501
+ */
136
502
  gasLimit?: bigint; // utia
503
+ /**
504
+ * Custom gas price for fee calculation. By default, client will query gas
505
+ * estimation service to get gas price estimate.
506
+ */
137
507
  gasPrice?: number;
508
+ /**
509
+ * Memo for the transaction
510
+ */
138
511
  memo?: string;
512
+ /**
513
+ * Priority of the transaction, used with gas estimation service
514
+ */
515
+ priority?: TxPriority;
139
516
  }
140
517
 
141
518
 
519
+ /**
520
+ * ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
521
+ */
522
+ export class AbciMessageLog {
523
+ private constructor();
524
+ free(): void;
525
+ msg_index: number;
526
+ log: string;
527
+ /**
528
+ * Events contains a slice of Event objects that were emitted during some
529
+ * execution.
530
+ */
531
+ events: StringEvent[];
532
+ }
533
+ /**
534
+ * Response to a tx query
535
+ */
536
+ export class AbciQueryResponse {
537
+ private constructor();
538
+ free(): void;
539
+ /**
540
+ * Response code.
541
+ */
542
+ code: ErrorCode;
543
+ /**
544
+ * Namespace for the Code.
545
+ */
546
+ codespace: string;
547
+ /**
548
+ * The index of the key in the tree.
549
+ */
550
+ index: bigint;
551
+ /**
552
+ * The key of the matching data.
553
+ */
554
+ key: Uint8Array;
555
+ /**
556
+ * The value of the matching data.
557
+ */
558
+ value: Uint8Array;
559
+ /**
560
+ * Serialized proof for the value data, if requested,
561
+ * to be verified against the [`AppHash`] for the given [`Height`].
562
+ *
563
+ * [`AppHash`]: tendermint::hash::AppHash
564
+ */
565
+ get proof_ops(): ProofOps | undefined;
566
+ /**
567
+ * Serialized proof for the value data, if requested,
568
+ * to be verified against the [`AppHash`] for the given [`Height`].
569
+ *
570
+ * [`AppHash`]: tendermint::hash::AppHash
571
+ */
572
+ set proof_ops(value: ProofOps | null | undefined);
573
+ /**
574
+ * The output of the application's logger (raw string). May be
575
+ * non-deterministic.
576
+ */
577
+ log: string;
578
+ /**
579
+ * Additional information. May be non-deterministic.
580
+ */
581
+ info: string;
582
+ /**
583
+ * The block height from which data was derived.
584
+ *
585
+ * Note that this is the height of the block containing the application's Merkle root hash,
586
+ * which represents the state as it was after committing the block at height - 1.
587
+ */
588
+ readonly height: bigint;
589
+ }
142
590
  /**
143
591
  * Address of an account.
144
592
  */
@@ -155,108 +603,336 @@ export class AccAddress {
155
603
  free(): void;
156
604
  }
157
605
  /**
158
- * Version of the App
606
+ * Version of the App
607
+ */
608
+ export class AppVersion {
609
+ private constructor();
610
+ free(): void;
611
+ /**
612
+ * Latest App version variant.
613
+ */
614
+ static latest(): AppVersion;
615
+ /**
616
+ * App v1
617
+ */
618
+ static readonly V1: AppVersion;
619
+ /**
620
+ * App v2
621
+ */
622
+ static readonly V2: AppVersion;
623
+ /**
624
+ * App v3
625
+ */
626
+ static readonly V3: AppVersion;
627
+ /**
628
+ * App v4
629
+ */
630
+ static readonly V4: AppVersion;
631
+ /**
632
+ * App v5
633
+ */
634
+ static readonly V5: AppVersion;
635
+ }
636
+ /**
637
+ * Attribute defines an attribute wrapper where the key and value are
638
+ * strings instead of raw bytes.
639
+ */
640
+ export class Attribute {
641
+ private constructor();
642
+ free(): void;
643
+ key: string;
644
+ value: string;
645
+ }
646
+ /**
647
+ * [`AuthInfo`] describes the fee and signer modes that are used to sign a transaction.
648
+ */
649
+ export class AuthInfo {
650
+ private constructor();
651
+ free(): void;
652
+ /**
653
+ * Defines the signing modes for the required signers.
654
+ *
655
+ * The number and order of elements must match the required signers from transaction
656
+ * [`TxBody`]’s messages. The first element is the primary signer and the one
657
+ * which pays the [`Fee`].
658
+ */
659
+ signer_infos: SignerInfo[];
660
+ /**
661
+ * [`Fee`] and gas limit for the transaction.
662
+ *
663
+ * The first signer is the primary signer and the one which pays the fee.
664
+ * The fee can be calculated based on the cost of evaluating the body and doing signature
665
+ * verification of the signers. This can be estimated via simulation.
666
+ */
667
+ fee: Fee;
668
+ }
669
+ /**
670
+ * Arbitrary data that can be stored in the network within certain [`Namespace`].
671
+ */
672
+ export class Blob {
673
+ /**
674
+ ** Return copy of self without private attributes.
675
+ */
676
+ toJSON(): Object;
677
+ /**
678
+ * Return stringified version of self.
679
+ */
680
+ toString(): string;
681
+ free(): void;
682
+ /**
683
+ * Create a new blob with the given data within the [`Namespace`].
684
+ */
685
+ constructor(namespace: Namespace, data: Uint8Array, app_version: AppVersion);
686
+ /**
687
+ * Clone a blob creating a new deep copy of it.
688
+ */
689
+ clone(): Blob;
690
+ /**
691
+ * A [`Namespace`] the [`Blob`] belongs to.
692
+ */
693
+ namespace: Namespace;
694
+ /**
695
+ * Data stored within the [`Blob`].
696
+ */
697
+ data: Uint8Array;
698
+ /**
699
+ * Version indicating the format in which [`Share`]s should be created from this [`Blob`].
700
+ */
701
+ share_version: number;
702
+ /**
703
+ * A [`Commitment`] computed from the [`Blob`]s data.
704
+ */
705
+ commitment: Commitment;
706
+ /**
707
+ * Index of the blob's first share in the EDS. Only set for blobs retrieved from chain.
708
+ */
709
+ get index(): bigint | undefined;
710
+ /**
711
+ * Index of the blob's first share in the EDS. Only set for blobs retrieved from chain.
712
+ */
713
+ set index(value: bigint | null | undefined);
714
+ /**
715
+ * A signer of the blob, i.e. address of the account which submitted the blob.
716
+ *
717
+ * Must be present in `share_version 1` and absent otherwise.
718
+ */
719
+ get signer(): AccAddress | undefined;
720
+ /**
721
+ * A signer of the blob, i.e. address of the account which submitted the blob.
722
+ *
723
+ * Must be present in `share_version 1` and absent otherwise.
724
+ */
725
+ set signer(value: AccAddress | null | undefined);
726
+ }
727
+ /**
728
+ * Params defines the parameters for the blob module.
729
+ */
730
+ export class BlobParams {
731
+ private constructor();
732
+ /**
733
+ ** Return copy of self without private attributes.
734
+ */
735
+ toJSON(): Object;
736
+ /**
737
+ * Return stringified version of self.
738
+ */
739
+ toString(): string;
740
+ free(): void;
741
+ /**
742
+ * Gas cost per blob byte
743
+ */
744
+ gas_per_blob_byte: number;
745
+ /**
746
+ * Max square size
747
+ */
748
+ gov_max_square_size: bigint;
749
+ }
750
+ /**
751
+ * Blocks consist of a header, transactions, votes (the commit), and a list of
752
+ * evidence of malfeasance (i.e. signing conflicting votes).
753
+ *
754
+ * This is a modified version of [`tendermint::block::Block`] which contains
755
+ * [modifications](data-mod) that Celestia introduced.
756
+ *
757
+ * [data-mod]: https://github.com/celestiaorg/celestia-core/blob/a1268f7ae3e688144a613c8a439dd31818aae07d/proto/tendermint/types/types.proto#L84-L104
758
+ */
759
+ export class Block {
760
+ private constructor();
761
+ free(): void;
762
+ /**
763
+ * Transaction data
764
+ */
765
+ data: Data;
766
+ /**
767
+ * Block header
768
+ */
769
+ readonly header: Header;
770
+ /**
771
+ * Evidence of malfeasance
772
+ */
773
+ readonly evidence: Evidence[];
774
+ /**
775
+ * Last commit, should be `None` for the initial block.
776
+ */
777
+ readonly lastCommit: Commit | undefined;
778
+ }
779
+ /**
780
+ * Block identifiers which contain two distinct Merkle roots of the block, as well as the number of parts in the block.
781
+ */
782
+ export class BlockId {
783
+ private constructor();
784
+ free(): void;
785
+ /**
786
+ * The block’s main hash is the Merkle root of all the fields in the block header.
787
+ */
788
+ hash: string;
789
+ /**
790
+ * Parts header (if available) is used for secure gossipping of the block during
791
+ * consensus. It is the Merkle root of the complete serialized block cut into parts.
792
+ *
793
+ * PartSet is used to split a byteslice of data into parts (pieces) for transmission.
794
+ * By splitting data into smaller parts and computing a Merkle root hash on the list,
795
+ * you can verify that a part is legitimately part of the complete data, and the part
796
+ * can be forwarded to other peers before all the parts are known. In short, it’s
797
+ * a fast way to propagate a large file over a gossip network.
798
+ *
799
+ * <https://github.com/tendermint/tendermint/wiki/Block-Structure#partset>
800
+ *
801
+ * PartSetHeader in protobuf is defined as never nil using the gogoproto annotations.
802
+ * This does not translate to Rust, but we can indicate this in the domain type.
803
+ */
804
+ part_set_header: PartsHeader;
805
+ }
806
+ /**
807
+ * A range of blocks between `start` and `end` height, inclusive
808
+ */
809
+ export class BlockRange {
810
+ private constructor();
811
+ /**
812
+ ** Return copy of self without private attributes.
813
+ */
814
+ toJSON(): Object;
815
+ /**
816
+ * Return stringified version of self.
817
+ */
818
+ toString(): string;
819
+ free(): void;
820
+ /**
821
+ * First block height in range
822
+ */
823
+ start: bigint;
824
+ /**
825
+ * Last block height in range
826
+ */
827
+ end: bigint;
828
+ }
829
+ /**
830
+ * BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method.
159
831
  */
160
- export class AppVersion {
832
+ export class BroadcastMode {
161
833
  private constructor();
162
834
  free(): void;
163
835
  /**
164
- * Latest App version variant.
836
+ * zero-value for mode ordering
165
837
  */
166
- static latest(): AppVersion;
838
+ static readonly Unspecified: BroadcastMode;
167
839
  /**
168
- * App v1
840
+ * `BroadcastMode` `Block` defines a tx broadcasting mode where the client waits for
841
+ * the tx to be committed in a block.
169
842
  */
170
- static readonly V1: AppVersion;
843
+ static readonly Block: BroadcastMode;
171
844
  /**
172
- * App v2
845
+ * `BroadcastMode` `Sync` defines a tx broadcasting mode where the client waits for
846
+ * a CheckTx execution response only.
173
847
  */
174
- static readonly V2: AppVersion;
848
+ static readonly Sync: BroadcastMode;
175
849
  /**
176
- * App v3
850
+ * `BroadcastMode` `Async` defines a tx broadcasting mode where the client returns
851
+ * immediately.
177
852
  */
178
- static readonly V3: AppVersion;
853
+ static readonly Async: BroadcastMode;
179
854
  }
180
855
  /**
181
- * Arbitrary data that can be stored in the network within certain [`Namespace`].
856
+ * Coin defines a token with a denomination and an amount.
182
857
  */
183
- export class Blob {
184
- /**
185
- ** Return copy of self without private attributes.
186
- */
187
- toJSON(): Object;
188
- /**
189
- * Return stringified version of self.
190
- */
191
- toString(): string;
858
+ export class Coin {
859
+ private constructor();
192
860
  free(): void;
193
861
  /**
194
- * Create a new blob with the given data within the [`Namespace`].
195
- */
196
- constructor(namespace: Namespace, data: Uint8Array, app_version: AppVersion);
197
- /**
198
- * Clone a blob creating a new deep copy of it.
862
+ * Coin denomination
199
863
  */
200
- clone(): Blob;
864
+ denom: string;
201
865
  /**
202
- * A [`Namespace`] the [`Blob`] belongs to.
866
+ * Coin amount
203
867
  */
204
- namespace: Namespace;
868
+ amount: bigint;
869
+ }
870
+ /**
871
+ * Commit contains the justification (ie. a set of signatures) that a block was
872
+ * committed by a set of validators.
873
+ */
874
+ export class Commit {
875
+ private constructor();
876
+ free(): void;
205
877
  /**
206
- * Data stored within the [`Blob`].
878
+ * Block height
207
879
  */
208
- data: Uint8Array;
880
+ height: bigint;
209
881
  /**
210
- * Version indicating the format in which [`Share`]s should be created from this [`Blob`].
882
+ * Round
211
883
  */
212
- share_version: number;
884
+ round: number;
213
885
  /**
214
- * A [`Commitment`] computed from the [`Blob`]s data.
886
+ * Block ID
215
887
  */
216
- commitment: Commitment;
888
+ block_id: BlockId;
217
889
  /**
218
- * Index of the blob's first share in the EDS. Only set for blobs retrieved from chain.
890
+ * Signatures
219
891
  */
220
- get index(): bigint | undefined;
892
+ signatures: CommitSig[];
893
+ }
894
+ /**
895
+ * CommitSig represents a signature of a validator. It’s a part of the Commit and can
896
+ * be used to reconstruct the vote set given the validator set.
897
+ */
898
+ export class CommitSig {
899
+ private constructor();
900
+ free(): void;
221
901
  /**
222
- * Index of the blob's first share in the EDS. Only set for blobs retrieved from chain.
902
+ * vote type of a validator
223
903
  */
224
- set index(value: bigint | null | undefined);
904
+ vote_type: CommitVoteType;
225
905
  /**
226
- * A signer of the blob, i.e. address of the account which submitted the blob.
227
- *
228
- * Must be present in `share_version 1` and absent otherwise.
906
+ * vote, if received
229
907
  */
230
- get signer(): AccAddress | undefined;
908
+ get vote(): CommitVote | undefined;
231
909
  /**
232
- * A signer of the blob, i.e. address of the account which submitted the blob.
233
- *
234
- * Must be present in `share_version 1` and absent otherwise.
910
+ * vote, if received
235
911
  */
236
- set signer(value: AccAddress | null | undefined);
912
+ set vote(value: CommitVote | null | undefined);
237
913
  }
238
914
  /**
239
- * A range of blocks between `start` and `end` height, inclusive
915
+ * Value of the validator vote
240
916
  */
241
- export class BlockRange {
917
+ export class CommitVote {
242
918
  private constructor();
243
- /**
244
- ** Return copy of self without private attributes.
245
- */
246
- toJSON(): Object;
247
- /**
248
- * Return stringified version of self.
249
- */
250
- toString(): string;
251
919
  free(): void;
252
920
  /**
253
- * First block height in range
921
+ * Address of the voting validator
254
922
  */
255
- start: bigint;
923
+ validator_address: string;
256
924
  /**
257
- * Last block height in range
925
+ * Timestamp
258
926
  */
259
- end: bigint;
927
+ timestamp: string;
928
+ /**
929
+ * Signature
930
+ */
931
+ get signature(): Signature | undefined;
932
+ /**
933
+ * Signature
934
+ */
935
+ set signature(value: Signature | null | undefined);
260
936
  }
261
937
  /**
262
938
  * A merkle hash used to identify the [`Blob`]s data.
@@ -312,6 +988,21 @@ export class Commitment {
312
988
  */
313
989
  hash(): Uint8Array;
314
990
  }
991
+ /**
992
+ * Conflicting block detected in light client attack
993
+ */
994
+ export class ConflictingBlock {
995
+ private constructor();
996
+ free(): void;
997
+ /**
998
+ * Signed header
999
+ */
1000
+ signed_header: SignedHeader;
1001
+ /**
1002
+ * Validator set
1003
+ */
1004
+ validator_set: ValidatorSet;
1005
+ }
315
1006
  export class ConnectionCountersSnapshot {
316
1007
  private constructor();
317
1008
  /**
@@ -367,6 +1058,29 @@ export class ConsAddress {
367
1058
  toString(): string;
368
1059
  free(): void;
369
1060
  }
1061
+ /**
1062
+ * Data contained in a [`Block`].
1063
+ *
1064
+ * [`Block`]: crate::block::Block
1065
+ */
1066
+ export class Data {
1067
+ private constructor();
1068
+ free(): void;
1069
+ /**
1070
+ * Square width of original data square.
1071
+ */
1072
+ square_size: bigint;
1073
+ /**
1074
+ * Hash is the root of a binary Merkle tree where the leaves of the tree are
1075
+ * the row and column roots of an extended data square. Hash is often referred
1076
+ * to as the "data root".
1077
+ */
1078
+ hash: Uint8Array;
1079
+ /**
1080
+ * Transactions
1081
+ */
1082
+ readonly transactions: Uint8Array[];
1083
+ }
370
1084
  /**
371
1085
  * Header with commitments of the data availability.
372
1086
  *
@@ -441,6 +1155,40 @@ export class DataAvailabilityHeader {
441
1155
  */
442
1156
  squareWidth(): number;
443
1157
  }
1158
+ /**
1159
+ * Duplicate vote evidence
1160
+ */
1161
+ export class DuplicateVoteEvidence {
1162
+ private constructor();
1163
+ free(): void;
1164
+ /**
1165
+ * Vote A
1166
+ */
1167
+ vote_a: Vote;
1168
+ /**
1169
+ * Vote B
1170
+ */
1171
+ vote_b: Vote;
1172
+ /**
1173
+ * Total voting power
1174
+ */
1175
+ total_voting_power: bigint;
1176
+ /**
1177
+ * Validator power
1178
+ */
1179
+ validator_power: bigint;
1180
+ /**
1181
+ * Timestamp
1182
+ */
1183
+ timestamp: string;
1184
+ }
1185
+ /**
1186
+ * Evidence of malfeasance by validators (i.e. signing conflicting votes or light client attack).
1187
+ */
1188
+ export class Evidence {
1189
+ private constructor();
1190
+ free(): void;
1191
+ }
444
1192
  /**
445
1193
  * Block header together with the relevant Data Availability metadata.
446
1194
  *
@@ -568,13 +1316,257 @@ export class ExtendedHeader {
568
1316
  */
569
1317
  readonly header: any;
570
1318
  /**
571
- * Commit metadata and signatures from validators committing the block.
1319
+ * Commit metadata and signatures from validators committing the block.
1320
+ */
1321
+ readonly commit: any;
1322
+ /**
1323
+ * Information about the set of validators commiting the block.
1324
+ */
1325
+ readonly validatorSet: any;
1326
+ }
1327
+ /**
1328
+ * Fee includes the amount of coins paid in fees and the maximum
1329
+ * gas to be used by the transaction. The ratio yields an effective "gasprice",
1330
+ * which must be above some miminum to be accepted into the mempool.
1331
+ */
1332
+ export class Fee {
1333
+ private constructor();
1334
+ free(): void;
1335
+ /**
1336
+ * amount is the amount of coins to be paid as a fee
1337
+ */
1338
+ amount: Coin[];
1339
+ /**
1340
+ * gas_limit is the maximum gas that can be used in transaction processing
1341
+ * before an out of gas error occurs
1342
+ */
1343
+ gas_limit: bigint;
1344
+ /**
1345
+ * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees.
1346
+ * the payer must be a tx signer (and thus have signed this field in AuthInfo).
1347
+ * setting this field does *not* change the ordering of required signers for the transaction.
1348
+ */
1349
+ readonly payer: string | undefined;
1350
+ /**
1351
+ * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used
1352
+ * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does
1353
+ * not support fee grants, this will fail
1354
+ */
1355
+ readonly granter: string | undefined;
1356
+ }
1357
+ /**
1358
+ * Result of gas price and usage estimation
1359
+ */
1360
+ export class GasEstimate {
1361
+ private constructor();
1362
+ free(): void;
1363
+ /**
1364
+ * Gas price estimated based on last 5 blocks
1365
+ */
1366
+ price: number;
1367
+ /**
1368
+ * Simulated transaction gas usage
1369
+ */
1370
+ usage: bigint;
1371
+ }
1372
+ /**
1373
+ * GasInfo defines tx execution gas context.
1374
+ */
1375
+ export class GasInfo {
1376
+ private constructor();
1377
+ free(): void;
1378
+ /**
1379
+ * GasWanted is the maximum units of work we allow this tx to perform.
1380
+ */
1381
+ gas_wanted: bigint;
1382
+ /**
1383
+ * GasUsed is the amount of gas actually consumed.
1384
+ */
1385
+ gas_used: bigint;
1386
+ }
1387
+ /**
1388
+ * Response to GetTx
1389
+ */
1390
+ export class GetTxResponse {
1391
+ private constructor();
1392
+ free(): void;
1393
+ /**
1394
+ * Response Transaction
1395
+ */
1396
+ tx: Tx;
1397
+ /**
1398
+ * TxResponse to a Query
1399
+ */
1400
+ tx_response: TxResponse;
1401
+ }
1402
+ /**
1403
+ * Celestia GRPC client
1404
+ */
1405
+ export class GrpcClient {
1406
+ private constructor();
1407
+ free(): void;
1408
+ /**
1409
+ * Create a new client connected with the given `url`
1410
+ */
1411
+ static new(url: string): Promise<GrpcClient>;
1412
+ /**
1413
+ * Get auth params
1414
+ */
1415
+ get_auth_params(): Promise<AuthParams>;
1416
+ /**
1417
+ * Get account
1418
+ */
1419
+ get_account(account: string): Promise<BaseAccount>;
1420
+ /**
1421
+ * Get accounts
1422
+ */
1423
+ get_accounts(): Promise<BaseAccount[]>;
1424
+ /**
1425
+ * Get balance of coins with bond denom for the given address, together with a proof,
1426
+ * and verify the returned balance against the corresponding block's app hash.
1427
+ *
1428
+ * NOTE: the balance returned is the balance reported by the parent block of
1429
+ * the provided header. This is due to the fact that for block N, the block's
1430
+ * app hash is the result of applying the previous block's transaction list.
1431
+ */
1432
+ get_verified_balance(address: string, header: ExtendedHeader): Promise<Coin>;
1433
+ /**
1434
+ * Get balance of coins with given denom
1435
+ */
1436
+ get_balance(address: string, denom: string): Promise<Coin>;
1437
+ /**
1438
+ * Get balance of all coins
1439
+ */
1440
+ get_all_balances(address: string): Promise<Coin[]>;
1441
+ /**
1442
+ * Get balance of all spendable coins
1443
+ */
1444
+ get_spendable_balances(address: string): Promise<Coin[]>;
1445
+ /**
1446
+ * Get total supply
1447
+ */
1448
+ get_total_supply(): Promise<Coin[]>;
1449
+ /**
1450
+ * Get Minimum Gas price
1451
+ */
1452
+ get_min_gas_price(): Promise<number>;
1453
+ /**
1454
+ * Get latest block
1455
+ */
1456
+ get_latest_block(): Promise<Block>;
1457
+ /**
1458
+ * Get block by height
1459
+ */
1460
+ get_block_by_height(height: bigint): Promise<Block>;
1461
+ /**
1462
+ * Issue a direct ABCI query to the application
1463
+ */
1464
+ abci_query(data: Uint8Array, path: string, height: bigint, prove: boolean): Promise<AbciQueryResponse>;
1465
+ /**
1466
+ * Broadcast prepared and serialised transaction
1467
+ */
1468
+ broadcast_tx(tx_bytes: Uint8Array, mode: BroadcastMode): Promise<TxResponse>;
1469
+ /**
1470
+ * Get Tx
1471
+ */
1472
+ get_tx(hash: string): Promise<GetTxResponse>;
1473
+ /**
1474
+ * Simulate prepared and serialised transaction, returning simulated gas usage
1475
+ */
1476
+ simulate(tx_bytes: Uint8Array): Promise<GasInfo>;
1477
+ /**
1478
+ * Get blob params
1479
+ */
1480
+ get_blob_params(): Promise<BlobParams>;
1481
+ /**
1482
+ * Get status of the transaction
1483
+ */
1484
+ tx_status(hash: string): Promise<TxStatusResponse>;
1485
+ }
1486
+ /**
1487
+ * Block Header values contain metadata about the block and about the consensus,
1488
+ * as well as commitments to the data in the current block, the previous block,
1489
+ * and the results returned by the application.
1490
+ */
1491
+ export class Header {
1492
+ private constructor();
1493
+ free(): void;
1494
+ /**
1495
+ * Header version
1496
+ */
1497
+ version: ProtocolVersion;
1498
+ /**
1499
+ * Chain ID
1500
+ */
1501
+ chain_id: string;
1502
+ /**
1503
+ * Current block height
1504
+ */
1505
+ height: bigint;
1506
+ /**
1507
+ * Current timestamp encoded as rfc3339
1508
+ */
1509
+ time: string;
1510
+ /**
1511
+ * Previous block info
1512
+ */
1513
+ get last_block_id(): BlockId | undefined;
1514
+ /**
1515
+ * Previous block info
1516
+ */
1517
+ set last_block_id(value: BlockId | null | undefined);
1518
+ /**
1519
+ * Commit from validators from the last block
1520
+ */
1521
+ get last_commit_hash(): string | undefined;
1522
+ /**
1523
+ * Commit from validators from the last block
1524
+ */
1525
+ set last_commit_hash(value: string | null | undefined);
1526
+ /**
1527
+ * Merkle root of transaction hashes
1528
+ */
1529
+ get data_hash(): string | undefined;
1530
+ /**
1531
+ * Merkle root of transaction hashes
1532
+ */
1533
+ set data_hash(value: string | null | undefined);
1534
+ /**
1535
+ * Validators for the current block
1536
+ */
1537
+ validators_hash: string;
1538
+ /**
1539
+ * Validators for the next block
1540
+ */
1541
+ next_validators_hash: string;
1542
+ /**
1543
+ * Consensus params for the current block
1544
+ */
1545
+ consensus_hash: string;
1546
+ /**
1547
+ * State after txs from the previous block
1548
+ */
1549
+ app_hash: string;
1550
+ /**
1551
+ * Root hash of all results from the txs from the previous block
1552
+ */
1553
+ get last_results_hash(): string | undefined;
1554
+ /**
1555
+ * Root hash of all results from the txs from the previous block
1556
+ */
1557
+ set last_results_hash(value: string | null | undefined);
1558
+ /**
1559
+ * Hash of evidence included in the block
1560
+ */
1561
+ get evidence_hash(): string | undefined;
1562
+ /**
1563
+ * Hash of evidence included in the block
572
1564
  */
573
- readonly commit: any;
1565
+ set evidence_hash(value: string | null | undefined);
574
1566
  /**
575
- * Information about the set of validators commiting the block.
1567
+ * Original proposer of the block
576
1568
  */
577
- readonly validatorSet: any;
1569
+ proposer_address: string;
578
1570
  }
579
1571
  export class IntoUnderlyingByteSource {
580
1572
  private constructor();
@@ -598,6 +1590,118 @@ export class IntoUnderlyingSource {
598
1590
  pull(controller: ReadableStreamDefaultController): Promise<any>;
599
1591
  cancel(): void;
600
1592
  }
1593
+ /**
1594
+ * Array of bits
1595
+ */
1596
+ export class JsBitVector {
1597
+ private constructor();
1598
+ free(): void;
1599
+ 0: Uint8Array;
1600
+ }
1601
+ /**
1602
+ * Event allows application developers to attach additional information to
1603
+ * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx.
1604
+ * Later, transactions may be queried using these events.
1605
+ */
1606
+ export class JsEvent {
1607
+ private constructor();
1608
+ free(): void;
1609
+ type: string;
1610
+ attributes: JsEventAttribute[];
1611
+ }
1612
+ export class JsEventAttribute {
1613
+ private constructor();
1614
+ free(): void;
1615
+ key: Uint8Array;
1616
+ value: Uint8Array;
1617
+ index: boolean;
1618
+ }
1619
+ /**
1620
+ * Validator information
1621
+ */
1622
+ export class JsValidatorInfo {
1623
+ private constructor();
1624
+ free(): void;
1625
+ /**
1626
+ * Validator account address
1627
+ */
1628
+ address: string;
1629
+ /**
1630
+ * Validator public key
1631
+ */
1632
+ pub_key: PublicKey;
1633
+ /**
1634
+ * Validator voting power
1635
+ */
1636
+ power: bigint;
1637
+ /**
1638
+ * Validator name
1639
+ */
1640
+ get name(): string | undefined;
1641
+ /**
1642
+ * Validator name
1643
+ */
1644
+ set name(value: string | null | undefined);
1645
+ /**
1646
+ * Validator proposer priority
1647
+ */
1648
+ proposer_priority: bigint;
1649
+ }
1650
+ /**
1651
+ * LightClient attack evidence
1652
+ */
1653
+ export class LightClientAttackEvidence {
1654
+ private constructor();
1655
+ free(): void;
1656
+ /**
1657
+ * Conflicting block
1658
+ */
1659
+ conflicting_block: ConflictingBlock;
1660
+ /**
1661
+ * Common height
1662
+ */
1663
+ common_height: bigint;
1664
+ /**
1665
+ * Byzantine validators
1666
+ */
1667
+ byzantine_validators: JsValidatorInfo[];
1668
+ /**
1669
+ * Total voting power
1670
+ */
1671
+ total_voting_power: bigint;
1672
+ /**
1673
+ * Timestamp
1674
+ */
1675
+ timestamp: string;
1676
+ }
1677
+ /**
1678
+ * ModeInfo describes the signing mode of a single or nested multisig signer.
1679
+ */
1680
+ export class ModeInfo {
1681
+ private constructor();
1682
+ free(): void;
1683
+ /**
1684
+ * Return signature mode for the stored signature(s)
1685
+ */
1686
+ signature_mode(): SignatureMode;
1687
+ /**
1688
+ * Single is the mode info for a single signer. It is structured as a message
1689
+ * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
1690
+ * future
1691
+ */
1692
+ readonly mode: number | undefined;
1693
+ /**
1694
+ * Multi is the mode info for a multisig public key
1695
+ * bitarray specifies which keys within the multisig are signing
1696
+ */
1697
+ readonly bitarray: JsBitVector | undefined;
1698
+ /**
1699
+ * Multi is the mode info for a multisig public key
1700
+ * mode_infos is the corresponding modes of the signers of the multisig
1701
+ * which could include nested multisig public keys
1702
+ */
1703
+ readonly mode_infos: ModeInfo[] | undefined;
1704
+ }
601
1705
  /**
602
1706
  * Namespace of the data published to the celestia network.
603
1707
  *
@@ -810,7 +1914,7 @@ export class NodeClient {
810
1914
  * Request all blobs with provided namespace in the block corresponding to this header
811
1915
  * using bitswap protocol.
812
1916
  */
813
- requestAllBlobs(header: ExtendedHeader, namespace: Namespace, timeout_secs?: number | null): Promise<Blob[]>;
1917
+ requestAllBlobs(namespace: Namespace, block_height: bigint, timeout_secs?: number | null): Promise<Blob[]>;
814
1918
  /**
815
1919
  * Get current header syncing info.
816
1920
  */
@@ -885,51 +1989,31 @@ export class NodeConfig {
885
1989
  */
886
1990
  usePersistentMemory: boolean;
887
1991
  /**
888
- * Sampling window defines maximum age of a block considered for syncing and sampling.
889
- *
890
- * If this is not set, then default value will apply:
891
- *
892
- * * If `use_persistent_memory == true`, default value is 30 days.
893
- * * If `use_persistent_memory == false`, default value is 60 seconds.
1992
+ * Pruning window defines maximum age of a block for it to be retained in store.
894
1993
  *
895
- * The minimum value that can be set is 60 seconds.
896
- */
897
- get customSamplingWindowSecs(): number | undefined;
898
- /**
899
- * Sampling window defines maximum age of a block considered for syncing and sampling.
1994
+ * If pruning window is smaller than sampling window, then blocks will be pruned
1995
+ * right after they are sampled. This is useful when you want to keep low
1996
+ * memory footprint but still validate the blockchain.
900
1997
  *
901
1998
  * If this is not set, then default value will apply:
902
1999
  *
903
- * * If `use_persistent_memory == true`, default value is 30 days.
904
- * * If `use_persistent_memory == false`, default value is 60 seconds.
905
- *
906
- * The minimum value that can be set is 60 seconds.
2000
+ * * If `use_persistent_memory == true`, default value is 7 days plus 1 hour.
2001
+ * * If `use_persistent_memory == false`, default value is 0 seconds.
907
2002
  */
908
- set customSamplingWindowSecs(value: number | null | undefined);
2003
+ get customPruningWindowSecs(): number | undefined;
909
2004
  /**
910
- * Pruning delay defines how much time the pruner should wait after sampling window in
911
- * order to prune the block.
912
- *
913
- * If this is not set, then default value will apply:
914
- *
915
- * * If `use_persistent_memory == true`, default value is 1 hour.
916
- * * If `use_persistent_memory == false`, default value is 60 seconds.
2005
+ * Pruning window defines maximum age of a block for it to be retained in store.
917
2006
  *
918
- * The minimum value that can be set is 60 seconds.
919
- */
920
- get customPruningDelaySecs(): number | undefined;
921
- /**
922
- * Pruning delay defines how much time the pruner should wait after sampling window in
923
- * order to prune the block.
2007
+ * If pruning window is smaller than sampling window, then blocks will be pruned
2008
+ * right after they are sampled. This is useful when you want to keep low
2009
+ * memory footprint but still validate the blockchain.
924
2010
  *
925
2011
  * If this is not set, then default value will apply:
926
2012
  *
927
- * * If `use_persistent_memory == true`, default value is 1 hour.
928
- * * If `use_persistent_memory == false`, default value is 60 seconds.
929
- *
930
- * The minimum value that can be set is 60 seconds.
2013
+ * * If `use_persistent_memory == true`, default value is 7 days plus 1 hour.
2014
+ * * If `use_persistent_memory == false`, default value is 0 seconds.
931
2015
  */
932
- set customPruningDelaySecs(value: number | null | undefined);
2016
+ set customPruningWindowSecs(value: number | null | undefined);
933
2017
  }
934
2018
  /**
935
2019
  * `NodeWorker` is responsible for receiving commands from connected [`NodeClient`]s, executing
@@ -942,6 +2026,21 @@ export class NodeWorker {
942
2026
  constructor(port_like_object: any);
943
2027
  run(): Promise<void>;
944
2028
  }
2029
+ /**
2030
+ * Block parts header
2031
+ */
2032
+ export class PartsHeader {
2033
+ private constructor();
2034
+ free(): void;
2035
+ /**
2036
+ * Number of parts in this block
2037
+ */
2038
+ total: number;
2039
+ /**
2040
+ * Hash of the parts set header
2041
+ */
2042
+ hash: string;
2043
+ }
945
2044
  /**
946
2045
  * Statistics of the connected peers
947
2046
  */
@@ -965,6 +2064,47 @@ export class PeerTrackerInfoSnapshot {
965
2064
  */
966
2065
  num_connected_trusted_peers: bigint;
967
2066
  }
2067
+ /**
2068
+ * ProofOp defines an operation used for calculating Merkle root. The data could
2069
+ * be arbitrary format, providing nessecary data for example neighbouring node
2070
+ * hash.
2071
+ *
2072
+ * Note: This type is a duplicate of the ProofOp proto type defined in
2073
+ * Tendermint.
2074
+ */
2075
+ export class ProofOp {
2076
+ private constructor();
2077
+ free(): void;
2078
+ type: string;
2079
+ key: Uint8Array;
2080
+ data: Uint8Array;
2081
+ }
2082
+ /**
2083
+ * ProofOps is Merkle proof defined by the list of ProofOps.
2084
+ *
2085
+ * Note: This type is a duplicate of the ProofOps proto type defined in
2086
+ * Tendermint.
2087
+ */
2088
+ export class ProofOps {
2089
+ private constructor();
2090
+ free(): void;
2091
+ ops: ProofOp[];
2092
+ }
2093
+ /**
2094
+ * Version contains the protocol version for the blockchain and the application.
2095
+ */
2096
+ export class ProtocolVersion {
2097
+ private constructor();
2098
+ free(): void;
2099
+ /**
2100
+ * blockchain version
2101
+ */
2102
+ block: bigint;
2103
+ /**
2104
+ * app version
2105
+ */
2106
+ app: bigint;
2107
+ }
968
2108
  /**
969
2109
  * Sampling metadata for a block.
970
2110
  *
@@ -973,15 +2113,69 @@ export class PeerTrackerInfoSnapshot {
973
2113
  export class SamplingMetadata {
974
2114
  private constructor();
975
2115
  free(): void;
976
- /**
977
- * Indicates whether this node was able to successfuly sample the block
978
- */
979
- status: SamplingStatus;
980
2116
  /**
981
2117
  * Return Array of cids
982
2118
  */
983
2119
  readonly cids: Uint8Array[];
984
2120
  }
2121
+ /**
2122
+ * Signature
2123
+ */
2124
+ export class Signature {
2125
+ private constructor();
2126
+ free(): void;
2127
+ 0: Uint8Array;
2128
+ }
2129
+ /**
2130
+ * Signed block headers
2131
+ */
2132
+ export class SignedHeader {
2133
+ private constructor();
2134
+ free(): void;
2135
+ /**
2136
+ * Signed block headers
2137
+ */
2138
+ header: Header;
2139
+ /**
2140
+ * Commit containing signatures for the header
2141
+ */
2142
+ commit: Commit;
2143
+ }
2144
+ /**
2145
+ * SignerInfo describes the public key and signing mode of a single top-level
2146
+ * signer.
2147
+ */
2148
+ export class SignerInfo {
2149
+ private constructor();
2150
+ free(): void;
2151
+ /**
2152
+ * public_key is the public key of the signer. It is optional for accounts
2153
+ * that already exist in state. If unset, the verifier can use the required \
2154
+ * signer address for this position and lookup the public key.
2155
+ */
2156
+ public_key(): ProtoAny | undefined;
2157
+ /**
2158
+ * mode_info describes the signing mode of the signer and is a nested
2159
+ * structure to support nested multisig pubkey's
2160
+ */
2161
+ mode_info: ModeInfo;
2162
+ /**
2163
+ * sequence is the sequence of the account, which describes the
2164
+ * number of committed transactions signed by a given address. It is used to
2165
+ * prevent replay attacks.
2166
+ */
2167
+ sequence: bigint;
2168
+ }
2169
+ /**
2170
+ * StringEvent defines en Event object wrapper where all the attributes
2171
+ * contain key/value pairs that are strings instead of raw bytes.
2172
+ */
2173
+ export class StringEvent {
2174
+ private constructor();
2175
+ free(): void;
2176
+ type: string;
2177
+ attributes: Attribute[];
2178
+ }
985
2179
  /**
986
2180
  * Status of the synchronization.
987
2181
  */
@@ -1005,6 +2199,66 @@ export class SyncingInfoSnapshot {
1005
2199
  */
1006
2200
  subjective_head: bigint;
1007
2201
  }
2202
+ /**
2203
+ * [`Tx`] is the standard type used for broadcasting transactions.
2204
+ */
2205
+ export class Tx {
2206
+ private constructor();
2207
+ free(): void;
2208
+ /**
2209
+ * Processable content of the transaction
2210
+ */
2211
+ body: TxBody;
2212
+ /**
2213
+ * Authorization related content of the transaction, specifically signers, signer modes
2214
+ * and [`Fee`].
2215
+ */
2216
+ auth_info: AuthInfo;
2217
+ /**
2218
+ * List of signatures that matches the length and order of [`AuthInfo`]’s `signer_info`s to
2219
+ * allow connecting signature meta information like public key and signing mode by position.
2220
+ */
2221
+ readonly signatures: Signature[];
2222
+ }
2223
+ /**
2224
+ * [`TxBody`] of a transaction that all signers sign over.
2225
+ */
2226
+ export class TxBody {
2227
+ private constructor();
2228
+ free(): void;
2229
+ /**
2230
+ * `messages` is a list of messages to be executed. The required signers of
2231
+ * those messages define the number and order of elements in `AuthInfo`'s
2232
+ * signer_infos and Tx's signatures. Each required signer address is added to
2233
+ * the list only the first time it occurs.
2234
+ *
2235
+ * By convention, the first required signer (usually from the first message)
2236
+ * is referred to as the primary signer and pays the fee for the whole
2237
+ * transaction.
2238
+ */
2239
+ messages(): ProtoAny[];
2240
+ /**
2241
+ * `extension_options` are arbitrary options that can be added by chains
2242
+ * when the default options are not sufficient. If any of these are present
2243
+ * and can't be handled, the transaction will be rejected
2244
+ */
2245
+ extension_options(): ProtoAny[];
2246
+ /**
2247
+ * `extension_options` are arbitrary options that can be added by chains
2248
+ * when the default options are not sufficient. If any of these are present
2249
+ * and can't be handled, they will be ignored
2250
+ */
2251
+ non_critical_extension_options(): ProtoAny[];
2252
+ /**
2253
+ * `memo` is any arbitrary memo to be added to the transaction.
2254
+ */
2255
+ memo: string;
2256
+ /**
2257
+ * `timeout` is the block height after which this transaction will not
2258
+ * be processed by the chain
2259
+ */
2260
+ readonly timeout_height: bigint;
2261
+ }
1008
2262
  /**
1009
2263
  * Celestia grpc transaction client.
1010
2264
  */
@@ -1019,7 +2273,6 @@ export class TxClient {
1019
2273
  * ```js
1020
2274
  * import { secp256k1 } from "@noble/curves/secp256k1";
1021
2275
  *
1022
- * const address = "celestia169s50psyj2f4la9a2235329xz7rk6c53zhw9mm";
1023
2276
  * const privKey = "fdc8ac75dfa1c142dbcba77938a14dd03078052ce0b49a529dcf72a9885a3abb";
1024
2277
  * const pubKey = secp256k1.getPublicKey(privKey);
1025
2278
  *
@@ -1029,7 +2282,7 @@ export class TxClient {
1029
2282
  * return sig.toCompactRawBytes();
1030
2283
  * };
1031
2284
  *
1032
- * const txClient = await new TxClient("http://127.0.0.1:18080", address, pubKey, signer);
2285
+ * const txClient = await new TxClient("http://127.0.0.1:18080", pubKey, signer);
1033
2286
  * ```
1034
2287
  *
1035
2288
  * # Example with leap wallet
@@ -1042,14 +2295,22 @@ export class TxClient {
1042
2295
  * .then(sig => Uint8Array.from(atob(sig.signature.signature), c => c.charCodeAt(0)))
1043
2296
  * }
1044
2297
  *
1045
- * const tx_client = await new TxClient("http://127.0.0.1:18080", keys.bech32Address, keys.pubKey, signer)
2298
+ * const tx_client = await new TxClient("http://127.0.0.1:18080", keys.pubKey, signer)
1046
2299
  * ```
1047
2300
  */
1048
- constructor(url: string, bech32_address: string, pubkey: Uint8Array, signer_fn: SignerFn);
2301
+ constructor(url: string, pubkey: Uint8Array, signer_fn: SignerFn);
2302
+ /**
2303
+ * Query for the current minimum gas price
2304
+ */
2305
+ minGasPrice(): Promise<number>;
1049
2306
  /**
1050
- * Last gas price fetched by the client
2307
+ * estimate_gas_price takes a transaction priority and estimates the gas price based
2308
+ * on the gas prices of the transactions in the last five blocks.
2309
+ *
2310
+ * If no transaction is found in the last five blocks, return the network
2311
+ * min gas price.
1051
2312
  */
1052
- lastSeenGasPrice(): number;
2313
+ getEstimateGasPrice(priority: TxPriority): Promise<number>;
1053
2314
  /**
1054
2315
  * Submit blobs to the celestia network.
1055
2316
  *
@@ -1142,6 +2403,92 @@ export class TxClient {
1142
2403
  */
1143
2404
  readonly appVersion: AppVersion;
1144
2405
  }
2406
+ /**
2407
+ * Response to a tx query
2408
+ */
2409
+ export class TxResponse {
2410
+ private constructor();
2411
+ free(): void;
2412
+ /**
2413
+ * Namespace for the Code
2414
+ */
2415
+ codespace: string;
2416
+ /**
2417
+ * Response code.
2418
+ */
2419
+ code: ErrorCode;
2420
+ /**
2421
+ * Result bytes, if any.
2422
+ */
2423
+ data: string;
2424
+ /**
2425
+ * The output of the application's logger (raw string). May be
2426
+ * non-deterministic.
2427
+ */
2428
+ raw_log: string;
2429
+ /**
2430
+ * The output of the application's logger (typed). May be non-deterministic.
2431
+ */
2432
+ logs: AbciMessageLog[];
2433
+ /**
2434
+ * Additional information. May be non-deterministic.
2435
+ */
2436
+ info: string;
2437
+ /**
2438
+ * Amount of gas requested for transaction.
2439
+ */
2440
+ gas_wanted: bigint;
2441
+ /**
2442
+ * Amount of gas consumed by transaction.
2443
+ */
2444
+ gas_used: bigint;
2445
+ /**
2446
+ * Time of the previous block. For heights > 1, it's the weighted median of
2447
+ * the timestamps of the valid votes in the block.LastCommit. For height == 1,
2448
+ * it's genesis time.
2449
+ */
2450
+ timestamp: string;
2451
+ /**
2452
+ * The block height
2453
+ */
2454
+ readonly height: bigint;
2455
+ /**
2456
+ * Events defines all the events emitted by processing a transaction. Note,
2457
+ * these events include those emitted by processing all the messages and those
2458
+ * emitted from the ante. Whereas Logs contains the events, with
2459
+ * additional metadata, emitted only by processing the messages.
2460
+ */
2461
+ readonly events: JsEvent[];
2462
+ }
2463
+ /**
2464
+ * Response to a tx status query
2465
+ */
2466
+ export class TxStatusResponse {
2467
+ private constructor();
2468
+ free(): void;
2469
+ /**
2470
+ * Index of the transaction in block.
2471
+ */
2472
+ index: number;
2473
+ /**
2474
+ * Execution_code is returned when the transaction has been committed
2475
+ * and returns whether it was successful or errored. A non zero
2476
+ * execution code indicates an error.
2477
+ */
2478
+ execution_code: ErrorCode;
2479
+ /**
2480
+ * Error log, if transaction failed.
2481
+ */
2482
+ error: string;
2483
+ /**
2484
+ * Status of the transaction.
2485
+ */
2486
+ status: TxStatus;
2487
+ /**
2488
+ * Height of the block in which the transaction was committed.
2489
+ */
2490
+ readonly height: bigint;
2491
+ }
1145
2492
  /**
1146
2493
  * Address of a validator.
1147
2494
  */
@@ -1157,3 +2504,90 @@ export class ValAddress {
1157
2504
  toString(): string;
1158
2505
  free(): void;
1159
2506
  }
2507
+ /**
2508
+ * Validator set contains a vector of validators
2509
+ */
2510
+ export class ValidatorSet {
2511
+ private constructor();
2512
+ free(): void;
2513
+ /**
2514
+ * Validators in the set
2515
+ */
2516
+ validators: JsValidatorInfo[];
2517
+ /**
2518
+ * Proposer
2519
+ */
2520
+ get proposer(): JsValidatorInfo | undefined;
2521
+ /**
2522
+ * Proposer
2523
+ */
2524
+ set proposer(value: JsValidatorInfo | null | undefined);
2525
+ /**
2526
+ * Total voting power
2527
+ */
2528
+ total_voting_power: bigint;
2529
+ }
2530
+ /**
2531
+ * Votes are signed messages from validators for a particular block which include
2532
+ * information about the validator signing it.
2533
+ */
2534
+ export class Vote {
2535
+ private constructor();
2536
+ free(): void;
2537
+ /**
2538
+ * Type of vote (prevote or precommit)
2539
+ */
2540
+ vote_type: VoteType;
2541
+ /**
2542
+ * Block height
2543
+ */
2544
+ height: bigint;
2545
+ /**
2546
+ * Round
2547
+ */
2548
+ round: number;
2549
+ /**
2550
+ * Block ID
2551
+ */
2552
+ get block_id(): BlockId | undefined;
2553
+ /**
2554
+ * Block ID
2555
+ */
2556
+ set block_id(value: BlockId | null | undefined);
2557
+ /**
2558
+ * Timestamp
2559
+ */
2560
+ get timestamp(): string | undefined;
2561
+ /**
2562
+ * Timestamp
2563
+ */
2564
+ set timestamp(value: string | null | undefined);
2565
+ /**
2566
+ * Validator address
2567
+ */
2568
+ validator_address: string;
2569
+ /**
2570
+ * Validator index
2571
+ */
2572
+ validator_index: number;
2573
+ /**
2574
+ * Signature
2575
+ */
2576
+ get signature(): Signature | undefined;
2577
+ /**
2578
+ * Signature
2579
+ */
2580
+ set signature(value: Signature | null | undefined);
2581
+ /**
2582
+ * Vote extension provided by the application. Only valid for precommit messages.
2583
+ */
2584
+ extension: Uint8Array;
2585
+ /**
2586
+ * Vote extension signature by the validator Only valid for precommit messages.
2587
+ */
2588
+ get extension_signature(): Signature | undefined;
2589
+ /**
2590
+ * Vote extension signature by the validator Only valid for precommit messages.
2591
+ */
2592
+ set extension_signature(value: Signature | null | undefined);
2593
+ }