Gov

API

class terra_sdk.client.lcd.api.gov.GovAPI(c)[source]
deposits(proposal_id)[source]

Fetches the Gov module’s deposit parameters.

Returns

deposit parameters

Return type

dict

parameters()[source]

Fetches the Gov module’s parameters.

Returns

Gov module parameters

Return type

dict

proposal(proposal_id)[source]

Fetches a single proposal by id.

Parameters

proposal_id (int) – proposal ID

Returns

proposal

Return type

Proposal

proposals()[source]

Fetches all proposals.

Returns

proposals

Return type

List[Proposal]

proposer(proposal_id)[source]

Fetches the proposer of a proposal.

Parameters

proposal_id (int) – proposal ID

Returns

proposal’s proposer

Return type

str

tally(proposal_id)[source]

Fetches the tally for a proposal.

Parameters

proposal_id (int) – proposal ID

tally_parameters()[source]

Fetches the Gov module’s tally parameters.

Returns

tally parameters

Return type

dict

votes(proposal_id)[source]

Fetches the votes for a proposal.

Parameters

proposal_id (int) – proposal ID

voting_parameters()[source]

Fetches the Gov module’s voting parameters.

Returns

voting parameters

Return type

dict

Data

Gov module data types.

class terra_sdk.core.gov.data.Content(title, description)[source]

Abstract proposal content type.

Note

This object is abstract, and not meant to be instantiated directly.

description: str
title: str
class terra_sdk.core.gov.data.Proposal(id, content, proposal_status, final_tally_result, submit_time, deposit_end_time, total_deposit, voting_start_time, voting_end_time)[source]

Contains information about a submitted proposal on the blockchain.

content: terra_sdk.core.gov.data.Content

Proposal contents.

deposit_end_time: str

Time at which the deposit period ended, or will end.

final_tally_result: dict

Final tallied result of the proposal (after vote).

id: int

Proposal’s ID.

proposal_status: str

Status of proposal.

submit_time: str

Timestamp at which proposal was submitted.

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

total_deposit: terra_sdk.core.coins.Coins

Total amount deposited for proposal

voting_end_time: str

Time at which voting period ended, or will end.

voting_start_time: str

Time at which voting period started, or will start.

Messages

Gov module message types.

class terra_sdk.core.gov.msgs.MsgDeposit(proposal_id, depositor, amount)[source]

Deposit funds for an active deposit-stage proposal.

Parameters
  • proposal_id – proposal number to deposit for

  • depositor (AccAddress) – account making deposit

  • amount (Coins) – amount to deposit

action = 'deposit'
to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type: str = 'gov/MsgDeposit'
class terra_sdk.core.gov.msgs.MsgSubmitProposal(content, initial_deposit, proposer)[source]

Submit the attached proposal with an initial deposit.

Parameters
  • content (Content) – type of proposal

  • initial_deposit (Coins) – initial deposit for proposal made by proposer

  • proposer (AccAddress) – proposal submitter

action = 'submit_proposal'
type: str = 'gov/MsgSubmitProposal'
class terra_sdk.core.gov.msgs.MsgVote(proposal_id, voter, option)[source]

Vote for an active voting-stage proposal.

Parameters
ABSTAIN = 'Abstain'
EMPTY = 'Empty'

Encodes an empty vote option.

NO = 'No'
NO_WITH_VETO = 'NoWithVeto'
YES = 'Yes'
action = 'vote'
to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type: str = 'gov/MsgVote'

Proposals

Gov module governance proposal types.

class terra_sdk.core.gov.proposals.TextProposal(title, description)[source]

Generic proposal type with only title and description that does nothing if passed. Primarily used for assessing the community sentiment around the proposal.

Parameters
  • title (str) – proposal title

  • description (str) – proposal description

type: str = 'gov/TextProposal'