Fix stale MPP APIs and rename Channel mode to Session#71
Open
kaankacar wants to merge 1 commit into
Open
Conversation
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.
|
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.
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 exportsconfirms the subpath map and that the root exports no usableMppx/Store;npm viewconfirms the@stellar/mpp@0.7.1peer pins):mppx.middleware()is gone from both servers.Mppx.createon themppx/expressadapter returns per-route handlers, mounted per paid route with the price set there — the old examples never set an amount anywhere.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.store: Store.memory(), with a new error-keyed pitfall for the startup throw.challenge | signing | signed | paying | confirming | paidwithevent.hash.express@^5/stellar-sdk@^15plus a note on the peer-dependencyERESOLVEfailure, 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 thanany: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 realchallenge | signing | signed | paying | confirming | paidunion — the compiler reproduces #60's findings verbatim.