client

package
v0.7.2-RC3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 10 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

func (*Client) BlockByHash added in v0.5.0

func (c *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)

BlockByHash returns a block from the current canonical chain.

func (*Client) BlockByNumber added in v0.5.0

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

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

func (*Client) BlockNumber added in v0.5.0

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

BlockNumber returns the latest block number

func (*Client) ExitRootsByGER added in v0.5.0

func (c *Client) ExitRootsByGER(ctx context.Context, globalExitRoot common.Hash) (*types.ExitRoots, error)

ExitRootsByGER returns the exit roots accordingly to the provided Global Exit Root

func (*Client) GetLatestGlobalExitRoot added in v0.5.0

func (c *Client) GetLatestGlobalExitRoot(ctx context.Context) (common.Hash, error)

GetLatestGlobalExitRoot returns the latest global exit root

Jump to

Keyboard shortcuts

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