MCPcopy Create free account
hub / github.com/PolymathNetwork/polymath-core / getLogsFromEtherscan

Function getLogsFromEtherscan

scripts/tokenInfo-v1.js:67–85  ·  view source on GitHub ↗
(_address, _fromBlock, _toBlock, _eventSignature)

Source from the content-addressed store, hash-verified

65}
66
67async 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
87async function getABIfromEtherscan(_address) {
88 let urlDomain = 'api';

Callers 2

getTokensFunction · 0.70
getInfoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected