Skip to content

Validate fiat code before submitting market-price orders #175

Description

@ermeme

Milestone: M6 - UX / minor parity
Type: bug / parity
Priority: low

App v2 currently takes the selected fiat code from the order form and sends it directly into NewOrderParams.fiat_code without a submit-time validation step.

The currency picker is backed by the bundled fiat list, which is good for UX, but it is still only a UI constraint. If the saved default fiat code becomes stale or is tampered with, the create-order request can still go out with an unsupported code and come back as a daemon-side CantDo instead of being rejected locally.

Relevant code

  • lib/features/order/screens/add_order_screen.dart:157-180 - reads selectedFiatCodeProvider and builds NewOrderParams.
  • lib/features/order/widgets/currency_section.dart:53-67 - picker selection path.
  • rust/src/api/types.rs:217-233 - NewOrderParams has fiat_code, but no preflight validation hook.

Expected behavior

  • Reject unsupported fiat codes before the request is published.
  • Keep the UX aligned with the actual create-order contract instead of relying only on the picker list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: uiFlutter screens, UI providers, UXbugSomething isn't workingpriority: lowLow priority

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions