|
1 | | -# PlainText — wallet approval translator |
2 | | - |
3 | | -> **Moving:** the paid wallet approval check now lives in [presign-guard](https://github.com/Fizzl13/presign-guard) as `GET /v1/approvals?chain=…&address=…` ($0.02 USDC on Base or Solana, a verdict per approval and the ones to revoke, also as the MCP tool `wallet_approvals`). `/api/explain` overlaps with presign-guard's `POST /v1/check/explain`. PlainText's paid routes keep working for now. |
4 | | -
|
5 | | -A small Node.js app that looks up a wallet's token/NFT approvals via the |
6 | | -GoPlus Security API and asks Claude to explain them in plain language. |
7 | | - |
8 | | -[](https://smartcontractexplainer.onrender.com/media/explainer.mp4) |
9 | | - |
10 | | -▶ [Watch the 1-minute explainer](https://smartcontractexplainer.onrender.com/media/explainer.mp4) · Live: https://smartcontractexplainer.onrender.com |
11 | | - |
12 | | -## Project structure |
13 | | - |
14 | | -``` |
15 | | -plaintext-wallet/ |
16 | | -├── server.js Express backend (GoPlus + Anthropic calls) |
17 | | -├── media.js Serves the explainer video from the explainer-video branch |
18 | | -├── media/explainer/ Script and pipeline for the explainer video |
19 | | -├── package.json |
20 | | -├── render.yaml Render deploy config (optional, see below) |
21 | | -├── .env.example Copy to .env for local dev |
22 | | -└── public/ |
23 | | - └── index.html Frontend (wallet check + demo scenarios) |
24 | | -``` |
25 | | - |
26 | | -## 1. Run it locally first |
27 | | - |
28 | | -```bash |
29 | | -cd plaintext-wallet |
30 | | -npm install |
31 | | -cp .env.example .env |
32 | | -# edit .env and paste your ANTHROPIC_API_KEY |
33 | | -npm start |
34 | | -``` |
35 | | - |
36 | | -Open http://localhost:3000 — try the "Try a sample" tab first (no API keys |
37 | | -needed besides Anthropic), then "Check a wallet" with a real address once |
38 | | -you're happy it works. |
39 | | - |
40 | | -## 2. Deploy to Render |
41 | | - |
42 | | -**Option A — one-click via render.yaml (Blueprint)** |
43 | | -1. Push this folder to a new GitHub repo. |
44 | | -2. In the Render dashboard: **New +** → **Blueprint** → select your repo. |
45 | | - Render reads `render.yaml` automatically and creates the web service. |
46 | | -3. When prompted, fill in the environment variables: |
47 | | - - `ANTHROPIC_API_KEY` — required, from console.anthropic.com |
48 | | - - `GOPLUS_ACCESS_TOKEN` — optional, only needed if you outgrow GoPlus's |
49 | | - free 30 calls/minute limit (see console.gopluslabs.io) |
50 | | -4. Click **Apply** — Render builds and deploys automatically. |
51 | | - |
52 | | -**Option B — manual web service (no render.yaml needed)** |
53 | | -1. Push this folder to a GitHub repo. |
54 | | -2. Render dashboard → **New +** → **Web Service** → connect your repo. |
55 | | -3. Settings: |
56 | | - - **Environment**: Node |
57 | | - - **Build Command**: `npm install` |
58 | | - - **Start Command**: `npm start` |
59 | | - - **Instance Type**: Free (fine for a prototype) |
60 | | -4. Under **Environment Variables**, add `ANTHROPIC_API_KEY` (and optionally |
61 | | - `GOPLUS_ACCESS_TOKEN`). |
62 | | -5. Click **Create Web Service**. Render gives you a `https://<name>.onrender.com` |
63 | | - URL once the build finishes. |
64 | | - |
65 | | -Render's free tier spins the service down after inactivity — the first |
66 | | -request after idling will take ~30-50 seconds to wake up. That's normal |
67 | | -and fine for a prototype you're sharing for feedback. |
68 | | - |
69 | | -## Notes on the GoPlus integration |
70 | | - |
71 | | -- The wallet check calls `token_approval_security` or `nft721_approval_security` |
72 | | - under `https://api.gopluslabs.io/api/v2/...`. This is documented but the |
73 | | - GoPlus docs site is JS-rendered, so **before you rely on this in front of |
74 | | - real users, do one manual test call** (e.g. with `curl`) against a wallet |
75 | | - you control, and compare the actual JSON shape to what `server.js` expects |
76 | | - — field names occasionally shift between GoPlus API versions. |
77 | | -- The free GoPlus tier is capped at 30 calls/minute — plenty for early |
78 | | - testing, but rate-limit errors will surface as a plain error message in |
79 | | - the UI if you exceed it. |
80 | | -- No user data is stored anywhere in this app — every check is a stateless |
81 | | - round trip. If you later add accounts, saved wallets, or history, update |
82 | | - this note (and your own privacy policy) accordingly. |
83 | | - |
84 | | -## Costs to expect |
85 | | - |
86 | | -- **Render free tier**: $0/month, with the cold-start behavior above. A paid |
87 | | - tier ($7/month "Starter") removes the spin-down if this gets real usage. |
88 | | -- **Anthropic API**: pay-per-use, billed to whatever key you provide. A |
89 | | - single explanation call is small (well under 1K tokens), so cost per |
90 | | - check will be a fraction of a cent — but keep an eye on your usage |
91 | | - dashboard if this gets shared widely, since there's no rate limiting |
92 | | - built into this prototype yet. |
| 1 | +# PlainText — wallet approval translator |
| 2 | + |
| 3 | +> **Moving:** the paid wallet approval check now lives in [presign-guard](https://github.com/Fizzl13/presign-guard) as `GET /v1/approvals?chain=…&address=…` ($0.02 USDC on Base or Solana, a verdict per approval and the ones to revoke, also as the MCP tool `wallet_approvals`). `/api/explain` overlaps with presign-guard's `POST /v1/check/explain`. PlainText's paid routes keep working for now. |
| 4 | +
|
| 5 | +A small Node.js app that looks up a wallet's token/NFT approvals via the |
| 6 | +GoPlus Security API and asks Claude to explain them in plain language. |
| 7 | + |
| 8 | +[](https://plaintext.fizzl.eu/media/explainer.mp4) |
| 9 | + |
| 10 | +▶ [Watch the 1-minute explainer](https://plaintext.fizzl.eu/media/explainer.mp4) · Live: https://plaintext.fizzl.eu |
| 11 | + |
| 12 | +## Project structure |
| 13 | + |
| 14 | +``` |
| 15 | +plaintext-wallet/ |
| 16 | +├── server.js Express backend (GoPlus + Anthropic calls) |
| 17 | +├── media.js Serves the explainer video from the explainer-video branch |
| 18 | +├── media/explainer/ Script and pipeline for the explainer video |
| 19 | +├── package.json |
| 20 | +├── render.yaml Render deploy config (optional, see below) |
| 21 | +├── .env.example Copy to .env for local dev |
| 22 | +└── public/ |
| 23 | + └── index.html Frontend (wallet check + demo scenarios) |
| 24 | +``` |
| 25 | + |
| 26 | +## 1. Run it locally first |
| 27 | + |
| 28 | +```bash |
| 29 | +cd plaintext-wallet |
| 30 | +npm install |
| 31 | +cp .env.example .env |
| 32 | +# edit .env and paste your ANTHROPIC_API_KEY |
| 33 | +npm start |
| 34 | +``` |
| 35 | + |
| 36 | +Open http://localhost:3000 — try the "Try a sample" tab first (no API keys |
| 37 | +needed besides Anthropic), then "Check a wallet" with a real address once |
| 38 | +you're happy it works. |
| 39 | + |
| 40 | +## 2. Deploy to Render |
| 41 | + |
| 42 | +**Option A — one-click via render.yaml (Blueprint)** |
| 43 | +1. Push this folder to a new GitHub repo. |
| 44 | +2. In the Render dashboard: **New +** → **Blueprint** → select your repo. |
| 45 | + Render reads `render.yaml` automatically and creates the web service. |
| 46 | +3. When prompted, fill in the environment variables: |
| 47 | + - `ANTHROPIC_API_KEY` — required, from console.anthropic.com |
| 48 | + - `GOPLUS_ACCESS_TOKEN` — optional, only needed if you outgrow GoPlus's |
| 49 | + free 30 calls/minute limit (see console.gopluslabs.io) |
| 50 | +4. Click **Apply** — Render builds and deploys automatically. |
| 51 | + |
| 52 | +**Option B — manual web service (no render.yaml needed)** |
| 53 | +1. Push this folder to a GitHub repo. |
| 54 | +2. Render dashboard → **New +** → **Web Service** → connect your repo. |
| 55 | +3. Settings: |
| 56 | + - **Environment**: Node |
| 57 | + - **Build Command**: `npm install` |
| 58 | + - **Start Command**: `npm start` |
| 59 | + - **Instance Type**: Free (fine for a prototype) |
| 60 | +4. Under **Environment Variables**, add `ANTHROPIC_API_KEY` (and optionally |
| 61 | + `GOPLUS_ACCESS_TOKEN`). |
| 62 | +5. Click **Create Web Service**. Render gives you a `https://<name>.onrender.com` |
| 63 | + URL once the build finishes. |
| 64 | + |
| 65 | +Render's free tier spins the service down after inactivity — the first |
| 66 | +request after idling will take ~30-50 seconds to wake up. That's normal |
| 67 | +and fine for a prototype you're sharing for feedback. |
| 68 | + |
| 69 | +## Notes on the GoPlus integration |
| 70 | + |
| 71 | +- The wallet check calls `token_approval_security` or `nft721_approval_security` |
| 72 | + under `https://api.gopluslabs.io/api/v2/...`. This is documented but the |
| 73 | + GoPlus docs site is JS-rendered, so **before you rely on this in front of |
| 74 | + real users, do one manual test call** (e.g. with `curl`) against a wallet |
| 75 | + you control, and compare the actual JSON shape to what `server.js` expects |
| 76 | + — field names occasionally shift between GoPlus API versions. |
| 77 | +- The free GoPlus tier is capped at 30 calls/minute — plenty for early |
| 78 | + testing, but rate-limit errors will surface as a plain error message in |
| 79 | + the UI if you exceed it. |
| 80 | +- No user data is stored anywhere in this app — every check is a stateless |
| 81 | + round trip. If you later add accounts, saved wallets, or history, update |
| 82 | + this note (and your own privacy policy) accordingly. |
| 83 | + |
| 84 | +## Costs to expect |
| 85 | + |
| 86 | +- **Render free tier**: $0/month, with the cold-start behavior above. A paid |
| 87 | + tier ($7/month "Starter") removes the spin-down if this gets real usage. |
| 88 | +- **Anthropic API**: pay-per-use, billed to whatever key you provide. A |
| 89 | + single explanation call is small (well under 1K tokens), so cost per |
| 90 | + check will be a fraction of a cent — but keep an eye on your usage |
| 91 | + dashboard if this gets shared widely, since there's no rate limiting |
| 92 | + built into this prototype yet. |
0 commit comments