DRAFT: Option to print BTC transactions
Added --print-transactions option that for given Bitcoin
address prints all incoming transactions in reverse
chronological order.
Data printed: BTC amount, USD amount, date.
CI is broken @webwarrior-ws . Moving forward please don't create a PR yet if CI on your fork is not green yet.
CI failure on Windows seems to be completely unrelated
Fixed indentation in .fsproj file
@webwarrior-ws 2 last things to do here (while you're waiting for CI on the other task):
- Please rebase this PR with latest master in order to achieve green CI. After that:
- Please develop this small feature (in a 2nd commit, do not squash with 1st): when user writes a parameter for maxTransactionsCount, for example 2, check if the last 2 transactions have the same addresses as outputs (e.g. tx 1 outputs are 3: sends to address A, which belongs to wallet, and to address B and C, which don't belong to wallet; tx2 outputs are 3: sends to address A, which belongs to wallet, and to address B and D, which don't belong to the wallet), and if that is the case, put info about the TOTAL amount being sent, in tx1: A+B amount and percentage of each amount (e.g. 75% to A, 25% to B), and tx2: A+B amount and percentage of each amount (e.g. 65% to A, 35% to B).
I gave this a go today, I found 2 issues @webwarrior-ws , see this example output (where I cut addresses with <snip/> for privacy):
% mono src/GWallet.Frontend.Console/bin/Debug/GWallet.Frontend.Console.exe --print-transactions 2 39...<snip/>
BTC amount: 0.02800286
~USD amount: 478.88
date: ... UTC
BTC amount: 0.02321512
~USD amount: 391.20
date: ... UTC
Transactions with shared outputs:
Transaction with outputs to NBitcoin.TxOut, NBitcoin.TxOut
Date: ... PM UTC
Total BTC: 0.03634679
Sent 0.00134309 BTC to bc1qp...(snip) (3.70%)
Sent 0.00700074 BTC to bc1q1...(snip) (19.26%)
Transaction with outputs to NBitcoin.TxOut, NBitcoin.TxOut
Date: 8/12/2022 8:33:59 PM UTC
Total BTC: 0.03034462
Sent 0.00132585 BTC to bc1qp...(snip) (4.37%)
Sent 0.00580375 BTC to bc1q1...(snip) (19.13%)
The two issues are:
- The percentages are wrong, because their total is not 100%.
- Most importantly, address
39...<snip/>is not included in the final summary titledTransactions with shared outputs, it should be included!
@webwarrior-ws just a reminder, this is a low-priority task, you should only work on this when you're waiting for CI for your high-priority task. Thanks Taras, good progress so far.