Skip to content

docs: fix x402 buyer examples#2983

Merged
AyushBherwani1998 merged 2 commits into
MetaMask:mainfrom
vikions:fix/x402-buyer-examples
Jul 15, 2026
Merged

docs: fix x402 buyer examples#2983
AyushBherwani1998 merged 2 commits into
MetaMask:mainfrom
vikions:fix/x402-buyer-examples

Conversation

@vikions

@vikions vikions commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Description

Updates the x402 buyer examples to match the current Smart Accounts Kit and @metamask/x402 APIs.

The examples now:

  • Read facilitator addresses from the correct facilitatorAddresses field.
  • Use the supported redeemer parameter instead of passing execution rules directly.
  • Let the delegation provider use the session account as the redelegation's from address.

These changes make the examples consistent with the published SDK behavior.


Note

Low Risk
Markdown guide changes only; no runtime code, auth, or data paths are modified.

Overview
Updates the Advanced Permissions and recurring payments x402 buyer guides so copy-paste examples match the published Smart Accounts Kit and @metamask/x402 behavior.

In advanced-permissions, payment requirement types and sample code now use extra.facilitatorAddresses instead of facilitators, and requestExecutionPermissions passes facilitator allowlisting via the top-level redeemer parameter rather than a manual rules array (with prose noting the SDK maps that to a redeemer rule).

In recurring-payments, createx402DelegationProvider no longer passes from: permission.from; the guide documents that the provider derives the redelegation from from the session account.

Reviewed by Cursor Bugbot for commit 0182533. Bugbot is set up for automated code reviews on this repo. Configure here.

@vikions vikions requested review from a team as code owners July 12, 2026 11:28
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

@vikions is attempting to deploy a commit to the Consensys Team on Vercel.

A member of the Team first needs to authorize it.

@shahbaz17

Copy link
Copy Markdown
Member

cc @AyushBherwani1998

@AyushBherwani1998 AyushBherwani1998 left a comment

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.

LGTM, thanks for your contribution.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
metamask-docs Ready Ready Preview, Comment Jul 15, 2026 4:29am

Request Review

@AyushBherwani1998 AyushBherwani1998 merged commit d328802 into MetaMask:main Jul 15, 2026
19 checks passed
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