Documentation ¶
Overview ¶
Package types contains the types used in the JSON-RPC requests and responses.
Index ¶
- Constants
- type BundleResponse
- type GetBundleStatusByTransactionHashResponse
- type HealthResponse
- type JSONRPCError
- type JSONRPCRequest
- type JSONRPCResponse
- type PrivateTxAPIResponse
- type PrivateTxPreferences
- type PrivateTxStatus
- type RefundConfig
- type RelayErrorResponse
- type SendPrivateTxRequestWithPreferences
- type TransactionReceipt
- type TxPrivacyPreferences
- type TxValidityPreferences
Constants ¶
View Source
const ( JSONRPCParseError = -32700 JSONRPCInvalidRequest = -32600 JSONRPCMethodNotFound = -32601 JSONRPCInvalidParams = -32602 JSONRPCInternalError = -32603 )
As per JSON-RPC 2.0 Specification https://www.jsonrpc.org/specification#error_object
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BundleResponse ¶
type GetBundleStatusByTransactionHashResponse ¶
type GetBundleStatusByTransactionHashResponse struct { TxHash string `json:"txHash"` // "0x0aeb9c61b342f7fc94a10d41c5d30a049a9cfa9ab764c6dd02204a19960ee567" Status string `json:"status"` // "FAILED_BUNDLE" Message string `json:"message"` // "Expired - The base fee was to low to execute this transaction, please try again" Error string `json:"error"` // "max fee per gas less than block base fee" BlocksCount int `json:"blocksCount"` // 2 ReceivedTimestamp int `json:"receivedTimestamp"` // 1634568851003 StatusTimestamp int `json:"statusTimestamp"` // 1634568873862 }
type HealthResponse ¶
type JSONRPCError ¶
JSONRPCError https://www.jsonrpc.org/specification#error_object
func (JSONRPCError) Error ¶
func (err JSONRPCError) Error() string
type JSONRPCRequest ¶
type JSONRPCRequest struct { ID interface{} `json:"id"` Method string `json:"method"` Params []interface{} `json:"params"` Version string `json:"jsonrpc,omitempty"` }
func NewJSONRPCRequest ¶
func NewJSONRPCRequest(id interface{}, method string, params []interface{}) *JSONRPCRequest
func NewJSONRPCRequest1 ¶
func NewJSONRPCRequest1(id interface{}, method string, param interface{}) *JSONRPCRequest
type JSONRPCResponse ¶
type JSONRPCResponse struct { ID interface{} `json:"id"` Result json.RawMessage `json:"result,omitempty"` Error *JSONRPCError `json:"error,omitempty"` Version string `json:"jsonrpc"` }
func NewJSONRPCResponse ¶
func NewJSONRPCResponse(id interface{}, result json.RawMessage) *JSONRPCResponse
type PrivateTxAPIResponse ¶
type PrivateTxAPIResponse struct { Status PrivateTxStatus `json:"status"` Hash string `json:"hash"` MaxBlockNumber int `json:"maxBlockNumber"` }
type PrivateTxPreferences ¶
type PrivateTxPreferences struct { Privacy TxPrivacyPreferences `json:"privacy"` Validity TxValidityPreferences `json:"validity"` }
type PrivateTxStatus ¶
type PrivateTxStatus string
var ( TxStatusUnknown PrivateTxStatus = "UNKNOWN" TxStatusPending PrivateTxStatus = "PENDING" TxStatusIncluded PrivateTxStatus = "INCLUDED" TxStatusFailed PrivateTxStatus = "FAILED" )
type RefundConfig ¶
type RelayErrorResponse ¶
type RelayErrorResponse struct {
Error string `json:"error"`
}
type SendPrivateTxRequestWithPreferences ¶
type SendPrivateTxRequestWithPreferences struct { flashbotsrpc.FlashbotsSendPrivateTransactionRequest Preferences *PrivateTxPreferences `json:"preferences,omitempty"` }
type TransactionReceipt ¶
type TxPrivacyPreferences ¶
type TxValidityPreferences ¶
type TxValidityPreferences struct {
Refund []RefundConfig `json:"refund,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.