Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b6597a0
text fix
julian-CStack Sep 3, 2022
51675c6
exchange step indicator fix
julian-CStack Sep 3, 2022
4833c4c
couple more tests
julian-CStack Sep 3, 2022
eb63b18
explicitly declare empty lists
julian-CStack Sep 3, 2022
e97ccf8
estimated/floating rate fixes and optimizations
julian-CStack Sep 3, 2022
57814fa
remove redundant null check operator
julian-CStack Sep 3, 2022
7dc44eb
trade details view bug fixes
julian-CStack Sep 3, 2022
8253561
Merge branch 'staging' into ui-testing
julian-CStack Sep 5, 2022
c366e4a
wrap swb open from file in platform check
julian-CStack Sep 5, 2022
d661851
receive screen redesign and added generate new address button
julian-CStack Sep 6, 2022
88bc15f
firo anonymity set mint saving error
Sep 6, 2022
497e879
Merge branch 'staging' into ui-testing
julian-CStack Sep 6, 2022
8fc2e5e
hive data migrate to v1 for lelantus coins update
julian-CStack Sep 6, 2022
2fb96f4
added missing override
julian-CStack Sep 6, 2022
6bfd3d5
Merge pull request #41 from cypherstack/ui-testing
msalazarm Sep 6, 2022
a69f2cc
Merge pull request #42 from cypherstack/main
ryleedavis Sep 6, 2022
d2fbb7a
clean up linter warnings and disable auto minting
julian-CStack Sep 6, 2022
c68036b
change build
Sep 6, 2022
a510191
Merge pull request #43 from cypherstack/rylee-tmp
ryleedavis Sep 6, 2022
1ca9449
disable auto mint test
julian-CStack Sep 6, 2022
325b901
remove lottie test
julian-CStack Sep 6, 2022
97e2f60
clean up migrate and add possible stuff for upcoming firo functionality
julian-CStack Sep 6, 2022
d84cde3
upcoming firo functionality assets and some linter warning clean up
julian-CStack Sep 6, 2022
7a23cfc
extra balance getters in firo
julian-CStack Sep 6, 2022
94941df
bring back minting without automatically initiating it and do not mer…
julian-CStack Sep 6, 2022
fbc398b
WIP firo redesign
julian-CStack Sep 6, 2022
83d0782
Merge branch 'staging' into ui-testing
julian-CStack Sep 6, 2022
e65c657
in wallet exchange rate update optimization
julian-CStack Sep 7, 2022
f8c8dca
update btc dust limit
julian-CStack Sep 7, 2022
15c4d0e
non lelantus firo sends
julian-CStack Sep 7, 2022
88df571
public firo fee estimate and firo fee ui updates
julian-CStack Sep 7, 2022
1b24474
update bitcoin dust limit test
julian-CStack Sep 7, 2022
ff00e74
Merge pull request #44 from cypherstack/ui-testing
julian-CStack Sep 7, 2022
1da49a0
update readme
julian-CStack Sep 7, 2022
e69f7a3
Merge pull request #45 from cypherstack/ui-testing
ryleedavis Sep 7, 2022
580b010
change build
Sep 7, 2022
53b1047
Merge pull request #46 from cypherstack/rylee-tmp
ryleedavis Sep 7, 2022
16cd9b6
received jsplit not showing as confirmed in ui fix
julian-CStack Sep 7, 2022
6862eb3
clean up mint tx details view
julian-CStack Sep 7, 2022
0cfa724
changed epic and monero base color
julian-CStack Sep 7, 2022
3c31008
added block explorer warning
julian-CStack Sep 7, 2022
0544b86
Merge branch 'staging' into ui-testing
julian-CStack Sep 7, 2022
2eab96a
update Readme
Sep 8, 2022
2b6aa83
Merge pull request #47 from cypherstack/ui-testing
ryleedavis Sep 8, 2022
d672c2b
send all for private funds in firo, and bug fix for failing to load w…
Sep 8, 2022
9061b60
Merge branch 'staging' into ui-testing
julian-CStack Sep 8, 2022
519cba2
get anon set http post call
Sep 8, 2022
0710b63
changenow fixes and update fixed rate to be more accurate in displayi…
julian-CStack Sep 8, 2022
94e6016
Merge branch 'staging' into ui-testing
julian-CStack Sep 8, 2022
f92209c
comment out unused tests
julian-CStack Sep 8, 2022
1e89f4e
fetch server cached anonymity sets for huge increase in firo restore …
julian-CStack Sep 8, 2022
e4364d5
block ex warning bugfix
julian-CStack Sep 8, 2022
006a4de
temp comment out a couple tests
julian-CStack Sep 8, 2022
553f684
Merge pull request #48 from cypherstack/ui-testing
ryleedavis Sep 8, 2022
b3883ca
change build
Sep 8, 2022
e5777d9
Merge pull request #50 from cypherstack/rylee-tmp
ryleedavis Sep 8, 2022
d7c3878
changed monero color
Sep 8, 2022
b620485
change build
Sep 8, 2022
691c4a7
Merge pull request #51 from cypherstack/rylee-tmp
ryleedavis Sep 9, 2022
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
50 changes: 33 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
[![codecov](https://codecov.io/gh/cypherstack/stack_wallet/branch/main/graph/badge.svg?token=PM1N56UTEW)](https://codecov.io/gh/cypherstack/stack_wallet)

# Stack Wallet
put details here
Stack Wallet is a fully open source cryptocurrency wallet. With an easy to use user interface and quick and speedy transactions, this wallet is ideal for anyone no matter how much they know about the cryptocurrency space. The app is actively maintained to provide new user friendly features.

[![Playstore](https://bluewallet.io/img/play-store-badge.svg)](https://play.google.com/store/apps/details?id=com.cypherstack.stackwallet)

## Feature List
put features here

Highlights include:
- 5 Different cryptocurrencies
- All private keys and seeds stay on device and are never shared.
- Easy backup and restore feature to save all the information that's important to you.
- Trading cryptocurrencies through our partners.
- Custom address book
- Favorite wallets with fast syncing
- Custom Nodes.
- Open source software.

## Build and run
### Prerequisites
- Flutter 3.0.5
- Flutter SDK Requirement (>=2.12.0, up until <3.0.0)
- Android/iOS dev setup (Android Studio, xCode and subsequent dependencies)
- The only OS supported for building is Ubuntu 20.04
- A machine with at least 100 GB of Storage
- Flutter 3.0.5 [(install manually or with git, do not install with snap)](https://docs.flutter.dev/get-started/install)
- Dart SDK Requirement (>=2.17.0, up until <3.0.0)
- Android setup ([Android Studio](https://developer.android.com/studio) and subsequent dependencies)

After that download the project and init the submodules
```
Expand All @@ -21,35 +32,40 @@ cd stack_wallet
git submodule update --init --recursive
```

Building plugins for Android
```
cd crypto_plugins/flutter_liblelantus/scripts/android/
// note if you are on a mac go one directory further to android_on_mac
./build_all.sh
// when finished go back to the root directory
cd ../../../..
You will need to install all dependencies listed in each of the plugins in the crypto_plugins folder. (eg. [Monero](https://github.com/cypherstack/flutter_libmonero), [Epic Cash](https://github.com/cypherstack/flutter_libepiccash) ) as of Sep 8th 2022 that is:

Install [Rust](https://www.rust-lang.org/tools/install)
```
cargo install cargo-ndk
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

Building plugins for IOS
sudo apt install libc6-dev-i386
sudo apt install build-essential cmake git libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev pkg-config llvm
sudo apt install build-essential debhelper cmake libclang-dev libncurses5-dev clang libncursesw5-dev cargo rustc opencl-headers libssl-dev pkg-config ocl-icd-opencl-dev
sudo apt install unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless
```

Building plugins for Android
```
cd crypto_plugins/flutter_liblelantus/scripts/ios/
cd scripts/android/
./build_all.sh
// when finished go back to the root directory
cd ../../../..
cd ../..
```

Building plugins for testing on Linux

```
cd crypto_plugins/flutter_liblelantus/scripts/linux/
cd scripts/linux/
./build_all.sh
// when finished go back to the root directory
cd ../../../..
cd ../..
```

Finally, plug in your android device or use the emulator available via Android Studio and then run the following commands:
```
flutter pub get
flutter run
```

Note on Emulators: Only x86_64 emulators are supported, x86 emulators will not work
14 changes: 14 additions & 0 deletions assets/svg/share-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions assets/svg/tx-icon-anonymize-failed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions assets/svg/tx-icon-anonymize-pending.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions assets/svg/tx-icon-anonymize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions lib/electrumx_rpc/cached_electrumx.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
import 'package:stackwallet/hive/db.dart';
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/prefs.dart';
Expand Down Expand Up @@ -59,6 +60,20 @@ class CachedElectrumX {
"setHash": "",
"coins": <dynamic>[],
};

// try up to 3 times
for (int i = 0; i < 3; i++) {
final result = await getInitialAnonymitySetCache(groupId);
if (result != null) {
set["setHash"] = result["setHash"];
set["blockHash"] = result["blockHash"];
set["coins"] = result["coins"];
Logging.instance.log(
"Populated initial anon set cache for group $groupId",
level: LogLevel.Info);
break;
}
}
} else {
set = Map<String, dynamic>.from(cachedSet);
}
Expand Down
60 changes: 54 additions & 6 deletions lib/hive/db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import 'package:stackwallet/models/trade_wallet_lookup.dart';
import 'package:stackwallet/services/wallets_service.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';

import 'package:stackwallet/utilities/logger.dart';

class DB {
static const String boxNameAddressBook = "addressBook";
static const String boxNameDebugInfo = "debugInfoBox";
Expand All @@ -27,6 +29,7 @@ class DB {
static const String boxNamePrefs = "prefs";
static const String boxNameWalletsToDeleteOnStart = "walletsToDeleteOnStart";
static const String boxNamePriceCache = "priceAPIPrice24hCache";
static const String boxNameDBInfo = "dbInfo";

String boxNameTxCache({required Coin coin}) => "${coin.name}_txCache";
String boxNameSetCache({required Coin coin}) =>
Expand All @@ -50,6 +53,7 @@ class DB {
late final Box<xmr.WalletInfo> _walletInfoSource;
late final Box<dynamic> _boxPrefs;
late final Box<TradeWalletLookup> _boxTradeLookup;
late final Box<dynamic> _boxDBInfo;

final Map<String, Box<dynamic>> _walletBoxes = {};

Expand Down Expand Up @@ -80,13 +84,40 @@ class DB {
// open hive boxes
Future<void> init() async {
if (!_initialized) {
if (Hive.isBoxOpen(boxNameDBInfo)) {
_boxDBInfo = Hive.box<dynamic>(boxNameDBInfo);
} else {
_boxDBInfo = await Hive.openBox<dynamic>(boxNameDBInfo);
}
await Hive.openBox<String>(boxNameWalletsToDeleteOnStart);
_boxPrefs = await Hive.openBox<dynamic>(boxNamePrefs);

if (Hive.isBoxOpen(boxNamePrefs)) {
_boxPrefs = Hive.box<dynamic>(boxNamePrefs);
} else {
_boxPrefs = await Hive.openBox<dynamic>(boxNamePrefs);
}

_boxAddressBook = await Hive.openBox<dynamic>(boxNameAddressBook);
_boxDebugInfo = await Hive.openBox<String>(boxNameDebugInfo);
_boxNodeModels = await Hive.openBox<NodeModel>(boxNameNodeModels);
_boxPrimaryNodes = await Hive.openBox<NodeModel>(boxNamePrimaryNodes);
_boxAllWalletsData = await Hive.openBox<dynamic>(boxNameAllWalletsData);

if (Hive.isBoxOpen(boxNameNodeModels)) {
_boxNodeModels = Hive.box<NodeModel>(boxNameNodeModels);
} else {
_boxNodeModels = await Hive.openBox<NodeModel>(boxNameNodeModels);
}

if (Hive.isBoxOpen(boxNamePrimaryNodes)) {
_boxPrimaryNodes = Hive.box<NodeModel>(boxNamePrimaryNodes);
} else {
_boxPrimaryNodes = await Hive.openBox<NodeModel>(boxNamePrimaryNodes);
}

if (Hive.isBoxOpen(boxNameAllWalletsData)) {
_boxAllWalletsData = Hive.box<dynamic>(boxNameAllWalletsData);
} else {
_boxAllWalletsData = await Hive.openBox<dynamic>(boxNameAllWalletsData);
}

_boxNotifications =
await Hive.openBox<NotificationModel>(boxNameNotifications);
_boxWatchedTransactions =
Expand All @@ -112,12 +143,29 @@ class DB {

Future<void> _loadWalletBoxes() async {
final names = _boxAllWalletsData.get("names") as Map? ?? {};
names.removeWhere((name, dyn) {
final jsonObject = Map<String, dynamic>.from(dyn as Map);
try {
Coin.values.byName(jsonObject["coin"] as String);
return false;
} catch (e, s) {
Logging.instance.log(
"Error, ${jsonObject["coin"]} does not exist, $name wallet cannot be loaded",
level: LogLevel.Error);
return true;
}
});
final mapped = Map<String, dynamic>.from(names).map((name, dyn) => MapEntry(
name, WalletInfo.fromJson(Map<String, dynamic>.from(dyn as Map))));

for (final entry in mapped.entries) {
_walletBoxes[entry.value.walletId] =
await Hive.openBox<dynamic>(entry.value.walletId);
if (Hive.isBoxOpen(entry.value.walletId)) {
_walletBoxes[entry.value.walletId] =
Hive.box<dynamic>(entry.value.walletId);
} else {
_walletBoxes[entry.value.walletId] =
await Hive.openBox<dynamic>(entry.value.walletId);
}
}
}

Expand Down
Loading