From d751b75b6a18131d9490d117c6e2070935cbbbbf Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 6 Oct 2015 23:52:49 +0200 Subject: [PATCH] Added Basic types for hotwallet addresses --- Basic/Basic.csproj | 2 + .../Types/Financial/BasicHotBitcoinAddress.cs | 38 +++++++++++++++++++ .../BasicHotBitcoinAddressUnspent.cs | 38 +++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 Basic/Types/Financial/BasicHotBitcoinAddress.cs create mode 100644 Basic/Types/Financial/BasicHotBitcoinAddressUnspent.cs diff --git a/Basic/Basic.csproj b/Basic/Basic.csproj index d1389874..5824903f 100644 --- a/Basic/Basic.csproj +++ b/Basic/Basic.csproj @@ -73,6 +73,8 @@ + + diff --git a/Basic/Types/Financial/BasicHotBitcoinAddress.cs b/Basic/Types/Financial/BasicHotBitcoinAddress.cs new file mode 100644 index 00000000..42b97147 --- /dev/null +++ b/Basic/Types/Financial/BasicHotBitcoinAddress.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Swarmops.Common.Interfaces; + +namespace Swarmops.Basic.Types.Financial +{ + public class BasicHotBitcoinAddress: IHasIdentity + { + public BasicHotBitcoinAddress (int hotBitcoinAddressId, int organizationId, string derivationPath, + Int64 balanceSatoshis, Int64 throughputSatoshis) + { + this.HotBitcoinAddressId = hotBitcoinAddressId; + this.OrganizationId = organizationId; + this.DerivationPath = derivationPath; + this.BalanceSatoshis = balanceSatoshis; + this.ThroughputSatoshis = throughputSatoshis; + } + + public BasicHotBitcoinAddress (BasicHotBitcoinAddress original) + : this ( + original.HotBitcoinAddressId, original.OrganizationId, original.DerivationPath, original.BalanceSatoshis, + original.ThroughputSatoshis) + { + // copy ctor + } + + public int HotBitcoinAddressId { get; private set; } + public int OrganizationId { get; private set; } + public string DerivationPath { get; private set; } + public Int64 BalanceSatoshis { get; protected set; } + public Int64 ThroughputSatoshis { get; protected set; } + + public int Identity { get { return HotBitcoinAddressId; }} + } +} diff --git a/Basic/Types/Financial/BasicHotBitcoinAddressUnspent.cs b/Basic/Types/Financial/BasicHotBitcoinAddressUnspent.cs new file mode 100644 index 00000000..5441676f --- /dev/null +++ b/Basic/Types/Financial/BasicHotBitcoinAddressUnspent.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Swarmops.Common.Interfaces; + +namespace Swarmops.Basic.Types.Financial +{ + public class BasicHotBitcoinAddressUnspent: IHasIdentity + { + public BasicHotBitcoinAddressUnspent (int hotBitcoinAddressUnspentId, string transactionHash, + int transactionOutputIndex, Int64 amountSatoshis, int confirmationCount) + { + this.HotBitcoinAddressUnspentId = hotBitcoinAddressUnspentId; + this.TransactionHash = transactionHash; + this.TransactionOutputIndex = transactionOutputIndex; + this.AmountSatoshis = amountSatoshis; + this.ConfirmationCount = confirmationCount; + } + + public BasicHotBitcoinAddressUnspent (BasicHotBitcoinAddressUnspent original) + : this ( + original.HotBitcoinAddressUnspentId, original.TransactionHash, original.TransactionOutputIndex, + original.AmountSatoshis, original.ConfirmationCount) + { + // copy ctor + } + + public int HotBitcoinAddressUnspentId { get; private set; } + public string TransactionHash { get; private set; } + public int TransactionOutputIndex { get; private set; } + public Int64 AmountSatoshis { get; private set; } + public int ConfirmationCount { get; protected set; } + + public int Identity { get { return HotBitcoinAddressUnspentId; }} + } +}