lumina-node-wasm 0.9.0 → 0.10.1

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,6 +347,61 @@ 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
+ }
371
+ /**
372
+ * Represents state of the transaction in the mempool
373
+ */
374
+ export enum TxStatus {
375
+ /**
376
+ * The transaction is not known to the node, it could be never sent.
377
+ */
378
+ Unknown = 0,
379
+ /**
380
+ * The transaction is still pending.
381
+ */
382
+ Pending = 1,
383
+ /**
384
+ * The transaction was evicted from the mempool.
385
+ */
386
+ Evicted = 2,
387
+ /**
388
+ * The transaction was committed into the block.
389
+ */
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,
404
+ }
32
405
  /**
33
406
  * The `ReadableStreamType` enum.
34
407
  *
@@ -37,20 +410,11 @@ export enum Network {
37
410
  type ReadableStreamType = "bytes";
38
411
 
39
412
  /**
40
- * Transaction info
41
- */
42
- export interface TxInfo {
43
- hash: string;
44
- height: bigint;
45
- }
46
-
47
- /**
48
- * Transaction config.
413
+ * Protobuf Any type
49
414
  */
50
- export interface TxConfig {
51
- gasLimit?: bigint; // utia
52
- gasPrice?: number;
53
- memo?: string;
415
+ export interface ProtoAny {
416
+ typeUrl: string;
417
+ value: Uint8Array;
54
418
  }
55
419
 
56
420
 
@@ -113,15 +477,116 @@ export type SignerFn = ((arg: SignDoc) => Uint8Array) | ((arg: SignDoc) => Promi
113
477
 
114
478
 
115
479
 
480
+ /**
481
+ * Transaction info
482
+ */
483
+ export interface TxInfo {
484
+ /**
485
+ * Hash of the transaction.
486
+ */
487
+ hash: string;
488
+ /**
489
+ * Height at which transaction was submitted.
490
+ */
491
+ height: bigint;
492
+ }
493
+
494
+ /**
495
+ * Transaction config.
496
+ */
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
+ */
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
+ */
507
+ gasPrice?: number;
508
+ /**
509
+ * Memo for the transaction
510
+ */
511
+ memo?: string;
512
+ /**
513
+ * Priority of the transaction, used with gas estimation service
514
+ */
515
+ priority?: TxPriority;
516
+ }
517
+
518
+
116
519
  /**
117
- * Protobuf Any type
520
+ * ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
118
521
  */
119
- export interface ProtoAny {
120
- typeUrl: string;
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
+ */
121
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;
122
589
  }
123
-
124
-
125
590
  /**
126
591
  * Address of an account.
127
592
  */
@@ -162,12 +627,187 @@ export class AppVersion {
162
627
  /**
163
628
  * App v4
164
629
  */
165
- static readonly V4: AppVersion;
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;
166
805
  }
167
806
  /**
168
- * Arbitrary data that can be stored in the network within certain [`Namespace`].
807
+ * A range of blocks between `start` and `end` height, inclusive
169
808
  */
170
- export class Blob {
809
+ export class BlockRange {
810
+ private constructor();
171
811
  /**
172
812
  ** Return copy of self without private attributes.
173
813
  */
@@ -178,72 +818,113 @@ export class Blob {
178
818
  toString(): string;
179
819
  free(): void;
180
820
  /**
181
- * Create a new blob with the given data within the [`Namespace`].
821
+ * First block height in range
182
822
  */
183
- constructor(namespace: Namespace, data: Uint8Array, app_version: AppVersion);
823
+ start: bigint;
184
824
  /**
185
- * Clone a blob creating a new deep copy of it.
825
+ * Last block height in range
186
826
  */
187
- clone(): Blob;
827
+ end: bigint;
828
+ }
829
+ /**
830
+ * BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method.
831
+ */
832
+ export class BroadcastMode {
833
+ private constructor();
834
+ free(): void;
188
835
  /**
189
- * A [`Namespace`] the [`Blob`] belongs to.
836
+ * zero-value for mode ordering
190
837
  */
191
- namespace: Namespace;
838
+ static readonly Unspecified: BroadcastMode;
192
839
  /**
193
- * Data stored within the [`Blob`].
840
+ * DEPRECATED: use `BroadcastMode` `Sync` instead,
841
+ * `BroadcastMode` `Block` is not supported by the SDK from v0.47.x onwards.
194
842
  */
195
- data: Uint8Array;
843
+ static readonly Block: BroadcastMode;
196
844
  /**
197
- * Version indicating the format in which [`Share`]s should be created from this [`Blob`].
845
+ * `BroadcastMode` `Sync` defines a tx broadcasting mode where the client waits for
846
+ * a CheckTx execution response only.
198
847
  */
199
- share_version: number;
848
+ static readonly Sync: BroadcastMode;
200
849
  /**
201
- * A [`Commitment`] computed from the [`Blob`]s data.
850
+ * `BroadcastMode` `Async` defines a tx broadcasting mode where the client returns
851
+ * immediately.
202
852
  */
203
- commitment: Commitment;
853
+ static readonly Async: BroadcastMode;
854
+ }
855
+ /**
856
+ * Coin defines a token with a denomination and an amount.
857
+ */
858
+ export class Coin {
859
+ private constructor();
860
+ free(): void;
861
+ }
862
+ /**
863
+ * Commit contains the justification (ie. a set of signatures) that a block was
864
+ * committed by a set of validators.
865
+ */
866
+ export class Commit {
867
+ private constructor();
868
+ free(): void;
204
869
  /**
205
- * Index of the blob's first share in the EDS. Only set for blobs retrieved from chain.
870
+ * Block height
206
871
  */
207
- get index(): bigint | undefined;
872
+ height: bigint;
208
873
  /**
209
- * Index of the blob's first share in the EDS. Only set for blobs retrieved from chain.
874
+ * Round
210
875
  */
211
- set index(value: bigint | null | undefined);
876
+ round: number;
212
877
  /**
213
- * A signer of the blob, i.e. address of the account which submitted the blob.
214
- *
215
- * Must be present in `share_version 1` and absent otherwise.
878
+ * Block ID
216
879
  */
217
- get signer(): AccAddress | undefined;
880
+ block_id: BlockId;
218
881
  /**
219
- * A signer of the blob, i.e. address of the account which submitted the blob.
220
- *
221
- * Must be present in `share_version 1` and absent otherwise.
882
+ * Signatures
222
883
  */
223
- set signer(value: AccAddress | null | undefined);
884
+ signatures: CommitSig[];
224
885
  }
225
886
  /**
226
- * A range of blocks between `start` and `end` height, inclusive
887
+ * CommitSig represents a signature of a validator. It’s a part of the Commit and can
888
+ * be used to reconstruct the vote set given the validator set.
227
889
  */
228
- export class BlockRange {
890
+ export class CommitSig {
229
891
  private constructor();
892
+ free(): void;
893
+ /**
894
+ * vote type of a validator
895
+ */
896
+ vote_type: CommitVoteType;
897
+ /**
898
+ * vote, if received
899
+ */
900
+ get vote(): CommitVote | undefined;
901
+ /**
902
+ * vote, if received
903
+ */
904
+ set vote(value: CommitVote | null | undefined);
905
+ }
230
906
  /**
231
- ** Return copy of self without private attributes.
232
- */
233
- toJSON(): Object;
234
- /**
235
- * Return stringified version of self.
236
- */
237
- toString(): string;
907
+ * Value of the validator vote
908
+ */
909
+ export class CommitVote {
910
+ private constructor();
238
911
  free(): void;
239
912
  /**
240
- * First block height in range
913
+ * Address of the voting validator
241
914
  */
242
- start: bigint;
915
+ validator_address: string;
243
916
  /**
244
- * Last block height in range
917
+ * Timestamp
245
918
  */
246
- end: bigint;
919
+ timestamp: string;
920
+ /**
921
+ * Signature
922
+ */
923
+ get signature(): Signature | undefined;
924
+ /**
925
+ * Signature
926
+ */
927
+ set signature(value: Signature | null | undefined);
247
928
  }
248
929
  /**
249
930
  * A merkle hash used to identify the [`Blob`]s data.
@@ -299,6 +980,21 @@ export class Commitment {
299
980
  */
300
981
  hash(): Uint8Array;
301
982
  }
983
+ /**
984
+ * Conflicting block detected in light client attack
985
+ */
986
+ export class ConflictingBlock {
987
+ private constructor();
988
+ free(): void;
989
+ /**
990
+ * Signed header
991
+ */
992
+ signed_header: SignedHeader;
993
+ /**
994
+ * Validator set
995
+ */
996
+ validator_set: ValidatorSet;
997
+ }
302
998
  export class ConnectionCountersSnapshot {
303
999
  private constructor();
304
1000
  /**
@@ -354,6 +1050,29 @@ export class ConsAddress {
354
1050
  toString(): string;
355
1051
  free(): void;
356
1052
  }
1053
+ /**
1054
+ * Data contained in a [`Block`].
1055
+ *
1056
+ * [`Block`]: crate::block::Block
1057
+ */
1058
+ export class Data {
1059
+ private constructor();
1060
+ free(): void;
1061
+ /**
1062
+ * Square width of original data square.
1063
+ */
1064
+ square_size: bigint;
1065
+ /**
1066
+ * Hash is the root of a binary Merkle tree where the leaves of the tree are
1067
+ * the row and column roots of an extended data square. Hash is often referred
1068
+ * to as the "data root".
1069
+ */
1070
+ hash: Uint8Array;
1071
+ /**
1072
+ * Transactions
1073
+ */
1074
+ readonly transactions: Uint8Array[];
1075
+ }
357
1076
  /**
358
1077
  * Header with commitments of the data availability.
359
1078
  *
@@ -428,6 +1147,40 @@ export class DataAvailabilityHeader {
428
1147
  */
429
1148
  squareWidth(): number;
430
1149
  }
1150
+ /**
1151
+ * Duplicate vote evidence
1152
+ */
1153
+ export class DuplicateVoteEvidence {
1154
+ private constructor();
1155
+ free(): void;
1156
+ /**
1157
+ * Vote A
1158
+ */
1159
+ vote_a: Vote;
1160
+ /**
1161
+ * Vote B
1162
+ */
1163
+ vote_b: Vote;
1164
+ /**
1165
+ * Total voting power
1166
+ */
1167
+ total_voting_power: bigint;
1168
+ /**
1169
+ * Validator power
1170
+ */
1171
+ validator_power: bigint;
1172
+ /**
1173
+ * Timestamp
1174
+ */
1175
+ timestamp: string;
1176
+ }
1177
+ /**
1178
+ * Evidence of malfeasance by validators (i.e. signing conflicting votes or light client attack).
1179
+ */
1180
+ export class Evidence {
1181
+ private constructor();
1182
+ free(): void;
1183
+ }
431
1184
  /**
432
1185
  * Block header together with the relevant Data Availability metadata.
433
1186
  *
@@ -545,23 +1298,267 @@ export class ExtendedHeader {
545
1298
  * If verification fails, this function will return an error with a reason of failure.
546
1299
  * This function will also return an error if untrusted headers and `self` don't form contiguous range
547
1300
  */
548
- verifyAdjacentRange(untrusted: ExtendedHeader[]): void;
1301
+ verifyAdjacentRange(untrusted: ExtendedHeader[]): void;
1302
+ /**
1303
+ * Header of the block data availability.
1304
+ */
1305
+ dah: DataAvailabilityHeader;
1306
+ /**
1307
+ * Tendermint block header.
1308
+ */
1309
+ readonly header: any;
1310
+ /**
1311
+ * Commit metadata and signatures from validators committing the block.
1312
+ */
1313
+ readonly commit: any;
1314
+ /**
1315
+ * Information about the set of validators commiting the block.
1316
+ */
1317
+ readonly validatorSet: any;
1318
+ }
1319
+ /**
1320
+ * Fee includes the amount of coins paid in fees and the maximum
1321
+ * gas to be used by the transaction. The ratio yields an effective "gasprice",
1322
+ * which must be above some miminum to be accepted into the mempool.
1323
+ */
1324
+ export class Fee {
1325
+ private constructor();
1326
+ free(): void;
1327
+ /**
1328
+ * amount is the amount of coins to be paid as a fee
1329
+ */
1330
+ amount: Coin[];
1331
+ /**
1332
+ * gas_limit is the maximum gas that can be used in transaction processing
1333
+ * before an out of gas error occurs
1334
+ */
1335
+ gas_limit: bigint;
1336
+ /**
1337
+ * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees.
1338
+ * the payer must be a tx signer (and thus have signed this field in AuthInfo).
1339
+ * setting this field does *not* change the ordering of required signers for the transaction.
1340
+ */
1341
+ readonly payer: string | undefined;
1342
+ /**
1343
+ * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used
1344
+ * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does
1345
+ * not support fee grants, this will fail
1346
+ */
1347
+ readonly granter: string | undefined;
1348
+ }
1349
+ /**
1350
+ * Result of gas price and usage estimation
1351
+ */
1352
+ export class GasEstimate {
1353
+ private constructor();
1354
+ free(): void;
1355
+ /**
1356
+ * Gas price estimated based on last 5 blocks
1357
+ */
1358
+ price: number;
1359
+ /**
1360
+ * Simulated transaction gas usage
1361
+ */
1362
+ usage: bigint;
1363
+ }
1364
+ /**
1365
+ * GasInfo defines tx execution gas context.
1366
+ */
1367
+ export class GasInfo {
1368
+ private constructor();
1369
+ free(): void;
1370
+ /**
1371
+ * GasWanted is the maximum units of work we allow this tx to perform.
1372
+ */
1373
+ gas_wanted: bigint;
1374
+ /**
1375
+ * GasUsed is the amount of gas actually consumed.
1376
+ */
1377
+ gas_used: bigint;
1378
+ }
1379
+ /**
1380
+ * Response to GetTx
1381
+ */
1382
+ export class GetTxResponse {
1383
+ private constructor();
1384
+ free(): void;
1385
+ /**
1386
+ * Response Transaction
1387
+ */
1388
+ tx: Tx;
1389
+ /**
1390
+ * TxResponse to a Query
1391
+ */
1392
+ tx_response: TxResponse;
1393
+ }
1394
+ /**
1395
+ * Celestia GRPC client
1396
+ */
1397
+ export class GrpcClient {
1398
+ private constructor();
1399
+ free(): void;
1400
+ /**
1401
+ * Create a new client connected with the given `url`
1402
+ */
1403
+ static new(url: string): Promise<GrpcClient>;
1404
+ /**
1405
+ * Get auth params
1406
+ */
1407
+ get_auth_params(): Promise<AuthParams>;
1408
+ /**
1409
+ * Get account
1410
+ */
1411
+ get_account(account: string): Promise<BaseAccount>;
1412
+ /**
1413
+ * Get accounts
1414
+ */
1415
+ get_accounts(): Promise<BaseAccount[]>;
1416
+ /**
1417
+ * Get balance of coins with bond denom for the given address, together with a proof,
1418
+ * and verify the returned balance against the corresponding block's app hash.
1419
+ *
1420
+ * NOTE: the balance returned is the balance reported by the parent block of
1421
+ * the provided header. This is due to the fact that for block N, the block's
1422
+ * app hash is the result of applying the previous block's transaction list.
1423
+ */
1424
+ get_verified_balance(address: string, header: ExtendedHeader): Promise<Coin>;
1425
+ /**
1426
+ * Get balance of coins with given denom
1427
+ */
1428
+ get_balance(address: string, denom: string): Promise<Coin>;
1429
+ /**
1430
+ * Get balance of all coins
1431
+ */
1432
+ get_all_balances(address: string): Promise<Coin[]>;
1433
+ /**
1434
+ * Get balance of all spendable coins
1435
+ */
1436
+ get_spendable_balances(address: string): Promise<Coin[]>;
1437
+ /**
1438
+ * Get total supply
1439
+ */
1440
+ get_total_supply(): Promise<Coin[]>;
1441
+ /**
1442
+ * Get Minimum Gas price
1443
+ */
1444
+ get_min_gas_price(): Promise<number>;
1445
+ /**
1446
+ * Get latest block
1447
+ */
1448
+ get_latest_block(): Promise<Block>;
1449
+ /**
1450
+ * Get block by height
1451
+ */
1452
+ get_block_by_height(height: bigint): Promise<Block>;
1453
+ /**
1454
+ * Issue a direct ABCI query to the application
1455
+ */
1456
+ abci_query(data: Uint8Array, path: string, height: bigint, prove: boolean): Promise<AbciQueryResponse>;
1457
+ /**
1458
+ * Broadcast prepared and serialised transaction
1459
+ */
1460
+ broadcast_tx(tx_bytes: Uint8Array, mode: BroadcastMode): Promise<TxResponse>;
1461
+ /**
1462
+ * Get Tx
1463
+ */
1464
+ get_tx(hash: string): Promise<GetTxResponse>;
1465
+ /**
1466
+ * Simulate prepared and serialised transaction, returning simulated gas usage
1467
+ */
1468
+ simulate(tx_bytes: Uint8Array): Promise<GasInfo>;
1469
+ /**
1470
+ * Get blob params
1471
+ */
1472
+ get_blob_params(): Promise<BlobParams>;
1473
+ /**
1474
+ * Get status of the transaction
1475
+ */
1476
+ tx_status(hash: string): Promise<TxStatusResponse>;
1477
+ }
1478
+ /**
1479
+ * Block Header values contain metadata about the block and about the consensus,
1480
+ * as well as commitments to the data in the current block, the previous block,
1481
+ * and the results returned by the application.
1482
+ */
1483
+ export class Header {
1484
+ private constructor();
1485
+ free(): void;
1486
+ /**
1487
+ * Header version
1488
+ */
1489
+ version: ProtocolVersion;
1490
+ /**
1491
+ * Chain ID
1492
+ */
1493
+ chain_id: string;
1494
+ /**
1495
+ * Current block height
1496
+ */
1497
+ height: bigint;
1498
+ /**
1499
+ * Current timestamp encoded as rfc3339
1500
+ */
1501
+ time: string;
1502
+ /**
1503
+ * Previous block info
1504
+ */
1505
+ get last_block_id(): BlockId | undefined;
1506
+ /**
1507
+ * Previous block info
1508
+ */
1509
+ set last_block_id(value: BlockId | null | undefined);
1510
+ /**
1511
+ * Commit from validators from the last block
1512
+ */
1513
+ get last_commit_hash(): string | undefined;
1514
+ /**
1515
+ * Commit from validators from the last block
1516
+ */
1517
+ set last_commit_hash(value: string | null | undefined);
1518
+ /**
1519
+ * Merkle root of transaction hashes
1520
+ */
1521
+ get data_hash(): string | undefined;
1522
+ /**
1523
+ * Merkle root of transaction hashes
1524
+ */
1525
+ set data_hash(value: string | null | undefined);
1526
+ /**
1527
+ * Validators for the current block
1528
+ */
1529
+ validators_hash: string;
1530
+ /**
1531
+ * Validators for the next block
1532
+ */
1533
+ next_validators_hash: string;
1534
+ /**
1535
+ * Consensus params for the current block
1536
+ */
1537
+ consensus_hash: string;
549
1538
  /**
550
- * Header of the block data availability.
1539
+ * State after txs from the previous block
551
1540
  */
552
- dah: DataAvailabilityHeader;
1541
+ app_hash: string;
553
1542
  /**
554
- * Tendermint block header.
1543
+ * Root hash of all results from the txs from the previous block
555
1544
  */
556
- readonly header: any;
1545
+ get last_results_hash(): string | undefined;
557
1546
  /**
558
- * Commit metadata and signatures from validators committing the block.
1547
+ * Root hash of all results from the txs from the previous block
559
1548
  */
560
- readonly commit: any;
1549
+ set last_results_hash(value: string | null | undefined);
561
1550
  /**
562
- * Information about the set of validators commiting the block.
1551
+ * Hash of evidence included in the block
563
1552
  */
564
- readonly validatorSet: any;
1553
+ get evidence_hash(): string | undefined;
1554
+ /**
1555
+ * Hash of evidence included in the block
1556
+ */
1557
+ set evidence_hash(value: string | null | undefined);
1558
+ /**
1559
+ * Original proposer of the block
1560
+ */
1561
+ proposer_address: string;
565
1562
  }
566
1563
  export class IntoUnderlyingByteSource {
567
1564
  private constructor();
@@ -585,6 +1582,118 @@ export class IntoUnderlyingSource {
585
1582
  pull(controller: ReadableStreamDefaultController): Promise<any>;
586
1583
  cancel(): void;
587
1584
  }
1585
+ /**
1586
+ * Array of bits
1587
+ */
1588
+ export class JsBitVector {
1589
+ private constructor();
1590
+ free(): void;
1591
+ 0: Uint8Array;
1592
+ }
1593
+ /**
1594
+ * Event allows application developers to attach additional information to
1595
+ * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx.
1596
+ * Later, transactions may be queried using these events.
1597
+ */
1598
+ export class JsEvent {
1599
+ private constructor();
1600
+ free(): void;
1601
+ type: string;
1602
+ attributes: JsEventAttribute[];
1603
+ }
1604
+ export class JsEventAttribute {
1605
+ private constructor();
1606
+ free(): void;
1607
+ key: string;
1608
+ value: string;
1609
+ index: boolean;
1610
+ }
1611
+ /**
1612
+ * Validator information
1613
+ */
1614
+ export class JsValidatorInfo {
1615
+ private constructor();
1616
+ free(): void;
1617
+ /**
1618
+ * Validator account address
1619
+ */
1620
+ address: string;
1621
+ /**
1622
+ * Validator public key
1623
+ */
1624
+ pub_key: PublicKey;
1625
+ /**
1626
+ * Validator voting power
1627
+ */
1628
+ power: bigint;
1629
+ /**
1630
+ * Validator name
1631
+ */
1632
+ get name(): string | undefined;
1633
+ /**
1634
+ * Validator name
1635
+ */
1636
+ set name(value: string | null | undefined);
1637
+ /**
1638
+ * Validator proposer priority
1639
+ */
1640
+ proposer_priority: bigint;
1641
+ }
1642
+ /**
1643
+ * LightClient attack evidence
1644
+ */
1645
+ export class LightClientAttackEvidence {
1646
+ private constructor();
1647
+ free(): void;
1648
+ /**
1649
+ * Conflicting block
1650
+ */
1651
+ conflicting_block: ConflictingBlock;
1652
+ /**
1653
+ * Common height
1654
+ */
1655
+ common_height: bigint;
1656
+ /**
1657
+ * Byzantine validators
1658
+ */
1659
+ byzantine_validators: JsValidatorInfo[];
1660
+ /**
1661
+ * Total voting power
1662
+ */
1663
+ total_voting_power: bigint;
1664
+ /**
1665
+ * Timestamp
1666
+ */
1667
+ timestamp: string;
1668
+ }
1669
+ /**
1670
+ * ModeInfo describes the signing mode of a single or nested multisig signer.
1671
+ */
1672
+ export class ModeInfo {
1673
+ private constructor();
1674
+ free(): void;
1675
+ /**
1676
+ * Return signature mode for the stored signature(s)
1677
+ */
1678
+ signature_mode(): SignatureMode;
1679
+ /**
1680
+ * Single is the mode info for a single signer. It is structured as a message
1681
+ * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
1682
+ * future
1683
+ */
1684
+ readonly mode: number | undefined;
1685
+ /**
1686
+ * Multi is the mode info for a multisig public key
1687
+ * bitarray specifies which keys within the multisig are signing
1688
+ */
1689
+ readonly bitarray: JsBitVector | undefined;
1690
+ /**
1691
+ * Multi is the mode info for a multisig public key
1692
+ * mode_infos is the corresponding modes of the signers of the multisig
1693
+ * which could include nested multisig public keys
1694
+ */
1695
+ readonly mode_infos: ModeInfo[] | undefined;
1696
+ }
588
1697
  /**
589
1698
  * Namespace of the data published to the celestia network.
590
1699
  *
@@ -871,20 +1980,6 @@ export class NodeConfig {
871
1980
  * **Default value:** true
872
1981
  */
873
1982
  usePersistentMemory: boolean;
874
- /**
875
- * Sampling window defines maximum age of a block considered for syncing and sampling.
876
- *
877
- * **Default value:** 2592000 seconds (30 days)\
878
- * **Minimum:** 60 seconds
879
- */
880
- get customSamplingWindowSecs(): number | undefined;
881
- /**
882
- * Sampling window defines maximum age of a block considered for syncing and sampling.
883
- *
884
- * **Default value:** 2592000 seconds (30 days)\
885
- * **Minimum:** 60 seconds
886
- */
887
- set customSamplingWindowSecs(value: number | null | undefined);
888
1983
  /**
889
1984
  * Pruning window defines maximum age of a block for it to be retained in store.
890
1985
  *
@@ -894,7 +1989,7 @@ export class NodeConfig {
894
1989
  *
895
1990
  * If this is not set, then default value will apply:
896
1991
  *
897
- * * If `use_persistent_memory == true`, default value is 30 days plus 1 hour.
1992
+ * * If `use_persistent_memory == true`, default value is 7 days plus 1 hour.
898
1993
  * * If `use_persistent_memory == false`, default value is 0 seconds.
899
1994
  */
900
1995
  get customPruningWindowSecs(): number | undefined;
@@ -907,7 +2002,7 @@ export class NodeConfig {
907
2002
  *
908
2003
  * If this is not set, then default value will apply:
909
2004
  *
910
- * * If `use_persistent_memory == true`, default value is 30 days plus 1 hour.
2005
+ * * If `use_persistent_memory == true`, default value is 7 days plus 1 hour.
911
2006
  * * If `use_persistent_memory == false`, default value is 0 seconds.
912
2007
  */
913
2008
  set customPruningWindowSecs(value: number | null | undefined);
@@ -923,6 +2018,21 @@ export class NodeWorker {
923
2018
  constructor(port_like_object: any);
924
2019
  run(): Promise<void>;
925
2020
  }
2021
+ /**
2022
+ * Block parts header
2023
+ */
2024
+ export class PartsHeader {
2025
+ private constructor();
2026
+ free(): void;
2027
+ /**
2028
+ * Number of parts in this block
2029
+ */
2030
+ total: number;
2031
+ /**
2032
+ * Hash of the parts set header
2033
+ */
2034
+ hash: string;
2035
+ }
926
2036
  /**
927
2037
  * Statistics of the connected peers
928
2038
  */
@@ -946,6 +2056,45 @@ export class PeerTrackerInfoSnapshot {
946
2056
  */
947
2057
  num_connected_trusted_peers: bigint;
948
2058
  }
2059
+ /**
2060
+ * ProofOp defines an operation used for calculating Merkle root. The data could
2061
+ * be arbitrary format, providing necessary data for example neighbouring node
2062
+ * hash.
2063
+ *
2064
+ * Note: This type is a duplicate of the ProofOp proto type defined in Tendermint.
2065
+ */
2066
+ export class ProofOp {
2067
+ private constructor();
2068
+ free(): void;
2069
+ type: string;
2070
+ key: Uint8Array;
2071
+ data: Uint8Array;
2072
+ }
2073
+ /**
2074
+ * ProofOps is Merkle proof defined by the list of ProofOps.
2075
+ *
2076
+ * Note: This type is a duplicate of the ProofOps proto type defined in Tendermint.
2077
+ */
2078
+ export class ProofOps {
2079
+ private constructor();
2080
+ free(): void;
2081
+ ops: ProofOp[];
2082
+ }
2083
+ /**
2084
+ * Version contains the protocol version for the blockchain and the application.
2085
+ */
2086
+ export class ProtocolVersion {
2087
+ private constructor();
2088
+ free(): void;
2089
+ /**
2090
+ * blockchain version
2091
+ */
2092
+ block: bigint;
2093
+ /**
2094
+ * app version
2095
+ */
2096
+ app: bigint;
2097
+ }
949
2098
  /**
950
2099
  * Sampling metadata for a block.
951
2100
  *
@@ -959,6 +2108,64 @@ export class SamplingMetadata {
959
2108
  */
960
2109
  readonly cids: Uint8Array[];
961
2110
  }
2111
+ /**
2112
+ * Signature
2113
+ */
2114
+ export class Signature {
2115
+ private constructor();
2116
+ free(): void;
2117
+ 0: Uint8Array;
2118
+ }
2119
+ /**
2120
+ * Signed block headers
2121
+ */
2122
+ export class SignedHeader {
2123
+ private constructor();
2124
+ free(): void;
2125
+ /**
2126
+ * Signed block headers
2127
+ */
2128
+ header: Header;
2129
+ /**
2130
+ * Commit containing signatures for the header
2131
+ */
2132
+ commit: Commit;
2133
+ }
2134
+ /**
2135
+ * SignerInfo describes the public key and signing mode of a single top-level
2136
+ * signer.
2137
+ */
2138
+ export class SignerInfo {
2139
+ private constructor();
2140
+ free(): void;
2141
+ /**
2142
+ * public_key is the public key of the signer. It is optional for accounts
2143
+ * that already exist in state. If unset, the verifier can use the required \
2144
+ * signer address for this position and lookup the public key.
2145
+ */
2146
+ public_key(): ProtoAny | undefined;
2147
+ /**
2148
+ * mode_info describes the signing mode of the signer and is a nested
2149
+ * structure to support nested multisig pubkey's
2150
+ */
2151
+ mode_info: ModeInfo;
2152
+ /**
2153
+ * sequence is the sequence of the account, which describes the
2154
+ * number of committed transactions signed by a given address. It is used to
2155
+ * prevent replay attacks.
2156
+ */
2157
+ sequence: bigint;
2158
+ }
2159
+ /**
2160
+ * StringEvent defines en Event object wrapper where all the attributes
2161
+ * contain key/value pairs that are strings instead of raw bytes.
2162
+ */
2163
+ export class StringEvent {
2164
+ private constructor();
2165
+ free(): void;
2166
+ type: string;
2167
+ attributes: Attribute[];
2168
+ }
962
2169
  /**
963
2170
  * Status of the synchronization.
964
2171
  */
@@ -982,6 +2189,66 @@ export class SyncingInfoSnapshot {
982
2189
  */
983
2190
  subjective_head: bigint;
984
2191
  }
2192
+ /**
2193
+ * [`Tx`] is the standard type used for broadcasting transactions.
2194
+ */
2195
+ export class Tx {
2196
+ private constructor();
2197
+ free(): void;
2198
+ /**
2199
+ * Processable content of the transaction
2200
+ */
2201
+ body: TxBody;
2202
+ /**
2203
+ * Authorization related content of the transaction, specifically signers, signer modes
2204
+ * and [`Fee`].
2205
+ */
2206
+ auth_info: AuthInfo;
2207
+ /**
2208
+ * List of signatures that matches the length and order of [`AuthInfo`]’s `signer_info`s to
2209
+ * allow connecting signature meta information like public key and signing mode by position.
2210
+ */
2211
+ readonly signatures: Signature[];
2212
+ }
2213
+ /**
2214
+ * [`TxBody`] of a transaction that all signers sign over.
2215
+ */
2216
+ export class TxBody {
2217
+ private constructor();
2218
+ free(): void;
2219
+ /**
2220
+ * `messages` is a list of messages to be executed. The required signers of
2221
+ * those messages define the number and order of elements in `AuthInfo`'s
2222
+ * signer_infos and Tx's signatures. Each required signer address is added to
2223
+ * the list only the first time it occurs.
2224
+ *
2225
+ * By convention, the first required signer (usually from the first message)
2226
+ * is referred to as the primary signer and pays the fee for the whole
2227
+ * transaction.
2228
+ */
2229
+ messages(): ProtoAny[];
2230
+ /**
2231
+ * `extension_options` are arbitrary options that can be added by chains
2232
+ * when the default options are not sufficient. If any of these are present
2233
+ * and can't be handled, the transaction will be rejected
2234
+ */
2235
+ extension_options(): ProtoAny[];
2236
+ /**
2237
+ * `extension_options` are arbitrary options that can be added by chains
2238
+ * when the default options are not sufficient. If any of these are present
2239
+ * and can't be handled, they will be ignored
2240
+ */
2241
+ non_critical_extension_options(): ProtoAny[];
2242
+ /**
2243
+ * `memo` is any arbitrary memo to be added to the transaction.
2244
+ */
2245
+ memo: string;
2246
+ /**
2247
+ * `timeout` is the block height after which this transaction will not
2248
+ * be processed by the chain
2249
+ */
2250
+ readonly timeout_height: bigint;
2251
+ }
985
2252
  /**
986
2253
  * Celestia grpc transaction client.
987
2254
  */
@@ -996,7 +2263,6 @@ export class TxClient {
996
2263
  * ```js
997
2264
  * import { secp256k1 } from "@noble/curves/secp256k1";
998
2265
  *
999
- * const address = "celestia169s50psyj2f4la9a2235329xz7rk6c53zhw9mm";
1000
2266
  * const privKey = "fdc8ac75dfa1c142dbcba77938a14dd03078052ce0b49a529dcf72a9885a3abb";
1001
2267
  * const pubKey = secp256k1.getPublicKey(privKey);
1002
2268
  *
@@ -1006,7 +2272,7 @@ export class TxClient {
1006
2272
  * return sig.toCompactRawBytes();
1007
2273
  * };
1008
2274
  *
1009
- * const txClient = await new TxClient("http://127.0.0.1:18080", address, pubKey, signer);
2275
+ * const txClient = await new TxClient("http://127.0.0.1:18080", pubKey, signer);
1010
2276
  * ```
1011
2277
  *
1012
2278
  * # Example with leap wallet
@@ -1019,14 +2285,22 @@ export class TxClient {
1019
2285
  * .then(sig => Uint8Array.from(atob(sig.signature.signature), c => c.charCodeAt(0)))
1020
2286
  * }
1021
2287
  *
1022
- * const tx_client = await new TxClient("http://127.0.0.1:18080", keys.bech32Address, keys.pubKey, signer)
2288
+ * const tx_client = await new TxClient("http://127.0.0.1:18080", keys.pubKey, signer)
1023
2289
  * ```
1024
2290
  */
1025
- constructor(url: string, bech32_address: string, pubkey: Uint8Array, signer_fn: SignerFn);
2291
+ constructor(url: string, pubkey: Uint8Array, signer_fn: SignerFn);
2292
+ /**
2293
+ * Query for the current minimum gas price
2294
+ */
2295
+ minGasPrice(): Promise<number>;
1026
2296
  /**
1027
- * Last gas price fetched by the client
2297
+ * estimate_gas_price takes a transaction priority and estimates the gas price based
2298
+ * on the gas prices of the transactions in the last five blocks.
2299
+ *
2300
+ * If no transaction is found in the last five blocks, return the network
2301
+ * min gas price.
1028
2302
  */
1029
- lastSeenGasPrice(): number;
2303
+ getEstimateGasPrice(priority: TxPriority): Promise<number>;
1030
2304
  /**
1031
2305
  * Submit blobs to the celestia network.
1032
2306
  *
@@ -1119,6 +2393,92 @@ export class TxClient {
1119
2393
  */
1120
2394
  readonly appVersion: AppVersion;
1121
2395
  }
2396
+ /**
2397
+ * Response to a tx query
2398
+ */
2399
+ export class TxResponse {
2400
+ private constructor();
2401
+ free(): void;
2402
+ /**
2403
+ * Namespace for the Code
2404
+ */
2405
+ codespace: string;
2406
+ /**
2407
+ * Response code.
2408
+ */
2409
+ code: ErrorCode;
2410
+ /**
2411
+ * Result bytes, if any.
2412
+ */
2413
+ data: string;
2414
+ /**
2415
+ * The output of the application's logger (raw string). May be
2416
+ * non-deterministic.
2417
+ */
2418
+ raw_log: string;
2419
+ /**
2420
+ * The output of the application's logger (typed). May be non-deterministic.
2421
+ */
2422
+ logs: AbciMessageLog[];
2423
+ /**
2424
+ * Additional information. May be non-deterministic.
2425
+ */
2426
+ info: string;
2427
+ /**
2428
+ * Amount of gas requested for transaction.
2429
+ */
2430
+ gas_wanted: bigint;
2431
+ /**
2432
+ * Amount of gas consumed by transaction.
2433
+ */
2434
+ gas_used: bigint;
2435
+ /**
2436
+ * Time of the previous block. For heights > 1, it's the weighted median of
2437
+ * the timestamps of the valid votes in the block.LastCommit. For height == 1,
2438
+ * it's genesis time.
2439
+ */
2440
+ timestamp: string;
2441
+ /**
2442
+ * The block height
2443
+ */
2444
+ readonly height: bigint;
2445
+ /**
2446
+ * Events defines all the events emitted by processing a transaction. Note,
2447
+ * these events include those emitted by processing all the messages and those
2448
+ * emitted from the ante. Whereas Logs contains the events, with
2449
+ * additional metadata, emitted only by processing the messages.
2450
+ */
2451
+ readonly events: JsEvent[];
2452
+ }
2453
+ /**
2454
+ * Response to a tx status query
2455
+ */
2456
+ export class TxStatusResponse {
2457
+ private constructor();
2458
+ free(): void;
2459
+ /**
2460
+ * Index of the transaction in block.
2461
+ */
2462
+ index: number;
2463
+ /**
2464
+ * Execution_code is returned when the transaction has been committed
2465
+ * and returns whether it was successful or errored. A non zero
2466
+ * execution code indicates an error.
2467
+ */
2468
+ execution_code: ErrorCode;
2469
+ /**
2470
+ * Error log, if transaction failed.
2471
+ */
2472
+ error: string;
2473
+ /**
2474
+ * Status of the transaction.
2475
+ */
2476
+ status: TxStatus;
2477
+ /**
2478
+ * Height of the block in which the transaction was committed.
2479
+ */
2480
+ readonly height: bigint;
2481
+ }
1122
2482
  /**
1123
2483
  * Address of a validator.
1124
2484
  */
@@ -1134,3 +2494,90 @@ export class ValAddress {
1134
2494
  toString(): string;
1135
2495
  free(): void;
1136
2496
  }
2497
+ /**
2498
+ * Validator set contains a vector of validators
2499
+ */
2500
+ export class ValidatorSet {
2501
+ private constructor();
2502
+ free(): void;
2503
+ /**
2504
+ * Validators in the set
2505
+ */
2506
+ validators: JsValidatorInfo[];
2507
+ /**
2508
+ * Proposer
2509
+ */
2510
+ get proposer(): JsValidatorInfo | undefined;
2511
+ /**
2512
+ * Proposer
2513
+ */
2514
+ set proposer(value: JsValidatorInfo | null | undefined);
2515
+ /**
2516
+ * Total voting power
2517
+ */
2518
+ total_voting_power: bigint;
2519
+ }
2520
+ /**
2521
+ * Votes are signed messages from validators for a particular block which include
2522
+ * information about the validator signing it.
2523
+ */
2524
+ export class Vote {
2525
+ private constructor();
2526
+ free(): void;
2527
+ /**
2528
+ * Type of vote (prevote or precommit)
2529
+ */
2530
+ vote_type: VoteType;
2531
+ /**
2532
+ * Block height
2533
+ */
2534
+ height: bigint;
2535
+ /**
2536
+ * Round
2537
+ */
2538
+ round: number;
2539
+ /**
2540
+ * Block ID
2541
+ */
2542
+ get block_id(): BlockId | undefined;
2543
+ /**
2544
+ * Block ID
2545
+ */
2546
+ set block_id(value: BlockId | null | undefined);
2547
+ /**
2548
+ * Timestamp
2549
+ */
2550
+ get timestamp(): string | undefined;
2551
+ /**
2552
+ * Timestamp
2553
+ */
2554
+ set timestamp(value: string | null | undefined);
2555
+ /**
2556
+ * Validator address
2557
+ */
2558
+ validator_address: string;
2559
+ /**
2560
+ * Validator index
2561
+ */
2562
+ validator_index: number;
2563
+ /**
2564
+ * Signature
2565
+ */
2566
+ get signature(): Signature | undefined;
2567
+ /**
2568
+ * Signature
2569
+ */
2570
+ set signature(value: Signature | null | undefined);
2571
+ /**
2572
+ * Vote extension provided by the application. Only valid for precommit messages.
2573
+ */
2574
+ extension: Uint8Array;
2575
+ /**
2576
+ * Vote extension signature by the validator Only valid for precommit messages.
2577
+ */
2578
+ get extension_signature(): Signature | undefined;
2579
+ /**
2580
+ * Vote extension signature by the validator Only valid for precommit messages.
2581
+ */
2582
+ set extension_signature(value: Signature | null | undefined);
2583
+ }