You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update webhook parameter filtering types and add example (#7295)
# [Portal] Fix: Update webhook parameter filtering documentation
## Notes for the reviewer
This PR updates the webhook filtering documentation to:
1. Correct the type definition for `params` in both events and transactions filters
2. Add a practical example showing how to filter for `Transfer` events with specific parameters
## How to test
Review the updated documentation to ensure the type definitions are correct and the new example is clear and helpful.
<!-- start pr-codex -->
---
## PR-Codex overview
This PR updates the `params` property in the webhooks filtering configuration to allow for stricter type definitions, changing it from `Record<string, any>` to `Record<string, string | number>`. It also provides an example of how to filter `Transfer` events.
### Detailed summary
- Changed `params` type in the `webhooks` filtering from `Record<string, any>` to `Record<string, string | number>`.
- Updated `params` type in the `signatures` object from `string[]` to `Record<string, string | number>`.
- Added an example for filtering `Transfer` events with a specific `from` address.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
Copy file name to clipboardExpand all lines: apps/portal/src/app/insight/webhooks/filtering/page.mdx
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Each webhook must have either an events filter or a transactions filter (or both
35
35
signatures: { // Filter by event signatures
36
36
sig_hash: string, // Event signature hash
37
37
abi?: string, // Optional ABI for data decoding
38
-
params?: Record<string, any> // Filter on decoded parameters
38
+
params?: Record<string, string | number> // Filter on decoded parameters
39
39
}[]
40
40
}
41
41
}
@@ -51,7 +51,7 @@ Each webhook must have either an events filter or a transactions filter (or both
51
51
signatures: { // Filter by function signatures
52
52
sig_hash: string, // Function signature hash
53
53
abi?: string, // Optional ABI for data decoding
54
-
params?: string[] // Filter on decoded parameters
54
+
params?: Record<string, string | number>// Filter on decoded parameters
55
55
}[]
56
56
}
57
57
}
@@ -106,6 +106,27 @@ And this example will filter for `Approve` function calls on Ethereum for the co
106
106
107
107
`params` on the `signatures` object will allow you to filter based on the decoded data. Only strict equality is supported at the moment.
108
108
109
+
For example, if you want to filter for `Transfer` events where the `from` address is `0x1f9840a85d5af5bf1d1762f925bdaddc4201f984`, you can use the following:
0 commit comments