Documentation ¶
Index ¶
- Constants
- type EthReader
- func NewEthReader() *EthReader
- func NewEthReaderWithCustomNodes(nodes map[string]string) *EthReader
- func NewKovanReader() *EthReader
- func NewKovanReaderWithCustomNodes(nodes map[string]string) *EthReader
- func NewRinkebyReader() *EthReader
- func NewRinkebyReaderWithCustomNodes(nodes map[string]string) *EthReader
- func NewRopstenReader() *EthReader
- func NewRopstenReaderWithCustomNodes(nodes map[string]string) *EthReader
- func NewTomoReader() *EthReader
- func NewTomoReaderWithCustomNodes(nodes map[string]string) *EthReader
- func (self *EthReader) AddressFromContract(contract string, method string) (*common.Address, error)
- func (self *EthReader) CurrentBlock() (uint64, error)
- func (self *EthReader) ERC20Allowance(caddr string, owner string, spender string) (*big.Int, error)
- func (self *EthReader) ERC20Balance(caddr string, user string) (*big.Int, error)
- func (self *EthReader) ERC20Decimal(caddr string) (int64, error)
- func (self *EthReader) EstimateGas(from, to string, priceGwei, value float64, data []byte) (uint64, error)
- func (self *EthReader) GetABI(address string) (*abi.ABI, error)
- func (self *EthReader) GetABIString(address string) (string, error)
- func (self *EthReader) GetBalance(address string) (balance *big.Int, err error)
- func (self *EthReader) GetCode(address string) (code []byte, err error)
- func (self *EthReader) GetEthereumABI(address string) (*abi.ABI, error)
- func (self *EthReader) GetEthereumABIString(address string) (string, error)
- func (self *EthReader) GetKovanABI(address string) (*abi.ABI, error)
- func (self *EthReader) GetKovanABIString(address string) (string, error)
- func (self *EthReader) GetLogs(fromBlock, toBlock int, addresses []string, topic string) ([]types.Log, error)
- func (self *EthReader) GetMinedNonce(address string) (nonce uint64, err error)
- func (self *EthReader) GetPendingNonce(address string) (nonce uint64, err error)
- func (self *EthReader) GetRinkebyABI(address string) (*abi.ABI, error)
- func (self *EthReader) GetRinkebyABIString(address string) (string, error)
- func (self *EthReader) GetRopstenABI(address string) (*abi.ABI, error)
- func (self *EthReader) GetRopstenABIString(address string) (string, error)
- func (self *EthReader) GetTomoABI(address string) (*abi.ABI, error)
- func (self *EthReader) GetTomoABIString(address string) (string, error)
- func (self *EthReader) HeaderByNumber(number int64) (*types.Header, error)
- func (self *EthReader) HistoryERC20Allowance(atBlock int64, caddr string, owner string, spender string) (*big.Int, error)
- func (self *EthReader) HistoryERC20Balance(atBlock int64, caddr string, user string) (*big.Int, error)
- func (self *EthReader) HistoryERC20Decimal(atBlock int64, caddr string) (int64, error)
- func (self *EthReader) ReadContract(result interface{}, caddr string, method string, args ...interface{}) error
- func (self *EthReader) ReadContractToBytes(atBlock int64, caddr string, abi *abi.ABI, method string, args ...interface{}) ([]byte, error)
- func (self *EthReader) ReadContractWithABI(result interface{}, caddr string, abi *abi.ABI, method string, ...) error
- func (self *EthReader) ReadHistoryContract(atBlock int64, result interface{}, caddr string, method string, ...) error
- func (self *EthReader) ReadHistoryContractWithABI(atBlock int64, result interface{}, caddr string, abi *abi.ABI, method string, ...) error
- func (self *EthReader) RecommendedGasPrice() (float64, error)
- func (self *EthReader) RecommendedGasPriceEthereum() (float64, error)
- func (self *EthReader) RecommendedGasPriceKovan() (float64, error)
- func (self *EthReader) RecommendedGasPriceRinkeby() (float64, error)
- func (self *EthReader) RecommendedGasPriceRopsten() (float64, error)
- func (self *EthReader) RecommendedGasPriceTomo() (float64, error)
- func (self *EthReader) TransactionByHash(txHash string) (tx *eu.Transaction, isPending bool, err error)
- func (self *EthReader) TransactionReceipt(txHash string) (receipt *types.Receipt, err error)
- func (self *EthReader) TxInfoFromHash(tx string) (eu.TxInfo, error)
- type EthereumNode
- type OneNodeReader
- func (self *OneNodeReader) Client() (*rpc.Client, error)
- func (self *OneNodeReader) CurrentBlock() (uint64, error)
- func (self *OneNodeReader) EstimateGas(from, to string, priceGwei, value float64, data []byte) (uint64, error)
- func (self *OneNodeReader) EthClient() (*ethclient.Client, error)
- func (self *OneNodeReader) GetBalance(address string) (balance *big.Int, err error)
- func (self *OneNodeReader) GetCode(address string) (code []byte, err error)
- func (self *OneNodeReader) GetLogs(fromBlock, toBlock int, addresses []string, topic string) ([]types.Log, error)
- func (self *OneNodeReader) GetMinedNonce(address string) (nonce uint64, err error)
- func (self *OneNodeReader) GetPendingNonce(address string) (nonce uint64, err error)
- func (self *OneNodeReader) HeaderByNumber(number int64) (*types.Header, error)
- func (self *OneNodeReader) NodeName() string
- func (self *OneNodeReader) NodeURL() string
- func (self *OneNodeReader) ReadContractToBytes(atBlock int64, caddr string, abi *abi.ABI, method string, args ...interface{}) ([]byte, error)
- func (self *OneNodeReader) TransactionByHash(txHash string) (tx *eu.Transaction, isPending bool, err error)
- func (self *OneNodeReader) TransactionReceipt(txHash string) (receipt *types.Receipt, err error)
Constants ¶
View Source
const TIMEOUT time.Duration = 4 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EthReader ¶
type EthReader struct {
// contains filtered or unexported fields
}
func NewEthReader ¶
func NewEthReader() *EthReader
func NewEthReaderWithCustomNodes ¶ added in v0.2.3
func NewKovanReader ¶ added in v0.5.0
func NewKovanReader() *EthReader
func NewKovanReaderWithCustomNodes ¶ added in v0.5.0
func NewRinkebyReader ¶ added in v0.5.0
func NewRinkebyReader() *EthReader
func NewRinkebyReaderWithCustomNodes ¶ added in v0.5.0
func NewRopstenReader ¶
func NewRopstenReader() *EthReader
func NewRopstenReaderWithCustomNodes ¶ added in v0.2.3
func NewTomoReader ¶
func NewTomoReader() *EthReader
func NewTomoReaderWithCustomNodes ¶ added in v0.2.3
func (*EthReader) AddressFromContract ¶
func (*EthReader) CurrentBlock ¶ added in v0.3.0
func (*EthReader) ERC20Allowance ¶
func (*EthReader) ERC20Balance ¶
func (*EthReader) EstimateGas ¶
func (*EthReader) GetABIString ¶
func (*EthReader) GetBalance ¶
func (*EthReader) GetEthereumABI ¶
func (*EthReader) GetEthereumABIString ¶
func (*EthReader) GetKovanABI ¶ added in v0.5.0
func (*EthReader) GetKovanABIString ¶ added in v0.5.0
func (*EthReader) GetLogs ¶
func (self *EthReader) GetLogs(fromBlock, toBlock int, addresses []string, topic string) ([]types.Log, error)
if toBlock < 0, it will query to the latest block
func (*EthReader) GetMinedNonce ¶
func (*EthReader) GetPendingNonce ¶
func (*EthReader) GetRinkebyABI ¶ added in v0.5.0
func (*EthReader) GetRinkebyABIString ¶ added in v0.5.0
func (*EthReader) GetRopstenABI ¶
func (*EthReader) GetRopstenABIString ¶
func (*EthReader) GetTomoABIString ¶
func (*EthReader) HeaderByNumber ¶
func (*EthReader) HistoryERC20Allowance ¶
func (*EthReader) HistoryERC20Balance ¶
func (*EthReader) HistoryERC20Decimal ¶
func (*EthReader) ReadContract ¶
func (*EthReader) ReadContractToBytes ¶ added in v0.2.1
func (*EthReader) ReadContractWithABI ¶
func (*EthReader) ReadHistoryContract ¶
func (*EthReader) ReadHistoryContractWithABI ¶
func (*EthReader) RecommendedGasPrice ¶
return gwei
func (*EthReader) RecommendedGasPriceEthereum ¶
func (*EthReader) RecommendedGasPriceKovan ¶ added in v0.5.0
func (*EthReader) RecommendedGasPriceRinkeby ¶ added in v0.5.0
func (*EthReader) RecommendedGasPriceRopsten ¶
func (*EthReader) RecommendedGasPriceTomo ¶
func (*EthReader) TransactionByHash ¶
func (*EthReader) TransactionReceipt ¶
type EthereumNode ¶ added in v0.2.1
type EthereumNode interface { NodeName() string NodeURL() string EstimateGas(from, to string, priceGwei, value float64, data []byte) (gas uint64, err error) GetCode(address string) (code []byte, err error) GetBalance(address string) (balance *big.Int, err error) GetMinedNonce(address string) (nonce uint64, err error) GetPendingNonce(address string) (nonce uint64, err error) TransactionReceipt(txHash string) (receipt *types.Receipt, err error) TransactionByHash(txHash string) (tx *eu.Transaction, isPending bool, err error) // Call(result interface{}, method string, args ...interface{}) error ReadContractToBytes(atBlock int64, caddr string, abi *abi.ABI, method string, args ...interface{}) ([]byte, error) HeaderByNumber(number int64) (*types.Header, error) GetLogs(fromBlock, toBlock int, addresses []string, topic string) ([]types.Log, error) CurrentBlock() (uint64, error) }
type OneNodeReader ¶ added in v0.2.1
type OneNodeReader struct {
// contains filtered or unexported fields
}
func NewOneNodeReader ¶ added in v0.2.1
func NewOneNodeReader(name, url string) *OneNodeReader
func (*OneNodeReader) Client ¶ added in v0.2.1
func (self *OneNodeReader) Client() (*rpc.Client, error)
func (*OneNodeReader) CurrentBlock ¶ added in v0.3.0
func (self *OneNodeReader) CurrentBlock() (uint64, error)
func (*OneNodeReader) EstimateGas ¶ added in v0.2.1
func (*OneNodeReader) EthClient ¶ added in v0.2.1
func (self *OneNodeReader) EthClient() (*ethclient.Client, error)
func (*OneNodeReader) GetBalance ¶ added in v0.2.1
func (self *OneNodeReader) GetBalance(address string) (balance *big.Int, err error)
func (*OneNodeReader) GetCode ¶ added in v0.2.1
func (self *OneNodeReader) GetCode(address string) (code []byte, err error)
func (*OneNodeReader) GetMinedNonce ¶ added in v0.2.1
func (self *OneNodeReader) GetMinedNonce(address string) (nonce uint64, err error)
func (*OneNodeReader) GetPendingNonce ¶ added in v0.2.1
func (self *OneNodeReader) GetPendingNonce(address string) (nonce uint64, err error)
func (*OneNodeReader) HeaderByNumber ¶ added in v0.2.1
func (self *OneNodeReader) HeaderByNumber(number int64) (*types.Header, error)
func (*OneNodeReader) NodeName ¶ added in v0.2.1
func (self *OneNodeReader) NodeName() string
func (*OneNodeReader) NodeURL ¶ added in v0.2.1
func (self *OneNodeReader) NodeURL() string
func (*OneNodeReader) ReadContractToBytes ¶ added in v0.2.1
func (*OneNodeReader) TransactionByHash ¶ added in v0.2.1
func (self *OneNodeReader) TransactionByHash(txHash string) (tx *eu.Transaction, isPending bool, err error)
func (*OneNodeReader) TransactionReceipt ¶ added in v0.2.1
func (self *OneNodeReader) TransactionReceipt(txHash string) (receipt *types.Receipt, err error)
Click to show internal directories.
Click to hide internal directories.