flashbot

package module
v0.0.0-...-0dd1e0f Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

Overview

Blockchain helper built with Flashbot, Ethereum is a dark forest, FlashbotLaunch helps users hide transaction information and bundle transactions. Currently in beta, it's a good place to start, launch 🚀🚀🚀

Documentation

Index

Constants

View Source
const (
	// `eth_sendBundle` can be used to send your bundles to the Flashbots builder.
	MethodSendBundle = "eth_sendBundle"

	// eth_callBundle can be used to simulate a bundle against a specific block number,
	// including simulating a bundle at the top of the next block.
	MethodCallBundle = "eth_callBundle"

	// `eth_sendPrivateTransaction` used to send a single transaction to Flashbots.
	MethodSendPrivateTransaction = "eth_sendPrivateTransaction"

	// `eth_cancelPrivateTransaction` Method stops private
	// transactions from being submitted for future blocks.
	MethodCancelPrivateTransaction = "eth_cancelPrivateTransaction"

	MethodEstimateGasBundle = "eth_estimateGasBundle"
	MethodGetUserStats      = "flashbots_getUserStats"
	MethodGetBundleStats    = "flashbots_getBundleStats"
)

Variables

This section is empty.

Functions

func HexToECDSA

func HexToECDSA(privateKey string) *ecdsa.PrivateKey

func HextoBlockNumber

func HextoBlockNumber(blockNumber uint64) string

func RelayDefaultRPC

func RelayDefaultRPC(netType string) (string, error)

Types

type CallBundleParams

type CallBundleParams struct {
	Transactions     []string `json:"txs"`
	BlockNumber      string   `json:"blockNumber"`
	StateBlockNumber string   `json:"stateBlockNumber"`
	Timestamp        int64    `json:"timestamp,omitempty"`
}

############

callBundle

############

type CallBundleResponse

type CallBundleResponse struct {
	ID         uint         `json:"id"`
	Version    string       `json:"jsonrpc"`
	Result     *callResult  `json:"result"`
	Error      *errorResult `json:"error"`
	Raw        string
	StatusCode int
}

type FlashbotLaunch

type FlashbotLaunch struct {
	Rpc        string
	PrivateKey *ecdsa.PrivateKey
}

func New

func New(relayRPC string) *FlashbotLaunch

func (*FlashbotLaunch) CallBundle

func (f *FlashbotLaunch) CallBundle(transaction []string, blockNumber uint64) (*CallBundleResponse, error)

func (*FlashbotLaunch) GetUserStats

func (f *FlashbotLaunch) GetUserStats(blockNumber uint64) (*UserStatsResponse, error)

func (*FlashbotLaunch) SendBundle

func (f *FlashbotLaunch) SendBundle(transactions []string, blockNumber uint64) (*SendBundleResponse, error)

func (*FlashbotLaunch) SendPrivateTransaction

func (f *FlashbotLaunch) SendPrivateTransaction(tx string, maxBlockNumber string) (*SendPrivateTxResponse, error)

type SendBundleParams

type SendBundleParams struct {
	Transactions      []string `json:"txs"`
	BlockNumber       string   `json:"blockNumber"`
	MinTimestamp      int64    `json:"minTimestamp,omitempty"`
	MaxTimestamp      int64    `json:"maxTimestamp,omitempty"`
	RevertingTxHashes []string `json:"revertingTxHashes,omitempty"`
}

############

sendBundle

############

type SendBundleResponse

type SendBundleResponse struct {
	ID      uint          `json:"id"`
	Version string        `json:"jsonrpc"`
	Result  *bundleResult `json:"result"`
}

type SendPrivateTx

type SendPrivateTx struct {
	Transaction    string          `json:"txs"`
	MaxBlockNumber string          `json:"maxBlockNumber"`
	Preferences    map[string]bool `json:"preferences"`
}

####################

PrivateTransaction

####################

type SendPrivateTxResponse

type SendPrivateTxResponse struct {
	JsonRPC string `json:"jsonrpc"`
	Id      int    `json:"id"`
	Result  string `json:"result"`
}

type UserStatsResponse

type UserStatsResponse struct {
	ID      uint       `json:"id"`
	Version string     `json:"jsonrpc"`
	Result  *userStats `json:"result"`
}

###########

userStats

###########

Jump to

Keyboard shortcuts

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