wallet
Package wallet provides multi-chain wallet implementation.
import "github.com/luxfi/sdk/wallet"Package wallet provides multi-chain wallet implementation.
Types
PQWallet
PQWallet is the post-quantum native wallet facade. It stores PQAccounts (ML-DSA-65) and RecoveryAccounts (SLH-DSA-SHAKE-192s) by their canonical 48-byte AccountID, exposes Sign on accounts by ID, and is safe for concurrent use across goroutines.
PQWallet is intentionally separate from the secp256k1 Wallet type in this package: classical-compat keys live in a strictly disjoint keyring so a chain that refuses WalletSchemeSecp256k1 cannot accidentally see one. Callers that mix classical and PQ keys hold both Wallet and PQWallet instances.
func NewPQWallet() *PQWalletfunc (w *PQWallet) Account(id account.AccountID) (*account.PQAccount, bool)func (w *PQWallet) AccountIDs() []account.AccountIDfunc (w *PQWallet) AddAccount(a *account.PQAccount) errorfunc (w *PQWallet) AddRecovery(r *account.RecoveryAccount) errorfunc (w *PQWallet) Recovery(id account.AccountID) (*account.RecoveryAccount, bool)func (w *PQWallet) RemoveAccount(id account.AccountID) boolfunc (w *PQWallet) SignTx(id account.AccountID, env account.TxAuthEnvelope) errorTransferInput
TransferInput represents an input to a transfer transaction
TransferOutput
TransferOutput represents an output from a transfer transaction
TransferTx
TransferTx represents a transfer transaction
UTXO
UTXO represents an unspent transaction output
Wallet
Wallet manages keys and transactions for personal usage
func New(networkID uint32, chainID ids.ID) *Walletfunc (w *Wallet) AddUTXO(utxo *UTXO)func (w *Wallet) CreateTransferTx(
to ids.ShortID,
assetID ids.ID,
amount uint64,
memo []byte,
) (*TransferTx, error)func (w *Wallet) GenerateKey() (ids.ShortID, error)func (w *Wallet) GetAddress() (ids.ShortID, error)func (w *Wallet) GetAllAddresses() []ids.ShortIDfunc (w *Wallet) GetBLSKey() (*bls.SecretKey, error)func (w *Wallet) GetBalance(assetID ids.ID) uint64func (w *Wallet) GetUTXOs(assetID ids.ID, amount uint64) ([]*UTXO, uint64, error)func (w *Wallet) ImportKey(privateKey crypto.PrivateKey) (ids.ShortID, error)func (w *Wallet) RemoveUTXO(utxoID ids.ID)func (w *Wallet) SetBLSKey(key *bls.SecretKey)func (w *Wallet) Sign(ctx context.Context, tx chain.Transaction) error