wallet

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = 1
)

Variables

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

Functions

This section is empty.

Types

type IWallet

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

type Session

type Session struct {
	db.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) Export

func (s *Session) Export(path string) error

func (*Session) GenerateChangeBlock

func (s *Session) GenerateChangeBlock(account types.Address, representative types.Address) (types.Block, error)

func (*Session) GenerateReceiveBlock

func (s *Session) GenerateReceiveBlock(sendBlock types.Block) (types.Block, error)

func (*Session) GenerateSendBlock

func (s *Session) GenerateSendBlock(source types.Address, token types.Hash, to types.Address, amount types.Balance) (types.Block, error)

func (*Session) GetAccounts

func (s *Session) GetAccounts() ([]types.Address, error)

func (*Session) GetBalances

func (s *Session) GetBalances() (map[types.Hash]types.Balance, 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) Import

func (s *Session) Import(content string, password string) error

func (*Session) IsAccountExist

func (s *Session) IsAccountExist(addr types.Address) bool

func (*Session) ResetDeterministicIndex

func (s *Session) ResetDeterministicIndex() error

func (*Session) SearchPending

func (s *Session) SearchPending() 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
	db.Store
	// contains filtered or unexported fields
}

func NewWalletStore

func NewWalletStore(cfg *config.Config) *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