wallet

package
v0.0.0-...-ddb3e2c Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: LGPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrContractNotFound error returned when MerchantWalletContract could not be instantiated on the given address
	ErrContractNotFound = errors.New("wallet: MerchantWallet contract not found")
	//ErrAlwaysFailingTransaction error returned when Transaction could not be submitted to blockchain
	ErrAlwaysFailingTransaction = errors.New("wallet: could not submit a transaction. Gas limit exceeds limits or always failing transaction")
)

Functions

This section is empty.

Types

type Wallet

type Wallet struct {
	*eth.Session
	ContractAddress common.Address
	ContractHandler *contracts.MerchantWalletContract
}

Wallet executes methods necessary for fund management in MerchantWallet

func NewWallet

func NewWallet(s *eth.Session, contractAddress common.Address) *Wallet

NewWallet converts session to Wallet

func (*Wallet) ChangeMerchant

func (w *Wallet) ChangeMerchant(ctx context.Context,
	to common.Address) (txHash common.Hash, err error)

ChangeMerchant passes the administration of the MerchantWallet contract to another Address

func (*Wallet) WithdrawAllTo

func (w *Wallet) WithdrawAllTo(ctx context.Context,
	depositAddress common.Address,
	minAmount *big.Int) (txHash common.Hash, err error)

WithdrawAllTo withdraws all balance or minAmount to a provided deposit address

func (*Wallet) WithdrawAllTokensTo

func (w *Wallet) WithdrawAllTokensTo(ctx context.Context,
	tokenAddress common.Address,
	depositAddress common.Address,
	minAmount *big.Int) (txHash common.Hash, err error)

WithdrawAllTokensTo withdraws all token balance or minAmount to a provided deposit address.

func (*Wallet) WithdrawTo

func (w *Wallet) WithdrawTo(ctx context.Context,
	depositAddress common.Address,
	amount *big.Int) (txHash common.Hash, err error)

WithdrawTo withdraws specific amount to a provided deposit address

Jump to

Keyboard shortcuts

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