ethrequest

package
v0.0.0-...-cb07b45 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ETHEstimateGas        = "eth_estimateGas"
	ETHSendRawTransaction = "eth_sendRawTransaction"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrRequest

type ErrRequest error
var (
	ErrBadRequest        ErrRequest = errors.New("invalid request")
	ErrRateLimitExceeded ErrRequest = errors.New("rate limit exceeded")
)

type EthService

type EthService struct {
	// contains filtered or unexported fields
}

func NewEthService

func NewEthService(endpoint string) (*EthService, error)

func (*EthService) Client

func (e *EthService) Client() *ethclient.Client

func (*EthService) Close

func (e *EthService) Close()

func (*EthService) EstimateContractGasPrice

func (e *EthService) EstimateContractGasPrice(data []byte) (uint64, error)

func (*EthService) EstimateGas

func (e *EthService) EstimateGas(from, to string, value uint64) (uint64, error)

func (*EthService) EstimateGasPrice

func (e *EthService) EstimateGasPrice(from string, value uint64, data []byte) (uint64, error)

func (*EthService) NextNonce

func (e *EthService) NextNonce(address string) (uint64, error)

func (*EthService) SendRawTransaction

func (e *EthService) SendRawTransaction(tx string) ([]byte, error)

type RawService

type RawService struct {
	// contains filtered or unexported fields
}

func NewRawService

func NewRawService(url string) *RawService

func (*RawService) Post

func (r *RawService) Post(method string, body []any) ([]byte, error)

Jump to

Keyboard shortcuts

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