Documentation ¶
Index ¶
- Constants
- func AddKeyCommand() *cobra.Command
- func Commands(defaultNodeHome string) *cobra.Command
- func DeleteKeyCommand() *cobra.Command
- func ExportKeyCommand() *cobra.Command
- func ImportKeyCommand() *cobra.Command
- func ListKeysCmd() *cobra.Command
- func MigrateCommand() *cobra.Command
- func MnemonicKeyCommand() *cobra.Command
- func ParseKeyStringCommand() *cobra.Command
- func RenameKeyCommand() *cobra.Command
- func ShowKeysCmd() *cobra.Command
- type AddNewKey
- type DeleteKeyReq
- type KeyOutput
- func MkAccKeyOutput(k *keyring.Record) (KeyOutput, error)
- func MkAccKeysOutput(records []*keyring.Record) ([]KeyOutput, error)
- func MkConsKeyOutput(k *keyring.Record) (KeyOutput, error)
- func MkValKeyOutput(k *keyring.Record) (KeyOutput, error)
- func NewKeyOutput(name string, keyType keyring.KeyType, a sdk.Address, pk cryptotypes.PubKey) (KeyOutput, error)
- type RecoverKey
- type UpdateKeyReq
Constants ¶
const ( // FlagAddress is the flag for the user's address on the command line. FlagAddress = "address" // FlagPublicKey represents the user's public key on the command line. FlagPublicKey = "pubkey" // FlagBechPrefix defines a desired Bech32 prefix encoding for a key. FlagBechPrefix = "bech" // FlagDevice indicates that the information should be shown in the device FlagDevice = "device" )
const ( OutputFormatText = "text" OutputFormatJSON = "json" )
available output formats.
const (
// DefaultKeyPass contains the default key password for genesis transactions
DefaultKeyPass = "12345678"
)
Variables ¶
This section is empty.
Functions ¶
func AddKeyCommand ¶ added in v0.48.84
AddKeyCommand defines a keys command to add a generated or recovered private key to keybase.
func Commands ¶
Commands registers a sub-tree of commands to interact with local private key storage.
func DeleteKeyCommand ¶ added in v0.48.84
DeleteKeyCommand deletes a key from the key store.
func ExportKeyCommand ¶ added in v0.48.84
ExportKeyCommand exports private keys from the key store.
func ImportKeyCommand ¶ added in v0.48.84
ImportKeyCommand imports private keys from a keyfile.
func ListKeysCmd ¶ added in v0.48.84
ListKeysCmd lists all keys in the key store.
func MigrateCommand ¶ added in v0.48.84
MigrateCommand migrates key information from legacy keybase to OS secret store.
func MnemonicKeyCommand ¶ added in v0.48.84
MnemonicKeyCommand computes the bip39 memonic for input entropy.
func ParseKeyStringCommand ¶ added in v0.48.84
ParseKeyStringCommand parses an address from hex to bech32 and vice versa.
func RenameKeyCommand ¶ added in v0.48.84
RenameKeyCommand renames a key from the key store.
func ShowKeysCmd ¶ added in v0.48.84
ShowKeysCmd shows key information for a given key name.
Types ¶
type AddNewKey ¶ added in v0.31.0
type AddNewKey struct { Name string `json:"name"` Password string `json:"password"` Mnemonic string `json:"mnemonic"` Account int `json:"account,string,omitempty"` Index int `json:"index,string,omitempty"` }
AddNewKey request a new key
func NewAddNewKey ¶ added in v0.48.84
NewAddNewKey constructs a new AddNewKey request structure.
type DeleteKeyReq ¶ added in v0.31.0
type DeleteKeyReq struct {
Password string `json:"password"`
}
DeleteKeyReq requests deleting a key
func NewDeleteKeyReq ¶ added in v0.48.84
func NewDeleteKeyReq(password string) DeleteKeyReq
NewDeleteKeyReq constructs a new DeleteKeyReq structure.
type KeyOutput ¶
type KeyOutput struct { Name string `json:"name" yaml:"name"` Type string `json:"type" yaml:"type"` Address string `json:"address" yaml:"address"` PubKey string `json:"pubkey" yaml:"pubkey"` Mnemonic string `json:"mnemonic,omitempty" yaml:"mnemonic"` }
KeyOutput defines a structure wrapping around an Info object used for output functionality.
func MkAccKeyOutput ¶ added in v0.48.84
MkAccKeyOutput create a KeyOutput in with "acc" Bech32 prefixes. If the public key is a multisig public key, then the threshold and constituent public keys will be added.
func MkAccKeysOutput ¶ added in v0.48.84
MkAccKeysOutput returns a slice of KeyOutput objects, each with the "acc" Bech32 prefixes, given a slice of Record objects. It returns an error if any call to MkKeyOutput fails.
func MkConsKeyOutput ¶ added in v0.48.84
MkConsKeyOutput create a KeyOutput in with "cons" Bech32 prefixes.
func MkValKeyOutput ¶ added in v0.48.84
MkValKeyOutput create a KeyOutput in with "val" Bech32 prefixes.
type RecoverKey ¶ added in v0.31.0
type RecoverKey struct { Password string `json:"password"` Mnemonic string `json:"mnemonic"` Account int `json:"account,string,omitempty"` Index int `json:"index,string,omitempty"` }
RecoverKeyBody recovers a key
func NewRecoverKey ¶ added in v0.48.84
func NewRecoverKey(password, mnemonic string, account, index int) RecoverKey
NewRecoverKey constructs a new RecoverKey request structure.
type UpdateKeyReq ¶ added in v0.31.0
type UpdateKeyReq struct { OldPassword string `json:"old_password"` NewPassword string `json:"new_password"` }
UpdateKeyReq requests updating a key
func NewUpdateKeyReq ¶ added in v0.48.84
func NewUpdateKeyReq(old, new string) UpdateKeyReq
NewUpdateKeyReq constructs a new UpdateKeyReq structure.