Skip to content

Add helper for formatting XLM transaction amounts with sign prefix for activity feed #453

Description

@Chucks1093

Summary

The wallet activity feed displays both buy and sell amounts. Buys should show a negative sign (XLM spent) and sells a positive sign (XLM received). A shared helper should handle sign prefix, decimal formatting, and the XLM suffix consistently across all activity displays.

Scope

  • Add formatActivityAmount(amount: bigint, type: 'buy' | 'sell'): string utility
  • Buy: prefix with -, sell: prefix with +
  • Format value in XLM with consistent decimal places using the existing formatKeyPrice helper
  • Add unit tests for buy amount, sell amount, and zero amount

Acceptance Criteria

  • Buy amount prefixed with -
  • Sell amount prefixed with +
  • Zero amount returns +0.00 XLM
  • Unit tests cover all three cases

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions