@sparkdreamnft/sparkdreamjs 0.0.48 → 0.0.49
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/akash/bundle.d.ts +134 -134
- package/akash/bundle.js +150 -150
- package/amino-schema.d.ts +86 -0
- package/amino-schema.js +1 -1
- package/cosmos/bundle.d.ts +160 -160
- package/cosmos/bundle.js +182 -182
- package/esm/akash/bundle.js +150 -150
- package/esm/amino-schema.js +1 -1
- package/esm/cosmos/bundle.js +182 -182
- package/esm/ibc/bundle.js +116 -116
- package/esm/sparkdream/artifact/v1/types.js +25 -1
- package/esm/sparkdream/blog/v1/genesis.js +97 -1
- package/esm/sparkdream/bundle.js +447 -439
- package/esm/sparkdream/collect/v1/genesis.js +308 -3
- package/esm/sparkdream/collect/v1/tx.js +170 -0
- package/esm/sparkdream/collect/v1/tx.registry.js +20 -2
- package/esm/sparkdream/collect/v1/tx.rpc.msg.js +10 -1
- package/esm/sparkdream/collect/v1/types.js +51 -3
- package/esm/sparkdream/commons/v1/genesis.js +756 -27
- package/esm/sparkdream/commons/v1/group.js +130 -2
- package/esm/sparkdream/commons/v1/poll.js +281 -0
- package/esm/sparkdream/commons/v1/poll_vote.js +107 -0
- package/esm/sparkdream/commons/v1/query.js +759 -0
- package/esm/sparkdream/commons/v1/query.lcd.js +46 -0
- package/esm/sparkdream/commons/v1/query.rpc.Query.js +49 -1
- package/esm/sparkdream/commons/v1/tx.js +730 -4
- package/esm/sparkdream/commons/v1/tx.registry.js +74 -2
- package/esm/sparkdream/commons/v1/tx.rpc.msg.js +25 -1
- package/esm/sparkdream/commons/v1/voter_tree.js +208 -0
- package/esm/sparkdream/federation/v1/genesis.js +212 -2
- package/esm/sparkdream/federation/v1/tx.js +196 -0
- package/esm/sparkdream/federation/v1/tx.registry.js +20 -2
- package/esm/sparkdream/federation/v1/tx.rpc.msg.js +8 -1
- package/esm/sparkdream/federation/v1/types.js +194 -2
- package/esm/sparkdream/forum/v1/archive_metadata.js +13 -1
- package/esm/sparkdream/forum/v1/genesis.js +428 -1
- package/esm/sparkdream/forum/v1/params.js +182 -254
- package/esm/sparkdream/forum/v1/query.js +112 -7
- package/esm/sparkdream/forum/v1/user_reaction_limit.js +62 -1
- package/esm/sparkdream/futarchy/v1/market.js +37 -1
- package/esm/sparkdream/futarchy/v1/tx.js +13 -1
- package/esm/sparkdream/name/v1/dispute.js +13 -1
- package/esm/sparkdream/rep/v1/genesis.js +272 -2
- package/esm/sparkdream/rep/v1/initiative_review.js +13 -1
- package/esm/sparkdream/rep/v1/invitation.js +25 -1
- package/esm/sparkdream/rep/v1/member_report.js +335 -1
- package/esm/sparkdream/rep/v1/migration.js +27 -2
- package/esm/sparkdream/rep/v1/params.js +13 -1
- package/esm/sparkdream/rep/v1/stake.js +10 -0
- package/esm/sparkdream/rep/v1/tx.js +372 -14
- package/esm/sparkdream/rep/v1/tx.registry.js +38 -2
- package/esm/sparkdream/rep/v1/tx.rpc.msg.js +16 -2
- package/esm/sparkdream/reveal/v1/types.js +9 -21
- package/esm/sparkdream/season/v1/display_name_moderation.js +40 -1
- package/esm/sparkdream/season/v1/epoch_xp_tracker.js +13 -1
- package/esm/sparkdream/season/v1/genesis.js +125 -1
- package/esm/sparkdream/season/v1/guild_invite.js +13 -1
- package/esm/sparkdream/season/v1/guild_membership.js +13 -1
- package/esm/sparkdream/season/v1/member_profile.js +13 -1
- package/esm/sparkdream/season/v1/member_quest_progress.js +13 -1
- package/esm/sparkdream/season/v1/member_season_snapshot.js +16 -1
- package/esm/sparkdream/season/v1/nomination.js +37 -1
- package/esm/sparkdream/season/v1/query.js +26 -35
- package/esm/sparkdream/season/v1/query.lcd.js +1 -1
- package/esm/sparkdream/season/v1/quest.js +13 -1
- package/esm/sparkdream/season/v1/season.js +13 -1
- package/esm/sparkdream/season/v1/season_stats_counters.js +121 -0
- package/esm/sparkdream/season/v1/season_title_eligibility.js +4 -1
- package/esm/sparkdream/service/v1/genesis.js +126 -1
- package/esm/sparkdream/service/v1/refile_cooldown.js +20 -7
- package/esm/sparkdream/session/v1/genesis.js +303 -1
- package/esm/sparkdream/session/v1/params.js +24 -0
- package/esm/sparkdream/shield/v1/genesis.js +56 -2
- package/esm/sparkdream/shield/v1/params.js +13 -1
- package/esm/sparkdream/shield/v1/types.js +202 -1
- package/esm/sparkdream/vault/v1/genesis.js +25 -1
- package/esm/sparkdream/vault/v1/query.js +15 -2
- package/esm/sparkdream/vault/v1/query.lcd.js +3 -0
- package/esm/sparkdream/vault/v1/tx.js +301 -0
- package/esm/sparkdream/vault/v1/tx.registry.js +38 -2
- package/esm/sparkdream/vault/v1/tx.rpc.msg.js +13 -1
- package/esm/sparkdream/vault/v1/vault_signer.js +15 -2
- package/esm/tendermint/bundle.js +20 -20
- package/ibc/bundle.d.ts +99 -99
- package/ibc/bundle.js +116 -116
- package/package.json +1 -1
- package/sparkdream/artifact/v1/types.d.ts +14 -0
- package/sparkdream/artifact/v1/types.js +25 -1
- package/sparkdream/blog/v1/genesis.d.ts +60 -0
- package/sparkdream/blog/v1/genesis.js +98 -2
- package/sparkdream/bundle.d.ts +17095 -16171
- package/sparkdream/bundle.js +447 -439
- package/sparkdream/collect/v1/genesis.d.ts +186 -0
- package/sparkdream/collect/v1/genesis.js +309 -4
- package/sparkdream/collect/v1/tx.d.ts +100 -0
- package/sparkdream/collect/v1/tx.js +171 -1
- package/sparkdream/collect/v1/tx.registry.d.ts +13 -1
- package/sparkdream/collect/v1/tx.registry.js +19 -1
- package/sparkdream/collect/v1/tx.rpc.msg.d.ts +9 -1
- package/sparkdream/collect/v1/tx.rpc.msg.js +9 -0
- package/sparkdream/collect/v1/types.d.ts +52 -0
- package/sparkdream/collect/v1/types.js +51 -3
- package/sparkdream/commons/v1/genesis.d.ts +443 -22
- package/sparkdream/commons/v1/genesis.js +756 -27
- package/sparkdream/commons/v1/group.d.ts +75 -0
- package/sparkdream/commons/v1/group.js +133 -3
- package/sparkdream/commons/v1/poll.d.ts +135 -0
- package/sparkdream/commons/v1/poll.js +286 -0
- package/sparkdream/commons/v1/poll_vote.d.ts +58 -0
- package/sparkdream/commons/v1/poll_vote.js +110 -0
- package/sparkdream/commons/v1/query.d.ts +465 -0
- package/sparkdream/commons/v1/query.js +760 -1
- package/sparkdream/commons/v1/query.lcd.d.ts +6 -1
- package/sparkdream/commons/v1/query.lcd.js +46 -0
- package/sparkdream/commons/v1/query.rpc.Query.d.ts +30 -1
- package/sparkdream/commons/v1/query.rpc.Query.js +48 -0
- package/sparkdream/commons/v1/tx.d.ts +475 -1
- package/sparkdream/commons/v1/tx.js +731 -4
- package/sparkdream/commons/v1/tx.registry.d.ts +49 -1
- package/sparkdream/commons/v1/tx.registry.js +73 -1
- package/sparkdream/commons/v1/tx.rpc.msg.d.ts +13 -1
- package/sparkdream/commons/v1/tx.rpc.msg.js +24 -0
- package/sparkdream/commons/v1/voter_tree.d.ts +132 -0
- package/sparkdream/commons/v1/voter_tree.js +211 -0
- package/sparkdream/federation/v1/genesis.d.ts +136 -1
- package/sparkdream/federation/v1/genesis.js +212 -2
- package/sparkdream/federation/v1/tx.d.ts +138 -0
- package/sparkdream/federation/v1/tx.js +198 -1
- package/sparkdream/federation/v1/tx.registry.d.ts +13 -1
- package/sparkdream/federation/v1/tx.registry.js +19 -1
- package/sparkdream/federation/v1/tx.rpc.msg.d.ts +7 -1
- package/sparkdream/federation/v1/tx.rpc.msg.js +7 -0
- package/sparkdream/federation/v1/types.d.ts +166 -0
- package/sparkdream/federation/v1/types.js +197 -3
- package/sparkdream/forum/v1/archive_metadata.d.ts +12 -0
- package/sparkdream/forum/v1/archive_metadata.js +13 -1
- package/sparkdream/forum/v1/genesis.d.ts +256 -0
- package/sparkdream/forum/v1/genesis.js +429 -2
- package/sparkdream/forum/v1/params.d.ts +0 -30
- package/sparkdream/forum/v1/params.js +182 -254
- package/sparkdream/forum/v1/query.d.ts +70 -0
- package/sparkdream/forum/v1/query.js +112 -7
- package/sparkdream/forum/v1/user_reaction_limit.d.ts +25 -0
- package/sparkdream/forum/v1/user_reaction_limit.js +65 -2
- package/sparkdream/futarchy/v1/market.d.ts +32 -0
- package/sparkdream/futarchy/v1/market.js +37 -1
- package/sparkdream/futarchy/v1/tx.d.ts +10 -0
- package/sparkdream/futarchy/v1/tx.js +13 -1
- package/sparkdream/name/v1/dispute.d.ts +14 -0
- package/sparkdream/name/v1/dispute.js +13 -1
- package/sparkdream/rep/v1/genesis.d.ts +151 -1
- package/sparkdream/rep/v1/genesis.js +272 -2
- package/sparkdream/rep/v1/initiative_review.d.ts +14 -0
- package/sparkdream/rep/v1/initiative_review.js +13 -1
- package/sparkdream/rep/v1/invitation.d.ts +32 -0
- package/sparkdream/rep/v1/invitation.js +25 -1
- package/sparkdream/rep/v1/member_report.d.ts +215 -0
- package/sparkdream/rep/v1/member_report.js +336 -2
- package/sparkdream/rep/v1/migration.d.ts +34 -1
- package/sparkdream/rep/v1/migration.js +27 -2
- package/sparkdream/rep/v1/params.d.ts +18 -0
- package/sparkdream/rep/v1/params.js +13 -1
- package/sparkdream/rep/v1/stake.d.ts +5 -0
- package/sparkdream/rep/v1/stake.js +10 -0
- package/sparkdream/rep/v1/tx.d.ts +340 -39
- package/sparkdream/rep/v1/tx.js +375 -17
- package/sparkdream/rep/v1/tx.registry.d.ts +25 -1
- package/sparkdream/rep/v1/tx.registry.js +37 -1
- package/sparkdream/rep/v1/tx.rpc.msg.d.ts +12 -2
- package/sparkdream/rep/v1/tx.rpc.msg.js +15 -1
- package/sparkdream/reveal/v1/types.d.ts +0 -8
- package/sparkdream/reveal/v1/types.js +9 -21
- package/sparkdream/rpc.query.d.ts +5 -0
- package/sparkdream/season/v1/display_name_moderation.d.ts +28 -0
- package/sparkdream/season/v1/display_name_moderation.js +40 -1
- package/sparkdream/season/v1/epoch_xp_tracker.d.ts +10 -0
- package/sparkdream/season/v1/epoch_xp_tracker.js +13 -1
- package/sparkdream/season/v1/genesis.d.ts +75 -0
- package/sparkdream/season/v1/genesis.js +126 -2
- package/sparkdream/season/v1/guild_invite.d.ts +10 -0
- package/sparkdream/season/v1/guild_invite.js +13 -1
- package/sparkdream/season/v1/guild_membership.d.ts +12 -0
- package/sparkdream/season/v1/guild_membership.js +13 -1
- package/sparkdream/season/v1/member_profile.d.ts +12 -0
- package/sparkdream/season/v1/member_profile.js +13 -1
- package/sparkdream/season/v1/member_quest_progress.d.ts +8 -0
- package/sparkdream/season/v1/member_quest_progress.js +13 -1
- package/sparkdream/season/v1/member_season_snapshot.d.ts +14 -0
- package/sparkdream/season/v1/member_season_snapshot.js +16 -1
- package/sparkdream/season/v1/nomination.d.ts +32 -0
- package/sparkdream/season/v1/nomination.js +37 -1
- package/sparkdream/season/v1/query.d.ts +10 -6
- package/sparkdream/season/v1/query.js +26 -35
- package/sparkdream/season/v1/query.lcd.js +1 -1
- package/sparkdream/season/v1/quest.d.ts +12 -0
- package/sparkdream/season/v1/quest.js +13 -1
- package/sparkdream/season/v1/season.d.ts +12 -0
- package/sparkdream/season/v1/season.js +13 -1
- package/sparkdream/season/v1/season_stats_counters.d.ts +86 -0
- package/sparkdream/season/v1/season_stats_counters.js +124 -0
- package/sparkdream/season/v1/season_title_eligibility.d.ts +12 -3
- package/sparkdream/season/v1/season_title_eligibility.js +4 -1
- package/sparkdream/service/v1/genesis.d.ts +71 -0
- package/sparkdream/service/v1/genesis.js +127 -2
- package/sparkdream/service/v1/refile_cooldown.d.ts +35 -22
- package/sparkdream/service/v1/refile_cooldown.js +20 -7
- package/sparkdream/session/v1/genesis.d.ts +190 -0
- package/sparkdream/session/v1/genesis.js +304 -2
- package/sparkdream/session/v1/params.d.ts +18 -0
- package/sparkdream/session/v1/params.js +24 -0
- package/sparkdream/shield/v1/genesis.d.ts +37 -1
- package/sparkdream/shield/v1/genesis.js +55 -1
- package/sparkdream/shield/v1/params.d.ts +26 -2
- package/sparkdream/shield/v1/params.js +13 -1
- package/sparkdream/shield/v1/types.d.ts +122 -0
- package/sparkdream/shield/v1/types.js +203 -2
- package/sparkdream/vault/v1/genesis.d.ts +14 -0
- package/sparkdream/vault/v1/genesis.js +25 -1
- package/sparkdream/vault/v1/query.d.ts +16 -3
- package/sparkdream/vault/v1/query.js +15 -2
- package/sparkdream/vault/v1/query.lcd.js +3 -0
- package/sparkdream/vault/v1/tx.d.ts +219 -0
- package/sparkdream/vault/v1/tx.js +302 -1
- package/sparkdream/vault/v1/tx.registry.d.ts +25 -1
- package/sparkdream/vault/v1/tx.registry.js +37 -1
- package/sparkdream/vault/v1/tx.rpc.msg.d.ts +7 -1
- package/sparkdream/vault/v1/tx.rpc.msg.js +12 -0
- package/sparkdream/vault/v1/vault_signer.d.ts +22 -3
- package/sparkdream/vault/v1/vault_signer.js +15 -2
- package/tendermint/bundle.d.ts +844 -844
- package/tendermint/bundle.js +20 -20
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Poll = exports.PollStatusAmino = exports.PollStatus = void 0;
|
|
4
|
+
exports.pollStatusFromJSON = pollStatusFromJSON;
|
|
5
|
+
exports.pollStatusToJSON = pollStatusToJSON;
|
|
6
|
+
//@ts-nocheck
|
|
7
|
+
const binary_1 = require("../../../binary");
|
|
8
|
+
const helpers_1 = require("../../../helpers");
|
|
9
|
+
/** PollStatus is a poll's lifecycle state. */
|
|
10
|
+
var PollStatus;
|
|
11
|
+
(function (PollStatus) {
|
|
12
|
+
PollStatus[PollStatus["POLL_STATUS_UNSPECIFIED"] = 0] = "POLL_STATUS_UNSPECIFIED";
|
|
13
|
+
/** POLL_STATUS_OPEN - OPEN: voting is open until the deadline. */
|
|
14
|
+
PollStatus[PollStatus["POLL_STATUS_OPEN"] = 1] = "POLL_STATUS_OPEN";
|
|
15
|
+
/** POLL_STATUS_CLOSED - CLOSED: the deadline passed; tallies are final. */
|
|
16
|
+
PollStatus[PollStatus["POLL_STATUS_CLOSED"] = 2] = "POLL_STATUS_CLOSED";
|
|
17
|
+
/** POLL_STATUS_CANCELLED - CANCELLED: the creator withdrew it before any vote. */
|
|
18
|
+
PollStatus[PollStatus["POLL_STATUS_CANCELLED"] = 3] = "POLL_STATUS_CANCELLED";
|
|
19
|
+
PollStatus[PollStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
20
|
+
})(PollStatus || (exports.PollStatus = PollStatus = {}));
|
|
21
|
+
exports.PollStatusAmino = PollStatus;
|
|
22
|
+
function pollStatusFromJSON(object) {
|
|
23
|
+
switch (object) {
|
|
24
|
+
case 0:
|
|
25
|
+
case "POLL_STATUS_UNSPECIFIED":
|
|
26
|
+
return PollStatus.POLL_STATUS_UNSPECIFIED;
|
|
27
|
+
case 1:
|
|
28
|
+
case "POLL_STATUS_OPEN":
|
|
29
|
+
return PollStatus.POLL_STATUS_OPEN;
|
|
30
|
+
case 2:
|
|
31
|
+
case "POLL_STATUS_CLOSED":
|
|
32
|
+
return PollStatus.POLL_STATUS_CLOSED;
|
|
33
|
+
case 3:
|
|
34
|
+
case "POLL_STATUS_CANCELLED":
|
|
35
|
+
return PollStatus.POLL_STATUS_CANCELLED;
|
|
36
|
+
case -1:
|
|
37
|
+
case "UNRECOGNIZED":
|
|
38
|
+
default:
|
|
39
|
+
return PollStatus.UNRECOGNIZED;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function pollStatusToJSON(object) {
|
|
43
|
+
switch (object) {
|
|
44
|
+
case PollStatus.POLL_STATUS_UNSPECIFIED:
|
|
45
|
+
return "POLL_STATUS_UNSPECIFIED";
|
|
46
|
+
case PollStatus.POLL_STATUS_OPEN:
|
|
47
|
+
return "POLL_STATUS_OPEN";
|
|
48
|
+
case PollStatus.POLL_STATUS_CLOSED:
|
|
49
|
+
return "POLL_STATUS_CLOSED";
|
|
50
|
+
case PollStatus.POLL_STATUS_CANCELLED:
|
|
51
|
+
return "POLL_STATUS_CANCELLED";
|
|
52
|
+
case PollStatus.UNRECOGNIZED:
|
|
53
|
+
default:
|
|
54
|
+
return "UNRECOGNIZED";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function createBasePoll() {
|
|
58
|
+
return {
|
|
59
|
+
id: BigInt(0),
|
|
60
|
+
councilName: "",
|
|
61
|
+
creator: "",
|
|
62
|
+
question: "",
|
|
63
|
+
options: [],
|
|
64
|
+
secretBallot: false,
|
|
65
|
+
openedAt: BigInt(0),
|
|
66
|
+
deadline: BigInt(0),
|
|
67
|
+
status: 0,
|
|
68
|
+
tallies: [],
|
|
69
|
+
voterRoot: new Uint8Array(),
|
|
70
|
+
eligibleVoters: BigInt(0),
|
|
71
|
+
closedAt: BigInt(0)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Poll is a non-binding, single-choice question put to a group's members.
|
|
76
|
+
* It never executes anything.
|
|
77
|
+
* @name Poll
|
|
78
|
+
* @package sparkdream.commons.v1
|
|
79
|
+
* @see proto type: sparkdream.commons.v1.Poll
|
|
80
|
+
*/
|
|
81
|
+
exports.Poll = {
|
|
82
|
+
typeUrl: "/sparkdream.commons.v1.Poll",
|
|
83
|
+
encode(message, writer = binary_1.BinaryWriter.create()) {
|
|
84
|
+
if (message.id !== BigInt(0)) {
|
|
85
|
+
writer.uint32(8).uint64(message.id);
|
|
86
|
+
}
|
|
87
|
+
if (message.councilName !== "") {
|
|
88
|
+
writer.uint32(18).string(message.councilName);
|
|
89
|
+
}
|
|
90
|
+
if (message.creator !== "") {
|
|
91
|
+
writer.uint32(26).string(message.creator);
|
|
92
|
+
}
|
|
93
|
+
if (message.question !== "") {
|
|
94
|
+
writer.uint32(34).string(message.question);
|
|
95
|
+
}
|
|
96
|
+
for (const v of message.options) {
|
|
97
|
+
writer.uint32(42).string(v);
|
|
98
|
+
}
|
|
99
|
+
if (message.secretBallot === true) {
|
|
100
|
+
writer.uint32(48).bool(message.secretBallot);
|
|
101
|
+
}
|
|
102
|
+
if (message.openedAt !== BigInt(0)) {
|
|
103
|
+
writer.uint32(56).int64(message.openedAt);
|
|
104
|
+
}
|
|
105
|
+
if (message.deadline !== BigInt(0)) {
|
|
106
|
+
writer.uint32(64).int64(message.deadline);
|
|
107
|
+
}
|
|
108
|
+
if (message.status !== 0) {
|
|
109
|
+
writer.uint32(72).int32(message.status);
|
|
110
|
+
}
|
|
111
|
+
writer.uint32(82).fork();
|
|
112
|
+
for (const v of message.tallies) {
|
|
113
|
+
writer.uint64(v);
|
|
114
|
+
}
|
|
115
|
+
writer.ldelim();
|
|
116
|
+
if (message.voterRoot.length !== 0) {
|
|
117
|
+
writer.uint32(90).bytes(message.voterRoot);
|
|
118
|
+
}
|
|
119
|
+
if (message.eligibleVoters !== BigInt(0)) {
|
|
120
|
+
writer.uint32(96).uint64(message.eligibleVoters);
|
|
121
|
+
}
|
|
122
|
+
if (message.closedAt !== BigInt(0)) {
|
|
123
|
+
writer.uint32(104).int64(message.closedAt);
|
|
124
|
+
}
|
|
125
|
+
return writer;
|
|
126
|
+
},
|
|
127
|
+
decode(input, length) {
|
|
128
|
+
const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
|
|
129
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
130
|
+
const message = createBasePoll();
|
|
131
|
+
while (reader.pos < end) {
|
|
132
|
+
const tag = reader.uint32();
|
|
133
|
+
switch (tag >>> 3) {
|
|
134
|
+
case 1:
|
|
135
|
+
message.id = reader.uint64();
|
|
136
|
+
break;
|
|
137
|
+
case 2:
|
|
138
|
+
message.councilName = reader.string();
|
|
139
|
+
break;
|
|
140
|
+
case 3:
|
|
141
|
+
message.creator = reader.string();
|
|
142
|
+
break;
|
|
143
|
+
case 4:
|
|
144
|
+
message.question = reader.string();
|
|
145
|
+
break;
|
|
146
|
+
case 5:
|
|
147
|
+
message.options.push(reader.string());
|
|
148
|
+
break;
|
|
149
|
+
case 6:
|
|
150
|
+
message.secretBallot = reader.bool();
|
|
151
|
+
break;
|
|
152
|
+
case 7:
|
|
153
|
+
message.openedAt = reader.int64();
|
|
154
|
+
break;
|
|
155
|
+
case 8:
|
|
156
|
+
message.deadline = reader.int64();
|
|
157
|
+
break;
|
|
158
|
+
case 9:
|
|
159
|
+
message.status = reader.int32();
|
|
160
|
+
break;
|
|
161
|
+
case 10:
|
|
162
|
+
if ((tag & 7) === 2) {
|
|
163
|
+
const end2 = reader.uint32() + reader.pos;
|
|
164
|
+
while (reader.pos < end2) {
|
|
165
|
+
message.tallies.push(reader.uint64());
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
message.tallies.push(reader.uint64());
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
case 11:
|
|
173
|
+
message.voterRoot = reader.bytes();
|
|
174
|
+
break;
|
|
175
|
+
case 12:
|
|
176
|
+
message.eligibleVoters = reader.uint64();
|
|
177
|
+
break;
|
|
178
|
+
case 13:
|
|
179
|
+
message.closedAt = reader.int64();
|
|
180
|
+
break;
|
|
181
|
+
default:
|
|
182
|
+
reader.skipType(tag & 7);
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return message;
|
|
187
|
+
},
|
|
188
|
+
fromPartial(object) {
|
|
189
|
+
const message = createBasePoll();
|
|
190
|
+
message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0);
|
|
191
|
+
message.councilName = object.councilName ?? "";
|
|
192
|
+
message.creator = object.creator ?? "";
|
|
193
|
+
message.question = object.question ?? "";
|
|
194
|
+
message.options = object.options?.map(e => e) || [];
|
|
195
|
+
message.secretBallot = object.secretBallot ?? false;
|
|
196
|
+
message.openedAt = object.openedAt !== undefined && object.openedAt !== null ? BigInt(object.openedAt.toString()) : BigInt(0);
|
|
197
|
+
message.deadline = object.deadline !== undefined && object.deadline !== null ? BigInt(object.deadline.toString()) : BigInt(0);
|
|
198
|
+
message.status = object.status ?? 0;
|
|
199
|
+
message.tallies = object.tallies?.map(e => BigInt(e.toString())) || [];
|
|
200
|
+
message.voterRoot = object.voterRoot ?? new Uint8Array();
|
|
201
|
+
message.eligibleVoters = object.eligibleVoters !== undefined && object.eligibleVoters !== null ? BigInt(object.eligibleVoters.toString()) : BigInt(0);
|
|
202
|
+
message.closedAt = object.closedAt !== undefined && object.closedAt !== null ? BigInt(object.closedAt.toString()) : BigInt(0);
|
|
203
|
+
return message;
|
|
204
|
+
},
|
|
205
|
+
fromAmino(object) {
|
|
206
|
+
const message = createBasePoll();
|
|
207
|
+
if (object.id !== undefined && object.id !== null) {
|
|
208
|
+
message.id = BigInt(object.id);
|
|
209
|
+
}
|
|
210
|
+
if (object.council_name !== undefined && object.council_name !== null) {
|
|
211
|
+
message.councilName = object.council_name;
|
|
212
|
+
}
|
|
213
|
+
if (object.creator !== undefined && object.creator !== null) {
|
|
214
|
+
message.creator = object.creator;
|
|
215
|
+
}
|
|
216
|
+
if (object.question !== undefined && object.question !== null) {
|
|
217
|
+
message.question = object.question;
|
|
218
|
+
}
|
|
219
|
+
message.options = object.options?.map(e => e) || [];
|
|
220
|
+
if (object.secret_ballot !== undefined && object.secret_ballot !== null) {
|
|
221
|
+
message.secretBallot = object.secret_ballot;
|
|
222
|
+
}
|
|
223
|
+
if (object.opened_at !== undefined && object.opened_at !== null) {
|
|
224
|
+
message.openedAt = BigInt(object.opened_at);
|
|
225
|
+
}
|
|
226
|
+
if (object.deadline !== undefined && object.deadline !== null) {
|
|
227
|
+
message.deadline = BigInt(object.deadline);
|
|
228
|
+
}
|
|
229
|
+
if (object.status !== undefined && object.status !== null) {
|
|
230
|
+
message.status = object.status;
|
|
231
|
+
}
|
|
232
|
+
message.tallies = object.tallies?.map(e => BigInt(e)) || [];
|
|
233
|
+
if (object.voter_root !== undefined && object.voter_root !== null) {
|
|
234
|
+
message.voterRoot = (0, helpers_1.bytesFromBase64)(object.voter_root);
|
|
235
|
+
}
|
|
236
|
+
if (object.eligible_voters !== undefined && object.eligible_voters !== null) {
|
|
237
|
+
message.eligibleVoters = BigInt(object.eligible_voters);
|
|
238
|
+
}
|
|
239
|
+
if (object.closed_at !== undefined && object.closed_at !== null) {
|
|
240
|
+
message.closedAt = BigInt(object.closed_at);
|
|
241
|
+
}
|
|
242
|
+
return message;
|
|
243
|
+
},
|
|
244
|
+
toAmino(message) {
|
|
245
|
+
const obj = {};
|
|
246
|
+
obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined;
|
|
247
|
+
obj.council_name = message.councilName === "" ? undefined : message.councilName;
|
|
248
|
+
obj.creator = message.creator === "" ? undefined : message.creator;
|
|
249
|
+
obj.question = message.question === "" ? undefined : message.question;
|
|
250
|
+
if (message.options) {
|
|
251
|
+
obj.options = message.options.map(e => e);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
obj.options = message.options;
|
|
255
|
+
}
|
|
256
|
+
obj.secret_ballot = message.secretBallot === false ? undefined : message.secretBallot;
|
|
257
|
+
obj.opened_at = message.openedAt !== BigInt(0) ? message.openedAt?.toString() : undefined;
|
|
258
|
+
obj.deadline = message.deadline !== BigInt(0) ? message.deadline?.toString() : undefined;
|
|
259
|
+
obj.status = message.status === 0 ? undefined : message.status;
|
|
260
|
+
if (message.tallies) {
|
|
261
|
+
obj.tallies = message.tallies.map(e => e.toString());
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
obj.tallies = message.tallies;
|
|
265
|
+
}
|
|
266
|
+
obj.voter_root = message.voterRoot ? (0, helpers_1.base64FromBytes)(message.voterRoot) : undefined;
|
|
267
|
+
obj.eligible_voters = message.eligibleVoters !== BigInt(0) ? message.eligibleVoters?.toString() : undefined;
|
|
268
|
+
obj.closed_at = message.closedAt !== BigInt(0) ? message.closedAt?.toString() : undefined;
|
|
269
|
+
return obj;
|
|
270
|
+
},
|
|
271
|
+
fromAminoMsg(object) {
|
|
272
|
+
return exports.Poll.fromAmino(object.value);
|
|
273
|
+
},
|
|
274
|
+
fromProtoMsg(message) {
|
|
275
|
+
return exports.Poll.decode(message.value);
|
|
276
|
+
},
|
|
277
|
+
toProto(message) {
|
|
278
|
+
return exports.Poll.encode(message).finish();
|
|
279
|
+
},
|
|
280
|
+
toProtoMsg(message) {
|
|
281
|
+
return {
|
|
282
|
+
typeUrl: "/sparkdream.commons.v1.Poll",
|
|
283
|
+
value: exports.Poll.encode(message).finish()
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "../../../binary";
|
|
2
|
+
import { DeepPartial } from "../../../helpers";
|
|
3
|
+
/**
|
|
4
|
+
* PollVote is a member's open vote on a poll.
|
|
5
|
+
* @name PollVote
|
|
6
|
+
* @package sparkdream.commons.v1
|
|
7
|
+
* @see proto type: sparkdream.commons.v1.PollVote
|
|
8
|
+
*/
|
|
9
|
+
export interface PollVote {
|
|
10
|
+
pollId: bigint;
|
|
11
|
+
voter: string;
|
|
12
|
+
/**
|
|
13
|
+
* option is the index into the poll's options.
|
|
14
|
+
*/
|
|
15
|
+
option: bigint;
|
|
16
|
+
votedAt: bigint;
|
|
17
|
+
}
|
|
18
|
+
export interface PollVoteProtoMsg {
|
|
19
|
+
typeUrl: "/sparkdream.commons.v1.PollVote";
|
|
20
|
+
value: Uint8Array;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* PollVote is a member's open vote on a poll.
|
|
24
|
+
* @name PollVoteAmino
|
|
25
|
+
* @package sparkdream.commons.v1
|
|
26
|
+
* @see proto type: sparkdream.commons.v1.PollVote
|
|
27
|
+
*/
|
|
28
|
+
export interface PollVoteAmino {
|
|
29
|
+
poll_id?: string;
|
|
30
|
+
voter?: string;
|
|
31
|
+
/**
|
|
32
|
+
* option is the index into the poll's options.
|
|
33
|
+
*/
|
|
34
|
+
option?: string;
|
|
35
|
+
voted_at?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface PollVoteAminoMsg {
|
|
38
|
+
type: "/sparkdream.commons.v1.PollVote";
|
|
39
|
+
value: PollVoteAmino;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* PollVote is a member's open vote on a poll.
|
|
43
|
+
* @name PollVote
|
|
44
|
+
* @package sparkdream.commons.v1
|
|
45
|
+
* @see proto type: sparkdream.commons.v1.PollVote
|
|
46
|
+
*/
|
|
47
|
+
export declare const PollVote: {
|
|
48
|
+
typeUrl: string;
|
|
49
|
+
encode(message: PollVote, writer?: BinaryWriter): BinaryWriter;
|
|
50
|
+
decode(input: BinaryReader | Uint8Array, length?: number): PollVote;
|
|
51
|
+
fromPartial(object: DeepPartial<PollVote>): PollVote;
|
|
52
|
+
fromAmino(object: PollVoteAmino): PollVote;
|
|
53
|
+
toAmino(message: PollVote): PollVoteAmino;
|
|
54
|
+
fromAminoMsg(object: PollVoteAminoMsg): PollVote;
|
|
55
|
+
fromProtoMsg(message: PollVoteProtoMsg): PollVote;
|
|
56
|
+
toProto(message: PollVote): Uint8Array;
|
|
57
|
+
toProtoMsg(message: PollVote): PollVoteProtoMsg;
|
|
58
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PollVote = void 0;
|
|
4
|
+
//@ts-nocheck
|
|
5
|
+
const binary_1 = require("../../../binary");
|
|
6
|
+
function createBasePollVote() {
|
|
7
|
+
return {
|
|
8
|
+
pollId: BigInt(0),
|
|
9
|
+
voter: "",
|
|
10
|
+
option: BigInt(0),
|
|
11
|
+
votedAt: BigInt(0)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* PollVote is a member's open vote on a poll.
|
|
16
|
+
* @name PollVote
|
|
17
|
+
* @package sparkdream.commons.v1
|
|
18
|
+
* @see proto type: sparkdream.commons.v1.PollVote
|
|
19
|
+
*/
|
|
20
|
+
exports.PollVote = {
|
|
21
|
+
typeUrl: "/sparkdream.commons.v1.PollVote",
|
|
22
|
+
encode(message, writer = binary_1.BinaryWriter.create()) {
|
|
23
|
+
if (message.pollId !== BigInt(0)) {
|
|
24
|
+
writer.uint32(8).uint64(message.pollId);
|
|
25
|
+
}
|
|
26
|
+
if (message.voter !== "") {
|
|
27
|
+
writer.uint32(18).string(message.voter);
|
|
28
|
+
}
|
|
29
|
+
if (message.option !== BigInt(0)) {
|
|
30
|
+
writer.uint32(24).uint64(message.option);
|
|
31
|
+
}
|
|
32
|
+
if (message.votedAt !== BigInt(0)) {
|
|
33
|
+
writer.uint32(32).int64(message.votedAt);
|
|
34
|
+
}
|
|
35
|
+
return writer;
|
|
36
|
+
},
|
|
37
|
+
decode(input, length) {
|
|
38
|
+
const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
|
|
39
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
40
|
+
const message = createBasePollVote();
|
|
41
|
+
while (reader.pos < end) {
|
|
42
|
+
const tag = reader.uint32();
|
|
43
|
+
switch (tag >>> 3) {
|
|
44
|
+
case 1:
|
|
45
|
+
message.pollId = reader.uint64();
|
|
46
|
+
break;
|
|
47
|
+
case 2:
|
|
48
|
+
message.voter = reader.string();
|
|
49
|
+
break;
|
|
50
|
+
case 3:
|
|
51
|
+
message.option = reader.uint64();
|
|
52
|
+
break;
|
|
53
|
+
case 4:
|
|
54
|
+
message.votedAt = reader.int64();
|
|
55
|
+
break;
|
|
56
|
+
default:
|
|
57
|
+
reader.skipType(tag & 7);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return message;
|
|
62
|
+
},
|
|
63
|
+
fromPartial(object) {
|
|
64
|
+
const message = createBasePollVote();
|
|
65
|
+
message.pollId = object.pollId !== undefined && object.pollId !== null ? BigInt(object.pollId.toString()) : BigInt(0);
|
|
66
|
+
message.voter = object.voter ?? "";
|
|
67
|
+
message.option = object.option !== undefined && object.option !== null ? BigInt(object.option.toString()) : BigInt(0);
|
|
68
|
+
message.votedAt = object.votedAt !== undefined && object.votedAt !== null ? BigInt(object.votedAt.toString()) : BigInt(0);
|
|
69
|
+
return message;
|
|
70
|
+
},
|
|
71
|
+
fromAmino(object) {
|
|
72
|
+
const message = createBasePollVote();
|
|
73
|
+
if (object.poll_id !== undefined && object.poll_id !== null) {
|
|
74
|
+
message.pollId = BigInt(object.poll_id);
|
|
75
|
+
}
|
|
76
|
+
if (object.voter !== undefined && object.voter !== null) {
|
|
77
|
+
message.voter = object.voter;
|
|
78
|
+
}
|
|
79
|
+
if (object.option !== undefined && object.option !== null) {
|
|
80
|
+
message.option = BigInt(object.option);
|
|
81
|
+
}
|
|
82
|
+
if (object.voted_at !== undefined && object.voted_at !== null) {
|
|
83
|
+
message.votedAt = BigInt(object.voted_at);
|
|
84
|
+
}
|
|
85
|
+
return message;
|
|
86
|
+
},
|
|
87
|
+
toAmino(message) {
|
|
88
|
+
const obj = {};
|
|
89
|
+
obj.poll_id = message.pollId !== BigInt(0) ? message.pollId?.toString() : undefined;
|
|
90
|
+
obj.voter = message.voter === "" ? undefined : message.voter;
|
|
91
|
+
obj.option = message.option !== BigInt(0) ? message.option?.toString() : undefined;
|
|
92
|
+
obj.voted_at = message.votedAt !== BigInt(0) ? message.votedAt?.toString() : undefined;
|
|
93
|
+
return obj;
|
|
94
|
+
},
|
|
95
|
+
fromAminoMsg(object) {
|
|
96
|
+
return exports.PollVote.fromAmino(object.value);
|
|
97
|
+
},
|
|
98
|
+
fromProtoMsg(message) {
|
|
99
|
+
return exports.PollVote.decode(message.value);
|
|
100
|
+
},
|
|
101
|
+
toProto(message) {
|
|
102
|
+
return exports.PollVote.encode(message).finish();
|
|
103
|
+
},
|
|
104
|
+
toProtoMsg(message) {
|
|
105
|
+
return {
|
|
106
|
+
typeUrl: "/sparkdream.commons.v1.PollVote",
|
|
107
|
+
value: exports.PollVote.encode(message).finish()
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
};
|