Skip to content

feat(invoice): add formatSplitPercentage helper for basis-point percentages (#620) - #783

Open
ZacLou wants to merge 1 commit into
Stellar-split:mainfrom
ZacLou:feat/format-split-percentage-620
Open

feat(invoice): add formatSplitPercentage helper for basis-point percentages (#620)#783
ZacLou wants to merge 1 commit into
Stellar-split:mainfrom
ZacLou:feat/format-split-percentage-620

Conversation

@ZacLou

@ZacLou ZacLou commented Aug 29, 2026

Copy link
Copy Markdown

Implements formatSplitPercentage as requested in #620.

  • Converts a basis-point value (0–10000) to a human-readable percentage string.
  • Configurable decimal places (0–4, default 2).
  • Throws SdkError with INVALID_RECIPIENT for out-of-range basis points.
  • Throws RangeError for invalid decimal places.
  • Exported from src/index.ts and covered by unit tests.

Closes #620

…tellar-split#620)

- Add formatSplitPercentage(basisPoints, opts?) to invoice/calculator.ts
- Convert 0-10000 bps to human-readable percent with configurable decimals (0-4)
- Throw SdkError.INVALID_RECIPIENT for out-of-range bps
- Throw RangeError for invalid decimals
- Export from index.ts and add unit tests

Closes Stellar-split#620
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 formatSplitPercentage from basis points to invoice/calculator.ts

1 participant