txmgr

package
v0.0.0-...-5cda5f8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcGasFeeCap

func CalcGasFeeCap(baseFee, gasTipCap *big.Int) *big.Int

func WaitMined

func WaitMined(
	ctx context.Context,
	backend ReceiptSource,
	tx *types.Transaction,
	queryInterval time.Duration,
	numConfirmations uint64,
) (*types.Receipt, error)

Types

type Config

type Config struct {
	ResubmissionTimeout       time.Duration
	ReceiptQueryInterval      time.Duration
	NumConfirmations          uint64
	SafeAbortNonceTooLowCount uint64
}

type ReceiptSource

type ReceiptSource interface {
	BlockNumber(ctx context.Context) (uint64, error)
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
}

type SendState

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

func NewSendState

func NewSendState(safeAbortNonceTooLowCount uint64) *SendState

func (*SendState) IsWaitingForConfirmation

func (s *SendState) IsWaitingForConfirmation() bool

func (*SendState) ProcessSendError

func (s *SendState) ProcessSendError(err error)

func (*SendState) ShouldAbortImmediately

func (s *SendState) ShouldAbortImmediately() bool

func (*SendState) TxMined

func (s *SendState) TxMined(txHash common.Hash)

func (*SendState) TxNotMined

func (s *SendState) TxNotMined(txHash common.Hash)

type SendTransactionFunc

type SendTransactionFunc = func(ctx context.Context, tx *types.Transaction) error

type SimpleTxManager

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

func NewSimpleTxManager

func NewSimpleTxManager(cfg Config, backend ReceiptSource) *SimpleTxManager

func (*SimpleTxManager) Send

func (m *SimpleTxManager) Send(ctx context.Context, updateGasPrice UpdateGasPriceFunc, sendTx SendTransactionFunc) (*types.Receipt, error)

type TxManager

type TxManager interface {
	Send(ctx context.Context, updateGasPrice UpdateGasPriceFunc, sendTxn SendTransactionFunc) (*types.Receipt, error)
}

type UpdateGasPriceFunc

type UpdateGasPriceFunc = func(ctx context.Context) (*types.Transaction, error)

Jump to

Keyboard shortcuts

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