Introduces a platform abstraction so the React app runs on both
Electron (desktop) and Android (WebView via Capacitor) without any
Python backend:
- frontend/src/services/crypto-service.js: pure-JS reimplementation of
all address types (P2PKH, P2WPKH, P2TR, P2PK, P2SH multisig) and HD
wallet generation (BIP-32/39/44/49/84/86) using @noble/curves,
@noble/hashes, @scure/bip32, @scure/bip39, bech32, bs58.
AES-256-CBC encryption via Web Crypto API, Electrum-compatible key
derivation (SHA256(SHA256(password))).
- frontend/src/services/api.js: detects Electron (window.electronAPI)
vs Android (Capacitor Filesystem) at runtime; components are
unchanged in behaviour.
- frontend/src/components/{HDWallet,SingleAddress,WalletViewer}.jsx:
import api instead of window.electronAPI directly.
- frontend/package.json: @noble/*, @scure/*, bech32, bs58,
@capacitor/core, @capacitor/filesystem, @capacitor/cli,
@capacitor/android; cap:sync script.
- frontend/capacitor.config.json: appId com.walletgen.app, webDir dist.
- contrib/android/Dockerfile + build.sh: JDK 17, Android SDK 34,
cap add/sync, ./gradlew assembleDebug; outputs wallet-gen-debug.apk
64 lines
1.7 KiB
JSON
64 lines
1.7 KiB
JSON
{
|
|
"name": "wallet-gen",
|
|
"private": true,
|
|
"version": "1.0.0",
|
|
"type": "module",
|
|
"main": "electron/main.cjs",
|
|
"scripts": {
|
|
"vite": "vite",
|
|
"dev": "concurrently --kill-others -n Vite,Electron \"vite\" \"wait-on http://localhost:5173 && cross-env NODE_ENV=development ELECTRON_RUN_AS_NODE= electron .\"",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"dist": "vite build && electron-builder",
|
|
"cap:sync": "vite build && cap sync android"
|
|
},
|
|
"build": {
|
|
"appId": "com.walletgen.app",
|
|
"productName": "wallet-gen",
|
|
"icon": "public/icons/icon.png",
|
|
"files": ["dist/**", "electron/**"],
|
|
"extraResources": [
|
|
{ "from": "resources", "to": "." }
|
|
],
|
|
"directories": {
|
|
"output": "release"
|
|
},
|
|
"linux": {
|
|
"target": "AppImage",
|
|
"category": "Finance"
|
|
},
|
|
"win": {
|
|
"target": ["nsis", "portable"]
|
|
}
|
|
},
|
|
"dependencies": {
|
|
"@capacitor/core": "^7.0.0",
|
|
"@capacitor/filesystem": "^7.0.0",
|
|
"@noble/curves": "^1.8.0",
|
|
"@noble/hashes": "^1.7.0",
|
|
"@scure/bip32": "^1.6.0",
|
|
"@scure/bip39": "^1.5.0",
|
|
"bech32": "^2.0.0",
|
|
"bs58": "^6.0.0",
|
|
"react": "^19.2.0",
|
|
"react-dom": "^19.2.0"
|
|
},
|
|
"devDependencies": {
|
|
"@capacitor/android": "^7.0.0",
|
|
"@capacitor/cli": "^7.0.0",
|
|
"@eslint/js": "^9.39.1",
|
|
"@types/react": "^19.2.7",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@vitejs/plugin-react": "^5.1.1",
|
|
"concurrently": "^9.2.1",
|
|
"cross-env": "^10.1.0",
|
|
"electron": "^40.8.0",
|
|
"eslint": "^9.39.1",
|
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
"globals": "^16.5.0",
|
|
"vite": "^7.3.1",
|
|
"wait-on": "^9.0.4"
|
|
}
|
|
}
|