eth

package
v0.0.0-...-452d5d4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// account file not valid
	ErrNotValidAccountFile = errors.New("not valid account file")
	// target is not valid directory
	ErrNotDirectory = errors.New("not valid directory")
	// address is not valid
	ErrInvalidAddress = errors.New("invalid address")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(host, walletDir, accountFilePath, password, logDir string) (*Client, error)

func (*Client) CreateAccount

func (client *Client) CreateAccount(account string) (keeper.Account, error)

Create Account

func (*Client) EstimateGas

func (client *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)

EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.

func (*Client) GetAccountInfo

func (client *Client) GetAccountInfo(account string, minConf int) (keeper.Account, error)

GetAccountInfo

func (*Client) GetAddress

func (client *Client) GetAddress(account string) (string, error)

GetAddress - default address

func (*Client) GetAddressesByAccount

func (client *Client) GetAddressesByAccount(account string) ([]string, error)

GetAddressesByAccount

func (*Client) GetBlockCount

func (client *Client) GetBlockCount() (int64, error)

GetBlockCount

func (*Client) GetNewAddress

func (client *Client) GetNewAddress(account string) (string, error)

func (*Client) ListAccountsMinConf

func (client *Client) ListAccountsMinConf(conf int) (map[string]float64, error)

ListAccountsMinConf

func (*Client) ListUnspentMin

func (client *Client) ListUnspentMin(minConf int) ([]btcjson.ListUnspentResult, error)

ListUnspentMin

func (*Client) Move

func (client *Client) Move(from, to string, amount float64) (bool, error)

Move

func (*Client) NetworkID

func (client *Client) NetworkID(ctx context.Context) (*big.Int, error)

NetworkID returns the network ID (also known as the chain ID) for this chain.

func (*Client) PendingNonceAt

func (client *Client) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

PendingNonceAt returns the account nonce of the given account in the pending state. This is the nonce that should be used for the next transaction.

func (*Client) Ping

func (client *Client) Ping() error

Ping

func (*Client) SendFrom

func (client *Client) SendFrom(account, hexToAddress string, amount float64) (string, error)

TODO check validity of account and have sufficent balance

func (*Client) SendToAddress

func (client *Client) SendToAddress(address string, amount float64) (string, error)

SendToAddress

func (*Client) SendTransaction

func (client *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction injects a signed transaction into the pending pool for execution.

If the transaction was a contract creation use the TransactionReceipt method to get the contract address after the transaction has been mined.

func (*Client) SuggestGasPrice

func (client *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)

SuggestGasPrice retrieves the currently suggested gas price to allow a timely execution of a transaction.

Jump to

Keyboard shortcuts

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