internal void ReadAccount() { this.Account = HDAccount.GetAccount(this.conn, this.WalletId, this.AccountIndex); this.AddressCount = HDAddress.GetAddressCount(this.conn, this.WalletId, this.AccountIndex, this.AddressType); this.NextAddressIndex = HDAddress.GetNextAddressIndex(this.conn, this.WalletId, this.AccountIndex, this.AddressType); this.IsWatchOnlyAccount = this.Account.ExtPubKey == null; }
internal static HdAccount ToHdAccount(this SQLiteWalletRepository repo, HDAccount account) { return(new HdAccount() { Name = account.AccountName, CreationTime = DateTimeOffset.FromUnixTimeSeconds(account.CreationTime), ExtendedPubKey = account.ExtPubKey, Index = account.AccountIndex, HdPath = repo.ToHdPath(account.AccountIndex) }); }
internal static HdAccount ToHdAccount(this SQLiteWalletRepository repo, HDAccount account) { var res = new HdAccount { Name = account.AccountName, CreationTime = DateTimeOffset.FromUnixTimeSeconds(account.CreationTime), ExtendedPubKey = account.ExtPubKey, Index = account.AccountIndex, HdPath = repo.ToHdPath(account.AccountIndex), }; res.ExternalAddresses = new AddressCollection(res, 0); res.InternalAddresses = new AddressCollection(res, 1); return(res); }