From 564cf596c33d1163e4ac0058da922849fd2bc470 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Mon, 4 May 2020 08:13:32 -0500 Subject: [PATCH 1/6] Add track-payments.html to report on payments to incident victims The report is in HTML/pure javascript, it makes a web api call to blockchair.com to obtain the information that is presented. Resolves bisq-network/admin#77 --- track-payments.html | 234 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 track-payments.html diff --git a/track-payments.html b/track-payments.html new file mode 100644 index 0000000..4f01802 --- /dev/null +++ b/track-payments.html @@ -0,0 +1,234 @@ + + + + Bisq Repayment Report + + + +
+

Bisq Repayment Report

+ Hard-coded input parameters, copied from: https://github.com/bisq-network/admin/issues/76 +
You can paste updated info into this box, or update this source file when new information is available. +
(NB: tabs are significant)
+
+
+ +
+
+ +
+
+
results
+
+ + + + From 548f63361e0054c0a8f5053ad7d834227fd48181 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Wed, 6 May 2020 15:58:25 -0500 Subject: [PATCH 2/6] Handle API returning error due to no addresses found. The blockchair API will return a 404 when none of the addresses being queried are present in the blockchain database. For the report, in this case we still want to show the information with 0 payments made as it is the initial state. In case we ever get an error code from blockchair API we'll display the error message under the report. --- track-payments.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/track-payments.html b/track-payments.html index 4f01802..3263947 100644 --- a/track-payments.html +++ b/track-payments.html @@ -140,7 +140,7 @@

Bisq Repayment Report

}, // write the report into an HTML table - updateDocument: function() { + updateDocument: function(status) { var results = ""; results += "" +"" @@ -157,11 +157,12 @@

Bisq Repayment Report

+"" +"" +"" - +"" + +"" +"\n"; } results += "
ID" + i.btc_lost.toString() + "" + i.btc_received.toString() + "" + i.usd_value.toString() + "$" + i.usd_received.toString() + "$" + Number(i.usd_received).toFixed(2) + "
\n"; results += "

Transaction count: " + globalAccounts.transaction_count.toString() + "
\n"; + if (status != null) { results += "

Blockchair status: " + status + "
\n"; } document.getElementById('results').innerHTML = results; document.body.style.cursor = 'auto'; }, @@ -197,6 +198,7 @@

Bisq Repayment Report

{ if (req.readyState > 3) { + debugger; if (req.responseText.length > 0) { var data = JSON.parse(req.responseText); if ((data.context && data.data) && data.context.code =='200'){ @@ -208,8 +210,12 @@

Bisq Repayment Report

jmcData.setAmounts(m, received, received_usd); } jmcData.setTransactionCount(data.data.set.transaction_count); - jmcData.updateDocument(); } + var blockchairStatus = null; + if ((data.context && typeof data.context.error !== 'undefined')){ + blockchairStatus = data.context.error.toString(); + } + jmcData.updateDocument(blockchairStatus); } } }; From 69382ff5b7370b1f2d96699cc6adb26d4e7c8bd0 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Thu, 7 May 2020 08:33:28 +0200 Subject: [PATCH 3/6] Rename track-{=>re}payments.html --- track-payments.html => track-repayments.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename track-payments.html => track-repayments.html (100%) diff --git a/track-payments.html b/track-repayments.html similarity index 100% rename from track-payments.html rename to track-repayments.html From c82ffdb1ab2d5abb084472b01f20b66736fdd832 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Thu, 7 May 2020 08:35:16 +0200 Subject: [PATCH 4/6] Strip trailing whitespace See bisq-network/style#10 --- track-repayments.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/track-repayments.html b/track-repayments.html index 3263947..eb57be6 100644 --- a/track-repayments.html +++ b/track-repayments.html @@ -1,4 +1,4 @@ - + Bisq Repayment Report @@ -44,7 +44,7 @@

Bisq Repayment Report

