I need to get all transactions from aa address on bsc. I tried bscscan api but it doesn't give everything like burning minting actions, they just give transfers , how can I get all transactions with web3 js or web3 py. I would appreciate if someone can help me
Asked
Active
Viewed 1,201 times
-3
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 17 '22 at 10:11
1 Answers
0
You need scan all block and found that you need. This is very bad way. Other way -- you can use API
check etherscan.io api you can get a list of all transactions easily as an alternative
and work with this answer. This is easy way, but no easy way to get all transaction via web3js or web3py.
But if you need only specified events -- that was much easy.
you need function getPastEvents
const START_BLOCK = 7700000;
const END_BLOCK = 7701000;
contract.getPastEvents("allEvents",
{
fromBlock: START_BLOCK,
toBlock: END_BLOCK // You can also specify 'latest'
})
.then(events => console.log(events))
.catch((err) => console.error(err));
You can set mint or burn events only.
https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html#getpastevents

lesnik
- 76
- 2