decentralcardgame-cardchain-client-ts 0.0.17 → 0.0.18

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 (23) hide show
  1. package/DecentralCardGame.cardchain.cardchain/module.js +304 -310
  2. package/DecentralCardGame.cardchain.cardchain/module.ts +460 -466
  3. package/DecentralCardGame.cardchain.cardchain/registry.js +60 -60
  4. package/DecentralCardGame.cardchain.cardchain/registry.ts +60 -60
  5. package/DecentralCardGame.cardchain.cardchain/rest.js +7 -31
  6. package/DecentralCardGame.cardchain.cardchain/rest.ts +9 -84
  7. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +0 -6
  8. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +0 -6
  9. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/council.js +11 -17
  10. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/council.ts +11 -17
  11. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/params.js +0 -11
  12. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/params.ts +0 -13
  13. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +2 -331
  14. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +2 -390
  15. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +8 -8
  16. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +9 -9
  17. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.js +57 -81
  18. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.ts +56 -93
  19. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/voting.js +50 -59
  20. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/voting.ts +53 -71
  21. package/DecentralCardGame.cardchain.cardchain/types.js +1 -4
  22. package/DecentralCardGame.cardchain.cardchain/types.ts +0 -6
  23. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable */
2
2
  import Long from "long";
3
3
  import _m0 from "protobufjs/minimal";
4
- import { VoteRight } from "./voting";
5
4
  export const protobufPackage = "DecentralCardGame.cardchain.cardchain";
6
5
  export var CouncilStatus;
