diff --git a/index.html b/index.html index 76539f0..e06bdb1 100644 --- a/index.html +++ b/index.html @@ -26,6 +26,7 @@ + diff --git a/js/main_UI.js b/js/main_UI.js index 7ceb498..19c2332 100644 --- a/js/main_UI.js +++ b/js/main_UI.js @@ -329,51 +329,25 @@ function fetchRibcData() { receiverID: "FMyRTrz9CG4TFNM6rCQgy3VQ5NF23bY2xD" }); } -function fetchInternData() { - return floBlockchainAPI - .readAllTxs("FThgnJLcuStugLc24FJQggmp2WgaZjrBSn") - .then((allTxs) => { - allTxs.forEach((tx) => { - const floId = tx.vout[0].scriptPubKey.addresses[0]; - if (!floGlobals.appObjects.RIBC.internList[floId]) return; // not an intern - const { txid, floData, time } = tx - if (!floGlobals.internTxs[floId]) - floGlobals.internTxs[floId] = { - total: 0, - txs: [] - }; - const amount = parseFloat(floData.match(/([0-9]+)/)[1]) || 0; // get amount from floData - floGlobals.internTxs[floId].total += amount; - floGlobals.internTxs[floId].txs.push({ - txid, - amount, - time - }); - - }); - render.internPaymentList(); - }).catch((err) => { - console.log(err); - }); +function fetchTransactions() { + return floTokenAPI.getAllTxs('FThgnJLcuStugLc24FJQggmp2WgaZjrBSn') } const render = { internCard(floId) { const { total, txs } = floGlobals.internTxs[floId]; return html` -
Last payment: ${formatAmount(txs[0].amount)} on ${getFormattedTime(txs[0].time, 'date-only')}
-Total paid: ${formatAmount(total)}
-Last payment: ${formatAmount(txs[0].amount)} on ${getFormattedTime(txs[0].time, 'date-only')}
+Total paid: ${formatAmount(total)}
+