diff --git a/AGENTS.md b/AGENTS.md index 3007da9..c4e2f34 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,11 +10,24 @@ docker build -t cbBTC-dashboard . && docker run -p 8080:80 cbBTC-dashboard Or just open `index.html` in a browser (without the `/api/` proxy, only the Kraken BTC price chart will work). +## Architecture + +The codebase is split into three vanilla ESM modules plus the single-page dashboard: + +| Module | Purpose | +|---|---| +| `wallets.js` | **`WalletManager`** — localStorage state, chain-specific address validation, verification lifecycle | +| `verifier.js` | **`WalletVerifier`** — EIP-712 typed-data signing via `window.ethereum`, user rejection handling | +| `stream.js` | **`WalletStreamManager`** — single WebSocket with BroadcastChannel leader election, exponential backoff + jitter | + ## File layout | File | Purpose | |---|---| -| `index.html` | Everything. Frontend, embedded chart data, inline JS logic. Edit here. | +| `index.html` | Dashboard UI. Embedded chart data, ApexCharts, TailwindCSS. Loads modules via `