Skip to content

Implement Stellar Transaction Memo Verification and Parsing Utility #389

Description

@Cjay-Cyber-2

Description — what to implement and the why/impact.

Mergepay relies on structured Stellar transaction memos (MP:<code>) to automatically reconcile and verify on-chain settlements against pending expenses. This issue implements a robust utility for generating, formatting, and parsing memo strings safely according to Stellar memo limits and format specifications.

Context & Requirements — background, constraints, design references, edge cases; grounded in the actual repo (real files, stack, conventions).

Stellar transaction memos have strict character length limits (28 bytes for text memos). This utility must validate code lengths, sanitize input strings, and provide helper functions to extract expense references from incoming transaction payloads.

Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".

  • Implement memo generation and parsing functions in src/lib/.
  • Enforce Stellar 28-byte text memo constraints with Zod validation or strict assertions.
  • Add comprehensive unit tests covering edge cases, special characters, and length limits.
  • Pass npm run typecheck, npm run lint, and npm test.

Implementation Guidance — likely files/modules to touch (use real paths from the repo context) and a suggested approach, without over-prescribing.

  • Add tests in src/lib/__tests__/ alongside existing utility tests.
  • Ensure compatibility with @stellar/stellar-sdk memo classes.

Testing & Validation — how the contributor should prove it works (tests to add/run, manual checks, screenshots for UI).

  • Run npm test to verify all memo unit tests pass successfully.

Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting; follow the repo's existing style and conventions.


Wave complexity: Medium

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomplexity: mediumModerate scope, some designenhancementNew feature or requeststellarTouches Stellar / SEP flows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions