rpc

package
v0.0.0-...-cb32465 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlocksFromLogs

func GetBlocksFromLogs(logs []types.Log) []uint64

func GetBlocksTimestamp

func GetBlocksTimestamp(rpc *Client, blockNumbers []uint64) map[uint64]time.Time

func GetFilters

func GetFilters(start uint64, end uint64) ethereum.FilterQuery

func GetLatestBlockNumber

func GetLatestBlockNumber(rpc *Client) uint64

func GetLogs

func GetLogs(rpc *Client, filter ethereum.FilterQuery) []types.Log

func WeiToEther

func WeiToEther(wei *big.Int) *big.Float

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) Close

func (rpc *Client) Close()

func (*Client) GetClient

func (rpc *Client) GetClient() *ethclient.Client

type Sale

type Sale struct {
	TxHash     string
	ID         int
	StartPrice float64
	EndPrice   float64
	Timestamp  time.Time
}

func GetSaleFromTx

func GetSaleFromTx(tx *types.Transaction) (string, Sale)

func GetSalesFromLogs

func GetSalesFromLogs(rpc *Client, blocksTimestamp map[uint64]time.Time, logs []types.Log) []Sale

Jump to

Keyboard shortcuts

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