Versions in this module Expand all Collapse all v0 v0.4.0 Apr 4, 2024 v0.3.0 Feb 28, 2024 Changes in this version + const AccountFileName + var ErrInvalidPassword = errors.New("invalid password") + func NewDerivationPath(accountIndex uint64) string + type Account struct + AccountIndex uint64 + AccountKeys KeyHashes + func NewAccount(idx uint64, key AccountKey) *Account + type AccountKey struct + DerivationPath []byte + PrivKey []byte + PubKey []byte + PubKeyHash *KeyHashes + func NewAccountKey(masterKey *hdkeychain.ExtendedKey, derivationPath string) (*AccountKey, error) + type Db interface + Close func() error + Do func() TxContext + WithTransaction func(func(tx TxContext) error) error + type KeyHashes struct + Sha256 []byte + func NewKeyHash(key []byte) *KeyHashes + type Keys struct + AccountKey *AccountKey + MasterKey *hdkeychain.ExtendedKey + Mnemonic string + func NewKeys(mnemonic string) (*Keys, error) + type Manager interface + AddAccount func() (uint64, []byte, error) + Close func() + CreateKeys func(mnemonic string) error + GetAccountKey func(uint64) (*AccountKey, error) + GetAccountKeys func() ([]*AccountKey, error) + GetAll func() []Account + GetMaxAccountIndex func() (uint64, error) + GetMnemonic func() (string, error) + GetPublicKey func(accountIndex uint64) ([]byte, error) + GetPublicKeys func() ([][]byte, error) + func NewManager(dir string, password string, create bool) (Manager, error) + type TxContext interface + AddAccount func(accountIndex uint64, key *AccountKey) error + GetAccountKey func(accountIndex uint64) (*AccountKey, error) + GetAccountKeys func() ([]*AccountKey, error) + GetMasterKey func() (string, error) + GetMaxAccountIndex func() (uint64, error) + GetMnemonic func() (string, error) + IsEncrypted func() (bool, error) + SetEncrypted func(encrypted bool) error + SetMasterKey func(masterKey string) error + SetMaxAccountIndex func(accountIndex uint64) error + SetMnemonic func(mnemonic string) error + VerifyPassword func() (bool, error)