Skip to content

fix(alerts): reject the retired smart-contract-call alert type - #837

Merged
kome12 merged 2 commits into
mainfrom
fix/remove-retired-contract-call-alerts
Nov 15, 2026
Merged

kome12 merged 2 commits into
mainfrom
fix/remove-retired-contract-call-alerts

Conversation

@kome12

@kome12 kome12 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

What

nansen alerts create and update no longer offer the smart-contract-call alert type. The Nansen API retired the type, and every create for it now fails with 400 Invalid alert type.

  • --type smart-contract-call now fails with INVALID_PARAMS and says the type was retired.
  • The flags only that type used (--signature-hash, --caller, --contract, --exclude-caller, --exclude-contract) now fail the same way, with or without a value.
  • Any other unknown --type is 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.json no longer offer the type or its flags. The schema now lists --type as 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 alerts does not reject unknown flags. So a filter like --caller disappeared without any error.

Before / after

before after
alerts create --type smart-contract-call … request sent, API answers 400 INVALID_PARAMS "…was retired…", nothing sent
common-token-transfer … --caller address:0x1 --caller silently ignored, alert created INVALID_PARAMS naming --caller
alerts update <id> --type smart-contract-call alert fetched, then a type-mismatch error rejected before any request
alerts create --type not-a-type sent, API answers 422 INVALID_PARAMS listing the valid types
nansen schema alerts create --type no enum enum [sm-token-flows, common-token-transfer]

Testing

  • 15 new tests in src/__tests__/alerts.test.js cover 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 on main, where the request is sent.
  • The help drift test in help-ux.test.js now asserts the enum and that the retired flags are absent.
  • npm test and npm run lint pass.
  • I checked the API's response with a direct request to the create endpoint.

🤖 Generated with Claude Code

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>
Comment thread src/commands/alerts.js Resolved
@nansen-pr-reviewer

nansen-pr-reviewer Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

nansen-pr-reviewer summary

The 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 @nansen-pr-reviewer[bot] re-review.

nansen-pr-reviewer[bot]
nansen-pr-reviewer Bot previously approved these changes Nov 13, 2026

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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>

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@kome12 kome12 self-assigned this Nov 13, 2026
@kome12
kome12 merged commit b570853 into main Nov 15, 2026
17 checks passed
@kome12
kome12 deleted the fix/remove-retired-contract-call-alerts branch November 15, 2026 23:32
@github-actions github-actions Bot mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant