committer

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EVMCommitter

type EVMCommitter interface {
	FromAddress() ethcmn.Address
	Provider() provider.EVMProvider
	SendTx(
		ctx context.Context,
		recipient ethcmn.Address,
		txData []byte,
		gasCost uint64,
		gasPrice *big.Int,
	) (txHash ethcmn.Hash, err error)

	EstimateGas(
		ctx context.Context,
		recipient ethcmn.Address,
		txData []byte,
	) (gasCost uint64, gasPrice *big.Int, err error)
}

EVMCommitter defines an interface for submitting transactions into Ethereum, Matic, and other EVM-compatible networks.

func NewEthCommitter

func NewEthCommitter(
	logger zerolog.Logger,
	fromAddress ethcmn.Address,
	ethGasPriceAdjustment float64,
	ethGasLimitAdjustment float64,
	fromSigner bind.SignerFn,
	evmProvider provider.EVMProviderWithRet,
	committerOpts ...EVMCommitterOption,
) (EVMCommitter, error)

NewEthCommitter returns an instance of EVMCommitter, which can be used to submit txns into Ethereum, Matic, and other EVM-compatible networks.

type EVMCommitterOption

type EVMCommitterOption func(o *options) error

func OptionGasLimit

func OptionGasLimit(limit uint64) EVMCommitterOption

func OptionGasPriceFromBigInt

func OptionGasPriceFromBigInt(i *big.Int) EVMCommitterOption

func OptionGasPriceFromDecimal

func OptionGasPriceFromDecimal(gasPrice decimal.Decimal) EVMCommitterOption

func OptionGasPriceFromString

func OptionGasPriceFromString(str string) EVMCommitterOption

func TxBroadcastTimeout

func TxBroadcastTimeout(dur time.Duration) EVMCommitterOption

Jump to

Keyboard shortcuts

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