From cc336141a6c9a849d3509195228574482a778f4a Mon Sep 17 00:00:00 2001 From: "moxey.eth" Date: Thu, 10 Aug 2023 06:35:21 +0200 Subject: [PATCH] chore: update docs --- site/docs/actions/public/watchEvent.md | 4 ++-- site/docs/contract/watchContractEvent.md | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/site/docs/actions/public/watchEvent.md b/site/docs/actions/public/watchEvent.md index 60a9e767bf4..21a50e23730 100644 --- a/site/docs/actions/public/watchEvent.md +++ b/site/docs/actions/public/watchEvent.md @@ -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] } ) diff --git a/site/docs/contract/watchContractEvent.md b/site/docs/contract/watchContractEvent.md index b90cc40a414..2c2b9184ea4 100644 --- a/site/docs/contract/watchContractEvent.md +++ b/site/docs/contract/watchContractEvent.md @@ -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. @@ -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] } )