types

package
v0.0.0-...-f3d7857 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Attribute is used to unmarshall JSONRPC responses

type BlockResult

type BlockResult struct {
	Height                string          `json:"height"`
	Txs                   []Tx            `json:"txs_results"`
	BeginBlockEvents      []Event         `json:"begin_block_events"`
	EndBlockEvents        []Event         `json:"end_block_events"`
	ValidatorUpdates      json.RawMessage `json:"validator_updates"`
	ConsensusParamUpdates json.RawMessage `json:"consensus_param_updates"`
}

BlockResult is used to unmarshall JSONRPC responses for block_results?height={n} endpoint

func (*BlockResult) DecodeBlock

func (bl *BlockResult) DecodeBlock(chainId string) (dbBlock BlockResultDB)

DecodeBlock() converts WsResponse BlockResult to BlockResultDB ----- Base64 decodes event attributes, converts, adds fields for DB insert Decodes Txs Decodes BeginBlockEvents Decodes EndBlockEvents Converts height from string to int Adds chainId param to returned BlockResultDB struct

type BlockResultDB

type BlockResultDB struct {
	ID      int `pg:block_id",pk"`
	ChainId string

	Height                int
	Txs                   []Tx    `pg:"rel:has-many,join_fk:block_id"`
	BeginBlockEvents      []Event `pg:"rel:has-many,join_fk:block_id"`
	EndBlockEvents        []Event `pg:"rel:has-many,join_fk:block_id"`
	ValidatorUpdates      json.RawMessage
	ConsensusParamUpdates json.RawMessage
	// contains filtered or unexported fields
}

BlockResult is used to unmarshall JSONRPC responses

type Commission

type Commission struct {
	Rate          string `json:"rate"`
	MaxRate       string `json:"max_rate"`
	MaxChangeRate string `json:"max_change_rate"`
}

type Description

type Description struct {
	Details         string `json:"details"`
	Moniker         string `json:"moniker"`
	Website         string `json:"website"`
	Identity        string `json:"identity"`
	SecurityContact string `json:"security_contact"`
}

type Event

type Event struct {
	ID int `pg:e_id",pk"`

	BlockId    int         `pg:block_id`
	TxId       int         `pg:tx_id`
	Type       string      `json:"type"`
	Attributes []Attribute `json:"attributes"`
	// contains filtered or unexported fields
}

Event is used to unmarshall JSONRPC responses

type Mint

type Mint struct {
	BondedRatio      string `json:"bonded_ratio"`
	Inflation        string `json:"inflation"`
	AnnualProvisions string `json:"annual_provision"`
}

type Msg

type Msg interface {
	HandleMsg()
}

type MsgBeginRedelegate

type MsgBeginRedelegate struct {
	DelegatorAddress string `json:"sender"`
	ValidatorSrc     string `json:"validator_src"`
	ValidatorDst     string `json:"validator_dst"`
	Amount           string `json:"amount"`
}

type MsgCreateValidator

type MsgCreateValidator struct {
	ValDescription    Description `json:"description"`
	ValidatorAddress  string      `json:"validator"`
	DelegatorAddress  string      `json:"sender"`
	PubKey            string      `json:"pub_key"`
	Value             string      `json:"amount"`
	CommissionRate    Commission  `json:"commission"`
	MinSelfDelegation string      `json:"min_self_delegation"`
}

type MsgDelegate

type MsgDelegate struct {
	DelegatorAddress string `json:"sender"`
	Validator        string `json:"validator"`
	Amount           string `json:"amount"`
}

type MsgEditValidator

type MsgEditValidator struct {
	ValDescription    Description `json:"description"`
	ValidatorAddress  string      `json:"validator"`
	Value             string      `json:"amount"`
	CommissionRate    Commission  `json:"commission"`
	MinSelfDelegation string      `json:"min_self_delegation"`
}

type MsgExecuteContract

type MsgExecuteContract struct {
	Sender            string `json:"sender" yaml:"sender"`
	Contract          string `json:"contract" yaml:"contract"`
	Msg               []byte `json:"msg" yaml:"msg"`
	CallbackCodeHash  string `json:"callback_code_hash" yaml:"callback_code_hash"`
	SentFunds         string `json:"sent_funds" yaml:"sent_funds"`
	CallbackSignature []byte `json:"callback_sig" yaml:"callback_sig"` // Optional
}

type MsgInstantiateContract

