Skip to content

[Bug] Transaction history adaptor shows wrong settlement display price for JMD users #284

@islandbitcoin

Description

@islandbitcoin

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

  1. Pass the user's configured display currency into the adaptor; use it for both the label and the USD→JMD conversion
  2. Fix the offset logic for correct price mapping
  3. Replace Math.floor with proper rounding (Math.round)

Priority

Urgent — this affects every JMD user's transaction history on every page load.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions