feat: PDF receipts, Stellar fee estimation, and i18n notifications#1036
Merged
Haroldwonder merged 2 commits intoJun 30, 2026
Merged
Conversation
…aroldwonder#948, Haroldwonder#949, Haroldwonder#950) Closes Haroldwonder#948 — Add transaction receipt PDF generation API endpoint Closes Haroldwonder#949 — Add Stellar network fee (XLM) estimation and top-up guidance Closes Haroldwonder#950 — Add multi-language support for email and SMS notifications
|
@Idaonoli is attempting to deploy a commit to the Harold's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Idaonoli Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements three related enhancements from the Stellar Wave milestone:
GET /api/remittances/:id/receiptreturns a branded PDF receipt for any remittance. Authentication is required viaX-API-Key(admin) orX-Sender-Address(must match the remittance owner).GET /api/accounts/:address/stellar-feesreturns the current Horizon base fee, the account's native XLM balance, and the estimated XLM cost for N operations. Includes alow_balanceflag andtop_up_linkwhen balance is below 2 XLM. AnestimateStellarFee(operationCount)helper is added to the SDK. The frontend gains acheckXlmBalance()utility that calls the endpoint and renders a red warning banner when XLM is low.en,es,fr,pt) covering all five event types:remittance_created,remittance_completed,remittance_failed,kyc_approved,kyc_expired. Apreferred_languagecolumn is added tonotification_preferences(with migration). The notification service loads the correct locale template and falls back to English when a translation is missing. A CI-friendly script (check-notification-templates.ts) exits 1 if any locale is missing any key.Changes
api/src/routes/remittances.tsGET /:id/receiptendpointapi/src/services/receiptGenerator.tsapi/src/routes/accounts.tsapi/src/app.ts/api/accountsrouterapi/package.jsonpdfkit+@types/pdfkitdependenciesbackend/src/notification-service.tspreferred_languagein preferences,notifyKycEvent()backend/src/notification-templates/types.ts,index.ts,en.ts,es.ts,fr.ts,pt.tsbackend/migrations/preferred_languagecolumnbackend/scripts/check-notification-templates.tssdk/src/index.tsestimateStellarFee()helperfrontend/src/main.tscheckXlmBalance()and low-XLM bannerNotes
npm installinapi/after merging to pick uppdfkit.npm run migrateinbackend/to apply thepreferred_languagecolumn migration.tsx backend/scripts/check-notification-templates.tsto CI to enforce template completeness.ADMIN_API_KEYto be set in the environment for admin access. Sender-based auth uses theX-Sender-Addressheader matched againstremittance.sender_id.STELLAR_EXPLORER_URLcan be set to override the default on-chain explorer base URL in receipts.Test plan
GET /api/remittances/:id/receiptwith a validX-API-Keyreturns a PDF (Content-Type: application/pdf)X-Sender-Addressreturns 403GET /api/accounts/G.../stellar-feesreturnsbase_fee_stroops,xlm_balance,estimated_fee_xlmlow_balance: trueandtop_up_linkwhen XLM balance < 2estimateStellarFee(2)returns0.00002(2 × 100 stroops / 10 000 000)preferred_language = 'pt'delivers Portuguese textcheck-notification-templates.tsexits 0 with all templates present; exits 1 if a key is removedcloses #948
closes #949
closes #950