client

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONRPCBatchCall

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

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

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

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

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

BlockNumber returns the latest block number

func (*Client) ExitRootsByGER

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

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