Skip to content

Commit 4119e88

Browse files
update useScaffoldEvenHistory hook (#129)
1 parent 64c940d commit 4119e88

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/hooks/useScaffoldEventHistory.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ This example retrieves the historical event logs for the `GreetingChange` event
3232
| **contractName** | `string` | Name of the contract to read from. |
3333
| **eventName** | `string` | Name of the event to read. |
3434
| **fromBlock** | `bigint` | Block number from which to start reading events. |
35+
| **toBlock** | `bigint` | block number to stop reading events at (if not provided, reads until current block) |
3536
| **filters** (optional) | `object` | Apply filters to the event based on **indexed** parameter names and values `{ [parameterName]: value }`. |
3637
| **blockData** (optional) | `boolean` | If set to true it will return the block data for each event (default: false). |
3738
| **transactionData** (optional) | `boolean` | If set to true it will return the transaction data for each event (default: false). |
3839
| **receiptData** (optional) | `boolean` | If set to true it will return the receipt data for each event (default: false). |
3940
| **watch** (optional) | `boolean` | If set to true, the events will be refetched every [`pollingInterval`](/deploying/deploy-nextjs-app#--pollinginterval) set at `scaffold.config.ts`. (default: false). |
4041
| **enabled** (optional) | `boolean` | If set to false, the hook will not fetch any data (default: true). |
4142
| **chainId** (optional) | `string` | Id of the chain the contract lives on. Defaults to [`targetNetworks[0].id`](/deploying/deploy-nextjs-app#--targetnetworks) |
43+
| **blocksBatchSize** (optional) | `number` | batch size for fetching events. If specified, each batch will contain at most this many blocks (default: 500) |
4244

4345
## Return Values
4446

static/llms-full.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,13 +1215,15 @@ This example retrieves the historical event logs for the `GreetingChange` event
12151215
| **contractName** | `string` | Name of the contract to read from. |
12161216
| **eventName** | `string` | Name of the event to read. |
12171217
| **fromBlock** | `bigint` | Block number from which to start reading events. |
1218+
| **toBlock** | `bigint` | block number to stop reading events at (if not provided, reads until current block) |
12181219
| **filters** (optional) | `object` | Apply filters to the event based on **indexed** parameter names and values `{ [parameterName]: value }`. |
12191220
| **blockData** (optional) | `boolean` | If set to true it will return the block data for each event (default: false). |
12201221
| **transactionData** (optional) | `boolean` | If set to true it will return the transaction data for each event (default: false). |
12211222
| **receiptData** (optional) | `boolean` | If set to true it will return the receipt data for each event (default: false). |
12221223
| **watch** (optional) | `boolean` | If set to true, the events will be refetched every [`pollingInterval`](/deploying/deploy-nextjs-app#--pollinginterval) set at `scaffold.config.ts`. (default: false). |
12231224
| **enabled** (optional) | `boolean` | If set to false, the hook will not fetch any data (default: true). |
12241225
| **chainId** (optional) | `string` | Id of the chain the contract lives on. Defaults to [`targetNetworks[0].id`](/deploying/deploy-nextjs-app#--targetnetworks) |
1226+
| **blocksBatchSize** (optional) | `number` | batch size for fetching events. If specified, each batch will contain at most this many blocks (default: 500) |
12251227

12261228
#### Return Values
12271229

0 commit comments

Comments
 (0)