Retrieve events and calls tracking various activities and interactions within smart contracts

Get Events

The Get Events endpoint provides access to events with various filtering options.

Key Query ParametersDescription
contractfilters data by a specific smart contract
originfilters data by the address that signs the transaction and pays fees
op_codefilters data by the preferred event operation code
topic_0filters data by the event signature hash
topic_1, topic_2, topic_3filters data by specific arguments of the user's choice
block_number_start/block_number_enddefines the range of blocks within which events took place
timestamp_start/timestamp_enddefines the time interval within which events took place
block_hashdefines the reference number of the block to scan

Get all events of a specific contract

The following request retrieves all events that have ever occurred on our PRQ token smart contract on the Ethereum Mainnet. Be sure to replace YOUR_API_KEY with your actual API key.

curl --request GET \
--url 'https://api.parsiq.net/tsunami/eip155-1/v1/events?block_number_start=0&block_number_end=latest&contract=0x362bc847A3a9637d3af6624EeC853618a43ed7D2&limit=1000' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'

Get all Uniswap pairs

If you want to obtain a list of all Uniswap V2 pools or pairs, provide the following parameters:

  • 'topic 0' to view events of the desired type
  • an 'address' of the Uniswap V2 Factory contract
  • a 'block range'

In this particular example, the 'block range' is set from the first to the latest. The request pulls out every 'PairCreated' event, where 'topic 0' is '0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9', on the Uniswap V2 factory contract. Be sure to replace YOUR_API_KEY with your actual API key.

curl --request GET \
--url 'https://api.parsiq.net/tsunami/eip155-1/v1/events?block_number_start=1&block_number_end=latest&limit=100&contract=0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f&topic_0=0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9' \
--header 'Accept: application/json' \
--header 'authorization: Bearer YOUR_API_KEY'

Get all Aave borrows of a specific address

If you need to retrieve a list of all the instances when a certain address has borrowed anything on Aave, specify these parameters:

  • 'topic 0' to filter events of the desired type
  • 'the address' of the borrower
  • the 'block range'

In the following example, the 'block range' spans from the first to the latest. The request returns every borrow event, where 'topic 0' is '0xc6a898309e823ee50bac64e45ca8adba6690e99e7841c45d754e2a38e9019d9b', on any contract triggered by the specified address called 'origin'. Be sure to replace YOUR_API_KEY with your actual API key.

curl --request GET \
--url 'https://api.parsiq.net/tsunami/eip155-1/v1/events?origin=0xbd723fc4f1d737dcfc48a07fe7336766d34cad5f&block_number_start=1&block_number_end=latest&limit=100&topic_0=0xc6a898309e823ee50bac64e45ca8adba6690e99e7841c45d754e2a38e9019d9b' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'

Get Calls

The Get Calls endpoint obtains data about interactions with a smart contract based on specific parameters. This includes external function calls, transfers of native currency, and all instances of the contract being created.

Key Query ParametersDescription
contractFilters data by a specific smart contract address
originFilters data by the address that signs the transaction and pays fees
senderFilters data by the address that invokes a smart contract
sig_hashFilters data by the signature hash of the preferred function call
block_number_start/block_number_endDefines the range of blocks within which function calls took place
timestamp_start/timestamp_endDefines the time interval within which function calls took place
block_hashDefines the reference number of the block to scan
include-eventsIncludes events in the results if needed

Get the signature hash of a function

The signature hash of a function can be obtained on Etherscan by entering the address of a smart contract in the search bar and clicking on the '+Click to show more' button to view more details, as shown below.

Alternatively, the signature hash can be received by utilizing the Get Calls endpoint and filtering the results based on the contract and origin addresses.

To accomplish this, locate a transaction corresponding to the desired function call, where the signature hash is present in the Tsunami response. Additionally, specify the block range within which to search. In the example below, it is set from block 1 to the latest.

By making this request, you retrieve every function call triggered by the specified address, called 'origin', on the specified contract. Be sure to replace YOUR_API_KEY with your actual API key.

curl --request GET \
--url 'https://api.parsiq.net/tsunami/eip155-1/v1/calls?origin=0x21b97409b8fa7480f82fa2bf2f8e8a381cf80860&block_number_start=1&block_number_end=latest&limit=100&contract=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer Ujlp157DtncttvfTfWV0JNmt2jMHkJJP'

Find the transaction with the right tx_hash and see the sig_hash field in the response:

{
  "range": {
    "has_more": false,
    "start_block": 1,
    "end_block": 16541428,
    "next_offset": null
  },
  "items": [
    {
      "id": "0000000000fc660e-0018-00000000",
      "sender": "0x21b97409b8fa7480f82fa2bf2f8e8a381cf80860",
      "sig_hash": "0x095ea7b3",
      "tx_hash": "0x71f0866502848f379b4b35d24f3588df5c14b669506dfb7ce2eb7121d36fb66c",
      "block_hash": "0x5f301020023d0f1a4b63eaf656f2071e9561b6d5ed68758858f99d4aaeaaff12",
      "block_number": 16541198,
      "timestamp": 1675341887,
      "origin": "0x21b97409b8fa7480f82fa2bf2f8e8a381cf80860",
      "contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "input_data": "0x095ea7b3000000000000000000000000c92e8bdf79f0507f65a392b0ab4667716bfe0110ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
    }
  ]
}

Get all approve() calls of a specific address

To retrieve a list of all instances where a particular address approved any token for spending, provide the address of interest and the signature hash for the approve() function. Additionally, specify the block range, which in this example is set from block 1 to the latest.

The request fetches every call to the approve() function, specifically those with the function signature hash '0x095ea7b3', on any contract invoked by the specified address or 'origin'. Be sure to replace YOUR_API_KEY with your actual API key.

curl --request GET \
--url 'https://api.parsiq.net/tsunami/eip155-1/v1/calls?origin=0x21b97409b8fa7480f82fa2bf2f8e8a381cf80860&sig_hash=0x095ea7b3&block_number_start=1&block_number_end=latest&limit=100' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'

Get all swaps of a specific Uniswap pool

To obtain a list of all swaps made on a particular Uniswap pool, provide the address of the pool and the signature hash for the swap() function. Additionally, specify the block range, which in this example is set from block 1 to the latest.

The request pulls out every occurrence of the swap() function call, identified by the signature hash '0x022c0d9f', within the specified contract. Be sure to replace YOUR_API_KEY with your actual API key.

curl --request GET \
--url 'https://api.parsiq.net/tsunami/eip155-1/v1/calls?sig_hash=0x022c0d9f&block_number_start=1&block_number_end=latest&limit=100&contract=0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'