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
{{ message }}
Repository navigation
Commit 66d54f1
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CLAUDE.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,22 +18,23 @@ Interactive React SPA that demos every function of the `@utexo/rgb-sdk-web` WASM
18
18
19
19
## Architecture
20
20
21
-
**Startup flow**: `App.tsx` calls `initWasm()` (async WASM init), then `autoRestore()` to recover wallets from `sessionStorage`. The Zustand store in `src/store.ts` holds the live WASM wallet instances (`manager: WalletManager | null`, `utexo: UTEXOWallet | null`) plus an activity log. Wallet instances **must** live in Zustand (not React state) because WASM objects cannot be cloned/serialized.
21
+
The SDK is **RLN-only** (the old rgb-lib-wasm `WalletManager` stack was removed). All wallets are backed by `rln-wasm-sdk`.
22
+
23
+
**Startup flow**: `App.tsx` calls `initRlnWasm()` (async WASM init), then `autoRestore()` to recover wallets from `localStorage`. The Zustand store in `src/store.ts` holds live wallet instances (`type: 'utexo' | 'rln'`, instance `UTEXOWallet | RlnWalletManager`) plus an activity log. Instances **must** live in Zustand (not React state) — WASM objects cannot be cloned/serialized. Both wallet types restore via `*.create({ mnemonic, password, network, indexerUrl?, transportEndpoint?, proxyUrl?, nodeRuntimeId? })`, so the saved `WalletConfig` must include `password`. `create()` auto-connects to the indexer (saved `indexerUrl` or the network default) non-fatally — check `isOnline()` afterwards; no separate `goOnline()` call is needed.
`BitcoinPage`, `RgbAssetsPage`, `RlnWalletPage`, and `RlnFlowGuidePage` were removed — they duplicated `UtexoWalletPage`'s coverage of BTC send, RGB issue/send/receive, and Lightning at the lower `RlnWalletManager`/`IRlnNodeBinding` layer. `UTEXOWallet` does not re-expose `sendBeginBatch`/`sendBatch`/`sendRgbFromGroups` (batch/group RGB send) — use `RlnWalletManager` directly for that if needed.
30
31
31
32
**Reusable components** worth knowing:
32
33
-`StepFlow.tsx` — 3-step Begin → Sign → Broadcast UI; steps unlock sequentially; has an "Auto" button that runs all 3 at once
33
34
-`OutputBox.tsx` — `<pre>` display with Copy button
**Session persistence** (`src/lib/session.ts`): saves `{ type, mnemonic, network, transportEndpoint, indexerUrl }` to `sessionStorage['rgb_wallet_session']`. Cleared when browser session ends.
37
+
**Session persistence** (`src/lib/session.ts`): saves wallet entries (incl. `WalletConfig` with `password`) to `localStorage['rgb_wallet_sessions']`; active id in `sessionStorage['rgb_active_wallet_id']`.
37
38
38
39
## Critical Vite Config Rules
39
40
@@ -45,7 +46,7 @@ Interactive React SPA that demos every function of the `@utexo/rgb-sdk-web` WASM
45
46
46
47
`optimizeDeps.exclude` must list `@utexo/rgb-sdk-web` and sibling packages — Vite's pre-bundler breaks async WASM init if they're included.
47
48
48
-
`server.fs.allow` must include sibling monorepo paths (`../rgb-sdk-web`, `../rgb-lib-wasm`, `../rgb-sdk-core`) so Vite can serve their WASM files.
49
+
`server.fs.allow` must include sibling monorepo paths (`../rgb-sdk-web`, `../rgb-sdk-core`, `../../utexo/rgb-lightning-node/bindings/wasm-sdk/pkg`) so Vite can serve their WASM files.
0 commit comments