Documentation ¶
Index ¶
- Constants
- func Bip44Derivation(masterPrivKey *hd.ExtendedKey, coinType wallet.CoinType) (internal, external *hd.ExtendedKey, err error)
- type AddrFunc
- type KeyManager
- func (km *KeyManager) GenerateChildKey(purpose wallet.KeyPurpose, index uint32) (*hd.ExtendedKey, error)
- func (km *KeyManager) GetCurrentKey(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)
- func (km *KeyManager) GetFreshKey(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)
- func (km *KeyManager) GetKeyForScript(scriptAddress []byte) (*hd.ExtendedKey, error)
- func (km *KeyManager) GetKeys() []*hd.ExtendedKey
- func (km *KeyManager) GetNextUnused(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)
- func (km *KeyManager) KeyToAddress(key *hd.ExtendedKey) (btcutil.Address, error)
- func (km *KeyManager) MarkKeyAsUsed(scriptAddress []byte) error
Constants ¶
View Source
const LOOKAHEADWINDOW = 20
Variables ¶
This section is empty.
Functions ¶
func Bip44Derivation ¶
func Bip44Derivation(masterPrivKey *hd.ExtendedKey, coinType wallet.CoinType) (internal, external *hd.ExtendedKey, err error)
m / purpose' / coin_type' / account' / change / address_index
Types ¶
type KeyManager ¶
type KeyManager struct {
// contains filtered or unexported fields
}
func NewKeyManager ¶
func NewKeyManager(db wallet.Keys, params *chaincfg.Params, masterPrivKey *hd.ExtendedKey, coinType wallet.CoinType, getAddr AddrFunc) (*KeyManager, error)
func (*KeyManager) GenerateChildKey ¶
func (km *KeyManager) GenerateChildKey(purpose wallet.KeyPurpose, index uint32) (*hd.ExtendedKey, error)
func (*KeyManager) GetCurrentKey ¶
func (km *KeyManager) GetCurrentKey(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)
func (*KeyManager) GetFreshKey ¶
func (km *KeyManager) GetFreshKey(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)
func (*KeyManager) GetKeyForScript ¶
func (km *KeyManager) GetKeyForScript(scriptAddress []byte) (*hd.ExtendedKey, error)
func (*KeyManager) GetKeys ¶
func (km *KeyManager) GetKeys() []*hd.ExtendedKey
func (*KeyManager) GetNextUnused ¶
func (km *KeyManager) GetNextUnused(purpose wallet.KeyPurpose) (*hd.ExtendedKey, error)
func (*KeyManager) KeyToAddress ¶
func (km *KeyManager) KeyToAddress(key *hd.ExtendedKey) (btcutil.Address, error)
func (*KeyManager) MarkKeyAsUsed ¶
func (km *KeyManager) MarkKeyAsUsed(scriptAddress []byte) error
Mark the given key as used and extend the lookahead window
Click to show internal directories.
Click to hide internal directories.