Skip to content

feat: add buildPaymentMemo and parsePaymentMemo helpers - #707

Merged
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
Olisachukwuma1:feat/memo-builder
Aug 29, 2026
Merged

feat: add buildPaymentMemo and parsePaymentMemo helpers#707
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
Olisachukwuma1:feat/memo-builder

Conversation

@Olisachukwuma1

Copy link
Copy Markdown
Contributor

Summary

Adds canonical memo helpers for Stellar invoice payment transactions, replacing ad-hoc memo string construction across callers.

  • \�uildPaymentMemo(invoiceId, opts?)\ — builds \split:{id}\ or \split:{id}:t{tranche}\ memos, truncated to 28 bytes at a valid UTF-8 character boundary
  • \parsePaymentMemo(memo)\ — parses both formats, returns
    ull\ for non-split memos
  • Both exported from \src/memoBuilder.ts\ and re-exported from \src/index.ts\

Tests

14 unit tests in \ est/memoBuilder.test.ts\ covering base format, tranche format, ASCII and multi-byte truncation, round-trips, null returns, and truncation edge cases.

closes #610

- buildPaymentMemo(invoiceId, opts?) builds split:{id} or split:{id}:t{tranche}
  memos, truncated to 28 bytes at a valid UTF-8 character boundary
- parsePaymentMemo(memo) parses both formats; returns null for non-split memos
- Both exported from src/memoBuilder.ts and re-exported from src/index.ts
- 14 unit tests covering base format, tranche, truncation (ASCII + multi-byte),
  round-trips, null returns, and truncation edge cases
@Kingsman-99
Kingsman-99 merged commit bc432ce into Stellar-split:main Aug 29, 2026
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.

Add buildPaymentMemo and parsePaymentMemo helpers to memoBuilder

2 participants