Learn about parameters in our endpoints, how they work, and how to pass multiple values
Parameters supporting Multiple values
The Tsunami API supports sending requests with multiple values in parameters, allowing for more functionality. This page will cover what can you combine to get more functionality from Tsunami API.
To use it, write a parameter that supports multiple strings as an array in your request, like this:
?contract=0x00,0x01,0x002
The following parameters support multiple values:
- For Get Events:
contracts
andtopics
- For Get Calls:
contracts
andsig_hash
- For Get Native & Token Transfers by address and Get Token Transfers by contract address:
contracts
andasset_type
- For Get Contract Create and Get Contract Self-Destruct:
contracts
- For Get Decoded Events:
contracts
andtopics
- For Get Decoded Calls:
contracts
andsig_hash
Example One
You are making a request that has two contracts
and one topic_0
, lets call them Contract 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 and 0x362bc847A3a9637d3af6624EeC853618a43ed7D2, topic_0
0xddf5...b3ef
By doing that you will get every Event that happened to have these combinations of contracts and topics:
0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 + '0xddf5...b3ef'
0x362bc847A3a9637d3af6624EeC853618a43ed7D2 + '0xddf5...b3ef'
Example Two
Imagine that you need to make a request that contains the contract
0x362bc847A3a9637d3af6624EeC853618a43ed7D2 with topic_0
0xddf5...b3ef and 0xd78a...d822, topic_1
0x7C66...B445 and 0x9EA3...b1a4.
With that, the API will retrieve every Event with these combinations:
0x362bc847A3a9637d3af6624EeC853618a43ed7D2 + '0xddf5...b3ef' + '0x7C66...B445'
0x362bc847A3a9637d3af6624EeC853618a43ed7D2 + '0xddf5...b3ef' + '0x9EA3...b1a4'
0x362bc847A3a9637d3af6624EeC853618a43ed7D2 + '0xd78a...d822' + '0x7C66...B445'
0x362bc847A3a9637d3af6624EeC853618a43ed7D2 + '0xd78a...d822' + '0x9EA3...b1a4'
Query parameters
Read about every parameter used for querying in the table below:
Parameter | Description |
---|---|
chainID | The id of our blockchain. See the full list of Available blockchains. |
version | Currently, set to 1 . |
address | The Externally Owned Account (EOA) address, is a 42-character hexadecimal address. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045. |
direction | Transaction direction to filter out origin or destination addresses. either incoming or outgoing . |
counterparty | The Externally Owned Account (EOA) address, is a 42-character hexadecimal address. It is an address on the opposite side of the direction (incoming, outgoing). Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 |
contract | The contract is a 42-character hexadecimal address. For example, pick this contract 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 to get events. You can query up to 5 contracts within one request. |
asset_type | The asset type is the type of token you want to monitor. It takes ft (ERC-20 tokens), nft (ERC-720 tokens), multi (ERC-1155 tokens), and `native (Native tokens of the blockchains, like ETH, MATIC, BNB and others). |
blockhash | The block hash is a 66-character hexadecimal value for example like 0x5d423d4895769b218d450fadcb325655a79e4c9c8d912cdc397735cd1faa82e2. |
block_number_start | The first block to scan. Accepts block number like "15537351", "latest", "-1, -2, etc.". |
block_number_end | The last block to scan. Accepts block number like "15537353", "latest", "-1, -2, etc.". |
timestamp_start | The UNIX timestamp. The block must be within the timestamp range. Accepts Unix timestamp like "1663223655". |
timestamp_end | The UNIX timestamp. The block must be within the timestamp range. Accepts Unix timestamp like "1663223656". |
include_events | Takes true or false values. If set to true, it will return transaction events. |
include_logs | Takes true or false values. If set to true, it will return transaction events, calls and contract creates/destructs |
offset | A parameter used to paginate through the results. set the offset parameter in our request to the same value as range.next_offset in a previous response, to view the next results. |
origin | Transaction origin, a 42-character hexadecimal address who signed the transaction & paid fees. |
sender | A 42-character hexadecimal address of the sender of the message. |
caller | A 42-character hexadecimal address from which the SELFDESTRUCT or CREATE was called. |
op_code | The opcode of the event |
sig-hash | A 10-character hexadecimal signature hash of the function you looking for. |
topic0 | Topic 0 is a 66-character hexadecimal value of an event signature. For example, Transfer(from_address,to_address,uint256) event would have a topic 0 signature of 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef . You can query up to 5 contracts within one request. |
topic1 | Topic1 is a 66-character hexadecimal value of the first indexed parameter of the event. In the example above it can be from_address |
topic2 | Topic2 is a 66-character hexadecimal value of the first indexed parameter of the event. In the example above it can be to_address |
topic3 | Topic1 is a 66-character hexadecimal value of the first indexed parameter of the event. |
limit | Maximum rows to return. Free accounts can return a max of 100 rows per request. Pro accounts can return a max of 100 rows per request. Use the offset parameter to view all results. |