Documentation ¶
Index ¶
- Constants
- Variables
- type Bundle
- func (b *Bundle) AddTransaction(tx *types.Transaction)
- func (b *Bundle) AddTransactions(txs []*types.Transaction)
- func (b *Bundle) Builders() []string
- func (b *Bundle) BundleHash() common.Hash
- func (b *Bundle) Copy() *Bundle
- func (b *Bundle) GetBundelsForNextNBlocks(n uint64) ([]*Bundle, error)
- func (b *Bundle) MaxTimestamp() int64
- func (b *Bundle) MaximumGasFeePaid() (feePaid *big.Int)
- func (b *Bundle) MinTimestamp() int64
- func (b *Bundle) ReplacementUuid() string
- func (b *Bundle) RevertingTxHashes() []string
- func (b *Bundle) SetMaxTimestamp(maxTimestamp int64) error
- func (b *Bundle) SetMinTimestamp(minTimestamp int64) error
- func (b *Bundle) SetReplacementUuid(replacementUuid string) error
- func (b *Bundle) SetRevertingTxHash(revertingTxHash string)
- func (b *Bundle) SetRevertingTxHashes(revertingTxHashes []string)
- func (b *Bundle) SetTargetBlockNumber(blocknumber uint64) error
- func (b *Bundle) TargetBlockNumber() uint64
- func (b *Bundle) Transactions() []*types.Transaction
- func (b *Bundle) UseAllBuilders(networkId uint64)
- type BundleStats
- type BundleStatsV2
- type ErrorType
- type FlasbotsNetork
- type FlashbotsClient
- func (client *FlashbotsClient) Call(method string, params ...interface{}) (json.RawMessage, error)
- func (client *FlashbotsClient) CallWithAditionalHeaders(method string, headers map[string]string, params ...interface{}) (json.RawMessage, error)
- func (client *FlashbotsClient) CancelBundle(uuid string) error
- func (client *FlashbotsClient) CheckBundleIncusion(ctx context.Context, bundle *Bundle) (bool, error)
- func (client *FlashbotsClient) GetBundleStats(bundle *Bundle) (*BundleStats, error)
- func (client *FlashbotsClient) GetBundleStatsV2(bundle *Bundle) (*BundleStatsV2, error)
- func (client *FlashbotsClient) GetSbundleStats(bundle *Bundle) (*BundleStats, error)
- func (client *FlashbotsClient) SendBundle(bundle *Bundle) (common.Hash, bool, error)
- func (client *FlashbotsClient) SendBundleAndWait(ctx context.Context, bundle *Bundle) (bool, error)
- func (client *FlashbotsClient) SendBundleNTimes(originalBundle *Bundle, n uint64) (bundlesToSend []*Bundle, hash common.Hash, smart bool, err error)
- func (client *FlashbotsClient) SendNBundleAndWait(ctx context.Context, bundle *Bundle, n uint64) (bool, error)
- func (client *FlashbotsClient) SimulateBundle(bundle *Bundle, stateBlocknumber uint64) (*SimulationResultBundle, bool, error)
- func (client *FlashbotsClient) UpdateFeeRefundRecipient(newFeeRefundRecipient common.Address) error
- func (client *FlashbotsClient) WaitForBundleInclusion(ctx context.Context, bundle *Bundle) (bool, error)
- type RawSimulationResultBundle
- type RawSimulationResultTransaction
- type Request
- type Response
- type SimulationResultBundle
- type SimulationResultTransaction
Constants ¶
const ( JsonRpcParseError = -32700 JsonRpcInvalidRequest = -32600 JsonRpcMethodNotFound = -32601 JsonRpcInvalidParams = -32602 JsonRpcInternalError = -32603 )
Variables ¶
var AllBuilders = []string{
"flashbots",
"f1b.io",
"rsync",
"beaverbuild.org",
"builder0x69",
"Titan",
"EigenPhi",
"boba-builder",
"Gambit Labs",
"payload",
"Loki",
"BuildAI",
"JetBuilder",
"tbuilder",
"penguinbuild",
"bobthebuilder",
"BTCS",
"bloXroute",
"Blockbeelder",
}
var FlashbotsUrlPerNetwork = map[uint64]string{
1: "https://relay.flashbots.net",
5: "https://relay-goerli.flashbots.net",
11155111: "https://relay-sepolia.flashbots.net",
17000: "https://relay-holesky.flashbots.net",
}
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
func NewBundleWithTransactions ¶
func NewBundleWithTransactions(transactions []*types.Transaction) *Bundle
func (*Bundle) AddTransaction ¶
func (b *Bundle) AddTransaction(tx *types.Transaction)
func (*Bundle) AddTransactions ¶
func (b *Bundle) AddTransactions(txs []*types.Transaction)
func (*Bundle) BundleHash ¶
func (*Bundle) GetBundelsForNextNBlocks ¶ added in v0.2.0
func (*Bundle) MaxTimestamp ¶
func (*Bundle) MaximumGasFeePaid ¶
func (*Bundle) MinTimestamp ¶
func (*Bundle) ReplacementUuid ¶
func (*Bundle) RevertingTxHashes ¶
func (*Bundle) SetMaxTimestamp ¶
SetMaxTimestamp sets the maximum timestamp for which this bundle is valid, in seconds since the unix epoch
func (*Bundle) SetMinTimestamp ¶
SetMinTimestamp sets the minimum timestamp for which this bundle is valid, in seconds since the unix epoch
func (*Bundle) SetReplacementUuid ¶
SetReplacementUuid sets the replacement UUID for this bundle that can be used to cancel/replace this bundle
func (*Bundle) SetRevertingTxHash ¶
SetRevertingTxHash sets one transaction hash that is allowed to revert
func (*Bundle) SetRevertingTxHashes ¶
SetRevertingTxHashes sets the list of transaction hashes that are allowed to revert
func (*Bundle) SetTargetBlockNumber ¶ added in v0.2.0
SetBlockNumber sets the block number for which this bundle is valid If set to 0, the bundle is valid for the next block
func (*Bundle) TargetBlockNumber ¶ added in v0.2.0
func (*Bundle) Transactions ¶
func (b *Bundle) Transactions() []*types.Transaction
func (*Bundle) UseAllBuilders ¶ added in v0.1.1
type BundleStats ¶ added in v0.3.0
type BundleStats struct { IsHighPriority bool `json:"isHighPriority"` IsSimulated bool `json:"isSimulated"` SimulatedAt string `json:"simulatedAt"` ReceivedAt string `json:"receivedAt"` ConsideredByBuilders []struct { Pubkey string `json:"pubkey"` Timestamp string `json:"timestamp"` } `json:"consideredByBuildersAt"` SealedByBuilders []struct { Pubkey string `json:"pubkey"` Timestamp string `json:"timestamp"` } `json:"sealedByBuildersAt"` }
type BundleStatsV2 ¶ added in v0.2.0
type BundleStatsV2 struct { IsHighPriority bool `json:"isHighPriority"` IsSimulated bool `json:"isSimulated"` SimulatedAt string `json:"simulatedAt"` ReceivedAt string `json:"receivedAt"` ConsideredByBuilders []struct { Pubkey string `json:"pubkey"` Timestamp string `json:"timestamp"` } `json:"consideredByBuildersAt"` SealedByBuilders []struct { Pubkey string `json:"pubkey"` Timestamp string `json:"timestamp"` } `json:"sealedByBuildersAt"` }
type FlasbotsNetork ¶
type FlasbotsNetork string
type FlashbotsClient ¶
type FlashbotsClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(logger *slog.Logger, ethRpc *ethclient.Client, searcherSecret *ecdsa.PrivateKey) (*FlashbotsClient, error)
func NewClientRpcString ¶ added in v0.2.0
func NewClientRpcString(logger *slog.Logger, ethRpcStr string, searcherSecret *ecdsa.PrivateKey) (*FlashbotsClient, error)
func (*FlashbotsClient) Call ¶
func (client *FlashbotsClient) Call(method string, params ...interface{}) (json.RawMessage, error)
func (*FlashbotsClient) CallWithAditionalHeaders ¶
func (client *FlashbotsClient) CallWithAditionalHeaders(method string, headers map[string]string, params ...interface{}) (json.RawMessage, error)
func (*FlashbotsClient) CancelBundle ¶ added in v0.2.0
func (client *FlashbotsClient) CancelBundle(uuid string) error
func (*FlashbotsClient) CheckBundleIncusion ¶ added in v0.2.0
func (*FlashbotsClient) GetBundleStats ¶ added in v0.3.0
func (client *FlashbotsClient) GetBundleStats(bundle *Bundle) (*BundleStats, error)
func (*FlashbotsClient) GetBundleStatsV2 ¶ added in v0.2.0
func (client *FlashbotsClient) GetBundleStatsV2(bundle *Bundle) (*BundleStatsV2, error)
func (*FlashbotsClient) GetSbundleStats ¶ added in v0.3.0
func (client *FlashbotsClient) GetSbundleStats(bundle *Bundle) (*BundleStats, error)
func (*FlashbotsClient) SendBundle ¶
func (*FlashbotsClient) SendBundleAndWait ¶ added in v0.3.0
func (*FlashbotsClient) SendBundleNTimes ¶ added in v0.3.0
func (*FlashbotsClient) SendNBundleAndWait ¶ added in v0.3.0
func (*FlashbotsClient) SimulateBundle ¶
func (client *FlashbotsClient) SimulateBundle(bundle *Bundle, stateBlocknumber uint64) (*SimulationResultBundle, bool, error)
SimulateBundle simulates the execution of a bundle The stateBlocknumber parameter is the block number at which the simulation should start, 0 for the current block
func (*FlashbotsClient) UpdateFeeRefundRecipient ¶
func (client *FlashbotsClient) UpdateFeeRefundRecipient(newFeeRefundRecipient common.Address) error
func (*FlashbotsClient) WaitForBundleInclusion ¶
func (client *FlashbotsClient) WaitForBundleInclusion(ctx context.Context, bundle *Bundle) (bool, error)
WaitForBundleInclusion waits for a bundle to be included in a block
type RawSimulationResultTransaction ¶
type RawSimulationResultTransaction struct { CoinbaseDiff string `json:"coinbaseDiff"` EthSentToCoinbase string `json:"ethSentToCoinbase"` FromAddress string `json:"fromAddress"` GasFees string `json:"gasFees"` GasPrice string `json:"gasPrice"` GasUsed uint64 `json:"gasUsed"` ToAddress string `json:"toAddress"` TxHash string `json:"txHash"` Value string `json:"value"` // revert related Error string `json:"error"` RevertReason string `json:"revert"` }
type Response ¶
type Response struct { ID int `json:"id"` JSONRPC string `json:"jsonrpc"` Result json.RawMessage `json:"result"` Error ErrorType `json:"error"` }
type SimulationResultBundle ¶
type SimulationResultTransaction ¶
type SimulationResultTransaction struct { CoinbaseDiff *big.Int `json:"coinbaseDiff"` EthSentToCoinbase *big.Int `json:"ethSentToCoinbase"` FromAddress common.Address `json:"fromAddress"` GasFees *big.Int `json:"gasFees"` GasPrice *big.Int `json:"gasPrice"` GasUsed uint64 `json:"gasUsed"` ToAddress common.Address `json:"toAddress"` TxHash common.Hash `json:"txHash"` Value *big.Int `json:"value"` // revert related Error string `json:"error"` RevertReason string `json:"revert"` }