keys

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateInterfaceRegistryWithEVMSupport

func CreateInterfaceRegistryWithEVMSupport() codectypes.InterfaceRegistry

CreateInterfaceRegistryWithEVMSupport creates an interface registry with EVM-compatible key types

func CreateKeyring

func CreateKeyring(homeDir string, reader io.Reader, keyringBackend KeyringBackend) (keyring.Keyring, error)

CreateKeyring creates a keyring with EVM compatibility

func CreateKeyringFromConfig

func CreateKeyringFromConfig(homeDir string, reader io.Reader, configBackend config.KeyringBackend) (keyring.Keyring, error)

CreateKeyringFromConfig creates a keyring with EVM compatibility from config backend type

func CreateNewKey

func CreateNewKey(kr keyring.Keyring, name string, mnemonic string, passphrase string) (*keyring.Record, error)

CreateNewKey creates a new key in the keyring

func CreateNewKeyWithMnemonic

func CreateNewKeyWithMnemonic(kr keyring.Keyring, name string, mnemonic string, passphrase string) (*keyring.Record, string, error)

CreateNewKeyWithMnemonic creates a new key in the keyring and returns both the record and generated mnemonic

func GetKeyringKeybase

func GetKeyringKeybase(config KeyringConfig) (keyring.Keyring, string, error)

GetKeyringKeybase creates and returns keyring and key info

func ValidateKeyExists

func ValidateKeyExists(keyring keyring.Keyring, keyName string) error

ValidateKeyExists checks if a key exists in the keyring

Types

type KeyringBackend

type KeyringBackend string

KeyringBackend represents the type of keyring backend to use

const (
	// KeyringBackendTest is the test Cosmos keyring backend (unencrypted)
	KeyringBackendTest KeyringBackend = "test"

	// KeyringBackendFile is the file Cosmos keyring backend (encrypted)
	KeyringBackendFile KeyringBackend = "file"
)

func (KeyringBackend) String

func (kb KeyringBackend) String() string

String returns the string representation of the keyring backend

type KeyringConfig

type KeyringConfig struct {
	HomeDir        string
	KeyringBackend KeyringBackend
	HotkeyName     string
	HotkeyPassword string
	OperatorAddr   string
}

KeyringConfig holds configuration for keyring initialization

type Keys

type Keys struct {
	OperatorAddress sdk.AccAddress // Operator (validator) address for reference
	// contains filtered or unexported fields
}

Keys manages all the keys used by Universal Validator

func NewKeysWithKeybase

func NewKeysWithKeybase(
	kb keyring.Keyring,
	operatorAddress sdk.AccAddress,
	hotkeyName string,
	hotkeyPassword string,
) *Keys

NewKeysWithKeybase creates a new instance of Keys

func (*Keys) GetAddress

func (k *Keys) GetAddress() (sdk.AccAddress, error)

GetAddress returns the hot key address

func (*Keys) GetHotkeyPassword

func (k *Keys) GetHotkeyPassword() string

GetHotkeyPassword returns the password to be used returns empty if no password is needed (test backend)

func (*Keys) GetPrivateKey

func (k *Keys) GetPrivateKey(password string) (cryptotypes.PrivKey, error)

GetPrivateKey returns the private key (requires password for file backend)

type UniversalValidatorKeys

type UniversalValidatorKeys interface {
	// GetAddress returns the hot key address
	GetAddress() (sdk.AccAddress, error)

	// GetPrivateKey returns the hot key private key (requires password)
	GetPrivateKey(password string) (cryptotypes.PrivKey, error)

	// GetHotkeyPassword returns the password for file backend
	GetHotkeyPassword() string
}

UniversalValidatorKeys defines the interface for key management in Universal Validator

Jump to

Keyboard shortcuts

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