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