fee.watchSetUserToken
Watches for user token set events on the Fee Manager.
Usage
ts
import { } from 'wagmi/tempo'
import { } from './config'
const = ..(, {
(, ) {
.('args:', )
},
})
// 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
onUserTokenSet
- Type:
function
ts
declare function onUserTokenSet(args: Args, log: Log): void
type Args = {
/** Address of the user */
user: Address
/** Address of the new fee token */
token: Address
}Callback to invoke when a user token is set.
args (optional)
- Type:
object
ts
type Args = {
/** Address of the user to filter by */
user?: Address | Address[] | null
/** Address of the token to filter by */
token?: Address | Address[] | null
}Optional filters for the event.
fromBlock (optional)
- Type:
bigint
Block to start listening from.
onError (optional)
- Type:
function
ts
declare function onError(error: Error): voidThe callback to call when an error occurred when trying to get for a new block.
poll (optional)
- Type:
true
Enable polling mode.
pollingInterval (optional)
- Type:
number
Polling frequency (in ms). Defaults to Client's pollingInterval config.