feat(extensions): add split payments extension #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/splitpay"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a split payments extension that automatically distributes a percentage of every incoming payment to one or more recipients. 518 lines of TypeScript.
Closes #13
Architecture
Dual-layer split design (see #13 comment):
zaptags — Nostr-aware wallets split at the sender side, each recipient gets a direct zap. Extension does nothing.onPaymentReceived()catches non-Nostr payments (BOLT11, LNURL, CLINK) and splits internally.metadata.splitted = trueprevents the two layers from double-splitting.RPC Methods
splitpay.setTargetssplitpay.getTargetssplitpay.clearTargetssplitpay.getHistoryData Model
split_targets: recipient (pubkey/LNURL/Lightning Address), percent (0-100), alias, creator_pubkey
split_records: audit trail of every split — source payment hash, target, amount, outgoing payment hash, status (pending/success/failed), error
Validation
Files
Test plan
splitted: truemetadata → verify no re-splitView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.