Documentation ¶
Index ¶
- Constants
- type Account
- type AccountData
- type HeaderData
- type Wallet
- type WalletData
- type WalletImpl
- func (w *WalletImpl) ChangePassword(oldPassword []byte, newPassword []byte) bool
- func (w *WalletImpl) CreateAccount(seed []byte) error
- func (w *WalletImpl) GetAccount(pubKey []byte) (*Account, error)
- func (w *WalletImpl) GetContract() (*program.ProgramContext, error)
- func (w *WalletImpl) GetDefaultAccount() (*Account, error)
- func (w *WalletImpl) Sign(txn *transaction.Transaction) error
- type WalletStore
Constants ¶
View Source
const ( WalletIVLength = 16 WalletMasterKeyLength = 32 WalletVersion = 1 MinCompatibleWalletVersion = 1 MaxCompatibleWalletVersion = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountData ¶
type HeaderData ¶
type Wallet ¶
type Wallet interface { Sign(txn *transaction.Transaction) error GetAccount(pubKey []byte) (*Account, error) GetDefaultAccount() (*Account, error) }
type WalletData ¶
type WalletData struct { HeaderData AccountData }
type WalletImpl ¶
type WalletImpl struct { *WalletStore // contains filtered or unexported fields }
func NewWallet ¶
func NewWallet(path string, password []byte, needAccount bool) (*WalletImpl, error)
func OpenWallet ¶
func OpenWallet(path string, password []byte) (*WalletImpl, error)
func RecoverWallet ¶
func RecoverWallet(path string, password []byte, seedHex string) (*WalletImpl, error)
func (*WalletImpl) ChangePassword ¶
func (w *WalletImpl) ChangePassword(oldPassword []byte, newPassword []byte) bool
func (*WalletImpl) CreateAccount ¶
func (w *WalletImpl) CreateAccount(seed []byte) error
func (*WalletImpl) GetAccount ¶
func (w *WalletImpl) GetAccount(pubKey []byte) (*Account, error)
func (*WalletImpl) GetContract ¶
func (w *WalletImpl) GetContract() (*program.ProgramContext, error)
func (*WalletImpl) GetDefaultAccount ¶
func (w *WalletImpl) GetDefaultAccount() (*Account, error)
func (*WalletImpl) Sign ¶
func (w *WalletImpl) Sign(txn *transaction.Transaction) error
type WalletStore ¶
type WalletStore struct { sync.RWMutex Path string Data WalletData }
func LoadStore ¶
func LoadStore(fullPath string) (*WalletStore, error)
func NewStore ¶
func NewStore(fullPath string) (*WalletStore, error)
func (*WalletStore) SaveAccountData ¶
func (s *WalletStore) SaveAccountData(programHash []byte, encryptedSeed []byte, contract []byte) error
func (*WalletStore) SaveBasicData ¶
func (s *WalletStore) SaveBasicData(version int, iv, masterKey, passwordHash []byte) error
Click to show internal directories.
Click to hide internal directories.