txclient

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MinGasPrice = 500000000000
View Source
const TxReceiptInterval = 1 * time.Second
View Source
const TxReceiptTimeout = 30 * time.Second

Variables

This section is empty.

Functions

func Dial

func Dial(gethIpcPath string) (*ethclient.Client, error)

Dial connects to network and returns directly the official ETH connected Client.

Is recommended to always construct the *ethclient.Client using this Dial method as it only returns the Client when the blockchain is fully synced to avoid performing TXs from a non-synced state.

func ExtractSender added in v1.3.0

func ExtractSender(tx *ethTypes.Transaction) (common.Address, error)

func FetchReceipt

func FetchReceipt(client *ethclient.Client, tx *types.Transaction, cfg TxConfig) (*types.Receipt, error)

FetchReceipt periodically checks if transaction was already mined.

Returns TX receipt when transaction succeeds. Error otherwise.

func GenerateTxOpts

func GenerateTxOpts(ctx context.Context, client *ethclient.Client, auth authy.Auth, cfg TxConfig) (*bind.TransactOpts, error)

func SignTransferTx

func SignTransferTx(ctx context.Context, client *ethclient.Client, auth authy.Auth, to common.Address, amount *big.Int, cfg TxConfig) (*types.Transaction, error)

Types

type TxConfig

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

func NewTransferTxConfig

func NewTransferTxConfig() TxConfig

func NewTxConfig

func NewTxConfig(gasLimit uint64, gasPrice uint64, receiptTimeout time.Duration, receiptInterval time.Duration) TxConfig

func (TxConfig) GasLimit

func (c TxConfig) GasLimit() uint64

func (TxConfig) GasPrice

func (c TxConfig) GasPrice() uint64

func (TxConfig) TxReceiptInterval

func (c TxConfig) TxReceiptInterval() time.Duration

func (TxConfig) TxReceiptTimeout

func (c TxConfig) TxReceiptTimeout() time.Duration

Jump to

Keyboard shortcuts

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