rpc

package
v1.1.16-0...-5f6d184 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 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 Block

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

type BlockHeader

type BlockHeader struct {
	Number    string `json:"BlockNum"`
	Timestamp string `json:"Timestamp"`
}

type BlockTxRpc

type BlockTxRpc struct {
	JsonRpc string           `json:"jsonrpc"`
	Error   *client.RpcError `json:"error,omitempty"`
	Result  BlockTxs         `json:"result,omitempty"`
	Id      string           `json:"id,omitempty"`
}

type BlockTxs

type BlockTxs [][]string

type ChainInfo

type ChainInfo struct {
	NumTxBlocks string `json:"NumTxBlocks"`
}

type Client

type Client struct {
	client.Request
}

func InitClient

func InitClient(url string) Client

func (*Client) GetBlock

func (c *Client) GetBlock(number int64) (block Block, err error)

func (*Client) GetBlockchainInfo

func (c *Client) GetBlockchainInfo() (info *ChainInfo, err error)

func (*Client) GetTransactionsHashesInBlock

func (c *Client) GetTransactionsHashesInBlock(number int64) ([]string, error)

func (*Client) GetTx

func (c *Client) GetTx(hash string) (tx Tx, err error)

func (*Client) GetTxInBlock

func (c *Client) GetTxInBlock(number int64) (header BlockHeader, txs []Tx, err error)

type HashesResponse

type HashesResponse struct {
	ID      int        `json:"id"`
	Jsonrpc string     `json:"jsonrpc"`
	Result  [][]string `json:"result"`
}

func (HashesResponse) Txs

func (h HashesResponse) Txs() []string

type Receipt

type Receipt struct {
	CumulativeGas string `json:"cumulative_gas"`
	EpochNum      string `json:"epoch_num"`
	Success       bool   `json:"success"`
}

type Tx

type Tx struct {
	ID           string  `json:"ID"`
	Amount       string  `json:"amount"`
	GasLimit     string  `json:"gasLimit"`
	GasPrice     string  `json:"gasPrice"`
	Nonce        string  `json:"nonce"`
	Receipt      Receipt `json:"receipt"`
	SenderPubKey string  `json:"senderPubKey"`
	Signature    string  `json:"signature"`
	ToAddr       string  `json:"toAddr"`
	Version      string  `json:"version"`
}

Jump to

Keyboard shortcuts

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