wallet

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongPassword         = errors.New("aes.KeyUnwrap(): integrity check failed.") // nolint:revive
	ErrKeyringNotInitialized = errors.New("keyring not initialized")
)
View Source
var (
	ErrSecretNotFound   = errors.New("secret not found")
	ErrEmptyTradeWallet = errors.New("trade wallet is empty")
)
View Source
var (
	KeystoreFolder string
)

Functions

func CheckFileKeystore

func CheckFileKeystore() (bool, error)

func CheckKeystore

func CheckKeystore() (bool, error)

CheckKeystore checks whether the keystore already exists and if the keystore requires a password.

func GenerateNewMnemonic

func GenerateNewMnemonic() (string, error)

GenerateNewMnemonic generates a new mnemonic phrase.

func GetAddrByIndex

func GetAddrByIndex(mnemonic string, index uint) (string, error)

GetAddrByIndex returns the address from the mnemonic phrase based on the index.

func InitKeystore

func InitKeystore(password, ksBackend string) error

func IsInitialized

func IsInitialized() bool

func Load

func Load(cfg *database.Wallet) error

func RemoveSecret

func RemoveSecret() error

func RequirePassword

func RequirePassword() bool

func SearchMnemonic

func SearchMnemonic() (string, bool, error)

SearchMnemnoic searches the secrets database for a mnemonic phrase.

func Set

func Set(secret string, tradeWalletIndex uint, cfg *database.Wallet) error

Set sets the secret in the keystore. If the secret already exists, it will be overwritten. Set will also set the private key in the wallet config.

func SetKeyStoreBackend

func SetKeyStoreBackend(store string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL