builder

package
v0.0.0-...-7be72bc Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package builder implements a module for bundlers to act as MEV searchers and send batches to the AiMiddleware via a Block Builder API that supports eth_sendBundle.

Index

Constants

This section is empty.

Variables

View Source
var (
	// CompatibleChainIDs is a set of chainIDs that support the Block Builder API.
	CompatibleChainIDs = mapset.NewSet(
		config.EthereumChainID.Uint64(),
		config.GoerliChainID.Uint64(),
		config.SepoliaChainID.Uint64(),
	)

	DefaultWaitTimeout = 72 * time.Second

	ErrFlashbotsBroadcastBundle = errors.New("flashbots broadcast bundle error")
)

Functions

This section is empty.

Types

type BuilderClient

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

BuilderClient provides a connection to a block builder API to enable AiOperations to be sent through the mev-boost process.

func New

func New(
	eoa *signer.EOA,
	eth *ethclient.Client,
	fb *flashbotsrpc.BuilderBroadcastRPC,
	beneficiary common.Address,
	blocksInTheFuture int,
) *BuilderClient

New returns an instance of a BuilderClient with modules to send AiOperation bundles via the mev-boost process.

func (*BuilderClient) SendAiOperation

func (b *BuilderClient) SendAiOperation() modules.BatchHandlerFunc

SendAiOperation returns a BatchHandler that is used by the Bundler to send batches to a block builder that supports eth_sendBundle.

func (*BuilderClient) SetWaitTimeout

func (b *BuilderClient) SetWaitTimeout(timeout time.Duration)

SetWaitTimeout sets the total time to wait for a transaction to be included. When a timeout is reached, the BatchHandler will throw an error if the transaction has not been included or has been included but with a failed status.

The default value is 72 seconds. Setting the value to 0 will skip waiting for a transaction to be included.

Jump to

Keyboard shortcuts

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