flashbots

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRelayURL = "https://relay.flashbots.net"
	TestRelayURL    = "https://relay-goerli.flashbots.net"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleResult

type BundleResult struct {
	BundleHash string `json:"bundleHash"`
}

type BundleStats

type BundleStats struct {
	IsHighPriority bool   `json:"is_high_priority"`
	IsSimulated    bool   `json:"is_simulated"`
	IsSentToMiners bool   `json:"is_sent_to_miners"`
	SimulatedAt    string `json:"simulated_at"`
	SubmittedAt    string `json:"submitted_at"`
	SentToMinersAt string `json:"sent_to_miners_at"`
}

type CallResult

type CallResult struct {
	BundleGasPrice    string     `json:"bundleGasPrice"`
	BundleHash        string     `json:"bundleHash"`
	CoinbaseDiff      string     `json:"coinbaseDiff"`
	EthSentToCoinbase string     `json:"ethSentToCoinbase"`
	GasFees           string     `json:"gasFees"`
	Results           []txResult `json:"results"`
	StateBlockNumber  uint64     `json:"stateBlockNumber"`
	TotalGasUsed      uint64     `json:"totalGasUsed"`
}

func (*CallResult) EffectiveGasPrice

func (r *CallResult) EffectiveGasPrice() (*big.Int, error)

func (*CallResult) String

func (cr *CallResult) String() string

type FlashBot

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

func NewFlashBot

func NewFlashBot(providerURL, rpcRequestSigner string) (*FlashBot, error)

NewFlashBot, init flashbot instance providerURL: flashbot provider http url rpcRequestSigner: private key for signing request message proxyAddr: http proxy or socks5 proxy addr

func (*FlashBot) CallRawBundle

func (fb *FlashBot) CallRawBundle(transactions []string, blockNumber *big.Int, stateBlockNumber string) (*CallResult, error)

func (*FlashBot) GetBunderStats

func (fb *FlashBot) GetBunderStats(bundleHash string, blockNumber *big.Int) (*BundleStats, error)

func (*FlashBot) GetUserStats

func (fb *FlashBot) GetUserStats(blockNumber *big.Int) (*UserStats, error)

func (*FlashBot) SendBundle

func (fb *FlashBot) SendBundle(txs []*eTypes.Transaction, targetBlockNumber *big.Int) (*BundleResult, error)

func (*FlashBot) SendRawBundle

func (fb *FlashBot) SendRawBundle(transactions []string, targetBlockNumber *big.Int) (*BundleResult, error)

func (*FlashBot) Simulate

func (fb *FlashBot) Simulate(
	txs []*eTypes.Transaction,
	blockNumber *big.Int,
	stateBlockNumber string,
) (*CallResult, error)

func (*FlashBot) SimulateRaw

func (fb *FlashBot) SimulateRaw(
	transactions []string,
	blockNumber *big.Int,
	stateBlockNumber string,
) (*CallResult, error)

type UserStats

type UserStats struct {
	IsHighPriority       bool   `json:"is_high_priority"`
	AllTimeMinerPayments string `json:"all_time_miner_payments"`
	AllTimeGasSimulated  string `json:"all_time_gas_simulated"`
	Last7dMinerPayments  string `json:"last_7d_miner_payments"`
	Last7dGasSimulated   string `json:"last_7d_gas_simulated"`
	Last1dMinerPayments  string `json:"last_1d_miner_payments"`
	Last1dGasSimulated   string `json:"last_1d_gas_simulated"`
}

Jump to

Keyboard shortcuts

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