|
| 1 | +# NoM WebWallet |
| 2 | + |
| 3 | +A cryptocurrency wallet for the Zenon Network, supporting both browser extension (Chrome/Edge, Manifest V3) and standalone web application modes. |
| 4 | + |
| 5 | +## Tech Stack |
| 6 | + |
| 7 | +- **Framework**: Vue 3 (Composition API) |
| 8 | +- **Build Tool**: Vite |
| 9 | +- **Styling**: Tailwind CSS 4 + shadcn-vue + Reka UI |
| 10 | +- **Language**: TypeScript (strict mode) |
| 11 | +- **Blockchain**: znn-typescript-sdk (Zenon Network) |
| 12 | +- **WalletConnect**: v2 for dApp connections |
| 13 | +- **Package Manager**: npm workspaces (monorepo) |
| 14 | + |
| 15 | +## Project Structure |
| 16 | + |
| 17 | +``` |
| 18 | +nom-webwallet/ |
| 19 | +├── src/ |
| 20 | +│ ├── core/ # Business logic services |
| 21 | +│ │ ├── composables/ # Vue 3 reactive wrappers around services |
| 22 | +│ │ └── storage/ # Storage adapters (localStorage / chrome.storage) |
| 23 | +│ ├── components/ # Vue components |
| 24 | +│ ├── pages/ # Route components |
| 25 | +│ ├── types/ # TypeScript type definitions |
| 26 | +│ ├── main.ts # App entry point |
| 27 | +│ └── background.ts # Extension service worker |
| 28 | +├── packages/ |
| 29 | +│ └── ui/ # Shared shadcn-vue component library |
| 30 | +├── vite.config.web.ts # Web app build config |
| 31 | +├── vite.config.extension.ts# Extension build config |
| 32 | +└── manifest.json # Chrome extension manifest (MV3) |
| 33 | +``` |
| 34 | + |
| 35 | +## Commands |
| 36 | + |
| 37 | +```bash |
| 38 | +npm install # Install all workspaces |
| 39 | +npm run dev # Web dev server (localhost:5173) |
| 40 | +npm run dev:extension # Extension watch build |
| 41 | +npm run build # Web production build → dist/ |
| 42 | +npm run build:extension # Extension production build → dist-extension/ |
| 43 | +npm run lint # ESLint (TypeScript + Vue) |
| 44 | +npm run format # Prettier |
| 45 | +``` |
| 46 | + |
| 47 | +## Architecture |
| 48 | + |
| 49 | +**Service Layer** (`src/core/`): All blockchain and wallet business logic lives in service classes (`wallet-service.ts`, `transaction-service.ts`, `account-service.ts`, etc.). |
| 50 | + |
| 51 | +**Composables** (`src/core/composables/`): Vue 3 composables wrap services for reactive state in components. Each service has a corresponding composable (`useWallet`, `useAccount`, `useTransaction`, etc.). |
| 52 | + |
| 53 | +**Storage Abstraction**: `StorageAdapter` interface with `LocalStorageAdapter` (web) and `ChromeStorageAdapter` (extension). Adapter is selected at startup in `main.ts`. |
| 54 | + |
| 55 | +**Session Management**: Unlocked wallets are held in memory only via `SessionManager` with a 30-minute auto-timeout. No private keys are persisted unencrypted. |
| 56 | + |
| 57 | +**Singletons**: `ZenonService` (blockchain connection) and `SessionManager` use `getInstance()` pattern. |
| 58 | + |
| 59 | +## Routes |
| 60 | + |
| 61 | +- `/` — Home dashboard |
| 62 | +- `/setup` — Wallet creation/import |
| 63 | +- `/send` — Send transaction |
| 64 | +- `/receive` — Receive address |
| 65 | +- `/token/:tokenStandard` — Token details |
| 66 | + |
| 67 | +## Code Style |
| 68 | + |
| 69 | +- No semicolons, single quotes, 100-char print width (see `.prettierrc.json`) |
| 70 | +- Strict TypeScript mode |
| 71 | +- PascalCase for Vue components, camelCase for services/functions |
| 72 | +- No Pinia/Vuex — state managed via composables only |
| 73 | + |
| 74 | +## Testing |
| 75 | + |
| 76 | +No automated test suite. TypeScript strict mode is the primary correctness check. |
0 commit comments