@sparkdreamnft/sparkdreamjs 0.0.39 → 0.0.41

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.
@@ -1,6 +1,6 @@
1
1
  //@ts-nocheck
2
2
  import { Params } from "./params";
3
- import { Peer, PeerPolicy, BridgeBinding, FederatedContent, IdentityLink, ReputationAttestation, OutboundAttestation, VerificationRecord } from "./types";
3
+ import { Peer, PeerPolicy, BridgeBinding, FederatedContent, IdentityLink, ReputationAttestation, OutboundAttestation, VerificationRecord, EscalatedChallenge, ArbiterHashSubmission } from "./types";
4
4
  import { VerifierActivity } from "./verifier_activity";
5
5
  import { BinaryReader, BinaryWriter } from "../../../binary";
6
6
  function createBaseGenesisState() {
@@ -18,7 +18,16 @@ function createBaseGenesisState() {
18
18
  verificationRecords: [],
19
19
  nextContentId: BigInt(0),
20
20
  nextOutboundAttestationId: BigInt(0),
21
- operatorRewardDayFundingList: []
21
+ operatorRewardDayFundingList: [],
22
+ verificationWindowQueue: [],
23
+ challengeWindowQueue: [],
24
+ arbiterResolutionQueue: [],
25
+ arbiterEscalationQueue: [],
26
+ escalatedChallenges: [],
27
+ escalatedChallengeDeadlineQueue: [],
28
+ arbiterSubmissions: [],
29
+ arbiterHashCounts: [],
30
+ nextArbiterAnonSubmissionId: BigInt(0)
22
31
  };
23
32
  }
