Files
2026-04-06 20:58:42 +02:00

73 lines
2.1 KiB
Markdown

# Salvium Wallet (Flutter desktop MVP)
## Requirements
- Flutter stable (Linux desktop enabled)
- Prebuilt Salvium/Monero C/C++ libraries in `./monero_c`
## Run
```bash
flutter pub get
flutter run -d linux
```
The Flutter tool generates `linux/flutter/ephemeral` and plugin registrant files during the first build.
If your Flutter toolchain prefers a fresh runner scaffold, run:
`flutter create --platforms=linux .`
## Wallet backend (FFI)
The app loads a native library at runtime:
- Default name: `libwallet2_api_c.so` (also tries `libsalvium_libwallet2_api_c.so`, `salvium_libwallet2_api_c.so`)
- Search paths (Linux): `monero_c/salvium_libwallet2_api_c/build/x86_64-linux-gnu`, `monero_c/salvium_libwallet2_api_c/build`, `monero_c`, `native/build`, `native`
Override the path:
```bash
SALVIUM_LIBWALLET=/absolute/path/to/libwallet2_api_c.so flutter run -d linux
```
## Native wrapper (optional)
A C-ABI wrapper stub is provided in `native/`:
- `native/include/wallet_wrapper.h`
- `native/src/wallet_wrapper.c`
- `native/CMakeLists.txt`
Build it (Linux):
```bash
cmake -S native -B native/build
cmake --build native/build
```
Update `wallet_wrapper.c` to call the Salvium/Monero C/C++ APIs from `monero_c` and link them in `native/CMakeLists.txt`.
## Tray + background sync
- Enable **Minimize to tray** in Settings.
- Closing the window hides the app instead of quitting.
- Tray menu: Show/Hide, Sync now, Quit.
Notes:
- Some Linux window managers may not allow full close interception; in that case the app may quit on close.
## Auto-sync
Configure in Settings:
- **Auto sync** toggle
- Interval: 30s / 1m / 5m / 15m
Sync runs in background and skips overlapping ticks.
## Config storage
Config is saved to `config.json` under the application support directory:
- Linux: `~/.local/share/salvium_wallet/config.json`
## Translations (i18n)
ARB files:
- `lib/l10n/app_en.arb`
- `lib/l10n/app_pl.arb`
Add a new language by creating another ARB and rebuilding.
## FFI bindings (ffigen)
Bindings are seeded in `lib/native/wallet_wrapper_bindings.dart`.
To regenerate from `native/include/wallet_wrapper.h`:
```bash
dart run ffigen
```