type MsgInstantiateContract struct {
	Sender string `json:"sender" yaml:"sender"`
	// Admin is an optional address that can execute migrations
	// Admin string `json:"admin,omitempty" yaml:"admin"`
	// This field is only used for callbacks constructed with this message type
	CallbackCodeHash  string `json:"callback_code_hash" yaml:"callback_code_hash"`
	CodeID            uint64 `json:"code_id" yaml:"code_id"`
	Label             string `json:"label" yaml:"label"`
	InitMsg           []byte `json:"init_msg" yaml:"init_msg"`
	InitFunds         string `json:"init_funds" yaml:"init_funds"`
	CallbackSignature []byte `json:"callback_sig" yaml:"callback_sig"` // Optional
}

type MsgSend

type MsgSend struct {
	Sender    string `json:"sender"`
	Recipient string `json:"recipient"`
	// contains filtered or unexported fields
}

type MsgStoreCode

type MsgStoreCode struct {
	Sender string `json:"sender" yaml:"sender"`
	// WASMByteCode can be raw or gzip compressed
	WASMByteCode []byte `json:"wasm_byte_code" yaml:"wasm_byte_code"`
	// Source is a valid absolute HTTPS URI to the contract's source code, optional
	Source string `json:"source" yaml:"source"`
	// Builder is a valid docker image name with tag, optional
	Builder string `json:"builder" yaml:"builder"`
}

type MsgUndelegate

type MsgUndelegate struct {
	DelegatorAddress string `json:"sender"`
	Validator        string `json:"validator"`
	Amount           string `json:"amount"`
}

type NodeInfo

type NodeInfo struct {
	PVersion   ProtocolVersion `json:"protocol_version"`
	ID         string          `json:"id"`
	ListenAddr string          `json:"listen_addr"`
	Network    string          `json:"network"`
	Version    string          `json:"version"`
	Channels   string          `json:"channels"`
	Moniker    string          `json:"moniker"`
	OtherInfo  OtherStatus     `json:"other"`
}

type OtherStatus

type OtherStatus struct {
	TxIndex string `json:"tx_index"`
	RpcAddr string `json:"rpc_address"`
}

type ProtocolVersion

type ProtocolVersion struct {
	P2P   string `json:"p2p"`
	Block string `json:"block"`
	App   string `json:"app"`
}

type PubKeyStatus

type PubKeyStatus struct {
	PType  string `json:"type"`
	PValue string `json:"value"`
}

type StatusResult

type StatusResult struct {
	NInfo   NodeInfo      `json:"node_info"`
	SyInfo  SyncInfo      `json:"sync_info"`
	ValInfo ValidatorInfo `json:"validator_info"`
}

StatusResult is used to unmarshall JSONRPC responses for status? endpoint

type SyncInfo

type SyncInfo struct {
	LatestBlockHash     string `json:"latest_block_hash"`
	LatestAppHash       string `json:"latest_app_hash"`
	LatestBlockHeight   string `json:"latest_block_height"`
	LatestBlockTime     string `json:"latest_block_time"`
	EarliestBlockHash   string `json:"earliest_block_hash"`
	EarliestAppHash     string `json:"earliest_app_hash"`
	EarliestBlockHeight string `json:"earliest_block_height"`
	EarliestBlockTime   string `json:"earliest_block_time"`
	CatchingUp          bool   `json:"catching_up"`
}

type Tx

type Tx struct {
	ID        int     `pg:tx_id",pk"`
	BlockId   int     `pg:block_id`
	Code      int     `json:"code"`
	CodeSpace string  `json:"codespace"`
	Info      string  `json:"info"`
	Data      string  `json:"data"`
	GasWanted string  `json:"gasWanted"`
	GasUsed   string  `json:"gasUsed"`
	Log       string  `json:"log"`
	Events    []Event `json:"events" pg:"rel:has-many,join_fk:tx_id"`
	// contains filtered or unexported fields
}

Tx is used to unmarshall JSONRPC responses

type ValidatorInfo

type ValidatorInfo struct {
	Address     string       `json:"address"`
	PubKey      PubKeyStatus `json:"pub_key"`
	VotingPower string       `json:"voting_power"`
}

type WsResponse

type WsResponse struct {
	JSONRPC    string          `json:"jsonrpc"`
	ID         int             `json:"id"`
	RespResult json.RawMessage `json:"result"`
}

WsResponse is used to unmarshall JSONRPC responses

Jump to

Keyboard shortcuts

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