Skip to content

Standardize --asset-class flag and fix setup config path#18

Merged
agent-smith-k merged 5 commits into
mainfrom
fix/standardize-asset-class-flag
Mar 20, 2026
Merged

Standardize --asset-class flag and fix setup config path#18
agent-smith-k merged 5 commits into
mainfrom
fix/standardize-asset-class-flag

Conversation

@agent-smith-k

Copy link
Copy Markdown
Contributor

Summary

  • Standardizes --asset-class as the canonical CLI flag across all commands that previously used --aclass. Keeps --aclass as a hidden alias for backward compatibility. Kraken API parameter names in HTTP requests are unchanged.
  • Fixes the setup wizard to display the actual platform-specific config path instead of a hardcoded Linux path.
  • Bumps version to 0.2.2.

Changes

Flag standardization (fixes #12)

  • Renamed aclass struct fields to asset_class in lib.rs, commands/market.rs, commands/funding.rs, commands/account.rs
  • Added alias = "aclass" on all affected #[arg] attributes
  • Updated agents/tool-catalog.json, README.md, and AGENTS.md to reflect the canonical flag name

Setup config path fix

  • src/commands/utility.rs: replaced hardcoded ~/.config/kraken/config.toml with runtime-resolved path via config::config_path()
  • Falls back to a generic message if path resolution fails
  • Added config_path_resolves_to_config_toml and config_path_display_is_valid_string tests in src/config.rs

Affected commands

assets, pairs, ledgers, deposit methods, deposit addresses, deposit status, withdraw, withdrawal methods, withdrawal addresses, withdrawal status, setup

Test plan

  • cargo fmt --all --check: pass
  • cargo clippy --all --all-targets --all-features -- -Dwarnings: pass
  • cargo test --all-targets: 285 unit + 83 integration tests pass
  • cargo build --release: pass
  • E2E tests against UAT: 41/41 public-rest tests pass (including new --asset-class and --aclass alias coverage)

Made with Cursor

The `pairs`, `assets`, `ledgers`, and all funding/withdrawal commands
used `--aclass` while the rest of the CLI used `--asset-class`. This
inconsistency caused errors when users applied the same flag across
commands.

Renamed the CLI flag to `--asset-class` everywhere and added `--aclass`
as a hidden alias for backward compatibility. The Kraken API parameter
names sent in HTTP requests remain unchanged.

Fixes: #12
Made-with: Cursor
README.md and AGENTS.md still showed --aclass in command reference
tables and examples. Updated all occurrences to --asset-class to match
the standardized CLI flag.

Made-with: Cursor
The setup wizard hardcoded ~/.config/kraken/config.toml in both the
intro and completion messages. On macOS the actual path is
~/Library/Application Support/kraken/config.toml. Now resolves the
path at runtime via config::config_path(), with a generic fallback
if resolution fails.

Fixes: https://seabound.atlassian.net/browse/AIAN-263
Made-with: Cursor
Verifies config_path() returns a valid path ending in
kraken/config.toml and that the display formatting produces a
non-empty string containing 'kraken'. Covers the code path
introduced in the previous commit.

Made-with: Cursor
Made-with: Cursor
@agent-smith-k agent-smith-k merged commit 6552252 into main Mar 20, 2026
12 checks passed
@agent-smith-k agent-smith-k deleted the fix/standardize-asset-class-flag branch March 20, 2026 13:59
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.

Inconsistent asset class flag: --aclass (pairs) vs --asset-class (ticker, order)

1 participant