Documentation ¶
Index ¶
- Variables
- type Keyring
- type KeyringImpl
- func (k *KeyringImpl) GetPubKey(name string) (types.PubKey, error)
- func (k *KeyringImpl) KeyInfo(nameOrAddr string) (string, string, uint, error)
- func (k *KeyringImpl) KeyType(name string) (uint, error)
- func (k *KeyringImpl) List() ([]string, error)
- func (k *KeyringImpl) LookupAddressByKeyName(name string) ([]byte, error)
- func (k *KeyringImpl) Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error)
- type NoKeyring
- func (k NoKeyring) GetPubKey(name string) (cryptotypes.PubKey, error)
- func (k NoKeyring) KeyInfo(name string) (string, string, uint, error)
- func (k NoKeyring) KeyType(name string) (uint, error)
- func (k NoKeyring) List() ([]string, error)
- func (k NoKeyring) LookupAddressByKeyName(name string) ([]byte, error)
- func (k NoKeyring) Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var KeyringContextKey keyringContextKey
KeyringContextKey is the key used to store the keyring in the context. The keyring must be wrapped using the KeyringImpl.
Functions ¶
This section is empty.
Types ¶
type Keyring ¶
type Keyring interface { // List returns the names of all keys stored in the keyring. List() ([]string, error) // LookupAddressByKeyName returns the address of the key with the given name. LookupAddressByKeyName(name string) ([]byte, error) // GetPubKey returns the public key of the key with the given name. GetPubKey(name string) (cryptotypes.PubKey, error) // Sign signs the given bytes with the key with the given name. Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error) // KeyType returns the type of the key. KeyType(name string) (uint, error) // KeyInfo given a key name or address returns key name, key address and key type. KeyInfo(nameOrAddr string) (string, string, uint, error) }
Keyring is an interface used for signing transactions. It aims to be simplistic and easy to use.
func NewKeyringFromFlags ¶
func NewKeyringFromFlags(flagSet *pflag.FlagSet, ac address.Codec, input io.Reader, cdc codec.Codec, opts ...keyring.Option) (Keyring, error)
NewKeyringFromFlags creates a new Keyring instance based on command-line flags. It retrieves the keyring backend and directory from flags, creates a new keyring, and wraps it with an AutoCLI-compatible interface.
type KeyringImpl ¶
type KeyringImpl struct {
// contains filtered or unexported fields
}
func NewKeyringImpl ¶
func NewKeyringImpl(k Keyring) *KeyringImpl
func (*KeyringImpl) GetPubKey ¶
func (k *KeyringImpl) GetPubKey(name string) (types.PubKey, error)
GetPubKey implements Keyring.
func (*KeyringImpl) KeyInfo ¶
KeyInfo given a key name or address returns key name, key address and key type.
func (*KeyringImpl) KeyType ¶
func (k *KeyringImpl) KeyType(name string) (uint, error)
KeyType returns the type of the key.
func (*KeyringImpl) LookupAddressByKeyName ¶
func (k *KeyringImpl) LookupAddressByKeyName(name string) ([]byte, error)
LookupAddressByKeyName implements Keyring.
func (*KeyringImpl) Sign ¶
func (k *KeyringImpl) Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error)
Sign implements Keyring.
Click to show internal directories.
Click to hide internal directories.