Merge pull request #283 from cypherstack/xmr-sync

wownero sync ux
This commit is contained in:
Diego Salazar 2022-12-30 20:04:00 -07:00 committed by GitHub
commit 205087760d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 1182 additions and 1473 deletions

5
.gitignore vendored
View file

@ -50,3 +50,8 @@ test/services/coins/particl/particl_wallet_test_parameters.dart
coverage coverage
scripts/**/build scripts/**/build
/lib/external_api_keys.dart /lib/external_api_keys.dart
libcw_monero.dll
libcw_wownero.dll
libepic_cash_wallet.dll
libmobileliblelantus.dll

@ -1 +1 @@
Subproject commit 9a150d8cd2c3625424b0059e6b7306f3659fdbe0 Subproject commit 0309140a95a51388df0effcc39ff0a25b2752b29

@ -1 +1 @@
Subproject commit db928e6f11844138ce87de2b8c1abe3305ec589e Subproject commit 6864d7c0d4fa68c371e3f0c067afd50b0d59cc9b

@ -1 +1 @@
Subproject commit d636f16aa0079c7ef47f0c8547fba1635e5eb33b Subproject commit 66eaa2f3c7133f1dbf0b1fc950e7a9e3cc611185

View file

@ -33,9 +33,9 @@ class SearchableCoinList extends ConsumerWidget {
_coins.remove(Coin.firoTestNet); _coins.remove(Coin.firoTestNet);
// Kidgloves for Wownero on desktop // Kidgloves for Wownero on desktop
if(isDesktop) { // if(isDesktop) {
_coins.remove(Coin.wownero); // _coins.remove(Coin.wownero);
} // }
return _coins; return _coins;
} }

View file

@ -161,7 +161,7 @@ class _VerifyRecoveryPhraseViewState
result.insert(random.nextInt(wordsToShow), chosenWord); result.insert(random.nextInt(wordsToShow), chosenWord);
//todo: this prints sensitive info //todo: this prints sensitive info
// debugPrint("Mnemonic game correct word: $chosenWord"); debugPrint("Mnemonic game correct word: $chosenWord");
return Tuple2(result, chosenWord); return Tuple2(result, chosenWord);
} }

View file

@ -20,7 +20,6 @@ import 'package:stackwallet/providers/global/debug_service_provider.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/stack_file_system.dart'; import 'package:stackwallet/utilities/stack_file_system.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';

View file