// this hard-coded input data is cut-and-paste copied from // https://github.com/bisq-network/admin/issues/76 // will need to update here whenever a change is made (i.e. a new address) - var str = + var str = "ID btc lost usd value repayment address\n" +"1 4.08 $25,391.88 1EU2aUQkHQukKbk3t5fmA4quHyMRBupM2U\n" +"2 4.60 $31,126.54 1ALWSRCKBuad6JUh7Y371uDPyH9nwbsvxZ\n" @@ -143,20 +143,20 @@

Bisq Repayment Report

updateDocument: function(status) { var results = ""; results += "" - +"" - +"" - +"" - +"" - +"" + +"" + +"" + +"" + +"" + +"" +"\n"; var all_info = globalAccounts.accounts; for (const i of all_info) { results += "" - +"" - +"" - +"" - +"" - +"" + +"" + +"" + +"" + +"" + +"" +"" +"\n"; } @@ -194,7 +194,7 @@

Bisq Repayment Report

req.addEventListener("error", transferFailed); req.addEventListener("abort", transferCanceled); - req.onreadystatechange = function () + req.onreadystatechange = function () { if (req.readyState > 3) { From 0953f9011c0a30bb3974d563bf2d989fe150d488 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Thu, 7 May 2020 08:35:41 +0200 Subject: [PATCH 5/6] Update document title --- track-repayments.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/track-repayments.html b/track-repayments.html index eb57be6..40f864a 100644 --- a/track-repayments.html +++ b/track-repayments.html @@ -1,12 +1,12 @@ - Bisq Repayment Report + Repayments
-

Bisq Repayment Report

+

Apr 2020 security incident repayment report

Hard-coded input parameters, copied from: https://github.com/bisq-network/admin/issues/76
You can paste updated info into this box, or update this source file when new information is available.
(NB: tabs are significant)
From 01c0ab06c884ee552256bbfdc80416d07445d595 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Wed, 6 May 2020 11:46:57 +0200 Subject: [PATCH 6/6] Update repayment address values This commit synchronizes address values with the latest (and should be final) information from bisq-network/admin#76. --- track-repayments.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/track-repayments.html b/track-repayments.html index 40f864a..b8e3d5e 100644 --- a/track-repayments.html +++ b/track-repayments.html @@ -46,12 +46,12 @@

Apr 2020 security incident repayment report

// will need to update here whenever a change is made (i.e. a new address) var str = "ID btc lost usd value repayment address\n" - +"1 4.08 $25,391.88 1EU2aUQkHQukKbk3t5fmA4quHyMRBupM2U\n" - +"2 4.60 $31,126.54 1ALWSRCKBuad6JUh7Y371uDPyH9nwbsvxZ\n" + +"1 4.08 $25,391.88 19qA2BVPoyXDfHKVMovKG7SoxGY7xrBV8c\n" + +"2 4.60 $31,126.54 13sxMq8mTw7CTSqgGiMPfwo6ZDsVYrHLmR\n" +"3 2.30 $14,314.05 1HpvvMHcoXQsX85CjTsco5ZAAMoGu2Mze9\n" - +"4 8.80 $54,766.80 TBD\n" + +"4 8.80 $54,766.80 3EfRGckBQQuk7cpU7SwatPv8kFD1vALkTU\n" +"5 12.78 $93,418.99 19BNi5EpZhgBBWAt5ka7xWpJpX2ZWJEYyq\n" - +"6 2.30 $16,812.49 TBD\n" + +"6 2.30 $16,812.49 14iLhJiQ4aMU8DNg57CGGWhwXENV5X1FvW\n" +"\n\n"; document.getElementById('phrase').value = str; });
IDRepayment addressBTC lostBTC receivedUSD valueIDRepayment addressBTC lostBTC receivedUSD valueUSD received
" + i.id.toString() + "" + i.repayment_address + "" + i.btc_lost.toString() + "" + i.btc_received.toString() + "" + i.usd_value.toString() + "" + i.id.toString() + "" + i.repayment_address + "" + i.btc_lost.toString() + "" + i.btc_received.toString() + "" + i.usd_value.toString() + "$" + Number(i.usd_received).toFixed(2) + "