Documentation ¶
Index ¶
- Constants
- Variables
- 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 MarshalJSON(o interface{}) ([]byte, error)
- func MnemonicKeyCommand() *cobra.Command
- func ParseKeyStringCommand() *cobra.Command
- func ShowKeysCmd() *cobra.Command
- func UnmarshalJSON(bz []byte, ptr interface{}) error
- type AddNewKey
- type DeleteKeyReq
- 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 ( // CoinTypeNotAssigned means a coin type not assigned // finschia-sdk cannot support the coin type MaxUint32 CoinTypeNotAssigned = math.MaxUint32 )
Variables ¶
var KeysCdc *codec.LegacyAmino
KeysCdc defines codec to be used with key operations
Functions ¶
func AddKeyCommand ¶ added in v0.47.0
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.47.0
DeleteKeyCommand deletes a key from the key store.
func ExportKeyCommand ¶ added in v0.47.0
ExportKeyCommand exports private keys from the key store.
func ImportKeyCommand ¶ added in v0.47.0
ImportKeyCommand imports private keys from a keyfile.
func ListKeysCmd ¶ added in v0.47.0
ListKeysCmd lists all keys in the key store.
func MnemonicKeyCommand ¶ added in v0.47.0
MnemonicKeyCommand computes the bip39 memonic for input entropy.
func ParseKeyStringCommand ¶ added in v0.47.0
ParseKeyStringCommand parses an address from hex to bech32 and vice versa.
func ShowKeysCmd ¶ added in v0.47.0
ShowKeysCmd shows key information for a given key name.
func UnmarshalJSON ¶ added in v0.16.0
unmarshal json
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.47.0
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.47.0
func NewDeleteKeyReq(password string) DeleteKeyReq
NewDeleteKeyReq constructs a new DeleteKeyReq structure.
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.47.0
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.47.0
func NewUpdateKeyReq(old, new string) UpdateKeyReq
NewUpdateKeyReq constructs a new UpdateKeyReq structure.