@burnt-labs/xion-types 16.0.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/package.json +7 -20
  2. package/README.md +0 -111
  3. package/types/.gitkeep +0 -0
  4. package/types/generated/amino/amino.ts +0 -9
  5. package/types/generated/cosmos/app/v1alpha1/config.ts +0 -336
  6. package/types/generated/cosmos/app/v1alpha1/query.ts +0 -265
  7. package/types/generated/cosmos/auth/v1beta1/auth.ts +0 -520
  8. package/types/generated/cosmos/auth/v1beta1/query.ts +0 -1852
  9. package/types/generated/cosmos/authz/v1beta1/authz.ts +0 -404
  10. package/types/generated/cosmos/authz/v1beta1/query.ts +0 -774
  11. package/types/generated/cosmos/autocli/v1/options.ts +0 -1016
  12. package/types/generated/cosmos/autocli/v1/query.ts +0 -379
  13. package/types/generated/cosmos/bank/v1beta1/bank.ts +0 -752
  14. package/types/generated/cosmos/bank/v1beta1/query.ts +0 -2789
  15. package/types/generated/cosmos/base/abci/v1beta1/abci.ts +0 -1447
  16. package/types/generated/cosmos/base/node/v1beta1/query.ts +0 -587
  17. package/types/generated/cosmos/base/query/v1beta1/pagination.ts +0 -317
  18. package/types/generated/cosmos/base/tendermint/v1beta1/query.ts +0 -2228
  19. package/types/generated/cosmos/base/tendermint/v1beta1/types.ts +0 -522
  20. package/types/generated/cosmos/base/v1beta1/coin.ts +0 -326
  21. package/types/generated/cosmos/circuit/v1/query.ts +0 -606
  22. package/types/generated/cosmos/circuit/v1/types.ts +0 -353
  23. package/types/generated/cosmos/consensus/v1/query.ts +0 -271
  24. package/types/generated/cosmos/crypto/multisig/v1beta1/multisig.ts +0 -212
  25. package/types/generated/cosmos/distribution/v1beta1/distribution.ts +0 -1143
  26. package/types/generated/cosmos/distribution/v1beta1/query.ts +0 -2005
  27. package/types/generated/cosmos/evidence/v1beta1/query.ts +0 -526
  28. package/types/generated/cosmos/feegrant/v1beta1/feegrant.ts +0 -502
  29. package/types/generated/cosmos/feegrant/v1beta1/query.ts +0 -725
  30. package/types/generated/cosmos/gov/v1/gov.ts +0 -1656
  31. package/types/generated/cosmos/gov/v1/query.ts +0 -1847
  32. package/types/generated/cosmos/gov/v1beta1/gov.ts +0 -1239
  33. package/types/generated/cosmos/gov/v1beta1/query.ts +0 -1658
  34. package/types/generated/cosmos/group/v1/query.ts +0 -2840
  35. package/types/generated/cosmos/group/v1/types.ts +0 -1803
  36. package/types/generated/cosmos/ics23/v1/proofs.ts +0 -1685
  37. package/types/generated/cosmos/mint/v1beta1/mint.ts +0 -273
  38. package/types/generated/cosmos/mint/v1beta1/query.ts +0 -589
  39. package/types/generated/cosmos/msg/v1/msg.ts +0 -9
  40. package/types/generated/cosmos/nft/v1beta1/nft.ts +0 -333
  41. package/types/generated/cosmos/nft/v1beta1/query.ts +0 -1362
  42. package/types/generated/cosmos/orm/query/v1alpha1/query.ts +0 -1016
  43. package/types/generated/cosmos/params/v1beta1/params.ts +0 -227
  44. package/types/generated/cosmos/params/v1beta1/query.ts +0 -545
  45. package/types/generated/cosmos/query/v1/query.ts +0 -9
  46. package/types/generated/cosmos/slashing/v1beta1/query.ts +0 -626
  47. package/types/generated/cosmos/slashing/v1beta1/slashing.ts +0 -409
  48. package/types/generated/cosmos/staking/v1beta1/query.ts +0 -2912
  49. package/types/generated/cosmos/staking/v1beta1/staking.ts +0 -2515
  50. package/types/generated/cosmos/tx/signing/v1beta1/signing.ts +0 -608
  51. package/types/generated/cosmos/tx/v1beta1/service.ts +0 -2111
  52. package/types/generated/cosmos/tx/v1beta1/tx.ts +0 -1613
  53. package/types/generated/cosmos/upgrade/v1beta1/query.ts +0 -1007
  54. package/types/generated/cosmos/upgrade/v1beta1/upgrade.ts +0 -507
  55. package/types/generated/cosmos_proto/cosmos.ts +0 -299
  56. package/types/generated/cosmwasm/wasm/v1/query.ts +0 -2984
  57. package/types/generated/cosmwasm/wasm/v1/types.ts +0 -962
  58. package/types/generated/gogoproto/gogo.ts +0 -9
  59. package/types/generated/google/api/annotations.ts +0 -9
  60. package/types/generated/google/api/http.ts +0 -757
  61. package/types/generated/google/protobuf/any.ts +0 -253
  62. package/types/generated/google/protobuf/descriptor.ts +0 -4958
  63. package/types/generated/google/protobuf/duration.ts +0 -186
  64. package/types/generated/google/protobuf/timestamp.ts +0 -215
  65. package/types/generated/ibc/applications/fee/v1/fee.ts +0 -391
  66. package/types/generated/ibc/applications/fee/v1/genesis.ts +0 -553
  67. package/types/generated/ibc/applications/fee/v1/query.ts +0 -2056
  68. package/types/generated/ibc/applications/interchain_accounts/controller/v1/controller.ts +0 -100
  69. package/types/generated/ibc/applications/interchain_accounts/controller/v1/query.ts +0 -447
  70. package/types/generated/ibc/applications/interchain_accounts/host/v1/host.ts +0 -235
  71. package/types/generated/ibc/applications/interchain_accounts/host/v1/query.ts +0 -265
  72. package/types/generated/ibc/applications/transfer/v1/query.ts +0 -1135
  73. package/types/generated/ibc/applications/transfer/v1/transfer.ts +0 -213
  74. package/types/generated/ibc/core/channel/v1/channel.ts +0 -1329
  75. package/types/generated/ibc/core/channel/v1/query.ts +0 -4214
  76. package/types/generated/ibc/core/channel/v1/upgrade.ts +0 -330
  77. package/types/generated/ibc/core/client/v1/client.ts +0 -726
  78. package/types/generated/ibc/core/client/v1/query.ts +0 -2208
  79. package/types/generated/ibc/core/commitment/v1/commitment.ts +0 -329
  80. package/types/generated/ibc/core/connection/v1/connection.ts +0 -813
  81. package/types/generated/ibc/core/connection/v1/query.ts +0 -1442
  82. package/types/generated/ibc/lightclients/wasm/v1/query.ts +0 -484
  83. package/types/generated/tendermint/abci/types.ts +0 -6429
  84. package/types/generated/tendermint/crypto/keys.ts +0 -137
  85. package/types/generated/tendermint/crypto/proof.ts +0 -506
  86. package/types/generated/tendermint/p2p/types.ts +0 -514
  87. package/types/generated/tendermint/types/block.ts +0 -151
  88. package/types/generated/tendermint/types/evidence.ts +0 -493
  89. package/types/generated/tendermint/types/params.ts +0 -687
  90. package/types/generated/tendermint/types/types.ts +0 -2069
  91. package/types/generated/tendermint/types/validator.ts +0 -409
  92. package/types/generated/tendermint/version/types.ts +0 -202
  93. package/types/generated/xion/globalfee/v1/genesis.ts +0 -219
  94. package/types/generated/xion/globalfee/v1/query.ts +0 -269
  95. package/types/generated/xion/jwk/v1/audience.ts +0 -188
  96. package/types/generated/xion/jwk/v1/params.ts +0 -118
  97. package/types/generated/xion/jwk/v1/query.ts +0 -1061
  98. package/types/generated/xion/mint/v1/mint.ts +0 -273
  99. package/types/generated/xion/mint/v1/query.ts +0 -589
  100. package/types/generated/xion/v1/query.ts +0 -878
