Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
019af41
fix: fixes missing model generation that causes build failures
karlbuys Nov 28, 2025
77611dd
feat: adds MVP-based code to cakewallet
karlbuys Dec 2, 2025
16ffd24
feat(wip): adds onOpen migration check for isLWSEnabled
karlbuys Dec 3, 2025
6d78327
feat(debug): work on implementing lws
karlbuys Dec 5, 2025
06c69c4
feat(wip): adds LWS-related variable to node view model
karlbuys Dec 5, 2025
23fb661
feat(wip): adds isLWSEnabled to Node's map system and to a HiveField
karlbuys Dec 5, 2025
aeca92b
fix: adds field needed for compilation
karlbuys Dec 5, 2025
a2679d3
wip: adds isLWSEnabled field to MoneroWallet
karlbuys Dec 8, 2025
3821e20
refactor: minor tweaks
karlbuys Dec 9, 2025
a8d4e70
feat(wip): refactors node creation page
karlbuys Dec 9, 2025
9c9b15b
feat(wip): address non-dynamic variables
karlbuys Dec 9, 2025
ed70d38
feat(wip): get_address_txs, get_random_outs, get_decoy_outputs
karlbuys Dec 9, 2025
3f21fa8
lws output txes
karlbuys Dec 10, 2025
7904e07
feat: creates cw_monerolws library (copied cw_monero)
karlbuys Dec 11, 2025
ae8a61f
feat: creation of parallel wallet for monero-lws
karlbuys Dec 11, 2025
163bcf4
fix: undid change that legacy wallets did not contain
karlbuys Dec 15, 2025
ae2d88b
refactor: move mvp lws REST code to cw_monero
karlbuys Dec 15, 2025
c5f6425
fix: fixes silly mistake with regards to isLWSEnabled init
karlbuys Dec 15, 2025
56e5bad
feat: add "opt-in" for LWS for Monero wallets ONLY
karlbuys Dec 15, 2025
ee2807f
build: commit copy of lws monero library for now
karlbuys Dec 15, 2025
8d7b449
build: lwswallet2_api_c.so in appropriate folder for build
karlbuys Dec 16, 2025
90e2b92
move monero_lws_rest.dart
karlbuys Dec 16, 2025
fcff940
feat(wip): changes node.dart to have LWS node
karlbuys Dec 16, 2025
85f0e70
build: adds build runner to unused model
karlbuys Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
42 changes: 20 additions & 22 deletions cw_core/lib/db/sqlite.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@

import 'dart:io';

import 'package:sqflite_common_ffi/sqflite_ffi.dart';

late Database db;
late Database db;

Future<void> initDb({String? pathOverride}) async {
if (Platform.isLinux || Platform.isWindows) {
if (Platform.isLinux || Platform.isWindows) {
databaseFactory = databaseFactoryFfi;
}
db = await openDatabase(
pathOverride ?? "cake.db",
version: 1,
onCreate: (Database db, int version) async {
db = await openDatabase(pathOverride ?? "cake.db", version: 1,
onOpen: (Database db) async {
try {
await db.execute(
'''
'ALTER TABLE WalletInfo ADD COLUMN isLWSEnabled INTEGER DEFAULT (0) NOT NULL');
} catch (e) {
// Column already exists, ignore error
}
}, onCreate: (Database db, int version) async {
await db.execute('''
CREATE TABLE WalletInfo (
walletInfoId INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
id TEXT NOT NULL,
Expand All @@ -40,8 +43,7 @@ CREATE TABLE WalletInfo (
);
''');

await db.execute(
'''
await db.execute('''
CREATE TABLE WalletInfoDerivationInfo (
walletInfoDerivationInfoId INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
address TEXT NOT NULL,
Expand All @@ -54,8 +56,7 @@ CREATE TABLE WalletInfoDerivationInfo (
);
''');

await db.execute(
'''
await db.execute('''
CREATE TABLE WalletInfoAddress (
walletInfoAddressId INTEGER PRIMARY KEY AUTOINCREMENT,
walletInfoId INTEGER,
Expand All @@ -65,8 +66,7 @@ CREATE TABLE WalletInfoAddress (
);
''');

await db.execute(
'''
await db.execute('''
CREATE TABLE WalletInfoAddressInfo (
walletInfoAddressInfoId INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
walletInfoId INTEGER NOT NULL,
Expand All @@ -78,19 +78,16 @@ CREATE TABLE WalletInfoAddressInfo (
);
''');

await db.execute(
'''
await db.execute('''
CREATE TABLE "WalletInfoAddressMap" (
walletInfoAddressMapId INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
walletInfoId INTEGER NOT NULL,
addressKey TEXT NOT NULL,
addressValue TEXT NOT NULL,
CONSTRAINT WalletInfoAddress_WalletInfo_FK FOREIGN KEY (walletInfoId) REFERENCES WalletInfo(walletInfoId)
);
'''
);
}
);
''');
});
}

Future<Map<String, dynamic>> dumpDb() async {
Expand All @@ -105,7 +102,8 @@ Future<Map<String, dynamic>> dumpDb() async {
}

Future<List<String>> _getTableNames() async {
final tableNames = await db.rawQuery('SELECT name FROM sqlite_master WHERE type = "table"');
final tableNames =
await db.rawQuery('SELECT name FROM sqlite_master WHERE type = "table"');
return tableNames.map((e) => (e["name"]).toString()).toList();
}

Expand All @@ -116,4 +114,4 @@ Future<Map<String, dynamic>> _dumpDb() async {
ret[tableName] = await db.query(tableName);
}
return ret;
}
}
Loading