7
6
  (function (CouncilStatus) {
@@ -101,14 +100,15 @@ function createBaseUser() {
101
100
  ownedCardSchemes: [],
102
101
  ownedPrototypes: [],
103
102
  cards: [],
104
- voteRights: [],
105
- councilParticipation: undefined,
103
+ CouncilStatus: 0,
106
104
  ReportMatches: false,
107
105
  profileCard: 0,
108
106
  airDrops: undefined,
109
107
  boosterPacks: [],
110
108
  website: "",
111
109
  biography: "",
110
+ votableCards: [],
111
+ votedCards: [],
112
112
  };
113
113
  }
114
114
  export const User = {
@@ -131,11 +131,8 @@ export const User = {
131
131
  writer.uint64(v);
132
132
  }
133
133
  writer.ldelim();
134
- for (const v of message.voteRights) {
135
- VoteRight.encode(v, writer.uint32(42).fork()).ldelim();
136
- }
137
- if (message.councilParticipation !== undefined) {
138
- CouncilParticipation.encode(message.councilParticipation, writer.uint32(50).fork()).ldelim();
134
+ if (message.CouncilStatus !== 0) {
135
+ writer.uint32(48).int32(message.CouncilStatus);
139
136
  }
140
137
  if (message.ReportMatches === true) {
141
138
  writer.uint32(56).bool(message.ReportMatches);
@@ -155,6 +152,16 @@ export const User = {
155
152
  if (message.biography !== "") {
156
153
  writer.uint32(98).string(message.biography);
157
154
  }
155
+ writer.uint32(106).fork();
156
+ for (const v of message.votableCards) {
157
+ writer.uint64(v);
158
+ }
159
+ writer.ldelim();
160
+ writer.uint32(114).fork();
161
+ for (const v of message.votedCards) {
162
+ writer.uint64(v);
163
+ }
164
+ writer.ldelim();
158
165
  return writer;
159
166
  },
160
167
  decode(input, length) {
@@ -200,11 +207,8 @@ export const User = {
200
207
  message.cards.push(longToNumber(reader.uint64()));
201
208
  }
202
209
  break;
203
- case 5:
204
- message.voteRights.push(VoteRight.decode(reader, reader.uint32()));
205
- break;
206
210
  case 6:
207
- message.councilParticipation = CouncilParticipation.decode(reader, reader.uint32());
211
+ message.CouncilStatus = reader.int32();
208
212
  break;
209
213
  case 7:
210
214
  message.ReportMatches = reader.bool();
@@ -224,6 +228,28 @@ export const User = {
224
228
  case 12:
225
229
  message.biography = reader.string();
226
230
  break;
231
+ case 13:
232
+ if ((tag & 7) === 2) {
233
+ const end2 = reader.uint32() + reader.pos;
234
+ while (reader.pos < end2) {
235
+ message.votableCards.push(longToNumber(reader.uint64()));
236
+ }
237
+ }
238
+ else {
239
+ message.votableCards.push(longToNumber(reader.uint64()));
240
+ }
241
+ break;
242
+ case 14:
243
+ if ((tag & 7) === 2) {
244
+ const end2 = reader.uint32() + reader.pos;
245
+ while (reader.pos < end2) {
246
+ message.votedCards.push(longToNumber(reader.uint64()));
247
+ }
248
+ }
249
+ else {
250
+ message.votedCards.push(longToNumber(reader.uint64()));
251
+ }
252
+ break;
227
253
  default:
228
254
  reader.skipType(tag & 7);
229
255
  break;
@@ -239,10 +265,7 @@ export const User = {
239
265
  : [],
240
266
  ownedPrototypes: Array.isArray(object?.ownedPrototypes) ? object.ownedPrototypes.map((e) => Number(e)) : [],
241
267
  cards: Array.isArray(object?.cards) ? object.cards.map((e) => Number(e)) : [],
242
- voteRights: Array.isArray(object?.voteRights) ? object.voteRights.map((e) => VoteRight.fromJSON(e)) : [],
243
- councilParticipation: isSet(object.councilParticipation)
244
- ? CouncilParticipation.fromJSON(object.councilParticipation)
245
- : undefined,
268
+ CouncilStatus: isSet(object.CouncilStatus) ? councilStatusFromJSON(object.CouncilStatus) : 0,
246
269
  ReportMatches: isSet(object.ReportMatches) ? Boolean(object.ReportMatches) : false,
247
270
  profileCard: isSet(object.profileCard) ? Number(object.profileCard) : 0,
248
271
  airDrops: isSet(object.airDrops) ? AirDrops.fromJSON(object.airDrops) : undefined,
@@ -251,6 +274,8 @@ export const User = {
251
274
  : [],
252
275
  website: isSet(object.website) ? String(object.website) : "",
253
276
  biography: isSet(object.biography) ? String(object.biography) : "",
277
+ votableCards: Array.isArray(object?.votableCards) ? object.votableCards.map((e) => Number(e)) : [],
278
+ votedCards: Array.isArray(object?.votedCards) ? object.votedCards.map((e) => Number(e)) : [],
254
279
  };
255
280
  },
256
281
  toJSON(message) {
@@ -274,15 +299,7 @@ export const User = {
274
299
  else {
275
300
  obj.cards = [];
276
301
  }
277
- if (message.voteRights) {
278
- obj.voteRights = message.voteRights.map((e) => e ? VoteRight.toJSON(e) : undefined);
279
- }
280
- else {
281
- obj.voteRights = [];
282
- }
283
- message.councilParticipation !== undefined && (obj.councilParticipation = message.councilParticipation
284
- ? CouncilParticipation.toJSON(message.councilParticipation)
285
- : undefined);
302
+ message.CouncilStatus !== undefined && (obj.CouncilStatus = councilStatusToJSON(message.CouncilStatus));
286
303
  message.ReportMatches !== undefined && (obj.ReportMatches = message.ReportMatches);
287
304
  message.profileCard !== undefined && (obj.profileCard = Math.round(message.profileCard));
288
305
  message.airDrops !== undefined && (obj.airDrops = message.airDrops ? AirDrops.toJSON(message.airDrops) : undefined);
@@ -294,6 +311,18 @@ export const User = {
294
311
  }
295
312
  message.website !== undefined && (obj.website = message.website);
296
313
  message.biography !== undefined && (obj.biography = message.biography);
314
+ if (message.votableCards) {
315
+ obj.votableCards = message.votableCards.map((e) => Math.round(e));
316
+ }
317
+ else {
318
+ obj.votableCards = [];
319
+ }
320
+ if (message.votedCards) {
321
+ obj.votedCards = message.votedCards.map((e) => Math.round(e));
322
+ }
323
+ else {
324
+ obj.votedCards = [];
325
+ }
297
326
  return obj;
298
327
  },
299
328
  fromPartial(object) {
@@ -302,10 +331,7 @@ export const User = {
302
331
  message.ownedCardSchemes = object.ownedCardSchemes?.map((e) => e) || [];
303
332
  message.ownedPrototypes = object.ownedPrototypes?.map((e) => e) || [];
304
333
  message.cards = object.cards?.map((e) => e) || [];
305
- message.voteRights = object.voteRights?.map((e) => VoteRight.fromPartial(e)) || [];
306
- message.councilParticipation = (object.councilParticipation !== undefined && object.councilParticipation !== null)
307
- ? CouncilParticipation.fromPartial(object.councilParticipation)
308
- : undefined;
334
+ message.CouncilStatus = object.CouncilStatus ?? 0;
309
335
  message.ReportMatches = object.ReportMatches ?? false;
310
336
  message.profileCard = object.profileCard ?? 0;
311
337
  message.airDrops = (object.airDrops !== undefined && object.airDrops !== null)
@@ -314,58 +340,8 @@ export const User = {
314
340
  message.boosterPacks = object.boosterPacks?.map((e) => BoosterPack.fromPartial(e)) || [];
315
341
  message.website = object.website ?? "";
316
342
  message.biography = object.biography ?? "";
317
- return message;
318
- },
319
- };
320
- function createBaseCouncilParticipation() {
321
- return { status: 0, council: 0 };
322
- }
323
- export const CouncilParticipation = {
324
- encode(message, writer = _m0.Writer.create()) {
325
- if (message.status !== 0) {
326
- writer.uint32(8).int32(message.status);
327
- }
328
- if (message.council !== 0) {
329
- writer.uint32(16).uint64(message.council);
330
- }
331
- return writer;
332
- },
333
- decode(input, length) {
334
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
335
- let end = length === undefined ? reader.len : reader.pos + length;
336
- const message = createBaseCouncilParticipation();
337
- while (reader.pos < end) {
338
- const tag = reader.uint32();
339
- switch (tag >>> 3) {
340
- case 1:
341
- message.status = reader.int32();
342
- break;
343
- case 2:
344
- message.council = longToNumber(reader.uint64());
345
- break;
346
- default:
347
- reader.skipType(tag & 7);
348
- break;
349
- }
350
- }
351
- return message;
352
- },
353
- fromJSON(object) {
354
- return {
355
- status: isSet(object.status) ? councilStatusFromJSON(object.status) : 0,
356
- council: isSet(object.council) ? Number(object.council) : 0,
357
- };
358
- },
359
- toJSON(message) {
360
- const obj = {};
361
- message.status !== undefined && (obj.status = councilStatusToJSON(message.status));
362
- message.council !== undefined && (obj.council = Math.round(message.council));
363
- return obj;
364
- },
365
- fromPartial(object) {
366
- const message = createBaseCouncilParticipation();
367
- message.status = object.status ?? 0;
368
- message.council = object.council ?? 0;
343
+ message.votableCards = object.votableCards?.map((e) => e) || [];
344
+ message.votedCards = object.votedCards?.map((e) => e) || [];
369
345
  return message;
370
346
  },
371
347
  };
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable */
2
2
  import Long from "long";
3
3
  import _m0 from "protobufjs/minimal";
4
- import { VoteRight } from "./voting";
5
4
 
6
5
  export const protobufPackage = "DecentralCardGame.cardchain.cardchain";
7
6
 
@@ -106,19 +105,15 @@ export interface User {
106
105
  ownedCardSchemes: number[];
107
106
  ownedPrototypes: number[];
108
107
  cards: number[];
109
- voteRights: VoteRight[];
110
- councilParticipation: CouncilParticipation | undefined;
108
+ CouncilStatus: CouncilStatus;
111
109
  ReportMatches: boolean;
112
110
  profileCard: number;
113
111
  airDrops: AirDrops | undefined;
114
112
  boosterPacks: BoosterPack[];
115
113
  website: string;
116
114
  biography: string;
117
- }
118
-
119
- export interface CouncilParticipation {
120
- status: CouncilStatus;
121
- council: number;
115
+ votableCards: number[];
116
+ votedCards: number[];
122
117
  }
123
118
 
124
119
  export interface BoosterPack {
@@ -144,14 +139,15 @@ function createBaseUser(): User {
144
139
  ownedCardSchemes: [],
145
140
  ownedPrototypes: [],
146
141
  cards: [],
147
- voteRights: [],
148
- councilParticipation: undefined,
142
+ CouncilStatus: 0,
149
143
  ReportMatches: false,
150
144
  profileCard: 0,
151
145
  airDrops: undefined,
152
146
  boosterPacks: [],
153
147
  website: "",
154
148
  biography: "",
149
+ votableCards: [],
150
+ votedCards: [],
155
151
  };
156
152
  }
157
153
 
@@ -175,11 +171,8 @@ export const User = {
175
171
  writer.uint64(v);
176
172
  }
177
173
  writer.ldelim();
178
- for (const v of message.voteRights) {
179
- VoteRight.encode(v!, writer.uint32(42).fork()).ldelim();
180
- }
181
- if (message.councilParticipation !== undefined) {
182
- CouncilParticipation.encode(message.councilParticipation, writer.uint32(50).fork()).ldelim();
174
+ if (message.CouncilStatus !== 0) {
175
+ writer.uint32(48).int32(message.CouncilStatus);
183
176
  }
184
177
  if (message.ReportMatches === true) {
185
178
  writer.uint32(56).bool(message.ReportMatches);
@@ -199,6 +192,16 @@ export const User = {
199
192
  if (message.biography !== "") {
200
193
  writer.uint32(98).string(message.biography);
201
194
  }
195
+ writer.uint32(106).fork();
196
+ for (const v of message.votableCards) {
197
+ writer.uint64(v);
198
+ }
199
+ writer.ldelim();
200
+ writer.uint32(114).fork();
201
+ for (const v of message.votedCards) {
202
+ writer.uint64(v);
203
+ }
204
+ writer.ldelim();
202
205
  return writer;
203
206
  },
204
207
 
@@ -242,11 +245,8 @@ export const User = {
242
245
  message.cards.push(longToNumber(reader.uint64() as Long));
243
246
  }
244
247
  break;
245
- case 5:
246
- message.voteRights.push(VoteRight.decode(reader, reader.uint32()));
247
- break;
248
248
  case 6:
249
- message.councilParticipation = CouncilParticipation.decode(reader, reader.uint32());
249
+ message.CouncilStatus = reader.int32() as any;
250
250
  break;
251
251
  case 7:
252
252
  message.ReportMatches = reader.bool();
@@ -266,6 +266,26 @@ export const User = {
266
266
  case 12:
267
267
  message.biography = reader.string();
268
268
  break;
269
+ case 13:
270
+ if ((tag & 7) === 2) {
271
+ const end2 = reader.uint32() + reader.pos;
272
+ while (reader.pos < end2) {
273
+ message.votableCards.push(longToNumber(reader.uint64() as Long));
274
+ }
275
+ } else {
276
+ message.votableCards.push(longToNumber(reader.uint64() as Long));
277
+ }
278
+ break;
279
+ case 14:
280
+ if ((tag & 7) === 2) {
281
+ const end2 = reader.uint32() + reader.pos;
282
+ while (reader.pos < end2) {
283
+ message.votedCards.push(longToNumber(reader.uint64() as Long));
284
+ }
285
+ } else {
286
+ message.votedCards.push(longToNumber(reader.uint64() as Long));
287
+ }
288
+ break;
269
289
  default:
270
290
  reader.skipType(tag & 7);
271
291
  break;
@@ -282,10 +302,7 @@ export const User = {
282
302
  : [],
283
303
  ownedPrototypes: Array.isArray(object?.ownedPrototypes) ? object.ownedPrototypes.map((e: any) => Number(e)) : [],
284
304
  cards: Array.isArray(object?.cards) ? object.cards.map((e: any) => Number(e)) : [],
285
- voteRights: Array.isArray(object?.voteRights) ? object.voteRights.map((e: any) => VoteRight.fromJSON(e)) : [],
286
- councilParticipation: isSet(object.councilParticipation)
287
- ? CouncilParticipation.fromJSON(object.councilParticipation)
288
- : undefined,
305
+ CouncilStatus: isSet(object.CouncilStatus) ? councilStatusFromJSON(object.CouncilStatus) : 0,
289
306
  ReportMatches: isSet(object.ReportMatches) ? Boolean(object.ReportMatches) : false,
290
307
  profileCard: isSet(object.profileCard) ? Number(object.profileCard) : 0,
291
308
  airDrops: isSet(object.airDrops) ? AirDrops.fromJSON(object.airDrops) : undefined,
@@ -294,6 +311,8 @@ export const User = {
294
311
  : [],
295
312
  website: isSet(object.website) ? String(object.website) : "",
296
313
  biography: isSet(object.biography) ? String(object.biography) : "",
314
+ votableCards: Array.isArray(object?.votableCards) ? object.votableCards.map((e: any) => Number(e)) : [],
315
+ votedCards: Array.isArray(object?.votedCards) ? object.votedCards.map((e: any) => Number(e)) : [],
297
316
  };
298
317
  },
299
318
 
@@ -315,14 +334,7 @@ export const User = {
315
334
  } else {
316
335
  obj.cards = [];
317
336
  }
318
- if (message.voteRights) {
319
- obj.voteRights = message.voteRights.map((e) => e ? VoteRight.toJSON(e) : undefined);
320
- } else {
321
- obj.voteRights = [];
322
- }
323
- message.councilParticipation !== undefined && (obj.councilParticipation = message.councilParticipation
324
- ? CouncilParticipation.toJSON(message.councilParticipation)
325
- : undefined);
337
+ message.CouncilStatus !== undefined && (obj.CouncilStatus = councilStatusToJSON(message.CouncilStatus));
326
338
  message.ReportMatches !== undefined && (obj.ReportMatches = message.ReportMatches);
327
339
  message.profileCard !== undefined && (obj.profileCard = Math.round(message.profileCard));
328
340
  message.airDrops !== undefined && (obj.airDrops = message.airDrops ? AirDrops.toJSON(message.airDrops) : undefined);
@@ -333,6 +345,16 @@ export const User = {
333
345
  }
334
346
  message.website !== undefined && (obj.website = message.website);
335
347
  message.biography !== undefined && (obj.biography = message.biography);
348
+ if (message.votableCards) {
349
+ obj.votableCards = message.votableCards.map((e) => Math.round(e));
350
+ } else {
351
+ obj.votableCards = [];
352
+ }
353
+ if (message.votedCards) {
354
+ obj.votedCards = message.votedCards.map((e) => Math.round(e));
355
+ } else {
356
+ obj.votedCards = [];
357
+ }
336
358
  return obj;
337
359
  },
338
360
 
@@ -342,10 +364,7 @@ export const User = {
342
364
  message.ownedCardSchemes = object.ownedCardSchemes?.map((e) => e) || [];
343
365
  message.ownedPrototypes = object.ownedPrototypes?.map((e) => e) || [];
344
366
  message.cards = object.cards?.map((e) => e) || [];
345
- message.voteRights = object.voteRights?.map((e) => VoteRight.fromPartial(e)) || [];
346
- message.councilParticipation = (object.councilParticipation !== undefined && object.councilParticipation !== null)
347
- ? CouncilParticipation.fromPartial(object.councilParticipation)
348
- : undefined;
367
+ message.CouncilStatus = object.CouncilStatus ?? 0;
349
368
  message.ReportMatches = object.ReportMatches ?? false;
350
369
  message.profileCard = object.profileCard ?? 0;
351
370
  message.airDrops = (object.airDrops !== undefined && object.airDrops !== null)
@@ -354,64 +373,8 @@ export const User = {
354
373
  message.boosterPacks = object.boosterPacks?.map((e) => BoosterPack.fromPartial(e)) || [];
355
374
  message.website = object.website ?? "";
356
375
  message.biography = object.biography ?? "";
357
- return message;
358
- },
359
- };
360
-
361
- function createBaseCouncilParticipation(): CouncilParticipation {
362
- return { status: 0, council: 0 };
363
- }
364
-
365
- export const CouncilParticipation = {
366
- encode(message: CouncilParticipation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
367
- if (message.status !== 0) {
368
- writer.uint32(8).int32(message.status);
369
- }
370
- if (message.council !== 0) {
371
- writer.uint32(16).uint64(message.council);
372
- }
373
- return writer;
374
- },
375
-
376
- decode(input: _m0.Reader | Uint8Array, length?: number): CouncilParticipation {
377
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
378
- let end = length === undefined ? reader.len : reader.pos + length;
379
- const message = createBaseCouncilParticipation();
380
- while (reader.pos < end) {
381
- const tag = reader.uint32();
382
- switch (tag >>> 3) {
383
- case 1:
384
- message.status = reader.int32() as any;
385
- break;
386
- case 2:
387
- message.council = longToNumber(reader.uint64() as Long);
388
- break;
389
- default:
390
- reader.skipType(tag & 7);
391
- break;
392
- }
393
- }
394
- return message;
395
- },
396
-
397
- fromJSON(object: any): CouncilParticipation {
398
- return {
399
- status: isSet(object.status) ? councilStatusFromJSON(object.status) : 0,
400
- council: isSet(object.council) ? Number(object.council) : 0,
401
- };
402
- },
403
-
404
- toJSON(message: CouncilParticipation): unknown {
405
- const obj: any = {};
406
- message.status !== undefined && (obj.status = councilStatusToJSON(message.status));
407
- message.council !== undefined && (obj.council = Math.round(message.council));
408
- return obj;
409
- },
410
-
411
- fromPartial<I extends Exact<DeepPartial<CouncilParticipation>, I>>(object: I): CouncilParticipation {
412
- const message = createBaseCouncilParticipation();
413
- message.status = object.status ?? 0;
414
- message.council = object.council ?? 0;
376
+ message.votableCards = object.votableCards?.map((e) => e) || [];
377
+ message.votedCards = object.votedCards?.map((e) => e) || [];
415
378
  return message;
416
379
  },
417
380
  };
@@ -2,6 +2,49 @@
2
2
  import Long from "long";
3
3
  import _m0 from "protobufjs/minimal";
4
4
  export const protobufPackage = "DecentralCardGame.cardchain.cardchain";
5
+ export var VoteType;
6
+ (function (VoteType) {
7
+ VoteType[VoteType["fairEnough"] = 0] = "fairEnough";
8
+ VoteType[VoteType["inappropriate"] = 1] = "inappropriate";
9
+ VoteType[VoteType["overpowered"] = 2] = "overpowered";
10
+ VoteType[VoteType["underpowered"] = 3] = "underpowered";
11
+ VoteType[VoteType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
12
+ })(VoteType || (VoteType = {}));
13
+ export function voteTypeFromJSON(object) {
14
+ switch (object) {
15
+ case 0:
16
+ case "fairEnough":
17
+ return VoteType.fairEnough;
18
+ case 1:
19
+ case "inappropriate":
20
+ return VoteType.inappropriate;
21
+ case 2:
22
+ case "overpowered":
23
+ return VoteType.overpowered;
24
+ case 3:
25
+ case "underpowered":
26
+ return VoteType.underpowered;
27
+ case -1:
28
+ case "UNRECOGNIZED":
29
+ default:
30
+ return VoteType.UNRECOGNIZED;
31
+ }
32
+ }
33
+ export function voteTypeToJSON(object) {
34
+ switch (object) {
35
+ case VoteType.fairEnough:
36
+ return "fairEnough";
37
+ case VoteType.inappropriate:
38
+ return "inappropriate";
39
+ case VoteType.overpowered:
40
+ return "overpowered";
41
+ case VoteType.underpowered:
42
+ return "underpowered";
43
+ case VoteType.UNRECOGNIZED:
44
+ default:
45
+ return "UNRECOGNIZED";
46
+ }
47
+ }
5
48
  function createBaseVotingResults() {
6
49
  return {
7
50
  totalVotes: 0,
@@ -213,15 +256,15 @@ export const VotingResult = {
213
256
  },
214
257
  };
215
258
  function createBaseSingleVote() {
216
- return { cardId: 0, voteType: "" };
259
+ return { cardId: 0, voteType: 0 };
217
260
  }
218
261
  export const SingleVote = {
219
262
  encode(message, writer = _m0.Writer.create()) {
220
263
  if (message.cardId !== 0) {
221
264
  writer.uint32(8).uint64(message.cardId);
222
265
  }
223
- if (message.voteType !== "") {
224
- writer.uint32(18).string(message.voteType);
266
+ if (message.voteType !== 0) {
267
+ writer.uint32(16).int32(message.voteType);
225
268
  }
226
269
  return writer;
227
270
  },
@@ -236,7 +279,7 @@ export const SingleVote = {
236
279
  message.cardId = longToNumber(reader.uint64());
237
280
  break;
238
281
  case 2:
239
- message.voteType = reader.string();
282
+ message.voteType = reader.int32();
240
283
  break;
241
284
  default:
242
285
  reader.skipType(tag & 7);
@@ -248,71 +291,19 @@ export const SingleVote = {
248
291
  fromJSON(object) {
249
292
  return {
250
293
  cardId: isSet(object.cardId) ? Number(object.cardId) : 0,
251
- voteType: isSet(object.voteType) ? String(object.voteType) : "",
294
+ voteType: isSet(object.voteType) ? voteTypeFromJSON(object.voteType) : 0,
252
295
  };
253
296
  },
254
297
  toJSON(message) {
255
298
  const obj = {};
256
299
  message.cardId !== undefined && (obj.cardId = Math.round(message.cardId));
257
- message.voteType !== undefined && (obj.voteType = message.voteType);
300
+ message.voteType !== undefined && (obj.voteType = voteTypeToJSON(message.voteType));
258
301
  return obj;
259
302
  },
260
303
  fromPartial(object) {
261
304
  const message = createBaseSingleVote();
262
305
  message.cardId = object.cardId ?? 0;
263
- message.voteType = object.voteType ?? "";
264
- return message;
265
- },
266
- };
267
- function createBaseVoteRight() {
268
- return { cardId: 0, expireBlock: 0 };
269
- }
270
- export const VoteRight = {
271
- encode(message, writer = _m0.Writer.create()) {
272
- if (message.cardId !== 0) {
273
- writer.uint32(8).uint64(message.cardId);
274
- }
275
- if (message.expireBlock !== 0) {
276
- writer.uint32(16).int64(message.expireBlock);
277
- }
278
- return writer;
279
- },
280
- decode(input, length) {
281
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
282
- let end = length === undefined ? reader.len : reader.pos + length;
283
- const message = createBaseVoteRight();
284
- while (reader.pos < end) {
285
- const tag = reader.uint32();
286
- switch (tag >>> 3) {
287
- case 1:
288
- message.cardId = longToNumber(reader.uint64());
289
- break;
290
- case 2:
291
- message.expireBlock = longToNumber(reader.int64());
292
- break;
293
- default:
294
- reader.skipType(tag & 7);
295
- break;
296
- }
297
- }
298
- return message;
299
- },
300
- fromJSON(object) {
301
- return {
302
- cardId: isSet(object.cardId) ? Number(object.cardId) : 0,
303
- expireBlock: isSet(object.expireBlock) ? Number(object.expireBlock) : 0,
304
- };
305
- },
306
- toJSON(message) {
307
- const obj = {};
308
- message.cardId !== undefined && (obj.cardId = Math.round(message.cardId));
309
- message.expireBlock !== undefined && (obj.expireBlock = Math.round(message.expireBlock));
310
- return obj;
311
- },
312
- fromPartial(object) {
313
- const message = createBaseVoteRight();
314
- message.cardId = object.cardId ?? 0;
315
- message.expireBlock = object.expireBlock ?? 0;
306
+ message.voteType = object.voteType ?? 0;
316
307
  return message;
317
308
  },
318
309
  };