rpclient

package
v0.0.2-RC20 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCClient

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

RPCClient is a client for the JSON RPC

func NewRPCClient

func NewRPCClient(url string) *RPCClient

NewRPCClient creates an instance of client

type Request

type Request struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      interface{}     `json:"id"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params,omitempty"`
}

Request is a jsonrpc request

type Response

type Response struct {
	JSONRPC string
	ID      interface{}
	Result  json.RawMessage
}

Response is a jsonrpc success response

func JSONRPCCall

func JSONRPCCall(url, method string, httpHeaders map[string]string, id interface{}, parameters ...interface{}) (Response, error)

JSONRPCCall executes a 2.0 JSON RPC HTTP Post Request to the provided URL with the provided method and parameters, which is compatible with the Ethereum JSON RPC Server.

Jump to

Keyboard shortcuts

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