keyring

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 5 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntegrationKeyring

type IntegrationKeyring struct {
	// contains filtered or unexported fields
}

IntegrationKeyring is a keyring designed for integration tests.

func (*IntegrationKeyring) AddKey

func (kr *IntegrationKeyring) AddKey() int

AddKey adds a new account to the keyring. It returns the index for the key.

func (*IntegrationKeyring) GetAccAddr

func (kr *IntegrationKeyring) GetAccAddr(index int) sdktypes.AccAddress

GetAccAddr returns the sdk address of the specified account.

func (*IntegrationKeyring) GetAddr

func (kr *IntegrationKeyring) GetAddr(index int) common.Address

GetAddr returns the address of the specified account.

func (*IntegrationKeyring) GetAllAccAddrs

func (kr *IntegrationKeyring) GetAllAccAddrs() []sdktypes.AccAddress

GetAllAccAddrs returns all the sdk addresses of the accounts in the keyring.

func (*IntegrationKeyring) GetKey

func (kr *IntegrationKeyring) GetKey(index int) Key

GetKey returns the key specified by index.

func (*IntegrationKeyring) GetKeys

func (kr *IntegrationKeyring) GetKeys() []Key

GetKeys returns all keys from the keyring.

func (*IntegrationKeyring) GetPrivKey

func (kr *IntegrationKeyring) GetPrivKey(index int) cryptotypes.PrivKey

GetPrivKey returns the private key of the specified account.

func (*IntegrationKeyring) Sign

func (kr *IntegrationKeyring) Sign(index int, msg []byte) ([]byte, error)

Sign signs message with the specified key.

type Key

type Key struct {
	Addr    common.Address
	AccAddr sdktypes.AccAddress
	Priv    cryptotypes.PrivKey
}

func NewKey

func NewKey() Key

type Keyring

type Keyring interface {
	// GetPrivKey returns the private key of the account at the given keyring index.
	GetPrivKey(index int) cryptotypes.PrivKey
	// GetAddr returns the address of the account at the given keyring index.
	GetAddr(index int) common.Address
	// GetAccAddr returns the SDK address of the account at the given keyring index.
	GetAccAddr(index int) sdktypes.AccAddress
	// GetAllAccAddrs returns all the SDK addresses of the accounts in the keyring.
	GetAllAccAddrs() []sdktypes.AccAddress
	// GetKey returns the key at the given keyring index
	GetKey(index int) Key
	// GetKeys returns all the keys
	GetKeys() []Key

	// AddKey adds a new account to the keyring
	AddKey() int

	// Sign signs message with the specified account.
	Sign(index int, msg []byte) ([]byte, error)
}

func New

func New(nAccs int) Keyring

New returns a new keyring with nAccs accounts.

Jump to

Keyboard shortcuts

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