Skip to content

API-235: document global --limit/--page pagination flags in nansen schema - #500

Merged
gulshngill merged 1 commit into
mainfrom
docs/api-235-schema-pagination-globaloptions
Aug 19, 2026
Merged

API-235: document global --limit/--page pagination flags in nansen schema#500
gulshngill merged 1 commit into
mainfrom
docs/api-235-schema-pagination-globaloptions

Conversation

@gulshngill

Copy link
Copy Markdown
Contributor

Problem

buildPagination(options) in src/cli.js reads --limit/--page at six shared call sites (smart-money, profiler, token, perp, points, prediction-market), plus a local copy in src/commands/research.js for the historical-* commands — but schema.json globalOptions never listed either flag. Agents consuming nansen schema (the machine-readable CLI contract) could not discover pagination at all, nor the API-side fact that profiler endpoints and general endpoints have different per_page rules.

Change

Docs-only: adds limit and page to globalOptions in src/schema.json.

  • limitpagination.per_page. Description states the split verified against the live OpenAPI spec at docs.nansen.ai: general endpoints (PaginationRequest) default 10, max 1000; profiler address endpoints (ProfilerPaginationRequest) default 20, max 100. It also names the commands that declare their own limit with different semantics (search, token top-tokens, trade limit-order list), the endpoints that reject/ignore pagination (token ohlcv, profiler perp-positions, historical-token-flow-summary), and the CLI-side per_page: 100 default on profiler labels.
  • pagepagination.page, 1-based, default 1.

No runtime code touched — nansen schema --full and nansen schema <cmd> already render globalOptions, so the entries surface automatically. Changeset included (patch).

Not a duplicate of #491, which adds command-specific options (alerts/batch/screener) and does not touch globalOptions. Related: ECINT-6899 tracks the API side; this PR is the CLI side.

Validation

  • npm test: 2031 passed, 2 skipped
  • npm run lint: clean
  • node src/index.js schema --full exposes both new entries with descriptions
  • Independent Codex code review: APPROVED after fixing one finding (the description originally claimed trade commands ignore --limit, contradicting trade limit-order list)

🤖 Generated with Claude Code

…hema

buildPagination(options) reads --limit/--page across the smart-money,
profiler, token, perp, points, and prediction-market handlers (plus the
research historical-* commands), but schema.json globalOptions never
listed them. Add limit and page entries whose descriptions carry the
API-side split: general endpoints default per_page 10 (max 1000),
profiler address endpoints default 20 (max 100), so the distinction is
discoverable from `nansen schema --full` without reading source.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nansen-pr-reviewer

Copy link
Copy Markdown

pr-reviewer Summary for #9ccf8a2

No issues found

The code review completed successfully with no findings.

Review effort: 1/5 (Trivial)

Summary

This PR adds limit and page to globalOptions in src/schema.json, making global pagination flags discoverable via nansen schema. No runtime code is touched.

The descriptions are accurate: the endpoint-type split (general default 10/max 1000 vs. profiler default 20/max 100), the carve-outs for commands with their own limit semantics (search, token top-tokens, trade limit-order list), and the non-supporting endpoints (token ohlcv, profiler perp-positions, historical-token-flow-summary) all match the implementation in src/cli.js and src/commands/research.js. The limit entry correctly omits a default (since API-side defaults differ by endpoint) and page correctly carries default: 1 consistent with buildPagination. The changeset names the right package and uses an appropriate patch bump. No findings.


Token usage: 1,284 input, 3,137 output, 263,263 cache read, 23,501 cache write | Usage Guide

New pushes are reviewed automatically with a 10-minute cooldown between reviews. To request a review at any time, comment @nansen-pr-reviewer re-review.

@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

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

If you have any concerns, please request a manual review.

@gulshngill
gulshngill merged commit 91a36ba into main Aug 19, 2026
9 checks passed
@gulshngill
gulshngill deleted the docs/api-235-schema-pagination-globaloptions branch August 19, 2026 14:29
@github-actions github-actions Bot mentioned this pull request Aug 19, 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