Skip to content

Commit a58e7e6

Browse files
committed
Initial commit
0 parents  commit a58e7e6

213 files changed

Lines changed: 18497 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy Web App
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
22+
- name: Clean install dependencies
23+
run: |
24+
rm -rf node_modules package-lock.json
25+
npm install
26+
27+
- name: Build web app
28+
run: npm run build
29+
30+
- name: Setup SSH
31+
run: |
32+
mkdir -p ~/.ssh
33+
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
34+
chmod 600 ~/.ssh/deploy_key
35+
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
36+
37+
- name: Deploy to server
38+
run: |
39+
rsync -avz --delete \
40+
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no" \
41+
dist/ \
42+
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.DEPLOY_PATH }}
43+
44+
- name: Cleanup
45+
if: always()
46+
run: rm -f ~/.ssh/deploy_key

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
dist
3+
dist-extension
4+
.DS_Store
5+
*.local
6+
.vscode
7+
.idea
8+
*.log
9+
.env
10+
.air

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"printWidth": 100,
6+
"tabWidth": 2
7+
}

CLAUDE.md

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

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 digitalSloth
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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

Comments
 (0)