@ -1297,7 +1297,7 @@ class BitcoinWallet extends CoinServiceAPI {
final priceData = final priceData =
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency); await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero; Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
final String worthNow = Format.localizedStringAsFixed( final String worthNow = Format.localizedStringAsFixed(
value: value:
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) / ((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /

View file

@ -1174,7 +1174,7 @@ class BitcoinCashWallet extends CoinServiceAPI {
final priceData = final priceData =
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency); await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero; Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
final String worthNow = Format.localizedStringAsFixed( final String worthNow = Format.localizedStringAsFixed(
value: value:
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) / ((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /

View file

@ -197,7 +197,7 @@ abstract class CoinServiceAPI {
walletId: walletId, walletId: walletId,
walletName: walletName, walletName: walletName,
coin: coin, coin: coin,
secureStore: secureStorageInterface, secureStorage: secureStorageInterface,
// tracker: tracker, // tracker: tracker,
); );

View file

@ -1064,7 +1064,7 @@ class DogecoinWallet extends CoinServiceAPI {
final priceData = final priceData =
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency); await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero; Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
final String worthNow = Format.localizedStringAsFixed( final String worthNow = Format.localizedStringAsFixed(
value: value:
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) / ((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /

View file

@ -883,7 +883,7 @@ class FiroWallet extends CoinServiceAPI {
@override @override
Future<void> updateSentCachedTxData(Map<String, dynamic> txData) async { Future<void> updateSentCachedTxData(Map<String, dynamic> txData) async {
final currentPrice = await firoPrice; final currentPrice = await firoPrice;
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
final String worthNow = Format.localizedStringAsFixed( final String worthNow = Format.localizedStringAsFixed(
value: value:
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) / ((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
@ -2756,7 +2756,7 @@ class FiroWallet extends CoinServiceAPI {
var price = await firoPrice; var price = await firoPrice;
var builtHex = txb.build(); var builtHex = txb.build();
// return builtHex; // return builtHex;
final locale = await Devicelocale.currentLocale; final locale =Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
return { return {
"transaction": builtHex, "transaction": builtHex,
"txid": txId, "txid": txId,
@ -2810,7 +2810,7 @@ class FiroWallet extends CoinServiceAPI {
final currentPrice = await firoPrice; final currentPrice = await firoPrice;
// Grab the most recent information on all the joinsplits // Grab the most recent information on all the joinsplits
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
final updatedJSplit = await getJMintTransactions(cachedElectrumXClient, final updatedJSplit = await getJMintTransactions(cachedElectrumXClient,
joinsplits, _prefs.currency, coin, currentPrice, locale!); joinsplits, _prefs.currency, coin, currentPrice, locale!);
@ -3249,7 +3249,7 @@ class FiroWallet extends CoinServiceAPI {
final currentPrice = await firoPrice; final currentPrice = await firoPrice;
final List<Map<String, dynamic>> midSortedArray = []; final List<Map<String, dynamic>> midSortedArray = [];
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
Logging.instance.log("refresh the txs", level: LogLevel.Info); Logging.instance.log("refresh the txs", level: LogLevel.Info);
for (final txObject in allTransactions) { for (final txObject in allTransactions) {
@ -4324,7 +4324,7 @@ class FiroWallet extends CoinServiceAPI {
currency, currency,
coin, coin,
currentPrice, currentPrice,
(await Devicelocale.currentLocale)!); (Platform.isWindows ? "en_US" : await Devicelocale.currentLocale)!);
Logging.instance.log(spendTxs, level: LogLevel.Info); Logging.instance.log(spendTxs, level: LogLevel.Info);
for (var element in spendTxs) { for (var element in spendTxs) {
transactionMap[element.txid] = element; transactionMap[element.txid] = element;
@ -4375,7 +4375,7 @@ class FiroWallet extends CoinServiceAPI {
final lelantusEntry = await _getLelantusEntry(); final lelantusEntry = await _getLelantusEntry();
final anonymitySets = await fetchAnonymitySets(); final anonymitySets = await fetchAnonymitySets();
final locktime = await getBlockHead(electrumXClient); final locktime = await getBlockHead(electrumXClient);
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
ReceivePort receivePort = await getIsolate({ ReceivePort receivePort = await getIsolate({
"function": "createJoinSplit", "function": "createJoinSplit",

View file

@ -1299,7 +1299,7 @@ class LitecoinWallet extends CoinServiceAPI {
final priceData = final priceData =
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency); await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero; Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
final String worthNow = Format.localizedStringAsFixed( final String worthNow = Format.localizedStringAsFixed(
value: value:
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) / ((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /

View file

@ -1096,14 +1096,14 @@ class MoneroWallet extends CoinServiceAPI {
void onNewBlock() { void onNewBlock() {
// //
print("============================="); print("=============================");
print("New Block!"); print("New Block! :: $walletName");
print("============================="); print("=============================");
} }
void onNewTransaction() { void onNewTransaction() {
// //
print("============================="); print("=============================");
print("New Transaction!"); print("New Transaction! :: $walletName");
print("============================="); print("=============================");
// call this here? // call this here?

View file

@ -1287,7 +1287,7 @@ class NamecoinWallet extends CoinServiceAPI {
final priceData = final priceData =
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency); await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero; Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
final String worthNow = Format.localizedStringAsFixed( final String worthNow = Format.localizedStringAsFixed(
value: value:
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) / ((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /

View file

@ -1200,7 +1200,7 @@ class ParticlWallet extends CoinServiceAPI {
final priceData = final priceData =
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency); await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero; Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
final locale = await Devicelocale.currentLocale; final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
final String worthNow = Format.localizedStringAsFixed( final String worthNow = Format.localizedStringAsFixed(
value: value:
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) / ((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,4 @@
import 'dart:io';
import 'package:devicelocale/devicelocale.dart'; import 'package:devicelocale/devicelocale.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -7,7 +8,7 @@ class LocaleService extends ChangeNotifier {
String get locale => _locale; String get locale => _locale;
Future<void> loadLocale({bool notify = true}) async { Future<void> loadLocale({bool notify = true}) async {
_locale = await Devicelocale.currentLocale ?? "en_US"; _locale =Platform.isWindows ? "en_US" : await Devicelocale.currentLocale ?? "en_US";
if (notify) { if (notify) {
notifyListeners(); notifyListeners();
} }

View file

@ -11,12 +11,9 @@ import 'package:stackwallet/services/coins/litecoin/litecoin_wallet.dart'
import 'package:stackwallet/services/coins/monero/monero_wallet.dart' as xmr; import 'package:stackwallet/services/coins/monero/monero_wallet.dart' as xmr;
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart' import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart'
as nmc; as nmc;
import 'package:stackwallet/services/coins/particl/particl_wallet.dart'
as particl;
import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart' as wow; import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart' as wow;
import 'package:stackwallet/services/coins/particl/particl_wallet.dart'
as particl;
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/services/coins/particl/particl_wallet.dart'
as particl;
enum Coin { enum Coin {
bitcoin, bitcoin,
@ -42,7 +39,7 @@ enum Coin {
firoTestNet, firoTestNet,
} }
final int kTestNetCoinCount = Util.isDesktop ? 5 : 4; final int kTestNetCoinCount = 4; // Util.isDesktop ? 5 : 4;
extension CoinExt on Coin { extension CoinExt on Coin {
String get prettyName { String get prettyName {

View file

@ -15,8 +15,7 @@ abstract class StackFileSystem {
} else if (Platform.isLinux) { } else if (Platform.isLinux) {
appDirectory = Directory("${Platform.environment['HOME']}/.stackwallet"); appDirectory = Directory("${Platform.environment['HOME']}/.stackwallet");
} else if (Platform.isWindows) { } else if (Platform.isWindows) {
// TODO: windows root .stackwallet dir location appDirectory = await getApplicationSupportDirectory();
throw Exception("Unsupported platform");
} else if (Platform.isMacOS) { } else if (Platform.isMacOS) {
// currently run in ipad mode?? // currently run in ipad mode??
throw Exception("Unsupported platform"); throw Exception("Unsupported platform");

View file

@ -55,7 +55,7 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* firo_wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = firo_wallet.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10ED2044A3C60003C045 /* Stack Wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Stack Wallet.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@ -112,7 +112,7 @@
33CC10EE2044A3C60003C045 /* Products */ = { 33CC10EE2044A3C60003C045 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
33CC10ED2044A3C60003C045 /* firo_wallet.app */, 33CC10ED2044A3C60003C045 /* Stack Wallet.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
@ -193,7 +193,7 @@
); );
name = Runner; name = Runner;
productName = Runner; productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* firo_wallet.app */; productReference = 33CC10ED2044A3C60003C045 /* Stack Wallet.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */

View file

@ -15,7 +15,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045" BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "firo_wallet.app" BuildableName = "Stack Wallet.app"
BlueprintName = "Runner" BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
@ -31,7 +31,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045" BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "firo_wallet.app" BuildableName = "Stack Wallet.app"
BlueprintName = "Runner" BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
@ -54,7 +54,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045" BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "firo_wallet.app" BuildableName = "Stack Wallet.app"
BlueprintName = "Runner" BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
@ -71,7 +71,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045" BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "firo_wallet.app" BuildableName = "Stack Wallet.app"
BlueprintName = "Runner" BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>

View file

@ -5,10 +5,10 @@
// 'flutter create' template. // 'flutter create' template.
// The application's name. By default this is also the title of the Flutter window. // The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = firo_wallet PRODUCT_NAME = Stack Wallet
// The application's bundle identifier // The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.firoWallet PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stack_wallet
// The copyright displayed in application information // The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2022 com.cypherstack. All rights reserved. PRODUCT_COPYRIGHT = Copyright © 2022 com.cypherstack. All rights reserved.

9
scripts/windows/build_all.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
mkdir -p build
(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) &
(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) &
(cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./build_all.sh) &
wait
echo "Done building"

View file

@ -90,12 +90,12 @@ BEGIN
BLOCK "040904e4" BLOCK "040904e4"
BEGIN BEGIN
VALUE "CompanyName", "com.cypherstack" "\0" VALUE "CompanyName", "com.cypherstack" "\0"
VALUE "FileDescription", "firo_wallet" "\0" VALUE "FileDescription", "Stack Wallet" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "firo_wallet" "\0" VALUE "InternalName", "Stack Wallet" "\0"
VALUE "LegalCopyright", "Copyright (C) 2022 com.cypherstack. All rights reserved." "\0" VALUE "LegalCopyright", "Copyright (C) 2022 com.cypherstack. All rights reserved." "\0"
VALUE "OriginalFilename", "firo_wallet.exe" "\0" VALUE "OriginalFilename", "Stack Wallet.exe" "\0"
VALUE "ProductName", "firo_wallet" "\0" VALUE "ProductName", "Stack Wallet" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0"
END END
END END