You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(emergency-withdraw): update README for deployment, i18n, build setup
- New "Deployment" section — documents the GitHub Pages workflow
(.github/workflows/deploy-emergency-withdraw.yml), the public/CNAME
custom domain, and the one-time repo + DNS setup.
- New "Languages" section — English / 繁體中文 / 日本語, globe switcher,
localStorage persistence, all bundled so it works offline.
- Development: fix the stale `cd v1/reference/emergency-withdraw` path to
`cd emergency-withdraw`; prefer `npm ci` now that package-lock.json is
committed.
- Usage Option A: emergency.optivaults.app is live — drop the "once
published" qualifier.
- Trust model: refresh the SPA line-count note and mention i18n.
|`frontend/`| ✅ Published | React 19 + Vite 8 + TailwindCSS v4 SPA. CIP-30 wallet integration, **in-browser TX building via Lucid Evolution** (no separate API server — the previous `api/` component has been folded into the frontend client-side), Blockfrost direct REST, vitest tests. 7 pages with EN / zh-TW / ja i18n. Operator-specific URLs + Cloudflare Pages deploy script flagged in `frontend/README.md` for forkers. |
43
43
|`withdraw-cli/`| ✅ Published | Node CLI for self-serve Withdraw (no infrastructure dependency). |
44
-
|`emergency-withdraw/`| ✅ Published | Static HTML self-serve emergency-withdraw tool — in-browser, no backend dependency. |
44
+
|`emergency-withdraw/`| ✅ Published | Static HTML self-serve emergency-withdraw tool — in-browser, no backend dependency. English / zh-TW / ja i18n. |
45
45
46
46
Remaining components will be added in batches as each is verified V1-ready against the on-chain contracts.
| Vault identity | One-shot Vault NFT minted at deploy ceremony — the validator script hashes physically encode the real NFT policy, and the page verifies the target vault UTXO holds that NFT before building the TX |
| Withdrawal logic | This static React/Vite SPA — open source, ~700 lines of withdrawal logic in `lib/` plus the React UI (English / 繁體中文 / 日本語 i18n) |
24
24
| Chain query | Blockfrost (your own API key) |
25
25
| Deploy state | A `v1-deploy-state.json` ceremony file (operator-published, but you can swap it via `?config=<url>` query param) |
26
26
| TX signing | Your CIP-30 wallet extension |
@@ -32,11 +32,15 @@ The page detects the network from the loaded ceremony JSON's `network` field, th
32
32
33
33
V1 currently runs on **Preprod only** (release `v1-preprod-p23`). Mainnet deploy lands when V1 ceremony is performed.
34
34
35
+
## Languages
36
+
37
+
The UI ships in English, 繁體中文, and 日本語 — switch via the globe selector in the header. The choice is saved to `localStorage`, and on first visit it follows the browser language. All translations are bundled into the page (no network fetch), so they work in an offline-saved copy too.
38
+
35
39
## Usage
36
40
37
41
### Option A — online (operator-hosted)
38
42
39
-
Visit the operator's URL (e.g. `https://emergency.optivaults.app` once published).
43
+
Visit the operator's URL: <https://emergency.optivaults.app>.
40
44
41
45
### Option B — offline (recommended for worst-case)
42
46
@@ -80,15 +84,25 @@ Useful if you've forked the contract for your own instance and want to share an
80
84
## Development
81
85
82
86
```bash
83
-
cdv1/reference/emergency-withdraw
84
-
npm install
87
+
cd emergency-withdraw
88
+
npm ci # reproducible install from package-lock.json (npm install also works)
85
89
npm run dev # vite dev server on :5173
86
90
npm run build # outputs dist/ (Buffer polyfill auto-injected post-build)
87
91
npm run preview # serve dist/ locally
88
92
```
89
93
90
94
The build outputs a multi-file dist (HTML + JS chunks + WASM). For true single-file offline mode, run the build then drag `dist/index.html` into a browser; modern browsers inline assets automatically when saving "Webpage HTML Only".
91
95
96
+
## Deployment
97
+
98
+
The page is a static SPA, so any static host works. The OptiVaults-operated instance is published to GitHub Pages straight from this repo:
99
+
100
+
-[`.github/workflows/deploy-emergency-withdraw.yml`](../.github/workflows/deploy-emergency-withdraw.yml) builds the SPA on every push to `v1` that touches `emergency-withdraw/`, then publishes `dist/` via `actions/deploy-pages`.
101
+
-`public/CNAME` carries the custom domain `emergency.optivaults.app`. The site is served from the domain root, so Vite's default `base` (`/`) is left unchanged.
102
+
- One-time repo setup: **Settings → Pages → Source → "GitHub Actions"**, plus a DNS `CNAME` record `emergency` → `optivaults.github.io`.
103
+
104
+
Forking your own instance: repoint `public/CNAME` at your domain, or delete it and serve from the `*.github.io` project URL (set Vite `base` to match the sub-path), or drop the built `dist/` on any other static host.
0 commit comments