Versions in this module Expand all Collapse all v1 v1.9.25 Mar 25, 2021 v1.9.24 Mar 24, 2021 Changes in this version + const DefaultAccountNum + const ExternalBranch + const ImportedAddrAccount + const ImportedAddrAccountName + const InternalBranch + const LatestMgrVersion + const MaxAccountNum + const MaxAddressesPerAccount + var Break = managerError(ErrCallBackBreak, "callback break", nil) + var D logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var DefaultKeyScopes = []KeyScope + var DefaultScryptOptions = ScryptOptions + var E logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var F logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var I logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var KeyScopeBIP0044 = KeyScope + var ScopeAddrMap = map[KeyScope]ScopeAddrSchema + var T logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var W logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + func Create(ns walletdb.ReadWriteBucket, seed, pubPassphrase, privPassphrase []byte, ...) (e error) + func DoUpgrades(db walletdb.DB, namespaceKey []byte, pubPassphrase []byte, ...) (e error) + func IsError(e error, code ErrorCode) bool + func ValidateAccountName(name string) (e error) + type AccountProperties struct + AccountName string + AccountNumber uint32 + ExternalKeyCount uint32 + ImportedKeyCount uint32 + InternalKeyCount uint32 + type AddressType uint8 + const PubKeyHash + const RawPubKey + const Script + type BlockStamp struct + Hash chainhash.Hash + Height int32 + Timestamp time.Time + type CryptoKeyType byte + const CKTPrivate + const CKTPublic + const CKTScript + type DerivationPath struct + Account uint32 + Branch uint32 + Index uint32 + type EncryptorDecryptor interface + Bytes func() []byte + CopyBytes func([]byte) + Decrypt func(in []byte) ([]byte, error) + Encrypt func(in []byte) ([]byte, error) + Zero func() + type ErrorCode int + const ErrAccountNotFound + const ErrAccountNumTooHigh + const ErrAddressNotFound + const ErrAlreadyExists + const ErrCallBackBreak + const ErrCoinTypeTooHigh + const ErrCrypto + const ErrDatabase + const ErrDuplicateAccount + const ErrDuplicateAddress + const ErrEmptyPassphrase + const ErrInvalidAccount + const ErrInvalidKeyType + const ErrKeyChain + const ErrLocked + const ErrNoExist + const ErrScopeNotFound + const ErrTooManyAddresses + const ErrUpgrade + const ErrWatchingOnly + const ErrWrongNet + const ErrWrongPassphrase + func (e ErrorCode) String() string + type KeyScope struct + Coin uint32 + Purpose uint32 + func (k *KeyScope) String() string + type ManagedAddress interface + Account func() uint32 + AddrHash func() []byte + AddrType func() AddressType + Address func() btcaddr.Address + Compressed func() bool + Imported func() bool + Internal func() bool + Used func(ns walletdb.ReadBucket) bool + type ManagedPubKeyAddress interface + DerivationInfo func() (KeyScope, DerivationPath, bool) + ExportPrivKey func() (*util.WIF, error) + ExportPubKey func() string + PrivKey func() (*ec.PrivateKey, error) + PubKey func() *ec.PublicKey + type ManagedScriptAddress interface + Script func() ([]byte, error) + type Manager struct + func Open(ns walletdb.ReadBucket, pubPassphrase []byte, chainParams *chaincfg.Params) (*Manager, error) + func (m *Manager) ActiveScopedKeyManagers() []*ScopedKeyManager + func (m *Manager) AddrAccount(ns walletdb.ReadBucket, address btcaddr.Address) (*ScopedKeyManager, uint32, error) + func (m *Manager) Address(ns walletdb.ReadBucket, address btcaddr.Address) (ManagedAddress, error) + func (m *Manager) Birthday() time.Time + func (m *Manager) BlockHash(ns walletdb.ReadBucket, height int32) (*chainhash.Hash, error) + func (m *Manager) ChainParams() *chaincfg.Params + func (m *Manager) ChangePassphrase(ns walletdb.ReadWriteBucket, oldPassphrase, newPassphrase []byte, private bool, ...) (e error) + func (m *Manager) Close() + func (m *Manager) ConvertToWatchingOnly(ns walletdb.ReadWriteBucket) (e error) + func (m *Manager) Decrypt(keyType CryptoKeyType, in []byte) ([]byte, error) + func (m *Manager) Encrypt(keyType CryptoKeyType, in []byte) ([]byte, error) + func (m *Manager) FetchScopedKeyManager(scope KeyScope) (*ScopedKeyManager, error) + func (m *Manager) ForEachAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) (e error) + func (m *Manager) ForEachActiveAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) (e error) + func (m *Manager) ForEachActiveAddress(ns walletdb.ReadBucket, fn func(addr btcaddr.Address) error) (e error) + func (m *Manager) IsLocked() bool + func (m *Manager) Lock() (e error) + func (m *Manager) MarkUsed(ns walletdb.ReadWriteBucket, address btcaddr.Address) (e error) + func (m *Manager) NeuterRootKey(ns walletdb.ReadWriteBucket) (e error) + func (m *Manager) NewScopedKeyManager(ns walletdb.ReadWriteBucket, scope KeyScope, addrSchema ScopeAddrSchema) (*ScopedKeyManager, error) + func (m *Manager) ScopesForExternalAddrType(addrType AddressType) []KeyScope + func (m *Manager) ScopesForInternalAddrTypes(addrType AddressType) []KeyScope + func (m *Manager) SetBirthday(ns walletdb.ReadWriteBucket, birthday time.Time) (e error) + func (m *Manager) SetSyncedTo(ns walletdb.ReadWriteBucket, bs *BlockStamp) (e error) + func (m *Manager) SyncedTo() BlockStamp + func (m *Manager) Unlock(ns walletdb.ReadBucket, passphrase []byte) (e error) + func (m *Manager) WatchOnly() bool + type ManagerError struct + Description string + Err error + ErrorCode ErrorCode + func (e ManagerError) Error() string + type ObtainUserInputFunc func() ([]byte, error) + type OpenCallbacks struct + ObtainPrivatePass ObtainUserInputFunc + ObtainSeed ObtainUserInputFunc + type ScopeAddrSchema struct + ExternalAddrType AddressType + InternalAddrType AddressType + type ScopedIndex struct + Index uint32 + Scope KeyScope + type ScopedKeyManager struct + func (s *ScopedKeyManager) AccountName(ns walletdb.ReadBucket, account uint32) (string, error) + func (s *ScopedKeyManager) AccountProperties(ns walletdb.ReadBucket, account uint32) (*AccountProperties, error) + func (s *ScopedKeyManager) AddrAccount(ns walletdb.ReadBucket, address btcaddr.Address) (account uint32, e error) + func (s *ScopedKeyManager) AddrSchema() ScopeAddrSchema + func (s *ScopedKeyManager) Address(ns walletdb.ReadBucket, addr btcaddr.Address) (ma ManagedAddress, e error) + func (s *ScopedKeyManager) ChainParams() *chaincfg.Params + func (s *ScopedKeyManager) Close() + func (s *ScopedKeyManager) DeriveFromKeyPath(ns walletdb.ReadBucket, kp DerivationPath) (ManagedAddress, error) + func (s *ScopedKeyManager) ExtendExternalAddresses(ns walletdb.ReadWriteBucket, account uint32, lastIndex uint32) (e error) + func (s *ScopedKeyManager) ExtendInternalAddresses(ns walletdb.ReadWriteBucket, account uint32, lastIndex uint32) (e error) + func (s *ScopedKeyManager) ForEachAccount(ns walletdb.ReadBucket, fn func(account uint32) error) (e error) + func (s *ScopedKeyManager) ForEachAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) (e error) + func (s *ScopedKeyManager) ForEachActiveAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) (e error) + func (s *ScopedKeyManager) ForEachActiveAddress(ns walletdb.ReadBucket, fn func(addr btcaddr.Address) error) (e error) + func (s *ScopedKeyManager) ImportPrivateKey(ns walletdb.ReadWriteBucket, wif *util.WIF, bs *BlockStamp) (ManagedPubKeyAddress, error) + func (s *ScopedKeyManager) ImportScript(ns walletdb.ReadWriteBucket, script []byte, bs *BlockStamp) (ManagedScriptAddress, error) + func (s *ScopedKeyManager) LastAccount(ns walletdb.ReadBucket) (uint32, error) + func (s *ScopedKeyManager) LastExternalAddress(ns walletdb.ReadBucket, account uint32) (ManagedAddress, error) + func (s *ScopedKeyManager) LastInternalAddress(ns walletdb.ReadBucket, account uint32) (ManagedAddress, error) + func (s *ScopedKeyManager) LookupAccount(ns walletdb.ReadBucket, name string) (uint32, error) + func (s *ScopedKeyManager) MarkUsed(ns walletdb.ReadWriteBucket, address btcaddr.Address) (e error) + func (s *ScopedKeyManager) NewAccount(ns walletdb.ReadWriteBucket, name string) (account uint32, e error) + func (s *ScopedKeyManager) NewRawAccount(ns walletdb.ReadWriteBucket, number uint32) (e error) + func (s *ScopedKeyManager) NextExternalAddresses(ns walletdb.ReadWriteBucket, account uint32, numAddresses uint32) (ma []ManagedAddress, e error) + func (s *ScopedKeyManager) NextInternalAddresses(ns walletdb.ReadWriteBucket, account uint32, numAddresses uint32) (ma []ManagedAddress, e error) + func (s *ScopedKeyManager) RenameAccount(ns walletdb.ReadWriteBucket, account uint32, name string) (e error) + func (s *ScopedKeyManager) Scope() KeyScope + type ScryptOptions struct + N int + P int + R int + type SecretKeyGenerator func(passphrase *[]byte, config *ScryptOptions) (*snacl.SecretKey, error) + func SetSecretKeyGen(keyGen SecretKeyGenerator) SecretKeyGenerator