Function
getLogsFromEtherscan
(_address, _fromBlock, _toBlock, _eventSignature)
Source from the content-addressed store, hash-verified
| 87 | } |
| 88 | |
| 89 | async function getLogsFromEtherscan(_address, _fromBlock, _toBlock, _eventSignature) { |
| 90 | let urlDomain = "api"; |
| 91 | const options = { |
| 92 | url: `https://${urlDomain}.etherscan.io/api`, |
| 93 | qs: { |
| 94 | module: "logs", |
| 95 | action: "getLogs", |
| 96 | fromBlock: _fromBlock, |
| 97 | toBlock: _toBlock, |
| 98 | address: _address, |
| 99 | topic0: web3.utils.sha3(_eventSignature), |
| 100 | apikey: "THM9IUVC2DJJ6J5MTICDE6H1HGQK14X559" |
| 101 | }, |
| 102 | method: "GET", |
| 103 | json: true |
| 104 | }; |
| 105 | let data = await request(options); |
| 106 | return data.result; |
| 107 | } |
| 108 | |
| 109 | async function getABIfromEtherscan(_address) { |
| 110 | let urlDomain = "api"; |
Tested by
no test coverage detected