reward.watchRewardRecipientSet
Watches for reward recipient set events when token holders change their reward recipient.
Usage
example.ts
import { Actions } from 'tempo.ts/wagmi'
import { config } from './wagmi.config'
const unwatch = Actions.reward.watchRewardRecipientSet(config, {
onRewardRecipientSet: (args, log) => {
console.log('Holder:', args.holder)
console.log('Recipient:', args.recipient)
},
token: '0x20c0000000000000000000000000000000000000',
})
// Later, stop watching
unwatch()Return Type
type ReturnType = () => voidReturns a function to unsubscribe from the event.
Parameters
onRewardRecipientSet
- Type:
declare function onRewardRecipientSet(args: Args, log: Log): void
type Args = {
/** Token holder address who set their reward recipient */
holder: Address
/** New reward recipient address (zero address indicates opt-out) */
recipient: Address
}Callback to invoke when a reward recipient is set.
token
- Type:
Address
Address of the TIP-20 token to watch.
args (optional)
- Type:
object
type Args = {
/** Filter events by holder address */
holder?: Address
/** Filter events by recipient address */
recipient?: Address
}Optional filters for the event.