eth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseHexKey

func ParseHexKey(hexkey string) (*ecdsa.PrivateKey, common.Address, error)

ParseHexKey converts a hex private key to an ecdsa private key.

Types

type Wallet

type Wallet struct {
	Client     *ethclient.Client
	ChainId    *big.Int
	PrivateKey *ecdsa.PrivateKey
	From       common.Address
}

Wallet is wrappers ethclient and private key.

func NewWallet

func NewWallet(rpc string, chainId *big.Int, privateKey string) (*Wallet, error)

NewWallet creates are wallet for the given params.

func (*Wallet) GetCallOpts

func (w *Wallet) GetCallOpts(ctx context.Context) *bind.CallOpts

Returns options to fine tune a contract call request.

func (*Wallet) GetNonce

func (w *Wallet) GetNonce(ctx context.Context) (uint64, error)

Returns the current nonce value.

func (*Wallet) GetTransactOpts

func (w *Wallet) GetTransactOpts(ctx context.Context) (*bind.TransactOpts, error)

Returns transaction authorization data.

func (*Wallet) WaitForTransactionReceipt

func (w *Wallet) WaitForTransactionReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error)

Wait for transaction to be completed. Note: Will wait forever, should cancel.

Jump to

Keyboard shortcuts

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