You can use the generic subscribe("logs")
handler ( docs ) and filter by the contract address and event signature ( topics[0]
).
Mind that the 0x0511a506
mentioned in your question is a selector of the parent function that was invoked while the event was emitted, but you're really looking for the event signature - 0x598cd562...
in your case.
web3.eth.subscribe("logs", {
address: "contractAddress",
topics: [
"0x598cd562..."
]
}, (err, data) => {
console.log(data);
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.