types

package
v0.7.1 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 Balance added in v0.1.4

type Balance struct {
	Denom  string `json:"denom"`
	Amount string `json:"amount"`
}

type Block

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

Block is terra block data

type BlockDataV4 added in v0.2.2

type BlockDataV4 struct {
	Txs []string `json:"txs"`
}

type BlockHeader

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

type BlockHeaderV4

type BlockHeaderV4 struct {
	Height  string `json:"height"`
	ChainID string `json:"chain_id"`
	Time    string `json:"time"`
}

BlockHeaderV4 is block header

type BlockID

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

BlockID info

type BlockMeta

type BlockMeta struct {
	BlockID BlockID `json:"block_id"`
}

type BlockV4 added in v0.2.2

type BlockV4 struct {
	Header BlockHeaderV4 `json:"header"`
	Data   BlockDataV4   `json:"data"`
}

BlockV4 is terra block data

type Delegation added in v0.1.4

type Delegation struct {
	DelegatorAddress string `json:"delegator_address"`
	ValidatorAddress string `json:"validator_address"`
	Shares           string `json:"shares"`
	Balance          string `json:"balance"`
}

type DelegationResponse added in v0.1.4

type DelegationResponse struct {
	Height      string       `json:"height"`
	Delegations []Delegation `json:"result"`
}

DelegationResponse is terra response for querying /delegations

type DelegationResponseV4 added in v0.2.2

type DelegationResponseV4 struct {
	Height      string         `json:"height"`
	Delegations []DelegationV4 `json:"result"`
}

DelegationResponse is terra response for querying /delegations

type DelegationV4 added in v0.2.2

type DelegationV4 struct {
	DelegatorAddress string  `json:"delegator_address"`
	ValidatorAddress string  `json:"validator_address"`
	Shares           string  `json:"shares"`
	Balance          Balance `json:"balance"`
}

type Error

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

type GetBlockResponse added in v0.2.2

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

type GetBlockResponseV4 added in v0.2.2

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

type GetTxSearchResponse

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

GetTxSearchResponse terra response for search

type LogFormat

type LogFormat struct {
	MsgIndex float64      `json:"msg_index,omitempty"`
	Success  bool         `json:"success,omitempty"`
	Log      LogFormatLog `json:"log,omitempty"`
	Events   []TxEvents   `json:"events,omitempty"`
}

func (*LogFormat) UnmarshalJSON

func (lf *LogFormat) UnmarshalJSON(b []byte) error

type LogFormatLog

type LogFormatLog struct {
	Error
}

type ResponseDeliverTx

type ResponseDeliverTx struct {
	Log string `json:"log"`

	GasWanted string     `json:"gasWanted"`
	GasUsed   string     `json:"gasUsed"`
	Events    []TxEvents `json:"tags"`
}

type ResultBlock added in v0.2.2

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

type ResultBlockV4 added in v0.2.2

type ResultBlockV4 struct {
	Block   BlockV4 `json:"block"`
	BlockID BlockID `json:"block_id"`
}

type ResultTxSearch

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

Result of searching for txs

type TxEvents

type TxEvents struct {
	Type string `json:"type,omitempty"`
	//Attributes []string `json:"attributes"`
	Attributes *TxEventsAttributes `json:"attributes,omitempty"`
}

type TxEventsAttributes

type TxEventsAttributes struct {
	Module    string
	Action    string
	Amount    []string
	Sender    []string
	Validator map[string][]string
	Withdraw  map[string][]string
	Recipient []string
	Voter     []string
	Feeder    []string

	CompletionTime string
	Commission     []string

	Denom []string

	Others map[string][]string
}

func (*TxEventsAttributes) UnmarshalJSON

func (lea *TxEventsAttributes) 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 TxResponse

type TxResponse struct {
	Hash     string            `json:"hash"`
	Height   string            `json:"height"`
	TxResult ResponseDeliverTx `json:"tx_result"`

	// TxData is base64 encoded transaction data
	TxData string `json:"tx"`
}

TxResponse is result of querying for a tx

type TxTags

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

Jump to

Keyboard shortcuts

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