decentralcardgame-cardchain-client-ts 0.0.5 → 0.0.6

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.
Files changed (75) hide show
  1. package/DecentralCardGame.cardchain.cardchain/module.js +311 -309
  2. package/DecentralCardGame.cardchain.cardchain/module.ts +469 -467
  3. package/DecentralCardGame.cardchain.cardchain/registry.js +58 -58
  4. package/DecentralCardGame.cardchain.cardchain/registry.ts +58 -58
  5. package/DecentralCardGame.cardchain.cardchain/rest.ts +3 -0
  6. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +41 -0
  7. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +51 -0
  8. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.js +14 -1
  9. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.ts +16 -2
  10. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +10 -0
  11. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +11 -0
  12. package/DecentralCardGame.cardchain.cardchain/types.js +2 -1
  13. package/DecentralCardGame.cardchain.cardchain/types.ts +2 -0
  14. package/client.js +1 -2
  15. package/package.json +1 -1
  16. package/DecentralCardGame.cardchain.cardchain/types/cardchain/card.js +0 -491
  17. package/DecentralCardGame.cardchain.cardchain/types/cardchain/card.ts +0 -556
  18. package/DecentralCardGame.cardchain.cardchain/types/cardchain/collection.js +0 -365
  19. package/DecentralCardGame.cardchain.cardchain/types/cardchain/collection.ts +0 -416
  20. package/DecentralCardGame.cardchain.cardchain/types/cardchain/collection_proposal.js +0 -93
  21. package/DecentralCardGame.cardchain.cardchain/types/cardchain/collection_proposal.ts +0 -124
  22. package/DecentralCardGame.cardchain.cardchain/types/cardchain/copyright_proposal.js +0 -102
  23. package/DecentralCardGame.cardchain.cardchain/types/cardchain/copyright_proposal.ts +0 -134
  24. package/DecentralCardGame.cardchain.cardchain/types/cardchain/council.js +0 -350
  25. package/DecentralCardGame.cardchain.cardchain/types/cardchain/council.ts +0 -409
  26. package/DecentralCardGame.cardchain.cardchain/types/cardchain/genesis.js +0 -241
  27. package/DecentralCardGame.cardchain.cardchain/types/cardchain/genesis.ts +0 -267
  28. package/DecentralCardGame.cardchain.cardchain/types/cardchain/image.js +0 -88
  29. package/DecentralCardGame.cardchain.cardchain/types/cardchain/image.ts +0 -115
  30. package/DecentralCardGame.cardchain.cardchain/types/cardchain/match.js +0 -210
  31. package/DecentralCardGame.cardchain.cardchain/types/cardchain/match.ts +0 -255
  32. package/DecentralCardGame.cardchain.cardchain/types/cardchain/match_reporter_proposal.js +0 -67
  33. package/DecentralCardGame.cardchain.cardchain/types/cardchain/match_reporter_proposal.ts +0 -92
  34. package/DecentralCardGame.cardchain.cardchain/types/cardchain/num.js +0 -73
  35. package/DecentralCardGame.cardchain.cardchain/types/cardchain/num.ts +0 -102
  36. package/DecentralCardGame.cardchain.cardchain/types/cardchain/params.js +0 -275
  37. package/DecentralCardGame.cardchain.cardchain/types/cardchain/params.ts +0 -324
  38. package/DecentralCardGame.cardchain.cardchain/types/cardchain/query.js +0 -1970
  39. package/DecentralCardGame.cardchain.cardchain/types/cardchain/query.ts +0 -2366
  40. package/DecentralCardGame.cardchain.cardchain/types/cardchain/running_average.js +0 -85
  41. package/DecentralCardGame.cardchain.cardchain/types/cardchain/running_average.ts +0 -111
  42. package/DecentralCardGame.cardchain.cardchain/types/cardchain/sell_offer.js +0 -148
  43. package/DecentralCardGame.cardchain.cardchain/types/cardchain/sell_offer.ts +0 -183
  44. package/DecentralCardGame.cardchain.cardchain/types/cardchain/server.js +0 -93
  45. package/DecentralCardGame.cardchain.cardchain/types/cardchain/server.ts +0 -124
  46. package/DecentralCardGame.cardchain.cardchain/types/cardchain/tx.js +0 -4137
  47. package/DecentralCardGame.cardchain.cardchain/types/cardchain/tx.ts +0 -5125
  48. package/DecentralCardGame.cardchain.cardchain/types/cardchain/user.js +0 -496
  49. package/DecentralCardGame.cardchain.cardchain/types/cardchain/user.ts +0 -556
  50. package/DecentralCardGame.cardchain.cardchain/types/cardchain/vote_right.js +0 -84
  51. package/DecentralCardGame.cardchain.cardchain/types/cardchain/vote_right.ts +0 -114
  52. package/DecentralCardGame.cardchain.cardchain/types/cardchain/voting_result.js +0 -127
  53. package/DecentralCardGame.cardchain.cardchain/types/cardchain/voting_result.ts +0 -161
  54. package/DecentralCardGame.cardchain.cardchain/types/cardchain/voting_results.js +0 -148
  55. package/DecentralCardGame.cardchain.cardchain/types/cardchain/voting_results.ts +0 -182
  56. package/cosmos.authz.v1beta1/types/cosmos/base/abci/v1beta1/abci.js +0 -773
  57. package/cosmos.authz.v1beta1/types/cosmos/base/abci/v1beta1/abci.ts +0 -989
  58. package/cosmos.authz.v1beta1/types/google/protobuf/duration.js +0 -84
  59. package/cosmos.authz.v1beta1/types/google/protobuf/duration.ts +0 -187
  60. package/cosmos.authz.v1beta1/types/tendermint/abci/types.js +0 -3447
  61. package/cosmos.authz.v1beta1/types/tendermint/abci/types.ts +0 -4107
  62. package/cosmos.authz.v1beta1/types/tendermint/crypto/keys.js +0 -100
  63. package/cosmos.authz.v1beta1/types/tendermint/crypto/keys.ts +0 -129
  64. package/cosmos.authz.v1beta1/types/tendermint/crypto/proof.js +0 -356
  65. package/cosmos.authz.v1beta1/types/tendermint/crypto/proof.ts +0 -439
  66. package/cosmos.authz.v1beta1/types/tendermint/types/params.js +0 -378
  67. package/cosmos.authz.v1beta1/types/tendermint/types/params.ts +0 -514
  68. package/cosmos.authz.v1beta1/types/tendermint/types/types.js +0 -1207
  69. package/cosmos.authz.v1beta1/types/tendermint/types/types.ts +0 -1452
  70. package/cosmos.authz.v1beta1/types/tendermint/types/validator.js +0 -254
  71. package/cosmos.authz.v1beta1/types/tendermint/types/validator.ts +0 -308
  72. package/cosmos.authz.v1beta1/types/tendermint/version/types.js +0 -133
  73. package/cosmos.authz.v1beta1/types/tendermint/version/types.ts +0 -184
  74. package/ibc.core.connection.v1/types/confio/proofs.js +0 -1120
  75. package/ibc.core.connection.v1/types/confio/proofs.ts +0 -1402
