Filter Reference
Complete reference for all Chainhook filter types
Filter Reference
Filters define which blockchain events will trigger your chainhook. Use any of the following filter types in your filters.events[] array.
Fungible Token Events (FT)
Any FT Event
Match any fungible token event (transfer, burn, or mint):
{"type": "ft_event"}
FT Transfer
Match FT transfers for a specific asset:
{"type": "ft_transfer","asset_identifier": "SP...ABC.ft::usdc"}
Filter by sender:
{"type": "ft_transfer","asset_identifier": "SP...ABC.ft::usdc","sender": "SP...FROM"}
Filter by receiver:
{"type": "ft_transfer","asset_identifier": "SP...ABC.ft::usdc","receiver": "SP...TO"}
FT Mint
Match FT mint events:
{"type": "ft_mint","asset_identifier": "SP...ABC.ft::usdc"}
FT Burn
Match FT burn events:
{"type": "ft_burn","asset_identifier": "SP...ABC.ft::usdc"}
Non-Fungible Token Events (NFT)
Any NFT Event
Match any NFT event (transfer, burn, or mint):
{"type": "nft_event"}
NFT Transfer
Match NFT transfers for a specific collection:
{"type": "nft_transfer","asset_identifier": "SP...COLL.nft::collectible"}
Filter by sender:
{"type": "nft_transfer","asset_identifier": "SP...COLL.nft::collectible","sender": "SP...FROM"}
Filter by receiver:
{"type": "nft_transfer","asset_identifier": "SP...COLL.nft::collectible","receiver": "SP...TO"}
Filter by specific token ID:
{"type": "nft_transfer","asset_identifier": "SP...COLL.nft::collectible","value": "u123"}
NFT Mint
Match NFT mint events:
{"type": "nft_mint","asset_identifier": "SP...COLL.nft::collectible"}
NFT Burn
Match NFT burn events:
{"type": "nft_burn","asset_identifier": "SP...COLL.nft::collectible"}
STX Events
Any STX Event
Match any STX event (transfer, burn, or mint):
{"type": "stx_event"}
STX Transfer
Match any STX transfer:
{"type": "stx_transfer"}
Filter by sender:
{"type": "stx_transfer","sender": "SP...SENDER"}
Filter by receiver:
{"type": "stx_transfer","receiver": "SP...RECEIVER"}
Contract Events
Contract Deploy
Match any contract deployment:
{"type": "contract_deploy"}
Filter by deployer:
{"type": "contract_deploy","sender": "SP...DEPLOYER"}
Contract Call
Match any contract call:
{"type": "contract_call"}
Match calls to a specific contract:
{"type": "contract_call","contract_identifier": "SP...XYZ.counter"}
Match calls to a specific function:
{"type": "contract_call","contract_identifier": "SP...XYZ.counter","function_name": "increment"}
Filter by caller:
{"type": "contract_call","contract_identifier": "SP...XYZ.counter","function_name": "increment","sender": "SP...CALLER"}
Contract Log
Match contract print events:
{"type": "contract_log","contract_identifier": "SP...XYZ.counter"}
Filter by transaction sender:
{"type": "contract_log","contract_identifier": "SP...XYZ.counter","sender": "SP...SENDER"}
System Events
Coinbase
Match coinbase events (block rewards):
{"type": "coinbase"}
Tenure Change
Match any tenure change:
{"type": "tenure_change"}
Match tenure changes by cause (block found):
{"type": "tenure_change","cause": "block_found"}
Match tenure changes by cause (extended):
{"type": "tenure_change","cause": "extended"}
Combining Filters
You can combine multiple filters in the filters.events array. A chainhook will trigger if any of the filters match:
{"filters": {"events": [{"type": "ft_transfer","asset_identifier": "SP...ABC.token::diko"},{"type": "contract_call","contract_identifier": "SP...XYZ.counter","function_name": "increment"}]}}
This chainhook will trigger on either DIKO transfers or calls to the increment function.