Skip to content

Add evm collectibles command for NFT listings with spam filtering#34

Merged
ivpusic merged 2 commits intomainfrom
sim/evm-collectibles
Mar 13, 2026
Merged

Add evm collectibles command for NFT listings with spam filtering#34
ivpusic merged 2 commits intomainfrom
sim/evm-collectibles

Conversation

@ivpusic
Copy link
Member

@ivpusic ivpusic commented Mar 12, 2026

  • GET /v1/evm/collectibles/{address} with --chain-ids, --filter-spam, --show-spam-scores, --limit, --offset
  • Text table shows CHAIN, NAME, SYMBOL, TOKEN_ID, STANDARD, BALANCE plus SPAM/SPAM_SCORE when --show-spam-scores is set
  • Full OpenAPI spec coverage including metadata, spam explanations with json.RawMessage for polymorphic values
  • 6 E2E tests: text, JSON, filter-spam disabled, spam scores JSON, spam scores text columns, pagination

@cursor
Copy link

cursor bot commented Mar 12, 2026

PR Summary

Low Risk
Low risk: this is an additive CLI subcommand that calls a new API endpoint and formats output, with no changes to existing query flows besides command registration.

Overview
Adds a new sim evm collectibles <address> command that calls GET /v1/evm/collectibles/{address} with flags for --chain-ids, --filter-spam, --show-spam-scores, --limit, and --offset.

Supports both raw JSON output and a text table view, optionally adding SPAM/SPAM_SCORE columns and printing next_offset for pagination, and wires the new subcommand into the sim evm command tree.

Adds E2E tests covering text vs JSON output, spam filtering toggle, spam score inclusion, and pagination via next_offset.

Written by Cursor Bugbot for commit 8a633b2. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Attribute value typed as string, not RawMessage
    • Changed collectibleAttribute.Value from string to json.RawMessage to properly handle polymorphic NFT attribute values (strings, numbers, booleans) consistent with the codebase pattern.

Create PR

Or push these changes by commenting:

@cursor push 9d59d3b559
Preview (9d59d3b559)
diff --git a/cmd/sim/evm/collectibles.go b/cmd/sim/evm/collectibles.go
--- a/cmd/sim/evm/collectibles.go
+++ b/cmd/sim/evm/collectibles.go
@@ -69,9 +69,9 @@
 }
 
 type collectibleAttribute struct {
-	Key    string `json:"key"`
-	Value  string `json:"value"`
-	Format string `json:"format,omitempty"`
+	Key    string          `json:"key"`
+	Value  json.RawMessage `json:"value"`
+	Format string          `json:"format,omitempty"`
 }
 
 type spamExplanation struct {

Comment @cursor review or bugbot run to trigger another review on this PR

@ivpusic ivpusic force-pushed the sim/evm-transactions branch from bcff9e1 to a0d205d Compare March 12, 2026 15:34
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from 8a633b2 to 991a36a Compare March 12, 2026 15:34
@ivpusic ivpusic force-pushed the sim/evm-transactions branch from a0d205d to fbcafd8 Compare March 12, 2026 15:39
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from 991a36a to 2d53c17 Compare March 12, 2026 15:39
@ivpusic ivpusic force-pushed the sim/evm-transactions branch from fbcafd8 to a7bacad Compare March 12, 2026 16:07
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from 2d53c17 to a49f933 Compare March 12, 2026 16:07
@ivpusic ivpusic force-pushed the sim/evm-transactions branch from a7bacad to f381fe4 Compare March 12, 2026 16:10
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from a49f933 to d56f07a Compare March 12, 2026 16:10
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from d56f07a to b9114b7 Compare March 13, 2026 10:41
@ivpusic ivpusic force-pushed the sim/evm-transactions branch 2 times, most recently from 263b686 to 58c6d76 Compare March 13, 2026 10:45
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch 2 times, most recently from 582a079 to f7e1b5d Compare March 13, 2026 10:53
@ivpusic ivpusic force-pushed the sim/evm-transactions branch 2 times, most recently from 8107436 to e77da3b Compare March 13, 2026 10:56
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from f7e1b5d to e4db1df Compare March 13, 2026 10:56
@ivpusic ivpusic force-pushed the sim/evm-transactions branch from e77da3b to 8d22266 Compare March 13, 2026 12:09
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from e4db1df to 793d226 Compare March 13, 2026 12:09
@ivpusic ivpusic force-pushed the sim/evm-transactions branch from 8d22266 to ff23307 Compare March 13, 2026 16:08
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from 793d226 to 35ca86e Compare March 13, 2026 16:08
- GET /v1/evm/collectibles/{address} with --chain-ids, --filter-spam, --show-spam-scores, --limit, --offset
- Text table shows CHAIN, NAME, SYMBOL, TOKEN_ID, STANDARD, BALANCE plus SPAM/SPAM_SCORE when --show-spam-scores is set
- Full OpenAPI spec coverage including metadata, spam explanations with json.RawMessage for polymorphic values
- 6 E2E tests: text, JSON, filter-spam disabled, spam scores JSON, spam scores text columns, pagination
@ivpusic ivpusic changed the base branch from sim/evm-transactions to graphite-base/34 March 13, 2026 16:15
@ivpusic ivpusic force-pushed the sim/evm-collectibles branch from 35ca86e to f1358db Compare March 13, 2026 16:15
@ivpusic ivpusic changed the base branch from graphite-base/34 to main March 13, 2026 16:15
@ivpusic ivpusic merged commit c380067 into main Mar 13, 2026
2 checks passed
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.

2 participants