Skip to main content
Version: 0.9.1

Elections

GET /explorer/election/{head,hash,number}

On-chain elections can be queried by proposal hash or sequence number. An election contains a complete set of data on a past or the currently ongoing (head) on-chain voting process, including up to four voting periods. Voting periods may be empty when no proposal has been published. Only the last voting period of the last election can be in state open. Ballots represent the individual ballot operations sent by bakers during votes or the up-votes to a proposal during the first voting period.

FieldDescription
election_id int64Sequence number of the election.
num_periods int64Number of voting periods activated during this election (min 1, max 4)
num_proposals int64Total number of submitted proposals.
start_time int64Time of the first block in the election.
end_time int64Time of the last block in the election (when open this is an approximation of the latest possible end assuming all voting periods are used and all remaining blocks are produced at priority zero).
start_height int64First block of the election period.
end_height boolLast block of the election (when open this is an approximation of the full duration assuming all voting periods are used).
is_empty boolFlag indicating the election has not seen and proposal being submitted.
is_open boolFlag indicating the election is ongoing.
is_failed boolFlag indicating the election has failed to select or activate a new protocol.
no_quorum boolFlag indicating the election has failed because no quorum could be reached.
no_majority boolFlag indicating the election has failed because no majority could be reached.
no_proposal boolFlag indicating the election has failed because no proposal has been submitted.
voting_period enumPeriod kind proposal, exploration, cooldown, promotion, adoption.
proposal objectVote object for the proposal period 1 (see below).
exploration objectVote object for the exploration period 2 (see below).
cooldown objectVote object for the cooldown period 3 (see below).
promotion objectVote object for the promotion vote period 4 (see below).
adoption objectVote object for the adoption vote period 5 (see below).

List Voters​

GET /explorer/election/{hash,number,head}/{stage}/voters

Lists all eligible voters for the current voting period where stage is the sequence number of the voting period [1..4]. The voter list supports pagination with limit, offset and cursor. To change the order of returned calls use the optional order (asc|desc) parameter.

Voter Schema​

FieldDescription
row_id int64Internal account id for use with cursor.
address hashVoter address.
stake moneyStaking balance the voter had at the beginning of this voting period.
has_voted boolFlag indicating if the account has already voted.
ballot enumBallot cast by the voter, either yay, nay or pass.
proposals arrayList of proposals (as hashes) the voter voted for.

List Ballots​

GET /explorer/election/{hash,number,head}/{stage}/ballots

Lists all ballots cast during the current voting period where stage is the sequence number of the voting period [1..4]. The voter list supports pagination with limit, offset and cursor. To change the order of returned calls use the optional order (asc|desc) parameter.

Ballot Schema​

FieldDescription
row_id int64Internal account id for use with cursor.
sender hashVoter address.
height int64Operation submission height.
time datetimeOperation submission time.
election_id int64Sequence number of the election.
voting_period int64Protocol-level voting period counter.
voting_period_kind enumPeriod kind proposal, exploration, cooldown, promotion, adoption.
proposal hashHash of the proposal the voter voted for. If the vote happened during the proposal period and the voter used to vote for multiple proposals either in a single proposals operation or with multiple proposals operations, multiple ballots exist.
op hashOperation hash.
ballot enumBallot cast by the voter, either yay, nay or pass. During proposal period the ballot is always yay to describe the only choice.
stake moneyAmount of stake the voter had during this voting period.