Skip to content

feat: add marketplace commands (buy, info)#46

Merged
broody merged 3 commits intocartridge-gg:mainfrom
joystick-ctrl:feat/marketplace-commands
Feb 22, 2026
Merged

feat: add marketplace commands (buy, info)#46
broody merged 3 commits intocartridge-gg:mainfrom
joystick-ctrl:feat/marketplace-commands

Conversation

@joystick-ctrl
Copy link
Contributor

Summary

Add CLI commands for interacting with the Arcade marketplace, enabling users to purchase NFTs from listings without calldata ambiguity.

Commands Added

controller marketplace info

Query order validity and details before purchasing.

controller marketplace info \
  --order-id 42 \
  --collection 0x123...abc \
  --token-id 1 \
  --chain-id SN_MAIN

controller marketplace buy

Purchase an NFT from a marketplace listing.

controller marketplace buy \
  --order-id 42 \
  --collection 0x123...abc \
  --token-id 1 \
  --chain-id SN_MAIN \
  --wait

Implementation Details

  • u256 encoding: Properly encodes token IDs as (low, high) felt pairs
  • Policy validation: Checks session policies before executing
  • Order validation: Calls get_validity before attempting purchase
  • Pattern consistency: Follows the same patterns as starterpack commands

Files Changed

  • src/commands/marketplace/mod.rs - Module with shared utilities
  • src/commands/marketplace/info.rs - Order info query command
  • src/commands/marketplace/buy.rs - Purchase command
  • src/main.rs - CLI command registration
  • docs/PRD-marketplace-commands.md - Full PRD with TDD specs

Testing

Includes unit tests for:

  • u256 encoding (small values, large values, hex parsing)
  • Calldata building
  • Chain ID resolution

Related

  • Based on Arcade marketplace contract: arcade/contracts/src/systems/marketplace.cairo
  • Follows patterns from starterpack commands

Add CLI commands for interacting with the Arcade marketplace:

- `controller marketplace info` - Query order validity and details
- `controller marketplace buy` - Purchase NFTs from listings

Includes:
- Detailed PRD with TDD test specifications
- u256 encoding utilities for proper calldata formatting
- Policy validation for session security
- Full integration with Controller session system

Closes the gap for clean marketplace purchases without calldata ambiguity.

See docs/PRD-marketplace-commands.md for full specification.
- Fix primitive_types dependency by using starknet Felt directly
- Fix formatting issues in info.rs and mod.rs
- Add marketplace section to LLM_USAGE.md
- Add marketplace commands to SKILL.md
- Add marketplace tools to .claude/skills/controller-skill/skill.md
- Add AGENTS.md with PR guidelines and code style conventions
- Fix unused STRK_TOKEN constant warning (allow dead_code)
- Fix collapsible else if in info.rs
- Allow too_many_arguments for build_execute_calldata
@broody broody merged commit 0318c7f into cartridge-gg:main Feb 22, 2026
3 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