@sparkdreamnft/sparkdreamjs 0.0.25 → 0.0.27

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 (67) hide show
  1. package/cosmos/bundle.d.ts +160 -160
  2. package/cosmos/bundle.js +181 -181
  3. package/esm/cosmos/bundle.js +181 -181
  4. package/esm/ibc/bundle.js +105 -105
  5. package/esm/sparkdream/bundle.js +275 -273
  6. package/esm/sparkdream/collect/v1/params.js +24 -0
  7. package/esm/sparkdream/collect/v1/tx.js +216 -1
  8. package/esm/sparkdream/collect/v1/tx.registry.js +20 -2
  9. package/esm/sparkdream/collect/v1/tx.rpc.msg.js +11 -1
  10. package/esm/sparkdream/collect/v1/types.js +92 -2
  11. package/esm/sparkdream/forum/v1/genesis.js +110 -1
  12. package/esm/sparkdream/forum/v1/params.js +26 -2
  13. package/esm/sparkdream/forum/v1/sentinel_activity.js +58 -1
  14. package/esm/sparkdream/forum/v1/thread_metadata.js +13 -1
  15. package/esm/sparkdream/forum/v1/tx.js +157 -1
  16. package/esm/sparkdream/forum/v1/tx.registry.js +20 -2
  17. package/esm/sparkdream/forum/v1/tx.rpc.msg.js +7 -1
  18. package/esm/sparkdream/rep/v1/bonded_role.js +17 -5
  19. package/esm/sparkdream/rep/v1/genesis.js +17 -1
  20. package/esm/sparkdream/rep/v1/role_activity.js +670 -0
  21. package/esm/sparkdream/rep/v1/tx.js +159 -0
  22. package/esm/sparkdream/rep/v1/tx.registry.js +20 -2
  23. package/esm/sparkdream/rep/v1/tx.rpc.msg.js +8 -1
  24. package/esm/tendermint/bundle.js +17 -17
  25. package/ibc/bundle.d.ts +90 -90
  26. package/ibc/bundle.js +105 -105
  27. package/package.json +1 -1
  28. package/sparkdream/bundle.d.ts +7232 -7037
  29. package/sparkdream/bundle.js +275 -273
  30. package/sparkdream/collect/v1/params.d.ts +28 -0
  31. package/sparkdream/collect/v1/params.js +24 -0
  32. package/sparkdream/collect/v1/tx.d.ts +130 -6
  33. package/sparkdream/collect/v1/tx.js +220 -3
  34. package/sparkdream/collect/v1/tx.registry.d.ts +13 -1
  35. package/sparkdream/collect/v1/tx.registry.js +19 -1
  36. package/sparkdream/collect/v1/tx.rpc.msg.d.ts +10 -1
  37. package/sparkdream/collect/v1/tx.rpc.msg.js +10 -0
  38. package/sparkdream/collect/v1/types.d.ts +72 -0
  39. package/sparkdream/collect/v1/types.js +92 -2
  40. package/sparkdream/forum/v1/genesis.d.ts +65 -0
  41. package/sparkdream/forum/v1/genesis.js +111 -2
  42. package/sparkdream/forum/v1/params.d.ts +30 -0
  43. package/sparkdream/forum/v1/params.js +26 -2
  44. package/sparkdream/forum/v1/sentinel_activity.d.ts +53 -0
  45. package/sparkdream/forum/v1/sentinel_activity.js +58 -1
  46. package/sparkdream/forum/v1/thread_metadata.d.ts +16 -0
  47. package/sparkdream/forum/v1/thread_metadata.js +13 -1
  48. package/sparkdream/forum/v1/tx.d.ts +93 -7
  49. package/sparkdream/forum/v1/tx.js +158 -2
  50. package/sparkdream/forum/v1/tx.registry.d.ts +13 -1
  51. package/sparkdream/forum/v1/tx.registry.js +19 -1
  52. package/sparkdream/forum/v1/tx.rpc.msg.d.ts +4 -1
  53. package/sparkdream/forum/v1/tx.rpc.msg.js +6 -0
  54. package/sparkdream/rep/v1/bonded_role.d.ts +13 -1
  55. package/sparkdream/rep/v1/bonded_role.js +17 -5
  56. package/sparkdream/rep/v1/genesis.d.ts +3 -0
  57. package/sparkdream/rep/v1/genesis.js +17 -1
  58. package/sparkdream/rep/v1/role_activity.d.ts +395 -0
  59. package/sparkdream/rep/v1/role_activity.js +673 -0
  60. package/sparkdream/rep/v1/tx.d.ts +101 -0
  61. package/sparkdream/rep/v1/tx.js +160 -1
  62. package/sparkdream/rep/v1/tx.registry.d.ts +13 -1
  63. package/sparkdream/rep/v1/tx.registry.js +19 -1
  64. package/sparkdream/rep/v1/tx.rpc.msg.d.ts +7 -1
  65. package/sparkdream/rep/v1/tx.rpc.msg.js +7 -0
  66. package/tendermint/bundle.d.ts +844 -844
  67. package/tendermint/bundle.js +17 -17
