Skip to content

feat(spraay): Add Spraay batch payment action provider for Base#944

Open
plagtech wants to merge 2 commits intocoinbase:mainfrom
plagtech:feat/add-spraay-action-provider
Open

feat(spraay): Add Spraay batch payment action provider for Base#944
plagtech wants to merge 2 commits intocoinbase:mainfrom
plagtech:feat/add-spraay-action-provider

Conversation

@plagtech
Copy link

Pull Request: Add Spraay Batch Payment Action Provider

PR Title

feat(spraay): Add Spraay batch payment action provider for Base

PR Description

What

Adds a new Spraay Action Provider that enables AI agents to batch-send ETH or ERC-20 tokens to multiple recipients (up to 200) in a single transaction on Base, via the Spraay protocol.

Why

Batch payments are one of the most common onchain operations for DAOs, teams, and communities — payroll, airdrops, bounties, and reward distributions. Currently, AgentKit has no native batch payment capability, forcing agents to send individual transfers (expensive and slow). Spraay solves this with ~80% gas savings and a simple contract interface.

Actions Added

Action Description
spraay_eth Send equal ETH amounts to multiple recipients
spraay_token Send equal ERC-20 token amounts to multiple recipients
spraay_eth_variable Send different ETH amounts to each recipient
spraay_token_variable Send different token amounts to each recipient

Features

  • ✅ Supports ETH and any ERC-20 token on Base
  • ✅ Up to 200 recipients per transaction
  • ✅ Automatic token approval handling
  • ✅ Equal or variable amount distributions
  • ✅ Input validation via Zod schemas (TS) / Pydantic (Python)
  • ✅ Both TypeScript and Python implementations
  • ✅ Unit tests included

Contract Details

  • Contract: 0x1646452F98E36A3c9Cfc3eDD8868221E207B5eEC
  • Network: Base Mainnet
  • Verified on BaseScan: Yes
  • Protocol Fee: 0.3%
  • Security: ReentrancyGuard, Pausable (OpenZeppelin)

Testing

  • Unit tests cover all 4 actions
  • Tests verify correct transaction construction, fee calculation, approval flow, error handling, and network support filtering

Checklist

  • New action provider (TypeScript)
  • New action provider (Python)
  • Zod schemas with validation
  • Unit tests
  • README documentation
  • Follows existing action provider patterns (extends ActionProvider, @createaction decorator)
  • Network filtering (Base mainnet only)

How to Fork and Submit

# 1. Fork https://github.com/coinbase/agentkit on GitHub

# 2. Clone your fork
git clone https://github.com/plagtech/agentkit.git
cd agentkit

# 3. Create a branch
git checkout -b feat/add-spraay-action-provider

# 4. Copy TypeScript files
mkdir -p typescript/agentkit/src/action-providers/spraay
cp -r <path-to-spraay-files>/typescript/spraay/* typescript/agentkit/src/action-providers/spraay/

# 5. Copy Python files
mkdir -p python/coinbase-agentkit/coinbase_agentkit/action_providers/spraay
cp -r <path-to-spraay-files>/python/spraay/* python/coinbase-agentkit/coinbase_agentkit/action_providers/spraay/

# 6. Add the export to the TypeScript action-providers index
# In typescript/agentkit/src/action-providers/index.ts, add:
#   export { spraayActionProvider, SpraayActionProvider } from "./spraay";

# 7. Add the export to the Python action_providers __init__.py
# In python/coinbase-agentkit/coinbase_agentkit/action_providers/__init__.py, add:
#   from .spraay import spraay_action_provider, SpraayActionProvider

# 8. Run tests
cd typescript && npm test
cd ../python && poetry run pytest

# 9. Commit and push
git add .
git commit -m "feat(spraay): add Spraay batch payment action provider for Base"
git push origin feat/add-spraay-action-provider

# 10. Open PR on GitHub to coinbase/agentkit

@cb-heimdall
Copy link

cb-heimdall commented Feb 11, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@plagtech
Copy link
Author

Hey @murrlincoln — just following up on this PR. The Spraay x402 Gateway was recently merged into the official x402 ecosystem (coinbase/x402 PR #1278). Would appreciate a review when you get a chance. Happy to address any feedback. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants