Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Aug 10, 2023
1 parent 0fb074a commit cc33614
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions site/docs/actions/public/watchEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ const publicClient = createPublicClient({
transport: webSocket()
})

const unwatch = publicClient.watchBlocks(
const unwatch = publicClient.watchEvent(
{
onBlock: block => console.log(block),
onLogs: logs => console.log(logs),
poll: true, // [!code focus]
}
)
Expand Down
7 changes: 4 additions & 3 deletions site/docs/contract/watchContractEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ head:

Watches and returns emitted contract event logs.

This Action will batch up all the event logs found within the [`pollingInterval`](#pollinginterval-optional), and invoke them via [`onLogs`](#onLogs).
This Action will batch up all the event logs found within the [`pollingInterval`](#pollinginterval-optional), and invoke them via [`onLogs`](#onlogs).

`watchContractEvent` will attempt to create an [Event Filter](/docs/contract/createContractEventFilter) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (ie. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](/docs/actions/public/getLogs) instead.

Expand Down Expand Up @@ -303,9 +303,10 @@ const publicClient = createPublicClient({
transport: webSocket()
})

const unwatch = publicClient.watchBlocks(
const unwatch = publicClient.watchContractEvent(
{
onBlock: block => console.log(block),
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
abi: wagmiAbi,
poll: true, // [!code focus]
}
)
Expand Down

0 comments on commit cc33614

Please sign in to comment.