mppx 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +26 -0
- package/dist/Method.d.ts +2 -0
- package/dist/cli/Extension.d.ts +20 -0
- package/dist/cli/Extension.js +5 -0
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +135 -135
- package/dist/cli/config.d.ts +4 -0
- package/dist/cli/config.js +1 -0
- package/dist/cli/internal.d.ts +3 -0
- package/dist/cli/internal.js +15 -2
- package/dist/cli/plugins/evm.js +2 -0
- package/dist/cli/plugins/index.d.ts +1 -0
- package/dist/cli/plugins/index.js +13 -13
- package/dist/cli/plugins/plugin.d.ts +2 -2
- package/dist/cli/plugins/x402.d.ts +3 -0
- package/dist/cli/plugins/x402.js +61 -0
- package/dist/cli/sessions/request.d.ts +1 -0
- package/dist/cli/sessions/request.js +1 -0
- package/dist/cli/validate/payment.js +14 -8
- package/dist/evm/client/Charge.d.ts +2 -2
- package/dist/evm/client/Charge.js +1 -1
- package/dist/evm/server/Charge.d.ts +7 -2
- package/dist/evm/server/Charge.js +28 -2
- package/dist/evm/server/Methods.d.ts +1 -1
- package/dist/internal/version.d.ts +5 -0
- package/dist/internal/version.js +6 -0
- package/dist/middlewares/internal/mppx.js +17 -3
- package/dist/server/Mppx.d.ts +7 -6
- package/dist/server/Mppx.js +84 -2
- package/dist/server/internal/html/config.js +1 -3
- package/dist/stripe/Methods.d.ts +24 -5
- package/dist/stripe/Methods.js +14 -11
- package/dist/stripe/client/Charge.d.ts +23 -5
- package/dist/stripe/client/Methods.d.ts +23 -5
- package/dist/stripe/internal/constants.d.ts +4 -0
- package/dist/stripe/internal/constants.js +2 -0
- package/dist/stripe/internal/parse-units.d.ts +8 -0
- package/dist/stripe/internal/parse-units.js +20 -0
- package/dist/stripe/internal/payment-intent.d.ts +39 -1
- package/dist/stripe/internal/payment-intent.js +16 -1
- package/dist/stripe/internal/types.d.ts +4 -0
- package/dist/stripe/server/Charge.d.ts +25 -5
- package/dist/stripe/server/Charge.js +35 -23
- package/dist/stripe/server/Methods.d.ts +8 -0
- package/dist/stripe/server/Methods.js +54 -9
- package/dist/stripe/server/internal/analytics.d.ts +6 -0
- package/dist/stripe/server/internal/analytics.js +16 -0
- package/dist/stripe/server/internal/hosted-fee-payer.d.ts +10 -0
- package/dist/stripe/server/internal/hosted-fee-payer.js +54 -0
- package/dist/stripe/server/internal/html.gen.d.ts +1 -1
- package/dist/stripe/server/internal/html.gen.js +1 -1
- package/dist/stripe/server/internal/record-payment.d.ts +4 -1
- package/dist/stripe/server/internal/record-payment.js +35 -5
- package/dist/tempo/client/Subscription.js +6 -2
- package/dist/tempo/internal/account.d.ts +1 -0
- package/dist/tempo/internal/fee-payer.d.ts +2 -0
- package/dist/tempo/internal/fee-payer.js +4 -0
- package/dist/tempo/internal/remote-fee-payer.d.ts +2 -0
- package/dist/tempo/server/Subscription.js +1 -0
- package/dist/tempo/server/internal/html.gen.d.ts +1 -1
- package/dist/tempo/server/internal/html.gen.js +1 -1
- package/dist/tempo/session/client/SessionManager.d.ts +5 -0
- package/dist/tempo/session/client/SessionManager.js +16 -2
- package/dist/tempo/session/precompile/Chain.js +3 -0
- package/dist/tempo/subscription/KeyAuthorization.d.ts +7 -1
- package/dist/tempo/subscription/KeyAuthorization.js +21 -3
- package/dist/viem/Client.js +1 -0
- package/dist/x402/client/Exact.d.ts +2 -2
- package/dist/x402/client/Exact.js +1 -1
- package/dist/x402/server/EvmCharge.d.ts +2 -0
- package/dist/x402/server/EvmCharge.js +34 -26
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# mppx
|
|
2
2
|
|
|
3
|
+
## 0.9.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 43ec92c: Bound subscription key authorizations to their server-issued payment challenge.
|
|
8
|
+
- 175d709: Allowed EVM and x402 payments to be prepared without an account and signed using an account supplied during credential creation.
|
|
9
|
+
- 5932b08: Added non-mutating EVM credential validation with facilitator checks and revalidation before settlement through the existing broadcast lifecycle.
|
|
10
|
+
- 1fd8746: Expanded Tempo session close rollback and expiring-nonce transaction coverage.
|
|
11
|
+
- 459b517: Added challenge context to payment-success hooks, standardized Stripe PaymentIntent analytics
|
|
12
|
+
metadata, and added a shared SDK version identifier.
|
|
13
|
+
- 203bad2: Added typed multi-offer composition for MCP SDK and JSON-RPC transports while preserving selected-payment dispatch and receipt metadata.
|
|
14
|
+
- a5451d0: Updated `fast-uri` and `qs` to patched versions, resolving their latest security advisories.
|
|
15
|
+
- a802ce9: Added method-agnostic CLI payment extensions that can enforce policy or prepare funds before credential creation.
|
|
16
|
+
- baa0fd5: Added a fee-payer policy option to reject sponsored key authorizations while allowing them by default.
|
|
17
|
+
- f494ffd: Added request-scoped PaymentIntent option resolvers that run before terminal Stripe payments.
|
|
18
|
+
- 7949db6: Fixed server-side session transactions to use expiring nonces across independent processes.
|
|
19
|
+
- 26f9840: Removed the Stripe SPT runtime dependency on viem.
|
|
20
|
+
|
|
21
|
+
## 0.9.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 14e8b25: Added CLI support for selecting and paying x402 payment challenges.
|
|
26
|
+
- 5cbc5e4: Added request-scoped PaymentIntent customer, receipt email, and Tax calculation options, with fallback recording without rejected optional fields for completed crypto payments.
|
|
27
|
+
- b12e65b: Fixed framework adapters to preserve multi-method intent challenges.
|
|
28
|
+
- f13f800: Added a machine-payment metadata field to every Stripe PaymentIntent created by mppx.
|
|
29
|
+
- 9dd9969: Added opt-in Stripe-hosted Tempo fee sponsorship to `stripe.create()` using the configured Stripe client.
|
|
30
|
+
|
|
3
31
|
## 0.9.1
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -109,6 +109,9 @@ mppx account create
|
|
|
109
109
|
# make request - automatic payment handling, curl-like api
|
|
110
110
|
mppx example.com
|
|
111
111
|
|
|
112
|
+
# pay an x402 offer on a server that advertises both protocols
|
|
113
|
+
mppx example.com --protocol x402
|
|
114
|
+
|
|
112
115
|
# open another session instead of reusing the preferred channel
|
|
113
116
|
mppx example.com --session new
|
|
114
117
|
|
|
@@ -131,6 +134,29 @@ its configured custom escrow in the payment challenge, but the client rejects it
|
|
|
131
134
|
that do not support custom escrows should leave it unset. See the
|
|
132
135
|
[session escrow trust documentation](./src/tempo/session/README.md#escrow-configuration-and-trust).
|
|
133
136
|
|
|
137
|
+
`--protocol auto` is the default: MPP is preferred when available, and x402 is used otherwise.
|
|
138
|
+
Pass `mpp` or `x402` to require one protocol. x402 payments use the same EVM account as EVM
|
|
139
|
+
charges, so `MPPX_PRIVATE_KEY` or a stored account works for both.
|
|
140
|
+
|
|
141
|
+
Payment extensions can enforce policy or prepare funds after challenge selection and confirmation,
|
|
142
|
+
immediately before credential creation:
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
import { defineConfig, Extension } from 'mppx/cli'
|
|
146
|
+
|
|
147
|
+
export default defineConfig({
|
|
148
|
+
extensions: [
|
|
149
|
+
Extension.from({
|
|
150
|
+
async preparePayment({ challenge }) {
|
|
151
|
+
await prepareFunds(challenge)
|
|
152
|
+
},
|
|
153
|
+
}),
|
|
154
|
+
],
|
|
155
|
+
})
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Extensions run in configuration order. Throwing rejects the payment before Mppx signs it.
|
|
159
|
+
|
|
134
160
|
You can also install globally to use the `mppx` CLI from anywhere:
|
|
135
161
|
|
|
136
162
|
```bash
|
package/dist/Method.d.ts
CHANGED
|
@@ -185,6 +185,8 @@ export type CanOfferFn<method extends Method> = (parameters: {
|
|
|
185
185
|
* like recording the payment in an external system.
|
|
186
186
|
*/
|
|
187
187
|
export type OnPaymentSuccessFn<method extends Method> = (parameters: {
|
|
188
|
+
/** Challenge associated with the successful payment. */
|
|
189
|
+
challenge?: DeepReadonly<Challenge.Challenge<z.output<method['schema']['request']>, method['intent'], method['name']>> | undefined;
|
|
188
190
|
input?: globalThis.Request;
|
|
189
191
|
receipt: DeepReadonly<Receipt.Receipt>;
|
|
190
192
|
/** Canonical payment request included in the challenge. */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as Challenge from '../Challenge.js';
|
|
2
|
+
/** Context supplied before the CLI creates a payment credential. */
|
|
3
|
+
export type Context = Readonly<{
|
|
4
|
+
challenge: Challenge.Challenge;
|
|
5
|
+
/** Method-specific context that will be supplied to credential creation. */
|
|
6
|
+
credentialContext?: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
/** Result of preparing a selected payment. */
|
|
9
|
+
export type Result = Readonly<{
|
|
10
|
+
/** Replaces the method-specific context supplied to credential creation. */
|
|
11
|
+
credentialContext?: unknown;
|
|
12
|
+
}>;
|
|
13
|
+
/** Method-agnostic CLI lifecycle hooks. */
|
|
14
|
+
export type Extension = Readonly<{
|
|
15
|
+
/** Runs after challenge selection and confirmation, immediately before credential creation. */
|
|
16
|
+
preparePayment?(context: Context): Result | void | Promise<Result | void>;
|
|
17
|
+
}>;
|
|
18
|
+
/** Defines an Mppx CLI extension. */
|
|
19
|
+
export declare function from(extension: Extension): Extension;
|
|
20
|
+
//# sourceMappingURL=Extension.d.ts.map
|
package/dist/cli/cli.d.ts
CHANGED