Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ValidatePublicKey is the validation rule for valid secp256k1 pubkey. ValidatePublicKey = validation.NewStringRule(validatePublicKey, "must be a correct public key") )
Functions ¶
This section is empty.
Types ¶
type KeyManager ¶
type KeyManager struct { // The master key are generate using a mnemonic sentences following BIP39. // We use two master key, one for BIP49 (segwit) and the other for BIP84 (native segwit). BIP49MasterKey *hdkeychain.ExtendedKey BIP84MasterKey *hdkeychain.ExtendedKey Net *chaincfg.Params }
KeyManager is in charge of generating the addresses in the application.
func NewKeyManager ¶
func NewKeyManager(mnemonic string, password string, testnet bool) *KeyManager
NewKeyManager returns an KeyManager.
func (*KeyManager) GetNativeSegWitAddressForAccountAt ¶
func (km *KeyManager) GetNativeSegWitAddressForAccountAt(index uint32) (string, error)
GetNativeSegWitAddressForAccountAt generate a native segwit address from account index.
func (*KeyManager) GetSegWitAddressForAccountAt ¶
func (km *KeyManager) GetSegWitAddressForAccountAt(index uint32) (string, error)
GetSegWitAddressForAccountAt generate a segwit address from account index.
Click to show internal directories.
Click to hide internal directories.