wallet

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 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

func GetBlsFromSecret

func GetBlsFromSecret(secretsManager secrets.SecretsManager) (*bls.PrivateKey, error)

GetBlsFromSecret retrieves BLS key by using provided secretsManager

func GetEcdsaFromSecret

func GetEcdsaFromSecret(secretsManager secrets.SecretsManager) (*wallet.Key, error)

GetEcdsaFromSecret retrieves validator(ECDSA) key by using provided secretsManager

func RecoverAddressFromSignature

func RecoverAddressFromSignature(sig, rawContent []byte) (types.Address, error)

RecoverAddressFromSignature calculates keccak256 hash of provided rawContent and recovers signer address from given signature and hash

Types

type Account

type Account struct {
	Ecdsa *wallet.Key
	Bls   *bls.PrivateKey
}

Account is an account for key signatures

func GenerateAccount

func GenerateAccount() (*Account, error)

GenerateAccount generates a new random account

func NewAccountFromSecret

func NewAccountFromSecret(secretsManager secrets.SecretsManager) (*Account, error)

NewAccountFromSecret creates new account by using provided secretsManager

func (Account) Address

func (a Account) Address() types.Address

func (*Account) GetEcdsaPrivateKey

func (a *Account) GetEcdsaPrivateKey() (*ecdsa.PrivateKey, error)

func (*Account) Save

func (a *Account) Save(secretsManager secrets.SecretsManager) (err error)

Save persists ECDSA and BLS private keys to the SecretsManager

type ECDSASigner

type ECDSASigner struct {
	*Key
}

ECDSASigner implements ethgo.Key interface and it is used for signing using provided ECDSA key

func NewEcdsaSigner

func NewEcdsaSigner(ecdsaKey *Key) *ECDSASigner

func (*ECDSASigner) Sign

func (k *ECDSASigner) Sign(b []byte) ([]byte, error)

type Key

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

func NewKey

func NewKey(raw *Account) *Key

func (*Key) Address

func (k *Key) Address() ethgo.Address

Address returns ECDSA address

func (*Key) Sign

func (k *Key) Sign(digest []byte) ([]byte, error)

Sign signs the provided digest with BLS key Used only to sign transactions

func (*Key) SignIBFTMessage

func (k *Key) SignIBFTMessage(msg *proto.Message) (*proto.Message, error)

SignIBFTMessage signs the IBFT consensus message with ECDSA key

func (*Key) SignWithDomain

func (k *Key) SignWithDomain(digest, domain []byte) ([]byte, error)

SignWithDomain signs the provided digest with BLS key and provided domain

func (*Key) String

func (k *Key) String() string

String returns hex encoded ECDSA address

Jump to

Keyboard shortcuts

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