Repository navigation
fix(schema): sync the documented chain list with the API's published spec - #662
Conversation
…spec `nansen schema` (and the copies of its chain list in `--help` and the README) listed `scroll` and `ronin`, which no endpoint accepts any more, and omitted 20 chains the API does serve. Regenerate the list from the union of every chain enum in the API's published OpenAPI spec (https://api.nansen.ai/openapi.json). - schema.json `chains`: sorted, deduplicated union (36 chains) - `--help` "Research chains" line now interpolates `SCHEMA.chains` - coverage.test.js / api.test.js read the list from schema.json instead of hand-copied duplicates; new assertions pin lowercase slugs, uniqueness and alphabetical order - `EVM_CHAINS` drops `scroll`/`ronin` so the existing "schema chains is a superset of EVM_CHAINS" guard still holds; `EVM_CHAIN_IDS` (used for wallet transfers) is untouched Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pr-reviewer Summary for #d6712e2✅ No issues found The code review completed successfully with no findings. Review effort: 2/5 (Simple) SummaryThis PR synchronises the CLI's chain list with the API's published OpenAPI spec, removes two stale chains ( Highlights:
No bugs, logic errors, or convention violations found. Token usage: 1,026 input, 4,128 output, 377,833 cache read, 26,659 cache write | Usage Guide New pushes are reviewed automatically with a 10-minute cooldown between reviews. To request a review at any time, comment |
There was a problem hiding this comment.
Auto-approved
This PR was automatically approved because:
- Claude recommends approval
- Claude assessed this as a minimal effort change
- The effort level is within the auto-approval threshold of 2
- No high or critical issues were detected
- Review comment contains non-blocking feedback
If you have any concerns, please request a manual review.
|
Addressed the review finding in Local validation: @nansen-pr-reviewer re-review |
There was a problem hiding this comment.
Auto-approved
This PR was automatically approved because:
- Claude recommends approval
- Claude assessed this as a moderate effort change
- The effort level is within the auto-approval threshold of 2
- No high or critical issues were detected
- Review comment contains non-blocking feedback
If you have any concerns, please request a manual review.
|
Addressed the follow-up drift-guard finding in |
|
@nansen-pr-reviewer re-review |
There was a problem hiding this comment.
Auto-approved
This PR was automatically approved because:
- Claude recommends approval
- Claude assessed this as a moderate effort change
- The effort level is within the auto-approval threshold of 2
- No high or critical issues were detected
If you have any concerns, please request a manual review.
There was a problem hiding this comment.
Auto-approved
This PR was automatically approved because:
- Claude recommends approval
- Claude assessed this as a moderate effort change
- The effort level is within the auto-approval threshold of 2
- No high or critical issues were detected
If you have any concerns, please request a manual review.
Summary
nansen schemais the CLI's machine-readable self-description, and its top-levelchainslist is what agents (and shell completion for--chain) rely on. It had drifted from what the API accepts in both directions: it still listedscrollandronin, which no endpoint serves any more (the API returns 422 for them), and it omitted 20 chains the API does serve.This PR regenerates the list from the union of every chain enum in the API's published OpenAPI spec (https://api.nansen.ai/openapi.json), sorted and deduplicated (36 chains), and removes the hand-copied duplicates so the list cannot drift again.
ronin,scrollalgorand,aptos,arc,bitcoin,bitlayer,chiliz,citrea,gravity,hyperliquid,injective,mantra,near,robinhood,stacks,starknet,stellar,sui,ton,tron,victionNot every chain is served by every endpoint; the API keeps validating
--chainper endpoint, and theallwildcard some endpoints accept is deliberately not listed as a chain.Changes
src/schema.json:chainsregenerated from the spec union (sorted, unique).src/cli.js: the--help"Research chains" line is now interpolated fromSCHEMA.chainsinstead of a second hand-written copy.README.md: "Supported Chains" section updated to the same list.src/chain-ids.js:EVM_CHAINS(the CLI's own address-format/ENS gating set) dropsscrollandronin, so the existing test guard "schema.json chains should be a superset of EVM_CHAINS" keeps holding.EVM_CHAIN_IDS, which wallet transfers depend on, is untouched, and no new chains were added toEVM_CHAINS(address validation for chains it does not know already falls through to the API).src/api.js: comment onCOUNTERPARTIES_BATCH_CHAINSupdated to match.src/__tests__/coverage.test.js:DOCUMENTED_CHAINSnow readsSCHEMA.chainsrather than a duplicated literal, plus a new test asserting every entry is a lowercase slug, appears once, and the list is alphabetically sorted.src/__tests__/api.test.js: the "accept all documented chains" test reads the list fromschema.json; one test title reworded (scroll/roninare no longer "EVM chains this CLI knows")..changeset/sync-schema-chain-list.md: patch changeset (thenansen schemaoutput changes).Validation
npm run lint: clean (eslint ., no findings).Runtime:
nansen schema | jq '.chains | length'→36;nansen --helpshows the regenerated "Research chains" line. Live read-only spot check againsthttps://api.nansen.ai/api/v1/token-screener:scrollandronin→ HTTP 422 (Invalid value ... Valid options are: ...);tron,starknet,bitcoin→ HTTP 200.Checklist
npm test)src/schema.jsonupdated if new commands or flags were addedREADME.mdupdated if new top-level commands or categories were added.changeset/) — only required for user-facing changes (new commands, flags, bug fixes, breaking changes)🤖 Generated with Claude Code