Skip to content

Add helper for formatting a bigint stroop value as a signed XLM delta string for transaction history display #704

Description

@Chucks1093

Summary

Transaction history entries show the XLM change per transaction (e.g. +12.5000000 XLM or -3.0000000 XLM). The sign and formatting logic is currently duplicated across buy and sell serialisers. A shared formatXlmDelta(stroops: bigint, direction: 'in' | 'out'): string helper should centralise it.

Scope

  • Add formatXlmDelta(stroops, direction) returning a signed string: +X.XXXXXXX XLM for 'in', -X.XXXXXXX XLM for 'out'
  • Add unit tests: 10000000 stroops 'in' → '+1.0000000 XLM', 10000000 stroops 'out' → '-1.0000000 XLM', 0 stroops 'in' → '+0.0000000 XLM'
  • Replace all inline delta formatting in transaction history serialisers with the helper
  • Helper must use bigint arithmetic (no floating point)

Acceptance Criteria

  • 'in' direction returns positive prefix
  • 'out' direction returns negative prefix
  • 0 stroops returns correctly formatted zero
  • All existing delta formatting uses the helper
  • No floating-point arithmetic

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions