rpc

package
v0.0.0-...-a20f792 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoint string
}

func NewClient

func NewClient(endpoint string) *Client

func (*Client) GetBalance

func (c *Client) GetBalance(address, blk string) (*big.Int, error)

func (*Client) GetCode

func (c *Client) GetCode(address, blk string) ([]byte, error)

func (*Client) GetCodeAndStorageAt

func (c *Client) GetCodeAndStorageAt(address, position, blk string) ([]byte, common.Hash, error)

func (*Client) GetStorageAt

func (c *Client) GetStorageAt(address, position, blk string) (common.Hash, error)

type ErrResponse

type ErrResponse struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

func (*ErrResponse) Error

func (e *ErrResponse) Error() string

type RPCRequest

type RPCRequest struct {
	ID      int           `json:"id"`
	JSONRpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
}

type RPCResponse

type RPCResponse struct {
	ID      int             `json:"id"`
	JSONRpc string          `json:"jsonrpc"`
	Result  json.RawMessage `json:"result"`
	Err     *ErrResponse    `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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