types

package
v0.3.0-rc17 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Header BlockHeader `json:"header"`
}

Block is cosmos block data

type BlockHeader

type BlockHeader struct {
	Height  string `json:"height"`
	ChainID string `json:"chain_id"`
	Time    string `json:"time"`
	NumTxs  string `json:"num_txs"`
}

BlockHeader structures

type BlockID

type BlockID struct {
	Hash string `json:"hash"`
}

BlockID info

type BlockMeta

type BlockMeta struct {
	BlockID BlockID     `json:"block_id"`
	Header  BlockHeader `json:"header"`
}

BlockMeta is block metadata

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    string `json:"data"`
}

Error is api error

type GetBlockResponse

type GetBlockResponse struct {
	// ID     string      `json:"id"`
	RPC    string      `json:"jsonrpc"`
	Result ResultBlock `json:"result"`
	Error  Error       `json:"error"`
}

GetBlockResponse cosmos response from block

type GetBlockchainResponse

type GetBlockchainResponse struct {
	//ID     string           `json:"id"`
	RPC    string           `json:"jsonrpc"`
	Result ResultBlockchain `json:"result"`
	Error  Error            `json:"error"`
}

GetBlockchainResponse cosmos response from blockchain

type GetTxSearchResponse

type GetTxSearchResponse struct {
	// ID     string         `json:"id"`
	RPC    string         `json:"jsonrpc"`
	Result ResultTxSearch `json:"result"`
	Error  Error          `json:"error"`
}

GetTxSearchResponse cosmos response for search

type LogEvents

type LogEvents struct {
	Type string `json:"type"`
	//Attributes []string `json:"attributes"`
	Attributes []*LogEventsAttributes `json:"attributes"`
}

LogEvents format of events from logs cosmos

type LogEventsAttributes

type LogEventsAttributes struct {
	Module         string
	Action         string
	Amount         []string
	Sender         []string
	Validator      map[string][]string
	Withdraw       map[string][]string
	Recipient      []string
	CompletionTime string
	Commission     []string
	Others         map[string][]string
}

LogEventsAttributes enhanced format of event attributes

func (*LogEventsAttributes) UnmarshalJSON

func (lea *LogEventsAttributes) UnmarshalJSON(b []byte) error

UnmarshalJSON LogEvents into a different format, to be able to parse it later more easily thats fulfillment of json.Unmarshaler inferface

type LogFormat

type LogFormat struct {
	MsgIndex float64     `json:"msg_index"`
	Success  bool        `json:"success"`
	Log      string      `json:"log"`
	Events   []LogEvents `json:"events"`
}

LogFormat format of logs from cosmos

type ResponseDeliverTx

type ResponseDeliverTx struct {
	Log       string  `json:"log"`
	GasWanted string  `json:"gasWanted"`
	GasUsed   string  `json:"gasUsed"`
	Tags      []TxTag `json:"tags"`
}

ResponseDeliverTx result

type ResultBlock

type ResultBlock struct {
	Block     Block     `json:"block"`
	BlockMeta BlockMeta `json:"block_meta"`
}

ResultBlock is result of fetching block

type ResultBlockchain

type ResultBlockchain struct {
	LastHeight string      `json:"last_height"`
	BlockMetas []BlockMeta `json:"block_metas"`
}

ResultBlockchain is result of fetching block

type ResultTxSearch

type ResultTxSearch struct {
	Txs        []TxResponse `json:"txs"`
	TotalCount string       `json:"total_count"`
}

ResultTxSearch of searching for txs

type TxResponse

type TxResponse struct {
	Hash   string  `json:"hash"`
	Height string  `json:"height"`
	Index  float64 `json:"index"`

	TxResult ResponseDeliverTx `json:"tx_result"`
	// TxData is base64 encoded transaction data
	TxData string `json:"tx"`

	All int64
}

TxResponse is result of querying for a tx

type TxTag

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

TxTag is tag from cosmos

Jump to

Keyboard shortcuts

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