cosmos/gov

Table of Contents

cosmos/gov/v1beta1/query.proto

Top

QueryDepositRequest

QueryDepositRequest is the request type for the Query/Deposit RPC method.

FieldTypeLabelDescription
proposal_id uint64

proposal_id defines the unique id of the proposal.

depositor string

depositor defines the deposit addresses from the proposals.

QueryDepositResponse

QueryDepositResponse is the response type for the Query/Deposit RPC method.

FieldTypeLabelDescription
deposit Deposit

deposit defines the requested deposit.

QueryDepositsRequest

QueryDepositsRequest is the request type for the Query/Deposits RPC method.

FieldTypeLabelDescription
proposal_id uint64

proposal_id defines the unique id of the proposal.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryDepositsResponse

QueryDepositsResponse is the response type for the Query/Deposits RPC method.

FieldTypeLabelDescription
deposits Deposit repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryParamsRequest

QueryParamsRequest is the request type for the Query/Params RPC method.

FieldTypeLabelDescription
params_type string

params_type defines which parameters to query for, can be one of "voting", "tallying" or "deposit".

QueryParamsResponse

QueryParamsResponse is the response type for the Query/Params RPC method.

FieldTypeLabelDescription
voting_params VotingParams

voting_params defines the parameters related to voting.

deposit_params DepositParams

deposit_params defines the parameters related to deposit.

tally_params TallyParams

tally_params defines the parameters related to tally.

QueryProposalRequest

QueryProposalRequest is the request type for the Query/Proposal RPC method.

FieldTypeLabelDescription
proposal_id uint64

proposal_id defines the unique id of the proposal.

QueryProposalResponse

QueryProposalResponse is the response type for the Query/Proposal RPC method.

FieldTypeLabelDescription
proposal Proposal

QueryProposalsRequest

QueryProposalsRequest is the request type for the Query/Proposals RPC method.

FieldTypeLabelDescription
proposal_status ProposalStatus

proposal_status defines the status of the proposals.

voter string

voter defines the voter address for the proposals.

depositor string

depositor defines the deposit addresses from the proposals.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryProposalsResponse

QueryProposalsResponse is the response type for the Query/Proposals RPC

method.

FieldTypeLabelDescription
proposals Proposal repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryTallyResultRequest

QueryTallyResultRequest is the request type for the Query/Tally RPC method.

FieldTypeLabelDescription
proposal_id uint64

proposal_id defines the unique id of the proposal.

QueryTallyResultResponse

QueryTallyResultResponse is the response type for the Query/Tally RPC method.

FieldTypeLabelDescription
tally TallyResult

tally defines the requested tally.

QueryVoteRequest

QueryVoteRequest is the request type for the Query/Vote RPC method.

FieldTypeLabelDescription
proposal_id uint64

proposal_id defines the unique id of the proposal.

voter string

voter defines the oter address for the proposals.

QueryVoteResponse

QueryVoteResponse is the response type for the Query/Vote RPC method.

FieldTypeLabelDescription
vote Vote

vote defined the queried vote.

QueryVotesRequest

QueryVotesRequest is the request type for the Query/Votes RPC method.

FieldTypeLabelDescription
proposal_id uint64

proposal_id defines the unique id of the proposal.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryVotesResponse

QueryVotesResponse is the response type for the Query/Votes RPC method.

FieldTypeLabelDescription
votes Vote repeated

votes defined the queried votes.

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

Query

Query defines the gRPC querier service for gov module

Method NameRequest TypeResponse TypeDescription
Proposal QueryProposalRequest QueryProposalResponse

Proposal queries proposal details based on ProposalID.

Proposals QueryProposalsRequest QueryProposalsResponse

Proposals queries all proposals based on given status.

Vote QueryVoteRequest QueryVoteResponse

Vote queries voted information based on proposalID, voterAddr.

Votes QueryVotesRequest QueryVotesResponse

Votes queries votes of a given proposal.

Params QueryParamsRequest QueryParamsResponse

Params queries all parameters of the gov module.

Deposit QueryDepositRequest QueryDepositResponse

Deposit queries single deposit information based proposalID, depositAddr.

Deposits QueryDepositsRequest QueryDepositsResponse

Deposits queries all deposits of a single proposal.

TallyResult QueryTallyResultRequest QueryTallyResultResponse

TallyResult queries the tally of a proposal vote.

Methods with HTTP bindings

Method Name Method Pattern Body
Proposal GET /cosmos/gov/v1beta1/proposals/{proposal_id}
Proposals GET /cosmos/gov/v1beta1/proposals
Vote GET /cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}
Votes GET /cosmos/gov/v1beta1/proposals/{proposal_id}/votes
Params GET /cosmos/gov/v1beta1/params/{params_type}
Deposit GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}
Deposits GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits
TallyResult GET /cosmos/gov/v1beta1/proposals/{proposal_id}/tally

cosmos/gov/v1beta1/gov.proto

Top

Deposit

Deposit defines an amount deposited by an account address to an active

proposal.

FieldTypeLabelDescription
proposal_id uint64

depositor string

amount cosmos.base.v1beta1.Coin repeated

DepositParams

DepositParams defines the params for deposits on governance proposals.

FieldTypeLabelDescription
min_deposit cosmos.base.v1beta1.Coin repeated

Minimum deposit for a proposal to enter voting period.

max_deposit_period google.protobuf.Duration

Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months.

Proposal

Proposal defines the core field members of a governance proposal.

FieldTypeLabelDescription
proposal_id uint64

content google.protobuf.Any

status ProposalStatus

final_tally_result TallyResult

submit_time google.protobuf.Timestamp

deposit_end_time google.protobuf.Timestamp

