quaiclient

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 12 Imported by: 2

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) Append

func (ec *Client) Append(ctx context.Context, header *types.WorkObject, manifest types.BlockManifest, domPendingHeader *types.WorkObject, domTerminus common.Hash, domOrigin bool, newInboundEtxs types.Transactions) (types.Transactions, bool, bool, error)

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) Close

func (ec *Client) Close()

func (*Client) DownloadBlocksInManifest added in v0.19.0

func (ec *Client) DownloadBlocksInManifest(ctx context.Context, hash common.Hash, manifest types.BlockManifest, entropy *big.Int)

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) GenerateRecoveryPendingHeader

func (ec *Client) GenerateRecoveryPendingHeader(ctx context.Context, pendingHeader *types.WorkObject, checkpointHashes types.Termini) error

func (*Client) GetManifest

func (ec *Client) GetManifest(ctx context.Context, blockHash common.Hash) (types.BlockManifest, error)

GetManifest will get the block manifest ending with the parent hash

func (*Client) GetPendingEtxsFromSub added in v0.19.0

func (ec *Client) GetPendingEtxsFromSub(ctx context.Context, hash common.Hash, location common.Location) (types.PendingEtxs, error)

GetPendingEtxsFromSub gets the pendingEtxsRollup from the region

func (*Client) GetPendingEtxsRollupFromSub added in v0.19.0

func (ec *Client) GetPendingEtxsRollupFromSub(ctx context.Context, hash common.Hash, location common.Location) (types.PendingEtxsRollup, error)

GetPendingEtxsRollupFromSub gets the pendingEtxsRollup from the region

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) 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) NewGenesisPendingHeader

func (ec *Client) NewGenesisPendingHeader(ctx context.Context, header *types.WorkObject, domTerminus common.Hash, genesisHash common.Hash) error

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) RequestDomToAppendOrFetch

func (ec *Client) RequestDomToAppendOrFetch(ctx context.Context, hash common.Hash, entropy *big.Int, order int)

func (*Client) SendPendingEtxsRollupToDom

func (ec *Client) SendPendingEtxsRollupToDom(ctx context.Context, pEtxsRollup types.PendingEtxsRollup) error

func (*Client) SendPendingEtxsToDom

func (ec *Client) SendPendingEtxsToDom(ctx context.Context, pEtxs types.PendingEtxs) error

func (*Client) SubRelayPendingHeader

func (ec *Client) SubRelayPendingHeader(ctx context.Context, pendingHeader types.PendingHeader, newEntropy *big.Int, location common.Location, subReorg bool, order int)

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<- *types.WorkObject) (quai.Subscription, error)

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

func (*Client) UpdateDom

func (ec *Client) UpdateDom(ctx context.Context, oldTerminus common.Hash, pendingHeader types.PendingHeader, location common.Location)

type Termini

type Termini struct {
	Termini []common.Hash `json:"termini"`
}

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