Documentation ¶
Index ¶
- Constants
- func GetPassword(prompt string) string
- type EncryptedMnemonic
- func CreateMnemonics(params *dagconfig.Params, numKeys uint32, cmdLinePassword string, ...) (encryptedPrivateKeys []*EncryptedMnemonic, extendedPublicKeys []string, ...)
- func ImportMnemonics(params *dagconfig.Params, numKeys uint32, cmdLinePassword string, ...) (encryptedPrivateKeys []*EncryptedMnemonic, extendedPublicKeys []string, ...)
- type File
- func (d *File) DecryptMnemonics(password string) ([]string, error)
- func (d *File) LastUsedExternalIndex() uint32
- func (d *File) LastUsedInternalIndex() uint32
- func (d *File) Path() string
- func (d *File) Save() error
- func (d *File) SetLastUsedExternalIndex(index uint32) error
- func (d *File) SetLastUsedInternalIndex(index uint32) error
- func (d *File) SetPath(params *dagconfig.Params, path string, forceOverride bool) error
- func (d *File) TryLock() error
Constants ¶
const LastVersion = 2
LastVersion is the most up to date file format version
Variables ¶
This section is empty.
Functions ¶
func GetPassword ¶
GetPassword was adapted from https://gist.github.com/jlinoff/e8e26b4ffa38d379c7f1891fd174a6d0#file-getpassword2-go
Types ¶
type EncryptedMnemonic ¶
type EncryptedMnemonic struct {
// contains filtered or unexported fields
}
EncryptedMnemonic represents an encrypted mnemonic
type File ¶
type File struct { Version uint32 NumThreads uint8 // This field is ignored for versions different than 0 EncryptedMnemonics []*EncryptedMnemonic ExtendedPublicKeys []string MinimumSignatures uint32 CosignerIndex uint32 ECDSA bool // contains filtered or unexported fields }
File holds all the data related to the wallet keys
func NewFileFromMnemonic ¶
NewFileFromMnemonic generates a new File from the given mnemonic string
func ReadKeysFile ¶
ReadKeysFile returns the data related to the keys file
func (*File) DecryptMnemonics ¶
DecryptMnemonics asks the user to enter the password for the private keys and returns the decrypted private keys.
func (*File) LastUsedExternalIndex ¶
LastUsedExternalIndex returns the last used index in the external key chain and saves the file with the updated data.
func (*File) LastUsedInternalIndex ¶
LastUsedInternalIndex returns the last used index in the internal key chain
func (*File) SetLastUsedExternalIndex ¶
SetLastUsedExternalIndex sets the last used index in the external key chain, and saves the file with the updated data.
func (*File) SetLastUsedInternalIndex ¶
SetLastUsedInternalIndex sets the last used index in the internal key chain, and saves the file.