Skip to content

Commit

Permalink
adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
haseebrabbani committed Nov 1, 2023
1 parent 70669a4 commit 149bc7d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cli/commands/run/server/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ message AlertEvent {

message SourceAlertEvent {
string botId = 1;
string alertHash = 2;
string hash = 2;
string timestamp = 3;
string chainId = 4;
uint64 chainId = 4;
}

message Source {
string transactionHash = 1;
Bot bot = 2;
Block block = 3;
SourceAlertEvent sourceEvent = 4;
SourceAlertEvent sourceAlert = 4;
}

message Label {
Expand All @@ -315,6 +315,7 @@ message AlertEvent {
string entityType = 4;
bool remove = 5;
repeated string metadata = 6;
string uniqueKey = 7;
}

// Unique string to identify this class of finding,
Expand Down
1 change: 1 addition & 0 deletions python-sdk/src/forta_agent/alerts_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def get_query(self):
entityType
remove
metadata
uniqueKey
}
addressBloomFilter {
bitset
Expand Down
3 changes: 2 additions & 1 deletion python-sdk/src/forta_agent/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, dict):
self.confidence = dict['confidence']
self.label = dict['label']
self.remove = dict.get('remove', False)
self.unique_key = dict.get('uniqueKey', False)
self.unique_key = dict.get('unique_key', dict.get('uniqueKey'))
self.metadata = dict.get('metadata') if dict.get(
'metadata') is not None else {}
# if metadata is array, convert to map
Expand All @@ -35,6 +35,7 @@ def __init__(self, dict):
def toDict(self):
d = dict(self.__dict__, **{
'entityType': self.entity_type,
'uniqueKey': self.unique_key,
})
return {k: v for k, v in d.items() if v is not None}

Expand Down
1 change: 1 addition & 0 deletions sdk/alerts.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ const getQueryFromAlertOptions = (options: AlertQueryOptions) => {
entityType
remove
metadata
uniqueKey
}
addressBloomFilter {
bitset
Expand Down
1 change: 1 addition & 0 deletions sdk/labels.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const getQueryFromLabelOptions = (options: LabelQueryOptions) => {
label
metadata
remove
uniqueKey
}
source {
alertHash
Expand Down

0 comments on commit 149bc7d

Please sign in to comment.