eth

package
v0.0.0-...-bf51fc3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	BlockNum int64
	Txs      []Tx
}

func (Block) TxList

func (b Block) TxList() []string

type Client

type Client struct {
	EIPSigner types.EIP155Signer
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conf Config) *Client

func (*Client) BlockByNumber

func (c *Client) BlockByNumber(blockNum *big.Int) (*types.Block, error)

func (*Client) Dial

func (c *Client) Dial() error

func (*Client) FetchBlocks

func (c *Client) FetchBlocks() <-chan *types.Block

func (*Client) HeaderBlockNum

func (c *Client) HeaderBlockNum() (*big.Int, error)

func (*Client) ParseBlocks

func (c *Client) ParseBlocks(in <-chan *types.Block) <-chan Block

type Config

type Config struct {
	URL        string        `mapstructure:"ETH_URL" valid:"url,required"`
	RequestTTL time.Duration `valid:"-"`
	FromBlock  *big.Int      `mapstructure:"ETH_FROM_BLOCK" valid:"-"`
}

func (Config) Validate

func (c Config) Validate() error

type Tx

type Tx struct {
	BlockNum int64
	ID       string
	From     string
	To       string
	Value    *big.Int
}

Jump to

Keyboard shortcuts

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