rpc_client

package
v0.0.0-...-db344e9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RpcClient

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

func NewRpcClient

func NewRpcClient(rpcUrl string) (*RpcClient, error)

func NewRpcClientFromEthClient

func NewRpcClientFromEthClient(client *ethclient.Client) (*RpcClient, error)

func (*RpcClient) BuildTransferTx

func (ec *RpcClient) BuildTransferTx(to common.Address, value *big.Int, gasLimit uint64, opts *bind.TransactOpts) (tx *types.Transaction, err error)

func (*RpcClient) EstimateGasForContractCall

func (e *RpcClient) EstimateGasForContractCall(fromAddress common.Address, toAddress common.Address, data []byte) (uint64, error)

EstimateGasForContractCall estimates the gas needed for a contract-call transaction

func (*RpcClient) EstimateGasForTransfer

func (e *RpcClient) EstimateGasForTransfer(fromAddress string, toAddress string, amount uint64) (uint64, error)

EstimateGasForTransfer estimates the gas needed for a native token transfer transaction

func (*RpcClient) GenerateRawTransaction

func (e *RpcClient) GenerateRawTransaction(fromAddress string, toAddress string, amount uint64, privateKeyHex string) (string, error)

Send a transaction to the ETH network

func (*RpcClient) GetBalance

func (e *RpcClient) GetBalance(address string) (uint64, error)

func (*RpcClient) GetClientVersion

func (e *RpcClient) GetClientVersion() (string, error)

web3_client_version

func (*RpcClient) GetCode

func (e *RpcClient) GetCode(address string) (string, error)

func (*RpcClient) GetGasPrice

func (e *RpcClient) GetGasPrice() (*big.Int, error)

func (*RpcClient) GetNonce

func (e *RpcClient) GetNonce(address string) (uint64, error)

func (*RpcClient) GetStorageAt

func (e *RpcClient) GetStorageAt(address string, index string) (string, error)

func (*RpcClient) SendRawTransaction

func (e *RpcClient) SendRawTransaction(rawTx string) (string, error)

SendRawTransaction sends a raw transaction to the ETH network

func (*RpcClient) SendTransaction

func (e *RpcClient) SendTransaction(tx *types.Transaction) (string, error)

Jump to

Keyboard shortcuts

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