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
There is no way for filtering based on metadata, that makes the developers iterate over large results pages in case where they can be significantly reduced by specifying some metadata fields to filter.
Metadata works as a Map<string, string> so adding a filter to match key-value pairs on it will allow less computation on the Forta API user side and more precise/powerful filters.
Proposed Solution
I have no details to provide about how to accomplish this feature programmatically, but I have one comment to share about how I would like it to looks like in the API.
By adding something like a metadataContains field in AlertsInput the user will be able to filter to filter alerts by specifying key-value pairs that should be present in the metadata, for example:
In that way users can filter all the alerts that contains string1 as key1 & string2 as key2.
Additional context
Some examples of usage:
There is a race condition for calling a function. Each time it is called an event is emitted with the caller in the metadata. It is needed to filter all the alerts given a caller.
There is an event containing hashes in the metadata as hash: "true" to simulate a set of hashes. It is needed to filter alerts containing an specific hash.
There is a bot monitoring roles in some smart contract. There is needed to count how many times operator X granted the role R. (operator & role are metadata fields)
The text was updated successfully, but these errors were encountered:
Problem
There is no way for filtering based on metadata, that makes the developers iterate over large results pages in case where they can be significantly reduced by specifying some metadata fields to filter.
Metadata works as a
Map<string, string>
so adding a filter to match key-value pairs on it will allow less computation on the Forta API user side and more precise/powerful filters.Proposed Solution
I have no details to provide about how to accomplish this feature programmatically, but I have one comment to share about how I would like it to looks like in the API.
By adding something like a
metadataContains
field inAlertsInput
the user will be able to filter to filter alerts by specifying key-value pairs that should be present in the metadata, for example:In that way users can filter all the alerts that contains
string1
askey1
&string2
askey2
.Additional context
Some examples of usage:
hash: "true"
to simulate a set of hashes. It is needed to filter alerts containing an specific hash.The text was updated successfully, but these errors were encountered: