post https://api.parsiq.net/tsunami///filters
Create real-time filters for monitoring on-chain events and calls
Authorization required to use this endpoint
To get your API key, follow the instruction here.
The Create Filter endpoint enables you to create a real-time filter, which allows you to monitor blockchain events as they occur. Additionally, you can receive instant notifications via a defined webhook URL.
The topic_0
, topic_1
, topic_2
, topic_3
, and contract
fields can each hold a maximum of five values in a JSON array. The example below will provide you with notifications for every transfer made within the PRQ token's smart contract.
{
"name": "Real Time Filter",
"description": "Get all Transfers within Smart Contract",
"endpoint_url": "https://my-webhook-url.com/c6fc0bb1-d6ac-4177-a571-decf6675abe4",
"filter_type": "events",
"criteria": {
"topic_0": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"
],
"contract": [
"0x362bc847A3a9637d3af6624EeC853618a43ed7D2"
]
}
}
The data generated by the filter above will resemble the data obtained from using the Get Events endpoint.
{
"block": {
"block_number": 27733841,
"block_hash": "0x6bc1221f0224fdfc0b3fd113dad21f68c734133d19af21ea070949fa18100944",
"parent_hash": "0x6bc1221f0224fdfc0b3fd113dad21f68c734133d19af21ea070949fa18100944"
},
"items": [
{
"id": "0000000001a72f50-0004-00000003",
"topic_0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"topic_1": "0x000000000000000000000000765fdb41ea7fd9ff26c8dd4eea20a4248f106622",
"topic_2": "0x000000000000000000000000c1d48a9173212567bd358e40c50bfe131a9fabf1",
"topic_3": null,
"log_data": "0x0000000000000000000000000000000000000000000000000001faf62590d24f",
"tx_hash": "0x114176f13bb80daaf72c2191aa13797e56457a6c752e2baafa91898918c39100",
"block_hash": "0x6bc1221f0224fdfc0b3fd113dad21f68c734133d19af21ea070949fa18100944",
"block_number": 27733840,
"timestamp": 1661189266,
"op_code": "LOG3",
"origin": "0xc1d48a9173212567bd358e40c50bfe131a9fabf1",
"contract": "0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa"
},
{
"id": "0000000001a72f50-0004-00000006",
"topic_0": "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c",
"topic_1": "0x00000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45",
"topic_2": null,
"topic_3": null,
"log_data": "0x00000000000000000000000000000000000000000000000000b1a2bc2ec50000",
"tx_hash": "0x114176f13bb80daaf72c2191aa13797e56457a6c752e2baafa91898918c39100",
"block_hash": "0x6bc1221f0224fdfc0b3fd113dad21f68c734133d19af21ea070949fa18100944",
"block_number": 27733840,
"timestamp": 1661189266,
"op_code": "LOG2",
"origin": "0xc1d48a9173212567bd358e40c50bfe131a9fabf1",
"contract": "0x9c3c9283d3e44854697cd22d3faa240cfb032889"
}
]
}