Skip to content

feat: add wallet_authorizeChallenge support#540

Merged
brendanjryan merged 2 commits into
wevm:mainfrom
parvahuja:parv/mpp-authorize
Jun 16, 2026
Merged

feat: add wallet_authorizeChallenge support#540
brendanjryan merged 2 commits into
wevm:mainfrom
parvahuja:parv/mpp-authorize

Conversation

@parvahuja

@parvahuja parvahuja commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add wallet_authorizeChallenge wallet support: when a Tempo payment method resolves a JSON-RPC account, mppx first asks the wallet to satisfy the Challenge via the wallet_authorizeChallenge RPC and falls back to local signing when unsupported.
  • Capability-gated: probes wallet_getCapabilities for mpp.status === 'supported' on the challenge chain. The probe is opportunistic — any probe failure keeps the legacy local-signing path; only the wallet_authorizeChallenge call itself falls back strictly on 4200/-32601 and rethrows other errors.
  • Wire format (v0): wallet_authorizeChallenge({ challenges: [serialized] }){ authorization }, validated to answer the exact challenge sent.
  • Hooks: charge (after client/account resolution and the expectedRecipients check, which now also applies to wallet-handled payments) and v2 session (automatic mode only; manual actions, caller-supplied channels, and locally opened channels stay on the local path). Sessions probe once per instance, not per voucher.
  • Local accounts and src/tempo/legacy are untouched; zero new RPCs for non-JSON-RPC accounts.

Supersedes #527, rebuilt on the TIP-1034 session architecture — server session snapshots + pluggable storage replace the old session continuation parameter, so the RPC is challenges-in, credential-out.

Wallet-side counterpart (serves the RPC + advertises the capability): tempoxyz/accounts PR (linked below). Independent of #526 — either can land first; clients fall back gracefully until both sides exist.

Validation

  • pnpm check:types, pnpm check:ci; 53 tests across the helper (table-driven fallback matrix), charge, and session hooks.
  • Cross-checked literal-for-literal against the accounts handler; end-to-end exercised against a fake EIP-1193 wallet implementing the accounts dispatch (supported → wallet credential; unsupported → local signing).

@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/mppx@540

commit: d32e279

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe wallet.ts a better module name?

@parvahuja parvahuja force-pushed the parv/mpp-authorize branch from aa849a7 to 1e06130 Compare June 12, 2026 00:10
@parvahuja parvahuja changed the title feat: add mpp_authorize wallet support feat: add wallet_authorizeChallenge support Jun 12, 2026
@parvahuja parvahuja marked this pull request as ready for review June 12, 2026 00:17
@parvahuja parvahuja marked this pull request as draft June 12, 2026 18:28
@parvahuja parvahuja force-pushed the parv/mpp-authorize branch from 1e06130 to da7f3a4 Compare June 12, 2026 18:28
@parvahuja parvahuja marked this pull request as ready for review June 15, 2026 21:30
@brendanjryan brendanjryan merged commit c15be54 into wevm:main Jun 16, 2026
13 checks passed
parvahuja pushed a commit to parvahuja/mppx that referenced this pull request Jun 19, 2026
brendanjryan pushed a commit that referenced this pull request Jun 20, 2026
* Revert "feat: add wallet_authorizeChallenge support (#540)"

* Add wallet_authorizeChallenge removal changeset

---------

Co-authored-by: Parv Ahuja <parv@cf36c60m99.tail388b2e.ts.net>
Co-authored-by: Parv Ahuja <17094219+parvahuja@users.noreply.github.com>
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.

3 participants