Versions in this module Expand all Collapse all v0 v0.0.8 Apr 4, 2019 Changes in this version + const DefaultAccountNum + const ExternalBranch + const ImportedAddrAccount + const ImportedAddrAccountName + const InternalBranch + const MaxAccountNum + const MaxAddressesPerAccount + var Break = managerError(ErrCallBackBreak, "callback break", nil) + var DefaultKeyScopes = []KeyScope + var DefaultScryptOptions = ScryptOptions + var KeyScopeBIP0044 = KeyScope + var KeyScopeBIP0049Plus = KeyScope + var KeyScopeBIP0084 = KeyScope + var LatestMgrVersion = getLatestVersion() + var ScopeAddrMap = map[KeyScope]ScopeAddrSchema + func Create(ns walletdb.ReadWriteBucket, seed, pubPassphrase, privPassphrase []byte, ...) error + func DisableLog() + func IsError(err error, code ErrorCode) bool + func UseLogger(logger btclog.Logger) + func ValidateAccountName(name string) error + type AccountProperties struct + AccountName string + AccountNumber uint32 + ExternalKeyCount uint32 + ImportedKeyCount uint32 + InternalKeyCount uint32 + type AddressType uint8 + const NestedWitnessPubKey + const PubKeyHash + const RawPubKey + const Script + const WitnessPubKey + 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 ErrBirthdayBlockNotSet + const ErrBlockNotFound + 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() acmutil.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() (*acmutil.WIF, error) + ExportPubKey func() string + PrivKey func() (*btcec.PrivateKey, error) + PubKey func() *btcec.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 acmutil.Address) (*ScopedKeyManager, uint32, error) + func (m *Manager) Address(ns walletdb.ReadBucket, address acmutil.Address) (ManagedAddress, error) + func (m *Manager) Birthday() time.Time + func (m *Manager) BirthdayBlock(ns walletdb.ReadBucket) (BlockStamp, bool, error) + 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, ...) error + func (m *Manager) Close() + func (m *Manager) ConvertToWatchingOnly(ns walletdb.ReadWriteBucket) 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) error + func (m *Manager) ForEachActiveAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) error + func (m *Manager) ForEachActiveAddress(ns walletdb.ReadBucket, fn func(addr acmutil.Address) error) error + func (m *Manager) IsLocked() bool + func (m *Manager) Lock() error + func (m *Manager) MarkUsed(ns walletdb.ReadWriteBucket, address acmutil.Address) error + func (m *Manager) NeuterRootKey(ns walletdb.ReadWriteBucket) 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) error + func (m *Manager) SetBirthdayBlock(ns walletdb.ReadWriteBucket, block BlockStamp, verified bool) error + func (m *Manager) SetSyncedTo(ns walletdb.ReadWriteBucket, bs *BlockStamp) error + func (m *Manager) SyncedTo() BlockStamp + func (m *Manager) Unlock(ns walletdb.ReadBucket, passphrase []byte) error + func (m *Manager) WatchOnly() bool + type ManagerError struct + Description string + Err error + ErrorCode ErrorCode + func (e ManagerError) Error() string + type MigrationManager struct + func NewMigrationManager(ns walletdb.ReadWriteBucket) *MigrationManager + func (m *MigrationManager) CurrentVersion(ns walletdb.ReadBucket) (uint32, error) + func (m *MigrationManager) Name() string + func (m *MigrationManager) Namespace() walletdb.ReadWriteBucket + func (m *MigrationManager) SetVersion(ns walletdb.ReadWriteBucket, version uint32) error + func (m *MigrationManager) Versions() []migration.Version + 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 acmutil.Address) (uint32, error) + func (s *ScopedKeyManager) AddrSchema() ScopeAddrSchema + func (s *ScopedKeyManager) Address(ns walletdb.ReadBucket, address acmutil.Address) (ManagedAddress, 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) error + func (s *ScopedKeyManager) ExtendInternalAddresses(ns walletdb.ReadWriteBucket, account uint32, lastIndex uint32) error + func (s *ScopedKeyManager) ForEachAccount(ns walletdb.ReadBucket, fn func(account uint32) error) error + func (s *ScopedKeyManager) ForEachAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) error + func (s *ScopedKeyManager) ForEachActiveAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) error + func (s *ScopedKeyManager) ForEachActiveAddress(ns walletdb.ReadBucket, fn func(addr acmutil.Address) error) error + func (s *ScopedKeyManager) ImportPrivateKey(ns walletdb.ReadWriteBucket, wif *acmutil.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 acmutil.Address) error + func (s *ScopedKeyManager) NewAccount(ns walletdb.ReadWriteBucket, name string) (uint32, error) + func (s *ScopedKeyManager) NewRawAccount(ns walletdb.ReadWriteBucket, number uint32) error + func (s *ScopedKeyManager) NextExternalAddresses(ns walletdb.ReadWriteBucket, account uint32, numAddresses uint32) ([]ManagedAddress, error) + func (s *ScopedKeyManager) NextInternalAddresses(ns walletdb.ReadWriteBucket, account uint32, numAddresses uint32) ([]ManagedAddress, error) + func (s *ScopedKeyManager) RenameAccount(ns walletdb.ReadWriteBucket, account uint32, name string) 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