wallet

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wallet

type Wallet struct {
	qwallet.WalletStore
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet(dir string) (*Wallet, error)

NewWallet creates a new wallet

func (Wallet) ChangePassword

func (w Wallet) ChangePassword(addr types.Address, pwd string, newPwd string) error

ChangePassword changes password to a new password

func (*Wallet) Close

func (ws *Wallet) Close() error

Close closes wallet

func (*Wallet) CurrentId

func (w *Wallet) CurrentId() (types.Address, error)

CurrentId returns current wallet id

func (*Wallet) IsWalletExist

func (w *Wallet) IsWalletExist(address types.Address) (bool, error)

IsWalletExist check is the wallet exist by master address

func (*Wallet) NewWallet

func (w *Wallet) NewWallet() (types.Address, error)

NewWallet create new wallet and save to db

func (*Wallet) NewWalletBySeed

func (w *Wallet) NewWalletBySeed(seed, password string) (types.Address, error)

NewWalletBySeed create wallet from hex seed string

func (*Wallet) RemoveWallet

func (w *Wallet) RemoveWallet(id types.Address) error

RemoveWallet removes wallet by account

func (*Wallet) WalletIds

func (w *Wallet) WalletIds() ([]types.Address, error)

WalletIds returns all wallet ids

type WalletStore

type WalletStore interface {
	NewWallet() (types.Address, error)
	NewWalletBySeed(seed, password string) (types.Address, error)
	CurrentId() (types.Address, error)
	WalletIds() ([]types.Address, error)
	IsWalletExist(address types.Address) (bool, error)
	RemoveWallet(id types.Address) error
	ChangePassword(addr types.Address, pwd string, newPwd string) error
}

Jump to

Keyboard shortcuts

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