I can find my approval list in etherscan.io. But I don't see any api to get list of approval.
https://etherscan.io/tokenapprovalchecker?search=0xf7931b9b1fff5fc63c45577c43dfc0d0def16c46
I can find my approval list in etherscan.io. But I don't see any api to get list of approval.
https://etherscan.io/tokenapprovalchecker?search=0xf7931b9b1fff5fc63c45577c43dfc0d0def16c46
Etherscan builds their own database of approvals aggregated from the Approval
event logs emitted by transactions.
Example subscribing to event logs with web3js:
web3.eth.subscribe("logs", {
topics: [
// event signature standardized by ERC20 and ERC721
web3.utils.keccak256("Approval(address,address,uint256)")
]
}, (err, event) => {
console.log(event)
// `address` - token contract emitting the event
// `topics[0]` - approver
// `topics[1] - spender
// `topics[2]` - ERC721 token ID
// `data` - ERC20 amount
})
Docs: https://web3js.readthedocs.io/en/v1.8.1/web3-eth-subscribe.html#subscribe-logs