key

package
v0.0.0-...-79ba347 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFs              = errors.New("unable to read file from given path")
	ErrInvalidKey      = errors.New("provided key is incorrect, only wallet or binary key supported")
	ErrInvalidAddress  = errors.New("--address option must be specified and valid")
	ErrInvalidPassword = errors.New("invalid password for the encrypted key")
)

Key-related errors.

Functions

func FromWallet

func FromWallet(cmd *cobra.Command, w *wallet.Wallet, addrStr string) (*ecdsa.PrivateKey, error)

FromWallet returns private key of the wallet account.

func Get

func Get(cmd *cobra.Command) *ecdsa.PrivateKey

Get returns private key from wallet or binary file. Ideally we want to touch file-system on the last step. This function assumes that all flags were bind to viper in a `PersistentPreRun`.

func GetOrGenerate

func GetOrGenerate(cmd *cobra.Command) *ecdsa.PrivateKey

GetOrGenerate is similar to get but generates a new key if commonflags.GenerateKey is set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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