httpclient

package
v0.0.0-...-fb28cc1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserOperationReceipt

func GetUserOperationReceipt(bundlerURL string, userOpHash string) (json.RawMessage, error)

GetUserOperationReceipt retrieves the receipt of a UserOperation by its hash.

func SendRPCRequest

func SendRPCRequest(url, method string, params []interface{}) (json.RawMessage, error)

SendRPCRequest makes a JSON-RPC request to the given Bundler URL.

Types

type HashesResponse

type HashesResponse struct {
	Success  bool   `json:"success"`
	Original string `json:"original_hash"`
	Solved   string `json:"solved_hash"`
	Trx      string `json:"trx"`
}

func SendOpRPCRequest

func SendOpRPCRequest(url, method string, params []interface{}) (*HashesResponse, error)

SendOpRPCRequest sends a userOp JSON-RPC request to the given Bundler URL.

func SendUserOp

func SendUserOp(bundlerURL string, entryPointAddr common.Address, userOp *model.UserOperation) (*HashesResponse, error)

SendUserOp sends the UserOperation to the bundler.

type JsonRpcRequest

type JsonRpcRequest struct {
	Jsonrpc string        `json:"jsonrpc"`
	Id      int           `json:"id"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
}

type JsonRpcResponse

type JsonRpcResponse struct {
	Jsonrpc string           `json:"jsonrpc"`
	Result  json.RawMessage  `json:"result"`
	Error   *json.RawMessage `json:"error"`
	Id      int              `json:"id"`
}

type RPCErrDetail

type RPCErrDetail struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

func (*RPCErrDetail) Error

func (r *RPCErrDetail) Error() string

Jump to

Keyboard shortcuts

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