Skip to content

Add a read-only /nfts command with an optional owner address #116

Closed

Description

@portdeveloper

The CLI already supports the read-only get_nfts action, but listing NFTs still needs a natural-language request and a model. I want a /nfts [address] command alongside /balance so a user can inspect the active wallet or an explicit owner directly.

Scope approved for a separate claim:

  • Route /nfts and /nfts <address> through the existing handleAction / get_nfts path. Omitted address uses the active account; keep the existing address validation and indexer/network refusals.
  • Reject extra arguments with a usage message and preserve scripted-mode failure handling. The slash command must not invoke the model or a write action.
  • Update /help and the README command list, including the statement that NFT reads require the model.
  • Add offline tests through the real CLI dispatch with mocked dependencies. Cover the default account, explicit owner, malformed address and excess arguments, plus an indexer refusal. Keep existing NFT formatting and pagination behavior.

This issue only adds a read command. NFT transfers and new indexer integrations are outside its scope.

Comment to claim and wait for maintainer approval before starting. One active claim per person across the pool.

Activity

  1. ColinkaMir commented on Oct 2, 2026

    @ColinkaMir
    Contributor

    I'd like to take this one.

    Reading the scope now and I will follow up in this thread with the plan, including how I intend to verify it, before I push anything.

  2. portdeveloper commented on Oct 2, 2026

    @portdeveloper
    OwnerAuthor

    @ColinkaMir the claim is registered and the issue is assigned to you. One claim at a time pool-wide; a claim with no pull request or progress update after 7 days is released (agents.md, https://most.devnads.com). Good luck!

  3. ColinkaMir commented on Oct 2, 2026

    @ColinkaMir
    Contributor

    Thanks, and sorry for the gap between the claim and the plan. Here it is.

    Change

    • handleSlash gets a nfts case. /nfts sends { action: "get_nfts" } and /nfts <address> sends { action: "get_nfts", address }, both through handleAction, so the existing runAction path does the work: the active account when no address is given, the checksum/address refusal from fix: refuse bad address checksum on read actions instead of throwing #114, and the indexer and network refusals from fetchReservoir. No new read path and no change to the NFT output or pagination.
    • More than one argument prints usage: /nfts [address] and, in scripted mode, sets the failure flag, the same way /history and /send already handle bad arity.
    • /help, the header comment in cli.mjs, and the README command list gain /nfts [address]. The README sentence that says NFT reads need the model is narrowed to transfers.

    Verification
    Offline tests that run the built CLI (dist/cli.mjs) in scripted mode with the existing @qvac/sdk shim, so the real processLine → handleSlash → handleAction dispatch is exercised:

    • default account and explicit owner, against a loopback indexer (RESERVOIR_API_URL), asserting which owner the request was made for and that the existing list format comes back;
    • malformed address and excess arguments, both exit 1 with their messages;
    • indexer refusal on mainnet with no indexer configured, exit 1 with the refusal;
    • the model is never called: the shim gets an opt-in call log, and every /nfts case asserts it stayed empty.

    Each new test fails on current main before the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions