feat(orders): show effective fiat/USD rate on market-price offer cards

Aperta
#797 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart
Ambito
frontend, mobile

Direzione di ricerca

Start in lib/features/home/widgets/order_list_item.dart, where the "Market price" caption sits under the amount on market-price cards, and trace how exchangeRateProvider(<fiatCode>) and the USD rate from the kind 30078 mostro-rates event are read. Done means market-price cards show ~<effective rate> <fiat>/USD using the maker's premium, fixed-sats cards are unchanged, and the card falls back to "Market price" when no rate is available. Locale strings and regenerated golden images are part of the change.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

On the order book, a market-price offer shows its fiat amount and the premium against the market, but not the rate an offer actually represents. With a market-price offer, the user pays/receives market rate × (1 + premium/100); comparing two offers in the same currency means mentally applying each creator's premium to the market rate every time.

Proposal

On market-price offer cards in the public order book (lib/features/home/widgets/order_list_item.dart), replace the "Market price" caption under the amount with the effective cross rate the offer represents once the creator's premium is applied:

effectiveFiatPerBtc = marketFiatPerBtc × (1 + premium/100)
effectiveFiatPerUsd  = effectiveFiatPerBtc / usdPerBtc
  • Shown for every market-price offer (0% premium, premium, or discount) and any fiat currency.
  • Rendered as e.g. ~305.40 CUP/USD using the active locale's number formatting.
  • Only in the offer list — not repeated on the take-order or trade screens.
  • Fixed-sats offers are unaffected and do not subscribe to rate providers.
  • When the rate cannot be computed (the node publishes no rate for that currency, the kind 30078 mostro-rates event is missing/expired, or the fetch errors), the card keeps the current "Market price" caption.

The rates come from the existing exchangeRateProvider(<fiatCode>) and the USD rate, both already surfaced by the node's mostro-rates event. This is display logic only: no Rust/core, protocol, or bridge changes.

Reference currency is USD for now; a user-configurable reference could follow later.

Result (reference)

This is the same screen on the v1 app (mobile_mostro), where the feature is already implemented and user-visible — every market-price row shows the effective rate in its card:

Image

Acceptance criteria

  • Market-price offer cards show ~<effective rate> <fiat>/USD under the amount.
  • Zero-premium, premium and discounted offers all compute correctly from the maker's premium.
  • Fixed-sats cards render exactly as they do today (and create no rate providers).
  • When no rate is available, the card falls back to "Market price".
  • All locales updated; the rate formatted with the active locale.
  • Golden images of the offer card regenerated.
Lingua principale
Dart
Stelle
11
Fork
9
Merge medio
2g 1h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MostroP2P/app

Tutte le issue di MostroP2P/app

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.