Documentation ¶
Overview ¶
Package rpc is the RPC Client for `mev` api
Index ¶
- type Client
- func (c *Client) CallWithSig(method string, params ...interface{}) ([]byte, error)
- func (c *Client) SendBundle(bundle SendMevBundleArgs) (*mevshare.SendMevBundleResponse, error)
- func (c *Client) SendPrivateTransaction(signedRawTx string, options *PrivateTxOptions) (*common.Hash, error)
- func (c *Client) SimBundle(bundle mevshare.SendMevBundleArgs, simOverrides mevshare.SimMevBundleAuxArgs) (*mevshare.SimMevBundleResponse, error)
- type HintIntent
- type Hints
- type Inclusion
- type MetaData
- type MevAPIClient
- type MevBundleBody
- type Privacy
- type PrivateTxOptions
- type Refund
- type RefundConfig
- type SendMevBundleArgs
- type SendMevBundleResponse
- type SignedRawTx
- type SimMevBundleAuxArgs
- type SimMevBundleResponse
- type Validity
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 ¶
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 ¶
func (c *Client) SimBundle(bundle mevshare.SendMevBundleArgs, simOverrides mevshare.SimMevBundleAuxArgs) (*mevshare.SimMevBundleResponse, error)
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
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 ¶
`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