types

package
v0.0.0-...-d1bef67 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package types contains the types used in the JSON-RPC requests and responses.

Index

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 BundleResponse struct {
	BundleID string   `json:"bundleID"`
	RawTxs   []string `json:"rawTxs"`
}

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 HealthResponse struct {
	Now       time.Time `json:"time"`
	StartTime time.Time `json:"startTime"`
	Version   string    `json:"version"`
}

type JSONRPCError

type JSONRPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

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 RefundConfig struct {
	Address common.Address `json:"address"`
	Percent int            `json:"percent"`
}

type RelayErrorResponse

type RelayErrorResponse struct {
	Error string `json:"error"`
}

type SendPrivateTxRequestWithPreferences

type SendPrivateTxRequestWithPreferences struct {
	flashbotsrpc.FlashbotsSendPrivateTransactionRequest
	Preferences *PrivateTxPreferences `json:"preferences,omitempty"`
}

type TransactionReceipt

type TransactionReceipt struct {
	TransactionHash string
	Status          string
}

type TxPrivacyPreferences

type TxPrivacyPreferences struct {
	Hints    []string `json:"hints"`
	Builders []string `json:"builders"`
}

type TxValidityPreferences

type TxValidityPreferences struct {
	Refund []RefundConfig `json:"refund,omitempty"`
}

Jump to

Keyboard shortcuts

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