rpc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package rpc is the RPC Client for `mev` api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

RPC client

func (*Client) CallWithSig

func (c *Client) CallWithSig(method string, params ...interface{}) ([]byte, error)

Does api requests with Flashbots signature header returns the body

func (*Client) SendBundle

func (c *Client) SendBundle(bundle SendMevBundleArgs) (*mevshare.SendMevBundleResponse, error)

Send mev-share bundle ~`mev_sendBundle` bundle - the bundle with all transactions / hashes returns the bundle hash / error

func (*Client) SendPrivateTransaction

func (c *Client) SendPrivateTransaction(signedRawTx string, options *PrivateTxOptions) (*common.Hash, error)

Send private transaction ~`eth_sendPrivateTransaction` signedRawTx - transaction with nonce and vrs values options - options for private tx hints, builders, inclution, etc... returns the Transaction hash of the sent transaction

func (*Client) SimBundle

Simulate bundle ~`mev_simBundle` bundle - the bundle with all transactions / hashes simOverrides - given values will be overwritten when doing the simulation returns the simulation result / error

type HintIntent added in v0.3.0

type HintIntent = mevshare.HintIntent

type Hints

type Hints struct {
	CallData         bool
	ContractAddress  bool
	FunctionSelector bool
	Logs             bool
	DefaultLogs      bool
	TxHash           bool
}

Hints represents hints for privacy preferences

func (*Hints) String

func (h *Hints) String() []string

type Inclusion

type Inclusion = mevshare.MevBundleInclusion

type MetaData added in v0.3.0

type MetaData = mevshare.MevBundleMetadata

type MevAPIClient added in v0.3.0

type MevAPIClient interface {
	// MEV-Share Api Requests with Flashbots signature header
	CallWithSig(method string, params ...interface{}) ([]byte, error)
	// Send bundle tom mev-share node
	SendBundle(bundle mevshare.SendMevBundleArgs) (*mevshare.SendMevBundleResponse, error)
	// Bundle simulation
	SimBundle(bundle mevshare.SendMevBundleArgs, simOverrides mevshare.SimMevBundleAuxArgs) (*mevshare.SimMevBundleResponse, error)
	// Send private transaction with hints
	SendPrivateTransaction(signedRawTx string, options *PrivateTxOptions) (*common.Hash, error)
}

MevAPIClient is the MEV-Share Client abstraction

func NewClient

func NewClient(clientURL string, auth *ecdsa.PrivateKey) MevAPIClient

NewClient creates a new instance of the API client

type MevBundleBody added in v0.3.0

type MevBundleBody = mevshare.MevBundleBody

type Privacy added in v0.3.0

type Privacy = mevshare.MevBundlePrivacy

type PrivateTxOptions

type PrivateTxOptions struct {
	Hints          Hints
	MaxBlockNumber hexutil.Uint64
	Builders       []string
}

`eth_sendPrivateTransaction` parameters

type Refund

type Refund = mevshare.RefundConstraint

type RefundConfig

type RefundConfig = mevshare.RefundConfig

type SendMevBundleArgs added in v0.3.0

type SendMevBundleArgs = mevshare.SendMevBundleArgs

type SendMevBundleResponse added in v0.3.0

type SendMevBundleResponse = mevshare.SendMevBundleResponse

type SignedRawTx

type SignedRawTx struct {
	Tx        string `json:"tx,omitempty"`
	CanRevert bool   `json:"canRevert,omitempty"`
}

Regular transaction

type SimMevBundleAuxArgs added in v0.3.0

type SimMevBundleAuxArgs = mevshare.SimMevBundleAuxArgs

type SimMevBundleResponse added in v0.3.0

type SimMevBundleResponse = mevshare.SimMevBundleResponse

type Validity

type Validity = mevshare.MevBundleValidity

Jump to

Keyboard shortcuts

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