keys

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: LGPL-3.0, MIT Imports: 13 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressChecker

type AddressChecker interface {
	// CheckEnabled returns an error if address is not enabled.
	CheckEnabled(ctx context.Context, address common.Address) error
}

type AddressLister

type AddressLister interface {
	// EnabledAddresses returns a slice of enabled addresses.
	EnabledAddresses(ctx context.Context) (addresses []common.Address, err error)
}

type Addresses

type Addresses interface {
	AddressChecker
	AddressLister
}

type ChainStore

type ChainStore interface {
	Store
	TxSigner
}

ChainStore extends Store with methods that require a chain ID.

func NewChainStore

func NewChainStore(ks core.Keystore, chainID *big.Int) ChainStore

NewChainStore returns a new ChainStore for chainID backed by ks.

type Locker

type Locker interface {
	GetMutex(address common.Address) *Mutex
}

type MessageSigner

type MessageSigner interface {
	// SignMessage signs the given message with the key for address.
	// See [accounts.TextHash]
	SignMessage(ctx context.Context, address common.Address, message []byte) ([]byte, error)
}

type Mutex

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

func (*Mutex) IsLocked

func (m *Mutex) IsLocked(serviceType ServiceType) bool

IsLocked checks if the resource is locked by a specific service type.

func (*Mutex) TryLock

func (m *Mutex) TryLock(serviceType ServiceType) error

TryLock attempts to lock the resource for the specified service type. It returns an error if the resource is locked by a different service type.

func (*Mutex) Unlock

func (m *Mutex) Unlock(serviceType ServiceType) error

Unlock releases the lock for the service type

type RoundRobin

type RoundRobin interface {
	// GetNextAddress returns the next address to use from addresses, in round-robin order.
	GetNextAddress(ctx context.Context, addresses ...common.Address) (address common.Address, err error)
}

type ServiceType

type ServiceType int
const (
	TXMv1 ServiceType = iota
	TXMv2
)

type Signer

type Signer interface {
	// Sign signs bytes with the key for address.
	Sign(ctx context.Context, address common.Address, bytes []byte) ([]byte, error)
}

type Store

func NewStore

func NewStore(ks core.Keystore) Store

NewStore returns a new Store backed by ks.

type TxSigner

type TxSigner interface {
	// SignTx signs the given tx with the key for fromAddress.
	SignTx(ctx context.Context, fromAddress common.Address, tx *types.Transaction) (*types.Transaction, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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