Skip to content

Remove undocumented ledger / ledger:N positional shorthand #2559

@fnando

Description

@fnando

Any command that takes a positional name typed as UnresolvedMuxedAccount (e.g. keys fund, keys public-key / keys address, tx sign, contract invoke --source-account) silently accepts ledger or ledger:N and routes the call to a connected hardware Ledger device.

This shorthand has never been documented — it doesn't appear in any --help text, FULL_HELP_DOCS.md, the README, or any CLI example. The only places it shows up are the parser (parse_ledger in cmd/soroban-cli/src/config/address.rs) and the matching Display impl that prints ledger:N. It was introduced on 2025-02-14 in #1627 ("Feat: add stellar ledger as signer") and has been live since.

With #2557 introducing an explicit --ledger flag (starting on keys address, with other commands to follow), the positional shorthand becomes a confusing and undocumented second way to reach the device — and one that can't be scoped per-command.

Proposed fix

Remove the shorthand entirely:

  • Drop the if value.starts_with("ledger") branch from UnresolvedMuxedAccount::FromStr in cmd/soroban-cli/src/config/address.rs.
  • Delete parse_ledger.
  • The UnresolvedMuxedAccount::Ledger(u32) variant is still constructed by the new --ledger flag in keys address. Either keep it as an internally-constructible variant (simplest), or refactor the flag path to call ledger::new(index) directly and drop the variant entirely.

After the change, the only way to reach a Ledger device for address derivation is the explicit --ledger flag on commands that opt in.

Out of scope

--sign-with-ledger (the existing signing flag) stays as-is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions