Repository navigation
fix(alerts): reject the retired smart-contract-call alert type - #837
Conversation
The Nansen API retired the smart-contract-call alert type and rejects every create for it with "Invalid alert type". The CLI still documented and built it, and its flags (--signature-hash, --caller, --contract, --exclude-caller, --exclude-contract) were silently ignored on the other types because alerts does not reject unknown flags. alerts create/update now reject the type, those flags (bare or with a value) and any other unknown --type with INVALID_PARAMS, before reading stdin or sending a request. The help, schema (now with a --type enum) and skills no longer offer the type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nansen-pr-reviewer summaryThe change removes the retired smart-contract-call alert type and its dedicated flags from command handling, help, schema, and documentation. Create and update inputs are validated before secrets or API requests are processed, and updates to existing retired alerts are rejected locally. The relevant regression cases are covered by tests; no correctness or security issues were found. Deterministic check: success — No issues found Risk: 2/5 (Low) ✅ Auto-approved — Deterministic gates passed: severity thresholds met, recommendation "approve", risk level 2/5 within threshold 3. Token usage: 104,940 input, 1,353 output, 39,064 cache read | Usage Guide Cooldown: for the next 10 minutes (counting from when this review finished), new pushes to this PR will not trigger another review — the next push after the window expires will. Need a fresh review sooner? Comment |
There was a problem hiding this comment.
✅ Auto-approved by Nansen review
Deterministic gates passed: severity thresholds met, recommendation "approve_with_comments", risk level 3/5 within threshold 3.
- The deterministic severity check passed: Found 1 finding(s) within acceptable thresholds
- Risk level 3/5 (Elevated)
- The model recommended: approve_with_comments
Approval was decided by deterministic gates, not by the model. The model's recommendation can block auto-approval but never cause it.
An update to an alert whose stored type is smart-contract-call now fails locally with the retired-type error instead of sending a PATCH the API rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Auto-approved by Nansen review
Deterministic gates passed: severity thresholds met, recommendation "approve", risk level 2/5 within threshold 3.
- The deterministic severity check passed: No issues found
- Risk level 2/5 (Low)
- The model recommended: approve
Approval was decided by deterministic gates, not by the model. The model's recommendation can block auto-approval but never cause it.
What
nansen alerts createandupdateno longer offer thesmart-contract-callalert type. The Nansen API retired the type, and every create for it now fails with400 Invalid alert type.--type smart-contract-callnow fails withINVALID_PARAMSand says the type was retired.--signature-hash,--caller,--contract,--exclude-caller,--exclude-contract) now fail the same way, with or without a value.--typeis rejected too, and the error lists the valid types.All of these checks run before the CLI reads stdin or sends a request. On
update, they run before the alert is fetched.The help, the two alert skills and
src/schema.jsonno longer offer the type or its flags. The schema now lists--typeas an enum:sm-token-flows,common-token-transfer.Why
The CLI still documented and built smart-contract-call payloads, but the backend rejects every one. Its flags were also silently ignored on the other alert types, because
alertsdoes not reject unknown flags. So a filter like--callerdisappeared without any error.Before / after
alerts create --type smart-contract-call …INVALID_PARAMS"…was retired…", nothing sentcommon-token-transfer … --caller address:0x1--callersilently ignored, alert createdINVALID_PARAMSnaming--calleralerts update <id> --type smart-contract-callalerts create --type not-a-typeINVALID_PARAMSlisting the valid typesnansen schemaalerts create --type[sm-token-flows, common-token-transfer]Testing
src/__tests__/alerts.test.jscover the retired type, each retired flag in its bare and valued forms, update before fetch, an unknown type, and a valid create with--token. The 14 rejection tests fail onmain, where the request is sent.help-ux.test.jsnow asserts the enum and that the retired flags are absent.npm testandnpm run lintpass.🤖 Generated with Claude Code