feat(examples): add Spraay gateway server — multi-chain DeFi primitives via x402#2234
feat(examples): add Spraay gateway server — multi-chain DeFi primitives via x402#2234plagtech wants to merge 1 commit intox402-foundation:mainfrom
Conversation
|
@plagtech is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for the proposal @plagtech but examples should remain neutral and not highlight specific projects, that’s what the ecosystem page is for |
|
Thanks for the feedback @phdargen — totally understand, that makes sense. Happy to rework the examples to be neutral/generic and resubmit. Also, could you point me to the right place to submit for the ecosystem page? Would love to get Spraay listed there as an x402 gateway implementation. |
|
Please see here for the ecosystem submission: https://github.com/x402-foundation/x402/tree/main/typescript/site#adding-your-project-to-the-ecosystem You can add the example to the website you link there, I don't think a generic example in the x402 repo would add much wrt the examples we already have |
|
Perfect, appreciate the link! I'll get Spraay submitted through the ecosystem page. Thanks for the guidance 🤝 |
Description
Supersedes #1761 (rebased cleanly on current main to resolve conflicts).
Adds a new server example at
examples/typescript/servers/spraay-gateway/demonstrating how to protect a production API with 76+ DeFi endpoints using x402 payment middleware.Spraay is a multi-chain batch payment protocol and x402 gateway that exposes DeFi primitives (batch payments, payroll, token swaps, escrow, AI inference, robot hiring) across 13 blockchains. This example shows agents how to discover and pay for these primitives per-request via x402 — no accounts, no API keys, no subscriptions.
What's included
@x402/expressmiddleware protecting 5 representative endpoints + 1 free discovery route/discoverreturns the full endpoint catalog, pricing, and supported chainsWhy this example is useful
/weatherendpoint.Ecosystem context
Tests
This is an example server addition — no existing tests are modified. The server runs standalone against the live Spraay gateway API. Tested locally with
ts-node src/index.tsand verified all 5 paid endpoints return proper 402 responses.Checklist