keychain
Package keychain provides key management and keychain utilities.
import "github.com/luxfi/sdk/keychain"Package keychain provides key management and keychain utilities.
Types
Keychain
func NewKeychain(
network network.Network,
keyPath string,
ledgerInfo *LedgerParams,
) (*Keychain, error)func (kc *Keychain) AddLedgerAddresses(addresses []string) errorfunc (kc *Keychain) AddLedgerFunds(amount uint64) errorfunc (kc *Keychain) AddLedgerIndices(indices []uint32) errorfunc (kc *Keychain) LedgerEnabled() boolLedger
Ledger is part of the output of NewKeyChain if a new keychain is to be created using Ledger
LedgerParams
LedgerParams is an input to NewKeyChain if a new keychain is to be created using Ledger
To view Ledger addresses and their balances, you can use Lux CLI and use the command lux key list --ledger [0,1,2,3,4] The example command above will list the first five addresses in your Ledger
To transfer funds between addresses in Ledger, refer to https://docs.lux.network/tooling/cli-transfer-funds/how-to-transfer-funds