Join our community: https://t.me/+DOylgFv1jyJlNzM0
Description
frontend/src/utils/amount.ts was added and is used in IncomingStreams, Dashboard, and ActivityHistory, but several components still format amounts manually (raw division by 1e7, parseFloat, toFixed). This leads to inconsistent display and potential precision loss.
What Needs to Happen
- Audit all files that display or accept stream amounts
- Replace manual
/ 1e7 and parseFloat with fromStroops() from amount.ts
- Replace manual amount inputs with
toStroops() + hasValidPrecision() validation
- Specifically fix:
NotificationDropdown.tsx (line ~35), stream detail page, StreamCreationWizard amount step
- Add
formatRate() to show per-second and per-day rate in all stream cards
Files
frontend/src/components/NotificationDropdown.tsx
frontend/src/app/streams/[id]/page.tsx
frontend/src/components/stream-creation/AmountStep.tsx
Acceptance Criteria
Description
frontend/src/utils/amount.tswas added and is used inIncomingStreams,Dashboard, andActivityHistory, but several components still format amounts manually (raw division by 1e7,parseFloat,toFixed). This leads to inconsistent display and potential precision loss.What Needs to Happen
/ 1e7andparseFloatwithfromStroops()fromamount.tstoStroops()+hasValidPrecision()validationNotificationDropdown.tsx(line ~35),stream detail page,StreamCreationWizardamount stepformatRate()to show per-second and per-day rate in all stream cardsFiles
frontend/src/components/NotificationDropdown.tsxfrontend/src/app/streams/[id]/page.tsxfrontend/src/components/stream-creation/AmountStep.tsxAcceptance Criteria
/ 1e7or rawparseFloaton amounts in any componenthasValidPrecision