docs: sync mppx replay and method hooks - #869
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 025748969b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #### onPaymentSuccess (optional) | ||
|
|
||
| - **Type:** `Method.OnPaymentSuccessFn<method>` |
There was a problem hiding this comment.
Publish the method hook before documenting it
package.json and .mppx-docs-sync pin the 20260805221648/cd71f9e5 snapshot, but the per-method onPaymentSuccess constructor option comes from later, unpublished upstream changes and isn't exposed by that snapshot's types or runtime. Readers therefore get an unsupported property when following this reference; bump both pins to a release containing the hook or defer these additions until it is published.
AGENTS.md reference: AGENTS.md:L65-L67
Useful? React with 👍 / 👎.
| ### Create a payment-gated route | ||
|
|
||
| The route handler is identical to a single-method setup. `mppx.charge` advertises all registered methods in the Challenge and verifies whichever Credential the client presents. | ||
| The route handler is identical to a single-method setup. `mppx.charge` applies the same options to each registered charge method, advertises every resulting offer in the Challenge, and verifies whichever Credential the client presents. Use [`mppx.compose`](/sdk/typescript/server/Mppx.compose) when offers need different options. |
There was a problem hiding this comment.
Convert the shared amount before offering Lightning
When the guide registers all three shown methods, applying identical options doesn't produce an equivalent price: src/pages/payment-methods/lightning/charge.mdx:143-144 defines Spark's amount in satoshis with BTC as its default currency, while the Tempo and Stripe defaults here are dollar-denominated. Consequently, the primary route's amount: '0.01' requests 0.01 sat over Lightning rather than the promised $0.01; use explicit composition with a method-specific satoshi amount or perform a currency conversion.
AGENTS.md reference: AGENTS.md:L294-L299
Useful? React with 👍 / 👎.
| @@ -0,0 +1,65 @@ | |||
| # `Store.tryClaim` [Claim replay keys atomically] | |||
There was a problem hiding this comment.
Add the required social-card frontmatter
This new page starts directly with its H1, so it has neither a description nor an imageDescription; scripts/generate-og-descriptions.ts consequently omits the route and its social previews have no page-specific card copy. Add frontmatter with the required descriptions within the 160- and 80-character limits.
AGENTS.md reference: AGENTS.md:L241-L246
Useful? React with 👍 / 👎.
Motivation
Keep the TypeScript SDK documentation aligned with upstream public interfaces and runtime behavior.
Summary
Key design considerations
cd71f9e5until npm publishes a snapshot containing the later upstream APIs