Documentation Index
Fetch the complete documentation index at: https://docs.mandate.md/llms.txt
Use this file to discover all available pages before exploring further.
What does scan do?
The scan command walks your TypeScript and JavaScript files looking for wallet calls (.sendTransaction(), .transfer(), writeContract(), and 7 other patterns) that do not have a corresponding Mandate validation in the same file. It requires no authentication and no configuration.
Usage
Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
directory | No | . (current directory) | Path to the directory to scan |
Options
| Option | Required | Description |
|---|---|---|
--json | No | Output results as JSON instead of human-readable text |
--verbose | No | Show all findings, including protected calls |
--ignore | No | Comma-separated glob patterns to skip (e.g. tests,scripts) |
--no-telemetry | No | Disable anonymous scan telemetry |
Patterns detected
The scanner looks for 10 financial call patterns in.ts, .js, .tsx, and .jsx files:
| Pattern | Example |
|---|---|
wallet.transfer( | Direct wallet transfer calls |
wallet.sendTransaction( | Generic transaction sends |
wallet.send( | Shorthand send calls |
.sendTransaction( | Any object’s sendTransaction |
.sendRawTransaction( | Raw transaction sends |
writeContract( | Viem contract writes |
walletClient.write | Viem wallet client writes |
executeAction(...transfer) | Framework action executions |
execute_swap | Swap execution functions |
execute_trade | Trade execution functions |
@mandate, references MandateClient, MandateWallet, mandate.validate, or mandate.preflight. The scanner also checks for project-level protection: if @mandate.md/sdk appears in any package.json or a MANDATE.md file exists, all findings are marked protected.
Exit codes
| Code | Meaning |
|---|---|
0 | No unprotected calls found (clean) |
1 | One or more unprotected calls detected |
Human-readable output
JSON output
CI integration
Add the scan to your CI pipeline. The exit code 1 fails the build if unprotected calls exist. GitHub Actions:--json flag is useful for programmatic processing in CI. Pipe it to jq to extract specific fields or fail on thresholds.
Next Steps
Codebase Scanner Guide
Detailed walkthrough of scanner patterns and remediation steps.
CI/CD Integration
Set up Mandate checks in your deployment pipeline.
Validate Transactions
Add validation to the unprotected calls the scanner found.