Skip to main content

Endpoints

1.Subscribe

Method: POST

URL: https://<domain>/api/v1/watch/subscribe

Request body

NameRequiredTypeDescriptionExample
watch_entity_listYesList<String>List of addresses that need to be monitored[“0x9bd547446ea13c0c13df2c1885e1f5b019a77441”, “0x8315177ab297ba92a06054ce80a67ed4dbd7ed3a”]
watch_event_codeYesStringcode of an event that should be monitored . see here Specificationbig_amount_txn
threshold_configYesJSON MapConfiguration that should be used to filter alerts related to the particular event.{"severity”: "LOW"} or {"current_value_gt": "60","current_value_lt": "20","current_value_eq": "10","delta_value": "10","delta_percent": "0.3"}
Severity will also be stored on watch side.
current_value_gt : When the event content contains the current_value field, and current_value > current_value_gt, an alarm notification is triggered
current_value_lt : When the event content contains the current_value field, and current_value < current_value_lt, an alarm notification is triggered
current_value_eq : When the event content contains the current_value field, and current_value == current_value_eq, an alarm notification is triggered
delta_value : When the event content contains the delta_value field, and delta_value >= delta_value, an alarm notification is triggered
delta_percent : When the event content contains the delta_percent field, and delta_percent >= delta_percent, an alarm notification is triggered
notify_configYesJSON MapDefines what endpoint should be used to receive alerts and with what value. Currently only webhook is supported.{"webhook": " http://test.test "}

Response

NameNotNullDescriptionTypeExample
statusYesResult of operationstringOK:The scanning process terminated as expected

ERROR:Exception thrown or unexpected situation met
codeYesResult code of operationint000000000: success

000001: unknown server error occurred during detection

000002: Number of requests exceeded limit

000003: unknown appId

000004: X-Signature-signature header can't be null

000005: verify signature error

  • appid, timestamp, nonce, signature headers can not be null or empty
  • nonce is illegal
  • timestamp has illegal
  • timestamp is expired
  • invalid appid
  • appid has expired
  • invalid signature
  • replay request
  • app is out of count limit
dataYesQuery ResultjsonSee Data form

Data:

NameNotNullTypeDescriptionExample
watch_resultYesMapWhether a result Map of subscription
key-watch_entity (address)
value-provider_watch_id(When the monitoring is successful, the unique identification code of the monitoring; if Failed, fill in a blank string, or null)
{"0x9bd547446ea13c0c13df2c1885e1f5b019a77441":"abc12345", "0x8315177ab297ba92a06054ce80a67ed4dbd7ed3a":"zxc456", "0x66666177ab297ba92a06054ce80a67ed4dbdffcc":"" }

2.Unsubscribe

Method: POST

URL: https://<domain>/api/v1/watch/unsubscribe

Request body

NameRequiredTypeDescriptionExample
watch_id_listYesList<String>the unique identification code of the monitoring[“642272312405626880”, “642272312405626881”] You can fill in one of watch_id_list and watch_entity_list. If both are filled in, watch_id_list is the main one, and watch_entity_list is ignored.
watch_entity_list (addresses)YesList<String>addresses that need to be monitored[“0x9bd547446ea13c0c13df2c1885e1f5b019a77441”, “0x8315177ab297ba92a06054ce80a67ed4dbd7ed3a”] You can fill in one of watch_id_list and watch_entity_list. If both are filled in, watch_id_list is the main one, and watch_entity_list is ignored.
watch_event_codeNoStringcode of an event that should be monitoredbig_amount_txn

Response

NameNotNullDescriptionTypeExample
statusYesResult of operationstringOK:The scanning process terminated as expected

ERROR:Exception thrown or unexpected situation met
codeYesResult code of operationint000000000: success

000001: unknown server error occurred during detection

000002: Number of requests exceeded limit

000003: unknown appId

000004: X-Signature-signature header can't be null

000005: verify signature error

  • appid, timestamp, nonce, signature headers can not be null or empty
  • nonce is illegal
  • timestamp has illegal
  • timestamp is expired
  • invalid appid
  • appid has expired
  • invalid signature
  • replay request
  • app is out of count limit
dataYesQuery ResultjsonSee Data form

Data:

NameNotNullTypeDescriptionExample
watch_id_resultYesMapWhether a result Map of subscription key-watch_id value-SUCCESS / FAIL / NOT_FOUND{ "642272315572326400": "NOT_FOUND" }
watch_entity_resultYesMapWhether a result Map of subscription key-watch_entity (address) value-SUCCESS / FAIL / NOT_FOUND{ "0x9bd547446ea13c0c13df2c1885e1f5b019a77441": "NOT_FOUND" }

3.List Subscriptions

Method: POST

URL: https://<domain>/api/v1/watch/subscriptions/list

Request body

NameRequiredTypeDescriptionExample
watch_entity_listNoList<String>List of addresses that need to be monitored[“0x9bd547446ea13c0c13df2c1885e1f5b019a77441”, “0x8315177ab297ba92a06054ce80a67ed4dbd7ed3a”]
page_indexNoIntegerWhen the number is large, it will be processed by paging, and the page number needs to be set.Defaults 1
page_sizeNoIntegerWhen the number is large, it will be processed by paging, and the page number needs to be set.Defaults 50, max 50

Response

NameNotNullDescriptionTypeExample
statusYesResult of operationstringOK:The scanning process terminated as expected

ERROR:Exception thrown or unexpected situation met
codeYesResult code of operationint000000000: success

000001: unknown server error occurred during detection

000002: Number of requests exceeded limit

000003: unknown appId

000004: X-Signature-signature header can't be null

000005: verify signature error

  • appid, timestamp, nonce, signature headers can not be null or empty
  • nonce is illegal
  • timestamp has illegal
  • timestamp is expired
  • invalid appid
  • appid has expired
  • invalid signature
  • replay request
  • app is out of count limit
dataYesQuery ResultjsonSee Data form

Data:

NameNotNullDescriptionTypeExample
subscription_listYesWhether a result of subscription is true or falseList<Subscription>See “Subscription” form
page_indexYesLong
page_sizeYesLong
totalYesLong

Subscription:

NameNotNullDescriptionTypeExample
watch_entityYesaddresses that was monitoredString0x9bd547446ea13c0c13df2c1885e1f5b019a77441
watch_event_listYesList<WatchEvent>

WatchEvent:

NameNotNullDescriptionTypeExample
watch_event_codeYescode of an event that should be monitoredStringbig_amount_txn
provider_listNoprivoder list if list is empty,means that the subscription is still being processed and has not yet taken effectJSON List<String>Hashdit
watch_threshold_listYesSubscription threshold, the smallest subscription unitJSON List<WatchThreshold>See “WatchThreshold” form

WatchThreshold:

NameNotNullDescriptionTypeExample
watch_idYesId of an event which is monitored.String123
watch_event_codeYescode of an event that should be monitoredStringbig_amount_txn
provider_listNoprivoder list if list is empty,means that the subscription is still being processed and has not yet taken effectJSON List<String>Hashdit
threshold_configYesConfiguration that should be used to filter alerts related to the particular event.JSON Map{"severity”: "LOW"} or {"currentValueGt": "60","currentValueLt": "20","deltaValue": "10","deltaPercent": "30%"}
notify_configYesDefines what endpoint should be used to receive alerts and with what value. Currently only webhook is supported.JSON Map{"webhook": " http://test.test "}

4.Watch Events

Method: POST

URL: https://<domain>/api/v1/watch/event/list

Request body

Empty

Response

NameNotNullDescriptionTypeExample
statusYesResult of operationstringOK:The scanning process terminated as expected

ERROR:Exception thrown or unexpected situation met
codeYesResult code of operationint000000000: success

000001: unknown server error occurred during detection

000002: Number of requests exceeded limit

000003: unknown appId

000004: X-Signature-signature header can't be null

000005: verify signature error

  • appid, timestamp, nonce, signature headers can not be null or empty
  • nonce is illegal
  • timestamp has illegal
  • timestamp is expired
  • invalid appid
  • appid has expired
  • invalid signature
  • replay request
  • app is out of count limit
dataYesQuery resultList<SupportEvent>See “SupportEvent” form

SupportEvent:

NameNotNullDescriptionTypeExample
watch_event_codeYescode of an event that should be monitoredstringbig_amount_txn
support_entity_type_listYeswatch entity typeJSON List<String>["EOA","ERC20","ERC721","ERC1155","UNIVERSAL"] UNIVERSAL: no ERC CA , Dapp
mini_thresholdYesMinimum threshold to trigger an alarmstring0.005
severity_configYesThe default monitoring level and the corresponding trigger thresholdJSON Map{"HIGH":{"delta_percent":"0.05"}, "MEDIUM":{"delta_percent":"0.2"}, "LOW":{"delta_percent":"0.5"}}
trigger_frequencyYesAlarm trigger frequencystringMinutes (blocks)
event_descriptionNoevent descriptionstringlarge amount transfers

5.webhook callback

Method: POST

URL: webhook url provided by user

Request body

NameRequiredTypeDescriptionExample
sourcesYesstringAlarm Information ProviderHashdit
watchThresholdIdYesstringThe unique number of the subscription record used to identify which subscription the alert came from657425636074508288
watchEntityYesstringcode of an event that should be monitored0x9bd547446ea13c0c13df2c1885e1f5b019a77441
thresholdConfigYesstringThe threshold configuration of subscription records is used to compare whether the alarm content meets expectations"{\"severity\":\"LOW\"}"
chainIdYesStringchain id56
watchEntityTypeYesstringwatch entity typeERC20,ERC721,ERC777,ERC1155,ERC4626,Universal,Unverified
watchEventCodeYesstringcode of an event that should be monitoredbig_amount_txn
timestampYesstringTimestamp of the alarm, unix time, Second1678956256
eventValuesYesMapDetails of the eventsee EventValues Map

EventValues Map:

map format, the content of each event is different, here is an example of trust_score_decrease

NameRequiredTypeDescriptionExample
blockNumberYesstringThe height of the block where the event occurred95
cmcSlugYesstring
commentYesstring
txHashYesstringThe transaction hash of the alarm event0x9b4e6239dba9121600eedd8cf1a789d56a53b016843918d3704a31afa3761971
currentValueYesstringthe value of this transfer0.3684
{
"sources": "Hashdit",
"watchThresholdId": "657425636074508288",
"chainId": "56",
"watchEntity": "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
"watchEntityType": "ERC20",
"watchEventCode": "big_amount_txn_usd",
"thresholdConfig": "{\"severity\":\"LOW\"}",
"timestamp": "1673886407",
"eventValues": {
"blockNumber": "24840581",
"cmcSlug": "pancakeswap",
"comment": "",
"txHash": "0x9b4e6239dba9121600eedd8cf1a789d56a53b016843918d3704a31afa3761971",
"currentValue": "373.26463078223327"
}
}

6.Query Alerts

Method: POST

URL: https://<domain>/api/v1/watch/alert/list

Request body

NameRequiredTypeDescriptionExample
idNostringalert id123
watch_entity_valueNostringsubscription addresses0xee226379db83cffc681495730c11fdde79ba4c0c

0x4dbd4fc535ac27206064b68ffcf827b0a60bab3f

...
watch_event_codeNostringwatch event typeERC20,ERC721,ERC777,ERC1155,ERC4626,Universal,Unverified
start_timeNolongStart date for query1661371200000
end_timeNolongEnd date for query1661630400000
page_indexNointWhen the number is large, it will be processed by paging, and the page number needs to be set.Defaults 1
page_sizeNointWhen the number is large, it will be processed by paging, and the page number needs to be set.Defaults 50 max 50

Response

NameNotNullDescriptionTypeExample
statusYesResult of operationstringOK:The scanning process terminated as expected

ERROR:Exception thrown or unexpected situation met
codeYesResult code of operationint000000000: success

000001: unknown server error occurred during detection

000002: Number of requests exceeded limit

000003: unknown appId

000004: X-Signature-signature header can't be null

000005: verify signature error

  • appid, timestamp, nonce, signature headers can not be null or empty
  • nonce is illegal
  • timestamp has illegal
  • timestamp is expired
  • invalid appid
  • appid has expired
  • invalid signature
  • replay request
  • app is out of count limit
dataYesQuery resultjsonSee “data” form

Data:

NameNotNullTypeDescriptionExample
alert_listYesList<AlertInfo>alert info listSee “AlertInfo” form
page_indexYesLong
page_sizeYesLong
totalYesLong

AlertInfo:

NameNotNullTypeDescriptionExample
idYesLongalert id123
watch_idYesStringId of an event which is monitored.123
watch_entity_valueYesStringaddresses that was monitored0x9bd547446ea13c0c13df2c1885e1f5b019a77441
watch_event_codeYesStringcode of an event that should be monitoredbig_amount_txn
notify_contentYesStringnotification content
notify_statusYesStringnotification statusINIT/SUCCESS/FAILED
notify_typeYesStringnotification typewebhook
notify_urlYesStringnotification urlhttp://test.test
error_msgNoStringPrompt message when notification fails
alert_timeYesLongalert time;Unix timestamp1661371200000