package
0.1.3
Repository: https://github.com/xpladev/xpla.go.git
Documentation: pkg.go.dev

# README

Gov module

Usage

(Tx) Submit proposal

submitProposalMsg := types.SubmitProposalMsg{
    Title: "Test proposal",
    Description: "Proposal description",
    Type: "text",
    Deposit: "1000",
}
txbytes, err := xplac.SubmitProposal(submitProposalMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)

(Tx) Deposit

govDepositMsg := types.GovDepositMsg {
    ProposalID: "1",
    Deposit: "1000axpla",
}

txbytes, err := xplac.GovDeposit(govDepositMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)

(Tx) Vote

voteMsg := types.VoteMsg{
    ProposalID: "1",
    Option: "yes",
}

txbytes, err := xplac.Vote(voteMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)

(Tx) Weighted vote

weightedVoteMsg := types.WeightedVoteMsg{
    ProposalID: "1",
    Yes: "0.6",
    No: "0.3",
    Abstain: "0.05",
    NoWithVeto: "0.05",
}

txbytes, err := xplac.WeightedVote(weightedVoteMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)

(Query) proposal

queryProposalMsg := types.QueryProposalMsg{
    ProposalID: "1",
}

res, err := xplac.QueryProposal(queryProposalMsg).Query()

(Query) proposals

// Query all proposals
queryProposalsMsg := types.QueryProposalsMsg{}

// Set options
queryProposalsMsg := types.QueryProposalsMsg{
    Status: "DepositPeriod",
    Voter: "xpla1e4f6k98es55vxxv2pcfzpsjrf3mvazeyqpw8g9",
    Depositor: "xpla19yq7kjcgse7x672faptju0lxmy4cvdlcpmxnyn",
}    

res, err := xplac.QueryProposals(queryProposalsMsg).Query()

(Query) deposit

// Query details of a deposit
queryDepositMsg := types.QueryDepositMsg{
    Depositor: "xpla1e4f6k98es55vxxv2pcfzpsjrf3mvazeyqpw8g9",
    ProposalID: "1",
}

// Query depostis on a proposal
queryDepositMsg := types.QueryDepositMsg{
    ProposalID: "1",
}

res, err := xplac.QueryDeposit(queryDepositMsg).Query()

(Query) Tally

tallyMsg := types.TallyMsg{
    ProposalID: "1",
}

res, err := xplac.Tally(tallyMsg).Query()

(Query) gov params

// Query all parameters of the gov process
res, err := xplac.GovParams().Query()

// Query the parameters (voting|tallying|deposit) of the governance process
govParamsMsg := types.GovParamsMsg{
    ParamType: "tallying",
}
res, err := xplac.GovParams(govParamsMsg).Query()

(Query) proposer

proposerMsg := types.ProposerMsg {
    ProposalID: "1",
}

res, err := xplac.Proposer(proposerMsg).Query()

(Query) Votes

// query details of a single vote
queryVoteMsg := types.QueryVoteMsg{
    ProposalID: "1",
    VoterAddr: "xpla1mss8agu59x3qte67lfn80x6w65thq4283dvn7l",
}

// Query votes on a proposal
queryVoteMsg := types.QueryVoteMsg{
    ProposalID: "1",
}

res, err := xplac.QueryVote(queryVoteMsg).Query()

# Functions

(Tx) make msg - deposit.
(Query) make msg - gov params.
(Query) make msg - tally.
(Query) make msg - query deposit.
(Query) make msg - query deposits.
(Query) make msg - proposal.
(Query) make msg - proposals.
(Query) make msg - query vote.
(Query) make msg - query votes.
(Tx) make msg - submit proposal.
(Tx) make msg - vote.
(Tx) make msg - weighted vote.
No description provided by the author
No description provided by the author
Query client for gov module.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author