carbon-js-sdk 0.3.52 → 0.3.53-dev.1
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/lib/CarbonSDK.js +1 -1
- package/lib/clients/ETHClient.d.ts +11 -4
- package/lib/clients/ETHClient.js +20 -6
- package/lib/clients/HydrogenClient.d.ts +16 -7
- package/lib/clients/HydrogenClient.js +55 -9
- package/lib/clients/NEOClient.d.ts +1 -1
- package/lib/clients/NEOClient.js +9 -4
- package/lib/clients/TokenClient.d.ts +17 -4
- package/lib/clients/TokenClient.js +121 -8
- package/lib/clients/ZILClient.d.ts +1 -1
- package/lib/clients/ZILClient.js +9 -4
- package/lib/codec/cosmos/app/module/v1alpha1/module.d.ts +18 -0
- package/lib/codec/cosmos/app/module/v1alpha1/module.js +46 -0
- package/lib/codec/cosmos/app/v1alpha1/config.d.ts +57 -0
- package/lib/codec/cosmos/app/v1alpha1/config.js +125 -0
- package/lib/codec/cosmos/app/v1alpha1/export.d.ts +3 -0
- package/lib/codec/cosmos/app/v1alpha1/export.js +13 -0
- package/lib/codec/cosmos/app/v1alpha1/module.d.ts +109 -0
- package/lib/codec/cosmos/app/v1alpha1/module.js +192 -0
- package/lib/codec/cosmos/app/v1alpha1/query.d.ts +44 -0
- package/lib/codec/cosmos/app/v1alpha1/query.js +107 -0
- package/lib/codec/cosmos/authz/v1beta1/export.d.ts +4 -0
- package/lib/codec/cosmos/authz/v1beta1/export.js +25 -0
- package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +42 -0
- package/lib/codec/cosmos/base/node/v1beta1/query.js +104 -0
- package/lib/codec/cosmos/base/tendermint/v1beta1/types.d.ts +67 -0
- package/lib/codec/cosmos/base/tendermint/v1beta1/types.js +423 -0
- package/lib/codec/cosmos/capability/v1beta1/export.d.ts +2 -0
- package/lib/codec/cosmos/capability/v1beta1/export.js +9 -0
- package/lib/codec/cosmos/crisis/v1beta1/export.d.ts +1 -0
- package/lib/codec/cosmos/crisis/v1beta1/export.js +6 -0
- package/lib/codec/cosmos/crypto/hd/v1/hd.d.ts +32 -0
- package/lib/codec/cosmos/crypto/hd/v1/hd.js +114 -0
- package/lib/codec/cosmos/crypto/keyring/v1/record.d.ts +78 -0
- package/lib/codec/cosmos/crypto/keyring/v1/record.js +309 -0
- package/lib/codec/cosmos/evidence/v1beta1/export.d.ts +3 -0
- package/lib/codec/cosmos/evidence/v1beta1/export.js +13 -0
- package/lib/codec/cosmos/feegrant/v1beta1/export.d.ts +3 -0
- package/lib/codec/cosmos/feegrant/v1beta1/export.js +20 -0
- package/lib/codec/cosmos/gov/v1/export.d.ts +3 -0
- package/lib/codec/cosmos/gov/v1/export.js +46 -0
- package/lib/codec/cosmos/gov/v1/genesis.d.ts +34 -0
- package/lib/codec/cosmos/gov/v1/genesis.js +166 -0
- package/lib/codec/cosmos/gov/v1/gov.d.ts +198 -0
- package/lib/codec/cosmos/gov/v1/gov.js +855 -0
- package/lib/codec/cosmos/gov/v1/query.d.ts +264 -0
- package/lib/codec/cosmos/gov/v1/query.js +1045 -0
- package/lib/codec/cosmos/gov/v1/tx.d.ts +167 -0
- package/lib/codec/cosmos/gov/v1/tx.js +639 -0
- package/lib/codec/cosmos/group/v1/events.d.ts +124 -0
- package/lib/codec/cosmos/group/v1/events.js +480 -0
- package/lib/codec/cosmos/group/v1/export.d.ts +4 -0
- package/lib/codec/cosmos/group/v1/export.js +94 -0
- package/lib/codec/cosmos/group/v1/genesis.d.ts +45 -0
- package/lib/codec/cosmos/group/v1/genesis.js +176 -0
- package/lib/codec/cosmos/group/v1/query.d.ts +412 -0
- package/lib/codec/cosmos/group/v1/query.js +1648 -0
- package/lib/codec/cosmos/group/v1/tx.d.ts +483 -0
- package/lib/codec/cosmos/group/v1/tx.js +1840 -0
- package/lib/codec/cosmos/group/v1/types.d.ts +356 -0
- package/lib/codec/cosmos/group/v1/types.js +1306 -0
- package/lib/codec/cosmos/msg/v1/msg.d.ts +1 -0
- package/lib/codec/cosmos/msg/v1/msg.js +14 -0
- package/lib/codec/cosmos/nft/v1beta1/event.d.ts +48 -0
- package/lib/codec/cosmos/nft/v1beta1/event.js +227 -0
- package/lib/codec/cosmos/nft/v1beta1/export.d.ts +5 -0
- package/lib/codec/cosmos/nft/v1beta1/export.js +30 -0
- package/lib/codec/cosmos/nft/v1beta1/genesis.d.ts +36 -0
- package/lib/codec/cosmos/nft/v1beta1/genesis.js +140 -0
- package/lib/codec/cosmos/nft/v1beta1/nft.d.ts +53 -0
- package/lib/codec/cosmos/nft/v1beta1/nft.js +233 -0
- package/lib/codec/cosmos/nft/v1beta1/query.d.ts +206 -0
- package/lib/codec/cosmos/nft/v1beta1/query.js +817 -0
- package/lib/codec/cosmos/nft/v1beta1/tx.d.ts +49 -0
- package/lib/codec/cosmos/nft/v1beta1/tx.js +137 -0
- package/lib/codec/cosmos/orm/module/v1alpha1/module.d.ts +22 -0
- package/lib/codec/cosmos/orm/module/v1alpha1/module.js +46 -0
- package/lib/codec/cosmos/orm/v1/export.d.ts +1 -0
- package/lib/codec/cosmos/orm/v1/export.js +8 -0
- package/lib/codec/cosmos/orm/v1/orm.d.ts +123 -0
- package/lib/codec/cosmos/orm/v1/orm.js +263 -0
- package/lib/codec/cosmos/orm/v1alpha1/export.d.ts +1 -0
- package/lib/codec/cosmos/orm/v1alpha1/export.js +9 -0
- package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +96 -0
- package/lib/codec/cosmos/orm/v1alpha1/schema.js +265 -0
- package/lib/codec/cosmos/upgrade/v1beta1/export.d.ts +3 -0
- package/lib/codec/cosmos/upgrade/v1beta1/export.js +24 -0
- package/lib/codec/cosmos/upgrade/v1beta1/tx.d.ts +97 -0
- package/lib/codec/cosmos/upgrade/v1beta1/tx.js +203 -0
- package/lib/codec/ibc/applications/fee/v1/ack.d.ts +24 -0
- package/lib/codec/ibc/applications/fee/v1/ack.js +125 -0
- package/lib/codec/ibc/applications/fee/v1/export.d.ts +6 -0
- package/lib/codec/ibc/applications/fee/v1/export.js +47 -0
- package/lib/codec/ibc/applications/fee/v1/fee.d.ts +68 -0
- package/lib/codec/ibc/applications/fee/v1/fee.js +289 -0
- package/lib/codec/ibc/applications/fee/v1/genesis.d.ts +93 -0
- package/lib/codec/ibc/applications/fee/v1/genesis.js +390 -0
- package/lib/codec/ibc/applications/fee/v1/metadata.d.ts +25 -0
- package/lib/codec/ibc/applications/fee/v1/metadata.js +71 -0
- package/lib/codec/ibc/applications/fee/v1/query.d.ts +312 -0
- package/lib/codec/ibc/applications/fee/v1/query.js +1187 -0
- package/lib/codec/ibc/applications/fee/v1/tx.d.ts +171 -0
- package/lib/codec/ibc/applications/fee/v1/tx.js +524 -0
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +78 -0
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.js +296 -0
- package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.d.ts +80 -0
- package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.js +439 -0
- package/lib/hydrogen/transfer.d.ts +5 -5
- package/lib/insights/competition.d.ts +1 -0
- package/lib/provider/metamask/MetaMask.d.ts +5 -5
- package/lib/provider/metamask/MetaMask.js +35 -35
- package/lib/util/blockchain.d.ts +9 -0
- package/lib/util/blockchain.js +143 -1
- package/lib/util/ibc.d.ts +4 -4
- package/lib/util/ibc.js +17 -18
- package/package.json +1 -1
|
@@ -0,0 +1,855 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TallyParams = exports.VotingParams = exports.DepositParams = exports.Vote = exports.TallyResult = exports.Proposal = exports.Deposit = exports.WeightedVoteOption = exports.proposalStatusToJSON = exports.proposalStatusFromJSON = exports.ProposalStatus = exports.voteOptionToJSON = exports.voteOptionFromJSON = exports.VoteOption = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
9
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
const duration_1 = require("../../../google/protobuf/duration");
|
|
11
|
+
const timestamp_1 = require("../../../google/protobuf/timestamp");
|
|
12
|
+
const coin_1 = require("../../base/v1beta1/coin");
|
|
13
|
+
const any_1 = require("../../../google/protobuf/any");
|
|
14
|
+
exports.protobufPackage = "cosmos.gov.v1";
|
|
15
|
+
/** Since: cosmos-sdk 0.46 */
|
|
16
|
+
/** VoteOption enumerates the valid vote options for a given governance proposal. */
|
|
17
|
+
var VoteOption;
|
|
18
|
+
(function (VoteOption) {
|
|
19
|
+
/** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */
|
|
20
|
+
VoteOption[VoteOption["VOTE_OPTION_UNSPECIFIED"] = 0] = "VOTE_OPTION_UNSPECIFIED";
|
|
21
|
+
/** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */
|
|
22
|
+
VoteOption[VoteOption["VOTE_OPTION_YES"] = 1] = "VOTE_OPTION_YES";
|
|
23
|
+
/** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */
|
|
24
|
+
VoteOption[VoteOption["VOTE_OPTION_ABSTAIN"] = 2] = "VOTE_OPTION_ABSTAIN";
|
|
25
|
+
/** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */
|
|
26
|
+
VoteOption[VoteOption["VOTE_OPTION_NO"] = 3] = "VOTE_OPTION_NO";
|
|
27
|
+
/** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */
|
|
28
|
+
VoteOption[VoteOption["VOTE_OPTION_NO_WITH_VETO"] = 4] = "VOTE_OPTION_NO_WITH_VETO";
|
|
29
|
+
VoteOption[VoteOption["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
30
|
+
})(VoteOption = exports.VoteOption || (exports.VoteOption = {}));
|
|
31
|
+
function voteOptionFromJSON(object) {
|
|
32
|
+
switch (object) {
|
|
33
|
+
case 0:
|
|
34
|
+
case "VOTE_OPTION_UNSPECIFIED":
|
|
35
|
+
return VoteOption.VOTE_OPTION_UNSPECIFIED;
|
|
36
|
+
case 1:
|
|
37
|
+
case "VOTE_OPTION_YES":
|
|
38
|
+
return VoteOption.VOTE_OPTION_YES;
|
|
39
|
+
case 2:
|
|
40
|
+
case "VOTE_OPTION_ABSTAIN":
|
|
41
|
+
return VoteOption.VOTE_OPTION_ABSTAIN;
|
|
42
|
+
case 3:
|
|
43
|
+
case "VOTE_OPTION_NO":
|
|
44
|
+
return VoteOption.VOTE_OPTION_NO;
|
|
45
|
+
case 4:
|
|
46
|
+
case "VOTE_OPTION_NO_WITH_VETO":
|
|
47
|
+
return VoteOption.VOTE_OPTION_NO_WITH_VETO;
|
|
48
|
+
case -1:
|
|
49
|
+
case "UNRECOGNIZED":
|
|
50
|
+
default:
|
|
51
|
+
return VoteOption.UNRECOGNIZED;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.voteOptionFromJSON = voteOptionFromJSON;
|
|
55
|
+
function voteOptionToJSON(object) {
|
|
56
|
+
switch (object) {
|
|
57
|
+
case VoteOption.VOTE_OPTION_UNSPECIFIED:
|
|
58
|
+
return "VOTE_OPTION_UNSPECIFIED";
|
|
59
|
+
case VoteOption.VOTE_OPTION_YES:
|
|
60
|
+
return "VOTE_OPTION_YES";
|
|
61
|
+
case VoteOption.VOTE_OPTION_ABSTAIN:
|
|
62
|
+
return "VOTE_OPTION_ABSTAIN";
|
|
63
|
+
case VoteOption.VOTE_OPTION_NO:
|
|
64
|
+
return "VOTE_OPTION_NO";
|
|
65
|
+
case VoteOption.VOTE_OPTION_NO_WITH_VETO:
|
|
66
|
+
return "VOTE_OPTION_NO_WITH_VETO";
|
|
67
|
+
default:
|
|
68
|
+
return "UNKNOWN";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.voteOptionToJSON = voteOptionToJSON;
|
|
72
|
+
/** ProposalStatus enumerates the valid statuses of a proposal. */
|
|
73
|
+
var ProposalStatus;
|
|
74
|
+
(function (ProposalStatus) {
|
|
75
|
+
/** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */
|
|
76
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_UNSPECIFIED"] = 0] = "PROPOSAL_STATUS_UNSPECIFIED";
|
|
77
|
+
/**
|
|
78
|
+
* PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit
|
|
79
|
+
* period.
|
|
80
|
+
*/
|
|
81
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD";
|
|
82
|
+
/**
|
|
83
|
+
* PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting
|
|
84
|
+
* period.
|
|
85
|
+
*/
|
|
86
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_VOTING_PERIOD"] = 2] = "PROPOSAL_STATUS_VOTING_PERIOD";
|
|
87
|
+
/**
|
|
88
|
+
* PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has
|
|
89
|
+
* passed.
|
|
90
|
+
*/
|
|
91
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_PASSED"] = 3] = "PROPOSAL_STATUS_PASSED";
|
|
92
|
+
/**
|
|
93
|
+
* PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has
|
|
94
|
+
* been rejected.
|
|
95
|
+
*/
|
|
96
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_REJECTED"] = 4] = "PROPOSAL_STATUS_REJECTED";
|
|
97
|
+
/**
|
|
98
|
+
* PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has
|
|
99
|
+
* failed.
|
|
100
|
+
*/
|
|
101
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_FAILED"] = 5] = "PROPOSAL_STATUS_FAILED";
|
|
102
|
+
ProposalStatus[ProposalStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
103
|
+
})(ProposalStatus = exports.ProposalStatus || (exports.ProposalStatus = {}));
|
|
104
|
+
function proposalStatusFromJSON(object) {
|
|
105
|
+
switch (object) {
|
|
106
|
+
case 0:
|
|
107
|
+
case "PROPOSAL_STATUS_UNSPECIFIED":
|
|
108
|
+
return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED;
|
|
109
|
+
case 1:
|
|
110
|
+
case "PROPOSAL_STATUS_DEPOSIT_PERIOD":
|
|
111
|
+
return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD;
|
|
112
|
+
case 2:
|
|
113
|
+
case "PROPOSAL_STATUS_VOTING_PERIOD":
|
|
114
|
+
return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD;
|
|
115
|
+
case 3:
|
|
116
|
+
case "PROPOSAL_STATUS_PASSED":
|
|
117
|
+
return ProposalStatus.PROPOSAL_STATUS_PASSED;
|
|
118
|
+
case 4:
|
|
119
|
+
case "PROPOSAL_STATUS_REJECTED":
|
|
120
|
+
return ProposalStatus.PROPOSAL_STATUS_REJECTED;
|
|
121
|
+
case 5:
|
|
122
|
+
case "PROPOSAL_STATUS_FAILED":
|
|
123
|
+
return ProposalStatus.PROPOSAL_STATUS_FAILED;
|
|
124
|
+
case -1:
|
|
125
|
+
case "UNRECOGNIZED":
|
|
126
|
+
default:
|
|
127
|
+
return ProposalStatus.UNRECOGNIZED;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.proposalStatusFromJSON = proposalStatusFromJSON;
|
|
131
|
+
function proposalStatusToJSON(object) {
|
|
132
|
+
switch (object) {
|
|
133
|
+
case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED:
|
|
134
|
+
return "PROPOSAL_STATUS_UNSPECIFIED";
|
|
135
|
+
case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD:
|
|
136
|
+
return "PROPOSAL_STATUS_DEPOSIT_PERIOD";
|
|
137
|
+
case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD:
|
|
138
|
+
return "PROPOSAL_STATUS_VOTING_PERIOD";
|
|
139
|
+
case ProposalStatus.PROPOSAL_STATUS_PASSED:
|
|
140
|
+
return "PROPOSAL_STATUS_PASSED";
|
|
141
|
+
case ProposalStatus.PROPOSAL_STATUS_REJECTED:
|
|
142
|
+
return "PROPOSAL_STATUS_REJECTED";
|
|
143
|
+
case ProposalStatus.PROPOSAL_STATUS_FAILED:
|
|
144
|
+
return "PROPOSAL_STATUS_FAILED";
|
|
145
|
+
default:
|
|
146
|
+
return "UNKNOWN";
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.proposalStatusToJSON = proposalStatusToJSON;
|
|
150
|
+
const baseWeightedVoteOption = { option: 0, weight: "" };
|
|
151
|
+
exports.WeightedVoteOption = {
|
|
152
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
153
|
+
if (message.option !== 0) {
|
|
154
|
+
writer.uint32(8).int32(message.option);
|
|
155
|
+
}
|
|
156
|
+
if (message.weight !== "") {
|
|
157
|
+
writer.uint32(18).string(message.weight);
|
|
158
|
+
}
|
|
159
|
+
return writer;
|
|
160
|
+
},
|
|
161
|
+
decode(input, length) {
|
|
162
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
163
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
164
|
+
const message = Object.assign({}, baseWeightedVoteOption);
|
|
165
|
+
while (reader.pos < end) {
|
|
166
|
+
const tag = reader.uint32();
|
|
167
|
+
switch (tag >>> 3) {
|
|
168
|
+
case 1:
|
|
169
|
+
message.option = reader.int32();
|
|
170
|
+
break;
|
|
171
|
+
case 2:
|
|
172
|
+
message.weight = reader.string();
|
|
173
|
+
break;
|
|
174
|
+
default:
|
|
175
|
+
reader.skipType(tag & 7);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return message;
|
|
180
|
+
},
|
|
181
|
+
fromJSON(object) {
|
|
182
|
+
const message = Object.assign({}, baseWeightedVoteOption);
|
|
183
|
+
message.option =
|
|
184
|
+
object.option !== undefined && object.option !== null
|
|
185
|
+
? voteOptionFromJSON(object.option)
|
|
186
|
+
: 0;
|
|
187
|
+
message.weight =
|
|
188
|
+
object.weight !== undefined && object.weight !== null
|
|
189
|
+
? String(object.weight)
|
|
190
|
+
: "";
|
|
191
|
+
return message;
|
|
192
|
+
},
|
|
193
|
+
toJSON(message) {
|
|
194
|
+
const obj = {};
|
|
195
|
+
message.option !== undefined &&
|
|
196
|
+
(obj.option = voteOptionToJSON(message.option));
|
|
197
|
+
message.weight !== undefined && (obj.weight = message.weight);
|
|
198
|
+
return obj;
|
|
199
|
+
},
|
|
200
|
+
fromPartial(object) {
|
|
201
|
+
var _a, _b;
|
|
202
|
+
const message = Object.assign({}, baseWeightedVoteOption);
|
|
203
|
+
message.option = (_a = object.option) !== null && _a !== void 0 ? _a : 0;
|
|
204
|
+
message.weight = (_b = object.weight) !== null && _b !== void 0 ? _b : "";
|
|
205
|
+
return message;
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
const baseDeposit = { proposalId: long_1.default.UZERO, depositor: "" };
|
|
209
|
+
exports.Deposit = {
|
|
210
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
211
|
+
if (!message.proposalId.isZero()) {
|
|
212
|
+
writer.uint32(8).uint64(message.proposalId);
|
|
213
|
+
}
|
|
214
|
+
if (message.depositor !== "") {
|
|
215
|
+
writer.uint32(18).string(message.depositor);
|
|
216
|
+
}
|
|
217
|
+
for (const v of message.amount) {
|
|
218
|
+
coin_1.Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
219
|
+
}
|
|
220
|
+
return writer;
|
|
221
|
+
},
|
|
222
|
+
decode(input, length) {
|
|
223
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
224
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
225
|
+
const message = Object.assign({}, baseDeposit);
|
|
226
|
+
message.amount = [];
|
|
227
|
+
while (reader.pos < end) {
|
|
228
|
+
const tag = reader.uint32();
|
|
229
|
+
switch (tag >>> 3) {
|
|
230
|
+
case 1:
|
|
231
|
+
message.proposalId = reader.uint64();
|
|
232
|
+
break;
|
|
233
|
+
case 2:
|
|
234
|
+
message.depositor = reader.string();
|
|
235
|
+
break;
|
|
236
|
+
case 3:
|
|
237
|
+
message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));
|
|
238
|
+
break;
|
|
239
|
+
default:
|
|
240
|
+
reader.skipType(tag & 7);
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return message;
|
|
245
|
+
},
|
|
246
|
+
fromJSON(object) {
|
|
247
|
+
var _a;
|
|
248
|
+
const message = Object.assign({}, baseDeposit);
|
|
249
|
+
message.proposalId =
|
|
250
|
+
object.proposalId !== undefined && object.proposalId !== null
|
|
251
|
+
? long_1.default.fromString(object.proposalId)
|
|
252
|
+
: long_1.default.UZERO;
|
|
253
|
+
message.depositor =
|
|
254
|
+
object.depositor !== undefined && object.depositor !== null
|
|
255
|
+
? String(object.depositor)
|
|
256
|
+
: "";
|
|
257
|
+
message.amount = ((_a = object.amount) !== null && _a !== void 0 ? _a : []).map((e) => coin_1.Coin.fromJSON(e));
|
|
258
|
+
return message;
|
|
259
|
+
},
|
|
260
|
+
toJSON(message) {
|
|
261
|
+
const obj = {};
|
|
262
|
+
message.proposalId !== undefined &&
|
|
263
|
+
(obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());
|
|
264
|
+
message.depositor !== undefined && (obj.depositor = message.depositor);
|
|
265
|
+
if (message.amount) {
|
|
266
|
+
obj.amount = message.amount.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
obj.amount = [];
|
|
270
|
+
}
|
|
271
|
+
return obj;
|
|
272
|
+
},
|
|
273
|
+
fromPartial(object) {
|
|
274
|
+
var _a, _b;
|
|
275
|
+
const message = Object.assign({}, baseDeposit);
|
|
276
|
+
message.proposalId =
|
|
277
|
+
object.proposalId !== undefined && object.proposalId !== null
|
|
278
|
+
? long_1.default.fromValue(object.proposalId)
|
|
279
|
+
: long_1.default.UZERO;
|
|
280
|
+
message.depositor = (_a = object.depositor) !== null && _a !== void 0 ? _a : "";
|
|
281
|
+
message.amount = ((_b = object.amount) !== null && _b !== void 0 ? _b : []).map((e) => coin_1.Coin.fromPartial(e));
|
|
282
|
+
return message;
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
const baseProposal = { id: long_1.default.UZERO, status: 0, metadata: "" };
|
|
286
|
+
exports.Proposal = {
|
|
287
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
288
|
+
if (!message.id.isZero()) {
|
|
289
|
+
writer.uint32(8).uint64(message.id);
|
|
290
|
+
}
|
|
291
|
+
for (const v of message.messages) {
|
|
292
|
+
any_1.Any.encode(v, writer.uint32(18).fork()).ldelim();
|
|
293
|
+
}
|
|
294
|
+
if (message.status !== 0) {
|
|
295
|
+
writer.uint32(24).int32(message.status);
|
|
296
|
+
}
|
|
297
|
+
if (message.finalTallyResult !== undefined) {
|
|
298
|
+
exports.TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim();
|
|
299
|
+
}
|
|
300
|
+
if (message.submitTime !== undefined) {
|
|
301
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim();
|
|
302
|
+
}
|
|
303
|
+
if (message.depositEndTime !== undefined) {
|
|
304
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim();
|
|
305
|
+
}
|
|
306
|
+
for (const v of message.totalDeposit) {
|
|
307
|
+
coin_1.Coin.encode(v, writer.uint32(58).fork()).ldelim();
|
|
308
|
+
}
|
|
309
|
+
if (message.votingStartTime !== undefined) {
|
|
310
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim();
|
|
311
|
+
}
|
|
312
|
+
if (message.votingEndTime !== undefined) {
|
|
313
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim();
|
|
314
|
+
}
|
|
315
|
+
if (message.metadata !== "") {
|
|
316
|
+
writer.uint32(82).string(message.metadata);
|
|
317
|
+
}
|
|
318
|
+
return writer;
|
|
319
|
+
},
|
|
320
|
+
decode(input, length) {
|
|
321
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
322
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
323
|
+
const message = Object.assign({}, baseProposal);
|
|
324
|
+
message.messages = [];
|
|
325
|
+
message.totalDeposit = [];
|
|
326
|
+
while (reader.pos < end) {
|
|
327
|
+
const tag = reader.uint32();
|
|
328
|
+
switch (tag >>> 3) {
|
|
329
|
+
case 1:
|
|
330
|
+
message.id = reader.uint64();
|
|
331
|
+
break;
|
|
332
|
+
case 2:
|
|
333
|
+
message.messages.push(any_1.Any.decode(reader, reader.uint32()));
|
|
334
|
+
break;
|
|
335
|
+
case 3:
|
|
336
|
+
message.status = reader.int32();
|
|
337
|
+
break;
|
|
338
|
+
case 4:
|
|
339
|
+
message.finalTallyResult = exports.TallyResult.decode(reader, reader.uint32());
|
|
340
|
+
break;
|
|
341
|
+
case 5:
|
|
342
|
+
message.submitTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
343
|
+
break;
|
|
344
|
+
case 6:
|
|
345
|
+
message.depositEndTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
346
|
+
break;
|
|
347
|
+
case 7:
|
|
348
|
+
message.totalDeposit.push(coin_1.Coin.decode(reader, reader.uint32()));
|
|
349
|
+
break;
|
|
350
|
+
case 8:
|
|
351
|
+
message.votingStartTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
352
|
+
break;
|
|
353
|
+
case 9:
|
|
354
|
+
message.votingEndTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
355
|
+
break;
|
|
356
|
+
case 10:
|
|
357
|
+
message.metadata = reader.string();
|
|
358
|
+
break;
|
|
359
|
+
default:
|
|
360
|
+
reader.skipType(tag & 7);
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return message;
|
|
365
|
+
},
|
|
366
|
+
fromJSON(object) {
|
|
367
|
+
var _a, _b;
|
|
368
|
+
const message = Object.assign({}, baseProposal);
|
|
369
|
+
message.id =
|
|
370
|
+
object.id !== undefined && object.id !== null
|
|
371
|
+
? long_1.default.fromString(object.id)
|
|
372
|
+
: long_1.default.UZERO;
|
|
373
|
+
message.messages = ((_a = object.messages) !== null && _a !== void 0 ? _a : []).map((e) => any_1.Any.fromJSON(e));
|
|
374
|
+
message.status =
|
|
375
|
+
object.status !== undefined && object.status !== null
|
|
376
|
+
? proposalStatusFromJSON(object.status)
|
|
377
|
+
: 0;
|
|
378
|
+
message.finalTallyResult =
|
|
379
|
+
object.finalTallyResult !== undefined && object.finalTallyResult !== null
|
|
380
|
+
? exports.TallyResult.fromJSON(object.finalTallyResult)
|
|
381
|
+
: undefined;
|
|
382
|
+
message.submitTime =
|
|
383
|
+
object.submitTime !== undefined && object.submitTime !== null
|
|
384
|
+
? fromJsonTimestamp(object.submitTime)
|
|
385
|
+
: undefined;
|
|
386
|
+
message.depositEndTime =
|
|
387
|
+
object.depositEndTime !== undefined && object.depositEndTime !== null
|
|
388
|
+
? fromJsonTimestamp(object.depositEndTime)
|
|
389
|
+
: undefined;
|
|
390
|
+
message.totalDeposit = ((_b = object.totalDeposit) !== null && _b !== void 0 ? _b : []).map((e) => coin_1.Coin.fromJSON(e));
|
|
391
|
+
message.votingStartTime =
|
|
392
|
+
object.votingStartTime !== undefined && object.votingStartTime !== null
|
|
393
|
+
? fromJsonTimestamp(object.votingStartTime)
|
|
394
|
+
: undefined;
|
|
395
|
+
message.votingEndTime =
|
|
396
|
+
object.votingEndTime !== undefined && object.votingEndTime !== null
|
|
397
|
+
? fromJsonTimestamp(object.votingEndTime)
|
|
398
|
+
: undefined;
|
|
399
|
+
message.metadata =
|
|
400
|
+
object.metadata !== undefined && object.metadata !== null
|
|
401
|
+
? String(object.metadata)
|
|
402
|
+
: "";
|
|
403
|
+
return message;
|
|
404
|
+
},
|
|
405
|
+
toJSON(message) {
|
|
406
|
+
const obj = {};
|
|
407
|
+
message.id !== undefined &&
|
|
408
|
+
(obj.id = (message.id || long_1.default.UZERO).toString());
|
|
409
|
+
if (message.messages) {
|
|
410
|
+
obj.messages = message.messages.map((e) => e ? any_1.Any.toJSON(e) : undefined);
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
obj.messages = [];
|
|
414
|
+
}
|
|
415
|
+
message.status !== undefined &&
|
|
416
|
+
(obj.status = proposalStatusToJSON(message.status));
|
|
417
|
+
message.finalTallyResult !== undefined &&
|
|
418
|
+
(obj.finalTallyResult = message.finalTallyResult
|
|
419
|
+
? exports.TallyResult.toJSON(message.finalTallyResult)
|
|
420
|
+
: undefined);
|
|
421
|
+
message.submitTime !== undefined &&
|
|
422
|
+
(obj.submitTime = message.submitTime.toISOString());
|
|
423
|
+
message.depositEndTime !== undefined &&
|
|
424
|
+
(obj.depositEndTime = message.depositEndTime.toISOString());
|
|
425
|
+
if (message.totalDeposit) {
|
|
426
|
+
obj.totalDeposit = message.totalDeposit.map((e) => e ? coin_1.Coin.toJSON(e) : undefined);
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
obj.totalDeposit = [];
|
|
430
|
+
}
|
|
431
|
+
message.votingStartTime !== undefined &&
|
|
432
|
+
(obj.votingStartTime = message.votingStartTime.toISOString());
|
|
433
|
+
message.votingEndTime !== undefined &&
|
|
434
|
+
(obj.votingEndTime = message.votingEndTime.toISOString());
|
|
435
|
+
message.metadata !== undefined && (obj.metadata = message.metadata);
|
|
436
|
+
return obj;
|
|
437
|
+
},
|
|
438
|
+
fromPartial(object) {
|
|
439
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
440
|
+
const message = Object.assign({}, baseProposal);
|
|
441
|
+
message.id =
|
|
442
|
+
object.id !== undefined && object.id !== null
|
|
443
|
+
? long_1.default.fromValue(object.id)
|
|
444
|
+
: long_1.default.UZERO;
|
|
445
|
+
message.messages = ((_a = object.messages) !== null && _a !== void 0 ? _a : []).map((e) => any_1.Any.fromPartial(e));
|
|
446
|
+
message.status = (_b = object.status) !== null && _b !== void 0 ? _b : 0;
|
|
447
|
+
message.finalTallyResult =
|
|
448
|
+
object.finalTallyResult !== undefined && object.finalTallyResult !== null
|
|
449
|
+
? exports.TallyResult.fromPartial(object.finalTallyResult)
|
|
450
|
+
: undefined;
|
|
451
|
+
message.submitTime = (_c = object.submitTime) !== null && _c !== void 0 ? _c : undefined;
|
|
452
|
+
message.depositEndTime = (_d = object.depositEndTime) !== null && _d !== void 0 ? _d : undefined;
|
|
453
|
+
message.totalDeposit = ((_e = object.totalDeposit) !== null && _e !== void 0 ? _e : []).map((e) => coin_1.Coin.fromPartial(e));
|
|
454
|
+
message.votingStartTime = (_f = object.votingStartTime) !== null && _f !== void 0 ? _f : undefined;
|
|
455
|
+
message.votingEndTime = (_g = object.votingEndTime) !== null && _g !== void 0 ? _g : undefined;
|
|
456
|
+
message.metadata = (_h = object.metadata) !== null && _h !== void 0 ? _h : "";
|
|
457
|
+
return message;
|
|
458
|
+
},
|
|
459
|
+
};
|
|
460
|
+
const baseTallyResult = {
|
|
461
|
+
yesCount: "",
|
|
462
|
+
abstainCount: "",
|
|
463
|
+
noCount: "",
|
|
464
|
+
noWithVetoCount: "",
|
|
465
|
+
};
|
|
466
|
+
exports.TallyResult = {
|
|
467
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
468
|
+
if (message.yesCount !== "") {
|
|
469
|
+
writer.uint32(10).string(message.yesCount);
|
|
470
|
+
}
|
|
471
|
+
if (message.abstainCount !== "") {
|
|
472
|
+
writer.uint32(18).string(message.abstainCount);
|
|
473
|
+
}
|
|
474
|
+
if (message.noCount !== "") {
|
|
475
|
+
writer.uint32(26).string(message.noCount);
|
|
476
|
+
}
|
|
477
|
+
if (message.noWithVetoCount !== "") {
|
|
478
|
+
writer.uint32(34).string(message.noWithVetoCount);
|
|
479
|
+
}
|
|
480
|
+
return writer;
|
|
481
|
+
},
|
|
482
|
+
decode(input, length) {
|
|
483
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
484
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
485
|
+
const message = Object.assign({}, baseTallyResult);
|
|
486
|
+
while (reader.pos < end) {
|
|
487
|
+
const tag = reader.uint32();
|
|
488
|
+
switch (tag >>> 3) {
|
|
489
|
+
case 1:
|
|
490
|
+
message.yesCount = reader.string();
|
|
491
|
+
break;
|
|
492
|
+
case 2:
|
|
493
|
+
message.abstainCount = reader.string();
|
|
494
|
+
break;
|
|
495
|
+
case 3:
|
|
496
|
+
message.noCount = reader.string();
|
|
497
|
+
break;
|
|
498
|
+
case 4:
|
|
499
|
+
message.noWithVetoCount = reader.string();
|
|
500
|
+
break;
|
|
501
|
+
default:
|
|
502
|
+
reader.skipType(tag & 7);
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return message;
|
|
507
|
+
},
|
|
508
|
+
fromJSON(object) {
|
|
509
|
+
const message = Object.assign({}, baseTallyResult);
|
|
510
|
+
message.yesCount =
|
|
511
|
+
object.yesCount !== undefined && object.yesCount !== null
|
|
512
|
+
? String(object.yesCount)
|
|
513
|
+
: "";
|
|
514
|
+
message.abstainCount =
|
|
515
|
+
object.abstainCount !== undefined && object.abstainCount !== null
|
|
516
|
+
? String(object.abstainCount)
|
|
517
|
+
: "";
|
|
518
|
+
message.noCount =
|
|
519
|
+
object.noCount !== undefined && object.noCount !== null
|
|
520
|
+
? String(object.noCount)
|
|
521
|
+
: "";
|
|
522
|
+
message.noWithVetoCount =
|
|
523
|
+
object.noWithVetoCount !== undefined && object.noWithVetoCount !== null
|
|
524
|
+
? String(object.noWithVetoCount)
|
|
525
|
+
: "";
|
|
526
|
+
return message;
|
|
527
|
+
},
|
|
528
|
+
toJSON(message) {
|
|
529
|
+
const obj = {};
|
|
530
|
+
message.yesCount !== undefined && (obj.yesCount = message.yesCount);
|
|
531
|
+
message.abstainCount !== undefined &&
|
|
532
|
+
(obj.abstainCount = message.abstainCount);
|
|
533
|
+
message.noCount !== undefined && (obj.noCount = message.noCount);
|
|
534
|
+
message.noWithVetoCount !== undefined &&
|
|
535
|
+
(obj.noWithVetoCount = message.noWithVetoCount);
|
|
536
|
+
return obj;
|
|
537
|
+
},
|
|
538
|
+
fromPartial(object) {
|
|
539
|
+
var _a, _b, _c, _d;
|
|
540
|
+
const message = Object.assign({}, baseTallyResult);
|
|
541
|
+
message.yesCount = (_a = object.yesCount) !== null && _a !== void 0 ? _a : "";
|
|
542
|
+
message.abstainCount = (_b = object.abstainCount) !== null && _b !== void 0 ? _b : "";
|
|
543
|
+
message.noCount = (_c = object.noCount) !== null && _c !== void 0 ? _c : "";
|
|
544
|
+
message.noWithVetoCount = (_d = object.noWithVetoCount) !== null && _d !== void 0 ? _d : "";
|
|
545
|
+
return message;
|
|
546
|
+
},
|
|
547
|
+
};
|
|
548
|
+
const baseVote = { proposalId: long_1.default.UZERO, voter: "", metadata: "" };
|
|
549
|
+
exports.Vote = {
|
|
550
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
551
|
+
if (!message.proposalId.isZero()) {
|
|
552
|
+
writer.uint32(8).uint64(message.proposalId);
|
|
553
|
+
}
|
|
554
|
+
if (message.voter !== "") {
|
|
555
|
+
writer.uint32(18).string(message.voter);
|
|
556
|
+
}
|
|
557
|
+
for (const v of message.options) {
|
|
558
|
+
exports.WeightedVoteOption.encode(v, writer.uint32(34).fork()).ldelim();
|
|
559
|
+
}
|
|
560
|
+
if (message.metadata !== "") {
|
|
561
|
+
writer.uint32(42).string(message.metadata);
|
|
562
|
+
}
|
|
563
|
+
return writer;
|
|
564
|
+
},
|
|
565
|
+
decode(input, length) {
|
|
566
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
567
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
568
|
+
const message = Object.assign({}, baseVote);
|
|
569
|
+
message.options = [];
|
|
570
|
+
while (reader.pos < end) {
|
|
571
|
+
const tag = reader.uint32();
|
|
572
|
+
switch (tag >>> 3) {
|
|
573
|
+
case 1:
|
|
574
|
+
message.proposalId = reader.uint64();
|
|
575
|
+
break;
|
|
576
|
+
case 2:
|
|
577
|
+
message.voter = reader.string();
|
|
578
|
+
break;
|
|
579
|
+
case 4:
|
|
580
|
+
message.options.push(exports.WeightedVoteOption.decode(reader, reader.uint32()));
|
|
581
|
+
break;
|
|
582
|
+
case 5:
|
|
583
|
+
message.metadata = reader.string();
|
|
584
|
+
break;
|
|
585
|
+
default:
|
|
586
|
+
reader.skipType(tag & 7);
|
|
587
|
+
break;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return message;
|
|
591
|
+
},
|
|
592
|
+
fromJSON(object) {
|
|
593
|
+
var _a;
|
|
594
|
+
const message = Object.assign({}, baseVote);
|
|
595
|
+
message.proposalId =
|
|
596
|
+
object.proposalId !== undefined && object.proposalId !== null
|
|
597
|
+
? long_1.default.fromString(object.proposalId)
|
|
598
|
+
: long_1.default.UZERO;
|
|
599
|
+
message.voter =
|
|
600
|
+
object.voter !== undefined && object.voter !== null
|
|
601
|
+
? String(object.voter)
|
|
602
|
+
: "";
|
|
603
|
+
message.options = ((_a = object.options) !== null && _a !== void 0 ? _a : []).map((e) => exports.WeightedVoteOption.fromJSON(e));
|
|
604
|
+
message.metadata =
|
|
605
|
+
object.metadata !== undefined && object.metadata !== null
|
|
606
|
+
? String(object.metadata)
|
|
607
|
+
: "";
|
|
608
|
+
return message;
|
|
609
|
+
},
|
|
610
|
+
toJSON(message) {
|
|
611
|
+
const obj = {};
|
|
612
|
+
message.proposalId !== undefined &&
|
|
613
|
+
(obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());
|
|
614
|
+
message.voter !== undefined && (obj.voter = message.voter);
|
|
615
|
+
if (message.options) {
|
|
616
|
+
obj.options = message.options.map((e) => e ? exports.WeightedVoteOption.toJSON(e) : undefined);
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
obj.options = [];
|
|
620
|
+
}
|
|
621
|
+
message.metadata !== undefined && (obj.metadata = message.metadata);
|
|
622
|
+
return obj;
|
|
623
|
+
},
|
|
624
|
+
fromPartial(object) {
|
|
625
|
+
var _a, _b, _c;
|
|
626
|
+
const message = Object.assign({}, baseVote);
|
|
627
|
+
message.proposalId =
|
|
628
|
+
object.proposalId !== undefined && object.proposalId !== null
|
|
629
|
+
? long_1.default.fromValue(object.proposalId)
|
|
630
|
+
: long_1.default.UZERO;
|
|
631
|
+
message.voter = (_a = object.voter) !== null && _a !== void 0 ? _a : "";
|
|
632
|
+
message.options = ((_b = object.options) !== null && _b !== void 0 ? _b : []).map((e) => exports.WeightedVoteOption.fromPartial(e));
|
|
633
|
+
message.metadata = (_c = object.metadata) !== null && _c !== void 0 ? _c : "";
|
|
634
|
+
return message;
|
|
635
|
+
},
|
|
636
|
+
};
|
|
637
|
+
const baseDepositParams = {};
|
|
638
|
+
exports.DepositParams = {
|
|
639
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
640
|
+
for (const v of message.minDeposit) {
|
|
641
|
+
coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();
|
|
642
|
+
}
|
|
643
|
+
if (message.maxDepositPeriod !== undefined) {
|
|
644
|
+
duration_1.Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim();
|
|
645
|
+
}
|
|
646
|
+
return writer;
|
|
647
|
+
},
|
|
648
|
+
decode(input, length) {
|
|
649
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
650
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
651
|
+
const message = Object.assign({}, baseDepositParams);
|
|
652
|
+
message.minDeposit = [];
|
|
653
|
+
while (reader.pos < end) {
|
|
654
|
+
const tag = reader.uint32();
|
|
655
|
+
switch (tag >>> 3) {
|
|
656
|
+
case 1:
|
|
657
|
+
message.minDeposit.push(coin_1.Coin.decode(reader, reader.uint32()));
|
|
658
|
+
break;
|
|
659
|
+
case 2:
|
|
660
|
+
message.maxDepositPeriod = duration_1.Duration.decode(reader, reader.uint32());
|
|
661
|
+
break;
|
|
662
|
+
default:
|
|
663
|
+
reader.skipType(tag & 7);
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
return message;
|
|
668
|
+
},
|
|
669
|
+
fromJSON(object) {
|
|
670
|
+
var _a;
|
|
671
|
+
const message = Object.assign({}, baseDepositParams);
|
|
672
|
+
message.minDeposit = ((_a = object.minDeposit) !== null && _a !== void 0 ? _a : []).map((e) => coin_1.Coin.fromJSON(e));
|
|
673
|
+
message.maxDepositPeriod =
|
|
674
|
+
object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null
|
|
675
|
+
? duration_1.Duration.fromJSON(object.maxDepositPeriod)
|
|
676
|
+
: undefined;
|
|
677
|
+
return message;
|
|
678
|
+
},
|
|
679
|
+
toJSON(message) {
|
|
680
|
+
const obj = {};
|
|
681
|
+
if (message.minDeposit) {
|
|
682
|
+
obj.minDeposit = message.minDeposit.map((e) => e ? coin_1.Coin.toJSON(e) : undefined);
|
|
683
|
+
}
|
|
684
|
+
else {
|
|
685
|
+
obj.minDeposit = [];
|
|
686
|
+
}
|
|
687
|
+
message.maxDepositPeriod !== undefined &&
|
|
688
|
+
(obj.maxDepositPeriod = message.maxDepositPeriod
|
|
689
|
+
? duration_1.Duration.toJSON(message.maxDepositPeriod)
|
|
690
|
+
: undefined);
|
|
691
|
+
return obj;
|
|
692
|
+
},
|
|
693
|
+
fromPartial(object) {
|
|
694
|
+
var _a;
|
|
695
|
+
const message = Object.assign({}, baseDepositParams);
|
|
696
|
+
message.minDeposit = ((_a = object.minDeposit) !== null && _a !== void 0 ? _a : []).map((e) => coin_1.Coin.fromPartial(e));
|
|
697
|
+
message.maxDepositPeriod =
|
|
698
|
+
object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null
|
|
699
|
+
? duration_1.Duration.fromPartial(object.maxDepositPeriod)
|
|
700
|
+
: undefined;
|
|
701
|
+
return message;
|
|
702
|
+
},
|
|
703
|
+
};
|
|
704
|
+
const baseVotingParams = {};
|
|
705
|
+
exports.VotingParams = {
|
|
706
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
707
|
+
if (message.votingPeriod !== undefined) {
|
|
708
|
+
duration_1.Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim();
|
|
709
|
+
}
|
|
710
|
+
return writer;
|
|
711
|
+
},
|
|
712
|
+
decode(input, length) {
|
|
713
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
714
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
715
|
+
const message = Object.assign({}, baseVotingParams);
|
|
716
|
+
while (reader.pos < end) {
|
|
717
|
+
const tag = reader.uint32();
|
|
718
|
+
switch (tag >>> 3) {
|
|
719
|
+
case 1:
|
|
720
|
+
message.votingPeriod = duration_1.Duration.decode(reader, reader.uint32());
|
|
721
|
+
break;
|
|
722
|
+
default:
|
|
723
|
+
reader.skipType(tag & 7);
|
|
724
|
+
break;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return message;
|
|
728
|
+
},
|
|
729
|
+
fromJSON(object) {
|
|
730
|
+
const message = Object.assign({}, baseVotingParams);
|
|
731
|
+
message.votingPeriod =
|
|
732
|
+
object.votingPeriod !== undefined && object.votingPeriod !== null
|
|
733
|
+
? duration_1.Duration.fromJSON(object.votingPeriod)
|
|
734
|
+
: undefined;
|
|
735
|
+
return message;
|
|
736
|
+
},
|
|
737
|
+
toJSON(message) {
|
|
738
|
+
const obj = {};
|
|
739
|
+
message.votingPeriod !== undefined &&
|
|
740
|
+
(obj.votingPeriod = message.votingPeriod
|
|
741
|
+
? duration_1.Duration.toJSON(message.votingPeriod)
|
|
742
|
+
: undefined);
|
|
743
|
+
return obj;
|
|
744
|
+
},
|
|
745
|
+
fromPartial(object) {
|
|
746
|
+
const message = Object.assign({}, baseVotingParams);
|
|
747
|
+
message.votingPeriod =
|
|
748
|
+
object.votingPeriod !== undefined && object.votingPeriod !== null
|
|
749
|
+
? duration_1.Duration.fromPartial(object.votingPeriod)
|
|
750
|
+
: undefined;
|
|
751
|
+
return message;
|
|
752
|
+
},
|
|
753
|
+
};
|
|
754
|
+
const baseTallyParams = {
|
|
755
|
+
quorum: "",
|
|
756
|
+
threshold: "",
|
|
757
|
+
vetoThreshold: "",
|
|
758
|
+
};
|
|
759
|
+
exports.TallyParams = {
|
|
760
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
761
|
+
if (message.quorum !== "") {
|
|
762
|
+
writer.uint32(10).string(message.quorum);
|
|
763
|
+
}
|
|
764
|
+
if (message.threshold !== "") {
|
|
765
|
+
writer.uint32(18).string(message.threshold);
|
|
766
|
+
}
|
|
767
|
+
if (message.vetoThreshold !== "") {
|
|
768
|
+
writer.uint32(26).string(message.vetoThreshold);
|
|
769
|
+
}
|
|
770
|
+
return writer;
|
|
771
|
+
},
|
|
772
|
+
decode(input, length) {
|
|
773
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
774
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
775
|
+
const message = Object.assign({}, baseTallyParams);
|
|
776
|
+
while (reader.pos < end) {
|
|
777
|
+
const tag = reader.uint32();
|
|
778
|
+
switch (tag >>> 3) {
|
|
779
|
+
case 1:
|
|
780
|
+
message.quorum = reader.string();
|
|
781
|
+
break;
|
|
782
|
+
case 2:
|
|
783
|
+
message.threshold = reader.string();
|
|
784
|
+
break;
|
|
785
|
+
case 3:
|
|
786
|
+
message.vetoThreshold = reader.string();
|
|
787
|
+
break;
|
|
788
|
+
default:
|
|
789
|
+
reader.skipType(tag & 7);
|
|
790
|
+
break;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
return message;
|
|
794
|
+
},
|
|
795
|
+
fromJSON(object) {
|
|
796
|
+
const message = Object.assign({}, baseTallyParams);
|
|
797
|
+
message.quorum =
|
|
798
|
+
object.quorum !== undefined && object.quorum !== null
|
|
799
|
+
? String(object.quorum)
|
|
800
|
+
: "";
|
|
801
|
+
message.threshold =
|
|
802
|
+
object.threshold !== undefined && object.threshold !== null
|
|
803
|
+
? String(object.threshold)
|
|
804
|
+
: "";
|
|
805
|
+
message.vetoThreshold =
|
|
806
|
+
object.vetoThreshold !== undefined && object.vetoThreshold !== null
|
|
807
|
+
? String(object.vetoThreshold)
|
|
808
|
+
: "";
|
|
809
|
+
return message;
|
|
810
|
+
},
|
|
811
|
+
toJSON(message) {
|
|
812
|
+
const obj = {};
|
|
813
|
+
message.quorum !== undefined && (obj.quorum = message.quorum);
|
|
814
|
+
message.threshold !== undefined && (obj.threshold = message.threshold);
|
|
815
|
+
message.vetoThreshold !== undefined &&
|
|
816
|
+
(obj.vetoThreshold = message.vetoThreshold);
|
|
817
|
+
return obj;
|
|
818
|
+
},
|
|
819
|
+
fromPartial(object) {
|
|
820
|
+
var _a, _b, _c;
|
|
821
|
+
const message = Object.assign({}, baseTallyParams);
|
|
822
|
+
message.quorum = (_a = object.quorum) !== null && _a !== void 0 ? _a : "";
|
|
823
|
+
message.threshold = (_b = object.threshold) !== null && _b !== void 0 ? _b : "";
|
|
824
|
+
message.vetoThreshold = (_c = object.vetoThreshold) !== null && _c !== void 0 ? _c : "";
|
|
825
|
+
return message;
|
|
826
|
+
},
|
|
827
|
+
};
|
|
828
|
+
function toTimestamp(date) {
|
|
829
|
+
const seconds = numberToLong(date.getTime() / 1000);
|
|
830
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
831
|
+
return { seconds, nanos };
|
|
832
|
+
}
|
|
833
|
+
function fromTimestamp(t) {
|
|
834
|
+
let millis = t.seconds.toNumber() * 1000;
|
|
835
|
+
millis += t.nanos / 1000000;
|
|
836
|
+
return new Date(millis);
|
|
837
|
+
}
|
|
838
|
+
function fromJsonTimestamp(o) {
|
|
839
|
+
if (o instanceof Date) {
|
|
840
|
+
return o;
|
|
841
|
+
}
|
|
842
|
+
else if (typeof o === "string") {
|
|
843
|
+
return new Date(o);
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
function numberToLong(number) {
|
|
850
|
+
return long_1.default.fromNumber(number);
|
|
851
|
+
}
|
|
852
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
853
|
+
minimal_1.default.util.Long = long_1.default;
|
|
854
|
+
minimal_1.default.configure();
|
|
855
|
+
}
|