WATCHER: get a signed callback the moment a crypto address transacts. Arm once, pay once (no account, no API key) — we watch Base, Ethereum, or Bitcoin and POST your custom payload to callbackUrl when the address sends/receives native coins, ERC-20s, or ERC-721s. Filter by direction (in/out/both), asset type, and a USD minimum (minValueUsd) to skip dust. Bounded by a 30-day / 25-fire window. Deliveries are EIP-191-signed by our published key (verify offline) and retried with exponential backoff; missed pushes are recoverable via watchers.status. Returns a watcherId.
/api/watchers/crypto-address-activityPAYMENT-SIGNATURE.The crypto address activity API is a pay-per-call watchers endpoint built for AI agents and autonomous software. WATCHER: get a signed callback the moment a crypto address transacts.
There is no signup and no API key. An agent (or any HTTP client) hits the endpoint, receives an x402 "402 Payment Required" challenge, signs a sub-cent USDC payment on Base or Solana, and retries — the data comes back on the paid request. That makes it a drop-in crypto address activity data source for an agent tool-use loop, an MCP host, or a backend that needs watchers data on demand without onboarding to yet another vendor portal.
| Name | Type | Description |
|---|---|---|
chainrequired | string | Which chain to watch: base, ethereum, or bitcoin. one of: base | ethereum | bitcoin |
addressrequired | string | The address to watch — an EVM address (0x… 40 hex) for base/ethereum, or a Bitcoin address (bc1…/1…/3…). min 20 chars · max 100 chars |
callbackUrlrequired | string | Where we POST the event. Any http(s) URL; the JSON body is signed (verify with X-2s-Signature). e.g. https://your-agent.app/hooks/wallet max 2048 chars · uri |
direction | string | Which flows to fire on: "in" = address received, "out" = address sent, "both" = either. Default: both. one of: in | out | both |
assetTypes | array | Limit to asset kinds: any of "native" (ETH/BTC), "erc20" (tokens), "erc721" (NFTs). Omit to watch all. EVM only — Bitcoin is always native. e.g. ["erc20"] for token transfers only. |
minValueUsd | number | Only fire when the transfer is worth at least this many USD — filters out dust/spam. e.g. 100 ignores anything under $100. Omit to fire on any non-zero amount. min 0 · max 1000000000000 |
payload | object | Arbitrary JSON, echoed back verbatim in every callback so you can route/identify the event on your side. e.g. {"agentId":"a1","reason":"treasury-monitor"} |
expiresInSeconds | integer | How long the watch stays active, in seconds. Default 2592000 (30 days), max 7776000 (90 days). e.g. 86400 = 1 day. min 60 · max 7776000 |
maxFires | integer | Stop after this many callbacks. Default 25, max 1000. The watch ends at whichever comes first — maxFires or expiry. min 1 · max 1000 |
label | string | Optional free-text tag to recognize this watcher later. e.g. "exchange-cold-wallet". max 64 chars |
# 1. Probe the endpoint with no auth — receive 402 with PaymentRequirements
curl -sS -X POST 'https://2s.io/api/watchers/crypto-address-activity' \
-H 'Content-Type: application/json' \
-d '{"chain":"base","address":"xxxxxxxxxxxxxxxxxxxx","callbackUrl":"https://example.com","direction":"in","assetTypes":["native"],"minValueUsd":0,"payload":{},"expiresInSeconds":60,"maxFires":1,"label":"example"}'
# 2. Sign the EIP-3009 transferWithAuthorization for the advertised price +
# payTo from the 402 envelope, then retry with PAYMENT-SIGNATURE:
curl -sS -X POST 'https://2s.io/api/watchers/crypto-address-activity' \
-H 'Content-Type: application/json' \
-H 'PAYMENT-SIGNATURE: <base64-json-payload>' \
-d '{"chain":"base","address":"xxxxxxxxxxxxxxxxxxxx","callbackUrl":"https://example.com","direction":"in","assetTypes":["native"],"minValueUsd":0,"payload":{},"expiresInSeconds":60,"maxFires":1,"label":"example"}'
# Or just use the canonical runner — it handles the whole loop:
# EVM_PRIVATE_KEY=0x... node --env-file=.env.local \
# --experimental-strip-types scripts/x402-pay.ts \
# 'https://2s.io/api/watchers/crypto-address-activity'import { TwoS } from '@2sio/sdk'
const client = new TwoS({
privateKey: process.env.EVM_PRIVATE_KEY as `0x${string}`,
})
const result = await client.watchers.cryptoAddressActivity({
"chain": "base",
"address": "xxxxxxxxxxxxxxxxxxxx",
"callbackUrl": "https://example.com",
"direction": "in",
"assetTypes": [
"native"
],
"minValueUsd": 0,
"payload": {},
"expiresInSeconds": 60,
"maxFires": 1,
"label": "example"
})
console.log('endpoint:', result.endpoint)
console.log('cost:', result.costUsd, 'USDC')
console.log('tx:', result.settlement?.txHash)
console.log('data:', result.data)import os
from twosio import TwoS
client = TwoS(private_key=os.environ["EVM_PRIVATE_KEY"])
result = client.watchers.crypto_address_activity(chain="base", address="xxxxxxxxxxxxxxxxxxxx", callbackUrl="https://example.com", direction="in", assetTypes=["native"], minValueUsd=0, payload={}, expiresInSeconds=60, maxFires=1, label="example")
print("endpoint:", result.endpoint)
print("cost:", result.cost_usd, "USDC")
print("tx:", (result.settlement or {}).get("tx_hash"))
print("data:", result.data)// 1. Add @2sio/mcp to your MCP host config (Claude Desktop example below).
// EVM_PRIVATE_KEY funds x402 payments per call.
// claude_desktop_config.json
{
"mcpServers": {
"2sio": {
"command": "npx",
"args": ["-y", "@2sio/mcp"],
"env": { "EVM_PRIVATE_KEY": "0x..." }
}
}
}
// 2. Once the server is running, agents call this tool via standard MCP:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "watchers.crypto-address-activity",
"arguments": {
"chain": "base",
"address": "xxxxxxxxxxxxxxxxxxxx",
"callbackUrl": "https://example.com",
"direction": "in",
"assetTypes": [
"native"
],
"minValueUsd": 0,
"payload": {},
"expiresInSeconds": 60,
"maxFires": 1,
"label": "example"
}
}
}| Field | Type | Description |
|---|---|---|
ok | boolean | one of: true |
items | array | |
total | integer | Total matching rows upstream; null when unknown. |
source | object |
{
"ok": true,
"items": [
{
"watcherId": "example",
"status": "example",
"chain": "example",
"address": "example",
"direction": "example",
"assetTypes": [
"example"
],
"minValueUsd": 1,
"maxFires": 1,
"firesRemaining": 1,
"expiresAt": "example",
"statusUrl": "example",
"callbackSigner": "example"
}
],
"total": 1,
"source": {
"provider": "example",
"url": "example",
"license": "example"
}
}