node

package
v0.0.0-...-d7f79cc Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialEthClientWithTimeout

func DialEthClientWithTimeout(ctx context.Context, url string, disableHTTP2 bool) (
	*ethclient.Client, error)

func IsURLAvailable

func IsURLAvailable(address string) bool

Types

type EthClient

type EthClient interface {
	TxReceiptByHash(common.Hash) (*types.Transaction, error)
	SendTransaction(ctx context.Context, tx *types.Transaction) error
	GetBalanceByBlockNumber(address string, blockNumber *big.Int) (*big.Int, error)
	GetLatestBlock() (*big.Int, error)
	GetERC20Balance(contractAddress common.Address, ownerAddress common.Address, blockNumber *big.Int) (*big.Int, error)
	TxReceiptDetailByHash(hash common.Hash) (*types.Receipt, error)
	Close()
}

func DialEthClient

func DialEthClient(ctx context.Context, rpcUrl string) (EthClient, error)

type RPC

type RPC interface {
	Close()
	CallContext(ctx context.Context, result any, method string, args ...any) error
	BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
}

func NewRPC

func NewRPC(client *rpc.Client) RPC

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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