Skip to content

feat(receipts): add Soroban receipt normalization API (#546)#630

Merged
Cedarich merged 2 commits into
Pulsefy:mainfrom
coderDom-x:feat/be-receipt-normalization
Jun 29, 2026
Merged

feat(receipts): add Soroban receipt normalization API (#546)#630
Cedarich merged 2 commits into
Pulsefy:mainfrom
coderDom-x:feat/be-receipt-normalization

Conversation

@coderDom-x

Copy link
Copy Markdown
Contributor

Summary

Closes #546 — BE-62

Normalizes transaction, contract, and fee metadata into a single stable
NormalizedReceipt payload. Clients can render receipt screens with no
additional joins or calculations.

Changes

  • receipt.schema.ts — canonical receipt type covering payments, refunds, contract actions
  • receipt.normalizer.ts — aggregates Horizon + Soroban RPC + indexer into one payload
  • receipts.service.ts — orchestrates fetches; Supabase hook marked with TODO
  • receipts.controller.ts — GET /v1/receipts/tx/:txHash, GET /v1/receipts/address/:address
  • receipts.module.ts — NestJS module registration
  • receipt.normalizer.spec.ts — 20 Jest tests

Acceptance Criteria

  • Clients can render receipts without additional joins or calculations
  • Receipt IDs are stable across testnet retries and reindexing (derived from txHash + opIndex)
  • Failed actions return errorCode, errorMessage, resultXdr, envelopeXdr
  • Tests cover success, pending (NOT_FOUND), and failed contract actions

Testing

pnpm turbo run test --filter=app/backend

- Define canonical NormalizedReceipt schema for payments, refunds, and contract actions
- Add ReceiptNormalizer to aggregate Horizon, Soroban RPC, and indexer metadata
- Add stable receipt IDs derived from txHash + operationIndex
- Use submittedAt for failed tx timestamps to survive testnet retries
- Always return diagnostic metadata (errorCode, resultXdr, envelopeXdr) on failure
- Expose GET /v1/receipts/tx/:txHash and GET /v1/receipts/address/:address
- Add 20 Jest tests covering success, pending, and failed contract actions
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@coderDom-x 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! 🚀

Learn more about application limits

@Cedarich

Copy link
Copy Markdown
Contributor

@coderDom-x Fix workflow

@coderDom-x

Copy link
Copy Markdown
Contributor Author

@Cedarich done

@Cedarich Cedarich merged commit 08795de into Pulsefy:main Jun 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BE-62: Soroban Receipt Normalization API

2 participants