keychain

package
v1.11.14 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: BSD-3-Clause Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keychain

type Keychain interface {
	Addresses() []ids.ShortID
	Get(ids.ShortID) (Signer, bool)
}

Keychain interface that wallet signers can use This allows both secp256k1fx.Keychain and ledger-lux-go/keychain.Keychain to be used Generic across chains, DAGs, and post-quantum crypto

func NewLedgerKeychain

func NewLedgerKeychain(kc *ledgerkeychain.Keychain) Keychain

NewLedgerKeychain creates a new adapter from ledger-lux-go/keychain.Keychain

type LedgerKeychain

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

LedgerKeychain adapts a ledger-lux-go/keychain.Keychain to implement the Keychain interface

func (*LedgerKeychain) Addresses

func (l *LedgerKeychain) Addresses() []ids.ShortID

func (*LedgerKeychain) Get

func (l *LedgerKeychain) Get(addr ids.ShortID) (Signer, bool)

type Secp256k1fxKeychain

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

Secp256k1fxKeychain adapts a secp256k1fx.Keychain to implement the Keychain interface

func NewSecp256k1fxKeychain

func NewSecp256k1fxKeychain(kc *secp256k1fx.Keychain) *Secp256k1fxKeychain

NewSecp256k1fxKeychain creates a new adapter from secp256k1fx.Keychain

func (*Secp256k1fxKeychain) Addresses

func (a *Secp256k1fxKeychain) Addresses() []ids.ShortID

func (*Secp256k1fxKeychain) EthAddresses

func (a *Secp256k1fxKeychain) EthAddresses() set.Set[common.Address]

EthAddresses implements c.EthKeychain

func (*Secp256k1fxKeychain) Get

func (a *Secp256k1fxKeychain) Get(addr ids.ShortID) (Signer, bool)

func (*Secp256k1fxKeychain) GetEth

func (a *Secp256k1fxKeychain) GetEth(addr common.Address) (Signer, bool)

GetEth implements c.EthKeychain

type Signer

type Signer interface {
	SignHash([]byte) ([]byte, error)
	Sign([]byte) ([]byte, error)
	Address() ids.ShortID
}

Signer interface for signing operations Generic interface for all signing needs (classical and post-quantum)

type WalletKeychain

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

WalletKeychain provides both LUX and Eth keychain functionality for wallets

func NewWalletKeychain

func NewWalletKeychain(kc *secp256k1fx.Keychain) *WalletKeychain

NewWalletKeychain creates a new wallet keychain from secp256k1fx.Keychain

func (*WalletKeychain) Addresses

func (w *WalletKeychain) Addresses() []ids.ShortID

Addresses implements Keychain

func (*WalletKeychain) EthAddresses

func (w *WalletKeychain) EthAddresses() set.Set[common.Address]

EthAddresses returns Ethereum addresses

func (*WalletKeychain) Get

func (w *WalletKeychain) Get(addr ids.ShortID) (Signer, bool)

Get implements Keychain

func (*WalletKeychain) GetEth

func (w *WalletKeychain) GetEth(addr common.Address) (Signer, bool)

GetEth returns a signer for an Ethereum address

Jump to

Keyboard shortcuts

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