Preamble

Tsunami API provides you with a capability of blockchain real time monitoring through the concept of Real Time Filters.

Real Timer Filter is a set of conditions that should be met within a blockchain event or call to produce a payload.

When the defined conditions are met, Tsunami API will produce a JSON payload similar to our fundamental data endpoints and deliver it via WebHook defined during a filter's creation.

Payloads are produced on a block basis, if block contains more than one entry that meets the criteria of your Real Time Filter—you will get them in one payload.

By default, Real Time Filter will deliver you the raw data, but you can also set up an ABI Decoder to get your data decoded!

Getting started

Generally, all you need to do is to create a Real Time Fitler using the HTTP interface.

Once filter is created, Tsunami API will scan every block to find entries that meet the filter's condition.

Payload example

{
  "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"
    }
  ]
}