@@ -1,2228 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v1.181.2
4
- // protoc unknown
5
- // source: cosmos/base/tendermint/v1beta1/query.proto
6
-
7
- /* eslint-disable */
8
- import { grpc } from "@improbable-eng/grpc-web";
9
- import { BrowserHeaders } from "browser-headers";
10
- import Long from "long";
11
- import _m0 from "protobufjs/minimal";
12
- import { Any } from "../../../../google/protobuf/any";
13
- import { DefaultNodeInfo } from "../../../../tendermint/p2p/types";
14
- import { Block } from "../../../../tendermint/types/block";
15
- import { BlockID } from "../../../../tendermint/types/types";
16
- import { PageRequest, PageResponse } from "../../query/v1beta1/pagination";
17
- import { Block as Block1 } from "./types";
18
-
19
- export const protobufPackage = "cosmos.base.tendermint.v1beta1";
20
-
21
- /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */
22
- export interface GetValidatorSetByHeightRequest {
23
- height: Long;
24
- /** pagination defines an pagination for the request. */
25
- pagination?: PageRequest | undefined;
26
- }
27
-
28
- /** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */
29
- export interface GetValidatorSetByHeightResponse {
30
- blockHeight: Long;
31
- validators: Validator[];
32
- /** pagination defines an pagination for the response. */
33
- pagination?: PageResponse | undefined;
34
- }
35
-
36
- /** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */
37
- export interface GetLatestValidatorSetRequest {
38
- /** pagination defines an pagination for the request. */
39
- pagination?: PageRequest | undefined;
40
- }
41
-
42
- /** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */
43
- export interface GetLatestValidatorSetResponse {
44
- blockHeight: Long;
45
- validators: Validator[];
46
- /** pagination defines an pagination for the response. */
47
- pagination?: PageResponse | undefined;
48
- }
49
-
50
- /** Validator is the type for the validator-set. */
51
- export interface Validator {
52
- address: string;
53
- pubKey?: Any | undefined;
54
- votingPower: Long;
55
- proposerPriority: Long;
56
- }
57
-
58
- /** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */
59
- export interface GetBlockByHeightRequest {
60
- height: Long;
61
- }
62
-
63
- /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */
64
- export interface GetBlockByHeightResponse {
65
- blockId?:
66
- | BlockID
67
- | undefined;
68
- /** Deprecated: please use `sdk_block` instead */
69
- block?:
70
- | Block
71
- | undefined;
72
- /** Since: cosmos-sdk 0.47 */
73
- sdkBlock?: Block1 | undefined;
74
- }
75
-
76
- /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */
77
- export interface GetLatestBlockRequest {
78
- }
79
-
80
- /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */
81
- export interface GetLatestBlockResponse {
82
- blockId?:
83
- | BlockID
84
- | undefined;
85
- /** Deprecated: please use `sdk_block` instead */
86
- block?:
87
- | Block
88
- | undefined;
89
- /** Since: cosmos-sdk 0.47 */
90
- sdkBlock?: Block1 | undefined;
91
- }
92
-
93
- /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */
94
- export interface GetSyncingRequest {
95
- }
96
-
97
- /** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */
98
- export interface GetSyncingResponse {
99
- syncing: boolean;
100
- }
101
-
102
- /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */
103
- export interface GetNodeInfoRequest {
104
- }
105
-
106
- /** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */
107
- export interface GetNodeInfoResponse {
108
- defaultNodeInfo?: DefaultNodeInfo | undefined;
109
- applicationVersion?: VersionInfo | undefined;
110
- }
111
-
112
- /** VersionInfo is the type for the GetNodeInfoResponse message. */
113
- export interface VersionInfo {
114
- name: string;
115
- appName: string;
116
- version: string;
117
- gitCommit: string;
118
- buildTags: string;
119
- goVersion: string;
120
- buildDeps: Module[];
121
- /** Since: cosmos-sdk 0.43 */
122
- cosmosSdkVersion: string;
123
- }
124
-
125
- /** Module is the type for VersionInfo */
126
- export interface Module {
127
- /** module path */
128
- path: string;
129
- /** module version */
130
- version: string;
131
- /** checksum */
132
- sum: string;
133
- }
134
-
135
- /** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */
136
- export interface ABCIQueryRequest {
137
- data: Uint8Array;
138
- path: string;
139
- height: Long;
140
- prove: boolean;
141
- }
142
-
143
- /**
144
- * ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query.
145
- *
146
- * Note: This type is a duplicate of the ResponseQuery proto type defined in
147
- * Tendermint.
148
- */
149
- export interface ABCIQueryResponse {
150
- code: number;
151
- /** nondeterministic */
152
- log: string;
153
- /** nondeterministic */
154
- info: string;
155
- index: Long;
156
- key: Uint8Array;
157
- value: Uint8Array;
158
- proofOps?: ProofOps | undefined;
159
- height: Long;
160
- codespace: string;
161
- }
162
-
163
- /**
164
- * ProofOp defines an operation used for calculating Merkle root. The data could
165
- * be arbitrary format, providing necessary data for example neighbouring node
166
- * hash.
167
- *
168
- * Note: This type is a duplicate of the ProofOp proto type defined in Tendermint.
169
- */
170
- export interface ProofOp {
171
- type: string;
172
- key: Uint8Array;
173
- data: Uint8Array;
174
- }
175
-
176
- /**
177
- * ProofOps is Merkle proof defined by the list of ProofOps.
178
- *
179
- * Note: This type is a duplicate of the ProofOps proto type defined in Tendermint.
180
- */
181
- export interface ProofOps {
182
- ops: ProofOp[];
183
- }
184
-
185
- function createBaseGetValidatorSetByHeightRequest(): GetValidatorSetByHeightRequest {
186
- return { height: Long.ZERO, pagination: undefined };
187
- }
188
-
189
- export const GetValidatorSetByHeightRequest = {
190
- encode(message: GetValidatorSetByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
191
- if (!message.height.equals(Long.ZERO)) {
192
- writer.uint32(8).int64(message.height);
193
- }
194
- if (message.pagination !== undefined) {
195
- PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
196
- }
197
- return writer;
198
- },
199
-
200
- decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightRequest {
201
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
202
- let end = length === undefined ? reader.len : reader.pos + length;
203
- const message = createBaseGetValidatorSetByHeightRequest();
204
- while (reader.pos < end) {
205
- const tag = reader.uint32();
206
- switch (tag >>> 3) {
207
- case 1:
208
- if (tag !== 8) {
209
- break;
210
- }
211
-
212
- message.height = reader.int64() as Long;
213
- continue;
214
- case 2:
215
- if (tag !== 18) {
216
- break;
217
- }
218
-
219
- message.pagination = PageRequest.decode(reader, reader.uint32());
220
- continue;
221
- }
222
- if ((tag & 7) === 4 || tag === 0) {
223
- break;
224
- }
225
- reader.skipType(tag & 7);
226
- }
227
- return message;
228
- },
229
-
230
- fromJSON(object: any): GetValidatorSetByHeightRequest {
231
- return {
232
- height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO,
233
- pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined,
234
- };
235
- },
236
-
237
- toJSON(message: GetValidatorSetByHeightRequest): unknown {
238
- const obj: any = {};
239
- if (!message.height.equals(Long.ZERO)) {
240
- obj.height = (message.height || Long.ZERO).toString();
241
- }
242
- if (message.pagination !== undefined) {
243
- obj.pagination = PageRequest.toJSON(message.pagination);
244
- }
245
- return obj;
246
- },
247
-
248
- create<I extends Exact<DeepPartial<GetValidatorSetByHeightRequest>, I>>(base?: I): GetValidatorSetByHeightRequest {
249
- return GetValidatorSetByHeightRequest.fromPartial(base ?? ({} as any));
250
- },
251
- fromPartial<I extends Exact<DeepPartial<GetValidatorSetByHeightRequest>, I>>(
252
- object: I,
253
- ): GetValidatorSetByHeightRequest {
254
- const message = createBaseGetValidatorSetByHeightRequest();
255
- message.height = (object.height !== undefined && object.height !== null)
256
- ? Long.fromValue(object.height)
257
- : Long.ZERO;
258
- message.pagination = (object.pagination !== undefined && object.pagination !== null)
259
- ? PageRequest.fromPartial(object.pagination)
260
- : undefined;
261
- return message;
262
- },
263
- };
264
-
265
- function createBaseGetValidatorSetByHeightResponse(): GetValidatorSetByHeightResponse {
266
- return { blockHeight: Long.ZERO, validators: [], pagination: undefined };
267
- }
268
-
269
- export const GetValidatorSetByHeightResponse = {
270
- encode(message: GetValidatorSetByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
271
- if (!message.blockHeight.equals(Long.ZERO)) {
272
- writer.uint32(8).int64(message.blockHeight);
273
- }
274
- for (const v of message.validators) {
275
- Validator.encode(v!, writer.uint32(18).fork()).ldelim();
276
- }
277
- if (message.pagination !== undefined) {
278
- PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim();
279
- }
280
- return writer;
281
- },
282
-
283
- decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightResponse {
284
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
285
- let end = length === undefined ? reader.len : reader.pos + length;
286
- const message = createBaseGetValidatorSetByHeightResponse();
287
- while (reader.pos < end) {
288
- const tag = reader.uint32();
289
- switch (tag >>> 3) {
290
- case 1:
291
- if (tag !== 8) {
292
- break;
293
- }
294
-
295
- message.blockHeight = reader.int64() as Long;
296
- continue;
297
- case 2:
298
- if (tag !== 18) {
299
- break;
300
- }
301
-
302
- message.validators.push(Validator.decode(reader, reader.uint32()));
303
- continue;
304
- case 3:
305
- if (tag !== 26) {
306
- break;
307
- }
308
-
309
- message.pagination = PageResponse.decode(reader, reader.uint32());
310
- continue;
311
- }
312
- if ((tag & 7) === 4 || tag === 0) {
313
- break;
314
- }
315
- reader.skipType(tag & 7);
316
- }
317
- return message;
318
- },
319
-
320
- fromJSON(object: any): GetValidatorSetByHeightResponse {
321
- return {
322
- blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO,
323
- validators: globalThis.Array.isArray(object?.validators)
324
- ? object.validators.map((e: any) => Validator.fromJSON(e))
325
- : [],
326
- pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined,
327
- };
328
- },
329
-
330
- toJSON(message: GetValidatorSetByHeightResponse): unknown {
331
- const obj: any = {};
332
- if (!message.blockHeight.equals(Long.ZERO)) {
333
- obj.blockHeight = (message.blockHeight || Long.ZERO).toString();
334
- }
335
- if (message.validators?.length) {
336
- obj.validators = message.validators.map((e) => Validator.toJSON(e));
337
- }
338
- if (message.pagination !== undefined) {
339
- obj.pagination = PageResponse.toJSON(message.pagination);
340
- }
341
- return obj;
342
- },
343
-
344
- create<I extends Exact<DeepPartial<GetValidatorSetByHeightResponse>, I>>(base?: I): GetValidatorSetByHeightResponse {
345
- return GetValidatorSetByHeightResponse.fromPartial(base ?? ({} as any));
346
- },
347
- fromPartial<I extends Exact<DeepPartial<GetValidatorSetByHeightResponse>, I>>(
348
- object: I,
349
- ): GetValidatorSetByHeightResponse {
350
- const message = createBaseGetValidatorSetByHeightResponse();
351
- message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null)
352
- ? Long.fromValue(object.blockHeight)
353
- : Long.ZERO;
354
- message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [];
355
- message.pagination = (object.pagination !== undefined && object.pagination !== null)
356
- ? PageResponse.fromPartial(object.pagination)
357
- : undefined;
358
- return message;
359
- },
360
- };
361
-
362
- function createBaseGetLatestValidatorSetRequest(): GetLatestValidatorSetRequest {
363
- return { pagination: undefined };
364
- }
365
-
366
- export const GetLatestValidatorSetRequest = {
367
- encode(message: GetLatestValidatorSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
368
- if (message.pagination !== undefined) {
369
- PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
370
- }
371
- return writer;
372
- },
373
-
374
- decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetRequest {
375
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
376
- let end = length === undefined ? reader.len : reader.pos + length;
377
- const message = createBaseGetLatestValidatorSetRequest();
378
- while (reader.pos < end) {
379
- const tag = reader.uint32();
380
- switch (tag >>> 3) {
381
- case 1:
382
- if (tag !== 10) {
383
- break;
384
- }
385
-
386
- message.pagination = PageRequest.decode(reader, reader.uint32());
387
- continue;
388
- }
389
- if ((tag & 7) === 4 || tag === 0) {
390
- break;
391
- }
392
- reader.skipType(tag & 7);
393
- }
394
- return message;
395
- },
396
-
397
- fromJSON(object: any): GetLatestValidatorSetRequest {
398
- return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined };
399
- },
400
-
401
- toJSON(message: GetLatestValidatorSetRequest): unknown {
402
- const obj: any = {};
403
- if (message.pagination !== undefined) {
404
- obj.pagination = PageRequest.toJSON(message.pagination);
405
- }
406
- return obj;
407
- },
408
-
409
- create<I extends Exact<DeepPartial<GetLatestValidatorSetRequest>, I>>(base?: I): GetLatestValidatorSetRequest {
410
- return GetLatestValidatorSetRequest.fromPartial(base ?? ({} as any));
411
- },
412
- fromPartial<I extends Exact<DeepPartial<GetLatestValidatorSetRequest>, I>>(object: I): GetLatestValidatorSetRequest {
413
- const message = createBaseGetLatestValidatorSetRequest();
414
- message.pagination = (object.pagination !== undefined && object.pagination !== null)
415
- ? PageRequest.fromPartial(object.pagination)
416
- : undefined;
417
- return message;
418
- },
419
- };
420
-
421
- function createBaseGetLatestValidatorSetResponse(): GetLatestValidatorSetResponse {
422
- return { blockHeight: Long.ZERO, validators: [], pagination: undefined };
423
- }
424
-
425
- export const GetLatestValidatorSetResponse = {
426
- encode(message: GetLatestValidatorSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
427
- if (!message.blockHeight.equals(Long.ZERO)) {
428
- writer.uint32(8).int64(message.blockHeight);
429
- }
430
- for (const v of message.validators) {
431
- Validator.encode(v!, writer.uint32(18).fork()).ldelim();
432
- }
433
- if (message.pagination !== undefined) {
434
- PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim();
435
- }
436
- return writer;
437
- },
438
-
439
- decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetResponse {
440
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
441
- let end = length === undefined ? reader.len : reader.pos + length;
442
- const message = createBaseGetLatestValidatorSetResponse();
443
- while (reader.pos < end) {
444
- const tag = reader.uint32();
445
- switch (tag >>> 3) {
446
- case 1:
447
- if (tag !== 8) {
448
- break;
449
- }
450
-
451
- message.blockHeight = reader.int64() as Long;
452
- continue;
453
- case 2:
454
- if (tag !== 18) {
455
- break;
456
- }
457
-
458
- message.validators.push(Validator.decode(reader, reader.uint32()));
459
- continue;
460
- case 3:
461
- if (tag !== 26) {
462
- break;
463
- }
464
-
465
- message.pagination = PageResponse.decode(reader, reader.uint32());
466
- continue;
467
- }
468
- if ((tag & 7) === 4 || tag === 0) {
469
- break;
470
- }
471
- reader.skipType(tag & 7);
472
- }
473
- return message;
474
- },
475
-
476
- fromJSON(object: any): GetLatestValidatorSetResponse {
477
- return {
478
- blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO,
479
- validators: globalThis.Array.isArray(object?.validators)
480
- ? object.validators.map((e: any) => Validator.fromJSON(e))
481
- : [],
482
- pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined,
483
- };
484
- },
485
-
486
- toJSON(message: GetLatestValidatorSetResponse): unknown {
487
- const obj: any = {};
488
- if (!message.blockHeight.equals(Long.ZERO)) {
489
- obj.blockHeight = (message.blockHeight || Long.ZERO).toString();
490
- }
491
- if (message.validators?.length) {
492
- obj.validators = message.validators.map((e) => Validator.toJSON(e));
493
- }
494
- if (message.pagination !== undefined) {
495
- obj.pagination = PageResponse.toJSON(message.pagination);
496
- }
497
- return obj;
498
- },
499
-
500
- create<I extends Exact<DeepPartial<GetLatestValidatorSetResponse>, I>>(base?: I): GetLatestValidatorSetResponse {
501
- return GetLatestValidatorSetResponse.fromPartial(base ?? ({} as any));
502
- },
503
- fromPartial<I extends Exact<DeepPartial<GetLatestValidatorSetResponse>, I>>(
504
- object: I,
505
- ): GetLatestValidatorSetResponse {
506
- const message = createBaseGetLatestValidatorSetResponse();
507
- message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null)
508
- ? Long.fromValue(object.blockHeight)
509
- : Long.ZERO;
510
- message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [];
511
- message.pagination = (object.pagination !== undefined && object.pagination !== null)
512
- ? PageResponse.fromPartial(object.pagination)
513
- : undefined;
514
- return message;
515
- },
516
- };
517
-
518
- function createBaseValidator(): Validator {
519
- return { address: "", pubKey: undefined, votingPower: Long.ZERO, proposerPriority: Long.ZERO };
520
- }
521
-
522
- export const Validator = {
523
- encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
524
- if (message.address !== "") {
525
- writer.uint32(10).string(message.address);
526
- }
527
- if (message.pubKey !== undefined) {
528
- Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim();
529
- }
530
- if (!message.votingPower.equals(Long.ZERO)) {
531
- writer.uint32(24).int64(message.votingPower);
532
- }
533
- if (!message.proposerPriority.equals(Long.ZERO)) {
534
- writer.uint32(32).int64(message.proposerPriority);
535
- }
536
- return writer;
537
- },
538
-
539
- decode(input: _m0.Reader | Uint8Array, length?: number): Validator {
540
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
541
- let end = length === undefined ? reader.len : reader.pos + length;
542
- const message = createBaseValidator();
543
- while (reader.pos < end) {
544
- const tag = reader.uint32();
545
- switch (tag >>> 3) {
546
- case 1:
547
- if (tag !== 10) {
548
- break;
549
- }
550
-
551
- message.address = reader.string();
552
- continue;
553
- case 2:
554
- if (tag !== 18) {
555
- break;
556
- }
557
-
558
- message.pubKey = Any.decode(reader, reader.uint32());
559
- continue;
560
- case 3:
561
- if (tag !== 24) {
562
- break;
563
- }
564
-
565
- message.votingPower = reader.int64() as Long;
566
- continue;
567
- case 4:
568
- if (tag !== 32) {
569
- break;
570
- }
571
-
572
- message.proposerPriority = reader.int64() as Long;
573
- continue;
574
- }
575
- if ((tag & 7) === 4 || tag === 0) {
576
- break;
577
- }
578
- reader.skipType(tag & 7);
579
- }
580
- return message;
581
- },
582
-
583
- fromJSON(object: any): Validator {
584
- return {
585
- address: isSet(object.address) ? globalThis.String(object.address) : "",
586
- pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined,
587
- votingPower: isSet(object.votingPower) ? Long.fromValue(object.votingPower) : Long.ZERO,
588
- proposerPriority: isSet(object.proposerPriority) ? Long.fromValue(object.proposerPriority) : Long.ZERO,
589
- };
590
- },
591
-
592
- toJSON(message: Validator): unknown {
593
- const obj: any = {};
594
- if (message.address !== "") {
595
- obj.address = message.address;
596
- }
597
- if (message.pubKey !== undefined) {
598
- obj.pubKey = Any.toJSON(message.pubKey);
599
- }
600
- if (!message.votingPower.equals(Long.ZERO)) {
601
- obj.votingPower = (message.votingPower || Long.ZERO).toString();
602
- }
603
- if (!message.proposerPriority.equals(Long.ZERO)) {
604
- obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString();
605
- }
606
- return obj;
607
- },
608
-
609
- create<I extends Exact<DeepPartial<Validator>, I>>(base?: I): Validator {
610
- return Validator.fromPartial(base ?? ({} as any));
611
- },
612
- fromPartial<I extends Exact<DeepPartial<Validator>, I>>(object: I): Validator {
613
- const message = createBaseValidator();
614
- message.address = object.address ?? "";
615
- message.pubKey = (object.pubKey !== undefined && object.pubKey !== null)
616
- ? Any.fromPartial(object.pubKey)
617
- : undefined;
618
- message.votingPower = (object.votingPower !== undefined && object.votingPower !== null)
619
- ? Long.fromValue(object.votingPower)
620
- : Long.ZERO;
621
- message.proposerPriority = (object.proposerPriority !== undefined && object.proposerPriority !== null)
622
- ? Long.fromValue(object.proposerPriority)
623
- : Long.ZERO;
624
- return message;
625
- },
626
- };
627
-
628
- function createBaseGetBlockByHeightRequest(): GetBlockByHeightRequest {
629
- return { height: Long.ZERO };
630
- }
631
-
632
- export const GetBlockByHeightRequest = {
633
- encode(message: GetBlockByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
634
- if (!message.height.equals(Long.ZERO)) {
635
- writer.uint32(8).int64(message.height);
636
- }
637
- return writer;
638
- },
639
-
640
- decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightRequest {
641
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
642
- let end = length === undefined ? reader.len : reader.pos + length;
643
- const message = createBaseGetBlockByHeightRequest();
644
- while (reader.pos < end) {
645
- const tag = reader.uint32();
646
- switch (tag >>> 3) {
647
- case 1:
648
- if (tag !== 8) {
649
- break;
650
- }
651
-
652
- message.height = reader.int64() as Long;
653
- continue;
654
- }
655
- if ((tag & 7) === 4 || tag === 0) {
656
- break;
657
- }
658
- reader.skipType(tag & 7);
659
- }
660
- return message;
661
- },
662
-
663
- fromJSON(object: any): GetBlockByHeightRequest {
664
- return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO };
665
- },
666
-
667
- toJSON(message: GetBlockByHeightRequest): unknown {
668
- const obj: any = {};
669
- if (!message.height.equals(Long.ZERO)) {
670
- obj.height = (message.height || Long.ZERO).toString();
671
- }
672
- return obj;
673
- },
674
-
675
- create<I extends Exact<DeepPartial<GetBlockByHeightRequest>, I>>(base?: I): GetBlockByHeightRequest {
676
- return GetBlockByHeightRequest.fromPartial(base ?? ({} as any));
677
- },
678
- fromPartial<I extends Exact<DeepPartial<GetBlockByHeightRequest>, I>>(object: I): GetBlockByHeightRequest {
679
- const message = createBaseGetBlockByHeightRequest();
680
- message.height = (object.height !== undefined && object.height !== null)
681
- ? Long.fromValue(object.height)
682
- : Long.ZERO;
683
- return message;
684
- },
685
- };
686
-
687
- function createBaseGetBlockByHeightResponse(): GetBlockByHeightResponse {
688
- return { blockId: undefined, block: undefined, sdkBlock: undefined };
689
- }
690
-
691
- export const GetBlockByHeightResponse = {
692
- encode(message: GetBlockByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
693
- if (message.blockId !== undefined) {
694
- BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim();
695
- }
696
- if (message.block !== undefined) {
697
- Block.encode(message.block, writer.uint32(18).fork()).ldelim();
698
- }
699
- if (message.sdkBlock !== undefined) {
700
- Block1.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim();
701
- }
702
- return writer;
703
- },
704
-
705
- decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightResponse {
706
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
707
- let end = length === undefined ? reader.len : reader.pos + length;
708
- const message = createBaseGetBlockByHeightResponse();
709
- while (reader.pos < end) {
710
- const tag = reader.uint32();
711
- switch (tag >>> 3) {
712
- case 1:
713
- if (tag !== 10) {
714
- break;
715
- }
716
-
717
- message.blockId = BlockID.decode(reader, reader.uint32());
718
- continue;
719
- case 2:
720
- if (tag !== 18) {
721
- break;
722
- }
723
-
724
- message.block = Block.decode(reader, reader.uint32());
725
- continue;
726
- case 3:
727
- if (tag !== 26) {
728
- break;
729
- }
730
-
731
- message.sdkBlock = Block1.decode(reader, reader.uint32());
732
- continue;
733
- }
734
- if ((tag & 7) === 4 || tag === 0) {
735
- break;
736
- }
737
- reader.skipType(tag & 7);
738
- }
739
- return message;
740
- },
741
-
742
- fromJSON(object: any): GetBlockByHeightResponse {
743
- return {
744
- blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined,
745
- block: isSet(object.block) ? Block.fromJSON(object.block) : undefined,
746
- sdkBlock: isSet(object.sdkBlock) ? Block1.fromJSON(object.sdkBlock) : undefined,
747
- };
748
- },
749
-
750
- toJSON(message: GetBlockByHeightResponse): unknown {
751
- const obj: any = {};
752
- if (message.blockId !== undefined) {
753
- obj.blockId = BlockID.toJSON(message.blockId);
754
- }
755
- if (message.block !== undefined) {
756
- obj.block = Block.toJSON(message.block);
757
- }
758
- if (message.sdkBlock !== undefined) {
759
- obj.sdkBlock = Block1.toJSON(message.sdkBlock);
760
- }
761
- return obj;
762
- },
763
-
764
- create<I extends Exact<DeepPartial<GetBlockByHeightResponse>, I>>(base?: I): GetBlockByHeightResponse {
765
- return GetBlockByHeightResponse.fromPartial(base ?? ({} as any));
766
- },
767
- fromPartial<I extends Exact<DeepPartial<GetBlockByHeightResponse>, I>>(object: I): GetBlockByHeightResponse {
768
- const message = createBaseGetBlockByHeightResponse();
769
- message.blockId = (object.blockId !== undefined && object.blockId !== null)
770
- ? BlockID.fromPartial(object.blockId)
771
- : undefined;
772
- message.block = (object.block !== undefined && object.block !== null) ? Block.fromPartial(object.block) : undefined;
773
- message.sdkBlock = (object.sdkBlock !== undefined && object.sdkBlock !== null)
774
- ? Block1.fromPartial(object.sdkBlock)
775
- : undefined;
776
- return message;
777
- },
778
- };
779
-
780
- function createBaseGetLatestBlockRequest(): GetLatestBlockRequest {
781
- return {};
782
- }
783
-
784
- export const GetLatestBlockRequest = {
785
- encode(_: GetLatestBlockRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
786
- return writer;
787
- },
788
-
789
- decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockRequest {
790
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
791
- let end = length === undefined ? reader.len : reader.pos + length;
792
- const message = createBaseGetLatestBlockRequest();
793
- while (reader.pos < end) {
794
- const tag = reader.uint32();
795
- switch (tag >>> 3) {
796
- }
797
- if ((tag & 7) === 4 || tag === 0) {
798
- break;
799
- }
800
- reader.skipType(tag & 7);
801
- }
802
- return message;
803
- },
804
-
805
- fromJSON(_: any): GetLatestBlockRequest {
806
- return {};
807
- },
808
-
809
- toJSON(_: GetLatestBlockRequest): unknown {
810
- const obj: any = {};
811
- return obj;
812
- },
813
-
814
- create<I extends Exact<DeepPartial<GetLatestBlockRequest>, I>>(base?: I): GetLatestBlockRequest {
815
- return GetLatestBlockRequest.fromPartial(base ?? ({} as any));
816
- },
817
- fromPartial<I extends Exact<DeepPartial<GetLatestBlockRequest>, I>>(_: I): GetLatestBlockRequest {
818
- const message = createBaseGetLatestBlockRequest();
819
- return message;
820
- },
821
- };
822
-
823
- function createBaseGetLatestBlockResponse(): GetLatestBlockResponse {
824
- return { blockId: undefined, block: undefined, sdkBlock: undefined };
825
- }
826
-
827
- export const GetLatestBlockResponse = {
828
- encode(message: GetLatestBlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
829
- if (message.blockId !== undefined) {
830
- BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim();
831
- }
832
- if (message.block !== undefined) {
833
- Block.encode(message.block, writer.uint32(18).fork()).ldelim();
834
- }
835
- if (message.sdkBlock !== undefined) {
836
- Block1.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim();
837
- }
838
- return writer;
839
- },
840
-
841
- decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockResponse {
842
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
843
- let end = length === undefined ? reader.len : reader.pos + length;
844
- const message = createBaseGetLatestBlockResponse();
845
- while (reader.pos < end) {
846
- const tag = reader.uint32();
847
- switch (tag >>> 3) {
848
- case 1:
849
- if (tag !== 10) {
850
- break;
851
- }
852
-
853
- message.blockId = BlockID.decode(reader, reader.uint32());
854
- continue;
855
- case 2:
856
- if (tag !== 18) {
857
- break;
858
- }
859
-
860
- message.block = Block.decode(reader, reader.uint32());
861
- continue;
862
- case 3:
863
- if (tag !== 26) {
864
- break;
865
- }
866
-
867
- message.sdkBlock = Block1.decode(reader, reader.uint32());
868
- continue;
869
- }
870
- if ((tag & 7) === 4 || tag === 0) {
871
- break;
872
- }
873
- reader.skipType(tag & 7);
874
- }
875
- return message;
876
- },
877
-
878
- fromJSON(object: any): GetLatestBlockResponse {
879
- return {
880
- blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined,
881
- block: isSet(object.block) ? Block.fromJSON(object.block) : undefined,
882
- sdkBlock: isSet(object.sdkBlock) ? Block1.fromJSON(object.sdkBlock) : undefined,
883
- };
884
- },
885
-
886
- toJSON(message: GetLatestBlockResponse): unknown {
887
- const obj: any = {};
888
- if (message.blockId !== undefined) {
889
- obj.blockId = BlockID.toJSON(message.blockId);
890
- }
891
- if (message.block !== undefined) {
892
- obj.block = Block.toJSON(message.block);
893
- }
894
- if (message.sdkBlock !== undefined) {
895
- obj.sdkBlock = Block1.toJSON(message.sdkBlock);
896
- }
897
- return obj;
898
- },
899
-
900
- create<I extends Exact<DeepPartial<GetLatestBlockResponse>, I>>(base?: I): GetLatestBlockResponse {
901
- return GetLatestBlockResponse.fromPartial(base ?? ({} as any));
902
- },
903
- fromPartial<I extends Exact<DeepPartial<GetLatestBlockResponse>, I>>(object: I): GetLatestBlockResponse {
904
- const message = createBaseGetLatestBlockResponse();
905
- message.blockId = (object.blockId !== undefined && object.blockId !== null)
906
- ? BlockID.fromPartial(object.blockId)
907
- : undefined;
908
- message.block = (object.block !== undefined && object.block !== null) ? Block.fromPartial(object.block) : undefined;
909
- message.sdkBlock = (object.sdkBlock !== undefined && object.sdkBlock !== null)
910
- ? Block1.fromPartial(object.sdkBlock)
911
- : undefined;
912
- return message;
913
- },
914
- };
915
-
916
- function createBaseGetSyncingRequest(): GetSyncingRequest {
917
- return {};
918
- }
919
-
920
- export const GetSyncingRequest = {
921
- encode(_: GetSyncingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
922
- return writer;
923
- },
924
-
925
- decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingRequest {
926
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
927
- let end = length === undefined ? reader.len : reader.pos + length;
928
- const message = createBaseGetSyncingRequest();
929
- while (reader.pos < end) {
930
- const tag = reader.uint32();
931
- switch (tag >>> 3) {
932
- }
933
- if ((tag & 7) === 4 || tag === 0) {
934
- break;
935
- }
936
- reader.skipType(tag & 7);
937
- }
938
- return message;
939
- },
940
-
941
- fromJSON(_: any): GetSyncingRequest {
942
- return {};
943
- },
944
-
945
- toJSON(_: GetSyncingRequest): unknown {
946
- const obj: any = {};
947
- return obj;
948
- },
949
-
950
- create<I extends Exact<DeepPartial<GetSyncingRequest>, I>>(base?: I): GetSyncingRequest {
951
- return GetSyncingRequest.fromPartial(base ?? ({} as any));
952
- },
953
- fromPartial<I extends Exact<DeepPartial<GetSyncingRequest>, I>>(_: I): GetSyncingRequest {
954
- const message = createBaseGetSyncingRequest();
955
- return message;
956
- },
957
- };
958
-
959
- function createBaseGetSyncingResponse(): GetSyncingResponse {
960
- return { syncing: false };
961
- }
962
-
963
- export const GetSyncingResponse = {
964
- encode(message: GetSyncingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
965
- if (message.syncing !== false) {
966
- writer.uint32(8).bool(message.syncing);
967
- }
968
- return writer;
969
- },
970
-
971
- decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingResponse {
972
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
973
- let end = length === undefined ? reader.len : reader.pos + length;
974
- const message = createBaseGetSyncingResponse();
975
- while (reader.pos < end) {
976
- const tag = reader.uint32();
977
- switch (tag >>> 3) {
978
- case 1:
979
- if (tag !== 8) {
980
- break;
981
- }
982
-
983
- message.syncing = reader.bool();
984
- continue;
985
- }
986
- if ((tag & 7) === 4 || tag === 0) {
987
- break;
988
- }
989
- reader.skipType(tag & 7);
990
- }
991
- return message;
992
- },
993
-
994
- fromJSON(object: any): GetSyncingResponse {
995
- return { syncing: isSet(object.syncing) ? globalThis.Boolean(object.syncing) : false };
996
- },
997
-
998
- toJSON(message: GetSyncingResponse): unknown {
999
- const obj: any = {};
1000
- if (message.syncing !== false) {
1001
- obj.syncing = message.syncing;
1002
- }
1003
- return obj;
1004
- },
1005
-
1006
- create<I extends Exact<DeepPartial<GetSyncingResponse>, I>>(base?: I): GetSyncingResponse {
1007
- return GetSyncingResponse.fromPartial(base ?? ({} as any));
1008
- },
1009
- fromPartial<I extends Exact<DeepPartial<GetSyncingResponse>, I>>(object: I): GetSyncingResponse {
1010
- const message = createBaseGetSyncingResponse();
1011
- message.syncing = object.syncing ?? false;
1012
- return message;
1013
- },
1014
- };
1015
-
1016
- function createBaseGetNodeInfoRequest(): GetNodeInfoRequest {
1017
- return {};
1018
- }
1019
-
1020
- export const GetNodeInfoRequest = {
1021
- encode(_: GetNodeInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1022
- return writer;
1023
- },
1024
-
1025
- decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoRequest {
1026
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1027
- let end = length === undefined ? reader.len : reader.pos + length;
1028
- const message = createBaseGetNodeInfoRequest();
1029
- while (reader.pos < end) {
1030
- const tag = reader.uint32();
1031
- switch (tag >>> 3) {
1032
- }
1033
- if ((tag & 7) === 4 || tag === 0) {
1034
- break;
1035
- }
1036
- reader.skipType(tag & 7);
1037
- }
1038
- return message;
1039
- },
1040
-
1041
- fromJSON(_: any): GetNodeInfoRequest {
1042
- return {};
1043
- },
1044
-
1045
- toJSON(_: GetNodeInfoRequest): unknown {
1046
- const obj: any = {};
1047
- return obj;
1048
- },
1049
-
1050
- create<I extends Exact<DeepPartial<GetNodeInfoRequest>, I>>(base?: I): GetNodeInfoRequest {
1051
- return GetNodeInfoRequest.fromPartial(base ?? ({} as any));
1052
- },
1053
- fromPartial<I extends Exact<DeepPartial<GetNodeInfoRequest>, I>>(_: I): GetNodeInfoRequest {
1054
- const message = createBaseGetNodeInfoRequest();
1055
- return message;
1056
- },
1057
- };
1058
-
1059
- function createBaseGetNodeInfoResponse(): GetNodeInfoResponse {
1060
- return { defaultNodeInfo: undefined, applicationVersion: undefined };
1061
- }
1062
-
1063
- export const GetNodeInfoResponse = {
1064
- encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1065
- if (message.defaultNodeInfo !== undefined) {
1066
- DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim();
1067
- }
1068
- if (message.applicationVersion !== undefined) {
1069
- VersionInfo.encode(message.applicationVersion, writer.uint32(18).fork()).ldelim();
1070
- }
1071
- return writer;
1072
- },
1073
-
1074
- decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoResponse {
1075
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1076
- let end = length === undefined ? reader.len : reader.pos + length;
1077
- const message = createBaseGetNodeInfoResponse();
1078
- while (reader.pos < end) {
1079
- const tag = reader.uint32();
1080
- switch (tag >>> 3) {
1081
- case 1:
1082
- if (tag !== 10) {
1083
- break;
1084
- }
1085
-
1086
- message.defaultNodeInfo = DefaultNodeInfo.decode(reader, reader.uint32());
1087
- continue;
1088
- case 2:
1089
- if (tag !== 18) {
1090
- break;
1091
- }
1092
-
1093
- message.applicationVersion = VersionInfo.decode(reader, reader.uint32());
1094
- continue;
1095
- }
1096
- if ((tag & 7) === 4 || tag === 0) {
1097
- break;
1098
- }
1099
- reader.skipType(tag & 7);
1100
- }
1101
- return message;
1102
- },
1103
-
1104
- fromJSON(object: any): GetNodeInfoResponse {
1105
- return {
1106
- defaultNodeInfo: isSet(object.defaultNodeInfo) ? DefaultNodeInfo.fromJSON(object.defaultNodeInfo) : undefined,
1107
- applicationVersion: isSet(object.applicationVersion)
1108
- ? VersionInfo.fromJSON(object.applicationVersion)
1109
- : undefined,
1110
- };
1111
- },
1112
-
1113
- toJSON(message: GetNodeInfoResponse): unknown {
1114
- const obj: any = {};
1115
- if (message.defaultNodeInfo !== undefined) {
1116
- obj.defaultNodeInfo = DefaultNodeInfo.toJSON(message.defaultNodeInfo);
1117
- }
1118
- if (message.applicationVersion !== undefined) {
1119
- obj.applicationVersion = VersionInfo.toJSON(message.applicationVersion);
1120
- }
1121
- return obj;
1122
- },
1123
-
1124
- create<I extends Exact<DeepPartial<GetNodeInfoResponse>, I>>(base?: I): GetNodeInfoResponse {
1125
- return GetNodeInfoResponse.fromPartial(base ?? ({} as any));
1126
- },
1127
- fromPartial<I extends Exact<DeepPartial<GetNodeInfoResponse>, I>>(object: I): GetNodeInfoResponse {
1128
- const message = createBaseGetNodeInfoResponse();
1129
- message.defaultNodeInfo = (object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null)
1130
- ? DefaultNodeInfo.fromPartial(object.defaultNodeInfo)
1131
- : undefined;
1132
- message.applicationVersion = (object.applicationVersion !== undefined && object.applicationVersion !== null)
1133
- ? VersionInfo.fromPartial(object.applicationVersion)
1134
- : undefined;
1135
- return message;
1136
- },
1137
- };
1138
-
1139
- function createBaseVersionInfo(): VersionInfo {
1140
- return {
1141
- name: "",
1142
- appName: "",
1143
- version: "",
1144
- gitCommit: "",
1145
- buildTags: "",
1146
- goVersion: "",
1147
- buildDeps: [],
1148
- cosmosSdkVersion: "",
1149
- };
1150
- }
1151
-
1152
- export const VersionInfo = {
1153
- encode(message: VersionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1154
- if (message.name !== "") {
1155
- writer.uint32(10).string(message.name);
1156
- }
1157
- if (message.appName !== "") {
1158
- writer.uint32(18).string(message.appName);
1159
- }
1160
- if (message.version !== "") {
1161
- writer.uint32(26).string(message.version);
1162
- }
1163
- if (message.gitCommit !== "") {
1164
- writer.uint32(34).string(message.gitCommit);
1165
- }
1166
- if (message.buildTags !== "") {
1167
- writer.uint32(42).string(message.buildTags);
1168
- }
1169
- if (message.goVersion !== "") {
1170
- writer.uint32(50).string(message.goVersion);
1171
- }
1172
- for (const v of message.buildDeps) {
1173
- Module.encode(v!, writer.uint32(58).fork()).ldelim();
1174
- }
1175
- if (message.cosmosSdkVersion !== "") {
1176
- writer.uint32(66).string(message.cosmosSdkVersion);
1177
- }
1178
- return writer;
1179
- },
1180
-
1181
- decode(input: _m0.Reader | Uint8Array, length?: number): VersionInfo {
1182
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1183
- let end = length === undefined ? reader.len : reader.pos + length;
1184
- const message = createBaseVersionInfo();
1185
- while (reader.pos < end) {
1186
- const tag = reader.uint32();
1187
- switch (tag >>> 3) {
1188
- case 1:
1189
- if (tag !== 10) {
1190
- break;
1191
- }
1192
-
1193
- message.name = reader.string();
1194
- continue;
1195
- case 2:
1196
- if (tag !== 18) {
1197
- break;
1198
- }
1199
-
1200
- message.appName = reader.string();
1201
- continue;
1202
- case 3:
1203
- if (tag !== 26) {
1204
- break;
1205
- }
1206
-
1207
- message.version = reader.string();
1208
- continue;
1209
- case 4:
1210
- if (tag !== 34) {
1211
- break;
1212
- }
1213
-
1214
- message.gitCommit = reader.string();
1215
- continue;
1216
- case 5:
1217
- if (tag !== 42) {
1218
- break;
1219
- }
1220
-
1221
- message.buildTags = reader.string();
1222
- continue;
1223
- case 6:
1224
- if (tag !== 50) {
1225
- break;
1226
- }
1227
-
1228
- message.goVersion = reader.string();
1229
- continue;
1230
- case 7:
1231
- if (tag !== 58) {
1232
- break;
1233
- }
1234
-
1235
- message.buildDeps.push(Module.decode(reader, reader.uint32()));
1236
- continue;
1237
- case 8:
1238
- if (tag !== 66) {
1239
- break;
1240
- }
1241
-
1242
- message.cosmosSdkVersion = reader.string();
1243
- continue;
1244
- }
1245
- if ((tag & 7) === 4 || tag === 0) {
1246
- break;
1247
- }
1248
- reader.skipType(tag & 7);
1249
- }
1250
- return message;
1251
- },
1252
-
1253
- fromJSON(object: any): VersionInfo {
1254
- return {
1255
- name: isSet(object.name) ? globalThis.String(object.name) : "",
1256
- appName: isSet(object.appName) ? globalThis.String(object.appName) : "",
1257
- version: isSet(object.version) ? globalThis.String(object.version) : "",
1258
- gitCommit: isSet(object.gitCommit) ? globalThis.String(object.gitCommit) : "",
1259
- buildTags: isSet(object.buildTags) ? globalThis.String(object.buildTags) : "",
1260
- goVersion: isSet(object.goVersion) ? globalThis.String(object.goVersion) : "",
1261
- buildDeps: globalThis.Array.isArray(object?.buildDeps)
1262
- ? object.buildDeps.map((e: any) => Module.fromJSON(e))
1263
- : [],
1264
- cosmosSdkVersion: isSet(object.cosmosSdkVersion) ? globalThis.String(object.cosmosSdkVersion) : "",
1265
- };
1266
- },
1267
-
1268
- toJSON(message: VersionInfo): unknown {
1269
- const obj: any = {};
1270
- if (message.name !== "") {
1271
- obj.name = message.name;
1272
- }
1273
- if (message.appName !== "") {
1274
- obj.appName = message.appName;
1275
- }
1276
- if (message.version !== "") {
1277
- obj.version = message.version;
1278
- }
1279
- if (message.gitCommit !== "") {
1280
- obj.gitCommit = message.gitCommit;
1281
- }
1282
- if (message.buildTags !== "") {
1283
- obj.buildTags = message.buildTags;
1284
- }
1285
- if (message.goVersion !== "") {
1286
- obj.goVersion = message.goVersion;
1287
- }
1288
- if (message.buildDeps?.length) {
1289
- obj.buildDeps = message.buildDeps.map((e) => Module.toJSON(e));
1290
- }
1291
- if (message.cosmosSdkVersion !== "") {
1292
- obj.cosmosSdkVersion = message.cosmosSdkVersion;
1293
- }
1294
- return obj;
1295
- },
1296
-
1297
- create<I extends Exact<DeepPartial<VersionInfo>, I>>(base?: I): VersionInfo {
1298
- return VersionInfo.fromPartial(base ?? ({} as any));
1299
- },
1300
- fromPartial<I extends Exact<DeepPartial<VersionInfo>, I>>(object: I): VersionInfo {
1301
- const message = createBaseVersionInfo();
1302
- message.name = object.name ?? "";
1303
- message.appName = object.appName ?? "";
1304
- message.version = object.version ?? "";
1305
- message.gitCommit = object.gitCommit ?? "";
1306
- message.buildTags = object.buildTags ?? "";
1307
- message.goVersion = object.goVersion ?? "";
1308
- message.buildDeps = object.buildDeps?.map((e) => Module.fromPartial(e)) || [];
1309
- message.cosmosSdkVersion = object.cosmosSdkVersion ?? "";
1310
- return message;
1311
- },
1312
- };
1313
-
1314
- function createBaseModule(): Module {
1315
- return { path: "", version: "", sum: "" };
1316
- }
1317
-
1318
- export const Module = {
1319
- encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1320
- if (message.path !== "") {
1321
- writer.uint32(10).string(message.path);
1322
- }
1323
- if (message.version !== "") {
1324
- writer.uint32(18).string(message.version);
1325
- }
1326
- if (message.sum !== "") {
1327
- writer.uint32(26).string(message.sum);
1328
- }
1329
- return writer;
1330
- },
1331
-
1332
- decode(input: _m0.Reader | Uint8Array, length?: number): Module {
1333
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1334
- let end = length === undefined ? reader.len : reader.pos + length;
1335
- const message = createBaseModule();
1336
- while (reader.pos < end) {
1337
- const tag = reader.uint32();
1338
- switch (tag >>> 3) {
1339
- case 1:
1340
- if (tag !== 10) {
1341
- break;
1342
- }
1343
-
1344
- message.path = reader.string();
1345
- continue;
1346
- case 2:
1347
- if (tag !== 18) {
1348
- break;
1349
- }
1350
-
1351
- message.version = reader.string();
1352
- continue;
1353
- case 3:
1354
- if (tag !== 26) {
1355
- break;
1356
- }
1357
-
1358
- message.sum = reader.string();
1359
- continue;
1360
- }
1361
- if ((tag & 7) === 4 || tag === 0) {
1362
- break;
1363
- }
1364
- reader.skipType(tag & 7);
1365
- }
1366
- return message;
1367
- },
1368
-
1369
- fromJSON(object: any): Module {
1370
- return {
1371
- path: isSet(object.path) ? globalThis.String(object.path) : "",
1372
- version: isSet(object.version) ? globalThis.String(object.version) : "",
1373
- sum: isSet(object.sum) ? globalThis.String(object.sum) : "",
1374
- };
1375
- },
1376
-
1377
- toJSON(message: Module): unknown {
1378
- const obj: any = {};
1379
- if (message.path !== "") {
1380
- obj.path = message.path;
1381
- }
1382
- if (message.version !== "") {
1383
- obj.version = message.version;
1384
- }
1385
- if (message.sum !== "") {
1386
- obj.sum = message.sum;
1387
- }
1388
- return obj;
1389
- },
1390
-
1391
- create<I extends Exact<DeepPartial<Module>, I>>(base?: I): Module {
1392
- return Module.fromPartial(base ?? ({} as any));
1393
- },
1394
- fromPartial<I extends Exact<DeepPartial<Module>, I>>(object: I): Module {
1395
- const message = createBaseModule();
1396
- message.path = object.path ?? "";
1397
- message.version = object.version ?? "";
1398
- message.sum = object.sum ?? "";
1399
- return message;
1400
- },
1401
- };
1402
-
1403
- function createBaseABCIQueryRequest(): ABCIQueryRequest {
1404
- return { data: new Uint8Array(0), path: "", height: Long.ZERO, prove: false };
1405
- }
1406
-
1407
- export const ABCIQueryRequest = {
1408
- encode(message: ABCIQueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1409
- if (message.data.length !== 0) {
1410
- writer.uint32(10).bytes(message.data);
1411
- }
1412
- if (message.path !== "") {
1413
- writer.uint32(18).string(message.path);
1414
- }
1415
- if (!message.height.equals(Long.ZERO)) {
1416
- writer.uint32(24).int64(message.height);
1417
- }
1418
- if (message.prove !== false) {
1419
- writer.uint32(32).bool(message.prove);
1420
- }
1421
- return writer;
1422
- },
1423
-
1424
- decode(input: _m0.Reader | Uint8Array, length?: number): ABCIQueryRequest {
1425
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1426
- let end = length === undefined ? reader.len : reader.pos + length;
1427
- const message = createBaseABCIQueryRequest();
1428
- while (reader.pos < end) {
1429
- const tag = reader.uint32();
1430
- switch (tag >>> 3) {
1431
- case 1:
1432
- if (tag !== 10) {
1433
- break;
1434
- }
1435
-
1436
- message.data = reader.bytes();
1437
- continue;
1438
- case 2:
1439
- if (tag !== 18) {
1440
- break;
1441
- }
1442
-
1443
- message.path = reader.string();
1444
- continue;
1445
- case 3:
1446
- if (tag !== 24) {
1447
- break;
1448
- }
1449
-
1450
- message.height = reader.int64() as Long;
1451
- continue;
1452
- case 4:
1453
- if (tag !== 32) {
1454
- break;
1455
- }
1456
-
1457
- message.prove = reader.bool();
1458
- continue;
1459
- }
1460
- if ((tag & 7) === 4 || tag === 0) {
1461
- break;
1462
- }
1463
- reader.skipType(tag & 7);
1464
- }
1465
- return message;
1466
- },
1467
-
1468
- fromJSON(object: any): ABCIQueryRequest {
1469
- return {
1470
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
1471
- path: isSet(object.path) ? globalThis.String(object.path) : "",
1472
- height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO,
1473
- prove: isSet(object.prove) ? globalThis.Boolean(object.prove) : false,
1474
- };
1475
- },
1476
-
1477
- toJSON(message: ABCIQueryRequest): unknown {
1478
- const obj: any = {};
1479
- if (message.data.length !== 0) {
1480
- obj.data = base64FromBytes(message.data);
1481
- }
1482
- if (message.path !== "") {
1483
- obj.path = message.path;
1484
- }
1485
- if (!message.height.equals(Long.ZERO)) {
1486
- obj.height = (message.height || Long.ZERO).toString();
1487
- }
1488
- if (message.prove !== false) {
1489
- obj.prove = message.prove;
1490
- }
1491
- return obj;
1492
- },
1493
-
1494
- create<I extends Exact<DeepPartial<ABCIQueryRequest>, I>>(base?: I): ABCIQueryRequest {
1495
- return ABCIQueryRequest.fromPartial(base ?? ({} as any));
1496
- },
1497
- fromPartial<I extends Exact<DeepPartial<ABCIQueryRequest>, I>>(object: I): ABCIQueryRequest {
1498
- const message = createBaseABCIQueryRequest();
1499
- message.data = object.data ?? new Uint8Array(0);
1500
- message.path = object.path ?? "";
1501
- message.height = (object.height !== undefined && object.height !== null)
1502
- ? Long.fromValue(object.height)
1503
- : Long.ZERO;
1504
- message.prove = object.prove ?? false;
1505
- return message;
1506
- },
1507
- };
1508
-
1509
- function createBaseABCIQueryResponse(): ABCIQueryResponse {
1510
- return {
1511
- code: 0,
1512
- log: "",
1513
- info: "",
1514
- index: Long.ZERO,
1515
- key: new Uint8Array(0),
1516
- value: new Uint8Array(0),
1517
- proofOps: undefined,
1518
- height: Long.ZERO,
1519
- codespace: "",
1520
- };
1521
- }
1522
-
1523
- export const ABCIQueryResponse = {
1524
- encode(message: ABCIQueryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1525
- if (message.code !== 0) {
1526
- writer.uint32(8).uint32(message.code);
1527
- }
1528
- if (message.log !== "") {
1529
- writer.uint32(26).string(message.log);
1530
- }
1531
- if (message.info !== "") {
1532
- writer.uint32(34).string(message.info);
1533
- }
1534
- if (!message.index.equals(Long.ZERO)) {
1535
- writer.uint32(40).int64(message.index);
1536
- }
1537
- if (message.key.length !== 0) {
1538
- writer.uint32(50).bytes(message.key);
1539
- }
1540
- if (message.value.length !== 0) {
1541
- writer.uint32(58).bytes(message.value);
1542
- }
1543
- if (message.proofOps !== undefined) {
1544
- ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim();
1545
- }
1546
- if (!message.height.equals(Long.ZERO)) {
1547
- writer.uint32(72).int64(message.height);
1548
- }
1549
- if (message.codespace !== "") {
1550
- writer.uint32(82).string(message.codespace);
1551
- }
1552
- return writer;
1553
- },
1554
-
1555
- decode(input: _m0.Reader | Uint8Array, length?: number): ABCIQueryResponse {
1556
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1557
- let end = length === undefined ? reader.len : reader.pos + length;
1558
- const message = createBaseABCIQueryResponse();
1559
- while (reader.pos < end) {
1560
- const tag = reader.uint32();
1561
- switch (tag >>> 3) {
1562
- case 1:
1563
- if (tag !== 8) {
1564
- break;
1565
- }
1566
-
1567
- message.code = reader.uint32();
1568
- continue;
1569
- case 3:
1570
- if (tag !== 26) {
1571
- break;
1572
- }
1573
-
1574
- message.log = reader.string();
1575
- continue;
1576
- case 4:
1577
- if (tag !== 34) {
1578
- break;
1579
- }
1580
-
1581
- message.info = reader.string();
1582
- continue;
1583
- case 5:
1584
- if (tag !== 40) {
1585
- break;
1586
- }
1587
-
1588
- message.index = reader.int64() as Long;
1589
- continue;
1590
- case 6:
1591
- if (tag !== 50) {
1592
- break;
1593
- }
1594
-
1595
- message.key = reader.bytes();
1596
- continue;
1597
- case 7:
1598
- if (tag !== 58) {
1599
- break;
1600
- }
1601
-
1602
- message.value = reader.bytes();
1603
- continue;
1604
- case 8:
1605
- if (tag !== 66) {
1606
- break;
1607
- }
1608
-
1609
- message.proofOps = ProofOps.decode(reader, reader.uint32());
1610
- continue;
1611
- case 9:
1612
- if (tag !== 72) {
1613
- break;
1614
- }
1615
-
1616
- message.height = reader.int64() as Long;
1617
- continue;
1618
- case 10:
1619
- if (tag !== 82) {
1620
- break;
1621
- }
1622
-
1623
- message.codespace = reader.string();
1624
- continue;
1625
- }
1626
- if ((tag & 7) === 4 || tag === 0) {
1627
- break;
1628
- }
1629
- reader.skipType(tag & 7);
1630
- }
1631
- return message;
1632
- },
1633
-
1634
- fromJSON(object: any): ABCIQueryResponse {
1635
- return {
1636
- code: isSet(object.code) ? globalThis.Number(object.code) : 0,
1637
- log: isSet(object.log) ? globalThis.String(object.log) : "",
1638
- info: isSet(object.info) ? globalThis.String(object.info) : "",
1639
- index: isSet(object.index) ? Long.fromValue(object.index) : Long.ZERO,
1640
- key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
1641
- value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
1642
- proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined,
1643
- height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO,
1644
- codespace: isSet(object.codespace) ? globalThis.String(object.codespace) : "",
1645
- };
1646
- },
1647
-
1648
- toJSON(message: ABCIQueryResponse): unknown {
1649
- const obj: any = {};
1650
- if (message.code !== 0) {
1651
- obj.code = Math.round(message.code);
1652
- }
1653
- if (message.log !== "") {
1654
- obj.log = message.log;
1655
- }
1656
- if (message.info !== "") {
1657
- obj.info = message.info;
1658
- }
1659
- if (!message.index.equals(Long.ZERO)) {
1660
- obj.index = (message.index || Long.ZERO).toString();
1661
- }
1662
- if (message.key.length !== 0) {
1663
- obj.key = base64FromBytes(message.key);
1664
- }
1665
- if (message.value.length !== 0) {
1666
- obj.value = base64FromBytes(message.value);
1667
- }
1668
- if (message.proofOps !== undefined) {
1669
- obj.proofOps = ProofOps.toJSON(message.proofOps);
1670
- }
1671
- if (!message.height.equals(Long.ZERO)) {
1672
- obj.height = (message.height || Long.ZERO).toString();
1673
- }
1674
- if (message.codespace !== "") {
1675
- obj.codespace = message.codespace;
1676
- }
1677
- return obj;
1678
- },
1679
-
1680
- create<I extends Exact<DeepPartial<ABCIQueryResponse>, I>>(base?: I): ABCIQueryResponse {
1681
- return ABCIQueryResponse.fromPartial(base ?? ({} as any));
1682
- },
1683
- fromPartial<I extends Exact<DeepPartial<ABCIQueryResponse>, I>>(object: I): ABCIQueryResponse {
1684
- const message = createBaseABCIQueryResponse();
1685
- message.code = object.code ?? 0;
1686
- message.log = object.log ?? "";
1687
- message.info = object.info ?? "";
1688
- message.index = (object.index !== undefined && object.index !== null) ? Long.fromValue(object.index) : Long.ZERO;
1689
- message.key = object.key ?? new Uint8Array(0);
1690
- message.value = object.value ?? new Uint8Array(0);
1691
- message.proofOps = (object.proofOps !== undefined && object.proofOps !== null)
1692
- ? ProofOps.fromPartial(object.proofOps)
1693
- : undefined;
1694
- message.height = (object.height !== undefined && object.height !== null)
1695
- ? Long.fromValue(object.height)
1696
- : Long.ZERO;
1697
- message.codespace = object.codespace ?? "";
1698
- return message;
1699
- },
1700
- };
1701
-
1702
- function createBaseProofOp(): ProofOp {
1703
- return { type: "", key: new Uint8Array(0), data: new Uint8Array(0) };
1704
- }
1705
-
1706
- export const ProofOp = {
1707
- encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1708
- if (message.type !== "") {
1709
- writer.uint32(10).string(message.type);
1710
- }
1711
- if (message.key.length !== 0) {
1712
- writer.uint32(18).bytes(message.key);
1713
- }
1714
- if (message.data.length !== 0) {
1715
- writer.uint32(26).bytes(message.data);
1716
- }
1717
- return writer;
1718
- },
1719
-
1720
- decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp {
1721
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1722
- let end = length === undefined ? reader.len : reader.pos + length;
1723
- const message = createBaseProofOp();
1724
- while (reader.pos < end) {
1725
- const tag = reader.uint32();
1726
- switch (tag >>> 3) {
1727
- case 1:
1728
- if (tag !== 10) {
1729
- break;
1730
- }
1731
-
1732
- message.type = reader.string();
1733
- continue;
1734
- case 2:
1735
- if (tag !== 18) {
1736
- break;
1737
- }
1738
-
1739
- message.key = reader.bytes();
1740
- continue;
1741
- case 3:
1742
- if (tag !== 26) {
1743
- break;
1744
- }
1745
-
1746
- message.data = reader.bytes();
1747
- continue;
1748
- }
1749
- if ((tag & 7) === 4 || tag === 0) {
1750
- break;
1751
- }
1752
- reader.skipType(tag & 7);
1753
- }
1754
- return message;
1755
- },
1756
-
1757
- fromJSON(object: any): ProofOp {
1758
- return {
1759
- type: isSet(object.type) ? globalThis.String(object.type) : "",
1760
- key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
1761
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
1762
- };
1763
- },
1764
-
1765
- toJSON(message: ProofOp): unknown {
1766
- const obj: any = {};
1767
- if (message.type !== "") {
1768
- obj.type = message.type;
1769
- }
1770
- if (message.key.length !== 0) {
1771
- obj.key = base64FromBytes(message.key);
1772
- }
1773
- if (message.data.length !== 0) {
1774
- obj.data = base64FromBytes(message.data);
1775
- }
1776
- return obj;
1777
- },
1778
-
1779
- create<I extends Exact<DeepPartial<ProofOp>, I>>(base?: I): ProofOp {
1780
- return ProofOp.fromPartial(base ?? ({} as any));
1781
- },
1782
- fromPartial<I extends Exact<DeepPartial<ProofOp>, I>>(object: I): ProofOp {
1783
- const message = createBaseProofOp();
1784
- message.type = object.type ?? "";
1785
- message.key = object.key ?? new Uint8Array(0);
1786
- message.data = object.data ?? new Uint8Array(0);
1787
- return message;
1788
- },
1789
- };
1790
-
1791
- function createBaseProofOps(): ProofOps {
1792
- return { ops: [] };
1793
- }
1794
-
1795
- export const ProofOps = {
1796
- encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1797
- for (const v of message.ops) {
1798
- ProofOp.encode(v!, writer.uint32(10).fork()).ldelim();
1799
- }
1800
- return writer;
1801
- },
1802
-
1803
- decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps {
1804
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1805
- let end = length === undefined ? reader.len : reader.pos + length;
1806
- const message = createBaseProofOps();
1807
- while (reader.pos < end) {
1808
- const tag = reader.uint32();
1809
- switch (tag >>> 3) {
1810
- case 1:
1811
- if (tag !== 10) {
1812
- break;
1813
- }
1814
-
1815
- message.ops.push(ProofOp.decode(reader, reader.uint32()));
1816
- continue;
1817
- }
1818
- if ((tag & 7) === 4 || tag === 0) {
1819
- break;
1820
- }
1821
- reader.skipType(tag & 7);
1822
- }
1823
- return message;
1824
- },
1825
-
1826
- fromJSON(object: any): ProofOps {
1827
- return { ops: globalThis.Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromJSON(e)) : [] };
1828
- },
1829
-
1830
- toJSON(message: ProofOps): unknown {
1831
- const obj: any = {};
1832
- if (message.ops?.length) {
1833
- obj.ops = message.ops.map((e) => ProofOp.toJSON(e));
1834
- }
1835
- return obj;
1836
- },
1837
-
1838
- create<I extends Exact<DeepPartial<ProofOps>, I>>(base?: I): ProofOps {
1839
- return ProofOps.fromPartial(base ?? ({} as any));
1840
- },
1841
- fromPartial<I extends Exact<DeepPartial<ProofOps>, I>>(object: I): ProofOps {
1842
- const message = createBaseProofOps();
1843
- message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || [];
1844
- return message;
1845
- },
1846
- };
1847
-
1848
- /** Service defines the gRPC querier service for tendermint queries. */
1849
- export interface Service {
1850
- /** GetNodeInfo queries the current node info. */
1851
- GetNodeInfo(request: DeepPartial<GetNodeInfoRequest>, metadata?: grpc.Metadata): Promise<GetNodeInfoResponse>;
1852
- /** GetSyncing queries node syncing. */
1853
- GetSyncing(request: DeepPartial<GetSyncingRequest>, metadata?: grpc.Metadata): Promise<GetSyncingResponse>;
1854
- /** GetLatestBlock returns the latest block. */
1855
- GetLatestBlock(
1856
- request: DeepPartial<GetLatestBlockRequest>,
1857
- metadata?: grpc.Metadata,
1858
- ): Promise<GetLatestBlockResponse>;
1859
- /** GetBlockByHeight queries block for given height. */
1860
- GetBlockByHeight(
1861
- request: DeepPartial<GetBlockByHeightRequest>,
1862
- metadata?: grpc.Metadata,
1863
- ): Promise<GetBlockByHeightResponse>;
1864
- /** GetLatestValidatorSet queries latest validator-set. */
1865
- GetLatestValidatorSet(
1866
- request: DeepPartial<GetLatestValidatorSetRequest>,
1867
- metadata?: grpc.Metadata,
1868
- ): Promise<GetLatestValidatorSetResponse>;
1869
- /** GetValidatorSetByHeight queries validator-set at a given height. */
1870
- GetValidatorSetByHeight(
1871
- request: DeepPartial<GetValidatorSetByHeightRequest>,
1872
- metadata?: grpc.Metadata,
1873
- ): Promise<GetValidatorSetByHeightResponse>;
1874
- /**
1875
- * ABCIQuery defines a query handler that supports ABCI queries directly to the
1876
- * application, bypassing Tendermint completely. The ABCI query must contain
1877
- * a valid and supported path, including app, custom, p2p, and store.
1878
- *
1879
- * Since: cosmos-sdk 0.46
1880
- */
1881
- ABCIQuery(request: DeepPartial<ABCIQueryRequest>, metadata?: grpc.Metadata): Promise<ABCIQueryResponse>;
1882
- }
1883
-
1884
- export class ServiceClientImpl implements Service {
1885
- private readonly rpc: Rpc;
1886
-
1887
- constructor(rpc: Rpc) {
1888
- this.rpc = rpc;
1889
- this.GetNodeInfo = this.GetNodeInfo.bind(this);
1890
- this.GetSyncing = this.GetSyncing.bind(this);
1891
- this.GetLatestBlock = this.GetLatestBlock.bind(this);
1892
- this.GetBlockByHeight = this.GetBlockByHeight.bind(this);
1893
- this.GetLatestValidatorSet = this.GetLatestValidatorSet.bind(this);
1894
- this.GetValidatorSetByHeight = this.GetValidatorSetByHeight.bind(this);
1895
- this.ABCIQuery = this.ABCIQuery.bind(this);
1896
- }
1897
-
1898
- GetNodeInfo(request: DeepPartial<GetNodeInfoRequest>, metadata?: grpc.Metadata): Promise<GetNodeInfoResponse> {
1899
- return this.rpc.unary(ServiceGetNodeInfoDesc, GetNodeInfoRequest.fromPartial(request), metadata);
1900
- }
1901
-
1902
- GetSyncing(request: DeepPartial<GetSyncingRequest>, metadata?: grpc.Metadata): Promise<GetSyncingResponse> {
1903
- return this.rpc.unary(ServiceGetSyncingDesc, GetSyncingRequest.fromPartial(request), metadata);
1904
- }
1905
-
1906
- GetLatestBlock(
1907
- request: DeepPartial<GetLatestBlockRequest>,
1908
- metadata?: grpc.Metadata,
1909
- ): Promise<GetLatestBlockResponse> {
1910
- return this.rpc.unary(ServiceGetLatestBlockDesc, GetLatestBlockRequest.fromPartial(request), metadata);
1911
- }
1912
-
1913
- GetBlockByHeight(
1914
- request: DeepPartial<GetBlockByHeightRequest>,
1915
- metadata?: grpc.Metadata,
1916
- ): Promise<GetBlockByHeightResponse> {
1917
- return this.rpc.unary(ServiceGetBlockByHeightDesc, GetBlockByHeightRequest.fromPartial(request), metadata);
1918
- }
1919
-
1920
- GetLatestValidatorSet(
1921
- request: DeepPartial<GetLatestValidatorSetRequest>,
1922
- metadata?: grpc.Metadata,
1923
- ): Promise<GetLatestValidatorSetResponse> {
1924
- return this.rpc.unary(
1925
- ServiceGetLatestValidatorSetDesc,
1926
- GetLatestValidatorSetRequest.fromPartial(request),
1927
- metadata,
1928
- );
1929
- }
1930
-
1931
- GetValidatorSetByHeight(
1932
- request: DeepPartial<GetValidatorSetByHeightRequest>,
1933
- metadata?: grpc.Metadata,
1934
- ): Promise<GetValidatorSetByHeightResponse> {
1935
- return this.rpc.unary(
1936
- ServiceGetValidatorSetByHeightDesc,
1937
- GetValidatorSetByHeightRequest.fromPartial(request),
1938
- metadata,
1939
- );
1940
- }
1941
-
1942
- ABCIQuery(request: DeepPartial<ABCIQueryRequest>, metadata?: grpc.Metadata): Promise<ABCIQueryResponse> {
1943
- return this.rpc.unary(ServiceABCIQueryDesc, ABCIQueryRequest.fromPartial(request), metadata);
1944
- }
1945
- }
1946
-
1947
- export const ServiceDesc = { serviceName: "cosmos.base.tendermint.v1beta1.Service" };
1948
-
1949
- export const ServiceGetNodeInfoDesc: UnaryMethodDefinitionish = {
1950
- methodName: "GetNodeInfo",
1951
- service: ServiceDesc,
1952
- requestStream: false,
1953
- responseStream: false,
1954
- requestType: {
1955
- serializeBinary() {
1956
- return GetNodeInfoRequest.encode(this).finish();
1957
- },
1958
- } as any,
1959
- responseType: {
1960
- deserializeBinary(data: Uint8Array) {
1961
- const value = GetNodeInfoResponse.decode(data);
1962
- return {
1963
- ...value,
1964
- toObject() {
1965
- return value;
1966
- },
1967
- };
1968
- },
1969
- } as any,
1970
- };
1971
-
1972
- export const ServiceGetSyncingDesc: UnaryMethodDefinitionish = {
1973
- methodName: "GetSyncing",
1974
- service: ServiceDesc,
1975
- requestStream: false,
1976
- responseStream: false,
1977
- requestType: {
1978
- serializeBinary() {
1979
- return GetSyncingRequest.encode(this).finish();
1980
- },
1981
- } as any,
1982
- responseType: {
1983
- deserializeBinary(data: Uint8Array) {
1984
- const value = GetSyncingResponse.decode(data);
1985
- return {
1986
- ...value,
1987
- toObject() {
1988
- return value;
1989
- },
1990
- };
1991
- },
1992
- } as any,
1993
- };
1994
-
1995
- export const ServiceGetLatestBlockDesc: UnaryMethodDefinitionish = {
1996
- methodName: "GetLatestBlock",
1997
- service: ServiceDesc,
1998
- requestStream: false,
1999
- responseStream: false,
2000
- requestType: {
2001
- serializeBinary() {
2002
- return GetLatestBlockRequest.encode(this).finish();
2003
- },
2004
- } as any,
2005
- responseType: {
2006
- deserializeBinary(data: Uint8Array) {
2007
- const value = GetLatestBlockResponse.decode(data);
2008
- return {
2009
- ...value,
2010
- toObject() {
2011
- return value;
2012
- },
2013
- };
2014
- },
2015
- } as any,
2016
- };
2017
-
2018
- export const ServiceGetBlockByHeightDesc: UnaryMethodDefinitionish = {
2019
- methodName: "GetBlockByHeight",
2020
- service: ServiceDesc,
2021
- requestStream: false,
2022
- responseStream: false,
2023
- requestType: {
2024
- serializeBinary() {
2025
- return GetBlockByHeightRequest.encode(this).finish();
2026
- },
2027
- } as any,
2028
- responseType: {
2029
- deserializeBinary(data: Uint8Array) {
2030
- const value = GetBlockByHeightResponse.decode(data);
2031
- return {
2032
- ...value,
2033
- toObject() {
2034
- return value;
2035
- },
2036
- };
2037
- },
2038
- } as any,
2039
- };
2040
-
2041
- export const ServiceGetLatestValidatorSetDesc: UnaryMethodDefinitionish = {
2042
- methodName: "GetLatestValidatorSet",
2043
- service: ServiceDesc,
2044
- requestStream: false,
2045
- responseStream: false,
2046
- requestType: {
2047
- serializeBinary() {
2048
- return GetLatestValidatorSetRequest.encode(this).finish();
2049
- },
2050
- } as any,
2051
- responseType: {
2052
- deserializeBinary(data: Uint8Array) {
2053
- const value = GetLatestValidatorSetResponse.decode(data);
2054
- return {
2055
- ...value,
2056
- toObject() {
2057
- return value;
2058
- },
2059
- };
2060
- },
2061
- } as any,
2062
- };
2063
-
2064
- export const ServiceGetValidatorSetByHeightDesc: UnaryMethodDefinitionish = {
2065
- methodName: "GetValidatorSetByHeight",
2066
- service: ServiceDesc,
2067
- requestStream: false,
2068
- responseStream: false,
2069
- requestType: {
2070
- serializeBinary() {
2071
- return GetValidatorSetByHeightRequest.encode(this).finish();
2072
- },
2073
- } as any,
2074
- responseType: {
2075
- deserializeBinary(data: Uint8Array) {
2076
- const value = GetValidatorSetByHeightResponse.decode(data);
2077
- return {
2078
- ...value,
2079
- toObject() {
2080
- return value;
2081
- },
2082
- };
2083
- },
2084
- } as any,
2085
- };
2086
-
2087
- export const ServiceABCIQueryDesc: UnaryMethodDefinitionish = {
2088
- methodName: "ABCIQuery",
2089
- service: ServiceDesc,
2090
- requestStream: false,
2091
- responseStream: false,
2092
- requestType: {
2093
- serializeBinary() {
2094
- return ABCIQueryRequest.encode(this).finish();
2095
- },
2096
- } as any,
2097
- responseType: {
2098
- deserializeBinary(data: Uint8Array) {
2099
- const value = ABCIQueryResponse.decode(data);
2100
- return {
2101
- ...value,
2102
- toObject() {
2103
- return value;
2104
- },
2105
- };
2106
- },
2107
- } as any,
2108
- };
2109
-
2110
- interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition<any, any> {
2111
- requestStream: any;
2112
- responseStream: any;
2113
- }
2114
-
2115
- type UnaryMethodDefinitionish = UnaryMethodDefinitionishR;
2116
-
2117
- interface Rpc {
2118
- unary<T extends UnaryMethodDefinitionish>(
2119
- methodDesc: T,
2120
- request: any,
2121
- metadata: grpc.Metadata | undefined,
2122
- ): Promise<any>;
2123
- }
2124
-
2125
- export class GrpcWebImpl {
2126
- private host: string;
2127
- private options: {
2128
- transport?: grpc.TransportFactory;
2129
-
2130
- debug?: boolean;
2131
- metadata?: grpc.Metadata;
2132
- upStreamRetryCodes?: number[];
2133
- };
2134
-
2135
- constructor(
2136
- host: string,
2137
- options: {
2138
- transport?: grpc.TransportFactory;
2139
-
2140
- debug?: boolean;
2141
- metadata?: grpc.Metadata;
2142
- upStreamRetryCodes?: number[];
2143
- },
2144
- ) {
2145
- this.host = host;
2146
- this.options = options;
2147
- }
2148
-
2149
- unary<T extends UnaryMethodDefinitionish>(
2150
- methodDesc: T,
2151
- _request: any,
2152
- metadata: grpc.Metadata | undefined,
2153
- ): Promise<any> {
2154
- const request = { ..._request, ...methodDesc.requestType };
2155
- const maybeCombinedMetadata = metadata && this.options.metadata
2156
- ? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap })
2157
- : metadata ?? this.options.metadata;
2158
- return new Promise((resolve, reject) => {
2159
- grpc.unary(methodDesc, {
2160
- request,
2161
- host: this.host,
2162
- metadata: maybeCombinedMetadata ?? {},
2163
- ...(this.options.transport !== undefined ? { transport: this.options.transport } : {}),
2164
- debug: this.options.debug ?? false,
2165
- onEnd: function (response) {
2166
- if (response.status === grpc.Code.OK) {
2167
- resolve(response.message!.toObject());
2168
- } else {
2169
- const err = new GrpcWebError(response.statusMessage, response.status, response.trailers);
2170
- reject(err);
2171
- }
2172
- },
2173
- });
2174
- });
2175
- }
2176
- }
2177
-
2178
- function bytesFromBase64(b64: string): Uint8Array {
2179
- if ((globalThis as any).Buffer) {
2180
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
2181
- } else {
2182
- const bin = globalThis.atob(b64);
2183
- const arr = new Uint8Array(bin.length);
2184
- for (let i = 0; i < bin.length; ++i) {
2185
- arr[i] = bin.charCodeAt(i);
2186
- }
2187
- return arr;
2188
- }
2189
- }
2190
-
2191
- function base64FromBytes(arr: Uint8Array): string {
2192
- if ((globalThis as any).Buffer) {
2193
- return globalThis.Buffer.from(arr).toString("base64");
2194
- } else {
2195
- const bin: string[] = [];
2196
- arr.forEach((byte) => {
2197
- bin.push(globalThis.String.fromCharCode(byte));
2198
- });
2199
- return globalThis.btoa(bin.join(""));
2200
- }
2201
- }
2202
-
2203
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
2204
-
2205
- export type DeepPartial<T> = T extends Builtin ? T
2206
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
2207
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
2208
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
2209
- : Partial<T>;
2210
-
2211
- type KeysOfUnion<T> = T extends T ? keyof T : never;
2212
- export type Exact<P, I extends P> = P extends Builtin ? P
2213
- : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
2214
-
2215
- if (_m0.util.Long !== Long) {
2216
- _m0.util.Long = Long as any;
2217
- _m0.configure();
2218
- }
2219
-
2220
- function isSet(value: any): boolean {
2221
- return value !== null && value !== undefined;
2222
- }
2223
-
2224
- export class GrpcWebError extends globalThis.Error {
2225
- constructor(message: string, public code: grpc.Code, public metadata: grpc.Metadata) {
2226
- super(message);
2227
- }
2228
- }