mirror of
https://github.com/luxfi/sdk.git
synced 2026-10-30 15:19:23 +00:00
- Migrate from github.com/luxfi/const to github.com/luxfi/constants - Update all wallet, validatormanager, and utility imports
26 lines
717 B
Go
26 lines
717 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package keychain
|
|
|
|
import (
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/math/set"
|
|
)
|
|
|
|
// 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
|
|
type Keychain interface {
|
|
Addresses() set.Set[ids.ShortID]
|
|
Get(ids.ShortID) (Signer, bool)
|
|
}
|
|
|
|
// Signer interface for signing operations
|
|
// Generic interface for all signing needs (classical and post-quantum)
|
|
type Signer interface {
|
|
SignHash([]byte) ([]byte, error)
|
|
Sign([]byte) ([]byte, error)
|
|
Address() ids.ShortID
|
|
}
|