Documentation
¶
Overview ¶
Package ethereum implements interface for ethereum networks.
Index ¶
- type Ethereum
- func (e *Ethereum) AvgBlock() int
- func (e *Ethereum) Balance(address, token string) (ethBal, tokBal *big.Int, err error)
- func (e *Ethereum) Close()
- func (e *Ethereum) DecodeBlock(t interface{}) (types.Block, error)
- func (e *Ethereum) DecodeTxs(t interface{}) (txs []types.Trans, err error)
- func (e *Ethereum) Get(hash string) (*types.Trans, error)
- func (e *Ethereum) GetBlock(block uint64, full bool, response interface{}) (err error)
- func (e *Ethereum) GetToken(token string) (t types.Token, err error)
- func (e *Ethereum) MaxBlocks() int
- func (e *Ethereum) Send(fromAddress, toAddress, token, amount string, data []byte, key string, ...) (fee *big.Int, hash []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ethereum ¶
type Ethereum struct {
// contains filtered or unexported fields
}
Ethereum implements a connection to an ethereum-type chain.
func Init ¶
Init returns a connection to an ethereum node, using secret if necessary for authentication. maxBlocks is required to indicate how many blocks will be taken into account for uncle management.
func (*Ethereum) Balance ¶
Balance loads the ether balance, and the token balance if specified, onto the provided big.Int pointers, or error otherwise.
func (*Ethereum) DecodeBlock ¶
DecodeBlock returns a struct with the values from the block data. It is used after a call to GetBlock.
func (*Ethereum) DecodeTxs ¶
DecodeTxs returns a slice of transactions from the block data. It is used after a call to GetBlock.
func (*Ethereum) GetBlock ¶
GetBlock returns in response the block number requested. If full, it provides all the details of the transactions.
func (*Ethereum) MaxBlocks ¶
MaxBlocks returns how many blocks will be taken into account for uncle management.
func (*Ethereum) Send ¶
func (e *Ethereum) Send(fromAddress, toAddress, token, amount string, data []byte, key string, priceIn uint64, dryRun bool) (fee *big.Int, hash []byte, err error)
Send executes a transaction in the blockchain with the given parameters returning the expected fee, the transaction hash or an error otherwise. If 'dryRun' is true, the transaction will not be sent to the blockchain but still a valid hash will be returned.