Skip to content

Fix stale MPP APIs and rename Channel mode to Session#71

Open
kaankacar wants to merge 1 commit into
mainfrom
fix-mpp-section
Open

Fix stale MPP APIs and rename Channel mode to Session#71
kaankacar wants to merge 1 commit into
mainfrom
fix-mpp-section

Conversation

@kaankacar

@kaankacar kaankacar commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Closes #60. Closes #57.

Applies @jeesunikim's on-chain-verified corrections from #60, each re-checked against the published packages before writing (npm view mppx@0.6.29 exports confirms the subpath map and that the root exports no usable Mppx/Store; npm view confirms the @stellar/mpp@0.7.1 peer pins):

  • mppx.middleware() is gone from both servers. Mppx.create on the mppx/express adapter returns per-route handlers, mounted per paid route with the price set there — the old examples never set an amount anywhere.
  • Imports corrected to the real subpaths (mppx/express, mppx/server, mppx/client, client re-export via @stellar/mpp/charge/client), and the package table now maps them explicitly with a warning about the bare root.
  • The charge server passes the required store: Store.memory(), with a new error-keyed pitfall for the startup throw.
  • Client progress events corrected to challenge | signing | signed | paying | confirming | paid with event.hash.
  • Install pins express@^5 / stellar-sdk@^15 plus a note on the peer-dependency ERESOLVE failure, and a matching pitfall.

Terminology per #57: the mode is now Session everywhere (decision table, headings, pitfalls, frontmatter, site card), with a naming callout that keeps "Channel mode" as a documented synonym and reserves "channel" for the settlement mechanism — contract, deposit, close flows keep their mechanism wording, as recommended.

Verification: all four examples in the diff type-check exactly as written against the published packages (mppx 0.6.31, @stellar/mpp 0.7.1, stellar-sdk 15.1.0, express 5.2.1), including the session server's per-route mppx.channel({ amount, description }) handler. A negative control confirms the types are real rather than any: mppx.middleware() fails with property-does-not-exist, a typo'd route option is rejected with the exact { amount, description, expires, meta, scope } schema, and comparing an event to "settled" fails against the real challenge | signing | signed | paying | confirming | paid union — the compiler reproduces #60's findings verbatim.

API fixes, all from the on-chain-verified report in #60 and re-checked
against the published packages (mppx exports map and peer deps via npm):

- mppx.middleware() does not exist; Mppx.create on the mppx/express
  adapter returns per-route handlers, and the price is set per route
  (the old examples never set an amount anywhere)
- the bare mppx root exports neither Mppx nor Store; imports now use
  mppx/express, mppx/server, and mppx/client subpaths, with the
  package table corrected
- charge mode requires a store; the charge server now passes
  Store.memory() and a pitfall documents the startup error
- client progress events are challenge/signing/signed/paying/
  confirming/paid with the hash on event.hash, not settled/txHash
- install line pins express@^5 and stellar-sdk@^15 with a note on the
  @stellar/mpp peer-dependency pins and the ERESOLVE failure

Terminology per #57: the payment intent is now called Session
(channel-backed); Channel stays as the name of the settlement
mechanism and as a documented synonym for searchability.

Closes #60. Closes #57.
Copilot AI review requested due to automatic review settings July 20, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://stellar.github.io/stellar-dev-skill/pr/pr-71/

Built to branch gh-pages at 2026-07-20 19:06 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

Stale methods and incorrect information in mpp section Use MPP Session as the public mode name; keep channel as the mechanism

2 participants