lumina-node-wasm 0.9.0 → 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.
- package/lumina_node_wasm.d.ts +1574 -117
- package/lumina_node_wasm_bg.js +6296 -1578
- package/lumina_node_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/lumina_node_wasm.d.ts
CHANGED
|
@@ -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,21 @@ export enum Network {
|
|
|
37
410
|
type ReadableStreamType = "bytes";
|
|
38
411
|
|
|
39
412
|
/**
|
|
40
|
-
*
|
|
413
|
+
* Coin
|
|
41
414
|
*/
|
|
42
|
-
export interface
|
|
43
|
-
|
|
44
|
-
|
|
415
|
+
export interface Coin {
|
|
416
|
+
denom: string,
|
|
417
|
+
amount: bigint
|
|
45
418
|
}
|
|
419
|
+
|
|
420
|
+
|
|
46
421
|
|
|
47
422
|
/**
|
|
48
|
-
*
|
|
423
|
+
* Protobuf Any type
|
|
49
424
|
*/
|
|
50
|
-
export interface
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
memo?: string;
|
|
425
|
+
export interface ProtoAny {
|
|
426
|
+
typeUrl: string;
|
|
427
|
+
value: Uint8Array;
|
|
54
428
|
}
|
|
55
429
|
|
|
56
430
|
|
|
@@ -86,16 +460,6 @@ type ReadableStreamType = "bytes";
|
|
|
86
460
|
|
|
87
461
|
|
|
88
462
|
|
|
89
|
-
/**
|
|
90
|
-
* Coin
|
|
91
|
-
*/
|
|
92
|
-
export interface Coin {
|
|
93
|
-
denom: string,
|
|
94
|
-
amount: bigint
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
463
|
/**
|
|
100
464
|
* A payload to be signed
|
|
101
465
|
*/
|
|
@@ -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
|
-
*
|
|
520
|
+
* ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
|
|
118
521
|
*/
|
|
119
|
-
export
|
|
120
|
-
|
|
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
|
*/
|
|
@@ -144,106 +609,330 @@ export class AppVersion {
|
|
|
144
609
|
private constructor();
|
|
145
610
|
free(): void;
|
|
146
611
|
/**
|
|
147
|
-
* Latest App version variant.
|
|
148
|
-
*/
|
|
149
|
-
static latest(): AppVersion;
|
|
150
|
-
/**
|
|
151
|
-
* App v1
|
|
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.
|
|
831
|
+
*/
|
|
832
|
+
export class BroadcastMode {
|
|
833
|
+
private constructor();
|
|
834
|
+
free(): void;
|
|
835
|
+
/**
|
|
836
|
+
* zero-value for mode ordering
|
|
152
837
|
*/
|
|
153
|
-
static readonly
|
|
838
|
+
static readonly Unspecified: BroadcastMode;
|
|
154
839
|
/**
|
|
155
|
-
*
|
|
840
|
+
* `BroadcastMode` `Block` defines a tx broadcasting mode where the client waits for
|
|
841
|
+
* the tx to be committed in a block.
|
|
156
842
|
*/
|
|
157
|
-
static readonly
|
|
843
|
+
static readonly Block: BroadcastMode;
|
|
158
844
|
/**
|
|
159
|
-
*
|
|
845
|
+
* `BroadcastMode` `Sync` defines a tx broadcasting mode where the client waits for
|
|
846
|
+
* a CheckTx execution response only.
|
|
160
847
|
*/
|
|
161
|
-
static readonly
|
|
848
|
+
static readonly Sync: BroadcastMode;
|
|
162
849
|
/**
|
|
163
|
-
*
|
|
850
|
+
* `BroadcastMode` `Async` defines a tx broadcasting mode where the client returns
|
|
851
|
+
* immediately.
|
|
164
852
|
*/
|
|
165
|
-
static readonly
|
|
853
|
+
static readonly Async: BroadcastMode;
|
|
166
854
|
}
|
|
167
855
|
/**
|
|
168
|
-
*
|
|
856
|
+
* Coin defines a token with a denomination and an amount.
|
|
169
857
|
*/
|
|
170
|
-
export class
|
|
171
|
-
|
|
172
|
-
** Return copy of self without private attributes.
|
|
173
|
-
*/
|
|
174
|
-
toJSON(): Object;
|
|
175
|
-
/**
|
|
176
|
-
* Return stringified version of self.
|
|
177
|
-
*/
|
|
178
|
-
toString(): string;
|
|
858
|
+
export class Coin {
|
|
859
|
+
private constructor();
|
|
179
860
|
free(): void;
|
|
180
861
|
/**
|
|
181
|
-
*
|
|
182
|
-
*/
|
|
183
|
-
constructor(namespace: Namespace, data: Uint8Array, app_version: AppVersion);
|
|
184
|
-
/**
|
|
185
|
-
* Clone a blob creating a new deep copy of it.
|
|
862
|
+
* Coin denomination
|
|
186
863
|
*/
|
|
187
|
-
|
|
864
|
+
denom: string;
|
|
188
865
|
/**
|
|
189
|
-
*
|
|
866
|
+
* Coin amount
|
|
190
867
|
*/
|
|
191
|
-
|
|
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;
|
|
192
877
|
/**
|
|
193
|
-
*
|
|
878
|
+
* Block height
|
|
194
879
|
*/
|
|
195
|
-
|
|
880
|
+
height: bigint;
|
|
196
881
|
/**
|
|
197
|
-
*
|
|
882
|
+
* Round
|
|
198
883
|
*/
|
|
199
|
-
|
|
884
|
+
round: number;
|
|
200
885
|
/**
|
|
201
|
-
*
|
|
886
|
+
* Block ID
|
|
202
887
|
*/
|
|
203
|
-
|
|
888
|
+
block_id: BlockId;
|
|
204
889
|
/**
|
|
205
|
-
*
|
|
890
|
+
* Signatures
|
|
206
891
|
*/
|
|
207
|
-
|
|
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;
|
|
208
901
|
/**
|
|
209
|
-
*
|
|
902
|
+
* vote type of a validator
|
|
210
903
|
*/
|
|
211
|
-
|
|
904
|
+
vote_type: CommitVoteType;
|
|
212
905
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
* Must be present in `share_version 1` and absent otherwise.
|
|
906
|
+
* vote, if received
|
|
216
907
|
*/
|
|
217
|
-
get
|
|
908
|
+
get vote(): CommitVote | undefined;
|
|
218
909
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* Must be present in `share_version 1` and absent otherwise.
|
|
910
|
+
* vote, if received
|
|
222
911
|
*/
|
|
223
|
-
set
|
|
912
|
+
set vote(value: CommitVote | null | undefined);
|
|
224
913
|
}
|
|
225
914
|
/**
|
|
226
|
-
*
|
|
915
|
+
* Value of the validator vote
|
|
227
916
|
*/
|
|
228
|
-
export class
|
|
917
|
+
export class CommitVote {
|
|
229
918
|
private constructor();
|
|
230
|
-
/**
|
|
231
|
-
** Return copy of self without private attributes.
|
|
232
|
-
*/
|
|
233
|
-
toJSON(): Object;
|
|
234
|
-
/**
|
|
235
|
-
* Return stringified version of self.
|
|
236
|
-
*/
|
|
237
|
-
toString(): string;
|
|
238
919
|
free(): void;
|
|
239
920
|
/**
|
|
240
|
-
*
|
|
921
|
+
* Address of the voting validator
|
|
241
922
|
*/
|
|
242
|
-
|
|
923
|
+
validator_address: string;
|
|
243
924
|
/**
|
|
244
|
-
*
|
|
925
|
+
* Timestamp
|
|
245
926
|
*/
|
|
246
|
-
|
|
927
|
+
timestamp: string;
|
|
928
|
+
/**
|
|
929
|
+
* Signature
|
|
930
|
+
*/
|
|
931
|
+
get signature(): Signature | undefined;
|
|
932
|
+
/**
|
|
933
|
+
* Signature
|
|
934
|
+
*/
|
|
935
|
+
set signature(value: Signature | null | undefined);
|
|
247
936
|
}
|
|
248
937
|
/**
|
|
249
938
|
* A merkle hash used to identify the [`Blob`]s data.
|
|
@@ -299,6 +988,21 @@ export class Commitment {
|
|
|
299
988
|
*/
|
|
300
989
|
hash(): Uint8Array;
|
|
301
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
|
+
}
|
|
302
1006
|
export class ConnectionCountersSnapshot {
|
|
303
1007
|
private constructor();
|
|
304
1008
|
/**
|
|
@@ -354,6 +1058,29 @@ export class ConsAddress {
|
|
|
354
1058
|
toString(): string;
|
|
355
1059
|
free(): void;
|
|
356
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
|
+
}
|
|
357
1084
|
/**
|
|
358
1085
|
* Header with commitments of the data availability.
|
|
359
1086
|
*
|
|
@@ -428,6 +1155,40 @@ export class DataAvailabilityHeader {
|
|
|
428
1155
|
*/
|
|
429
1156
|
squareWidth(): number;
|
|
430
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
|
+
}
|
|
431
1192
|
/**
|
|
432
1193
|
* Block header together with the relevant Data Availability metadata.
|
|
433
1194
|
*
|
|
@@ -545,23 +1306,267 @@ export class ExtendedHeader {
|
|
|
545
1306
|
* If verification fails, this function will return an error with a reason of failure.
|
|
546
1307
|
* This function will also return an error if untrusted headers and `self` don't form contiguous range
|
|
547
1308
|
*/
|
|
548
|
-
verifyAdjacentRange(untrusted: ExtendedHeader[]): void;
|
|
1309
|
+
verifyAdjacentRange(untrusted: ExtendedHeader[]): void;
|
|
1310
|
+
/**
|
|
1311
|
+
* Header of the block data availability.
|
|
1312
|
+
*/
|
|
1313
|
+
dah: DataAvailabilityHeader;
|
|
1314
|
+
/**
|
|
1315
|
+
* Tendermint block header.
|
|
1316
|
+
*/
|
|
1317
|
+
readonly header: any;
|
|
1318
|
+
/**
|
|
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;
|
|
549
1550
|
/**
|
|
550
|
-
*
|
|
1551
|
+
* Root hash of all results from the txs from the previous block
|
|
551
1552
|
*/
|
|
552
|
-
|
|
1553
|
+
get last_results_hash(): string | undefined;
|
|
553
1554
|
/**
|
|
554
|
-
*
|
|
1555
|
+
* Root hash of all results from the txs from the previous block
|
|
555
1556
|
*/
|
|
556
|
-
|
|
1557
|
+
set last_results_hash(value: string | null | undefined);
|
|
557
1558
|
/**
|
|
558
|
-
*
|
|
1559
|
+
* Hash of evidence included in the block
|
|
559
1560
|
*/
|
|
560
|
-
|
|
1561
|
+
get evidence_hash(): string | undefined;
|
|
561
1562
|
/**
|
|
562
|
-
*
|
|
1563
|
+
* Hash of evidence included in the block
|
|
563
1564
|
*/
|
|
564
|
-
|
|
1565
|
+
set evidence_hash(value: string | null | undefined);
|
|
1566
|
+
/**
|
|
1567
|
+
* Original proposer of the block
|
|
1568
|
+
*/
|
|
1569
|
+
proposer_address: string;
|
|
565
1570
|
}
|
|
566
1571
|
export class IntoUnderlyingByteSource {
|
|
567
1572
|
private constructor();
|
|
@@ -585,6 +1590,118 @@ export class IntoUnderlyingSource {
|
|
|
585
1590
|
pull(controller: ReadableStreamDefaultController): Promise<any>;
|
|
586
1591
|
cancel(): void;
|
|
587
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
|
+
}
|
|
588
1705
|
/**
|
|
589
1706
|
* Namespace of the data published to the celestia network.
|
|
590
1707
|
*
|
|
@@ -871,20 +1988,6 @@ export class NodeConfig {
|
|
|
871
1988
|
* **Default value:** true
|
|
872
1989
|
*/
|
|
873
1990
|
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
1991
|
/**
|
|
889
1992
|
* Pruning window defines maximum age of a block for it to be retained in store.
|
|
890
1993
|
*
|
|
@@ -894,7 +1997,7 @@ export class NodeConfig {
|
|
|
894
1997
|
*
|
|
895
1998
|
* If this is not set, then default value will apply:
|
|
896
1999
|
*
|
|
897
|
-
* * If `use_persistent_memory == true`, default value is
|
|
2000
|
+
* * If `use_persistent_memory == true`, default value is 7 days plus 1 hour.
|
|
898
2001
|
* * If `use_persistent_memory == false`, default value is 0 seconds.
|
|
899
2002
|
*/
|
|
900
2003
|
get customPruningWindowSecs(): number | undefined;
|
|
@@ -907,7 +2010,7 @@ export class NodeConfig {
|
|
|
907
2010
|
*
|
|
908
2011
|
* If this is not set, then default value will apply:
|
|
909
2012
|
*
|
|
910
|
-
* * If `use_persistent_memory == true`, default value is
|
|
2013
|
+
* * If `use_persistent_memory == true`, default value is 7 days plus 1 hour.
|
|
911
2014
|
* * If `use_persistent_memory == false`, default value is 0 seconds.
|
|
912
2015
|
*/
|
|
913
2016
|
set customPruningWindowSecs(value: number | null | undefined);
|
|
@@ -923,6 +2026,21 @@ export class NodeWorker {
|
|
|
923
2026
|
constructor(port_like_object: any);
|
|
924
2027
|
run(): Promise<void>;
|
|
925
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
|
+
}
|
|
926
2044
|
/**
|
|
927
2045
|
* Statistics of the connected peers
|
|
928
2046
|
*/
|
|
@@ -946,6 +2064,47 @@ export class PeerTrackerInfoSnapshot {
|
|
|
946
2064
|
*/
|
|
947
2065
|
num_connected_trusted_peers: bigint;
|
|
948
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
|
+
}
|
|
949
2108
|
/**
|
|
950
2109
|
* Sampling metadata for a block.
|
|
951
2110
|
*
|
|
@@ -959,6 +2118,64 @@ export class SamplingMetadata {
|
|
|
959
2118
|
*/
|
|
960
2119
|
readonly cids: Uint8Array[];
|
|
961
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
|
+
}
|
|
962
2179
|
/**
|
|
963
2180
|
* Status of the synchronization.
|
|
964
2181
|
*/
|
|
@@ -982,6 +2199,66 @@ export class SyncingInfoSnapshot {
|
|
|
982
2199
|
*/
|
|
983
2200
|
subjective_head: bigint;
|
|
984
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
|
+
}
|
|
985
2262
|
/**
|
|
986
2263
|
* Celestia grpc transaction client.
|
|
987
2264
|
*/
|
|
@@ -996,7 +2273,6 @@ export class TxClient {
|
|
|
996
2273
|
* ```js
|
|
997
2274
|
* import { secp256k1 } from "@noble/curves/secp256k1";
|
|
998
2275
|
*
|
|
999
|
-
* const address = "celestia169s50psyj2f4la9a2235329xz7rk6c53zhw9mm";
|
|
1000
2276
|
* const privKey = "fdc8ac75dfa1c142dbcba77938a14dd03078052ce0b49a529dcf72a9885a3abb";
|
|
1001
2277
|
* const pubKey = secp256k1.getPublicKey(privKey);
|
|
1002
2278
|
*
|
|
@@ -1006,7 +2282,7 @@ export class TxClient {
|
|
|
1006
2282
|
* return sig.toCompactRawBytes();
|
|
1007
2283
|
* };
|
|
1008
2284
|
*
|
|
1009
|
-
* const txClient = await new TxClient("http://127.0.0.1:18080",
|
|
2285
|
+
* const txClient = await new TxClient("http://127.0.0.1:18080", pubKey, signer);
|
|
1010
2286
|
* ```
|
|
1011
2287
|
*
|
|
1012
2288
|
* # Example with leap wallet
|
|
@@ -1019,14 +2295,22 @@ export class TxClient {
|
|
|
1019
2295
|
* .then(sig => Uint8Array.from(atob(sig.signature.signature), c => c.charCodeAt(0)))
|
|
1020
2296
|
* }
|
|
1021
2297
|
*
|
|
1022
|
-
* const tx_client = await new TxClient("http://127.0.0.1:18080", keys.
|
|
2298
|
+
* const tx_client = await new TxClient("http://127.0.0.1:18080", keys.pubKey, signer)
|
|
1023
2299
|
* ```
|
|
1024
2300
|
*/
|
|
1025
|
-
constructor(url: string,
|
|
2301
|
+
constructor(url: string, pubkey: Uint8Array, signer_fn: SignerFn);
|
|
2302
|
+
/**
|
|
2303
|
+
* Query for the current minimum gas price
|
|
2304
|
+
*/
|
|
2305
|
+
minGasPrice(): Promise<number>;
|
|
1026
2306
|
/**
|
|
1027
|
-
*
|
|
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.
|
|
1028
2312
|
*/
|
|
1029
|
-
|
|
2313
|
+
getEstimateGasPrice(priority: TxPriority): Promise<number>;
|
|
1030
2314
|
/**
|
|
1031
2315
|
* Submit blobs to the celestia network.
|
|
1032
2316
|
*
|
|
@@ -1119,6 +2403,92 @@ export class TxClient {
|
|
|
1119
2403
|
*/
|
|
1120
2404
|
readonly appVersion: AppVersion;
|
|
1121
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
|
+
}
|
|
1122
2492
|
/**
|
|
1123
2493
|
* Address of a validator.
|
|
1124
2494
|
*/
|
|
@@ -1134,3 +2504,90 @@ export class ValAddress {
|
|
|
1134
2504
|
toString(): string;
|
|
1135
2505
|
free(): void;
|
|
1136
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
|
+
}
|