carbon-js-sdk 0.3.51 → 0.3.53-dev.1

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 (116) hide show
  1. package/lib/CarbonSDK.js +1 -1
  2. package/lib/clients/ETHClient.d.ts +11 -4
  3. package/lib/clients/ETHClient.js +20 -6
  4. package/lib/clients/HydrogenClient.d.ts +16 -7
  5. package/lib/clients/HydrogenClient.js +55 -9
  6. package/lib/clients/NEOClient.d.ts +1 -1
  7. package/lib/clients/NEOClient.js +9 -4
  8. package/lib/clients/TokenClient.d.ts +17 -4
  9. package/lib/clients/TokenClient.js +121 -8
  10. package/lib/clients/ZILClient.d.ts +1 -1
  11. package/lib/clients/ZILClient.js +9 -4
  12. package/lib/codec/cosmos/app/module/v1alpha1/module.d.ts +18 -0
  13. package/lib/codec/cosmos/app/module/v1alpha1/module.js +46 -0
  14. package/lib/codec/cosmos/app/v1alpha1/config.d.ts +57 -0
  15. package/lib/codec/cosmos/app/v1alpha1/config.js +125 -0
  16. package/lib/codec/cosmos/app/v1alpha1/export.d.ts +3 -0
  17. package/lib/codec/cosmos/app/v1alpha1/export.js +13 -0
  18. package/lib/codec/cosmos/app/v1alpha1/module.d.ts +109 -0
  19. package/lib/codec/cosmos/app/v1alpha1/module.js +192 -0
  20. package/lib/codec/cosmos/app/v1alpha1/query.d.ts +44 -0
  21. package/lib/codec/cosmos/app/v1alpha1/query.js +107 -0
  22. package/lib/codec/cosmos/authz/v1beta1/export.d.ts +4 -0
  23. package/lib/codec/cosmos/authz/v1beta1/export.js +25 -0
  24. package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +42 -0
  25. package/lib/codec/cosmos/base/node/v1beta1/query.js +104 -0
  26. package/lib/codec/cosmos/base/tendermint/v1beta1/types.d.ts +67 -0
  27. package/lib/codec/cosmos/base/tendermint/v1beta1/types.js +423 -0
  28. package/lib/codec/cosmos/capability/v1beta1/export.d.ts +2 -0
  29. package/lib/codec/cosmos/capability/v1beta1/export.js +9 -0
  30. package/lib/codec/cosmos/crisis/v1beta1/export.d.ts +1 -0
  31. package/lib/codec/cosmos/crisis/v1beta1/export.js +6 -0
  32. package/lib/codec/cosmos/crypto/hd/v1/hd.d.ts +32 -0
  33. package/lib/codec/cosmos/crypto/hd/v1/hd.js +114 -0
  34. package/lib/codec/cosmos/crypto/keyring/v1/record.d.ts +78 -0
  35. package/lib/codec/cosmos/crypto/keyring/v1/record.js +309 -0
  36. package/lib/codec/cosmos/evidence/v1beta1/export.d.ts +3 -0
  37. package/lib/codec/cosmos/evidence/v1beta1/export.js +13 -0
  38. package/lib/codec/cosmos/feegrant/v1beta1/export.d.ts +3 -0
  39. package/lib/codec/cosmos/feegrant/v1beta1/export.js +20 -0
  40. package/lib/codec/cosmos/gov/v1/export.d.ts +3 -0
  41. package/lib/codec/cosmos/gov/v1/export.js +46 -0
  42. package/lib/codec/cosmos/gov/v1/genesis.d.ts +34 -0
  43. package/lib/codec/cosmos/gov/v1/genesis.js +166 -0
  44. package/lib/codec/cosmos/gov/v1/gov.d.ts +198 -0
  45. package/lib/codec/cosmos/gov/v1/gov.js +855 -0
  46. package/lib/codec/cosmos/gov/v1/query.d.ts +264 -0
  47. package/lib/codec/cosmos/gov/v1/query.js +1045 -0
  48. package/lib/codec/cosmos/gov/v1/tx.d.ts +167 -0
  49. package/lib/codec/cosmos/gov/v1/tx.js +639 -0
  50. package/lib/codec/cosmos/group/v1/events.d.ts +124 -0
  51. package/lib/codec/cosmos/group/v1/events.js +480 -0
  52. package/lib/codec/cosmos/group/v1/export.d.ts +4 -0
  53. package/lib/codec/cosmos/group/v1/export.js +94 -0
  54. package/lib/codec/cosmos/group/v1/genesis.d.ts +45 -0
  55. package/lib/codec/cosmos/group/v1/genesis.js +176 -0
  56. package/lib/codec/cosmos/group/v1/query.d.ts +412 -0
  57. package/lib/codec/cosmos/group/v1/query.js +1648 -0
  58. package/lib/codec/cosmos/group/v1/tx.d.ts +483 -0
  59. package/lib/codec/cosmos/group/v1/tx.js +1840 -0
  60. package/lib/codec/cosmos/group/v1/types.d.ts +356 -0
  61. package/lib/codec/cosmos/group/v1/types.js +1306 -0
  62. package/lib/codec/cosmos/msg/v1/msg.d.ts +1 -0
  63. package/lib/codec/cosmos/msg/v1/msg.js +14 -0
  64. package/lib/codec/cosmos/nft/v1beta1/event.d.ts +48 -0
  65. package/lib/codec/cosmos/nft/v1beta1/event.js +227 -0
  66. package/lib/codec/cosmos/nft/v1beta1/export.d.ts +5 -0
  67. package/lib/codec/cosmos/nft/v1beta1/export.js +30 -0
  68. package/lib/codec/cosmos/nft/v1beta1/genesis.d.ts +36 -0
  69. package/lib/codec/cosmos/nft/v1beta1/genesis.js +140 -0
  70. package/lib/codec/cosmos/nft/v1beta1/nft.d.ts +53 -0
  71. package/lib/codec/cosmos/nft/v1beta1/nft.js +233 -0
  72. package/lib/codec/cosmos/nft/v1beta1/query.d.ts +206 -0
  73. package/lib/codec/cosmos/nft/v1beta1/query.js +817 -0
  74. package/lib/codec/cosmos/nft/v1beta1/tx.d.ts +49 -0
  75. package/lib/codec/cosmos/nft/v1beta1/tx.js +137 -0
  76. package/lib/codec/cosmos/orm/module/v1alpha1/module.d.ts +22 -0
  77. package/lib/codec/cosmos/orm/module/v1alpha1/module.js +46 -0
  78. package/lib/codec/cosmos/orm/v1/export.d.ts +1 -0
  79. package/lib/codec/cosmos/orm/v1/export.js +8 -0
  80. package/lib/codec/cosmos/orm/v1/orm.d.ts +123 -0
  81. package/lib/codec/cosmos/orm/v1/orm.js +263 -0
  82. package/lib/codec/cosmos/orm/v1alpha1/export.d.ts +1 -0
  83. package/lib/codec/cosmos/orm/v1alpha1/export.js +9 -0
  84. package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +96 -0
  85. package/lib/codec/cosmos/orm/v1alpha1/schema.js +265 -0
  86. package/lib/codec/cosmos/upgrade/v1beta1/export.d.ts +3 -0
  87. package/lib/codec/cosmos/upgrade/v1beta1/export.js +24 -0
  88. package/lib/codec/cosmos/upgrade/v1beta1/tx.d.ts +97 -0
  89. package/lib/codec/cosmos/upgrade/v1beta1/tx.js +203 -0
  90. package/lib/codec/ibc/applications/fee/v1/ack.d.ts +24 -0
  91. package/lib/codec/ibc/applications/fee/v1/ack.js +125 -0
  92. package/lib/codec/ibc/applications/fee/v1/export.d.ts +6 -0
  93. package/lib/codec/ibc/applications/fee/v1/export.js +47 -0
  94. package/lib/codec/ibc/applications/fee/v1/fee.d.ts +68 -0
  95. package/lib/codec/ibc/applications/fee/v1/fee.js +289 -0
  96. package/lib/codec/ibc/applications/fee/v1/genesis.d.ts +93 -0
  97. package/lib/codec/ibc/applications/fee/v1/genesis.js +390 -0
  98. package/lib/codec/ibc/applications/fee/v1/metadata.d.ts +25 -0
  99. package/lib/codec/ibc/applications/fee/v1/metadata.js +71 -0
  100. package/lib/codec/ibc/applications/fee/v1/query.d.ts +312 -0
  101. package/lib/codec/ibc/applications/fee/v1/query.js +1187 -0
  102. package/lib/codec/ibc/applications/fee/v1/tx.d.ts +171 -0
  103. package/lib/codec/ibc/applications/fee/v1/tx.js +524 -0
  104. package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +78 -0
  105. package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.js +296 -0
  106. package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.d.ts +80 -0
  107. package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.js +439 -0
  108. package/lib/hydrogen/transfer.d.ts +5 -5
  109. package/lib/insights/competition.d.ts +2 -0
  110. package/lib/provider/metamask/MetaMask.d.ts +5 -5
  111. package/lib/provider/metamask/MetaMask.js +35 -35
  112. package/lib/util/blockchain.d.ts +9 -0
  113. package/lib/util/blockchain.js +143 -1
  114. package/lib/util/ibc.d.ts +4 -4
  115. package/lib/util/ibc.js +17 -18
  116. package/package.json +1 -1
