sender

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BumpGas

BumpGas bumps the gas on a tx by a 15% increase.

func SetNonce

func SetNonce(tx *coretypes.Transaction, nonce uint64) *coretypes.Transaction

SetNonce sets the given nonce on a tx.

Types

type Factory

type Factory interface {
	RebuildTransactionFromRequest(
		context.Context, *ethereum.CallMsg, uint64,
	) (*coretypes.Transaction, error)
}

Factory is an interface for building transactions, used if retrying.

type Noncer

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

Noncer is the interface for acquiring fresh nonces, used if retrying.

type Sender

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

Sender is a component that sends (and retries) transactions to the chain.

func New

func New(factory Factory, noncer Noncer) *Sender

New creates a new Sender with default replacement and exponential retry policies.

func (*Sender) SendTransaction

func (s *Sender) SendTransaction(ctx context.Context, tx *coretypes.Transaction) error

SendTransaction sends a transaction using the Ethereum client. If the transaction fails to send, it retries based on the configured retry policy.

func (*Sender) Setup

func (s *Sender) Setup(chain eth.Client, logger log.Logger)

Jump to

Keyboard shortcuts

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