ethrpc

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: LGPL-3.0, MIT Imports: 18 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForTxnReceipt added in v1.3.6

func WaitForTxnReceipt(ctx context.Context, provider *Provider, txHash common.Hash) (*types.Receipt, error)

Types

type Config

type Config struct {
	Nodes []NodeConfig

	ChaindID int // expected ChainID so we confirm on connect..
	TestMode bool
}

func (*Config) AddNode

func (c *Config) AddNode(nodeConfig NodeConfig)

type NodeConfig

type NodeConfig struct {
	URL                 string
	MaxRequestPerSecond float64
}

type Provider

type Provider struct {
	*ethclient.Client
	Config *Config
	RPC    *rpc.Client
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(ethURL string, optClient ...*http.Client) (*Provider, error)

func NewProviderWithConfig

func NewProviderWithConfig(config *Config, optClient ...*http.Client) (*Provider, error)

func (*Provider) BlockByHash added in v1.1.7

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

func (*Provider) BlockByNumber

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

func (*Provider) ChainID

func (s *Provider) ChainID(ctx context.Context) (*big.Int, error)

func (*Provider) Dial

func (s *Provider) Dial() error

func (*Provider) QueryContract added in v1.3.4

func (s *Provider) QueryContract(ctx context.Context, contractAddress string, inputAbiExpr, outputAbiExpr string, args []string) ([]string, error)

ie, QueryContext(context.Background(), "0xabcdef..", "balanceOf(uint256)", "uint256", []string{"1"})

func (*Provider) SendRawTransaction added in v1.3.6

func (s *Provider) SendRawTransaction(ctx context.Context, signedTxHex string) (common.Hash, error)

func (*Provider) TransactionDetails

func (s *Provider) TransactionDetails(ctx context.Context, txnHash common.Hash) (bool, *types.Receipt, *types.Transaction, string, error)

Jump to

Keyboard shortcuts

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