Skip to content

Commit b496ea9

Browse files
committed
Initial commit
0 parents  commit b496ea9

208 files changed

Lines changed: 20015 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.

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# WalletConnect Project ID (Reown)
2+
# Get your free project ID from: https://cloud.reown.com/
3+
# Note: WalletConnect is now Reown - same protocol, new name
4+
VITE_WALLETCONNECT_PROJECT_ID=your_project_id_here

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2021": true,
6+
"node": true
7+
},
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"plugin:vue/vue3-recommended",
12+
"@vue/typescript/recommended"
13+
],
14+
"parser": "vue-eslint-parser",
15+
"parserOptions": {
16+
"ecmaVersion": "latest",
17+
"parser": "@typescript-eslint/parser",
18+
"sourceType": "module"
19+
},
20+
"rules": {
21+
"vue/multi-word-component-names": "off"
22+
}
23+
}

.github/workflows/deploy.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
env:
29+
VITE_WALLETCONNECT_PROJECT_ID: ${{ secrets.VITE_WALLETCONNECT_PROJECT_ID }}
30+
run: npm run build:web
31+
32+
- name: Setup SSH
33+
run: |
34+
mkdir -p ~/.ssh
35+
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
36+
chmod 600 ~/.ssh/deploy_key
37+
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
38+
39+
- name: Deploy to server
40+
run: |
41+
rsync -avz --delete \
42+
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no" \
43+
apps/web/dist/ \
44+
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.DEPLOY_PATH }}
45+
46+
- name: Cleanup
47+
if: always()
48+
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: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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

Comments
 (0)