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