@@ -1,4107 +0,0 @@
1
- /* eslint-disable */
2
- import Long from "long";
3
- import _m0 from "protobufjs/minimal";
4
- import { Timestamp } from "../../google/protobuf/timestamp";
5
- import { PublicKey } from "../crypto/keys";
6
- import { ProofOps } from "../crypto/proof";
7
- import { EvidenceParams, ValidatorParams, VersionParams } from "../types/params";
8
- import { Header } from "../types/types";
9
-
10
- export const protobufPackage = "tendermint.abci";
11
-
12
- export enum CheckTxType {
13
- NEW = 0,
14
- RECHECK = 1,
15
- UNRECOGNIZED = -1,
16
- }
17
-
18
- export function checkTxTypeFromJSON(object: any): CheckTxType {
19
- switch (object) {
20
- case 0:
21
- case "NEW":
22
- return CheckTxType.NEW;
23
- case 1:
24
- case "RECHECK":
25
- return CheckTxType.RECHECK;
26
- case -1:
27
- case "UNRECOGNIZED":
28
- default:
29
- return CheckTxType.UNRECOGNIZED;
30
- }
31
- }
32
-
33
- export function checkTxTypeToJSON(object: CheckTxType): string {
34
- switch (object) {
35
- case CheckTxType.NEW:
36
- return "NEW";
37
- case CheckTxType.RECHECK:
38
- return "RECHECK";
39
- case CheckTxType.UNRECOGNIZED:
40
- default:
41
- return "UNRECOGNIZED";
42
- }
43
- }
44
-
45
- export enum EvidenceType {
46
- UNKNOWN = 0,
47
- DUPLICATE_VOTE = 1,
48
- LIGHT_CLIENT_ATTACK = 2,
49
- UNRECOGNIZED = -1,
50
- }
51
-
52
- export function evidenceTypeFromJSON(object: any): EvidenceType {
53
- switch (object) {
54
- case 0:
55
- case "UNKNOWN":
56
- return EvidenceType.UNKNOWN;
57
- case 1:
58
- case "DUPLICATE_VOTE":
59
- return EvidenceType.DUPLICATE_VOTE;
60
- case 2:
61
- case "LIGHT_CLIENT_ATTACK":
62
- return EvidenceType.LIGHT_CLIENT_ATTACK;
63
- case -1:
64
- case "UNRECOGNIZED":
65
- default:
66
- return EvidenceType.UNRECOGNIZED;
67
- }
68
- }
69
-
70
- export function evidenceTypeToJSON(object: EvidenceType): string {
71
- switch (object) {
72
- case EvidenceType.UNKNOWN:
73
- return "UNKNOWN";
74
- case EvidenceType.DUPLICATE_VOTE:
75
- return "DUPLICATE_VOTE";
76
- case EvidenceType.LIGHT_CLIENT_ATTACK:
77
- return "LIGHT_CLIENT_ATTACK";
78
- case EvidenceType.UNRECOGNIZED:
79
- default:
80
- return "UNRECOGNIZED";
81
- }
82
- }
83
-
84
- export interface Request {
85
- echo: RequestEcho | undefined;
86
- flush: RequestFlush | undefined;
87
- info: RequestInfo | undefined;
88
- setOption: RequestSetOption | undefined;
89
- initChain: RequestInitChain | undefined;
90
- query: RequestQuery | undefined;
91
- beginBlock: RequestBeginBlock | undefined;
92
- checkTx: RequestCheckTx | undefined;
93
- deliverTx: RequestDeliverTx | undefined;
94
- endBlock: RequestEndBlock | undefined;
95
- commit: RequestCommit | undefined;
96
- listSnapshots: RequestListSnapshots | undefined;
97
- offerSnapshot: RequestOfferSnapshot | undefined;
98
- loadSnapshotChunk: RequestLoadSnapshotChunk | undefined;
99
- applySnapshotChunk: RequestApplySnapshotChunk | undefined;
100
- }
101
-
102
- export interface RequestEcho {
103
- message: string;
104
- }
105
-
106
- export interface RequestFlush {
107
- }
108
-
109
- export interface RequestInfo {
110
- version: string;
111
- blockVersion: number;
112
- p2pVersion: number;
113
- }
114
-
115
- /** nondeterministic */
116
- export interface RequestSetOption {
117
- key: string;
118
- value: string;
119
- }
120
-
121
- export interface RequestInitChain {
122
- time: Date | undefined;
123
- chainId: string;
124
- consensusParams: ConsensusParams | undefined;
125
- validators: ValidatorUpdate[];
126
- appStateBytes: Uint8Array;
127
- initialHeight: number;
128
- }
129
-
130
- export interface RequestQuery {
131
- data: Uint8Array;
132
- path: string;
133
- height: number;
134
- prove: boolean;
135
- }
136
-
137
- export interface RequestBeginBlock {
138
- hash: Uint8Array;
139
- header: Header | undefined;
140
- lastCommitInfo: LastCommitInfo | undefined;
141
- byzantineValidators: Evidence[];
142
- }
143
-
144
- export interface RequestCheckTx {
145
- tx: Uint8Array;
146
- type: CheckTxType;
147
- }
148
-
149
- export interface RequestDeliverTx {
150
- tx: Uint8Array;
151
- }
152
-
153
- export interface RequestEndBlock {
154
- height: number;
155
- }
156
-
157
- export interface RequestCommit {
158
- }
159
-
160
- /** lists available snapshots */
161
- export interface RequestListSnapshots {
162
- }
163
-
164
- /** offers a snapshot to the application */
165
- export interface RequestOfferSnapshot {
166
- /** snapshot offered by peers */
167
- snapshot:
168
- | Snapshot
169
- | undefined;
170
- /** light client-verified app hash for snapshot height */
171
- appHash: Uint8Array;
172
- }
173
-
174
- /** loads a snapshot chunk */
175
- export interface RequestLoadSnapshotChunk {
176
- height: number;
177
- format: number;
178
- chunk: number;
179
- }
180
-
181
- /** Applies a snapshot chunk */
182
- export interface RequestApplySnapshotChunk {
183
- index: number;
184
- chunk: Uint8Array;
185
- sender: string;
186
- }
187
-
188
- export interface Response {
189
- exception: ResponseException | undefined;
190
- echo: ResponseEcho | undefined;
191
- flush: ResponseFlush | undefined;
192
- info: ResponseInfo | undefined;
193
- setOption: ResponseSetOption | undefined;
194
- initChain: ResponseInitChain | undefined;
195
- query: ResponseQuery | undefined;
196
- beginBlock: ResponseBeginBlock | undefined;
197
- checkTx: ResponseCheckTx | undefined;
198
- deliverTx: ResponseDeliverTx | undefined;
199
- endBlock: ResponseEndBlock | undefined;
200
- commit: ResponseCommit | undefined;
201
- listSnapshots: ResponseListSnapshots | undefined;
202
- offerSnapshot: ResponseOfferSnapshot | undefined;
203
- loadSnapshotChunk: ResponseLoadSnapshotChunk | undefined;
204
- applySnapshotChunk: ResponseApplySnapshotChunk | undefined;
205
- }
206
-
207
- /** nondeterministic */
208
- export interface ResponseException {
209
- error: string;
210
- }
211
-
212
- export interface ResponseEcho {
213
- message: string;
214
- }
215
-
216
- export interface ResponseFlush {
217
- }
218
-
219
- export interface ResponseInfo {
220
- data: string;
221
- version: string;
222
- appVersion: number;
223
- lastBlockHeight: number;
224
- lastBlockAppHash: Uint8Array;
225
- }
226
-
227
- /** nondeterministic */
228
- export interface ResponseSetOption {
229
- code: number;
230
- /** bytes data = 2; */
231
- log: string;
232
- info: string;
233
- }
234
-
235
- export interface ResponseInitChain {
236
- consensusParams: ConsensusParams | undefined;
237
- validators: ValidatorUpdate[];
238
- appHash: Uint8Array;
239
- }
240
-
241
- export interface ResponseQuery {
242
- code: number;
243
- /** bytes data = 2; // use "value" instead. */
244
- log: string;
245
- /** nondeterministic */
246
- info: string;
247
- index: number;
248
- key: Uint8Array;
249
- value: Uint8Array;
250
- proofOps: ProofOps | undefined;
251
- height: number;
252
- codespace: string;
253
- }
254
-
255
- export interface ResponseBeginBlock {
256
- events: Event[];
257
- }
258
-
259
- export interface ResponseCheckTx {
260
- code: number;
261
- data: Uint8Array;
262
- /** nondeterministic */
263
- log: string;
264
- /** nondeterministic */
265
- info: string;
266
- gasWanted: number;
267
- gasUsed: number;
268
- events: Event[];
269
- codespace: string;
270
- }
271
-
272
- export interface ResponseDeliverTx {
273
- code: number;
274
- data: Uint8Array;
275
- /** nondeterministic */
276
- log: string;
277
- /** nondeterministic */
278
- info: string;
279
- gasWanted: number;
280
- gasUsed: number;
281
- events: Event[];
282
- codespace: string;
283
- }
284
-
285
- export interface ResponseEndBlock {
286
- validatorUpdates: ValidatorUpdate[];
287
- consensusParamUpdates: ConsensusParams | undefined;
288
- events: Event[];
289
- }
290
-
291
- export interface ResponseCommit {
292
- /** reserve 1 */
293
- data: Uint8Array;
294
- retainHeight: number;
295
- }
296
-
297
- export interface ResponseListSnapshots {
298
- snapshots: Snapshot[];
299
- }
300
-
301
- export interface ResponseOfferSnapshot {
302
- result: ResponseOfferSnapshot_Result;
303
- }
304
-
305
- export enum ResponseOfferSnapshot_Result {
306
- /** UNKNOWN - Unknown result, abort all snapshot restoration */
307
- UNKNOWN = 0,
308
- /** ACCEPT - Snapshot accepted, apply chunks */
309
- ACCEPT = 1,
310
- /** ABORT - Abort all snapshot restoration */
311
- ABORT = 2,
312
- /** REJECT - Reject this specific snapshot, try others */
313
- REJECT = 3,
314
- /** REJECT_FORMAT - Reject all snapshots of this format, try others */
315
- REJECT_FORMAT = 4,
316
- /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */
317
- REJECT_SENDER = 5,
318
- UNRECOGNIZED = -1,
319
- }
320
-
321
- export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result {
322
- switch (object) {
323
- case 0:
324
- case "UNKNOWN":
325
- return ResponseOfferSnapshot_Result.UNKNOWN;
326
- case 1:
327
- case "ACCEPT":
328
- return ResponseOfferSnapshot_Result.ACCEPT;
329
- case 2:
330
- case "ABORT":
331
- return ResponseOfferSnapshot_Result.ABORT;
332
- case 3:
333
- case "REJECT":
334
- return ResponseOfferSnapshot_Result.REJECT;
335
- case 4:
336
- case "REJECT_FORMAT":
337
- return ResponseOfferSnapshot_Result.REJECT_FORMAT;
338
- case 5:
339
- case "REJECT_SENDER":
340
- return ResponseOfferSnapshot_Result.REJECT_SENDER;
341
- case -1:
342
- case "UNRECOGNIZED":
343
- default:
344
- return ResponseOfferSnapshot_Result.UNRECOGNIZED;
345
- }
346
- }
347
-
348
- export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string {
349
- switch (object) {
350
- case ResponseOfferSnapshot_Result.UNKNOWN:
351
- return "UNKNOWN";
352
- case ResponseOfferSnapshot_Result.ACCEPT:
353
- return "ACCEPT";
354
- case ResponseOfferSnapshot_Result.ABORT:
355
- return "ABORT";
356
- case ResponseOfferSnapshot_Result.REJECT:
357
- return "REJECT";
358
- case ResponseOfferSnapshot_Result.REJECT_FORMAT:
359
- return "REJECT_FORMAT";
360
- case ResponseOfferSnapshot_Result.REJECT_SENDER:
361
- return "REJECT_SENDER";
362
- case ResponseOfferSnapshot_Result.UNRECOGNIZED:
363
- default:
364
- return "UNRECOGNIZED";
365
- }
366
- }
367
-
368
- export interface ResponseLoadSnapshotChunk {
369
- chunk: Uint8Array;
370
- }
371
-
372
- export interface ResponseApplySnapshotChunk {
373
- result: ResponseApplySnapshotChunk_Result;
374
- /** Chunks to refetch and reapply */
375
- refetchChunks: number[];
376
- /** Chunk senders to reject and ban */
377
- rejectSenders: string[];
378
- }
379
-
380
- export enum ResponseApplySnapshotChunk_Result {
381
- /** UNKNOWN - Unknown result, abort all snapshot restoration */
382
- UNKNOWN = 0,
383
- /** ACCEPT - Chunk successfully accepted */
384
- ACCEPT = 1,
385
- /** ABORT - Abort all snapshot restoration */
386
- ABORT = 2,
387
- /** RETRY - Retry chunk (combine with refetch and reject) */
388
- RETRY = 3,
389
- /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */
390
- RETRY_SNAPSHOT = 4,
391
- /** REJECT_SNAPSHOT - Reject this snapshot, try others */
392
- REJECT_SNAPSHOT = 5,
393
- UNRECOGNIZED = -1,
394
- }
395
-
396
- export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result {
397
- switch (object) {
398
- case 0:
399
- case "UNKNOWN":
400
- return ResponseApplySnapshotChunk_Result.UNKNOWN;
401
- case 1:
402
- case "ACCEPT":
403
- return ResponseApplySnapshotChunk_Result.ACCEPT;
404
- case 2:
405
- case "ABORT":
406
- return ResponseApplySnapshotChunk_Result.ABORT;
407
- case 3:
408
- case "RETRY":
409
- return ResponseApplySnapshotChunk_Result.RETRY;
410
- case 4:
411
- case "RETRY_SNAPSHOT":
412
- return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT;
413
- case 5:
414
- case "REJECT_SNAPSHOT":
415
- return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT;
416
- case -1:
417
- case "UNRECOGNIZED":
418
- default:
419
- return ResponseApplySnapshotChunk_Result.UNRECOGNIZED;
420
- }
421
- }
422
-
423
- export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string {
424
- switch (object) {
425
- case ResponseApplySnapshotChunk_Result.UNKNOWN:
426
- return "UNKNOWN";
427
- case ResponseApplySnapshotChunk_Result.ACCEPT:
428
- return "ACCEPT";
429
- case ResponseApplySnapshotChunk_Result.ABORT:
430
- return "ABORT";
431
- case ResponseApplySnapshotChunk_Result.RETRY:
432
- return "RETRY";
433
- case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT:
434
- return "RETRY_SNAPSHOT";
435
- case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT:
436
- return "REJECT_SNAPSHOT";
437
- case ResponseApplySnapshotChunk_Result.UNRECOGNIZED:
438
- default:
439
- return "UNRECOGNIZED";
440
- }
441
- }
442
-
443
- /**
444
- * ConsensusParams contains all consensus-relevant parameters
445
- * that can be adjusted by the abci app
446
- */
447
- export interface ConsensusParams {
448
- block: BlockParams | undefined;
449
- evidence: EvidenceParams | undefined;
450
- validator: ValidatorParams | undefined;
451
- version: VersionParams | undefined;
452
- }
453
-
454
- /** BlockParams contains limits on the block size. */
455
- export interface BlockParams {
456
- /** Note: must be greater than 0 */
457
- maxBytes: number;
458
- /** Note: must be greater or equal to -1 */
459
- maxGas: number;
460
- }
461
-
462
- export interface LastCommitInfo {
463
- round: number;
464
- votes: VoteInfo[];
465
- }
466
-
467
- /**
468
- * Event allows application developers to attach additional information to
469
- * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx.
470
- * Later, transactions may be queried using these events.
471
- */
472
- export interface Event {
473
- type: string;
474
- attributes: EventAttribute[];
475
- }
476
-
477
- /** EventAttribute is a single key-value pair, associated with an event. */
478
- export interface EventAttribute {
479
- key: Uint8Array;
480
- value: Uint8Array;
481
- /** nondeterministic */
482
- index: boolean;
483
- }
484
-
485
- /**
486
- * TxResult contains results of executing the transaction.
487
- *
488
- * One usage is indexing transaction results.
489
- */
490
- export interface TxResult {
491
- height: number;
492
- index: number;
493
- tx: Uint8Array;
494
- result: ResponseDeliverTx | undefined;
495
- }
496
-
497
- /** Validator */
498
- export interface Validator {
499
- /** The first 20 bytes of SHA256(public key) */
500
- address: Uint8Array;
501
- /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */
502
- power: number;
503
- }
504
-
505
- /** ValidatorUpdate */
506
- export interface ValidatorUpdate {
507
- pubKey: PublicKey | undefined;
508
- power: number;
509
- }
510
-
511
- /** VoteInfo */
512
- export interface VoteInfo {
513
- validator: Validator | undefined;
514
- signedLastBlock: boolean;
515
- }
516
-
517
- export interface Evidence {
518
- type: EvidenceType;
519
- /** The offending validator */
520
- validator:
521
- | Validator
522
- | undefined;
523
- /** The height when the offense occurred */
524
- height: number;
525
- /** The corresponding time where the offense occurred */
526
- time:
527
- | Date
528
- | undefined;
529
- /**
530
- * Total voting power of the validator set in case the ABCI application does
531
- * not store historical validators.
532
- * https://github.com/tendermint/tendermint/issues/4581
533
- */
534
- totalVotingPower: number;
535
- }
536
-
537
- export interface Snapshot {
538
- /** The height at which the snapshot was taken */
539
- height: number;
540
- /** The application-specific snapshot format */
541
- format: number;
542
- /** Number of chunks in the snapshot */
543
- chunks: number;
544
- /** Arbitrary snapshot hash, equal only if identical */
545
- hash: Uint8Array;
546
- /** Arbitrary application metadata */
547
- metadata: Uint8Array;
548
- }
549
-
550
- function createBaseRequest(): Request {
551
- return {
552
- echo: undefined,
553
- flush: undefined,
554
- info: undefined,
555
- setOption: undefined,
556
- initChain: undefined,
557
- query: undefined,
558
- beginBlock: undefined,
559
- checkTx: undefined,
560
- deliverTx: undefined,
561
- endBlock: undefined,
562
- commit: undefined,
563
- listSnapshots: undefined,
564
- offerSnapshot: undefined,
565
- loadSnapshotChunk: undefined,
566
- applySnapshotChunk: undefined,
567
- };
568
- }
569
-
570
- export const Request = {
571
- encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
572
- if (message.echo !== undefined) {
573
- RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim();
574
- }
575
- if (message.flush !== undefined) {
576
- RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim();
577
- }
578
- if (message.info !== undefined) {
579
- RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim();
580
- }
581
- if (message.setOption !== undefined) {
582
- RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim();
583
- }
584
- if (message.initChain !== undefined) {
585
- RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim();
586
- }
587
- if (message.query !== undefined) {
588
- RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim();
589
- }
590
- if (message.beginBlock !== undefined) {
591
- RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim();
592
- }
593
- if (message.checkTx !== undefined) {
594
- RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim();
595
- }
596
- if (message.deliverTx !== undefined) {
597
- RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim();
598
- }
599
- if (message.endBlock !== undefined) {
600
- RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim();
601
- }
602
- if (message.commit !== undefined) {
603
- RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim();
604
- }
605
- if (message.listSnapshots !== undefined) {
606
- RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim();
607
- }
608
- if (message.offerSnapshot !== undefined) {
609
- RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim();
610
- }
611
- if (message.loadSnapshotChunk !== undefined) {
612
- RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim();
613
- }
614
- if (message.applySnapshotChunk !== undefined) {
615
- RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim();
616
- }
617
- return writer;
618
- },
619
-
620
- decode(input: _m0.Reader | Uint8Array, length?: number): Request {
621
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
622
- let end = length === undefined ? reader.len : reader.pos + length;
623
- const message = createBaseRequest();
624
- while (reader.pos < end) {
625
- const tag = reader.uint32();
626
- switch (tag >>> 3) {
627
- case 1:
628
- message.echo = RequestEcho.decode(reader, reader.uint32());
629
- break;
630
- case 2:
631
- message.flush = RequestFlush.decode(reader, reader.uint32());
632
- break;
633
- case 3:
634
- message.info = RequestInfo.decode(reader, reader.uint32());
635
- break;
636
- case 4:
637
- message.setOption = RequestSetOption.decode(reader, reader.uint32());
638
- break;
639
- case 5:
640
- message.initChain = RequestInitChain.decode(reader, reader.uint32());
641
- break;
642
- case 6:
643
- message.query = RequestQuery.decode(reader, reader.uint32());
644
- break;
645
- case 7:
646
- message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32());
647
- break;
648
- case 8:
649
- message.checkTx = RequestCheckTx.decode(reader, reader.uint32());
650
- break;
651
- case 9:
652
- message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32());
653
- break;
654
- case 10:
655
- message.endBlock = RequestEndBlock.decode(reader, reader.uint32());
656
- break;
657
- case 11:
658
- message.commit = RequestCommit.decode(reader, reader.uint32());
659
- break;
660
- case 12:
661
- message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32());
662
- break;
663
- case 13:
664
- message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32());
665
- break;
666
- case 14:
667
- message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32());
668
- break;
669
- case 15:
670
- message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32());
671
- break;
672
- default:
673
- reader.skipType(tag & 7);
674
- break;
675
- }
676
- }
677
- return message;
678
- },
679
-
680
- fromJSON(object: any): Request {
681
- return {
682
- echo: isSet(object.echo) ? RequestEcho.fromJSON(object.echo) : undefined,
683
- flush: isSet(object.flush) ? RequestFlush.fromJSON(object.flush) : undefined,
684
- info: isSet(object.info) ? RequestInfo.fromJSON(object.info) : undefined,
685
- setOption: isSet(object.setOption) ? RequestSetOption.fromJSON(object.setOption) : undefined,
686
- initChain: isSet(object.initChain) ? RequestInitChain.fromJSON(object.initChain) : undefined,
687
- query: isSet(object.query) ? RequestQuery.fromJSON(object.query) : undefined,
688
- beginBlock: isSet(object.beginBlock) ? RequestBeginBlock.fromJSON(object.beginBlock) : undefined,
689
- checkTx: isSet(object.checkTx) ? RequestCheckTx.fromJSON(object.checkTx) : undefined,
690
- deliverTx: isSet(object.deliverTx) ? RequestDeliverTx.fromJSON(object.deliverTx) : undefined,
691
- endBlock: isSet(object.endBlock) ? RequestEndBlock.fromJSON(object.endBlock) : undefined,
692
- commit: isSet(object.commit) ? RequestCommit.fromJSON(object.commit) : undefined,
693
- listSnapshots: isSet(object.listSnapshots) ? RequestListSnapshots.fromJSON(object.listSnapshots) : undefined,
694
- offerSnapshot: isSet(object.offerSnapshot) ? RequestOfferSnapshot.fromJSON(object.offerSnapshot) : undefined,
695
- loadSnapshotChunk: isSet(object.loadSnapshotChunk)
696
- ? RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk)
697
- : undefined,
698
- applySnapshotChunk: isSet(object.applySnapshotChunk)
699
- ? RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk)
700
- : undefined,
701
- };
702
- },
703
-
704
- toJSON(message: Request): unknown {
705
- const obj: any = {};
706
- message.echo !== undefined && (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined);
707
- message.flush !== undefined && (obj.flush = message.flush ? RequestFlush.toJSON(message.flush) : undefined);
708
- message.info !== undefined && (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined);
709
- message.setOption !== undefined
710
- && (obj.setOption = message.setOption ? RequestSetOption.toJSON(message.setOption) : undefined);
711
- message.initChain !== undefined
712
- && (obj.initChain = message.initChain ? RequestInitChain.toJSON(message.initChain) : undefined);
713
- message.query !== undefined && (obj.query = message.query ? RequestQuery.toJSON(message.query) : undefined);
714
- message.beginBlock !== undefined
715
- && (obj.beginBlock = message.beginBlock ? RequestBeginBlock.toJSON(message.beginBlock) : undefined);
716
- message.checkTx !== undefined
717
- && (obj.checkTx = message.checkTx ? RequestCheckTx.toJSON(message.checkTx) : undefined);
718
- message.deliverTx !== undefined
719
- && (obj.deliverTx = message.deliverTx ? RequestDeliverTx.toJSON(message.deliverTx) : undefined);
720
- message.endBlock !== undefined
721
- && (obj.endBlock = message.endBlock ? RequestEndBlock.toJSON(message.endBlock) : undefined);
722
- message.commit !== undefined && (obj.commit = message.commit ? RequestCommit.toJSON(message.commit) : undefined);
723
- message.listSnapshots !== undefined
724
- && (obj.listSnapshots = message.listSnapshots ? RequestListSnapshots.toJSON(message.listSnapshots) : undefined);
725
- message.offerSnapshot !== undefined
726
- && (obj.offerSnapshot = message.offerSnapshot ? RequestOfferSnapshot.toJSON(message.offerSnapshot) : undefined);
727
- message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk
728
- ? RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk)
729
- : undefined);
730
- message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk
731
- ? RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk)
732
- : undefined);
733
- return obj;
734
- },
735
-
736
- fromPartial<I extends Exact<DeepPartial<Request>, I>>(object: I): Request {
737
- const message = createBaseRequest();
738
- message.echo = (object.echo !== undefined && object.echo !== null)
739
- ? RequestEcho.fromPartial(object.echo)
740
- : undefined;
741
- message.flush = (object.flush !== undefined && object.flush !== null)
742
- ? RequestFlush.fromPartial(object.flush)
743
- : undefined;
744
- message.info = (object.info !== undefined && object.info !== null)
745
- ? RequestInfo.fromPartial(object.info)
746
- : undefined;
747
- message.setOption = (object.setOption !== undefined && object.setOption !== null)
748
- ? RequestSetOption.fromPartial(object.setOption)
749
- : undefined;
750
- message.initChain = (object.initChain !== undefined && object.initChain !== null)
751
- ? RequestInitChain.fromPartial(object.initChain)
752
- : undefined;
753
- message.query = (object.query !== undefined && object.query !== null)
754
- ? RequestQuery.fromPartial(object.query)
755
- : undefined;
756
- message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null)
757
- ? RequestBeginBlock.fromPartial(object.beginBlock)
758
- : undefined;
759
- message.checkTx = (object.checkTx !== undefined && object.checkTx !== null)
760
- ? RequestCheckTx.fromPartial(object.checkTx)
761
- : undefined;
762
- message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null)
763
- ? RequestDeliverTx.fromPartial(object.deliverTx)
764
- : undefined;
765
- message.endBlock = (object.endBlock !== undefined && object.endBlock !== null)
766
- ? RequestEndBlock.fromPartial(object.endBlock)
767
- : undefined;
768
- message.commit = (object.commit !== undefined && object.commit !== null)
769
- ? RequestCommit.fromPartial(object.commit)
770
- : undefined;
771
- message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null)
772
- ? RequestListSnapshots.fromPartial(object.listSnapshots)
773
- : undefined;
774
- message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null)
775
- ? RequestOfferSnapshot.fromPartial(object.offerSnapshot)
776
- : undefined;
777
- message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null)
778
- ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk)
779
- : undefined;
780
- message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null)
781
- ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk)
782
- : undefined;
783
- return message;
784
- },
785
- };
786
-
787
- function createBaseRequestEcho(): RequestEcho {
788
- return { message: "" };
789
- }
790
-
791
- export const RequestEcho = {
792
- encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
793
- if (message.message !== "") {
794
- writer.uint32(10).string(message.message);
795
- }
796
- return writer;
797
- },
798
-
799
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho {
800
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
801
- let end = length === undefined ? reader.len : reader.pos + length;
802
- const message = createBaseRequestEcho();
803
- while (reader.pos < end) {
804
- const tag = reader.uint32();
805
- switch (tag >>> 3) {
806
- case 1:
807
- message.message = reader.string();
808
- break;
809
- default:
810
- reader.skipType(tag & 7);
811
- break;
812
- }
813
- }
814
- return message;
815
- },
816
-
817
- fromJSON(object: any): RequestEcho {
818
- return { message: isSet(object.message) ? String(object.message) : "" };
819
- },
820
-
821
- toJSON(message: RequestEcho): unknown {
822
- const obj: any = {};
823
- message.message !== undefined && (obj.message = message.message);
824
- return obj;
825
- },
826
-
827
- fromPartial<I extends Exact<DeepPartial<RequestEcho>, I>>(object: I): RequestEcho {
828
- const message = createBaseRequestEcho();
829
- message.message = object.message ?? "";
830
- return message;
831
- },
832
- };
833
-
834
- function createBaseRequestFlush(): RequestFlush {
835
- return {};
836
- }
837
-
838
- export const RequestFlush = {
839
- encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
840
- return writer;
841
- },
842
-
843
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush {
844
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
845
- let end = length === undefined ? reader.len : reader.pos + length;
846
- const message = createBaseRequestFlush();
847
- while (reader.pos < end) {
848
- const tag = reader.uint32();
849
- switch (tag >>> 3) {
850
- default:
851
- reader.skipType(tag & 7);
852
- break;
853
- }
854
- }
855
- return message;
856
- },
857
-
858
- fromJSON(_: any): RequestFlush {
859
- return {};
860
- },
861
-
862
- toJSON(_: RequestFlush): unknown {
863
- const obj: any = {};
864
- return obj;
865
- },
866
-
867
- fromPartial<I extends Exact<DeepPartial<RequestFlush>, I>>(_: I): RequestFlush {
868
- const message = createBaseRequestFlush();
869
- return message;
870
- },
871
- };
872
-
873
- function createBaseRequestInfo(): RequestInfo {
874
- return { version: "", blockVersion: 0, p2pVersion: 0 };
875
- }
876
-
877
- export const RequestInfo = {
878
- encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
879
- if (message.version !== "") {
880
- writer.uint32(10).string(message.version);
881
- }
882
- if (message.blockVersion !== 0) {
883
- writer.uint32(16).uint64(message.blockVersion);
884
- }
885
- if (message.p2pVersion !== 0) {
886
- writer.uint32(24).uint64(message.p2pVersion);
887
- }
888
- return writer;
889
- },
890
-
891
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo {
892
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
893
- let end = length === undefined ? reader.len : reader.pos + length;
894
- const message = createBaseRequestInfo();
895
- while (reader.pos < end) {
896
- const tag = reader.uint32();
897
- switch (tag >>> 3) {
898
- case 1:
899
- message.version = reader.string();
900
- break;
901
- case 2:
902
- message.blockVersion = longToNumber(reader.uint64() as Long);
903
- break;
904
- case 3:
905
- message.p2pVersion = longToNumber(reader.uint64() as Long);
906
- break;
907
- default:
908
- reader.skipType(tag & 7);
909
- break;
910
- }
911
- }
912
- return message;
913
- },
914
-
915
- fromJSON(object: any): RequestInfo {
916
- return {
917
- version: isSet(object.version) ? String(object.version) : "",
918
- blockVersion: isSet(object.blockVersion) ? Number(object.blockVersion) : 0,
919
- p2pVersion: isSet(object.p2pVersion) ? Number(object.p2pVersion) : 0,
920
- };
921
- },
922
-
923
- toJSON(message: RequestInfo): unknown {
924
- const obj: any = {};
925
- message.version !== undefined && (obj.version = message.version);
926
- message.blockVersion !== undefined && (obj.blockVersion = Math.round(message.blockVersion));
927
- message.p2pVersion !== undefined && (obj.p2pVersion = Math.round(message.p2pVersion));
928
- return obj;
929
- },
930
-
931
- fromPartial<I extends Exact<DeepPartial<RequestInfo>, I>>(object: I): RequestInfo {
932
- const message = createBaseRequestInfo();
933
- message.version = object.version ?? "";
934
- message.blockVersion = object.blockVersion ?? 0;
935
- message.p2pVersion = object.p2pVersion ?? 0;
936
- return message;
937
- },
938
- };
939
-
940
- function createBaseRequestSetOption(): RequestSetOption {
941
- return { key: "", value: "" };
942
- }
943
-
944
- export const RequestSetOption = {
945
- encode(message: RequestSetOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
946
- if (message.key !== "") {
947
- writer.uint32(10).string(message.key);
948
- }
949
- if (message.value !== "") {
950
- writer.uint32(18).string(message.value);
951
- }
952
- return writer;
953
- },
954
-
955
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestSetOption {
956
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
957
- let end = length === undefined ? reader.len : reader.pos + length;
958
- const message = createBaseRequestSetOption();
959
- while (reader.pos < end) {
960
- const tag = reader.uint32();
961
- switch (tag >>> 3) {
962
- case 1:
963
- message.key = reader.string();
964
- break;
965
- case 2:
966
- message.value = reader.string();
967
- break;
968
- default:
969
- reader.skipType(tag & 7);
970
- break;
971
- }
972
- }
973
- return message;
974
- },
975
-
976
- fromJSON(object: any): RequestSetOption {
977
- return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "" };
978
- },
979
-
980
- toJSON(message: RequestSetOption): unknown {
981
- const obj: any = {};
982
- message.key !== undefined && (obj.key = message.key);
983
- message.value !== undefined && (obj.value = message.value);
984
- return obj;
985
- },
986
-
987
- fromPartial<I extends Exact<DeepPartial<RequestSetOption>, I>>(object: I): RequestSetOption {
988
- const message = createBaseRequestSetOption();
989
- message.key = object.key ?? "";
990
- message.value = object.value ?? "";
991
- return message;
992
- },
993
- };
994
-
995
- function createBaseRequestInitChain(): RequestInitChain {
996
- return {
997
- time: undefined,
998
- chainId: "",
999
- consensusParams: undefined,
1000
- validators: [],
1001
- appStateBytes: new Uint8Array(),
1002
- initialHeight: 0,
1003
- };
1004
- }
1005
-
1006
- export const RequestInitChain = {
1007
- encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1008
- if (message.time !== undefined) {
1009
- Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim();
1010
- }
1011
- if (message.chainId !== "") {
1012
- writer.uint32(18).string(message.chainId);
1013
- }
1014
- if (message.consensusParams !== undefined) {
1015
- ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim();
1016
- }
1017
- for (const v of message.validators) {
1018
- ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim();
1019
- }
1020
- if (message.appStateBytes.length !== 0) {
1021
- writer.uint32(42).bytes(message.appStateBytes);
1022
- }
1023
- if (message.initialHeight !== 0) {
1024
- writer.uint32(48).int64(message.initialHeight);
1025
- }
1026
- return writer;
1027
- },
1028
-
1029
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain {
1030
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1031
- let end = length === undefined ? reader.len : reader.pos + length;
1032
- const message = createBaseRequestInitChain();
1033
- while (reader.pos < end) {
1034
- const tag = reader.uint32();
1035
- switch (tag >>> 3) {
1036
- case 1:
1037
- message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1038
- break;
1039
- case 2:
1040
- message.chainId = reader.string();
1041
- break;
1042
- case 3:
1043
- message.consensusParams = ConsensusParams.decode(reader, reader.uint32());
1044
- break;
1045
- case 4:
1046
- message.validators.push(ValidatorUpdate.decode(reader, reader.uint32()));
1047
- break;
1048
- case 5:
1049
- message.appStateBytes = reader.bytes();
1050
- break;
1051
- case 6:
1052
- message.initialHeight = longToNumber(reader.int64() as Long);
1053
- break;
1054
- default:
1055
- reader.skipType(tag & 7);
1056
- break;
1057
- }
1058
- }
1059
- return message;
1060
- },
1061
-
1062
- fromJSON(object: any): RequestInitChain {
1063
- return {
1064
- time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
1065
- chainId: isSet(object.chainId) ? String(object.chainId) : "",
1066
- consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined,
1067
- validators: Array.isArray(object?.validators)
1068
- ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e))
1069
- : [],
1070
- appStateBytes: isSet(object.appStateBytes) ? bytesFromBase64(object.appStateBytes) : new Uint8Array(),
1071
- initialHeight: isSet(object.initialHeight) ? Number(object.initialHeight) : 0,
1072
- };
1073
- },
1074
-
1075
- toJSON(message: RequestInitChain): unknown {
1076
- const obj: any = {};
1077
- message.time !== undefined && (obj.time = message.time.toISOString());
1078
- message.chainId !== undefined && (obj.chainId = message.chainId);
1079
- message.consensusParams !== undefined
1080
- && (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined);
1081
- if (message.validators) {
1082
- obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined);
1083
- } else {
1084
- obj.validators = [];
1085
- }
1086
- message.appStateBytes !== undefined
1087
- && (obj.appStateBytes = base64FromBytes(
1088
- message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array(),
1089
- ));
1090
- message.initialHeight !== undefined && (obj.initialHeight = Math.round(message.initialHeight));
1091
- return obj;
1092
- },
1093
-
1094
- fromPartial<I extends Exact<DeepPartial<RequestInitChain>, I>>(object: I): RequestInitChain {
1095
- const message = createBaseRequestInitChain();
1096
- message.time = object.time ?? undefined;
1097
- message.chainId = object.chainId ?? "";
1098
- message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null)
1099
- ? ConsensusParams.fromPartial(object.consensusParams)
1100
- : undefined;
1101
- message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [];
1102
- message.appStateBytes = object.appStateBytes ?? new Uint8Array();
1103
- message.initialHeight = object.initialHeight ?? 0;
1104
- return message;
1105
- },
1106
- };
1107
-
1108
- function createBaseRequestQuery(): RequestQuery {
1109
- return { data: new Uint8Array(), path: "", height: 0, prove: false };
1110
- }
1111
-
1112
- export const RequestQuery = {
1113
- encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1114
- if (message.data.length !== 0) {
1115
- writer.uint32(10).bytes(message.data);
1116
- }
1117
- if (message.path !== "") {
1118
- writer.uint32(18).string(message.path);
1119
- }
1120
- if (message.height !== 0) {
1121
- writer.uint32(24).int64(message.height);
1122
- }
1123
- if (message.prove === true) {
1124
- writer.uint32(32).bool(message.prove);
1125
- }
1126
- return writer;
1127
- },
1128
-
1129
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery {
1130
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1131
- let end = length === undefined ? reader.len : reader.pos + length;
1132
- const message = createBaseRequestQuery();
1133
- while (reader.pos < end) {
1134
- const tag = reader.uint32();
1135
- switch (tag >>> 3) {
1136
- case 1:
1137
- message.data = reader.bytes();
1138
- break;
1139
- case 2:
1140
- message.path = reader.string();
1141
- break;
1142
- case 3:
1143
- message.height = longToNumber(reader.int64() as Long);
1144
- break;
1145
- case 4:
1146
- message.prove = reader.bool();
1147
- break;
1148
- default:
1149
- reader.skipType(tag & 7);
1150
- break;
1151
- }
1152
- }
1153
- return message;
1154
- },
1155
-
1156
- fromJSON(object: any): RequestQuery {
1157
- return {
1158
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
1159
- path: isSet(object.path) ? String(object.path) : "",
1160
- height: isSet(object.height) ? Number(object.height) : 0,
1161
- prove: isSet(object.prove) ? Boolean(object.prove) : false,
1162
- };
1163
- },
1164
-
1165
- toJSON(message: RequestQuery): unknown {
1166
- const obj: any = {};
1167
- message.data !== undefined
1168
- && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
1169
- message.path !== undefined && (obj.path = message.path);
1170
- message.height !== undefined && (obj.height = Math.round(message.height));
1171
- message.prove !== undefined && (obj.prove = message.prove);
1172
- return obj;
1173
- },
1174
-
1175
- fromPartial<I extends Exact<DeepPartial<RequestQuery>, I>>(object: I): RequestQuery {
1176
- const message = createBaseRequestQuery();
1177
- message.data = object.data ?? new Uint8Array();
1178
- message.path = object.path ?? "";
1179
- message.height = object.height ?? 0;
1180
- message.prove = object.prove ?? false;
1181
- return message;
1182
- },
1183
- };
1184
-
1185
- function createBaseRequestBeginBlock(): RequestBeginBlock {
1186
- return { hash: new Uint8Array(), header: undefined, lastCommitInfo: undefined, byzantineValidators: [] };
1187
- }
1188
-
1189
- export const RequestBeginBlock = {
1190
- encode(message: RequestBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1191
- if (message.hash.length !== 0) {
1192
- writer.uint32(10).bytes(message.hash);
1193
- }
1194
- if (message.header !== undefined) {
1195
- Header.encode(message.header, writer.uint32(18).fork()).ldelim();
1196
- }
1197
- if (message.lastCommitInfo !== undefined) {
1198
- LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim();
1199
- }
1200
- for (const v of message.byzantineValidators) {
1201
- Evidence.encode(v!, writer.uint32(34).fork()).ldelim();
1202
- }
1203
- return writer;
1204
- },
1205
-
1206
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestBeginBlock {
1207
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1208
- let end = length === undefined ? reader.len : reader.pos + length;
1209
- const message = createBaseRequestBeginBlock();
1210
- while (reader.pos < end) {
1211
- const tag = reader.uint32();
1212
- switch (tag >>> 3) {
1213
- case 1:
1214
- message.hash = reader.bytes();
1215
- break;
1216
- case 2:
1217
- message.header = Header.decode(reader, reader.uint32());
1218
- break;
1219
- case 3:
1220
- message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32());
1221
- break;
1222
- case 4:
1223
- message.byzantineValidators.push(Evidence.decode(reader, reader.uint32()));
1224
- break;
1225
- default:
1226
- reader.skipType(tag & 7);
1227
- break;
1228
- }
1229
- }
1230
- return message;
1231
- },
1232
-
1233
- fromJSON(object: any): RequestBeginBlock {
1234
- return {
1235
- hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(),
1236
- header: isSet(object.header) ? Header.fromJSON(object.header) : undefined,
1237
- lastCommitInfo: isSet(object.lastCommitInfo) ? LastCommitInfo.fromJSON(object.lastCommitInfo) : undefined,
1238
- byzantineValidators: Array.isArray(object?.byzantineValidators)
1239
- ? object.byzantineValidators.map((e: any) => Evidence.fromJSON(e))
1240
- : [],
1241
- };
1242
- },
1243
-
1244
- toJSON(message: RequestBeginBlock): unknown {
1245
- const obj: any = {};
1246
- message.hash !== undefined
1247
- && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
1248
- message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined);
1249
- message.lastCommitInfo !== undefined
1250
- && (obj.lastCommitInfo = message.lastCommitInfo ? LastCommitInfo.toJSON(message.lastCommitInfo) : undefined);
1251
- if (message.byzantineValidators) {
1252
- obj.byzantineValidators = message.byzantineValidators.map((e) => e ? Evidence.toJSON(e) : undefined);
1253
- } else {
1254
- obj.byzantineValidators = [];
1255
- }
1256
- return obj;
1257
- },
1258
-
1259
- fromPartial<I extends Exact<DeepPartial<RequestBeginBlock>, I>>(object: I): RequestBeginBlock {
1260
- const message = createBaseRequestBeginBlock();
1261
- message.hash = object.hash ?? new Uint8Array();
1262
- message.header = (object.header !== undefined && object.header !== null)
1263
- ? Header.fromPartial(object.header)
1264
- : undefined;
1265
- message.lastCommitInfo = (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null)
1266
- ? LastCommitInfo.fromPartial(object.lastCommitInfo)
1267
- : undefined;
1268
- message.byzantineValidators = object.byzantineValidators?.map((e) => Evidence.fromPartial(e)) || [];
1269
- return message;
1270
- },
1271
- };
1272
-
1273
- function createBaseRequestCheckTx(): RequestCheckTx {
1274
- return { tx: new Uint8Array(), type: 0 };
1275
- }
1276
-
1277
- export const RequestCheckTx = {
1278
- encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1279
- if (message.tx.length !== 0) {
1280
- writer.uint32(10).bytes(message.tx);
1281
- }
1282
- if (message.type !== 0) {
1283
- writer.uint32(16).int32(message.type);
1284
- }
1285
- return writer;
1286
- },
1287
-
1288
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx {
1289
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1290
- let end = length === undefined ? reader.len : reader.pos + length;
1291
- const message = createBaseRequestCheckTx();
1292
- while (reader.pos < end) {
1293
- const tag = reader.uint32();
1294
- switch (tag >>> 3) {
1295
- case 1:
1296
- message.tx = reader.bytes();
1297
- break;
1298
- case 2:
1299
- message.type = reader.int32() as any;
1300
- break;
1301
- default:
1302
- reader.skipType(tag & 7);
1303
- break;
1304
- }
1305
- }
1306
- return message;
1307
- },
1308
-
1309
- fromJSON(object: any): RequestCheckTx {
1310
- return {
1311
- tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(),
1312
- type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0,
1313
- };
1314
- },
1315
-
1316
- toJSON(message: RequestCheckTx): unknown {
1317
- const obj: any = {};
1318
- message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array()));
1319
- message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type));
1320
- return obj;
1321
- },
1322
-
1323
- fromPartial<I extends Exact<DeepPartial<RequestCheckTx>, I>>(object: I): RequestCheckTx {
1324
- const message = createBaseRequestCheckTx();
1325
- message.tx = object.tx ?? new Uint8Array();
1326
- message.type = object.type ?? 0;
1327
- return message;
1328
- },
1329
- };
1330
-
1331
- function createBaseRequestDeliverTx(): RequestDeliverTx {
1332
- return { tx: new Uint8Array() };
1333
- }
1334
-
1335
- export const RequestDeliverTx = {
1336
- encode(message: RequestDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1337
- if (message.tx.length !== 0) {
1338
- writer.uint32(10).bytes(message.tx);
1339
- }
1340
- return writer;
1341
- },
1342
-
1343
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestDeliverTx {
1344
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1345
- let end = length === undefined ? reader.len : reader.pos + length;
1346
- const message = createBaseRequestDeliverTx();
1347
- while (reader.pos < end) {
1348
- const tag = reader.uint32();
1349
- switch (tag >>> 3) {
1350
- case 1:
1351
- message.tx = reader.bytes();
1352
- break;
1353
- default:
1354
- reader.skipType(tag & 7);
1355
- break;
1356
- }
1357
- }
1358
- return message;
1359
- },
1360
-
1361
- fromJSON(object: any): RequestDeliverTx {
1362
- return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array() };
1363
- },
1364
-
1365
- toJSON(message: RequestDeliverTx): unknown {
1366
- const obj: any = {};
1367
- message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array()));
1368
- return obj;
1369
- },
1370
-
1371
- fromPartial<I extends Exact<DeepPartial<RequestDeliverTx>, I>>(object: I): RequestDeliverTx {
1372
- const message = createBaseRequestDeliverTx();
1373
- message.tx = object.tx ?? new Uint8Array();
1374
- return message;
1375
- },
1376
- };
1377
-
1378
- function createBaseRequestEndBlock(): RequestEndBlock {
1379
- return { height: 0 };
1380
- }
1381
-
1382
- export const RequestEndBlock = {
1383
- encode(message: RequestEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1384
- if (message.height !== 0) {
1385
- writer.uint32(8).int64(message.height);
1386
- }
1387
- return writer;
1388
- },
1389
-
1390
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestEndBlock {
1391
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1392
- let end = length === undefined ? reader.len : reader.pos + length;
1393
- const message = createBaseRequestEndBlock();
1394
- while (reader.pos < end) {
1395
- const tag = reader.uint32();
1396
- switch (tag >>> 3) {
1397
- case 1:
1398
- message.height = longToNumber(reader.int64() as Long);
1399
- break;
1400
- default:
1401
- reader.skipType(tag & 7);
1402
- break;
1403
- }
1404
- }
1405
- return message;
1406
- },
1407
-
1408
- fromJSON(object: any): RequestEndBlock {
1409
- return { height: isSet(object.height) ? Number(object.height) : 0 };
1410
- },
1411
-
1412
- toJSON(message: RequestEndBlock): unknown {
1413
- const obj: any = {};
1414
- message.height !== undefined && (obj.height = Math.round(message.height));
1415
- return obj;
1416
- },
1417
-
1418
- fromPartial<I extends Exact<DeepPartial<RequestEndBlock>, I>>(object: I): RequestEndBlock {
1419
- const message = createBaseRequestEndBlock();
1420
- message.height = object.height ?? 0;
1421
- return message;
1422
- },
1423
- };
1424
-
1425
- function createBaseRequestCommit(): RequestCommit {
1426
- return {};
1427
- }
1428
-
1429
- export const RequestCommit = {
1430
- encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1431
- return writer;
1432
- },
1433
-
1434
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit {
1435
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1436
- let end = length === undefined ? reader.len : reader.pos + length;
1437
- const message = createBaseRequestCommit();
1438
- while (reader.pos < end) {
1439
- const tag = reader.uint32();
1440
- switch (tag >>> 3) {
1441
- default:
1442
- reader.skipType(tag & 7);
1443
- break;
1444
- }
1445
- }
1446
- return message;
1447
- },
1448
-
1449
- fromJSON(_: any): RequestCommit {
1450
- return {};
1451
- },
1452
-
1453
- toJSON(_: RequestCommit): unknown {
1454
- const obj: any = {};
1455
- return obj;
1456
- },
1457
-
1458
- fromPartial<I extends Exact<DeepPartial<RequestCommit>, I>>(_: I): RequestCommit {
1459
- const message = createBaseRequestCommit();
1460
- return message;
1461
- },
1462
- };
1463
-
1464
- function createBaseRequestListSnapshots(): RequestListSnapshots {
1465
- return {};
1466
- }
1467
-
1468
- export const RequestListSnapshots = {
1469
- encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1470
- return writer;
1471
- },
1472
-
1473
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots {
1474
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1475
- let end = length === undefined ? reader.len : reader.pos + length;
1476
- const message = createBaseRequestListSnapshots();
1477
- while (reader.pos < end) {
1478
- const tag = reader.uint32();
1479
- switch (tag >>> 3) {
1480
- default:
1481
- reader.skipType(tag & 7);
1482
- break;
1483
- }
1484
- }
1485
- return message;
1486
- },
1487
-
1488
- fromJSON(_: any): RequestListSnapshots {
1489
- return {};
1490
- },
1491
-
1492
- toJSON(_: RequestListSnapshots): unknown {
1493
- const obj: any = {};
1494
- return obj;
1495
- },
1496
-
1497
- fromPartial<I extends Exact<DeepPartial<RequestListSnapshots>, I>>(_: I): RequestListSnapshots {
1498
- const message = createBaseRequestListSnapshots();
1499
- return message;
1500
- },
1501
- };
1502
-
1503
- function createBaseRequestOfferSnapshot(): RequestOfferSnapshot {
1504
- return { snapshot: undefined, appHash: new Uint8Array() };
1505
- }
1506
-
1507
- export const RequestOfferSnapshot = {
1508
- encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1509
- if (message.snapshot !== undefined) {
1510
- Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim();
1511
- }
1512
- if (message.appHash.length !== 0) {
1513
- writer.uint32(18).bytes(message.appHash);
1514
- }
1515
- return writer;
1516
- },
1517
-
1518
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot {
1519
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1520
- let end = length === undefined ? reader.len : reader.pos + length;
1521
- const message = createBaseRequestOfferSnapshot();
1522
- while (reader.pos < end) {
1523
- const tag = reader.uint32();
1524
- switch (tag >>> 3) {
1525
- case 1:
1526
- message.snapshot = Snapshot.decode(reader, reader.uint32());
1527
- break;
1528
- case 2:
1529
- message.appHash = reader.bytes();
1530
- break;
1531
- default:
1532
- reader.skipType(tag & 7);
1533
- break;
1534
- }
1535
- }
1536
- return message;
1537
- },
1538
-
1539
- fromJSON(object: any): RequestOfferSnapshot {
1540
- return {
1541
- snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined,
1542
- appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(),
1543
- };
1544
- },
1545
-
1546
- toJSON(message: RequestOfferSnapshot): unknown {
1547
- const obj: any = {};
1548
- message.snapshot !== undefined && (obj.snapshot = message.snapshot ? Snapshot.toJSON(message.snapshot) : undefined);
1549
- message.appHash !== undefined
1550
- && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array()));
1551
- return obj;
1552
- },
1553
-
1554
- fromPartial<I extends Exact<DeepPartial<RequestOfferSnapshot>, I>>(object: I): RequestOfferSnapshot {
1555
- const message = createBaseRequestOfferSnapshot();
1556
- message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
1557
- ? Snapshot.fromPartial(object.snapshot)
1558
- : undefined;
1559
- message.appHash = object.appHash ?? new Uint8Array();
1560
- return message;
1561
- },
1562
- };
1563
-
1564
- function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk {
1565
- return { height: 0, format: 0, chunk: 0 };
1566
- }
1567
-
1568
- export const RequestLoadSnapshotChunk = {
1569
- encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1570
- if (message.height !== 0) {
1571
- writer.uint32(8).uint64(message.height);
1572
- }
1573
- if (message.format !== 0) {
1574
- writer.uint32(16).uint32(message.format);
1575
- }
1576
- if (message.chunk !== 0) {
1577
- writer.uint32(24).uint32(message.chunk);
1578
- }
1579
- return writer;
1580
- },
1581
-
1582
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk {
1583
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1584
- let end = length === undefined ? reader.len : reader.pos + length;
1585
- const message = createBaseRequestLoadSnapshotChunk();
1586
- while (reader.pos < end) {
1587
- const tag = reader.uint32();
1588
- switch (tag >>> 3) {
1589
- case 1:
1590
- message.height = longToNumber(reader.uint64() as Long);
1591
- break;
1592
- case 2:
1593
- message.format = reader.uint32();
1594
- break;
1595
- case 3:
1596
- message.chunk = reader.uint32();
1597
- break;
1598
- default:
1599
- reader.skipType(tag & 7);
1600
- break;
1601
- }
1602
- }
1603
- return message;
1604
- },
1605
-
1606
- fromJSON(object: any): RequestLoadSnapshotChunk {
1607
- return {
1608
- height: isSet(object.height) ? Number(object.height) : 0,
1609
- format: isSet(object.format) ? Number(object.format) : 0,
1610
- chunk: isSet(object.chunk) ? Number(object.chunk) : 0,
1611
- };
1612
- },
1613
-
1614
- toJSON(message: RequestLoadSnapshotChunk): unknown {
1615
- const obj: any = {};
1616
- message.height !== undefined && (obj.height = Math.round(message.height));
1617
- message.format !== undefined && (obj.format = Math.round(message.format));
1618
- message.chunk !== undefined && (obj.chunk = Math.round(message.chunk));
1619
- return obj;
1620
- },
1621
-
1622
- fromPartial<I extends Exact<DeepPartial<RequestLoadSnapshotChunk>, I>>(object: I): RequestLoadSnapshotChunk {
1623
- const message = createBaseRequestLoadSnapshotChunk();
1624
- message.height = object.height ?? 0;
1625
- message.format = object.format ?? 0;
1626
- message.chunk = object.chunk ?? 0;
1627
- return message;
1628
- },
1629
- };
1630
-
1631
- function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk {
1632
- return { index: 0, chunk: new Uint8Array(), sender: "" };
1633
- }
1634
-
1635
- export const RequestApplySnapshotChunk = {
1636
- encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1637
- if (message.index !== 0) {
1638
- writer.uint32(8).uint32(message.index);
1639
- }
1640
- if (message.chunk.length !== 0) {
1641
- writer.uint32(18).bytes(message.chunk);
1642
- }
1643
- if (message.sender !== "") {
1644
- writer.uint32(26).string(message.sender);
1645
- }
1646
- return writer;
1647
- },
1648
-
1649
- decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk {
1650
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1651
- let end = length === undefined ? reader.len : reader.pos + length;
1652
- const message = createBaseRequestApplySnapshotChunk();
1653
- while (reader.pos < end) {
1654
- const tag = reader.uint32();
1655
- switch (tag >>> 3) {
1656
- case 1:
1657
- message.index = reader.uint32();
1658
- break;
1659
- case 2:
1660
- message.chunk = reader.bytes();
1661
- break;
1662
- case 3:
1663
- message.sender = reader.string();
1664
- break;
1665
- default:
1666
- reader.skipType(tag & 7);
1667
- break;
1668
- }
1669
- }
1670
- return message;
1671
- },
1672
-
1673
- fromJSON(object: any): RequestApplySnapshotChunk {
1674
- return {
1675
- index: isSet(object.index) ? Number(object.index) : 0,
1676
- chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array(),
1677
- sender: isSet(object.sender) ? String(object.sender) : "",
1678
- };
1679
- },
1680
-
1681
- toJSON(message: RequestApplySnapshotChunk): unknown {
1682
- const obj: any = {};
1683
- message.index !== undefined && (obj.index = Math.round(message.index));
1684
- message.chunk !== undefined
1685
- && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array()));
1686
- message.sender !== undefined && (obj.sender = message.sender);
1687
- return obj;
1688
- },
1689
-
1690
- fromPartial<I extends Exact<DeepPartial<RequestApplySnapshotChunk>, I>>(object: I): RequestApplySnapshotChunk {
1691
- const message = createBaseRequestApplySnapshotChunk();
1692
- message.index = object.index ?? 0;
1693
- message.chunk = object.chunk ?? new Uint8Array();
1694
- message.sender = object.sender ?? "";
1695
- return message;
1696
- },
1697
- };
1698
-
1699
- function createBaseResponse(): Response {
1700
- return {
1701
- exception: undefined,
1702
- echo: undefined,
1703
- flush: undefined,
1704
- info: undefined,
1705
- setOption: undefined,
1706
- initChain: undefined,
1707
- query: undefined,
1708
- beginBlock: undefined,
1709
- checkTx: undefined,
1710
- deliverTx: undefined,
1711
- endBlock: undefined,
1712
- commit: undefined,
1713
- listSnapshots: undefined,
1714
- offerSnapshot: undefined,
1715
- loadSnapshotChunk: undefined,
1716
- applySnapshotChunk: undefined,
1717
- };
1718
- }
1719
-
1720
- export const Response = {
1721
- encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1722
- if (message.exception !== undefined) {
1723
- ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim();
1724
- }
1725
- if (message.echo !== undefined) {
1726
- ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim();
1727
- }
1728
- if (message.flush !== undefined) {
1729
- ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim();
1730
- }
1731
- if (message.info !== undefined) {
1732
- ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim();
1733
- }
1734
- if (message.setOption !== undefined) {
1735
- ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim();
1736
- }
1737
- if (message.initChain !== undefined) {
1738
- ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim();
1739
- }
1740
- if (message.query !== undefined) {
1741
- ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim();
1742
- }
1743
- if (message.beginBlock !== undefined) {
1744
- ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim();
1745
- }
1746
- if (message.checkTx !== undefined) {
1747
- ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim();
1748
- }
1749
- if (message.deliverTx !== undefined) {
1750
- ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim();
1751
- }
1752
- if (message.endBlock !== undefined) {
1753
- ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim();
1754
- }
1755
- if (message.commit !== undefined) {
1756
- ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim();
1757
- }
1758
- if (message.listSnapshots !== undefined) {
1759
- ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim();
1760
- }
1761
- if (message.offerSnapshot !== undefined) {
1762
- ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim();
1763
- }
1764
- if (message.loadSnapshotChunk !== undefined) {
1765
- ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim();
1766
- }
1767
- if (message.applySnapshotChunk !== undefined) {
1768
- ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim();
1769
- }
1770
- return writer;
1771
- },
1772
-
1773
- decode(input: _m0.Reader | Uint8Array, length?: number): Response {
1774
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1775
- let end = length === undefined ? reader.len : reader.pos + length;
1776
- const message = createBaseResponse();
1777
- while (reader.pos < end) {
1778
- const tag = reader.uint32();
1779
- switch (tag >>> 3) {
1780
- case 1:
1781
- message.exception = ResponseException.decode(reader, reader.uint32());
1782
- break;
1783
- case 2:
1784
- message.echo = ResponseEcho.decode(reader, reader.uint32());
1785
- break;
1786
- case 3:
1787
- message.flush = ResponseFlush.decode(reader, reader.uint32());
1788
- break;
1789
- case 4:
1790
- message.info = ResponseInfo.decode(reader, reader.uint32());
1791
- break;
1792
- case 5:
1793
- message.setOption = ResponseSetOption.decode(reader, reader.uint32());
1794
- break;
1795
- case 6:
1796
- message.initChain = ResponseInitChain.decode(reader, reader.uint32());
1797
- break;
1798
- case 7:
1799
- message.query = ResponseQuery.decode(reader, reader.uint32());
1800
- break;
1801
- case 8:
1802
- message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32());
1803
- break;
1804
- case 9:
1805
- message.checkTx = ResponseCheckTx.decode(reader, reader.uint32());
1806
- break;
1807
- case 10:
1808
- message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32());
1809
- break;
1810
- case 11:
1811
- message.endBlock = ResponseEndBlock.decode(reader, reader.uint32());
1812
- break;
1813
- case 12:
1814
- message.commit = ResponseCommit.decode(reader, reader.uint32());
1815
- break;
1816
- case 13:
1817
- message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32());
1818
- break;
1819
- case 14:
1820
- message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32());
1821
- break;
1822
- case 15:
1823
- message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32());
1824
- break;
1825
- case 16:
1826
- message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32());
1827
- break;
1828
- default:
1829
- reader.skipType(tag & 7);
1830
- break;
1831
- }
1832
- }
1833
- return message;
1834
- },
1835
-
1836
- fromJSON(object: any): Response {
1837
- return {
1838
- exception: isSet(object.exception) ? ResponseException.fromJSON(object.exception) : undefined,
1839
- echo: isSet(object.echo) ? ResponseEcho.fromJSON(object.echo) : undefined,
1840
- flush: isSet(object.flush) ? ResponseFlush.fromJSON(object.flush) : undefined,
1841
- info: isSet(object.info) ? ResponseInfo.fromJSON(object.info) : undefined,
1842
- setOption: isSet(object.setOption) ? ResponseSetOption.fromJSON(object.setOption) : undefined,
1843
- initChain: isSet(object.initChain) ? ResponseInitChain.fromJSON(object.initChain) : undefined,
1844
- query: isSet(object.query) ? ResponseQuery.fromJSON(object.query) : undefined,
1845
- beginBlock: isSet(object.beginBlock) ? ResponseBeginBlock.fromJSON(object.beginBlock) : undefined,
1846
- checkTx: isSet(object.checkTx) ? ResponseCheckTx.fromJSON(object.checkTx) : undefined,
1847
- deliverTx: isSet(object.deliverTx) ? ResponseDeliverTx.fromJSON(object.deliverTx) : undefined,
1848
- endBlock: isSet(object.endBlock) ? ResponseEndBlock.fromJSON(object.endBlock) : undefined,
1849
- commit: isSet(object.commit) ? ResponseCommit.fromJSON(object.commit) : undefined,
1850
- listSnapshots: isSet(object.listSnapshots) ? ResponseListSnapshots.fromJSON(object.listSnapshots) : undefined,
1851
- offerSnapshot: isSet(object.offerSnapshot) ? ResponseOfferSnapshot.fromJSON(object.offerSnapshot) : undefined,
1852
- loadSnapshotChunk: isSet(object.loadSnapshotChunk)
1853
- ? ResponseLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk)
1854
- : undefined,
1855
- applySnapshotChunk: isSet(object.applySnapshotChunk)
1856
- ? ResponseApplySnapshotChunk.fromJSON(object.applySnapshotChunk)
1857
- : undefined,
1858
- };
1859
- },
1860
-
1861
- toJSON(message: Response): unknown {
1862
- const obj: any = {};
1863
- message.exception !== undefined
1864
- && (obj.exception = message.exception ? ResponseException.toJSON(message.exception) : undefined);
1865
- message.echo !== undefined && (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined);
1866
- message.flush !== undefined && (obj.flush = message.flush ? ResponseFlush.toJSON(message.flush) : undefined);
1867
- message.info !== undefined && (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined);
1868
- message.setOption !== undefined
1869
- && (obj.setOption = message.setOption ? ResponseSetOption.toJSON(message.setOption) : undefined);
1870
- message.initChain !== undefined
1871
- && (obj.initChain = message.initChain ? ResponseInitChain.toJSON(message.initChain) : undefined);
1872
- message.query !== undefined && (obj.query = message.query ? ResponseQuery.toJSON(message.query) : undefined);
1873
- message.beginBlock !== undefined
1874
- && (obj.beginBlock = message.beginBlock ? ResponseBeginBlock.toJSON(message.beginBlock) : undefined);
1875
- message.checkTx !== undefined
1876
- && (obj.checkTx = message.checkTx ? ResponseCheckTx.toJSON(message.checkTx) : undefined);
1877
- message.deliverTx !== undefined
1878
- && (obj.deliverTx = message.deliverTx ? ResponseDeliverTx.toJSON(message.deliverTx) : undefined);
1879
- message.endBlock !== undefined
1880
- && (obj.endBlock = message.endBlock ? ResponseEndBlock.toJSON(message.endBlock) : undefined);
1881
- message.commit !== undefined && (obj.commit = message.commit ? ResponseCommit.toJSON(message.commit) : undefined);
1882
- message.listSnapshots !== undefined
1883
- && (obj.listSnapshots = message.listSnapshots ? ResponseListSnapshots.toJSON(message.listSnapshots) : undefined);
1884
- message.offerSnapshot !== undefined
1885
- && (obj.offerSnapshot = message.offerSnapshot ? ResponseOfferSnapshot.toJSON(message.offerSnapshot) : undefined);
1886
- message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk
1887
- ? ResponseLoadSnapshotChunk.toJSON(message.loadSnapshotChunk)
1888
- : undefined);
1889
- message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk
1890
- ? ResponseApplySnapshotChunk.toJSON(message.applySnapshotChunk)
1891
- : undefined);
1892
- return obj;
1893
- },
1894
-
1895
- fromPartial<I extends Exact<DeepPartial<Response>, I>>(object: I): Response {
1896
- const message = createBaseResponse();
1897
- message.exception = (object.exception !== undefined && object.exception !== null)
1898
- ? ResponseException.fromPartial(object.exception)
1899
- : undefined;
1900
- message.echo = (object.echo !== undefined && object.echo !== null)
1901
- ? ResponseEcho.fromPartial(object.echo)
1902
- : undefined;
1903
- message.flush = (object.flush !== undefined && object.flush !== null)
1904
- ? ResponseFlush.fromPartial(object.flush)
1905
- : undefined;
1906
- message.info = (object.info !== undefined && object.info !== null)
1907
- ? ResponseInfo.fromPartial(object.info)
1908
- : undefined;
1909
- message.setOption = (object.setOption !== undefined && object.setOption !== null)
1910
- ? ResponseSetOption.fromPartial(object.setOption)
1911
- : undefined;
1912
- message.initChain = (object.initChain !== undefined && object.initChain !== null)
1913
- ? ResponseInitChain.fromPartial(object.initChain)
1914
- : undefined;
1915
- message.query = (object.query !== undefined && object.query !== null)
1916
- ? ResponseQuery.fromPartial(object.query)
1917
- : undefined;
1918
- message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null)
1919
- ? ResponseBeginBlock.fromPartial(object.beginBlock)
1920
- : undefined;
1921
- message.checkTx = (object.checkTx !== undefined && object.checkTx !== null)
1922
- ? ResponseCheckTx.fromPartial(object.checkTx)
1923
- : undefined;
1924
- message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null)
1925
- ? ResponseDeliverTx.fromPartial(object.deliverTx)
1926
- : undefined;
1927
- message.endBlock = (object.endBlock !== undefined && object.endBlock !== null)
1928
- ? ResponseEndBlock.fromPartial(object.endBlock)
1929
- : undefined;
1930
- message.commit = (object.commit !== undefined && object.commit !== null)
1931
- ? ResponseCommit.fromPartial(object.commit)
1932
- : undefined;
1933
- message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null)
1934
- ? ResponseListSnapshots.fromPartial(object.listSnapshots)
1935
- : undefined;
1936
- message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null)
1937
- ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot)
1938
- : undefined;
1939
- message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null)
1940
- ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk)
1941
- : undefined;
1942
- message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null)
1943
- ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk)
1944
- : undefined;
1945
- return message;
1946
- },
1947
- };
1948
-
1949
- function createBaseResponseException(): ResponseException {
1950
- return { error: "" };
1951
- }
1952
-
1953
- export const ResponseException = {
1954
- encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1955
- if (message.error !== "") {
1956
- writer.uint32(10).string(message.error);
1957
- }
1958
- return writer;
1959
- },
1960
-
1961
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException {
1962
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1963
- let end = length === undefined ? reader.len : reader.pos + length;
1964
- const message = createBaseResponseException();
1965
- while (reader.pos < end) {
1966
- const tag = reader.uint32();
1967
- switch (tag >>> 3) {
1968
- case 1:
1969
- message.error = reader.string();
1970
- break;
1971
- default:
1972
- reader.skipType(tag & 7);
1973
- break;
1974
- }
1975
- }
1976
- return message;
1977
- },
1978
-
1979
- fromJSON(object: any): ResponseException {
1980
- return { error: isSet(object.error) ? String(object.error) : "" };
1981
- },
1982
-
1983
- toJSON(message: ResponseException): unknown {
1984
- const obj: any = {};
1985
- message.error !== undefined && (obj.error = message.error);
1986
- return obj;
1987
- },
1988
-
1989
- fromPartial<I extends Exact<DeepPartial<ResponseException>, I>>(object: I): ResponseException {
1990
- const message = createBaseResponseException();
1991
- message.error = object.error ?? "";
1992
- return message;
1993
- },
1994
- };
1995
-
1996
- function createBaseResponseEcho(): ResponseEcho {
1997
- return { message: "" };
1998
- }
1999
-
2000
- export const ResponseEcho = {
2001
- encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2002
- if (message.message !== "") {
2003
- writer.uint32(10).string(message.message);
2004
- }
2005
- return writer;
2006
- },
2007
-
2008
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho {
2009
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2010
- let end = length === undefined ? reader.len : reader.pos + length;
2011
- const message = createBaseResponseEcho();
2012
- while (reader.pos < end) {
2013
- const tag = reader.uint32();
2014
- switch (tag >>> 3) {
2015
- case 1:
2016
- message.message = reader.string();
2017
- break;
2018
- default:
2019
- reader.skipType(tag & 7);
2020
- break;
2021
- }
2022
- }
2023
- return message;
2024
- },
2025
-
2026
- fromJSON(object: any): ResponseEcho {
2027
- return { message: isSet(object.message) ? String(object.message) : "" };
2028
- },
2029
-
2030
- toJSON(message: ResponseEcho): unknown {
2031
- const obj: any = {};
2032
- message.message !== undefined && (obj.message = message.message);
2033
- return obj;
2034
- },
2035
-
2036
- fromPartial<I extends Exact<DeepPartial<ResponseEcho>, I>>(object: I): ResponseEcho {
2037
- const message = createBaseResponseEcho();
2038
- message.message = object.message ?? "";
2039
- return message;
2040
- },
2041
- };
2042
-
2043
- function createBaseResponseFlush(): ResponseFlush {
2044
- return {};
2045
- }
2046
-
2047
- export const ResponseFlush = {
2048
- encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2049
- return writer;
2050
- },
2051
-
2052
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush {
2053
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2054
- let end = length === undefined ? reader.len : reader.pos + length;
2055
- const message = createBaseResponseFlush();
2056
- while (reader.pos < end) {
2057
- const tag = reader.uint32();
2058
- switch (tag >>> 3) {
2059
- default:
2060
- reader.skipType(tag & 7);
2061
- break;
2062
- }
2063
- }
2064
- return message;
2065
- },
2066
-
2067
- fromJSON(_: any): ResponseFlush {
2068
- return {};
2069
- },
2070
-
2071
- toJSON(_: ResponseFlush): unknown {
2072
- const obj: any = {};
2073
- return obj;
2074
- },
2075
-
2076
- fromPartial<I extends Exact<DeepPartial<ResponseFlush>, I>>(_: I): ResponseFlush {
2077
- const message = createBaseResponseFlush();
2078
- return message;
2079
- },
2080
- };
2081
-
2082
- function createBaseResponseInfo(): ResponseInfo {
2083
- return { data: "", version: "", appVersion: 0, lastBlockHeight: 0, lastBlockAppHash: new Uint8Array() };
2084
- }
2085
-
2086
- export const ResponseInfo = {
2087
- encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2088
- if (message.data !== "") {
2089
- writer.uint32(10).string(message.data);
2090
- }
2091
- if (message.version !== "") {
2092
- writer.uint32(18).string(message.version);
2093
- }
2094
- if (message.appVersion !== 0) {
2095
- writer.uint32(24).uint64(message.appVersion);
2096
- }
2097
- if (message.lastBlockHeight !== 0) {
2098
- writer.uint32(32).int64(message.lastBlockHeight);
2099
- }
2100
- if (message.lastBlockAppHash.length !== 0) {
2101
- writer.uint32(42).bytes(message.lastBlockAppHash);
2102
- }
2103
- return writer;
2104
- },
2105
-
2106
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo {
2107
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2108
- let end = length === undefined ? reader.len : reader.pos + length;
2109
- const message = createBaseResponseInfo();
2110
- while (reader.pos < end) {
2111
- const tag = reader.uint32();
2112
- switch (tag >>> 3) {
2113
- case 1:
2114
- message.data = reader.string();
2115
- break;
2116
- case 2:
2117
- message.version = reader.string();
2118
- break;
2119
- case 3:
2120
- message.appVersion = longToNumber(reader.uint64() as Long);
2121
- break;
2122
- case 4:
2123
- message.lastBlockHeight = longToNumber(reader.int64() as Long);
2124
- break;
2125
- case 5:
2126
- message.lastBlockAppHash = reader.bytes();
2127
- break;
2128
- default:
2129
- reader.skipType(tag & 7);
2130
- break;
2131
- }
2132
- }
2133
- return message;
2134
- },
2135
-
2136
- fromJSON(object: any): ResponseInfo {
2137
- return {
2138
- data: isSet(object.data) ? String(object.data) : "",
2139
- version: isSet(object.version) ? String(object.version) : "",
2140
- appVersion: isSet(object.appVersion) ? Number(object.appVersion) : 0,
2141
- lastBlockHeight: isSet(object.lastBlockHeight) ? Number(object.lastBlockHeight) : 0,
2142
- lastBlockAppHash: isSet(object.lastBlockAppHash) ? bytesFromBase64(object.lastBlockAppHash) : new Uint8Array(),
2143
- };
2144
- },
2145
-
2146
- toJSON(message: ResponseInfo): unknown {
2147
- const obj: any = {};
2148
- message.data !== undefined && (obj.data = message.data);
2149
- message.version !== undefined && (obj.version = message.version);
2150
- message.appVersion !== undefined && (obj.appVersion = Math.round(message.appVersion));
2151
- message.lastBlockHeight !== undefined && (obj.lastBlockHeight = Math.round(message.lastBlockHeight));
2152
- message.lastBlockAppHash !== undefined
2153
- && (obj.lastBlockAppHash = base64FromBytes(
2154
- message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array(),
2155
- ));
2156
- return obj;
2157
- },
2158
-
2159
- fromPartial<I extends Exact<DeepPartial<ResponseInfo>, I>>(object: I): ResponseInfo {
2160
- const message = createBaseResponseInfo();
2161
- message.data = object.data ?? "";
2162
- message.version = object.version ?? "";
2163
- message.appVersion = object.appVersion ?? 0;
2164
- message.lastBlockHeight = object.lastBlockHeight ?? 0;
2165
- message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array();
2166
- return message;
2167
- },
2168
- };
2169
-
2170
- function createBaseResponseSetOption(): ResponseSetOption {
2171
- return { code: 0, log: "", info: "" };
2172
- }
2173
-
2174
- export const ResponseSetOption = {
2175
- encode(message: ResponseSetOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2176
- if (message.code !== 0) {
2177
- writer.uint32(8).uint32(message.code);
2178
- }
2179
- if (message.log !== "") {
2180
- writer.uint32(26).string(message.log);
2181
- }
2182
- if (message.info !== "") {
2183
- writer.uint32(34).string(message.info);
2184
- }
2185
- return writer;
2186
- },
2187
-
2188
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseSetOption {
2189
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2190
- let end = length === undefined ? reader.len : reader.pos + length;
2191
- const message = createBaseResponseSetOption();
2192
- while (reader.pos < end) {
2193
- const tag = reader.uint32();
2194
- switch (tag >>> 3) {
2195
- case 1:
2196
- message.code = reader.uint32();
2197
- break;
2198
- case 3:
2199
- message.log = reader.string();
2200
- break;
2201
- case 4:
2202
- message.info = reader.string();
2203
- break;
2204
- default:
2205
- reader.skipType(tag & 7);
2206
- break;
2207
- }
2208
- }
2209
- return message;
2210
- },
2211
-
2212
- fromJSON(object: any): ResponseSetOption {
2213
- return {
2214
- code: isSet(object.code) ? Number(object.code) : 0,
2215
- log: isSet(object.log) ? String(object.log) : "",
2216
- info: isSet(object.info) ? String(object.info) : "",
2217
- };
2218
- },
2219
-
2220
- toJSON(message: ResponseSetOption): unknown {
2221
- const obj: any = {};
2222
- message.code !== undefined && (obj.code = Math.round(message.code));
2223
- message.log !== undefined && (obj.log = message.log);
2224
- message.info !== undefined && (obj.info = message.info);
2225
- return obj;
2226
- },
2227
-
2228
- fromPartial<I extends Exact<DeepPartial<ResponseSetOption>, I>>(object: I): ResponseSetOption {
2229
- const message = createBaseResponseSetOption();
2230
- message.code = object.code ?? 0;
2231
- message.log = object.log ?? "";
2232
- message.info = object.info ?? "";
2233
- return message;
2234
- },
2235
- };
2236
-
2237
- function createBaseResponseInitChain(): ResponseInitChain {
2238
- return { consensusParams: undefined, validators: [], appHash: new Uint8Array() };
2239
- }
2240
-
2241
- export const ResponseInitChain = {
2242
- encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2243
- if (message.consensusParams !== undefined) {
2244
- ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim();
2245
- }
2246
- for (const v of message.validators) {
2247
- ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim();
2248
- }
2249
- if (message.appHash.length !== 0) {
2250
- writer.uint32(26).bytes(message.appHash);
2251
- }
2252
- return writer;
2253
- },
2254
-
2255
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain {
2256
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2257
- let end = length === undefined ? reader.len : reader.pos + length;
2258
- const message = createBaseResponseInitChain();
2259
- while (reader.pos < end) {
2260
- const tag = reader.uint32();
2261
- switch (tag >>> 3) {
2262
- case 1:
2263
- message.consensusParams = ConsensusParams.decode(reader, reader.uint32());
2264
- break;
2265
- case 2:
2266
- message.validators.push(ValidatorUpdate.decode(reader, reader.uint32()));
2267
- break;
2268
- case 3:
2269
- message.appHash = reader.bytes();
2270
- break;
2271
- default:
2272
- reader.skipType(tag & 7);
2273
- break;
2274
- }
2275
- }
2276
- return message;
2277
- },
2278
-
2279
- fromJSON(object: any): ResponseInitChain {
2280
- return {
2281
- consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined,
2282
- validators: Array.isArray(object?.validators)
2283
- ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e))
2284
- : [],
2285
- appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(),
2286
- };
2287
- },
2288
-
2289
- toJSON(message: ResponseInitChain): unknown {
2290
- const obj: any = {};
2291
- message.consensusParams !== undefined
2292
- && (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined);
2293
- if (message.validators) {
2294
- obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined);
2295
- } else {
2296
- obj.validators = [];
2297
- }
2298
- message.appHash !== undefined
2299
- && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array()));
2300
- return obj;
2301
- },
2302
-
2303
- fromPartial<I extends Exact<DeepPartial<ResponseInitChain>, I>>(object: I): ResponseInitChain {
2304
- const message = createBaseResponseInitChain();
2305
- message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null)
2306
- ? ConsensusParams.fromPartial(object.consensusParams)
2307
- : undefined;
2308
- message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [];
2309
- message.appHash = object.appHash ?? new Uint8Array();
2310
- return message;
2311
- },
2312
- };
2313
-
2314
- function createBaseResponseQuery(): ResponseQuery {
2315
- return {
2316
- code: 0,
2317
- log: "",
2318
- info: "",
2319
- index: 0,
2320
- key: new Uint8Array(),
2321
- value: new Uint8Array(),
2322
- proofOps: undefined,
2323
- height: 0,
2324
- codespace: "",
2325
- };
2326
- }
2327
-
2328
- export const ResponseQuery = {
2329
- encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2330
- if (message.code !== 0) {
2331
- writer.uint32(8).uint32(message.code);
2332
- }
2333
- if (message.log !== "") {
2334
- writer.uint32(26).string(message.log);
2335
- }
2336
- if (message.info !== "") {
2337
- writer.uint32(34).string(message.info);
2338
- }
2339
- if (message.index !== 0) {
2340
- writer.uint32(40).int64(message.index);
2341
- }
2342
- if (message.key.length !== 0) {
2343
- writer.uint32(50).bytes(message.key);
2344
- }
2345
- if (message.value.length !== 0) {
2346
- writer.uint32(58).bytes(message.value);
2347
- }
2348
- if (message.proofOps !== undefined) {
2349
- ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim();
2350
- }
2351
- if (message.height !== 0) {
2352
- writer.uint32(72).int64(message.height);
2353
- }
2354
- if (message.codespace !== "") {
2355
- writer.uint32(82).string(message.codespace);
2356
- }
2357
- return writer;
2358
- },
2359
-
2360
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery {
2361
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2362
- let end = length === undefined ? reader.len : reader.pos + length;
2363
- const message = createBaseResponseQuery();
2364
- while (reader.pos < end) {
2365
- const tag = reader.uint32();
2366
- switch (tag >>> 3) {
2367
- case 1:
2368
- message.code = reader.uint32();
2369
- break;
2370
- case 3:
2371
- message.log = reader.string();
2372
- break;
2373
- case 4:
2374
- message.info = reader.string();
2375
- break;
2376
- case 5:
2377
- message.index = longToNumber(reader.int64() as Long);
2378
- break;
2379
- case 6:
2380
- message.key = reader.bytes();
2381
- break;
2382
- case 7:
2383
- message.value = reader.bytes();
2384
- break;
2385
- case 8:
2386
- message.proofOps = ProofOps.decode(reader, reader.uint32());
2387
- break;
2388
- case 9:
2389
- message.height = longToNumber(reader.int64() as Long);
2390
- break;
2391
- case 10:
2392
- message.codespace = reader.string();
2393
- break;
2394
- default:
2395
- reader.skipType(tag & 7);
2396
- break;
2397
- }
2398
- }
2399
- return message;
2400
- },
2401
-
2402
- fromJSON(object: any): ResponseQuery {
2403
- return {
2404
- code: isSet(object.code) ? Number(object.code) : 0,
2405
- log: isSet(object.log) ? String(object.log) : "",
2406
- info: isSet(object.info) ? String(object.info) : "",
2407
- index: isSet(object.index) ? Number(object.index) : 0,
2408
- key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(),
2409
- value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(),
2410
- proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined,
2411
- height: isSet(object.height) ? Number(object.height) : 0,
2412
- codespace: isSet(object.codespace) ? String(object.codespace) : "",
2413
- };
2414
- },
2415
-
2416
- toJSON(message: ResponseQuery): unknown {
2417
- const obj: any = {};
2418
- message.code !== undefined && (obj.code = Math.round(message.code));
2419
- message.log !== undefined && (obj.log = message.log);
2420
- message.info !== undefined && (obj.info = message.info);
2421
- message.index !== undefined && (obj.index = Math.round(message.index));
2422
- message.key !== undefined
2423
- && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
2424
- message.value !== undefined
2425
- && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
2426
- message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined);
2427
- message.height !== undefined && (obj.height = Math.round(message.height));
2428
- message.codespace !== undefined && (obj.codespace = message.codespace);
2429
- return obj;
2430
- },
2431
-
2432
- fromPartial<I extends Exact<DeepPartial<ResponseQuery>, I>>(object: I): ResponseQuery {
2433
- const message = createBaseResponseQuery();
2434
- message.code = object.code ?? 0;
2435
- message.log = object.log ?? "";
2436
- message.info = object.info ?? "";
2437
- message.index = object.index ?? 0;
2438
- message.key = object.key ?? new Uint8Array();
2439
- message.value = object.value ?? new Uint8Array();
2440
- message.proofOps = (object.proofOps !== undefined && object.proofOps !== null)
2441
- ? ProofOps.fromPartial(object.proofOps)
2442
- : undefined;
2443
- message.height = object.height ?? 0;
2444
- message.codespace = object.codespace ?? "";
2445
- return message;
2446
- },
2447
- };
2448
-
2449
- function createBaseResponseBeginBlock(): ResponseBeginBlock {
2450
- return { events: [] };
2451
- }
2452
-
2453
- export const ResponseBeginBlock = {
2454
- encode(message: ResponseBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2455
- for (const v of message.events) {
2456
- Event.encode(v!, writer.uint32(10).fork()).ldelim();
2457
- }
2458
- return writer;
2459
- },
2460
-
2461
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseBeginBlock {
2462
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2463
- let end = length === undefined ? reader.len : reader.pos + length;
2464
- const message = createBaseResponseBeginBlock();
2465
- while (reader.pos < end) {
2466
- const tag = reader.uint32();
2467
- switch (tag >>> 3) {
2468
- case 1:
2469
- message.events.push(Event.decode(reader, reader.uint32()));
2470
- break;
2471
- default:
2472
- reader.skipType(tag & 7);
2473
- break;
2474
- }
2475
- }
2476
- return message;
2477
- },
2478
-
2479
- fromJSON(object: any): ResponseBeginBlock {
2480
- return { events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [] };
2481
- },
2482
-
2483
- toJSON(message: ResponseBeginBlock): unknown {
2484
- const obj: any = {};
2485
- if (message.events) {
2486
- obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined);
2487
- } else {
2488
- obj.events = [];
2489
- }
2490
- return obj;
2491
- },
2492
-
2493
- fromPartial<I extends Exact<DeepPartial<ResponseBeginBlock>, I>>(object: I): ResponseBeginBlock {
2494
- const message = createBaseResponseBeginBlock();
2495
- message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
2496
- return message;
2497
- },
2498
- };
2499
-
2500
- function createBaseResponseCheckTx(): ResponseCheckTx {
2501
- return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: 0, gasUsed: 0, events: [], codespace: "" };
2502
- }
2503
-
2504
- export const ResponseCheckTx = {
2505
- encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2506
- if (message.code !== 0) {
2507
- writer.uint32(8).uint32(message.code);
2508
- }
2509
- if (message.data.length !== 0) {
2510
- writer.uint32(18).bytes(message.data);
2511
- }
2512
- if (message.log !== "") {
2513
- writer.uint32(26).string(message.log);
2514
- }
2515
- if (message.info !== "") {
2516
- writer.uint32(34).string(message.info);
2517
- }
2518
- if (message.gasWanted !== 0) {
2519
- writer.uint32(40).int64(message.gasWanted);
2520
- }
2521
- if (message.gasUsed !== 0) {
2522
- writer.uint32(48).int64(message.gasUsed);
2523
- }
2524
- for (const v of message.events) {
2525
- Event.encode(v!, writer.uint32(58).fork()).ldelim();
2526
- }
2527
- if (message.codespace !== "") {
2528
- writer.uint32(66).string(message.codespace);
2529
- }
2530
- return writer;
2531
- },
2532
-
2533
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx {
2534
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2535
- let end = length === undefined ? reader.len : reader.pos + length;
2536
- const message = createBaseResponseCheckTx();
2537
- while (reader.pos < end) {
2538
- const tag = reader.uint32();
2539
- switch (tag >>> 3) {
2540
- case 1:
2541
- message.code = reader.uint32();
2542
- break;
2543
- case 2:
2544
- message.data = reader.bytes();
2545
- break;
2546
- case 3:
2547
- message.log = reader.string();
2548
- break;
2549
- case 4:
2550
- message.info = reader.string();
2551
- break;
2552
- case 5:
2553
- message.gasWanted = longToNumber(reader.int64() as Long);
2554
- break;
2555
- case 6:
2556
- message.gasUsed = longToNumber(reader.int64() as Long);
2557
- break;
2558
- case 7:
2559
- message.events.push(Event.decode(reader, reader.uint32()));
2560
- break;
2561
- case 8:
2562
- message.codespace = reader.string();
2563
- break;
2564
- default:
2565
- reader.skipType(tag & 7);
2566
- break;
2567
- }
2568
- }
2569
- return message;
2570
- },
2571
-
2572
- fromJSON(object: any): ResponseCheckTx {
2573
- return {
2574
- code: isSet(object.code) ? Number(object.code) : 0,
2575
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
2576
- log: isSet(object.log) ? String(object.log) : "",
2577
- info: isSet(object.info) ? String(object.info) : "",
2578
- gasWanted: isSet(object.gas_wanted) ? Number(object.gas_wanted) : 0,
2579
- gasUsed: isSet(object.gas_used) ? Number(object.gas_used) : 0,
2580
- events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [],
2581
- codespace: isSet(object.codespace) ? String(object.codespace) : "",
2582
- };
2583
- },
2584
-
2585
- toJSON(message: ResponseCheckTx): unknown {
2586
- const obj: any = {};
2587
- message.code !== undefined && (obj.code = Math.round(message.code));
2588
- message.data !== undefined
2589
- && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
2590
- message.log !== undefined && (obj.log = message.log);
2591
- message.info !== undefined && (obj.info = message.info);
2592
- message.gasWanted !== undefined && (obj.gas_wanted = Math.round(message.gasWanted));
2593
- message.gasUsed !== undefined && (obj.gas_used = Math.round(message.gasUsed));
2594
- if (message.events) {
2595
- obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined);
2596
- } else {
2597
- obj.events = [];
2598
- }
2599
- message.codespace !== undefined && (obj.codespace = message.codespace);
2600
- return obj;
2601
- },
2602
-
2603
- fromPartial<I extends Exact<DeepPartial<ResponseCheckTx>, I>>(object: I): ResponseCheckTx {
2604
- const message = createBaseResponseCheckTx();
2605
- message.code = object.code ?? 0;
2606
- message.data = object.data ?? new Uint8Array();
2607
- message.log = object.log ?? "";
2608
- message.info = object.info ?? "";
2609
- message.gasWanted = object.gasWanted ?? 0;
2610
- message.gasUsed = object.gasUsed ?? 0;
2611
- message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
2612
- message.codespace = object.codespace ?? "";
2613
- return message;
2614
- },
2615
- };
2616
-
2617
- function createBaseResponseDeliverTx(): ResponseDeliverTx {
2618
- return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: 0, gasUsed: 0, events: [], codespace: "" };
2619
- }
2620
-
2621
- export const ResponseDeliverTx = {
2622
- encode(message: ResponseDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2623
- if (message.code !== 0) {
2624
- writer.uint32(8).uint32(message.code);
2625
- }
2626
- if (message.data.length !== 0) {
2627
- writer.uint32(18).bytes(message.data);
2628
- }
2629
- if (message.log !== "") {
2630
- writer.uint32(26).string(message.log);
2631
- }
2632
- if (message.info !== "") {
2633
- writer.uint32(34).string(message.info);
2634
- }
2635
- if (message.gasWanted !== 0) {
2636
- writer.uint32(40).int64(message.gasWanted);
2637
- }
2638
- if (message.gasUsed !== 0) {
2639
- writer.uint32(48).int64(message.gasUsed);
2640
- }
2641
- for (const v of message.events) {
2642
- Event.encode(v!, writer.uint32(58).fork()).ldelim();
2643
- }
2644
- if (message.codespace !== "") {
2645
- writer.uint32(66).string(message.codespace);
2646
- }
2647
- return writer;
2648
- },
2649
-
2650
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseDeliverTx {
2651
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2652
- let end = length === undefined ? reader.len : reader.pos + length;
2653
- const message = createBaseResponseDeliverTx();
2654
- while (reader.pos < end) {
2655
- const tag = reader.uint32();
2656
- switch (tag >>> 3) {
2657
- case 1:
2658
- message.code = reader.uint32();
2659
- break;
2660
- case 2:
2661
- message.data = reader.bytes();
2662
- break;
2663
- case 3:
2664
- message.log = reader.string();
2665
- break;
2666
- case 4:
2667
- message.info = reader.string();
2668
- break;
2669
- case 5:
2670
- message.gasWanted = longToNumber(reader.int64() as Long);
2671
- break;
2672
- case 6:
2673
- message.gasUsed = longToNumber(reader.int64() as Long);
2674
- break;
2675
- case 7:
2676
- message.events.push(Event.decode(reader, reader.uint32()));
2677
- break;
2678
- case 8:
2679
- message.codespace = reader.string();
2680
- break;
2681
- default:
2682
- reader.skipType(tag & 7);
2683
- break;
2684
- }
2685
- }
2686
- return message;
2687
- },
2688
-
2689
- fromJSON(object: any): ResponseDeliverTx {
2690
- return {
2691
- code: isSet(object.code) ? Number(object.code) : 0,
2692
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
2693
- log: isSet(object.log) ? String(object.log) : "",
2694
- info: isSet(object.info) ? String(object.info) : "",
2695
- gasWanted: isSet(object.gas_wanted) ? Number(object.gas_wanted) : 0,
2696
- gasUsed: isSet(object.gas_used) ? Number(object.gas_used) : 0,
2697
- events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [],
2698
- codespace: isSet(object.codespace) ? String(object.codespace) : "",
2699
- };
2700
- },
2701
-
2702
- toJSON(message: ResponseDeliverTx): unknown {
2703
- const obj: any = {};
2704
- message.code !== undefined && (obj.code = Math.round(message.code));
2705
- message.data !== undefined
2706
- && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
2707
- message.log !== undefined && (obj.log = message.log);
2708
- message.info !== undefined && (obj.info = message.info);
2709
- message.gasWanted !== undefined && (obj.gas_wanted = Math.round(message.gasWanted));
2710
- message.gasUsed !== undefined && (obj.gas_used = Math.round(message.gasUsed));
2711
- if (message.events) {
2712
- obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined);
2713
- } else {
2714
- obj.events = [];
2715
- }
2716
- message.codespace !== undefined && (obj.codespace = message.codespace);
2717
- return obj;
2718
- },
2719
-
2720
- fromPartial<I extends Exact<DeepPartial<ResponseDeliverTx>, I>>(object: I): ResponseDeliverTx {
2721
- const message = createBaseResponseDeliverTx();
2722
- message.code = object.code ?? 0;
2723
- message.data = object.data ?? new Uint8Array();
2724
- message.log = object.log ?? "";
2725
- message.info = object.info ?? "";
2726
- message.gasWanted = object.gasWanted ?? 0;
2727
- message.gasUsed = object.gasUsed ?? 0;
2728
- message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
2729
- message.codespace = object.codespace ?? "";
2730
- return message;
2731
- },
2732
- };
2733
-
2734
- function createBaseResponseEndBlock(): ResponseEndBlock {
2735
- return { validatorUpdates: [], consensusParamUpdates: undefined, events: [] };
2736
- }
2737
-
2738
- export const ResponseEndBlock = {
2739
- encode(message: ResponseEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2740
- for (const v of message.validatorUpdates) {
2741
- ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim();
2742
- }
2743
- if (message.consensusParamUpdates !== undefined) {
2744
- ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim();
2745
- }
2746
- for (const v of message.events) {
2747
- Event.encode(v!, writer.uint32(26).fork()).ldelim();
2748
- }
2749
- return writer;
2750
- },
2751
-
2752
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEndBlock {
2753
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2754
- let end = length === undefined ? reader.len : reader.pos + length;
2755
- const message = createBaseResponseEndBlock();
2756
- while (reader.pos < end) {
2757
- const tag = reader.uint32();
2758
- switch (tag >>> 3) {
2759
- case 1:
2760
- message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32()));
2761
- break;
2762
- case 2:
2763
- message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32());
2764
- break;
2765
- case 3:
2766
- message.events.push(Event.decode(reader, reader.uint32()));
2767
- break;
2768
- default:
2769
- reader.skipType(tag & 7);
2770
- break;
2771
- }
2772
- }
2773
- return message;
2774
- },
2775
-
2776
- fromJSON(object: any): ResponseEndBlock {
2777
- return {
2778
- validatorUpdates: Array.isArray(object?.validatorUpdates)
2779
- ? object.validatorUpdates.map((e: any) => ValidatorUpdate.fromJSON(e))
2780
- : [],
2781
- consensusParamUpdates: isSet(object.consensusParamUpdates)
2782
- ? ConsensusParams.fromJSON(object.consensusParamUpdates)
2783
- : undefined,
2784
- events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [],
2785
- };
2786
- },
2787
-
2788
- toJSON(message: ResponseEndBlock): unknown {
2789
- const obj: any = {};
2790
- if (message.validatorUpdates) {
2791
- obj.validatorUpdates = message.validatorUpdates.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined);
2792
- } else {
2793
- obj.validatorUpdates = [];
2794
- }
2795
- message.consensusParamUpdates !== undefined && (obj.consensusParamUpdates = message.consensusParamUpdates
2796
- ? ConsensusParams.toJSON(message.consensusParamUpdates)
2797
- : undefined);
2798
- if (message.events) {
2799
- obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined);
2800
- } else {
2801
- obj.events = [];
2802
- }
2803
- return obj;
2804
- },
2805
-
2806
- fromPartial<I extends Exact<DeepPartial<ResponseEndBlock>, I>>(object: I): ResponseEndBlock {
2807
- const message = createBaseResponseEndBlock();
2808
- message.validatorUpdates = object.validatorUpdates?.map((e) => ValidatorUpdate.fromPartial(e)) || [];
2809
- message.consensusParamUpdates =
2810
- (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null)
2811
- ? ConsensusParams.fromPartial(object.consensusParamUpdates)
2812
- : undefined;
2813
- message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
2814
- return message;
2815
- },
2816
- };
2817
-
2818
- function createBaseResponseCommit(): ResponseCommit {
2819
- return { data: new Uint8Array(), retainHeight: 0 };
2820
- }
2821
-
2822
- export const ResponseCommit = {
2823
- encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2824
- if (message.data.length !== 0) {
2825
- writer.uint32(18).bytes(message.data);
2826
- }
2827
- if (message.retainHeight !== 0) {
2828
- writer.uint32(24).int64(message.retainHeight);
2829
- }
2830
- return writer;
2831
- },
2832
-
2833
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit {
2834
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2835
- let end = length === undefined ? reader.len : reader.pos + length;
2836
- const message = createBaseResponseCommit();
2837
- while (reader.pos < end) {
2838
- const tag = reader.uint32();
2839
- switch (tag >>> 3) {
2840
- case 2:
2841
- message.data = reader.bytes();
2842
- break;
2843
- case 3:
2844
- message.retainHeight = longToNumber(reader.int64() as Long);
2845
- break;
2846
- default:
2847
- reader.skipType(tag & 7);
2848
- break;
2849
- }
2850
- }
2851
- return message;
2852
- },
2853
-
2854
- fromJSON(object: any): ResponseCommit {
2855
- return {
2856
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
2857
- retainHeight: isSet(object.retainHeight) ? Number(object.retainHeight) : 0,
2858
- };
2859
- },
2860
-
2861
- toJSON(message: ResponseCommit): unknown {
2862
- const obj: any = {};
2863
- message.data !== undefined
2864
- && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
2865
- message.retainHeight !== undefined && (obj.retainHeight = Math.round(message.retainHeight));
2866
- return obj;
2867
- },
2868
-
2869
- fromPartial<I extends Exact<DeepPartial<ResponseCommit>, I>>(object: I): ResponseCommit {
2870
- const message = createBaseResponseCommit();
2871
- message.data = object.data ?? new Uint8Array();
2872
- message.retainHeight = object.retainHeight ?? 0;
2873
- return message;
2874
- },
2875
- };
2876
-
2877
- function createBaseResponseListSnapshots(): ResponseListSnapshots {
2878
- return { snapshots: [] };
2879
- }
2880
-
2881
- export const ResponseListSnapshots = {
2882
- encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2883
- for (const v of message.snapshots) {
2884
- Snapshot.encode(v!, writer.uint32(10).fork()).ldelim();
2885
- }
2886
- return writer;
2887
- },
2888
-
2889
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots {
2890
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2891
- let end = length === undefined ? reader.len : reader.pos + length;
2892
- const message = createBaseResponseListSnapshots();
2893
- while (reader.pos < end) {
2894
- const tag = reader.uint32();
2895
- switch (tag >>> 3) {
2896
- case 1:
2897
- message.snapshots.push(Snapshot.decode(reader, reader.uint32()));
2898
- break;
2899
- default:
2900
- reader.skipType(tag & 7);
2901
- break;
2902
- }
2903
- }
2904
- return message;
2905
- },
2906
-
2907
- fromJSON(object: any): ResponseListSnapshots {
2908
- return {
2909
- snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromJSON(e)) : [],
2910
- };
2911
- },
2912
-
2913
- toJSON(message: ResponseListSnapshots): unknown {
2914
- const obj: any = {};
2915
- if (message.snapshots) {
2916
- obj.snapshots = message.snapshots.map((e) => e ? Snapshot.toJSON(e) : undefined);
2917
- } else {
2918
- obj.snapshots = [];
2919
- }
2920
- return obj;
2921
- },
2922
-
2923
- fromPartial<I extends Exact<DeepPartial<ResponseListSnapshots>, I>>(object: I): ResponseListSnapshots {
2924
- const message = createBaseResponseListSnapshots();
2925
- message.snapshots = object.snapshots?.map((e) => Snapshot.fromPartial(e)) || [];
2926
- return message;
2927
- },
2928
- };
2929
-
2930
- function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot {
2931
- return { result: 0 };
2932
- }
2933
-
2934
- export const ResponseOfferSnapshot = {
2935
- encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2936
- if (message.result !== 0) {
2937
- writer.uint32(8).int32(message.result);
2938
- }
2939
- return writer;
2940
- },
2941
-
2942
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot {
2943
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2944
- let end = length === undefined ? reader.len : reader.pos + length;
2945
- const message = createBaseResponseOfferSnapshot();
2946
- while (reader.pos < end) {
2947
- const tag = reader.uint32();
2948
- switch (tag >>> 3) {
2949
- case 1:
2950
- message.result = reader.int32() as any;
2951
- break;
2952
- default:
2953
- reader.skipType(tag & 7);
2954
- break;
2955
- }
2956
- }
2957
- return message;
2958
- },
2959
-
2960
- fromJSON(object: any): ResponseOfferSnapshot {
2961
- return { result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 };
2962
- },
2963
-
2964
- toJSON(message: ResponseOfferSnapshot): unknown {
2965
- const obj: any = {};
2966
- message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result));
2967
- return obj;
2968
- },
2969
-
2970
- fromPartial<I extends Exact<DeepPartial<ResponseOfferSnapshot>, I>>(object: I): ResponseOfferSnapshot {
2971
- const message = createBaseResponseOfferSnapshot();
2972
- message.result = object.result ?? 0;
2973
- return message;
2974
- },
2975
- };
2976
-
2977
- function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk {
2978
- return { chunk: new Uint8Array() };
2979
- }
2980
-
2981
- export const ResponseLoadSnapshotChunk = {
2982
- encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2983
- if (message.chunk.length !== 0) {
2984
- writer.uint32(10).bytes(message.chunk);
2985
- }
2986
- return writer;
2987
- },
2988
-
2989
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk {
2990
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2991
- let end = length === undefined ? reader.len : reader.pos + length;
2992
- const message = createBaseResponseLoadSnapshotChunk();
2993
- while (reader.pos < end) {
2994
- const tag = reader.uint32();
2995
- switch (tag >>> 3) {
2996
- case 1:
2997
- message.chunk = reader.bytes();
2998
- break;
2999
- default:
3000
- reader.skipType(tag & 7);
3001
- break;
3002
- }
3003
- }
3004
- return message;
3005
- },
3006
-
3007
- fromJSON(object: any): ResponseLoadSnapshotChunk {
3008
- return { chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array() };
3009
- },
3010
-
3011
- toJSON(message: ResponseLoadSnapshotChunk): unknown {
3012
- const obj: any = {};
3013
- message.chunk !== undefined
3014
- && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array()));
3015
- return obj;
3016
- },
3017
-
3018
- fromPartial<I extends Exact<DeepPartial<ResponseLoadSnapshotChunk>, I>>(object: I): ResponseLoadSnapshotChunk {
3019
- const message = createBaseResponseLoadSnapshotChunk();
3020
- message.chunk = object.chunk ?? new Uint8Array();
3021
- return message;
3022
- },
3023
- };
3024
-
3025
- function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk {
3026
- return { result: 0, refetchChunks: [], rejectSenders: [] };
3027
- }
3028
-
3029
- export const ResponseApplySnapshotChunk = {
3030
- encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3031
- if (message.result !== 0) {
3032
- writer.uint32(8).int32(message.result);
3033
- }
3034
- writer.uint32(18).fork();
3035
- for (const v of message.refetchChunks) {
3036
- writer.uint32(v);
3037
- }
3038
- writer.ldelim();
3039
- for (const v of message.rejectSenders) {
3040
- writer.uint32(26).string(v!);
3041
- }
3042
- return writer;
3043
- },
3044
-
3045
- decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk {
3046
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3047
- let end = length === undefined ? reader.len : reader.pos + length;
3048
- const message = createBaseResponseApplySnapshotChunk();
3049
- while (reader.pos < end) {
3050
- const tag = reader.uint32();
3051
- switch (tag >>> 3) {
3052
- case 1:
3053
- message.result = reader.int32() as any;
3054
- break;
3055
- case 2:
3056
- if ((tag & 7) === 2) {
3057
- const end2 = reader.uint32() + reader.pos;
3058
- while (reader.pos < end2) {
3059
- message.refetchChunks.push(reader.uint32());
3060
- }
3061
- } else {
3062
- message.refetchChunks.push(reader.uint32());
3063
- }
3064
- break;
3065
- case 3:
3066
- message.rejectSenders.push(reader.string());
3067
- break;
3068
- default:
3069
- reader.skipType(tag & 7);
3070
- break;
3071
- }
3072
- }
3073
- return message;
3074
- },
3075
-
3076
- fromJSON(object: any): ResponseApplySnapshotChunk {
3077
- return {
3078
- result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0,
3079
- refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [],
3080
- rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [],
3081
- };
3082
- },
3083
-
3084
- toJSON(message: ResponseApplySnapshotChunk): unknown {
3085
- const obj: any = {};
3086
- message.result !== undefined && (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result));
3087
- if (message.refetchChunks) {
3088
- obj.refetchChunks = message.refetchChunks.map((e) => Math.round(e));
3089
- } else {
3090
- obj.refetchChunks = [];
3091
- }
3092
- if (message.rejectSenders) {
3093
- obj.rejectSenders = message.rejectSenders.map((e) => e);
3094
- } else {
3095
- obj.rejectSenders = [];
3096
- }
3097
- return obj;
3098
- },
3099
-
3100
- fromPartial<I extends Exact<DeepPartial<ResponseApplySnapshotChunk>, I>>(object: I): ResponseApplySnapshotChunk {
3101
- const message = createBaseResponseApplySnapshotChunk();
3102
- message.result = object.result ?? 0;
3103
- message.refetchChunks = object.refetchChunks?.map((e) => e) || [];
3104
- message.rejectSenders = object.rejectSenders?.map((e) => e) || [];
3105
- return message;
3106
- },
3107
- };
3108
-
3109
- function createBaseConsensusParams(): ConsensusParams {
3110
- return { block: undefined, evidence: undefined, validator: undefined, version: undefined };
3111
- }
3112
-
3113
- export const ConsensusParams = {
3114
- encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3115
- if (message.block !== undefined) {
3116
- BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim();
3117
- }
3118
- if (message.evidence !== undefined) {
3119
- EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim();
3120
- }
3121
- if (message.validator !== undefined) {
3122
- ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim();
3123
- }
3124
- if (message.version !== undefined) {
3125
- VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim();
3126
- }
3127
- return writer;
3128
- },
3129
-
3130
- decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams {
3131
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3132
- let end = length === undefined ? reader.len : reader.pos + length;
3133
- const message = createBaseConsensusParams();
3134
- while (reader.pos < end) {
3135
- const tag = reader.uint32();
3136
- switch (tag >>> 3) {
3137
- case 1:
3138
- message.block = BlockParams.decode(reader, reader.uint32());
3139
- break;
3140
- case 2:
3141
- message.evidence = EvidenceParams.decode(reader, reader.uint32());
3142
- break;
3143
- case 3:
3144
- message.validator = ValidatorParams.decode(reader, reader.uint32());
3145
- break;
3146
- case 4:
3147
- message.version = VersionParams.decode(reader, reader.uint32());
3148
- break;
3149
- default:
3150
- reader.skipType(tag & 7);
3151
- break;
3152
- }
3153
- }
3154
- return message;
3155
- },
3156
-
3157
- fromJSON(object: any): ConsensusParams {
3158
- return {
3159
- block: isSet(object.block) ? BlockParams.fromJSON(object.block) : undefined,
3160
- evidence: isSet(object.evidence) ? EvidenceParams.fromJSON(object.evidence) : undefined,
3161
- validator: isSet(object.validator) ? ValidatorParams.fromJSON(object.validator) : undefined,
3162
- version: isSet(object.version) ? VersionParams.fromJSON(object.version) : undefined,
3163
- };
3164
- },
3165
-
3166
- toJSON(message: ConsensusParams): unknown {
3167
- const obj: any = {};
3168
- message.block !== undefined && (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined);
3169
- message.evidence !== undefined
3170
- && (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined);
3171
- message.validator !== undefined
3172
- && (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined);
3173
- message.version !== undefined
3174
- && (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined);
3175
- return obj;
3176
- },
3177
-
3178
- fromPartial<I extends Exact<DeepPartial<ConsensusParams>, I>>(object: I): ConsensusParams {
3179
- const message = createBaseConsensusParams();
3180
- message.block = (object.block !== undefined && object.block !== null)
3181
- ? BlockParams.fromPartial(object.block)
3182
- : undefined;
3183
- message.evidence = (object.evidence !== undefined && object.evidence !== null)
3184
- ? EvidenceParams.fromPartial(object.evidence)
3185
- : undefined;
3186
- message.validator = (object.validator !== undefined && object.validator !== null)
3187
- ? ValidatorParams.fromPartial(object.validator)
3188
- : undefined;
3189
- message.version = (object.version !== undefined && object.version !== null)
3190
- ? VersionParams.fromPartial(object.version)
3191
- : undefined;
3192
- return message;
3193
- },
3194
- };
3195
-
3196
- function createBaseBlockParams(): BlockParams {
3197
- return { maxBytes: 0, maxGas: 0 };
3198
- }
3199
-
3200
- export const BlockParams = {
3201
- encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3202
- if (message.maxBytes !== 0) {
3203
- writer.uint32(8).int64(message.maxBytes);
3204
- }
3205
- if (message.maxGas !== 0) {
3206
- writer.uint32(16).int64(message.maxGas);
3207
- }
3208
- return writer;
3209
- },
3210
-
3211
- decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams {
3212
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3213
- let end = length === undefined ? reader.len : reader.pos + length;
3214
- const message = createBaseBlockParams();
3215
- while (reader.pos < end) {
3216
- const tag = reader.uint32();
3217
- switch (tag >>> 3) {
3218
- case 1:
3219
- message.maxBytes = longToNumber(reader.int64() as Long);
3220
- break;
3221
- case 2:
3222
- message.maxGas = longToNumber(reader.int64() as Long);
3223
- break;
3224
- default:
3225
- reader.skipType(tag & 7);
3226
- break;
3227
- }
3228
- }
3229
- return message;
3230
- },
3231
-
3232
- fromJSON(object: any): BlockParams {
3233
- return {
3234
- maxBytes: isSet(object.maxBytes) ? Number(object.maxBytes) : 0,
3235
- maxGas: isSet(object.maxGas) ? Number(object.maxGas) : 0,
3236
- };
3237
- },
3238
-
3239
- toJSON(message: BlockParams): unknown {
3240
- const obj: any = {};
3241
- message.maxBytes !== undefined && (obj.maxBytes = Math.round(message.maxBytes));
3242
- message.maxGas !== undefined && (obj.maxGas = Math.round(message.maxGas));
3243
- return obj;
3244
- },
3245
-
3246
- fromPartial<I extends Exact<DeepPartial<BlockParams>, I>>(object: I): BlockParams {
3247
- const message = createBaseBlockParams();
3248
- message.maxBytes = object.maxBytes ?? 0;
3249
- message.maxGas = object.maxGas ?? 0;
3250
- return message;
3251
- },
3252
- };
3253
-
3254
- function createBaseLastCommitInfo(): LastCommitInfo {
3255
- return { round: 0, votes: [] };
3256
- }
3257
-
3258
- export const LastCommitInfo = {
3259
- encode(message: LastCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3260
- if (message.round !== 0) {
3261
- writer.uint32(8).int32(message.round);
3262
- }
3263
- for (const v of message.votes) {
3264
- VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim();
3265
- }
3266
- return writer;
3267
- },
3268
-
3269
- decode(input: _m0.Reader | Uint8Array, length?: number): LastCommitInfo {
3270
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3271
- let end = length === undefined ? reader.len : reader.pos + length;
3272
- const message = createBaseLastCommitInfo();
3273
- while (reader.pos < end) {
3274
- const tag = reader.uint32();
3275
- switch (tag >>> 3) {
3276
- case 1:
3277
- message.round = reader.int32();
3278
- break;
3279
- case 2:
3280
- message.votes.push(VoteInfo.decode(reader, reader.uint32()));
3281
- break;
3282
- default:
3283
- reader.skipType(tag & 7);
3284
- break;
3285
- }
3286
- }
3287
- return message;
3288
- },
3289
-
3290
- fromJSON(object: any): LastCommitInfo {
3291
- return {
3292
- round: isSet(object.round) ? Number(object.round) : 0,
3293
- votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromJSON(e)) : [],
3294
- };
3295
- },
3296
-
3297
- toJSON(message: LastCommitInfo): unknown {
3298
- const obj: any = {};
3299
- message.round !== undefined && (obj.round = Math.round(message.round));
3300
- if (message.votes) {
3301
- obj.votes = message.votes.map((e) => e ? VoteInfo.toJSON(e) : undefined);
3302
- } else {
3303
- obj.votes = [];
3304
- }
3305
- return obj;
3306
- },
3307
-
3308
- fromPartial<I extends Exact<DeepPartial<LastCommitInfo>, I>>(object: I): LastCommitInfo {
3309
- const message = createBaseLastCommitInfo();
3310
- message.round = object.round ?? 0;
3311
- message.votes = object.votes?.map((e) => VoteInfo.fromPartial(e)) || [];
3312
- return message;
3313
- },
3314
- };
3315
-
3316
- function createBaseEvent(): Event {
3317
- return { type: "", attributes: [] };
3318
- }
3319
-
3320
- export const Event = {
3321
- encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3322
- if (message.type !== "") {
3323
- writer.uint32(10).string(message.type);
3324
- }
3325
- for (const v of message.attributes) {
3326
- EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim();
3327
- }
3328
- return writer;
3329
- },
3330
-
3331
- decode(input: _m0.Reader | Uint8Array, length?: number): Event {
3332
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3333
- let end = length === undefined ? reader.len : reader.pos + length;
3334
- const message = createBaseEvent();
3335
- while (reader.pos < end) {
3336
- const tag = reader.uint32();
3337
- switch (tag >>> 3) {
3338
- case 1:
3339
- message.type = reader.string();
3340
- break;
3341
- case 2:
3342
- message.attributes.push(EventAttribute.decode(reader, reader.uint32()));
3343
- break;
3344
- default:
3345
- reader.skipType(tag & 7);
3346
- break;
3347
- }
3348
- }
3349
- return message;
3350
- },
3351
-
3352
- fromJSON(object: any): Event {
3353
- return {
3354
- type: isSet(object.type) ? String(object.type) : "",
3355
- attributes: Array.isArray(object?.attributes)
3356
- ? object.attributes.map((e: any) => EventAttribute.fromJSON(e))
3357
- : [],
3358
- };
3359
- },
3360
-
3361
- toJSON(message: Event): unknown {
3362
- const obj: any = {};
3363
- message.type !== undefined && (obj.type = message.type);
3364
- if (message.attributes) {
3365
- obj.attributes = message.attributes.map((e) => e ? EventAttribute.toJSON(e) : undefined);
3366
- } else {
3367
- obj.attributes = [];
3368
- }
3369
- return obj;
3370
- },
3371
-
3372
- fromPartial<I extends Exact<DeepPartial<Event>, I>>(object: I): Event {
3373
- const message = createBaseEvent();
3374
- message.type = object.type ?? "";
3375
- message.attributes = object.attributes?.map((e) => EventAttribute.fromPartial(e)) || [];
3376
- return message;
3377
- },
3378
- };
3379
-
3380
- function createBaseEventAttribute(): EventAttribute {
3381
- return { key: new Uint8Array(), value: new Uint8Array(), index: false };
3382
- }
3383
-
3384
- export const EventAttribute = {
3385
- encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3386
- if (message.key.length !== 0) {
3387
- writer.uint32(10).bytes(message.key);
3388
- }
3389
- if (message.value.length !== 0) {
3390
- writer.uint32(18).bytes(message.value);
3391
- }
3392
- if (message.index === true) {
3393
- writer.uint32(24).bool(message.index);
3394
- }
3395
- return writer;
3396
- },
3397
-
3398
- decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute {
3399
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3400
- let end = length === undefined ? reader.len : reader.pos + length;
3401
- const message = createBaseEventAttribute();
3402
- while (reader.pos < end) {
3403
- const tag = reader.uint32();
3404
- switch (tag >>> 3) {
3405
- case 1:
3406
- message.key = reader.bytes();
3407
- break;
3408
- case 2:
3409
- message.value = reader.bytes();
3410
- break;
3411
- case 3:
3412
- message.index = reader.bool();
3413
- break;
3414
- default:
3415
- reader.skipType(tag & 7);
3416
- break;
3417
- }
3418
- }
3419
- return message;
3420
- },
3421
-
3422
- fromJSON(object: any): EventAttribute {
3423
- return {
3424
- key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(),
3425
- value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(),
3426
- index: isSet(object.index) ? Boolean(object.index) : false,
3427
- };
3428
- },
3429
-
3430
- toJSON(message: EventAttribute): unknown {
3431
- const obj: any = {};
3432
- message.key !== undefined
3433
- && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
3434
- message.value !== undefined
3435
- && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
3436
- message.index !== undefined && (obj.index = message.index);
3437
- return obj;
3438
- },
3439
-
3440
- fromPartial<I extends Exact<DeepPartial<EventAttribute>, I>>(object: I): EventAttribute {
3441
- const message = createBaseEventAttribute();
3442
- message.key = object.key ?? new Uint8Array();
3443
- message.value = object.value ?? new Uint8Array();
3444
- message.index = object.index ?? false;
3445
- return message;
3446
- },
3447
- };
3448
-
3449
- function createBaseTxResult(): TxResult {
3450
- return { height: 0, index: 0, tx: new Uint8Array(), result: undefined };
3451
- }
3452
-
3453
- export const TxResult = {
3454
- encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3455
- if (message.height !== 0) {
3456
- writer.uint32(8).int64(message.height);
3457
- }
3458
- if (message.index !== 0) {
3459
- writer.uint32(16).uint32(message.index);
3460
- }
3461
- if (message.tx.length !== 0) {
3462
- writer.uint32(26).bytes(message.tx);
3463
- }
3464
- if (message.result !== undefined) {
3465
- ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim();
3466
- }
3467
- return writer;
3468
- },
3469
-
3470
- decode(input: _m0.Reader | Uint8Array, length?: number): TxResult {
3471
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3472
- let end = length === undefined ? reader.len : reader.pos + length;
3473
- const message = createBaseTxResult();
3474
- while (reader.pos < end) {
3475
- const tag = reader.uint32();
3476
- switch (tag >>> 3) {
3477
- case 1:
3478
- message.height = longToNumber(reader.int64() as Long);
3479
- break;
3480
- case 2:
3481
- message.index = reader.uint32();
3482
- break;
3483
- case 3:
3484
- message.tx = reader.bytes();
3485
- break;
3486
- case 4:
3487
- message.result = ResponseDeliverTx.decode(reader, reader.uint32());
3488
- break;
3489
- default:
3490
- reader.skipType(tag & 7);
3491
- break;
3492
- }
3493
- }
3494
- return message;
3495
- },
3496
-
3497
- fromJSON(object: any): TxResult {
3498
- return {
3499
- height: isSet(object.height) ? Number(object.height) : 0,
3500
- index: isSet(object.index) ? Number(object.index) : 0,
3501
- tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(),
3502
- result: isSet(object.result) ? ResponseDeliverTx.fromJSON(object.result) : undefined,
3503
- };
3504
- },
3505
-
3506
- toJSON(message: TxResult): unknown {
3507
- const obj: any = {};
3508
- message.height !== undefined && (obj.height = Math.round(message.height));
3509
- message.index !== undefined && (obj.index = Math.round(message.index));
3510
- message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array()));
3511
- message.result !== undefined
3512
- && (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined);
3513
- return obj;
3514
- },
3515
-
3516
- fromPartial<I extends Exact<DeepPartial<TxResult>, I>>(object: I): TxResult {
3517
- const message = createBaseTxResult();
3518
- message.height = object.height ?? 0;
3519
- message.index = object.index ?? 0;
3520
- message.tx = object.tx ?? new Uint8Array();
3521
- message.result = (object.result !== undefined && object.result !== null)
3522
- ? ResponseDeliverTx.fromPartial(object.result)
3523
- : undefined;
3524
- return message;
3525
- },
3526
- };
3527
-
3528
- function createBaseValidator(): Validator {
3529
- return { address: new Uint8Array(), power: 0 };
3530
- }
3531
-
3532
- export const Validator = {
3533
- encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3534
- if (message.address.length !== 0) {
3535
- writer.uint32(10).bytes(message.address);
3536
- }
3537
- if (message.power !== 0) {
3538
- writer.uint32(24).int64(message.power);
3539
- }
3540
- return writer;
3541
- },
3542
-
3543
- decode(input: _m0.Reader | Uint8Array, length?: number): Validator {
3544
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3545
- let end = length === undefined ? reader.len : reader.pos + length;
3546
- const message = createBaseValidator();
3547
- while (reader.pos < end) {
3548
- const tag = reader.uint32();
3549
- switch (tag >>> 3) {
3550
- case 1:
3551
- message.address = reader.bytes();
3552
- break;
3553
- case 3:
3554
- message.power = longToNumber(reader.int64() as Long);
3555
- break;
3556
- default:
3557
- reader.skipType(tag & 7);
3558
- break;
3559
- }
3560
- }
3561
- return message;
3562
- },
3563
-
3564
- fromJSON(object: any): Validator {
3565
- return {
3566
- address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(),
3567
- power: isSet(object.power) ? Number(object.power) : 0,
3568
- };
3569
- },
3570
-
3571
- toJSON(message: Validator): unknown {
3572
- const obj: any = {};
3573
- message.address !== undefined
3574
- && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array()));
3575
- message.power !== undefined && (obj.power = Math.round(message.power));
3576
- return obj;
3577
- },
3578
-
3579
- fromPartial<I extends Exact<DeepPartial<Validator>, I>>(object: I): Validator {
3580
- const message = createBaseValidator();
3581
- message.address = object.address ?? new Uint8Array();
3582
- message.power = object.power ?? 0;
3583
- return message;
3584
- },
3585
- };
3586
-
3587
- function createBaseValidatorUpdate(): ValidatorUpdate {
3588
- return { pubKey: undefined, power: 0 };
3589
- }
3590
-
3591
- export const ValidatorUpdate = {
3592
- encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3593
- if (message.pubKey !== undefined) {
3594
- PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim();
3595
- }
3596
- if (message.power !== 0) {
3597
- writer.uint32(16).int64(message.power);
3598
- }
3599
- return writer;
3600
- },
3601
-
3602
- decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate {
3603
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3604
- let end = length === undefined ? reader.len : reader.pos + length;
3605
- const message = createBaseValidatorUpdate();
3606
- while (reader.pos < end) {
3607
- const tag = reader.uint32();
3608
- switch (tag >>> 3) {
3609
- case 1:
3610
- message.pubKey = PublicKey.decode(reader, reader.uint32());
3611
- break;
3612
- case 2:
3613
- message.power = longToNumber(reader.int64() as Long);
3614
- break;
3615
- default:
3616
- reader.skipType(tag & 7);
3617
- break;
3618
- }
3619
- }
3620
- return message;
3621
- },
3622
-
3623
- fromJSON(object: any): ValidatorUpdate {
3624
- return {
3625
- pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined,
3626
- power: isSet(object.power) ? Number(object.power) : 0,
3627
- };
3628
- },
3629
-
3630
- toJSON(message: ValidatorUpdate): unknown {
3631
- const obj: any = {};
3632
- message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
3633
- message.power !== undefined && (obj.power = Math.round(message.power));
3634
- return obj;
3635
- },
3636
-
3637
- fromPartial<I extends Exact<DeepPartial<ValidatorUpdate>, I>>(object: I): ValidatorUpdate {
3638
- const message = createBaseValidatorUpdate();
3639
- message.pubKey = (object.pubKey !== undefined && object.pubKey !== null)
3640
- ? PublicKey.fromPartial(object.pubKey)
3641
- : undefined;
3642
- message.power = object.power ?? 0;
3643
- return message;
3644
- },
3645
- };
3646
-
3647
- function createBaseVoteInfo(): VoteInfo {
3648
- return { validator: undefined, signedLastBlock: false };
3649
- }
3650
-
3651
- export const VoteInfo = {
3652
- encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3653
- if (message.validator !== undefined) {
3654
- Validator.encode(message.validator, writer.uint32(10).fork()).ldelim();
3655
- }
3656
- if (message.signedLastBlock === true) {
3657
- writer.uint32(16).bool(message.signedLastBlock);
3658
- }
3659
- return writer;
3660
- },
3661
-
3662
- decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo {
3663
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3664
- let end = length === undefined ? reader.len : reader.pos + length;
3665
- const message = createBaseVoteInfo();
3666
- while (reader.pos < end) {
3667
- const tag = reader.uint32();
3668
- switch (tag >>> 3) {
3669
- case 1:
3670
- message.validator = Validator.decode(reader, reader.uint32());
3671
- break;
3672
- case 2:
3673
- message.signedLastBlock = reader.bool();
3674
- break;
3675
- default:
3676
- reader.skipType(tag & 7);
3677
- break;
3678
- }
3679
- }
3680
- return message;
3681
- },
3682
-
3683
- fromJSON(object: any): VoteInfo {
3684
- return {
3685
- validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined,
3686
- signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false,
3687
- };
3688
- },
3689
-
3690
- toJSON(message: VoteInfo): unknown {
3691
- const obj: any = {};
3692
- message.validator !== undefined
3693
- && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined);
3694
- message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock);
3695
- return obj;
3696
- },
3697
-
3698
- fromPartial<I extends Exact<DeepPartial<VoteInfo>, I>>(object: I): VoteInfo {
3699
- const message = createBaseVoteInfo();
3700
- message.validator = (object.validator !== undefined && object.validator !== null)
3701
- ? Validator.fromPartial(object.validator)
3702
- : undefined;
3703
- message.signedLastBlock = object.signedLastBlock ?? false;
3704
- return message;
3705
- },
3706
- };
3707
-
3708
- function createBaseEvidence(): Evidence {
3709
- return { type: 0, validator: undefined, height: 0, time: undefined, totalVotingPower: 0 };
3710
- }
3711
-
3712
- export const Evidence = {
3713
- encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3714
- if (message.type !== 0) {
3715
- writer.uint32(8).int32(message.type);
3716
- }
3717
- if (message.validator !== undefined) {
3718
- Validator.encode(message.validator, writer.uint32(18).fork()).ldelim();
3719
- }
3720
- if (message.height !== 0) {
3721
- writer.uint32(24).int64(message.height);
3722
- }
3723
- if (message.time !== undefined) {
3724
- Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim();
3725
- }
3726
- if (message.totalVotingPower !== 0) {
3727
- writer.uint32(40).int64(message.totalVotingPower);
3728
- }
3729
- return writer;
3730
- },
3731
-
3732
- decode(input: _m0.Reader | Uint8Array, length?: number): Evidence {
3733
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3734
- let end = length === undefined ? reader.len : reader.pos + length;
3735
- const message = createBaseEvidence();
3736
- while (reader.pos < end) {
3737
- const tag = reader.uint32();
3738
- switch (tag >>> 3) {
3739
- case 1:
3740
- message.type = reader.int32() as any;
3741
- break;
3742
- case 2:
3743
- message.validator = Validator.decode(reader, reader.uint32());
3744
- break;
3745
- case 3:
3746
- message.height = longToNumber(reader.int64() as Long);
3747
- break;
3748
- case 4:
3749
- message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3750
- break;
3751
- case 5:
3752
- message.totalVotingPower = longToNumber(reader.int64() as Long);
3753
- break;
3754
- default:
3755
- reader.skipType(tag & 7);
3756
- break;
3757
- }
3758
- }
3759
- return message;
3760
- },
3761
-
3762
- fromJSON(object: any): Evidence {
3763
- return {
3764
- type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0,
3765
- validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined,
3766
- height: isSet(object.height) ? Number(object.height) : 0,
3767
- time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
3768
- totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0,
3769
- };
3770
- },
3771
-
3772
- toJSON(message: Evidence): unknown {
3773
- const obj: any = {};
3774
- message.type !== undefined && (obj.type = evidenceTypeToJSON(message.type));
3775
- message.validator !== undefined
3776
- && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined);
3777
- message.height !== undefined && (obj.height = Math.round(message.height));
3778
- message.time !== undefined && (obj.time = message.time.toISOString());
3779
- message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower));
3780
- return obj;
3781
- },
3782
-
3783
- fromPartial<I extends Exact<DeepPartial<Evidence>, I>>(object: I): Evidence {
3784
- const message = createBaseEvidence();
3785
- message.type = object.type ?? 0;
3786
- message.validator = (object.validator !== undefined && object.validator !== null)
3787
- ? Validator.fromPartial(object.validator)
3788
- : undefined;
3789
- message.height = object.height ?? 0;
3790
- message.time = object.time ?? undefined;
3791
- message.totalVotingPower = object.totalVotingPower ?? 0;
3792
- return message;
3793
- },
3794
- };
3795
-
3796
- function createBaseSnapshot(): Snapshot {
3797
- return { height: 0, format: 0, chunks: 0, hash: new Uint8Array(), metadata: new Uint8Array() };
3798
- }
3799
-
3800
- export const Snapshot = {
3801
- encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3802
- if (message.height !== 0) {
3803
- writer.uint32(8).uint64(message.height);
3804
- }
3805
- if (message.format !== 0) {
3806
- writer.uint32(16).uint32(message.format);
3807
- }
3808
- if (message.chunks !== 0) {
3809
- writer.uint32(24).uint32(message.chunks);
3810
- }
3811
- if (message.hash.length !== 0) {
3812
- writer.uint32(34).bytes(message.hash);
3813
- }
3814
- if (message.metadata.length !== 0) {
3815
- writer.uint32(42).bytes(message.metadata);
3816
- }
3817
- return writer;
3818
- },
3819
-
3820
- decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot {
3821
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3822
- let end = length === undefined ? reader.len : reader.pos + length;
3823
- const message = createBaseSnapshot();
3824
- while (reader.pos < end) {
3825
- const tag = reader.uint32();
3826
- switch (tag >>> 3) {
3827
- case 1:
3828
- message.height = longToNumber(reader.uint64() as Long);
3829
- break;
3830
- case 2:
3831
- message.format = reader.uint32();
3832
- break;
3833
- case 3:
3834
- message.chunks = reader.uint32();
3835
- break;
3836
- case 4:
3837
- message.hash = reader.bytes();
3838
- break;
3839
- case 5:
3840
- message.metadata = reader.bytes();
3841
- break;
3842
- default:
3843
- reader.skipType(tag & 7);
3844
- break;
3845
- }
3846
- }
3847
- return message;
3848
- },
3849
-
3850
- fromJSON(object: any): Snapshot {
3851
- return {
3852
- height: isSet(object.height) ? Number(object.height) : 0,
3853
- format: isSet(object.format) ? Number(object.format) : 0,
3854
- chunks: isSet(object.chunks) ? Number(object.chunks) : 0,
3855
- hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(),
3856
- metadata: isSet(object.metadata) ? bytesFromBase64(object.metadata) : new Uint8Array(),
3857
- };
3858
- },
3859
-
3860
- toJSON(message: Snapshot): unknown {
3861
- const obj: any = {};
3862
- message.height !== undefined && (obj.height = Math.round(message.height));
3863
- message.format !== undefined && (obj.format = Math.round(message.format));
3864
- message.chunks !== undefined && (obj.chunks = Math.round(message.chunks));
3865
- message.hash !== undefined
3866
- && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
3867
- message.metadata !== undefined
3868
- && (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array()));
3869
- return obj;
3870
- },
3871
-
3872
- fromPartial<I extends Exact<DeepPartial<Snapshot>, I>>(object: I): Snapshot {
3873
- const message = createBaseSnapshot();
3874
- message.height = object.height ?? 0;
3875
- message.format = object.format ?? 0;
3876
- message.chunks = object.chunks ?? 0;
3877
- message.hash = object.hash ?? new Uint8Array();
3878
- message.metadata = object.metadata ?? new Uint8Array();
3879
- return message;
3880
- },
3881
- };
3882
-
3883
- export interface ABCIApplication {
3884
- Echo(request: RequestEcho): Promise<ResponseEcho>;
3885
- Flush(request: RequestFlush): Promise<ResponseFlush>;
3886
- Info(request: RequestInfo): Promise<ResponseInfo>;
3887
- SetOption(request: RequestSetOption): Promise<ResponseSetOption>;
3888
- DeliverTx(request: RequestDeliverTx): Promise<ResponseDeliverTx>;
3889
- CheckTx(request: RequestCheckTx): Promise<ResponseCheckTx>;
3890
- Query(request: RequestQuery): Promise<ResponseQuery>;
3891
- Commit(request: RequestCommit): Promise<ResponseCommit>;
3892
- InitChain(request: RequestInitChain): Promise<ResponseInitChain>;
3893
- BeginBlock(request: RequestBeginBlock): Promise<ResponseBeginBlock>;
3894
- EndBlock(request: RequestEndBlock): Promise<ResponseEndBlock>;
3895
- ListSnapshots(request: RequestListSnapshots): Promise<ResponseListSnapshots>;
3896
- OfferSnapshot(request: RequestOfferSnapshot): Promise<ResponseOfferSnapshot>;
3897
- LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise<ResponseLoadSnapshotChunk>;
3898
- ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise<ResponseApplySnapshotChunk>;
3899
- }
3900
-
3901
- export class ABCIApplicationClientImpl implements ABCIApplication {
3902
- private readonly rpc: Rpc;
3903
- constructor(rpc: Rpc) {
3904
- this.rpc = rpc;
3905
- this.Echo = this.Echo.bind(this);
3906
- this.Flush = this.Flush.bind(this);
3907
- this.Info = this.Info.bind(this);
3908
- this.SetOption = this.SetOption.bind(this);
3909
- this.DeliverTx = this.DeliverTx.bind(this);
3910
- this.CheckTx = this.CheckTx.bind(this);
3911
- this.Query = this.Query.bind(this);
3912
- this.Commit = this.Commit.bind(this);
3913
- this.InitChain = this.InitChain.bind(this);
3914
- this.BeginBlock = this.BeginBlock.bind(this);
3915
- this.EndBlock = this.EndBlock.bind(this);
3916
- this.ListSnapshots = this.ListSnapshots.bind(this);
3917
- this.OfferSnapshot = this.OfferSnapshot.bind(this);
3918
- this.LoadSnapshotChunk = this.LoadSnapshotChunk.bind(this);
3919
- this.ApplySnapshotChunk = this.ApplySnapshotChunk.bind(this);
3920
- }
3921
- Echo(request: RequestEcho): Promise<ResponseEcho> {
3922
- const data = RequestEcho.encode(request).finish();
3923
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data);
3924
- return promise.then((data) => ResponseEcho.decode(new _m0.Reader(data)));
3925
- }
3926
-
3927
- Flush(request: RequestFlush): Promise<ResponseFlush> {
3928
- const data = RequestFlush.encode(request).finish();
3929
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data);
3930
- return promise.then((data) => ResponseFlush.decode(new _m0.Reader(data)));
3931
- }
3932
-
3933
- Info(request: RequestInfo): Promise<ResponseInfo> {
3934
- const data = RequestInfo.encode(request).finish();
3935
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data);
3936
- return promise.then((data) => ResponseInfo.decode(new _m0.Reader(data)));
3937
- }
3938
-
3939
- SetOption(request: RequestSetOption): Promise<ResponseSetOption> {
3940
- const data = RequestSetOption.encode(request).finish();
3941
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "SetOption", data);
3942
- return promise.then((data) => ResponseSetOption.decode(new _m0.Reader(data)));
3943
- }
3944
-
3945
- DeliverTx(request: RequestDeliverTx): Promise<ResponseDeliverTx> {
3946
- const data = RequestDeliverTx.encode(request).finish();
3947
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "DeliverTx", data);
3948
- return promise.then((data) => ResponseDeliverTx.decode(new _m0.Reader(data)));
3949
- }
3950
-
3951
- CheckTx(request: RequestCheckTx): Promise<ResponseCheckTx> {
3952
- const data = RequestCheckTx.encode(request).finish();
3953
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data);
3954
- return promise.then((data) => ResponseCheckTx.decode(new _m0.Reader(data)));
3955
- }
3956
-
3957
- Query(request: RequestQuery): Promise<ResponseQuery> {
3958
- const data = RequestQuery.encode(request).finish();
3959
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data);
3960
- return promise.then((data) => ResponseQuery.decode(new _m0.Reader(data)));
3961
- }
3962
-
3963
- Commit(request: RequestCommit): Promise<ResponseCommit> {
3964
- const data = RequestCommit.encode(request).finish();
3965
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data);
3966
- return promise.then((data) => ResponseCommit.decode(new _m0.Reader(data)));
3967
- }
3968
-
3969
- InitChain(request: RequestInitChain): Promise<ResponseInitChain> {
3970
- const data = RequestInitChain.encode(request).finish();
3971
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "InitChain", data);
3972
- return promise.then((data) => ResponseInitChain.decode(new _m0.Reader(data)));
3973
- }
3974
-
3975
- BeginBlock(request: RequestBeginBlock): Promise<ResponseBeginBlock> {
3976
- const data = RequestBeginBlock.encode(request).finish();
3977
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "BeginBlock", data);
3978
- return promise.then((data) => ResponseBeginBlock.decode(new _m0.Reader(data)));
3979
- }
3980
-
3981
- EndBlock(request: RequestEndBlock): Promise<ResponseEndBlock> {
3982
- const data = RequestEndBlock.encode(request).finish();
3983
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "EndBlock", data);
3984
- return promise.then((data) => ResponseEndBlock.decode(new _m0.Reader(data)));
3985
- }
3986
-
3987
- ListSnapshots(request: RequestListSnapshots): Promise<ResponseListSnapshots> {
3988
- const data = RequestListSnapshots.encode(request).finish();
3989
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ListSnapshots", data);
3990
- return promise.then((data) => ResponseListSnapshots.decode(new _m0.Reader(data)));
3991
- }
3992
-
3993
- OfferSnapshot(request: RequestOfferSnapshot): Promise<ResponseOfferSnapshot> {
3994
- const data = RequestOfferSnapshot.encode(request).finish();
3995
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "OfferSnapshot", data);
3996
- return promise.then((data) => ResponseOfferSnapshot.decode(new _m0.Reader(data)));
3997
- }
3998
-
3999
- LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise<ResponseLoadSnapshotChunk> {
4000
- const data = RequestLoadSnapshotChunk.encode(request).finish();
4001
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "LoadSnapshotChunk", data);
4002
- return promise.then((data) => ResponseLoadSnapshotChunk.decode(new _m0.Reader(data)));
4003
- }
4004
-
4005
- ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise<ResponseApplySnapshotChunk> {
4006
- const data = RequestApplySnapshotChunk.encode(request).finish();
4007
- const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ApplySnapshotChunk", data);
4008
- return promise.then((data) => ResponseApplySnapshotChunk.decode(new _m0.Reader(data)));
4009
- }
4010
- }
4011
-
4012
- interface Rpc {
4013
- request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
4014
- }
4015
-
4016
- declare var self: any | undefined;
4017
- declare var window: any | undefined;
4018
- declare var global: any | undefined;
4019
- var globalThis: any = (() => {
4020
- if (typeof globalThis !== "undefined") {
4021
- return globalThis;
4022
- }
4023
- if (typeof self !== "undefined") {
4024
- return self;
4025
- }
4026
- if (typeof window !== "undefined") {
4027
- return window;
4028
- }
4029
- if (typeof global !== "undefined") {
4030
- return global;
4031
- }
4032
- throw "Unable to locate global object";
4033
- })();
4034
-
4035
- function bytesFromBase64(b64: string): Uint8Array {
4036
- if (globalThis.Buffer) {
4037
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
4038
- } else {
4039
- const bin = globalThis.atob(b64);
4040
- const arr = new Uint8Array(bin.length);
4041
- for (let i = 0; i < bin.length; ++i) {
4042
- arr[i] = bin.charCodeAt(i);
4043
- }
4044
- return arr;
4045
- }
4046
- }
4047
-
4048
- function base64FromBytes(arr: Uint8Array): string {
4049
- if (globalThis.Buffer) {
4050
- return globalThis.Buffer.from(arr).toString("base64");
4051
- } else {
4052
- const bin: string[] = [];
4053
- arr.forEach((byte) => {
4054
- bin.push(String.fromCharCode(byte));
4055
- });
4056
- return globalThis.btoa(bin.join(""));
4057
- }
4058
- }
4059
-
4060
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
4061
-
4062
- export type DeepPartial<T> = T extends Builtin ? T
4063
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
4064
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
4065
- : Partial<T>;
4066
-
4067
- type KeysOfUnion<T> = T extends T ? keyof T : never;
4068
- export type Exact<P, I extends P> = P extends Builtin ? P
4069
- : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
4070
-
4071
- function toTimestamp(date: Date): Timestamp {
4072
- const seconds = date.getTime() / 1_000;
4073
- const nanos = (date.getTime() % 1_000) * 1_000_000;
4074
- return { seconds, nanos };
4075
- }
4076
-
4077
- function fromTimestamp(t: Timestamp): Date {
4078
- let millis = t.seconds * 1_000;
4079
- millis += t.nanos / 1_000_000;
4080
- return new Date(millis);
4081
- }
4082
-
4083
- function fromJsonTimestamp(o: any): Date {
4084
- if (o instanceof Date) {
4085
- return o;
4086
- } else if (typeof o === "string") {
4087
- return new Date(o);
4088
- } else {
4089
- return fromTimestamp(Timestamp.fromJSON(o));
4090
- }
4091
- }
4092
-
4093
- function longToNumber(long: Long): number {
4094
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
4095
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
4096
- }
4097
- return long.toNumber();
4098
- }
4099
-
4100
- if (_m0.util.Long !== Long) {
4101
- _m0.util.Long = Long as any;
4102
- _m0.configure();
4103
- }
4104
-
4105
- function isSet(value: any): boolean {
4106
- return value !== null && value !== undefined;
4107
- }