examples: add x402 payment and agent policy examples#207
Open
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
Open
examples: add x402 payment and agent policy examples#207ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
Conversation
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 is attempting to deploy a commit to the MoonPay Team on Vercel. A member of the Team first needs to authorize it. |
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.
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.jsMake 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.jsDiscover payable services in the OWS marketplace using
discover()with optional keyword filtering and pagination support.examples/agent-with-policy.jsCreate 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.mdPrerequisites 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.