feat: decouple fee payment from sequence number management#23
Merged
marcelosalloum merged 12 commits intomainfrom Mar 26, 2026
Merged
feat: decouple fee payment from sequence number management#23marcelosalloum merged 12 commits intomainfrom
marcelosalloum merged 12 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Decouples Stellar fee payment (fee-bump) from sequence-number management across the SDK’s Charge and Channel servers, aligns push-mode credential naming with the latest spec draft, and introduces a shared keypair resolution utility exported through public entrypoints.
Changes:
- Replace
feePayer/closeKeywithsigner(source account) and optionalfeeBumpSigner(fee payer) on server APIs and channel close helpers. - Rename push-mode credential payload type from
"signature"to"hash"and removefeePayerKeyfrom schema and client progress events. - Add and export
resolveKeypair(Keypair|string)across SDK/server entrypoints; update docs/examples accordingly.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/src/signers.ts | Adds resolveKeypair helper for Keypair-or-secret-string normalization. |
| sdk/src/signers.test.ts | Unit tests for resolveKeypair. |
| sdk/src/server/index.ts | Re-exports resolveKeypair from the server entrypoint. |
| sdk/src/server/Charge.ts | Splits sponsorship signer vs fee-bump signer; updates push-mode to "hash"; removes feePayerKey; adds fee-bump wrapping. |
| sdk/src/server/Charge.test.ts | Updates parameter acceptance tests; updates hash-dedup tests for "hash" type. |
| sdk/src/integration.test.ts | Updates credential type validation to "hash". |
| sdk/src/index.ts | Re-exports resolveKeypair from the root SDK entrypoint. |
| sdk/src/client/Charge.ts | Removes feePayerKey progress/event plumbing; renames push credential payload to "hash". |
| sdk/src/channel/server/index.ts | Re-exports resolveKeypair from channel server entrypoint. |
| sdk/src/channel/server/Channel.ts | Replaces closeKey with signer and adds optional fee-bump wrapping for close/open + standalone close(). |
| sdk/src/channel/server/Channel.test.ts | Updates tests for signer requirement and adds acceptance for feeBumpSigner. |
| sdk/src/Methods.ts | Updates credential schema discriminator to "hash" and removes feePayerKey from methodDetails schema. |
| sdk/src/Methods.test.ts | Updates schema tests for "hash" and removes feePayerKey assertion. |
| examples/channel-close.ts | Updates example to use signer instead of closeKey. |
| README.md | Updates public API docs/events and describes signer vs fee-bump signer roles. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sagpatil
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
feePayerparam with separatesigner(source account) andfeeBumpSigner(fee payer) on both Charge and Channel servers"signature"to"hash"per MPP spec draft-stellar-charge-00feePayerKeyfrom schema and client progress eventscloseKeywithsigner+feeBumpSigneron Channel server and standaloneclose()functionresolveKeypairutility, exported from all server subpathsWhy
Servers commonly use a pool of accounts for sequence numbers and a single dedicated account to pay fees via
FeeBumpTransaction. The oldfeePayerparameter conflated both roles, making it impossible to separate fee payment from transaction signing. This decoupling is standard practice in Stellar infrastructure (see x402 facilitator pattern).The
type: "signature"→type: "hash"rename aligns with MPP spec PR #199 which specifiestype="hash"for push-mode credentials.Breaking changes
charge({ feePayer: kp })charge({ signer: kp, feeBumpSigner?: kp2 })channel({ closeKey: kp })channel({ signer: kp, feeBumpSigner?: kp2 })close({ closeKey: kp })close({ signer: kp, feeBumpSigner?: kp2 })type: "signature"(push mode)type: "hash"feePayerKeyin schema/eventsExample