transaction

package
v0.6.33 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: GPL-3.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

func ToRawTxHex added in v0.6.28

func ToRawTxHex(txn *types.Transaction) string

ToRawTxHex Takes a Geth types.Transaction and returns the encoded raw hex string.

func Wait added in v0.6.28

func Wait(txn *types.Transaction, eth *ethclient.Client, timeout time.Duration) (*types.Transaction, error)

Wait blocks the process until a given transaction has been included on-chain or timeout has been reached.

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
	NoSend      bool
	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