total_deposit cosmos.base.v1beta1.Coin repeated

voting_start_time google.protobuf.Timestamp

voting_end_time google.protobuf.Timestamp

TallyParams

TallyParams defines the params for tallying votes on governance proposals.

FieldTypeLabelDescription
quorum bytes

Minimum percentage of total stake needed to vote for a result to be considered valid.

threshold bytes

Minimum proportion of Yes votes for proposal to pass. Default value: 0.5.

veto_threshold bytes

Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3.

TallyResult

TallyResult defines a standard tally for a governance proposal.

FieldTypeLabelDescription
yes string

abstain string

no string

no_with_veto string

TextProposal

TextProposal defines a standard text proposal whose changes need to be

manually updated in case of approval.

FieldTypeLabelDescription
title string

description string

Vote

Vote defines a vote on a governance proposal.

A Vote consists of a proposal ID, the voter, and the vote option.

FieldTypeLabelDescription
proposal_id uint64

voter string

option VoteOption

Deprecated. Deprecated: Prefer to use `options` instead. This field is set in queries if and only if `len(options) == 1` and that option has weight 1. In all other cases, this field will default to VOTE_OPTION_UNSPECIFIED.

options WeightedVoteOption repeated

Since: cosmos-sdk 0.43

Fields with deprecated option

Name Option
option

true

VotingParams

VotingParams defines the params for voting on governance proposals.

FieldTypeLabelDescription
voting_period google.protobuf.Duration

Length of the voting period.

WeightedVoteOption

WeightedVoteOption defines a unit of vote for vote split.

Since: cosmos-sdk 0.43

FieldTypeLabelDescription
option VoteOption

weight string

ProposalStatus

ProposalStatus enumerates the valid statuses of a proposal.

NameNumberDescription
PROPOSAL_STATUS_UNSPECIFIED 0

PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status.

PROPOSAL_STATUS_DEPOSIT_PERIOD 1

PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period.

PROPOSAL_STATUS_VOTING_PERIOD 2

PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period.

PROPOSAL_STATUS_PASSED 3

PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed.

PROPOSAL_STATUS_REJECTED 4

PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected.

PROPOSAL_STATUS_FAILED 5

PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed.

VoteOption

VoteOption enumerates the valid vote options for a given governance proposal.

NameNumberDescription
VOTE_OPTION_UNSPECIFIED 0

VOTE_OPTION_UNSPECIFIED defines a no-op vote option.

VOTE_OPTION_YES 1

VOTE_OPTION_YES defines a yes vote option.

VOTE_OPTION_ABSTAIN 2

VOTE_OPTION_ABSTAIN defines an abstain vote option.

VOTE_OPTION_NO 3

VOTE_OPTION_NO defines a no vote option.

VOTE_OPTION_NO_WITH_VETO 4

VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.

cosmos/gov/v1beta1/genesis.proto

Top

GenesisState

GenesisState defines the gov module's genesis state.

FieldTypeLabelDescription
starting_proposal_id uint64

starting_proposal_id is the ID of the starting proposal.

deposits Deposit repeated

deposits defines all the deposits present at genesis.

votes Vote repeated

votes defines all the votes present at genesis.

proposals Proposal repeated

proposals defines all the proposals present at genesis.

deposit_params DepositParams

params defines all the paramaters of related to deposit.

voting_params VotingParams

params defines all the paramaters of related to voting.

tally_params TallyParams

params defines all the paramaters of related to tally.

cosmos/gov/v1beta1/tx.proto

Top

MsgDeposit

MsgDeposit defines a message to submit a deposit to an existing proposal.

FieldTypeLabelDescription
proposal_id uint64

depositor string

amount cosmos.base.v1beta1.Coin repeated

MsgDepositResponse

MsgDepositResponse defines the Msg/Deposit response type.

MsgSubmitProposal

MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary

proposal Content.

FieldTypeLabelDescription
content google.protobuf.Any

initial_deposit cosmos.base.v1beta1.Coin repeated

proposer string

MsgSubmitProposalResponse

MsgSubmitProposalResponse defines the Msg/SubmitProposal response type.

FieldTypeLabelDescription
proposal_id uint64

MsgVote

MsgVote defines a message to cast a vote.

FieldTypeLabelDescription
proposal_id uint64

voter string

option VoteOption

MsgVoteResponse

MsgVoteResponse defines the Msg/Vote response type.

MsgVoteWeighted

MsgVoteWeighted defines a message to cast a vote.

Since: cosmos-sdk 0.43

FieldTypeLabelDescription
proposal_id uint64

voter string

options WeightedVoteOption repeated

MsgVoteWeightedResponse

MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.

Since: cosmos-sdk 0.43

Msg

Msg defines the bank Msg service.

Method NameRequest TypeResponse TypeDescription
SubmitProposal MsgSubmitProposal MsgSubmitProposalResponse

SubmitProposal defines a method to create new proposal given a content.

Vote MsgVote MsgVoteResponse

Vote defines a method to add a vote on a specific proposal.

VoteWeighted MsgVoteWeighted MsgVoteWeightedResponse

VoteWeighted defines a method to add a weighted vote on a specific proposal. Since: cosmos-sdk 0.43

Deposit MsgDeposit MsgDepositResponse

Deposit defines a method to add deposit on a specific proposal.

Scalar Value Types

.proto Type Notes Python Type
double float
float float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int/long
uint32 Uses variable-length encoding. int/long
uint64 Uses variable-length encoding. int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. int/long
sfixed32 Always four bytes. int
sfixed64 Always eight bytes. int/long
bool boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. str/unicode
bytes May contain any arbitrary sequence of bytes. str