check_grant
Check if a grant allows spending a specified amount on a target program, verifying allowlist, cap, and root configuration before consumption.
Instructions
Agent consume path. Agent signs. Increments spent_lamports. Does not move SOL. Empty allowlist is denied. cap 0 requires amount 0. Optional root if not in config. Relayer submits if you also call pay.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Root pubkey if GROKCHAIN_ROOT_KEYPAIR is unset | |
| agent | No | Agent pubkey if GROKCHAIN_AGENT_KEYPAIR is unset (unsigned-tx path) | |
| dry_run | No | ||
| target_program | Yes | Target program id (v1 router mode: local-only INTENTS on localnet; grokchain-devnet INTENTS EYhYtq… on devnet). | |
| amount_lamports | Yes | Amount to consume from the cap counter. 0 is valid (call-only). |