|
| 1 | +# NoM Wallet |
| 2 | + |
| 3 | +A self-custody cryptocurrency wallet for the [Zenon Network](https://zenon.network) (Network of Momentum). NoM Wallet runs both as a **browser extension** (Chrome/Edge, Manifest V3) and as a **standalone web app**, sharing the same wallet logic and interface across both. |
| 4 | + |
| 5 | +Your keys stay on your device. Wallets are encrypted with a password you choose, and the unlocked keys live only in memory for the duration of your session. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- **Create or import wallets** from a mnemonic phrase, with multiple derived accounts per wallet |
| 10 | +- **Send and receive** ZNN, QSR, and other ZTS tokens |
| 11 | +- **Plasma** — fuse and cancel QSR to generate plasma for feeless transactions |
| 12 | +- **Staking** — stake ZNN for fixed durations and collect rewards |
| 13 | +- **Pillars** — delegate to a pillar and track delegation |
| 14 | +- **Rewards** — view and collect uncollected pillar, sentinel, stake, and liquidity rewards |
| 15 | +- **Multiple networks** — connect to the default Zenon node or point at your own |
| 16 | +- **In-browser Proof-of-Work** — generates the required PoW locally when an account lacks plasma; nothing is outsourced |
| 17 | +- **Password-encrypted storage** with an auto-locking session (30-minute inactivity timeout) |
| 18 | + |
| 19 | +## Getting Started |
| 20 | + |
| 21 | +### Prerequisites |
| 22 | + |
| 23 | +- **Node.js** 20.19+ or 22.12+ (required by Vite 7) |
| 24 | +- **npm** 7+ (required for workspaces) |
| 25 | + |
| 26 | +### Install |
| 27 | + |
| 28 | +```bash |
| 29 | +npm install |
| 30 | +``` |
| 31 | + |
| 32 | +### Run the web app |
| 33 | + |
| 34 | +```bash |
| 35 | +npm run dev |
| 36 | +``` |
| 37 | + |
| 38 | +The app runs at `http://localhost:5173`. |
| 39 | + |
| 40 | +### Build and load the browser extension |
| 41 | + |
| 42 | +```bash |
| 43 | +npm run build:extension |
| 44 | +``` |
| 45 | + |
| 46 | +This produces an unpacked extension in `dist-extension/`. To load it: |
| 47 | + |
| 48 | +1. Open `chrome://extensions/` in Chrome or Edge |
| 49 | +2. Enable **Developer mode** (top-right toggle) |
| 50 | +3. Click **Load unpacked** and select the `dist-extension/` directory |
| 51 | +4. The NoM Wallet icon appears in your toolbar |
| 52 | + |
| 53 | +For active extension development, use watch mode and reload the extension after changes: |
| 54 | + |
| 55 | +```bash |
| 56 | +npm run dev:extension |
| 57 | +``` |
| 58 | + |
| 59 | +## First Run |
| 60 | + |
| 61 | +On first launch the wallet has no accounts, so you're taken to the **setup** flow to create a new wallet or import one from a mnemonic. After setup, the home dashboard shows your balances, with tabs for Tokens, Rewards, Plasma, Pillar, and Staking. |
| 62 | + |
| 63 | +Sending a transaction requires the active wallet to be unlocked — if it's locked, the wallet prompts you for your password and then continues to the action. |
| 64 | + |
| 65 | +## Scripts |
| 66 | + |
| 67 | +| Command | Description | |
| 68 | +| --- | --- | |
| 69 | +| `npm run dev` | Start the web app dev server (`localhost:5173`) | |
| 70 | +| `npm run dev:extension` | Build the extension in watch mode | |
| 71 | +| `npm run build` | Production build of the web app → `dist/` | |
| 72 | +| `npm run build:extension` | Production build of the extension → `dist-extension/` | |
| 73 | +| `npm run preview` | Preview the production web build | |
| 74 | +| `npm run typecheck` | Type-check with `vue-tsc` | |
| 75 | +| `npm run lint` | Run ESLint | |
| 76 | +| `npm run lint:fix` | Run ESLint with autofix | |
| 77 | +| `npm run format` | Format with Prettier | |
| 78 | + |
| 79 | +> There is no automated test suite. TypeScript strict mode, `typecheck`, and `lint` are the correctness checks. |
| 80 | +
|
| 81 | +## Tech Stack |
| 82 | + |
| 83 | +- **Vue 3** (Composition API) + **Vite** |
| 84 | +- **Tailwind CSS 4** with **shadcn-vue** / **Reka UI** components |
| 85 | +- **TypeScript** (strict mode) |
| 86 | +- **znn-typescript-sdk** for Zenon Network connectivity |
| 87 | +- **npm workspaces** monorepo (`@nom/ui` shared component library) |
| 88 | + |
| 89 | +## Project Layout |
| 90 | + |
| 91 | +``` |
| 92 | +nom-webwallet/ |
| 93 | +├── src/ # Application code (pages, components, core logic) |
| 94 | +│ ├── core/ # Services, composables, storage adapters |
| 95 | +│ ├── components/ # Vue components |
| 96 | +│ ├── pages/ # Routed views |
| 97 | +│ ├── App.vue / main.ts # App shell and entry point |
| 98 | +│ └── background.ts # Extension service worker |
| 99 | +├── packages/ui/ # Shared shadcn-vue component library (@nom/ui) |
| 100 | +├── vite.config.web.ts # Web build config |
| 101 | +├── vite.config.extension.ts # Extension build config |
| 102 | +└── manifest.json # Chrome extension manifest (MV3) |
| 103 | +``` |
| 104 | + |
| 105 | +For a detailed technical breakdown of the service layer, composables, storage abstraction, session handling, and routing, see [ARCHITECTURE.md](docs/ARCHITECTURE.md). |
| 106 | + |
| 107 | +## Security Notes |
| 108 | + |
| 109 | +- Private keys are never written to storage in plaintext. Each wallet is persisted as a password-encrypted keystore. |
| 110 | +- Unlocked keys are held in memory only and are cleared on lock or after the session timeout. |
| 111 | +- Export your mnemonic and keep it somewhere safe — it is the only way to recover a wallet. |
0 commit comments