factory

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

type Batcher interface {
	// BatchRequests creates a batched transaction request for the given call requests.
	BatchRequests(requireSuccess bool, callReqs ...*ethereum.CallMsg) *types.Request

	// BatchCallRequests returns multicall results after executing the given call requests.
	BatchCallRequests(
		ctx context.Context, from common.Address, requireSuccess bool,
		callReqs ...*ethereum.CallMsg,
	) (any, error)
}

Batcher is an interface for batching requests, commonly implemented by multicallers.

type Factory

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

Factory is a transaction factory that builds 1559 transactions with the configured signer.

func New

func New(
	noncer Noncer, batcher Batcher, signer kmstypes.TxSigner, signTxTimeout time.Duration,
	defaultRequireSuccess bool,
) *Factory

New creates a new factory instance.

func (*Factory) BuildTransactionFromRequests

func (f *Factory) BuildTransactionFromRequests(
	ctx context.Context, requests ...*ethereum.CallMsg,
) (*coretypes.Transaction, error)

BuildTransactionFromRequests builds a transaction from a list of requests.

func (*Factory) RebuildTransactionFromRequest

func (f *Factory) RebuildTransactionFromRequest(
	ctx context.Context, request *ethereum.CallMsg, forcedNonce uint64,
) (*coretypes.Transaction, error)

RebuildTransactionFromRequest rebuilds a transaction from a request with the forced nonce.

func (*Factory) SetClient

func (f *Factory) SetClient(ethClient eth.Client)

type Noncer

type Noncer interface {
	Acquire() (uint64, bool)
}

Noncer is an interface for acquiring fresh nonces.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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