wallet

package
v1.4.2-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = 1
)

Variables

View Source
var (
	ErrEmptyCurrentId = errors.New("can not find any wallet id")
)
View Source
var (
	ErrEmptyId = errors.New("empty wallet id")
)

Functions

This section is empty.

Types

type IWallet

type IWallet interface {
	// contains filtered or unexported methods
}

type Session

type Session struct {
	storage.Store
	// contains filtered or unexported fields
}

func (*Session) ChangePassword

func (s *Session) ChangePassword(password string) error

func (*Session) EnterPassword

func (s *Session) EnterPassword(password string) error

func (*Session) GetDeterministicIndex

func (s *Session) GetDeterministicIndex() (int64, error)

func (*Session) GetRawKey

func (s *Session) GetRawKey(account types.Address) (*types.Account, error)

func (*Session) GetRepresentative

func (s *Session) GetRepresentative() (types.Address, error)

func (*Session) GetSeed

func (s *Session) GetSeed() ([]byte, error)

func (*Session) GetVersion

func (s *Session) GetVersion() (int64, error)

func (*Session) GetWalletId

func (s *Session) GetWalletId() ([]byte, error)

func (*Session) GetWork

func (s *Session) GetWork(account types.Address) (types.Work, error)

func (*Session) ResetDeterministicIndex

func (s *Session) ResetDeterministicIndex() error

func (*Session) SetDeterministicIndex

func (s *Session) SetDeterministicIndex(index int64) error

func (*Session) SetRepresentative

func (s *Session) SetRepresentative(address types.Address) error

func (*Session) SetVersion

func (s *Session) SetVersion(version int64) error

func (*Session) ValidPassword

func (s *Session) ValidPassword() bool

func (*Session) VerifyPassword

func (s *Session) VerifyPassword(password string) (bool, error)

type WalletStore

type WalletStore struct {
	io.Closer
	storage.Store
	// contains filtered or unexported fields
}

func NewWalletStore

func NewWalletStore(cfgFile string) *WalletStore

func (*WalletStore) Close

func (ws *WalletStore) Close() error

func (*WalletStore) CurrentId

func (ws *WalletStore) CurrentId() (types.Address, error)

func (*WalletStore) IsWalletExist

func (ws *WalletStore) IsWalletExist(address types.Address) (bool, error)

IsWalletExist check is the wallet exist by master address

func (*WalletStore) NewSession

func (ws *WalletStore) NewSession(walletId types.Address) *Session

func (*WalletStore) NewWallet

func (ws *WalletStore) NewWallet() (types.Address, error)

NewWallet create new wallet and save to db

func (*WalletStore) NewWalletBySeed

func (ws *WalletStore) NewWalletBySeed(seed, password string) (types.Address, error)

NewWalletBySeed create wallet from hex seed string

func (*WalletStore) RemoveWallet

func (ws *WalletStore) RemoveWallet(id types.Address) error

func (*WalletStore) WalletIds

func (ws *WalletStore) WalletIds() ([]types.Address, error)

Jump to

Keyboard shortcuts

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