transaction

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: GPL-3.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRawHandleOps

func CreateRawHandleOps(opts *Opts) (string, error)

CreateRawHandleOps returns a raw transaction string that calls handleOps() on the EntryPoint with a given batch, gas limit, and tip.

func EstimateHandleOpsGas

func EstimateHandleOpsGas(opts *Opts) (gas uint64, revert *reverts.FailedOpRevert, err error)

EstimateHandleOpsGas returns a gas estimate required to call handleOps() with a given batch. A failed call will return the cause of the revert.

func HandleOps

func HandleOps(opts *Opts) (txn *types.Transaction, err error)

HandleOps submits a transaction to send a batch of UserOperations to the EntryPoint.

func SuggestMeanGasFeeCap added in v0.6.5

func SuggestMeanGasFeeCap(basefee *big.Int, tip *big.Int, batch []*userop.UserOperation) *big.Int

SuggestMeanGasFeeCap suggests a Max Fee for an EIP-1559 transaction to submit a batch of UserOperations to the EntryPoint. It returns the larger value between the recommended max fee or the average maxFeePerGas of the entire batch.

func SuggestMeanGasPrice added in v0.6.5

func SuggestMeanGasPrice(gasPrice *big.Int, batch []*userop.UserOperation) *big.Int

SuggestMeanGasPrice suggests a Gas Price for a legacy transaction to submit a batch of UserOperations to the EntryPoint. It returns the larger value between a given gas price or the average maxFeePerGas of the entire batch.

func SuggestMeanGasTipCap added in v0.6.5

func SuggestMeanGasTipCap(tip *big.Int, batch []*userop.UserOperation) *big.Int

SuggestMeanGasTipCap suggests a Max Priority Fee for an EIP-1559 transaction to submit a batch of UserOperations to the EntryPoint. It returns the larger value between the suggested gas tip or the average maxPriorityFeePerGas of the entire batch.

Types

type Opts added in v0.6.5

type Opts struct {
	// Options for the network
	EOA     *signer.EOA
	Eth     *ethclient.Client
	ChainID *big.Int

	// Options for the EntryPoint
	EntryPoint  common.Address
	Batch       []*userop.UserOperation
	Beneficiary common.Address

	// Options for the EOA transaction
	BaseFee     *big.Int
	Tip         *big.Int
	GasPrice    *big.Int
	GasLimit    uint64
	WaitTimeout time.Duration
}

Opts contains all the fields required for submitting a transaction to call HandleOps on the EntryPoint contract.

Jump to

Keyboard shortcuts

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