newtonclient

package
v0.0.0-...-cd98764 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package newtonclient provides a client for the NewChain RPC API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseInfo

type BaseInfo struct {
	GasPrice     *big.Int `json:"gasPrice"`
	NetworkID    uint64   `json:"networkID"`
	NonceLatest  uint64   `json:"nonceLatest"`
	NoncePending uint64   `json:"noncePending"`
	Balance      *big.Int `json:"balance"`
}

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 DialContext

func DialContext(ctx context.Context, rawurl string) (*Client, error)

func NewClient

func NewClient(c *rpc.Client) *Client

NewClient creates a client that uses the given RPC client.

func (*Client) Close

func (ec *Client) Close()

func (*Client) GetBaseInfo

func (ec *Client) GetBaseInfo(ctx context.Context, account common.Address) (*BaseInfo, error)

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

func (*Client) SendRawTransaction

func (ec *Client) SendRawTransaction(ctx context.Context, tx *types.Transaction, wait uint64) (common.Hash, error)

SendRawTransaction injects a signed transaction into the pending pool for execution.

func (*Client) SendTransaction

func (ec *Client) SendTransaction(ctx context.Context, rlpTx, signature []byte, from common.Address, wait uint64) (common.Hash, error)

SendTransaction injects a signed transaction into the pending pool for execution.

Jump to

Keyboard shortcuts

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