rpc

package
v0.0.0-...-0c64813 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadBigint

func ReadBigint(source string) (*big.Int, error)

ReadBigint .

Types

type Block

type Block struct {
	Number           string         `json:"number"`
	Hash             string         `json:"hash"`
	Parent           string         `json:"parentHash"`
	Nonce            string         `json:"nonce"`
	SHA3Uncles       string         `json:"sha3Uncles"`
	LogsBloom        string         `json:"logsBloom"`
	TransactionsRoot string         `json:"transactionsRoot"`
	StateRoot        string         `json:"stateRoot"`
	ReceiptsRoot     string         `json:"receiptsRoot"`
	Miner            string         `json:"miner"`
	Difficulty       string         `json:"difficulty"`
	TotalDifficulty  string         `json:"totalDifficulty"`
	ExtraData        string         `json:"extraData"`
	Size             string         `json:"size"`
	GasLimit         string         `json:"gasLimit"`
	GasUsed          string         `json:"gasUsed"`
	Timestamp        string         `json:"timestamp"`
	Transactions     []*Transaction `json:"transactions"`
	Uncles           []string       `json:"uncles"`
}

Block eth block object

type CallSite

type CallSite struct {
	From     string `json:"from,omitempty"`
	To       string `json:"to,omitempty"`
	Value    string `json:"value,omitempty"`
	GasPrice string `json:"gasPrice,omitempty"`
	Gas      string `json:"gas,omitempty"`
	Data     string `json:"data,omitempty"`
}

CallSite .

type Client

type Client struct {
	slf4go.Logger
	// contains filtered or unexported fields
}

Client neo jsonrpc 2.0 client

func NewClient

func NewClient(url string) *Client

NewClient create new neo client

func (*Client) BlockNumber

func (client *Client) BlockNumber() (uint64, error)

BlockNumber get geth last block number

func (*Client) BlockPerSecond

func (client *Client) BlockPerSecond() (val float64, err error)

BlockPerSecond get geth last block number

func (*Client) Call

func (client *Client) Call(callsite *CallSite) (val string, err error)

Call eth call

func (*Client) EstimateGas

func (client *Client) EstimateGas(from, to, value, data string) (*big.Int, error)

func (*Client) GetBalance

func (client *Client) GetBalance(address string) (value *ethgo.Value, err error)

GetBalance get balance of eth address

func (*Client) GetBlockByNumber

func (client *Client) GetBlockByNumber(number uint64) (val *Block, err error)

GetBlockByNumber get geth last block number

func (*Client) GetTokenBalance

func (client *Client) GetTokenBalance(token string, address string) (val *big.Int, err error)

GetTokenBalance .

func (*Client) GetTokenDecimals

func (client *Client) GetTokenDecimals(token string) (val *big.Int, err error)

GetTokenDecimals .

func (*Client) GetTransactionByHash

func (client *Client) GetTransactionByHash(tx string) (val *Transaction, err error)

GetTransactionByHash get geth last block number

func (*Client) GetTransactionReceipt

func (client *Client) GetTransactionReceipt(tx string) (val *TransactionReceipt, err error)

GetTransactionReceipt ...

func (*Client) Nonce

func (client *Client) Nonce(address string) (uint64, error)

Nonce get address send transactions

func (*Client) SendRawTransaction

func (client *Client) SendRawTransaction(tx []byte) (val string, err error)

SendRawTransaction .

func (*Client) SuggestGasPrice

func (client *Client) SuggestGasPrice() (*big.Int, error)

type Transaction

type Transaction struct {
	Hash             string `json:"hash"`
	Nonce            string `json:"nonce"`
	BlockHash        string `json:"blockHash"`
	BlockNumber      string `json:"blockNumber"`
	TransactionIndex string `json:"transactionIndex"`
	From             string `json:"from"`
	To               string `json:"to"`
	Value            string `json:"value"`
	GasPrice         string `json:"gasPrice"`
	Gas              string `json:"gas"`
	Input            string `json:"input"`
}

Transaction .

type TransactionReceipt

type TransactionReceipt struct {
	Hash              string        `json:"transactionHash"`
	BlockHash         string        `json:"blockHash"`
	BlockNumber       string        `json:"blockNumber"`
	TransactionIndex  string        `json:"transactionIndex"`
	CumulativeGasUsed string        `json:"cumulativeGasUsed"`
	GasUsed           string        `json:"gasUsed"`
	ContractAddress   string        `json:"contractAddress"`
	Logs              []interface{} `json:"logs"`
	LogsBloom         string        `json:"logsBloom"`
	Status            string        `json:"status"`
}

TransactionReceipt .

Jump to

Keyboard shortcuts

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