Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ca81948
Merge pull request #1156 from cypherstack/staging
julian-CStack Jun 9, 2025
09c9104
WIP setup mweb
julian-CStack Jun 9, 2025
06d513a
replace barcode_scan2 with mobile_scanner
julian-CStack Jun 10, 2025
a28b629
update fusiondart
julian-CStack Jun 10, 2025
518888a
add mweb dependencies
julian-CStack Jun 10, 2025
a41a5fa
WIP drift mweb outputs and build runner gen updates
julian-CStack Jun 11, 2025
009a90d
mweb utils
julian-CStack Jun 11, 2025
f57e53c
formatting
julian-CStack Jun 12, 2025
6a05595
WIP: mweb integration - desktop focus
julian-CStack Jun 12, 2025
7752210
WIP: mweb recovery
julian-CStack Jun 13, 2025
7e17436
mwebd service clean up
julian-CStack Jun 19, 2025
6824774
refactor firo balance type to general pub/priv balance type for use w…
julian-CStack Jun 19, 2025
a8fc2f9
refactor signing data
julian-CStack Jun 19, 2025
1054b5a
WIP broken mweb transactions
julian-CStack Jun 20, 2025
921287c
temp hacks
julian-CStack Jun 24, 2025
15f84b4
no need to update if empty list passed in
julian-CStack Jun 26, 2025
11d6b2c
fix: respect verbose flag
julian-CStack Jun 26, 2025
e9f021c
mweb (and pegin/pegout) transactions (with some bugs) and some relati…
julian-CStack Jun 27, 2025
9fdcdc2
balance fixes
julian-CStack Jun 27, 2025
d41b3de
use mweb enabled coinlib
julian-CStack Jun 27, 2025
6fa12ce
fix: mweb tx change
julian-CStack Jun 27, 2025
e2da471
fix: mweb spend all
julian-CStack Jun 30, 2025
74d3c9f
fix: mweb anon all (pegin everything)
julian-CStack Jun 30, 2025
0cfa270
prevent mweb pegin transactions with non witness inputs from being br…
julian-CStack Jun 30, 2025
5073be7
update generated and handle mweb outputs in litecoin electrumx tx par…
julian-CStack Jun 30, 2025
f00e85f
mweb toggle dialog
julian-CStack Jul 1, 2025
95d3772
mweb address on mobile receive view
julian-CStack Jul 1, 2025
e8b2c59
adjust mweb toggle dialog info text
julian-CStack Jul 1, 2025
e0dfeb9
mwebd logs stream in debug mode
julian-CStack Jul 1, 2025
53caa9b
mweb mobile updates and fixes
julian-CStack Jul 1, 2025
32bd98f
flutter_mwebd go requirement docs update and bump flutter_mwebd versi…
julian-CStack Jul 2, 2025
01b0676
fix utxos update "optimization"
julian-CStack Jul 3, 2025
ec630cf
bump flutter_mwebd version again (with ios build fix)
julian-CStack Jul 3, 2025
8b19fcb
bump flutter_mwebd version yet again
julian-CStack Jul 3, 2025
483a41e
and again bump flutter_mwebd version, this time with windows build fix
julian-CStack Jul 4, 2025
338f661
again, but this time with linux fix
julian-CStack Jul 4, 2025
abeb824
mweb related ui tweaks
julian-CStack Jul 4, 2025
219b4d1
fix coin control pegin
julian-CStack Jul 4, 2025
e7e053f
ensure wallet has address of mweb output in local db
julian-CStack Jul 4, 2025
6cb870e
fix mweb -> mweb send all
julian-CStack Jul 4, 2025
fe6ef0a
fix receiving address query listener
julian-CStack Jul 7, 2025
3c05f17
salvium block explorer uri fix
julian-CStack Jul 7, 2025
401af1f
salvium price fix
julian-CStack Jul 7, 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
3 changes: 3 additions & 0 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Here you will find instructions on how to install the necessary tools for buildi
- The only OS supported for building Android and Linux desktop is Ubuntu 20.04. Windows builds require using Ubuntu 20.04 on WSL2. macOS builds for itself and iOS. Advanced users may also be able to build on other Debian-based distributions like Linux Mint.
- Android setup ([Android Studio](https://developer.android.com/studio) and subsequent dependencies)
- 100 GB of storage
- Install go: [https://go.dev/doc/install](https://go.dev/doc/install)

## Linux host

Expand Down Expand Up @@ -163,6 +164,8 @@ cd scripts/windows
./deps.sh
```

install go in WSL [https://go.dev/doc/install](https://go.dev/doc/install) (follow linux instructions) and ensure you have `x86_64-w64-mingw32-gcc`

and use `scripts/build_app.sh` to build plugins:
```
cd ..
Expand Down
48 changes: 46 additions & 2 deletions lib/db/drift/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

import 'dart:async';
import 'dart:math' as math;

import 'package:drift/drift.dart';
import 'package:drift_flutter/drift_flutter.dart';
Expand Down Expand Up @@ -44,13 +45,56 @@ class SparkNames extends Table {
Set<Column> get primaryKey => {name};
}

@DriftDatabase(tables: [SparkNames])
class MwebUtxos extends Table {
TextColumn get outputId => text()();
TextColumn get address => text()();
IntColumn get value => integer()();
IntColumn get height => integer()();
IntColumn get blockTime => integer()();
BoolColumn get blocked => boolean()();
BoolColumn get used => boolean()();

@override
Set<Column> get primaryKey => {outputId};
}

extension MwebUtxoExt on MwebUtxo {
int getConfirmations(int currentChainHeight) {
if (blockTime <= 0) return 0;
if (height <= 0) return 0;
return math.max(0, currentChainHeight - (height - 1));
}

bool isConfirmed(
int currentChainHeight,
int minimumConfirms, {
int? overrideMinConfirms,
}) {
final confirmations = getConfirmations(currentChainHeight);

if (overrideMinConfirms != null) {
return confirmations >= overrideMinConfirms;
}
return confirmations >= minimumConfirms;
}
}

@DriftDatabase(tables: [SparkNames, MwebUtxos])
final class WalletDatabase extends _$WalletDatabase {
WalletDatabase._(String walletId, [QueryExecutor? executor])
: super(executor ?? _openConnection(walletId));

@override
int get schemaVersion => 1;
int get schemaVersion => 2;

@override
MigrationStrategy get migration => MigrationStrategy(
onUpgrade: (m, from, to) async {
if (from == 1 && to == 2) {
await m.createTable(mwebUtxos);
}
},
);

static QueryExecutor _openConnection(String walletId) {
return driftDatabase(
Expand Down
Loading
Loading