← 返回
开发者工具 Key 中文

PaySpawn — On-Chain Spending Limits for AI Agents

Add spending controls to any AI agent that makes API payments. Supports x402 auto-pay, daily limits, per-transaction limits, address allowlists, and fleet pr...
为进行API支付的AI代理添加支出控制。支持x402自动支付、每日限额、单笔限额、地址白名单及机群管理。
adambrainai
开发者工具 clawhub v1.0.3 1 版本 100000 Key: 需要
★ 0
Stars
📥 691
下载
💾 7
安装
1
版本
#agents#defi#latest#payments#x402

概述

PaySpawn — Agent Payment Controls

Set spending limits for AI agents that make payments autonomously. Limits are enforced at the smart contract level on Base — not in software, not on a server. The contract cannot be overridden.

Install

npm install @payspawn/sdk

Credential Setup (One Human Step)

Before the agent can make payments, the wallet owner must create a credential:

  1. Go to payspawn.ai/dashboard
  2. Connect your wallet (MetaMask, Coinbase Wallet, or any USDC wallet on Base)
  3. Approve a USDC spending ceiling (one on-chain transaction, ~$0.005 gas)
  4. Set limits: daily cap, per-transaction cap, optional address whitelist
  5. Sign the credential (EIP-712 signature — no gas, no transaction)
  6. Copy the credential string and set it as PAYSPAWN_CREDENTIAL in your environment

The credential is not a private key. Your wallet key never leaves your control. The agent can only spend within the limits you set — the contract enforces this and cannot be bypassed.

Usage

import { PaySpawn } from "@payspawn/sdk";
const ps = new PaySpawn(process.env.PAYSPAWN_CREDENTIAL);

// Auto-pay x402 APIs within your set limits
const res = await ps.fetch("https://api.example.com/endpoint");

// Send a payment
await ps.pay("0xRecipientAddress", 1.00);

// Check balance and remaining daily allowance
const { balance, remaining } = await ps.check();

// Pause all payments instantly (on-chain, immediate effect)
await ps.agent.pause();

// Resume payments
await ps.agent.unpause();

Fleet Mode

Provision multiple agent credentials from one shared pool. One wallet funds the pool; each agent gets its own credential with its own daily limit.

// Create a shared budget pool
const pool = await ps.pool.create({ totalBudget: 100, agentDailyLimit: 10 });

// Fund the pool: send USDC to pool.address from your wallet

// Provision credentials for each agent
const fleet = await ps.fleet.provision({ poolAddress: pool.address, count: 10 });
// fleet[0], fleet[1], ... → credential strings, one per agent

Contract Enforcement

Every payment is checked by the PaySpawn V5 contract on Base before any USDC moves:

  • Daily allowance exceeded → transaction reverts
  • Amount exceeds per-tx cap → transaction reverts
  • Recipient not on whitelist → transaction reverts

No API override. No config flag. Math runs first, every time.

Contract address (Base Mainnet): 0xaa8e6815b0E8a3006DEe0c3171Cf9CA165fd862e

USDC (Base): 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Links

版本历史

共 1 个版本

  • v1.0.3 当前
    2026-03-29 15:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,793
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,843
data-analysis

ADHD X Bookmark Analyzer

adambrainai
自动抓取、分类并汇总您的X书签,将其转化为可执行的见解,推送到您指定的消息渠道以便轻松查阅。
★ 2 📥 686