quaiclient

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: GPL-3.0 Imports: 12 Imported by: 3

Documentation

Overview

Package ethclient provides a client for the Quai RPC API.

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 Quai RPC API.

func Dial

func Dial(rawurl string, logger *log.Logger) (*Client, error)

Dial connects a client to the given URL.

func DialContext

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

func NewClient

func NewClient(c *rpc.Client) *Client

NewClient creates a client that uses the given RPC client.

func (*Client) BaseFee added in v0.29.0

func (ec *Client) BaseFee(ctx context.Context, txType bool) (*big.Int, error)

BaseFee returns the base fee for a tx to be included in the next block. If txType is set to "true" returns the Quai base fee in units of Wei. If txType is set to "false" returns the Qi base fee in units of Qit.

func (*Client) CalcOrder added in v0.31.0

func (ec *Client) CalcOrder(ctx context.Context, header *types.WorkObject) (int, error)

func (*Client) Close

func (ec *Client) Close()

func (*Client) EstimateGas added in v0.29.0

func (ec *Client) EstimateGas(ctx context.Context, msg quai.CallMsg) (uint64, error)

EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.

func (*Client) FilterLogs added in v0.28.0

func (ec *Client) FilterLogs(ctx context.Context, q quai.FilterQuery) ([]types.Log, error)

FilterLogs executes a filter query.

func (*Client) GetPendingHeader added in v0.28.0

func (ec *Client) GetPendingHeader(ctx context.Context) (*types.WorkObject, error)

GetPendingHeader gets the latest pending header from the chain.

func (*Client) GetWorkShareThreshold added in v0.32.0

func (ec *Client) GetWorkShareThreshold(ctx context.Context) (int, error)

func (*Client) HeaderByHash

func (ec *Client) HeaderByHash(ctx context.Context, hash common.Hash) *types.Header

func (*Client) HeaderByNumber

func (ec *Client) HeaderByNumber(ctx context.Context, number string) *types.Header

func (*Client) QiRateAtBlock added in v0.29.0

func (ec *Client) QiRateAtBlock(ctx context.Context, block interface{}) (*big.Int, error)

QiRateAtBlock returns the number of Quai needed for a Qi at a given block number or hash.

func (*Client) QuaiRateAtBlock added in v0.29.0

func (ec *Client) QuaiRateAtBlock(ctx context.Context, block interface{}) (*big.Int, error)

QuaiRateAtBlock returns the number of Qi needed for a Quai at a given block number or hash.

func (*Client) ReceiveMinedHeader added in v0.28.0

func (ec *Client) ReceiveMinedHeader(ctx context.Context, header *types.WorkObject) error

ReceiveMinedHeader sends a mined block back to the node

func (*Client) ReceiveWorkShare added in v0.29.0

func (ec *Client) ReceiveWorkShare(ctx context.Context, header *types.WorkObjectHeader) error

func (*Client) SubmitSubWorkshare added in v0.32.0

func (ec *Client) SubmitSubWorkshare(ctx context.Context, wo *types.WorkObject) error

Submits a minimally worked workshare to the client node

func (*Client) SubscribeFilterLogs added in v0.28.0

func (ec *Client) SubscribeFilterLogs(ctx context.Context, q quai.FilterQuery, ch chan<- types.Log) (quai.Subscription, error)

SubscribeFilterLogs subscribes to the results of a streaming filter query.

func (*Client) SubscribePendingHeader added in v0.28.0

func (ec *Client) SubscribePendingHeader(ctx context.Context, ch chan<- []byte) (quai.Subscription, error)

SubscribePendingHeader subscribes to notifications about the current pending block on the node.

func (*Client) TxPoolStatus added in v0.30.0

func (ec *Client) TxPoolStatus(ctx context.Context) (map[string]hexutil.Uint, error)

Directories

Path Synopsis
Package ethclient provides a client for the Quai RPC API.
Package ethclient provides a client for the Quai RPC API.

Jump to

Keyboard shortcuts

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