# eth

import "github.com/rocket-pool/rocketpool-go/utils/eth"

# Index

# Constants

Conversion factors

const (
    WeiPerEth  float64 = 1e18
    WeiPerGwei float64 = 1e9
)

# func EstimateSendTransactionGas (opens new window)

func EstimateSendTransactionGas(client *ethclient.Client, toAddress common.Address, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of SendTransaction

# func EthToWei (opens new window)

func EthToWei(eth float64) *big.Int

Convert eth to wei

# func FilterContractLogs (opens new window)

func FilterContractLogs(rp *rocketpool.RocketPool, contractName string, q FilterQuery, intervalSize *big.Int) ([]types.Log, error)

# func GetLogs (opens new window)

func GetLogs(rp *rocketpool.RocketPool, addressFilter []common.Address, topicFilter [][]common.Hash, intervalSize, fromBlock, toBlock *big.Int, blockHash *common.Hash) ([]types.Log, error)

Gets the logs for a particular log request, breaking the calls into batches if necessary

# func GweiToWei (opens new window)

func GweiToWei(gwei float64) *big.Int

Convert gigawei to wei

# func SendTransaction (opens new window)

func SendTransaction(client *ethclient.Client, toAddress common.Address, opts *bind.TransactOpts) (common.Hash, error)

Send a transaction to an address

# func WeiToEth (opens new window)

func WeiToEth(wei *big.Int) float64

Convert wei to eth

# func WeiToGwei (opens new window)

func WeiToGwei(wei *big.Int) float64

Convert wei to gigawei

# type FilterQuery (opens new window)

type FilterQuery struct {
    BlockHash *common.Hash
    FromBlock *big.Int
    ToBlock   *big.Int
    Topics    [][]common.Hash
}