ethereum

package
v0.0.0-...-d73ec67 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SoftwareWallet

type SoftwareWallet struct {
	WalletImp
}

func (*SoftwareWallet) AccountBalance

func (w *SoftwareWallet) AccountBalance(
	ctx context.Context,
	client *ethclient.Client,
	account accounts.Account,
	blockNumber *big.Int,
) (*big.Int, error)

func (*SoftwareWallet) AccountBalanceEth

func (w *SoftwareWallet) AccountBalanceEth(
	ctx context.Context,
	client *ethclient.Client,
	account accounts.Account,
	blockNumber *big.Int,
) (*big.Float, error)

func (*SoftwareWallet) CreateTransaction

func (w *SoftwareWallet) CreateTransaction(
	ctx context.Context,
	client *ethclient.Client,
	account accounts.Account,
	toAddress common.Address,
	value *big.Int,
	gassLimit uint64,
) (*types.Transaction, error)

func (*SoftwareWallet) PendingAccountBalance

func (w *SoftwareWallet) PendingAccountBalance(
	ctx context.Context,
	client *ethclient.Client,
	account accounts.Account,
) (*big.Int, error)

func (*SoftwareWallet) PendingAccountBallanceEth

func (w *SoftwareWallet) PendingAccountBallanceEth(
	ctx context.Context,
	client *ethclient.Client,
	account accounts.Account,
) (*big.Float, error)

type Wallet

type Wallet interface {
	WalletImp

	AccountBalance(context.Context, *ethclient.Client, accounts.Account, *big.Int) (*big.Int, error)
	AccountBalanceEth(context.Context, *ethclient.Client, accounts.Account, *big.Int) (*big.Float, error)
	PendingAccountBalance(context.Context, *ethclient.Client, accounts.Account) (*big.Int, error)
	PendingAccountBallanceEth(context.Context, *ethclient.Client, accounts.Account) (*big.Float, error)
	CreateTransaction(context.Context, *ethclient.Client, accounts.Account, common.Address, *big.Int, uint64) (*types.Transaction, error)
}

func NewSoftwareWalletFromMnemonic

func NewSoftwareWalletFromMnemonic(
	mnemonic string,
	passOpt ...string,
) (Wallet, error)

func NewSoftwareWalletFromSeed

func NewSoftwareWalletFromSeed(seed []byte) (Wallet, error)

type WalletImp

type WalletImp interface {
	accounts.Wallet

	SignHash(accounts.Account, []byte) ([]byte, error)
	SignHashWithPassphrase(accounts.Account, string, []byte) ([]byte, error)

	Unpin(accounts.Account) error

	PrivateKey(accounts.Account) (*ecdsa.PrivateKey, error)
	PrivateKeyBytes(accounts.Account) ([]byte, error)
	PrivateKeyHex(accounts.Account) (string, error)

	PublicKey(accounts.Account) (*ecdsa.PublicKey, error)
	PublicKeyBytes(accounts.Account) ([]byte, error)
	PublicKeyHex(accounts.Account) (string, error)

	Address(accounts.Account) (common.Address, error)
	AddressBytes(accounts.Account) ([]byte, error)
	AddressHex(accounts.Account) (string, error)

	Path(accounts.Account) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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