feat(spraay): Add Spraay batch payment tools for Base#95
feat(spraay): Add Spraay batch payment tools for Base#95DeanChensj merged 5 commits intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @plagtech, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates the Spraay batch payment protocol into the Google ADK community tools, allowing AI agents to perform efficient and cost-effective batch transfers of ETH and ERC-20 tokens on the Base network. This functionality is crucial for common on-chain operations such as payroll, airdrops, and bounty distributions, offering substantial gas savings and simplifying complex multi-recipient transactions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Update — March 2026Spraay x402 Gateway has expanded significantly since this PR was opened: 62 paid endpoints across 8 categories (up from 6):
63-tool MCP server on Smithery: @plagtech/spraay-x402-mcp All endpoints are x402-native — agents pay USDC per request on Base. No API keys, no accounts. The Search/RAG primitive is especially relevant for ADK agents — web search, content extraction, and Q&A are core agent actions, now available pay-per-call via x402. |
|
@gemini-cli /review |
|
🤖 Hi @DeanChensj, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
Great work on adding the Spraay batch payment tools! This is a very useful addition for the ADK community.
I've added a few specific comments regarding:
- Using
decimal.Decimalinstead offloatfor token amount calculations to avoid precision issues. - Adding a gas buffer to prevent 'out of gas' errors.
- Verifying the Chain ID before sending transactions.
One additional suggestion:
- Please add
web3as an optional dependency inpyproject.toml(e.g.,spraay = ["web3"]) so users can install it easily.
Overall, the code is well-structured and documented. Once these minor points are addressed, it should be ready for merge.
…D check, web3 optional dep
|
Addressed all review feedback: Switched float → decimal.Decimal for token amount calculations |
|
@gemini-cli /review |
|
🤖 Hi @DeanChensj, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
|
Hi @plagtech , could you also address the failing tests? |
|
Just pushed a fix — updated the tests to properly mock web3 and account for the new chain ID check. CI should be green on this commit. |
|
Pushed test fixes — all mocks now properly cover web3 imports so tests pass without web3 installed in CI. Also moved validation checks before the web3 import in _validate_recipients so empty list / max recipients checks work independently. |
It seems these tests still depend on web3 library. |
Fixed — test_valid_addresses and test_invalid_address now mock the web3 module at the import level using patch.dict(sys.modules) so they no longer depend on web3 being installed. Just pushed the update. |
|
🤖 Hi @DeanChensj, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
Excellent work on these tools! The implementation is robust, follows ADK patterns, and properly handles common pitfalls in on-chain transactions (gas buffers, chain ID verification, precision with Decimal).
The author has proactively addressed all previous feedback. The code is well-structured and the documentation is comprehensive.
One minor suggestion: while the 10% gas buffer is a good default, for very large batch transactions or highly volatile gas environments, making this buffer configurable via an environment variable could be a useful future enhancement.
Overall, this is a high-quality contribution.
What
Adds Spraay batch payment tools to the ADK community tools collection, enabling any ADK agent to batch-send ETH or ERC-20 tokens to up to 200 recipients in a single transaction on Base.
Why
Batch payments are one of the most common onchain operations for DAOs, teams, and AI agents — payroll, airdrops, bounties, and reward distributions. Without batch support, agents must send individual transfers, which is slow and expensive. Spraay solves this with ~80% gas savings via a single contract call.
Tools Added
spraay_batch_ethspraay_batch_tokenspraay_batch_eth_variablespraay_batch_token_variableFeatures
Usage
Files
Protocol
0x1646452F98E36A3c9Cfc3eDD8868221E207B5eEC(Base Mainnet)web3(Python)Testing
Checklist