client

package
v0.2.6-RC2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONRPCCall

func JSONRPCCall(url, method string, parameters ...interface{}) (types.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.

Types

type Client

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

Client defines typed wrappers for the zkEVM RPC API.

func NewClient

func NewClient(url string) *Client

NewClient creates an instance of client

func (*Client) BatchByNumber

func (c *Client) BatchByNumber(ctx context.Context, number *big.Int) (*types.Batch, error)

BatchByNumber returns a batch from the current canonical chain. If number is nil, the latest known batch is returned.

func (*Client) BatchNumber

func (c *Client) BatchNumber(ctx context.Context) (uint64, error)

BatchNumber returns the latest batch number

Jump to

Keyboard shortcuts

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