Paymetheus.Decred.Wallet.Wallet.Wallet C# (CSharp) Method

Wallet() public method

public Wallet ( BlockChainIdentity activeChain, TransactionSet txSet, List bip0032Accounts, Paymetheus.Decred.Wallet.AccountProperties importedAccount, BlockIdentity chainTip ) : Paymetheus.Decred.Util
activeChain BlockChainIdentity
txSet TransactionSet
bip0032Accounts List
importedAccount Paymetheus.Decred.Wallet.AccountProperties
chainTip BlockIdentity
return Paymetheus.Decred.Util
        public Wallet(BlockChainIdentity activeChain, TransactionSet txSet, List<AccountProperties> bip0032Accounts,
            AccountProperties importedAccount, BlockIdentity chainTip)
        {
            if (activeChain == null)
                throw new ArgumentNullException(nameof(activeChain));
            if (bip0032Accounts == null)
                throw new ArgumentNullException(nameof(bip0032Accounts));
            if (importedAccount == null)
                throw new ArgumentNullException(nameof(importedAccount));
            if (chainTip == null)
                throw new ArgumentNullException(nameof(chainTip));

            _transactionCount = txSet.MinedTransactions.Aggregate(0, (acc, b) => acc + b.Transactions.Count) +
                txSet.UnminedTransactions.Count;
            _bip0032Accounts = bip0032Accounts;
            _importedAccount = importedAccount;

            var totalBalance = EnumerateAccounts().Aggregate((Amount)0, (acc, a) => acc + a.Item2.TotalBalance);

            ActiveChain = activeChain;
            RecentTransactions = txSet;
            TotalBalance = totalBalance;
            ChainTip = chainTip;
        }