using NBitcoin; using PalladiumWallet.Core.Chain; namespace PalladiumWallet.Core.Crypto; /// /// Abstraction over all wallet account types (HD from seed, HD from imported xpub/xprv, /// imported WIF keys). Allows WalletSynchronizer and TransactionFactory to operate /// independently of the underlying keystore type (blueprint §4.4–§4.5). /// public interface IWalletAccount { ScriptKind Kind { get; } ChainProfile Profile { get; } /// True if the account cannot sign (no private keys present). bool IsWatchOnly { get; } BitcoinAddress GetAddress(bool isChange, int index); BitcoinAddress GetReceiveAddress(int index); BitcoinAddress GetChangeAddress(int index); /// Null if the public key cannot be derived from the account (pure watch-only addresses). PubKey? GetPublicKey(bool isChange, int index); /// Null if the account is watch-only or the index is out of range. Key? GetPrivateKey(bool isChange, int index); /// /// For accounts with fixed addresses (imported WIF keys) returns the full list /// to scan; null for HD accounts that use the gap limit. /// IReadOnlyList<(BitcoinAddress Address, bool IsChange, int Index)>? FixedAddresses { get; } }