near

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package near contains workaround for the aurora rpc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockByHash

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

BlockByHash overrides the get block unmarshalling to be compatible with near.

func BlockByNumber

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

BlockByNumber overrides the get block unmarshalling to be compatible with near.

Types

type AuroraClient

type AuroraClient interface {
	// CallContext performs a JSON-RPC call with the given arguments. If the context is
	// canceled before the call has successfully returned, CallContext returns immediately.
	//
	// The result must be a pointer so that package json can unmarshal into it. You
	// can also pass nil, in which case the result is ignored.
	CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
	// BatchCallContext sends all given requests as a single batch and waits for the server
	// to return a response for all of them. The wait duration is bounded by the
	// context's deadline.
	//
	// In contrast to CallContext, BatchCallContext only returns errors that have occurred
	// while sending the request. Any error specific to a request is reported through the
	// Error field of the corresponding BatchElem.
	//
	// Note that batch calls may not be executed atomically on the server side.
	BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
	// BlockNumber gets the latest block number
	BlockNumber(ctx context.Context) (uint64, error)
	// TransactionByHash gets a tx by hash
	TransactionByHash(ctx context.Context, txHash common.Hash) (tx *types.Transaction, isPending bool, err error)
}

AuroraClient contains the methods necessary to use the aurora client adapter.

Jump to

Keyboard shortcuts

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