reward.watchRewardRecipientSet
Watches for reward recipient set events when token holders change their reward recipient.
Usage
ts
import { } from 'wagmi/tempo'
import { } from './config'
const = ..(, {
(, ) {
.('args:', )
},
: '0x20c0000000000000000000000000000000000000',
})
// Later, stop watching
()ts
import { createConfig, http } from 'wagmi'
import { tempoTestnet } from 'wagmi/chains'
import { KeyManager, webAuthn } from 'wagmi/tempo'
export const config = createConfig({
connectors: [
webAuthn({
keyManager: KeyManager.localStorage(),
}),
],
chains: [tempoTestnet],
multiInjectedProviderDiscovery: false,
transports: {
[tempoTestnet.id]: http(),
},
})Return Type
() => void
Returns a function to unsubscribe from the event.
Parameters
onRewardRecipientSet
- Type:
function
ts
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
ts
type Args = {
/** Filter events by holder address */
holder?: Address
/** Filter events by recipient address */
recipient?: Address
}Optional filters for the event.