Skip to content

examples: add x402 payment and agent policy examples#207

Open
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
ygd58:examples/add-x402-and-integration-examples
Open

examples: add x402 payment and agent policy examples#207
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
ygd58:examples/add-x402-and-integration-examples

Conversation

@ygd58
Copy link
Copy Markdown

@ygd58 ygd58 commented Apr 17, 2026

Closes #149

Summary

Adds an examples/ directory with three runnable examples addressing the question raised in issue #149 about where community integrations should live.

What is included

examples/x402-pay-request.js
Make a paid HTTP request to an x402-enabled API endpoint. Shows the full 402 -> sign -> retry flow using pay(). This directly addresses the Agoragentic use case mentioned in the issue.

examples/x402-discover-services.js
Discover payable services in the OWS marketplace using discover() with optional keyword filtering and pagination support.

examples/agent-with-policy.js
Create a wallet, register a chain+expiry policy, and set up a policy-gated API key for an agent. Shows the recommended pattern for giving agents scoped access.

examples/README.md
Prerequisites and usage instructions for all examples.

Why examples/ in core

Keeping canonical examples in the core repo makes them discoverable, versioned alongside the SDK, and easy to reference from documentation. Community-specific integrations (like Agoragentic) can stay in their own repos and link back here.

Closes open-wallet-standard#149

Adds an examples/ directory with three runnable examples:

- x402-pay-request.js: make a paid HTTP request to an x402-enabled
  endpoint — shows the full 402->sign->retry flow via pay()
- x402-discover-services.js: discover payable services in the OWS
  marketplace via discover() with optional keyword filtering
- agent-with-policy.js: create a wallet, register a chain+expiry
  policy, and set up a policy-gated API key for an agent

Also adds examples/README.md with prerequisites and usage instructions.
@ygd58 ygd58 requested a review from njdawn as a code owner April 17, 2026 05:28
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

@ygd58 is attempting to deploy a commit to the MoonPay Team on Vercel.

A member of the Team first needs to authorize it.

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.

Where should marketplace/integration examples live?

1 participant