Documentation ¶
Index ¶
- Constants
- func Close()
- func EthBlockNumber() (height string, err error)
- func EthBlockNumberInt64() (height int64, err error)
- func EthBlockNumberResponse() (response string, err error)
- func EthGetBalance(address string, blockParameter string) (response string, err error)
- func EthGetBlockByNumberResponse(height int64) (response string, err error)
- func EthGetTransactionByHashResponse(hash string) (response string, err error)
- func EthGetTransactionReceiptResponse(hash string) (response string, err error)
- func EthProtocolVersionResponse() (response string, err error)
- type Account
- type Block
- type EthClient
- type GethConfig
- type JSONRPC
- type RPCResponse
- type ResultError
- type Token
- type Transaction
- type TransactionReceipt
Constants ¶
const ( // VERSION of ethereum VERSION = "v1.8.23" // CLIENT identifier CLIENT = "geth" )
Variables ¶
This section is empty.
Functions ¶
func EthBlockNumber ¶
EthBlockNumber return block number in hex string
func EthBlockNumberInt64 ¶
EthBlockNumberInt64 return block number in int64
func EthBlockNumberResponse ¶
EthBlockNumberResponse json-rpc response string for eth_blockNumber
func EthGetBalance ¶
EthGetBalance returns the balance of the account of given address.
func EthGetBlockByNumberResponse ¶
EthGetBlockByNumberResponse json-rpc for eth_getBlockByNumber
func EthGetTransactionByHashResponse ¶
EthGetTransactionByHashResponse returns the information about a transaction requested by transaction hash.
func EthGetTransactionReceiptResponse ¶
EthGetTransactionReceiptResponse returns the receipt of a transaction by transaction hash
func EthProtocolVersionResponse ¶
EthProtocolVersionResponse json-rpc for eth_protocolVersion
Types ¶
type Account ¶
Account escrow account on hyperledger fabric
func NewAccount ¶
NewAccount create a new account on ethereum
type Block ¶
type Block struct { Number string `json:"number,omitempty"` Difficulty string `json:"difficulty,omitempty"` Transactions []*Transaction `json:"transactions,omitempty"` }
Block returns from ethereum
func EthGetBlockByNumber ¶
EthGetBlockByNumber json-rpc for eth_getBlockByNumber
type EthClient ¶
type EthClient struct {
// contains filtered or unexported fields
}
EthClient ethereum json-rpc client
type GethConfig ¶
type GethConfig struct { Eth eth.Config Shh whisper.Config Node node.Config // Ethstats ethstatsConfig Dashboard dashboard.Config }
GethConfig wrapped ethereum config
type JSONRPC ¶
type JSONRPC struct { JSONRPC string `json:"jsonrpc,omitempty"` Method string `json:"method,omitempty"` Params []interface{} `json:"params,omitempty"` ID uint8 `json:"id,omitempty"` }
JSONRPC rpc request
type RPCResponse ¶
type RPCResponse struct { JSONRPCVersion string `json:"jsonrpc"` ID uint8 `json:"id"` Result interface{} `json:"result"` Error *ResultError `json:"error"` }
RPCResponse returns block from ethereum
type ResultError ¶
ResultError error message
type Token ¶
type Token struct { Name string `json:"name,omitempty"` Symbol string `json:"symbol,omitempty"` Decimals uint8 `json:"decimals,omitempty"` }
Token info on chain
func QueryTokenInfo ¶
QueryTokenInfo query token info on ethereum
type Transaction ¶
type Transaction struct { BlockHash string `json:"blockHash,omitempty"` TransactionIndex string `json:"transactionIndex,omitempty"` From string `json:"from,omitempty"` To string `json:"to,omitempty"` Value string `json:"value,omitempty"` BlockNumber string `json:"blockNumber,omitempty"` ChainID string `json:"chainId,omitempty"` // Condition // Creates Gas string `json:"gas,omitempty"` GasPrice string `json:"gasPrice,omitempty"` Hash string `json:"hash,omitempty"` Input string `json:"input,omitempty"` Nonce string `json:"nonce,omitempty"` PublicKey string `json:"publicKey,omitempty"` R string `json:"r,omitempty"` Raw string `json:"raw,omitempty"` S string `json:"s,omitempty"` StandardV string `standardV:"value,omitempty"` V string `json:"v,omitempty"` }
Transaction block tx
func EthGetTransactionByHash ¶
func EthGetTransactionByHash(hash string) (*Transaction, error)
EthGetTransactionByHash returns the information about a transaction requested by transaction hash.
type TransactionReceipt ¶
type TransactionReceipt struct { Height string `json:"blockNumber,omitempty"` Hash string `json:"transactionHash,omitempty"` Status string `json:"status,omitempty"` GasUsed string `json:"gasUsed,omitempty"` ContractAddress string `json:"contractAddress,omitempty"` }
TransactionReceipt receipt of transaction
func EthGetTransactionReceipt ¶
func EthGetTransactionReceipt(hash string) (*TransactionReceipt, error)
EthGetTransactionReceipt returns the receipt of a transaction by transaction hash