-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Summary
The transaction history adaptor (src/app/wallets/get-transactions-for-wallet.ts) serves incorrect display amounts for JMD users. Since Ibex IS the ledger and Flash has no server-side ledger for Ibex-settled transactions, this adaptor is the only place to fix display amounts — if it's wrong, every historical transaction displays wrong, retroactively.
The Bugs
1. Hardcoded USD instead of user display currency
The adaptor returns USD as the display currency and does not convert the settlement amount to the user's configured currency (JMD). This means both the currency label and the numeric value are wrong — JMD users see raw USD amounts labeled as their display currency. One fix: pass the user's display currency into the adaptor and apply the conversion.
2. Wrong offset in pagination/conversion
An offset error causes transactions to map to incorrect price points, shifting which rate gets applied to which transaction.
3. Math.floor truncates fractional amounts
Math.floor on converted amounts silently drops fractional JMD cents. For small BTC transactions, this can truncate the display amount to 0.
Why This Matters
- Flash has no server-side ledger for Ibex-settled transactions — Ibex is the ledger
- Transaction history is fetched live from the Ibex API every time
- This adaptor is the single point of truth for display amounts
- Every JMD user sees wrong amounts on every historical transaction, retroactively
File
src/app/wallets/get-transactions-for-wallet.ts
Fix Approach
- Pass the user's configured display currency into the adaptor; use it for both the label and the USD→JMD conversion
- Fix the offset logic for correct price mapping
- Replace
Math.floorwith proper rounding (Math.round)
Priority
Urgent — this affects every JMD user's transaction history on every page load.
Related
- Parent tracking issue: [Bug] JMD Currency Precision — Backend #282 (JMD currency precision failures)
- Proto precision (deferred): [Low Priority] Upgrade price.proto float → double for future fiat currency precision #283
- Mobile companion: [Bug] Systemic JMD currency precision failures — float amounts, wrong tx history, 100× inflation, hardcoded USD flash-mobile#555