Documentation
¶
Index ¶
- Constants
- func Factory(logger hclog.Logger, m interface{}, config map[string]interface{}) (api.API, error)
- type BlockNumber
- type Dispatcher
- type ErrorObject
- type Eth
- func (e *Eth) BlockNumber() (interface{}, error)
- func (e *Eth) GetBalance(address string, number string) (interface{}, error)
- func (e *Eth) GetBlockByHash(hashStr string, full bool) (interface{}, error)
- func (e *Eth) GetBlockByNumber(blockNumber string, full bool) (interface{}, error)
- func (e *Eth) GetCode(address string, number string) (interface{}, error)
- func (e *Eth) GetTransactionCount(address string, number string) (interface{}, error)
- func (e *Eth) GetTransactionReceipt(hash string) (interface{}, error)
- func (e *Eth) SendRawTransaction(input string) (interface{}, error)
- func (e *Eth) SendTransaction(params map[string]interface{}) (interface{}, error)
- type HTTPServer
- type JSONRPC
- type Net
- type Request
- type Response
- type Server
- type ServerConfig
- type ServerFactory
- type Web3
Constants ¶
const ( PendingBlockNumber = BlockNumber(-3) LatestBlockNumber = BlockNumber(-2) EarliestBlockNumber = BlockNumber(-1) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockNumber ¶
type BlockNumber int64
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher handles jsonrpc requests
type ErrorObject ¶
type ErrorObject struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data,omitempty"` }
ErrorObject is a jsonrpc error
type Eth ¶
type Eth struct {
// contains filtered or unexported fields
}
Eth is the eth jsonrpc endpoint
func (*Eth) BlockNumber ¶
CurrentBlock returns current block number
func (*Eth) GetBalance ¶
CurrentBlock returns current block number
func (*Eth) GetBlockByHash ¶
GetBlockByHash returns information about a block by hash
func (*Eth) GetBlockByNumber ¶
GetBlockByNumber returns information about a block by block number
func (*Eth) GetTransactionCount ¶
GetTransactionCount returns account nonce
func (*Eth) GetTransactionReceipt ¶
GetTransactionReceipt returns account nonce
func (*Eth) SendRawTransaction ¶
func (*Eth) SendTransaction ¶
SendTransaction creates new message call transaction or a contract creation, if the data field contains code.
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer is an http server that serves jsonrpc requests
func (*HTTPServer) Close ¶
func (h *HTTPServer) Close() error
Close implements the transport interface
type JSONRPC ¶
type JSONRPC struct {
// contains filtered or unexported fields
}
JSONRPC is an API backend
type Net ¶
type Net struct {
// contains filtered or unexported fields
}
Net is the net jsonrpc endpoint
func (*Net) Listening ¶
Listening returns true if client is actively listening for network connections
type Request ¶
type Request struct { ID int `json:"id"` Method string `json:"method"` Params json.RawMessage `json:"params"` }
Request is a jsonrpc request
type Response ¶
type Response struct { ID int `json:"id"` Result json.RawMessage `json:"result"` Error *ErrorObject `json:"error,omitempty"` }
Response is a jsonrpc response
type Server ¶
type Server interface { // Close shutdowns the server and closes any open connection Close() error }
Server is a communication interface for the server
type ServerConfig ¶
type ServerConfig map[string]interface{}
ServerConfig is the configuration for each server
type ServerFactory ¶
type ServerFactory func(d *Dispatcher, logger hclog.Logger, config ServerConfig) (Server, error)
ServerFactory is a factory method to create servers
type Web3 ¶
type Web3 struct {
// contains filtered or unexported fields
}
Web3 is the web3 jsonrpc endpoint
func (*Web3) ClientVersion ¶
ClientVersion returns the current client version