Sponsored by Deepsite.site

Spraay Solana Gateway โ€” Batch Payments For Ai Agents On Solana

Created By
plagtech22 days ago
Batch send SOL or any SPL token to 1000+ Solana wallets in one API call. x402 payment protocol โ€” $0.01 per request, no API keys, no accounts. Built for AI agents. MCP endpoint: https://gateway-solana.spraay.app/mcp
Overview

๐Ÿ’ง Spraay Solana Gateway

x402-powered batch payment infrastructure for AI agents on Solana.

Any AI agent can batch send SOL, USDC, BONK, or any SPL token to 1,000+ wallets via the x402 payment protocol. No API keys. No accounts. Pay per request.

๐Ÿ—๏ธ Architecture

AI Agent (any framework)
    โ”‚
    โ”œโ”€โ”€ HTTP Request
    โ”‚
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Spraay Solana Gateway                  โ”‚
โ”‚   gateway-solana.spraay.app              โ”‚
โ”‚                                          โ”‚
โ”‚   @x402/express + @x402/svm             โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚   โ”‚ x402 Paymentโ”‚  โ”‚ Solana Batch โ”‚     โ”‚
โ”‚   โ”‚ Middleware   โ”‚  โ”‚ Engine       โ”‚     โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚          โ”‚                โ”‚              โ”‚
โ”‚          โ–ผ                โ–ผ              โ”‚
โ”‚   USDC payment     Execute batch        โ”‚
โ”‚   verified via     SOL/SPL transfers    โ”‚
โ”‚   facilitator                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
Solana Network

๐Ÿ“ก Endpoints

EndpointMethodPriceDescription
/solana/batch-send-solPOST$0.01Batch send SOL to multiple wallets
/solana/batch-send-tokenPOST$0.01Batch send any SPL token
/solana/quoteGET$0.001Get cost estimate
/solana/status/:txidGET$0.001Check transaction status
/healthGETFreeHealth check
/.well-known/x402GETFreex402 discovery manifest

๐Ÿš€ Quick Start

1. Clone & Install

git clone https://github.com/plagtech/spraay-solana-gateway.git
cd spraay-solana-gateway
npm install

2. Configure

cp .env.example .env
# Edit .env with your treasury wallet and private key

3. Run

npm run dev    # development (auto-reload)
npm start      # production

๐Ÿ“– API Usage

Batch Send SOL

curl -X POST https://gateway-solana.spraay.app/solana/batch-send-sol \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: <base64 payment proof>" \
  -d '{
    "recipients": [
      { "address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "amount": 0.01 },
      { "address": "7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyLWP9SfKFJ", "amount": 0.02 }
    ]
  }'

Batch Send SPL Token

curl -X POST https://gateway-solana.spraay.app/solana/batch-send-token \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: <base64 payment proof>" \
  -d '{
    "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
    "recipients": [
      { "address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "amount": 1000 },
      { "address": "7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyLWP9SfKFJ", "amount": 500 }
    ]
  }'

Get Quote

curl "https://gateway-solana.spraay.app/solana/quote?recipients=100&token=BONK"

๐Ÿ” x402 Payment Flow

  1. Agent sends request without payment header
  2. Gateway returns 402 Payment Required with Solana USDC payment instructions
  3. Agent sends USDC on Solana to the treasury address
  4. Agent retries request with payment proof in X-PAYMENT header
  5. Gateway verifies payment via facilitator, executes batch transfer

Supported facilitators:

  • Devnet: https://x402.org/facilitator
  • Mainnet: https://facilitator.payai.network (PayAI โ€” free tx fees)

๐Ÿค– MCP Server

The gateway includes an MCP server for AI agent framework integration:

# Install MCP SDK
npm install @modelcontextprotocol/sdk

# Run MCP server
node mcp/spraay-solana-mcp.js

Tools available:

  • spraay_solana_batch_send_sol โ€” Batch send SOL
  • spraay_solana_batch_send_token โ€” Batch send SPL tokens
  • spraay_solana_quote โ€” Cost estimation
  • spraay_solana_tx_status โ€” Transaction lookup

๐ŸŒ Deployment

Railway

  1. Create new service in Railway project
  2. Connect GitHub repo: plagtech/spraay-solana-gateway
  3. Set environment variables in Railway dashboard
  4. Deploy โ†’ configure custom domain

DNS (GoDaddy)

Type: CNAME
Name: gateway-solana
Value: <railway-app-url>.railway.app
TTL: 600

๐Ÿ”— Spraay Ecosystem

ServiceURL
Spraay Appspraay.app
Base Gatewaygateway.spraay.app
Solana Gatewaygateway-solana.spraay.app
GitHubgithub.com/plagtech
Twitter@Spraay_app

๐Ÿ“„ License

MIT

Server Config

{
  "mcpServers": {
    "spraay-solana": {
      "url": "https://gateway-solana.spraay.app/mcp"
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map็™พๅบฆๅœฐๅ›พๆ ธๅฟƒAPI็Žฐๅทฒๅ…จ้ขๅ…ผๅฎนMCPๅ่ฎฎ๏ผŒๆ˜ฏๅ›ฝๅ†…้ฆ–ๅฎถๅ…ผๅฎนMCPๅ่ฎฎ็š„ๅœฐๅ›พๆœๅŠกๅ•†ใ€‚
Amap Maps้ซ˜ๅพทๅœฐๅ›พๅฎ˜ๆ–น MCP Server
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Tavily Mcp
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
CursorThe AI Code Editor
Howtocook McpๅŸบไบŽAnduin2017 / HowToCook ๏ผˆ็จ‹ๅบๅ‘˜ๅœจๅฎถๅš้ฅญๆŒ‡ๅ—๏ผ‰็š„mcp server๏ผŒๅธฎไฝ ๆŽจ่่œ่ฐฑใ€่ง„ๅˆ’่†ณ้ฃŸ๏ผŒ่งฃๅ†ณโ€œไปŠๅคฉๅƒไป€ไนˆโ€œ็š„ไธ–็บช้šพ้ข˜๏ผ› Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
WindsurfThe new purpose-built IDE to harness magic
ChatWiseThe second fastest AI chatbotโ„ข
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.