Filtering
v1.events
Subscribes to blockchain log events.
v1.transactions
Subscribes to blockchain transactions.
You can filter webhook notifications based on specific criteria.
Each webhook must have either an events filter or a transactions filter (or both).
You can specify partial ABIs to have decoded data sent in the webhook payload. For this you also need to give the sig_hash
of the event or function call.
The following example will filter for Transfer
events on Ethereum for the contract 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
In some cases, different token standards use the same event signature. For example, both ERC-20 and ERC-721 standards have a Transfer
event. The ERC-20 Transfer(address,address,uint256)
event has a non-indexed value
parameter, while the ERC-721 Transfer(address,address,uint256)
has an indexed tokenId
parameter.
To support these scenarios, you can provide an array of ABIs in the abi
field. This allows the webhook to attempt decoding with each ABI until one succeeds.
The abi
field accepts a string that can be either a single JSON object "{}"
or a JSON array of objects '[{},{}]'
.
Here is an example of a webhook that filters for both ERC-20 and ERC-721 Transfer
events across all contracts on the Ethereum mainnet:
And this example will filter for Approve
function calls on Ethereum for the contract 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
params
on the signatures
object will allow you to filter based on the decoded data. Only strict equality is supported at the moment.
For example, if you want to filter for Transfer
events where the from
address is 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
, you can use the following:
- You can specify ABIs to receive decoded event/transaction data
- Parameter filtering supports equality matching only
- At least one filter criteria must be specified