cosmos

package
v0.0.0-...-3543da7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseAPIUrlFormat = "https://cosmos.directory/%s"
)

Variables

This section is empty.

Functions

func GetOpenProposals

func GetOpenProposals(rpcNode string) ([]types.Proposal, error)

func HasVoted

func HasVoted(rpcNode, walletName string, proposalID uint64) (bool, error)

func SubmitVote

func SubmitVote(rpcNode, walletName, password string, proposalID uint64, voteOption, gasPrices string) (string, error)

Types

type ChainConfig

type ChainConfig struct {
	ChainID       string `json:"chain_id"`
	Executable    string `json:"executable"`
	WalletName    string `json:"wallet_name"`
	WalletAddress string `json:"wallet_address"`
	Password      string `json:"password"`
	Salt          string `json:"salt"`
	GasPrices     string `json:"gas_prices"`
	RPCNode       string `json:"rpc_node"`
}

type ChainInfo

type ChainInfo struct {
	ChainID string `json:"chain_id"`
	RPCNode string
}

func GetChainInfo

func GetChainInfo(chain, rpcNode string) (ChainInfo, error)

type Proposal

type Proposal struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Status      string `json:"status"`
}

type Vote

type Vote struct {
	ProposalID string `json:"proposal_id"`
	Voter      string `json:"voter"`
	Option     string `json:"option"`
}

Jump to

Keyboard shortcuts

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