hmyclient

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client defines typed wrappers for the Ethereum RPC API.

func Dial

func Dial(rawurl string) (*Client, error)

Dial connects a client to the given URL.

func NewClient

func NewClient(c *rpc.Client) *Client

NewClient creates a client that uses the given RPC client.

func (*Client) BlockByHash

func (c *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)

BlockByHash returns the given full block.

Note that loading full blocks requires two requests. Use HeaderByHash if you don't need all transactions or uncle headers.

func (*Client) BlockByNumber

func (c *Client) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

BlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.

Note that loading full blocks requires two requests. Use HeaderByNumber if you don't need all transactions or uncle headers.

func (*Client) BlockNumber

func (c *Client) BlockNumber(ctx context.Context) (hexutil.Uint64, error)

BlockNumber returns the block height.

func (*Client) Close

func (c *Client) Close()

Close closes the client

func (*Client) NetworkID

func (c *Client) NetworkID(ctx context.Context) (*big.Int, error)

NetworkID returns the network ID (also known as the chain ID) for this chain.

Jump to

Keyboard shortcuts

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