remove evm + add xrp

This commit is contained in:
2026-08-01 00:58:22 +08:00
parent f46e61ed5e
commit 0d3acef182
55 changed files with 1457 additions and 4148 deletions
+17 -21
View File
@@ -1,16 +1,16 @@
# Koins
Multi-chain desktop wallet for **Ethereum**, **BSC**, **Polygon**, and **Monero**. Built with [Bun](https://bun.sh) + [Electrobun](https://electrobun.dev) + Svelte.
Desktop wallet for **Monero** and **XRP**. Built with [Bun](https://bun.sh) + [Electrobun](https://electrobun.dev) + Svelte.
## Features
- **Multi-coin mode**: ETH, BSC, Polygon wallet with seed phrase vault stored in system keychain
- **Monero mode**: Self-contained Monero wallet — auto-downloads `monero-wallet-rpc` binary on first launch, no manual binary install
- **XRP mode**: XRP Ledger wallet — generate or import XRP seeds, send payments with optional destination tags
- **Touch ID unlock**: Biometric auth via Swift helper, no node-gyp or FFI dylib
- **Password fallback**: PBKDF2-salted password stored in keychain, used when biometric is unavailable
- **QR codes**: Address QR with chain logo overlay
- **Transaction history**: Cached in local SQLite via Drizzle ORM
- **Settings**: Reset app clears all DB tables and keychain entries
- **Transaction history**: Live XRP ledger transactions and Monero wallet transactions
- **Settings**: Reset app clears all keychain entries
## Prerequisites
@@ -35,41 +35,38 @@ apps/desktop/
│ │ │ ├── monero/ # Monero RPC management
│ │ │ │ ├── binary.ts # Download/extract monero-wallet-rpc
│ │ │ │ └── wallet.ts # Child process + RPC client
│ │ │ ├── alchemy/ # Alchemy API calls
│ │ │ ├── viem/ # viem chain calls
│ │ │ ├── tokens/ # Token metadata (DB-first cache)
│ │ │ ├── transactions/ # Tx history + details (DB-first cache)
│ │ │ ├── db/ # Drizzle ORM + SQLite schema
│ │ │ ├── xrp/ # XRP Ledger client (xrpl)
│ │ │ └── biometric.ts # Biometric auth (Swift subprocess)
│ │ ├── rpc/
│ │ │ ├── monero/ # Monero RPC handlers
│ │ │ └── xrp/ # XRP RPC handlers
│ │ └── native/
│ │ └── biometric-helper.swift # Touch ID prompt binary
│ ├── lib/
│ │ ├── states/
│ │ │ └── wallet.svelte.ts # Wallet state (singleton)
│ │ ├── components/
│ │ │ └── EvmDashboard.svelte # Shared EVM dashboard
│ │ │ ├── monero-wallet.svelte.ts # Monero wallet state (singleton)
│ │ │ └── xrp-wallet.svelte.ts # XRP wallet state (singleton)
│ │ └── electrobun.ts # RPC type definitions
│ └── routes/
│ ├── index.svelte # Login/welcome page
│ ├── multicoin/ # ETH / BSC / Polygon routes
│ ├── monero/ # Monero dashboard
│ ├── settings.svelte # App settings
│ └── tx/ # Transaction details
│ ├── monero/ # Monero routes
│ ├── xrp/ # XRP routes
│ └── settings.svelte # App settings
└── package.json
```
## Key Decisions
- **Monero via RPC, not WASM**: `monero-ts`'s WASM wallet (`MoneroWalletFull`) doesn't work in Bun because the C++ HTTP client fails at runtime. Instead, `monero-wallet-rpc` runs as a child process.
- **SQLite cache**: All chain data (tx history, receipts, token metadata) cached in SQLite via Drizzle, not localStorage.
- **XRP via xrpl**: Uses the official `xrpl` library over the public `wss://s1.ripple.com` WebSocket server. XRP seeds are stored in the system keychain.
- **Keychain storage**: Wallet seeds and metadata are stored in the macOS keychain via `Bun.secrets`, not a local database.
- **Biometric auth**: Uses a Swift binary spawned via `Bun.spawnSync()` (not `dlopen` — Bun crashes on ObjC runtime; not `node-mac-auth` — fragile node-gyp chain).
- **Separate account types**: EVM and Monero are separate account types with their own seed formats and auth flows.
- **Separate account types**: Monero and XRP are separate account types with their own seed formats and auth flows.
## Dependencies
- [Viem](https://viem.sh) — EVM chain RPC calls + wallet operations
- [xrpl](https://github.com/XRPLF/xrpl.js) — XRP Ledger client
- [monero-ts](https://github.com/woodser/monero-ts) — Monero RPC client
- [Drizzle ORM](https://orm.drizzle.team) — SQLite schema + queries
- [Svelte 5](https://svelte.dev) — UI framework
- [Electrobun](https://electrobun.dev) — Desktop app shell
- [sv-router](https://github.com/TZGyn/sv-router) — File-based routing
@@ -80,5 +77,4 @@ apps/desktop/
```bash
bun run dev # Start development server
bun run db:push # Push Drizzle schema to SQLite
```