[Backend] Guard against BigInt serialization errors in stream JSON response formatting
Overview
Prisma models with BigInt fields (e.g. streamId, depositedAmount, withdrawnAmount) cannot be serialized by standard JSON.stringify() without custom replacers, leading to runtime TypeError: Do not know how to serialize a BigInt.
Problem
- Endpoints must consistently serialize BigInt values to string representation across all controllers.
Proposed Changes
- Create a lightweight serializer helper in
backend/src/lib/serialize.ts. - Automatically convert BigInt values to strings in API responses.
Acceptance Criteria
- [ ] All controllers pass responses through BigInt-safe serializer.
- [ ] No unhandled
Do not know how to serialize a BigInterrors. - [ ] Test verifies nested objects and arrays containing BigInts serialize correctly.
@Chinko21 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
I would like to fix this
âšī¸ Repo Maintainers: To accept this application, review their application or assign @Chinko21 to this issue.
Congratulations, @Chinko21! đ Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
đ§âđģ @Chinko21: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
đ¤ Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
đ Happy Wave đ
This issue has been marked as completed by a Drips Wave moderator for @Chinko21 as part of the Stellar Wave Program's 10th Wave đĨŗ
Moderator's reason: [Auto-assessed] The PR is merged (mergedAt 2026-10-09T14:36:08Z) and the issue is closed. The contributor added a robust BigInt-safe JSON serialization middleware and helper along with comprehensive unit tests as requested in the issue.
đ @Chinko21: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here.
đ§âđģ Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
âšī¸ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.