keys

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutputFormatText = "text"
	OutputFormatJSON = "json"
)

available output formats.

View Source
const (
	// FlagAddress is the flag for the user's address on the command line.
	FlagAddress = "address"
	// FlagEip55Address is the flag for the user's EIP address on the command line.
	FlagEip55Address = "eip-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"
)

Variables

This section is empty.

Functions

func AddKeyCommand

func AddKeyCommand() *cobra.Command

AddKeyCommand defines a keys command to add a generated or recovered private key to keybase.

func ExportKeyCommand

func ExportKeyCommand() *cobra.Command

ExportKeyCommand exports private keys from the key store.

func ImportKeyCommand

func ImportKeyCommand() *cobra.Command

func ListKeysCmd

func ListKeysCmd() *cobra.Command

ListKeysCmd lists all keys in the key store.

func ParseAddressCommand

func ParseAddressCommand() *cobra.Command

func ShowKeysCmd

func ShowKeysCmd() *cobra.Command

ShowKeysCmd shows key information for a given key name.

Types

type KeyOutput

type KeyOutput struct {
	Name         string `json:"name" yaml:"name"`
	Type         string `json:"type" yaml:"type"`
	Eip55Address string `json:"eip55_address,omitempty" yaml:"eip55_address,omitempty"`
	Address      string `json:"address" yaml:"address"`
	PubKey       string `json:"pubkey" yaml:"pubkey"`
	Mnemonic     string `json:"mnemonic,omitempty" yaml:"mnemonic,omitempty"`
	Algo         string `json:"algo" yaml:"algo"`
}

KeyOutput defines a structure wrapping around an Info object used for output functionality.

func MkAccKeyOutput

func MkAccKeyOutput(keyInfo keyring.Info) (KeyOutput, error)

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

func MkAccKeysOutput(infos []keyring.Info) ([]KeyOutput, error)

MkAccKeysOutput returns a slice of KeyOutput objects, each with the "acc" Bech32 prefixes, given a slice of Info objects. It returns an error if any call to MkKeyOutput fails.

func MkConsKeyOutput

func MkConsKeyOutput(keyInfo keyring.Info) (KeyOutput, error)

MkConsKeyOutput create a KeyOutput in with "cons" Bech32 prefixes.

func MkValKeyOutput

func MkValKeyOutput(keyInfo keyring.Info) (KeyOutput, error)

MkValKeyOutput create a KeyOutput in with "val" Bech32 prefixes.

func NewKeyOutput

func NewKeyOutput(keyInfo keyring.Info, a sdk.Address) (KeyOutput, error)

NewKeyOutput creates a default KeyOutput instance without Mnemonic, Threshold and PubKeys

Jump to

Keyboard shortcuts

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