24
33
  /**
@@ -72,6 +81,33 @@ export const GenesisState = {
72
81
  for (const v of message.operatorRewardDayFundingList) {
73
82
  OperatorRewardDayFunding.encode(v, writer.uint32(114).fork()).ldelim();
74
83
  }
84
+ for (const v of message.verificationWindowQueue) {
85
+ ContentDeadline.encode(v, writer.uint32(122).fork()).ldelim();
86
+ }
87
+ for (const v of message.challengeWindowQueue) {
88
+ ContentDeadline.encode(v, writer.uint32(130).fork()).ldelim();
89
+ }
90
+ for (const v of message.arbiterResolutionQueue) {
91
+ ContentDeadline.encode(v, writer.uint32(138).fork()).ldelim();
92
+ }
93
+ for (const v of message.arbiterEscalationQueue) {
94
+ ContentDeadline.encode(v, writer.uint32(146).fork()).ldelim();
95
+ }
96
+ for (const v of message.escalatedChallenges) {
97
+ EscalatedChallenge.encode(v, writer.uint32(154).fork()).ldelim();
98
+ }
99
+ for (const v of message.escalatedChallengeDeadlineQueue) {
100
+ ContentDeadline.encode(v, writer.uint32(162).fork()).ldelim();
101
+ }
102
+ for (const v of message.arbiterSubmissions) {
103
+ ArbiterSubmissionEntry.encode(v, writer.uint32(170).fork()).ldelim();
104
+ }
105
+ for (const v of message.arbiterHashCounts) {
106
+ ArbiterHashCount.encode(v, writer.uint32(178).fork()).ldelim();
107
+ }
108
+ if (message.nextArbiterAnonSubmissionId !== BigInt(0)) {
109
+ writer.uint32(184).uint64(message.nextArbiterAnonSubmissionId);
110
+ }
75
111
  return writer;
76
112
  },
77
113
  decode(input, length) {
@@ -123,6 +159,33 @@ export const GenesisState = {
123
159
  case 14:
124
160
  message.operatorRewardDayFundingList.push(OperatorRewardDayFunding.decode(reader, reader.uint32()));
125
161
  break;
162
+ case 15:
163
+ message.verificationWindowQueue.push(ContentDeadline.decode(reader, reader.uint32()));
164
+ break;
165
+ case 16:
166
+ message.challengeWindowQueue.push(ContentDeadline.decode(reader, reader.uint32()));
167
+ break;
168
+ case 17:
169
+ message.arbiterResolutionQueue.push(ContentDeadline.decode(reader, reader.uint32()));
170
+ break;
171
+ case 18:
172
+ message.arbiterEscalationQueue.push(ContentDeadline.decode(reader, reader.uint32()));
173
+ break;
174
+ case 19:
175
+ message.escalatedChallenges.push(EscalatedChallenge.decode(reader, reader.uint32()));
176
+ break;
177
+ case 20:
178
+ message.escalatedChallengeDeadlineQueue.push(ContentDeadline.decode(reader, reader.uint32()));
179
+ break;
180
+ case 21:
181
+ message.arbiterSubmissions.push(ArbiterSubmissionEntry.decode(reader, reader.uint32()));
182
+ break;
183
+ case 22:
184
+ message.arbiterHashCounts.push(ArbiterHashCount.decode(reader, reader.uint32()));
185
+ break;
186
+ case 23:
187
+ message.nextArbiterAnonSubmissionId = reader.uint64();
188
+ break;
126
189
  default:
127
190
  reader.skipType(tag & 7);
128
191
  break;
@@ -146,6 +209,15 @@ export const GenesisState = {
146
209
  message.nextContentId = object.nextContentId !== undefined && object.nextContentId !== null ? BigInt(object.nextContentId.toString()) : BigInt(0);
147
210
  message.nextOutboundAttestationId = object.nextOutboundAttestationId !== undefined && object.nextOutboundAttestationId !== null ? BigInt(object.nextOutboundAttestationId.toString()) : BigInt(0);
148
211
  message.operatorRewardDayFundingList = object.operatorRewardDayFundingList?.map(e => OperatorRewardDayFunding.fromPartial(e)) || [];
212
+ message.verificationWindowQueue = object.verificationWindowQueue?.map(e => ContentDeadline.fromPartial(e)) || [];
213
+ message.challengeWindowQueue = object.challengeWindowQueue?.map(e => ContentDeadline.fromPartial(e)) || [];
214
+ message.arbiterResolutionQueue = object.arbiterResolutionQueue?.map(e => ContentDeadline.fromPartial(e)) || [];
215
+ message.arbiterEscalationQueue = object.arbiterEscalationQueue?.map(e => ContentDeadline.fromPartial(e)) || [];
216
+ message.escalatedChallenges = object.escalatedChallenges?.map(e => EscalatedChallenge.fromPartial(e)) || [];
217
+ message.escalatedChallengeDeadlineQueue = object.escalatedChallengeDeadlineQueue?.map(e => ContentDeadline.fromPartial(e)) || [];
218
+ message.arbiterSubmissions = object.arbiterSubmissions?.map(e => ArbiterSubmissionEntry.fromPartial(e)) || [];
219
+ message.arbiterHashCounts = object.arbiterHashCounts?.map(e => ArbiterHashCount.fromPartial(e)) || [];
220
+ message.nextArbiterAnonSubmissionId = object.nextArbiterAnonSubmissionId !== undefined && object.nextArbiterAnonSubmissionId !== null ? BigInt(object.nextArbiterAnonSubmissionId.toString()) : BigInt(0);
149
221
  return message;
150
222
  },
151
223
  fromAmino(object) {
@@ -172,6 +244,17 @@ export const GenesisState = {
172
244
  message.nextOutboundAttestationId = BigInt(object.next_outbound_attestation_id);
173
245
  }
174
246
  message.operatorRewardDayFundingList = object.operator_reward_day_funding_list?.map(e => OperatorRewardDayFunding.fromAmino(e)) || [];
247
+ message.verificationWindowQueue = object.verification_window_queue?.map(e => ContentDeadline.fromAmino(e)) || [];
248
+ message.challengeWindowQueue = object.challenge_window_queue?.map(e => ContentDeadline.fromAmino(e)) || [];
249
+ message.arbiterResolutionQueue = object.arbiter_resolution_queue?.map(e => ContentDeadline.fromAmino(e)) || [];
250
+ message.arbiterEscalationQueue = object.arbiter_escalation_queue?.map(e => ContentDeadline.fromAmino(e)) || [];
251
+ message.escalatedChallenges = object.escalated_challenges?.map(e => EscalatedChallenge.fromAmino(e)) || [];
252
+ message.escalatedChallengeDeadlineQueue = object.escalated_challenge_deadline_queue?.map(e => ContentDeadline.fromAmino(e)) || [];
253
+ message.arbiterSubmissions = object.arbiter_submissions?.map(e => ArbiterSubmissionEntry.fromAmino(e)) || [];
254
+ message.arbiterHashCounts = object.arbiter_hash_counts?.map(e => ArbiterHashCount.fromAmino(e)) || [];
255
+ if (object.next_arbiter_anon_submission_id !== undefined && object.next_arbiter_anon_submission_id !== null) {
256
+ message.nextArbiterAnonSubmissionId = BigInt(object.next_arbiter_anon_submission_id);
257
+ }
175
258
  return message;
176
259
  },
177
260
  toAmino(message) {
@@ -240,6 +323,55 @@ export const GenesisState = {
240
323
  else {
241
324
  obj.operator_reward_day_funding_list = message.operatorRewardDayFundingList;
242
325
  }
326
+ if (message.verificationWindowQueue) {
327
+ obj.verification_window_queue = message.verificationWindowQueue.map(e => e ? ContentDeadline.toAmino(e) : undefined);
328
+ }
329
+ else {
330
+ obj.verification_window_queue = message.verificationWindowQueue;
331
+ }
332
+ if (message.challengeWindowQueue) {
333
+ obj.challenge_window_queue = message.challengeWindowQueue.map(e => e ? ContentDeadline.toAmino(e) : undefined);
334
+ }
335
+ else {
336
+ obj.challenge_window_queue = message.challengeWindowQueue;
337
+ }
338
+ if (message.arbiterResolutionQueue) {
339
+ obj.arbiter_resolution_queue = message.arbiterResolutionQueue.map(e => e ? ContentDeadline.toAmino(e) : undefined);
340
+ }
341
+ else {
342
+ obj.arbiter_resolution_queue = message.arbiterResolutionQueue;
343
+ }
344
+ if (message.arbiterEscalationQueue) {
345
+ obj.arbiter_escalation_queue = message.arbiterEscalationQueue.map(e => e ? ContentDeadline.toAmino(e) : undefined);
346
+ }
347
+ else {
348
+ obj.arbiter_escalation_queue = message.arbiterEscalationQueue;
349
+ }
350
+ if (message.escalatedChallenges) {
351
+ obj.escalated_challenges = message.escalatedChallenges.map(e => e ? EscalatedChallenge.toAmino(e) : undefined);
352
+ }
353
+ else {
354
+ obj.escalated_challenges = message.escalatedChallenges;
355
+ }
356
+ if (message.escalatedChallengeDeadlineQueue) {
357
+ obj.escalated_challenge_deadline_queue = message.escalatedChallengeDeadlineQueue.map(e => e ? ContentDeadline.toAmino(e) : undefined);
358
+ }
359
+ else {
360
+ obj.escalated_challenge_deadline_queue = message.escalatedChallengeDeadlineQueue;
361
+ }
362
+ if (message.arbiterSubmissions) {
363
+ obj.arbiter_submissions = message.arbiterSubmissions.map(e => e ? ArbiterSubmissionEntry.toAmino(e) : undefined);
364
+ }
365
+ else {
366
+ obj.arbiter_submissions = message.arbiterSubmissions;
367
+ }
368
+ if (message.arbiterHashCounts) {
369
+ obj.arbiter_hash_counts = message.arbiterHashCounts.map(e => e ? ArbiterHashCount.toAmino(e) : undefined);
370
+ }
371
+ else {
372
+ obj.arbiter_hash_counts = message.arbiterHashCounts;
373
+ }
374
+ obj.next_arbiter_anon_submission_id = message.nextArbiterAnonSubmissionId !== BigInt(0) ? message.nextArbiterAnonSubmissionId?.toString() : undefined;
243
375
  return obj;
244
376
  },
245
377
  fromAminoMsg(object) {
@@ -258,6 +390,269 @@ export const GenesisState = {
258
390
  };
259
391
  }
260
392
  };
393
+ function createBaseContentDeadline() {
394
+ return {
395
+ deadline: BigInt(0),
396
+ contentId: BigInt(0)
397
+ };
398
+ }
399
+ /**
400
+ * ContentDeadline is one (deadline, content_id) entry of a federation
401
+ * EndBlocker time queue. All four verification-lifecycle queues share this
402
+ * shape, so they share this message.
403
+ * @name ContentDeadline
404
+ * @package sparkdream.federation.v1
405
+ * @see proto type: sparkdream.federation.v1.ContentDeadline
406
+ */
407
+ export const ContentDeadline = {
408
+ typeUrl: "/sparkdream.federation.v1.ContentDeadline",
409
+ encode(message, writer = BinaryWriter.create()) {
410
+ if (message.deadline !== BigInt(0)) {
411
+ writer.uint32(8).int64(message.deadline);
412
+ }
413
+ if (message.contentId !== BigInt(0)) {
414
+ writer.uint32(16).uint64(message.contentId);
415
+ }
416
+ return writer;
417
+ },
418
+ decode(input, length) {
419
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
420
+ let end = length === undefined ? reader.len : reader.pos + length;
421
+ const message = createBaseContentDeadline();
422
+ while (reader.pos < end) {
423
+ const tag = reader.uint32();
424
+ switch (tag >>> 3) {
425
+ case 1:
426
+ message.deadline = reader.int64();
427
+ break;
428
+ case 2:
429
+ message.contentId = reader.uint64();
430
+ break;
431
+ default:
432
+ reader.skipType(tag & 7);
433
+ break;
434
+ }
435
+ }
436
+ return message;
437
+ },
438
+ fromPartial(object) {
439
+ const message = createBaseContentDeadline();
440
+ message.deadline = object.deadline !== undefined && object.deadline !== null ? BigInt(object.deadline.toString()) : BigInt(0);
441
+ message.contentId = object.contentId !== undefined && object.contentId !== null ? BigInt(object.contentId.toString()) : BigInt(0);
442
+ return message;
443
+ },
444
+ fromAmino(object) {
445
+ const message = createBaseContentDeadline();
446
+ if (object.deadline !== undefined && object.deadline !== null) {
447
+ message.deadline = BigInt(object.deadline);
448
+ }
449
+ if (object.content_id !== undefined && object.content_id !== null) {
450
+ message.contentId = BigInt(object.content_id);
451
+ }
452
+ return message;
453
+ },
454
+ toAmino(message) {
455
+ const obj = {};
456
+ obj.deadline = message.deadline !== BigInt(0) ? message.deadline?.toString() : undefined;
457
+ obj.content_id = message.contentId !== BigInt(0) ? message.contentId?.toString() : undefined;
458
+ return obj;
459
+ },
460
+ fromAminoMsg(object) {
461
+ return ContentDeadline.fromAmino(object.value);
462
+ },
463
+ fromProtoMsg(message) {
464
+ return ContentDeadline.decode(message.value);
465
+ },
466
+ toProto(message) {
467
+ return ContentDeadline.encode(message).finish();
468
+ },
469
+ toProtoMsg(message) {
470
+ return {
471
+ typeUrl: "/sparkdream.federation.v1.ContentDeadline",
472
+ value: ContentDeadline.encode(message).finish()
473
+ };
474
+ }
475
+ };
476
+ function createBaseArbiterSubmissionEntry() {
477
+ return {
478
+ submitterKey: "",
479
+ submission: ArbiterHashSubmission.fromPartial({})
480
+ };
481
+ }
482
+ /**
483
+ * ArbiterSubmissionEntry is one ArbiterSubmissions map entry. The submitter
484
+ * key is part of the STATE key rather than of ArbiterHashSubmission —
485
+ * identified arbiters key by bech32 address, anonymous ones by "anon:<seq>"
486
+ * (where the Operator field holds the shield module address instead) — so it
487
+ * must be exported alongside the value or the "no double vote per operator"
488
+ * rule cannot be reconstructed.
489
+ * @name ArbiterSubmissionEntry
490
+ * @package sparkdream.federation.v1
491
+ * @see proto type: sparkdream.federation.v1.ArbiterSubmissionEntry
492
+ */
493
+ export const ArbiterSubmissionEntry = {
494
+ typeUrl: "/sparkdream.federation.v1.ArbiterSubmissionEntry",
495
+ encode(message, writer = BinaryWriter.create()) {
496
+ if (message.submitterKey !== "") {
497
+ writer.uint32(10).string(message.submitterKey);
498
+ }
499
+ if (message.submission !== undefined) {
500
+ ArbiterHashSubmission.encode(message.submission, writer.uint32(18).fork()).ldelim();
501
+ }
502
+ return writer;
503
+ },
504
+ decode(input, length) {
505
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
506
+ let end = length === undefined ? reader.len : reader.pos + length;
507
+ const message = createBaseArbiterSubmissionEntry();
508
+ while (reader.pos < end) {
509
+ const tag = reader.uint32();
510
+ switch (tag >>> 3) {
511
+ case 1:
512
+ message.submitterKey = reader.string();
513
+ break;
514
+ case 2:
515
+ message.submission = ArbiterHashSubmission.decode(reader, reader.uint32());
516
+ break;
517
+ default:
518
+ reader.skipType(tag & 7);
519
+ break;
520
+ }
521
+ }
522
+ return message;
523
+ },
524
+ fromPartial(object) {
525
+ const message = createBaseArbiterSubmissionEntry();
526
+ message.submitterKey = object.submitterKey ?? "";
527
+ message.submission = object.submission !== undefined && object.submission !== null ? ArbiterHashSubmission.fromPartial(object.submission) : undefined;
528
+ return message;
529
+ },
530
+ fromAmino(object) {
531
+ const message = createBaseArbiterSubmissionEntry();
532
+ if (object.submitter_key !== undefined && object.submitter_key !== null) {
533
+ message.submitterKey = object.submitter_key;
534
+ }
535
+ if (object.submission !== undefined && object.submission !== null) {
536
+ message.submission = ArbiterHashSubmission.fromAmino(object.submission);
537
+ }
538
+ return message;
539
+ },
540
+ toAmino(message) {
541
+ const obj = {};
542
+ obj.submitter_key = message.submitterKey === "" ? undefined : message.submitterKey;
543
+ obj.submission = message.submission ? ArbiterHashSubmission.toAmino(message.submission) : undefined;
544
+ return obj;
545
+ },
546
+ fromAminoMsg(object) {
547
+ return ArbiterSubmissionEntry.fromAmino(object.value);
548
+ },
549
+ fromProtoMsg(message) {
550
+ return ArbiterSubmissionEntry.decode(message.value);
551
+ },
552
+ toProto(message) {
553
+ return ArbiterSubmissionEntry.encode(message).finish();
554
+ },
555
+ toProtoMsg(message) {
556
+ return {
557
+ typeUrl: "/sparkdream.federation.v1.ArbiterSubmissionEntry",
558
+ value: ArbiterSubmissionEntry.encode(message).finish()
559
+ };
560
+ }
561
+ };
562
+ function createBaseArbiterHashCount() {
563
+ return {
564
+ contentId: BigInt(0),
565
+ contentHash: "",
566
+ count: 0
567
+ };
568
+ }
569
+ /**
570
+ * ArbiterHashCount is one (content_id, content_hash) -> votes tally from the
571
+ * arbiter quorum counter.
572
+ * @name ArbiterHashCount
573
+ * @package sparkdream.federation.v1
574
+ * @see proto type: sparkdream.federation.v1.ArbiterHashCount
575
+ */
576
+ export const ArbiterHashCount = {
577
+ typeUrl: "/sparkdream.federation.v1.ArbiterHashCount",
578
+ encode(message, writer = BinaryWriter.create()) {
579
+ if (message.contentId !== BigInt(0)) {
580
+ writer.uint32(8).uint64(message.contentId);
581
+ }
582
+ if (message.contentHash !== "") {
583
+ writer.uint32(18).string(message.contentHash);
584
+ }
585
+ if (message.count !== 0) {
586
+ writer.uint32(24).uint32(message.count);
587
+ }
588
+ return writer;
589
+ },
590
+ decode(input, length) {
591
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
592
+ let end = length === undefined ? reader.len : reader.pos + length;
593
+ const message = createBaseArbiterHashCount();
594
+ while (reader.pos < end) {
595
+ const tag = reader.uint32();
596
+ switch (tag >>> 3) {
597
+ case 1:
598
+ message.contentId = reader.uint64();
599
+ break;
600
+ case 2:
601
+ message.contentHash = reader.string();
602
+ break;
603
+ case 3:
604
+ message.count = reader.uint32();
605
+ break;
606
+ default:
607
+ reader.skipType(tag & 7);
608
+ break;
609
+ }
610
+ }
611
+ return message;
612
+ },
613
+ fromPartial(object) {
614
+ const message = createBaseArbiterHashCount();
615
+ message.contentId = object.contentId !== undefined && object.contentId !== null ? BigInt(object.contentId.toString()) : BigInt(0);
616
+ message.contentHash = object.contentHash ?? "";
617
+ message.count = object.count ?? 0;
618
+ return message;
619
+ },
620
+ fromAmino(object) {
621
+ const message = createBaseArbiterHashCount();
622
+ if (object.content_id !== undefined && object.content_id !== null) {
623
+ message.contentId = BigInt(object.content_id);
624
+ }
625
+ if (object.content_hash !== undefined && object.content_hash !== null) {
626
+ message.contentHash = object.content_hash;
627
+ }
628
+ if (object.count !== undefined && object.count !== null) {
629
+ message.count = object.count;
630
+ }
631
+ return message;
632
+ },
633
+ toAmino(message) {
634
+ const obj = {};
635
+ obj.content_id = message.contentId !== BigInt(0) ? message.contentId?.toString() : undefined;
636
+ obj.content_hash = message.contentHash === "" ? undefined : message.contentHash;
637
+ obj.count = message.count === 0 ? undefined : message.count;
638
+ return obj;
639
+ },
640
+ fromAminoMsg(object) {
641
+ return ArbiterHashCount.fromAmino(object.value);
642
+ },
643
+ fromProtoMsg(message) {
644
+ return ArbiterHashCount.decode(message.value);
645
+ },
646
+ toProto(message) {
647
+ return ArbiterHashCount.encode(message).finish();
648
+ },
649
+ toProtoMsg(message) {
650
+ return {
651
+ typeUrl: "/sparkdream.federation.v1.ArbiterHashCount",
652
+ value: ArbiterHashCount.encode(message).finish()
653
+ };
654
+ }
655
+ };
261
656
  function createBaseOperatorRewardDayFunding() {
262
657
  return {
263
658
  day: BigInt(0),