rest

package
v1.0.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	RestParamsType     = "type"
	RestProposalID     = "proposal-id"
	RestDepositor      = "depositor"
	RestVoter          = "voter"
	RestProposalStatus = "status"
	RestNumLimit       = "limit"
)

REST Variable names nolint

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, phs []ProposalRESTHandler)

RegisterRoutes - Central function to define routes that get registered by the main application

Types

type BaseReq added in v0.3.2

type BaseReq struct {

	//Address of the sender
	//required:true
	//in:body
	From string `json:"address"`

	//Chain ID of Heimdall
	//required:true
	//in:body
	ChainID string `json:"chain_id"`
}

type DepositQuery added in v0.3.2

type DepositQuery struct {
	//Proposal ID
	//in:path
	ProposalId int64 `json:"proposal-id"`

	//Depositor ID
	//in:path
	Depositor int64 `json:"depositor"`
}

type DepositReq

type DepositReq struct {
	BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`

	Depositor hmTypes.HeimdallAddress `json:"depositor" yaml:"depositor"` // Address of the depositor
	Amount    sdk.Coins               `json:"amount" yaml:"amount"`       // Coins to add to the proposal's deposit
	Validator hmTypes.ValidatorID     `json:"validator" yaml:"validator"` // id of the validator
}

DepositReq defines the properties of a deposit request's body.

type Height added in v0.3.2

type Height struct {

	//Block Height
	//in:query
	Height string `json:"height"`
}

type PostProposalReq

type PostProposalReq struct {
	BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`

	Title          string                  `json:"title" yaml:"title"`                     // Title of the proposal
	Description    string                  `json:"description" yaml:"description"`         // Description of the proposal
	ProposalType   string                  `json:"proposal_type" yaml:"proposal_type"`     // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
	Proposer       hmTypes.HeimdallAddress `json:"proposer" yaml:"proposer"`               // Address of the proposer
	Validator      hmTypes.ValidatorID     `json:"validator" yaml:"validator"`             // id of the validator
	InitialDeposit sdk.Coins               `json:"initial_deposit" yaml:"initial_deposit"` // Coins to add to the proposal's deposit
}

PostProposalReq defines the properties of a proposal request's body.

type ProposalId added in v0.3.2

type ProposalId struct {
	//Proposal ID
	//in:path
	ProposalId int64 `json:"proposal-id"`
}

type ProposalRESTHandler

type ProposalRESTHandler struct {
	SubRoute string
	Handler  func(http.ResponseWriter, *http.Request)
}

ProposalRESTHandler defines a REST handler implemented in another module. The sub-route is mounted on the governance REST handler.

type ProposalsQuery added in v0.3.2

type ProposalsQuery struct {

	//Proposal Status [DepositPeriod,Passed,Rejected,Failed,VotingPeriod]
	//in:query
	Status string `json:"status"`

	//Limit
	//in:query
	Limit int64 `json:"limit"`

	//Voter ID
	//in:query
	Voter int64 `json:"voter"`

	//Depositor ID
	//in:query
	Depositor int64 `json:"depositor"`
}

type TallyResult added in v0.3.2

type TallyResult struct {
	Yes        string `json:"yes"`
	Abstain    string `json:"abstain"`
	No         string `json:"no"`
	NoWithVeto string `json:"no_with_veto"`
}

type VoteReq

type VoteReq struct {
	BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`

	Voter     hmTypes.HeimdallAddress `json:"voter" yaml:"voter"`         // address of the voter
	Option    string                  `json:"option" yaml:"option"`       // option from OptionSet chosen by the voter
	Validator hmTypes.ValidatorID     `json:"validator" yaml:"validator"` // id of the validator
}

VoteReq defines the properties of a vote request's body.

type VotesQuery added in v0.3.2

type VotesQuery struct {
	//Proposal ID
	//in:path
	ProposalId int64 `json:"proposal-id"`

	//Voter ID
	//in:path
	Voter int64 `json:"voter"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL