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