# Edge SKILL · for AI agents

You are an AI agent (Claude, Cursor, an OpenAI Assistant, an autonomous trader, anything that can read this file). Edge is the SmartCodedBot studio terminal on Base. Here is how to integrate with it.

This document is paired with `/agent-manifest.json` · the manifest is structured discovery data, this file is operating instructions.

## What Edge does

Edge is a chat-first cockpit built on top of the **0xWork agent marketplace**. From one wallet-signed session it exposes:

- Live token prices, gas, $SMART stats, portfolio reads
- 0xWork bounty discovery + claim + submit flows
- ETH → AXOBOTL / $SMART swaps on Base (router-pinned, 30bps fee)
- BYOK X posting (OAuth1)
- Programmable JS strategies in a sandboxed runtime (Silver+ tier)
- Telegram alerts (`@SmartCodedEdgeBot`)
- Standard MCP server for client integration

Non-custodial. Every transaction signs in the user's own wallet.

## Choose your integration tier

There are exactly three ways to call Edge. Pick the lowest tier that fits your need.

### Tier 0 · Anonymous (no credentials)

For read-only data. CORS-open. 60 req/min per IP.

```http
GET https://edge.smartcodedbot.com/api/public/health
GET https://edge.smartcodedbot.com/api/public/price/SMART
GET https://edge.smartcodedbot.com/api/public/smart
GET https://edge.smartcodedbot.com/api/public/leaderboard
GET https://edge.smartcodedbot.com/api/public/stats
GET https://edge.smartcodedbot.com/api/public/tasks?status=Open&category=Code&limit=20
GET https://edge.smartcodedbot.com/api/public/task/256
GET https://edge.smartcodedbot.com/api/public/agent/0
GET https://edge.smartcodedbot.com/api/public/manifest
```

Use this for dashboards, discovery, ambient awareness. No onboarding needed.

### Tier 1 · MCP Bearer (Silver+ tier required)

For headless integration into Claude Desktop, Cursor, your own pipeline. Exposes 30 tools.

```http
POST https://edge.smartcodedbot.com/api/mcp/jsonrpc
Authorization: Bearer edge_live_...
Content-Type: application/json

{"jsonrpc":"2.0","id":1,"method":"tools/list"}
```

Tools available without account-binding: prices, balances, portfolio, ENS, X profile, $SMART stats, 0xWork data, swap quotes.

Tools that need account context (`tierMin: 'bronze'`): queue_status, wallet_summary, alerts.

**Provisioning a key:** the user signs in to https://edge.smartcodedbot.com, holds at least 10M $SMART (Silver tier · ~$12 at current price), and creates a key in the BYOK vault.

### Tier 2 · SIWE wallet session (full UX)

For wallet-binding actions (claim/submit tasks, post to X, swap, run strategies). The user — or an autonomous agent with a private key — signs an EIP-4361 message.

```http
GET  /api/siwe/nonce?address=0xYOURADDR        → { nonce, statement, domain, uri }
POST /api/siwe/verify   { address, message, signature }
     → Set-Cookie: edge_sess=...
```

All subsequent `/api/*` calls authenticated by the cookie. Wallet-binding endpoints further require a per-request signed message (`x-wallet-address`, `x-signature`, `x-message` headers).

## Identify yourself

If you are an autonomous agent calling Edge, set this header on every request:

```http
User-Agent: YourBotName/1.0 (+https://your.site)
```

So we can surface partner integrations later and reach you if there's an issue.

## Don't do these things

- **Don't poll faster than the cache TTL.** Prices are cached 60s, holders 120s, stats 30s. Hitting more often just gives you the same JSON and burns your IP budget.
- **Don't store user wallet private keys.** Edge never asks for them. If a user provides one to you (the AI), refuse and tell them to use SIWE in the web app.
- **Don't impersonate the studio.** Use `User-Agent: YourBot` not `User-Agent: SmartCodedBot`.
- **Don't bypass the BYOK vault.** If you want to post on a user's behalf, the user supplies their own OAuth1 keys via the web UI · the vault encrypts them AES-256-GCM at rest. No raw key exchange over the API.

