Skip to content

Comments

refactor: use SDK-native types for CLI parsing, centralize client initialization & output helpers#13

Open
suhailkakar wants to merge 5 commits intomainfrom
refactoring
Open

refactor: use SDK-native types for CLI parsing, centralize client initialization & output helpers#13
suhailkakar wants to merge 5 commits intomainfrom
refactoring

Conversation

@suhailkakar
Copy link
Member

@suhailkakar suhailkakar commented Feb 25, 2026

Note

Medium Risk
Primarily a refactor, but it changes CLI argument parsing types and authentication/client initialization paths, which could cause subtle runtime/CLI compatibility issues (e.g., parsing/validation differences and RPC connectivity).

Overview
Switches many CLI commands from manual string parsing to SDK-native clap-parsed types (e.g. Address, B256, U256) for addresses/condition IDs/token IDs, removing parse_address/parse_condition_id helpers and consolidating enum conversions via the new enum_from! macro.

Centralizes common behavior: main.rs now lazily initializes shared SDK clients, errors are printed via output::print_error (used by both main and shell), and table output formatting is normalized with shared helpers (NONE, format_date, active_status).

Makes a few operational tweaks: Polygon RPC URL can now be overridden via POLYMARKET_RPC_URL, USDC address is shared as USDC_ADDRESS_STR, and wallet setup/import now stores a canonical hex key derived from the signer (signer_key_hex) rather than normalizing user input.

Written by Cursor Bugbot for commit 7431398. This will update automatically on new commits. 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 is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@suhailkakar suhailkakar changed the title [wip] refactoring refactor: use SDK-native types for CLI parsing, centralize client initialization & output helpers Feb 25, 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