set-before-send-hook
Configure automated contract execution before token transfers on Osmosis to enforce custom rules or trigger actions.
Instructions
Set a before send hook for a token (admin only)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"mnemonic": "<mnemonic>",
"denom": "<denom>",
"contractAddr": "<contractAddr>"
},
"name": "set-before-send-hook"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mnemonic | Yes | BIP-39 mnemonic phrase for signing the transaction (must be admin) | |
| denom | Yes | Token denomination to set hook for | |
| contractAddr | Yes | Contract address for the hook | |
| gas | No | Gas limit (default: auto-estimate) | |
| gasPrice | No | Gas price (default: 0.025uosmo) | |
| memo | No | Transaction memo |