@sparkdreamnft/sparkdreamjs 0.0.24 → 0.0.26
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/esm/sparkdream/forum/v1/genesis.js +110 -1
- package/esm/sparkdream/forum/v1/params.js +74 -2
- package/esm/sparkdream/forum/v1/sentinel_activity.js +160 -1
- package/esm/sparkdream/forum/v1/thread_metadata.js +37 -1
- package/esm/sparkdream/forum/v1/tx.js +156 -0
- package/esm/sparkdream/forum/v1/tx.registry.js +20 -2
- package/esm/sparkdream/forum/v1/tx.rpc.msg.js +7 -1
- package/esm/sparkdream/rep/v1/params.js +24 -0
- package/esm/sparkdream/rep/v1/tx.js +159 -0
- package/esm/sparkdream/rep/v1/tx.registry.js +20 -2
- package/esm/sparkdream/rep/v1/tx.rpc.msg.js +8 -1
- package/package.json +1 -1
- package/sparkdream/bundle.d.ts +100 -0
- package/sparkdream/forum/v1/genesis.d.ts +65 -0
- package/sparkdream/forum/v1/genesis.js +111 -2
- package/sparkdream/forum/v1/params.d.ts +78 -0
- package/sparkdream/forum/v1/params.js +74 -2
- package/sparkdream/forum/v1/sentinel_activity.d.ts +125 -0
- package/sparkdream/forum/v1/sentinel_activity.js +161 -2
- package/sparkdream/forum/v1/thread_metadata.d.ts +48 -0
- package/sparkdream/forum/v1/thread_metadata.js +37 -1
- package/sparkdream/forum/v1/tx.d.ts +92 -6
- package/sparkdream/forum/v1/tx.js +157 -1
- package/sparkdream/forum/v1/tx.registry.d.ts +13 -1
- package/sparkdream/forum/v1/tx.registry.js +19 -1
- package/sparkdream/forum/v1/tx.rpc.msg.d.ts +4 -1
- package/sparkdream/forum/v1/tx.rpc.msg.js +6 -0
- package/sparkdream/rep/v1/params.d.ts +24 -0
- package/sparkdream/rep/v1/params.js +24 -0
- package/sparkdream/rep/v1/tx.d.ts +101 -0
- package/sparkdream/rep/v1/tx.js +160 -1
- package/sparkdream/rep/v1/tx.registry.d.ts +13 -1
- package/sparkdream/rep/v1/tx.registry.js +19 -1
- package/sparkdream/rep/v1/tx.rpc.msg.d.ts +7 -1
- package/sparkdream/rep/v1/tx.rpc.msg.js +7 -0
|
@@ -31,7 +31,8 @@ function createBaseGenesisState() {
|
|
|
31
31
|
threadFollowMap: [],
|
|
32
32
|
threadFollowCountMap: [],
|
|
33
33
|
archiveMetadataMap: [],
|
|
34
|
-
postCount: BigInt(0)
|
|
34
|
+
postCount: BigInt(0),
|
|
35
|
+
proposalCountMap: []
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
@@ -91,6 +92,9 @@ export const GenesisState = {
|
|
|
91
92
|
if (message.postCount !== BigInt(0)) {
|
|
92
93
|
writer.uint32(128).uint64(message.postCount);
|
|
93
94
|
}
|
|
95
|
+
for (const v of message.proposalCountMap) {
|
|
96
|
+
ProposalCountEntry.encode(v, writer.uint32(138).fork()).ldelim();
|
|
97
|
+
}
|
|
94
98
|
return writer;
|
|
95
99
|
},
|
|
96
100
|
decode(input, length) {
|
|
@@ -148,6 +152,9 @@ export const GenesisState = {
|
|
|
148
152
|
case 16:
|
|
149
153
|
message.postCount = reader.uint64();
|
|
150
154
|
break;
|
|
155
|
+
case 17:
|
|
156
|
+
message.proposalCountMap.push(ProposalCountEntry.decode(reader, reader.uint32()));
|
|
157
|
+
break;
|
|
151
158
|
default:
|
|
152
159
|
reader.skipType(tag & 7);
|
|
153
160
|
break;
|
|
@@ -173,6 +180,7 @@ export const GenesisState = {
|
|
|
173
180
|
message.threadFollowCountMap = object.threadFollowCountMap?.map(e => ThreadFollowCount.fromPartial(e)) || [];
|
|
174
181
|
message.archiveMetadataMap = object.archiveMetadataMap?.map(e => ArchiveMetadata.fromPartial(e)) || [];
|
|
175
182
|
message.postCount = object.postCount !== undefined && object.postCount !== null ? BigInt(object.postCount.toString()) : BigInt(0);
|
|
183
|
+
message.proposalCountMap = object.proposalCountMap?.map(e => ProposalCountEntry.fromPartial(e)) || [];
|
|
176
184
|
return message;
|
|
177
185
|
},
|
|
178
186
|
fromAmino(object) {
|
|
@@ -199,6 +207,7 @@ export const GenesisState = {
|
|
|
199
207
|
if (object.post_count !== undefined && object.post_count !== null) {
|
|
200
208
|
message.postCount = BigInt(object.post_count);
|
|
201
209
|
}
|
|
210
|
+
message.proposalCountMap = object.proposal_count_map?.map(e => ProposalCountEntry.fromAmino(e)) || [];
|
|
202
211
|
return message;
|
|
203
212
|
},
|
|
204
213
|
toAmino(message) {
|
|
@@ -284,6 +293,12 @@ export const GenesisState = {
|
|
|
284
293
|
obj.archive_metadata_map = message.archiveMetadataMap;
|
|
285
294
|
}
|
|
286
295
|
obj.post_count = message.postCount !== BigInt(0) ? message.postCount?.toString() : undefined;
|
|
296
|
+
if (message.proposalCountMap) {
|
|
297
|
+
obj.proposal_count_map = message.proposalCountMap.map(e => e ? ProposalCountEntry.toAmino(e) : undefined);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
obj.proposal_count_map = message.proposalCountMap;
|
|
301
|
+
}
|
|
287
302
|
return obj;
|
|
288
303
|
},
|
|
289
304
|
fromAminoMsg(object) {
|
|
@@ -302,3 +317,97 @@ export const GenesisState = {
|
|
|
302
317
|
};
|
|
303
318
|
}
|
|
304
319
|
};
|
|
320
|
+
function createBaseProposalCountEntry() {
|
|
321
|
+
return {
|
|
322
|
+
threadId: BigInt(0),
|
|
323
|
+
sentinel: "",
|
|
324
|
+
count: BigInt(0)
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* ProposalCountEntry is one (thread_id, sentinel) -> count tuple of the
|
|
329
|
+
* accepted-reply proposal cap counter, flattened for genesis import/export.
|
|
330
|
+
* @name ProposalCountEntry
|
|
331
|
+
* @package sparkdream.forum.v1
|
|
332
|
+
* @see proto type: sparkdream.forum.v1.ProposalCountEntry
|
|
333
|
+
*/
|
|
334
|
+
export const ProposalCountEntry = {
|
|
335
|
+
typeUrl: "/sparkdream.forum.v1.ProposalCountEntry",
|
|
336
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
337
|
+
if (message.threadId !== BigInt(0)) {
|
|
338
|
+
writer.uint32(8).uint64(message.threadId);
|
|
339
|
+
}
|
|
340
|
+
if (message.sentinel !== "") {
|
|
341
|
+
writer.uint32(18).string(message.sentinel);
|
|
342
|
+
}
|
|
343
|
+
if (message.count !== BigInt(0)) {
|
|
344
|
+
writer.uint32(24).uint64(message.count);
|
|
345
|
+
}
|
|
346
|
+
return writer;
|
|
347
|
+
},
|
|
348
|
+
decode(input, length) {
|
|
349
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
350
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
351
|
+
const message = createBaseProposalCountEntry();
|
|
352
|
+
while (reader.pos < end) {
|
|
353
|
+
const tag = reader.uint32();
|
|
354
|
+
switch (tag >>> 3) {
|
|
355
|
+
case 1:
|
|
356
|
+
message.threadId = reader.uint64();
|
|
357
|
+
break;
|
|
358
|
+
case 2:
|
|
359
|
+
message.sentinel = reader.string();
|
|
360
|
+
break;
|
|
361
|
+
case 3:
|
|
362
|
+
message.count = reader.uint64();
|
|
363
|
+
break;
|
|
364
|
+
default:
|
|
365
|
+
reader.skipType(tag & 7);
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return message;
|
|
370
|
+
},
|
|
371
|
+
fromPartial(object) {
|
|
372
|
+
const message = createBaseProposalCountEntry();
|
|
373
|
+
message.threadId = object.threadId !== undefined && object.threadId !== null ? BigInt(object.threadId.toString()) : BigInt(0);
|
|
374
|
+
message.sentinel = object.sentinel ?? "";
|
|
375
|
+
message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0);
|
|
376
|
+
return message;
|
|
377
|
+
},
|
|
378
|
+
fromAmino(object) {
|
|
379
|
+
const message = createBaseProposalCountEntry();
|
|
380
|
+
if (object.thread_id !== undefined && object.thread_id !== null) {
|
|
381
|
+
message.threadId = BigInt(object.thread_id);
|
|
382
|
+
}
|
|
383
|
+
if (object.sentinel !== undefined && object.sentinel !== null) {
|
|
384
|
+
message.sentinel = object.sentinel;
|
|
385
|
+
}
|
|
386
|
+
if (object.count !== undefined && object.count !== null) {
|
|
387
|
+
message.count = BigInt(object.count);
|
|
388
|
+
}
|
|
389
|
+
return message;
|
|
390
|
+
},
|
|
391
|
+
toAmino(message) {
|
|
392
|
+
const obj = {};
|
|
393
|
+
obj.thread_id = message.threadId !== BigInt(0) ? message.threadId?.toString() : undefined;
|
|
394
|
+
obj.sentinel = message.sentinel === "" ? undefined : message.sentinel;
|
|
395
|
+
obj.count = message.count !== BigInt(0) ? message.count?.toString() : undefined;
|
|
396
|
+
return obj;
|
|
397
|
+
},
|
|
398
|
+
fromAminoMsg(object) {
|
|
399
|
+
return ProposalCountEntry.fromAmino(object.value);
|
|
400
|
+
},
|
|
401
|
+
fromProtoMsg(message) {
|
|
402
|
+
return ProposalCountEntry.decode(message.value);
|
|
403
|
+
},
|
|
404
|
+
toProto(message) {
|
|
405
|
+
return ProposalCountEntry.encode(message).finish();
|
|
406
|
+
},
|
|
407
|
+
toProtoMsg(message) {
|
|
408
|
+
return {
|
|
409
|
+
typeUrl: "/sparkdream.forum.v1.ProposalCountEntry",
|
|
410
|
+
value: ProposalCountEntry.encode(message).finish()
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
};
|
|
@@ -58,7 +58,10 @@ function createBaseParams() {
|
|
|
58
58
|
postConvictionLockSeconds: BigInt(0),
|
|
59
59
|
postConvictionStreamRatePerBlock: "",
|
|
60
60
|
maxForumRepPerTagPerEpoch: "",
|
|
61
|
-
postConvictionStakerSlashBps: BigInt(0)
|
|
61
|
+
postConvictionStakerSlashBps: BigInt(0),
|
|
62
|
+
curationDreamReward: "",
|
|
63
|
+
acceptProposalTimeout: BigInt(0),
|
|
64
|
+
maxAcceptProposalsPerSentinelPerThread: 0
|
|
62
65
|
};
|
|
63
66
|
}
|
|
64
67
|
/**
|
|
@@ -241,6 +244,15 @@ export const Params = {
|
|
|
241
244
|
if (message.postConvictionStakerSlashBps !== BigInt(0)) {
|
|
242
245
|
writer.uint32(512).uint64(message.postConvictionStakerSlashBps);
|
|
243
246
|
}
|
|
247
|
+
if (message.curationDreamReward !== "") {
|
|
248
|
+
writer.uint32(522).string(message.curationDreamReward);
|
|
249
|
+
}
|
|
250
|
+
if (message.acceptProposalTimeout !== BigInt(0)) {
|
|
251
|
+
writer.uint32(528).int64(message.acceptProposalTimeout);
|
|
252
|
+
}
|
|
253
|
+
if (message.maxAcceptProposalsPerSentinelPerThread !== 0) {
|
|
254
|
+
writer.uint32(536).uint32(message.maxAcceptProposalsPerSentinelPerThread);
|
|
255
|
+
}
|
|
244
256
|
return writer;
|
|
245
257
|
},
|
|
246
258
|
decode(input, length) {
|
|
@@ -418,6 +430,15 @@ export const Params = {
|
|
|
418
430
|
case 64:
|
|
419
431
|
message.postConvictionStakerSlashBps = reader.uint64();
|
|
420
432
|
break;
|
|
433
|
+
case 65:
|
|
434
|
+
message.curationDreamReward = reader.string();
|
|
435
|
+
break;
|
|
436
|
+
case 66:
|
|
437
|
+
message.acceptProposalTimeout = reader.int64();
|
|
438
|
+
break;
|
|
439
|
+
case 67:
|
|
440
|
+
message.maxAcceptProposalsPerSentinelPerThread = reader.uint32();
|
|
441
|
+
break;
|
|
421
442
|
default:
|
|
422
443
|
reader.skipType(tag & 7);
|
|
423
444
|
break;
|
|
@@ -483,6 +504,9 @@ export const Params = {
|
|
|
483
504
|
message.postConvictionStreamRatePerBlock = object.postConvictionStreamRatePerBlock ?? "";
|
|
484
505
|
message.maxForumRepPerTagPerEpoch = object.maxForumRepPerTagPerEpoch ?? "";
|
|
485
506
|
message.postConvictionStakerSlashBps = object.postConvictionStakerSlashBps !== undefined && object.postConvictionStakerSlashBps !== null ? BigInt(object.postConvictionStakerSlashBps.toString()) : BigInt(0);
|
|
507
|
+
message.curationDreamReward = object.curationDreamReward ?? "";
|
|
508
|
+
message.acceptProposalTimeout = object.acceptProposalTimeout !== undefined && object.acceptProposalTimeout !== null ? BigInt(object.acceptProposalTimeout.toString()) : BigInt(0);
|
|
509
|
+
message.maxAcceptProposalsPerSentinelPerThread = object.maxAcceptProposalsPerSentinelPerThread ?? 0;
|
|
486
510
|
return message;
|
|
487
511
|
},
|
|
488
512
|
fromAmino(object) {
|
|
@@ -655,6 +679,15 @@ export const Params = {
|
|
|
655
679
|
if (object.post_conviction_staker_slash_bps !== undefined && object.post_conviction_staker_slash_bps !== null) {
|
|
656
680
|
message.postConvictionStakerSlashBps = BigInt(object.post_conviction_staker_slash_bps);
|
|
657
681
|
}
|
|
682
|
+
if (object.curation_dream_reward !== undefined && object.curation_dream_reward !== null) {
|
|
683
|
+
message.curationDreamReward = object.curation_dream_reward;
|
|
684
|
+
}
|
|
685
|
+
if (object.accept_proposal_timeout !== undefined && object.accept_proposal_timeout !== null) {
|
|
686
|
+
message.acceptProposalTimeout = BigInt(object.accept_proposal_timeout);
|
|
687
|
+
}
|
|
688
|
+
if (object.max_accept_proposals_per_sentinel_per_thread !== undefined && object.max_accept_proposals_per_sentinel_per_thread !== null) {
|
|
689
|
+
message.maxAcceptProposalsPerSentinelPerThread = object.max_accept_proposals_per_sentinel_per_thread;
|
|
690
|
+
}
|
|
658
691
|
return message;
|
|
659
692
|
},
|
|
660
693
|
toAmino(message) {
|
|
@@ -715,6 +748,9 @@ export const Params = {
|
|
|
715
748
|
obj.post_conviction_stream_rate_per_block = message.postConvictionStreamRatePerBlock === "" ? undefined : message.postConvictionStreamRatePerBlock;
|
|
716
749
|
obj.max_forum_rep_per_tag_per_epoch = message.maxForumRepPerTagPerEpoch === "" ? undefined : message.maxForumRepPerTagPerEpoch;
|
|
717
750
|
obj.post_conviction_staker_slash_bps = message.postConvictionStakerSlashBps !== BigInt(0) ? message.postConvictionStakerSlashBps?.toString() : undefined;
|
|
751
|
+
obj.curation_dream_reward = message.curationDreamReward === "" ? undefined : message.curationDreamReward;
|
|
752
|
+
obj.accept_proposal_timeout = message.acceptProposalTimeout !== BigInt(0) ? message.acceptProposalTimeout?.toString() : undefined;
|
|
753
|
+
obj.max_accept_proposals_per_sentinel_per_thread = message.maxAcceptProposalsPerSentinelPerThread === 0 ? undefined : message.maxAcceptProposalsPerSentinelPerThread;
|
|
718
754
|
return obj;
|
|
719
755
|
},
|
|
720
756
|
fromAminoMsg(object) {
|
|
@@ -790,7 +826,10 @@ function createBaseForumOperationalParams() {
|
|
|
790
826
|
postConvictionLockSeconds: BigInt(0),
|
|
791
827
|
postConvictionStreamRatePerBlock: "",
|
|
792
828
|
maxForumRepPerTagPerEpoch: "",
|
|
793
|
-
postConvictionStakerSlashBps: BigInt(0)
|
|
829
|
+
postConvictionStakerSlashBps: BigInt(0),
|
|
830
|
+
curationDreamReward: "",
|
|
831
|
+
acceptProposalTimeout: BigInt(0),
|
|
832
|
+
maxAcceptProposalsPerSentinelPerThread: 0
|
|
794
833
|
};
|
|
795
834
|
}
|
|
796
835
|
/**
|
|
@@ -956,6 +995,15 @@ export const ForumOperationalParams = {
|
|
|
956
995
|
if (message.postConvictionStakerSlashBps !== BigInt(0)) {
|
|
957
996
|
writer.uint32(512).uint64(message.postConvictionStakerSlashBps);
|
|
958
997
|
}
|
|
998
|
+
if (message.curationDreamReward !== "") {
|
|
999
|
+
writer.uint32(522).string(message.curationDreamReward);
|
|
1000
|
+
}
|
|
1001
|
+
if (message.acceptProposalTimeout !== BigInt(0)) {
|
|
1002
|
+
writer.uint32(528).int64(message.acceptProposalTimeout);
|
|
1003
|
+
}
|
|
1004
|
+
if (message.maxAcceptProposalsPerSentinelPerThread !== 0) {
|
|
1005
|
+
writer.uint32(536).uint32(message.maxAcceptProposalsPerSentinelPerThread);
|
|
1006
|
+
}
|
|
959
1007
|
return writer;
|
|
960
1008
|
},
|
|
961
1009
|
decode(input, length) {
|
|
@@ -1115,6 +1163,15 @@ export const ForumOperationalParams = {
|
|
|
1115
1163
|
case 64:
|
|
1116
1164
|
message.postConvictionStakerSlashBps = reader.uint64();
|
|
1117
1165
|
break;
|
|
1166
|
+
case 65:
|
|
1167
|
+
message.curationDreamReward = reader.string();
|
|
1168
|
+
break;
|
|
1169
|
+
case 66:
|
|
1170
|
+
message.acceptProposalTimeout = reader.int64();
|
|
1171
|
+
break;
|
|
1172
|
+
case 67:
|
|
1173
|
+
message.maxAcceptProposalsPerSentinelPerThread = reader.uint32();
|
|
1174
|
+
break;
|
|
1118
1175
|
default:
|
|
1119
1176
|
reader.skipType(tag & 7);
|
|
1120
1177
|
break;
|
|
@@ -1174,6 +1231,9 @@ export const ForumOperationalParams = {
|
|
|
1174
1231
|
message.postConvictionStreamRatePerBlock = object.postConvictionStreamRatePerBlock ?? "";
|
|
1175
1232
|
message.maxForumRepPerTagPerEpoch = object.maxForumRepPerTagPerEpoch ?? "";
|
|
1176
1233
|
message.postConvictionStakerSlashBps = object.postConvictionStakerSlashBps !== undefined && object.postConvictionStakerSlashBps !== null ? BigInt(object.postConvictionStakerSlashBps.toString()) : BigInt(0);
|
|
1234
|
+
message.curationDreamReward = object.curationDreamReward ?? "";
|
|
1235
|
+
message.acceptProposalTimeout = object.acceptProposalTimeout !== undefined && object.acceptProposalTimeout !== null ? BigInt(object.acceptProposalTimeout.toString()) : BigInt(0);
|
|
1236
|
+
message.maxAcceptProposalsPerSentinelPerThread = object.maxAcceptProposalsPerSentinelPerThread ?? 0;
|
|
1177
1237
|
return message;
|
|
1178
1238
|
},
|
|
1179
1239
|
fromAmino(object) {
|
|
@@ -1328,6 +1388,15 @@ export const ForumOperationalParams = {
|
|
|
1328
1388
|
if (object.post_conviction_staker_slash_bps !== undefined && object.post_conviction_staker_slash_bps !== null) {
|
|
1329
1389
|
message.postConvictionStakerSlashBps = BigInt(object.post_conviction_staker_slash_bps);
|
|
1330
1390
|
}
|
|
1391
|
+
if (object.curation_dream_reward !== undefined && object.curation_dream_reward !== null) {
|
|
1392
|
+
message.curationDreamReward = object.curation_dream_reward;
|
|
1393
|
+
}
|
|
1394
|
+
if (object.accept_proposal_timeout !== undefined && object.accept_proposal_timeout !== null) {
|
|
1395
|
+
message.acceptProposalTimeout = BigInt(object.accept_proposal_timeout);
|
|
1396
|
+
}
|
|
1397
|
+
if (object.max_accept_proposals_per_sentinel_per_thread !== undefined && object.max_accept_proposals_per_sentinel_per_thread !== null) {
|
|
1398
|
+
message.maxAcceptProposalsPerSentinelPerThread = object.max_accept_proposals_per_sentinel_per_thread;
|
|
1399
|
+
}
|
|
1331
1400
|
return message;
|
|
1332
1401
|
},
|
|
1333
1402
|
toAmino(message) {
|
|
@@ -1382,6 +1451,9 @@ export const ForumOperationalParams = {
|
|
|
1382
1451
|
obj.post_conviction_stream_rate_per_block = message.postConvictionStreamRatePerBlock === "" ? undefined : message.postConvictionStreamRatePerBlock;
|
|
1383
1452
|
obj.max_forum_rep_per_tag_per_epoch = message.maxForumRepPerTagPerEpoch === "" ? undefined : message.maxForumRepPerTagPerEpoch;
|
|
1384
1453
|
obj.post_conviction_staker_slash_bps = message.postConvictionStakerSlashBps !== BigInt(0) ? message.postConvictionStakerSlashBps?.toString() : undefined;
|
|
1454
|
+
obj.curation_dream_reward = message.curationDreamReward === "" ? undefined : message.curationDreamReward;
|
|
1455
|
+
obj.accept_proposal_timeout = message.acceptProposalTimeout !== BigInt(0) ? message.acceptProposalTimeout?.toString() : undefined;
|
|
1456
|
+
obj.max_accept_proposals_per_sentinel_per_thread = message.maxAcceptProposalsPerSentinelPerThread === 0 ? undefined : message.maxAcceptProposalsPerSentinelPerThread;
|
|
1385
1457
|
return obj;
|
|
1386
1458
|
},
|
|
1387
1459
|
fromAminoMsg(object) {
|
|
@@ -1,5 +1,101 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
2
|
import { BinaryReader, BinaryWriter } from "../../../binary";
|
|
3
|
+
function createBaseAccuracyEpochBucket() {
|
|
4
|
+
return {
|
|
5
|
+
epoch: BigInt(0),
|
|
6
|
+
upheld: BigInt(0),
|
|
7
|
+
overturned: BigInt(0)
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* AccuracyEpochBucket holds one reward-epoch's resolved-appeal tally for a
|
|
12
|
+
* sentinel. Stored in a fixed-size ring on SentinelActivity (slot index =
|
|
13
|
+
* epoch % SentinelAccuracyRingSize); the `epoch` stamp disambiguates a live
|
|
14
|
+
* slot from a stale one left behind by an inactive epoch.
|
|
15
|
+
* @name AccuracyEpochBucket
|
|
16
|
+
* @package sparkdream.forum.v1
|
|
17
|
+
* @see proto type: sparkdream.forum.v1.AccuracyEpochBucket
|
|
18
|
+
*/
|
|
19
|
+
export const AccuracyEpochBucket = {
|
|
20
|
+
typeUrl: "/sparkdream.forum.v1.AccuracyEpochBucket",
|
|
21
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
22
|
+
if (message.epoch !== BigInt(0)) {
|
|
23
|
+
writer.uint32(8).uint64(message.epoch);
|
|
24
|
+
}
|
|
25
|
+
if (message.upheld !== BigInt(0)) {
|
|
26
|
+
writer.uint32(16).uint64(message.upheld);
|
|
27
|
+
}
|
|
28
|
+
if (message.overturned !== BigInt(0)) {
|
|
29
|
+
writer.uint32(24).uint64(message.overturned);
|
|
30
|
+
}
|
|
31
|
+
return writer;
|
|
32
|
+
},
|
|
33
|
+
decode(input, length) {
|
|
34
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
35
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
36
|
+
const message = createBaseAccuracyEpochBucket();
|
|
37
|
+
while (reader.pos < end) {
|
|
38
|
+
const tag = reader.uint32();
|
|
39
|
+
switch (tag >>> 3) {
|
|
40
|
+
case 1:
|
|
41
|
+
message.epoch = reader.uint64();
|
|
42
|
+
break;
|
|
43
|
+
case 2:
|
|
44
|
+
message.upheld = reader.uint64();
|
|
45
|
+
break;
|
|
46
|
+
case 3:
|
|
47
|
+
message.overturned = reader.uint64();
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
reader.skipType(tag & 7);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return message;
|
|
55
|
+
},
|
|
56
|
+
fromPartial(object) {
|
|
57
|
+
const message = createBaseAccuracyEpochBucket();
|
|
58
|
+
message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0);
|
|
59
|
+
message.upheld = object.upheld !== undefined && object.upheld !== null ? BigInt(object.upheld.toString()) : BigInt(0);
|
|
60
|
+
message.overturned = object.overturned !== undefined && object.overturned !== null ? BigInt(object.overturned.toString()) : BigInt(0);
|
|
61
|
+
return message;
|
|
62
|
+
},
|
|
63
|
+
fromAmino(object) {
|
|
64
|
+
const message = createBaseAccuracyEpochBucket();
|
|
65
|
+
if (object.epoch !== undefined && object.epoch !== null) {
|
|
66
|
+
message.epoch = BigInt(object.epoch);
|
|
67
|
+
}
|
|
68
|
+
if (object.upheld !== undefined && object.upheld !== null) {
|
|
69
|
+
message.upheld = BigInt(object.upheld);
|
|
70
|
+
}
|
|
71
|
+
if (object.overturned !== undefined && object.overturned !== null) {
|
|
72
|
+
message.overturned = BigInt(object.overturned);
|
|
73
|
+
}
|
|
74
|
+
return message;
|
|
75
|
+
},
|
|
76
|
+
toAmino(message) {
|
|
77
|
+
const obj = {};
|
|
78
|
+
obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined;
|
|
79
|
+
obj.upheld = message.upheld !== BigInt(0) ? message.upheld?.toString() : undefined;
|
|
80
|
+
obj.overturned = message.overturned !== BigInt(0) ? message.overturned?.toString() : undefined;
|
|
81
|
+
return obj;
|
|
82
|
+
},
|
|
83
|
+
fromAminoMsg(object) {
|
|
84
|
+
return AccuracyEpochBucket.fromAmino(object.value);
|
|
85
|
+
},
|
|
86
|
+
fromProtoMsg(message) {
|
|
87
|
+
return AccuracyEpochBucket.decode(message.value);
|
|
88
|
+
},
|
|
89
|
+
toProto(message) {
|
|
90
|
+
return AccuracyEpochBucket.encode(message).finish();
|
|
91
|
+
},
|
|
92
|
+
toProtoMsg(message) {
|
|
93
|
+
return {
|
|
94
|
+
typeUrl: "/sparkdream.forum.v1.AccuracyEpochBucket",
|
|
95
|
+
value: AccuracyEpochBucket.encode(message).finish()
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
3
99
|
function createBaseSentinelActivity() {
|
|
4
100
|
return {
|
|
5
101
|
address: "",
|
|
@@ -25,7 +121,12 @@ function createBaseSentinelActivity() {
|
|
|
25
121
|
totalPins: BigInt(0),
|
|
26
122
|
upheldPins: BigInt(0),
|
|
27
123
|
overturnedPins: BigInt(0),
|
|
28
|
-
epochPins: BigInt(0)
|
|
124
|
+
epochPins: BigInt(0),
|
|
125
|
+
totalProposals: BigInt(0),
|
|
126
|
+
confirmedProposals: BigInt(0),
|
|
127
|
+
rejectedProposals: BigInt(0),
|
|
128
|
+
epochCurations: BigInt(0),
|
|
129
|
+
accuracyWindow: []
|
|
29
130
|
};
|
|
30
131
|
}
|
|
31
132
|
/**
|
|
@@ -111,6 +212,21 @@ export const SentinelActivity = {
|
|
|
111
212
|
if (message.epochPins !== BigInt(0)) {
|
|
112
213
|
writer.uint32(192).uint64(message.epochPins);
|
|
113
214
|
}
|
|
215
|
+
if (message.totalProposals !== BigInt(0)) {
|
|
216
|
+
writer.uint32(200).uint64(message.totalProposals);
|
|
217
|
+
}
|
|
218
|
+
if (message.confirmedProposals !== BigInt(0)) {
|
|
219
|
+
writer.uint32(208).uint64(message.confirmedProposals);
|
|
220
|
+
}
|
|
221
|
+
if (message.rejectedProposals !== BigInt(0)) {
|
|
222
|
+
writer.uint32(216).uint64(message.rejectedProposals);
|
|
223
|
+
}
|
|
224
|
+
if (message.epochCurations !== BigInt(0)) {
|
|
225
|
+
writer.uint32(224).uint64(message.epochCurations);
|
|
226
|
+
}
|
|
227
|
+
for (const v of message.accuracyWindow) {
|
|
228
|
+
AccuracyEpochBucket.encode(v, writer.uint32(234).fork()).ldelim();
|
|
229
|
+
}
|
|
114
230
|
return writer;
|
|
115
231
|
},
|
|
116
232
|
decode(input, length) {
|
|
@@ -192,6 +308,21 @@ export const SentinelActivity = {
|
|
|
192
308
|
case 24:
|
|
193
309
|
message.epochPins = reader.uint64();
|
|
194
310
|
break;
|
|
311
|
+
case 25:
|
|
312
|
+
message.totalProposals = reader.uint64();
|
|
313
|
+
break;
|
|
314
|
+
case 26:
|
|
315
|
+
message.confirmedProposals = reader.uint64();
|
|
316
|
+
break;
|
|
317
|
+
case 27:
|
|
318
|
+
message.rejectedProposals = reader.uint64();
|
|
319
|
+
break;
|
|
320
|
+
case 28:
|
|
321
|
+
message.epochCurations = reader.uint64();
|
|
322
|
+
break;
|
|
323
|
+
case 29:
|
|
324
|
+
message.accuracyWindow.push(AccuracyEpochBucket.decode(reader, reader.uint32()));
|
|
325
|
+
break;
|
|
195
326
|
default:
|
|
196
327
|
reader.skipType(tag & 7);
|
|
197
328
|
break;
|
|
@@ -225,6 +356,11 @@ export const SentinelActivity = {
|
|
|
225
356
|
message.upheldPins = object.upheldPins !== undefined && object.upheldPins !== null ? BigInt(object.upheldPins.toString()) : BigInt(0);
|
|
226
357
|
message.overturnedPins = object.overturnedPins !== undefined && object.overturnedPins !== null ? BigInt(object.overturnedPins.toString()) : BigInt(0);
|
|
227
358
|
message.epochPins = object.epochPins !== undefined && object.epochPins !== null ? BigInt(object.epochPins.toString()) : BigInt(0);
|
|
359
|
+
message.totalProposals = object.totalProposals !== undefined && object.totalProposals !== null ? BigInt(object.totalProposals.toString()) : BigInt(0);
|
|
360
|
+
message.confirmedProposals = object.confirmedProposals !== undefined && object.confirmedProposals !== null ? BigInt(object.confirmedProposals.toString()) : BigInt(0);
|
|
361
|
+
message.rejectedProposals = object.rejectedProposals !== undefined && object.rejectedProposals !== null ? BigInt(object.rejectedProposals.toString()) : BigInt(0);
|
|
362
|
+
message.epochCurations = object.epochCurations !== undefined && object.epochCurations !== null ? BigInt(object.epochCurations.toString()) : BigInt(0);
|
|
363
|
+
message.accuracyWindow = object.accuracyWindow?.map(e => AccuracyEpochBucket.fromPartial(e)) || [];
|
|
228
364
|
return message;
|
|
229
365
|
},
|
|
230
366
|
fromAmino(object) {
|
|
@@ -301,6 +437,19 @@ export const SentinelActivity = {
|
|
|
301
437
|
if (object.epoch_pins !== undefined && object.epoch_pins !== null) {
|
|
302
438
|
message.epochPins = BigInt(object.epoch_pins);
|
|
303
439
|
}
|
|
440
|
+
if (object.total_proposals !== undefined && object.total_proposals !== null) {
|
|
441
|
+
message.totalProposals = BigInt(object.total_proposals);
|
|
442
|
+
}
|
|
443
|
+
if (object.confirmed_proposals !== undefined && object.confirmed_proposals !== null) {
|
|
444
|
+
message.confirmedProposals = BigInt(object.confirmed_proposals);
|
|
445
|
+
}
|
|
446
|
+
if (object.rejected_proposals !== undefined && object.rejected_proposals !== null) {
|
|
447
|
+
message.rejectedProposals = BigInt(object.rejected_proposals);
|
|
448
|
+
}
|
|
449
|
+
if (object.epoch_curations !== undefined && object.epoch_curations !== null) {
|
|
450
|
+
message.epochCurations = BigInt(object.epoch_curations);
|
|
451
|
+
}
|
|
452
|
+
message.accuracyWindow = object.accuracy_window?.map(e => AccuracyEpochBucket.fromAmino(e)) || [];
|
|
304
453
|
return message;
|
|
305
454
|
},
|
|
306
455
|
toAmino(message) {
|
|
@@ -329,6 +478,16 @@ export const SentinelActivity = {
|
|
|
329
478
|
obj.upheld_pins = message.upheldPins !== BigInt(0) ? message.upheldPins?.toString() : undefined;
|
|
330
479
|
obj.overturned_pins = message.overturnedPins !== BigInt(0) ? message.overturnedPins?.toString() : undefined;
|
|
331
480
|
obj.epoch_pins = message.epochPins !== BigInt(0) ? message.epochPins?.toString() : undefined;
|
|
481
|
+
obj.total_proposals = message.totalProposals !== BigInt(0) ? message.totalProposals?.toString() : undefined;
|
|
482
|
+
obj.confirmed_proposals = message.confirmedProposals !== BigInt(0) ? message.confirmedProposals?.toString() : undefined;
|
|
483
|
+
obj.rejected_proposals = message.rejectedProposals !== BigInt(0) ? message.rejectedProposals?.toString() : undefined;
|
|
484
|
+
obj.epoch_curations = message.epochCurations !== BigInt(0) ? message.epochCurations?.toString() : undefined;
|
|
485
|
+
if (message.accuracyWindow) {
|
|
486
|
+
obj.accuracy_window = message.accuracyWindow.map(e => e ? AccuracyEpochBucket.toAmino(e) : undefined);
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
obj.accuracy_window = message.accuracyWindow;
|
|
490
|
+
}
|
|
332
491
|
return obj;
|
|
333
492
|
},
|
|
334
493
|
fromAminoMsg(object) {
|
|
@@ -10,8 +10,11 @@ function createBaseThreadMetadata() {
|
|
|
10
10
|
proposedReplyId: BigInt(0),
|
|
11
11
|
proposedBy: "",
|
|
12
12
|
proposedAt: BigInt(0),
|
|
13
|
+
proposalExtended: false,
|
|
14
|
+
proposalFireAt: BigInt(0),
|
|
13
15
|
pinnedReplyIds: [],
|
|
14
|
-
pinnedRecords: []
|
|
16
|
+
pinnedRecords: [],
|
|
17
|
+
proposalsLocked: false
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
@@ -44,6 +47,12 @@ export const ThreadMetadata = {
|
|
|
44
47
|
if (message.proposedAt !== BigInt(0)) {
|
|
45
48
|
writer.uint32(56).int64(message.proposedAt);
|
|
46
49
|
}
|
|
50
|
+
if (message.proposalExtended === true) {
|
|
51
|
+
writer.uint32(64).bool(message.proposalExtended);
|
|
52
|
+
}
|
|
53
|
+
if (message.proposalFireAt !== BigInt(0)) {
|
|
54
|
+
writer.uint32(72).int64(message.proposalFireAt);
|
|
55
|
+
}
|
|
47
56
|
writer.uint32(82).fork();
|
|
48
57
|
for (const v of message.pinnedReplyIds) {
|
|
49
58
|
writer.uint64(v);
|
|
@@ -52,6 +61,9 @@ export const ThreadMetadata = {
|
|
|
52
61
|
for (const v of message.pinnedRecords) {
|
|
53
62
|
PinnedReplyRecord.encode(v, writer.uint32(90).fork()).ldelim();
|
|
54
63
|
}
|
|
64
|
+
if (message.proposalsLocked === true) {
|
|
65
|
+
writer.uint32(96).bool(message.proposalsLocked);
|
|
66
|
+
}
|
|
55
67
|
return writer;
|
|
56
68
|
},
|
|
57
69
|
decode(input, length) {
|
|
@@ -82,6 +94,12 @@ export const ThreadMetadata = {
|
|
|
82
94
|
case 7:
|
|
83
95
|
message.proposedAt = reader.int64();
|
|
84
96
|
break;
|
|
97
|
+
case 8:
|
|
98
|
+
message.proposalExtended = reader.bool();
|
|
99
|
+
break;
|
|
100
|
+
case 9:
|
|
101
|
+
message.proposalFireAt = reader.int64();
|
|
102
|
+
break;
|
|
85
103
|
case 10:
|
|
86
104
|
if ((tag & 7) === 2) {
|
|
87
105
|
const end2 = reader.uint32() + reader.pos;
|
|
@@ -96,6 +114,9 @@ export const ThreadMetadata = {
|
|
|
96
114
|
case 11:
|
|
97
115
|
message.pinnedRecords.push(PinnedReplyRecord.decode(reader, reader.uint32()));
|
|
98
116
|
break;
|
|
117
|
+
case 12:
|
|
118
|
+
message.proposalsLocked = reader.bool();
|
|
119
|
+
break;
|
|
99
120
|
default:
|
|
100
121
|
reader.skipType(tag & 7);
|
|
101
122
|
break;
|
|
@@ -112,8 +133,11 @@ export const ThreadMetadata = {
|
|
|
112
133
|
message.proposedReplyId = object.proposedReplyId !== undefined && object.proposedReplyId !== null ? BigInt(object.proposedReplyId.toString()) : BigInt(0);
|
|
113
134
|
message.proposedBy = object.proposedBy ?? "";
|
|
114
135
|
message.proposedAt = object.proposedAt !== undefined && object.proposedAt !== null ? BigInt(object.proposedAt.toString()) : BigInt(0);
|
|
136
|
+
message.proposalExtended = object.proposalExtended ?? false;
|
|
137
|
+
message.proposalFireAt = object.proposalFireAt !== undefined && object.proposalFireAt !== null ? BigInt(object.proposalFireAt.toString()) : BigInt(0);
|
|
115
138
|
message.pinnedReplyIds = object.pinnedReplyIds?.map(e => BigInt(e.toString())) || [];
|
|
116
139
|
message.pinnedRecords = object.pinnedRecords?.map(e => PinnedReplyRecord.fromPartial(e)) || [];
|
|
140
|
+
message.proposalsLocked = object.proposalsLocked ?? false;
|
|
117
141
|
return message;
|
|
118
142
|
},
|
|
119
143
|
fromAmino(object) {
|
|
@@ -139,8 +163,17 @@ export const ThreadMetadata = {
|
|
|
139
163
|
if (object.proposed_at !== undefined && object.proposed_at !== null) {
|
|
140
164
|
message.proposedAt = BigInt(object.proposed_at);
|
|
141
165
|
}
|
|
166
|
+
if (object.proposal_extended !== undefined && object.proposal_extended !== null) {
|
|
167
|
+
message.proposalExtended = object.proposal_extended;
|
|
168
|
+
}
|
|
169
|
+
if (object.proposal_fire_at !== undefined && object.proposal_fire_at !== null) {
|
|
170
|
+
message.proposalFireAt = BigInt(object.proposal_fire_at);
|
|
171
|
+
}
|
|
142
172
|
message.pinnedReplyIds = object.pinned_reply_ids?.map(e => BigInt(e)) || [];
|
|
143
173
|
message.pinnedRecords = object.pinned_records?.map(e => PinnedReplyRecord.fromAmino(e)) || [];
|
|
174
|
+
if (object.proposals_locked !== undefined && object.proposals_locked !== null) {
|
|
175
|
+
message.proposalsLocked = object.proposals_locked;
|
|
176
|
+
}
|
|
144
177
|
return message;
|
|
145
178
|
},
|
|
146
179
|
toAmino(message) {
|
|
@@ -152,6 +185,8 @@ export const ThreadMetadata = {
|
|
|
152
185
|
obj.proposed_reply_id = message.proposedReplyId !== BigInt(0) ? message.proposedReplyId?.toString() : undefined;
|
|
153
186
|
obj.proposed_by = message.proposedBy === "" ? undefined : message.proposedBy;
|
|
154
187
|
obj.proposed_at = message.proposedAt !== BigInt(0) ? message.proposedAt?.toString() : undefined;
|
|
188
|
+
obj.proposal_extended = message.proposalExtended === false ? undefined : message.proposalExtended;
|
|
189
|
+
obj.proposal_fire_at = message.proposalFireAt !== BigInt(0) ? message.proposalFireAt?.toString() : undefined;
|
|
155
190
|
if (message.pinnedReplyIds) {
|
|
156
191
|
obj.pinned_reply_ids = message.pinnedReplyIds.map(e => e.toString());
|
|
157
192
|
}
|
|
@@ -164,6 +199,7 @@ export const ThreadMetadata = {
|
|
|
164
199
|
else {
|
|
165
200
|
obj.pinned_records = message.pinnedRecords;
|
|
166
201
|
}
|
|
202
|
+
obj.proposals_locked = message.proposalsLocked === false ? undefined : message.proposalsLocked;
|
|
167
203
|
return obj;
|
|
168
204
|
},
|
|
169
205
|
fromAminoMsg(object) {
|