nonce.watchNonceIncremented
Watches for nonce incremented events. This event is emitted whenever a transaction is executed using a specific nonce key.
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
onNonceIncremented
- Type:
function
ts
declare function onNonceIncremented(args: Args, log: Log): void
type Args = {
/** Address of the account */
account: Address
/** Nonce key that was incremented */
nonceKey: bigint
/** New nonce value after increment */
newNonce: bigint
}Callback to invoke when a nonce is incremented.
args (optional)
- Type:
object
ts
type Args = {
/** Address of the account to filter by */
account?: Address | Address[] | null
/** Nonce key to filter by */
nonceKey?: bigint | bigint[] | 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.