diff --git a/Site5/App_GlobalResources/Global.resx b/Site5/App_GlobalResources/Global.resx
index f15dbf89..c6876106 100644
--- a/Site5/App_GlobalResources/Global.resx
+++ b/Site5/App_GlobalResources/Global.resx
@@ -725,4 +725,8 @@
Flags
As in a table column header
+
+ Total
+ Used as footer in tables, summarizing something
+
\ No newline at end of file
diff --git a/Site5/App_GlobalResources/Pages.Ledgers.resx b/Site5/App_GlobalResources/Pages.Ledgers.resx
index da50e635..51165fd6 100644
--- a/Site5/App_GlobalResources/Pages.Ledgers.resx
+++ b/Site5/App_GlobalResources/Pages.Ledgers.resx
@@ -775,4 +775,11 @@
Bitcoin Hotwallet
+
+ Transaction Hash
+
+
+ Unspent TxOut
+ The local translation of a bitcoin UTXO (Unspent Transaction Output).
+
\ No newline at end of file
diff --git a/Site5/Pages/v5/Ledgers/BitcoinHotwallet.aspx b/Site5/Pages/v5/Ledgers/BitcoinHotwallet.aspx
index 21736c9d..bbe77da5 100644
--- a/Site5/Pages/v5/Ledgers/BitcoinHotwallet.aspx
+++ b/Site5/Pages/v5/Ledgers/BitcoinHotwallet.aspx
@@ -8,14 +8,14 @@
$('#tableHotwallet').treegrid(
{
onBeforeExpand: function (foo) {
- $('span.profitlossdata-collapsed-' + foo.id).fadeOut('fast', function () {
- $('span.profitlossdata-expanded-' + foo.id).fadeIn('slow');
+ $('span.bitcoinhotwalletdata-collapsed-' + foo.id).fadeOut('fast', function () {
+ $('span.bitcoinhotwalletdata-expanded-' + foo.id).fadeIn('slow');
});
},
onBeforeCollapse: function (foo) {
- $('span.profitlossdata-expanded-' + foo.id).fadeOut('fast', function () {
- $('span.profitlossdata-collapsed-' + foo.id).fadeIn('slow');
+ $('span.bitcoinhotwalletdata-expanded-' + foo.id).fadeOut('fast', function () {
+ $('span.bitcoinhotwalletdata-collapsed-' + foo.id).fadeIn('slow');
});
},
@@ -51,7 +51,7 @@
animate="true"
fitColumns="true"
showFooter="true"
- idField="id" treeField="name">
+ idField="id" treeField="derivePath">
|
diff --git a/Site5/Pages/v5/Ledgers/BitcoinHotwallet.aspx.cs b/Site5/Pages/v5/Ledgers/BitcoinHotwallet.aspx.cs
index a2f1a4c7..a96eff2b 100644
--- a/Site5/Pages/v5/Ledgers/BitcoinHotwallet.aspx.cs
+++ b/Site5/Pages/v5/Ledgers/BitcoinHotwallet.aspx.cs
@@ -36,7 +36,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
{
this.LabelContentHeader.Text = Resources.Pages.Ledgers.BitcoinHotwallet_Header;
this.LiteralHeaderDerivationPath.Text = Resources.Pages.Ledgers.BitcoinHotwallet_DerivationPath;
- this.LiteralHeaderAddress.Text = Resources.Pages.Ledgers.BitcoinHotwallet_Address;
+ this.LiteralHeaderAddress.Text = Resources.Pages.Ledgers.BitcoinHotwallet_Address + @" / " + Resources.Pages.Ledgers.BitcoinHotWallet_TransactionHash;
this.LiteralHeaderMicrocoins.Text = Resources.Pages.Ledgers.BitcoinHotwallet_BalanceMicrocoins;
this.LiteralHeaderFiatValue.Text = String.Format(Resources.Pages.Ledgers.BitcoinHotwallet_ValueFiat, CurrentOrganization.Currency.DisplayCode);
}
diff --git a/Site5/Pages/v5/Ledgers/Json-BitcoinHotwalletData.aspx.cs b/Site5/Pages/v5/Ledgers/Json-BitcoinHotwalletData.aspx.cs
index ac8d2bdd..d5e13acd 100644
--- a/Site5/Pages/v5/Ledgers/Json-BitcoinHotwalletData.aspx.cs
+++ b/Site5/Pages/v5/Ledgers/Json-BitcoinHotwalletData.aspx.cs
@@ -43,21 +43,49 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
foreach (HotBitcoinAddress address in addresses)
{
+ HotBitcoinAddressUnspents unspents = HotBitcoinAddressUnspents.ForAddress (address);
+ Int64 satoshisUnspentAddress = 0;
+
+ StringBuilder childResult = new StringBuilder(16384);
+ foreach (HotBitcoinAddressUnspent unspent in unspents)
+ {
+ childResult.Append ("{");
+ childResult.AppendFormat(
+ "\"id\":\"UTXO{0}\"," +
+ "\"derivePath\":\"{1}\"," +
+ "\"address\":\"{2}\"," +
+ "\"balanceMicrocoins\":\"{3}\"," +
+ "\"balanceFiat\":\"{4}\"",
+ unspent.Identity,
+ Resources.Pages.Ledgers.BitcoinHotWallet_UnspentTransaction,
+ unspent.TransactionHash,
+ (unspent.AmountSatoshis / 100.0).ToString("N2"),
+ (unspent.AmountSatoshis / 100.0 * conversionRate).ToString("N2")
+ );
+ satoshisUnspentAddress += unspent.AmountSatoshis;
+ childResult.Append("},");
+ }
+ if (unspents.Count > 0)
+ {
+ childResult.Remove (childResult.Length - 1, 1); // remove last comma
+ }
+
result.Append("{");
result.AppendFormat (
"\"id\":\"{0}\"," +
"\"derivePath\":\"{1}\"," +
"\"address\":\"{2}\"," +
"\"balanceMicrocoins\":\"{3}\"," +
- "\"balanceFiat\":\"{4}\"",
+ "\"balanceFiat\":\"{4}\",",
address.Identity,
address.DerivationPath,
address.Address,
- (address.BalanceSatoshis/100.0).ToString ("N2"),
- (address.BalanceSatoshis/100.0*conversionRate).ToString ("N2")
+ JsonExpandingString (address.Identity, satoshisUnspentAddress),
+ JsonExpandingString (address.Identity, (Int64) (satoshisUnspentAddress * conversionRate))
);
+ result.Append ("\"state\":\"closed\",\"children\":[" + childResult.ToString() + "]");
result.Append("},");
- satoshisTotal += address.BalanceSatoshis;
+ satoshisTotal += satoshisUnspentAddress;
}
if (addresses.Count > 0)
@@ -69,7 +97,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
result.Append("{");
- result.AppendFormat("\"derivePath\":\"TOTAL\",\"balanceMicrocoins\":\"{0}\",\"balanceFiat\":\"{1:N2}\"",
+ result.AppendFormat("\"derivePath\":\"" + Resources.Global.Global_Total + "\",\"balanceMicrocoins\":\"{0}\",\"balanceFiat\":\"{1}\"",
(satoshisTotal / 100.0).ToString("N2"), (satoshisTotal / 100.0 * conversionRate).ToString("N2"));
result.Append("}]}"); // on separate line to suppress warning
@@ -78,6 +106,13 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
}
+ private string JsonExpandingString(int addressId, Int64 currencyValue)
+ {
+ return string.Format(CultureInfo.CurrentCulture,
+ "Σ {1:N2} ",
+ addressId, currencyValue / 100.00);
+ }
+
}
}
\ No newline at end of file