clef

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 13 Imported by: 2 modules, 1 package

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

View Source
var (
	ErrNoAccounts          = errors.New("no accounts found in clef")
	ErrAccountNotAvailable = errors.New("account not available in clef")
)

Functions

func DefaultIpcPath

func DefaultIpcPath() (string, error)

DefaultIpcPath returns the os-dependent default ipc path for clef.

func NewSigner

func NewSigner(clef ExternalSignerInterface, client Client, recoverFunc crypto.RecoverFunc, ethAddress *common.Address) (signer crypto.Signer, err error)

NewSigner creates a new connection to the signer at endpoint. If ethAddress is nil the account with index 0 will be selected. Otherwise it will verify the requested account actually exists. As clef does not expose public keys it signs a test message to recover the public key.

Types

type Client

type Client interface {
	Call(result interface{}, method string, args ...interface{}) error
}

Client is the interface for rpc.RpcClient.

type ExternalSignerInterface

type ExternalSignerInterface interface {
	SignData(account accounts.Account, mimeType string, data []byte) ([]byte, error)
	SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
	Accounts() []accounts.Account
}

ExternalSignerInterface is the interface for the clef client from go-ethereum.

Jump to

Keyboard shortcuts

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