Fix for the transactions

Using explorer instead of richlist
This commit is contained in:
Exlo
2022-06-21 08:51:26 +02:00
parent b68a9c9bcc
commit b16e9b2901
2 changed files with 16 additions and 12 deletions

View File

@@ -106,7 +106,7 @@
<button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('https://t.me/Ether_1')">Telegram</button> <button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('https://t.me/Ether_1')">Telegram</button>
</div> </div>
<div class="column"> <div class="column">
<button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('https://t.me/Ether1News')">News</button> <button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('https://ethoprotocol.com/blog/')">News Blog</button>
</div> </div>
<div class="column"> <div class="column">
<button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('mailto:admin@ethoprotocol.com')">Email</button> <button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('mailto:admin@ethoprotocol.com')">Email</button>

View File

@@ -1,4 +1,5 @@
const {ipcRenderer} = require("electron"); const {ipcRenderer} = require("electron");
const moment = require("moment");
class Transactions { class Transactions {
constructor() { constructor() {
@@ -46,19 +47,22 @@ class Transactions {
lastBlock lastBlock
]); ]);
$.getJSON("https://richlist.ethoprotocol.com/transactions_list.php" + params, function (result) { $.getJSON("https://explorer1.ethoprotocol.com/api?module=account&action=txlist&address=" + addressList[counter].toLowerCase(), function (result) {
result.data.forEach(element => {
if (element.fromaddr && element.toaddr) { if (result.result) {
result.result.forEach(element => {
if (element.from && element.to && startBlock <= parseInt(element.blockNumber) && lastBlock >= parseInt(element.blockNumber)) {
ipcRenderer.send("storeTransaction", { ipcRenderer.send("storeTransaction", {
block: element.block.toString(), block: element.blockNumber.toString(),
txhash: element.txhash.toLowerCase(), txhash: element.hash.toLowerCase(),
fromaddr: element.fromaddr.toLowerCase(), fromaddr: element.from.toLowerCase(),
timestamp: element.timestamp, timestamp: moment.unix(parseInt(element.timeStamp)).format("YYYY-MM-DD HH:mm:ss"),
toaddr: element.toaddr.toLowerCase(), toaddr: element.to.toLowerCase(),
value: element.value value: element.value
}); });
} }
}); });
}
// call the transaction sync for the next address // call the transaction sync for the next address
EthoTransactions.syncTransactionsForSingleAddress(addressList, counters, lastBlock, counter + 1); EthoTransactions.syncTransactionsForSingleAddress(addressList, counters, lastBlock, counter + 1);