@@ -0,0 +1,673 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoleActivity = exports.RoleActivity_OverturnedActionsEntry = exports.RoleActivity_UpheldActionsEntry = exports.RoleActivity_TotalActionsEntry = exports.RoleActivity_EpochActionsEntry = exports.RoleAccuracyBucket = void 0;
4
+ const binary_1 = require("../../../binary");
5
+ function createBaseRoleAccuracyBucket() {
6
+ return {
7
+ epoch: BigInt(0),
8
+ upheld: BigInt(0),
9
+ overturned: BigInt(0)
10
+ };
11
+ }
12
+ /**
13
+ * RoleAccuracyBucket is one reward-epoch slot in a RoleActivity's rolling
14
+ * accuracy ring (slot index = epoch % ring size); the `epoch` stamp
15
+ * disambiguates a live slot from a stale one left by an earlier epoch that
16
+ * mapped to the same index.
17
+ * @name RoleAccuracyBucket
18
+ * @package sparkdream.rep.v1
19
+ * @see proto type: sparkdream.rep.v1.RoleAccuracyBucket
20
+ */
21
+ exports.RoleAccuracyBucket = {
22
+ typeUrl: "/sparkdream.rep.v1.RoleAccuracyBucket",
23
+ encode(message, writer = binary_1.BinaryWriter.create()) {
24
+ if (message.epoch !== BigInt(0)) {
25
+ writer.uint32(8).uint64(message.epoch);
26
+ }
27
+ if (message.upheld !== BigInt(0)) {
28
+ writer.uint32(16).uint64(message.upheld);
29
+ }
30
+ if (message.overturned !== BigInt(0)) {
31
+ writer.uint32(24).uint64(message.overturned);
32
+ }
33
+ return writer;
34
+ },
35
+ decode(input, length) {
36
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
37
+ let end = length === undefined ? reader.len : reader.pos + length;
38
+ const message = createBaseRoleAccuracyBucket();
39
+ while (reader.pos < end) {
40
+ const tag = reader.uint32();
41
+ switch (tag >>> 3) {
42
+ case 1:
43
+ message.epoch = reader.uint64();
44
+ break;
45
+ case 2:
46
+ message.upheld = reader.uint64();
47
+ break;
48
+ case 3:
49
+ message.overturned = reader.uint64();
50
+ break;
51
+ default:
52
+ reader.skipType(tag & 7);
53
+ break;
54
+ }
55
+ }
56
+ return message;
57
+ },
58
+ fromPartial(object) {
59
+ const message = createBaseRoleAccuracyBucket();
60
+ message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0);
61
+ message.upheld = object.upheld !== undefined && object.upheld !== null ? BigInt(object.upheld.toString()) : BigInt(0);
62
+ message.overturned = object.overturned !== undefined && object.overturned !== null ? BigInt(object.overturned.toString()) : BigInt(0);
63
+ return message;
64
+ },
65
+ fromAmino(object) {
66
+ const message = createBaseRoleAccuracyBucket();
67
+ if (object.epoch !== undefined && object.epoch !== null) {
68
+ message.epoch = BigInt(object.epoch);
69
+ }
70
+ if (object.upheld !== undefined && object.upheld !== null) {
71
+ message.upheld = BigInt(object.upheld);
72
+ }
73
+ if (object.overturned !== undefined && object.overturned !== null) {
74
+ message.overturned = BigInt(object.overturned);
75
+ }
76
+ return message;
77
+ },
78
+ toAmino(message) {
79
+ const obj = {};
80
+ obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined;
81
+ obj.upheld = message.upheld !== BigInt(0) ? message.upheld?.toString() : undefined;
82
+ obj.overturned = message.overturned !== BigInt(0) ? message.overturned?.toString() : undefined;
83
+ return obj;
84
+ },
85
+ fromAminoMsg(object) {
86
+ return exports.RoleAccuracyBucket.fromAmino(object.value);
87
+ },
88
+ fromProtoMsg(message) {
89
+ return exports.RoleAccuracyBucket.decode(message.value);
90
+ },
91
+ toProto(message) {
92
+ return exports.RoleAccuracyBucket.encode(message).finish();
93
+ },
94
+ toProtoMsg(message) {
95
+ return {
96
+ typeUrl: "/sparkdream.rep.v1.RoleAccuracyBucket",
97
+ value: exports.RoleAccuracyBucket.encode(message).finish()
98
+ };
99
+ }
100
+ };
101
+ function createBaseRoleActivity_EpochActionsEntry() {
102
+ return {
103
+ key: "",
104
+ value: BigInt(0)
105
+ };
106
+ }
107
+ /**
108
+ * @name RoleActivity_EpochActionsEntry
109
+ * @package sparkdream.rep.v1
110
+ * @see proto type: sparkdream.rep.v1.undefined
111
+ */
112
+ exports.RoleActivity_EpochActionsEntry = {
113
+ encode(message, writer = binary_1.BinaryWriter.create()) {
114
+ if (message.key !== "") {
115
+ writer.uint32(10).string(message.key);
116
+ }
117
+ if (message.value !== BigInt(0)) {
118
+ writer.uint32(16).uint64(message.value);
119
+ }
120
+ return writer;
121
+ },
122
+ decode(input, length) {
123
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
124
+ let end = length === undefined ? reader.len : reader.pos + length;
125
+ const message = createBaseRoleActivity_EpochActionsEntry();
126
+ while (reader.pos < end) {
127
+ const tag = reader.uint32();
128
+ switch (tag >>> 3) {
129
+ case 1:
130
+ message.key = reader.string();
131
+ break;
132
+ case 2:
133
+ message.value = reader.uint64();
134
+ break;
135
+ default:
136
+ reader.skipType(tag & 7);
137
+ break;
138
+ }
139
+ }
140
+ return message;
141
+ },
142
+ fromPartial(object) {
143
+ const message = createBaseRoleActivity_EpochActionsEntry();
144
+ message.key = object.key ?? "";
145
+ message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0);
146
+ return message;
147
+ },
148
+ fromAmino(object) {
149
+ const message = createBaseRoleActivity_EpochActionsEntry();
150
+ if (object.key !== undefined && object.key !== null) {
151
+ message.key = object.key;
152
+ }
153
+ if (object.value !== undefined && object.value !== null) {
154
+ message.value = BigInt(object.value);
155
+ }
156
+ return message;
157
+ },
158
+ toAmino(message) {
159
+ const obj = {};
160
+ obj.key = message.key === "" ? undefined : message.key;
161
+ obj.value = message.value !== BigInt(0) ? message.value?.toString() : undefined;
162
+ return obj;
163
+ },
164
+ fromAminoMsg(object) {
165
+ return exports.RoleActivity_EpochActionsEntry.fromAmino(object.value);
166
+ },
167
+ fromProtoMsg(message) {
168
+ return exports.RoleActivity_EpochActionsEntry.decode(message.value);
169
+ },
170
+ toProto(message) {
171
+ return exports.RoleActivity_EpochActionsEntry.encode(message).finish();
172
+ }
173
+ };
174
+ function createBaseRoleActivity_TotalActionsEntry() {
175
+ return {
176
+ key: "",
177
+ value: BigInt(0)
178
+ };
179
+ }
180
+ /**
181
+ * @name RoleActivity_TotalActionsEntry
182
+ * @package sparkdream.rep.v1
183
+ * @see proto type: sparkdream.rep.v1.undefined
184
+ */
185
+ exports.RoleActivity_TotalActionsEntry = {
186
+ encode(message, writer = binary_1.BinaryWriter.create()) {
187
+ if (message.key !== "") {
188
+ writer.uint32(10).string(message.key);
189
+ }
190
+ if (message.value !== BigInt(0)) {
191
+ writer.uint32(16).uint64(message.value);
192
+ }
193
+ return writer;
194
+ },
195
+ decode(input, length) {
196
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
197
+ let end = length === undefined ? reader.len : reader.pos + length;
198
+ const message = createBaseRoleActivity_TotalActionsEntry();
199
+ while (reader.pos < end) {
200
+ const tag = reader.uint32();
201
+ switch (tag >>> 3) {
202
+ case 1:
203
+ message.key = reader.string();
204
+ break;
205
+ case 2:
206
+ message.value = reader.uint64();
207
+ break;
208
+ default:
209
+ reader.skipType(tag & 7);
210
+ break;
211
+ }
212
+ }
213
+ return message;
214
+ },
215
+ fromPartial(object) {
216
+ const message = createBaseRoleActivity_TotalActionsEntry();
217
+ message.key = object.key ?? "";
218
+ message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0);
219
+ return message;
220
+ },
221
+ fromAmino(object) {
222
+ const message = createBaseRoleActivity_TotalActionsEntry();
223
+ if (object.key !== undefined && object.key !== null) {
224
+ message.key = object.key;
225
+ }
226
+ if (object.value !== undefined && object.value !== null) {
227
+ message.value = BigInt(object.value);
228
+ }
229
+ return message;
230
+ },
231
+ toAmino(message) {
232
+ const obj = {};
233
+ obj.key = message.key === "" ? undefined : message.key;
234
+ obj.value = message.value !== BigInt(0) ? message.value?.toString() : undefined;
235
+ return obj;
236
+ },
237
+ fromAminoMsg(object) {
238
+ return exports.RoleActivity_TotalActionsEntry.fromAmino(object.value);
239
+ },
240
+ fromProtoMsg(message) {
241
+ return exports.RoleActivity_TotalActionsEntry.decode(message.value);
242
+ },
243
+ toProto(message) {
244
+ return exports.RoleActivity_TotalActionsEntry.encode(message).finish();
245
+ }
246
+ };
247
+ function createBaseRoleActivity_UpheldActionsEntry() {
248
+ return {
249
+ key: "",
250
+ value: BigInt(0)
251
+ };
252
+ }
253
+ /**
254
+ * @name RoleActivity_UpheldActionsEntry
255
+ * @package sparkdream.rep.v1
256
+ * @see proto type: sparkdream.rep.v1.undefined
257
+ */
258
+ exports.RoleActivity_UpheldActionsEntry = {
259
+ encode(message, writer = binary_1.BinaryWriter.create()) {
260
+ if (message.key !== "") {
261
+ writer.uint32(10).string(message.key);
262
+ }
263
+ if (message.value !== BigInt(0)) {
264
+ writer.uint32(16).uint64(message.value);
265
+ }
266
+ return writer;
267
+ },
268
+ decode(input, length) {
269
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
270
+ let end = length === undefined ? reader.len : reader.pos + length;
271
+ const message = createBaseRoleActivity_UpheldActionsEntry();
272
+ while (reader.pos < end) {
273
+ const tag = reader.uint32();
274
+ switch (tag >>> 3) {
275
+ case 1:
276
+ message.key = reader.string();
277
+ break;
278
+ case 2:
279
+ message.value = reader.uint64();
280
+ break;
281
+ default:
282
+ reader.skipType(tag & 7);
283
+ break;
284
+ }
285
+ }
286
+ return message;
287
+ },
288
+ fromPartial(object) {
289
+ const message = createBaseRoleActivity_UpheldActionsEntry();
290
+ message.key = object.key ?? "";
291
+ message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0);
292
+ return message;
293
+ },
294
+ fromAmino(object) {
295
+ const message = createBaseRoleActivity_UpheldActionsEntry();
296
+ if (object.key !== undefined && object.key !== null) {
297
+ message.key = object.key;
298
+ }
299
+ if (object.value !== undefined && object.value !== null) {
300
+ message.value = BigInt(object.value);
301
+ }
302
+ return message;
303
+ },
304
+ toAmino(message) {
305
+ const obj = {};
306
+ obj.key = message.key === "" ? undefined : message.key;
307
+ obj.value = message.value !== BigInt(0) ? message.value?.toString() : undefined;
308
+ return obj;
309
+ },
310
+ fromAminoMsg(object) {
311
+ return exports.RoleActivity_UpheldActionsEntry.fromAmino(object.value);
312
+ },
313
+ fromProtoMsg(message) {
314
+ return exports.RoleActivity_UpheldActionsEntry.decode(message.value);
315
+ },
316
+ toProto(message) {
317
+ return exports.RoleActivity_UpheldActionsEntry.encode(message).finish();
318
+ }
319
+ };
320
+ function createBaseRoleActivity_OverturnedActionsEntry() {
321
+ return {
322
+ key: "",
323
+ value: BigInt(0)
324
+ };
325
+ }
326
+ /**
327
+ * @name RoleActivity_OverturnedActionsEntry
328
+ * @package sparkdream.rep.v1
329
+ * @see proto type: sparkdream.rep.v1.undefined
330
+ */
331
+ exports.RoleActivity_OverturnedActionsEntry = {
332
+ encode(message, writer = binary_1.BinaryWriter.create()) {
333
+ if (message.key !== "") {
334
+ writer.uint32(10).string(message.key);
335
+ }
336
+ if (message.value !== BigInt(0)) {
337
+ writer.uint32(16).uint64(message.value);
338
+ }
339
+ return writer;
340
+ },
341
+ decode(input, length) {
342
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
343
+ let end = length === undefined ? reader.len : reader.pos + length;
344
+ const message = createBaseRoleActivity_OverturnedActionsEntry();
345
+ while (reader.pos < end) {
346
+ const tag = reader.uint32();
347
+ switch (tag >>> 3) {
348
+ case 1:
349
+ message.key = reader.string();
350
+ break;
351
+ case 2:
352
+ message.value = reader.uint64();
353
+ break;
354
+ default:
355
+ reader.skipType(tag & 7);
356
+ break;
357
+ }
358
+ }
359
+ return message;
360
+ },
361
+ fromPartial(object) {
362
+ const message = createBaseRoleActivity_OverturnedActionsEntry();
363
+ message.key = object.key ?? "";
364
+ message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0);
365
+ return message;
366
+ },
367
+ fromAmino(object) {
368
+ const message = createBaseRoleActivity_OverturnedActionsEntry();
369
+ if (object.key !== undefined && object.key !== null) {
370
+ message.key = object.key;
371
+ }
372
+ if (object.value !== undefined && object.value !== null) {
373
+ message.value = BigInt(object.value);
374
+ }
375
+ return message;
376
+ },
377
+ toAmino(message) {
378
+ const obj = {};
379
+ obj.key = message.key === "" ? undefined : message.key;
380
+ obj.value = message.value !== BigInt(0) ? message.value?.toString() : undefined;
381
+ return obj;
382
+ },
383
+ fromAminoMsg(object) {
384
+ return exports.RoleActivity_OverturnedActionsEntry.fromAmino(object.value);
385
+ },
386
+ fromProtoMsg(message) {
387
+ return exports.RoleActivity_OverturnedActionsEntry.decode(message.value);
388
+ },
389
+ toProto(message) {
390
+ return exports.RoleActivity_OverturnedActionsEntry.encode(message).finish();
391
+ }
392
+ };
393
+ function createBaseRoleActivity() {
394
+ return {
395
+ roleType: 0,
396
+ address: "",
397
+ consecutiveUpheld: BigInt(0),
398
+ consecutiveOverturns: BigInt(0),
399
+ overturnCooldownUntil: BigInt(0),
400
+ epochAppealsResolved: BigInt(0),
401
+ accuracyWindow: [],
402
+ epochActions: {},
403
+ totalActions: {},
404
+ upheldActions: {},
405
+ overturnedActions: {}
406
+ };
407
+ }
408
+ /**
409
+ * RoleActivity is the SHARED accountability record for a bonded role,
410
+ * keyed by (role_type, address) and owned by x/rep. It holds everything
411
+ * that is a property of the role rather than of any one module surface:
412
+ * verdict streaks, the overturn cooldown, the rolling accuracy ring, and
413
+ * generic per-action-kind counters. Owning modules REPORT actions
414
+ * (RecordRoleAction) and jury verdicts (RecordRoleOutcome); x/rep applies
415
+ * the consequences, including streak demotion (it owns the bond).
416
+ *
417
+ * Module-local bookkeeping that is not shared (e.g. forum's
418
+ * pending_hide_count, curation-proposal lifecycle counts) stays in the
419
+ * owning module. There are deliberately NO duplicate counters: forum's
420
+ * per-epoch moderation caps read these maps too.
421
+ *
422
+ * See docs/x-rep-spec.md (RoleActivity).
423
+ * @name RoleActivity
424
+ * @package sparkdream.rep.v1
425
+ * @see proto type: sparkdream.rep.v1.RoleActivity
426
+ */
427
+ exports.RoleActivity = {
428
+ typeUrl: "/sparkdream.rep.v1.RoleActivity",
429
+ encode(message, writer = binary_1.BinaryWriter.create()) {
430
+ if (message.roleType !== 0) {
431
+ writer.uint32(8).int32(message.roleType);
432
+ }
433
+ if (message.address !== "") {
434
+ writer.uint32(18).string(message.address);
435
+ }
436
+ if (message.consecutiveUpheld !== BigInt(0)) {
437
+ writer.uint32(24).uint64(message.consecutiveUpheld);
438
+ }
439
+ if (message.consecutiveOverturns !== BigInt(0)) {
440
+ writer.uint32(32).uint64(message.consecutiveOverturns);
441
+ }
442
+ if (message.overturnCooldownUntil !== BigInt(0)) {
443
+ writer.uint32(40).int64(message.overturnCooldownUntil);
444
+ }
445
+ if (message.epochAppealsResolved !== BigInt(0)) {
446
+ writer.uint32(48).uint64(message.epochAppealsResolved);
447
+ }
448
+ for (const v of message.accuracyWindow) {
449
+ exports.RoleAccuracyBucket.encode(v, writer.uint32(58).fork()).ldelim();
450
+ }
451
+ Object.entries(message.epochActions).forEach(([key, value]) => {
452
+ exports.RoleActivity_EpochActionsEntry.encode({
453
+ key: key,
454
+ value
455
+ }, writer.uint32(64).fork()).ldelim();
456
+ });
457
+ Object.entries(message.totalActions).forEach(([key, value]) => {
458
+ exports.RoleActivity_TotalActionsEntry.encode({
459
+ key: key,
460
+ value
461
+ }, writer.uint32(72).fork()).ldelim();
462
+ });
463
+ Object.entries(message.upheldActions).forEach(([key, value]) => {
464
+ exports.RoleActivity_UpheldActionsEntry.encode({
465
+ key: key,
466
+ value
467
+ }, writer.uint32(80).fork()).ldelim();
468
+ });
469
+ Object.entries(message.overturnedActions).forEach(([key, value]) => {
470
+ exports.RoleActivity_OverturnedActionsEntry.encode({
471
+ key: key,
472
+ value
473
+ }, writer.uint32(88).fork()).ldelim();
474
+ });
475
+ return writer;
476
+ },
477
+ decode(input, length) {
478
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
479
+ let end = length === undefined ? reader.len : reader.pos + length;
480
+ const message = createBaseRoleActivity();
481
+ while (reader.pos < end) {
482
+ const tag = reader.uint32();
483
+ switch (tag >>> 3) {
484
+ case 1:
485
+ message.roleType = reader.int32();
486
+ break;
487
+ case 2:
488
+ message.address = reader.string();
489
+ break;
490
+ case 3:
491
+ message.consecutiveUpheld = reader.uint64();
492
+ break;
493
+ case 4:
494
+ message.consecutiveOverturns = reader.uint64();
495
+ break;
496
+ case 5:
497
+ message.overturnCooldownUntil = reader.int64();
498
+ break;
499
+ case 6:
500
+ message.epochAppealsResolved = reader.uint64();
501
+ break;
502
+ case 7:
503
+ message.accuracyWindow.push(exports.RoleAccuracyBucket.decode(reader, reader.uint32()));
504
+ break;
505
+ case 8:
506
+ const entry8 = exports.RoleActivity_EpochActionsEntry.decode(reader, reader.uint32());
507
+ if (entry8.value !== undefined) {
508
+ message.epochActions[entry8.key] = entry8.value;
509
+ }
510
+ break;
511
+ case 9:
512
+ const entry9 = exports.RoleActivity_TotalActionsEntry.decode(reader, reader.uint32());
513
+ if (entry9.value !== undefined) {
514
+ message.totalActions[entry9.key] = entry9.value;
515
+ }
516
+ break;
517
+ case 10:
518
+ const entry10 = exports.RoleActivity_UpheldActionsEntry.decode(reader, reader.uint32());
519
+ if (entry10.value !== undefined) {
520
+ message.upheldActions[entry10.key] = entry10.value;
521
+ }
522
+ break;
523
+ case 11:
524
+ const entry11 = exports.RoleActivity_OverturnedActionsEntry.decode(reader, reader.uint32());
525
+ if (entry11.value !== undefined) {
526
+ message.overturnedActions[entry11.key] = entry11.value;
527
+ }
528
+ break;
529
+ default:
530
+ reader.skipType(tag & 7);
531
+ break;
532
+ }
533
+ }
534
+ return message;
535
+ },
536
+ fromPartial(object) {
537
+ const message = createBaseRoleActivity();
538
+ message.roleType = object.roleType ?? 0;
539
+ message.address = object.address ?? "";
540
+ message.consecutiveUpheld = object.consecutiveUpheld !== undefined && object.consecutiveUpheld !== null ? BigInt(object.consecutiveUpheld.toString()) : BigInt(0);
541
+ message.consecutiveOverturns = object.consecutiveOverturns !== undefined && object.consecutiveOverturns !== null ? BigInt(object.consecutiveOverturns.toString()) : BigInt(0);
542
+ message.overturnCooldownUntil = object.overturnCooldownUntil !== undefined && object.overturnCooldownUntil !== null ? BigInt(object.overturnCooldownUntil.toString()) : BigInt(0);
543
+ message.epochAppealsResolved = object.epochAppealsResolved !== undefined && object.epochAppealsResolved !== null ? BigInt(object.epochAppealsResolved.toString()) : BigInt(0);
544
+ message.accuracyWindow = object.accuracyWindow?.map(e => exports.RoleAccuracyBucket.fromPartial(e)) || [];
545
+ message.epochActions = Object.entries(object.epochActions ?? {}).reduce((acc, [key, value]) => {
546
+ if (value !== undefined) {
547
+ acc[key] = BigInt(value.toString());
548
+ }
549
+ return acc;
550
+ }, {});
551
+ message.totalActions = Object.entries(object.totalActions ?? {}).reduce((acc, [key, value]) => {
552
+ if (value !== undefined) {
553
+ acc[key] = BigInt(value.toString());
554
+ }
555
+ return acc;
556
+ }, {});
557
+ message.upheldActions = Object.entries(object.upheldActions ?? {}).reduce((acc, [key, value]) => {
558
+ if (value !== undefined) {
559
+ acc[key] = BigInt(value.toString());
560
+ }
561
+ return acc;
562
+ }, {});
563
+ message.overturnedActions = Object.entries(object.overturnedActions ?? {}).reduce((acc, [key, value]) => {
564
+ if (value !== undefined) {
565
+ acc[key] = BigInt(value.toString());
566
+ }
567
+ return acc;
568
+ }, {});
569
+ return message;
570
+ },
571
+ fromAmino(object) {
572
+ const message = createBaseRoleActivity();
573
+ if (object.role_type !== undefined && object.role_type !== null) {
574
+ message.roleType = object.role_type;
575
+ }
576
+ if (object.address !== undefined && object.address !== null) {
577
+ message.address = object.address;
578
+ }
579
+ if (object.consecutive_upheld !== undefined && object.consecutive_upheld !== null) {
580
+ message.consecutiveUpheld = BigInt(object.consecutive_upheld);
581
+ }
582
+ if (object.consecutive_overturns !== undefined && object.consecutive_overturns !== null) {
583
+ message.consecutiveOverturns = BigInt(object.consecutive_overturns);
584
+ }
585
+ if (object.overturn_cooldown_until !== undefined && object.overturn_cooldown_until !== null) {
586
+ message.overturnCooldownUntil = BigInt(object.overturn_cooldown_until);
587
+ }
588
+ if (object.epoch_appeals_resolved !== undefined && object.epoch_appeals_resolved !== null) {
589
+ message.epochAppealsResolved = BigInt(object.epoch_appeals_resolved);
590
+ }
591
+ message.accuracyWindow = object.accuracy_window?.map(e => exports.RoleAccuracyBucket.fromAmino(e)) || [];
592
+ message.epochActions = Object.entries(object.epoch_actions ?? {}).reduce((acc, [key, value]) => {
593
+ if (value !== undefined) {
594
+ acc[key] = BigInt(value.toString());
595
+ }
596
+ return acc;
597
+ }, {});
598
+ message.totalActions = Object.entries(object.total_actions ?? {}).reduce((acc, [key, value]) => {
599
+ if (value !== undefined) {
600
+ acc[key] = BigInt(value.toString());
601
+ }
602
+ return acc;
603
+ }, {});
604
+ message.upheldActions = Object.entries(object.upheld_actions ?? {}).reduce((acc, [key, value]) => {
605
+ if (value !== undefined) {
606
+ acc[key] = BigInt(value.toString());
607
+ }
608
+ return acc;
609
+ }, {});
610
+ message.overturnedActions = Object.entries(object.overturned_actions ?? {}).reduce((acc, [key, value]) => {
611
+ if (value !== undefined) {
612
+ acc[key] = BigInt(value.toString());
613
+ }
614
+ return acc;
615
+ }, {});
616
+ return message;
617
+ },
618
+ toAmino(message) {
619
+ const obj = {};
620
+ obj.role_type = message.roleType === 0 ? undefined : message.roleType;
621
+ obj.address = message.address === "" ? undefined : message.address;
622
+ obj.consecutive_upheld = message.consecutiveUpheld !== BigInt(0) ? message.consecutiveUpheld?.toString() : undefined;
623
+ obj.consecutive_overturns = message.consecutiveOverturns !== BigInt(0) ? message.consecutiveOverturns?.toString() : undefined;
624
+ obj.overturn_cooldown_until = message.overturnCooldownUntil !== BigInt(0) ? message.overturnCooldownUntil?.toString() : undefined;
625
+ obj.epoch_appeals_resolved = message.epochAppealsResolved !== BigInt(0) ? message.epochAppealsResolved?.toString() : undefined;
626
+ if (message.accuracyWindow) {
627
+ obj.accuracy_window = message.accuracyWindow.map(e => e ? exports.RoleAccuracyBucket.toAmino(e) : undefined);
628
+ }
629
+ else {
630
+ obj.accuracy_window = message.accuracyWindow;
631
+ }
632
+ obj.epoch_actions = {};
633
+ if (message.epochActions) {
634
+ Object.entries(message.epochActions).forEach(([k, v]) => {
635
+ obj.epoch_actions[k] = v.toString();
636
+ });
637
+ }
638
+ obj.total_actions = {};
639
+ if (message.totalActions) {
640
+ Object.entries(message.totalActions).forEach(([k, v]) => {
641
+ obj.total_actions[k] = v.toString();
642
+ });
643
+ }
644
+ obj.upheld_actions = {};
645
+ if (message.upheldActions) {
646
+ Object.entries(message.upheldActions).forEach(([k, v]) => {
647
+ obj.upheld_actions[k] = v.toString();
648
+ });
649
+ }
650
+ obj.overturned_actions = {};
651
+ if (message.overturnedActions) {
652
+ Object.entries(message.overturnedActions).forEach(([k, v]) => {
653
+ obj.overturned_actions[k] = v.toString();
654
+ });
655
+ }
656
+ return obj;
657
+ },
658
+ fromAminoMsg(object) {
659
+ return exports.RoleActivity.fromAmino(object.value);
660
+ },
661
+ fromProtoMsg(message) {
662
+ return exports.RoleActivity.decode(message.value);
663
+ },
664
+ toProto(message) {
665
+ return exports.RoleActivity.encode(message).finish();
666
+ },
667
+ toProtoMsg(message) {
668
+ return {
669
+ typeUrl: "/sparkdream.rep.v1.RoleActivity",
670
+ value: exports.RoleActivity.encode(message).finish()
671
+ };
672
+ }
673
+ };