@inco/js 0.1.30 → 0.1.31-alpha

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 (178) hide show
  1. package/dist/binary.js +67 -0
  2. package/dist/binary.js.map +1 -0
  3. package/dist/chain.js +24 -0
  4. package/dist/chain.js.map +1 -0
  5. package/dist/encryption/encryption.js +98 -0
  6. package/dist/encryption/encryption.js.map +1 -0
  7. package/dist/encryption/index.js +2 -0
  8. package/dist/encryption/index.js.map +1 -0
  9. package/dist/fhevm/fhe-environment.js +8 -0
  10. package/dist/fhevm/fhe-environment.js.map +1 -0
  11. package/dist/fhevm/fhevm.js +139 -0
  12. package/dist/fhevm/fhevm.js.map +1 -0
  13. package/dist/fhevm/index.js +2 -0
  14. package/dist/fhevm/index.js.map +1 -0
  15. package/dist/fhevm/reencrypt.js +123 -0
  16. package/dist/fhevm/reencrypt.js.map +1 -0
  17. package/dist/fhevm/tfhe.js +324 -0
  18. package/dist/fhevm/tfhe.js.map +1 -0
  19. package/dist/fhevm/types.js +26 -0
  20. package/dist/fhevm/types.js.map +1 -0
  21. package/dist/generated/abis/addTwo.js +59 -0
  22. package/dist/generated/abis/addTwo.js.map +1 -0
  23. package/dist/generated/abis/inco-fhevm.js +6242 -0
  24. package/dist/generated/abis/inco-fhevm.js.map +1 -0
  25. package/dist/generated/abis/index.js +3 -0
  26. package/dist/generated/abis/index.js.map +1 -0
  27. package/dist/generated/abis/lightning.js +12489 -0
  28. package/dist/generated/abis/lightning.js.map +1 -0
  29. package/dist/generated/es/cosmos/ics23/v1/proofs_pb.js +198 -0
  30. package/dist/generated/es/cosmos/ics23/v1/proofs_pb.js.map +1 -0
  31. package/dist/generated/es/cosmos/msg/v1/msg_pb.js +33 -0
  32. package/dist/generated/es/cosmos/msg/v1/msg_pb.js.map +1 -0
  33. package/dist/generated/es/cosmos_proto/cosmos_pb.js +115 -0
  34. package/dist/generated/es/cosmos_proto/cosmos_pb.js.map +1 -0
  35. package/dist/generated/es/google/api/annotations_pb.js +27 -0
  36. package/dist/generated/es/google/api/annotations_pb.js.map +1 -0
  37. package/dist/generated/es/google/api/http_pb.js +34 -0
  38. package/dist/generated/es/google/api/http_pb.js.map +1 -0
  39. package/dist/generated/es/inco/fhe/v1/events_pb.js +21 -0
  40. package/dist/generated/es/inco/fhe/v1/events_pb.js.map +1 -0
  41. package/dist/generated/es/inco/fhe/v1/genesis_pb.js +46 -0
  42. package/dist/generated/es/inco/fhe/v1/genesis_pb.js.map +1 -0
  43. package/dist/generated/es/inco/fhe/v1/query_pb.js +108 -0
  44. package/dist/generated/es/inco/fhe/v1/query_pb.js.map +1 -0
  45. package/dist/generated/es/inco/fhe/v1/tx_pb.js +108 -0
  46. package/dist/generated/es/inco/fhe/v1/tx_pb.js.map +1 -0
  47. package/dist/generated/es/inco/fhe/v1/types_pb.js +133 -0
  48. package/dist/generated/es/inco/fhe/v1/types_pb.js.map +1 -0
  49. package/dist/generated/es/inco/kms/lite/v1/kms_service_pb.js +43 -0
  50. package/dist/generated/es/inco/kms/lite/v1/kms_service_pb.js.map +1 -0
  51. package/dist/generated/es/inco/kms/lite/v1/types_pb.js +44 -0
  52. package/dist/generated/es/inco/kms/lite/v1/types_pb.js.map +1 -0
  53. package/dist/generated/es/inco/preflight/v1/genesis_pb.js +20 -0
  54. package/dist/generated/es/inco/preflight/v1/genesis_pb.js.map +1 -0
  55. package/dist/generated/es/inco/preflight/v1/query_pb.js +38 -0
  56. package/dist/generated/es/inco/preflight/v1/query_pb.js.map +1 -0
  57. package/dist/generated/es/inco/preflight/v1/tx_pb.js +48 -0
  58. package/dist/generated/es/inco/preflight/v1/tx_pb.js.map +1 -0
  59. package/dist/generated/es/inco/preflight/v1/types_pb.js +34 -0
  60. package/dist/generated/es/inco/preflight/v1/types_pb.js.map +1 -0
  61. package/dist/generated/es/kms/base_pb.js +238 -0
  62. package/dist/generated/es/kms/base_pb.js.map +1 -0
  63. package/dist/generated/es/sf/ethereum/type/v2/type_pb.js +571 -0
  64. package/dist/generated/es/sf/ethereum/type/v2/type_pb.js.map +1 -0
  65. package/dist/generated/fhe-environments.js +15 -0
  66. package/dist/generated/fhe-environments.js.map +1 -0
  67. package/dist/generated/lightning.js +399 -0
  68. package/dist/generated/lightning.js.map +1 -0
  69. package/dist/generated/local-node.js +8 -0
  70. package/dist/generated/local-node.js.map +1 -0
  71. package/dist/generated/ts/amino/amino.js +8 -0
  72. package/dist/generated/ts/amino/amino.js.map +1 -0
  73. package/dist/generated/ts/cometbft/abci/v1/types.js +5063 -0
  74. package/dist/generated/ts/cometbft/abci/v1/types.js.map +1 -0
  75. package/dist/generated/ts/cometbft/crypto/v1/keys.js +105 -0
  76. package/dist/generated/ts/cometbft/crypto/v1/keys.js.map +1 -0
  77. package/dist/generated/ts/cometbft/crypto/v1/proof.js +430 -0
  78. package/dist/generated/ts/cometbft/crypto/v1/proof.js.map +1 -0
  79. package/dist/generated/ts/cometbft/types/v1/params.js +713 -0
  80. package/dist/generated/ts/cometbft/types/v1/params.js.map +1 -0
  81. package/dist/generated/ts/cometbft/types/v1/validator.js +353 -0
  82. package/dist/generated/ts/cometbft/types/v1/validator.js.map +1 -0
  83. package/dist/generated/ts/cosmos/app/v1alpha1/module.js +218 -0
  84. package/dist/generated/ts/cosmos/app/v1alpha1/module.js.map +1 -0
  85. package/dist/generated/ts/cosmos/msg/v1/msg.js +8 -0
  86. package/dist/generated/ts/cosmos/msg/v1/msg.js.map +1 -0
  87. package/dist/generated/ts/cosmos_proto/cosmos.js +211 -0
  88. package/dist/generated/ts/cosmos_proto/cosmos.js.map +1 -0
  89. package/dist/generated/ts/gogoproto/gogo.js +8 -0
  90. package/dist/generated/ts/gogoproto/gogo.js.map +1 -0
  91. package/dist/generated/ts/google/api/annotations.js +8 -0
  92. package/dist/generated/ts/google/api/annotations.js.map +1 -0
  93. package/dist/generated/ts/google/api/http.js +353 -0
  94. package/dist/generated/ts/google/api/http.js.map +1 -0
  95. package/dist/generated/ts/google/protobuf/descriptor.js +5070 -0
  96. package/dist/generated/ts/google/protobuf/descriptor.js.map +1 -0
  97. package/dist/generated/ts/google/protobuf/duration.js +90 -0
  98. package/dist/generated/ts/google/protobuf/duration.js.map +1 -0
  99. package/dist/generated/ts/google/protobuf/timestamp.js +90 -0
  100. package/dist/generated/ts/google/protobuf/timestamp.js.map +1 -0
  101. package/dist/generated/ts/google/protobuf/wrappers.js +506 -0
  102. package/dist/generated/ts/google/protobuf/wrappers.js.map +1 -0
  103. package/dist/generated/ts/inco/abci/v1/types.js +70 -0
  104. package/dist/generated/ts/inco/abci/v1/types.js.map +1 -0
  105. package/dist/generated/ts/inco/fhe/module/v1/module.js +63 -0
  106. package/dist/generated/ts/inco/fhe/module/v1/module.js.map +1 -0
  107. package/dist/generated/ts/inco/fhe/v1/events.js +187 -0
  108. package/dist/generated/ts/inco/fhe/v1/events.js.map +1 -0
  109. package/dist/generated/ts/inco/fhe/v1/genesis.js +711 -0
  110. package/dist/generated/ts/inco/fhe/v1/genesis.js.map +1 -0
  111. package/dist/generated/ts/inco/fhe/v1/query.js +1391 -0
  112. package/dist/generated/ts/inco/fhe/v1/query.js.map +1 -0
  113. package/dist/generated/ts/inco/fhe/v1/tx.js +1233 -0
  114. package/dist/generated/ts/inco/fhe/v1/tx.js.map +1 -0
  115. package/dist/generated/ts/inco/fhe/v1/types.js +985 -0
  116. package/dist/generated/ts/inco/fhe/v1/types.js.map +1 -0
  117. package/dist/generated/ts/inco/originchain/module/v1/module.js +63 -0
  118. package/dist/generated/ts/inco/originchain/module/v1/module.js.map +1 -0
  119. package/dist/generated/ts/inco/originchain/v1/abci.js +328 -0
  120. package/dist/generated/ts/inco/originchain/v1/abci.js.map +1 -0
  121. package/dist/generated/ts/inco/originchain/v1/events.js +213 -0
  122. package/dist/generated/ts/inco/originchain/v1/events.js.map +1 -0
  123. package/dist/generated/ts/inco/originchain/v1/genesis.js +66 -0
  124. package/dist/generated/ts/inco/originchain/v1/genesis.js.map +1 -0
  125. package/dist/generated/ts/inco/originchain/v1/query.js +277 -0
  126. package/dist/generated/ts/inco/originchain/v1/query.js.map +1 -0
  127. package/dist/generated/ts/inco/originchain/v1/tx.js +137 -0
  128. package/dist/generated/ts/inco/originchain/v1/tx.js.map +1 -0
  129. package/dist/generated/ts/inco/originchain/v1/types.js +200 -0
  130. package/dist/generated/ts/inco/originchain/v1/types.js.map +1 -0
  131. package/dist/generated/ts/inco/preflight/module/v1/module.js +63 -0
  132. package/dist/generated/ts/inco/preflight/module/v1/module.js.map +1 -0
  133. package/dist/generated/ts/inco/preflight/v1/genesis.js +182 -0
  134. package/dist/generated/ts/inco/preflight/v1/genesis.js.map +1 -0
  135. package/dist/generated/ts/inco/preflight/v1/query.js +256 -0
  136. package/dist/generated/ts/inco/preflight/v1/query.js.map +1 -0
  137. package/dist/generated/ts/inco/preflight/v1/tx.js +445 -0
  138. package/dist/generated/ts/inco/preflight/v1/tx.js.map +1 -0
  139. package/dist/generated/ts/inco/preflight/v1/types.js +395 -0
  140. package/dist/generated/ts/inco/preflight/v1/types.js.map +1 -0
  141. package/dist/handle.js +94 -0
  142. package/dist/handle.js.map +1 -0
  143. package/dist/index.js +6 -0
  144. package/dist/index.js.map +1 -0
  145. package/dist/l1/client.js +93 -0
  146. package/dist/l1/client.js.map +1 -0
  147. package/dist/l1/index.js +3 -0
  148. package/dist/l1/index.js.map +1 -0
  149. package/dist/l1/preflight.js +39 -0
  150. package/dist/l1/preflight.js.map +1 -0
  151. package/dist/lite/deployments.js +17 -0
  152. package/dist/lite/deployments.js.map +1 -0
  153. package/dist/lite/ecies.js +124 -0
  154. package/dist/lite/ecies.js.map +1 -0
  155. package/dist/lite/hadu.js +36 -0
  156. package/dist/lite/hadu.js.map +1 -0
  157. package/dist/lite/index.js +7 -0
  158. package/dist/lite/index.js.map +1 -0
  159. package/dist/lite/lightning.d.ts +2 -1
  160. package/dist/lite/lightning.js +179 -0
  161. package/dist/lite/lightning.js.map +1 -0
  162. package/dist/lite/reencrypt.js +129 -0
  163. package/dist/lite/reencrypt.js.map +1 -0
  164. package/dist/local/index.js +2 -0
  165. package/dist/local/index.js.map +1 -0
  166. package/dist/local/local-node.js +24 -0
  167. package/dist/local/local-node.js.map +1 -0
  168. package/dist/reencryption/eip712.js +81 -0
  169. package/dist/reencryption/eip712.js.map +1 -0
  170. package/dist/reencryption/index.js +3 -0
  171. package/dist/reencryption/index.js.map +1 -0
  172. package/dist/reencryption/types.js +2 -0
  173. package/dist/reencryption/types.js.map +1 -0
  174. package/dist/schema.js +15 -0
  175. package/dist/schema.js.map +1 -0
  176. package/dist/viem.js +8 -0
  177. package/dist/viem.js.map +1 -0
  178. package/package.json +10 -44
