import { prepareEvent, watchContractEvents } from "thirdweb";
const myEvent = prepareEvent({
event: "event MyEvent(uint256 myArg)",
});
const events = await watchContractEvents({
contract: myContract,
events: [myEvent],
onEvents: (events) => {
// do something with the events
},
});