@@ -0,0 +1,1648 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.QueryClientImpl = exports.QueryTallyResultResponse = exports.QueryTallyResultRequest = exports.QueryGroupsByMemberResponse = exports.QueryGroupsByMemberRequest = exports.QueryVotesByVoterResponse = exports.QueryVotesByVoterRequest = exports.QueryVotesByProposalResponse = exports.QueryVotesByProposalRequest = exports.QueryVoteByProposalVoterResponse = exports.QueryVoteByProposalVoterRequest = exports.QueryProposalsByGroupPolicyResponse = exports.QueryProposalsByGroupPolicyRequest = exports.QueryProposalResponse = exports.QueryProposalRequest = exports.QueryGroupPoliciesByAdminResponse = exports.QueryGroupPoliciesByAdminRequest = exports.QueryGroupPoliciesByGroupResponse = exports.QueryGroupPoliciesByGroupRequest = exports.QueryGroupsByAdminResponse = exports.QueryGroupsByAdminRequest = exports.QueryGroupMembersResponse = exports.QueryGroupMembersRequest = exports.QueryGroupPolicyInfoResponse = exports.QueryGroupPolicyInfoRequest = exports.QueryGroupInfoResponse = exports.QueryGroupInfoRequest = exports.protobufPackage = void 0;
7
+ /* eslint-disable */
8
+ const long_1 = __importDefault(require("long"));
9
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
+ const types_1 = require("./types");
11
+ const pagination_1 = require("../../base/query/v1beta1/pagination");
12
+ exports.protobufPackage = "cosmos.group.v1";
13
+ const baseQueryGroupInfoRequest = { groupId: long_1.default.UZERO };
14
+ exports.QueryGroupInfoRequest = {
15
+ encode(message, writer = minimal_1.default.Writer.create()) {
16
+ if (!message.groupId.isZero()) {
17
+ writer.uint32(8).uint64(message.groupId);
18
+ }
19
+ return writer;
20
+ },
21
+ decode(input, length) {
22
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
23
+ let end = length === undefined ? reader.len : reader.pos + length;
24
+ const message = Object.assign({}, baseQueryGroupInfoRequest);
25
+ while (reader.pos < end) {
26
+ const tag = reader.uint32();
27
+ switch (tag >>> 3) {
28
+ case 1:
29
+ message.groupId = reader.uint64();
30
+ break;
31
+ default:
32
+ reader.skipType(tag & 7);
33
+ break;
34
+ }
35
+ }
36
+ return message;
37
+ },
38
+ fromJSON(object) {
39
+ const message = Object.assign({}, baseQueryGroupInfoRequest);
40
+ message.groupId =
41
+ object.groupId !== undefined && object.groupId !== null
42
+ ? long_1.default.fromString(object.groupId)
43
+ : long_1.default.UZERO;
44
+ return message;
45
+ },
46
+ toJSON(message) {
47
+ const obj = {};
48
+ message.groupId !== undefined &&
49
+ (obj.groupId = (message.groupId || long_1.default.UZERO).toString());
50
+ return obj;
51
+ },
52
+ fromPartial(object) {
53
+ const message = Object.assign({}, baseQueryGroupInfoRequest);
54
+ message.groupId =
55
+ object.groupId !== undefined && object.groupId !== null
56
+ ? long_1.default.fromValue(object.groupId)
57
+ : long_1.default.UZERO;
58
+ return message;
59
+ },
60
+ };
61
+ const baseQueryGroupInfoResponse = {};
62
+ exports.QueryGroupInfoResponse = {
63
+ encode(message, writer = minimal_1.default.Writer.create()) {
64
+ if (message.info !== undefined) {
65
+ types_1.GroupInfo.encode(message.info, writer.uint32(10).fork()).ldelim();
66
+ }
67
+ return writer;
68
+ },
69
+ decode(input, length) {
70
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
71
+ let end = length === undefined ? reader.len : reader.pos + length;
72
+ const message = Object.assign({}, baseQueryGroupInfoResponse);
73
+ while (reader.pos < end) {
74
+ const tag = reader.uint32();
75
+ switch (tag >>> 3) {
76
+ case 1:
77
+ message.info = types_1.GroupInfo.decode(reader, reader.uint32());
78
+ break;
79
+ default:
80
+ reader.skipType(tag & 7);
81
+ break;
82
+ }
83
+ }
84
+ return message;
85
+ },
86
+ fromJSON(object) {
87
+ const message = Object.assign({}, baseQueryGroupInfoResponse);
88
+ message.info =
89
+ object.info !== undefined && object.info !== null
90
+ ? types_1.GroupInfo.fromJSON(object.info)
91
+ : undefined;
92
+ return message;
93
+ },
94
+ toJSON(message) {
95
+ const obj = {};
96
+ message.info !== undefined &&
97
+ (obj.info = message.info ? types_1.GroupInfo.toJSON(message.info) : undefined);
98
+ return obj;
99
+ },
100
+ fromPartial(object) {
101
+ const message = Object.assign({}, baseQueryGroupInfoResponse);
102
+ message.info =
103
+ object.info !== undefined && object.info !== null
104
+ ? types_1.GroupInfo.fromPartial(object.info)
105
+ : undefined;
106
+ return message;
107
+ },
108
+ };
109
+ const baseQueryGroupPolicyInfoRequest = { address: "" };
110
+ exports.QueryGroupPolicyInfoRequest = {
111
+ encode(message, writer = minimal_1.default.Writer.create()) {
112
+ if (message.address !== "") {
113
+ writer.uint32(10).string(message.address);
114
+ }
115
+ return writer;
116
+ },
117
+ decode(input, length) {
118
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
119
+ let end = length === undefined ? reader.len : reader.pos + length;
120
+ const message = Object.assign({}, baseQueryGroupPolicyInfoRequest);
121
+ while (reader.pos < end) {
122
+ const tag = reader.uint32();
123
+ switch (tag >>> 3) {
124
+ case 1:
125
+ message.address = reader.string();
126
+ break;
127
+ default:
128
+ reader.skipType(tag & 7);
129
+ break;
130
+ }
131
+ }
132
+ return message;
133
+ },
134
+ fromJSON(object) {
135
+ const message = Object.assign({}, baseQueryGroupPolicyInfoRequest);
136
+ message.address =
137
+ object.address !== undefined && object.address !== null
138
+ ? String(object.address)
139
+ : "";
140
+ return message;
141
+ },
142
+ toJSON(message) {
143
+ const obj = {};
144
+ message.address !== undefined && (obj.address = message.address);
145
+ return obj;
146
+ },
147
+ fromPartial(object) {
148
+ var _a;
149
+ const message = Object.assign({}, baseQueryGroupPolicyInfoRequest);
150
+ message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
151
+ return message;
152
+ },
153
+ };
154
+ const baseQueryGroupPolicyInfoResponse = {};
155
+ exports.QueryGroupPolicyInfoResponse = {
156
+ encode(message, writer = minimal_1.default.Writer.create()) {
157
+ if (message.info !== undefined) {
158
+ types_1.GroupPolicyInfo.encode(message.info, writer.uint32(10).fork()).ldelim();
159
+ }
160
+ return writer;
161
+ },
162
+ decode(input, length) {
163
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
164
+ let end = length === undefined ? reader.len : reader.pos + length;
165
+ const message = Object.assign({}, baseQueryGroupPolicyInfoResponse);
166
+ while (reader.pos < end) {
167
+ const tag = reader.uint32();
168
+ switch (tag >>> 3) {
169
+ case 1:
170
+ message.info = types_1.GroupPolicyInfo.decode(reader, reader.uint32());
171
+ break;
172
+ default:
173
+ reader.skipType(tag & 7);
174
+ break;
175
+ }
176
+ }
177
+ return message;
178
+ },
179
+ fromJSON(object) {
180
+ const message = Object.assign({}, baseQueryGroupPolicyInfoResponse);
181
+ message.info =
182
+ object.info !== undefined && object.info !== null
183
+ ? types_1.GroupPolicyInfo.fromJSON(object.info)
184
+ : undefined;
185
+ return message;
186
+ },
187
+ toJSON(message) {
188
+ const obj = {};
189
+ message.info !== undefined &&
190
+ (obj.info = message.info
191
+ ? types_1.GroupPolicyInfo.toJSON(message.info)
192
+ : undefined);
193
+ return obj;
194
+ },
195
+ fromPartial(object) {
196
+ const message = Object.assign({}, baseQueryGroupPolicyInfoResponse);
197
+ message.info =
198
+ object.info !== undefined && object.info !== null
199
+ ? types_1.GroupPolicyInfo.fromPartial(object.info)
200
+ : undefined;
201
+ return message;
202
+ },
203
+ };
204
+ const baseQueryGroupMembersRequest = { groupId: long_1.default.UZERO };
205
+ exports.QueryGroupMembersRequest = {
206
+ encode(message, writer = minimal_1.default.Writer.create()) {
207
+ if (!message.groupId.isZero()) {
208
+ writer.uint32(8).uint64(message.groupId);
209
+ }
210
+ if (message.pagination !== undefined) {
211
+ pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
212
+ }
213
+ return writer;
214
+ },
215
+ decode(input, length) {
216
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
217
+ let end = length === undefined ? reader.len : reader.pos + length;
218
+ const message = Object.assign({}, baseQueryGroupMembersRequest);
219
+ while (reader.pos < end) {
220
+ const tag = reader.uint32();
221
+ switch (tag >>> 3) {
222
+ case 1:
223
+ message.groupId = reader.uint64();
224
+ break;
225
+ case 2:
226
+ message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
227
+ break;
228
+ default:
229
+ reader.skipType(tag & 7);
230
+ break;
231
+ }
232
+ }
233
+ return message;
234
+ },
235
+ fromJSON(object) {
236
+ const message = Object.assign({}, baseQueryGroupMembersRequest);
237
+ message.groupId =
238
+ object.groupId !== undefined && object.groupId !== null
239
+ ? long_1.default.fromString(object.groupId)
240
+ : long_1.default.UZERO;
241
+ message.pagination =
242
+ object.pagination !== undefined && object.pagination !== null
243
+ ? pagination_1.PageRequest.fromJSON(object.pagination)
244
+ : undefined;
245
+ return message;
246
+ },
247
+ toJSON(message) {
248
+ const obj = {};
249
+ message.groupId !== undefined &&
250
+ (obj.groupId = (message.groupId || long_1.default.UZERO).toString());
251
+ message.pagination !== undefined &&
252
+ (obj.pagination = message.pagination
253
+ ? pagination_1.PageRequest.toJSON(message.pagination)
254
+ : undefined);
255
+ return obj;
256
+ },
257
+ fromPartial(object) {
258
+ const message = Object.assign({}, baseQueryGroupMembersRequest);
259
+ message.groupId =
260
+ object.groupId !== undefined && object.groupId !== null
261
+ ? long_1.default.fromValue(object.groupId)
262
+ : long_1.default.UZERO;
263
+ message.pagination =
264
+ object.pagination !== undefined && object.pagination !== null
265
+ ? pagination_1.PageRequest.fromPartial(object.pagination)
266
+ : undefined;
267
+ return message;
268
+ },
269
+ };
270
+ const baseQueryGroupMembersResponse = {};
271
+ exports.QueryGroupMembersResponse = {
272
+ encode(message, writer = minimal_1.default.Writer.create()) {
273
+ for (const v of message.members) {
274
+ types_1.GroupMember.encode(v, writer.uint32(10).fork()).ldelim();
275
+ }
276
+ if (message.pagination !== undefined) {
277
+ pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
278
+ }
279
+ return writer;
280
+ },
281
+ decode(input, length) {
282
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
283
+ let end = length === undefined ? reader.len : reader.pos + length;
284
+ const message = Object.assign({}, baseQueryGroupMembersResponse);
285
+ message.members = [];
286
+ while (reader.pos < end) {
287
+ const tag = reader.uint32();
288
+ switch (tag >>> 3) {
289
+ case 1:
290
+ message.members.push(types_1.GroupMember.decode(reader, reader.uint32()));
291
+ break;
292
+ case 2:
293
+ message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
294
+ break;
295
+ default:
296
+ reader.skipType(tag & 7);
297
+ break;
298
+ }
299
+ }
300
+ return message;
301
+ },
302
+ fromJSON(object) {
303
+ var _a;
304
+ const message = Object.assign({}, baseQueryGroupMembersResponse);
305
+ message.members = ((_a = object.members) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupMember.fromJSON(e));
306
+ message.pagination =
307
+ object.pagination !== undefined && object.pagination !== null
308
+ ? pagination_1.PageResponse.fromJSON(object.pagination)
309
+ : undefined;
310
+ return message;
311
+ },
312
+ toJSON(message) {
313
+ const obj = {};
314
+ if (message.members) {
315
+ obj.members = message.members.map((e) => e ? types_1.GroupMember.toJSON(e) : undefined);
316
+ }
317
+ else {
318
+ obj.members = [];
319
+ }
320
+ message.pagination !== undefined &&
321
+ (obj.pagination = message.pagination
322
+ ? pagination_1.PageResponse.toJSON(message.pagination)
323
+ : undefined);
324
+ return obj;
325
+ },
326
+ fromPartial(object) {
327
+ var _a;
328
+ const message = Object.assign({}, baseQueryGroupMembersResponse);
329
+ message.members = ((_a = object.members) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupMember.fromPartial(e));
330
+ message.pagination =
331
+ object.pagination !== undefined && object.pagination !== null
332
+ ? pagination_1.PageResponse.fromPartial(object.pagination)
333
+ : undefined;
334
+ return message;
335
+ },
336
+ };
337
+ const baseQueryGroupsByAdminRequest = { admin: "" };
338
+ exports.QueryGroupsByAdminRequest = {
339
+ encode(message, writer = minimal_1.default.Writer.create()) {
340
+ if (message.admin !== "") {
341
+ writer.uint32(10).string(message.admin);
342
+ }
343
+ if (message.pagination !== undefined) {
344
+ pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
345
+ }
346
+ return writer;
347
+ },
348
+ decode(input, length) {
349
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
350
+ let end = length === undefined ? reader.len : reader.pos + length;
351
+ const message = Object.assign({}, baseQueryGroupsByAdminRequest);
352
+ while (reader.pos < end) {
353
+ const tag = reader.uint32();
354
+ switch (tag >>> 3) {
355
+ case 1:
356
+ message.admin = reader.string();
357
+ break;
358
+ case 2:
359
+ message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
360
+ break;
361
+ default:
362
+ reader.skipType(tag & 7);
363
+ break;
364
+ }
365
+ }
366
+ return message;
367
+ },
368
+ fromJSON(object) {
369
+ const message = Object.assign({}, baseQueryGroupsByAdminRequest);
370
+ message.admin =
371
+ object.admin !== undefined && object.admin !== null
372
+ ? String(object.admin)
373
+ : "";
374
+ message.pagination =
375
+ object.pagination !== undefined && object.pagination !== null
376
+ ? pagination_1.PageRequest.fromJSON(object.pagination)
377
+ : undefined;
378
+ return message;
379
+ },
380
+ toJSON(message) {
381
+ const obj = {};
382
+ message.admin !== undefined && (obj.admin = message.admin);
383
+ message.pagination !== undefined &&
384
+ (obj.pagination = message.pagination
385
+ ? pagination_1.PageRequest.toJSON(message.pagination)
386
+ : undefined);
387
+ return obj;
388
+ },
389
+ fromPartial(object) {
390
+ var _a;
391
+ const message = Object.assign({}, baseQueryGroupsByAdminRequest);
392
+ message.admin = (_a = object.admin) !== null && _a !== void 0 ? _a : "";
393
+ message.pagination =
394
+ object.pagination !== undefined && object.pagination !== null
395
+ ? pagination_1.PageRequest.fromPartial(object.pagination)
396
+ : undefined;
397
+ return message;
398
+ },
399
+ };
400
+ const baseQueryGroupsByAdminResponse = {};
401
+ exports.QueryGroupsByAdminResponse = {
402
+ encode(message, writer = minimal_1.default.Writer.create()) {
403
+ for (const v of message.groups) {
404
+ types_1.GroupInfo.encode(v, writer.uint32(10).fork()).ldelim();
405
+ }
406
+ if (message.pagination !== undefined) {
407
+ pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
408
+ }
409
+ return writer;
410
+ },
411
+ decode(input, length) {
412
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
413
+ let end = length === undefined ? reader.len : reader.pos + length;
414
+ const message = Object.assign({}, baseQueryGroupsByAdminResponse);
415
+ message.groups = [];
416
+ while (reader.pos < end) {
417
+ const tag = reader.uint32();
418
+ switch (tag >>> 3) {
419
+ case 1:
420
+ message.groups.push(types_1.GroupInfo.decode(reader, reader.uint32()));
421
+ break;
422
+ case 2:
423
+ message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
424
+ break;
425
+ default:
426
+ reader.skipType(tag & 7);
427
+ break;
428
+ }
429
+ }
430
+ return message;
431
+ },
432
+ fromJSON(object) {
433
+ var _a;
434
+ const message = Object.assign({}, baseQueryGroupsByAdminResponse);
435
+ message.groups = ((_a = object.groups) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupInfo.fromJSON(e));
436
+ message.pagination =
437
+ object.pagination !== undefined && object.pagination !== null
438
+ ? pagination_1.PageResponse.fromJSON(object.pagination)
439
+ : undefined;
440
+ return message;
441
+ },
442
+ toJSON(message) {
443
+ const obj = {};
444
+ if (message.groups) {
445
+ obj.groups = message.groups.map((e) => e ? types_1.GroupInfo.toJSON(e) : undefined);
446
+ }
447
+ else {
448
+ obj.groups = [];
449
+ }
450
+ message.pagination !== undefined &&
451
+ (obj.pagination = message.pagination
452
+ ? pagination_1.PageResponse.toJSON(message.pagination)
453
+ : undefined);
454
+ return obj;
455
+ },
456
+ fromPartial(object) {
457
+ var _a;
458
+ const message = Object.assign({}, baseQueryGroupsByAdminResponse);
459
+ message.groups = ((_a = object.groups) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupInfo.fromPartial(e));
460
+ message.pagination =
461
+ object.pagination !== undefined && object.pagination !== null
462
+ ? pagination_1.PageResponse.fromPartial(object.pagination)
463
+ : undefined;
464
+ return message;
465
+ },
466
+ };
467
+ const baseQueryGroupPoliciesByGroupRequest = { groupId: long_1.default.UZERO };
468
+ exports.QueryGroupPoliciesByGroupRequest = {
469
+ encode(message, writer = minimal_1.default.Writer.create()) {
470
+ if (!message.groupId.isZero()) {
471
+ writer.uint32(8).uint64(message.groupId);
472
+ }
473
+ if (message.pagination !== undefined) {
474
+ pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
475
+ }
476
+ return writer;
477
+ },
478
+ decode(input, length) {
479
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
480
+ let end = length === undefined ? reader.len : reader.pos + length;
481
+ const message = Object.assign({}, baseQueryGroupPoliciesByGroupRequest);
482
+ while (reader.pos < end) {
483
+ const tag = reader.uint32();
484
+ switch (tag >>> 3) {
485
+ case 1:
486
+ message.groupId = reader.uint64();
487
+ break;
488
+ case 2:
489
+ message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
490
+ break;
491
+ default:
492
+ reader.skipType(tag & 7);
493
+ break;
494
+ }
495
+ }
496
+ return message;
497
+ },
498
+ fromJSON(object) {
499
+ const message = Object.assign({}, baseQueryGroupPoliciesByGroupRequest);
500
+ message.groupId =
501
+ object.groupId !== undefined && object.groupId !== null
502
+ ? long_1.default.fromString(object.groupId)
503
+ : long_1.default.UZERO;
504
+ message.pagination =
505
+ object.pagination !== undefined && object.pagination !== null
506
+ ? pagination_1.PageRequest.fromJSON(object.pagination)
507
+ : undefined;
508
+ return message;
509
+ },
510
+ toJSON(message) {
511
+ const obj = {};
512
+ message.groupId !== undefined &&
513
+ (obj.groupId = (message.groupId || long_1.default.UZERO).toString());
514
+ message.pagination !== undefined &&
515
+ (obj.pagination = message.pagination
516
+ ? pagination_1.PageRequest.toJSON(message.pagination)
517
+ : undefined);
518
+ return obj;
519
+ },
520
+ fromPartial(object) {
521
+ const message = Object.assign({}, baseQueryGroupPoliciesByGroupRequest);
522
+ message.groupId =
523
+ object.groupId !== undefined && object.groupId !== null
524
+ ? long_1.default.fromValue(object.groupId)
525
+ : long_1.default.UZERO;
526
+ message.pagination =
527
+ object.pagination !== undefined && object.pagination !== null
528
+ ? pagination_1.PageRequest.fromPartial(object.pagination)
529
+ : undefined;
530
+ return message;
531
+ },
532
+ };
533
+ const baseQueryGroupPoliciesByGroupResponse = {};
534
+ exports.QueryGroupPoliciesByGroupResponse = {
535
+ encode(message, writer = minimal_1.default.Writer.create()) {
536
+ for (const v of message.groupPolicies) {
537
+ types_1.GroupPolicyInfo.encode(v, writer.uint32(10).fork()).ldelim();
538
+ }
539
+ if (message.pagination !== undefined) {
540
+ pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
541
+ }
542
+ return writer;
543
+ },
544
+ decode(input, length) {
545
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
546
+ let end = length === undefined ? reader.len : reader.pos + length;
547
+ const message = Object.assign({}, baseQueryGroupPoliciesByGroupResponse);
548
+ message.groupPolicies = [];
549
+ while (reader.pos < end) {
550
+ const tag = reader.uint32();
551
+ switch (tag >>> 3) {
552
+ case 1:
553
+ message.groupPolicies.push(types_1.GroupPolicyInfo.decode(reader, reader.uint32()));
554
+ break;
555
+ case 2:
556
+ message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
557
+ break;
558
+ default:
559
+ reader.skipType(tag & 7);
560
+ break;
561
+ }
562
+ }
563
+ return message;
564
+ },
565
+ fromJSON(object) {
566
+ var _a;
567
+ const message = Object.assign({}, baseQueryGroupPoliciesByGroupResponse);
568
+ message.groupPolicies = ((_a = object.groupPolicies) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupPolicyInfo.fromJSON(e));
569
+ message.pagination =
570
+ object.pagination !== undefined && object.pagination !== null
571
+ ? pagination_1.PageResponse.fromJSON(object.pagination)
572
+ : undefined;
573
+ return message;
574
+ },
575
+ toJSON(message) {
576
+ const obj = {};
577
+ if (message.groupPolicies) {
578
+ obj.groupPolicies = message.groupPolicies.map((e) => e ? types_1.GroupPolicyInfo.toJSON(e) : undefined);
579
+ }
580
+ else {
581
+ obj.groupPolicies = [];
582
+ }
583
+ message.pagination !== undefined &&
584
+ (obj.pagination = message.pagination
585
+ ? pagination_1.PageResponse.toJSON(message.pagination)
586
+ : undefined);
587
+ return obj;
588
+ },
589
+ fromPartial(object) {
590
+ var _a;
591
+ const message = Object.assign({}, baseQueryGroupPoliciesByGroupResponse);
592
+ message.groupPolicies = ((_a = object.groupPolicies) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupPolicyInfo.fromPartial(e));
593
+ message.pagination =
594
+ object.pagination !== undefined && object.pagination !== null
595
+ ? pagination_1.PageResponse.fromPartial(object.pagination)
596
+ : undefined;
597
+ return message;
598
+ },
599
+ };
600
+ const baseQueryGroupPoliciesByAdminRequest = { admin: "" };
601
+ exports.QueryGroupPoliciesByAdminRequest = {
602
+ encode(message, writer = minimal_1.default.Writer.create()) {
603
+ if (message.admin !== "") {
604
+ writer.uint32(10).string(message.admin);
605
+ }
606
+ if (message.pagination !== undefined) {
607
+ pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
608
+ }
609
+ return writer;
610
+ },
611
+ decode(input, length) {
612
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
613
+ let end = length === undefined ? reader.len : reader.pos + length;
614
+ const message = Object.assign({}, baseQueryGroupPoliciesByAdminRequest);
615
+ while (reader.pos < end) {
616
+ const tag = reader.uint32();
617
+ switch (tag >>> 3) {
618
+ case 1:
619
+ message.admin = reader.string();
620
+ break;
621
+ case 2:
622
+ message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
623
+ break;
624
+ default:
625
+ reader.skipType(tag & 7);
626
+ break;
627
+ }
628
+ }
629
+ return message;
630
+ },
631
+ fromJSON(object) {
632
+ const message = Object.assign({}, baseQueryGroupPoliciesByAdminRequest);
633
+ message.admin =
634
+ object.admin !== undefined && object.admin !== null
635
+ ? String(object.admin)
636
+ : "";
637
+ message.pagination =
638
+ object.pagination !== undefined && object.pagination !== null
639
+ ? pagination_1.PageRequest.fromJSON(object.pagination)
640
+ : undefined;
641
+ return message;
642
+ },
643
+ toJSON(message) {
644
+ const obj = {};
645
+ message.admin !== undefined && (obj.admin = message.admin);
646
+ message.pagination !== undefined &&
647
+ (obj.pagination = message.pagination
648
+ ? pagination_1.PageRequest.toJSON(message.pagination)
649
+ : undefined);
650
+ return obj;
651
+ },
652
+ fromPartial(object) {
653
+ var _a;
654
+ const message = Object.assign({}, baseQueryGroupPoliciesByAdminRequest);
655
+ message.admin = (_a = object.admin) !== null && _a !== void 0 ? _a : "";
656
+ message.pagination =
657
+ object.pagination !== undefined && object.pagination !== null
658
+ ? pagination_1.PageRequest.fromPartial(object.pagination)
659
+ : undefined;
660
+ return message;
661
+ },
662
+ };
663
+ const baseQueryGroupPoliciesByAdminResponse = {};
664
+ exports.QueryGroupPoliciesByAdminResponse = {
665
+ encode(message, writer = minimal_1.default.Writer.create()) {
666
+ for (const v of message.groupPolicies) {
667
+ types_1.GroupPolicyInfo.encode(v, writer.uint32(10).fork()).ldelim();
668
+ }
669
+ if (message.pagination !== undefined) {
670
+ pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
671
+ }
672
+ return writer;
673
+ },
674
+ decode(input, length) {
675
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
676
+ let end = length === undefined ? reader.len : reader.pos + length;
677
+ const message = Object.assign({}, baseQueryGroupPoliciesByAdminResponse);
678
+ message.groupPolicies = [];
679
+ while (reader.pos < end) {
680
+ const tag = reader.uint32();
681
+ switch (tag >>> 3) {
682
+ case 1:
683
+ message.groupPolicies.push(types_1.GroupPolicyInfo.decode(reader, reader.uint32()));
684
+ break;
685
+ case 2:
686
+ message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
687
+ break;
688
+ default:
689
+ reader.skipType(tag & 7);
690
+ break;
691
+ }
692
+ }
693
+ return message;
694
+ },
695
+ fromJSON(object) {
696
+ var _a;
697
+ const message = Object.assign({}, baseQueryGroupPoliciesByAdminResponse);
698
+ message.groupPolicies = ((_a = object.groupPolicies) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupPolicyInfo.fromJSON(e));
699
+ message.pagination =
700
+ object.pagination !== undefined && object.pagination !== null
701
+ ? pagination_1.PageResponse.fromJSON(object.pagination)
702
+ : undefined;
703
+ return message;
704
+ },
705
+ toJSON(message) {
706
+ const obj = {};
707
+ if (message.groupPolicies) {
708
+ obj.groupPolicies = message.groupPolicies.map((e) => e ? types_1.GroupPolicyInfo.toJSON(e) : undefined);
709
+ }
710
+ else {
711
+ obj.groupPolicies = [];
712
+ }
713
+ message.pagination !== undefined &&
714
+ (obj.pagination = message.pagination
715
+ ? pagination_1.PageResponse.toJSON(message.pagination)
716
+ : undefined);
717
+ return obj;
718
+ },
719
+ fromPartial(object) {
720
+ var _a;
721
+ const message = Object.assign({}, baseQueryGroupPoliciesByAdminResponse);
722
+ message.groupPolicies = ((_a = object.groupPolicies) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupPolicyInfo.fromPartial(e));
723
+ message.pagination =
724
+ object.pagination !== undefined && object.pagination !== null
725
+ ? pagination_1.PageResponse.fromPartial(object.pagination)
726
+ : undefined;
727
+ return message;
728
+ },
729
+ };
730
+ const baseQueryProposalRequest = { proposalId: long_1.default.UZERO };
731
+ exports.QueryProposalRequest = {
732
+ encode(message, writer = minimal_1.default.Writer.create()) {
733
+ if (!message.proposalId.isZero()) {
734
+ writer.uint32(8).uint64(message.proposalId);
735
+ }
736
+ return writer;
737
+ },
738
+ decode(input, length) {
739
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
740
+ let end = length === undefined ? reader.len : reader.pos + length;
741
+ const message = Object.assign({}, baseQueryProposalRequest);
742
+ while (reader.pos < end) {
743
+ const tag = reader.uint32();
744
+ switch (tag >>> 3) {
745
+ case 1:
746
+ message.proposalId = reader.uint64();
747
+ break;
748
+ default:
749
+ reader.skipType(tag & 7);
750
+ break;
751
+ }
752
+ }
753
+ return message;
754
+ },
755
+ fromJSON(object) {
756
+ const message = Object.assign({}, baseQueryProposalRequest);
757
+ message.proposalId =
758
+ object.proposalId !== undefined && object.proposalId !== null
759
+ ? long_1.default.fromString(object.proposalId)
760
+ : long_1.default.UZERO;
761
+ return message;
762
+ },
763
+ toJSON(message) {
764
+ const obj = {};
765
+ message.proposalId !== undefined &&
766
+ (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());
767
+ return obj;
768
+ },
769
+ fromPartial(object) {
770
+ const message = Object.assign({}, baseQueryProposalRequest);
771
+ message.proposalId =
772
+ object.proposalId !== undefined && object.proposalId !== null
773
+ ? long_1.default.fromValue(object.proposalId)
774
+ : long_1.default.UZERO;
775
+ return message;
776
+ },
777
+ };
778
+ const baseQueryProposalResponse = {};
779
+ exports.QueryProposalResponse = {
780
+ encode(message, writer = minimal_1.default.Writer.create()) {
781
+ if (message.proposal !== undefined) {
782
+ types_1.Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim();
783
+ }
784
+ return writer;
785
+ },
786
+ decode(input, length) {
787
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
788
+ let end = length === undefined ? reader.len : reader.pos + length;
789
+ const message = Object.assign({}, baseQueryProposalResponse);
790
+ while (reader.pos < end) {
791
+ const tag = reader.uint32();
792
+ switch (tag >>> 3) {
793
+ case 1:
794
+ message.proposal = types_1.Proposal.decode(reader, reader.uint32());
795
+ break;
796
+ default:
797
+ reader.skipType(tag & 7);
798
+ break;
799
+ }
800
+ }
801
+ return message;
802
+ },
803
+ fromJSON(object) {
804
+ const message = Object.assign({}, baseQueryProposalResponse);
805
+ message.proposal =
806
+ object.proposal !== undefined && object.proposal !== null
807
+ ? types_1.Proposal.fromJSON(object.proposal)
808
+ : undefined;
809
+ return message;
810
+ },
811
+ toJSON(message) {
812
+ const obj = {};
813
+ message.proposal !== undefined &&
814
+ (obj.proposal = message.proposal
815
+ ? types_1.Proposal.toJSON(message.proposal)
816
+ : undefined);
817
+ return obj;
818
+ },
819
+ fromPartial(object) {
820
+ const message = Object.assign({}, baseQueryProposalResponse);
821
+ message.proposal =
822
+ object.proposal !== undefined && object.proposal !== null
823
+ ? types_1.Proposal.fromPartial(object.proposal)
824
+ : undefined;
825
+ return message;
826
+ },
827
+ };
828
+ const baseQueryProposalsByGroupPolicyRequest = { address: "" };
829
+ exports.QueryProposalsByGroupPolicyRequest = {
830
+ encode(message, writer = minimal_1.default.Writer.create()) {
831
+ if (message.address !== "") {
832
+ writer.uint32(10).string(message.address);
833
+ }
834
+ if (message.pagination !== undefined) {
835
+ pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
836
+ }
837
+ return writer;
838
+ },
839
+ decode(input, length) {
840
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
841
+ let end = length === undefined ? reader.len : reader.pos + length;
842
+ const message = Object.assign({}, baseQueryProposalsByGroupPolicyRequest);
843
+ while (reader.pos < end) {
844
+ const tag = reader.uint32();
845
+ switch (tag >>> 3) {
846
+ case 1:
847
+ message.address = reader.string();
848
+ break;
849
+ case 2:
850
+ message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
851
+ break;
852
+ default:
853
+ reader.skipType(tag & 7);
854
+ break;
855
+ }
856
+ }
857
+ return message;
858
+ },
859
+ fromJSON(object) {
860
+ const message = Object.assign({}, baseQueryProposalsByGroupPolicyRequest);
861
+ message.address =
862
+ object.address !== undefined && object.address !== null
863
+ ? String(object.address)
864
+ : "";
865
+ message.pagination =
866
+ object.pagination !== undefined && object.pagination !== null
867
+ ? pagination_1.PageRequest.fromJSON(object.pagination)
868
+ : undefined;
869
+ return message;
870
+ },
871
+ toJSON(message) {
872
+ const obj = {};
873
+ message.address !== undefined && (obj.address = message.address);
874
+ message.pagination !== undefined &&
875
+ (obj.pagination = message.pagination
876
+ ? pagination_1.PageRequest.toJSON(message.pagination)
877
+ : undefined);
878
+ return obj;
879
+ },
880
+ fromPartial(object) {
881
+ var _a;
882
+ const message = Object.assign({}, baseQueryProposalsByGroupPolicyRequest);
883
+ message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
884
+ message.pagination =
885
+ object.pagination !== undefined && object.pagination !== null
886
+ ? pagination_1.PageRequest.fromPartial(object.pagination)
887
+ : undefined;
888
+ return message;
889
+ },
890
+ };
891
+ const baseQueryProposalsByGroupPolicyResponse = {};
892
+ exports.QueryProposalsByGroupPolicyResponse = {
893
+ encode(message, writer = minimal_1.default.Writer.create()) {
894
+ for (const v of message.proposals) {
895
+ types_1.Proposal.encode(v, writer.uint32(10).fork()).ldelim();
896
+ }
897
+ if (message.pagination !== undefined) {
898
+ pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
899
+ }
900
+ return writer;
901
+ },
902
+ decode(input, length) {
903
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
904
+ let end = length === undefined ? reader.len : reader.pos + length;
905
+ const message = Object.assign({}, baseQueryProposalsByGroupPolicyResponse);
906
+ message.proposals = [];
907
+ while (reader.pos < end) {
908
+ const tag = reader.uint32();
909
+ switch (tag >>> 3) {
910
+ case 1:
911
+ message.proposals.push(types_1.Proposal.decode(reader, reader.uint32()));
912
+ break;
913
+ case 2:
914
+ message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
915
+ break;
916
+ default:
917
+ reader.skipType(tag & 7);
918
+ break;
919
+ }
920
+ }
921
+ return message;
922
+ },
923
+ fromJSON(object) {
924
+ var _a;
925
+ const message = Object.assign({}, baseQueryProposalsByGroupPolicyResponse);
926
+ message.proposals = ((_a = object.proposals) !== null && _a !== void 0 ? _a : []).map((e) => types_1.Proposal.fromJSON(e));
927
+ message.pagination =
928
+ object.pagination !== undefined && object.pagination !== null
929
+ ? pagination_1.PageResponse.fromJSON(object.pagination)
930
+ : undefined;
931
+ return message;
932
+ },
933
+ toJSON(message) {
934
+ const obj = {};
935
+ if (message.proposals) {
936
+ obj.proposals = message.proposals.map((e) => e ? types_1.Proposal.toJSON(e) : undefined);
937
+ }
938
+ else {
939
+ obj.proposals = [];
940
+ }
941
+ message.pagination !== undefined &&
942
+ (obj.pagination = message.pagination
943
+ ? pagination_1.PageResponse.toJSON(message.pagination)
944
+ : undefined);
945
+ return obj;
946
+ },
947
+ fromPartial(object) {
948
+ var _a;
949
+ const message = Object.assign({}, baseQueryProposalsByGroupPolicyResponse);
950
+ message.proposals = ((_a = object.proposals) !== null && _a !== void 0 ? _a : []).map((e) => types_1.Proposal.fromPartial(e));
951
+ message.pagination =
952
+ object.pagination !== undefined && object.pagination !== null
953
+ ? pagination_1.PageResponse.fromPartial(object.pagination)
954
+ : undefined;
955
+ return message;
956
+ },
957
+ };
958
+ const baseQueryVoteByProposalVoterRequest = {
959
+ proposalId: long_1.default.UZERO,
960
+ voter: "",
961
+ };
962
+ exports.QueryVoteByProposalVoterRequest = {
963
+ encode(message, writer = minimal_1.default.Writer.create()) {
964
+ if (!message.proposalId.isZero()) {
965
+ writer.uint32(8).uint64(message.proposalId);
966
+ }
967
+ if (message.voter !== "") {
968
+ writer.uint32(18).string(message.voter);
969
+ }
970
+ return writer;
971
+ },
972
+ decode(input, length) {
973
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
974
+ let end = length === undefined ? reader.len : reader.pos + length;
975
+ const message = Object.assign({}, baseQueryVoteByProposalVoterRequest);
976
+ while (reader.pos < end) {
977
+ const tag = reader.uint32();
978
+ switch (tag >>> 3) {
979
+ case 1:
980
+ message.proposalId = reader.uint64();
981
+ break;
982
+ case 2:
983
+ message.voter = reader.string();
984
+ break;
985
+ default:
986
+ reader.skipType(tag & 7);
987
+ break;
988
+ }
989
+ }
990
+ return message;
991
+ },
992
+ fromJSON(object) {
993
+ const message = Object.assign({}, baseQueryVoteByProposalVoterRequest);
994
+ message.proposalId =
995
+ object.proposalId !== undefined && object.proposalId !== null
996
+ ? long_1.default.fromString(object.proposalId)
997
+ : long_1.default.UZERO;
998
+ message.voter =
999
+ object.voter !== undefined && object.voter !== null
1000
+ ? String(object.voter)
1001
+ : "";
1002
+ return message;
1003
+ },
1004
+ toJSON(message) {
1005
+ const obj = {};
1006
+ message.proposalId !== undefined &&
1007
+ (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());
1008
+ message.voter !== undefined && (obj.voter = message.voter);
1009
+ return obj;
1010
+ },
1011
+ fromPartial(object) {
1012
+ var _a;
1013
+ const message = Object.assign({}, baseQueryVoteByProposalVoterRequest);
1014
+ message.proposalId =
1015
+ object.proposalId !== undefined && object.proposalId !== null
1016
+ ? long_1.default.fromValue(object.proposalId)
1017
+ : long_1.default.UZERO;
1018
+ message.voter = (_a = object.voter) !== null && _a !== void 0 ? _a : "";
1019
+ return message;
1020
+ },
1021
+ };
1022
+ const baseQueryVoteByProposalVoterResponse = {};
1023
+ exports.QueryVoteByProposalVoterResponse = {
1024
+ encode(message, writer = minimal_1.default.Writer.create()) {
1025
+ if (message.vote !== undefined) {
1026
+ types_1.Vote.encode(message.vote, writer.uint32(10).fork()).ldelim();
1027
+ }
1028
+ return writer;
1029
+ },
1030
+ decode(input, length) {
1031
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1032
+ let end = length === undefined ? reader.len : reader.pos + length;
1033
+ const message = Object.assign({}, baseQueryVoteByProposalVoterResponse);
1034
+ while (reader.pos < end) {
1035
+ const tag = reader.uint32();
1036
+ switch (tag >>> 3) {
1037
+ case 1:
1038
+ message.vote = types_1.Vote.decode(reader, reader.uint32());
1039
+ break;
1040
+ default:
1041
+ reader.skipType(tag & 7);
1042
+ break;
1043
+ }
1044
+ }
1045
+ return message;
1046
+ },
1047
+ fromJSON(object) {
1048
+ const message = Object.assign({}, baseQueryVoteByProposalVoterResponse);
1049
+ message.vote =
1050
+ object.vote !== undefined && object.vote !== null
1051
+ ? types_1.Vote.fromJSON(object.vote)
1052
+ : undefined;
1053
+ return message;
1054
+ },
1055
+ toJSON(message) {
1056
+ const obj = {};
1057
+ message.vote !== undefined &&
1058
+ (obj.vote = message.vote ? types_1.Vote.toJSON(message.vote) : undefined);
1059
+ return obj;
1060
+ },
1061
+ fromPartial(object) {
1062
+ const message = Object.assign({}, baseQueryVoteByProposalVoterResponse);
1063
+ message.vote =
1064
+ object.vote !== undefined && object.vote !== null
1065
+ ? types_1.Vote.fromPartial(object.vote)
1066
+ : undefined;
1067
+ return message;
1068
+ },
1069
+ };
1070
+ const baseQueryVotesByProposalRequest = { proposalId: long_1.default.UZERO };
1071
+ exports.QueryVotesByProposalRequest = {
1072
+ encode(message, writer = minimal_1.default.Writer.create()) {
1073
+ if (!message.proposalId.isZero()) {
1074
+ writer.uint32(8).uint64(message.proposalId);
1075
+ }
1076
+ if (message.pagination !== undefined) {
1077
+ pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1078
+ }
1079
+ return writer;
1080
+ },
1081
+ decode(input, length) {
1082
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1083
+ let end = length === undefined ? reader.len : reader.pos + length;
1084
+ const message = Object.assign({}, baseQueryVotesByProposalRequest);
1085
+ while (reader.pos < end) {
1086
+ const tag = reader.uint32();
1087
+ switch (tag >>> 3) {
1088
+ case 1:
1089
+ message.proposalId = reader.uint64();
1090
+ break;
1091
+ case 2:
1092
+ message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
1093
+ break;
1094
+ default:
1095
+ reader.skipType(tag & 7);
1096
+ break;
1097
+ }
1098
+ }
1099
+ return message;
1100
+ },
1101
+ fromJSON(object) {
1102
+ const message = Object.assign({}, baseQueryVotesByProposalRequest);
1103
+ message.proposalId =
1104
+ object.proposalId !== undefined && object.proposalId !== null
1105
+ ? long_1.default.fromString(object.proposalId)
1106
+ : long_1.default.UZERO;
1107
+ message.pagination =
1108
+ object.pagination !== undefined && object.pagination !== null
1109
+ ? pagination_1.PageRequest.fromJSON(object.pagination)
1110
+ : undefined;
1111
+ return message;
1112
+ },
1113
+ toJSON(message) {
1114
+ const obj = {};
1115
+ message.proposalId !== undefined &&
1116
+ (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());
1117
+ message.pagination !== undefined &&
1118
+ (obj.pagination = message.pagination
1119
+ ? pagination_1.PageRequest.toJSON(message.pagination)
1120
+ : undefined);
1121
+ return obj;
1122
+ },
1123
+ fromPartial(object) {
1124
+ const message = Object.assign({}, baseQueryVotesByProposalRequest);
1125
+ message.proposalId =
1126
+ object.proposalId !== undefined && object.proposalId !== null
1127
+ ? long_1.default.fromValue(object.proposalId)
1128
+ : long_1.default.UZERO;
1129
+ message.pagination =
1130
+ object.pagination !== undefined && object.pagination !== null
1131
+ ? pagination_1.PageRequest.fromPartial(object.pagination)
1132
+ : undefined;
1133
+ return message;
1134
+ },
1135
+ };
1136
+ const baseQueryVotesByProposalResponse = {};
1137
+ exports.QueryVotesByProposalResponse = {
1138
+ encode(message, writer = minimal_1.default.Writer.create()) {
1139
+ for (const v of message.votes) {
1140
+ types_1.Vote.encode(v, writer.uint32(10).fork()).ldelim();
1141
+ }
1142
+ if (message.pagination !== undefined) {
1143
+ pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1144
+ }
1145
+ return writer;
1146
+ },
1147
+ decode(input, length) {
1148
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1149
+ let end = length === undefined ? reader.len : reader.pos + length;
1150
+ const message = Object.assign({}, baseQueryVotesByProposalResponse);
1151
+ message.votes = [];
1152
+ while (reader.pos < end) {
1153
+ const tag = reader.uint32();
1154
+ switch (tag >>> 3) {
1155
+ case 1:
1156
+ message.votes.push(types_1.Vote.decode(reader, reader.uint32()));
1157
+ break;
1158
+ case 2:
1159
+ message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
1160
+ break;
1161
+ default:
1162
+ reader.skipType(tag & 7);
1163
+ break;
1164
+ }
1165
+ }
1166
+ return message;
1167
+ },
1168
+ fromJSON(object) {
1169
+ var _a;
1170
+ const message = Object.assign({}, baseQueryVotesByProposalResponse);
1171
+ message.votes = ((_a = object.votes) !== null && _a !== void 0 ? _a : []).map((e) => types_1.Vote.fromJSON(e));
1172
+ message.pagination =
1173
+ object.pagination !== undefined && object.pagination !== null
1174
+ ? pagination_1.PageResponse.fromJSON(object.pagination)
1175
+ : undefined;
1176
+ return message;
1177
+ },
1178
+ toJSON(message) {
1179
+ const obj = {};
1180
+ if (message.votes) {
1181
+ obj.votes = message.votes.map((e) => (e ? types_1.Vote.toJSON(e) : undefined));
1182
+ }
1183
+ else {
1184
+ obj.votes = [];
1185
+ }
1186
+ message.pagination !== undefined &&
1187
+ (obj.pagination = message.pagination
1188
+ ? pagination_1.PageResponse.toJSON(message.pagination)
1189
+ : undefined);
1190
+ return obj;
1191
+ },
1192
+ fromPartial(object) {
1193
+ var _a;
1194
+ const message = Object.assign({}, baseQueryVotesByProposalResponse);
1195
+ message.votes = ((_a = object.votes) !== null && _a !== void 0 ? _a : []).map((e) => types_1.Vote.fromPartial(e));
1196
+ message.pagination =
1197
+ object.pagination !== undefined && object.pagination !== null
1198
+ ? pagination_1.PageResponse.fromPartial(object.pagination)
1199
+ : undefined;
1200
+ return message;
1201
+ },
1202
+ };
1203
+ const baseQueryVotesByVoterRequest = { voter: "" };
1204
+ exports.QueryVotesByVoterRequest = {
1205
+ encode(message, writer = minimal_1.default.Writer.create()) {
1206
+ if (message.voter !== "") {
1207
+ writer.uint32(10).string(message.voter);
1208
+ }
1209
+ if (message.pagination !== undefined) {
1210
+ pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1211
+ }
1212
+ return writer;
1213
+ },
1214
+ decode(input, length) {
1215
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1216
+ let end = length === undefined ? reader.len : reader.pos + length;
1217
+ const message = Object.assign({}, baseQueryVotesByVoterRequest);
1218
+ while (reader.pos < end) {
1219
+ const tag = reader.uint32();
1220
+ switch (tag >>> 3) {
1221
+ case 1:
1222
+ message.voter = reader.string();
1223
+ break;
1224
+ case 2:
1225
+ message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
1226
+ break;
1227
+ default:
1228
+ reader.skipType(tag & 7);
1229
+ break;
1230
+ }
1231
+ }
1232
+ return message;
1233
+ },
1234
+ fromJSON(object) {
1235
+ const message = Object.assign({}, baseQueryVotesByVoterRequest);
1236
+ message.voter =
1237
+ object.voter !== undefined && object.voter !== null
1238
+ ? String(object.voter)
1239
+ : "";
1240
+ message.pagination =
1241
+ object.pagination !== undefined && object.pagination !== null
1242
+ ? pagination_1.PageRequest.fromJSON(object.pagination)
1243
+ : undefined;
1244
+ return message;
1245
+ },
1246
+ toJSON(message) {
1247
+ const obj = {};
1248
+ message.voter !== undefined && (obj.voter = message.voter);
1249
+ message.pagination !== undefined &&
1250
+ (obj.pagination = message.pagination
1251
+ ? pagination_1.PageRequest.toJSON(message.pagination)
1252
+ : undefined);
1253
+ return obj;
1254
+ },
1255
+ fromPartial(object) {
1256
+ var _a;
1257
+ const message = Object.assign({}, baseQueryVotesByVoterRequest);
1258
+ message.voter = (_a = object.voter) !== null && _a !== void 0 ? _a : "";
1259
+ message.pagination =
1260
+ object.pagination !== undefined && object.pagination !== null
1261
+ ? pagination_1.PageRequest.fromPartial(object.pagination)
1262
+ : undefined;
1263
+ return message;
1264
+ },
1265
+ };
1266
+ const baseQueryVotesByVoterResponse = {};
1267
+ exports.QueryVotesByVoterResponse = {
1268
+ encode(message, writer = minimal_1.default.Writer.create()) {
1269
+ for (const v of message.votes) {
1270
+ types_1.Vote.encode(v, writer.uint32(10).fork()).ldelim();
1271
+ }
1272
+ if (message.pagination !== undefined) {
1273
+ pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1274
+ }
1275
+ return writer;
1276
+ },
1277
+ decode(input, length) {
1278
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1279
+ let end = length === undefined ? reader.len : reader.pos + length;
1280
+ const message = Object.assign({}, baseQueryVotesByVoterResponse);
1281
+ message.votes = [];
1282
+ while (reader.pos < end) {
1283
+ const tag = reader.uint32();
1284
+ switch (tag >>> 3) {
1285
+ case 1:
1286
+ message.votes.push(types_1.Vote.decode(reader, reader.uint32()));
1287
+ break;
1288
+ case 2:
1289
+ message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
1290
+ break;
1291
+ default:
1292
+ reader.skipType(tag & 7);
1293
+ break;
1294
+ }
1295
+ }
1296
+ return message;
1297
+ },
1298
+ fromJSON(object) {
1299
+ var _a;
1300
+ const message = Object.assign({}, baseQueryVotesByVoterResponse);
1301
+ message.votes = ((_a = object.votes) !== null && _a !== void 0 ? _a : []).map((e) => types_1.Vote.fromJSON(e));
1302
+ message.pagination =
1303
+ object.pagination !== undefined && object.pagination !== null
1304
+ ? pagination_1.PageResponse.fromJSON(object.pagination)
1305
+ : undefined;
1306
+ return message;
1307
+ },
1308
+ toJSON(message) {
1309
+ const obj = {};
1310
+ if (message.votes) {
1311
+ obj.votes = message.votes.map((e) => (e ? types_1.Vote.toJSON(e) : undefined));
1312
+ }
1313
+ else {
1314
+ obj.votes = [];
1315
+ }
1316
+ message.pagination !== undefined &&
1317
+ (obj.pagination = message.pagination
1318
+ ? pagination_1.PageResponse.toJSON(message.pagination)
1319
+ : undefined);
1320
+ return obj;
1321
+ },
1322
+ fromPartial(object) {
1323
+ var _a;
1324
+ const message = Object.assign({}, baseQueryVotesByVoterResponse);
1325
+ message.votes = ((_a = object.votes) !== null && _a !== void 0 ? _a : []).map((e) => types_1.Vote.fromPartial(e));
1326
+ message.pagination =
1327
+ object.pagination !== undefined && object.pagination !== null
1328
+ ? pagination_1.PageResponse.fromPartial(object.pagination)
1329
+ : undefined;
1330
+ return message;
1331
+ },
1332
+ };
1333
+ const baseQueryGroupsByMemberRequest = { address: "" };
1334
+ exports.QueryGroupsByMemberRequest = {
1335
+ encode(message, writer = minimal_1.default.Writer.create()) {
1336
+ if (message.address !== "") {
1337
+ writer.uint32(10).string(message.address);
1338
+ }
1339
+ if (message.pagination !== undefined) {
1340
+ pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1341
+ }
1342
+ return writer;
1343
+ },
1344
+ decode(input, length) {
1345
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1346
+ let end = length === undefined ? reader.len : reader.pos + length;
1347
+ const message = Object.assign({}, baseQueryGroupsByMemberRequest);
1348
+ while (reader.pos < end) {
1349
+ const tag = reader.uint32();
1350
+ switch (tag >>> 3) {
1351
+ case 1:
1352
+ message.address = reader.string();
1353
+ break;
1354
+ case 2:
1355
+ message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
1356
+ break;
1357
+ default:
1358
+ reader.skipType(tag & 7);
1359
+ break;
1360
+ }
1361
+ }
1362
+ return message;
1363
+ },
1364
+ fromJSON(object) {
1365
+ const message = Object.assign({}, baseQueryGroupsByMemberRequest);
1366
+ message.address =
1367
+ object.address !== undefined && object.address !== null
1368
+ ? String(object.address)
1369
+ : "";
1370
+ message.pagination =
1371
+ object.pagination !== undefined && object.pagination !== null
1372
+ ? pagination_1.PageRequest.fromJSON(object.pagination)
1373
+ : undefined;
1374
+ return message;
1375
+ },
1376
+ toJSON(message) {
1377
+ const obj = {};
1378
+ message.address !== undefined && (obj.address = message.address);
1379
+ message.pagination !== undefined &&
1380
+ (obj.pagination = message.pagination
1381
+ ? pagination_1.PageRequest.toJSON(message.pagination)
1382
+ : undefined);
1383
+ return obj;
1384
+ },
1385
+ fromPartial(object) {
1386
+ var _a;
1387
+ const message = Object.assign({}, baseQueryGroupsByMemberRequest);
1388
+ message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
1389
+ message.pagination =
1390
+ object.pagination !== undefined && object.pagination !== null
1391
+ ? pagination_1.PageRequest.fromPartial(object.pagination)
1392
+ : undefined;
1393
+ return message;
1394
+ },
1395
+ };
1396
+ const baseQueryGroupsByMemberResponse = {};
1397
+ exports.QueryGroupsByMemberResponse = {
1398
+ encode(message, writer = minimal_1.default.Writer.create()) {
1399
+ for (const v of message.groups) {
1400
+ types_1.GroupInfo.encode(v, writer.uint32(10).fork()).ldelim();
1401
+ }
1402
+ if (message.pagination !== undefined) {
1403
+ pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1404
+ }
1405
+ return writer;
1406
+ },
1407
+ decode(input, length) {
1408
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1409
+ let end = length === undefined ? reader.len : reader.pos + length;
1410
+ const message = Object.assign({}, baseQueryGroupsByMemberResponse);
1411
+ message.groups = [];
1412
+ while (reader.pos < end) {
1413
+ const tag = reader.uint32();
1414
+ switch (tag >>> 3) {
1415
+ case 1:
1416
+ message.groups.push(types_1.GroupInfo.decode(reader, reader.uint32()));
1417
+ break;
1418
+ case 2:
1419
+ message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
1420
+ break;
1421
+ default:
1422
+ reader.skipType(tag & 7);
1423
+ break;
1424
+ }
1425
+ }
1426
+ return message;
1427
+ },
1428
+ fromJSON(object) {
1429
+ var _a;
1430
+ const message = Object.assign({}, baseQueryGroupsByMemberResponse);
1431
+ message.groups = ((_a = object.groups) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupInfo.fromJSON(e));
1432
+ message.pagination =
1433
+ object.pagination !== undefined && object.pagination !== null
1434
+ ? pagination_1.PageResponse.fromJSON(object.pagination)
1435
+ : undefined;
1436
+ return message;
1437
+ },
1438
+ toJSON(message) {
1439
+ const obj = {};
1440
+ if (message.groups) {
1441
+ obj.groups = message.groups.map((e) => e ? types_1.GroupInfo.toJSON(e) : undefined);
1442
+ }
1443
+ else {
1444
+ obj.groups = [];
1445
+ }
1446
+ message.pagination !== undefined &&
1447
+ (obj.pagination = message.pagination
1448
+ ? pagination_1.PageResponse.toJSON(message.pagination)
1449
+ : undefined);
1450
+ return obj;
1451
+ },
1452
+ fromPartial(object) {
1453
+ var _a;
1454
+ const message = Object.assign({}, baseQueryGroupsByMemberResponse);
1455
+ message.groups = ((_a = object.groups) !== null && _a !== void 0 ? _a : []).map((e) => types_1.GroupInfo.fromPartial(e));
1456
+ message.pagination =
1457
+ object.pagination !== undefined && object.pagination !== null
1458
+ ? pagination_1.PageResponse.fromPartial(object.pagination)
1459
+ : undefined;
1460
+ return message;
1461
+ },
1462
+ };
1463
+ const baseQueryTallyResultRequest = { proposalId: long_1.default.UZERO };
1464
+ exports.QueryTallyResultRequest = {
1465
+ encode(message, writer = minimal_1.default.Writer.create()) {
1466
+ if (!message.proposalId.isZero()) {
1467
+ writer.uint32(8).uint64(message.proposalId);
1468
+ }
1469
+ return writer;
1470
+ },
1471
+ decode(input, length) {
1472
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1473
+ let end = length === undefined ? reader.len : reader.pos + length;
1474
+ const message = Object.assign({}, baseQueryTallyResultRequest);
1475
+ while (reader.pos < end) {
1476
+ const tag = reader.uint32();
1477
+ switch (tag >>> 3) {
1478
+ case 1:
1479
+ message.proposalId = reader.uint64();
1480
+ break;
1481
+ default:
1482
+ reader.skipType(tag & 7);
1483
+ break;
1484
+ }
1485
+ }
1486
+ return message;
1487
+ },
1488
+ fromJSON(object) {
1489
+ const message = Object.assign({}, baseQueryTallyResultRequest);
1490
+ message.proposalId =
1491
+ object.proposalId !== undefined && object.proposalId !== null
1492
+ ? long_1.default.fromString(object.proposalId)
1493
+ : long_1.default.UZERO;
1494
+ return message;
1495
+ },
1496
+ toJSON(message) {
1497
+ const obj = {};
1498
+ message.proposalId !== undefined &&
1499
+ (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());
1500
+ return obj;
1501
+ },
1502
+ fromPartial(object) {
1503
+ const message = Object.assign({}, baseQueryTallyResultRequest);
1504
+ message.proposalId =
1505
+ object.proposalId !== undefined && object.proposalId !== null
1506
+ ? long_1.default.fromValue(object.proposalId)
1507
+ : long_1.default.UZERO;
1508
+ return message;
1509
+ },
1510
+ };
1511
+ const baseQueryTallyResultResponse = {};
1512
+ exports.QueryTallyResultResponse = {
1513
+ encode(message, writer = minimal_1.default.Writer.create()) {
1514
+ if (message.tally !== undefined) {
1515
+ types_1.TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim();
1516
+ }
1517
+ return writer;
1518
+ },
1519
+ decode(input, length) {
1520
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1521
+ let end = length === undefined ? reader.len : reader.pos + length;
1522
+ const message = Object.assign({}, baseQueryTallyResultResponse);
1523
+ while (reader.pos < end) {
1524
+ const tag = reader.uint32();
1525
+ switch (tag >>> 3) {
1526
+ case 1:
1527
+ message.tally = types_1.TallyResult.decode(reader, reader.uint32());
1528
+ break;
1529
+ default:
1530
+ reader.skipType(tag & 7);
1531
+ break;
1532
+ }
1533
+ }
1534
+ return message;
1535
+ },
1536
+ fromJSON(object) {
1537
+ const message = Object.assign({}, baseQueryTallyResultResponse);
1538
+ message.tally =
1539
+ object.tally !== undefined && object.tally !== null
1540
+ ? types_1.TallyResult.fromJSON(object.tally)
1541
+ : undefined;
1542
+ return message;
1543
+ },
1544
+ toJSON(message) {
1545
+ const obj = {};
1546
+ message.tally !== undefined &&
1547
+ (obj.tally = message.tally
1548
+ ? types_1.TallyResult.toJSON(message.tally)
1549
+ : undefined);
1550
+ return obj;
1551
+ },
1552
+ fromPartial(object) {
1553
+ const message = Object.assign({}, baseQueryTallyResultResponse);
1554
+ message.tally =
1555
+ object.tally !== undefined && object.tally !== null
1556
+ ? types_1.TallyResult.fromPartial(object.tally)
1557
+ : undefined;
1558
+ return message;
1559
+ },
1560
+ };
1561
+ class QueryClientImpl {
1562
+ constructor(rpc) {
1563
+ this.rpc = rpc;
1564
+ this.GroupInfo = this.GroupInfo.bind(this);
1565
+ this.GroupPolicyInfo = this.GroupPolicyInfo.bind(this);
1566
+ this.GroupMembers = this.GroupMembers.bind(this);
1567
+ this.GroupsByAdmin = this.GroupsByAdmin.bind(this);
1568
+ this.GroupPoliciesByGroup = this.GroupPoliciesByGroup.bind(this);
1569
+ this.GroupPoliciesByAdmin = this.GroupPoliciesByAdmin.bind(this);
1570
+ this.Proposal = this.Proposal.bind(this);
1571
+ this.ProposalsByGroupPolicy = this.ProposalsByGroupPolicy.bind(this);
1572
+ this.VoteByProposalVoter = this.VoteByProposalVoter.bind(this);
1573
+ this.VotesByProposal = this.VotesByProposal.bind(this);
1574
+ this.VotesByVoter = this.VotesByVoter.bind(this);
1575
+ this.GroupsByMember = this.GroupsByMember.bind(this);
1576
+ this.TallyResult = this.TallyResult.bind(this);
1577
+ }
1578
+ GroupInfo(request) {
1579
+ const data = exports.QueryGroupInfoRequest.encode(request).finish();
1580
+ const promise = this.rpc.request("cosmos.group.v1.Query", "GroupInfo", data);
1581
+ return promise.then((data) => exports.QueryGroupInfoResponse.decode(new minimal_1.default.Reader(data)));
1582
+ }
1583
+ GroupPolicyInfo(request) {
1584
+ const data = exports.QueryGroupPolicyInfoRequest.encode(request).finish();
1585
+ const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPolicyInfo", data);
1586
+ return promise.then((data) => exports.QueryGroupPolicyInfoResponse.decode(new minimal_1.default.Reader(data)));
1587
+ }
1588
+ GroupMembers(request) {
1589
+ const data = exports.QueryGroupMembersRequest.encode(request).finish();
1590
+ const promise = this.rpc.request("cosmos.group.v1.Query", "GroupMembers", data);
1591
+ return promise.then((data) => exports.QueryGroupMembersResponse.decode(new minimal_1.default.Reader(data)));
1592
+ }
1593
+ GroupsByAdmin(request) {
1594
+ const data = exports.QueryGroupsByAdminRequest.encode(request).finish();
1595
+ const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByAdmin", data);
1596
+ return promise.then((data) => exports.QueryGroupsByAdminResponse.decode(new minimal_1.default.Reader(data)));
1597
+ }
1598
+ GroupPoliciesByGroup(request) {
1599
+ const data = exports.QueryGroupPoliciesByGroupRequest.encode(request).finish();
1600
+ const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByGroup", data);
1601
+ return promise.then((data) => exports.QueryGroupPoliciesByGroupResponse.decode(new minimal_1.default.Reader(data)));
1602
+ }
1603
+ GroupPoliciesByAdmin(request) {
1604
+ const data = exports.QueryGroupPoliciesByAdminRequest.encode(request).finish();
1605
+ const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByAdmin", data);
1606
+ return promise.then((data) => exports.QueryGroupPoliciesByAdminResponse.decode(new minimal_1.default.Reader(data)));
1607
+ }
1608
+ Proposal(request) {
1609
+ const data = exports.QueryProposalRequest.encode(request).finish();
1610
+ const promise = this.rpc.request("cosmos.group.v1.Query", "Proposal", data);
1611
+ return promise.then((data) => exports.QueryProposalResponse.decode(new minimal_1.default.Reader(data)));
1612
+ }
1613
+ ProposalsByGroupPolicy(request) {
1614
+ const data = exports.QueryProposalsByGroupPolicyRequest.encode(request).finish();
1615
+ const promise = this.rpc.request("cosmos.group.v1.Query", "ProposalsByGroupPolicy", data);
1616
+ return promise.then((data) => exports.QueryProposalsByGroupPolicyResponse.decode(new minimal_1.default.Reader(data)));
1617
+ }
1618
+ VoteByProposalVoter(request) {
1619
+ const data = exports.QueryVoteByProposalVoterRequest.encode(request).finish();
1620
+ const promise = this.rpc.request("cosmos.group.v1.Query", "VoteByProposalVoter", data);
1621
+ return promise.then((data) => exports.QueryVoteByProposalVoterResponse.decode(new minimal_1.default.Reader(data)));
1622
+ }
1623
+ VotesByProposal(request) {
1624
+ const data = exports.QueryVotesByProposalRequest.encode(request).finish();
1625
+ const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByProposal", data);
1626
+ return promise.then((data) => exports.QueryVotesByProposalResponse.decode(new minimal_1.default.Reader(data)));
1627
+ }
1628
+ VotesByVoter(request) {
1629
+ const data = exports.QueryVotesByVoterRequest.encode(request).finish();
1630
+ const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByVoter", data);
1631
+ return promise.then((data) => exports.QueryVotesByVoterResponse.decode(new minimal_1.default.Reader(data)));
1632
+ }
1633
+ GroupsByMember(request) {
1634
+ const data = exports.QueryGroupsByMemberRequest.encode(request).finish();
1635
+ const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByMember", data);
1636
+ return promise.then((data) => exports.QueryGroupsByMemberResponse.decode(new minimal_1.default.Reader(data)));
1637
+ }
1638
+ TallyResult(request) {
1639
+ const data = exports.QueryTallyResultRequest.encode(request).finish();
1640
+ const promise = this.rpc.request("cosmos.group.v1.Query", "TallyResult", data);
1641
+ return promise.then((data) => exports.QueryTallyResultResponse.decode(new minimal_1.default.Reader(data)));
1642
+ }
1643
+ }
1644
+ exports.QueryClientImpl = QueryClientImpl;
1645
+ if (minimal_1.default.util.Long !== long_1.default) {
1646
+ minimal_1.default.util.Long = long_1.default;
1647
+ minimal_1.default.configure();
1648
+ }