@@ -0,0 +1,1391 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc unknown
5
+ // source: inco/fhe/v1/query.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { makeGenericClientConstructor, } from "@grpc/grpc-js";
9
+ import { BlockTopo, CARoot, Covalidator, FheEnv, HandleBinding, KeysetInfo } from "./types";
10
+ export const protobufPackage = "inco.fhe.v1";
11
+ function createBaseQueryCARootRequest() {
12
+ return { hostChainId: "", keysetId: "", blockHash: "" };
13
+ }
14
+ export const QueryCARootRequest = {
15
+ encode(message, writer = new BinaryWriter()) {
16
+ if (message.hostChainId !== "") {
17
+ writer.uint32(10).string(message.hostChainId);
18
+ }
19
+ if (message.keysetId !== "") {
20
+ writer.uint32(18).string(message.keysetId);
21
+ }
22
+ if (message.blockHash !== "") {
23
+ writer.uint32(26).string(message.blockHash);
24
+ }
25
+ return writer;
26
+ },
27
+ decode(input, length) {
28
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29
+ let end = length === undefined ? reader.len : reader.pos + length;
30
+ const message = createBaseQueryCARootRequest();
31
+ while (reader.pos < end) {
32
+ const tag = reader.uint32();
33
+ switch (tag >>> 3) {
34
+ case 1: {
35
+ if (tag !== 10) {
36
+ break;
37
+ }
38
+ message.hostChainId = reader.string();
39
+ continue;
40
+ }
41
+ case 2: {
42
+ if (tag !== 18) {
43
+ break;
44
+ }
45
+ message.keysetId = reader.string();
46
+ continue;
47
+ }
48
+ case 3: {
49
+ if (tag !== 26) {
50
+ break;
51
+ }
52
+ message.blockHash = reader.string();
53
+ continue;
54
+ }
55
+ }
56
+ if ((tag & 7) === 4 || tag === 0) {
57
+ break;
58
+ }
59
+ reader.skip(tag & 7);
60
+ }
61
+ return message;
62
+ },
63
+ fromJSON(object) {
64
+ return {
65
+ hostChainId: isSet(object.hostChainId) ? globalThis.String(object.hostChainId) : "",
66
+ keysetId: isSet(object.keysetId) ? globalThis.String(object.keysetId) : "",
67
+ blockHash: isSet(object.blockHash) ? globalThis.String(object.blockHash) : "",
68
+ };
69
+ },
70
+ toJSON(message) {
71
+ const obj = {};
72
+ if (message.hostChainId !== "") {
73
+ obj.hostChainId = message.hostChainId;
74
+ }
75
+ if (message.keysetId !== "") {
76
+ obj.keysetId = message.keysetId;
77
+ }
78
+ if (message.blockHash !== "") {
79
+ obj.blockHash = message.blockHash;
80
+ }
81
+ return obj;
82
+ },
83
+ create(base) {
84
+ return QueryCARootRequest.fromPartial(base ?? {});
85
+ },
86
+ fromPartial(object) {
87
+ const message = createBaseQueryCARootRequest();
88
+ message.hostChainId = object.hostChainId ?? "";
89
+ message.keysetId = object.keysetId ?? "";
90
+ message.blockHash = object.blockHash ?? "";
91
+ return message;
92
+ },
93
+ };
94
+ function createBaseQueryCARootResponse() {
95
+ return { caRoot: undefined };
96
+ }
97
+ export const QueryCARootResponse = {
98
+ encode(message, writer = new BinaryWriter()) {
99
+ if (message.caRoot !== undefined) {
100
+ CARoot.encode(message.caRoot, writer.uint32(10).fork()).join();
101
+ }
102
+ return writer;
103
+ },
104
+ decode(input, length) {
105
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
106
+ let end = length === undefined ? reader.len : reader.pos + length;
107
+ const message = createBaseQueryCARootResponse();
108
+ while (reader.pos < end) {
109
+ const tag = reader.uint32();
110
+ switch (tag >>> 3) {
111
+ case 1: {
112
+ if (tag !== 10) {
113
+ break;
114
+ }
115
+ message.caRoot = CARoot.decode(reader, reader.uint32());
116
+ continue;
117
+ }
118
+ }
119
+ if ((tag & 7) === 4 || tag === 0) {
120
+ break;
121
+ }
122
+ reader.skip(tag & 7);
123
+ }
124
+ return message;
125
+ },
126
+ fromJSON(object) {
127
+ return { caRoot: isSet(object.caRoot) ? CARoot.fromJSON(object.caRoot) : undefined };
128
+ },
129
+ toJSON(message) {
130
+ const obj = {};
131
+ if (message.caRoot !== undefined) {
132
+ obj.caRoot = CARoot.toJSON(message.caRoot);
133
+ }
134
+ return obj;
135
+ },
136
+ create(base) {
137
+ return QueryCARootResponse.fromPartial(base ?? {});
138
+ },
139
+ fromPartial(object) {
140
+ const message = createBaseQueryCARootResponse();
141
+ message.caRoot = (object.caRoot !== undefined && object.caRoot !== null)
142
+ ? CARoot.fromPartial(object.caRoot)
143
+ : undefined;
144
+ return message;
145
+ },
146
+ };
147
+ function createBaseQueryVoteRequest() {
148
+ return { hostChainId: "", keysetId: "", blockHash: "", covalidator: "" };
149
+ }
150
+ export const QueryVoteRequest = {
151
+ encode(message, writer = new BinaryWriter()) {
152
+ if (message.hostChainId !== "") {
153
+ writer.uint32(10).string(message.hostChainId);
154
+ }
155
+ if (message.keysetId !== "") {
156
+ writer.uint32(18).string(message.keysetId);
157
+ }
158
+ if (message.blockHash !== "") {
159
+ writer.uint32(26).string(message.blockHash);
160
+ }
161
+ if (message.covalidator !== "") {
162
+ writer.uint32(34).string(message.covalidator);
163
+ }
164
+ return writer;
165
+ },
166
+ decode(input, length) {
167
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
168
+ let end = length === undefined ? reader.len : reader.pos + length;
169
+ const message = createBaseQueryVoteRequest();
170
+ while (reader.pos < end) {
171
+ const tag = reader.uint32();
172
+ switch (tag >>> 3) {
173
+ case 1: {
174
+ if (tag !== 10) {
175
+ break;
176
+ }
177
+ message.hostChainId = reader.string();
178
+ continue;
179
+ }
180
+ case 2: {
181
+ if (tag !== 18) {
182
+ break;
183
+ }
184
+ message.keysetId = reader.string();
185
+ continue;
186
+ }
187
+ case 3: {
188
+ if (tag !== 26) {
189
+ break;
190
+ }
191
+ message.blockHash = reader.string();
192
+ continue;
193
+ }
194
+ case 4: {
195
+ if (tag !== 34) {
196
+ break;
197
+ }
198
+ message.covalidator = reader.string();
199
+ continue;
200
+ }
201
+ }
202
+ if ((tag & 7) === 4 || tag === 0) {
203
+ break;
204
+ }
205
+ reader.skip(tag & 7);
206
+ }
207
+ return message;
208
+ },
209
+ fromJSON(object) {
210
+ return {
211
+ hostChainId: isSet(object.hostChainId) ? globalThis.String(object.hostChainId) : "",
212
+ keysetId: isSet(object.keysetId) ? globalThis.String(object.keysetId) : "",
213
+ blockHash: isSet(object.blockHash) ? globalThis.String(object.blockHash) : "",
214
+ covalidator: isSet(object.covalidator) ? globalThis.String(object.covalidator) : "",
215
+ };
216
+ },
217
+ toJSON(message) {
218
+ const obj = {};
219
+ if (message.hostChainId !== "") {
220
+ obj.hostChainId = message.hostChainId;
221
+ }
222
+ if (message.keysetId !== "") {
223
+ obj.keysetId = message.keysetId;
224
+ }
225
+ if (message.blockHash !== "") {
226
+ obj.blockHash = message.blockHash;
227
+ }
228
+ if (message.covalidator !== "") {
229
+ obj.covalidator = message.covalidator;
230
+ }
231
+ return obj;
232
+ },
233
+ create(base) {
234
+ return QueryVoteRequest.fromPartial(base ?? {});
235
+ },
236
+ fromPartial(object) {
237
+ const message = createBaseQueryVoteRequest();
238
+ message.hostChainId = object.hostChainId ?? "";
239
+ message.keysetId = object.keysetId ?? "";
240
+ message.blockHash = object.blockHash ?? "";
241
+ message.covalidator = object.covalidator ?? "";
242
+ return message;
243
+ },
244
+ };
245
+ function createBaseQueryVoteResponse() {
246
+ return { caRoot: undefined };
247
+ }
248
+ export const QueryVoteResponse = {
249
+ encode(message, writer = new BinaryWriter()) {
250
+ if (message.caRoot !== undefined) {
251
+ CARoot.encode(message.caRoot, writer.uint32(10).fork()).join();
252
+ }
253
+ return writer;
254
+ },
255
+ decode(input, length) {
256
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
257
+ let end = length === undefined ? reader.len : reader.pos + length;
258
+ const message = createBaseQueryVoteResponse();
259
+ while (reader.pos < end) {
260
+ const tag = reader.uint32();
261
+ switch (tag >>> 3) {
262
+ case 1: {
263
+ if (tag !== 10) {
264
+ break;
265
+ }
266
+ message.caRoot = CARoot.decode(reader, reader.uint32());
267
+ continue;
268
+ }
269
+ }
270
+ if ((tag & 7) === 4 || tag === 0) {
271
+ break;
272
+ }
273
+ reader.skip(tag & 7);
274
+ }
275
+ return message;
276
+ },
277
+ fromJSON(object) {
278
+ return { caRoot: isSet(object.caRoot) ? CARoot.fromJSON(object.caRoot) : undefined };
279
+ },
280
+ toJSON(message) {
281
+ const obj = {};
282
+ if (message.caRoot !== undefined) {
283
+ obj.caRoot = CARoot.toJSON(message.caRoot);
284
+ }
285
+ return obj;
286
+ },
287
+ create(base) {
288
+ return QueryVoteResponse.fromPartial(base ?? {});
289
+ },
290
+ fromPartial(object) {
291
+ const message = createBaseQueryVoteResponse();
292
+ message.caRoot = (object.caRoot !== undefined && object.caRoot !== null)
293
+ ? CARoot.fromPartial(object.caRoot)
294
+ : undefined;
295
+ return message;
296
+ },
297
+ };
298
+ function createBaseQueryTopoVoteRequest() {
299
+ return { hostChainId: "", keysetId: "", blockHash: "", blockHeight: 0, covalidator: "" };
300
+ }
301
+ export const QueryTopoVoteRequest = {
302
+ encode(message, writer = new BinaryWriter()) {
303
+ if (message.hostChainId !== "") {
304
+ writer.uint32(10).string(message.hostChainId);
305
+ }
306
+ if (message.keysetId !== "") {
307
+ writer.uint32(18).string(message.keysetId);
308
+ }
309
+ if (message.blockHash !== "") {
310
+ writer.uint32(26).string(message.blockHash);
311
+ }
312
+ if (message.blockHeight !== 0) {
313
+ writer.uint32(32).uint64(message.blockHeight);
314
+ }
315
+ if (message.covalidator !== "") {
316
+ writer.uint32(42).string(message.covalidator);
317
+ }
318
+ return writer;
319
+ },
320
+ decode(input, length) {
321
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
322
+ let end = length === undefined ? reader.len : reader.pos + length;
323
+ const message = createBaseQueryTopoVoteRequest();
324
+ while (reader.pos < end) {
325
+ const tag = reader.uint32();
326
+ switch (tag >>> 3) {
327
+ case 1: {
328
+ if (tag !== 10) {
329
+ break;
330
+ }
331
+ message.hostChainId = reader.string();
332
+ continue;
333
+ }
334
+ case 2: {
335
+ if (tag !== 18) {
336
+ break;
337
+ }
338
+ message.keysetId = reader.string();
339
+ continue;
340
+ }
341
+ case 3: {
342
+ if (tag !== 26) {
343
+ break;
344
+ }
345
+ message.blockHash = reader.string();
346
+ continue;
347
+ }
348
+ case 4: {
349
+ if (tag !== 32) {
350
+ break;
351
+ }
352
+ message.blockHeight = longToNumber(reader.uint64());
353
+ continue;
354
+ }
355
+ case 5: {
356
+ if (tag !== 42) {
357
+ break;
358
+ }
359
+ message.covalidator = reader.string();
360
+ continue;
361
+ }
362
+ }
363
+ if ((tag & 7) === 4 || tag === 0) {
364
+ break;
365
+ }
366
+ reader.skip(tag & 7);
367
+ }
368
+ return message;
369
+ },
370
+ fromJSON(object) {
371
+ return {
372
+ hostChainId: isSet(object.hostChainId) ? globalThis.String(object.hostChainId) : "",
373
+ keysetId: isSet(object.keysetId) ? globalThis.String(object.keysetId) : "",
374
+ blockHash: isSet(object.blockHash) ? globalThis.String(object.blockHash) : "",
375
+ blockHeight: isSet(object.blockHeight) ? globalThis.Number(object.blockHeight) : 0,
376
+ covalidator: isSet(object.covalidator) ? globalThis.String(object.covalidator) : "",
377
+ };
378
+ },
379
+ toJSON(message) {
380
+ const obj = {};
381
+ if (message.hostChainId !== "") {
382
+ obj.hostChainId = message.hostChainId;
383
+ }
384
+ if (message.keysetId !== "") {
385
+ obj.keysetId = message.keysetId;
386
+ }
387
+ if (message.blockHash !== "") {
388
+ obj.blockHash = message.blockHash;
389
+ }
390
+ if (message.blockHeight !== 0) {
391
+ obj.blockHeight = Math.round(message.blockHeight);
392
+ }
393
+ if (message.covalidator !== "") {
394
+ obj.covalidator = message.covalidator;
395
+ }
396
+ return obj;
397
+ },
398
+ create(base) {
399
+ return QueryTopoVoteRequest.fromPartial(base ?? {});
400
+ },
401
+ fromPartial(object) {
402
+ const message = createBaseQueryTopoVoteRequest();
403
+ message.hostChainId = object.hostChainId ?? "";
404
+ message.keysetId = object.keysetId ?? "";
405
+ message.blockHash = object.blockHash ?? "";
406
+ message.blockHeight = object.blockHeight ?? 0;
407
+ message.covalidator = object.covalidator ?? "";
408
+ return message;
409
+ },
410
+ };
411
+ function createBaseQueryTopoVoteResponse() {
412
+ return { blockTopo: undefined, found: false };
413
+ }
414
+ export const QueryTopoVoteResponse = {
415
+ encode(message, writer = new BinaryWriter()) {
416
+ if (message.blockTopo !== undefined) {
417
+ BlockTopo.encode(message.blockTopo, writer.uint32(10).fork()).join();
418
+ }
419
+ if (message.found !== false) {
420
+ writer.uint32(16).bool(message.found);
421
+ }
422
+ return writer;
423
+ },
424
+ decode(input, length) {
425
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
426
+ let end = length === undefined ? reader.len : reader.pos + length;
427
+ const message = createBaseQueryTopoVoteResponse();
428
+ while (reader.pos < end) {
429
+ const tag = reader.uint32();
430
+ switch (tag >>> 3) {
431
+ case 1: {
432
+ if (tag !== 10) {
433
+ break;
434
+ }
435
+ message.blockTopo = BlockTopo.decode(reader, reader.uint32());
436
+ continue;
437
+ }
438
+ case 2: {
439
+ if (tag !== 16) {
440
+ break;
441
+ }
442
+ message.found = reader.bool();
443
+ continue;
444
+ }
445
+ }
446
+ if ((tag & 7) === 4 || tag === 0) {
447
+ break;
448
+ }
449
+ reader.skip(tag & 7);
450
+ }
451
+ return message;
452
+ },
453
+ fromJSON(object) {
454
+ return {
455
+ blockTopo: isSet(object.blockTopo) ? BlockTopo.fromJSON(object.blockTopo) : undefined,
456
+ found: isSet(object.found) ? globalThis.Boolean(object.found) : false,
457
+ };
458
+ },
459
+ toJSON(message) {
460
+ const obj = {};
461
+ if (message.blockTopo !== undefined) {
462
+ obj.blockTopo = BlockTopo.toJSON(message.blockTopo);
463
+ }
464
+ if (message.found !== false) {
465
+ obj.found = message.found;
466
+ }
467
+ return obj;
468
+ },
469
+ create(base) {
470
+ return QueryTopoVoteResponse.fromPartial(base ?? {});
471
+ },
472
+ fromPartial(object) {
473
+ const message = createBaseQueryTopoVoteResponse();
474
+ message.blockTopo = (object.blockTopo !== undefined && object.blockTopo !== null)
475
+ ? BlockTopo.fromPartial(object.blockTopo)
476
+ : undefined;
477
+ message.found = object.found ?? false;
478
+ return message;
479
+ },
480
+ };
481
+ function createBaseQueryBindingVoteRequest() {
482
+ return { covalidator: "", keysetId: "", hostChainId: "", handle: "" };
483
+ }
484
+ export const QueryBindingVoteRequest = {
485
+ encode(message, writer = new BinaryWriter()) {
486
+ if (message.covalidator !== "") {
487
+ writer.uint32(10).string(message.covalidator);
488
+ }
489
+ if (message.keysetId !== "") {
490
+ writer.uint32(18).string(message.keysetId);
491
+ }
492
+ if (message.hostChainId !== "") {
493
+ writer.uint32(26).string(message.hostChainId);
494
+ }
495
+ if (message.handle !== "") {
496
+ writer.uint32(34).string(message.handle);
497
+ }
498
+ return writer;
499
+ },
500
+ decode(input, length) {
501
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
502
+ let end = length === undefined ? reader.len : reader.pos + length;
503
+ const message = createBaseQueryBindingVoteRequest();
504
+ while (reader.pos < end) {
505
+ const tag = reader.uint32();
506
+ switch (tag >>> 3) {
507
+ case 1: {
508
+ if (tag !== 10) {
509
+ break;
510
+ }
511
+ message.covalidator = reader.string();
512
+ continue;
513
+ }
514
+ case 2: {
515
+ if (tag !== 18) {
516
+ break;
517
+ }
518
+ message.keysetId = reader.string();
519
+ continue;
520
+ }
521
+ case 3: {
522
+ if (tag !== 26) {
523
+ break;
524
+ }
525
+ message.hostChainId = reader.string();
526
+ continue;
527
+ }
528
+ case 4: {
529
+ if (tag !== 34) {
530
+ break;
531
+ }
532
+ message.handle = reader.string();
533
+ continue;
534
+ }
535
+ }
536
+ if ((tag & 7) === 4 || tag === 0) {
537
+ break;
538
+ }
539
+ reader.skip(tag & 7);
540
+ }
541
+ return message;
542
+ },
543
+ fromJSON(object) {
544
+ return {
545
+ covalidator: isSet(object.covalidator) ? globalThis.String(object.covalidator) : "",
546
+ keysetId: isSet(object.keysetId) ? globalThis.String(object.keysetId) : "",
547
+ hostChainId: isSet(object.hostChainId) ? globalThis.String(object.hostChainId) : "",
548
+ handle: isSet(object.handle) ? globalThis.String(object.handle) : "",
549
+ };
550
+ },
551
+ toJSON(message) {
552
+ const obj = {};
553
+ if (message.covalidator !== "") {
554
+ obj.covalidator = message.covalidator;
555
+ }
556
+ if (message.keysetId !== "") {
557
+ obj.keysetId = message.keysetId;
558
+ }
559
+ if (message.hostChainId !== "") {
560
+ obj.hostChainId = message.hostChainId;
561
+ }
562
+ if (message.handle !== "") {
563
+ obj.handle = message.handle;
564
+ }
565
+ return obj;
566
+ },
567
+ create(base) {
568
+ return QueryBindingVoteRequest.fromPartial(base ?? {});
569
+ },
570
+ fromPartial(object) {
571
+ const message = createBaseQueryBindingVoteRequest();
572
+ message.covalidator = object.covalidator ?? "";
573
+ message.keysetId = object.keysetId ?? "";
574
+ message.hostChainId = object.hostChainId ?? "";
575
+ message.handle = object.handle ?? "";
576
+ return message;
577
+ },
578
+ };
579
+ function createBaseQueryBindingVoteResponse() {
580
+ return { handleBinding: undefined, found: false };
581
+ }
582
+ export const QueryBindingVoteResponse = {
583
+ encode(message, writer = new BinaryWriter()) {
584
+ if (message.handleBinding !== undefined) {
585
+ HandleBinding.encode(message.handleBinding, writer.uint32(10).fork()).join();
586
+ }
587
+ if (message.found !== false) {
588
+ writer.uint32(16).bool(message.found);
589
+ }
590
+ return writer;
591
+ },
592
+ decode(input, length) {
593
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
594
+ let end = length === undefined ? reader.len : reader.pos + length;
595
+ const message = createBaseQueryBindingVoteResponse();
596
+ while (reader.pos < end) {
597
+ const tag = reader.uint32();
598
+ switch (tag >>> 3) {
599
+ case 1: {
600
+ if (tag !== 10) {
601
+ break;
602
+ }
603
+ message.handleBinding = HandleBinding.decode(reader, reader.uint32());
604
+ continue;
605
+ }
606
+ case 2: {
607
+ if (tag !== 16) {
608
+ break;
609
+ }
610
+ message.found = reader.bool();
611
+ continue;
612
+ }
613
+ }
614
+ if ((tag & 7) === 4 || tag === 0) {
615
+ break;
616
+ }
617
+ reader.skip(tag & 7);
618
+ }
619
+ return message;
620
+ },
621
+ fromJSON(object) {
622
+ return {
623
+ handleBinding: isSet(object.handleBinding) ? HandleBinding.fromJSON(object.handleBinding) : undefined,
624
+ found: isSet(object.found) ? globalThis.Boolean(object.found) : false,
625
+ };
626
+ },
627
+ toJSON(message) {
628
+ const obj = {};
629
+ if (message.handleBinding !== undefined) {
630
+ obj.handleBinding = HandleBinding.toJSON(message.handleBinding);
631
+ }
632
+ if (message.found !== false) {
633
+ obj.found = message.found;
634
+ }
635
+ return obj;
636
+ },
637
+ create(base) {
638
+ return QueryBindingVoteResponse.fromPartial(base ?? {});
639
+ },
640
+ fromPartial(object) {
641
+ const message = createBaseQueryBindingVoteResponse();
642
+ message.handleBinding = (object.handleBinding !== undefined && object.handleBinding !== null)
643
+ ? HandleBinding.fromPartial(object.handleBinding)
644
+ : undefined;
645
+ message.found = object.found ?? false;
646
+ return message;
647
+ },
648
+ };
649
+ function createBaseQueryTopoRequest() {
650
+ return { hostChainId: "", keysetId: "", blockHash: "", blockHeight: 0 };
651
+ }
652
+ export const QueryTopoRequest = {
653
+ encode(message, writer = new BinaryWriter()) {
654
+ if (message.hostChainId !== "") {
655
+ writer.uint32(10).string(message.hostChainId);
656
+ }
657
+ if (message.keysetId !== "") {
658
+ writer.uint32(18).string(message.keysetId);
659
+ }
660
+ if (message.blockHash !== "") {
661
+ writer.uint32(26).string(message.blockHash);
662
+ }
663
+ if (message.blockHeight !== 0) {
664
+ writer.uint32(32).uint64(message.blockHeight);
665
+ }
666
+ return writer;
667
+ },
668
+ decode(input, length) {
669
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
670
+ let end = length === undefined ? reader.len : reader.pos + length;
671
+ const message = createBaseQueryTopoRequest();
672
+ while (reader.pos < end) {
673
+ const tag = reader.uint32();
674
+ switch (tag >>> 3) {
675
+ case 1: {
676
+ if (tag !== 10) {
677
+ break;
678
+ }
679
+ message.hostChainId = reader.string();
680
+ continue;
681
+ }
682
+ case 2: {
683
+ if (tag !== 18) {
684
+ break;
685
+ }
686
+ message.keysetId = reader.string();
687
+ continue;
688
+ }
689
+ case 3: {
690
+ if (tag !== 26) {
691
+ break;
692
+ }
693
+ message.blockHash = reader.string();
694
+ continue;
695
+ }
696
+ case 4: {
697
+ if (tag !== 32) {
698
+ break;
699
+ }
700
+ message.blockHeight = longToNumber(reader.uint64());
701
+ continue;
702
+ }
703
+ }
704
+ if ((tag & 7) === 4 || tag === 0) {
705
+ break;
706
+ }
707
+ reader.skip(tag & 7);
708
+ }
709
+ return message;
710
+ },
711
+ fromJSON(object) {
712
+ return {
713
+ hostChainId: isSet(object.hostChainId) ? globalThis.String(object.hostChainId) : "",
714
+ keysetId: isSet(object.keysetId) ? globalThis.String(object.keysetId) : "",
715
+ blockHash: isSet(object.blockHash) ? globalThis.String(object.blockHash) : "",
716
+ blockHeight: isSet(object.blockHeight) ? globalThis.Number(object.blockHeight) : 0,
717
+ };
718
+ },
719
+ toJSON(message) {
720
+ const obj = {};
721
+ if (message.hostChainId !== "") {
722
+ obj.hostChainId = message.hostChainId;
723
+ }
724
+ if (message.keysetId !== "") {
725
+ obj.keysetId = message.keysetId;
726
+ }
727
+ if (message.blockHash !== "") {
728
+ obj.blockHash = message.blockHash;
729
+ }
730
+ if (message.blockHeight !== 0) {
731
+ obj.blockHeight = Math.round(message.blockHeight);
732
+ }
733
+ return obj;
734
+ },
735
+ create(base) {
736
+ return QueryTopoRequest.fromPartial(base ?? {});
737
+ },
738
+ fromPartial(object) {
739
+ const message = createBaseQueryTopoRequest();
740
+ message.hostChainId = object.hostChainId ?? "";
741
+ message.keysetId = object.keysetId ?? "";
742
+ message.blockHash = object.blockHash ?? "";
743
+ message.blockHeight = object.blockHeight ?? 0;
744
+ return message;
745
+ },
746
+ };
747
+ function createBaseQueryTopoResponse() {
748
+ return { blockTopo: undefined, found: false };
749
+ }
750
+ export const QueryTopoResponse = {
751
+ encode(message, writer = new BinaryWriter()) {
752
+ if (message.blockTopo !== undefined) {
753
+ BlockTopo.encode(message.blockTopo, writer.uint32(10).fork()).join();
754
+ }
755
+ if (message.found !== false) {
756
+ writer.uint32(16).bool(message.found);
757
+ }
758
+ return writer;
759
+ },
760
+ decode(input, length) {
761
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
762
+ let end = length === undefined ? reader.len : reader.pos + length;
763
+ const message = createBaseQueryTopoResponse();
764
+ while (reader.pos < end) {
765
+ const tag = reader.uint32();
766
+ switch (tag >>> 3) {
767
+ case 1: {
768
+ if (tag !== 10) {
769
+ break;
770
+ }
771
+ message.blockTopo = BlockTopo.decode(reader, reader.uint32());
772
+ continue;
773
+ }
774
+ case 2: {
775
+ if (tag !== 16) {
776
+ break;
777
+ }
778
+ message.found = reader.bool();
779
+ continue;
780
+ }
781
+ }
782
+ if ((tag & 7) === 4 || tag === 0) {
783
+ break;
784
+ }
785
+ reader.skip(tag & 7);
786
+ }
787
+ return message;
788
+ },
789
+ fromJSON(object) {
790
+ return {
791
+ blockTopo: isSet(object.blockTopo) ? BlockTopo.fromJSON(object.blockTopo) : undefined,
792
+ found: isSet(object.found) ? globalThis.Boolean(object.found) : false,
793
+ };
794
+ },
795
+ toJSON(message) {
796
+ const obj = {};
797
+ if (message.blockTopo !== undefined) {
798
+ obj.blockTopo = BlockTopo.toJSON(message.blockTopo);
799
+ }
800
+ if (message.found !== false) {
801
+ obj.found = message.found;
802
+ }
803
+ return obj;
804
+ },
805
+ create(base) {
806
+ return QueryTopoResponse.fromPartial(base ?? {});
807
+ },
808
+ fromPartial(object) {
809
+ const message = createBaseQueryTopoResponse();
810
+ message.blockTopo = (object.blockTopo !== undefined && object.blockTopo !== null)
811
+ ? BlockTopo.fromPartial(object.blockTopo)
812
+ : undefined;
813
+ message.found = object.found ?? false;
814
+ return message;
815
+ },
816
+ };
817
+ function createBaseQueryBindingRequest() {
818
+ return { hostChainId: "", keysetId: "", handle: "" };
819
+ }
820
+ export const QueryBindingRequest = {
821
+ encode(message, writer = new BinaryWriter()) {
822
+ if (message.hostChainId !== "") {
823
+ writer.uint32(10).string(message.hostChainId);
824
+ }
825
+ if (message.keysetId !== "") {
826
+ writer.uint32(18).string(message.keysetId);
827
+ }
828
+ if (message.handle !== "") {
829
+ writer.uint32(26).string(message.handle);
830
+ }
831
+ return writer;
832
+ },
833
+ decode(input, length) {
834
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
835
+ let end = length === undefined ? reader.len : reader.pos + length;
836
+ const message = createBaseQueryBindingRequest();
837
+ while (reader.pos < end) {
838
+ const tag = reader.uint32();
839
+ switch (tag >>> 3) {
840
+ case 1: {
841
+ if (tag !== 10) {
842
+ break;
843
+ }
844
+ message.hostChainId = reader.string();
845
+ continue;
846
+ }
847
+ case 2: {
848
+ if (tag !== 18) {
849
+ break;
850
+ }
851
+ message.keysetId = reader.string();
852
+ continue;
853
+ }
854
+ case 3: {
855
+ if (tag !== 26) {
856
+ break;
857
+ }
858
+ message.handle = reader.string();
859
+ continue;
860
+ }
861
+ }
862
+ if ((tag & 7) === 4 || tag === 0) {
863
+ break;
864
+ }
865
+ reader.skip(tag & 7);
866
+ }
867
+ return message;
868
+ },
869
+ fromJSON(object) {
870
+ return {
871
+ hostChainId: isSet(object.hostChainId) ? globalThis.String(object.hostChainId) : "",
872
+ keysetId: isSet(object.keysetId) ? globalThis.String(object.keysetId) : "",
873
+ handle: isSet(object.handle) ? globalThis.String(object.handle) : "",
874
+ };
875
+ },
876
+ toJSON(message) {
877
+ const obj = {};
878
+ if (message.hostChainId !== "") {
879
+ obj.hostChainId = message.hostChainId;
880
+ }
881
+ if (message.keysetId !== "") {
882
+ obj.keysetId = message.keysetId;
883
+ }
884
+ if (message.handle !== "") {
885
+ obj.handle = message.handle;
886
+ }
887
+ return obj;
888
+ },
889
+ create(base) {
890
+ return QueryBindingRequest.fromPartial(base ?? {});
891
+ },
892
+ fromPartial(object) {
893
+ const message = createBaseQueryBindingRequest();
894
+ message.hostChainId = object.hostChainId ?? "";
895
+ message.keysetId = object.keysetId ?? "";
896
+ message.handle = object.handle ?? "";
897
+ return message;
898
+ },
899
+ };
900
+ function createBaseQueryBindingResponse() {
901
+ return { handleBinding: undefined, found: false };
902
+ }
903
+ export const QueryBindingResponse = {
904
+ encode(message, writer = new BinaryWriter()) {
905
+ if (message.handleBinding !== undefined) {
906
+ HandleBinding.encode(message.handleBinding, writer.uint32(10).fork()).join();
907
+ }
908
+ if (message.found !== false) {
909
+ writer.uint32(16).bool(message.found);
910
+ }
911
+ return writer;
912
+ },
913
+ decode(input, length) {
914
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
915
+ let end = length === undefined ? reader.len : reader.pos + length;
916
+ const message = createBaseQueryBindingResponse();
917
+ while (reader.pos < end) {
918
+ const tag = reader.uint32();
919
+ switch (tag >>> 3) {
920
+ case 1: {
921
+ if (tag !== 10) {
922
+ break;
923
+ }
924
+ message.handleBinding = HandleBinding.decode(reader, reader.uint32());
925
+ continue;
926
+ }
927
+ case 2: {
928
+ if (tag !== 16) {
929
+ break;
930
+ }
931
+ message.found = reader.bool();
932
+ continue;
933
+ }
934
+ }
935
+ if ((tag & 7) === 4 || tag === 0) {
936
+ break;
937
+ }
938
+ reader.skip(tag & 7);
939
+ }
940
+ return message;
941
+ },
942
+ fromJSON(object) {
943
+ return {
944
+ handleBinding: isSet(object.handleBinding) ? HandleBinding.fromJSON(object.handleBinding) : undefined,
945
+ found: isSet(object.found) ? globalThis.Boolean(object.found) : false,
946
+ };
947
+ },
948
+ toJSON(message) {
949
+ const obj = {};
950
+ if (message.handleBinding !== undefined) {
951
+ obj.handleBinding = HandleBinding.toJSON(message.handleBinding);
952
+ }
953
+ if (message.found !== false) {
954
+ obj.found = message.found;
955
+ }
956
+ return obj;
957
+ },
958
+ create(base) {
959
+ return QueryBindingResponse.fromPartial(base ?? {});
960
+ },
961
+ fromPartial(object) {
962
+ const message = createBaseQueryBindingResponse();
963
+ message.handleBinding = (object.handleBinding !== undefined && object.handleBinding !== null)
964
+ ? HandleBinding.fromPartial(object.handleBinding)
965
+ : undefined;
966
+ message.found = object.found ?? false;
967
+ return message;
968
+ },
969
+ };
970
+ function createBaseQueryCovalidatorRequest() {
971
+ return { covalidator: "" };
972
+ }
973
+ export const QueryCovalidatorRequest = {
974
+ encode(message, writer = new BinaryWriter()) {
975
+ if (message.covalidator !== "") {
976
+ writer.uint32(10).string(message.covalidator);
977
+ }
978
+ return writer;
979
+ },
980
+ decode(input, length) {
981
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
982
+ let end = length === undefined ? reader.len : reader.pos + length;
983
+ const message = createBaseQueryCovalidatorRequest();
984
+ while (reader.pos < end) {
985
+ const tag = reader.uint32();
986
+ switch (tag >>> 3) {
987
+ case 1: {
988
+ if (tag !== 10) {
989
+ break;
990
+ }
991
+ message.covalidator = reader.string();
992
+ continue;
993
+ }
994
+ }
995
+ if ((tag & 7) === 4 || tag === 0) {
996
+ break;
997
+ }
998
+ reader.skip(tag & 7);
999
+ }
1000
+ return message;
1001
+ },
1002
+ fromJSON(object) {
1003
+ return { covalidator: isSet(object.covalidator) ? globalThis.String(object.covalidator) : "" };
1004
+ },
1005
+ toJSON(message) {
1006
+ const obj = {};
1007
+ if (message.covalidator !== "") {
1008
+ obj.covalidator = message.covalidator;
1009
+ }
1010
+ return obj;
1011
+ },
1012
+ create(base) {
1013
+ return QueryCovalidatorRequest.fromPartial(base ?? {});
1014
+ },
1015
+ fromPartial(object) {
1016
+ const message = createBaseQueryCovalidatorRequest();
1017
+ message.covalidator = object.covalidator ?? "";
1018
+ return message;
1019
+ },
1020
+ };
1021
+ function createBaseQueryCovalidatorResponse() {
1022
+ return { covalidator: undefined };
1023
+ }
1024
+ export const QueryCovalidatorResponse = {
1025
+ encode(message, writer = new BinaryWriter()) {
1026
+ if (message.covalidator !== undefined) {
1027
+ Covalidator.encode(message.covalidator, writer.uint32(10).fork()).join();
1028
+ }
1029
+ return writer;
1030
+ },
1031
+ decode(input, length) {
1032
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1033
+ let end = length === undefined ? reader.len : reader.pos + length;
1034
+ const message = createBaseQueryCovalidatorResponse();
1035
+ while (reader.pos < end) {
1036
+ const tag = reader.uint32();
1037
+ switch (tag >>> 3) {
1038
+ case 1: {
1039
+ if (tag !== 10) {
1040
+ break;
1041
+ }
1042
+ message.covalidator = Covalidator.decode(reader, reader.uint32());
1043
+ continue;
1044
+ }
1045
+ }
1046
+ if ((tag & 7) === 4 || tag === 0) {
1047
+ break;
1048
+ }
1049
+ reader.skip(tag & 7);
1050
+ }
1051
+ return message;
1052
+ },
1053
+ fromJSON(object) {
1054
+ return { covalidator: isSet(object.covalidator) ? Covalidator.fromJSON(object.covalidator) : undefined };
1055
+ },
1056
+ toJSON(message) {
1057
+ const obj = {};
1058
+ if (message.covalidator !== undefined) {
1059
+ obj.covalidator = Covalidator.toJSON(message.covalidator);
1060
+ }
1061
+ return obj;
1062
+ },
1063
+ create(base) {
1064
+ return QueryCovalidatorResponse.fromPartial(base ?? {});
1065
+ },
1066
+ fromPartial(object) {
1067
+ const message = createBaseQueryCovalidatorResponse();
1068
+ message.covalidator = (object.covalidator !== undefined && object.covalidator !== null)
1069
+ ? Covalidator.fromPartial(object.covalidator)
1070
+ : undefined;
1071
+ return message;
1072
+ },
1073
+ };
1074
+ function createBaseQueryKeysetsRequest() {
1075
+ return {};
1076
+ }
1077
+ export const QueryKeysetsRequest = {
1078
+ encode(_, writer = new BinaryWriter()) {
1079
+ return writer;
1080
+ },
1081
+ decode(input, length) {
1082
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1083
+ let end = length === undefined ? reader.len : reader.pos + length;
1084
+ const message = createBaseQueryKeysetsRequest();
1085
+ while (reader.pos < end) {
1086
+ const tag = reader.uint32();
1087
+ switch (tag >>> 3) {
1088
+ }
1089
+ if ((tag & 7) === 4 || tag === 0) {
1090
+ break;
1091
+ }
1092
+ reader.skip(tag & 7);
1093
+ }
1094
+ return message;
1095
+ },
1096
+ fromJSON(_) {
1097
+ return {};
1098
+ },
1099
+ toJSON(_) {
1100
+ const obj = {};
1101
+ return obj;
1102
+ },
1103
+ create(base) {
1104
+ return QueryKeysetsRequest.fromPartial(base ?? {});
1105
+ },
1106
+ fromPartial(_) {
1107
+ const message = createBaseQueryKeysetsRequest();
1108
+ return message;
1109
+ },
1110
+ };
1111
+ function createBaseQueryKeysetsResponse() {
1112
+ return { keysets: [] };
1113
+ }
1114
+ export const QueryKeysetsResponse = {
1115
+ encode(message, writer = new BinaryWriter()) {
1116
+ for (const v of message.keysets) {
1117
+ KeysetInfo.encode(v, writer.uint32(10).fork()).join();
1118
+ }
1119
+ return writer;
1120
+ },
1121
+ decode(input, length) {
1122
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1123
+ let end = length === undefined ? reader.len : reader.pos + length;
1124
+ const message = createBaseQueryKeysetsResponse();
1125
+ while (reader.pos < end) {
1126
+ const tag = reader.uint32();
1127
+ switch (tag >>> 3) {
1128
+ case 1: {
1129
+ if (tag !== 10) {
1130
+ break;
1131
+ }
1132
+ message.keysets.push(KeysetInfo.decode(reader, reader.uint32()));
1133
+ continue;
1134
+ }
1135
+ }
1136
+ if ((tag & 7) === 4 || tag === 0) {
1137
+ break;
1138
+ }
1139
+ reader.skip(tag & 7);
1140
+ }
1141
+ return message;
1142
+ },
1143
+ fromJSON(object) {
1144
+ return {
1145
+ keysets: globalThis.Array.isArray(object?.keysets) ? object.keysets.map((e) => KeysetInfo.fromJSON(e)) : [],
1146
+ };
1147
+ },
1148
+ toJSON(message) {
1149
+ const obj = {};
1150
+ if (message.keysets?.length) {
1151
+ obj.keysets = message.keysets.map((e) => KeysetInfo.toJSON(e));
1152
+ }
1153
+ return obj;
1154
+ },
1155
+ create(base) {
1156
+ return QueryKeysetsResponse.fromPartial(base ?? {});
1157
+ },
1158
+ fromPartial(object) {
1159
+ const message = createBaseQueryKeysetsResponse();
1160
+ message.keysets = object.keysets?.map((e) => KeysetInfo.fromPartial(e)) || [];
1161
+ return message;
1162
+ },
1163
+ };
1164
+ function createBaseQueryFheEnvRequest() {
1165
+ return { hostChainId: "", keysetId: "" };
1166
+ }
1167
+ export const QueryFheEnvRequest = {
1168
+ encode(message, writer = new BinaryWriter()) {
1169
+ if (message.hostChainId !== "") {
1170
+ writer.uint32(10).string(message.hostChainId);
1171
+ }
1172
+ if (message.keysetId !== "") {
1173
+ writer.uint32(18).string(message.keysetId);
1174
+ }
1175
+ return writer;
1176
+ },
1177
+ decode(input, length) {
1178
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1179
+ let end = length === undefined ? reader.len : reader.pos + length;
1180
+ const message = createBaseQueryFheEnvRequest();
1181
+ while (reader.pos < end) {
1182
+ const tag = reader.uint32();
1183
+ switch (tag >>> 3) {
1184
+ case 1: {
1185
+ if (tag !== 10) {
1186
+ break;
1187
+ }
1188
+ message.hostChainId = reader.string();
1189
+ continue;
1190
+ }
1191
+ case 2: {
1192
+ if (tag !== 18) {
1193
+ break;
1194
+ }
1195
+ message.keysetId = reader.string();
1196
+ continue;
1197
+ }
1198
+ }
1199
+ if ((tag & 7) === 4 || tag === 0) {
1200
+ break;
1201
+ }
1202
+ reader.skip(tag & 7);
1203
+ }
1204
+ return message;
1205
+ },
1206
+ fromJSON(object) {
1207
+ return {
1208
+ hostChainId: isSet(object.hostChainId) ? globalThis.String(object.hostChainId) : "",
1209
+ keysetId: isSet(object.keysetId) ? globalThis.String(object.keysetId) : "",
1210
+ };
1211
+ },
1212
+ toJSON(message) {
1213
+ const obj = {};
1214
+ if (message.hostChainId !== "") {
1215
+ obj.hostChainId = message.hostChainId;
1216
+ }
1217
+ if (message.keysetId !== "") {
1218
+ obj.keysetId = message.keysetId;
1219
+ }
1220
+ return obj;
1221
+ },
1222
+ create(base) {
1223
+ return QueryFheEnvRequest.fromPartial(base ?? {});
1224
+ },
1225
+ fromPartial(object) {
1226
+ const message = createBaseQueryFheEnvRequest();
1227
+ message.hostChainId = object.hostChainId ?? "";
1228
+ message.keysetId = object.keysetId ?? "";
1229
+ return message;
1230
+ },
1231
+ };
1232
+ function createBaseQueryFheEnvResponse() {
1233
+ return { fheEnv: undefined };
1234
+ }
1235
+ export const QueryFheEnvResponse = {
1236
+ encode(message, writer = new BinaryWriter()) {
1237
+ if (message.fheEnv !== undefined) {
1238
+ FheEnv.encode(message.fheEnv, writer.uint32(10).fork()).join();
1239
+ }
1240
+ return writer;
1241
+ },
1242
+ decode(input, length) {
1243
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1244
+ let end = length === undefined ? reader.len : reader.pos + length;
1245
+ const message = createBaseQueryFheEnvResponse();
1246
+ while (reader.pos < end) {
1247
+ const tag = reader.uint32();
1248
+ switch (tag >>> 3) {
1249
+ case 1: {
1250
+ if (tag !== 10) {
1251
+ break;
1252
+ }
1253
+ message.fheEnv = FheEnv.decode(reader, reader.uint32());
1254
+ continue;
1255
+ }
1256
+ }
1257
+ if ((tag & 7) === 4 || tag === 0) {
1258
+ break;
1259
+ }
1260
+ reader.skip(tag & 7);
1261
+ }
1262
+ return message;
1263
+ },
1264
+ fromJSON(object) {
1265
+ return { fheEnv: isSet(object.fheEnv) ? FheEnv.fromJSON(object.fheEnv) : undefined };
1266
+ },
1267
+ toJSON(message) {
1268
+ const obj = {};
1269
+ if (message.fheEnv !== undefined) {
1270
+ obj.fheEnv = FheEnv.toJSON(message.fheEnv);
1271
+ }
1272
+ return obj;
1273
+ },
1274
+ create(base) {
1275
+ return QueryFheEnvResponse.fromPartial(base ?? {});
1276
+ },
1277
+ fromPartial(object) {
1278
+ const message = createBaseQueryFheEnvResponse();
1279
+ message.fheEnv = (object.fheEnv !== undefined && object.fheEnv !== null)
1280
+ ? FheEnv.fromPartial(object.fheEnv)
1281
+ : undefined;
1282
+ return message;
1283
+ },
1284
+ };
1285
+ export const QueryService = {
1286
+ /** CARoot returns the CA Root for the given FheEnvBlock. */
1287
+ caRoot: {
1288
+ path: "/inco.fhe.v1.Query/CARoot",
1289
+ requestStream: false,
1290
+ responseStream: false,
1291
+ requestSerialize: (value) => Buffer.from(QueryCARootRequest.encode(value).finish()),
1292
+ requestDeserialize: (value) => QueryCARootRequest.decode(value),
1293
+ responseSerialize: (value) => Buffer.from(QueryCARootResponse.encode(value).finish()),
1294
+ responseDeserialize: (value) => QueryCARootResponse.decode(value),
1295
+ },
1296
+ /** Vote returns the vote for the given FheEnvBlock and covalidator. */
1297
+ vote: {
1298
+ path: "/inco.fhe.v1.Query/Vote",
1299
+ requestStream: false,
1300
+ responseStream: false,
1301
+ requestSerialize: (value) => Buffer.from(QueryVoteRequest.encode(value).finish()),
1302
+ requestDeserialize: (value) => QueryVoteRequest.decode(value),
1303
+ responseSerialize: (value) => Buffer.from(QueryVoteResponse.encode(value).finish()),
1304
+ responseDeserialize: (value) => QueryVoteResponse.decode(value),
1305
+ },
1306
+ /** TopoVote returns the topology vote of the given FheEnvBlock and covalidator. */
1307
+ topoVote: {
1308
+ path: "/inco.fhe.v1.Query/TopoVote",
1309
+ requestStream: false,
1310
+ responseStream: false,
1311
+ requestSerialize: (value) => Buffer.from(QueryTopoVoteRequest.encode(value).finish()),
1312
+ requestDeserialize: (value) => QueryTopoVoteRequest.decode(value),
1313
+ responseSerialize: (value) => Buffer.from(QueryTopoVoteResponse.encode(value).finish()),
1314
+ responseDeserialize: (value) => QueryTopoVoteResponse.decode(value),
1315
+ },
1316
+ /** BindingVote returns the handle binding vote for the given handle and covalidator. */
1317
+ bindingVote: {
1318
+ path: "/inco.fhe.v1.Query/BindingVote",
1319
+ requestStream: false,
1320
+ responseStream: false,
1321
+ requestSerialize: (value) => Buffer.from(QueryBindingVoteRequest.encode(value).finish()),
1322
+ requestDeserialize: (value) => QueryBindingVoteRequest.decode(value),
1323
+ responseSerialize: (value) => Buffer.from(QueryBindingVoteResponse.encode(value).finish()),
1324
+ responseDeserialize: (value) => QueryBindingVoteResponse.decode(value),
1325
+ },
1326
+ /** Topo returns the topology of the given FheEnvBlock. */
1327
+ topo: {
1328
+ path: "/inco.fhe.v1.Query/Topo",
1329
+ requestStream: false,
1330
+ responseStream: false,
1331
+ requestSerialize: (value) => Buffer.from(QueryTopoRequest.encode(value).finish()),
1332
+ requestDeserialize: (value) => QueryTopoRequest.decode(value),
1333
+ responseSerialize: (value) => Buffer.from(QueryTopoResponse.encode(value).finish()),
1334
+ responseDeserialize: (value) => QueryTopoResponse.decode(value),
1335
+ },
1336
+ /** Binding returns the binding of the given handle. */
1337
+ binding: {
1338
+ path: "/inco.fhe.v1.Query/Binding",
1339
+ requestStream: false,
1340
+ responseStream: false,
1341
+ requestSerialize: (value) => Buffer.from(QueryBindingRequest.encode(value).finish()),
1342
+ requestDeserialize: (value) => QueryBindingRequest.decode(value),
1343
+ responseSerialize: (value) => Buffer.from(QueryBindingResponse.encode(value).finish()),
1344
+ responseDeserialize: (value) => QueryBindingResponse.decode(value),
1345
+ },
1346
+ /** Covalidator returns the covalidator for the given covalidator address. */
1347
+ covalidator: {
1348
+ path: "/inco.fhe.v1.Query/Covalidator",
1349
+ requestStream: false,
1350
+ responseStream: false,
1351
+ requestSerialize: (value) => Buffer.from(QueryCovalidatorRequest.encode(value).finish()),
1352
+ requestDeserialize: (value) => QueryCovalidatorRequest.decode(value),
1353
+ responseSerialize: (value) => Buffer.from(QueryCovalidatorResponse.encode(value).finish()),
1354
+ responseDeserialize: (value) => QueryCovalidatorResponse.decode(value),
1355
+ },
1356
+ /** Keysets returns the available keysets. */
1357
+ keysets: {
1358
+ path: "/inco.fhe.v1.Query/Keysets",
1359
+ requestStream: false,
1360
+ responseStream: false,
1361
+ requestSerialize: (value) => Buffer.from(QueryKeysetsRequest.encode(value).finish()),
1362
+ requestDeserialize: (value) => QueryKeysetsRequest.decode(value),
1363
+ responseSerialize: (value) => Buffer.from(QueryKeysetsResponse.encode(value).finish()),
1364
+ responseDeserialize: (value) => QueryKeysetsResponse.decode(value),
1365
+ },
1366
+ /** FheEnv returns the FHE environment given the keyset_id and host_chain_id. */
1367
+ fheEnv: {
1368
+ path: "/inco.fhe.v1.Query/FheEnv",
1369
+ requestStream: false,
1370
+ responseStream: false,
1371
+ requestSerialize: (value) => Buffer.from(QueryFheEnvRequest.encode(value).finish()),
1372
+ requestDeserialize: (value) => QueryFheEnvRequest.decode(value),
1373
+ responseSerialize: (value) => Buffer.from(QueryFheEnvResponse.encode(value).finish()),
1374
+ responseDeserialize: (value) => QueryFheEnvResponse.decode(value),
1375
+ },
1376
+ };
1377
+ export const QueryClient = makeGenericClientConstructor(QueryService, "inco.fhe.v1.Query");
1378
+ function longToNumber(int64) {
1379
+ const num = globalThis.Number(int64.toString());
1380
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1381
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1382
+ }
1383
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1384
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1385
+ }
1386
+ return num;
1387
+ }
1388
+ function isSet(value) {
1389
+ return value !== null && value !== undefined;
1390
+ }
1391
+ //# sourceMappingURL=query.js.map