Documentation ¶
Index ¶
- type Block
- type EthError
- type EthRPCClient
- func (rpc *EthRPCClient) Call(method string, params ...interface{}) (json.RawMessage, error)
- func (rpc *EthRPCClient) EthGetBlockByHash(hash string, withTransactions bool) (*Block, error)
- func (rpc *EthRPCClient) EthGetBlockByNumber(number int, withTransactions bool) (*Block, error)
- func (rpc *EthRPCClient) EthGetTransactionByBlockHashAndIndex(blockHash string, transactionIndex int) (*Transaction, error)
- func (rpc *EthRPCClient) EthGetTransactionByBlockNumberAndIndex(blockNumber, transactionIndex int) (*Transaction, error)
- func (rpc *EthRPCClient) EthGetTransactionByHash(hash string) (*Transaction, error)
- func (rpc *EthRPCClient) EthGetTransactionReceipt(hash string) (*Transaction, error)
- func (rpc *EthRPCClient) EthSyncing() (*Syncing, error)
- func (rpc *EthRPCClient) Web3ClientVersion() (string, error)
- func (rpc *EthRPCClient) Web3Sha3(data []byte) (string, error)
- type JsonBlockWithTransactions
- type JsonBlockWithoutTransactions
- type JsonSyncing
- type JsonTransaction
- type ProxyBlock
- type Syncing
- type Transaction
- type TrxInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Number int Hash string ParentHash string Nonce string Sha3Uncles string LogsBloom string TransactionsRoot string StateRoot string Miner string Difficulty big.Int TotalDifficulty big.Int ExtraData string Size int GasLimit int GasUsed int Timestamp int Transactions []Transaction Uncles []string }
Block - block object
type EthRPCClient ¶
type EthRPCClient struct { Debug bool // contains filtered or unexported fields }
EthRPC - Ethereum rpc client
func NewEthRPCClient ¶
func NewEthRPCClient(url string, options ...func(rpc *EthRPCClient)) *EthRPCClient
NewEthRPC create new rpc client with given url
func (*EthRPCClient) Call ¶
func (rpc *EthRPCClient) Call(method string, params ...interface{}) (json.RawMessage, error)
Call returns raw response of method call
func (*EthRPCClient) EthGetBlockByHash ¶
func (rpc *EthRPCClient) EthGetBlockByHash(hash string, withTransactions bool) (*Block, error)
EthGetBlockByHash returns information about a block by hash.
func (*EthRPCClient) EthGetBlockByNumber ¶
func (rpc *EthRPCClient) EthGetBlockByNumber(number int, withTransactions bool) (*Block, error)
EthGetBlockByNumber returns information about a block by block number.
func (*EthRPCClient) EthGetTransactionByBlockHashAndIndex ¶
func (rpc *EthRPCClient) EthGetTransactionByBlockHashAndIndex(blockHash string, transactionIndex int) (*Transaction, error)
EthGetTransactionByBlockHashAndIndex returns information about a transaction by block hash and transaction index position.
func (*EthRPCClient) EthGetTransactionByBlockNumberAndIndex ¶
func (rpc *EthRPCClient) EthGetTransactionByBlockNumberAndIndex(blockNumber, transactionIndex int) (*Transaction, error)
EthGetTransactionByBlockNumberAndIndex returns information about a transaction by block number and transaction index position.
func (*EthRPCClient) EthGetTransactionByHash ¶
func (rpc *EthRPCClient) EthGetTransactionByHash(hash string) (*Transaction, error)
EthGetTransactionByHash returns the information about a transaction requested by transaction hash.
func (*EthRPCClient) EthGetTransactionReceipt ¶ added in v0.5.2
func (rpc *EthRPCClient) EthGetTransactionReceipt(hash string) (*Transaction, error)
func (*EthRPCClient) EthSyncing ¶
func (rpc *EthRPCClient) EthSyncing() (*Syncing, error)
EthSyncing returns an object with data about the sync status or false.
func (*EthRPCClient) Web3ClientVersion ¶
func (rpc *EthRPCClient) Web3ClientVersion() (string, error)
Web3ClientVersion returns the current client version.
type JsonBlockWithTransactions ¶
type JsonBlockWithTransactions struct { Number hexInt `json:"number"` Hash string `json:"hash"` ParentHash string `json:"parentHash"` Nonce string `json:"nonce"` Sha3Uncles string `json:"sha3Uncles"` LogsBloom string `json:"logsBloom"` TransactionsRoot string `json:"transactionsRoot"` StateRoot string `json:"stateRoot"` Miner string `json:"miner"` Difficulty hexBig `json:"difficulty"` TotalDifficulty hexBig `json:"totalDifficulty"` ExtraData string `json:"extraData"` Size hexInt `json:"size"` GasLimit hexInt `json:"gasLimit"` GasUsed hexInt `json:"gasUsed"` Timestamp hexInt `json:"timestamp"` Transactions []JsonTransaction `json:"transactions"` Uncles []string `json:"uncles"` }
JsonBlockWithTransactions - Block with Transaction json object
type JsonBlockWithoutTransactions ¶
type JsonBlockWithoutTransactions struct { Number hexInt `json:"number"` Hash string `json:"hash"` ParentHash string `json:"parentHash"` Nonce string `json:"nonce"` Sha3Uncles string `json:"sha3Uncles"` LogsBloom string `json:"logsBloom"` TransactionsRoot string `json:"transactionsRoot"` StateRoot string `json:"stateRoot"` Miner string `json:"miner"` Difficulty hexBig `json:"difficulty"` TotalDifficulty hexBig `json:"totalDifficulty"` ExtraData string `json:"extraData"` Size hexInt `json:"size"` GasLimit hexInt `json:"gasLimit"` GasUsed hexInt `json:"gasUsed"` Timestamp hexInt `json:"timestamp"` Transactions []string `json:"transactions"` Uncles []string `json:"uncles"` }
JsonBlockWithoutTransactions - Block without Transaction json object
type JsonSyncing ¶
type JsonSyncing struct { IsSyncing bool `json:"-"` StartingBlock hexInt `json:"startingBlock"` CurrentBlock hexInt `json:"currentBlock"` HighestBlock hexInt `json:"highestBlock"` }
JsonSyncing - Syncing json object
type JsonTransaction ¶
type JsonTransaction struct { Hash string `json:"hash"` Nonce hexInt `json:"nonce"` BlockHash string `json:"blockHash"` BlockNumber *hexInt `json:"blockNumber"` TransactionIndex *hexInt `json:"transactionIndex"` From string `json:"from"` To string `json:"to"` Value hexBig `json:"value"` Gas hexInt `json:"gas"` GasPrice hexBig `json:"gasPrice"` Input string `json:"input"` }
JsonTransaction - Transaction json object
type ProxyBlock ¶
type ProxyBlock interface {
// contains filtered or unexported methods
}
ProxyBlock - proxy to block object
type Syncing ¶
Syncing - object with syncing data info
func (*Syncing) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Transaction ¶
type Transaction struct { Hash string Nonce int BlockHash string BlockNumber *int TransactionIndex *int From string To string Value big.Int Gas int GasPrice big.Int Input string }
Transaction - transaction object
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.