feat(provider): serve wallet_authorizeChallenge and expose provider.mpp#645
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
Contributor
|
Contributor
|
4043f9b to
26ba2e5
Compare
jxom
reviewed
Jun 11, 2026
| feePayer?: string | undefined | ||
| }): ViemClient<Transport, typeof tempo> | ||
| /** Payment-aware `fetch` and MPP method clients. `undefined` when MPP is disabled. */ | ||
| mpp: mpp.Mpp | undefined |
Member
There was a problem hiding this comment.
Why do we need to return this now?
26ba2e5 to
91cec00
Compare
jxom
approved these changes
Jun 12, 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.
Summary
wallet_authorizeChallengewallet RPC: apps and agents hand the provider a serialized MPP Challenge and get back a complete authorization credential, paid through the connected account's access keys (the same internal mppx method clients the fetch integration uses). Challenges targeting chains outside the provider's configured set are rejected instead of settling on the default chain.mpp: { status: 'supported' }per chain inwallet_getCapabilities(iff the handler will serve).provider.mpp = { fetch, methods }instead of discarding theMppx.createhandler — the payment-aware scoped fetch and pre-wired method clients for runtimes where the global fetch polyfill is unavailable (e.g. Cloudflare Workers) or for handing to an MCP client wrapper.wallet_authorizeChallengewith4200, so the wallet's own payment machinery never re-enters the handler (it signs locally, as today). This also stops mutating the shared cached client with an attached account.mppprovider handle.Client-side counterpart (probes the capability and calls the RPC for JSON-RPC accounts): wevm/mppx#540. Independently shippable — until the client side lands, the RPC is simply unused; the wire protocol degrades gracefully in both directions.
Validation
tsc -b, lint/format; 490 unit tests including the re-entrancy termination regression test and the foreign-chain rejection test. Localnet suites (mppx.localnet.test.ts) require a running localnet — exercised in CI.