Documentation ¶
Index ¶
- func InitMetrics()
- func RawToTransaction(logger *zap.Logger, cdc *amino.Codec, in []TxResponse, ...) error
- func RawToTransactionCh(logger *zap.Logger, cdc *amino.Codec, wg *sync.WaitGroup, in <-chan TxResponse, ...)
- type Block
- type BlockHeader
- type BlockHeaderV4
- type BlockID
- type BlockMeta
- type BlockMetaV4
- type BlocksMap
- type Client
- func (c *Client) CDC() *amino.Codec
- func (c *Client) GetAccountBalance(ctx context.Context, params structs.HeightAccount) (resp structs.GetAccountBalanceResponse, err error)
- func (c Client) GetBlocksMeta(ctx context.Context, params structs.HeightRange, limit uint64, ...)
- func (c *Client) GetFromRaw(logger *zap.Logger, txReader io.Reader) []map[string]interface{}
- func (c *Client) GetReward(ctx context.Context, params structs.HeightAccount) (resp structs.GetRewardResponse, err error)
- func (c *Client) SearchTx(ctx context.Context, r structs.HeightRange, chain_id string, ...)
- func (c *Client) SearchTxSingularHeight(ctx context.Context, height uint64, page, perPage int) (txSearch []TxResponse, err error)
- func (c *Client) SingularHeightWorker(ctx context.Context, wg *sync.WaitGroup, out chan TxResponse, in chan ToGet)
- type Error
- type GetBlockchainResponse
- type GetBlockchainResponseV4
- type GetTxSearchResponse
- type LogFormat
- type LogFormatLog
- type ResponseDeliverTx
- type ResultBlockchain
- type ResultBlockchainV4
- type ResultTxSearch
- type RewardResponse
- type RewardResult
- type ToGet
- type TxEvents
- type TxEventsAttributes
- type TxLogError
- type TxResponse
- type TxTags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RawToTransaction ¶
Types ¶
type BlockHeader ¶
type BlockHeaderV4 ¶
type BlockHeaderV4 struct { Height string `json:"height"` ChainID string `json:"chain_id"` Time string `json:"time"` }
BlockMetaV4 is block header
type BlockMeta ¶
type BlockMeta struct { BlockID BlockID `json:"block_id"` Header BlockHeader `json:"header"` }
BlockMeta is block metadata
type BlockMetaV4 ¶
type BlockMetaV4 struct { BlockID BlockID `json:"block_id"` Header BlockHeaderV4 `json:"header"` NumTxs string `json:"num_txs"` }
BlockMetaV4 is block metadata
type BlocksMap ¶
type BlocksMap struct { sync.Mutex Blocks map[uint64]structs.Block NumTxs uint64 StartHeight uint64 EndHeight uint64 }
BlocksMap map of blocks to control block map with extra summary of number of transactions
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Tendermint RPC client for cosmos using figmentnetworks datahub
func (*Client) GetAccountBalance ¶ added in v0.0.6
func (c *Client) GetAccountBalance(ctx context.Context, params structs.HeightAccount) (resp structs.GetAccountBalanceResponse, err error)
GetAccountBalance fetches account balance
func (Client) GetBlocksMeta ¶
func (c Client) GetBlocksMeta(ctx context.Context, params structs.HeightRange, limit uint64, blocks *BlocksMap, end chan<- error)
GetBlocksMeta fetches block metadata from given range of blocks
func (*Client) GetFromRaw ¶ added in v0.0.3
GetFromRaw returns raw data for plugin use;
func (*Client) GetReward ¶ added in v0.0.5
func (c *Client) GetReward(ctx context.Context, params structs.HeightAccount) (resp structs.GetRewardResponse, err error)
GetReward fetches total rewards for delegator account
func (*Client) SearchTx ¶
func (c *Client) SearchTx(ctx context.Context, r structs.HeightRange, chain_id string, blocks map[uint64]structs.Block, out chan cStruct.OutResp, page, perPage int, fin chan string)
SearchTx is making search api call
func (*Client) SearchTxSingularHeight ¶
func (c *Client) SearchTxSingularHeight(ctx context.Context, height uint64, page, perPage int) (txSearch []TxResponse, err error)
SearchTxSingularHeight is making search api call for
func (*Client) SingularHeightWorker ¶
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 GetBlockchainResponseV4 ¶
type GetBlockchainResponseV4 struct { ID int `json:"id"` RPC string `json:"jsonrpc"` Result ResultBlockchainV4 `json:"result"` Error Error `json:"error"` }
GetBlockchainResponseV4 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 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 ¶
type LogFormatLog ¶
type LogFormatLog struct {
Error
}
type ResponseDeliverTx ¶
type ResultBlockchain ¶
type ResultBlockchain struct { LastHeight string `json:"last_height"` BlockMetas []BlockMeta `json:"block_metas"` }
ResultBlockchain is result of fetching block
type ResultBlockchainV4 ¶
type ResultBlockchainV4 struct { LastHeight string `json:"last_height"` BlockMetas []BlockMetaV4 `json:"block_metas"` }
ResultBlockchainV4 is result of fetching block
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 RewardResponse ¶ added in v0.0.5
type RewardResponse struct { Height string `json:"height"` Result RewardResult `json:"result"` }
RewardResponse is terra response for querying /rewards
type RewardResult ¶ added in v0.0.5
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 TxLogError ¶
type TxLogError struct { Codespace string `json:"codespace"` Code float64 `json:"code"` Message string `json:"message"` }
TxLogError Error message
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