diff --git a/cli/commands/run/server/agent.proto b/cli/commands/run/server/agent.proto index 41c0e37..346a046 100644 --- a/cli/commands/run/server/agent.proto +++ b/cli/commands/run/server/agent.proto @@ -296,16 +296,16 @@ message AlertEvent { message SourceAlertEvent { string botId = 1; - string hash = 2; + string alertHash = 2; string timestamp = 3; - uint64 chainId = 4; + string chainId = 4; } message Source { string transactionHash = 1; Bot bot = 2; Block block = 3; - SourceAlertEvent sourceAlert = 4; + SourceAlertEvent sourceEvent = 4; } message Label { diff --git a/python-sdk/src/forta_agent/label.py b/python-sdk/src/forta_agent/label.py index e6acbb0..30493bf 100644 --- a/python-sdk/src/forta_agent/label.py +++ b/python-sdk/src/forta_agent/label.py @@ -21,6 +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.metadata = dict.get('metadata') if dict.get( 'metadata') is not None else {} # if metadata is array, convert to map diff --git a/python-sdk/src/forta_agent/labels_api.py b/python-sdk/src/forta_agent/labels_api.py index ad50359..aab463b 100644 --- a/python-sdk/src/forta_agent/labels_api.py +++ b/python-sdk/src/forta_agent/labels_api.py @@ -54,6 +54,7 @@ def get_query(self): label metadata remove + uniqueKey } source { alertHash diff --git a/sdk/label.ts b/sdk/label.ts index 340b9af..256f2b5 100644 --- a/sdk/label.ts +++ b/sdk/label.ts @@ -37,6 +37,7 @@ type LabelInput = { source?: LabelSource; createdAt?: string; id?: string; + uniqueKey?: string; }; export class Label { @@ -49,7 +50,8 @@ export class Label { readonly metadata: { [key: string]: string }, readonly source?: LabelSource, readonly id?: string, - readonly createdAt?: string + readonly createdAt?: string, + readonly uniqueKey?: string ) {} static from(labelInput: LabelInput) { @@ -66,6 +68,7 @@ export class Label { source, id, createdAt, + uniqueKey }: LabelInput) { if (typeof entityType == "string") { entityType = ENTITY_TYPE_STRING_TO_ENUM[entityType]; @@ -91,7 +94,8 @@ export class Label { metadata, source, id, - createdAt + createdAt, + uniqueKey ); } }