keys

package
v0.0.0-...-cda3398 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBech32ifyPubKey is an error when Bech32ifyPubKey fails
	ErrBech32ifyPubKey = errors.New("Bech32ifyPubKey fail in main")

	// ErrNewPubKey is an error when NewPubKey fails
	ErrNewPubKey = errors.New("NewPubKey error from string")
)

Functions

func GetGranteeKeyName

func GetGranteeKeyName(signerName string) string

GetGranteeKeyName return the grantee name

func GetKeyringKeybase

func GetKeyringKeybase(cfg config.Config, hotkeyPassword string) (ckeys.Keyring, string, error)

GetKeyringKeybase return keyring and key info

func IsRelayerPrivateKeyValid

func IsRelayerPrivateKeyValid(privateKey string, network chains.Network) bool

IsRelayerPrivateKeyValid checks if the given private key is valid for the given network

func ResolveRelayerKeyFile

func ResolveRelayerKeyFile(relayerKeyPath string, network chains.Network) (string, error)

ResolveRelayerKeyFile is a helper function to resolve the relayer key file with full path

func WriteRelayerKeyToFile

func WriteRelayerKeyToFile(fileName string, relayerKey RelayerKey) error

WriteRelayerKeyToFile writes the relayer key to a file

Types

type Keys

type Keys struct {
	OperatorAddress sdk.AccAddress
	// contains filtered or unexported fields
}

Keys manages all the keys used by zeta client

func NewKeysWithKeybase

func NewKeysWithKeybase(
	kb ckeys.Keyring,
	granterAddress sdk.AccAddress,
	granteeName string,
	hotkeyPassword string,
) *Keys

NewKeysWithKeybase create a new instance of Keys

func (*Keys) GetAddress

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

GetAddress return the signer address

func (*Keys) GetHotkeyPassword

func (k *Keys) GetHotkeyPassword() string

GetHotkeyPassword returns the password to be used returns empty if no password is needed

func (*Keys) GetKeybase

func (k *Keys) GetKeybase() ckeys.Keyring

GetKeybase return the keybase

func (*Keys) GetOperatorAddress

func (k *Keys) GetOperatorAddress() sdk.AccAddress

GetOperatorAddress return the operator address

func (*Keys) GetPrivateKey

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

GetPrivateKey return the private key

func (*Keys) GetPubKeySet

func (k *Keys) GetPubKeySet(password string) (zetacrypto.PubKeySet, error)

func (*Keys) GetSignerInfo

func (k *Keys) GetSignerInfo() *ckeys.Record

GetSignerInfo return signer info

type RelayerKey

type RelayerKey struct {
	PrivateKey string `json:"private_key"`
}

RelayerKey is the structure that holds the relayer private key

func LoadRelayerKey

func LoadRelayerKey(relayerKeyPath string, network chains.Network, password string) (*RelayerKey, error)

LoadRelayerKey loads the relayer key for given network and password

func ReadRelayerKeyFromFile

func ReadRelayerKeyFromFile(fileName string) (*RelayerKey, error)

ReadRelayerKeyFromFile reads the relayer key file and returns the key

func (RelayerKey) ResolveAddress

func (rk RelayerKey) ResolveAddress(network chains.Network) (string, string, error)

ResolveAddress returns the network name and address of the relayer key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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