Stacks scopes are parameters you use to define the if this specification logic of your Chainhook on the Stacks blockchain. In other words, scopes specify what on-chain events you are looking to monitor and track. For more information on Chainhook design, please view predicate design.
txid
The txid scope allows you to query transactions based on their transaction ID. This is particularly useful for tracking specific transactions or auditing transaction histories.
The block_height scope allows you to query blocks based on their height. This is useful for identifying specific blocks or ranges of blocks in the blockchain.
The equals property specifies the exact height of the block to match.
higher_than
Required
integer
The higher_than property specifies that the block height should be greater than the provided value.
lower_than
Required
integer
The lower_than property specifies that the block height should be less than the provided value.
between
Required
array of integers
The between property specifies a range of block heights to match, inclusive of the provided start and end values.
{
"if_this": {
"scope":"block_height",
"equals":141200
}
}
ft_transfer
The ft_transfer scope allows you to query transactions based on fungible token transfers. This is useful for tracking specific token movements or auditing token transfer histories.
The nft_transfer scope allows you to query transactions based on non-fungible token transfers. This is useful for tracking specific NFT movements or auditing NFT transfer histories.
The stx_transfer scope allows you to query transactions involving STX token movements. This is crucial for monitoring STX transfers, including minting, burning, and locking actions.
The actions property specifies the types of STX token actions to observe, such as mint, transfer, burn, and lock.
{
"if_this": {
"scope":"stx_transfer",
"actions": ["transfer"]
}
}
print_event
The print_event scope allows you to query transactions based on specific print events emitted during contract execution. This is useful for monitoring specific events for auditing or tracking purposes.
The contract_call scope allows you to query transactions that involve direct calls to specific methods within a smart contract. This is particularly useful for tracking interactions with critical contract functions.
The contract_deployment scope allows you to query transactions involving the deployment of smart contracts. This is crucial for monitoring new contract deployments and ensuring compliance with expected deployments.