@ottochain/sdk 1.4.1 → 1.4.2
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/dist/esm/apps/contracts/index.js +10 -28
- package/dist/esm/apps/corporate/index.js +24 -79
- package/dist/esm/apps/governance/index.js +36 -85
- package/dist/esm/apps/identity/constants.js +22 -27
- package/dist/esm/apps/identity/index.js +7 -35
- package/dist/esm/apps/index.js +6 -32
- package/dist/esm/apps/markets/index.js +6 -27
- package/dist/esm/apps/oracles/index.js +7 -27
- package/dist/esm/errors.js +9 -19
- package/dist/esm/generated/google/protobuf/struct.js +33 -39
- package/dist/esm/generated/google/protobuf/timestamp.js +6 -9
- package/dist/esm/generated/index.js +10 -134
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +48 -54
- package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +335 -357
- package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +284 -299
- package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +38 -47
- package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +44 -50
- package/dist/esm/generated/ottochain/apps/markets/v1/market.js +77 -86
- package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +66 -72
- package/dist/esm/generated/ottochain/v1/common.js +1 -4
- package/dist/esm/generated/ottochain/v1/fiber.js +90 -96
- package/dist/esm/generated/ottochain/v1/messages.js +79 -82
- package/dist/esm/generated/ottochain/v1/records.js +137 -140
- package/dist/esm/index.js +13 -70
- package/dist/esm/ottochain/drop-nulls.js +1 -5
- package/dist/esm/ottochain/index.js +6 -54
- package/dist/esm/ottochain/metagraph-client.js +12 -16
- package/dist/esm/ottochain/normalize.js +4 -11
- package/dist/esm/ottochain/snapshot.js +10 -20
- package/dist/esm/ottochain/transaction.js +13 -25
- package/dist/esm/ottochain/types.js +1 -2
- package/dist/esm/types.js +2 -7
- package/dist/esm/validation.js +65 -76
- package/dist/esm/verify.js +3 -7
- package/package.json +1 -1
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
2
|
// versions:
|
|
4
3
|
// protoc-gen-ts_proto v2.11.2
|
|
5
4
|
// protoc unknown
|
|
6
5
|
// source: ottochain/apps/governance/v1/governance.proto
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ExecuteRequest = exports.VoteRequest = exports.ProposeRequest = exports.CreateDAORequest = exports.ThresholdHistoryEntry = exports.ThresholdVotes = exports.ThresholdDAO_MemberJoinedAtEntry = exports.ThresholdDAO = exports.TokenProposalResult = exports.TokenDAO_DelegationsEntry = exports.TokenDAO_BalancesEntry = exports.TokenDAO = exports.MultisigAction_SignaturesEntry = exports.MultisigAction = exports.MultisigDAO_SignaturesEntry = exports.MultisigDAO = exports.OwnershipTransfer = exports.SingleOwnerAction = exports.SingleOwnerDAO = exports.VoteTally = exports.Vote = exports.Proposal = exports.DAOMetadata = exports.voteChoiceToNumber = exports.voteChoiceToJSON = exports.voteChoiceFromJSON = exports.VoteChoice = exports.proposalStatusToNumber = exports.proposalStatusToJSON = exports.proposalStatusFromJSON = exports.ProposalStatus = exports.dAOStatusToNumber = exports.dAOStatusToJSON = exports.dAOStatusFromJSON = exports.DAOStatus = exports.dAOTypeToNumber = exports.dAOTypeToJSON = exports.dAOTypeFromJSON = exports.DAOType = exports.protobufPackage = void 0;
|
|
9
6
|
/* eslint-disable */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { Struct } from "../../../../google/protobuf/struct.js";
|
|
9
|
+
import { Timestamp } from "../../../../google/protobuf/timestamp.js";
|
|
10
|
+
export const protobufPackage = "ottochain.apps.governance.v1";
|
|
14
11
|
/** Type of DAO governance model */
|
|
15
|
-
var DAOType;
|
|
12
|
+
export var DAOType;
|
|
16
13
|
(function (DAOType) {
|
|
17
14
|
DAOType["DAO_TYPE_UNSPECIFIED"] = "DAO_TYPE_UNSPECIFIED";
|
|
18
15
|
/** DAO_TYPE_SINGLE - Single owner controls all actions */
|
|
@@ -24,8 +21,8 @@ var DAOType;
|
|
|
24
21
|
/** DAO_TYPE_THRESHOLD - Reputation threshold for participation */
|
|
25
22
|
DAOType["DAO_TYPE_THRESHOLD"] = "DAO_TYPE_THRESHOLD";
|
|
26
23
|
DAOType["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
27
|
-
})(DAOType || (
|
|
28
|
-
function dAOTypeFromJSON(object) {
|
|
24
|
+
})(DAOType || (DAOType = {}));
|
|
25
|
+
export function dAOTypeFromJSON(object) {
|
|
29
26
|
switch (object) {
|
|
30
27
|
case 0:
|
|
31
28
|
case "DAO_TYPE_UNSPECIFIED":
|
|
@@ -48,8 +45,7 @@ function dAOTypeFromJSON(object) {
|
|
|
48
45
|
return DAOType.UNRECOGNIZED;
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
|
|
52
|
-
function dAOTypeToJSON(object) {
|
|
48
|
+
export function dAOTypeToJSON(object) {
|
|
53
49
|
switch (object) {
|
|
54
50
|
case DAOType.DAO_TYPE_UNSPECIFIED:
|
|
55
51
|
return "DAO_TYPE_UNSPECIFIED";
|
|
@@ -66,8 +62,7 @@ function dAOTypeToJSON(object) {
|
|
|
66
62
|
return "UNRECOGNIZED";
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
|
-
|
|
70
|
-
function dAOTypeToNumber(object) {
|
|
65
|
+
export function dAOTypeToNumber(object) {
|
|
71
66
|
switch (object) {
|
|
72
67
|
case DAOType.DAO_TYPE_UNSPECIFIED:
|
|
73
68
|
return 0;
|
|
@@ -84,16 +79,15 @@ function dAOTypeToNumber(object) {
|
|
|
84
79
|
return -1;
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
|
-
exports.dAOTypeToNumber = dAOTypeToNumber;
|
|
88
82
|
/** DAO lifecycle status */
|
|
89
|
-
var DAOStatus;
|
|
83
|
+
export var DAOStatus;
|
|
90
84
|
(function (DAOStatus) {
|
|
91
85
|
DAOStatus["DAO_STATUS_UNSPECIFIED"] = "DAO_STATUS_UNSPECIFIED";
|
|
92
86
|
DAOStatus["DAO_STATUS_ACTIVE"] = "DAO_STATUS_ACTIVE";
|
|
93
87
|
DAOStatus["DAO_STATUS_DISSOLVED"] = "DAO_STATUS_DISSOLVED";
|
|
94
88
|
DAOStatus["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
95
|
-
})(DAOStatus || (
|
|
96
|
-
function dAOStatusFromJSON(object) {
|
|
89
|
+
})(DAOStatus || (DAOStatus = {}));
|
|
90
|
+
export function dAOStatusFromJSON(object) {
|
|
97
91
|
switch (object) {
|
|
98
92
|
case 0:
|
|
99
93
|
case "DAO_STATUS_UNSPECIFIED":
|
|
@@ -110,8 +104,7 @@ function dAOStatusFromJSON(object) {
|
|
|
110
104
|
return DAOStatus.UNRECOGNIZED;
|
|
111
105
|
}
|
|
112
106
|
}
|
|
113
|
-
|
|
114
|
-
function dAOStatusToJSON(object) {
|
|
107
|
+
export function dAOStatusToJSON(object) {
|
|
115
108
|
switch (object) {
|
|
116
109
|
case DAOStatus.DAO_STATUS_UNSPECIFIED:
|
|
117
110
|
return "DAO_STATUS_UNSPECIFIED";
|
|
@@ -124,8 +117,7 @@ function dAOStatusToJSON(object) {
|
|
|
124
117
|
return "UNRECOGNIZED";
|
|
125
118
|
}
|
|
126
119
|
}
|
|
127
|
-
|
|
128
|
-
function dAOStatusToNumber(object) {
|
|
120
|
+
export function dAOStatusToNumber(object) {
|
|
129
121
|
switch (object) {
|
|
130
122
|
case DAOStatus.DAO_STATUS_UNSPECIFIED:
|
|
131
123
|
return 0;
|
|
@@ -138,9 +130,8 @@ function dAOStatusToNumber(object) {
|
|
|
138
130
|
return -1;
|
|
139
131
|
}
|
|
140
132
|
}
|
|
141
|
-
exports.dAOStatusToNumber = dAOStatusToNumber;
|
|
142
133
|
/** Proposal status for voting DAOs */
|
|
143
|
-
var ProposalStatus;
|
|
134
|
+
export var ProposalStatus;
|
|
144
135
|
(function (ProposalStatus) {
|
|
145
136
|
ProposalStatus["PROPOSAL_STATUS_UNSPECIFIED"] = "PROPOSAL_STATUS_UNSPECIFIED";
|
|
146
137
|
ProposalStatus["PROPOSAL_STATUS_PENDING"] = "PROPOSAL_STATUS_PENDING";
|
|
@@ -150,8 +141,8 @@ var ProposalStatus;
|
|
|
150
141
|
ProposalStatus["PROPOSAL_STATUS_REJECTED"] = "PROPOSAL_STATUS_REJECTED";
|
|
151
142
|
ProposalStatus["PROPOSAL_STATUS_CANCELLED"] = "PROPOSAL_STATUS_CANCELLED";
|
|
152
143
|
ProposalStatus["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
153
|
-
})(ProposalStatus || (
|
|
154
|
-
function proposalStatusFromJSON(object) {
|
|
144
|
+
})(ProposalStatus || (ProposalStatus = {}));
|
|
145
|
+
export function proposalStatusFromJSON(object) {
|
|
155
146
|
switch (object) {
|
|
156
147
|
case 0:
|
|
157
148
|
case "PROPOSAL_STATUS_UNSPECIFIED":
|
|
@@ -180,8 +171,7 @@ function proposalStatusFromJSON(object) {
|
|
|
180
171
|
return ProposalStatus.UNRECOGNIZED;
|
|
181
172
|
}
|
|
182
173
|
}
|
|
183
|
-
|
|
184
|
-
function proposalStatusToJSON(object) {
|
|
174
|
+
export function proposalStatusToJSON(object) {
|
|
185
175
|
switch (object) {
|
|
186
176
|
case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED:
|
|
187
177
|
return "PROPOSAL_STATUS_UNSPECIFIED";
|
|
@@ -202,8 +192,7 @@ function proposalStatusToJSON(object) {
|
|
|
202
192
|
return "UNRECOGNIZED";
|
|
203
193
|
}
|
|
204
194
|
}
|
|
205
|
-
|
|
206
|
-
function proposalStatusToNumber(object) {
|
|
195
|
+
export function proposalStatusToNumber(object) {
|
|
207
196
|
switch (object) {
|
|
208
197
|
case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED:
|
|
209
198
|
return 0;
|
|
@@ -224,17 +213,16 @@ function proposalStatusToNumber(object) {
|
|
|
224
213
|
return -1;
|
|
225
214
|
}
|
|
226
215
|
}
|
|
227
|
-
exports.proposalStatusToNumber = proposalStatusToNumber;
|
|
228
216
|
/** Vote choice */
|
|
229
|
-
var VoteChoice;
|
|
217
|
+
export var VoteChoice;
|
|
230
218
|
(function (VoteChoice) {
|
|
231
219
|
VoteChoice["VOTE_CHOICE_UNSPECIFIED"] = "VOTE_CHOICE_UNSPECIFIED";
|
|
232
220
|
VoteChoice["VOTE_CHOICE_FOR"] = "VOTE_CHOICE_FOR";
|
|
233
221
|
VoteChoice["VOTE_CHOICE_AGAINST"] = "VOTE_CHOICE_AGAINST";
|
|
234
222
|
VoteChoice["VOTE_CHOICE_ABSTAIN"] = "VOTE_CHOICE_ABSTAIN";
|
|
235
223
|
VoteChoice["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
236
|
-
})(VoteChoice || (
|
|
237
|
-
function voteChoiceFromJSON(object) {
|
|
224
|
+
})(VoteChoice || (VoteChoice = {}));
|
|
225
|
+
export function voteChoiceFromJSON(object) {
|
|
238
226
|
switch (object) {
|
|
239
227
|
case 0:
|
|
240
228
|
case "VOTE_CHOICE_UNSPECIFIED":
|
|
@@ -254,8 +242,7 @@ function voteChoiceFromJSON(object) {
|
|
|
254
242
|
return VoteChoice.UNRECOGNIZED;
|
|
255
243
|
}
|
|
256
244
|
}
|
|
257
|
-
|
|
258
|
-
function voteChoiceToJSON(object) {
|
|
245
|
+
export function voteChoiceToJSON(object) {
|
|
259
246
|
switch (object) {
|
|
260
247
|
case VoteChoice.VOTE_CHOICE_UNSPECIFIED:
|
|
261
248
|
return "VOTE_CHOICE_UNSPECIFIED";
|
|
@@ -270,8 +257,7 @@ function voteChoiceToJSON(object) {
|
|
|
270
257
|
return "UNRECOGNIZED";
|
|
271
258
|
}
|
|
272
259
|
}
|
|
273
|
-
|
|
274
|
-
function voteChoiceToNumber(object) {
|
|
260
|
+
export function voteChoiceToNumber(object) {
|
|
275
261
|
switch (object) {
|
|
276
262
|
case VoteChoice.VOTE_CHOICE_UNSPECIFIED:
|
|
277
263
|
return 0;
|
|
@@ -286,12 +272,11 @@ function voteChoiceToNumber(object) {
|
|
|
286
272
|
return -1;
|
|
287
273
|
}
|
|
288
274
|
}
|
|
289
|
-
exports.voteChoiceToNumber = voteChoiceToNumber;
|
|
290
275
|
function createBaseDAOMetadata() {
|
|
291
276
|
return { description: "", website: "", logo: "", extra: undefined };
|
|
292
277
|
}
|
|
293
|
-
|
|
294
|
-
encode(message, writer = new
|
|
278
|
+
export const DAOMetadata = {
|
|
279
|
+
encode(message, writer = new BinaryWriter()) {
|
|
295
280
|
if (message.description !== "") {
|
|
296
281
|
writer.uint32(10).string(message.description);
|
|
297
282
|
}
|
|
@@ -302,12 +287,12 @@ exports.DAOMetadata = {
|
|
|
302
287
|
writer.uint32(26).string(message.logo);
|
|
303
288
|
}
|
|
304
289
|
if (message.extra !== undefined) {
|
|
305
|
-
|
|
290
|
+
Struct.encode(Struct.wrap(message.extra), writer.uint32(34).fork()).join();
|
|
306
291
|
}
|
|
307
292
|
return writer;
|
|
308
293
|
},
|
|
309
294
|
decode(input, length) {
|
|
310
|
-
const reader = input instanceof
|
|
295
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
311
296
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
312
297
|
const message = createBaseDAOMetadata();
|
|
313
298
|
while (reader.pos < end) {
|
|
@@ -338,7 +323,7 @@ exports.DAOMetadata = {
|
|
|
338
323
|
if (tag !== 34) {
|
|
339
324
|
break;
|
|
340
325
|
}
|
|
341
|
-
message.extra =
|
|
326
|
+
message.extra = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
342
327
|
continue;
|
|
343
328
|
}
|
|
344
329
|
}
|
|
@@ -374,7 +359,7 @@ exports.DAOMetadata = {
|
|
|
374
359
|
return obj;
|
|
375
360
|
},
|
|
376
361
|
create(base) {
|
|
377
|
-
return
|
|
362
|
+
return DAOMetadata.fromPartial(base ?? {});
|
|
378
363
|
},
|
|
379
364
|
fromPartial(object) {
|
|
380
365
|
const message = createBaseDAOMetadata();
|
|
@@ -399,8 +384,8 @@ function createBaseProposal() {
|
|
|
399
384
|
executableAt: undefined,
|
|
400
385
|
};
|
|
401
386
|
}
|
|
402
|
-
|
|
403
|
-
encode(message, writer = new
|
|
387
|
+
export const Proposal = {
|
|
388
|
+
encode(message, writer = new BinaryWriter()) {
|
|
404
389
|
if (message.id !== "") {
|
|
405
390
|
writer.uint32(10).string(message.id);
|
|
406
391
|
}
|
|
@@ -414,27 +399,27 @@ exports.Proposal = {
|
|
|
414
399
|
writer.uint32(34).string(message.actionType);
|
|
415
400
|
}
|
|
416
401
|
if (message.payload !== undefined) {
|
|
417
|
-
|
|
402
|
+
Struct.encode(Struct.wrap(message.payload), writer.uint32(42).fork()).join();
|
|
418
403
|
}
|
|
419
404
|
if (message.proposer !== "") {
|
|
420
405
|
writer.uint32(50).string(message.proposer);
|
|
421
406
|
}
|
|
422
407
|
if (message.proposedAt !== undefined) {
|
|
423
|
-
|
|
408
|
+
Timestamp.encode(toTimestamp(message.proposedAt), writer.uint32(58).fork()).join();
|
|
424
409
|
}
|
|
425
410
|
if (message.deadline !== undefined) {
|
|
426
|
-
|
|
411
|
+
Timestamp.encode(toTimestamp(message.deadline), writer.uint32(66).fork()).join();
|
|
427
412
|
}
|
|
428
413
|
if (message.queuedAt !== undefined) {
|
|
429
|
-
|
|
414
|
+
Timestamp.encode(toTimestamp(message.queuedAt), writer.uint32(74).fork()).join();
|
|
430
415
|
}
|
|
431
416
|
if (message.executableAt !== undefined) {
|
|
432
|
-
|
|
417
|
+
Timestamp.encode(toTimestamp(message.executableAt), writer.uint32(82).fork()).join();
|
|
433
418
|
}
|
|
434
419
|
return writer;
|
|
435
420
|
},
|
|
436
421
|
decode(input, length) {
|
|
437
|
-
const reader = input instanceof
|
|
422
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
438
423
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
439
424
|
const message = createBaseProposal();
|
|
440
425
|
while (reader.pos < end) {
|
|
@@ -472,7 +457,7 @@ exports.Proposal = {
|
|
|
472
457
|
if (tag !== 42) {
|
|
473
458
|
break;
|
|
474
459
|
}
|
|
475
|
-
message.payload =
|
|
460
|
+
message.payload = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
476
461
|
continue;
|
|
477
462
|
}
|
|
478
463
|
case 6: {
|
|
@@ -486,28 +471,28 @@ exports.Proposal = {
|
|
|
486
471
|
if (tag !== 58) {
|
|
487
472
|
break;
|
|
488
473
|
}
|
|
489
|
-
message.proposedAt = fromTimestamp(
|
|
474
|
+
message.proposedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
490
475
|
continue;
|
|
491
476
|
}
|
|
492
477
|
case 8: {
|
|
493
478
|
if (tag !== 66) {
|
|
494
479
|
break;
|
|
495
480
|
}
|
|
496
|
-
message.deadline = fromTimestamp(
|
|
481
|
+
message.deadline = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
497
482
|
continue;
|
|
498
483
|
}
|
|
499
484
|
case 9: {
|
|
500
485
|
if (tag !== 74) {
|
|
501
486
|
break;
|
|
502
487
|
}
|
|
503
|
-
message.queuedAt = fromTimestamp(
|
|
488
|
+
message.queuedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
504
489
|
continue;
|
|
505
490
|
}
|
|
506
491
|
case 10: {
|
|
507
492
|
if (tag !== 82) {
|
|
508
493
|
break;
|
|
509
494
|
}
|
|
510
|
-
message.executableAt = fromTimestamp(
|
|
495
|
+
message.executableAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
511
496
|
continue;
|
|
512
497
|
}
|
|
513
498
|
}
|
|
@@ -583,7 +568,7 @@ exports.Proposal = {
|
|
|
583
568
|
return obj;
|
|
584
569
|
},
|
|
585
570
|
create(base) {
|
|
586
|
-
return
|
|
571
|
+
return Proposal.fromPartial(base ?? {});
|
|
587
572
|
},
|
|
588
573
|
fromPartial(object) {
|
|
589
574
|
const message = createBaseProposal();
|
|
@@ -603,8 +588,8 @@ exports.Proposal = {
|
|
|
603
588
|
function createBaseVote() {
|
|
604
589
|
return { voter: "", choice: VoteChoice.VOTE_CHOICE_UNSPECIFIED, weight: 0, votedAt: undefined };
|
|
605
590
|
}
|
|
606
|
-
|
|
607
|
-
encode(message, writer = new
|
|
591
|
+
export const Vote = {
|
|
592
|
+
encode(message, writer = new BinaryWriter()) {
|
|
608
593
|
if (message.voter !== "") {
|
|
609
594
|
writer.uint32(10).string(message.voter);
|
|
610
595
|
}
|
|
@@ -615,12 +600,12 @@ exports.Vote = {
|
|
|
615
600
|
writer.uint32(24).int64(message.weight);
|
|
616
601
|
}
|
|
617
602
|
if (message.votedAt !== undefined) {
|
|
618
|
-
|
|
603
|
+
Timestamp.encode(toTimestamp(message.votedAt), writer.uint32(34).fork()).join();
|
|
619
604
|
}
|
|
620
605
|
return writer;
|
|
621
606
|
},
|
|
622
607
|
decode(input, length) {
|
|
623
|
-
const reader = input instanceof
|
|
608
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
624
609
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
625
610
|
const message = createBaseVote();
|
|
626
611
|
while (reader.pos < end) {
|
|
@@ -651,7 +636,7 @@ exports.Vote = {
|
|
|
651
636
|
if (tag !== 34) {
|
|
652
637
|
break;
|
|
653
638
|
}
|
|
654
|
-
message.votedAt = fromTimestamp(
|
|
639
|
+
message.votedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
655
640
|
continue;
|
|
656
641
|
}
|
|
657
642
|
}
|
|
@@ -691,7 +676,7 @@ exports.Vote = {
|
|
|
691
676
|
return obj;
|
|
692
677
|
},
|
|
693
678
|
create(base) {
|
|
694
|
-
return
|
|
679
|
+
return Vote.fromPartial(base ?? {});
|
|
695
680
|
},
|
|
696
681
|
fromPartial(object) {
|
|
697
682
|
const message = createBaseVote();
|
|
@@ -705,8 +690,8 @@ exports.Vote = {
|
|
|
705
690
|
function createBaseVoteTally() {
|
|
706
691
|
return { votesFor: 0, votesAgainst: 0, votesAbstain: 0, votes: [] };
|
|
707
692
|
}
|
|
708
|
-
|
|
709
|
-
encode(message, writer = new
|
|
693
|
+
export const VoteTally = {
|
|
694
|
+
encode(message, writer = new BinaryWriter()) {
|
|
710
695
|
if (message.votesFor !== 0) {
|
|
711
696
|
writer.uint32(8).int64(message.votesFor);
|
|
712
697
|
}
|
|
@@ -717,12 +702,12 @@ exports.VoteTally = {
|
|
|
717
702
|
writer.uint32(24).int64(message.votesAbstain);
|
|
718
703
|
}
|
|
719
704
|
for (const v of message.votes) {
|
|
720
|
-
|
|
705
|
+
Vote.encode(v, writer.uint32(34).fork()).join();
|
|
721
706
|
}
|
|
722
707
|
return writer;
|
|
723
708
|
},
|
|
724
709
|
decode(input, length) {
|
|
725
|
-
const reader = input instanceof
|
|
710
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
726
711
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
727
712
|
const message = createBaseVoteTally();
|
|
728
713
|
while (reader.pos < end) {
|
|
@@ -753,7 +738,7 @@ exports.VoteTally = {
|
|
|
753
738
|
if (tag !== 34) {
|
|
754
739
|
break;
|
|
755
740
|
}
|
|
756
|
-
message.votes.push(
|
|
741
|
+
message.votes.push(Vote.decode(reader, reader.uint32()));
|
|
757
742
|
continue;
|
|
758
743
|
}
|
|
759
744
|
}
|
|
@@ -781,7 +766,7 @@ exports.VoteTally = {
|
|
|
781
766
|
: isSet(object.votes_abstain)
|
|
782
767
|
? globalThis.Number(object.votes_abstain)
|
|
783
768
|
: 0,
|
|
784
|
-
votes: globalThis.Array.isArray(object?.votes) ? object.votes.map((e) =>
|
|
769
|
+
votes: globalThis.Array.isArray(object?.votes) ? object.votes.map((e) => Vote.fromJSON(e)) : [],
|
|
785
770
|
};
|
|
786
771
|
},
|
|
787
772
|
toJSON(message) {
|
|
@@ -796,19 +781,19 @@ exports.VoteTally = {
|
|
|
796
781
|
obj.votesAbstain = Math.round(message.votesAbstain);
|
|
797
782
|
}
|
|
798
783
|
if (message.votes?.length) {
|
|
799
|
-
obj.votes = message.votes.map((e) =>
|
|
784
|
+
obj.votes = message.votes.map((e) => Vote.toJSON(e));
|
|
800
785
|
}
|
|
801
786
|
return obj;
|
|
802
787
|
},
|
|
803
788
|
create(base) {
|
|
804
|
-
return
|
|
789
|
+
return VoteTally.fromPartial(base ?? {});
|
|
805
790
|
},
|
|
806
791
|
fromPartial(object) {
|
|
807
792
|
const message = createBaseVoteTally();
|
|
808
793
|
message.votesFor = object.votesFor ?? 0;
|
|
809
794
|
message.votesAgainst = object.votesAgainst ?? 0;
|
|
810
795
|
message.votesAbstain = object.votesAbstain ?? 0;
|
|
811
|
-
message.votes = object.votes?.map((e) =>
|
|
796
|
+
message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || [];
|
|
812
797
|
return message;
|
|
813
798
|
},
|
|
814
799
|
};
|
|
@@ -824,8 +809,8 @@ function createBaseSingleOwnerDAO() {
|
|
|
824
809
|
status: DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
825
810
|
};
|
|
826
811
|
}
|
|
827
|
-
|
|
828
|
-
encode(message, writer = new
|
|
812
|
+
export const SingleOwnerDAO = {
|
|
813
|
+
encode(message, writer = new BinaryWriter()) {
|
|
829
814
|
if (message.name !== "") {
|
|
830
815
|
writer.uint32(10).string(message.name);
|
|
831
816
|
}
|
|
@@ -836,16 +821,16 @@ exports.SingleOwnerDAO = {
|
|
|
836
821
|
writer.uint32(26).string(message.pendingOwner);
|
|
837
822
|
}
|
|
838
823
|
if (message.transferInitiatedAt !== undefined) {
|
|
839
|
-
|
|
824
|
+
Timestamp.encode(toTimestamp(message.transferInitiatedAt), writer.uint32(34).fork()).join();
|
|
840
825
|
}
|
|
841
826
|
for (const v of message.actions) {
|
|
842
|
-
|
|
827
|
+
SingleOwnerAction.encode(v, writer.uint32(42).fork()).join();
|
|
843
828
|
}
|
|
844
829
|
for (const v of message.ownershipHistory) {
|
|
845
|
-
|
|
830
|
+
OwnershipTransfer.encode(v, writer.uint32(50).fork()).join();
|
|
846
831
|
}
|
|
847
832
|
if (message.metadata !== undefined) {
|
|
848
|
-
|
|
833
|
+
DAOMetadata.encode(message.metadata, writer.uint32(58).fork()).join();
|
|
849
834
|
}
|
|
850
835
|
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
851
836
|
writer.uint32(64).int32(dAOStatusToNumber(message.status));
|
|
@@ -853,7 +838,7 @@ exports.SingleOwnerDAO = {
|
|
|
853
838
|
return writer;
|
|
854
839
|
},
|
|
855
840
|
decode(input, length) {
|
|
856
|
-
const reader = input instanceof
|
|
841
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
857
842
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
858
843
|
const message = createBaseSingleOwnerDAO();
|
|
859
844
|
while (reader.pos < end) {
|
|
@@ -884,28 +869,28 @@ exports.SingleOwnerDAO = {
|
|
|
884
869
|
if (tag !== 34) {
|
|
885
870
|
break;
|
|
886
871
|
}
|
|
887
|
-
message.transferInitiatedAt = fromTimestamp(
|
|
872
|
+
message.transferInitiatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
888
873
|
continue;
|
|
889
874
|
}
|
|
890
875
|
case 5: {
|
|
891
876
|
if (tag !== 42) {
|
|
892
877
|
break;
|
|
893
878
|
}
|
|
894
|
-
message.actions.push(
|
|
879
|
+
message.actions.push(SingleOwnerAction.decode(reader, reader.uint32()));
|
|
895
880
|
continue;
|
|
896
881
|
}
|
|
897
882
|
case 6: {
|
|
898
883
|
if (tag !== 50) {
|
|
899
884
|
break;
|
|
900
885
|
}
|
|
901
|
-
message.ownershipHistory.push(
|
|
886
|
+
message.ownershipHistory.push(OwnershipTransfer.decode(reader, reader.uint32()));
|
|
902
887
|
continue;
|
|
903
888
|
}
|
|
904
889
|
case 7: {
|
|
905
890
|
if (tag !== 58) {
|
|
906
891
|
break;
|
|
907
892
|
}
|
|
908
|
-
message.metadata =
|
|
893
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
909
894
|
continue;
|
|
910
895
|
}
|
|
911
896
|
case 8: {
|
|
@@ -938,14 +923,14 @@ exports.SingleOwnerDAO = {
|
|
|
938
923
|
? fromJsonTimestamp(object.transfer_initiated_at)
|
|
939
924
|
: undefined,
|
|
940
925
|
actions: globalThis.Array.isArray(object?.actions)
|
|
941
|
-
? object.actions.map((e) =>
|
|
926
|
+
? object.actions.map((e) => SingleOwnerAction.fromJSON(e))
|
|
942
927
|
: [],
|
|
943
928
|
ownershipHistory: globalThis.Array.isArray(object?.ownershipHistory)
|
|
944
|
-
? object.ownershipHistory.map((e) =>
|
|
929
|
+
? object.ownershipHistory.map((e) => OwnershipTransfer.fromJSON(e))
|
|
945
930
|
: globalThis.Array.isArray(object?.ownership_history)
|
|
946
|
-
? object.ownership_history.map((e) =>
|
|
931
|
+
? object.ownership_history.map((e) => OwnershipTransfer.fromJSON(e))
|
|
947
932
|
: [],
|
|
948
|
-
metadata: isSet(object.metadata) ?
|
|
933
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
949
934
|
status: isSet(object.status) ? dAOStatusFromJSON(object.status) : DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
950
935
|
};
|
|
951
936
|
},
|
|
@@ -964,13 +949,13 @@ exports.SingleOwnerDAO = {
|
|
|
964
949
|
obj.transferInitiatedAt = message.transferInitiatedAt.toISOString();
|
|
965
950
|
}
|
|
966
951
|
if (message.actions?.length) {
|
|
967
|
-
obj.actions = message.actions.map((e) =>
|
|
952
|
+
obj.actions = message.actions.map((e) => SingleOwnerAction.toJSON(e));
|
|
968
953
|
}
|
|
969
954
|
if (message.ownershipHistory?.length) {
|
|
970
|
-
obj.ownershipHistory = message.ownershipHistory.map((e) =>
|
|
955
|
+
obj.ownershipHistory = message.ownershipHistory.map((e) => OwnershipTransfer.toJSON(e));
|
|
971
956
|
}
|
|
972
957
|
if (message.metadata !== undefined) {
|
|
973
|
-
obj.metadata =
|
|
958
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
974
959
|
}
|
|
975
960
|
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
976
961
|
obj.status = dAOStatusToJSON(message.status);
|
|
@@ -978,7 +963,7 @@ exports.SingleOwnerDAO = {
|
|
|
978
963
|
return obj;
|
|
979
964
|
},
|
|
980
965
|
create(base) {
|
|
981
|
-
return
|
|
966
|
+
return SingleOwnerDAO.fromPartial(base ?? {});
|
|
982
967
|
},
|
|
983
968
|
fromPartial(object) {
|
|
984
969
|
const message = createBaseSingleOwnerDAO();
|
|
@@ -986,10 +971,10 @@ exports.SingleOwnerDAO = {
|
|
|
986
971
|
message.owner = object.owner ?? "";
|
|
987
972
|
message.pendingOwner = object.pendingOwner ?? "";
|
|
988
973
|
message.transferInitiatedAt = object.transferInitiatedAt ?? undefined;
|
|
989
|
-
message.actions = object.actions?.map((e) =>
|
|
990
|
-
message.ownershipHistory = object.ownershipHistory?.map((e) =>
|
|
974
|
+
message.actions = object.actions?.map((e) => SingleOwnerAction.fromPartial(e)) || [];
|
|
975
|
+
message.ownershipHistory = object.ownershipHistory?.map((e) => OwnershipTransfer.fromPartial(e)) || [];
|
|
991
976
|
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
992
|
-
?
|
|
977
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
993
978
|
: undefined;
|
|
994
979
|
message.status = object.status ?? DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
995
980
|
return message;
|
|
@@ -998,8 +983,8 @@ exports.SingleOwnerDAO = {
|
|
|
998
983
|
function createBaseSingleOwnerAction() {
|
|
999
984
|
return { id: "", actionType: "", payload: undefined, executedAt: undefined };
|
|
1000
985
|
}
|
|
1001
|
-
|
|
1002
|
-
encode(message, writer = new
|
|
986
|
+
export const SingleOwnerAction = {
|
|
987
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1003
988
|
if (message.id !== "") {
|
|
1004
989
|
writer.uint32(10).string(message.id);
|
|
1005
990
|
}
|
|
@@ -1007,15 +992,15 @@ exports.SingleOwnerAction = {
|
|
|
1007
992
|
writer.uint32(18).string(message.actionType);
|
|
1008
993
|
}
|
|
1009
994
|
if (message.payload !== undefined) {
|
|
1010
|
-
|
|
995
|
+
Struct.encode(Struct.wrap(message.payload), writer.uint32(26).fork()).join();
|
|
1011
996
|
}
|
|
1012
997
|
if (message.executedAt !== undefined) {
|
|
1013
|
-
|
|
998
|
+
Timestamp.encode(toTimestamp(message.executedAt), writer.uint32(34).fork()).join();
|
|
1014
999
|
}
|
|
1015
1000
|
return writer;
|
|
1016
1001
|
},
|
|
1017
1002
|
decode(input, length) {
|
|
1018
|
-
const reader = input instanceof
|
|
1003
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1019
1004
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1020
1005
|
const message = createBaseSingleOwnerAction();
|
|
1021
1006
|
while (reader.pos < end) {
|
|
@@ -1039,14 +1024,14 @@ exports.SingleOwnerAction = {
|
|
|
1039
1024
|
if (tag !== 26) {
|
|
1040
1025
|
break;
|
|
1041
1026
|
}
|
|
1042
|
-
message.payload =
|
|
1027
|
+
message.payload = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
1043
1028
|
continue;
|
|
1044
1029
|
}
|
|
1045
1030
|
case 4: {
|
|
1046
1031
|
if (tag !== 34) {
|
|
1047
1032
|
break;
|
|
1048
1033
|
}
|
|
1049
|
-
message.executedAt = fromTimestamp(
|
|
1034
|
+
message.executedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1050
1035
|
continue;
|
|
1051
1036
|
}
|
|
1052
1037
|
}
|
|
@@ -1090,7 +1075,7 @@ exports.SingleOwnerAction = {
|
|
|
1090
1075
|
return obj;
|
|
1091
1076
|
},
|
|
1092
1077
|
create(base) {
|
|
1093
|
-
return
|
|
1078
|
+
return SingleOwnerAction.fromPartial(base ?? {});
|
|
1094
1079
|
},
|
|
1095
1080
|
fromPartial(object) {
|
|
1096
1081
|
const message = createBaseSingleOwnerAction();
|
|
@@ -1104,8 +1089,8 @@ exports.SingleOwnerAction = {
|
|
|
1104
1089
|
function createBaseOwnershipTransfer() {
|
|
1105
1090
|
return { from: "", to: "", at: undefined };
|
|
1106
1091
|
}
|
|
1107
|
-
|
|
1108
|
-
encode(message, writer = new
|
|
1092
|
+
export const OwnershipTransfer = {
|
|
1093
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1109
1094
|
if (message.from !== "") {
|
|
1110
1095
|
writer.uint32(10).string(message.from);
|
|
1111
1096
|
}
|
|
@@ -1113,12 +1098,12 @@ exports.OwnershipTransfer = {
|
|
|
1113
1098
|
writer.uint32(18).string(message.to);
|
|
1114
1099
|
}
|
|
1115
1100
|
if (message.at !== undefined) {
|
|
1116
|
-
|
|
1101
|
+
Timestamp.encode(toTimestamp(message.at), writer.uint32(26).fork()).join();
|
|
1117
1102
|
}
|
|
1118
1103
|
return writer;
|
|
1119
1104
|
},
|
|
1120
1105
|
decode(input, length) {
|
|
1121
|
-
const reader = input instanceof
|
|
1106
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1122
1107
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1123
1108
|
const message = createBaseOwnershipTransfer();
|
|
1124
1109
|
while (reader.pos < end) {
|
|
@@ -1142,7 +1127,7 @@ exports.OwnershipTransfer = {
|
|
|
1142
1127
|
if (tag !== 26) {
|
|
1143
1128
|
break;
|
|
1144
1129
|
}
|
|
1145
|
-
message.at = fromTimestamp(
|
|
1130
|
+
message.at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1146
1131
|
continue;
|
|
1147
1132
|
}
|
|
1148
1133
|
}
|
|
@@ -1174,7 +1159,7 @@ exports.OwnershipTransfer = {
|
|
|
1174
1159
|
return obj;
|
|
1175
1160
|
},
|
|
1176
1161
|
create(base) {
|
|
1177
|
-
return
|
|
1162
|
+
return OwnershipTransfer.fromPartial(base ?? {});
|
|
1178
1163
|
},
|
|
1179
1164
|
fromPartial(object) {
|
|
1180
1165
|
const message = createBaseOwnershipTransfer();
|
|
@@ -1198,8 +1183,8 @@ function createBaseMultisigDAO() {
|
|
|
1198
1183
|
status: DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
1199
1184
|
};
|
|
1200
1185
|
}
|
|
1201
|
-
|
|
1202
|
-
encode(message, writer = new
|
|
1186
|
+
export const MultisigDAO = {
|
|
1187
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1203
1188
|
if (message.name !== "") {
|
|
1204
1189
|
writer.uint32(10).string(message.name);
|
|
1205
1190
|
}
|
|
@@ -1213,19 +1198,19 @@ exports.MultisigDAO = {
|
|
|
1213
1198
|
writer.uint32(32).int64(message.proposalTtlMs);
|
|
1214
1199
|
}
|
|
1215
1200
|
if (message.proposal !== undefined) {
|
|
1216
|
-
|
|
1201
|
+
Proposal.encode(message.proposal, writer.uint32(42).fork()).join();
|
|
1217
1202
|
}
|
|
1218
1203
|
globalThis.Object.entries(message.signatures).forEach(([key, value]) => {
|
|
1219
|
-
|
|
1204
|
+
MultisigDAO_SignaturesEntry.encode({ key: key, value }, writer.uint32(50).fork()).join();
|
|
1220
1205
|
});
|
|
1221
1206
|
for (const v of message.actions) {
|
|
1222
|
-
|
|
1207
|
+
MultisigAction.encode(v, writer.uint32(58).fork()).join();
|
|
1223
1208
|
}
|
|
1224
1209
|
for (const v of message.cancelledProposals) {
|
|
1225
|
-
|
|
1210
|
+
Proposal.encode(v, writer.uint32(66).fork()).join();
|
|
1226
1211
|
}
|
|
1227
1212
|
if (message.metadata !== undefined) {
|
|
1228
|
-
|
|
1213
|
+
DAOMetadata.encode(message.metadata, writer.uint32(74).fork()).join();
|
|
1229
1214
|
}
|
|
1230
1215
|
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
1231
1216
|
writer.uint32(80).int32(dAOStatusToNumber(message.status));
|
|
@@ -1233,7 +1218,7 @@ exports.MultisigDAO = {
|
|
|
1233
1218
|
return writer;
|
|
1234
1219
|
},
|
|
1235
1220
|
decode(input, length) {
|
|
1236
|
-
const reader = input instanceof
|
|
1221
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1237
1222
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1238
1223
|
const message = createBaseMultisigDAO();
|
|
1239
1224
|
while (reader.pos < end) {
|
|
@@ -1271,14 +1256,14 @@ exports.MultisigDAO = {
|
|
|
1271
1256
|
if (tag !== 42) {
|
|
1272
1257
|
break;
|
|
1273
1258
|
}
|
|
1274
|
-
message.proposal =
|
|
1259
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
1275
1260
|
continue;
|
|
1276
1261
|
}
|
|
1277
1262
|
case 6: {
|
|
1278
1263
|
if (tag !== 50) {
|
|
1279
1264
|
break;
|
|
1280
1265
|
}
|
|
1281
|
-
const entry6 =
|
|
1266
|
+
const entry6 = MultisigDAO_SignaturesEntry.decode(reader, reader.uint32());
|
|
1282
1267
|
if (entry6.value !== undefined) {
|
|
1283
1268
|
message.signatures[entry6.key] = entry6.value;
|
|
1284
1269
|
}
|
|
@@ -1288,21 +1273,21 @@ exports.MultisigDAO = {
|
|
|
1288
1273
|
if (tag !== 58) {
|
|
1289
1274
|
break;
|
|
1290
1275
|
}
|
|
1291
|
-
message.actions.push(
|
|
1276
|
+
message.actions.push(MultisigAction.decode(reader, reader.uint32()));
|
|
1292
1277
|
continue;
|
|
1293
1278
|
}
|
|
1294
1279
|
case 8: {
|
|
1295
1280
|
if (tag !== 66) {
|
|
1296
1281
|
break;
|
|
1297
1282
|
}
|
|
1298
|
-
message.cancelledProposals.push(
|
|
1283
|
+
message.cancelledProposals.push(Proposal.decode(reader, reader.uint32()));
|
|
1299
1284
|
continue;
|
|
1300
1285
|
}
|
|
1301
1286
|
case 9: {
|
|
1302
1287
|
if (tag !== 74) {
|
|
1303
1288
|
break;
|
|
1304
1289
|
}
|
|
1305
|
-
message.metadata =
|
|
1290
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
1306
1291
|
continue;
|
|
1307
1292
|
}
|
|
1308
1293
|
case 10: {
|
|
@@ -1330,7 +1315,7 @@ exports.MultisigDAO = {
|
|
|
1330
1315
|
: isSet(object.proposal_ttl_ms)
|
|
1331
1316
|
? globalThis.Number(object.proposal_ttl_ms)
|
|
1332
1317
|
: 0,
|
|
1333
|
-
proposal: isSet(object.proposal) ?
|
|
1318
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
1334
1319
|
signatures: isObject(object.signatures)
|
|
1335
1320
|
? globalThis.Object.entries(object.signatures).reduce((acc, [key, value]) => {
|
|
1336
1321
|
acc[key] = globalThis.Number(value);
|
|
@@ -1338,14 +1323,14 @@ exports.MultisigDAO = {
|
|
|
1338
1323
|
}, {})
|
|
1339
1324
|
: {},
|
|
1340
1325
|
actions: globalThis.Array.isArray(object?.actions)
|
|
1341
|
-
? object.actions.map((e) =>
|
|
1326
|
+
? object.actions.map((e) => MultisigAction.fromJSON(e))
|
|
1342
1327
|
: [],
|
|
1343
1328
|
cancelledProposals: globalThis.Array.isArray(object?.cancelledProposals)
|
|
1344
|
-
? object.cancelledProposals.map((e) =>
|
|
1329
|
+
? object.cancelledProposals.map((e) => Proposal.fromJSON(e))
|
|
1345
1330
|
: globalThis.Array.isArray(object?.cancelled_proposals)
|
|
1346
|
-
? object.cancelled_proposals.map((e) =>
|
|
1331
|
+
? object.cancelled_proposals.map((e) => Proposal.fromJSON(e))
|
|
1347
1332
|
: [],
|
|
1348
|
-
metadata: isSet(object.metadata) ?
|
|
1333
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
1349
1334
|
status: isSet(object.status) ? dAOStatusFromJSON(object.status) : DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
1350
1335
|
};
|
|
1351
1336
|
},
|
|
@@ -1364,7 +1349,7 @@ exports.MultisigDAO = {
|
|
|
1364
1349
|
obj.proposalTtlMs = Math.round(message.proposalTtlMs);
|
|
1365
1350
|
}
|
|
1366
1351
|
if (message.proposal !== undefined) {
|
|
1367
|
-
obj.proposal =
|
|
1352
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
1368
1353
|
}
|
|
1369
1354
|
if (message.signatures) {
|
|
1370
1355
|
const entries = globalThis.Object.entries(message.signatures);
|
|
@@ -1376,13 +1361,13 @@ exports.MultisigDAO = {
|
|
|
1376
1361
|
}
|
|
1377
1362
|
}
|
|
1378
1363
|
if (message.actions?.length) {
|
|
1379
|
-
obj.actions = message.actions.map((e) =>
|
|
1364
|
+
obj.actions = message.actions.map((e) => MultisigAction.toJSON(e));
|
|
1380
1365
|
}
|
|
1381
1366
|
if (message.cancelledProposals?.length) {
|
|
1382
|
-
obj.cancelledProposals = message.cancelledProposals.map((e) =>
|
|
1367
|
+
obj.cancelledProposals = message.cancelledProposals.map((e) => Proposal.toJSON(e));
|
|
1383
1368
|
}
|
|
1384
1369
|
if (message.metadata !== undefined) {
|
|
1385
|
-
obj.metadata =
|
|
1370
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
1386
1371
|
}
|
|
1387
1372
|
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
1388
1373
|
obj.status = dAOStatusToJSON(message.status);
|
|
@@ -1390,7 +1375,7 @@ exports.MultisigDAO = {
|
|
|
1390
1375
|
return obj;
|
|
1391
1376
|
},
|
|
1392
1377
|
create(base) {
|
|
1393
|
-
return
|
|
1378
|
+
return MultisigDAO.fromPartial(base ?? {});
|
|
1394
1379
|
},
|
|
1395
1380
|
fromPartial(object) {
|
|
1396
1381
|
const message = createBaseMultisigDAO();
|
|
@@ -1399,7 +1384,7 @@ exports.MultisigDAO = {
|
|
|
1399
1384
|
message.threshold = object.threshold ?? 0;
|
|
1400
1385
|
message.proposalTtlMs = object.proposalTtlMs ?? 0;
|
|
1401
1386
|
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
1402
|
-
?
|
|
1387
|
+
? Proposal.fromPartial(object.proposal)
|
|
1403
1388
|
: undefined;
|
|
1404
1389
|
message.signatures = globalThis.Object.entries(object.signatures ?? {}).reduce((acc, [key, value]) => {
|
|
1405
1390
|
if (value !== undefined) {
|
|
@@ -1407,10 +1392,10 @@ exports.MultisigDAO = {
|
|
|
1407
1392
|
}
|
|
1408
1393
|
return acc;
|
|
1409
1394
|
}, {});
|
|
1410
|
-
message.actions = object.actions?.map((e) =>
|
|
1411
|
-
message.cancelledProposals = object.cancelledProposals?.map((e) =>
|
|
1395
|
+
message.actions = object.actions?.map((e) => MultisigAction.fromPartial(e)) || [];
|
|
1396
|
+
message.cancelledProposals = object.cancelledProposals?.map((e) => Proposal.fromPartial(e)) || [];
|
|
1412
1397
|
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
1413
|
-
?
|
|
1398
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
1414
1399
|
: undefined;
|
|
1415
1400
|
message.status = object.status ?? DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
1416
1401
|
return message;
|
|
@@ -1419,8 +1404,8 @@ exports.MultisigDAO = {
|
|
|
1419
1404
|
function createBaseMultisigDAO_SignaturesEntry() {
|
|
1420
1405
|
return { key: "", value: 0 };
|
|
1421
1406
|
}
|
|
1422
|
-
|
|
1423
|
-
encode(message, writer = new
|
|
1407
|
+
export const MultisigDAO_SignaturesEntry = {
|
|
1408
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1424
1409
|
if (message.key !== "") {
|
|
1425
1410
|
writer.uint32(10).string(message.key);
|
|
1426
1411
|
}
|
|
@@ -1430,7 +1415,7 @@ exports.MultisigDAO_SignaturesEntry = {
|
|
|
1430
1415
|
return writer;
|
|
1431
1416
|
},
|
|
1432
1417
|
decode(input, length) {
|
|
1433
|
-
const reader = input instanceof
|
|
1418
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1434
1419
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1435
1420
|
const message = createBaseMultisigDAO_SignaturesEntry();
|
|
1436
1421
|
while (reader.pos < end) {
|
|
@@ -1475,7 +1460,7 @@ exports.MultisigDAO_SignaturesEntry = {
|
|
|
1475
1460
|
return obj;
|
|
1476
1461
|
},
|
|
1477
1462
|
create(base) {
|
|
1478
|
-
return
|
|
1463
|
+
return MultisigDAO_SignaturesEntry.fromPartial(base ?? {});
|
|
1479
1464
|
},
|
|
1480
1465
|
fromPartial(object) {
|
|
1481
1466
|
const message = createBaseMultisigDAO_SignaturesEntry();
|
|
@@ -1487,21 +1472,21 @@ exports.MultisigDAO_SignaturesEntry = {
|
|
|
1487
1472
|
function createBaseMultisigAction() {
|
|
1488
1473
|
return { proposal: undefined, signatures: {}, executedAt: undefined };
|
|
1489
1474
|
}
|
|
1490
|
-
|
|
1491
|
-
encode(message, writer = new
|
|
1475
|
+
export const MultisigAction = {
|
|
1476
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1492
1477
|
if (message.proposal !== undefined) {
|
|
1493
|
-
|
|
1478
|
+
Proposal.encode(message.proposal, writer.uint32(10).fork()).join();
|
|
1494
1479
|
}
|
|
1495
1480
|
globalThis.Object.entries(message.signatures).forEach(([key, value]) => {
|
|
1496
|
-
|
|
1481
|
+
MultisigAction_SignaturesEntry.encode({ key: key, value }, writer.uint32(18).fork()).join();
|
|
1497
1482
|
});
|
|
1498
1483
|
if (message.executedAt !== undefined) {
|
|
1499
|
-
|
|
1484
|
+
Timestamp.encode(toTimestamp(message.executedAt), writer.uint32(26).fork()).join();
|
|
1500
1485
|
}
|
|
1501
1486
|
return writer;
|
|
1502
1487
|
},
|
|
1503
1488
|
decode(input, length) {
|
|
1504
|
-
const reader = input instanceof
|
|
1489
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1505
1490
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1506
1491
|
const message = createBaseMultisigAction();
|
|
1507
1492
|
while (reader.pos < end) {
|
|
@@ -1511,14 +1496,14 @@ exports.MultisigAction = {
|
|
|
1511
1496
|
if (tag !== 10) {
|
|
1512
1497
|
break;
|
|
1513
1498
|
}
|
|
1514
|
-
message.proposal =
|
|
1499
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
1515
1500
|
continue;
|
|
1516
1501
|
}
|
|
1517
1502
|
case 2: {
|
|
1518
1503
|
if (tag !== 18) {
|
|
1519
1504
|
break;
|
|
1520
1505
|
}
|
|
1521
|
-
const entry2 =
|
|
1506
|
+
const entry2 = MultisigAction_SignaturesEntry.decode(reader, reader.uint32());
|
|
1522
1507
|
if (entry2.value !== undefined) {
|
|
1523
1508
|
message.signatures[entry2.key] = entry2.value;
|
|
1524
1509
|
}
|
|
@@ -1528,7 +1513,7 @@ exports.MultisigAction = {
|
|
|
1528
1513
|
if (tag !== 26) {
|
|
1529
1514
|
break;
|
|
1530
1515
|
}
|
|
1531
|
-
message.executedAt = fromTimestamp(
|
|
1516
|
+
message.executedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1532
1517
|
continue;
|
|
1533
1518
|
}
|
|
1534
1519
|
}
|
|
@@ -1541,7 +1526,7 @@ exports.MultisigAction = {
|
|
|
1541
1526
|
},
|
|
1542
1527
|
fromJSON(object) {
|
|
1543
1528
|
return {
|
|
1544
|
-
proposal: isSet(object.proposal) ?
|
|
1529
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
1545
1530
|
signatures: isObject(object.signatures)
|
|
1546
1531
|
? globalThis.Object.entries(object.signatures).reduce((acc, [key, value]) => {
|
|
1547
1532
|
acc[key] = globalThis.Number(value);
|
|
@@ -1558,7 +1543,7 @@ exports.MultisigAction = {
|
|
|
1558
1543
|
toJSON(message) {
|
|
1559
1544
|
const obj = {};
|
|
1560
1545
|
if (message.proposal !== undefined) {
|
|
1561
|
-
obj.proposal =
|
|
1546
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
1562
1547
|
}
|
|
1563
1548
|
if (message.signatures) {
|
|
1564
1549
|
const entries = globalThis.Object.entries(message.signatures);
|
|
@@ -1575,12 +1560,12 @@ exports.MultisigAction = {
|
|
|
1575
1560
|
return obj;
|
|
1576
1561
|
},
|
|
1577
1562
|
create(base) {
|
|
1578
|
-
return
|
|
1563
|
+
return MultisigAction.fromPartial(base ?? {});
|
|
1579
1564
|
},
|
|
1580
1565
|
fromPartial(object) {
|
|
1581
1566
|
const message = createBaseMultisigAction();
|
|
1582
1567
|
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
1583
|
-
?
|
|
1568
|
+
? Proposal.fromPartial(object.proposal)
|
|
1584
1569
|
: undefined;
|
|
1585
1570
|
message.signatures = globalThis.Object.entries(object.signatures ?? {}).reduce((acc, [key, value]) => {
|
|
1586
1571
|
if (value !== undefined) {
|
|
@@ -1595,8 +1580,8 @@ exports.MultisigAction = {
|
|
|
1595
1580
|
function createBaseMultisigAction_SignaturesEntry() {
|
|
1596
1581
|
return { key: "", value: 0 };
|
|
1597
1582
|
}
|
|
1598
|
-
|
|
1599
|
-
encode(message, writer = new
|
|
1583
|
+
export const MultisigAction_SignaturesEntry = {
|
|
1584
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1600
1585
|
if (message.key !== "") {
|
|
1601
1586
|
writer.uint32(10).string(message.key);
|
|
1602
1587
|
}
|
|
@@ -1606,7 +1591,7 @@ exports.MultisigAction_SignaturesEntry = {
|
|
|
1606
1591
|
return writer;
|
|
1607
1592
|
},
|
|
1608
1593
|
decode(input, length) {
|
|
1609
|
-
const reader = input instanceof
|
|
1594
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1610
1595
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1611
1596
|
const message = createBaseMultisigAction_SignaturesEntry();
|
|
1612
1597
|
while (reader.pos < end) {
|
|
@@ -1651,7 +1636,7 @@ exports.MultisigAction_SignaturesEntry = {
|
|
|
1651
1636
|
return obj;
|
|
1652
1637
|
},
|
|
1653
1638
|
create(base) {
|
|
1654
|
-
return
|
|
1639
|
+
return MultisigAction_SignaturesEntry.fromPartial(base ?? {});
|
|
1655
1640
|
},
|
|
1656
1641
|
fromPartial(object) {
|
|
1657
1642
|
const message = createBaseMultisigAction_SignaturesEntry();
|
|
@@ -1679,8 +1664,8 @@ function createBaseTokenDAO() {
|
|
|
1679
1664
|
status: DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
1680
1665
|
};
|
|
1681
1666
|
}
|
|
1682
|
-
|
|
1683
|
-
encode(message, writer = new
|
|
1667
|
+
export const TokenDAO = {
|
|
1668
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1684
1669
|
if (message.name !== "") {
|
|
1685
1670
|
writer.uint32(10).string(message.name);
|
|
1686
1671
|
}
|
|
@@ -1688,10 +1673,10 @@ exports.TokenDAO = {
|
|
|
1688
1673
|
writer.uint32(18).string(message.tokenId);
|
|
1689
1674
|
}
|
|
1690
1675
|
globalThis.Object.entries(message.balances).forEach(([key, value]) => {
|
|
1691
|
-
|
|
1676
|
+
TokenDAO_BalancesEntry.encode({ key: key, value }, writer.uint32(26).fork()).join();
|
|
1692
1677
|
});
|
|
1693
1678
|
globalThis.Object.entries(message.delegations).forEach(([key, value]) => {
|
|
1694
|
-
|
|
1679
|
+
TokenDAO_DelegationsEntry.encode({ key: key, value }, writer.uint32(34).fork()).join();
|
|
1695
1680
|
});
|
|
1696
1681
|
if (message.proposalThreshold !== 0) {
|
|
1697
1682
|
writer.uint32(40).int64(message.proposalThreshold);
|
|
@@ -1706,22 +1691,22 @@ exports.TokenDAO = {
|
|
|
1706
1691
|
writer.uint32(64).int64(message.quorum);
|
|
1707
1692
|
}
|
|
1708
1693
|
if (message.proposal !== undefined) {
|
|
1709
|
-
|
|
1694
|
+
Proposal.encode(message.proposal, writer.uint32(74).fork()).join();
|
|
1710
1695
|
}
|
|
1711
1696
|
if (message.votes !== undefined) {
|
|
1712
|
-
|
|
1697
|
+
VoteTally.encode(message.votes, writer.uint32(82).fork()).join();
|
|
1713
1698
|
}
|
|
1714
1699
|
for (const v of message.executedProposals) {
|
|
1715
|
-
|
|
1700
|
+
TokenProposalResult.encode(v, writer.uint32(90).fork()).join();
|
|
1716
1701
|
}
|
|
1717
1702
|
for (const v of message.rejectedProposals) {
|
|
1718
|
-
|
|
1703
|
+
TokenProposalResult.encode(v, writer.uint32(98).fork()).join();
|
|
1719
1704
|
}
|
|
1720
1705
|
for (const v of message.cancelledProposals) {
|
|
1721
|
-
|
|
1706
|
+
Proposal.encode(v, writer.uint32(106).fork()).join();
|
|
1722
1707
|
}
|
|
1723
1708
|
if (message.metadata !== undefined) {
|
|
1724
|
-
|
|
1709
|
+
DAOMetadata.encode(message.metadata, writer.uint32(114).fork()).join();
|
|
1725
1710
|
}
|
|
1726
1711
|
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
1727
1712
|
writer.uint32(120).int32(dAOStatusToNumber(message.status));
|
|
@@ -1729,7 +1714,7 @@ exports.TokenDAO = {
|
|
|
1729
1714
|
return writer;
|
|
1730
1715
|
},
|
|
1731
1716
|
decode(input, length) {
|
|
1732
|
-
const reader = input instanceof
|
|
1717
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1733
1718
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1734
1719
|
const message = createBaseTokenDAO();
|
|
1735
1720
|
while (reader.pos < end) {
|
|
@@ -1753,7 +1738,7 @@ exports.TokenDAO = {
|
|
|
1753
1738
|
if (tag !== 26) {
|
|
1754
1739
|
break;
|
|
1755
1740
|
}
|
|
1756
|
-
const entry3 =
|
|
1741
|
+
const entry3 = TokenDAO_BalancesEntry.decode(reader, reader.uint32());
|
|
1757
1742
|
if (entry3.value !== undefined) {
|
|
1758
1743
|
message.balances[entry3.key] = entry3.value;
|
|
1759
1744
|
}
|
|
@@ -1763,7 +1748,7 @@ exports.TokenDAO = {
|
|
|
1763
1748
|
if (tag !== 34) {
|
|
1764
1749
|
break;
|
|
1765
1750
|
}
|
|
1766
|
-
const entry4 =
|
|
1751
|
+
const entry4 = TokenDAO_DelegationsEntry.decode(reader, reader.uint32());
|
|
1767
1752
|
if (entry4.value !== undefined) {
|
|
1768
1753
|
message.delegations[entry4.key] = entry4.value;
|
|
1769
1754
|
}
|
|
@@ -1801,42 +1786,42 @@ exports.TokenDAO = {
|
|
|
1801
1786
|
if (tag !== 74) {
|
|
1802
1787
|
break;
|
|
1803
1788
|
}
|
|
1804
|
-
message.proposal =
|
|
1789
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
1805
1790
|
continue;
|
|
1806
1791
|
}
|
|
1807
1792
|
case 10: {
|
|
1808
1793
|
if (tag !== 82) {
|
|
1809
1794
|
break;
|
|
1810
1795
|
}
|
|
1811
|
-
message.votes =
|
|
1796
|
+
message.votes = VoteTally.decode(reader, reader.uint32());
|
|
1812
1797
|
continue;
|
|
1813
1798
|
}
|
|
1814
1799
|
case 11: {
|
|
1815
1800
|
if (tag !== 90) {
|
|
1816
1801
|
break;
|
|
1817
1802
|
}
|
|
1818
|
-
message.executedProposals.push(
|
|
1803
|
+
message.executedProposals.push(TokenProposalResult.decode(reader, reader.uint32()));
|
|
1819
1804
|
continue;
|
|
1820
1805
|
}
|
|
1821
1806
|
case 12: {
|
|
1822
1807
|
if (tag !== 98) {
|
|
1823
1808
|
break;
|
|
1824
1809
|
}
|
|
1825
|
-
message.rejectedProposals.push(
|
|
1810
|
+
message.rejectedProposals.push(TokenProposalResult.decode(reader, reader.uint32()));
|
|
1826
1811
|
continue;
|
|
1827
1812
|
}
|
|
1828
1813
|
case 13: {
|
|
1829
1814
|
if (tag !== 106) {
|
|
1830
1815
|
break;
|
|
1831
1816
|
}
|
|
1832
|
-
message.cancelledProposals.push(
|
|
1817
|
+
message.cancelledProposals.push(Proposal.decode(reader, reader.uint32()));
|
|
1833
1818
|
continue;
|
|
1834
1819
|
}
|
|
1835
1820
|
case 14: {
|
|
1836
1821
|
if (tag !== 114) {
|
|
1837
1822
|
break;
|
|
1838
1823
|
}
|
|
1839
|
-
message.metadata =
|
|
1824
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
1840
1825
|
continue;
|
|
1841
1826
|
}
|
|
1842
1827
|
case 15: {
|
|
@@ -1890,24 +1875,24 @@ exports.TokenDAO = {
|
|
|
1890
1875
|
? globalThis.Number(object.timelock_ms)
|
|
1891
1876
|
: 0,
|
|
1892
1877
|
quorum: isSet(object.quorum) ? globalThis.Number(object.quorum) : 0,
|
|
1893
|
-
proposal: isSet(object.proposal) ?
|
|
1894
|
-
votes: isSet(object.votes) ?
|
|
1878
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
1879
|
+
votes: isSet(object.votes) ? VoteTally.fromJSON(object.votes) : undefined,
|
|
1895
1880
|
executedProposals: globalThis.Array.isArray(object?.executedProposals)
|
|
1896
|
-
? object.executedProposals.map((e) =>
|
|
1881
|
+
? object.executedProposals.map((e) => TokenProposalResult.fromJSON(e))
|
|
1897
1882
|
: globalThis.Array.isArray(object?.executed_proposals)
|
|
1898
|
-
? object.executed_proposals.map((e) =>
|
|
1883
|
+
? object.executed_proposals.map((e) => TokenProposalResult.fromJSON(e))
|
|
1899
1884
|
: [],
|
|
1900
1885
|
rejectedProposals: globalThis.Array.isArray(object?.rejectedProposals)
|
|
1901
|
-
? object.rejectedProposals.map((e) =>
|
|
1886
|
+
? object.rejectedProposals.map((e) => TokenProposalResult.fromJSON(e))
|
|
1902
1887
|
: globalThis.Array.isArray(object?.rejected_proposals)
|
|
1903
|
-
? object.rejected_proposals.map((e) =>
|
|
1888
|
+
? object.rejected_proposals.map((e) => TokenProposalResult.fromJSON(e))
|
|
1904
1889
|
: [],
|
|
1905
1890
|
cancelledProposals: globalThis.Array.isArray(object?.cancelledProposals)
|
|
1906
|
-
? object.cancelledProposals.map((e) =>
|
|
1891
|
+
? object.cancelledProposals.map((e) => Proposal.fromJSON(e))
|
|
1907
1892
|
: globalThis.Array.isArray(object?.cancelled_proposals)
|
|
1908
|
-
? object.cancelled_proposals.map((e) =>
|
|
1893
|
+
? object.cancelled_proposals.map((e) => Proposal.fromJSON(e))
|
|
1909
1894
|
: [],
|
|
1910
|
-
metadata: isSet(object.metadata) ?
|
|
1895
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
1911
1896
|
status: isSet(object.status) ? dAOStatusFromJSON(object.status) : DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
1912
1897
|
};
|
|
1913
1898
|
},
|
|
@@ -1950,22 +1935,22 @@ exports.TokenDAO = {
|
|
|
1950
1935
|
obj.quorum = Math.round(message.quorum);
|
|
1951
1936
|
}
|
|
1952
1937
|
if (message.proposal !== undefined) {
|
|
1953
|
-
obj.proposal =
|
|
1938
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
1954
1939
|
}
|
|
1955
1940
|
if (message.votes !== undefined) {
|
|
1956
|
-
obj.votes =
|
|
1941
|
+
obj.votes = VoteTally.toJSON(message.votes);
|
|
1957
1942
|
}
|
|
1958
1943
|
if (message.executedProposals?.length) {
|
|
1959
|
-
obj.executedProposals = message.executedProposals.map((e) =>
|
|
1944
|
+
obj.executedProposals = message.executedProposals.map((e) => TokenProposalResult.toJSON(e));
|
|
1960
1945
|
}
|
|
1961
1946
|
if (message.rejectedProposals?.length) {
|
|
1962
|
-
obj.rejectedProposals = message.rejectedProposals.map((e) =>
|
|
1947
|
+
obj.rejectedProposals = message.rejectedProposals.map((e) => TokenProposalResult.toJSON(e));
|
|
1963
1948
|
}
|
|
1964
1949
|
if (message.cancelledProposals?.length) {
|
|
1965
|
-
obj.cancelledProposals = message.cancelledProposals.map((e) =>
|
|
1950
|
+
obj.cancelledProposals = message.cancelledProposals.map((e) => Proposal.toJSON(e));
|
|
1966
1951
|
}
|
|
1967
1952
|
if (message.metadata !== undefined) {
|
|
1968
|
-
obj.metadata =
|
|
1953
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
1969
1954
|
}
|
|
1970
1955
|
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
1971
1956
|
obj.status = dAOStatusToJSON(message.status);
|
|
@@ -1973,7 +1958,7 @@ exports.TokenDAO = {
|
|
|
1973
1958
|
return obj;
|
|
1974
1959
|
},
|
|
1975
1960
|
create(base) {
|
|
1976
|
-
return
|
|
1961
|
+
return TokenDAO.fromPartial(base ?? {});
|
|
1977
1962
|
},
|
|
1978
1963
|
fromPartial(object) {
|
|
1979
1964
|
const message = createBaseTokenDAO();
|
|
@@ -1996,16 +1981,16 @@ exports.TokenDAO = {
|
|
|
1996
1981
|
message.timelockMs = object.timelockMs ?? 0;
|
|
1997
1982
|
message.quorum = object.quorum ?? 0;
|
|
1998
1983
|
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
1999
|
-
?
|
|
1984
|
+
? Proposal.fromPartial(object.proposal)
|
|
2000
1985
|
: undefined;
|
|
2001
1986
|
message.votes = (object.votes !== undefined && object.votes !== null)
|
|
2002
|
-
?
|
|
1987
|
+
? VoteTally.fromPartial(object.votes)
|
|
2003
1988
|
: undefined;
|
|
2004
|
-
message.executedProposals = object.executedProposals?.map((e) =>
|
|
2005
|
-
message.rejectedProposals = object.rejectedProposals?.map((e) =>
|
|
2006
|
-
message.cancelledProposals = object.cancelledProposals?.map((e) =>
|
|
1989
|
+
message.executedProposals = object.executedProposals?.map((e) => TokenProposalResult.fromPartial(e)) || [];
|
|
1990
|
+
message.rejectedProposals = object.rejectedProposals?.map((e) => TokenProposalResult.fromPartial(e)) || [];
|
|
1991
|
+
message.cancelledProposals = object.cancelledProposals?.map((e) => Proposal.fromPartial(e)) || [];
|
|
2007
1992
|
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
2008
|
-
?
|
|
1993
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
2009
1994
|
: undefined;
|
|
2010
1995
|
message.status = object.status ?? DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
2011
1996
|
return message;
|
|
@@ -2014,8 +1999,8 @@ exports.TokenDAO = {
|
|
|
2014
1999
|
function createBaseTokenDAO_BalancesEntry() {
|
|
2015
2000
|
return { key: "", value: 0 };
|
|
2016
2001
|
}
|
|
2017
|
-
|
|
2018
|
-
encode(message, writer = new
|
|
2002
|
+
export const TokenDAO_BalancesEntry = {
|
|
2003
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2019
2004
|
if (message.key !== "") {
|
|
2020
2005
|
writer.uint32(10).string(message.key);
|
|
2021
2006
|
}
|
|
@@ -2025,7 +2010,7 @@ exports.TokenDAO_BalancesEntry = {
|
|
|
2025
2010
|
return writer;
|
|
2026
2011
|
},
|
|
2027
2012
|
decode(input, length) {
|
|
2028
|
-
const reader = input instanceof
|
|
2013
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2029
2014
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2030
2015
|
const message = createBaseTokenDAO_BalancesEntry();
|
|
2031
2016
|
while (reader.pos < end) {
|
|
@@ -2070,7 +2055,7 @@ exports.TokenDAO_BalancesEntry = {
|
|
|
2070
2055
|
return obj;
|
|
2071
2056
|
},
|
|
2072
2057
|
create(base) {
|
|
2073
|
-
return
|
|
2058
|
+
return TokenDAO_BalancesEntry.fromPartial(base ?? {});
|
|
2074
2059
|
},
|
|
2075
2060
|
fromPartial(object) {
|
|
2076
2061
|
const message = createBaseTokenDAO_BalancesEntry();
|
|
@@ -2082,8 +2067,8 @@ exports.TokenDAO_BalancesEntry = {
|
|
|
2082
2067
|
function createBaseTokenDAO_DelegationsEntry() {
|
|
2083
2068
|
return { key: "", value: "" };
|
|
2084
2069
|
}
|
|
2085
|
-
|
|
2086
|
-
encode(message, writer = new
|
|
2070
|
+
export const TokenDAO_DelegationsEntry = {
|
|
2071
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2087
2072
|
if (message.key !== "") {
|
|
2088
2073
|
writer.uint32(10).string(message.key);
|
|
2089
2074
|
}
|
|
@@ -2093,7 +2078,7 @@ exports.TokenDAO_DelegationsEntry = {
|
|
|
2093
2078
|
return writer;
|
|
2094
2079
|
},
|
|
2095
2080
|
decode(input, length) {
|
|
2096
|
-
const reader = input instanceof
|
|
2081
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2097
2082
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2098
2083
|
const message = createBaseTokenDAO_DelegationsEntry();
|
|
2099
2084
|
while (reader.pos < end) {
|
|
@@ -2138,7 +2123,7 @@ exports.TokenDAO_DelegationsEntry = {
|
|
|
2138
2123
|
return obj;
|
|
2139
2124
|
},
|
|
2140
2125
|
create(base) {
|
|
2141
|
-
return
|
|
2126
|
+
return TokenDAO_DelegationsEntry.fromPartial(base ?? {});
|
|
2142
2127
|
},
|
|
2143
2128
|
fromPartial(object) {
|
|
2144
2129
|
const message = createBaseTokenDAO_DelegationsEntry();
|
|
@@ -2150,21 +2135,21 @@ exports.TokenDAO_DelegationsEntry = {
|
|
|
2150
2135
|
function createBaseTokenProposalResult() {
|
|
2151
2136
|
return { proposal: undefined, votes: undefined, finalizedAt: undefined };
|
|
2152
2137
|
}
|
|
2153
|
-
|
|
2154
|
-
encode(message, writer = new
|
|
2138
|
+
export const TokenProposalResult = {
|
|
2139
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2155
2140
|
if (message.proposal !== undefined) {
|
|
2156
|
-
|
|
2141
|
+
Proposal.encode(message.proposal, writer.uint32(10).fork()).join();
|
|
2157
2142
|
}
|
|
2158
2143
|
if (message.votes !== undefined) {
|
|
2159
|
-
|
|
2144
|
+
VoteTally.encode(message.votes, writer.uint32(18).fork()).join();
|
|
2160
2145
|
}
|
|
2161
2146
|
if (message.finalizedAt !== undefined) {
|
|
2162
|
-
|
|
2147
|
+
Timestamp.encode(toTimestamp(message.finalizedAt), writer.uint32(26).fork()).join();
|
|
2163
2148
|
}
|
|
2164
2149
|
return writer;
|
|
2165
2150
|
},
|
|
2166
2151
|
decode(input, length) {
|
|
2167
|
-
const reader = input instanceof
|
|
2152
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2168
2153
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2169
2154
|
const message = createBaseTokenProposalResult();
|
|
2170
2155
|
while (reader.pos < end) {
|
|
@@ -2174,21 +2159,21 @@ exports.TokenProposalResult = {
|
|
|
2174
2159
|
if (tag !== 10) {
|
|
2175
2160
|
break;
|
|
2176
2161
|
}
|
|
2177
|
-
message.proposal =
|
|
2162
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
2178
2163
|
continue;
|
|
2179
2164
|
}
|
|
2180
2165
|
case 2: {
|
|
2181
2166
|
if (tag !== 18) {
|
|
2182
2167
|
break;
|
|
2183
2168
|
}
|
|
2184
|
-
message.votes =
|
|
2169
|
+
message.votes = VoteTally.decode(reader, reader.uint32());
|
|
2185
2170
|
continue;
|
|
2186
2171
|
}
|
|
2187
2172
|
case 3: {
|
|
2188
2173
|
if (tag !== 26) {
|
|
2189
2174
|
break;
|
|
2190
2175
|
}
|
|
2191
|
-
message.finalizedAt = fromTimestamp(
|
|
2176
|
+
message.finalizedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
2192
2177
|
continue;
|
|
2193
2178
|
}
|
|
2194
2179
|
}
|
|
@@ -2201,8 +2186,8 @@ exports.TokenProposalResult = {
|
|
|
2201
2186
|
},
|
|
2202
2187
|
fromJSON(object) {
|
|
2203
2188
|
return {
|
|
2204
|
-
proposal: isSet(object.proposal) ?
|
|
2205
|
-
votes: isSet(object.votes) ?
|
|
2189
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
2190
|
+
votes: isSet(object.votes) ? VoteTally.fromJSON(object.votes) : undefined,
|
|
2206
2191
|
finalizedAt: isSet(object.finalizedAt)
|
|
2207
2192
|
? fromJsonTimestamp(object.finalizedAt)
|
|
2208
2193
|
: isSet(object.finalized_at)
|
|
@@ -2213,10 +2198,10 @@ exports.TokenProposalResult = {
|
|
|
2213
2198
|
toJSON(message) {
|
|
2214
2199
|
const obj = {};
|
|
2215
2200
|
if (message.proposal !== undefined) {
|
|
2216
|
-
obj.proposal =
|
|
2201
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
2217
2202
|
}
|
|
2218
2203
|
if (message.votes !== undefined) {
|
|
2219
|
-
obj.votes =
|
|
2204
|
+
obj.votes = VoteTally.toJSON(message.votes);
|
|
2220
2205
|
}
|
|
2221
2206
|
if (message.finalizedAt !== undefined) {
|
|
2222
2207
|
obj.finalizedAt = message.finalizedAt.toISOString();
|
|
@@ -2224,15 +2209,15 @@ exports.TokenProposalResult = {
|
|
|
2224
2209
|
return obj;
|
|
2225
2210
|
},
|
|
2226
2211
|
create(base) {
|
|
2227
|
-
return
|
|
2212
|
+
return TokenProposalResult.fromPartial(base ?? {});
|
|
2228
2213
|
},
|
|
2229
2214
|
fromPartial(object) {
|
|
2230
2215
|
const message = createBaseTokenProposalResult();
|
|
2231
2216
|
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
2232
|
-
?
|
|
2217
|
+
? Proposal.fromPartial(object.proposal)
|
|
2233
2218
|
: undefined;
|
|
2234
2219
|
message.votes = (object.votes !== undefined && object.votes !== null)
|
|
2235
|
-
?
|
|
2220
|
+
? VoteTally.fromPartial(object.votes)
|
|
2236
2221
|
: undefined;
|
|
2237
2222
|
message.finalizedAt = object.finalizedAt ?? undefined;
|
|
2238
2223
|
return message;
|
|
@@ -2255,8 +2240,8 @@ function createBaseThresholdDAO() {
|
|
|
2255
2240
|
status: DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
2256
2241
|
};
|
|
2257
2242
|
}
|
|
2258
|
-
|
|
2259
|
-
encode(message, writer = new
|
|
2243
|
+
export const ThresholdDAO = {
|
|
2244
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2260
2245
|
if (message.name !== "") {
|
|
2261
2246
|
writer.uint32(10).string(message.name);
|
|
2262
2247
|
}
|
|
@@ -2264,7 +2249,7 @@ exports.ThresholdDAO = {
|
|
|
2264
2249
|
writer.uint32(18).string(v);
|
|
2265
2250
|
}
|
|
2266
2251
|
globalThis.Object.entries(message.memberJoinedAt).forEach(([key, value]) => {
|
|
2267
|
-
|
|
2252
|
+
ThresholdDAO_MemberJoinedAtEntry.encode({ key: key, value }, writer.uint32(26).fork()).join();
|
|
2268
2253
|
});
|
|
2269
2254
|
if (message.memberThreshold !== 0) {
|
|
2270
2255
|
writer.uint32(32).int64(message.memberThreshold);
|
|
@@ -2282,16 +2267,16 @@ exports.ThresholdDAO = {
|
|
|
2282
2267
|
writer.uint32(64).int64(message.votingPeriodMs);
|
|
2283
2268
|
}
|
|
2284
2269
|
if (message.proposal !== undefined) {
|
|
2285
|
-
|
|
2270
|
+
Proposal.encode(message.proposal, writer.uint32(74).fork()).join();
|
|
2286
2271
|
}
|
|
2287
2272
|
if (message.votes !== undefined) {
|
|
2288
|
-
|
|
2273
|
+
ThresholdVotes.encode(message.votes, writer.uint32(82).fork()).join();
|
|
2289
2274
|
}
|
|
2290
2275
|
for (const v of message.history) {
|
|
2291
|
-
|
|
2276
|
+
ThresholdHistoryEntry.encode(v, writer.uint32(90).fork()).join();
|
|
2292
2277
|
}
|
|
2293
2278
|
if (message.metadata !== undefined) {
|
|
2294
|
-
|
|
2279
|
+
DAOMetadata.encode(message.metadata, writer.uint32(98).fork()).join();
|
|
2295
2280
|
}
|
|
2296
2281
|
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
2297
2282
|
writer.uint32(104).int32(dAOStatusToNumber(message.status));
|
|
@@ -2299,7 +2284,7 @@ exports.ThresholdDAO = {
|
|
|
2299
2284
|
return writer;
|
|
2300
2285
|
},
|
|
2301
2286
|
decode(input, length) {
|
|
2302
|
-
const reader = input instanceof
|
|
2287
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2303
2288
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2304
2289
|
const message = createBaseThresholdDAO();
|
|
2305
2290
|
while (reader.pos < end) {
|
|
@@ -2323,7 +2308,7 @@ exports.ThresholdDAO = {
|
|
|
2323
2308
|
if (tag !== 26) {
|
|
2324
2309
|
break;
|
|
2325
2310
|
}
|
|
2326
|
-
const entry3 =
|
|
2311
|
+
const entry3 = ThresholdDAO_MemberJoinedAtEntry.decode(reader, reader.uint32());
|
|
2327
2312
|
if (entry3.value !== undefined) {
|
|
2328
2313
|
message.memberJoinedAt[entry3.key] = entry3.value;
|
|
2329
2314
|
}
|
|
@@ -2368,28 +2353,28 @@ exports.ThresholdDAO = {
|
|
|
2368
2353
|
if (tag !== 74) {
|
|
2369
2354
|
break;
|
|
2370
2355
|
}
|
|
2371
|
-
message.proposal =
|
|
2356
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
2372
2357
|
continue;
|
|
2373
2358
|
}
|
|
2374
2359
|
case 10: {
|
|
2375
2360
|
if (tag !== 82) {
|
|
2376
2361
|
break;
|
|
2377
2362
|
}
|
|
2378
|
-
message.votes =
|
|
2363
|
+
message.votes = ThresholdVotes.decode(reader, reader.uint32());
|
|
2379
2364
|
continue;
|
|
2380
2365
|
}
|
|
2381
2366
|
case 11: {
|
|
2382
2367
|
if (tag !== 90) {
|
|
2383
2368
|
break;
|
|
2384
2369
|
}
|
|
2385
|
-
message.history.push(
|
|
2370
|
+
message.history.push(ThresholdHistoryEntry.decode(reader, reader.uint32()));
|
|
2386
2371
|
continue;
|
|
2387
2372
|
}
|
|
2388
2373
|
case 12: {
|
|
2389
2374
|
if (tag !== 98) {
|
|
2390
2375
|
break;
|
|
2391
2376
|
}
|
|
2392
|
-
message.metadata =
|
|
2377
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
2393
2378
|
continue;
|
|
2394
2379
|
}
|
|
2395
2380
|
case 13: {
|
|
@@ -2443,12 +2428,12 @@ exports.ThresholdDAO = {
|
|
|
2443
2428
|
: isSet(object.voting_period_ms)
|
|
2444
2429
|
? globalThis.Number(object.voting_period_ms)
|
|
2445
2430
|
: 0,
|
|
2446
|
-
proposal: isSet(object.proposal) ?
|
|
2447
|
-
votes: isSet(object.votes) ?
|
|
2431
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
2432
|
+
votes: isSet(object.votes) ? ThresholdVotes.fromJSON(object.votes) : undefined,
|
|
2448
2433
|
history: globalThis.Array.isArray(object?.history)
|
|
2449
|
-
? object.history.map((e) =>
|
|
2434
|
+
? object.history.map((e) => ThresholdHistoryEntry.fromJSON(e))
|
|
2450
2435
|
: [],
|
|
2451
|
-
metadata: isSet(object.metadata) ?
|
|
2436
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
2452
2437
|
status: isSet(object.status) ? dAOStatusFromJSON(object.status) : DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
2453
2438
|
};
|
|
2454
2439
|
},
|
|
@@ -2485,16 +2470,16 @@ exports.ThresholdDAO = {
|
|
|
2485
2470
|
obj.votingPeriodMs = Math.round(message.votingPeriodMs);
|
|
2486
2471
|
}
|
|
2487
2472
|
if (message.proposal !== undefined) {
|
|
2488
|
-
obj.proposal =
|
|
2473
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
2489
2474
|
}
|
|
2490
2475
|
if (message.votes !== undefined) {
|
|
2491
|
-
obj.votes =
|
|
2476
|
+
obj.votes = ThresholdVotes.toJSON(message.votes);
|
|
2492
2477
|
}
|
|
2493
2478
|
if (message.history?.length) {
|
|
2494
|
-
obj.history = message.history.map((e) =>
|
|
2479
|
+
obj.history = message.history.map((e) => ThresholdHistoryEntry.toJSON(e));
|
|
2495
2480
|
}
|
|
2496
2481
|
if (message.metadata !== undefined) {
|
|
2497
|
-
obj.metadata =
|
|
2482
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
2498
2483
|
}
|
|
2499
2484
|
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
2500
2485
|
obj.status = dAOStatusToJSON(message.status);
|
|
@@ -2502,7 +2487,7 @@ exports.ThresholdDAO = {
|
|
|
2502
2487
|
return obj;
|
|
2503
2488
|
},
|
|
2504
2489
|
create(base) {
|
|
2505
|
-
return
|
|
2490
|
+
return ThresholdDAO.fromPartial(base ?? {});
|
|
2506
2491
|
},
|
|
2507
2492
|
fromPartial(object) {
|
|
2508
2493
|
const message = createBaseThresholdDAO();
|
|
@@ -2520,14 +2505,14 @@ exports.ThresholdDAO = {
|
|
|
2520
2505
|
message.quorum = object.quorum ?? 0;
|
|
2521
2506
|
message.votingPeriodMs = object.votingPeriodMs ?? 0;
|
|
2522
2507
|
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
2523
|
-
?
|
|
2508
|
+
? Proposal.fromPartial(object.proposal)
|
|
2524
2509
|
: undefined;
|
|
2525
2510
|
message.votes = (object.votes !== undefined && object.votes !== null)
|
|
2526
|
-
?
|
|
2511
|
+
? ThresholdVotes.fromPartial(object.votes)
|
|
2527
2512
|
: undefined;
|
|
2528
|
-
message.history = object.history?.map((e) =>
|
|
2513
|
+
message.history = object.history?.map((e) => ThresholdHistoryEntry.fromPartial(e)) || [];
|
|
2529
2514
|
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
2530
|
-
?
|
|
2515
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
2531
2516
|
: undefined;
|
|
2532
2517
|
message.status = object.status ?? DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
2533
2518
|
return message;
|
|
@@ -2536,8 +2521,8 @@ exports.ThresholdDAO = {
|
|
|
2536
2521
|
function createBaseThresholdDAO_MemberJoinedAtEntry() {
|
|
2537
2522
|
return { key: "", value: 0 };
|
|
2538
2523
|
}
|
|
2539
|
-
|
|
2540
|
-
encode(message, writer = new
|
|
2524
|
+
export const ThresholdDAO_MemberJoinedAtEntry = {
|
|
2525
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2541
2526
|
if (message.key !== "") {
|
|
2542
2527
|
writer.uint32(10).string(message.key);
|
|
2543
2528
|
}
|
|
@@ -2547,7 +2532,7 @@ exports.ThresholdDAO_MemberJoinedAtEntry = {
|
|
|
2547
2532
|
return writer;
|
|
2548
2533
|
},
|
|
2549
2534
|
decode(input, length) {
|
|
2550
|
-
const reader = input instanceof
|
|
2535
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2551
2536
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2552
2537
|
const message = createBaseThresholdDAO_MemberJoinedAtEntry();
|
|
2553
2538
|
while (reader.pos < end) {
|
|
@@ -2592,7 +2577,7 @@ exports.ThresholdDAO_MemberJoinedAtEntry = {
|
|
|
2592
2577
|
return obj;
|
|
2593
2578
|
},
|
|
2594
2579
|
create(base) {
|
|
2595
|
-
return
|
|
2580
|
+
return ThresholdDAO_MemberJoinedAtEntry.fromPartial(base ?? {});
|
|
2596
2581
|
},
|
|
2597
2582
|
fromPartial(object) {
|
|
2598
2583
|
const message = createBaseThresholdDAO_MemberJoinedAtEntry();
|
|
@@ -2604,8 +2589,8 @@ exports.ThresholdDAO_MemberJoinedAtEntry = {
|
|
|
2604
2589
|
function createBaseThresholdVotes() {
|
|
2605
2590
|
return { votesFor: [], votesAgainst: [], votesAbstain: [] };
|
|
2606
2591
|
}
|
|
2607
|
-
|
|
2608
|
-
encode(message, writer = new
|
|
2592
|
+
export const ThresholdVotes = {
|
|
2593
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2609
2594
|
for (const v of message.votesFor) {
|
|
2610
2595
|
writer.uint32(10).string(v);
|
|
2611
2596
|
}
|
|
@@ -2618,7 +2603,7 @@ exports.ThresholdVotes = {
|
|
|
2618
2603
|
return writer;
|
|
2619
2604
|
},
|
|
2620
2605
|
decode(input, length) {
|
|
2621
|
-
const reader = input instanceof
|
|
2606
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2622
2607
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2623
2608
|
const message = createBaseThresholdVotes();
|
|
2624
2609
|
while (reader.pos < end) {
|
|
@@ -2686,7 +2671,7 @@ exports.ThresholdVotes = {
|
|
|
2686
2671
|
return obj;
|
|
2687
2672
|
},
|
|
2688
2673
|
create(base) {
|
|
2689
|
-
return
|
|
2674
|
+
return ThresholdVotes.fromPartial(base ?? {});
|
|
2690
2675
|
},
|
|
2691
2676
|
fromPartial(object) {
|
|
2692
2677
|
const message = createBaseThresholdVotes();
|
|
@@ -2699,24 +2684,24 @@ exports.ThresholdVotes = {
|
|
|
2699
2684
|
function createBaseThresholdHistoryEntry() {
|
|
2700
2685
|
return { resultType: "", proposal: undefined, votes: undefined, at: undefined };
|
|
2701
2686
|
}
|
|
2702
|
-
|
|
2703
|
-
encode(message, writer = new
|
|
2687
|
+
export const ThresholdHistoryEntry = {
|
|
2688
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2704
2689
|
if (message.resultType !== "") {
|
|
2705
2690
|
writer.uint32(10).string(message.resultType);
|
|
2706
2691
|
}
|
|
2707
2692
|
if (message.proposal !== undefined) {
|
|
2708
|
-
|
|
2693
|
+
Proposal.encode(message.proposal, writer.uint32(18).fork()).join();
|
|
2709
2694
|
}
|
|
2710
2695
|
if (message.votes !== undefined) {
|
|
2711
|
-
|
|
2696
|
+
ThresholdVotes.encode(message.votes, writer.uint32(26).fork()).join();
|
|
2712
2697
|
}
|
|
2713
2698
|
if (message.at !== undefined) {
|
|
2714
|
-
|
|
2699
|
+
Timestamp.encode(toTimestamp(message.at), writer.uint32(34).fork()).join();
|
|
2715
2700
|
}
|
|
2716
2701
|
return writer;
|
|
2717
2702
|
},
|
|
2718
2703
|
decode(input, length) {
|
|
2719
|
-
const reader = input instanceof
|
|
2704
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2720
2705
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2721
2706
|
const message = createBaseThresholdHistoryEntry();
|
|
2722
2707
|
while (reader.pos < end) {
|
|
@@ -2733,21 +2718,21 @@ exports.ThresholdHistoryEntry = {
|
|
|
2733
2718
|
if (tag !== 18) {
|
|
2734
2719
|
break;
|
|
2735
2720
|
}
|
|
2736
|
-
message.proposal =
|
|
2721
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
2737
2722
|
continue;
|
|
2738
2723
|
}
|
|
2739
2724
|
case 3: {
|
|
2740
2725
|
if (tag !== 26) {
|
|
2741
2726
|
break;
|
|
2742
2727
|
}
|
|
2743
|
-
message.votes =
|
|
2728
|
+
message.votes = ThresholdVotes.decode(reader, reader.uint32());
|
|
2744
2729
|
continue;
|
|
2745
2730
|
}
|
|
2746
2731
|
case 4: {
|
|
2747
2732
|
if (tag !== 34) {
|
|
2748
2733
|
break;
|
|
2749
2734
|
}
|
|
2750
|
-
message.at = fromTimestamp(
|
|
2735
|
+
message.at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
2751
2736
|
continue;
|
|
2752
2737
|
}
|
|
2753
2738
|
}
|
|
@@ -2765,8 +2750,8 @@ exports.ThresholdHistoryEntry = {
|
|
|
2765
2750
|
: isSet(object.result_type)
|
|
2766
2751
|
? globalThis.String(object.result_type)
|
|
2767
2752
|
: "",
|
|
2768
|
-
proposal: isSet(object.proposal) ?
|
|
2769
|
-
votes: isSet(object.votes) ?
|
|
2753
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
2754
|
+
votes: isSet(object.votes) ? ThresholdVotes.fromJSON(object.votes) : undefined,
|
|
2770
2755
|
at: isSet(object.at) ? fromJsonTimestamp(object.at) : undefined,
|
|
2771
2756
|
};
|
|
2772
2757
|
},
|
|
@@ -2776,10 +2761,10 @@ exports.ThresholdHistoryEntry = {
|
|
|
2776
2761
|
obj.resultType = message.resultType;
|
|
2777
2762
|
}
|
|
2778
2763
|
if (message.proposal !== undefined) {
|
|
2779
|
-
obj.proposal =
|
|
2764
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
2780
2765
|
}
|
|
2781
2766
|
if (message.votes !== undefined) {
|
|
2782
|
-
obj.votes =
|
|
2767
|
+
obj.votes = ThresholdVotes.toJSON(message.votes);
|
|
2783
2768
|
}
|
|
2784
2769
|
if (message.at !== undefined) {
|
|
2785
2770
|
obj.at = message.at.toISOString();
|
|
@@ -2787,16 +2772,16 @@ exports.ThresholdHistoryEntry = {
|
|
|
2787
2772
|
return obj;
|
|
2788
2773
|
},
|
|
2789
2774
|
create(base) {
|
|
2790
|
-
return
|
|
2775
|
+
return ThresholdHistoryEntry.fromPartial(base ?? {});
|
|
2791
2776
|
},
|
|
2792
2777
|
fromPartial(object) {
|
|
2793
2778
|
const message = createBaseThresholdHistoryEntry();
|
|
2794
2779
|
message.resultType = object.resultType ?? "";
|
|
2795
2780
|
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
2796
|
-
?
|
|
2781
|
+
? Proposal.fromPartial(object.proposal)
|
|
2797
2782
|
: undefined;
|
|
2798
2783
|
message.votes = (object.votes !== undefined && object.votes !== null)
|
|
2799
|
-
?
|
|
2784
|
+
? ThresholdVotes.fromPartial(object.votes)
|
|
2800
2785
|
: undefined;
|
|
2801
2786
|
message.at = object.at ?? undefined;
|
|
2802
2787
|
return message;
|
|
@@ -2805,8 +2790,8 @@ exports.ThresholdHistoryEntry = {
|
|
|
2805
2790
|
function createBaseCreateDAORequest() {
|
|
2806
2791
|
return { daoType: DAOType.DAO_TYPE_UNSPECIFIED, name: "", creator: "", metadata: undefined, config: undefined };
|
|
2807
2792
|
}
|
|
2808
|
-
|
|
2809
|
-
encode(message, writer = new
|
|
2793
|
+
export const CreateDAORequest = {
|
|
2794
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2810
2795
|
if (message.daoType !== DAOType.DAO_TYPE_UNSPECIFIED) {
|
|
2811
2796
|
writer.uint32(8).int32(dAOTypeToNumber(message.daoType));
|
|
2812
2797
|
}
|
|
@@ -2817,15 +2802,15 @@ exports.CreateDAORequest = {
|
|
|
2817
2802
|
writer.uint32(26).string(message.creator);
|
|
2818
2803
|
}
|
|
2819
2804
|
if (message.metadata !== undefined) {
|
|
2820
|
-
|
|
2805
|
+
DAOMetadata.encode(message.metadata, writer.uint32(34).fork()).join();
|
|
2821
2806
|
}
|
|
2822
2807
|
if (message.config !== undefined) {
|
|
2823
|
-
|
|
2808
|
+
Struct.encode(Struct.wrap(message.config), writer.uint32(42).fork()).join();
|
|
2824
2809
|
}
|
|
2825
2810
|
return writer;
|
|
2826
2811
|
},
|
|
2827
2812
|
decode(input, length) {
|
|
2828
|
-
const reader = input instanceof
|
|
2813
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2829
2814
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2830
2815
|
const message = createBaseCreateDAORequest();
|
|
2831
2816
|
while (reader.pos < end) {
|
|
@@ -2856,14 +2841,14 @@ exports.CreateDAORequest = {
|
|
|
2856
2841
|
if (tag !== 34) {
|
|
2857
2842
|
break;
|
|
2858
2843
|
}
|
|
2859
|
-
message.metadata =
|
|
2844
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
2860
2845
|
continue;
|
|
2861
2846
|
}
|
|
2862
2847
|
case 5: {
|
|
2863
2848
|
if (tag !== 42) {
|
|
2864
2849
|
break;
|
|
2865
2850
|
}
|
|
2866
|
-
message.config =
|
|
2851
|
+
message.config = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2867
2852
|
continue;
|
|
2868
2853
|
}
|
|
2869
2854
|
}
|
|
@@ -2883,7 +2868,7 @@ exports.CreateDAORequest = {
|
|
|
2883
2868
|
: DAOType.DAO_TYPE_UNSPECIFIED,
|
|
2884
2869
|
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
2885
2870
|
creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
|
|
2886
|
-
metadata: isSet(object.metadata) ?
|
|
2871
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
2887
2872
|
config: isObject(object.config) ? object.config : undefined,
|
|
2888
2873
|
};
|
|
2889
2874
|
},
|
|
@@ -2899,7 +2884,7 @@ exports.CreateDAORequest = {
|
|
|
2899
2884
|
obj.creator = message.creator;
|
|
2900
2885
|
}
|
|
2901
2886
|
if (message.metadata !== undefined) {
|
|
2902
|
-
obj.metadata =
|
|
2887
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
2903
2888
|
}
|
|
2904
2889
|
if (message.config !== undefined) {
|
|
2905
2890
|
obj.config = message.config;
|
|
@@ -2907,7 +2892,7 @@ exports.CreateDAORequest = {
|
|
|
2907
2892
|
return obj;
|
|
2908
2893
|
},
|
|
2909
2894
|
create(base) {
|
|
2910
|
-
return
|
|
2895
|
+
return CreateDAORequest.fromPartial(base ?? {});
|
|
2911
2896
|
},
|
|
2912
2897
|
fromPartial(object) {
|
|
2913
2898
|
const message = createBaseCreateDAORequest();
|
|
@@ -2915,7 +2900,7 @@ exports.CreateDAORequest = {
|
|
|
2915
2900
|
message.name = object.name ?? "";
|
|
2916
2901
|
message.creator = object.creator ?? "";
|
|
2917
2902
|
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
2918
|
-
?
|
|
2903
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
2919
2904
|
: undefined;
|
|
2920
2905
|
message.config = object.config ?? undefined;
|
|
2921
2906
|
return message;
|
|
@@ -2924,8 +2909,8 @@ exports.CreateDAORequest = {
|
|
|
2924
2909
|
function createBaseProposeRequest() {
|
|
2925
2910
|
return { daoId: "", proposer: "", title: "", description: "", actionType: "", payload: undefined };
|
|
2926
2911
|
}
|
|
2927
|
-
|
|
2928
|
-
encode(message, writer = new
|
|
2912
|
+
export const ProposeRequest = {
|
|
2913
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2929
2914
|
if (message.daoId !== "") {
|
|
2930
2915
|
writer.uint32(10).string(message.daoId);
|
|
2931
2916
|
}
|
|
@@ -2942,12 +2927,12 @@ exports.ProposeRequest = {
|
|
|
2942
2927
|
writer.uint32(42).string(message.actionType);
|
|
2943
2928
|
}
|
|
2944
2929
|
if (message.payload !== undefined) {
|
|
2945
|
-
|
|
2930
|
+
Struct.encode(Struct.wrap(message.payload), writer.uint32(50).fork()).join();
|
|
2946
2931
|
}
|
|
2947
2932
|
return writer;
|
|
2948
2933
|
},
|
|
2949
2934
|
decode(input, length) {
|
|
2950
|
-
const reader = input instanceof
|
|
2935
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2951
2936
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2952
2937
|
const message = createBaseProposeRequest();
|
|
2953
2938
|
while (reader.pos < end) {
|
|
@@ -2992,7 +2977,7 @@ exports.ProposeRequest = {
|
|
|
2992
2977
|
if (tag !== 50) {
|
|
2993
2978
|
break;
|
|
2994
2979
|
}
|
|
2995
|
-
message.payload =
|
|
2980
|
+
message.payload = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2996
2981
|
continue;
|
|
2997
2982
|
}
|
|
2998
2983
|
}
|
|
@@ -3044,7 +3029,7 @@ exports.ProposeRequest = {
|
|
|
3044
3029
|
return obj;
|
|
3045
3030
|
},
|
|
3046
3031
|
create(base) {
|
|
3047
|
-
return
|
|
3032
|
+
return ProposeRequest.fromPartial(base ?? {});
|
|
3048
3033
|
},
|
|
3049
3034
|
fromPartial(object) {
|
|
3050
3035
|
const message = createBaseProposeRequest();
|
|
@@ -3060,8 +3045,8 @@ exports.ProposeRequest = {
|
|
|
3060
3045
|
function createBaseVoteRequest() {
|
|
3061
3046
|
return { daoId: "", voter: "", choice: VoteChoice.VOTE_CHOICE_UNSPECIFIED };
|
|
3062
3047
|
}
|
|
3063
|
-
|
|
3064
|
-
encode(message, writer = new
|
|
3048
|
+
export const VoteRequest = {
|
|
3049
|
+
encode(message, writer = new BinaryWriter()) {
|
|
3065
3050
|
if (message.daoId !== "") {
|
|
3066
3051
|
writer.uint32(10).string(message.daoId);
|
|
3067
3052
|
}
|
|
@@ -3074,7 +3059,7 @@ exports.VoteRequest = {
|
|
|
3074
3059
|
return writer;
|
|
3075
3060
|
},
|
|
3076
3061
|
decode(input, length) {
|
|
3077
|
-
const reader = input instanceof
|
|
3062
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3078
3063
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3079
3064
|
const message = createBaseVoteRequest();
|
|
3080
3065
|
while (reader.pos < end) {
|
|
@@ -3134,7 +3119,7 @@ exports.VoteRequest = {
|
|
|
3134
3119
|
return obj;
|
|
3135
3120
|
},
|
|
3136
3121
|
create(base) {
|
|
3137
|
-
return
|
|
3122
|
+
return VoteRequest.fromPartial(base ?? {});
|
|
3138
3123
|
},
|
|
3139
3124
|
fromPartial(object) {
|
|
3140
3125
|
const message = createBaseVoteRequest();
|
|
@@ -3147,8 +3132,8 @@ exports.VoteRequest = {
|
|
|
3147
3132
|
function createBaseExecuteRequest() {
|
|
3148
3133
|
return { daoId: "", executor: "" };
|
|
3149
3134
|
}
|
|
3150
|
-
|
|
3151
|
-
encode(message, writer = new
|
|
3135
|
+
export const ExecuteRequest = {
|
|
3136
|
+
encode(message, writer = new BinaryWriter()) {
|
|
3152
3137
|
if (message.daoId !== "") {
|
|
3153
3138
|
writer.uint32(10).string(message.daoId);
|
|
3154
3139
|
}
|
|
@@ -3158,7 +3143,7 @@ exports.ExecuteRequest = {
|
|
|
3158
3143
|
return writer;
|
|
3159
3144
|
},
|
|
3160
3145
|
decode(input, length) {
|
|
3161
|
-
const reader = input instanceof
|
|
3146
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3162
3147
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3163
3148
|
const message = createBaseExecuteRequest();
|
|
3164
3149
|
while (reader.pos < end) {
|
|
@@ -3207,7 +3192,7 @@ exports.ExecuteRequest = {
|
|
|
3207
3192
|
return obj;
|
|
3208
3193
|
},
|
|
3209
3194
|
create(base) {
|
|
3210
|
-
return
|
|
3195
|
+
return ExecuteRequest.fromPartial(base ?? {});
|
|
3211
3196
|
},
|
|
3212
3197
|
fromPartial(object) {
|
|
3213
3198
|
const message = createBaseExecuteRequest();
|
|
@@ -3234,7 +3219,7 @@ function fromJsonTimestamp(o) {
|
|
|
3234
3219
|
return new globalThis.Date(o);
|
|
3235
3220
|
}
|
|
3236
3221
|
else {
|
|
3237
|
-
return fromTimestamp(
|
|
3222
|
+
return fromTimestamp(Timestamp.fromJSON(o));
|
|
3238
3223
|
}
|
|
3239
3224
|
}
|
|
3240
3225
|
function longToNumber(int64) {
|