@sparkdreamnft/sparkdreamjs 0.0.18 → 0.0.20
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/blog/v1/params.js +62 -2
- package/esm/sparkdream/blog/v1/tx.js +583 -2
- package/esm/sparkdream/blog/v1/tx.registry.js +74 -2
- package/esm/sparkdream/blog/v1/tx.rpc.msg.js +33 -3
- package/esm/sparkdream/collect/v1/params.js +109 -1
- package/esm/sparkdream/collect/v1/tx.js +293 -1
- package/esm/sparkdream/collect/v1/tx.registry.js +38 -2
- package/esm/sparkdream/collect/v1/tx.rpc.msg.js +17 -2
- package/esm/sparkdream/collect/v1/types.js +135 -3
- package/esm/sparkdream/forum/v1/params.js +218 -2
- package/esm/sparkdream/forum/v1/post.js +25 -1
- package/esm/sparkdream/forum/v1/query.js +469 -0
- package/esm/sparkdream/forum/v1/query.lcd.js +30 -0
- package/esm/sparkdream/forum/v1/query.rpc.Query.js +31 -1
- package/esm/sparkdream/forum/v1/tx.js +460 -0
- package/esm/sparkdream/forum/v1/tx.registry.js +56 -2
- package/esm/sparkdream/forum/v1/tx.rpc.msg.js +30 -1
- package/esm/sparkdream/forum/v1/types.js +355 -0
- package/esm/sparkdream/forum/v1/user_rate_limit.js +41 -2
- package/esm/sparkdream/rep/v1/member.js +209 -1
- package/esm/sparkdream/rep/v1/query.js +13 -22
- package/package.json +1 -1
- package/sparkdream/blog/v1/params.d.ts +52 -0
- package/sparkdream/blog/v1/params.js +62 -2
- package/sparkdream/blog/v1/tx.d.ts +381 -6
- package/sparkdream/blog/v1/tx.js +584 -3
- package/sparkdream/blog/v1/tx.registry.d.ts +49 -1
- package/sparkdream/blog/v1/tx.registry.js +73 -1
- package/sparkdream/blog/v1/tx.rpc.msg.d.ts +27 -3
- package/sparkdream/blog/v1/tx.rpc.msg.js +32 -2
- package/sparkdream/bundle.d.ts +474 -0
- package/sparkdream/collect/v1/params.d.ts +124 -0
- package/sparkdream/collect/v1/params.js +109 -1
- package/sparkdream/collect/v1/tx.d.ts +195 -3
- package/sparkdream/collect/v1/tx.js +294 -2
- package/sparkdream/collect/v1/tx.registry.d.ts +25 -1
- package/sparkdream/collect/v1/tx.registry.js +37 -1
- package/sparkdream/collect/v1/tx.rpc.msg.d.ts +15 -2
- package/sparkdream/collect/v1/tx.rpc.msg.js +16 -1
- package/sparkdream/collect/v1/types.d.ts +112 -0
- package/sparkdream/collect/v1/types.js +135 -3
- package/sparkdream/forum/v1/params.d.ts +210 -0
- package/sparkdream/forum/v1/params.js +218 -2
- package/sparkdream/forum/v1/post.d.ts +28 -0
- package/sparkdream/forum/v1/post.js +25 -1
- package/sparkdream/forum/v1/query.d.ts +273 -0
- package/sparkdream/forum/v1/query.js +470 -1
- package/sparkdream/forum/v1/query.lcd.d.ts +4 -1
- package/sparkdream/forum/v1/query.lcd.js +30 -0
- package/sparkdream/forum/v1/query.rpc.Query.d.ts +18 -1
- package/sparkdream/forum/v1/query.rpc.Query.js +30 -0
- package/sparkdream/forum/v1/tx.d.ts +291 -0
- package/sparkdream/forum/v1/tx.js +462 -2
- package/sparkdream/forum/v1/tx.registry.d.ts +37 -1
- package/sparkdream/forum/v1/tx.registry.js +55 -1
- package/sparkdream/forum/v1/tx.rpc.msg.d.ts +27 -1
- package/sparkdream/forum/v1/tx.rpc.msg.js +29 -0
- package/sparkdream/forum/v1/types.d.ts +247 -0
- package/sparkdream/forum/v1/types.js +356 -1
- package/sparkdream/forum/v1/user_rate_limit.d.ts +24 -3
- package/sparkdream/forum/v1/user_rate_limit.js +41 -2
- package/sparkdream/rep/v1/member.d.ts +134 -0
- package/sparkdream/rep/v1/member.js +210 -2
- package/sparkdream/rep/v1/query.d.ts +2 -4
- package/sparkdream/rep/v1/query.js +13 -22
- package/sparkdream/rpc.query.d.ts +3 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PinnedReplyRecord = exports.BountyAward = exports.ModerationSourceAmino = exports.ModerationSource = exports.ModerationActionTypeAmino = exports.ModerationActionType = exports.BountyStatusAmino = exports.BountyStatus = exports.PostStatusAmino = exports.PostStatus = void 0;
|
|
3
|
+
exports.PostConvictionStake = exports.PostConvictionStake_AccruedRepPerTagEntry = exports.ForumRepEpochCounter = exports.PinnedReplyRecord = exports.BountyAward = exports.ModerationSourceAmino = exports.ModerationSource = exports.ModerationActionTypeAmino = exports.ModerationActionType = exports.BountyStatusAmino = exports.BountyStatus = exports.PostStatusAmino = exports.PostStatus = void 0;
|
|
4
4
|
exports.postStatusFromJSON = postStatusFromJSON;
|
|
5
5
|
exports.postStatusToJSON = postStatusToJSON;
|
|
6
6
|
exports.bountyStatusFromJSON = bountyStatusFromJSON;
|
|
@@ -11,6 +11,7 @@ exports.moderationSourceFromJSON = moderationSourceFromJSON;
|
|
|
11
11
|
exports.moderationSourceToJSON = moderationSourceToJSON;
|
|
12
12
|
//@ts-nocheck
|
|
13
13
|
const binary_1 = require("../../../binary");
|
|
14
|
+
const math_1 = require("@interchainjs/math");
|
|
14
15
|
/** PostStatus represents the status of a post. */
|
|
15
16
|
var PostStatus;
|
|
16
17
|
(function (PostStatus) {
|
|
@@ -551,3 +552,357 @@ exports.PinnedReplyRecord = {
|
|
|
551
552
|
};
|
|
552
553
|
}
|
|
553
554
|
};
|
|
555
|
+
function createBaseForumRepEpochCounter() {
|
|
556
|
+
return {
|
|
557
|
+
epochId: BigInt(0),
|
|
558
|
+
accumulated: ""
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* ForumRepEpochCounter tracks how much forum reputation a single author has
|
|
563
|
+
* earned in a single tag during the current UTC-day epoch. Reset implicitly
|
|
564
|
+
* by comparing epoch_id to floor(block_time / 86400) on read — when the
|
|
565
|
+
* stored epoch_id is stale, the accumulated counter is treated as zero and
|
|
566
|
+
* overwritten on the next credit. Used by the post-conviction accrual loop
|
|
567
|
+
* to enforce Params.max_forum_rep_per_tag_per_epoch.
|
|
568
|
+
* @name ForumRepEpochCounter
|
|
569
|
+
* @package sparkdream.forum.v1
|
|
570
|
+
* @see proto type: sparkdream.forum.v1.ForumRepEpochCounter
|
|
571
|
+
*/
|
|
572
|
+
exports.ForumRepEpochCounter = {
|
|
573
|
+
typeUrl: "/sparkdream.forum.v1.ForumRepEpochCounter",
|
|
574
|
+
encode(message, writer = binary_1.BinaryWriter.create()) {
|
|
575
|
+
if (message.epochId !== BigInt(0)) {
|
|
576
|
+
writer.uint32(8).int64(message.epochId);
|
|
577
|
+
}
|
|
578
|
+
if (message.accumulated !== "") {
|
|
579
|
+
writer.uint32(18).string(math_1.Decimal.fromUserInput(message.accumulated, 18).atomics);
|
|
580
|
+
}
|
|
581
|
+
return writer;
|
|
582
|
+
},
|
|
583
|
+
decode(input, length) {
|
|
584
|
+
const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
|
|
585
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
586
|
+
const message = createBaseForumRepEpochCounter();
|
|
587
|
+
while (reader.pos < end) {
|
|
588
|
+
const tag = reader.uint32();
|
|
589
|
+
switch (tag >>> 3) {
|
|
590
|
+
case 1:
|
|
591
|
+
message.epochId = reader.int64();
|
|
592
|
+
break;
|
|
593
|
+
case 2:
|
|
594
|
+
message.accumulated = math_1.Decimal.fromAtomics(reader.string(), 18).toString();
|
|
595
|
+
break;
|
|
596
|
+
default:
|
|
597
|
+
reader.skipType(tag & 7);
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
return message;
|
|
602
|
+
},
|
|
603
|
+
fromPartial(object) {
|
|
604
|
+
const message = createBaseForumRepEpochCounter();
|
|
605
|
+
message.epochId = object.epochId !== undefined && object.epochId !== null ? BigInt(object.epochId.toString()) : BigInt(0);
|
|
606
|
+
message.accumulated = object.accumulated ?? "";
|
|
607
|
+
return message;
|
|
608
|
+
},
|
|
609
|
+
fromAmino(object) {
|
|
610
|
+
const message = createBaseForumRepEpochCounter();
|
|
611
|
+
if (object.epoch_id !== undefined && object.epoch_id !== null) {
|
|
612
|
+
message.epochId = BigInt(object.epoch_id);
|
|
613
|
+
}
|
|
614
|
+
if (object.accumulated !== undefined && object.accumulated !== null) {
|
|
615
|
+
message.accumulated = object.accumulated;
|
|
616
|
+
}
|
|
617
|
+
return message;
|
|
618
|
+
},
|
|
619
|
+
toAmino(message) {
|
|
620
|
+
const obj = {};
|
|
621
|
+
obj.epoch_id = message.epochId !== BigInt(0) ? message.epochId?.toString() : undefined;
|
|
622
|
+
obj.accumulated = message.accumulated === "" ? undefined : message.accumulated;
|
|
623
|
+
return obj;
|
|
624
|
+
},
|
|
625
|
+
fromAminoMsg(object) {
|
|
626
|
+
return exports.ForumRepEpochCounter.fromAmino(object.value);
|
|
627
|
+
},
|
|
628
|
+
fromProtoMsg(message) {
|
|
629
|
+
return exports.ForumRepEpochCounter.decode(message.value);
|
|
630
|
+
},
|
|
631
|
+
toProto(message) {
|
|
632
|
+
return exports.ForumRepEpochCounter.encode(message).finish();
|
|
633
|
+
},
|
|
634
|
+
toProtoMsg(message) {
|
|
635
|
+
return {
|
|
636
|
+
typeUrl: "/sparkdream.forum.v1.ForumRepEpochCounter",
|
|
637
|
+
value: exports.ForumRepEpochCounter.encode(message).finish()
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
function createBasePostConvictionStake_AccruedRepPerTagEntry() {
|
|
642
|
+
return {
|
|
643
|
+
key: "",
|
|
644
|
+
value: ""
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* @name PostConvictionStake_AccruedRepPerTagEntry
|
|
649
|
+
* @package sparkdream.forum.v1
|
|
650
|
+
* @see proto type: sparkdream.forum.v1.undefined
|
|
651
|
+
*/
|
|
652
|
+
exports.PostConvictionStake_AccruedRepPerTagEntry = {
|
|
653
|
+
encode(message, writer = binary_1.BinaryWriter.create()) {
|
|
654
|
+
if (message.key !== "") {
|
|
655
|
+
writer.uint32(10).string(message.key);
|
|
656
|
+
}
|
|
657
|
+
if (message.value !== "") {
|
|
658
|
+
writer.uint32(18).string(message.value);
|
|
659
|
+
}
|
|
660
|
+
return writer;
|
|
661
|
+
},
|
|
662
|
+
decode(input, length) {
|
|
663
|
+
const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
|
|
664
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
665
|
+
const message = createBasePostConvictionStake_AccruedRepPerTagEntry();
|
|
666
|
+
while (reader.pos < end) {
|
|
667
|
+
const tag = reader.uint32();
|
|
668
|
+
switch (tag >>> 3) {
|
|
669
|
+
case 1:
|
|
670
|
+
message.key = reader.string();
|
|
671
|
+
break;
|
|
672
|
+
case 2:
|
|
673
|
+
message.value = reader.string();
|
|
674
|
+
break;
|
|
675
|
+
default:
|
|
676
|
+
reader.skipType(tag & 7);
|
|
677
|
+
break;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return message;
|
|
681
|
+
},
|
|
682
|
+
fromPartial(object) {
|
|
683
|
+
const message = createBasePostConvictionStake_AccruedRepPerTagEntry();
|
|
684
|
+
message.key = object.key ?? "";
|
|
685
|
+
message.value = object.value ?? "";
|
|
686
|
+
return message;
|
|
687
|
+
},
|
|
688
|
+
fromAmino(object) {
|
|
689
|
+
const message = createBasePostConvictionStake_AccruedRepPerTagEntry();
|
|
690
|
+
if (object.key !== undefined && object.key !== null) {
|
|
691
|
+
message.key = object.key;
|
|
692
|
+
}
|
|
693
|
+
if (object.value !== undefined && object.value !== null) {
|
|
694
|
+
message.value = object.value;
|
|
695
|
+
}
|
|
696
|
+
return message;
|
|
697
|
+
},
|
|
698
|
+
toAmino(message) {
|
|
699
|
+
const obj = {};
|
|
700
|
+
obj.key = message.key === "" ? undefined : message.key;
|
|
701
|
+
obj.value = message.value === "" ? undefined : message.value;
|
|
702
|
+
return obj;
|
|
703
|
+
},
|
|
704
|
+
fromAminoMsg(object) {
|
|
705
|
+
return exports.PostConvictionStake_AccruedRepPerTagEntry.fromAmino(object.value);
|
|
706
|
+
},
|
|
707
|
+
fromProtoMsg(message) {
|
|
708
|
+
return exports.PostConvictionStake_AccruedRepPerTagEntry.decode(message.value);
|
|
709
|
+
},
|
|
710
|
+
toProto(message) {
|
|
711
|
+
return exports.PostConvictionStake_AccruedRepPerTagEntry.encode(message).finish();
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
function createBasePostConvictionStake() {
|
|
715
|
+
return {
|
|
716
|
+
id: BigInt(0),
|
|
717
|
+
staker: "",
|
|
718
|
+
postId: BigInt(0),
|
|
719
|
+
amount: "",
|
|
720
|
+
stakedAt: BigInt(0),
|
|
721
|
+
unlocksAt: BigInt(0),
|
|
722
|
+
accruedRepPerTag: {},
|
|
723
|
+
lastAccrualAt: BigInt(0),
|
|
724
|
+
released: false
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* PostConvictionStake records an ESTABLISHED+ member's DREAM lock backing a
|
|
729
|
+
* post's author. While the stake is active, the EndBlocker streams per-tag
|
|
730
|
+
* reputation to the author proportional to the stake's share of total active
|
|
731
|
+
* stakes on the post (split evenly across the post's tags). On confirmed
|
|
732
|
+
* sentinel hide (ExpireHiddenPosts), the accrued rep is clawed back from the
|
|
733
|
+
* author per tag and a fraction of the staker's locked DREAM is slashed
|
|
734
|
+
* (staker_slash_bps) — both staker and author endorsed harm.
|
|
735
|
+
*
|
|
736
|
+
* Stakers cannot stake on their own posts. Stakes are released after
|
|
737
|
+
* unlocks_at via MsgReleasePostConviction; LockDREAM/UnlockDREAM bypass the
|
|
738
|
+
* 3% transfer tax because it is internal member-balance rebalancing, not a
|
|
739
|
+
* transfer.
|
|
740
|
+
* @name PostConvictionStake
|
|
741
|
+
* @package sparkdream.forum.v1
|
|
742
|
+
* @see proto type: sparkdream.forum.v1.PostConvictionStake
|
|
743
|
+
*/
|
|
744
|
+
exports.PostConvictionStake = {
|
|
745
|
+
typeUrl: "/sparkdream.forum.v1.PostConvictionStake",
|
|
746
|
+
encode(message, writer = binary_1.BinaryWriter.create()) {
|
|
747
|
+
if (message.id !== BigInt(0)) {
|
|
748
|
+
writer.uint32(8).uint64(message.id);
|
|
749
|
+
}
|
|
750
|
+
if (message.staker !== "") {
|
|
751
|
+
writer.uint32(18).string(message.staker);
|
|
752
|
+
}
|
|
753
|
+
if (message.postId !== BigInt(0)) {
|
|
754
|
+
writer.uint32(24).uint64(message.postId);
|
|
755
|
+
}
|
|
756
|
+
if (message.amount !== "") {
|
|
757
|
+
writer.uint32(34).string(message.amount);
|
|
758
|
+
}
|
|
759
|
+
if (message.stakedAt !== BigInt(0)) {
|
|
760
|
+
writer.uint32(40).int64(message.stakedAt);
|
|
761
|
+
}
|
|
762
|
+
if (message.unlocksAt !== BigInt(0)) {
|
|
763
|
+
writer.uint32(48).int64(message.unlocksAt);
|
|
764
|
+
}
|
|
765
|
+
Object.entries(message.accruedRepPerTag).forEach(([key, value]) => {
|
|
766
|
+
exports.PostConvictionStake_AccruedRepPerTagEntry.encode({
|
|
767
|
+
key: key,
|
|
768
|
+
value
|
|
769
|
+
}, writer.uint32(58).fork()).ldelim();
|
|
770
|
+
});
|
|
771
|
+
if (message.lastAccrualAt !== BigInt(0)) {
|
|
772
|
+
writer.uint32(64).int64(message.lastAccrualAt);
|
|
773
|
+
}
|
|
774
|
+
if (message.released === true) {
|
|
775
|
+
writer.uint32(72).bool(message.released);
|
|
776
|
+
}
|
|
777
|
+
return writer;
|
|
778
|
+
},
|
|
779
|
+
decode(input, length) {
|
|
780
|
+
const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
|
|
781
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
782
|
+
const message = createBasePostConvictionStake();
|
|
783
|
+
while (reader.pos < end) {
|
|
784
|
+
const tag = reader.uint32();
|
|
785
|
+
switch (tag >>> 3) {
|
|
786
|
+
case 1:
|
|
787
|
+
message.id = reader.uint64();
|
|
788
|
+
break;
|
|
789
|
+
case 2:
|
|
790
|
+
message.staker = reader.string();
|
|
791
|
+
break;
|
|
792
|
+
case 3:
|
|
793
|
+
message.postId = reader.uint64();
|
|
794
|
+
break;
|
|
795
|
+
case 4:
|
|
796
|
+
message.amount = reader.string();
|
|
797
|
+
break;
|
|
798
|
+
case 5:
|
|
799
|
+
message.stakedAt = reader.int64();
|
|
800
|
+
break;
|
|
801
|
+
case 6:
|
|
802
|
+
message.unlocksAt = reader.int64();
|
|
803
|
+
break;
|
|
804
|
+
case 7:
|
|
805
|
+
const entry7 = exports.PostConvictionStake_AccruedRepPerTagEntry.decode(reader, reader.uint32());
|
|
806
|
+
if (entry7.value !== undefined) {
|
|
807
|
+
message.accruedRepPerTag[entry7.key] = entry7.value;
|
|
808
|
+
}
|
|
809
|
+
break;
|
|
810
|
+
case 8:
|
|
811
|
+
message.lastAccrualAt = reader.int64();
|
|
812
|
+
break;
|
|
813
|
+
case 9:
|
|
814
|
+
message.released = reader.bool();
|
|
815
|
+
break;
|
|
816
|
+
default:
|
|
817
|
+
reader.skipType(tag & 7);
|
|
818
|
+
break;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return message;
|
|
822
|
+
},
|
|
823
|
+
fromPartial(object) {
|
|
824
|
+
const message = createBasePostConvictionStake();
|
|
825
|
+
message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0);
|
|
826
|
+
message.staker = object.staker ?? "";
|
|
827
|
+
message.postId = object.postId !== undefined && object.postId !== null ? BigInt(object.postId.toString()) : BigInt(0);
|
|
828
|
+
message.amount = object.amount ?? "";
|
|
829
|
+
message.stakedAt = object.stakedAt !== undefined && object.stakedAt !== null ? BigInt(object.stakedAt.toString()) : BigInt(0);
|
|
830
|
+
message.unlocksAt = object.unlocksAt !== undefined && object.unlocksAt !== null ? BigInt(object.unlocksAt.toString()) : BigInt(0);
|
|
831
|
+
message.accruedRepPerTag = Object.entries(object.accruedRepPerTag ?? {}).reduce((acc, [key, value]) => {
|
|
832
|
+
if (value !== undefined) {
|
|
833
|
+
acc[key] = String(value);
|
|
834
|
+
}
|
|
835
|
+
return acc;
|
|
836
|
+
}, {});
|
|
837
|
+
message.lastAccrualAt = object.lastAccrualAt !== undefined && object.lastAccrualAt !== null ? BigInt(object.lastAccrualAt.toString()) : BigInt(0);
|
|
838
|
+
message.released = object.released ?? false;
|
|
839
|
+
return message;
|
|
840
|
+
},
|
|
841
|
+
fromAmino(object) {
|
|
842
|
+
const message = createBasePostConvictionStake();
|
|
843
|
+
if (object.id !== undefined && object.id !== null) {
|
|
844
|
+
message.id = BigInt(object.id);
|
|
845
|
+
}
|
|
846
|
+
if (object.staker !== undefined && object.staker !== null) {
|
|
847
|
+
message.staker = object.staker;
|
|
848
|
+
}
|
|
849
|
+
if (object.post_id !== undefined && object.post_id !== null) {
|
|
850
|
+
message.postId = BigInt(object.post_id);
|
|
851
|
+
}
|
|
852
|
+
if (object.amount !== undefined && object.amount !== null) {
|
|
853
|
+
message.amount = object.amount;
|
|
854
|
+
}
|
|
855
|
+
if (object.staked_at !== undefined && object.staked_at !== null) {
|
|
856
|
+
message.stakedAt = BigInt(object.staked_at);
|
|
857
|
+
}
|
|
858
|
+
if (object.unlocks_at !== undefined && object.unlocks_at !== null) {
|
|
859
|
+
message.unlocksAt = BigInt(object.unlocks_at);
|
|
860
|
+
}
|
|
861
|
+
message.accruedRepPerTag = Object.entries(object.accrued_rep_per_tag ?? {}).reduce((acc, [key, value]) => {
|
|
862
|
+
if (value !== undefined) {
|
|
863
|
+
acc[key] = String(value);
|
|
864
|
+
}
|
|
865
|
+
return acc;
|
|
866
|
+
}, {});
|
|
867
|
+
if (object.last_accrual_at !== undefined && object.last_accrual_at !== null) {
|
|
868
|
+
message.lastAccrualAt = BigInt(object.last_accrual_at);
|
|
869
|
+
}
|
|
870
|
+
if (object.released !== undefined && object.released !== null) {
|
|
871
|
+
message.released = object.released;
|
|
872
|
+
}
|
|
873
|
+
return message;
|
|
874
|
+
},
|
|
875
|
+
toAmino(message) {
|
|
876
|
+
const obj = {};
|
|
877
|
+
obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined;
|
|
878
|
+
obj.staker = message.staker === "" ? undefined : message.staker;
|
|
879
|
+
obj.post_id = message.postId !== BigInt(0) ? message.postId?.toString() : undefined;
|
|
880
|
+
obj.amount = message.amount === "" ? undefined : message.amount;
|
|
881
|
+
obj.staked_at = message.stakedAt !== BigInt(0) ? message.stakedAt?.toString() : undefined;
|
|
882
|
+
obj.unlocks_at = message.unlocksAt !== BigInt(0) ? message.unlocksAt?.toString() : undefined;
|
|
883
|
+
obj.accrued_rep_per_tag = {};
|
|
884
|
+
if (message.accruedRepPerTag) {
|
|
885
|
+
Object.entries(message.accruedRepPerTag).forEach(([k, v]) => {
|
|
886
|
+
obj.accrued_rep_per_tag[k] = v;
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
obj.last_accrual_at = message.lastAccrualAt !== BigInt(0) ? message.lastAccrualAt?.toString() : undefined;
|
|
890
|
+
obj.released = message.released === false ? undefined : message.released;
|
|
891
|
+
return obj;
|
|
892
|
+
},
|
|
893
|
+
fromAminoMsg(object) {
|
|
894
|
+
return exports.PostConvictionStake.fromAmino(object.value);
|
|
895
|
+
},
|
|
896
|
+
fromProtoMsg(message) {
|
|
897
|
+
return exports.PostConvictionStake.decode(message.value);
|
|
898
|
+
},
|
|
899
|
+
toProto(message) {
|
|
900
|
+
return exports.PostConvictionStake.encode(message).finish();
|
|
901
|
+
},
|
|
902
|
+
toProtoMsg(message) {
|
|
903
|
+
return {
|
|
904
|
+
typeUrl: "/sparkdream.forum.v1.PostConvictionStake",
|
|
905
|
+
value: exports.PostConvictionStake.encode(message).finish()
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "../../../binary";
|
|
2
2
|
import { DeepPartial } from "../../../helpers";
|
|
3
3
|
/**
|
|
4
|
-
* UserRateLimit defines the UserRateLimit message.
|
|
4
|
+
* UserRateLimit defines the UserRateLimit message. Counters are split by
|
|
5
|
+
* action class — the post counter (fields 2-5) bounds CreatePost, the
|
|
6
|
+
* make-permanent counter (fields 6-8) bounds MakePostPermanent. They are
|
|
7
|
+
* kept on the same record to avoid an extra collection lookup per call.
|
|
5
8
|
* @name UserRateLimit
|
|
6
9
|
* @package sparkdream.forum.v1
|
|
7
10
|
* @see proto type: sparkdream.forum.v1.UserRateLimit
|
|
@@ -12,13 +15,22 @@ export interface UserRateLimit {
|
|
|
12
15
|
previousEpochCount: bigint;
|
|
13
16
|
currentEpochStart: bigint;
|
|
14
17
|
lastPostTime: bigint;
|
|
18
|
+
/**
|
|
19
|
+
* MakePostPermanent sliding-window counters, mirrored from the post counter.
|
|
20
|
+
*/
|
|
21
|
+
makePermanentCurrentEpochCount: bigint;
|
|
22
|
+
makePermanentPreviousEpochCount: bigint;
|
|
23
|
+
makePermanentCurrentEpochStart: bigint;
|
|
15
24
|
}
|
|
16
25
|
export interface UserRateLimitProtoMsg {
|
|
17
26
|
typeUrl: "/sparkdream.forum.v1.UserRateLimit";
|
|
18
27
|
value: Uint8Array;
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
21
|
-
* UserRateLimit defines the UserRateLimit message.
|
|
30
|
+
* UserRateLimit defines the UserRateLimit message. Counters are split by
|
|
31
|
+
* action class — the post counter (fields 2-5) bounds CreatePost, the
|
|
32
|
+
* make-permanent counter (fields 6-8) bounds MakePostPermanent. They are
|
|
33
|
+
* kept on the same record to avoid an extra collection lookup per call.
|
|
22
34
|
* @name UserRateLimitAmino
|
|
23
35
|
* @package sparkdream.forum.v1
|
|
24
36
|
* @see proto type: sparkdream.forum.v1.UserRateLimit
|
|
@@ -29,13 +41,22 @@ export interface UserRateLimitAmino {
|
|
|
29
41
|
previous_epoch_count?: string;
|
|
30
42
|
current_epoch_start?: string;
|
|
31
43
|
last_post_time?: string;
|
|
44
|
+
/**
|
|
45
|
+
* MakePostPermanent sliding-window counters, mirrored from the post counter.
|
|
46
|
+
*/
|
|
47
|
+
make_permanent_current_epoch_count?: string;
|
|
48
|
+
make_permanent_previous_epoch_count?: string;
|
|
49
|
+
make_permanent_current_epoch_start?: string;
|
|
32
50
|
}
|
|
33
51
|
export interface UserRateLimitAminoMsg {
|
|
34
52
|
type: "/sparkdream.forum.v1.UserRateLimit";
|
|
35
53
|
value: UserRateLimitAmino;
|
|
36
54
|
}
|
|
37
55
|
/**
|
|
38
|
-
* UserRateLimit defines the UserRateLimit message.
|
|
56
|
+
* UserRateLimit defines the UserRateLimit message. Counters are split by
|
|
57
|
+
* action class — the post counter (fields 2-5) bounds CreatePost, the
|
|
58
|
+
* make-permanent counter (fields 6-8) bounds MakePostPermanent. They are
|
|
59
|
+
* kept on the same record to avoid an extra collection lookup per call.
|
|
39
60
|
* @name UserRateLimit
|
|
40
61
|
* @package sparkdream.forum.v1
|
|
41
62
|
* @see proto type: sparkdream.forum.v1.UserRateLimit
|
|
@@ -9,11 +9,17 @@ function createBaseUserRateLimit() {
|
|
|
9
9
|
currentEpochCount: BigInt(0),
|
|
10
10
|
previousEpochCount: BigInt(0),
|
|
11
11
|
currentEpochStart: BigInt(0),
|
|
12
|
-
lastPostTime: BigInt(0)
|
|
12
|
+
lastPostTime: BigInt(0),
|
|
13
|
+
makePermanentCurrentEpochCount: BigInt(0),
|
|
14
|
+
makePermanentPreviousEpochCount: BigInt(0),
|
|
15
|
+
makePermanentCurrentEpochStart: BigInt(0)
|
|
13
16
|
};
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
|
-
* UserRateLimit defines the UserRateLimit message.
|
|
19
|
+
* UserRateLimit defines the UserRateLimit message. Counters are split by
|
|
20
|
+
* action class — the post counter (fields 2-5) bounds CreatePost, the
|
|
21
|
+
* make-permanent counter (fields 6-8) bounds MakePostPermanent. They are
|
|
22
|
+
* kept on the same record to avoid an extra collection lookup per call.
|
|
17
23
|
* @name UserRateLimit
|
|
18
24
|
* @package sparkdream.forum.v1
|
|
19
25
|
* @see proto type: sparkdream.forum.v1.UserRateLimit
|
|
@@ -36,6 +42,15 @@ exports.UserRateLimit = {
|
|
|
36
42
|
if (message.lastPostTime !== BigInt(0)) {
|
|
37
43
|
writer.uint32(40).int64(message.lastPostTime);
|
|
38
44
|
}
|
|
45
|
+
if (message.makePermanentCurrentEpochCount !== BigInt(0)) {
|
|
46
|
+
writer.uint32(48).uint64(message.makePermanentCurrentEpochCount);
|
|
47
|
+
}
|
|
48
|
+
if (message.makePermanentPreviousEpochCount !== BigInt(0)) {
|
|
49
|
+
writer.uint32(56).uint64(message.makePermanentPreviousEpochCount);
|
|
50
|
+
}
|
|
51
|
+
if (message.makePermanentCurrentEpochStart !== BigInt(0)) {
|
|
52
|
+
writer.uint32(64).int64(message.makePermanentCurrentEpochStart);
|
|
53
|
+
}
|
|
39
54
|
return writer;
|
|
40
55
|
},
|
|
41
56
|
decode(input, length) {
|
|
@@ -60,6 +75,15 @@ exports.UserRateLimit = {
|
|
|
60
75
|
case 5:
|
|
61
76
|
message.lastPostTime = reader.int64();
|
|
62
77
|
break;
|
|
78
|
+
case 6:
|
|
79
|
+
message.makePermanentCurrentEpochCount = reader.uint64();
|
|
80
|
+
break;
|
|
81
|
+
case 7:
|
|
82
|
+
message.makePermanentPreviousEpochCount = reader.uint64();
|
|
83
|
+
break;
|
|
84
|
+
case 8:
|
|
85
|
+
message.makePermanentCurrentEpochStart = reader.int64();
|
|
86
|
+
break;
|
|
63
87
|
default:
|
|
64
88
|
reader.skipType(tag & 7);
|
|
65
89
|
break;
|
|
@@ -74,6 +98,9 @@ exports.UserRateLimit = {
|
|
|
74
98
|
message.previousEpochCount = object.previousEpochCount !== undefined && object.previousEpochCount !== null ? BigInt(object.previousEpochCount.toString()) : BigInt(0);
|
|
75
99
|
message.currentEpochStart = object.currentEpochStart !== undefined && object.currentEpochStart !== null ? BigInt(object.currentEpochStart.toString()) : BigInt(0);
|
|
76
100
|
message.lastPostTime = object.lastPostTime !== undefined && object.lastPostTime !== null ? BigInt(object.lastPostTime.toString()) : BigInt(0);
|
|
101
|
+
message.makePermanentCurrentEpochCount = object.makePermanentCurrentEpochCount !== undefined && object.makePermanentCurrentEpochCount !== null ? BigInt(object.makePermanentCurrentEpochCount.toString()) : BigInt(0);
|
|
102
|
+
message.makePermanentPreviousEpochCount = object.makePermanentPreviousEpochCount !== undefined && object.makePermanentPreviousEpochCount !== null ? BigInt(object.makePermanentPreviousEpochCount.toString()) : BigInt(0);
|
|
103
|
+
message.makePermanentCurrentEpochStart = object.makePermanentCurrentEpochStart !== undefined && object.makePermanentCurrentEpochStart !== null ? BigInt(object.makePermanentCurrentEpochStart.toString()) : BigInt(0);
|
|
77
104
|
return message;
|
|
78
105
|
},
|
|
79
106
|
fromAmino(object) {
|
|
@@ -93,6 +120,15 @@ exports.UserRateLimit = {
|
|
|
93
120
|
if (object.last_post_time !== undefined && object.last_post_time !== null) {
|
|
94
121
|
message.lastPostTime = BigInt(object.last_post_time);
|
|
95
122
|
}
|
|
123
|
+
if (object.make_permanent_current_epoch_count !== undefined && object.make_permanent_current_epoch_count !== null) {
|
|
124
|
+
message.makePermanentCurrentEpochCount = BigInt(object.make_permanent_current_epoch_count);
|
|
125
|
+
}
|
|
126
|
+
if (object.make_permanent_previous_epoch_count !== undefined && object.make_permanent_previous_epoch_count !== null) {
|
|
127
|
+
message.makePermanentPreviousEpochCount = BigInt(object.make_permanent_previous_epoch_count);
|
|
128
|
+
}
|
|
129
|
+
if (object.make_permanent_current_epoch_start !== undefined && object.make_permanent_current_epoch_start !== null) {
|
|
130
|
+
message.makePermanentCurrentEpochStart = BigInt(object.make_permanent_current_epoch_start);
|
|
131
|
+
}
|
|
96
132
|
return message;
|
|
97
133
|
},
|
|
98
134
|
toAmino(message) {
|
|
@@ -102,6 +138,9 @@ exports.UserRateLimit = {
|
|
|
102
138
|
obj.previous_epoch_count = message.previousEpochCount !== BigInt(0) ? message.previousEpochCount?.toString() : undefined;
|
|
103
139
|
obj.current_epoch_start = message.currentEpochStart !== BigInt(0) ? message.currentEpochStart?.toString() : undefined;
|
|
104
140
|
obj.last_post_time = message.lastPostTime !== BigInt(0) ? message.lastPostTime?.toString() : undefined;
|
|
141
|
+
obj.make_permanent_current_epoch_count = message.makePermanentCurrentEpochCount !== BigInt(0) ? message.makePermanentCurrentEpochCount?.toString() : undefined;
|
|
142
|
+
obj.make_permanent_previous_epoch_count = message.makePermanentPreviousEpochCount !== BigInt(0) ? message.makePermanentPreviousEpochCount?.toString() : undefined;
|
|
143
|
+
obj.make_permanent_current_epoch_start = message.makePermanentCurrentEpochStart !== BigInt(0) ? message.makePermanentCurrentEpochStart?.toString() : undefined;
|
|
105
144
|
return obj;
|
|
106
145
|
},
|
|
107
146
|
fromAminoMsg(object) {
|
|
@@ -98,6 +98,58 @@ export interface Member_ReputationGainedThisEpochEntryAminoMsg {
|
|
|
98
98
|
type: string;
|
|
99
99
|
value: Member_ReputationGainedThisEpochEntryAmino;
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* @name Member_ForumRepPerTagEntry
|
|
103
|
+
* @package sparkdream.rep.v1
|
|
104
|
+
* @see proto type: sparkdream.rep.v1.undefined
|
|
105
|
+
*/
|
|
106
|
+
export interface Member_ForumRepPerTagEntry {
|
|
107
|
+
key: string;
|
|
108
|
+
value: string;
|
|
109
|
+
}
|
|
110
|
+
export interface Member_ForumRepPerTagEntryProtoMsg {
|
|
111
|
+
typeUrl: string;
|
|
112
|
+
value: Uint8Array;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @name Member_ForumRepPerTagEntryAmino
|
|
116
|
+
* @package sparkdream.rep.v1
|
|
117
|
+
* @see proto type: sparkdream.rep.v1.Member_ForumRepPerTagEntry
|
|
118
|
+
*/
|
|
119
|
+
export interface Member_ForumRepPerTagEntryAmino {
|
|
120
|
+
key?: string;
|
|
121
|
+
value?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface Member_ForumRepPerTagEntryAminoMsg {
|
|
124
|
+
type: string;
|
|
125
|
+
value: Member_ForumRepPerTagEntryAmino;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @name Member_LifetimeForumRepPerTagEntry
|
|
129
|
+
* @package sparkdream.rep.v1
|
|
130
|
+
* @see proto type: sparkdream.rep.v1.undefined
|
|
131
|
+
*/
|
|
132
|
+
export interface Member_LifetimeForumRepPerTagEntry {
|
|
133
|
+
key: string;
|
|
134
|
+
value: string;
|
|
135
|
+
}
|
|
136
|
+
export interface Member_LifetimeForumRepPerTagEntryProtoMsg {
|
|
137
|
+
typeUrl: string;
|
|
138
|
+
value: Uint8Array;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @name Member_LifetimeForumRepPerTagEntryAmino
|
|
142
|
+
* @package sparkdream.rep.v1
|
|
143
|
+
* @see proto type: sparkdream.rep.v1.Member_LifetimeForumRepPerTagEntry
|
|
144
|
+
*/
|
|
145
|
+
export interface Member_LifetimeForumRepPerTagEntryAmino {
|
|
146
|
+
key?: string;
|
|
147
|
+
value?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface Member_LifetimeForumRepPerTagEntryAminoMsg {
|
|
150
|
+
type: string;
|
|
151
|
+
value: Member_LifetimeForumRepPerTagEntryAmino;
|
|
152
|
+
}
|
|
101
153
|
/**
|
|
102
154
|
* Member defines the Member message.
|
|
103
155
|
* @name Member
|
|
@@ -195,6 +247,32 @@ export interface Member {
|
|
|
195
247
|
*/
|
|
196
248
|
epochSalvations: number;
|
|
197
249
|
lastSalvationEpoch: bigint;
|
|
250
|
+
/**
|
|
251
|
+
* forum_rep_per_tag is per-tag reputation earned through forum activity
|
|
252
|
+
* (conviction-staked endorsements on posts and replies). Stored separately
|
|
253
|
+
* from reputation_scores so the trust-level ladder can include it for
|
|
254
|
+
* PROVISIONAL and ESTABLISHED tiers while excluding it from TRUSTED and
|
|
255
|
+
* CORE — forum participation is legitimate early-stage contribution but
|
|
256
|
+
* is cheaper to game than verified initiative output, so it must not gate
|
|
257
|
+
* the high-consequence council-adjacent tiers. Slashable on confirmed
|
|
258
|
+
* hide of the post that produced the rep (see x/forum
|
|
259
|
+
* PostConvictionStake.accrued_rep_per_tag). Map key is tag name, value is
|
|
260
|
+
* a decimal string (math.LegacyDec).
|
|
261
|
+
*/
|
|
262
|
+
forumRepPerTag: {
|
|
263
|
+
[key: string]: string;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* lifetime_forum_rep_per_tag accumulates forum_rep_per_tag across all
|
|
267
|
+
* completed seasons. Reset on season transition: forum_rep_per_tag is
|
|
268
|
+
* added to this map then cleared (mirroring lifetime_reputation /
|
|
269
|
+
* reputation_scores). Display-only — never read by the trust-level
|
|
270
|
+
* ladder. Keeps the historical signal visible on profiles without
|
|
271
|
+
* letting forum participation gate higher tiers across seasons.
|
|
272
|
+
*/
|
|
273
|
+
lifetimeForumRepPerTag: {
|
|
274
|
+
[key: string]: string;
|
|
275
|
+
};
|
|
198
276
|
}
|
|
199
277
|
export interface MemberProtoMsg {
|
|
200
278
|
typeUrl: "/sparkdream.rep.v1.Member";
|
|
@@ -297,6 +375,32 @@ export interface MemberAmino {
|
|
|
297
375
|
*/
|
|
298
376
|
epoch_salvations?: number;
|
|
299
377
|
last_salvation_epoch?: string;
|
|
378
|
+
/**
|
|
379
|
+
* forum_rep_per_tag is per-tag reputation earned through forum activity
|
|
380
|
+
* (conviction-staked endorsements on posts and replies). Stored separately
|
|
381
|
+
* from reputation_scores so the trust-level ladder can include it for
|
|
382
|
+
* PROVISIONAL and ESTABLISHED tiers while excluding it from TRUSTED and
|
|
383
|
+
* CORE — forum participation is legitimate early-stage contribution but
|
|
384
|
+
* is cheaper to game than verified initiative output, so it must not gate
|
|
385
|
+
* the high-consequence council-adjacent tiers. Slashable on confirmed
|
|
386
|
+
* hide of the post that produced the rep (see x/forum
|
|
387
|
+
* PostConvictionStake.accrued_rep_per_tag). Map key is tag name, value is
|
|
388
|
+
* a decimal string (math.LegacyDec).
|
|
389
|
+
*/
|
|
390
|
+
forum_rep_per_tag?: {
|
|
391
|
+
[key: string]: string;
|
|
392
|
+
};
|
|
393
|
+
/**
|
|
394
|
+
* lifetime_forum_rep_per_tag accumulates forum_rep_per_tag across all
|
|
395
|
+
* completed seasons. Reset on season transition: forum_rep_per_tag is
|
|
396
|
+
* added to this map then cleared (mirroring lifetime_reputation /
|
|
397
|
+
* reputation_scores). Display-only — never read by the trust-level
|
|
398
|
+
* ladder. Keeps the historical signal visible on profiles without
|
|
399
|
+
* letting forum participation gate higher tiers across seasons.
|
|
400
|
+
*/
|
|
401
|
+
lifetime_forum_rep_per_tag?: {
|
|
402
|
+
[key: string]: string;
|
|
403
|
+
};
|
|
300
404
|
}
|
|
301
405
|
export interface MemberAminoMsg {
|
|
302
406
|
type: "/sparkdream.rep.v1.Member";
|
|
@@ -385,6 +489,36 @@ export declare const Member_ReputationGainedThisEpochEntry: {
|
|
|
385
489
|
fromProtoMsg(message: Member_ReputationGainedThisEpochEntryProtoMsg): Member_ReputationGainedThisEpochEntry;
|
|
386
490
|
toProto(message: Member_ReputationGainedThisEpochEntry): Uint8Array;
|
|
387
491
|
};
|
|
492
|
+
/**
|
|
493
|
+
* @name Member_ForumRepPerTagEntry
|
|
494
|
+
* @package sparkdream.rep.v1
|
|
495
|
+
* @see proto type: sparkdream.rep.v1.undefined
|
|
496
|
+
*/
|
|
497
|
+
export declare const Member_ForumRepPerTagEntry: {
|
|
498
|
+
encode(message: Member_ForumRepPerTagEntry, writer?: BinaryWriter): BinaryWriter;
|
|
499
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Member_ForumRepPerTagEntry;
|
|
500
|
+
fromPartial(object: DeepPartial<Member_ForumRepPerTagEntry>): Member_ForumRepPerTagEntry;
|
|
501
|
+
fromAmino(object: Member_ForumRepPerTagEntryAmino): Member_ForumRepPerTagEntry;
|
|
502
|
+
toAmino(message: Member_ForumRepPerTagEntry): Member_ForumRepPerTagEntryAmino;
|
|
503
|
+
fromAminoMsg(object: Member_ForumRepPerTagEntryAminoMsg): Member_ForumRepPerTagEntry;
|
|
504
|
+
fromProtoMsg(message: Member_ForumRepPerTagEntryProtoMsg): Member_ForumRepPerTagEntry;
|
|
505
|
+
toProto(message: Member_ForumRepPerTagEntry): Uint8Array;
|
|
506
|
+
};
|
|
507
|
+
/**
|
|
508
|
+
* @name Member_LifetimeForumRepPerTagEntry
|
|
509
|
+
* @package sparkdream.rep.v1
|
|
510
|
+
* @see proto type: sparkdream.rep.v1.undefined
|
|
511
|
+
*/
|
|
512
|
+
export declare const Member_LifetimeForumRepPerTagEntry: {
|
|
513
|
+
encode(message: Member_LifetimeForumRepPerTagEntry, writer?: BinaryWriter): BinaryWriter;
|
|
514
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Member_LifetimeForumRepPerTagEntry;
|
|
515
|
+
fromPartial(object: DeepPartial<Member_LifetimeForumRepPerTagEntry>): Member_LifetimeForumRepPerTagEntry;
|
|
516
|
+
fromAmino(object: Member_LifetimeForumRepPerTagEntryAmino): Member_LifetimeForumRepPerTagEntry;
|
|
517
|
+
toAmino(message: Member_LifetimeForumRepPerTagEntry): Member_LifetimeForumRepPerTagEntryAmino;
|
|
518
|
+
fromAminoMsg(object: Member_LifetimeForumRepPerTagEntryAminoMsg): Member_LifetimeForumRepPerTagEntry;
|
|
519
|
+
fromProtoMsg(message: Member_LifetimeForumRepPerTagEntryProtoMsg): Member_LifetimeForumRepPerTagEntry;
|
|
520
|
+
toProto(message: Member_LifetimeForumRepPerTagEntry): Uint8Array;
|
|
521
|
+
};
|
|
388
522
|
/**
|
|
389
523
|
* Member defines the Member message.
|
|
390
524
|
* @name Member
|