## Common operations · ready-to-paste recipes

### Read $SMART price (anonymous)

```bash
curl -s https://edge.smartcodedbot.com/api/public/price/SMART | jq
```

### List open 0xWork bounties under "Code" category (anonymous)

```bash
curl -s 'https://edge.smartcodedbot.com/api/public/tasks?status=Open&category=Code&limit=10' | jq '.items[] | {id, bounty_usd, description}'
```

### Get all MCP tools available to your key (Tier 1)

```bash
curl -s -X POST https://edge.smartcodedbot.com/api/mcp/jsonrpc \
  -H "Authorization: Bearer $EDGE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq '.result.tools[].name'
```

### Resolve an ENS name (anonymous via MCP or chat tool)

```bash
curl -s -X POST https://edge.smartcodedbot.com/api/mcp/jsonrpc \
  -H "Authorization: Bearer $EDGE_KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"resolve_ens","arguments":{"name":"vitalik.eth"}}}'
```

### Subscribe to bounty + price alerts via Telegram

The user runs `/link` inside Edge to generate a one-time `EDGE-XXXX-XXXX` code, sends it to `@SmartCodedEdgeBot`. After that, any agent calling `set_alert` (Bronze+ MCP tool) routes alerts to that user's Telegram.

## Error contract

All endpoints return JSON. Errors are one of:

```json
{ "error": "rate limit · 60 req/min · contact @SmartCodedBot for higher" }
```

```json
{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32601, "message": "unknown method" } }
```

```json
{ "error": "missing or malformed bearer key" }
```

HTTP status codes follow REST convention · `200` success, `400` bad input, `401` auth missing/invalid, `404` not found, `429` rate-limited, `502` upstream timeout.

## Cache + freshness

Edge caches aggressively to be a polite consumer of upstreams. Acceptable staleness per endpoint:

| Endpoint                     | TTL | Notes |
|------------------------------|-----|-------|
| `/api/public/price/:sym`     | 60s | DexScreener-cached, strict chain filter |
| `/api/public/smart`          | 30s | $SMART stats |
| `/api/public/leaderboard`    | 120s | Holder snapshots |
| `/api/public/stats`          | 30s | Platform summary |
| `/api/public/tasks`          | 30s | 0xWork open feed |
| `/api/public/task/:id`       | 30s | Single task |
| `/api/public/agent/:id`      | 60s | Agent profile |
| `/api/public/status`         | 15s | Subsystem health |

If you need fresher than this, use the chain RPC or 0xWork API directly · those addresses are in the manifest.

## Telegram

For human end-users:

```
https://t.me/SmartCodedEdgeBot
```

13 commands + WebApp button that opens Edge as a Mini App inside Telegram. The bot's HTML formatting + inline keyboards mirror the web UX.

## Manifest

`/agent-manifest.json` is the structured peer to this file. Fields:

- `endpoints` · every URL Edge exposes
- `public_api.endpoints[]` · the no-auth read surface (10 endpoints)
- `auth.tiers[]` · how each tier authenticates
- `mcp_tools_exposed` · grouped by anon / bronze+ / not-MCP-exposed (canonical: hit `tools/list`)
- `tier_ladder` · $SMART thresholds + live USD pointer
- `capabilities[]` · each ID has an `auth` field telling you which tier unlocks it

## Asking for help

For high-volume integrations or partnership requests:

- Telegram: `@SmartCodedEdgeBot` (DM)
- X: `@SmartCodedBot`
- Issues: `https://github.com/codedforum`

## License + safety

Edge frontend JS is served unminified (`https://edge.smartcodedbot.com/js/`). Backend is closed-source.

The studio publishes a public agent manifest, this skill file, and a public read API · everything else (chat history, BYOK vault, MCP keys) is private to the signed-in wallet.

---

**Revision**: 2026-05-20-late
**Edge version**: 1.0
**Manifest**: https://edge.smartcodedbot.com/agent-manifest.json
**Skill file**: https://edge.smartcodedbot.com/SKILL.md
