Function
getLogsFromEtherscan
(_address, _fromBlock, _toBlock, _eventSignature)
Source from the content-addressed store, hash-verified
| 65 | } |
| 66 | |
| 67 | async function getLogsFromEtherscan(_address, _fromBlock, _toBlock, _eventSignature) { |
| 68 | let urlDomain = 'api'; |
| 69 | const options = { |
| 70 | url: `https://${urlDomain}.etherscan.io/api`, |
| 71 | qs: { |
| 72 | module: 'logs', |
| 73 | action: 'getLogs', |
| 74 | fromBlock: _fromBlock, |
| 75 | toBlock: _toBlock, |
| 76 | address: _address, |
| 77 | topic0: web3.utils.sha3(_eventSignature), |
| 78 | apikey: 'THM9IUVC2DJJ6J5MTICDE6H1HGQK14X559' |
| 79 | }, |
| 80 | method: 'GET', |
| 81 | json: true |
| 82 | }; |
| 83 | let data = await request(options); |
| 84 | return data.result; |
| 85 | } |
| 86 | |
| 87 | async function getABIfromEtherscan(_address) { |
| 88 | let urlDomain = 'api'; |
Tested by
no test coverage detected