-
Notifications
You must be signed in to change notification settings - Fork 1k
Add Python support for Solana x402 payments with complete client/server implementation and testing. #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🟡 Heimdall Review Status
|
|
@HealthyBuilder is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
|
gmgm, any feeback on this? |
|
@CarsonRoscoe @erikreppel-cb Do you know someone who could review and take a look at this? As a user of this repo for grove.city, I found myself needing this functionality and lucky enough to find @HealthyBuilder's PR (rather than doing it myself). I'm sure everyone in the community would benefit! Given that coinbase's facilitator supports solana, this PR makes a ton of sense! |
|
@HealthyBuilder Here's a small update from the official x402 telegram channel.
|
|
@HealthyBuilder Would be able to update this PR once python support for v2 is complete? Here's a screenshot from the official x402 telegram chat:
|
|
Hi @HealthyBuilder, we really appreciate your initiative to bring solana support to the python sdk! That's certainly a big gap and something many users are waiting for. Now that v2 is released for typescript and go, the legacy packages are effectively frozen and a top priority is to fast-follow with a python v2 SDK release. We have a new development branch up with the core building blocks but there is still a lot missing, including the Solana mechanism. Please have a look at this PR: #841 and let us know if you are interested in working on this and update your code to v2. Your contribution would be much appreciated! Closing this now, please target the Here are some resources to get started with v2:
|


What's Added
Core Library - SVM Support
New modules:
exact_svm.py- Solana transaction creation, signing, and payment header generationsvm/rpc.py- Solana RPC client wrappersvm/transaction.py- Transaction encoding/decoding utilitiessvm/wallet.py- Wallet and keypair managementEnhanced existing modules:
clients/base.py- SVM keypair support with proper type detectionfastapi/middleware.py- Solana payment middlewareflask/middleware.py- Solana payment middlewarechains.py,networks.py,types.py- Solana network configurationsExamples
examples/python/clients/solana/) - httpx-based payment client with proxy bypassexamples/python/servers/solana/) - FastAPI server with payment middlewaremain_no_facilitator.py) - Direct Solana settlement without facilitatorTesting
tests/test_svm.py) - Core SVM functionalitytests/test_svm_e2e.py) - Full payment flow with live blockchainrun_e2e_test.sh) - Automated E2E test executionPayment Flow:
Networks Supported:
solana-devnet(testing)solana-mainnet-beta(production)