client

package
v0.4.0-RC2a Latest Latest
Warning

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

Go to latest
Published: Nov 3, 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 JSONRPCBatchCall added in v0.0.990

func JSONRPCBatchCall(url string, calls ...BatchCall) ([]types.Response, error)

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

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 BatchCall added in v0.0.990

type BatchCall struct {
	Method     string
	Parameters []interface{}
}

BatchCall used in batch requests to send multiple methods and parameters at once

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