Open
Description
Suggestion
it says:
filter = contract.filters.Transfer("ethers.eth")
contract.on(filter, (from, to, amount, event) => {
// `to` will always be equal to the address of "ethers.eth"
});
I think you meant that from
will always be equal to the address of "ethers.eth".
But also my callback is just receiving a single argument: ContractEventPayload.
contract.on(contract.filters.Transfer(userAddress), (payload) => {
console.log(payload.args[0]); // from = to userAddress
console.log(payload.args[1]); // to
console.log(payload.args[2]); // value
});
This was really hard to figure out!
I am getting ethers from: https://cdnjs.cloudflare.com/ajax/libs/ethers/6.13.5/ethers.umd.min.js