Documentation ¶
Index ¶
- type Attribute
- type BlockResult
- type BlockResultDB
- type Commission
- type Description
- type Event
- type Mint
- type Msg
- type MsgBeginRedelegate
- type MsgCreateValidator
- type MsgDelegate
- type MsgEditValidator
- type MsgExecuteContract
- type MsgInstantiateContract
- type MsgSend
- type MsgStoreCode
- type MsgUndelegate
- type NodeInfo
- type OtherStatus
- type ProtocolVersion
- type PubKeyStatus
- type StatusResult
- type SyncInfo
- type Tx
- type ValidatorInfo
- type WsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 Description ¶
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 MsgBeginRedelegate ¶
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 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 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 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 ProtocolVersion ¶
type PubKeyStatus ¶
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