0

How can i retrieve the total number of transactions from an address for a specific token using web3 library?

For example i need to get the total number of tx to the dead address for the TokenA.

Thank you

1 Answer 1

0

Something like this should work

const events = await erc20Contract.getPastEvents('Transfer', {
    filter: { to: 0xdead },
    fromBlock: 0,
    toBlock: 'latest'
})

This gets you all transfer events for a certain ERC20 token.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.