Documentation ¶
Index ¶
Constants ¶
View Source
const ( MNEMONIC_SALT_PREFIX string = "LIBRA WALLET: mnemonic salt prefix$" MASTER_KEY_SALT string = "LIBRA WALLET: master key salt$" INFO_PREFIX string = "LIBRA WALLET: derived key$" )
View Source
const (
PublicKeySize = 32
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct { Address types.AccountAddress KeyPair *crypto.KeyPair Sequence uint64 }
func NewAccount ¶
Create Account from Mnemonic and child number.
func NewAccountFromKeyPair ¶
Create account from key pair
func NewAccountFromSecret ¶
Create Account from Secret Key.
type ExtendedPrivKey ¶
type ExtendedPrivKey struct { ChildNumber uint64 PrivateKey ed25519.PrivateKey }
func (*ExtendedPrivKey) GetAddress ¶
func (e *ExtendedPrivKey) GetAddress() types.AccountAddress
func (*ExtendedPrivKey) GetPublic ¶
func (e *ExtendedPrivKey) GetPublic() ed25519.PublicKey
func (*ExtendedPrivKey) ToString ¶
func (e *ExtendedPrivKey) ToString() string
Returns Private Key hex string representation
type KeyFactory ¶
func NewKeyFactory ¶
func NewKeyFactory(seed *Seed) *KeyFactory
func (*KeyFactory) GenerateKey ¶
func (k *KeyFactory) GenerateKey(childNumber uint64) *ExtendedPrivKey
type Seed ¶
type Seed struct {
Data []byte
}
type WalletLibrary ¶
type WalletLibrary struct { Mnemonic Mnemonic KeyFactory *KeyFactory KeyLeaf uint64 AddressMap map[string]uint64 //string is hex string of AccountAddress }
func NewWalletLibrary ¶
func NewWalletLibrary(mnemonicStr string) *WalletLibrary
func (*WalletLibrary) GenerateAddress ¶
func (w *WalletLibrary) GenerateAddress(depth uint64) error
TODO: Complete immplementation for Generating Multiple address up to a depth
func (*WalletLibrary) GetAccount ¶
func (w *WalletLibrary) GetAccount(childNumber uint64) (*Account, error)
Get Account in wallet library with child number.
func (*WalletLibrary) NewAddress ¶
func (w *WalletLibrary) NewAddress() (types.AccountAddress, uint64, error)
Create new address in wallet library.
Click to show internal directories.
Click to hide internal directories.