diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3704f1488..e14b9d303 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,12 +8,12 @@ jobs: - name: Prepare repository uses: actions/checkout@v3 with: - flutter-version: '3.7.10' + flutter-version: '3.10.3' channel: 'stable' - name: Install Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.7.10' + flutter-version: '3.10.3' channel: 'stable' - name: Setup | Rust uses: ATiltedTree/setup-rust@v1 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..eba0d6cd7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dart.lineLength": 80, +} \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index db3483291..dda3aabee 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -34,6 +34,8 @@ if (keystorePropertiesFile.exists()) { android { compileSdkVersion 33 + ndkVersion = "21.1.6352462" + sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -47,6 +49,7 @@ android { applicationId "com.cypherstack.stackwallet" minSdkVersion 23 targetSdkVersion 33 + ndkVersion = "21.1.6352462" versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/android/build.gradle b/android/build.gradle index b309554fd..f7eb7f63c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.20' + ext.kotlin_version = '1.7.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.2' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -14,7 +14,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 562c5e444..6b665338b 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14fb1..44e62bcf0 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +1,11 @@ include ':app' -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/assets/default_themes/dark.zip b/assets/default_themes/dark.zip index e2291ba2b..07c4d6521 100644 Binary files a/assets/default_themes/dark.zip and b/assets/default_themes/dark.zip differ diff --git a/assets/default_themes/light.zip b/assets/default_themes/light.zip index c9579152d..649716126 100644 Binary files a/assets/default_themes/light.zip and b/assets/default_themes/light.zip differ diff --git a/crypto_plugins/flutter_libepiccash b/crypto_plugins/flutter_libepiccash index 594ab89bc..3f9472225 160000 --- a/crypto_plugins/flutter_libepiccash +++ b/crypto_plugins/flutter_libepiccash @@ -1 +1 @@ -Subproject commit 594ab89bc665a15a810ba7476ed2ad255fa8b5ac +Subproject commit 3f94722254d1c9ad54036e39a620ccc0bb53863b diff --git a/crypto_plugins/flutter_liblelantus b/crypto_plugins/flutter_liblelantus index b3fac32f5..ec3cf5e8e 160000 --- a/crypto_plugins/flutter_liblelantus +++ b/crypto_plugins/flutter_liblelantus @@ -1 +1 @@ -Subproject commit b3fac32f57d7ef97da8641463d1a852f41660f9b +Subproject commit ec3cf5e8e1b90e006188aa8c323d4cd52dbfa9b9 diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index 73d257ed2..26a152fea 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit 73d257ed2fe5b204cf3589822e226301b187b86d +Subproject commit 26a152fea3ca4b8c3f1130392a02f579c2ff218c diff --git a/docs/building.md b/docs/building.md index 3f5f4415a..6e71727ef 100644 --- a/docs/building.md +++ b/docs/building.md @@ -4,42 +4,37 @@ Here you will find instructions on how to install the necessary tools for buildi ## Prerequisites -- The only OS supported for building is Ubuntu 20.04. Advanced users may also be able to build on other Debian-based distributions like Linux Mint. +- The only OS supported for building Android and Linux desktop is Ubuntu 20.04. Windows build are completed using Ubuntu 20.04 on WSL2. 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 Android Studio following the instructions below before proceeding, then the following prerequisites can be installed with the setup script [`scripts/setup.sh`](./../scripts/setup.sh) or manually as described below: - -- Flutter 3.7.12 [(install manually or with git, do not install with snap)](https://docs.flutter.dev/get-started/install) -- Dart SDK Requirement (>=2.19.0, up until <3.0.0) (normally included with a flutter install) +## Linux host +The following instructions are for building and running on a Linux host. Alternatively, see the [Windows](#Windows host) section. ### Android Studio -Android Studio is the recommended IDE for development, not just for launching on Android devices and emulators but also for Linux desktop development. - -Follow instructions here [https://developer.android.com/studio/install#linux](https://developer.android.com/studio/install#linux) or install via snap: +Install Android Studio. Follow instructions here [https://developer.android.com/studio/install#linux](https://developer.android.com/studio/install#linux) or install via snap: ``` # setup android studio sudo apt install -y openjdk-11-jdk sudo snap install android-studio --classic ``` -Use Tools > SDK Manager to install: - - SDK Tools > Android SDK (API 30) - - SDK Tools > NDK - - SDK Tools > Android SDK command line tools - - SDK Tools > CMake +Use `Tools > SDK Manager` to install: + - `SDK Tools > Android SDK (API 30)` + - `SDK Tools > NDK` + - `SDK Tools > Android SDK command line tools` + - `SDK Tools > CMake` -Then in File > Settings > Plugins, install the Flutter plugin and restart the IDE. In File > Settings > Languages & Frameworks > Flutter > Editor, enable auto format on save to match the project's code style. If you have problems with the Dart SDK, make sure to run `flutter` in a terminal to download it (use `source ~/.bashrc` to update your environment variables if you're still using the same terminal from which you ran `setup.sh`) +Then in `File > Settings > Plugins`, install the **Flutter** and **Dart** plugins and restart the IDE. In `File > Settings > Languages & Frameworks > Flutter > Editor`, enable auto format on save to match the project's code style. If you have problems with the Dart SDK, make sure to run `flutter` in a terminal to download it (use `source ~/.bashrc` to update your environment variables if you're still using the same terminal from which you ran `setup.sh`). Run `flutter doctor` to install any missing dependencies and review and agree to any license agreements. Make a Pixel 4 (API 30) x86_64 emulator with 2GB of storage space for emulation ### Scripted setup -[`scripts/setup.sh`](./../scripts/setup.sh) is provided as a tool to set up installation for building: download the script and run it anywhere. This script should skip the entire [Manual setup](#manual-setup) section below and prepare you for [running](#running). It will set up the stack_wallet repository in `~/projects/stack_wallet` and build it there. +[`scripts/setup.sh`](./../scripts/setup.sh) is provided as a tool to set up installation for building: download the script and run it anywhere. This script should skip the entire [Manual setup](#manual-setup) section below and prepare you for [running](#Running). ### Manual setup - -> If you used the `setup.sh` script, skip to [running](#running) +> If you used the `setup.sh` script, skip to [running](#Running) Install basic dependencies ``` @@ -82,15 +77,6 @@ git submodule update --init --recursive ``` -Run prebuild script - -``` -cd scripts -./prebuild.sh -// when finished go back to the root directory -cd .. -``` - Remove pre-installed system libraries for the following packages built by cryptography plugins in the crypto_plugins folder: `boost iconv libjson-dev libsecret openssl sodium unbound zmq`. You can use ``` sudo apt list --installed | grep boost @@ -101,26 +87,39 @@ sudo apt-get remove '^libboost.*-dev.*' ``` -Building plugins for Android +### Run prebuild script + +Certain test wallet parameter and API key template files must be created in order to run Stack Wallet. These can be created by script as in +``` +cd scripts +./prebuild.sh +// when finished go back to the root directory +cd .. +``` +or manually by creating the files referenced in that script with the specified content. + +### Building plugins for Android > Warning: This will take a long time, please be patient ``` -cd scripts/android/ +cd scripts/android ./build_all.sh -// when finished go back to the root directory -cd ../.. ``` -Building plugins for Linux - +### Building plugins for Linux ``` -cd scripts/linux/ +cd scripts/linux ./build_all.sh -// when finished go back to the root directory -cd ../.. ``` -## Running -### Android +### Building plugins for Windows +``` +cd scripts/windows +./deps.sh +./build_all.sh +``` + +### Running +#### Android Plug in your android device or use the emulator available via Android Studio and then run the following commands: ``` flutter pub get @@ -129,9 +128,58 @@ flutter run android Note on Emulators: Only x86_64 emulators are supported, x86 emulators will not work -### Linux +#### Linux Plug in your android device or use the emulator available via Android Studio and then run the following commands: ``` -flutter pub get Linux +flutter pub get flutter run linux ``` + +## Windows host +### Visual Studio +Visual Studio is required for Windows development with the Flutter SDK. Download it at https://visualstudio.microsoft.com/downloads/ and install the "Desktop development with C++" workload, including all of its default components. + +### Building libraries in WSL2 +Set up Ubuntu 20.04 in WSL2. Follow the entire Linux host section to get set up and build windows `dll` libraries. Copy the resulting `dll`s to their respective positions on the Windows host: + +- `stack_wallet/crypto_plugins/flutter_libepiccash/scripts/windows/build/libepic_cash_wallet.dll` +- `stack_wallet/crypto_plugins/flutter_liblelantus/scripts/windows/build/libmobileliblelantus.dll` + + +### Install Flutter on Windows host +Install Flutter 3.10.3 on your Windows host (not in WSL2) by following these instructions: https://docs.flutter.dev/get-started/install/windows or by running `scripts/windows/deps.ps1`. You may still have to add `C:\development\flutter\bin` to PATH before proceeding, even if you ran `deps.ps1`. Run `flutter doctor` in PowerShell to confirm its installation. + +### Dependencies +Install the Windows SDK: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ You may need to install the [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/), which can be installed [by Visual Studio](https://stackoverflow.com/a/73923899) (`Tools > Get Tools and Features... > Modify > Individual Components > Windows 10 SDK`). + +Enable Developer Mode for symlink support, +``` +start ms-settings:developers +``` + +You may need to install NuGet and CppWinRT / C++/WinRT SDKs version `2.0.210806.1`: +``` +winget install 9WZDNCRDMDM3 # NuGet, can also use Microsoft.NuGet +winget install Microsoft.Windows.CppWinRT -Version 2.0.210806.1 +``` +or [download the package](https://www.nuget.org/packages/Microsoft.Windows.CppWinRT/2.0.210806.1) and [manually install it](https://github.com/Baseflow/flutter-permission-handler/issues/1025#issuecomment-1518576722) by placing it in `flutter/bin` with [nuget.exe](https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) and installing by running `nuget install Microsoft.Windows.CppWinRT -Version 2.0.210806.1` in the root `stack_wallet` folder. + + +### Run prebuild script + +Certain test wallet parameter and API key template files must be created in order to run Stack Wallet. These can be created by script as in +``` +cd scripts +./prebuild.ps1 +// when finished go back to the root directory +cd .. +``` +or manually by creating the files referenced in that script with the specified content. + +### Running + +Run the following commands: +``` +flutter pub get +flutter run -d windows +``` diff --git a/lib/db/hive/db.dart b/lib/db/hive/db.dart index 5700f985d..42e938279 100644 --- a/lib/db/hive/db.dart +++ b/lib/db/hive/db.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:isolate'; import 'package:cw_core/wallet_info.dart' as xmr; diff --git a/lib/db/isar/main_db.dart b/lib/db/isar/main_db.dart index b9841de02..ed73c398d 100644 --- a/lib/db/isar/main_db.dart +++ b/lib/db/isar/main_db.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:flutter_native_splash/cli_commands.dart'; import 'package:isar/isar.dart'; @@ -13,6 +23,11 @@ import 'package:tuple/tuple.dart'; part '../queries/queries.dart'; +/* + * This file includes the functions that are used to interact with the main database. + * To add a new function, add it in the class MainDB. + */ + class MainDB { MainDB._(); static MainDB? _instance; @@ -50,7 +65,7 @@ class MainDB { } // contact entries - List getContactEntries(){ + List getContactEntries() { return isar.contactEntrys.where().findAllSync(); } diff --git a/lib/db/queries/queries.dart b/lib/db/queries/queries.dart index 65fc6d26e..7e14de0e6 100644 --- a/lib/db/queries/queries.dart +++ b/lib/db/queries/queries.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + part of 'package:stackwallet/db/isar/main_db.dart'; enum CCFilter { diff --git a/lib/dto/ethereum/eth_token_tx_dto.dart b/lib/dto/ethereum/eth_token_tx_dto.dart index e7329ef79..f305cc2df 100644 --- a/lib/dto/ethereum/eth_token_tx_dto.dart +++ b/lib/dto/ethereum/eth_token_tx_dto.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + /// address : "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984" /// blockNumber : 16484149 /// logIndex : 61 diff --git a/lib/dto/ethereum/eth_token_tx_extra_dto.dart b/lib/dto/ethereum/eth_token_tx_extra_dto.dart index bbc457b0c..5629ce959 100644 --- a/lib/dto/ethereum/eth_token_tx_extra_dto.dart +++ b/lib/dto/ethereum/eth_token_tx_extra_dto.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:stackwallet/utilities/amount/amount.dart'; diff --git a/lib/dto/ethereum/eth_tx_dto.dart b/lib/dto/ethereum/eth_tx_dto.dart index a4345dec5..7289cda15 100644 --- a/lib/dto/ethereum/eth_tx_dto.dart +++ b/lib/dto/ethereum/eth_tx_dto.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:stackwallet/utilities/amount/amount.dart'; diff --git a/lib/dto/ethereum/pending_eth_tx_dto.dart b/lib/dto/ethereum/pending_eth_tx_dto.dart index 0c1fa03b6..a19a95f61 100644 --- a/lib/dto/ethereum/pending_eth_tx_dto.dart +++ b/lib/dto/ethereum/pending_eth_tx_dto.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + /// blockHash : null /// blockNumber : null /// from : "0x..." diff --git a/lib/electrumx_rpc/cached_electrumx.dart b/lib/electrumx_rpc/cached_electrumx.dart index 2aab533f8..c3e6a9248 100644 --- a/lib/electrumx_rpc/cached_electrumx.dart +++ b/lib/electrumx_rpc/cached_electrumx.dart @@ -1,46 +1,36 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/electrumx_rpc/electrumx.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; -import 'package:stackwallet/utilities/prefs.dart'; import 'package:string_validator/string_validator.dart'; class CachedElectrumX { - final ElectrumX? electrumXClient; - - final String server; - final int port; - final bool useSSL; - - final Prefs prefs; - final List failovers; + final ElectrumX electrumXClient; static const minCacheConfirms = 30; const CachedElectrumX({ - required this.server, - required this.port, - required this.useSSL, - required this.prefs, - required this.failovers, - this.electrumXClient, + required this.electrumXClient, }); factory CachedElectrumX.from({ - required ElectrumXNode node, - required Prefs prefs, - required List failovers, - ElectrumX? electrumXClient, + required ElectrumX electrumXClient, }) => CachedElectrumX( - server: node.address, - port: node.port, - useSSL: node.useSSL, - prefs: prefs, - failovers: failovers, - electrumXClient: electrumXClient); + electrumXClient: electrumXClient, + ); Future> getAnonymitySet({ required String groupId, @@ -66,16 +56,7 @@ class CachedElectrumX { set = Map.from(cachedSet); } - final client = electrumXClient ?? - ElectrumX( - host: server, - port: port, - useSSL: useSSL, - prefs: prefs, - failovers: failovers, - ); - - final newSet = await client.getAnonymitySet( + final newSet = await electrumXClient.getAnonymitySet( groupId: groupId, blockhash: set["blockHash"] as String, ); @@ -152,16 +133,8 @@ class CachedElectrumX { final cachedTx = DB.instance.get( boxName: DB.instance.boxNameTxCache(coin: coin), key: txHash) as Map?; if (cachedTx == null) { - final client = electrumXClient ?? - ElectrumX( - host: server, - port: port, - useSSL: useSSL, - prefs: prefs, - failovers: failovers, - ); - final Map result = - await client.getTransaction(txHash: txHash, verbose: verbose); + final Map result = await electrumXClient + .getTransaction(txHash: txHash, verbose: verbose); result.remove("hex"); result.remove("lelantusData"); @@ -202,16 +175,8 @@ class CachedElectrumX { final startNumber = cachedSerials.length; - final client = electrumXClient ?? - ElectrumX( - host: server, - port: port, - useSSL: useSSL, - prefs: prefs, - failovers: failovers, - ); - - final serials = await client.getUsedCoinSerials(startNumber: startNumber); + final serials = + await electrumXClient.getUsedCoinSerials(startNumber: startNumber); List newSerials = []; for (final element in (serials["serials"] as List)) { diff --git a/lib/electrumx_rpc/electrumx.dart b/lib/electrumx_rpc/electrumx.dart index 6667c3de5..fd48c07ba 100644 --- a/lib/electrumx_rpc/electrumx.dart +++ b/lib/electrumx_rpc/electrumx.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:io'; @@ -132,8 +142,12 @@ class ElectrumX { final response = await _rpcClient!.request(jsonRequestString); - if (response["error"] != null) { - if (response["error"] + if (response.exception != null) { + throw response.exception!; + } + + if (response.data["error"] != null) { + if (response.data["error"] .toString() .contains("No such mempool or blockchain transaction")) { throw NoSuchTransactionException( @@ -143,11 +157,15 @@ class ElectrumX { } throw Exception( - "JSONRPC response \ncommand: $command \nargs: $args \nerror: $response"); + "JSONRPC response\n" + " command: $command\n" + " args: $args\n" + " error: $response.data", + ); } currentFailoverIndex = -1; - return response; + return response.data; } on WifiOnlyException { rethrow; } on SocketException { @@ -228,7 +246,13 @@ class ElectrumX { // Logging.instance.log("batch request: $request"); // send batch request - final response = (await _rpcClient!.request(request)) as List; + final jsonRpcResponse = (await _rpcClient!.request(request)); + + if (jsonRpcResponse.exception != null) { + throw jsonRpcResponse.exception!; + } + + final response = jsonRpcResponse.data as List; // check for errors, format and throw if there are any final List errors = []; @@ -310,6 +334,13 @@ class ElectrumX { requestID: requestID, command: 'blockchain.headers.subscribe', ); + if (response["result"] == null) { + Logging.instance.log( + "getBlockHeadTip returned null response", + level: LogLevel.Error, + ); + throw 'getBlockHeadTip returned null response'; + } return Map.from(response["result"] as Map); } catch (e) { rethrow; @@ -546,8 +577,9 @@ class ElectrumX { bool verbose = true, String? requestID, }) async { + dynamic response; try { - final response = await request( + response = await request( requestID: requestID, command: 'blockchain.transaction.get', args: [ @@ -561,6 +593,10 @@ class ElectrumX { return Map.from(response["result"] as Map); } catch (e) { + Logging.instance.log( + "getTransaction($txHash) response: $response", + level: LogLevel.Error, + ); rethrow; } } diff --git a/lib/electrumx_rpc/rpc.dart b/lib/electrumx_rpc/rpc.dart index 3510e4113..0c3834ae8 100644 --- a/lib/electrumx_rpc/rpc.dart +++ b/lib/electrumx_rpc/rpc.dart @@ -1,10 +1,22 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'package:flutter/foundation.dart'; +import 'package:mutex/mutex.dart'; import 'package:stackwallet/utilities/logger.dart'; -// hacky fix to receive large jsonrpc responses +// Json RPC class to handle connecting to electrumx servers class JsonRPC { JsonRPC({ required this.host, @@ -12,65 +24,267 @@ class JsonRPC { this.useSSL = false, this.connectionTimeout = const Duration(seconds: 60), }); - bool useSSL; - String host; - int port; - Duration connectionTimeout; + final bool useSSL; + final String host; + final int port; + final Duration connectionTimeout; - Future request(String jsonRpcRequest) async { - Socket? socket; - final completer = Completer(); - final List responseData = []; + final _requestMutex = Mutex(); + final _JsonRPCRequestQueue _requestQueue = _JsonRPCRequestQueue(); + Socket? _socket; + StreamSubscription? _subscription; - void dataHandler(List data) { - responseData.addAll(data); + void _dataHandler(List data) { + _requestQueue.nextIncompleteReq.then((req) { + if (req != null) { + req.appendDataAndCheckIfComplete(data); - // 0x0A is newline - // https://electrumx-spesmilo.readthedocs.io/en/latest/protocol-basics.html - if (data.last == 0x0A) { - try { - final response = json.decode(String.fromCharCodes(responseData)); - completer.complete(response); - } catch (e, s) { - Logging.instance - .log("JsonRPC json.decode: $e\n$s", level: LogLevel.Error); - completer.completeError(e, s); - } finally { - socket?.destroy(); + if (req.isComplete) { + _onReqCompleted(req); } + } else { + Logging.instance.log( + "_dataHandler found a null req!", + level: LogLevel.Warning, + ); } - } + }); + } - void errorHandler(Object error, StackTrace trace) { - Logging.instance - .log("JsonRPC errorHandler: $error\n$trace", level: LogLevel.Error); - completer.completeError(error, trace); - socket?.destroy(); - } + void _errorHandler(Object error, StackTrace trace) { + _requestQueue.nextIncompleteReq.then((req) { + if (req != null) { + req.completer.completeError(error, trace); + _onReqCompleted(req); + } + }); + } - void doneHandler() { - socket?.destroy(); + void _doneHandler() { + disconnect(reason: "JsonRPC _doneHandler() called"); + } + + void _onReqCompleted(_JsonRPCRequest req) { + _requestQueue.remove(req).then((_) { + // attempt to send next request + _sendNextAvailableRequest(); + }); + } + + void _sendNextAvailableRequest() { + _requestQueue.nextIncompleteReq.then((req) { + if (req != null) { + // \r\n required by electrumx server + _socket!.write('${req.jsonRequest}\r\n'); + + // TODO different timeout length? + req.initiateTimeout( + const Duration(seconds: 10), + onTimedOut: () { + _requestQueue.remove(req); + }, + ); + } + }); + } + + Future request(String jsonRpcRequest) async { + await _requestMutex.protect(() async { + if (_socket == null) { + Logging.instance.log( + "JsonRPC request: opening socket $host:$port", + level: LogLevel.Info, + ); + await connect(); + } + }); + + final req = _JsonRPCRequest( + jsonRequest: jsonRpcRequest, + completer: Completer(), + ); + + final future = req.completer.future.onError( + (error, stackTrace) async { + await disconnect( + reason: "return req.completer.future.onError: $error\n$stackTrace", + ); + return JsonRPCResponse( + exception: error is Exception + ? error + : Exception( + "req.completer.future.onError: $error\n$stackTrace", + ), + ); + }, + ); + + // if this is the only/first request then send it right away + await _requestQueue.add( + req, + onInitialRequestAdded: _sendNextAvailableRequest, + ); + + return future; + } + + Future disconnect({required String reason}) async { + await _requestMutex.protect(() async { + await _subscription?.cancel(); + _subscription = null; + _socket?.destroy(); + _socket = null; + + // clean up remaining queue + await _requestQueue.completeRemainingWithError( + "JsonRPC disconnect() called with reason: \"$reason\"", + ); + }); + } + + Future connect() async { + if (_socket != null) { + throw Exception( + "JsonRPC attempted to connect to an already existing socket!", + ); } if (useSSL) { - await SecureSocket.connect(host, port, - timeout: connectionTimeout, - onBadCertificate: (_) => true).then((Socket sock) { - socket = sock; - socket?.listen(dataHandler, - onError: errorHandler, onDone: doneHandler, cancelOnError: true); - }); + _socket = await SecureSocket.connect( + host, + port, + timeout: connectionTimeout, + onBadCertificate: (_) => true, + ); // TODO do not automatically trust bad certificates } else { - await Socket.connect(host, port, timeout: connectionTimeout) - .then((Socket sock) { - socket = sock; - socket?.listen(dataHandler, - onError: errorHandler, onDone: doneHandler, cancelOnError: true); - }); + _socket = await Socket.connect( + host, + port, + timeout: connectionTimeout, + ); } - socket?.write('$jsonRpcRequest\r\n'); - - return completer.future; + _subscription = _socket!.listen( + _dataHandler, + onError: _errorHandler, + onDone: _doneHandler, + cancelOnError: true, + ); } } + +class _JsonRPCRequestQueue { + final _lock = Mutex(); + final List<_JsonRPCRequest> _rq = []; + + Future add( + _JsonRPCRequest req, { + VoidCallback? onInitialRequestAdded, + }) async { + return await _lock.protect(() async { + _rq.add(req); + if (_rq.length == 1) { + onInitialRequestAdded?.call(); + } + }); + } + + Future remove(_JsonRPCRequest req) async { + return await _lock.protect(() async { + final result = _rq.remove(req); + return result; + }); + } + + Future<_JsonRPCRequest?> get nextIncompleteReq async { + return await _lock.protect(() async { + int removeCount = 0; + _JsonRPCRequest? returnValue; + for (final req in _rq) { + if (req.isComplete) { + removeCount++; + } else { + returnValue = req; + break; + } + } + + _rq.removeRange(0, removeCount); + + return returnValue; + }); + } + + Future completeRemainingWithError( + String error, { + StackTrace? stackTrace, + }) async { + await _lock.protect(() async { + for (final req in _rq) { + if (!req.isComplete) { + req.completer.completeError(Exception(error), stackTrace); + } + } + _rq.clear(); + }); + } + + Future get isEmpty async { + return await _lock.protect(() async { + return _rq.isEmpty; + }); + } +} + +class _JsonRPCRequest { + // 0x0A is newline + // https://electrumx-spesmilo.readthedocs.io/en/latest/protocol-basics.html + static const int separatorByte = 0x0A; + + final String jsonRequest; + final Completer completer; + final List _responseData = []; + + _JsonRPCRequest({required this.jsonRequest, required this.completer}); + + void appendDataAndCheckIfComplete(List data) { + _responseData.addAll(data); + if (data.last == separatorByte) { + try { + final response = json.decode(String.fromCharCodes(_responseData)); + completer.complete(JsonRPCResponse(data: response)); + } catch (e, s) { + Logging.instance.log( + "JsonRPC json.decode: $e\n$s", + level: LogLevel.Error, + ); + completer.completeError(e, s); + } + } + } + + void initiateTimeout( + Duration timeout, { + VoidCallback? onTimedOut, + }) { + Future.delayed(timeout).then((_) { + if (!isComplete) { + try { + throw Exception("_JsonRPCRequest timed out: $jsonRequest"); + } catch (e, s) { + completer.completeError(e, s); + onTimedOut?.call(); + } + } + }); + } + + bool get isComplete => completer.isCompleted; +} + +class JsonRPCResponse { + final dynamic data; + final Exception? exception; + + JsonRPCResponse({this.data, this.exception}); +} diff --git a/lib/electrumx_rpc/subscribable_electrumx.dart b/lib/electrumx_rpc/subscribable_electrumx.dart index be0f638a4..4720e345b 100644 --- a/lib/electrumx_rpc/subscribable_electrumx.dart +++ b/lib/electrumx_rpc/subscribable_electrumx.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/lib/exceptions/address/address_exception.dart b/lib/exceptions/address/address_exception.dart index 3331bef99..073dc72a3 100644 --- a/lib/exceptions/address/address_exception.dart +++ b/lib/exceptions/address/address_exception.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/sw_exception.dart'; class AddressException extends SWException { diff --git a/lib/exceptions/electrumx/no_such_transaction.dart b/lib/exceptions/electrumx/no_such_transaction.dart index 0c7bedeae..b74fae29a 100644 --- a/lib/exceptions/electrumx/no_such_transaction.dart +++ b/lib/exceptions/electrumx/no_such_transaction.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/sw_exception.dart'; class NoSuchTransactionException extends SWException { diff --git a/lib/exceptions/exchange/exchange_exception.dart b/lib/exceptions/exchange/exchange_exception.dart index c68599321..c383c27da 100644 --- a/lib/exceptions/exchange/exchange_exception.dart +++ b/lib/exceptions/exchange/exchange_exception.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/sw_exception.dart'; enum ExchangeExceptionType { generic, serializeResponseError, orderNotFound } diff --git a/lib/exceptions/exchange/majestic_bank/mb_exception.dart b/lib/exceptions/exchange/majestic_bank/mb_exception.dart index d3130d874..00b2ad6f8 100644 --- a/lib/exceptions/exchange/majestic_bank/mb_exception.dart +++ b/lib/exceptions/exchange/majestic_bank/mb_exception.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/exchange/exchange_exception.dart'; class MBException extends ExchangeException { diff --git a/lib/exceptions/exchange/pair_unavailable_exception.dart b/lib/exceptions/exchange/pair_unavailable_exception.dart index 9c9ee5a5c..ecb1e66f4 100644 --- a/lib/exceptions/exchange/pair_unavailable_exception.dart +++ b/lib/exceptions/exchange/pair_unavailable_exception.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/exchange/exchange_exception.dart'; class PairUnavailableException extends ExchangeException { diff --git a/lib/exceptions/exchange/unsupported_currency_exception.dart b/lib/exceptions/exchange/unsupported_currency_exception.dart index 9e4430de8..38e1c2cad 100644 --- a/lib/exceptions/exchange/unsupported_currency_exception.dart +++ b/lib/exceptions/exchange/unsupported_currency_exception.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/exchange/exchange_exception.dart'; class UnsupportedCurrencyException extends ExchangeException { diff --git a/lib/exceptions/main_db/main_db_exception.dart b/lib/exceptions/main_db/main_db_exception.dart index 4285060ba..65bfc5987 100644 --- a/lib/exceptions/main_db/main_db_exception.dart +++ b/lib/exceptions/main_db/main_db_exception.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/sw_exception.dart'; class MainDBException extends SWException { diff --git a/lib/exceptions/sw_exception.dart b/lib/exceptions/sw_exception.dart index 34ab664f2..dfba11efc 100644 --- a/lib/exceptions/sw_exception.dart +++ b/lib/exceptions/sw_exception.dart @@ -1,7 +1,17 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // generic stack wallet exception which all other custom exceptions should // extend from -class SWException with Exception { +class SWException implements Exception { SWException(this.message); final String message; diff --git a/lib/exceptions/wallet/insufficient_balance_exception.dart b/lib/exceptions/wallet/insufficient_balance_exception.dart index 219ef6a76..d03572c4a 100644 --- a/lib/exceptions/wallet/insufficient_balance_exception.dart +++ b/lib/exceptions/wallet/insufficient_balance_exception.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/sw_exception.dart'; class InsufficientBalanceException extends SWException { diff --git a/lib/exceptions/wallet/paynym_send_exception.dart b/lib/exceptions/wallet/paynym_send_exception.dart index 9980e6790..bdbd47f6b 100644 --- a/lib/exceptions/wallet/paynym_send_exception.dart +++ b/lib/exceptions/wallet/paynym_send_exception.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/sw_exception.dart'; class PaynymSendException extends SWException { diff --git a/lib/main.dart b/lib/main.dart index 8fa870214..852ffc9c0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; import 'dart:math'; @@ -178,7 +188,9 @@ void main() async { } } - monero.onStartup(); + if (!Platform.isWindows) { + monero.onStartup(); + } if (!Platform.isLinux && !Platform.isWindows) { wownero.onStartup(); } @@ -193,6 +205,27 @@ void main() async { // check and update or install default themes await ThemeService.instance.checkDefaultThemesOnStartup(); + // verify current user preference theme and revert to default + // if problems are found to prevent app being unusable + if (!(await ThemeService.instance + .verifyInstalled(themeId: Prefs.instance.themeId))) { + Prefs.instance.themeId = "light"; + } + + // verify current user preference light brightness theme and revert to default + // if problems are found to prevent app being unusable + if (!(await ThemeService.instance + .verifyInstalled(themeId: Prefs.instance.systemBrightnessLightThemeId))) { + Prefs.instance.systemBrightnessLightThemeId = "light"; + } + + // verify current user preference dark brightness theme and revert to default + // if problems are found to prevent app being unusable + if (!(await ThemeService.instance + .verifyInstalled(themeId: Prefs.instance.systemBrightnessDarkThemeId))) { + Prefs.instance.systemBrightnessDarkThemeId = "dark"; + } + runApp(const ProviderScope(child: MyApp())); } diff --git a/lib/models/add_wallet_list_entity/add_wallet_list_entity.dart b/lib/models/add_wallet_list_entity/add_wallet_list_entity.dart index 3dd24d7b1..f59725f6b 100644 --- a/lib/models/add_wallet_list_entity/add_wallet_list_entity.dart +++ b/lib/models/add_wallet_list_entity/add_wallet_list_entity.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:equatable/equatable.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/models/add_wallet_list_entity/sub_classes/coin_entity.dart b/lib/models/add_wallet_list_entity/sub_classes/coin_entity.dart index 770a9d1cf..10e78688f 100644 --- a/lib/models/add_wallet_list_entity/sub_classes/coin_entity.dart +++ b/lib/models/add_wallet_list_entity/sub_classes/coin_entity.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/add_wallet_list_entity/add_wallet_list_entity.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/models/add_wallet_list_entity/sub_classes/eth_token_entity.dart b/lib/models/add_wallet_list_entity/sub_classes/eth_token_entity.dart index ccc0da239..000bc810f 100644 --- a/lib/models/add_wallet_list_entity/sub_classes/eth_token_entity.dart +++ b/lib/models/add_wallet_list_entity/sub_classes/eth_token_entity.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/add_wallet_list_entity/add_wallet_list_entity.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/models/address_book_filter.dart b/lib/models/address_book_filter.dart index bce445c20..578ffc8c9 100644 --- a/lib/models/address_book_filter.dart +++ b/lib/models/address_book_filter.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/models/balance.dart b/lib/models/balance.dart index 63fbe9ab7..a77e87834 100644 --- a/lib/models/balance.dart +++ b/lib/models/balance.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:stackwallet/utilities/amount/amount.dart'; diff --git a/lib/models/buy/buy_form_state.dart b/lib/models/buy/buy_form_state.dart index 843262eb3..edc1b482f 100644 --- a/lib/models/buy/buy_form_state.dart +++ b/lib/models/buy/buy_form_state.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:stackwallet/services/buy/buy.dart'; diff --git a/lib/models/buy/response_objects/crypto.dart b/lib/models/buy/response_objects/crypto.dart index d3f3aded0..b45dc8f29 100644 --- a/lib/models/buy/response_objects/crypto.dart +++ b/lib/models/buy/response_objects/crypto.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class Crypto { /// Crypto ticker final String ticker; diff --git a/lib/models/buy/response_objects/fiat.dart b/lib/models/buy/response_objects/fiat.dart index 00cb0f945..f8a425836 100644 --- a/lib/models/buy/response_objects/fiat.dart +++ b/lib/models/buy/response_objects/fiat.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; class Fiat { diff --git a/lib/models/buy/response_objects/order.dart b/lib/models/buy/response_objects/order.dart index 3802dd1cc..44e385c9e 100644 --- a/lib/models/buy/response_objects/order.dart +++ b/lib/models/buy/response_objects/order.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/buy/response_objects/quote.dart'; class SimplexOrder { diff --git a/lib/models/buy/response_objects/quote.dart b/lib/models/buy/response_objects/quote.dart index e91ca4d67..6eb846d14 100644 --- a/lib/models/buy/response_objects/quote.dart +++ b/lib/models/buy/response_objects/quote.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/buy/response_objects/crypto.dart'; import 'package:stackwallet/models/buy/response_objects/fiat.dart'; diff --git a/lib/models/buy/simplex/simplex.dart b/lib/models/buy/simplex/simplex.dart index bb75036ab..4b959377b 100644 --- a/lib/models/buy/simplex/simplex.dart +++ b/lib/models/buy/simplex/simplex.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/buy/response_objects/crypto.dart'; import 'package:stackwallet/models/buy/response_objects/fiat.dart'; diff --git a/lib/models/contact.dart b/lib/models/contact.dart index 37961476a..239680fd7 100644 --- a/lib/models/contact.dart +++ b/lib/models/contact.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:stackwallet/models/contact_address_entry.dart'; diff --git a/lib/models/contact_address_entry.dart b/lib/models/contact_address_entry.dart index d917b47c0..6f1ad1d54 100644 --- a/lib/models/contact_address_entry.dart +++ b/lib/models/contact_address_entry.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/models/contact_address_entry_data.dart b/lib/models/contact_address_entry_data.dart index b67299a3e..d7fb17684 100644 --- a/lib/models/contact_address_entry_data.dart +++ b/lib/models/contact_address_entry_data.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:stackwallet/models/isar/models/contact_entry.dart'; import 'package:stackwallet/utilities/address_utils.dart'; diff --git a/lib/models/epicbox_config_model.dart b/lib/models/epicbox_config_model.dart index 7927fd165..5c3509c12 100644 --- a/lib/models/epicbox_config_model.dart +++ b/lib/models/epicbox_config_model.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:hive/hive.dart'; diff --git a/lib/models/epicbox_server_model.dart b/lib/models/epicbox_server_model.dart index 8bb431348..ec8f6cd8e 100644 --- a/lib/models/epicbox_server_model.dart +++ b/lib/models/epicbox_server_model.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; part 'type_adaptors/epicbox_server_model.g.dart'; diff --git a/lib/models/exchange/active_pair.dart b/lib/models/exchange/active_pair.dart index 4a2e80eba..56e348d11 100644 --- a/lib/models/exchange/active_pair.dart +++ b/lib/models/exchange/active_pair.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:stackwallet/models/exchange/aggregate_currency.dart'; diff --git a/lib/models/exchange/aggregate_currency.dart b/lib/models/exchange/aggregate_currency.dart index 1bbc767a5..cad2708e9 100644 --- a/lib/models/exchange/aggregate_currency.dart +++ b/lib/models/exchange/aggregate_currency.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/isar/exchange_cache/currency.dart'; import 'package:stackwallet/models/isar/exchange_cache/pair.dart'; import 'package:tuple/tuple.dart'; diff --git a/lib/models/exchange/change_now/cn_exchange_estimate.dart b/lib/models/exchange/change_now/cn_exchange_estimate.dart index d20606865..08d96d2dd 100644 --- a/lib/models/exchange/change_now/cn_exchange_estimate.dart +++ b/lib/models/exchange/change_now/cn_exchange_estimate.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/models/exchange/change_now/estimated_exchange_amount.dart b/lib/models/exchange/change_now/estimated_exchange_amount.dart index dccf6b3b3..03b8da4cf 100644 --- a/lib/models/exchange/change_now/estimated_exchange_amount.dart +++ b/lib/models/exchange/change_now/estimated_exchange_amount.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/models/exchange/change_now/exchange_transaction.dart b/lib/models/exchange/change_now/exchange_transaction.dart index 233c242c9..e1d6a41ed 100644 --- a/lib/models/exchange/change_now/exchange_transaction.dart +++ b/lib/models/exchange/change_now/exchange_transaction.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:hive/hive.dart'; import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'; diff --git a/lib/models/exchange/change_now/exchange_transaction_status.dart b/lib/models/exchange/change_now/exchange_transaction_status.dart index bb50d60f2..cd337fb81 100644 --- a/lib/models/exchange/change_now/exchange_transaction_status.dart +++ b/lib/models/exchange/change_now/exchange_transaction_status.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/models/exchange/incomplete_exchange.dart b/lib/models/exchange/incomplete_exchange.dart index 2680b24e0..7ca7bfe09 100644 --- a/lib/models/exchange/incomplete_exchange.dart +++ b/lib/models/exchange/incomplete_exchange.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:flutter/foundation.dart'; import 'package:stackwallet/models/exchange/response_objects/estimate.dart'; diff --git a/lib/models/exchange/majestic_bank/mb_limit.dart b/lib/models/exchange/majestic_bank/mb_limit.dart index baa002d56..a549b3b39 100644 --- a/lib/models/exchange/majestic_bank/mb_limit.dart +++ b/lib/models/exchange/majestic_bank/mb_limit.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/exchange/majestic_bank/mb_object.dart'; diff --git a/lib/models/exchange/majestic_bank/mb_object.dart b/lib/models/exchange/majestic_bank/mb_object.dart index e3810131c..1333a7604 100644 --- a/lib/models/exchange/majestic_bank/mb_object.dart +++ b/lib/models/exchange/majestic_bank/mb_object.dart @@ -1 +1,11 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + abstract class MBObject {} diff --git a/lib/models/exchange/majestic_bank/mb_order.dart b/lib/models/exchange/majestic_bank/mb_order.dart index f5dde038e..8361c63db 100644 --- a/lib/models/exchange/majestic_bank/mb_order.dart +++ b/lib/models/exchange/majestic_bank/mb_order.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/exchange/majestic_bank/mb_object.dart'; diff --git a/lib/models/exchange/majestic_bank/mb_order_calculation.dart b/lib/models/exchange/majestic_bank/mb_order_calculation.dart index 931ca440f..4ac6711f0 100644 --- a/lib/models/exchange/majestic_bank/mb_order_calculation.dart +++ b/lib/models/exchange/majestic_bank/mb_order_calculation.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/exchange/majestic_bank/mb_object.dart'; diff --git a/lib/models/exchange/majestic_bank/mb_order_status.dart b/lib/models/exchange/majestic_bank/mb_order_status.dart index 030fe1ddf..7dbb274cc 100644 --- a/lib/models/exchange/majestic_bank/mb_order_status.dart +++ b/lib/models/exchange/majestic_bank/mb_order_status.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/exchange/majestic_bank/mb_object.dart'; diff --git a/lib/models/exchange/majestic_bank/mb_rate.dart b/lib/models/exchange/majestic_bank/mb_rate.dart index 60d71cdf0..2702a359d 100644 --- a/lib/models/exchange/majestic_bank/mb_rate.dart +++ b/lib/models/exchange/majestic_bank/mb_rate.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/exchange/majestic_bank/mb_object.dart'; diff --git a/lib/models/exchange/response_objects/estimate.dart b/lib/models/exchange/response_objects/estimate.dart index 9284c8340..ef48e5850 100644 --- a/lib/models/exchange/response_objects/estimate.dart +++ b/lib/models/exchange/response_objects/estimate.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/models/exchange/response_objects/fixed_rate_market.dart b/lib/models/exchange/response_objects/fixed_rate_market.dart index 7e2b363c9..6b2c8dc3e 100644 --- a/lib/models/exchange/response_objects/fixed_rate_market.dart +++ b/lib/models/exchange/response_objects/fixed_rate_market.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/models/exchange/response_objects/range.dart b/lib/models/exchange/response_objects/range.dart index 715a3ecce..9c30887a9 100644 --- a/lib/models/exchange/response_objects/range.dart +++ b/lib/models/exchange/response_objects/range.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; class Range { diff --git a/lib/models/exchange/response_objects/trade.dart b/lib/models/exchange/response_objects/trade.dart index 7fc019aa9..5f52183a3 100644 --- a/lib/models/exchange/response_objects/trade.dart +++ b/lib/models/exchange/response_objects/trade.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'; import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart'; diff --git a/lib/models/exchange/simpleswap/sp_currency.dart b/lib/models/exchange/simpleswap/sp_currency.dart index 5aabc20d4..f45a80332 100644 --- a/lib/models/exchange/simpleswap/sp_currency.dart +++ b/lib/models/exchange/simpleswap/sp_currency.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/logger.dart'; class SPCurrency { diff --git a/lib/models/isar/exchange_cache/currency.dart b/lib/models/isar/exchange_cache/currency.dart index 1744f9350..5a3915e08 100644 --- a/lib/models/isar/exchange_cache/currency.dart +++ b/lib/models/isar/exchange_cache/currency.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; import 'package:stackwallet/models/isar/exchange_cache/pair.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/models/isar/exchange_cache/pair.dart b/lib/models/isar/exchange_cache/pair.dart index 4d7ebe8e8..4630a192e 100644 --- a/lib/models/isar/exchange_cache/pair.dart +++ b/lib/models/isar/exchange_cache/pair.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; part 'pair.g.dart'; diff --git a/lib/models/isar/models/address_label.dart b/lib/models/isar/models/address_label.dart index 9988c83c0..ebee66369 100644 --- a/lib/models/isar/models/address_label.dart +++ b/lib/models/isar/models/address_label.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; part 'address_label.g.dart'; diff --git a/lib/models/isar/models/block_explorer.dart b/lib/models/isar/models/block_explorer.dart index cf01fa5e2..05d832580 100644 --- a/lib/models/isar/models/block_explorer.dart +++ b/lib/models/isar/models/block_explorer.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/models/isar/models/blockchain_data/address.dart b/lib/models/isar/models/blockchain_data/address.dart index 25281a629..028bee04a 100644 --- a/lib/models/isar/models/blockchain_data/address.dart +++ b/lib/models/isar/models/blockchain_data/address.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:isar/isar.dart'; @@ -123,7 +133,9 @@ enum AddressType { mimbleWimble, unknown, nonWallet, - ethereum; + ethereum, + nano, + banano; String get readableName { switch (this) { @@ -143,6 +155,10 @@ enum AddressType { return "Non wallet/unknown"; case AddressType.ethereum: return "Ethereum"; + case AddressType.nano: + return "Nano"; + case AddressType.banano: + return "Banano"; } } } diff --git a/lib/models/isar/models/blockchain_data/address.g.dart b/lib/models/isar/models/blockchain_data/address.g.dart index 49188b395..356904d2c 100644 --- a/lib/models/isar/models/blockchain_data/address.g.dart +++ b/lib/models/isar/models/blockchain_data/address.g.dart @@ -261,6 +261,8 @@ const _AddresstypeEnumValueMap = { 'unknown': 5, 'nonWallet': 6, 'ethereum': 7, + 'nano': 8, + 'banano': 9, }; const _AddresstypeValueEnumMap = { 0: AddressType.p2pkh, @@ -271,6 +273,8 @@ const _AddresstypeValueEnumMap = { 5: AddressType.unknown, 6: AddressType.nonWallet, 7: AddressType.ethereum, + 8: AddressType.nano, + 9: AddressType.banano, }; Id _addressGetId(Address object) { diff --git a/lib/models/isar/models/blockchain_data/crypto_currency_address.dart b/lib/models/isar/models/blockchain_data/crypto_currency_address.dart index 4c8670a30..65940316a 100644 --- a/lib/models/isar/models/blockchain_data/crypto_currency_address.dart +++ b/lib/models/isar/models/blockchain_data/crypto_currency_address.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + abstract class CryptoCurrencyAddress { // future use? } diff --git a/lib/models/isar/models/blockchain_data/input.dart b/lib/models/isar/models/blockchain_data/input.dart index c97cff73d..e816a5596 100644 --- a/lib/models/isar/models/blockchain_data/input.dart +++ b/lib/models/isar/models/blockchain_data/input.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:isar/isar.dart'; diff --git a/lib/models/isar/models/blockchain_data/output.dart b/lib/models/isar/models/blockchain_data/output.dart index 959fc37a2..f544e9911 100644 --- a/lib/models/isar/models/blockchain_data/output.dart +++ b/lib/models/isar/models/blockchain_data/output.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:isar/isar.dart'; diff --git a/lib/models/isar/models/blockchain_data/transaction.dart b/lib/models/isar/models/blockchain_data/transaction.dart index 39d2cc0af..5b32142c2 100644 --- a/lib/models/isar/models/blockchain_data/transaction.dart +++ b/lib/models/isar/models/blockchain_data/transaction.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:math'; @@ -12,6 +22,7 @@ part 'transaction.g.dart'; @Collection() class Transaction { + Transaction({ required this.walletId, required this.txid, @@ -29,6 +40,7 @@ class Transaction { required this.inputs, required this.outputs, required this.nonce, + required this.numberOfMessages, }); Tuple2 copyWith({ @@ -50,6 +62,7 @@ class Transaction { int? nonce, Id? id, Address? address, + int? numberOfMessages, }) { return Tuple2( Transaction( @@ -68,7 +81,8 @@ class Transaction { otherData: otherData ?? this.otherData, nonce: nonce ?? this.nonce, inputs: inputs ?? this.inputs, - outputs: outputs ?? this.outputs) + outputs: outputs ?? this.outputs, + numberOfMessages: numberOfMessages ?? this.numberOfMessages) ..id = id ?? this.id, address ?? this.address.value, ); @@ -114,6 +128,8 @@ class Transaction { late final List outputs; + late final int? numberOfMessages; + @Backlink(to: "transactions") final address = IsarLink
(); @@ -154,6 +170,7 @@ class Transaction { "address: ${address.value}, " "inputsLength: ${inputs.length}, " "outputsLength: ${outputs.length}, " + "numberOfMessages: $numberOfMessages, " "}"; String toJsonString() { @@ -175,6 +192,7 @@ class Transaction { "address": address.value?.toJsonString(), "inputs": inputs.map((e) => e.toJsonString()).toList(), "outputs": outputs.map((e) => e.toJsonString()).toList(), + "numberOfMessages": numberOfMessages, }; return jsonEncode(result); } @@ -205,6 +223,7 @@ class Transaction { outputs: List.from(json["outputs"] as List) .map((e) => Output.fromJsonString(e)) .toList(), + numberOfMessages: json["numberOfMessages"] as int, ); if (json["address"] == null) { return Tuple2(transaction, null); diff --git a/lib/models/isar/models/blockchain_data/transaction.g.dart b/lib/models/isar/models/blockchain_data/transaction.g.dart index 74a5a1652..c11649ddb 100644 --- a/lib/models/isar/models/blockchain_data/transaction.g.dart +++ b/lib/models/isar/models/blockchain_data/transaction.g.dart @@ -58,46 +58,51 @@ const TransactionSchema = CollectionSchema( name: r'nonce', type: IsarType.long, ), - r'otherData': PropertySchema( + r'numberOfMessages': PropertySchema( id: 8, + name: r'numberOfMessages', + type: IsarType.long, + ), + r'otherData': PropertySchema( + id: 9, name: r'otherData', type: IsarType.string, ), r'outputs': PropertySchema( - id: 9, + id: 10, name: r'outputs', type: IsarType.objectList, target: r'Output', ), r'slateId': PropertySchema( - id: 10, + id: 11, name: r'slateId', type: IsarType.string, ), r'subType': PropertySchema( - id: 11, + id: 12, name: r'subType', type: IsarType.byte, enumMap: _TransactionsubTypeEnumValueMap, ), r'timestamp': PropertySchema( - id: 12, + id: 13, name: r'timestamp', type: IsarType.long, ), r'txid': PropertySchema( - id: 13, + id: 14, name: r'txid', type: IsarType.string, ), r'type': PropertySchema( - id: 14, + id: 15, name: r'type', type: IsarType.byte, enumMap: _TransactiontypeEnumValueMap, ), r'walletId': PropertySchema( - id: 15, + id: 16, name: r'walletId', type: IsarType.string, ) @@ -233,19 +238,20 @@ void _transactionSerialize( writer.writeBool(offsets[5], object.isCancelled); writer.writeBool(offsets[6], object.isLelantus); writer.writeLong(offsets[7], object.nonce); - writer.writeString(offsets[8], object.otherData); + writer.writeLong(offsets[8], object.numberOfMessages); + writer.writeString(offsets[9], object.otherData); writer.writeObjectList( - offsets[9], + offsets[10], allOffsets, OutputSchema.serialize, object.outputs, ); - writer.writeString(offsets[10], object.slateId); - writer.writeByte(offsets[11], object.subType.index); - writer.writeLong(offsets[12], object.timestamp); - writer.writeString(offsets[13], object.txid); - writer.writeByte(offsets[14], object.type.index); - writer.writeString(offsets[15], object.walletId); + writer.writeString(offsets[11], object.slateId); + writer.writeByte(offsets[12], object.subType.index); + writer.writeLong(offsets[13], object.timestamp); + writer.writeString(offsets[14], object.txid); + writer.writeByte(offsets[15], object.type.index); + writer.writeString(offsets[16], object.walletId); } Transaction _transactionDeserialize( @@ -269,23 +275,24 @@ Transaction _transactionDeserialize( isCancelled: reader.readBool(offsets[5]), isLelantus: reader.readBoolOrNull(offsets[6]), nonce: reader.readLongOrNull(offsets[7]), - otherData: reader.readStringOrNull(offsets[8]), + numberOfMessages: reader.readLongOrNull(offsets[8]), + otherData: reader.readStringOrNull(offsets[9]), outputs: reader.readObjectList( - offsets[9], + offsets[10], OutputSchema.deserialize, allOffsets, Output(), ) ?? [], - slateId: reader.readStringOrNull(offsets[10]), + slateId: reader.readStringOrNull(offsets[11]), subType: - _TransactionsubTypeValueEnumMap[reader.readByteOrNull(offsets[11])] ?? + _TransactionsubTypeValueEnumMap[reader.readByteOrNull(offsets[12])] ?? TransactionSubType.none, - timestamp: reader.readLong(offsets[12]), - txid: reader.readString(offsets[13]), - type: _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[14])] ?? + timestamp: reader.readLong(offsets[13]), + txid: reader.readString(offsets[14]), + type: _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[15])] ?? TransactionType.outgoing, - walletId: reader.readString(offsets[15]), + walletId: reader.readString(offsets[16]), ); object.id = id; return object; @@ -321,8 +328,10 @@ P _transactionDeserializeProp

( case 7: return (reader.readLongOrNull(offset)) as P; case 8: - return (reader.readStringOrNull(offset)) as P; + return (reader.readLongOrNull(offset)) as P; case 9: + return (reader.readStringOrNull(offset)) as P; + case 10: return (reader.readObjectList( offset, OutputSchema.deserialize, @@ -330,19 +339,19 @@ P _transactionDeserializeProp

( Output(), ) ?? []) as P; - case 10: - return (reader.readStringOrNull(offset)) as P; case 11: + return (reader.readStringOrNull(offset)) as P; + case 12: return (_TransactionsubTypeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionSubType.none) as P; - case 12: - return (reader.readLong(offset)) as P; case 13: - return (reader.readString(offset)) as P; + return (reader.readLong(offset)) as P; case 14: + return (reader.readString(offset)) as P; + case 15: return (_TransactiontypeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionType.outgoing) as P; - case 15: + case 16: return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); @@ -1374,6 +1383,80 @@ extension TransactionQueryFilter }); } + QueryBuilder + numberOfMessagesIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'numberOfMessages', + )); + }); + } + + QueryBuilder + numberOfMessagesIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'numberOfMessages', + )); + }); + } + + QueryBuilder + numberOfMessagesEqualTo(int? value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesGreaterThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesLessThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesBetween( + int? lower, + int? upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'numberOfMessages', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + QueryBuilder otherDataIsNull() { return QueryBuilder.apply(this, (query) { @@ -2320,6 +2403,20 @@ extension TransactionQuerySortBy }); } + QueryBuilder + sortByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.asc); + }); + } + + QueryBuilder + sortByNumberOfMessagesDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.desc); + }); + } + QueryBuilder sortByOtherData() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.asc); @@ -2504,6 +2601,20 @@ extension TransactionQuerySortThenBy }); } + QueryBuilder + thenByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.asc); + }); + } + + QueryBuilder + thenByNumberOfMessagesDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.desc); + }); + } + QueryBuilder thenByOtherData() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.asc); @@ -2634,6 +2745,13 @@ extension TransactionQueryWhereDistinct }); } + QueryBuilder + distinctByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'numberOfMessages'); + }); + } + QueryBuilder distinctByOtherData( {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { @@ -2737,6 +2855,12 @@ extension TransactionQueryProperty }); } + QueryBuilder numberOfMessagesProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'numberOfMessages'); + }); + } + QueryBuilder otherDataProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'otherData'); diff --git a/lib/models/isar/models/blockchain_data/utxo.dart b/lib/models/isar/models/blockchain_data/utxo.dart index ba618b0c1..3a87957f0 100644 --- a/lib/models/isar/models/blockchain_data/utxo.dart +++ b/lib/models/isar/models/blockchain_data/utxo.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:math'; import 'package:isar/isar.dart'; diff --git a/lib/models/isar/models/contact_entry.dart b/lib/models/isar/models/contact_entry.dart index 676b33d23..0ed9a8fb2 100644 --- a/lib/models/isar/models/contact_entry.dart +++ b/lib/models/isar/models/contact_entry.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/models/isar/models/contract.dart b/lib/models/isar/models/contract.dart index 88e2a454c..3260df084 100644 --- a/lib/models/isar/models/contract.dart +++ b/lib/models/isar/models/contract.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + abstract class Contract { // for possible future use } diff --git a/lib/models/isar/models/encrypted_string_value.dart b/lib/models/isar/models/encrypted_string_value.dart index 79e9fcaae..96b3d1799 100644 --- a/lib/models/isar/models/encrypted_string_value.dart +++ b/lib/models/isar/models/encrypted_string_value.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; part 'encrypted_string_value.g.dart'; diff --git a/lib/models/isar/models/ethereum/eth_contract.dart b/lib/models/isar/models/ethereum/eth_contract.dart index d969cd503..59b350e0d 100644 --- a/lib/models/isar/models/ethereum/eth_contract.dart +++ b/lib/models/isar/models/ethereum/eth_contract.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; import 'package:stackwallet/models/isar/models/contract.dart'; diff --git a/lib/models/isar/models/isar_models.dart b/lib/models/isar/models/isar_models.dart index 6b244ee48..ce7652a46 100644 --- a/lib/models/isar/models/isar_models.dart +++ b/lib/models/isar/models/isar_models.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + export 'address_label.dart'; export 'blockchain_data/address.dart'; export 'blockchain_data/input.dart'; diff --git a/lib/models/isar/models/log.dart b/lib/models/isar/models/log.dart index f89fba253..31334327a 100644 --- a/lib/models/isar/models/log.dart +++ b/lib/models/isar/models/log.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; // import 'package:stackwallet/models/isar/type_converters/log_level_converter.dart'; import 'package:stackwallet/utilities/enums/log_level_enum.dart'; diff --git a/lib/models/isar/models/transaction_note.dart b/lib/models/isar/models/transaction_note.dart index a1e9e8d3f..b85e78eda 100644 --- a/lib/models/isar/models/transaction_note.dart +++ b/lib/models/isar/models/transaction_note.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:isar/isar.dart'; part 'transaction_note.g.dart'; diff --git a/lib/models/isar/stack_theme.dart b/lib/models/isar/stack_theme.dart index 5809e4443..b005c40ea 100644 --- a/lib/models/isar/stack_theme.dart +++ b/lib/models/isar/stack_theme.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:flutter/material.dart'; @@ -1483,8 +1493,12 @@ class StackTheme { late final ThemeAssetsV2? assetsV2; + // cheat build runner into adding this at end of property id list in isar + @Name("zAssetsV3") + late final ThemeAssetsV3? assetsV3; + @ignore - IThemeAssets get assets => assetsV2 ?? assetsV1!; + IThemeAssets get assets => assetsV3 ?? assetsV2 ?? assetsV1!; // =========================================================================== @@ -1514,6 +1528,13 @@ class StackTheme { themeId: json["id"] as String, ) : null + ..assetsV3 = version >= 3 + ? ThemeAssetsV3.fromJson( + json: Map.from(json["assets"] as Map), + applicationThemesDirectoryPath: applicationThemesDirectoryPath, + themeId: json["id"] as String, + ) + : null ..themeId = json["id"] as String ..name = json["name"] as String ..brightnessString = json["brightness"] as String @@ -1929,8 +1950,6 @@ class ThemeAssets implements IThemeAssets { @override late final String? background; - // todo: add all assets expected in json - ThemeAssets(); factory ThemeAssets.fromJson({ @@ -2212,6 +2231,261 @@ class ThemeAssetsV2 implements IThemeAssets { return result; } + + @override + String toString() { + return 'ThemeAssetsV2(' + 'bellNew: $bellNew, ' + 'buy: $buy, ' + 'exchange: $exchange, ' + 'personaIncognito: $personaIncognito, ' + 'personaEasy: $personaEasy, ' + 'stack: $stack, ' + 'stackIcon: $stackIcon, ' + 'receive: $receive, ' + 'receivePending: $receivePending, ' + 'receiveCancelled: $receiveCancelled, ' + 'send: $send, ' + 'sendPending: $sendPending, ' + 'sendCancelled: $sendCancelled, ' + 'themeSelector: $themeSelector, ' + 'themePreview: $themePreview, ' + 'txExchange: $txExchange, ' + 'txExchangePending: $txExchangePending, ' + 'txExchangeFailed: $txExchangeFailed, ' + 'loadingGif: $loadingGif, ' + 'background: $background, ' + 'coinPlaceholder: $coinPlaceholder, ' + 'coinIcons: $coinIcons, ' + 'coinImages: $coinImages, ' + 'coinSecondaryImages: $coinSecondaryImages, ' + ')'; + } +} + +@Embedded(inheritance: false) +class ThemeAssetsV3 implements IThemeAssets { + @override + late final String bellNew; + @override + late final String buy; + @override + late final String exchange; + @override + late final String personaIncognito; + @override + late final String personaEasy; + @override + late final String stack; + @override + late final String stackIcon; + @override + late final String receive; + @override + late final String receivePending; + @override + late final String receiveCancelled; + @override + late final String send; + @override + late final String sendPending; + @override + late final String sendCancelled; + @override + late final String themeSelector; + @override + late final String themePreview; + @override + late final String txExchange; + @override + late final String txExchangePending; + @override + late final String txExchangeFailed; + @override + late final String? loadingGif; + @override + late final String? background; + + late final String coinPlaceholder; + + // Added some future proof params in case we want to add anything else + // This should provide some buffer in stead of creating assetsV4 etc + @Name("otherStringParam1") + late final String? dummy1; + @Name("otherStringParam2") + late final String? dummy2; + @Name("otherStringParam3") + late final String? dummy3; + + @ignore + Map get coinIcons => _coinIcons ??= parseCoinAssetsString( + coinIconsString, + placeHolder: coinPlaceholder, + ); + @ignore + Map? _coinIcons; + late final String coinIconsString; + + @ignore + Map get coinImages => _coinImages ??= parseCoinAssetsString( + coinImagesString, + placeHolder: coinPlaceholder, + ); + @ignore + Map? _coinImages; + late final String coinImagesString; + + @ignore + Map get coinSecondaryImages => + _coinSecondaryImages ??= parseCoinAssetsString( + coinSecondaryImagesString, + placeHolder: coinPlaceholder, + ); + @ignore + Map? _coinSecondaryImages; + late final String coinSecondaryImagesString; + + @ignore + Map? get coinCardImages => + _coinCardImages ??= coinCardImagesString == null + ? null + : parseCoinAssetsString( + coinCardImagesString!, + placeHolder: coinPlaceholder, + ); + @ignore + Map? _coinCardImages; + late final String? coinCardImagesString; + + ThemeAssetsV3(); + + factory ThemeAssetsV3.fromJson({ + required Map json, + required String applicationThemesDirectoryPath, + required String themeId, + }) { + return ThemeAssetsV3() + ..bellNew = + "$applicationThemesDirectoryPath/$themeId/assets/${json["bell_new"] as String}" + ..buy = + "$applicationThemesDirectoryPath/$themeId/assets/${json["buy"] as String}" + ..exchange = + "$applicationThemesDirectoryPath/$themeId/assets/${json["exchange"] as String}" + ..personaIncognito = + "$applicationThemesDirectoryPath/$themeId/assets/${json["persona_incognito"] as String}" + ..personaEasy = + "$applicationThemesDirectoryPath/$themeId/assets/${json["persona_easy"] as String}" + ..stack = + "$applicationThemesDirectoryPath/$themeId/assets/${json["stack"] as String}" + ..stackIcon = + "$applicationThemesDirectoryPath/$themeId/assets/${json["stack_icon"] as String}" + ..receive = + "$applicationThemesDirectoryPath/$themeId/assets/${json["receive"] as String}" + ..receivePending = + "$applicationThemesDirectoryPath/$themeId/assets/${json["receive_pending"] as String}" + ..receiveCancelled = + "$applicationThemesDirectoryPath/$themeId/assets/${json["receive_cancelled"] as String}" + ..send = + "$applicationThemesDirectoryPath/$themeId/assets/${json["send"] as String}" + ..sendPending = + "$applicationThemesDirectoryPath/$themeId/assets/${json["send_pending"] as String}" + ..sendCancelled = + "$applicationThemesDirectoryPath/$themeId/assets/${json["send_cancelled"] as String}" + ..themeSelector = + "$applicationThemesDirectoryPath/$themeId/assets/${json["theme_selector"] as String}" + ..themePreview = + "$applicationThemesDirectoryPath/$themeId/assets/${json["theme_preview"] as String}" + ..txExchange = + "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange"] as String}" + ..txExchangePending = + "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange_pending"] as String}" + ..txExchangeFailed = + "$applicationThemesDirectoryPath/$themeId/assets/${json["tx_exchange_failed"] as String}" + ..coinPlaceholder = + "$applicationThemesDirectoryPath/$themeId/assets/${json["coin_placeholder"] as String}" + ..coinIconsString = createCoinAssetsString( + "$applicationThemesDirectoryPath/$themeId/assets", + Map.from(json["coins"]["icons"] as Map), + ) + ..coinImagesString = createCoinAssetsString( + "$applicationThemesDirectoryPath/$themeId/assets", + Map.from(json["coins"]["images"] as Map), + ) + ..coinSecondaryImagesString = createCoinAssetsString( + "$applicationThemesDirectoryPath/$themeId/assets", + Map.from(json["coins"]["secondaries"] as Map), + ) + ..coinCardImagesString = json["coins"]["cards"] is Map + ? createCoinAssetsString( + "$applicationThemesDirectoryPath/$themeId/assets", + Map.from(json["coins"]["cards"] as Map), + ) + : null + ..loadingGif = json["loading_gif"] is String + ? "$applicationThemesDirectoryPath/$themeId/assets/${json["loading_gif"] as String}" + : null + ..background = json["background"] is String + ? "$applicationThemesDirectoryPath/$themeId/assets/${json["background"] as String}" + : null + ..dummy1 = null + ..dummy2 = null + ..dummy3 = null; + } + + static String createCoinAssetsString(String path, Map json) { + final Map map = {}; + for (final entry in json.entries) { + map[entry.key] = "$path/${entry.value as String}"; + } + return jsonEncode(map); + } + + static Map parseCoinAssetsString( + String jsonString, { + required String placeHolder, + }) { + final json = jsonDecode(jsonString) as Map; + final map = Map.from(json); + + final Map result = {}; + + for (final coin in Coin.values) { + result[coin] = map[coin.name] as String? ?? placeHolder; + } + + return result; + } + + @override + String toString() { + return 'ThemeAssetsV3(' + 'bellNew: $bellNew, ' + 'buy: $buy, ' + 'exchange: $exchange, ' + 'personaIncognito: $personaIncognito, ' + 'personaEasy: $personaEasy, ' + 'stack: $stack, ' + 'stackIcon: $stackIcon, ' + 'receive: $receive, ' + 'receivePending: $receivePending, ' + 'receiveCancelled: $receiveCancelled, ' + 'send: $send, ' + 'sendPending: $sendPending, ' + 'sendCancelled: $sendCancelled, ' + 'themeSelector: $themeSelector, ' + 'themePreview: $themePreview, ' + 'txExchange: $txExchange, ' + 'txExchangePending: $txExchangePending, ' + 'txExchangeFailed: $txExchangeFailed, ' + 'loadingGif: $loadingGif, ' + 'background: $background, ' + 'coinPlaceholder: $coinPlaceholder, ' + 'coinIcons: $coinIcons, ' + 'coinImages: $coinImages, ' + 'coinSecondaryImages: $coinSecondaryImages, ' + 'coinCardImages: $coinCardImages' + ')'; + } } abstract class IThemeAssets { diff --git a/lib/models/isar/stack_theme.g.dart b/lib/models/isar/stack_theme.g.dart index ad6f905bd..e1bb0a549 100644 --- a/lib/models/isar/stack_theme.g.dart +++ b/lib/models/isar/stack_theme.g.dart @@ -823,6 +823,12 @@ const StackThemeSchema = CollectionSchema( id: 160, name: r'warningForegroundInt', type: IsarType.long, + ), + r'zAssetsV3': PropertySchema( + id: 161, + name: r'zAssetsV3', + type: IsarType.object, + target: r'ThemeAssetsV3', ) }, estimateSize: _stackThemeEstimateSize, @@ -848,7 +854,8 @@ const StackThemeSchema = CollectionSchema( links: {}, embeddedSchemas: { r'ThemeAssets': ThemeAssetsSchema, - r'ThemeAssetsV2': ThemeAssetsV2Schema + r'ThemeAssetsV2': ThemeAssetsV2Schema, + r'ThemeAssetsV3': ThemeAssetsV3Schema }, getId: _stackThemeGetId, getLinks: _stackThemeGetLinks, @@ -895,6 +902,14 @@ int _stackThemeEstimateSize( bytesCount += 3 + object.name.length * 3; bytesCount += 3 + object.standardBoxShadowString.length * 3; bytesCount += 3 + object.themeId.length * 3; + { + final value = object.assetsV3; + if (value != null) { + bytesCount += 3 + + ThemeAssetsV3Schema.estimateSize( + value, allOffsets[ThemeAssetsV3]!, allOffsets); + } + } return bytesCount; } @@ -1075,6 +1090,12 @@ void _stackThemeSerialize( writer.writeLong(offsets[158], object.version); writer.writeLong(offsets[159], object.warningBackgroundInt); writer.writeLong(offsets[160], object.warningForegroundInt); + writer.writeObject( + offsets[161], + allOffsets, + ThemeAssetsV3Schema.serialize, + object.assetsV3, + ); } StackTheme _stackThemeDeserialize( @@ -1255,6 +1276,11 @@ StackTheme _stackThemeDeserialize( object.version = reader.readLongOrNull(offsets[158]); object.warningBackgroundInt = reader.readLong(offsets[159]); object.warningForegroundInt = reader.readLong(offsets[160]); + object.assetsV3 = reader.readObjectOrNull( + offsets[161], + ThemeAssetsV3Schema.deserialize, + allOffsets, + ); return object; } @@ -1595,6 +1621,12 @@ P _stackThemeDeserializeProp

( return (reader.readLong(offset)) as P; case 160: return (reader.readLong(offset)) as P; + case 161: + return (reader.readObjectOrNull( + offset, + ThemeAssetsV3Schema.deserialize, + allOffsets, + )) as P; default: throw IsarError('Unknown property with id $propertyId'); } @@ -11382,6 +11414,23 @@ extension StackThemeQueryFilter )); }); } + + QueryBuilder assetsV3IsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'zAssetsV3', + )); + }); + } + + QueryBuilder + assetsV3IsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'zAssetsV3', + )); + }); + } } extension StackThemeQueryObject @@ -11399,6 +11448,13 @@ extension StackThemeQueryObject return query.object(q, r'assetsV2'); }); } + + QueryBuilder assetsV3( + FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.object(q, r'zAssetsV3'); + }); + } } extension StackThemeQueryLinks @@ -17942,6 +17998,13 @@ extension StackThemeQueryProperty return query.addPropertyName(r'warningForegroundInt'); }); } + + QueryBuilder + assetsV3Property() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'zAssetsV3'); + }); + } } // ************************************************************************** @@ -29376,3 +29439,4287 @@ extension ThemeAssetsV2QueryFilter extension ThemeAssetsV2QueryObject on QueryBuilder {} + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters + +const ThemeAssetsV3Schema = Schema( + name: r'ThemeAssetsV3', + id: -8828098514594684151, + properties: { + r'background': PropertySchema( + id: 0, + name: r'background', + type: IsarType.string, + ), + r'bellNew': PropertySchema( + id: 1, + name: r'bellNew', + type: IsarType.string, + ), + r'buy': PropertySchema( + id: 2, + name: r'buy', + type: IsarType.string, + ), + r'coinCardImagesString': PropertySchema( + id: 3, + name: r'coinCardImagesString', + type: IsarType.string, + ), + r'coinIconsString': PropertySchema( + id: 4, + name: r'coinIconsString', + type: IsarType.string, + ), + r'coinImagesString': PropertySchema( + id: 5, + name: r'coinImagesString', + type: IsarType.string, + ), + r'coinPlaceholder': PropertySchema( + id: 6, + name: r'coinPlaceholder', + type: IsarType.string, + ), + r'coinSecondaryImagesString': PropertySchema( + id: 7, + name: r'coinSecondaryImagesString', + type: IsarType.string, + ), + r'exchange': PropertySchema( + id: 8, + name: r'exchange', + type: IsarType.string, + ), + r'loadingGif': PropertySchema( + id: 9, + name: r'loadingGif', + type: IsarType.string, + ), + r'otherStringParam1': PropertySchema( + id: 10, + name: r'otherStringParam1', + type: IsarType.string, + ), + r'otherStringParam2': PropertySchema( + id: 11, + name: r'otherStringParam2', + type: IsarType.string, + ), + r'otherStringParam3': PropertySchema( + id: 12, + name: r'otherStringParam3', + type: IsarType.string, + ), + r'personaEasy': PropertySchema( + id: 13, + name: r'personaEasy', + type: IsarType.string, + ), + r'personaIncognito': PropertySchema( + id: 14, + name: r'personaIncognito', + type: IsarType.string, + ), + r'receive': PropertySchema( + id: 15, + name: r'receive', + type: IsarType.string, + ), + r'receiveCancelled': PropertySchema( + id: 16, + name: r'receiveCancelled', + type: IsarType.string, + ), + r'receivePending': PropertySchema( + id: 17, + name: r'receivePending', + type: IsarType.string, + ), + r'send': PropertySchema( + id: 18, + name: r'send', + type: IsarType.string, + ), + r'sendCancelled': PropertySchema( + id: 19, + name: r'sendCancelled', + type: IsarType.string, + ), + r'sendPending': PropertySchema( + id: 20, + name: r'sendPending', + type: IsarType.string, + ), + r'stack': PropertySchema( + id: 21, + name: r'stack', + type: IsarType.string, + ), + r'stackIcon': PropertySchema( + id: 22, + name: r'stackIcon', + type: IsarType.string, + ), + r'themePreview': PropertySchema( + id: 23, + name: r'themePreview', + type: IsarType.string, + ), + r'themeSelector': PropertySchema( + id: 24, + name: r'themeSelector', + type: IsarType.string, + ), + r'txExchange': PropertySchema( + id: 25, + name: r'txExchange', + type: IsarType.string, + ), + r'txExchangeFailed': PropertySchema( + id: 26, + name: r'txExchangeFailed', + type: IsarType.string, + ), + r'txExchangePending': PropertySchema( + id: 27, + name: r'txExchangePending', + type: IsarType.string, + ) + }, + estimateSize: _themeAssetsV3EstimateSize, + serialize: _themeAssetsV3Serialize, + deserialize: _themeAssetsV3Deserialize, + deserializeProp: _themeAssetsV3DeserializeProp, +); + +int _themeAssetsV3EstimateSize( + ThemeAssetsV3 object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + { + final value = object.background; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + bytesCount += 3 + object.bellNew.length * 3; + bytesCount += 3 + object.buy.length * 3; + { + final value = object.coinCardImagesString; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + bytesCount += 3 + object.coinIconsString.length * 3; + bytesCount += 3 + object.coinImagesString.length * 3; + bytesCount += 3 + object.coinPlaceholder.length * 3; + bytesCount += 3 + object.coinSecondaryImagesString.length * 3; + bytesCount += 3 + object.exchange.length * 3; + { + final value = object.loadingGif; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + { + final value = object.dummy1; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + { + final value = object.dummy2; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + { + final value = object.dummy3; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + bytesCount += 3 + object.personaEasy.length * 3; + bytesCount += 3 + object.personaIncognito.length * 3; + bytesCount += 3 + object.receive.length * 3; + bytesCount += 3 + object.receiveCancelled.length * 3; + bytesCount += 3 + object.receivePending.length * 3; + bytesCount += 3 + object.send.length * 3; + bytesCount += 3 + object.sendCancelled.length * 3; + bytesCount += 3 + object.sendPending.length * 3; + bytesCount += 3 + object.stack.length * 3; + bytesCount += 3 + object.stackIcon.length * 3; + bytesCount += 3 + object.themePreview.length * 3; + bytesCount += 3 + object.themeSelector.length * 3; + bytesCount += 3 + object.txExchange.length * 3; + bytesCount += 3 + object.txExchangeFailed.length * 3; + bytesCount += 3 + object.txExchangePending.length * 3; + return bytesCount; +} + +void _themeAssetsV3Serialize( + ThemeAssetsV3 object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeString(offsets[0], object.background); + writer.writeString(offsets[1], object.bellNew); + writer.writeString(offsets[2], object.buy); + writer.writeString(offsets[3], object.coinCardImagesString); + writer.writeString(offsets[4], object.coinIconsString); + writer.writeString(offsets[5], object.coinImagesString); + writer.writeString(offsets[6], object.coinPlaceholder); + writer.writeString(offsets[7], object.coinSecondaryImagesString); + writer.writeString(offsets[8], object.exchange); + writer.writeString(offsets[9], object.loadingGif); + writer.writeString(offsets[10], object.dummy1); + writer.writeString(offsets[11], object.dummy2); + writer.writeString(offsets[12], object.dummy3); + writer.writeString(offsets[13], object.personaEasy); + writer.writeString(offsets[14], object.personaIncognito); + writer.writeString(offsets[15], object.receive); + writer.writeString(offsets[16], object.receiveCancelled); + writer.writeString(offsets[17], object.receivePending); + writer.writeString(offsets[18], object.send); + writer.writeString(offsets[19], object.sendCancelled); + writer.writeString(offsets[20], object.sendPending); + writer.writeString(offsets[21], object.stack); + writer.writeString(offsets[22], object.stackIcon); + writer.writeString(offsets[23], object.themePreview); + writer.writeString(offsets[24], object.themeSelector); + writer.writeString(offsets[25], object.txExchange); + writer.writeString(offsets[26], object.txExchangeFailed); + writer.writeString(offsets[27], object.txExchangePending); +} + +ThemeAssetsV3 _themeAssetsV3Deserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = ThemeAssetsV3(); + object.background = reader.readStringOrNull(offsets[0]); + object.bellNew = reader.readString(offsets[1]); + object.buy = reader.readString(offsets[2]); + object.coinCardImagesString = reader.readStringOrNull(offsets[3]); + object.coinIconsString = reader.readString(offsets[4]); + object.coinImagesString = reader.readString(offsets[5]); + object.coinPlaceholder = reader.readString(offsets[6]); + object.coinSecondaryImagesString = reader.readString(offsets[7]); + object.exchange = reader.readString(offsets[8]); + object.loadingGif = reader.readStringOrNull(offsets[9]); + object.dummy1 = reader.readStringOrNull(offsets[10]); + object.dummy2 = reader.readStringOrNull(offsets[11]); + object.dummy3 = reader.readStringOrNull(offsets[12]); + object.personaEasy = reader.readString(offsets[13]); + object.personaIncognito = reader.readString(offsets[14]); + object.receive = reader.readString(offsets[15]); + object.receiveCancelled = reader.readString(offsets[16]); + object.receivePending = reader.readString(offsets[17]); + object.send = reader.readString(offsets[18]); + object.sendCancelled = reader.readString(offsets[19]); + object.sendPending = reader.readString(offsets[20]); + object.stack = reader.readString(offsets[21]); + object.stackIcon = reader.readString(offsets[22]); + object.themePreview = reader.readString(offsets[23]); + object.themeSelector = reader.readString(offsets[24]); + object.txExchange = reader.readString(offsets[25]); + object.txExchangeFailed = reader.readString(offsets[26]); + object.txExchangePending = reader.readString(offsets[27]); + return object; +} + +P _themeAssetsV3DeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readStringOrNull(offset)) as P; + case 1: + return (reader.readString(offset)) as P; + case 2: + return (reader.readString(offset)) as P; + case 3: + return (reader.readStringOrNull(offset)) as P; + case 4: + return (reader.readString(offset)) as P; + case 5: + return (reader.readString(offset)) as P; + case 6: + return (reader.readString(offset)) as P; + case 7: + return (reader.readString(offset)) as P; + case 8: + return (reader.readString(offset)) as P; + case 9: + return (reader.readStringOrNull(offset)) as P; + case 10: + return (reader.readStringOrNull(offset)) as P; + case 11: + return (reader.readStringOrNull(offset)) as P; + case 12: + return (reader.readStringOrNull(offset)) as P; + case 13: + return (reader.readString(offset)) as P; + case 14: + return (reader.readString(offset)) as P; + case 15: + return (reader.readString(offset)) as P; + case 16: + return (reader.readString(offset)) as P; + case 17: + return (reader.readString(offset)) as P; + case 18: + return (reader.readString(offset)) as P; + case 19: + return (reader.readString(offset)) as P; + case 20: + return (reader.readString(offset)) as P; + case 21: + return (reader.readString(offset)) as P; + case 22: + return (reader.readString(offset)) as P; + case 23: + return (reader.readString(offset)) as P; + case 24: + return (reader.readString(offset)) as P; + case 25: + return (reader.readString(offset)) as P; + case 26: + return (reader.readString(offset)) as P; + case 27: + return (reader.readString(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +extension ThemeAssetsV3QueryFilter + on QueryBuilder { + QueryBuilder + backgroundIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'background', + )); + }); + } + + QueryBuilder + backgroundIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'background', + )); + }); + } + + QueryBuilder + backgroundEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'background', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + backgroundGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'background', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + backgroundLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'background', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + backgroundBetween( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'background', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + backgroundStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'background', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + backgroundEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'background', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + backgroundContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'background', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + backgroundMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'background', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + backgroundIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'background', + value: '', + )); + }); + } + + QueryBuilder + backgroundIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'background', + value: '', + )); + }); + } + + QueryBuilder + bellNewEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + bellNewGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + bellNewLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + bellNewBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'bellNew', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + bellNewStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + bellNewEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + bellNewContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + bellNewMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'bellNew', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + bellNewIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'bellNew', + value: '', + )); + }); + } + + QueryBuilder + bellNewIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'bellNew', + value: '', + )); + }); + } + + QueryBuilder buyEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + buyGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'buy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder buyLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'buy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder buyBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'buy', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + buyStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder buyEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder buyContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder buyMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'buy', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + buyIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'buy', + value: '', + )); + }); + } + + QueryBuilder + buyIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'buy', + value: '', + )); + }); + } + + QueryBuilder + coinCardImagesStringIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'coinCardImagesString', + )); + }); + } + + QueryBuilder + coinCardImagesStringIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'coinCardImagesString', + )); + }); + } + + QueryBuilder + coinCardImagesStringEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinCardImagesStringGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinCardImagesStringLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinCardImagesStringBetween( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'coinCardImagesString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinCardImagesStringStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinCardImagesStringEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinCardImagesStringContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinCardImagesStringMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'coinCardImagesString', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinCardImagesStringIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinCardImagesString', + value: '', + )); + }); + } + + QueryBuilder + coinCardImagesStringIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'coinCardImagesString', + value: '', + )); + }); + } + + QueryBuilder + coinIconsStringEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinIconsStringGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinIconsStringLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinIconsStringBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'coinIconsString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinIconsStringStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinIconsStringEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinIconsStringContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinIconsStringMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'coinIconsString', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinIconsStringIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinIconsString', + value: '', + )); + }); + } + + QueryBuilder + coinIconsStringIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'coinIconsString', + value: '', + )); + }); + } + + QueryBuilder + coinImagesStringEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinImagesStringGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinImagesStringLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinImagesStringBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'coinImagesString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinImagesStringStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinImagesStringEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinImagesStringContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinImagesStringMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'coinImagesString', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinImagesStringIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinImagesString', + value: '', + )); + }); + } + + QueryBuilder + coinImagesStringIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'coinImagesString', + value: '', + )); + }); + } + + QueryBuilder + coinPlaceholderEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinPlaceholderGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinPlaceholderLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinPlaceholderBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'coinPlaceholder', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinPlaceholderStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinPlaceholderEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinPlaceholderContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinPlaceholderMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'coinPlaceholder', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinPlaceholderIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinPlaceholder', + value: '', + )); + }); + } + + QueryBuilder + coinPlaceholderIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'coinPlaceholder', + value: '', + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'coinSecondaryImagesString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'coinSecondaryImagesString', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'coinSecondaryImagesString', + value: '', + )); + }); + } + + QueryBuilder + coinSecondaryImagesStringIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'coinSecondaryImagesString', + value: '', + )); + }); + } + + QueryBuilder + exchangeEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + exchangeGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + exchangeLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + exchangeBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'exchange', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + exchangeStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + exchangeEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + exchangeContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + exchangeMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'exchange', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + exchangeIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'exchange', + value: '', + )); + }); + } + + QueryBuilder + exchangeIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'exchange', + value: '', + )); + }); + } + + QueryBuilder + loadingGifIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'loadingGif', + )); + }); + } + + QueryBuilder + loadingGifIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'loadingGif', + )); + }); + } + + QueryBuilder + loadingGifEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + loadingGifGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + loadingGifLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + loadingGifBetween( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'loadingGif', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + loadingGifStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + loadingGifEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + loadingGifContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + loadingGifMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'loadingGif', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + loadingGifIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'loadingGif', + value: '', + )); + }); + } + + QueryBuilder + loadingGifIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'loadingGif', + value: '', + )); + }); + } + + QueryBuilder + dummy1IsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'otherStringParam1', + )); + }); + } + + QueryBuilder + dummy1IsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'otherStringParam1', + )); + }); + } + + QueryBuilder + dummy1EqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy1GreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy1LessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy1Between( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'otherStringParam1', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy1StartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy1EndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy1Contains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy1Matches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'otherStringParam1', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy1IsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'otherStringParam1', + value: '', + )); + }); + } + + QueryBuilder + dummy1IsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'otherStringParam1', + value: '', + )); + }); + } + + QueryBuilder + dummy2IsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'otherStringParam2', + )); + }); + } + + QueryBuilder + dummy2IsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'otherStringParam2', + )); + }); + } + + QueryBuilder + dummy2EqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy2GreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy2LessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy2Between( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'otherStringParam2', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy2StartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy2EndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy2Contains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy2Matches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'otherStringParam2', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy2IsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'otherStringParam2', + value: '', + )); + }); + } + + QueryBuilder + dummy2IsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'otherStringParam2', + value: '', + )); + }); + } + + QueryBuilder + dummy3IsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'otherStringParam3', + )); + }); + } + + QueryBuilder + dummy3IsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'otherStringParam3', + )); + }); + } + + QueryBuilder + dummy3EqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy3GreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy3LessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy3Between( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'otherStringParam3', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy3StartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy3EndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy3Contains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy3Matches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'otherStringParam3', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + dummy3IsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'otherStringParam3', + value: '', + )); + }); + } + + QueryBuilder + dummy3IsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'otherStringParam3', + value: '', + )); + }); + } + + QueryBuilder + personaEasyEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaEasyGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaEasyLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaEasyBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'personaEasy', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaEasyStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaEasyEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaEasyContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaEasyMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'personaEasy', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaEasyIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'personaEasy', + value: '', + )); + }); + } + + QueryBuilder + personaEasyIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'personaEasy', + value: '', + )); + }); + } + + QueryBuilder + personaIncognitoEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaIncognitoGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaIncognitoLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaIncognitoBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'personaIncognito', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaIncognitoStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaIncognitoEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaIncognitoContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaIncognitoMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'personaIncognito', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + personaIncognitoIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'personaIncognito', + value: '', + )); + }); + } + + QueryBuilder + personaIncognitoIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'personaIncognito', + value: '', + )); + }); + } + + QueryBuilder + receiveEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'receive', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'receive', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'receive', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'receive', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'receive', + value: '', + )); + }); + } + + QueryBuilder + receiveIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'receive', + value: '', + )); + }); + } + + QueryBuilder + receiveCancelledEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveCancelledGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveCancelledLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveCancelledBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'receiveCancelled', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveCancelledStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveCancelledEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveCancelledContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveCancelledMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'receiveCancelled', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receiveCancelledIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'receiveCancelled', + value: '', + )); + }); + } + + QueryBuilder + receiveCancelledIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'receiveCancelled', + value: '', + )); + }); + } + + QueryBuilder + receivePendingEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receivePendingGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receivePendingLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receivePendingBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'receivePending', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receivePendingStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receivePendingEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receivePendingContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receivePendingMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'receivePending', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + receivePendingIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'receivePending', + value: '', + )); + }); + } + + QueryBuilder + receivePendingIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'receivePending', + value: '', + )); + }); + } + + QueryBuilder sendEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'send', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'send', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'send', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder sendBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'send', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'send', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'send', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'send', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder sendMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'send', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'send', + value: '', + )); + }); + } + + QueryBuilder + sendIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'send', + value: '', + )); + }); + } + + QueryBuilder + sendCancelledEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendCancelledGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendCancelledLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendCancelledBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'sendCancelled', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendCancelledStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendCancelledEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendCancelledContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendCancelledMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'sendCancelled', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendCancelledIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'sendCancelled', + value: '', + )); + }); + } + + QueryBuilder + sendCancelledIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'sendCancelled', + value: '', + )); + }); + } + + QueryBuilder + sendPendingEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendPendingGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendPendingLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendPendingBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'sendPending', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendPendingStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendPendingEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendPendingContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendPendingMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'sendPending', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + sendPendingIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'sendPending', + value: '', + )); + }); + } + + QueryBuilder + sendPendingIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'sendPending', + value: '', + )); + }); + } + + QueryBuilder + stackEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'stack', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'stack', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'stack', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'stack', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'stack', + value: '', + )); + }); + } + + QueryBuilder + stackIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'stack', + value: '', + )); + }); + } + + QueryBuilder + stackIconEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIconGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIconLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIconBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'stackIcon', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIconStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIconEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIconContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIconMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'stackIcon', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + stackIconIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'stackIcon', + value: '', + )); + }); + } + + QueryBuilder + stackIconIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'stackIcon', + value: '', + )); + }); + } + + QueryBuilder + themePreviewEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themePreviewGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themePreviewLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themePreviewBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'themePreview', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themePreviewStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themePreviewEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themePreviewContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themePreviewMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'themePreview', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themePreviewIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'themePreview', + value: '', + )); + }); + } + + QueryBuilder + themePreviewIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'themePreview', + value: '', + )); + }); + } + + QueryBuilder + themeSelectorEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themeSelectorGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themeSelectorLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themeSelectorBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'themeSelector', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themeSelectorStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themeSelectorEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themeSelectorContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themeSelectorMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'themeSelector', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + themeSelectorIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'themeSelector', + value: '', + )); + }); + } + + QueryBuilder + themeSelectorIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'themeSelector', + value: '', + )); + }); + } + + QueryBuilder + txExchangeEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'txExchange', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'txExchange', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txExchange', + value: '', + )); + }); + } + + QueryBuilder + txExchangeIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'txExchange', + value: '', + )); + }); + } + + QueryBuilder + txExchangeFailedEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeFailedGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeFailedLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeFailedBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'txExchangeFailed', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeFailedStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeFailedEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeFailedContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeFailedMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'txExchangeFailed', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangeFailedIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txExchangeFailed', + value: '', + )); + }); + } + + QueryBuilder + txExchangeFailedIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'txExchangeFailed', + value: '', + )); + }); + } + + QueryBuilder + txExchangePendingEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangePendingGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangePendingLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangePendingBetween( + String lower, + String upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'txExchangePending', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangePendingStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangePendingEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangePendingContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangePendingMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'txExchangePending', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + txExchangePendingIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txExchangePending', + value: '', + )); + }); + } + + QueryBuilder + txExchangePendingIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'txExchangePending', + value: '', + )); + }); + } +} + +extension ThemeAssetsV3QueryObject + on QueryBuilder {} diff --git a/lib/models/lelantus_coin.dart b/lib/models/lelantus_coin.dart index 325483970..0e32d33bf 100644 --- a/lib/models/lelantus_coin.dart +++ b/lib/models/lelantus_coin.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; part 'type_adaptors/lelantus_coin.g.dart'; diff --git a/lib/models/lelantus_fee_data.dart b/lib/models/lelantus_fee_data.dart index d4fafa3f6..1ba930a29 100644 --- a/lib/models/lelantus_fee_data.dart +++ b/lib/models/lelantus_fee_data.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class LelantusFeeData { int changeToMint; int fee; diff --git a/lib/models/models.dart b/lib/models/models.dart index 231072b79..3f6aaa525 100644 --- a/lib/models/models.dart +++ b/lib/models/models.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + export 'lelantus_coin.dart'; export 'lelantus_fee_data.dart'; export 'paymint/fee_object_model.dart'; diff --git a/lib/models/node_model.dart b/lib/models/node_model.dart index 2aeaa893b..ce79722ef 100644 --- a/lib/models/node_model.dart +++ b/lib/models/node_model.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; import 'package:stackwallet/utilities/default_nodes.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; diff --git a/lib/models/notification_model.dart b/lib/models/notification_model.dart index dd47594ea..54a7a6787 100644 --- a/lib/models/notification_model.dart +++ b/lib/models/notification_model.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; part 'type_adaptors/notification_model.g.dart'; diff --git a/lib/models/paymint/fee_object_model.dart b/lib/models/paymint/fee_object_model.dart index 1d3afd3c4..3745f997d 100644 --- a/lib/models/paymint/fee_object_model.dart +++ b/lib/models/paymint/fee_object_model.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class FeeObject { final int fast; final int medium; diff --git a/lib/models/paymint/transactions_model.dart b/lib/models/paymint/transactions_model.dart index cee48b8eb..db2dd2eee 100644 --- a/lib/models/paymint/transactions_model.dart +++ b/lib/models/paymint/transactions_model.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:dart_numerics/dart_numerics.dart'; import 'package:decimal/decimal.dart'; import 'package:hive/hive.dart'; @@ -155,6 +165,9 @@ class Transaction { // @HiveField(18) final String? otherData; + // @HiveField(16) + final int? numberOfMessages; + Transaction({ required this.txid, required this.confirmedStatus, @@ -176,6 +189,7 @@ class Transaction { this.isCancelled = false, this.slateId, this.otherData, + this.numberOfMessages, }); factory Transaction.fromJson(Map json) { @@ -211,6 +225,7 @@ class Transaction { isCancelled: json["isCancelled"] as bool? ?? false, slateId: json["slateId"] as String?, otherData: json["otherData"] as String?, + numberOfMessages: json["numberOfMessages"] as int?, ); } @@ -223,7 +238,7 @@ class Transaction { txType: json['txType'] as String, amount: (Decimal.parse(json["amount"].toString()) * Decimal.fromInt(Constants.satsPerCoin(Coin - .firo))) // dirty hack but we need 8 decimal places here to keep consistent data structure + .firo).toInt())) // dirty hack but we need 8 decimal places here to keep consistent data structure .toBigInt() .toInt(), aliens: [], @@ -231,7 +246,7 @@ class Transaction { worthAtBlockTimestamp: json['worthAtBlockTimestamp'] as String? ?? "0", fees: (Decimal.parse(json["fees"].toString()) * Decimal.fromInt(Constants.satsPerCoin(Coin - .firo))) // dirty hack but we need 8 decimal places here to keep consistent data structure + .firo).toInt())) // dirty hack but we need 8 decimal places here to keep consistent data structure .toBigInt() .toInt(), inputSize: json['inputSize'] as int? ?? 0, @@ -269,6 +284,7 @@ class Transaction { bool? isCancelled, String? slateId, String? otherData, + int? numberOfMessages, }) { return Transaction( txid: txid ?? this.txid, @@ -292,13 +308,14 @@ class Transaction { isCancelled: isCancelled ?? this.isCancelled, slateId: slateId ?? this.slateId, otherData: otherData ?? this.otherData, + numberOfMessages: numberOfMessages ?? this.numberOfMessages, ); } @override String toString() { String transaction = - "{txid: $txid, type: $txType, subType: $subType, value: $amount, fee: $fees, height: $height, confirm: $confirmedStatus, confirmations: $confirmations, address: $address, timestamp: $timestamp, worthNow: $worthNow, inputs: $inputs, slateid: $slateId }"; + "{txid: $txid, type: $txType, subType: $subType, value: $amount, fee: $fees, height: $height, confirm: $confirmedStatus, confirmations: $confirmations, address: $address, timestamp: $timestamp, worthNow: $worthNow, inputs: $inputs, slateid: $slateId, numberOfMessages: $numberOfMessages }"; return transaction; } } @@ -397,7 +414,7 @@ class Output { value: (Decimal.parse( (json["value"] ?? 0).toString()) * Decimal.fromInt(Constants.satsPerCoin(Coin - .firo))) // dirty hack but we need 8 decimal places here to keep consistent data structure + .firo).toInt())) // dirty hack but we need 8 decimal places here to keep consistent data structure .toBigInt() .toInt(), ); @@ -410,7 +427,7 @@ class Output { scriptpubkeyAddress: "", value: (Decimal.parse(0.toString()) * Decimal.fromInt(Constants.satsPerCoin(Coin - .firo))) // dirty hack but we need 8 decimal places here to keep consistent data structure + .firo).toInt())) // dirty hack but we need 8 decimal places here to keep consistent data structure .toBigInt() .toInt()); } diff --git a/lib/models/paymint/utxo_model.dart b/lib/models/paymint/utxo_model.dart index 99ba251c3..07f2c0e69 100644 --- a/lib/models/paymint/utxo_model.dart +++ b/lib/models/paymint/utxo_model.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:dart_numerics/dart_numerics.dart'; import 'package:hive/hive.dart'; diff --git a/lib/models/paynym/created_paynym.dart b/lib/models/paynym/created_paynym.dart index 8716d7e10..79ee2c377 100644 --- a/lib/models/paynym/created_paynym.dart +++ b/lib/models/paynym/created_paynym.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class CreatedPaynym { final bool claimed; final String? nymAvatar; diff --git a/lib/models/paynym/paynym_account.dart b/lib/models/paynym/paynym_account.dart index 133edc25d..4727820b4 100644 --- a/lib/models/paynym/paynym_account.dart +++ b/lib/models/paynym/paynym_account.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/paynym/paynym_account_lite.dart'; import 'package:stackwallet/models/paynym/paynym_code.dart'; diff --git a/lib/models/paynym/paynym_account_lite.dart b/lib/models/paynym/paynym_account_lite.dart index e1510febc..694efb778 100644 --- a/lib/models/paynym/paynym_account_lite.dart +++ b/lib/models/paynym/paynym_account_lite.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class PaynymAccountLite { final String nymId; final String nymName; diff --git a/lib/models/paynym/paynym_claim.dart b/lib/models/paynym/paynym_claim.dart index 275063e4a..0f1e66373 100644 --- a/lib/models/paynym/paynym_claim.dart +++ b/lib/models/paynym/paynym_claim.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class PaynymClaim { final String claimed; final String token; diff --git a/lib/models/paynym/paynym_code.dart b/lib/models/paynym/paynym_code.dart index d01366d20..445fdb7d4 100644 --- a/lib/models/paynym/paynym_code.dart +++ b/lib/models/paynym/paynym_code.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class PaynymCode { final bool claimed; final bool segwit; diff --git a/lib/models/paynym/paynym_follow.dart b/lib/models/paynym/paynym_follow.dart index 56bcb8fa9..73fbdb2e8 100644 --- a/lib/models/paynym/paynym_follow.dart +++ b/lib/models/paynym/paynym_follow.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class PaynymFollow { final String follower; final String following; diff --git a/lib/models/paynym/paynym_response.dart b/lib/models/paynym/paynym_response.dart index 3617d12cc..0e90cb633 100644 --- a/lib/models/paynym/paynym_response.dart +++ b/lib/models/paynym/paynym_response.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class PaynymResponse { final T? value; final int statusCode; diff --git a/lib/models/paynym/paynym_unfollow.dart b/lib/models/paynym/paynym_unfollow.dart index 4aa1ca975..e77fe3b5e 100644 --- a/lib/models/paynym/paynym_unfollow.dart +++ b/lib/models/paynym/paynym_unfollow.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + class PaynymUnfollow { final String follower; final String unfollowing; diff --git a/lib/models/send_view_auto_fill_data.dart b/lib/models/send_view_auto_fill_data.dart index 6d11dfc87..bb8817ca2 100644 --- a/lib/models/send_view_auto_fill_data.dart +++ b/lib/models/send_view_auto_fill_data.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; class SendViewAutoFillData { diff --git a/lib/models/signing_data.dart b/lib/models/signing_data.dart index bb933976c..ac7a0a4ed 100644 --- a/lib/models/signing_data.dart +++ b/lib/models/signing_data.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:typed_data'; import 'package:bitcoindart/bitcoindart.dart'; diff --git a/lib/models/stack_restoring_ui_state.dart b/lib/models/stack_restoring_ui_state.dart index 312b0989f..78246c649 100644 --- a/lib/models/stack_restoring_ui_state.dart +++ b/lib/models/stack_restoring_ui_state.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/wallet_restore_state.dart'; diff --git a/lib/models/trade_wallet_lookup.dart b/lib/models/trade_wallet_lookup.dart index d4a8c6ae6..c4bc8252b 100644 --- a/lib/models/trade_wallet_lookup.dart +++ b/lib/models/trade_wallet_lookup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; part 'type_adaptors/trade_wallet_lookup.g.dart'; diff --git a/lib/models/transaction_filter.dart b/lib/models/transaction_filter.dart index 7ea18aac0..9c9c7b879 100644 --- a/lib/models/transaction_filter.dart +++ b/lib/models/transaction_filter.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/amount/amount.dart'; class TransactionFilter { diff --git a/lib/models/tx_info.dart b/lib/models/tx_info.dart index 798cb5adc..88eebde0d 100644 --- a/lib/models/tx_info.dart +++ b/lib/models/tx_info.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; diff --git a/lib/models/wallet_restore_state.dart b/lib/models/wallet_restore_state.dart index a92753617..4dcefe3c5 100644 --- a/lib/models/wallet_restore_state.dart +++ b/lib/models/wallet_restore_state.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; diff --git a/lib/notifications/notification_card.dart b/lib/notifications/notification_card.dart index 08fbd2a3c..ada6400f6 100644 --- a/lib/notifications/notification_card.dart +++ b/lib/notifications/notification_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/notifications/show_flush_bar.dart b/lib/notifications/show_flush_bar.dart index 8d97f8bfb..6364d76c4 100644 --- a/lib/notifications/show_flush_bar.dart +++ b/lib/notifications/show_flush_bar.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:another_flushbar/flushbar.dart'; import 'package:another_flushbar/flushbar_route.dart' as flushRoute; import 'package:flutter/material.dart'; diff --git a/lib/pages/TermsOfServiceView.dart b/lib/pages/TermsOfServiceView.dart index dbb39a1b0..64258b24f 100644 --- a/lib/pages/TermsOfServiceView.dart +++ b/lib/pages/TermsOfServiceView.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; class TermsOfServiceView extends StatelessWidget { diff --git a/lib/pages/add_wallet_views/add_token_view/add_custom_token_view.dart b/lib/pages/add_wallet_views/add_token_view/add_custom_token_view.dart index f28b1870e..a3d297b8c 100644 --- a/lib/pages/add_wallet_views/add_token_view/add_custom_token_view.dart +++ b/lib/pages/add_wallet_views/add_token_view/add_custom_token_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart index a2cf7e881..4e34c8350 100644 --- a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart +++ b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_custom_token_selector.dart b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_custom_token_selector.dart index 715636e8f..9be56029a 100644 --- a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_custom_token_selector.dart +++ b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_custom_token_selector.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list.dart b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list.dart index a8532f307..9580d799f 100644 --- a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list.dart +++ b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/add_wallet_views/add_token_view/sub_widgets/add_custom_token_selector.dart'; import 'package:stackwallet/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart'; diff --git a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart index 5a10c0178..be5aaa37d 100644 --- a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart +++ b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:isar/isar.dart'; diff --git a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_text.dart b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_text.dart index 115d8be5c..7b901aa74 100644 --- a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_text.dart +++ b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_text.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index d2dd8e30f..419aa6d00 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_entity_list.dart b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_entity_list.dart index c503daa88..c1e903ae5 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_entity_list.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_entity_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/models/add_wallet_list_entity/add_wallet_list_entity.dart'; import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart'; diff --git a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_text.dart b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_text.dart index 40e20c3f0..77c5bcefb 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_text.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_text.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart index 7e85337c4..410ebc7bd 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/expanding_sub_list_item.dart b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/expanding_sub_list_item.dart index db6a6ae31..8940dd3d9 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/expanding_sub_list_item.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/expanding_sub_list_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/add_wallet_list_entity/add_wallet_list_entity.dart'; diff --git a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/next_button.dart b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/next_button.dart index 5a45ea39a..6756d3ca2 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/next_button.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/next_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/add_wallet_list_entity/sub_classes/eth_token_entity.dart'; diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart index e19cdb1cb..29b40f34b 100644 --- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/models/add_wallet_list_entity/add_wallet_list_entity.dart'; import 'package:stackwallet/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/coin_image.dart'; diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/coin_image.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/coin_image.dart index 0cf8cadb1..0d13044be 100644 --- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/coin_image.dart +++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/coin_image.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_subtitle.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_subtitle.dart index 2b6168509..d450a9f52 100644 --- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_subtitle.dart +++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_subtitle.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_title.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_title.dart index 8ac5af718..ae7e917c8 100644 --- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_title.dart +++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_title.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart index da355962e..e8c7c711c 100644 --- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart +++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart b/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart index 0948189d8..4e04fcb80 100644 --- a/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart +++ b/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart index f56b1d52c..2a1619364 100644 --- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart +++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:math'; diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart index 7d21dfec4..837954235 100644 --- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart +++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart'; diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart index a8b1b5a21..728948c5b 100644 --- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart +++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart index 77b796abd..e373e817b 100644 --- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart +++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -63,12 +73,6 @@ class _NewWalletRecoveryPhraseWarningViewState Widget build(BuildContext context) { debugPrint("BUILD: $runtimeType"); - final _numberOfPhraseWords = coin == Coin.monero - ? Constants.seedPhraseWordCountMonero - : coin == Coin.wownero - ? 14 - : Constants.seedPhraseWordCountBip39; - return MasterScaffold( isDesktop: isDesktop, appBar: isDesktop @@ -167,7 +171,15 @@ class _NewWalletRecoveryPhraseWarningViewState width: isDesktop ? 480 : null, child: isDesktop ? Text( - "On the next screen you will see $_numberOfPhraseWords words that make up your recovery phrase.\n\nPlease write it down. Keep it safe and never share it with anyone. Your recovery phrase is the only way you can access your funds if you forget your PIN, lose your phone, etc.\n\nStack Wallet does not keep nor is able to restore your recover phrase. Only you have access to your wallet.", + "On the next screen you will see " + "${Constants.defaultSeedPhraseLengthFor(coin: coin)} " + "words that make up your recovery phrase.\n\nPlease " + "write it down. Keep it safe and never share it with " + "anyone. Your recovery phrase is the only way you can" + " access your funds if you forget your PIN, lose your" + " phone, etc.\n\nStack Wallet does not keep nor is " + "able to restore your recover phrase. Only you have " + "access to your wallet.", style: isDesktop ? STextStyles.desktopTextMediumRegular(context) : STextStyles.subtitle(context).copyWith( @@ -204,7 +216,9 @@ class _NewWalletRecoveryPhraseWarningViewState ), ), TextSpan( - text: "$_numberOfPhraseWords words", + text: + "${Constants.defaultSeedPhraseLengthFor(coin: coin)}" + " words", style: STextStyles.desktopH3(context).copyWith( color: Theme.of(context) .extension()! diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/recovery_phrase_explanation_dialog.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/recovery_phrase_explanation_dialog.dart index 0138cdd02..2e6edcc3c 100644 --- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/recovery_phrase_explanation_dialog.dart +++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/recovery_phrase_explanation_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/confirm_recovery_dialog.dart b/lib/pages/add_wallet_views/restore_wallet_view/confirm_recovery_dialog.dart index f09e95683..dcdbc7dc8 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/confirm_recovery_dialog.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/confirm_recovery_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart index 05aaeffa4..59d1c0a8f 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -420,32 +430,32 @@ class _RestoreOptionsViewState extends ConsumerState { } }, isExpanded: true, - icon: SvgPicture.asset( - Assets.svg.chevronDown, - width: 12, - height: 6, - color: Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, - ), - buttonPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - buttonDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + iconStyleData: IconStyleData( + icon: SvgPicture.asset( + Assets.svg.chevronDown, + width: 12, + height: 6, + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, ), ), - dropdownDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + dropdownStyleData: DropdownStyleData( + offset: const Offset(0, -10), + elevation: 0, + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + ), + menuItemStyleData: const MenuItemStyleData( + padding: EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, ), ), ), diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/mobile_mnemonic_length_selector.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/mobile_mnemonic_length_selector.dart index d0a0baa57..25526283f 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/mobile_mnemonic_length_selector.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/mobile_mnemonic_length_selector.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_from_date_picker.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_from_date_picker.dart index 2e36d25f3..bf09b8b60 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_from_date_picker.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_from_date_picker.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_next_button.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_next_button.dart index 9a09fef50..0302e74ec 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_next_button.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_next_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart index b83b2eb8e..fa95e4291 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart index 7df799a24..f162c4f73 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:collection'; import 'dart:io'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart index d0f4667d8..010f195bc 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_failed_dialog.dart b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_failed_dialog.dart index 1f2435158..c098e449f 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_failed_dialog.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_failed_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart index 5a4fb8282..3963fc139 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart index 108f64c24..2be19e08a 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/add_wallet_views/select_wallet_for_token_view.dart b/lib/pages/add_wallet_views/select_wallet_for_token_view.dart index 3a22dcbfa..05b84f1f8 100644 --- a/lib/pages/add_wallet_views/select_wallet_for_token_view.dart +++ b/lib/pages/add_wallet_views/select_wallet_for_token_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/db/hive/db.dart'; diff --git a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table.dart b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table.dart index 768ed05af..260522cc0 100644 --- a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table.dart +++ b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart'; diff --git a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart index 81d4bb850..2990aaae4 100644 --- a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart +++ b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; diff --git a/lib/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart b/lib/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart index 79de8f879..fda4419d9 100644 --- a/lib/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart +++ b/lib/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:math'; diff --git a/lib/pages/address_book_views/address_book_view.dart b/lib/pages/address_book_views/address_book_view.dart index 3faaad48e..037a9772b 100644 --- a/lib/pages/address_book_views/address_book_view.dart +++ b/lib/pages/address_book_views/address_book_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart b/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart index 74e312da4..20237f174 100644 --- a/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart +++ b/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:emojis/emoji.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart b/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart index f01829ab2..4916ec69d 100644 --- a/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart +++ b/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages/address_book_views/subviews/address_book_filter_view.dart b/lib/pages/address_book_views/subviews/address_book_filter_view.dart index b98dc5fc3..83ed65ca4 100644 --- a/lib/pages/address_book_views/subviews/address_book_filter_view.dart +++ b/lib/pages/address_book_views/subviews/address_book_filter_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; diff --git a/lib/pages/address_book_views/subviews/coin_select_sheet.dart b/lib/pages/address_book_views/subviews/coin_select_sheet.dart index d343dbdbb..ca4405b64 100644 --- a/lib/pages/address_book_views/subviews/coin_select_sheet.dart +++ b/lib/pages/address_book_views/subviews/coin_select_sheet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/address_book_views/subviews/contact_details_view.dart b/lib/pages/address_book_views/subviews/contact_details_view.dart index b7d54ea71..ce543e04f 100644 --- a/lib/pages/address_book_views/subviews/contact_details_view.dart +++ b/lib/pages/address_book_views/subviews/contact_details_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/address_book_views/subviews/contact_popup.dart b/lib/pages/address_book_views/subviews/contact_popup.dart index fafebfcb1..a82eca283 100644 --- a/lib/pages/address_book_views/subviews/contact_popup.dart +++ b/lib/pages/address_book_views/subviews/contact_popup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/address_book_views/subviews/edit_contact_address_view.dart b/lib/pages/address_book_views/subviews/edit_contact_address_view.dart index 4fd98ff88..2448b1e33 100644 --- a/lib/pages/address_book_views/subviews/edit_contact_address_view.dart +++ b/lib/pages/address_book_views/subviews/edit_contact_address_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart b/lib/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart index 12b4043f2..8974d8a32 100644 --- a/lib/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart +++ b/lib/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:emojis/emoji.dart'; diff --git a/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart b/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart index cf315130c..9ca3f35e4 100644 --- a/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart +++ b/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:dropdown_button2/dropdown_button2.dart'; @@ -99,9 +109,25 @@ class _NewContactAddressEntryFormState "Select cryptocurrency", style: STextStyles.fieldLabel(context), ), - offset: const Offset(0, -10), + dropdownStyleData: DropdownStyleData( + offset: const Offset(0, -10), + elevation: 0, + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + ), + menuItemStyleData: const MenuItemStyleData( + padding: EdgeInsets.symmetric( + horizontal: 16, + vertical: 4, + ), + ), isExpanded: true, - dropdownElevation: 0, value: ref.watch(addressEntryDataProvider(widget.id) .select((value) => value.coin)), onChanged: (value) { @@ -109,30 +135,12 @@ class _NewContactAddressEntryFormState ref.read(addressEntryDataProvider(widget.id)).coin = value; } }, - icon: SvgPicture.asset( - Assets.svg.chevronDown, - width: 10, - height: 5, - color: Theme.of(context).extension()!.textDark3, - ), - buttonPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 4, - ), - buttonDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - ), - dropdownDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + iconStyleData: IconStyleData( + icon: SvgPicture.asset( + Assets.svg.chevronDown, + width: 10, + height: 5, + color: Theme.of(context).extension()!.textDark3, ), ), items: [ diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart index 1a31077e2..7c15370d3 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:decimal/decimal.dart'; diff --git a/lib/pages/buy_view/buy_in_wallet_view.dart b/lib/pages/buy_view/buy_in_wallet_view.dart index 8e74aee7d..b0183eb79 100644 --- a/lib/pages/buy_view/buy_in_wallet_view.dart +++ b/lib/pages/buy_view/buy_in_wallet_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/pages/buy_view/buy_view.dart'; diff --git a/lib/pages/buy_view/buy_order_details.dart b/lib/pages/buy_view/buy_order_details.dart index b21167201..250cba77b 100644 --- a/lib/pages/buy_view/buy_order_details.dart +++ b/lib/pages/buy_view/buy_order_details.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/buy/response_objects/order.dart'; diff --git a/lib/pages/buy_view/buy_quote_preview.dart b/lib/pages/buy_view/buy_quote_preview.dart index a3f872407..3f4f96006 100644 --- a/lib/pages/buy_view/buy_quote_preview.dart +++ b/lib/pages/buy_view/buy_quote_preview.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/buy_view/buy_view.dart b/lib/pages/buy_view/buy_view.dart index 4136bc5e1..3d5fe1539 100644 --- a/lib/pages/buy_view/buy_view.dart +++ b/lib/pages/buy_view/buy_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/pages/buy_view/buy_form.dart'; diff --git a/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart b/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart index aec4ce45c..f5d61e3f4 100644 --- a/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart +++ b/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart b/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart index 7ee9b296b..b7ae75de0 100644 --- a/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart +++ b/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/buy_view/sub_widgets/fiat_selection_view.dart b/lib/pages/buy_view/sub_widgets/fiat_selection_view.dart index 07bd504d5..555a86b00 100644 --- a/lib/pages/buy_view/sub_widgets/fiat_selection_view.dart +++ b/lib/pages/buy_view/sub_widgets/fiat_selection_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:intl/intl.dart'; diff --git a/lib/pages/coin_control/coin_control_view.dart b/lib/pages/coin_control/coin_control_view.dart index 5892aa2c9..33d1c6425 100644 --- a/lib/pages/coin_control/coin_control_view.dart +++ b/lib/pages/coin_control/coin_control_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -8,11 +18,11 @@ import 'package:stackwallet/db/isar/main_db.dart'; import 'package:stackwallet/models/isar/models/isar_models.dart'; import 'package:stackwallet/pages/coin_control/utxo_card.dart'; import 'package:stackwallet/pages/coin_control/utxo_details_view.dart'; -import 'package:stackwallet/providers/global/locale_provider.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/services/mixins/coin_control_interface.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -687,14 +697,9 @@ class _CoinControlViewState extends ConsumerState { fractionDigits: coin.decimals, ); return Text( - "${selectedSum.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => value.locale, - ), - ), - )} ${coin.ticker}", + ref + .watch(pAmountFormatter(coin)) + .format(selectedSum), style: widget.requestedTotal == null ? STextStyles.w600_14(context) : STextStyles.w600_14(context).copyWith( @@ -735,14 +740,9 @@ class _CoinControlViewState extends ConsumerState { style: STextStyles.w600_14(context), ), Text( - "${widget.requestedTotal!.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => value.locale, - ), - ), - )} ${coin.ticker}", + ref + .watch(pAmountFormatter(coin)) + .format(widget.requestedTotal!), style: STextStyles.w600_14(context), ), ], diff --git a/lib/pages/coin_control/utxo_card.dart b/lib/pages/coin_control/utxo_card.dart index 265a6de79..4fe5a47dd 100644 --- a/lib/pages/coin_control/utxo_card.dart +++ b/lib/pages/coin_control/utxo_card.dart @@ -1,11 +1,21 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/db/isar/main_db.dart'; import 'package:stackwallet/models/isar/models/isar_models.dart'; -import 'package:stackwallet/providers/global/locale_provider.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -124,15 +134,11 @@ class _UtxoCardState extends ConsumerState { mainAxisSize: MainAxisSize.min, children: [ Text( - "${utxo.value.toAmountAsRaw( - fractionDigits: coin.decimals, - ).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), + ref.watch(pAmountFormatter(coin)).format( + utxo.value.toAmountAsRaw( + fractionDigits: coin.decimals, ), - )} ${coin.ticker}", + ), style: STextStyles.w600_14(context), ), const SizedBox( diff --git a/lib/pages/coin_control/utxo_details_view.dart b/lib/pages/coin_control/utxo_details_view.dart index 53ba74b38..44709d077 100644 --- a/lib/pages/coin_control/utxo_details_view.dart +++ b/lib/pages/coin_control/utxo_details_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -6,10 +16,10 @@ import 'package:isar/isar.dart'; import 'package:stackwallet/db/isar/main_db.dart'; import 'package:stackwallet/models/isar/models/isar_models.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; -import 'package:stackwallet/providers/global/locale_provider.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -240,13 +250,11 @@ class _UtxoDetailsViewState extends ConsumerState { width: 16, ), Text( - "${utxo!.value.toAmountAsRaw(fractionDigits: coin.decimals).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), + ref.watch(pAmountFormatter(coin)).format( + utxo!.value.toAmountAsRaw( + fractionDigits: coin.decimals, ), - )} ${coin.ticker}", + ), style: STextStyles.pageTitleH2(context), ), ], diff --git a/lib/pages/exchange_view/choose_from_stack_view.dart b/lib/pages/exchange_view/choose_from_stack_view.dart index 5e32a8c27..847fd1100 100644 --- a/lib/pages/exchange_view/choose_from_stack_view.dart +++ b/lib/pages/exchange_view/choose_from_stack_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; diff --git a/lib/pages/exchange_view/confirm_change_now_send.dart b/lib/pages/exchange_view/confirm_change_now_send.dart index ce24fd0da..acb68288c 100644 --- a/lib/pages/exchange_view/confirm_change_now_send.dart +++ b/lib/pages/exchange_view/confirm_change_now_send.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -13,8 +23,10 @@ import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/background.dart'; @@ -145,7 +157,12 @@ class _ConfirmChangeNowSendViewState Navigator.of(context).popUntil(ModalRoute.withName(routeOnSuccessName)); } - } catch (e) { + } catch (e, s) { + Logging.instance.log( + "Broadcast transaction failed: $e\n$s", + level: LogLevel.Error, + ); + // pop sending dialog Navigator.of(context).pop(); @@ -194,9 +211,9 @@ class _ConfirmChangeNowSendViewState child: Column( mainAxisSize: MainAxisSize.min, children: [ - Row( + const Row( mainAxisAlignment: MainAxisAlignment.end, - children: const [ + children: [ DesktopDialogCloseButton(), ], ), @@ -366,20 +383,19 @@ class _ConfirmChangeNowSendViewState mainAxisAlignment: MainAxisAlignment.end, children: [ Text( - "${(transactionInfo["fee"] is Amount ? transactionInfo["fee"] as Amount : (transactionInfo["fee"] as int).toAmountAsRaw( - fractionDigits: ref.watch( - managerProvider - .select((value) => value.coin.decimals), - ), - )).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - )} ${ref.watch( + ref + .watch(pAmountFormatter(ref.watch( managerProvider.select((value) => value.coin), - ).ticker}", + ))) + .format(transactionInfo["fee"] is Amount + ? transactionInfo["fee"] as Amount + : (transactionInfo["fee"] as int) + .toAmountAsRaw( + fractionDigits: ref.watch( + managerProvider.select( + (value) => value.coin.decimals), + ), + )), style: STextStyles.desktopTextExtraExtraSmall(context) .copyWith( @@ -423,16 +439,9 @@ class _ConfirmChangeNowSendViewState final amount = transactionInfo["recipientAmt"] as Amount; final total = amount + fee; - final locale = ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ); + return Text( - "${total.localizedStringAsFixed( - locale: locale, - )}" - " ${coin.ticker}", + ref.watch(pAmountFormatter(coin)).format(total), style: STextStyles.itemSubtitle12(context) .copyWith( color: Theme.of(context) @@ -605,7 +614,7 @@ class _ConfirmChangeNowSendViewState ); return Text( - " | ${value.localizedStringAsFixed(locale: locale)} $currency", + " | ${value.fiatString(locale: locale)} $currency", style: STextStyles.desktopTextExtraExtraSmall(context) .copyWith( @@ -618,15 +627,11 @@ class _ConfirmChangeNowSendViewState ], ), child: Text( - "${(transactionInfo["recipientAmt"] as Amount).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - )} ${ref.watch( - managerProvider.select((value) => value.coin), - ).ticker}", + ref + .watch(pAmountFormatter(ref.watch( + walletsChangeNotifierProvider.select( + (value) => value.getManager(walletId).coin)))) + .format((transactionInfo["recipientAmt"] as Amount)), style: STextStyles.itemSubtitle12(context), textAlign: TextAlign.right, ), @@ -652,19 +657,20 @@ class _ConfirmChangeNowSendViewState style: STextStyles.smallMed12(context), ), Text( - "${(transactionInfo["fee"] is Amount ? transactionInfo["fee"] as Amount : (transactionInfo["fee"] as int).toAmountAsRaw(fractionDigits: ref.watch( - managerProvider.select( - (value) => value.coin.decimals, - ), - ))).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - )} ${ref.watch( + ref + .watch(pAmountFormatter(ref.watch( managerProvider.select((value) => value.coin), - ).ticker}", + ))) + .format( + (transactionInfo["fee"] is Amount + ? transactionInfo["fee"] as Amount + : (transactionInfo["fee"] as int).toAmountAsRaw( + fractionDigits: ref.watch( + managerProvider.select( + (value) => value.coin.decimals, + ), + ))), + ), style: STextStyles.itemSubtitle12(context), textAlign: TextAlign.right, ), @@ -756,16 +762,9 @@ class _ConfirmChangeNowSendViewState final amount = transactionInfo["recipientAmt"] as Amount; final total = amount + fee; - final locale = ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ); + return Text( - "${total.localizedStringAsFixed( - locale: locale, - )}" - " ${coin.ticker}", + ref.watch(pAmountFormatter(coin)).format(total), style: STextStyles.itemSubtitle12(context).copyWith( color: Theme.of(context) .extension()! diff --git a/lib/pages/exchange_view/edit_trade_note_view.dart b/lib/pages/exchange_view/edit_trade_note_view.dart index 1878e1385..13d152a84 100644 --- a/lib/pages/exchange_view/edit_trade_note_view.dart +++ b/lib/pages/exchange_view/edit_trade_note_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/exchange/trade_note_service_provider.dart'; diff --git a/lib/pages/exchange_view/exchange_coin_selection/exchange_currency_selection_view.dart b/lib/pages/exchange_view/exchange_coin_selection/exchange_currency_selection_view.dart index 964ed6068..87fc590e9 100644 --- a/lib/pages/exchange_view/exchange_coin_selection/exchange_currency_selection_view.dart +++ b/lib/pages/exchange_view/exchange_coin_selection/exchange_currency_selection_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/exchange_view/exchange_form.dart b/lib/pages/exchange_view/exchange_form.dart index 2604d89af..e65242fbd 100644 --- a/lib/pages/exchange_view/exchange_form.dart +++ b/lib/pages/exchange_view/exchange_form.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:decimal/decimal.dart'; diff --git a/lib/pages/exchange_view/exchange_loading_overlay.dart b/lib/pages/exchange_view/exchange_loading_overlay.dart index 673aae5a4..022855a03 100644 --- a/lib/pages/exchange_view/exchange_loading_overlay.dart +++ b/lib/pages/exchange_view/exchange_loading_overlay.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/exchange/changenow_initial_load_status.dart'; diff --git a/lib/pages/exchange_view/exchange_step_views/step_1_view.dart b/lib/pages/exchange_view/exchange_step_views/step_1_view.dart index 22e39b244..1795519b9 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_1_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_1_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/models/exchange/incomplete_exchange.dart'; import 'package:stackwallet/pages/exchange_view/exchange_step_views/step_2_view.dart'; diff --git a/lib/pages/exchange_view/exchange_step_views/step_2_view.dart b/lib/pages/exchange_view/exchange_step_views/step_2_view.dart index 1177d09ef..9a4f65356 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_2_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_2_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages/exchange_view/exchange_step_views/step_3_view.dart b/lib/pages/exchange_view/exchange_step_views/step_3_view.dart index 43ba2fdf6..318a5c0e4 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_3_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_3_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/exchange_view/exchange_step_views/step_4_view.dart b/lib/pages/exchange_view/exchange_step_views/step_4_view.dart index 853fed1cc..25967801a 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_4_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_4_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -18,6 +28,7 @@ import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; @@ -161,18 +172,15 @@ class _Step4ViewState extends ConsumerState { ), SecondaryButton( label: - "${firoWallet.balancePrivate.spendable.localizedStringAsFixed( - locale: locale, - )} (private)", + "${ref.watch(pAmountFormatter(firoWallet.coin)).format(firoWallet.balancePrivate.spendable)} (private)", onPressed: () => Navigator.of(context).pop(false), ), const SizedBox( height: 16, ), SecondaryButton( - label: "${firoWallet.balance.spendable.localizedStringAsFixed( - locale: locale, - )} (public)", + label: + "${ref.watch(pAmountFormatter(firoWallet.coin)).format(firoWallet.balance.spendable)} (public)", onPressed: () => Navigator.of(context).pop(true), ), const SizedBox( @@ -282,6 +290,7 @@ class _Step4ViewState extends ConsumerState { walletId: tuple.item1, routeOnSuccessName: HomeView.routeName, trade: model.trade!, + shouldSendPublicFiroFunds: firoPublicSend, ), settings: const RouteSettings( name: ConfirmChangeNowSendView.routeName, @@ -656,7 +665,7 @@ class _Step4ViewState extends ConsumerState { height: 24, ), Center( - child: QrImage( + child: QrImageView( // TODO: grab coin uri scheme from somewhere // data: "${coin.uriScheme}:$receivingAddress", data: model.trade!.payInAddress, diff --git a/lib/pages/exchange_view/exchange_view.dart b/lib/pages/exchange_view/exchange_view.dart index b8b7e48ca..04dd21998 100644 --- a/lib/pages/exchange_view/exchange_view.dart +++ b/lib/pages/exchange_view/exchange_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart index 28164e850..4935a1b20 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -16,6 +26,7 @@ import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -147,13 +158,7 @@ class _SendFromViewState extends ConsumerState { Row( children: [ Text( - "You need to send ${amount.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - )} ${coin.ticker}", + "You need to send ${ref.watch(pAmountFormatter(coin)).format(amount)}", style: isDesktop ? STextStyles.desktopTextExtraExtraSmall(context) : STextStyles.itemSubtitle(context), @@ -453,9 +458,10 @@ class _SendFromCardState extends ConsumerState { style: STextStyles.itemSubtitle(context), ), Text( - "${(manager.wallet as FiroWallet).availablePrivateBalance().localizedStringAsFixed( - locale: locale, - )} ${coin.ticker}", + ref.watch(pAmountFormatter(coin)).format( + (manager.wallet as FiroWallet) + .availablePrivateBalance(), + ), style: STextStyles.itemSubtitle(context), ), ], @@ -515,9 +521,9 @@ class _SendFromCardState extends ConsumerState { style: STextStyles.itemSubtitle(context), ), Text( - "${(manager.wallet as FiroWallet).availablePublicBalance().localizedStringAsFixed( - locale: locale, - )} ${coin.ticker}", + ref.watch(pAmountFormatter(coin)).format( + (manager.wallet as FiroWallet) + .availablePublicBalance()), style: STextStyles.itemSubtitle(context), ), ], @@ -605,9 +611,9 @@ class _SendFromCardState extends ConsumerState { ), if (!isFiro) Text( - "${manager.balance.spendable.localizedStringAsFixed( - locale: locale, - )} ${coin.ticker}", + ref + .watch(pAmountFormatter(coin)) + .format(manager.balance.spendable), style: STextStyles.itemSubtitle(context), ), ], diff --git a/lib/pages/exchange_view/sub_widgets/exchange_provider_option.dart b/lib/pages/exchange_view/sub_widgets/exchange_provider_option.dart index 6f13d00a2..e891f148e 100644 --- a/lib/pages/exchange_view/sub_widgets/exchange_provider_option.dart +++ b/lib/pages/exchange_view/sub_widgets/exchange_provider_option.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -8,6 +18,8 @@ import 'package:stackwallet/providers/global/locale_provider.dart'; import 'package:stackwallet/services/exchange/exchange.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/exchange_rate_type_enum.dart'; @@ -97,13 +109,32 @@ class _ExchangeOptionState extends ConsumerState { .toAmount(fractionDigits: decimals); } - final rateString = - "1 ${sendCurrency.ticker.toUpperCase()} ~ ${rate.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select((value) => value.locale), - ), - )} ${receivingCurrency.ticker.toUpperCase()}"; + Coin? coin; + try { + coin = coinFromTickerCaseInsensitive( + receivingCurrency.ticker); + } catch (_) { + coin = null; + } + + final String rateString; + if (coin != null) { + rateString = "1 ${sendCurrency.ticker.toUpperCase()} " + "~ ${ref.watch(pAmountFormatter(coin)).format(rate)}"; + } else { + final formatter = AmountFormatter( + unit: AmountUnit.normal, + locale: ref.watch( + localeServiceChangeNotifierProvider + .select((value) => value.locale), + ), + coin: Coin.bitcoin, // some sane default + maxDecimals: 8, // some sane default + ); + rateString = "1 ${sendCurrency.ticker.toUpperCase()} " + "~ ${formatter.format(rate, withUnitName: false)}" + " ${receivingCurrency.ticker.toUpperCase()}"; + } return ConditionalParent( condition: i > 0, diff --git a/lib/pages/exchange_view/sub_widgets/exchange_provider_options.dart b/lib/pages/exchange_view/sub_widgets/exchange_provider_options.dart index c8566fff9..13330e2f9 100644 --- a/lib/pages/exchange_view/sub_widgets/exchange_provider_options.dart +++ b/lib/pages/exchange_view/sub_widgets/exchange_provider_options.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/exchange/aggregate_currency.dart'; diff --git a/lib/pages/exchange_view/sub_widgets/rate_type_toggle.dart b/lib/pages/exchange_view/sub_widgets/rate_type_toggle.dart index 98e09211c..e98ed3b37 100644 --- a/lib/pages/exchange_view/sub_widgets/rate_type_toggle.dart +++ b/lib/pages/exchange_view/sub_widgets/rate_type_toggle.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; diff --git a/lib/pages/exchange_view/sub_widgets/step_indicator.dart b/lib/pages/exchange_view/sub_widgets/step_indicator.dart index 8eff8c52c..3fedfc459 100644 --- a/lib/pages/exchange_view/sub_widgets/step_indicator.dart +++ b/lib/pages/exchange_view/sub_widgets/step_indicator.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/exchange_view/sub_widgets/step_row.dart b/lib/pages/exchange_view/sub_widgets/step_row.dart index 9c2ee29c9..6dc6a4db4 100644 --- a/lib/pages/exchange_view/sub_widgets/step_row.dart +++ b/lib/pages/exchange_view/sub_widgets/step_row.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/exchange_view/sub_widgets/step_indicator.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/exchange_view/trade_details_view.dart b/lib/pages/exchange_view/trade_details_view.dart index 89501a74c..ff9b7ae24 100644 --- a/lib/pages/exchange_view/trade_details_view.dart +++ b/lib/pages/exchange_view/trade_details_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -26,6 +36,7 @@ import 'package:stackwallet/services/exchange/trocador/trocador_exchange.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; @@ -356,13 +367,9 @@ class _TradeDetailsViewState extends ConsumerState { trade.payInCurrency); final amount = sendAmount.toAmount( fractionDigits: coin.decimals); - text = amount.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - ); + text = ref + .watch(pAmountFormatter(coin)) + .format(amount); } catch (_) { text = sendAmount.toStringAsFixed( trade.payInCurrency.toLowerCase() == "xmr" @@ -771,7 +778,7 @@ class _TradeDetailsViewState extends ConsumerState { child: SizedBox( width: width + 20, height: width + 20, - child: QrImage( + child: QrImageView( data: trade.payInAddress, size: width, backgroundColor: Theme.of(context) diff --git a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart index f52cb0699..3b6c41093 100644 --- a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart +++ b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/generic/single_field_edit_view.dart b/lib/pages/generic/single_field_edit_view.dart index 17687a271..1cd8e33b3 100644 --- a/lib/pages/generic/single_field_edit_view.dart +++ b/lib/pages/generic/single_field_edit_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_native_splash/cli_commands.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index c9cf5f478..c3cad7a97 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages/home_view/sub_widgets/home_view_button_bar.dart b/lib/pages/home_view/sub_widgets/home_view_button_bar.dart index 58fda72a9..098ba4843 100644 --- a/lib/pages/home_view/sub_widgets/home_view_button_bar.dart +++ b/lib/pages/home_view/sub_widgets/home_view_button_bar.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; diff --git a/lib/pages/intro_view.dart b/lib/pages/intro_view.dart index 5771f4bca..2eecd4983 100644 --- a/lib/pages/intro_view.dart +++ b/lib/pages/intro_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/gestures.dart'; diff --git a/lib/pages/loading_view.dart b/lib/pages/loading_view.dart index 7d05f8c82..ef2bba93f 100644 --- a/lib/pages/loading_view.dart +++ b/lib/pages/loading_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'dart:math'; diff --git a/lib/pages/manage_favorites_view/manage_favorites_view.dart b/lib/pages/manage_favorites_view/manage_favorites_view.dart index 148c8a67b..737d83c2e 100644 --- a/lib/pages/manage_favorites_view/manage_favorites_view.dart +++ b/lib/pages/manage_favorites_view/manage_favorites_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; diff --git a/lib/pages/notification_views/notifications_view.dart b/lib/pages/notification_views/notifications_view.dart index fda479fb7..18af772ba 100644 --- a/lib/pages/notification_views/notifications_view.dart +++ b/lib/pages/notification_views/notifications_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/notifications/notification_card.dart'; diff --git a/lib/pages/paynym/add_new_paynym_follow_view.dart b/lib/pages/paynym/add_new_paynym_follow_view.dart index e27b218f9..8a32e21ea 100644 --- a/lib/pages/paynym/add_new_paynym_follow_view.dart +++ b/lib/pages/paynym/add_new_paynym_follow_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/paynym/dialogs/claiming_paynym_dialog.dart b/lib/pages/paynym/dialogs/claiming_paynym_dialog.dart index 339d5a838..d4652948f 100644 --- a/lib/pages/paynym/dialogs/claiming_paynym_dialog.dart +++ b/lib/pages/paynym/dialogs/claiming_paynym_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/paynym/dialogs/confirm_paynym_connect_dialog.dart b/lib/pages/paynym/dialogs/confirm_paynym_connect_dialog.dart index f2f886241..ae5bfed00 100644 --- a/lib/pages/paynym/dialogs/confirm_paynym_connect_dialog.dart +++ b/lib/pages/paynym/dialogs/confirm_paynym_connect_dialog.dart @@ -1,7 +1,19 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -12,7 +24,7 @@ import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; -class ConfirmPaynymConnectDialog extends StatelessWidget { +class ConfirmPaynymConnectDialog extends ConsumerWidget { const ConfirmPaynymConnectDialog({ Key? key, required this.nymName, @@ -30,14 +42,14 @@ class ConfirmPaynymConnectDialog extends StatelessWidget { String get title => "Connect to $nymName"; - String get message => "A one-time connection fee of " - "${amount.localizedStringAsFixed(locale: locale)} ${coin.ticker} " + String message(String amountString) => "A one-time connection fee of " + "$amountString " "will be charged to connect to this PayNym.\n\nThis fee " "covers the cost of creating a one-time transaction to create a " "record on the blockchain. This keeps PayNyms decentralized."; @override - Widget build(BuildContext context) { + Widget build(BuildContext context, WidgetRef ref) { if (Util.isDesktop) { return DesktopDialog( maxHeight: double.infinity, @@ -76,7 +88,7 @@ class ConfirmPaynymConnectDialog extends StatelessWidget { right: 40, ), child: Text( - message, + message(ref.watch(pAmountFormatter(coin)).format(amount)), style: STextStyles.desktopTextMedium(context).copyWith( color: Theme.of(context).extension()!.textDark3, ), @@ -123,7 +135,7 @@ class ConfirmPaynymConnectDialog extends StatelessWidget { width: 24, height: 24, ), - message: message, + message: message(ref.watch(pAmountFormatter(coin)).format(amount)), leftButton: SecondaryButton( buttonHeight: ButtonHeight.xl, label: "Cancel", diff --git a/lib/pages/paynym/dialogs/paynym_details_popup.dart b/lib/pages/paynym/dialogs/paynym_details_popup.dart index 653ef415b..ddfa74900 100644 --- a/lib/pages/paynym/dialogs/paynym_details_popup.dart +++ b/lib/pages/paynym/dialogs/paynym_details_popup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -369,7 +379,7 @@ class _PaynymDetailsPopupState extends ConsumerState { const SizedBox( width: 20, ), - QrImage( + QrImageView( padding: const EdgeInsets.all(0), size: 100, data: widget.accountLite.code, diff --git a/lib/pages/paynym/dialogs/paynym_qr_popup.dart b/lib/pages/paynym/dialogs/paynym_qr_popup.dart index 7b6326d23..076204950 100644 --- a/lib/pages/paynym/dialogs/paynym_qr_popup.dart +++ b/lib/pages/paynym/dialogs/paynym_qr_popup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -147,7 +157,7 @@ class PaynymQrPopup extends StatelessWidget { const SizedBox( width: 20, ), - QrImage( + QrImageView( padding: const EdgeInsets.all(0), size: 130, data: paynymAccount.nonSegwitPaymentCode.code, diff --git a/lib/pages/paynym/paynym_claim_view.dart b/lib/pages/paynym/paynym_claim_view.dart index efeb33071..77d02edd6 100644 --- a/lib/pages/paynym/paynym_claim_view.dart +++ b/lib/pages/paynym/paynym_claim_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/paynym/paynym_home_view.dart b/lib/pages/paynym/paynym_home_view.dart index 2a4ae4aaa..008ab3cbf 100644 --- a/lib/pages/paynym/paynym_home_view.dart +++ b/lib/pages/paynym/paynym_home_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/paynym/subwidgets/desktop_paynym_details.dart b/lib/pages/paynym/subwidgets/desktop_paynym_details.dart index ee70223f9..d4b4e2627 100644 --- a/lib/pages/paynym/subwidgets/desktop_paynym_details.dart +++ b/lib/pages/paynym/subwidgets/desktop_paynym_details.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -356,7 +366,7 @@ class _PaynymDetailsPopupState extends ConsumerState { const SizedBox( width: 20, ), - QrImage( + QrImageView( padding: const EdgeInsets.all(0), size: 100, data: widget.accountLite.code, diff --git a/lib/pages/paynym/subwidgets/featured_paynyms_widget.dart b/lib/pages/paynym/subwidgets/featured_paynyms_widget.dart index f88e25c7f..af363945d 100644 --- a/lib/pages/paynym/subwidgets/featured_paynyms_widget.dart +++ b/lib/pages/paynym/subwidgets/featured_paynyms_widget.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/paynym/subwidgets/paynym_card.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/paynym/subwidgets/paynym_bot.dart b/lib/pages/paynym/subwidgets/paynym_bot.dart index 40dadf812..d8f645da3 100644 --- a/lib/pages/paynym/subwidgets/paynym_bot.dart +++ b/lib/pages/paynym/subwidgets/paynym_bot.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/widgets/loading_indicator.dart'; diff --git a/lib/pages/paynym/subwidgets/paynym_card.dart b/lib/pages/paynym/subwidgets/paynym_card.dart index 7738424bc..8dab52869 100644 --- a/lib/pages/paynym/subwidgets/paynym_card.dart +++ b/lib/pages/paynym/subwidgets/paynym_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/paynym/subwidgets/paynym_bot.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/paynym/subwidgets/paynym_card_button.dart b/lib/pages/paynym/subwidgets/paynym_card_button.dart index 2697b78ee..07a5ece1e 100644 --- a/lib/pages/paynym/subwidgets/paynym_card_button.dart +++ b/lib/pages/paynym/subwidgets/paynym_card_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/paynym/paynym_account_lite.dart'; diff --git a/lib/pages/paynym/subwidgets/paynym_followers_list.dart b/lib/pages/paynym/subwidgets/paynym_followers_list.dart index fa581d700..7f09b421b 100644 --- a/lib/pages/paynym/subwidgets/paynym_followers_list.dart +++ b/lib/pages/paynym/subwidgets/paynym_followers_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:math'; import 'package:flutter/material.dart'; diff --git a/lib/pages/paynym/subwidgets/paynym_following_list.dart b/lib/pages/paynym/subwidgets/paynym_following_list.dart index c1d2157d2..ae77b5d8c 100644 --- a/lib/pages/paynym/subwidgets/paynym_following_list.dart +++ b/lib/pages/paynym/subwidgets/paynym_following_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:math'; import 'package:flutter/material.dart'; diff --git a/lib/pages/pinpad_views/create_pin_view.dart b/lib/pages/pinpad_views/create_pin_view.dart index 7ad3344ec..82c6c8a8e 100644 --- a/lib/pages/pinpad_views/create_pin_view.dart +++ b/lib/pages/pinpad_views/create_pin_view.dart @@ -1,3 +1,14 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + +import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; @@ -9,7 +20,6 @@ import 'package:stackwallet/providers/global/secure_store_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/biometrics.dart'; -import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/background.dart'; @@ -35,10 +45,11 @@ class CreatePinView extends ConsumerStatefulWidget { class _CreatePinViewState extends ConsumerState { BoxDecoration get _pinPutDecoration { return BoxDecoration( - color: Theme.of(context).extension()!.textSubtitle3, + color: Theme.of(context).extension()!.infoItemIcons, border: Border.all( - width: 1, - color: Theme.of(context).extension()!.textSubtitle3), + width: 1, + color: Theme.of(context).extension()!.infoItemIcons, + ), borderRadius: BorderRadius.circular(6), ); } @@ -57,10 +68,13 @@ class _CreatePinViewState extends ConsumerState { late SecureStorageInterface _secureStore; late Biometrics biometrics; + int pinCount = 1; + @override initState() { _secureStore = ref.read(secureStoreProvider); biometrics = widget.biometrics; + super.initState(); } @@ -71,11 +85,13 @@ class _CreatePinViewState extends ConsumerState { _pinPutController2.dispose(); _pinPutFocusNode1.dispose(); _pinPutFocusNode2.dispose(); + super.dispose(); } @override Widget build(BuildContext context) { + // int pinCount = 1; return Background( child: Scaffold( backgroundColor: Theme.of(context).extension()!.background, @@ -116,7 +132,7 @@ class _CreatePinViewState extends ConsumerState { height: 36, ), CustomPinPut( - fieldsCount: Constants.pinLength, + fieldsCount: pinCount, eachFieldHeight: 12, eachFieldWidth: 12, textStyle: STextStyles.label(context).copyWith( @@ -140,21 +156,23 @@ class _CreatePinViewState extends ConsumerState { ), isRandom: ref.read(prefsChangeNotifierProvider).randomizePIN, - submittedFieldDecoration: _pinPutDecoration.copyWith( - color: Theme.of(context) - .extension()! - .infoItemIcons, - border: Border.all( - width: 1, - color: Theme.of(context) - .extension()! - .infoItemIcons, - ), - ), + submittedFieldDecoration: _pinPutDecoration, selectedFieldDecoration: _pinPutDecoration, followingFieldDecoration: _pinPutDecoration, + onPinLengthChanged: (newLength) { + setState(() { + pinCount = newLength; + }); + }, onSubmit: (String pin) { - if (pin.length == Constants.pinLength) { + if (pin.length < 4) { + showFloatingFlushBar( + type: FlushBarType.warning, + message: "PIN not long enough!", + iconAsset: Assets.svg.alertCircle, + context: context, + ); + } else { _pageController.nextPage( duration: const Duration(milliseconds: 300), curve: Curves.linear, @@ -184,7 +202,7 @@ class _CreatePinViewState extends ConsumerState { height: 36, ), CustomPinPut( - fieldsCount: Constants.pinLength, + fieldsCount: pinCount, eachFieldHeight: 12, eachFieldWidth: 12, textStyle: STextStyles.infoSmall(context).copyWith( diff --git a/lib/pages/pinpad_views/lock_screen_view.dart b/lib/pages/pinpad_views/lock_screen_view.dart index 802488fca..dd7ca3aa9 100644 --- a/lib/pages/pinpad_views/lock_screen_view.dart +++ b/lib/pages/pinpad_views/lock_screen_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -13,7 +23,6 @@ import 'package:stackwallet/themes/stack_colors.dart'; // import 'package:stackwallet/providers/global/should_show_lockscreen_on_resume_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/biometrics.dart'; -import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; import 'package:stackwallet/utilities/show_loading.dart'; @@ -189,10 +198,11 @@ class _LockscreenViewState extends ConsumerState { BoxDecoration get _pinPutDecoration { return BoxDecoration( - color: Theme.of(context).extension()!.textSubtitle2, + color: Theme.of(context).extension()!.infoItemIcons, border: Border.all( - width: 1, - color: Theme.of(context).extension()!.textSubtitle2), + width: 1, + color: Theme.of(context).extension()!.infoItemIcons, + ), borderRadius: BorderRadius.circular(6), ); } @@ -202,6 +212,7 @@ class _LockscreenViewState extends ConsumerState { late SecureStorageInterface _secureStore; late Biometrics biometrics; + int pinCount = 1; Widget get _body => Background( child: SafeArea( @@ -274,13 +285,7 @@ class _LockscreenViewState extends ConsumerState { height: 52, ), CustomPinPut( - // customKey: CustomKey( - // onPressed: _checkUseBiometrics, - // iconAssetName: Platform.isIOS - // ? Assets.svg.faceId - // : Assets.svg.fingerprint, - // ), - fieldsCount: Constants.pinLength, + fieldsCount: pinCount, eachFieldHeight: 12, eachFieldWidth: 12, textStyle: STextStyles.label(context).copyWith( @@ -302,19 +307,7 @@ class _LockscreenViewState extends ConsumerState { .background, counterText: "", ), - submittedFieldDecoration: _pinPutDecoration.copyWith( - color: Theme.of(context) - .extension()! - .infoItemIcons, - border: Border.all( - width: 1, - color: Theme.of(context) - .extension()! - .infoItemIcons, - ), - ), - selectedFieldDecoration: _pinPutDecoration, - followingFieldDecoration: _pinPutDecoration, + submittedFieldDecoration: _pinPutDecoration, isRandom: ref .read(prefsChangeNotifierProvider) .randomizePIN, diff --git a/lib/pages/receive_view/addresses/address_card.dart b/lib/pages/receive_view/addresses/address_card.dart index 6a8abd78d..05c645352 100644 --- a/lib/pages/receive_view/addresses/address_card.dart +++ b/lib/pages/receive_view/addresses/address_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages/receive_view/addresses/address_details_view.dart b/lib/pages/receive_view/addresses/address_details_view.dart index 1a98c989d..75d41b073 100644 --- a/lib/pages/receive_view/addresses/address_details_view.dart +++ b/lib/pages/receive_view/addresses/address_details_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:isar/isar.dart'; @@ -77,7 +87,7 @@ class _AddressDetailsViewState extends ConsumerState { Center( child: RepaintBoundary( key: _qrKey, - child: QrImage( + child: QrImageView( data: AddressUtils.buildUriString( ref.watch(walletsChangeNotifierProvider.select( (value) => @@ -266,7 +276,7 @@ class _AddressDetailsViewState extends ConsumerState { Center( child: RepaintBoundary( key: _qrKey, - child: QrImage( + child: QrImageView( data: AddressUtils.buildUriString( ref.watch(walletsChangeNotifierProvider.select( (value) => diff --git a/lib/pages/receive_view/addresses/address_qr_popup.dart b/lib/pages/receive_view/addresses/address_qr_popup.dart index 65f0e7977..6e0c2e15b 100644 --- a/lib/pages/receive_view/addresses/address_qr_popup.dart +++ b/lib/pages/receive_view/addresses/address_qr_popup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; import 'dart:ui' as ui; @@ -126,7 +136,7 @@ class _AddressQrPopupState extends State { Center( child: RepaintBoundary( key: _qrKey, - child: QrImage( + child: QrImageView( data: AddressUtils.buildUriString( widget.coin, widget.addressString, diff --git a/lib/pages/receive_view/addresses/address_tag.dart b/lib/pages/receive_view/addresses/address_tag.dart index 0c78a2f2e..ceb9c35c8 100644 --- a/lib/pages/receive_view/addresses/address_tag.dart +++ b/lib/pages/receive_view/addresses/address_tag.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_native_splash/cli_commands.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/receive_view/addresses/edit_address_label_view.dart b/lib/pages/receive_view/addresses/edit_address_label_view.dart index 53ddada96..75549c807 100644 --- a/lib/pages/receive_view/addresses/edit_address_label_view.dart +++ b/lib/pages/receive_view/addresses/edit_address_label_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:isar/isar.dart'; diff --git a/lib/pages/receive_view/addresses/wallet_addresses_view.dart b/lib/pages/receive_view/addresses/wallet_addresses_view.dart index f90221bcf..81a6cecd7 100644 --- a/lib/pages/receive_view/addresses/wallet_addresses_view.dart +++ b/lib/pages/receive_view/addresses/wallet_addresses_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart b/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart index bc1281156..4fd9d0cf1 100644 --- a/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart +++ b/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; import 'dart:typed_data'; @@ -150,6 +160,7 @@ class _GenerateUriQrCodeViewState extends State { String receivingAddress = widget.receivingAddress; if ((widget.coin == Coin.bitcoincash || + widget.coin == Coin.eCash || widget.coin == Coin.bitcoincashTestnet) && receivingAddress.contains(":")) { // remove cash addr prefix @@ -200,7 +211,7 @@ class _GenerateUriQrCodeViewState extends State { child: SizedBox( width: width + 20, height: width + 20, - child: QrImage( + child: QrImageView( data: uriString, size: width, backgroundColor: @@ -246,6 +257,7 @@ class _GenerateUriQrCodeViewState extends State { String receivingAddress = widget.receivingAddress; if ((widget.coin == Coin.bitcoincash || + widget.coin == Coin.eCash || widget.coin == Coin.bitcoincashTestnet) && receivingAddress.contains(":")) { // remove cash addr prefix @@ -541,7 +553,7 @@ class _GenerateUriQrCodeViewState extends State { child: SizedBox( width: 234, height: 234, - child: QrImage( + child: QrImageView( data: _uriString, size: 220, backgroundColor: Theme.of(context) diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index bd2f6b70e..063f2b2cd 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -293,11 +303,17 @@ class _ReceiveViewState extends ConsumerState { ), ), ), - if (coin != Coin.epicCash && coin != Coin.ethereum) + if (coin != Coin.epicCash && + coin != Coin.ethereum && + coin != Coin.banano && + coin != Coin.nano) const SizedBox( height: 12, ), - if (coin != Coin.epicCash && coin != Coin.ethereum) + if (coin != Coin.epicCash && + coin != Coin.ethereum && + coin != Coin.banano && + coin != Coin.nano) TextButton( onPressed: generateNewAddress, style: Theme.of(context) @@ -320,7 +336,7 @@ class _ReceiveViewState extends ConsumerState { child: Center( child: Column( children: [ - QrImage( + QrImageView( data: "${coin.uriScheme}:$receivingAddress", size: MediaQuery.of(context).size.width / 2, foregroundColor: Theme.of(context) diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index e07064d39..62ab5cbb6 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -22,6 +32,7 @@ import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -277,13 +288,15 @@ class _ConfirmTransactionViewState final managerProvider = ref.watch(walletsChangeNotifierProvider .select((value) => value.getManagerProvider(walletId))); + final coin = ref.watch(walletsChangeNotifierProvider + .select((value) => value.getManager(walletId).coin)); + final String unit; if (widget.isTokenTx) { unit = ref.watch( tokenServiceProvider.select((value) => value!.tokenContract.symbol)); } else { - unit = ref.watch(walletsChangeNotifierProvider - .select((value) => value.getManager(walletId).coin.ticker)); + unit = coin.ticker; } return ConditionalParent( @@ -411,50 +424,50 @@ class _ConfirmTransactionViewState style: STextStyles.smallMed12(context), ), Text( - "${(transactionInfo["recipientAmt"] as Amount).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select((value) => value.locale), - ), - )} $unit", - style: STextStyles.itemSubtitle12(context), - textAlign: TextAlign.right, - ), - ], - ), - ), - const SizedBox( - height: 12, - ), - RoundedWhiteContainer( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Transaction fee", - style: STextStyles.smallMed12(context), - ), - Text( - "${(transactionInfo["fee"] is Amount ? transactionInfo["fee"] as Amount : (transactionInfo["fee"] as int).toAmountAsRaw( - fractionDigits: ref.watch( - managerProvider.select( - (value) => value.coin.decimals, - ), + ref.watch(pAmountFormatter(coin)).format( + transactionInfo["recipientAmt"] as Amount, + ethContract: ref + .watch(tokenServiceProvider) + ?.tokenContract, ), - )).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select((value) => value.locale), - ), - )} ${ref.watch( - managerProvider.select((value) => value.coin), - ).ticker}", style: STextStyles.itemSubtitle12(context), textAlign: TextAlign.right, ), ], ), ), + if (coin != Coin.banano && coin != Coin.nano) + const SizedBox( + height: 12, + ), + if (coin != Coin.banano && coin != Coin.nano) + RoundedWhiteContainer( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Transaction fee", + style: STextStyles.smallMed12(context), + ), + Text( + ref.watch(pAmountFormatter(coin)).format( + (transactionInfo["fee"] is Amount + ? transactionInfo["fee"] as Amount + : (transactionInfo["fee"] as int) + .toAmountAsRaw( + fractionDigits: ref.watch( + managerProvider.select( + (value) => value.coin.decimals, + ), + ), + )), + ), + style: STextStyles.itemSubtitle12(context), + textAlign: TextAlign.right, + ), + ], + ), + ), const SizedBox( height: 12, ), @@ -585,7 +598,7 @@ class _ConfirmTransactionViewState if (price > Decimal.zero) { fiatAmount = (amount.decimal * price) .toAmount(fractionDigits: 2) - .localizedStringAsFixed( + .fiatString( locale: ref .read( localeServiceChangeNotifierProvider) @@ -597,12 +610,11 @@ class _ConfirmTransactionViewState return Row( children: [ Text( - "${amount.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select((value) => value.locale), - ), - )} $unit", + ref.watch(pAmountFormatter(coin)).format( + amount, + ethContract: ref + .read(tokenServiceProvider) + ?.tokenContract), style: STextStyles .desktopTextExtraExtraSmall( context) @@ -712,14 +724,9 @@ class _ConfirmTransactionViewState ); return Text( - "${fee.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => value.locale, - ), - ), - )} ${coin.ticker}", + ref + .watch(pAmountFormatter(coin)) + .format(fee), style: STextStyles.desktopTextExtraExtraSmall( context) @@ -892,13 +899,7 @@ class _ConfirmTransactionViewState ); return Text( - "${fee.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - )} ${coin.ticker}", + ref.watch(pAmountFormatter(coin)).format(fee), style: STextStyles.itemSubtitle(context), ); }, @@ -952,18 +953,13 @@ class _ConfirmTransactionViewState ? transactionInfo["fee"] as Amount : (transactionInfo["fee"] as int) .toAmountAsRaw(fractionDigits: coin.decimals); - final locale = ref.watch( - localeServiceChangeNotifierProvider - .select((value) => value.locale), - ); + final amount = transactionInfo["recipientAmt"] as Amount; return Text( - "${(amount + fee).localizedStringAsFixed( - locale: locale, - )} ${ref.watch( - managerProvider.select((value) => value.coin), - ).ticker}", + ref + .watch(pAmountFormatter(coin)) + .format(amount + fee), style: isDesktop ? STextStyles.desktopTextExtraExtraSmall(context) .copyWith( diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 3d98309be..5ce6ccbb0 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -1,5 +1,16 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; +import 'dart:math'; import 'package:bip47/bip47.dart'; import 'package:cw_core/monero_transaction_priority.dart'; @@ -29,6 +40,8 @@ import 'package:stackwallet/themes/coin_icon_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; @@ -114,14 +127,26 @@ class _SendViewState extends ConsumerState { void _cryptoAmountChanged() async { if (!_cryptoAmountChangeLock) { - final String cryptoAmount = cryptoAmountController.text; + String cryptoAmount = cryptoAmountController.text; if (cryptoAmount.isNotEmpty && cryptoAmount != "." && cryptoAmount != ",") { + if (cryptoAmount.startsWith("~")) { + cryptoAmount = cryptoAmount.substring(1); + } + if (cryptoAmount.contains(" ")) { + cryptoAmount = cryptoAmount.split(" ").first; + } + + // ensure we don't shift past minimum atomic value + final shift = min(ref.read(pAmountUnit(coin)).shift, coin.decimals); + _amountToSend = cryptoAmount.contains(",") ? Decimal.parse(cryptoAmount.replaceFirst(",", ".")) + .shift(0 - shift) .toAmount(fractionDigits: coin.decimals) : Decimal.parse(cryptoAmount) + .shift(0 - shift) .toAmount(fractionDigits: coin.decimals); if (_cachedAmountToSend != null && _cachedAmountToSend == _amountToSend) { @@ -139,7 +164,7 @@ class _SendViewState extends ConsumerState { .toAmount( fractionDigits: 2, ) - .localizedStringAsFixed( + .fiatString( locale: ref.read(localeServiceChangeNotifierProvider).locale, ); } @@ -188,6 +213,15 @@ class _SendViewState extends ConsumerState { late Amount _currentFee; void _setCurrentFee(String fee, bool shouldSetState) { + fee = fee.trim(); + + if (fee.startsWith("~")) { + fee = fee.substring(1); + } + if (fee.contains(" ")) { + fee = fee.split(" ").first; + } + final value = fee.contains(",") ? Decimal.parse(fee.replaceFirst(",", ".")) .toAmount(fractionDigits: coin.decimals) @@ -268,7 +302,6 @@ class _SendViewState extends ConsumerState { break; } - final String locale = ref.read(localeServiceChangeNotifierProvider).locale; Amount fee; if (coin == Coin.monero) { MoneroTransactionPriority specialMoneroId; @@ -285,7 +318,11 @@ class _SendViewState extends ConsumerState { } fee = await manager.estimateFeeFor(amount, specialMoneroId.raw!); - cachedFees[amount] = fee.localizedStringAsFixed(locale: locale); + cachedFees[amount] = ref.read(pAmountFormatter(coin)).format( + fee, + withUnitName: true, + indicatePrecisionLoss: false, + ); return cachedFees[amount]!; } else if (coin == Coin.firo || coin == Coin.firoTestNet) { @@ -293,22 +330,32 @@ class _SendViewState extends ConsumerState { "Private") { fee = await manager.estimateFeeFor(amount, feeRate); - cachedFiroPrivateFees[amount] = - fee.localizedStringAsFixed(locale: locale); + cachedFiroPrivateFees[amount] = ref.read(pAmountFormatter(coin)).format( + fee, + withUnitName: true, + indicatePrecisionLoss: false, + ); return cachedFiroPrivateFees[amount]!; } else { fee = await (manager.wallet as FiroWallet) .estimateFeeForPublic(amount, feeRate); - cachedFiroPublicFees[amount] = - fee.localizedStringAsFixed(locale: locale); + cachedFiroPublicFees[amount] = ref.read(pAmountFormatter(coin)).format( + fee, + withUnitName: true, + indicatePrecisionLoss: false, + ); return cachedFiroPublicFees[amount]!; } } else { fee = await manager.estimateFeeFor(amount, feeRate); - cachedFees[amount] = fee.localizedStringAsFixed(locale: locale); + cachedFees[amount] = ref.read(pAmountFormatter(coin)).format( + fee, + withUnitName: true, + indicatePrecisionLoss: false, + ); return cachedFees[amount]!; } @@ -327,9 +374,9 @@ class _SendViewState extends ConsumerState { balance = wallet.availablePublicBalance(); } - return balance.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - ); + return ref.read(pAmountFormatter(coin)).format( + balance, + ); } return null; @@ -587,7 +634,15 @@ class _SendViewState extends ConsumerState { if (_data != null) { if (_data!.amount != null) { - cryptoAmountController.text = _data!.amount!.toString(); + final amount = Amount.fromDecimal( + _data!.amount!, + fractionDigits: coin.decimals, + ); + + cryptoAmountController.text = ref.read(pAmountFormatter(coin)).format( + amount, + withUnitName: false, + ); } sendToController.text = _data!.contactLabel; _address = _data!.address.trim(); @@ -831,10 +886,12 @@ class _SendViewState extends ConsumerState { if (_cachedBalance != null) { return GestureDetector( onTap: () { - cryptoAmountController.text = - _cachedBalance! - .localizedStringAsFixed( - locale: locale); + cryptoAmountController.text = ref + .read(pAmountFormatter(coin)) + .format( + _cachedBalance!, + withUnitName: false, + ); }, child: Container( color: Colors.transparent, @@ -843,9 +900,10 @@ class _SendViewState extends ConsumerState { CrossAxisAlignment.end, children: [ Text( - "${_cachedBalance!.localizedStringAsFixed( - locale: locale, - )} ${coin.ticker}", + ref + .watch(pAmountFormatter( + coin)) + .format(_cachedBalance!), style: STextStyles.titleBold12( context) @@ -857,7 +915,7 @@ class _SendViewState extends ConsumerState { Text( "${(_cachedBalance!.decimal * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getPrice(coin).item1))).toAmount( fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: locale, )} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}", style: STextStyles.subtitle( @@ -917,10 +975,32 @@ class _SendViewState extends ConsumerState { const SizedBox( height: 16, ), - Text( - isPaynymSend ? "Send to PayNym address" : "Send to", - style: STextStyles.smallMed12(context), - textAlign: TextAlign.left, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + isPaynymSend + ? "Send to PayNym address" + : "Send to", + style: STextStyles.smallMed12(context), + textAlign: TextAlign.left, + ), + // if (coin == Coin.monero) + // CustomTextButton( + // text: "Use OpenAlias", + // onTap: () async { + // await showModalBottomSheet( + // context: context, + // builder: (context) => + // OpenAliasBottomSheet( + // onSelected: (address) { + // sendToController.text = address; + // }, + // ), + // ); + // }, + // ), + ], ), const SizedBox( height: 8, @@ -1149,10 +1229,15 @@ class _SendViewState extends ConsumerState { ); cryptoAmountController .text = - amount - .localizedStringAsFixed( - locale: locale, - ); + ref + .read( + pAmountFormatter( + coin)) + .format( + amount, + withUnitName: + false, + ); _amountToSend = amount; } @@ -1340,7 +1425,7 @@ class _SendViewState extends ConsumerState { _privateBalanceString != null) { return Text( - "$_privateBalanceString ${coin.ticker}", + "$_privateBalanceString", style: STextStyles .itemSubtitle(context), ); @@ -1353,7 +1438,7 @@ class _SendViewState extends ConsumerState { _publicBalanceString != null) { return Text( - "$_publicBalanceString ${coin.ticker}", + "$_publicBalanceString", style: STextStyles .itemSubtitle(context), ); @@ -1413,23 +1498,32 @@ class _SendViewState extends ConsumerState { .state) .state == "Private") { - cryptoAmountController.text = firoWallet - .availablePrivateBalance() - .localizedStringAsFixed( - locale: locale); + cryptoAmountController.text = ref + .read(pAmountFormatter(coin)) + .format( + firoWallet + .availablePrivateBalance(), + withUnitName: false, + ); } else { - cryptoAmountController.text = firoWallet - .availablePublicBalance() - .localizedStringAsFixed( - locale: locale); + cryptoAmountController.text = ref + .read(pAmountFormatter(coin)) + .format( + firoWallet + .availablePublicBalance(), + withUnitName: false, + ); } } else { cryptoAmountController.text = ref - .read(provider) - .balance - .spendable - .localizedStringAsFixed( - locale: locale); + .read(pAmountFormatter(coin)) + .format( + ref + .read(provider) + .balance + .spendable, + withUnitName: false, + ); } _cryptoAmountChanged(); }, @@ -1482,7 +1576,9 @@ class _SendViewState extends ConsumerState { child: Padding( padding: const EdgeInsets.all(12), child: Text( - coin.ticker, + ref + .watch(pAmountUnit(coin)) + .unitForCoin(coin), style: STextStyles.smallMed14(context) .copyWith( color: Theme.of(context) @@ -1568,12 +1664,10 @@ class _SendViewState extends ConsumerState { level: LogLevel.Info); final amountString = - _amountToSend!.localizedStringAsFixed( - locale: ref - .read( - localeServiceChangeNotifierProvider) - .locale, - ); + ref.read(pAmountFormatter(coin)).format( + _amountToSend!, + withUnitName: false, + ); _cryptoAmountChangeLock = true; cryptoAmountController.text = amountString; @@ -1806,6 +1900,8 @@ class _SendViewState extends ConsumerState { amount: (Decimal.tryParse( cryptoAmountController .text) ?? + _amountToSend + ?.decimal ?? Decimal.zero) .toAmount( fractionDigits: coin.decimals, @@ -1845,7 +1941,7 @@ class _SendViewState extends ConsumerState { false, ); return Text( - "~${snapshot.data! as String} ${coin.ticker}", + "~${snapshot.data! as String}", style: STextStyles .itemSubtitle( context), @@ -1902,7 +1998,7 @@ class _SendViewState extends ConsumerState { false, ); return Text( - "~${snapshot.data! as String} ${coin.ticker}", + "~${snapshot.data! as String}", style: STextStyles .itemSubtitle( context), diff --git a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart index d930cd3ae..a8dfe643b 100644 --- a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart +++ b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart b/lib/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart index 175e1442a..ddec09d91 100644 --- a/lib/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart +++ b/lib/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart @@ -1,11 +1,21 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/wallet/public_private_balance_state_provider.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; -import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; class FiroBalanceSelectionSheet extends ConsumerStatefulWidget { @@ -152,14 +162,11 @@ class _FiroBalanceSelectionSheetState width: 2, ), Text( - "${firoWallet.availablePrivateBalance().localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => value.locale, - ), - ), - )} ${manager.coin.ticker}", + ref + .watch(pAmountFormatter(manager.coin)) + .format( + firoWallet.availablePrivateBalance(), + ), style: STextStyles.itemSubtitle(context), textAlign: TextAlign.left, ), @@ -233,14 +240,11 @@ class _FiroBalanceSelectionSheetState width: 2, ), Text( - "${firoWallet.availablePublicBalance().localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => value.locale, - ), - ), - )} ${manager.coin.ticker}", + ref + .watch(pAmountFormatter(manager.coin)) + .format( + firoWallet.availablePublicBalance(), + ), style: STextStyles.itemSubtitle(context), textAlign: TextAlign.left, ), diff --git a/lib/pages/send_view/sub_widgets/openalias_sheet.dart b/lib/pages/send_view/sub_widgets/openalias_sheet.dart new file mode 100644 index 000000000..d2bf5d302 --- /dev/null +++ b/lib/pages/send_view/sub_widgets/openalias_sheet.dart @@ -0,0 +1,151 @@ +// /* +// * This file is part of Stack Wallet. +// * +// * Copyright (c) 2023 Cypher Stack +// * All Rights Reserved. +// * The code is distributed under GPLv3 license, see LICENSE file for details. +// * Generated by Cypher Stack on 2023-05-26 +// * +// */ +// +// import 'package:basic_utils/basic_utils.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter_riverpod/flutter_riverpod.dart'; +// import 'package:stackwallet/themes/stack_colors.dart'; +// import 'package:stackwallet/utilities/constants.dart'; +// import 'package:stackwallet/utilities/text_styles.dart'; +// +// class OpenAliasBottomSheet extends ConsumerStatefulWidget { +// const OpenAliasBottomSheet({ +// Key? key, +// required this.onSelected, +// }) : super(key: key); +// +// final Null Function(String) onSelected; +// +// @override +// ConsumerState createState() => +// _OpenAliasBottomSheetState(); +// } +// +// class _OpenAliasBottomSheetState extends ConsumerState { +// late TextEditingController textEditingController; +// +// @override +// void initState() { +// super.initState(); +// textEditingController = TextEditingController(); +// } +// +// @override +// Widget build(BuildContext context) { +// return SingleChildScrollView( +// child: Padding( +// padding: +// EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), +// child: Container( +// decoration: BoxDecoration( +// color: Theme.of(context).extension()!.popupBG, +// borderRadius: const BorderRadius.vertical( +// top: Radius.circular(20), +// ), +// ), +// child: Padding( +// padding: const EdgeInsets.only( +// top: 20, +// left: 20, +// right: 20, +// bottom: 20, +// ), +// child: Column( +// mainAxisSize: MainAxisSize.min, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Center( +// child: Container( +// decoration: BoxDecoration( +// color: Theme.of(context) +// .extension()! +// .textFieldDefaultBG, +// borderRadius: BorderRadius.circular( +// Constants.size.circularBorderRadius, +// ), +// ), +// width: 60, +// height: 4, +// ), +// ), +// const SizedBox( +// height: 36, +// ), +// Text( +// 'OpenAlias Address', +// style: STextStyles.smallMed12(context), +// textAlign: TextAlign.left, +// ), +// const SizedBox( +// height: 8, +// ), +// TextField( +// controller: textEditingController, +// decoration: const InputDecoration( +// border: OutlineInputBorder(), +// ), +// ), +// const SizedBox( +// height: 16, +// ), +// Align( +// alignment: Alignment.bottomCenter, +// child: ConstrainedBox( +// constraints: const BoxConstraints( +// minWidth: 480, +// minHeight: 70, +// ), +// child: TextButton( +// style: Theme.of(context) +// .extension()! +// .getPrimaryEnabledButtonStyle(context), +// onPressed: () async { +// String text = textEditingController.text +// .trim() +// .replaceAll("@", "."); +// List? result = +// await DnsUtils.lookupRecord(text, RRecordType.TXT); +// String address = ""; +// if (result != null && result.isNotEmpty) { +// for (RRecord record in result) { +// if (record.data.startsWith("oa1:xmr")) { +// List datas = record.data.split(" "); +// for (String data in datas) { +// if (data.startsWith("recipient_address=")) { +// address = data +// .substring("recipient_address=".length) +// .replaceAll(";", ""); +// break; +// } +// } +// break; +// } +// } +// } +// widget.onSelected(address); +// if (mounted) { +// Navigator.of(context).pop(); +// } +// }, +// child: Text( +// "Enter", +// style: STextStyles.button(context), +// ), +// ), +// ), +// ) +// ], +// ), +// ), +// ), +// ), +// ); +// } +// } diff --git a/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart b/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart index 2442a7324..0376e9e3d 100644 --- a/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart +++ b/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart b/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart index f2458349e..cc3edbe7b 100644 --- a/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart +++ b/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart @@ -1,5 +1,14 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:cw_core/monero_transaction_priority.dart'; -import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/paymint/fee_object_model.dart'; @@ -10,6 +19,7 @@ import 'package:stackwallet/providers/wallet/public_private_balance_state_provid import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; @@ -325,20 +335,21 @@ class _TransactionFeeSelectionSheetState feeRate: feeObject!.fast, amount: amount, ), - // future: manager.estimateFeeFor( - // Format.decimalAmountToSatoshis( - // amount), - // feeObject!.fast), builder: (_, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { return Text( - "(~${snapshot.data!.decimal.toStringAsFixed( - manager.coin.decimals, - )}" - " ${manager.coin.ticker})", + "(~${ref.watch( + pAmountFormatter( + manager.coin, + ), + ).format( + snapshot.data!, + indicatePrecisionLoss: + false, + )})", style: STextStyles.itemSubtitle( context), textAlign: TextAlign.left, @@ -461,18 +472,21 @@ class _TransactionFeeSelectionSheetState feeRate: feeObject!.medium, amount: amount, ), - // future: manager.estimateFeeFor( - // Format.decimalAmountToSatoshis( - // amount), - // feeObject!.fast), builder: (_, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { return Text( - "(~${snapshot.data!.decimal.toStringAsFixed(manager.coin.decimals)}" - " ${manager.coin.ticker})", + "(~${ref.watch( + pAmountFormatter( + manager.coin, + ), + ).format( + snapshot.data!, + indicatePrecisionLoss: + false, + )})", style: STextStyles.itemSubtitle( context), textAlign: TextAlign.left, @@ -596,17 +610,21 @@ class _TransactionFeeSelectionSheetState feeRate: feeObject!.slow, amount: amount, ), - // future: manager.estimateFeeFor( - // Format.decimalAmountToSatoshis( - // amount), - // feeObject!.fast), builder: (_, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { return Text( - "(~${snapshot.data!.decimal.toStringAsFixed(manager.coin.decimals)} ${manager.coin.ticker})", + "(~${ref.watch( + pAmountFormatter( + manager.coin, + ), + ).format( + snapshot.data!, + indicatePrecisionLoss: + false, + )})", style: STextStyles.itemSubtitle( context), textAlign: TextAlign.left, @@ -669,25 +687,31 @@ class _TransactionFeeSelectionSheetState switch (feeRateType) { case FeeRateType.fast: if (ref.read(feeSheetSessionCacheProvider).fast[amount] != null) { - return (ref.read(feeSheetSessionCacheProvider).fast[amount] - as Decimal) - .toStringAsFixed(coin.decimals); + return ref.read(pAmountFormatter(coin)).format( + ref.read(feeSheetSessionCacheProvider).fast[amount]!, + indicatePrecisionLoss: false, + withUnitName: false, + ); } return null; case FeeRateType.average: if (ref.read(feeSheetSessionCacheProvider).average[amount] != null) { - return (ref.read(feeSheetSessionCacheProvider).average[amount] - as Decimal) - .toStringAsFixed(coin.decimals); + return ref.read(pAmountFormatter(coin)).format( + ref.read(feeSheetSessionCacheProvider).average[amount]!, + indicatePrecisionLoss: false, + withUnitName: false, + ); } return null; case FeeRateType.slow: if (ref.read(feeSheetSessionCacheProvider).slow[amount] != null) { - return (ref.read(feeSheetSessionCacheProvider).slow[amount] - as Decimal) - .toStringAsFixed(coin.decimals); + return ref.read(pAmountFormatter(coin)).format( + ref.read(feeSheetSessionCacheProvider).slow[amount]!, + indicatePrecisionLoss: false, + withUnitName: false, + ); } return null; } diff --git a/lib/pages/send_view/token_send_view.dart b/lib/pages/send_view/token_send_view.dart index d0eb505a2..4aa3a2225 100644 --- a/lib/pages/send_view/token_send_view.dart +++ b/lib/pages/send_view/token_send_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:decimal/decimal.dart'; @@ -20,6 +30,7 @@ import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; @@ -166,9 +177,11 @@ class _TokenSendViewState extends ConsumerState { final Amount amount = Decimal.parse(results["amount"]!).toAmount( fractionDigits: tokenContract.decimals, ); - cryptoAmountController.text = amount.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - ); + cryptoAmountController.text = ref.read(pAmountFormatter(coin)).format( + amount, + withUnitName: false, + indicatePrecisionLoss: false, + ); _amountToSend = amount; } @@ -238,9 +251,10 @@ class _TokenSendViewState extends ConsumerState { level: LogLevel.Info); _cryptoAmountChangeLock = true; - cryptoAmountController.text = _amountToSend!.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - ); + cryptoAmountController.text = ref.read(pAmountFormatter(coin)).format( + _amountToSend!, + withUnitName: false, + ); _cryptoAmountChangeLock = false; } else { _amountToSend = Amount.zero; @@ -258,10 +272,17 @@ class _TokenSendViewState extends ConsumerState { void _cryptoAmountChanged() async { if (!_cryptoAmountChangeLock) { - final String cryptoAmount = cryptoAmountController.text; + String cryptoAmount = cryptoAmountController.text; if (cryptoAmount.isNotEmpty && cryptoAmount != "." && cryptoAmount != ",") { + if (cryptoAmount.startsWith("~")) { + cryptoAmount = cryptoAmount.substring(1); + } + if (cryptoAmount.contains(" ")) { + cryptoAmount = cryptoAmount.split(" ").first; + } + _amountToSend = Amount.fromDecimal( cryptoAmount.contains(",") ? Decimal.parse(cryptoAmount.replaceFirst(",", ".")) @@ -285,7 +306,7 @@ class _TokenSendViewState extends ConsumerState { .toAmount( fractionDigits: 2, ) - .localizedStringAsFixed( + .fiatString( locale: ref.read(localeServiceChangeNotifierProvider).locale, ); } @@ -356,9 +377,11 @@ class _TokenSendViewState extends ConsumerState { } final Amount fee = wallet.estimateFeeFor(feeRate); - cachedFees = fee.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - ); + cachedFees = ref.read(pAmountFormatter(coin)).format( + fee, + withUnitName: true, + indicatePrecisionLoss: false, + ); return cachedFees; } @@ -674,14 +697,15 @@ class _TokenSendViewState extends ConsumerState { GestureDetector( onTap: () { cryptoAmountController.text = ref - .read(tokenServiceProvider)! - .balance - .spendable - .localizedStringAsFixed( - locale: ref - .read( - localeServiceChangeNotifierProvider) - .locale, + .watch(pAmountFormatter(coin)) + .format( + ref + .read(tokenServiceProvider)! + .balance + .spendable, + ethContract: tokenContract, + withUnitName: false, + indicatePrecisionLoss: true, ); }, child: Container( @@ -691,20 +715,22 @@ class _TokenSendViewState extends ConsumerState { CrossAxisAlignment.end, children: [ Text( - "${ref.watch( - tokenServiceProvider.select( - (value) => value! - .balance.spendable - .localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => value.locale, + ref + .watch(pAmountFormatter(coin)) + .format( + ref.watch( + tokenServiceProvider.select( + (value) => value! + .balance.spendable, + ), + ), + ethContract: ref.watch( + tokenServiceProvider.select( + (value) => + value!.tokenContract, ), ), ), - ), - )} ${tokenContract.symbol}", style: STextStyles.titleBold12(context) .copyWith( @@ -715,7 +741,7 @@ class _TokenSendViewState extends ConsumerState { Text( "${(ref.watch(tokenServiceProvider.select((value) => value!.balance.spendable.decimal)) * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getTokenPrice(tokenContract.address).item1))).toAmount( fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: locale, )} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}", style: STextStyles.subtitle(context) @@ -1159,7 +1185,7 @@ class _TokenSendViewState extends ConsumerState { ConnectionState.done && snapshot.hasData) { return Text( - "~${snapshot.data! as String} ${coin.ticker}", + "~${snapshot.data! as String}", style: STextStyles.itemSubtitle( context), diff --git a/lib/pages/settings_views/global_settings_view/about_view.dart b/lib/pages/settings_views/global_settings_view/about_view.dart index 89e555418..5daa1e81a 100644 --- a/lib/pages/settings_views/global_settings_view/about_view.dart +++ b/lib/pages/settings_views/global_settings_view/about_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:flutter/gestures.dart'; diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart b/lib/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart index 3285d61cf..dcc3ec5d5 100644 --- a/lib/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart @@ -1,6 +1,17 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/debug_view.dart'; +import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/manage_coin_units_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/manage_explorer_view.dart'; import 'package:stackwallet/pages/stack_privacy_calls.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; @@ -261,6 +272,41 @@ class AdvancedSettingsView extends StatelessWidget { ), ), ), + const SizedBox( + height: 8, + ), + RoundedWhiteContainer( + padding: const EdgeInsets.all(0), + child: RawMaterialButton( + // splashColor: Theme.of(context).extension()!.highlight, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + onPressed: () { + Navigator.of(context).pushNamed( + ManageCoinUnitsView.routeName, + ); + }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 20, + ), + child: Row( + children: [ + Text( + "Units", + style: STextStyles.titleBold12(context), + textAlign: TextAlign.left, + ), + ], + ), + ), + ), + ), ], ), ), diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart b/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart index 1b7ffa6f9..622a4cafe 100644 --- a/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart +++ b/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/choose_unit_sheet.dart b/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/choose_unit_sheet.dart new file mode 100644 index 000000000..d5ef002b7 --- /dev/null +++ b/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/choose_unit_sheet.dart @@ -0,0 +1,144 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; +import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/text_styles.dart'; + +class ChooseUnitSheet extends ConsumerStatefulWidget { + const ChooseUnitSheet({ + Key? key, + required this.coin, + }) : super(key: key); + + final Coin coin; + + @override + ConsumerState createState() => _ChooseUnitSheetState(); +} + +class _ChooseUnitSheetState extends ConsumerState { + late AmountUnit _current; + late final List values; + + @override + void initState() { + values = AmountUnit.valuesForCoin(widget.coin); + _current = ref.read(pAmountUnit(widget.coin)); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Theme.of(context).extension()!.popupBG, + borderRadius: const BorderRadius.vertical( + top: Radius.circular(20), + ), + ), + child: Padding( + padding: const EdgeInsets.only( + left: 24, + right: 24, + top: 10, + bottom: 0, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + width: 60, + height: 4, + ), + ), + const SizedBox( + height: 36, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Coin units", + style: STextStyles.pageTitleH2(context), + textAlign: TextAlign.left, + ), + const SizedBox( + height: 16, + ), + for (int i = 0; i < values.length; i++) + Column( + children: [ + GestureDetector( + onTap: () { + setState(() { + _current = values[i]; + }); + + Navigator.of(context).pop(_current); + }, + child: Container( + color: Colors.transparent, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 20, + height: 20, + child: Radio( + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, + value: values[i], + groupValue: _current, + onChanged: (x) { + setState(() { + _current = values[i]; + }); + + Navigator.of(context).pop(_current); + }, + ), + ), + const SizedBox( + width: 12, + ), + Text( + values[i].unitForCoin(widget.coin), + style: STextStyles.titleBold12(context), + textAlign: TextAlign.left, + ), + ], + ), + ), + ), + const SizedBox( + height: 16, + ), + ], + ), + const SizedBox( + height: 8, + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/edit_coin_units_view.dart b/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/edit_coin_units_view.dart new file mode 100644 index 000000000..bf06ebd2c --- /dev/null +++ b/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/edit_coin_units_view.dart @@ -0,0 +1,343 @@ +import 'package:dropdown_button2/dropdown_button2.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/choose_unit_sheet.dart'; +import 'package:stackwallet/providers/global/prefs_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; +import 'package:stackwallet/utilities/assets.dart'; +import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/util.dart'; +import 'package:stackwallet/widgets/background.dart'; +import 'package:stackwallet/widgets/conditional_parent.dart'; +import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; +import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; +import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; +import 'package:stackwallet/widgets/desktop/primary_button.dart'; +import 'package:stackwallet/widgets/desktop/secondary_button.dart'; +import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; +import 'package:stackwallet/widgets/stack_text_field.dart'; +import 'package:stackwallet/widgets/textfield_icon_button.dart'; + +class EditCoinUnitsView extends ConsumerStatefulWidget { + const EditCoinUnitsView({ + Key? key, + required this.coin, + }) : super(key: key); + + final Coin coin; + + static const String routeName = "/editCoinUnitsView"; + + @override + ConsumerState createState() => _EditCoinUnitsViewState(); +} + +class _EditCoinUnitsViewState extends ConsumerState { + late final TextEditingController _decimalsController; + late final FocusNode _decimalsFocusNode; + + late AmountUnit _currentUnit; + + void onSave() { + final maxDecimals = int.tryParse(_decimalsController.text); + + if (maxDecimals == null) { + // TODO show dialog error thing + return; + } + + ref.read(prefsChangeNotifierProvider).updateAmountUnit( + coin: widget.coin, + amountUnit: _currentUnit, + ); + ref.read(prefsChangeNotifierProvider).updateMaxDecimals( + coin: widget.coin, + maxDecimals: maxDecimals, + ); + + Navigator.of(context).pop(); + } + + Future chooseUnit() async { + final chosenUnit = await showModalBottomSheet( + backgroundColor: Colors.transparent, + context: context, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(20), + ), + ), + builder: (_) { + return ChooseUnitSheet( + coin: widget.coin, + ); + }, + ); + + if (chosenUnit != null) { + setState(() { + _currentUnit = chosenUnit; + }); + } + } + + @override + void initState() { + _decimalsFocusNode = FocusNode(); + _decimalsController = TextEditingController() + ..text = ref.read(pMaxDecimals(widget.coin)).toString(); + _currentUnit = ref.read(pAmountUnit(widget.coin)); + super.initState(); + } + + @override + void dispose() { + _decimalsFocusNode.dispose(); + _decimalsController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return ConditionalParent( + condition: Util.isDesktop, + builder: (child) => DesktopDialog( + maxHeight: 350, + maxWidth: 500, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Edit ${widget.coin.prettyName} units", + style: STextStyles.desktopH3(context), + ), + ), + const DesktopDialogCloseButton(), + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only( + left: 32, + right: 32, + bottom: 32, + ), + child: child, + ), + ), + ], + ), + ), + child: ConditionalParent( + condition: !Util.isDesktop, + builder: (child) => Background( + child: Scaffold( + backgroundColor: + Theme.of(context).extension()!.background, + appBar: AppBar( + leading: AppBarBackButton( + onPressed: () { + Navigator.of(context).pop(); + }, + ), + title: Text( + "Edit ${widget.coin.prettyName} units", + style: STextStyles.navBarTitle(context), + ), + ), + body: Padding( + padding: const EdgeInsets.all(16), + child: child, + ), + ), + ), + child: Column( + children: [ + if (Util.isDesktop) + DropdownButtonHideUnderline( + child: DropdownButton2( + value: _currentUnit, + items: [ + ...AmountUnit.valuesForCoin(widget.coin).map( + (e) => DropdownMenuItem( + value: e, + child: Text( + e.unitForCoin(widget.coin), + style: STextStyles.desktopTextMedium(context), + ), + ), + ), + ], + onChanged: (value) { + if (value is AmountUnit) { + _currentUnit = value; + } + }, + isExpanded: true, + iconStyleData: IconStyleData( + icon: SvgPicture.asset( + Assets.svg.chevronDown, + width: 12, + height: 6, + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, + ), + ), + dropdownStyleData: DropdownStyleData( + offset: const Offset(0, -10), + elevation: 0, + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + ), + menuItemStyleData: const MenuItemStyleData( + padding: EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, + ), + ), + ), + ), + if (!Util.isDesktop) + Stack( + children: [ + TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop ? false : true, + // controller: _lengthController, + readOnly: true, + textInputAction: TextInputAction.none, + ), + Positioned.fill( + child: RawMaterialButton( + splashColor: + Theme.of(context).extension()!.highlight, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + onPressed: chooseUnit, + child: Padding( + padding: const EdgeInsets.only( + left: 12, + right: 17, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + _currentUnit.unitForCoin(widget.coin), + style: STextStyles.itemSubtitle12(context), + ), + SvgPicture.asset( + Assets.svg.chevronDown, + width: 14, + height: 6, + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, + ), + ], + ), + ), + ), + ) + ], + ), + SizedBox( + height: Util.isDesktop ? 24 : 8, + ), + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop ? false : true, + key: const Key("addCustomNodeNodeNameFieldKey"), + controller: _decimalsController, + focusNode: _decimalsFocusNode, + keyboardType: const TextInputType.numberWithOptions( + signed: false, + decimal: false, + ), + style: STextStyles.field(context), + decoration: standardInputDecoration( + "Maximum precision", + _decimalsFocusNode, + context, + ).copyWith( + labelStyle: + Util.isDesktop ? STextStyles.fieldLabel(context) : null, + suffixIcon: _decimalsController.text.isNotEmpty + ? Padding( + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + _decimalsController.text = ""; + setState(() {}); + }, + ), + ], + ), + ), + ) + : null, + ), + ), + ), + const SizedBox( + height: 24, + ), + const Spacer(), + ConditionalParent( + condition: Util.isDesktop, + builder: (child) => Row( + children: [ + Expanded( + child: SecondaryButton( + label: "Cancel", + buttonHeight: ButtonHeight.l, + onPressed: Navigator.of(context).pop, + ), + ), + const SizedBox( + width: 16, + ), + Expanded( + child: child, + ), + ], + ), + child: PrimaryButton( + label: "Save", + buttonHeight: Util.isDesktop ? ButtonHeight.l : ButtonHeight.xl, + onPressed: onSave, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/manage_coin_units_view.dart b/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/manage_coin_units_view.dart new file mode 100644 index 000000000..6f16cda4e --- /dev/null +++ b/lib/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/manage_coin_units_view.dart @@ -0,0 +1,176 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/edit_coin_units_view.dart'; +import 'package:stackwallet/providers/global/prefs_provider.dart'; +import 'package:stackwallet/themes/coin_icon_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/assets.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/util.dart'; +import 'package:stackwallet/widgets/background.dart'; +import 'package:stackwallet/widgets/conditional_parent.dart'; +import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; +import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; +import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; +import 'package:stackwallet/widgets/rounded_white_container.dart'; + +class ManageCoinUnitsView extends ConsumerWidget { + const ManageCoinUnitsView({Key? key}) : super(key: key); + + static const String routeName = "/manageCoinUnitsView"; + + void onEditPressed(Coin coin, BuildContext context) { + if (Util.isDesktop) { + showDialog( + context: context, + builder: (context) => EditCoinUnitsView(coin: coin), + ); + } else { + Navigator.of(context).pushNamed( + EditCoinUnitsView.routeName, + arguments: coin, + ); + } + } + + @override + Widget build(BuildContext context, WidgetRef ref) { + bool showTestNet = ref.watch( + prefsChangeNotifierProvider.select((value) => value.showTestNetCoins), + ); + + final _coins = Coin.values.where((e) => e != Coin.firoTestNet).toList(); + + List coins = showTestNet + ? _coins + : _coins.sublist(0, _coins.length - kTestNetCoinCount); + + return ConditionalParent( + condition: Util.isDesktop, + builder: (child) => DesktopDialog( + maxHeight: 850, + maxWidth: 600, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Units", + style: STextStyles.desktopH3(context), + ), + ), + const DesktopDialogCloseButton(), + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only( + left: 32, + right: 32, + bottom: 32, + ), + child: child, + ), + ), + ], + ), + ), + child: ConditionalParent( + condition: !Util.isDesktop, + builder: (child) => Background( + child: Scaffold( + backgroundColor: + Theme.of(context).extension()!.background, + appBar: AppBar( + leading: AppBarBackButton( + onPressed: () { + Navigator.of(context).pop(); + }, + ), + title: Text( + "Units", + style: STextStyles.navBarTitle(context), + ), + ), + body: child, + ), + ), + child: ListView.separated( + itemCount: Util.isDesktop ? coins.length : coins.length + 2, + separatorBuilder: (_, __) => const SizedBox( + height: 12, + ), + itemBuilder: (_, index) { + if (!Util.isDesktop) { + if (index == 0) { + return const SizedBox(height: 0); + } else if (index > coins.length) { + return const SizedBox(height: 10); + } + } + + final coin = coins[Util.isDesktop ? index : index - 1]; + return Padding( + padding: Util.isDesktop + ? EdgeInsets.zero + : const EdgeInsets.symmetric( + horizontal: 16, + ), + child: RoundedWhiteContainer( + padding: Util.isDesktop + ? const EdgeInsets.symmetric( + vertical: 16, + horizontal: 14, + ) + : const EdgeInsets.all(12), + borderColor: Util.isDesktop + ? Theme.of(context).extension()!.textSubtitle6 + : null, + onPressed: () { + onEditPressed(coin, context); + }, + child: Row( + children: [ + SvgPicture.file( + File( + ref.watch( + coinIconProvider(coin), + ), + ), + width: 24, + height: 24, + ), + const SizedBox( + width: 12, + ), + Expanded( + child: Text( + "Edit ${coin.prettyName} units", + style: STextStyles.titleBold12(context), + ), + ), + const SizedBox( + width: 12, + ), + SvgPicture.asset( + Assets.svg.chevronRight, + width: Util.isDesktop ? 20 : 14, + height: Util.isDesktop ? 20 : 14, + ), + ], + ), + ), + ); + }, + ), + ), + ); + } +} diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/manage_explorer_view.dart b/lib/pages/settings_views/global_settings_view/advanced_views/manage_explorer_view.dart index 845c29411..9242731d1 100644 --- a/lib/pages/settings_views/global_settings_view/advanced_views/manage_explorer_view.dart +++ b/lib/pages/settings_views/global_settings_view/advanced_views/manage_explorer_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings/appearance_settings_view.dart b/lib/pages/settings_views/global_settings_view/appearance_settings/appearance_settings_view.dart index 314e0fff5..126b87060 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings/appearance_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings/appearance_settings_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/manage_themes.dart'; diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings/manage_themes.dart b/lib/pages/settings_views/global_settings_view/appearance_settings/manage_themes.dart index b363108c7..5b14a022c 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings/manage_themes.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings/manage_themes.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/install_theme_from_file_dialog.dart b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/install_theme_from_file_dialog.dart index c12d634a1..235bb5e95 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/install_theme_from_file_dialog.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/install_theme_from_file_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/stack_theme_card.dart b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/stack_theme_card.dart index 2f6f03091..af83e4db0 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/stack_theme_card.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/stack_theme_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart index 1b78a231f..a129147e0 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/constants.dart'; diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_options_widget.dart b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_options_widget.dart index de5c91ee0..bf8791542 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_options_widget.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_options_widget.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings/system_brightness_theme_selection_view.dart b/lib/pages/settings_views/global_settings_view/appearance_settings/system_brightness_theme_selection_view.dart index 734d7194b..5bb416284 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings/system_brightness_theme_selection_view.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings/system_brightness_theme_selection_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart'; diff --git a/lib/pages/settings_views/global_settings_view/currency_view.dart b/lib/pages/settings_views/global_settings_view/currency_view.dart index 346c625d2..cb3a3478b 100644 --- a/lib/pages/settings_views/global_settings_view/currency_view.dart +++ b/lib/pages/settings_views/global_settings_view/currency_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -50,6 +60,10 @@ class _CurrencyViewState extends ConsumerState { currenciesWithoutSelected.remove(current); currenciesWithoutSelected.insert(0, current); ref.read(prefsChangeNotifierProvider).currency = current; + + if (ref.read(prefsChangeNotifierProvider).externalCalls) { + ref.read(priceAnd24hChangeNotifierProvider).updatePrice(); + } } } diff --git a/lib/pages/settings_views/global_settings_view/delete_account_view.dart b/lib/pages/settings_views/global_settings_view/delete_account_view.dart index 3dc08c1d2..2b794f351 100644 --- a/lib/pages/settings_views/global_settings_view/delete_account_view.dart +++ b/lib/pages/settings_views/global_settings_view/delete_account_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/intro_view.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/settings_views/global_settings_view/global_settings_view.dart b/lib/pages/settings_views/global_settings_view/global_settings_view.dart index 582ccfde5..7cadc1a77 100644 --- a/lib/pages/settings_views/global_settings_view/global_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/global_settings_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/hidden_settings.dart b/lib/pages/settings_views/global_settings_view/hidden_settings.dart index b4b849990..4e42e3733 100644 --- a/lib/pages/settings_views/global_settings_view/hidden_settings.dart +++ b/lib/pages/settings_views/global_settings_view/hidden_settings.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/language_view.dart b/lib/pages/settings_views/global_settings_view/language_view.dart index 0d7b34216..ae2cb8c6e 100644 --- a/lib/pages/settings_views/global_settings_view/language_view.dart +++ b/lib/pages/settings_views/global_settings_view/language_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart index 1ff1a1359..3e5d3e3e4 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -150,6 +160,7 @@ class _AddEditNodeViewState extends ConsumerState { case Coin.bitcoincash: case Coin.litecoin: case Coin.dogecoin: + case Coin.eCash: case Coin.firo: case Coin.namecoin: case Coin.particl: @@ -175,12 +186,17 @@ class _AddEditNodeViewState extends ConsumerState { break; case Coin.ethereum: + // TODO fix this // final client = Web3Client( // "https://mainnet.infura.io/v3/22677300bf774e49a458b73313ee56ba", // Client()); try { // await client.getSyncStatus(); } catch (_) {} + + case Coin.nano: + case Coin.banano: + //TODO: check network/node } if (showFlushBar && mounted) { @@ -717,6 +733,8 @@ class _NodeFormState extends ConsumerState { case Coin.firoTestNet: case Coin.dogecoinTestNet: case Coin.epicCash: + case Coin.nano: + case Coin.banano: case Coin.eCash: return false; diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart index 03fc37f4f..1bb393246 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart index 7caf4647f..b6d9a9df2 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart index 4905393ac..fa69871cb 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -14,6 +24,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/test_epic_box_connection.dart'; +import 'package:stackwallet/utilities/test_eth_node_connection.dart'; import 'package:stackwallet/utilities/test_monero_node_connection.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -134,6 +145,7 @@ class _NodeDetailsViewState extends ConsumerState { case Coin.namecoin: case Coin.litecoinTestNet: case Coin.bitcoincashTestnet: + case Coin.eCash: final client = ElectrumX( host: node!.host, port: node.port, @@ -149,6 +161,18 @@ class _NodeDetailsViewState extends ConsumerState { } break; + + case Coin.ethereum: + try { + testPassed = await testEthNodeConnection(node!.host); + } catch (_) { + testPassed = false; + } + break; + + case Coin.nano: + case Coin.banano: + //TODO: check network/node } if (testPassed) { diff --git a/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart b/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart index 0e848ec12..76ea1991d 100644 --- a/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart +++ b/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; @@ -6,7 +16,6 @@ import 'package:stackwallet/providers/global/prefs_provider.dart'; import 'package:stackwallet/providers/global/secure_store_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/background.dart'; @@ -27,10 +36,11 @@ class ChangePinView extends ConsumerStatefulWidget { class _ChangePinViewState extends ConsumerState { BoxDecoration get _pinPutDecoration { return BoxDecoration( - color: Theme.of(context).extension()!.textSubtitle2, + color: Theme.of(context).extension()!.infoItemIcons, border: Border.all( - width: 1, - color: Theme.of(context).extension()!.textSubtitle2), + width: 1, + color: Theme.of(context).extension()!.infoItemIcons, + ), borderRadius: BorderRadius.circular(6), ); } @@ -48,6 +58,8 @@ class _ChangePinViewState extends ConsumerState { late final SecureStorageInterface _secureStore; + int pinCount = 1; + @override void initState() { _secureStore = ref.read(secureStoreProvider); @@ -101,7 +113,7 @@ class _ChangePinViewState extends ConsumerState { height: 52, ), CustomPinPut( - fieldsCount: Constants.pinLength, + fieldsCount: pinCount, eachFieldHeight: 12, eachFieldWidth: 12, textStyle: STextStyles.label(context).copyWith( @@ -125,21 +137,18 @@ class _ChangePinViewState extends ConsumerState { ), isRandom: ref.read(prefsChangeNotifierProvider).randomizePIN, - submittedFieldDecoration: _pinPutDecoration.copyWith( - color: Theme.of(context) - .extension()! - .infoItemIcons, - border: Border.all( - width: 1, - color: Theme.of(context) - .extension()! - .infoItemIcons, - ), - ), + submittedFieldDecoration: _pinPutDecoration, selectedFieldDecoration: _pinPutDecoration, followingFieldDecoration: _pinPutDecoration, onSubmit: (String pin) { - if (pin.length == Constants.pinLength) { + if (pin.length < 4) { + showFloatingFlushBar( + type: FlushBarType.warning, + message: "PIN not long enough!", + iconAsset: Assets.svg.alertCircle, + context: context, + ); + } else { _pageController.nextPage( duration: const Duration(milliseconds: 300), curve: Curves.linear, @@ -165,7 +174,7 @@ class _ChangePinViewState extends ConsumerState { height: 52, ), CustomPinPut( - fieldsCount: Constants.pinLength, + fieldsCount: pinCount, eachFieldHeight: 12, eachFieldWidth: 12, textStyle: STextStyles.infoSmall(context).copyWith( @@ -192,17 +201,7 @@ class _ChangePinViewState extends ConsumerState { ), isRandom: ref.read(prefsChangeNotifierProvider).randomizePIN, - submittedFieldDecoration: _pinPutDecoration.copyWith( - color: Theme.of(context) - .extension()! - .infoItemIcons, - border: Border.all( - width: 1, - color: Theme.of(context) - .extension()! - .infoItemIcons, - ), - ), + submittedFieldDecoration: _pinPutDecoration, selectedFieldDecoration: _pinPutDecoration, followingFieldDecoration: _pinPutDecoration, onSubmit: (String pin) async { diff --git a/lib/pages/settings_views/global_settings_view/security_views/security_view.dart b/lib/pages/settings_views/global_settings_view/security_views/security_view.dart index 38be88839..63cbb836e 100644 --- a/lib/pages/settings_views/global_settings_view/security_views/security_view.dart +++ b/lib/pages/settings_views/global_settings_view/security_views/security_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/pinpad_views/lock_screen_view.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart index cad08892c..cc76cbf2a 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart index 71b01f698..1e0c01609 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:io'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_information_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_information_view.dart index a1fe7aaf6..dd1f34120 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_information_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_information_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart index 4ecf1470c..2c2af8ca7 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart index 49b5728d6..752acdd4a 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart index 04e96667c..0838a25b3 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -616,9 +626,7 @@ class _EditAutoBackupViewState extends ConsumerState { if (isDesktop) DropdownButtonHideUnderline( child: DropdownButton2( - offset: const Offset(0, -10), isExpanded: true, - dropdownElevation: 0, value: _currentDropDownValue, items: [ ..._dropDownItems.map( @@ -662,30 +670,31 @@ class _EditAutoBackupViewState extends ConsumerState { }); } }, - icon: SvgPicture.asset( - Assets.svg.chevronDown, - width: 10, - height: 5, - color: Theme.of(context).extension()!.textDark3, - ), - buttonPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - buttonDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + iconStyleData: IconStyleData( + icon: SvgPicture.asset( + Assets.svg.chevronDown, + width: 10, + height: 5, + color: + Theme.of(context).extension()!.textDark3, ), ), - dropdownDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + dropdownStyleData: DropdownStyleData( + offset: const Offset(0, -10), + elevation: 0, + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + ), + menuItemStyleData: const MenuItemStyleData( + padding: EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, ), ), ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart index b89954521..32c21566a 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/swb_file_system.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/swb_file_system.dart index 8b8b9d695..50611e634 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/swb_file_system.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/swb_file_system.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:file_picker/file_picker.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart index a81561471..d67e2e663 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart index a63b23e98..a8d156467 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart index 3a0e61aa9..7e20dac36 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart index 476e1e5df..03a59db95 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/recovery_phrase_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/recovery_phrase_view.dart index a4f160800..7d60a2e55 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/recovery_phrase_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/recovery_phrase_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart index 79b52aab0..6fc2c8570 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_item_card.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_item_card.dart index 47b879b2f..274c3d846 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_item_card.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_item_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart index 2db94aff7..3e762e177 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart index b76b63f46..4609c2005 100644 --- a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart +++ b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart index 9b8a95909..95fafb2e1 100644 --- a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart +++ b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/settings_views/global_settings_view/support_view.dart b/lib/pages/settings_views/global_settings_view/support_view.dart index 0f38912c0..d8865a5f3 100644 --- a/lib/pages/settings_views/global_settings_view/support_view.dart +++ b/lib/pages/settings_views/global_settings_view/support_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart index eac006e35..f679d6a10 100644 --- a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart +++ b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart'; diff --git a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart index 628d344e2..74fda4510 100644 --- a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart +++ b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart'; diff --git a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart index ad0042dc8..41377a8ea 100644 --- a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart +++ b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; @@ -6,8 +16,8 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; -import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/sync_type_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -147,14 +157,10 @@ class WalletSyncingOptionsView extends ConsumerWidget { height: 2, ), Text( - "${manager.balance.total.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => value.locale, - ), - ), - )} ${manager.coin.ticker}", + ref + .watch(pAmountFormatter( + manager.coin)) + .format(manager.balance.total), style: STextStyles.itemSubtitle(context), ) diff --git a/lib/pages/settings_views/global_settings_view/xpub_view.dart b/lib/pages/settings_views/global_settings_view/xpub_view.dart index e23131ec8..e6777de91 100644 --- a/lib/pages/settings_views/global_settings_view/xpub_view.dart +++ b/lib/pages/settings_views/global_settings_view/xpub_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -243,7 +253,7 @@ class _XPub extends StatelessWidget { builder: (child) => RoundedWhiteContainer( child: child, ), - child: QrImage( + child: QrImageView( data: xpub, size: isDesktop ? 280 : MediaQuery.of(context).size.width / 1.5, foregroundColor: diff --git a/lib/pages/settings_views/sub_widgets/nodes_list.dart b/lib/pages/settings_views/sub_widgets/nodes_list.dart index 05681ec68..52d9b8861 100644 --- a/lib/pages/settings_views/sub_widgets/nodes_list.dart +++ b/lib/pages/settings_views/sub_widgets/nodes_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/node_service_provider.dart'; diff --git a/lib/pages/settings_views/sub_widgets/settings_list_button.dart b/lib/pages/settings_views/sub_widgets/settings_list_button.dart index 7ea8e9946..2e4c19d01 100644 --- a/lib/pages/settings_views/sub_widgets/settings_list_button.dart +++ b/lib/pages/settings_views/sub_widgets/settings_list_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart index 82c2e4807..4cf6cbd30 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -168,7 +178,7 @@ class WalletBackupView extends ConsumerWidget { child: SizedBox( width: width + 20, height: width + 20, - child: QrImage( + child: QrImageView( data: data, size: width, backgroundColor: Theme.of(context) diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/confirm_full_rescan.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/confirm_full_rescan.dart index 25c93e43a..bb47771d6 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/confirm_full_rescan.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/confirm_full_rescan.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/rescanning_dialog.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/rescanning_dialog.dart index ac30cb5e7..8c46d1ab5 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/rescanning_dialog.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/rescanning_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart'; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart index d199ba7c1..b447a53ee 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart index 26c94e4be..59f443db9 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:event_bus/event_bus.dart'; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart index 731164082..80f921b57 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart index cf21908d6..eb87575dd 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart'; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart index ed1dd1219..6c1cb0529 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart index 7e89519e0..55e891ecd 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/pinpad_views/lock_screen_view.dart'; diff --git a/lib/pages/stack_privacy_calls.dart b/lib/pages/stack_privacy_calls.dart index 22d48311e..e2c604494 100644 --- a/lib/pages/stack_privacy_calls.dart +++ b/lib/pages/stack_privacy_calls.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages/token_view/my_tokens_view.dart b/lib/pages/token_view/my_tokens_view.dart index f655bd27d..1b847cf1e 100644 --- a/lib/pages/token_view/my_tokens_view.dart +++ b/lib/pages/token_view/my_tokens_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/token_view/sub_widgets/my_token_select_item.dart b/lib/pages/token_view/sub_widgets/my_token_select_item.dart index 1cd3272ac..31dc2b085 100644 --- a/lib/pages/token_view/sub_widgets/my_token_select_item.dart +++ b/lib/pages/token_view/sub_widgets/my_token_select_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; @@ -10,7 +20,9 @@ import 'package:stackwallet/services/ethereum/cached_eth_token_balance.dart'; import 'package:stackwallet/services/ethereum/ethereum_token_service.dart'; import 'package:stackwallet/services/transaction_notification_tracker.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/show_loading.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -163,14 +175,10 @@ class _MyTokenSelectItemState extends ConsumerState { ), const Spacer(), Text( - "${cachedBalance.getCachedBalance().total.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - )} " - "${widget.token.symbol}", + ref.watch(pAmountFormatter(Coin.ethereum)).format( + cachedBalance.getCachedBalance().total, + ethContract: widget.token, + ), style: isDesktop ? STextStyles.desktopTextExtraSmall(context) .copyWith( diff --git a/lib/pages/token_view/sub_widgets/my_tokens_list.dart b/lib/pages/token_view/sub_widgets/my_tokens_list.dart index 659ed5221..89655b717 100644 --- a/lib/pages/token_view/sub_widgets/my_tokens_list.dart +++ b/lib/pages/token_view/sub_widgets/my_tokens_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:isar/isar.dart'; diff --git a/lib/pages/token_view/sub_widgets/no_tokens_found.dart b/lib/pages/token_view/sub_widgets/no_tokens_found.dart index 4fbfff50e..378235b59 100644 --- a/lib/pages/token_view/sub_widgets/no_tokens_found.dart +++ b/lib/pages/token_view/sub_widgets/no_tokens_found.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; diff --git a/lib/pages/token_view/sub_widgets/token_summary.dart b/lib/pages/token_view/sub_widgets/token_summary.dart index 51679c4d6..f15bc8fea 100644 --- a/lib/pages/token_view/sub_widgets/token_summary.dart +++ b/lib/pages/token_view/sub_widgets/token_summary.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -19,6 +29,7 @@ import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_ import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -86,14 +97,10 @@ class TokenSummary extends ConsumerWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "${balance.total.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, + ref.watch(pAmountFormatter(Coin.ethereum)).format( + balance.total, + ethContract: token, ), - ), - )}" - " ${token.symbol}", style: STextStyles.pageTitleH1(context).copyWith( color: Theme.of(context) .extension()! @@ -118,7 +125,7 @@ class TokenSummary extends ConsumerWidget { ), )).toAmount( fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: ref.watch( localeServiceChangeNotifierProvider.select( (value) => value.locale, diff --git a/lib/pages/token_view/sub_widgets/token_transaction_list_widget.dart b/lib/pages/token_view/sub_widgets/token_transaction_list_widget.dart index 03406338e..68f5c76b8 100644 --- a/lib/pages/token_view/sub_widgets/token_transaction_list_widget.dart +++ b/lib/pages/token_view/sub_widgets/token_transaction_list_widget.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages/token_view/token_contract_details_view.dart b/lib/pages/token_view/token_contract_details_view.dart index 663698197..e3c860a43 100644 --- a/lib/pages/token_view/token_contract_details_view.dart +++ b/lib/pages/token_view/token_contract_details_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:isar/isar.dart'; diff --git a/lib/pages/token_view/token_view.dart b/lib/pages/token_view/token_view.dart index 39bd5c2d6..421e00422 100644 --- a/lib/pages/token_view/token_view.dart +++ b/lib/pages/token_view/token_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages/wallet_view/sub_widgets/no_transactions_found.dart b/lib/pages/wallet_view/sub_widgets/no_transactions_found.dart index 35aa1eaf2..fdf923921 100644 --- a/lib/pages/wallet_view/sub_widgets/no_transactions_found.dart +++ b/lib/pages/wallet_view/sub_widgets/no_transactions_found.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; diff --git a/lib/pages/wallet_view/sub_widgets/transactions_list.dart b/lib/pages/wallet_view/sub_widgets/transactions_list.dart index e68b443ed..9afd4aa9f 100644 --- a/lib/pages/wallet_view/sub_widgets/transactions_list.dart +++ b/lib/pages/wallet_view/sub_widgets/transactions_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -93,12 +103,7 @@ class _TransactionsListState extends ConsumerState { children: [ TransactionCard( // this may mess with combined firo transactions - key: isConfirmed - ? Key(tx.txid + - tx.type.name + - tx.address.value.toString() + - tx.height.toString()) - : UniqueKey(), // + key: UniqueKey(), // transaction: tx, walletId: widget.walletId, ), @@ -193,12 +198,7 @@ class _TransactionsListState extends ConsumerState { ), child: TransactionCard( // this may mess with combined firo transactions - key: isConfirmed - ? Key(tx.txid + - tx.type.name + - tx.address.value.toString() + - tx.height.toString()) - : UniqueKey(), + key: UniqueKey(), transaction: tx, walletId: widget.walletId, ), diff --git a/lib/pages/wallet_view/sub_widgets/tx_icon.dart b/lib/pages/wallet_view/sub_widgets/tx_icon.dart index ed7d94e64..d86ad6e8d 100644 --- a/lib/pages/wallet_view/sub_widgets/tx_icon.dart +++ b/lib/pages/wallet_view/sub_widgets/tx_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/cupertino.dart'; diff --git a/lib/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart b/lib/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart index f63351aac..4b2ee7a3b 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/balance.dart'; @@ -7,6 +17,7 @@ import 'package:stackwallet/providers/wallet/wallet_balance_toggle_state_provide import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart'; @@ -278,13 +289,7 @@ class BalanceSelector extends ConsumerWidget { height: 2, ), Text( - "${balance.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - )} ${coin.ticker}", + ref.watch(pAmountFormatter(coin)).format(balance), style: STextStyles.itemSubtitle12(context).copyWith( color: Theme.of(context) .extension()! diff --git a/lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart b/lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart index 8b1378917..05e39c079 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart @@ -1 +1,11 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + diff --git a/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart b/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart index b62323414..2f03a1b21 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:event_bus/event_bus.dart'; @@ -56,26 +66,38 @@ class _RefreshButtonState extends ConsumerState { widget.tokenContractAddress == null) { switch (event.newStatus) { case WalletSyncStatus.unableToSync: - _spinController.stop?.call(); + if (_spinController.hasLoadedAnimation) { + _spinController.stop?.call(); + } break; case WalletSyncStatus.synced: - _spinController.stop?.call(); + if (_spinController.hasLoadedAnimation) { + _spinController.stop?.call(); + } break; case WalletSyncStatus.syncing: - _spinController.repeat?.call(); + if (_spinController.hasLoadedAnimation) { + _spinController.repeat?.call(); + } break; } } else if (widget.tokenContractAddress != null && event.walletId == widget.walletId + widget.tokenContractAddress!) { switch (event.newStatus) { case WalletSyncStatus.unableToSync: - _spinController.stop?.call(); + if (_spinController.hasLoadedAnimation) { + _spinController.stop?.call(); + } break; case WalletSyncStatus.synced: - _spinController.stop?.call(); + if (_spinController.hasLoadedAnimation) { + _spinController.stop?.call(); + } break; case WalletSyncStatus.syncing: - _spinController.repeat?.call(); + if (_spinController.hasLoadedAnimation) { + _spinController.repeat?.call(); + } break; } } diff --git a/lib/pages/wallet_view/sub_widgets/wallet_summary.dart b/lib/pages/wallet_view/sub_widgets/wallet_summary.dart index 3b0817cd9..a82145817 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary.dart @@ -1,18 +1,22 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/wallet_summary_info.dart'; -import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; -import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/widgets/coin_card.dart'; class WalletSummary extends StatelessWidget { const WalletSummary({ Key? key, required this.walletId, - required this.managerProvider, required this.initialSyncStatus, this.aspectRatio = 2.0, this.minHeight = 100.0, @@ -22,7 +26,6 @@ class WalletSummary extends StatelessWidget { }) : super(key: key); final String walletId; - final ChangeNotifierProvider managerProvider; final WalletSyncStatus initialSyncStatus; final double aspectRatio; @@ -42,83 +45,25 @@ class WalletSummary extends StatelessWidget { maxHeight: maxHeight, maxWidth: minWidth, ), - child: Stack( - children: [ - Consumer( - builder: (_, ref, __) { - return Container( - decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .colorForCoin(ref.watch( - managerProvider.select((value) => value.coin))), - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - ), - ); - }, - ), - Positioned.fill( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Spacer( - flex: 5, - ), - Expanded( - flex: 6, - child: SvgPicture.asset( - Assets.svg.ellipse1, - // fit: BoxFit.fitWidth, - // clipBehavior: Clip.none, - ), - ), - const SizedBox( - width: 25, - ), - ], + child: LayoutBuilder( + builder: (_, constraints) => Stack( + children: [ + CoinCard( + walletId: walletId, + width: constraints.maxWidth, + height: constraints.maxHeight, ), - ), - // Positioned.fill( - // child: - // Column( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - Align( - alignment: Alignment.bottomCenter, - child: Row( - children: [ - const Spacer( - flex: 1, + Positioned.fill( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: WalletSummaryInfo( + walletId: walletId, + initialSyncStatus: initialSyncStatus, ), - Expanded( - flex: 3, - child: SvgPicture.asset( - Assets.svg.ellipse2, - // fit: BoxFit.f, - // clipBehavior: Clip.none, - ), - ), - const SizedBox( - width: 13, - ), - ], - ), - ), - // ], - // ), - // ), - Positioned.fill( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: WalletSummaryInfo( - walletId: walletId, - initialSyncStatus: initialSyncStatus, ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart index 32db97f81..a4716d190 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -16,6 +26,7 @@ import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart'; @@ -150,9 +161,7 @@ class _WalletSummaryInfoState extends ConsumerState { FittedBox( fit: BoxFit.scaleDown, child: SelectableText( - "${balanceToShow.localizedStringAsFixed( - locale: locale, - )} ${coin.ticker}", + ref.watch(pAmountFormatter(coin)).format(balanceToShow), style: STextStyles.pageTitleH1(context).copyWith( fontSize: 24, color: Theme.of(context) @@ -165,7 +174,7 @@ class _WalletSummaryInfoState extends ConsumerState { Text( "${(priceTuple.item1 * balanceToShow.decimal).toAmount( fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: locale, )} $baseCurrency", style: STextStyles.subtitle500(context).copyWith( diff --git a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart index 8d23a67cf..32cd8fb30 100644 --- a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart +++ b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -15,6 +25,7 @@ import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/transaction_filter_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -958,9 +969,7 @@ class _DesktopTransactionCardRowState builder: (_) { final amount = _transaction.realAmount; return Text( - "$prefix${amount.localizedStringAsFixed( - locale: locale, - )} ${coin.ticker}", + "$prefix${ref.watch(pAmountFormatter(coin)).format(amount)}", style: STextStyles.desktopTextExtraExtraSmall(context) .copyWith( color: Theme.of(context) @@ -982,7 +991,7 @@ class _DesktopTransactionCardRowState return Text( "$prefix${(amount.decimal * price).toAmount( fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: locale, )} $baseCurrency", style: STextStyles.desktopTextExtraExtraSmall(context), diff --git a/lib/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart b/lib/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart index 810579e6c..7a94dc28f 100644 --- a/lib/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart +++ b/lib/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; diff --git a/lib/pages/wallet_view/transaction_views/edit_note_view.dart b/lib/pages/wallet_view/transaction_views/edit_note_view.dart index 6e984ad66..ba2a8f98b 100644 --- a/lib/pages/wallet_view/transaction_views/edit_note_view.dart +++ b/lib/pages/wallet_view/transaction_views/edit_note_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index 5a0068c93..cba8f5e5f 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/foundation.dart'; @@ -6,6 +16,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/receive_view/addresses/address_details_view.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/tx_icon.dart'; @@ -19,6 +30,7 @@ import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/block_explorers.dart'; import 'package:stackwallet/utilities/constants.dart'; @@ -73,6 +85,7 @@ class _TransactionDetailsViewState late final String amountPrefix; late final String unit; late final bool isTokenTx; + late final EthContract? ethContract; bool showFeePending = false; @@ -94,12 +107,11 @@ class _TransactionDetailsViewState amountPrefix = _transaction.type == TransactionType.outgoing ? "-" : "+"; } - unit = isTokenTx - ? ref - .read(mainDBProvider) - .getEthContractSync(_transaction.otherData!)! - .symbol - : coin.ticker; + ethContract = isTokenTx + ? ref.read(mainDBProvider).getEthContractSync(_transaction.otherData!) + : null; + + unit = isTokenTx ? ethContract!.symbol : coin.ticker; // if (coin == Coin.firo || coin == Coin.firoTestNet) { // showFeePending = true; @@ -126,6 +138,36 @@ class _TransactionDetailsViewState } } + if (coin == Coin.epicCash) { + if (_transaction.isCancelled) { + return "Cancelled"; + } else if (type == TransactionType.incoming) { + if (tx.isConfirmed(height, coin.requiredConfirmations)) { + return "Received"; + } else { + if (_transaction.numberOfMessages == 1) { + return "Receiving (waiting for sender)"; + } else if ((_transaction.numberOfMessages ?? 0) > 1) { + return "Receiving (waiting for confirmations)"; // TODO test if the sender still has to open again after the receiver has 2 messages present, ie. sender->receiver->sender->node (yes) vs. sender->receiver->node (no) + } else { + return "Receiving"; + } + } + } else if (type == TransactionType.outgoing) { + if (tx.isConfirmed(height, coin.requiredConfirmations)) { + return "Sent (confirmed)"; + } else { + if (_transaction.numberOfMessages == 1) { + return "Sending (waiting for receiver)"; + } else if ((_transaction.numberOfMessages ?? 0) > 1) { + return "Sending (waiting for confirmations)"; + } else { + return "Sending"; + } + } + } + } + if (type == TransactionType.incoming) { // if (_transaction.isMinting) { // return "Minting"; @@ -446,13 +488,7 @@ class _TransactionDetailsViewState : CrossAxisAlignment.start, children: [ SelectableText( - "$amountPrefix${amount.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select((value) => - value.locale), - ), - )} $unit", + "$amountPrefix${ref.watch(pAmountFormatter(coin)).format(amount, ethContract: ethContract)}", style: isDesktop ? STextStyles .desktopTextExtraExtraSmall( @@ -486,7 +522,7 @@ class _TransactionDetailsViewState .getPrice( coin) .item1), - )).toAmount(fractionDigits: 2).localizedStringAsFixed( + )).toAmount(fractionDigits: 2).fiatString( locale: ref.watch( localeServiceChangeNotifierProvider .select( @@ -926,100 +962,99 @@ class _TransactionDetailsViewState ], ), ), - isDesktop - ? const _Divider() - : const SizedBox( - height: 12, - ), - RoundedWhiteContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Builder(builder: (context) { - String feeString = showFeePending - ? _transaction.isConfirmed( - currentHeight, - coin.requiredConfirmations, - ) - ? fee.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => value.locale), - ), - ) - : "Pending" - : fee.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select((value) => value.locale), - ), - ); - if (isTokenTx) { - feeString += " ${coin.ticker}"; - } + if (coin != Coin.banano && coin != Coin.nano) + isDesktop + ? const _Divider() + : const SizedBox( + height: 12, + ), + if (coin != Coin.banano && coin != Coin.nano) + RoundedWhiteContainer( + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Builder(builder: (context) { + String feeString = showFeePending + ? _transaction.isConfirmed( + currentHeight, + coin.requiredConfirmations, + ) + ? ref + .watch(pAmountFormatter(coin)) + .format( + fee, + withUnitName: isTokenTx, + ) + : "Pending" + : ref + .watch(pAmountFormatter(coin)) + .format( + fee, + withUnitName: isTokenTx, + ); - return Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - "Transaction fee", - style: isDesktop - ? STextStyles - .desktopTextExtraExtraSmall( - context) - : STextStyles.itemSubtitle( - context), - ), - if (isDesktop) - const SizedBox( - height: 2, - ), - if (isDesktop) - SelectableText( - feeString, + return Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + "Transaction fee", style: isDesktop ? STextStyles - .desktopTextExtraExtraSmall( - context) - .copyWith( - color: Theme.of(context) - .extension< - StackColors>()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context), - ), - ], - ), - if (!isDesktop) - SelectableText( - feeString, - style: isDesktop - ? STextStyles .desktopTextExtraExtraSmall( context) - .copyWith( - color: Theme.of(context) - .extension()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context), + : STextStyles.itemSubtitle( + context), + ), + if (isDesktop) + const SizedBox( + height: 2, + ), + if (isDesktop) + SelectableText( + feeString, + style: isDesktop + ? STextStyles + .desktopTextExtraExtraSmall( + context) + .copyWith( + color: Theme.of(context) + .extension< + StackColors>()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context), + ), + ], ), - if (isDesktop) - IconCopyButton(data: feeString) - ], - ); - }), - ), + if (!isDesktop) + SelectableText( + feeString, + style: isDesktop + ? STextStyles + .desktopTextExtraExtraSmall( + context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context), + ), + if (isDesktop) + IconCopyButton(data: feeString) + ], + ); + }), + ), isDesktop ? const _Divider() : const SizedBox( @@ -1033,6 +1068,7 @@ class _TransactionDetailsViewState final String height; if (widget.coin == Coin.bitcoincash || + widget.coin == Coin.eCash || widget.coin == Coin.bitcoincashTestnet) { height = "${_transaction.height != null && _transaction.height! > 0 ? _transaction.height! : "Pending"}"; diff --git a/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart b/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart index 6ca10deee..b41177ab9 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -5,11 +15,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_rounded_date_picker/flutter_rounded_date_picker.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/transaction_filter.dart'; -import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/transaction_filter_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -76,11 +86,12 @@ class _TransactionSearchViewState _toDateString = _selectedToDate == null ? "" : Format.formatDate(_selectedToDate!); - final String amount = filterState.amount?.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - decimalPlaces: widget.coin.decimals, - ) ?? - ""; + final String amount = filterState.amount == null + ? "" + : ref.read(pAmountFormatter(widget.coin)).format( + filterState.amount!, + withUnitName: false, + ); _amountTextEditingController.text = amount; } diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index ea4804a8a..df036a73b 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -670,7 +680,6 @@ class _WalletViewState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 16), child: WalletSummary( walletId: walletId, - managerProvider: managerProvider, initialSyncStatus: ref.watch(managerProvider .select((value) => value.isRefreshing)) ? WalletSyncStatus.syncing diff --git a/lib/pages/wallets_view/sub_widgets/all_wallets.dart b/lib/pages/wallets_view/sub_widgets/all_wallets.dart index 3f91a739c..caa53421c 100644 --- a/lib/pages/wallets_view/sub_widgets/all_wallets.dart +++ b/lib/pages/wallets_view/sub_widgets/all_wallets.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart'; diff --git a/lib/pages/wallets_view/sub_widgets/empty_wallets.dart b/lib/pages/wallets_view/sub_widgets/empty_wallets.dart index 23d4686e7..c4e89c720 100644 --- a/lib/pages/wallets_view/sub_widgets/empty_wallets.dart +++ b/lib/pages/wallets_view/sub_widgets/empty_wallets.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages/wallets_view/sub_widgets/favorite_card.dart b/lib/pages/wallets_view/sub_widgets/favorite_card.dart index 87ffbccd1..b3f5e97e5 100644 --- a/lib/pages/wallets_view/sub_widgets/favorite_card.dart +++ b/lib/pages/wallets_view/sub_widgets/favorite_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; @@ -6,15 +16,16 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/pages/wallet_view/wallet_view.dart'; import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/services/coins/manager.dart'; +import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; -import 'package:stackwallet/utilities/assets.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; +import 'package:stackwallet/widgets/coin_card.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:tuple/tuple.dart'; @@ -24,13 +35,11 @@ class FavoriteCard extends ConsumerStatefulWidget { required this.walletId, required this.width, required this.height, - required this.managerProvider, }) : super(key: key); final String walletId; final double width; final double height; - final ChangeNotifierProvider managerProvider; @override ConsumerState createState() => _FavoriteCardState(); @@ -38,15 +47,10 @@ class FavoriteCard extends ConsumerStatefulWidget { class _FavoriteCardState extends ConsumerState { late final String walletId; - late final ChangeNotifierProvider managerProvider; - - Amount _cachedBalance = Amount.zero; - Amount _cachedFiatValue = Amount.zero; @override void initState() { walletId = widget.walletId; - managerProvider = widget.managerProvider; super.initState(); } @@ -55,9 +59,13 @@ class _FavoriteCardState extends ConsumerState { @override Widget build(BuildContext context) { - final coin = ref.watch(managerProvider.select((value) => value.coin)); + final coin = ref.watch( + walletsChangeNotifierProvider + .select((value) => value.getManager(walletId).coin), + ); final externalCalls = ref.watch( - prefsChangeNotifierProvider.select((value) => value.externalCalls)); + prefsChangeNotifierProvider.select((value) => value.externalCalls), + ); return ConditionalParent( condition: Util.isDesktop, @@ -109,7 +117,10 @@ class _FavoriteCardState extends ConsumerState { child: GestureDetector( onTap: () async { if (coin == Coin.monero || coin == Coin.wownero) { - await ref.read(managerProvider).initializeExisting(); + await ref + .read(walletsChangeNotifierProvider) + .getManager(walletId) + .initializeExisting(); } if (mounted) { if (Util.isDesktop) { @@ -122,7 +133,9 @@ class _FavoriteCardState extends ConsumerState { WalletView.routeName, arguments: Tuple2( walletId, - managerProvider, + ref + .read(walletsChangeNotifierProvider) + .getManagerProvider(walletId), ), ); } @@ -132,66 +145,10 @@ class _FavoriteCardState extends ConsumerState { width: widget.width, height: widget.height, child: CardOverlayStack( - background: Stack( - children: [ - Container( - width: widget.width, - height: widget.height, - decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .colorForCoin(coin), - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - ), - ), - Column( - children: [ - const Spacer(), - SizedBox( - height: widget.width * 0.3, - child: Row( - children: [ - const Spacer( - flex: 9, - ), - SvgPicture.asset( - Assets.svg.ellipse2, - height: widget.width * 0.3, - ), - // ), - const Spacer( - flex: 2, - ), - ], - ), - ), - ], - ), - Row( - children: [ - const Spacer( - flex: 5, - ), - SizedBox( - width: widget.width * 0.45, - child: Column( - children: [ - SvgPicture.asset( - Assets.svg.ellipse1, - width: widget.width * 0.45, - ), - const Spacer(), - ], - ), - ), - const Spacer( - flex: 1, - ), - ], - ), - ], + background: CoinCard( + walletId: widget.walletId, + width: widget.width, + height: widget.height, ), child: Padding( padding: const EdgeInsets.all(12.0), @@ -205,8 +162,12 @@ class _FavoriteCardState extends ConsumerState { children: [ Expanded( child: Text( - ref.watch(managerProvider - .select((value) => value.walletName)), + ref.watch( + walletsChangeNotifierProvider.select( + (value) => + value.getManager(walletId).walletName, + ), + ), style: STextStyles.itemSubtitle12(context).copyWith( color: Theme.of(context) .extension()! @@ -225,42 +186,48 @@ class _FavoriteCardState extends ConsumerState { ], ), ), - FutureBuilder( - future: Future(() => ref.watch(managerProvider - .select((value) => value.balance.total))), - builder: (builderContext, AsyncSnapshot snapshot) { - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - if (snapshot.data != null) { - _cachedBalance = snapshot.data!; - if (externalCalls && _cachedBalance > Amount.zero) { - _cachedFiatValue = (_cachedBalance.decimal * - ref - .watch( - priceAnd24hChangeNotifierProvider - .select( - (value) => value.getPrice(coin), - ), - ) - .item1) - .toAmount(fractionDigits: 2); - } - } + Builder( + builder: (context) { + final balance = ref.watch( + walletsChangeNotifierProvider.select( + (value) => value.getManager(walletId).balance, + ), + ); + + Amount total = balance.total; + if (coin == Coin.firo || coin == Coin.firoTestNet) { + final balancePrivate = ref.watch( + walletsChangeNotifierProvider.select( + (value) => (value.getManager(walletId).wallet + as FiroWallet) + .balancePrivate, + ), + ); + + total += balancePrivate.total; } + + Amount fiatTotal = Amount.zero; + + if (externalCalls && total > Amount.zero) { + fiatTotal = (total.decimal * + ref + .watch( + priceAnd24hChangeNotifierProvider.select( + (value) => value.getPrice(coin), + ), + ) + .item1) + .toAmount(fractionDigits: 2); + } + return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ FittedBox( fit: BoxFit.scaleDown, child: Text( - "${_cachedBalance.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select((value) => value.locale), - ), - decimalPlaces: ref.watch(managerProvider - .select((value) => value.coin.decimals)), - )} ${coin.ticker}", + ref.watch(pAmountFormatter(coin)).format(total), style: STextStyles.titleBold12(context).copyWith( fontSize: 16, color: Theme.of(context) @@ -275,15 +242,16 @@ class _FavoriteCardState extends ConsumerState { ), if (externalCalls) Text( - "${_cachedFiatValue.localizedStringAsFixed( + "${fiatTotal.fiatString( locale: ref.watch( - localeServiceChangeNotifierProvider - .select((value) => value.locale), + localeServiceChangeNotifierProvider.select( + (value) => value.locale, + ), ), - decimalPlaces: 2, )} ${ref.watch( - prefsChangeNotifierProvider - .select((value) => value.currency), + prefsChangeNotifierProvider.select( + (value) => value.currency, + ), )}", style: STextStyles.itemSubtitle12(context).copyWith( diff --git a/lib/pages/wallets_view/sub_widgets/favorite_wallets.dart b/lib/pages/wallets_view/sub_widgets/favorite_wallets.dart index afbea4562..2f3775282 100644 --- a/lib/pages/wallets_view/sub_widgets/favorite_wallets.dart +++ b/lib/pages/wallets_view/sub_widgets/favorite_wallets.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:ui'; import 'package:flutter/material.dart'; @@ -211,7 +221,6 @@ class _FavoriteWalletsState extends ConsumerState { child: FavoriteCard( key: Key("favCard_$walletId"), walletId: walletId!, - managerProvider: managerProvider!, width: cardWidth, height: cardHeight, ), @@ -219,7 +228,6 @@ class _FavoriteWalletsState extends ConsumerState { : FavoriteCard( key: Key("favCard_$walletId"), walletId: walletId!, - managerProvider: managerProvider!, width: cardWidth, height: cardHeight, ) diff --git a/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart b/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart index 81194fdc3..295e32a55 100644 --- a/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart +++ b/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -98,12 +108,12 @@ class WalletListItem extends ConsumerWidget { final calls = ref.watch(prefsChangeNotifierProvider).externalCalls; - final priceString = tuple.item1 - .toAmount(fractionDigits: 2) - .localizedStringAsFixed( - locale: ref.watch(localeServiceChangeNotifierProvider - .select((value) => value.locale)), - ); + final priceString = + tuple.item1.toAmount(fractionDigits: 2).fiatString( + locale: ref.watch( + localeServiceChangeNotifierProvider + .select((value) => value.locale)), + ); final double percentChange = tuple.item2; diff --git a/lib/pages/wallets_view/wallets_overview.dart b/lib/pages/wallets_view/wallets_overview.dart index 5cc032a9d..97d5f67fe 100644 --- a/lib/pages/wallets_view/wallets_overview.dart +++ b/lib/pages/wallets_view/wallets_overview.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages/wallets_view/wallets_view.dart b/lib/pages/wallets_view/wallets_view.dart index 8df30771d..692d251c5 100644 --- a/lib/pages/wallets_view/wallets_view.dart +++ b/lib/pages/wallets_view/wallets_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart b/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart index 905948569..561f774d6 100644 --- a/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart +++ b/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_book_scaffold.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_book_scaffold.dart index 36e44e6d4..a7a47e979 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_book_scaffold.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_book_scaffold.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/widgets.dart'; class DesktopAddressBookScaffold extends StatelessWidget { diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart index f26573c1e..cb570be90 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart index 9e1701fd2..267a7c2b9 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_options_menu_popup.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_options_menu_popup.dart index 3d8fb3a6a..fff2c337c 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_options_menu_popup.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_options_menu_popup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart b/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart index 9128f9417..d9e9c2763 100644 --- a/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart +++ b/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/addresses/sub_widgets/desktop_address_list.dart b/lib/pages_desktop_specific/addresses/sub_widgets/desktop_address_list.dart index ece508042..f0b4836f8 100644 --- a/lib/pages_desktop_specific/addresses/sub_widgets/desktop_address_list.dart +++ b/lib/pages_desktop_specific/addresses/sub_widgets/desktop_address_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart b/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart index e14d8bb19..345eea0c9 100644 --- a/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart +++ b/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/coin_control/desktop_coin_control_view.dart b/lib/pages_desktop_specific/coin_control/desktop_coin_control_view.dart index 0685204e4..fd3febe07 100644 --- a/lib/pages_desktop_specific/coin_control/desktop_coin_control_view.dart +++ b/lib/pages_desktop_specific/coin_control/desktop_coin_control_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/coin_control/freeze_button.dart b/lib/pages_desktop_specific/coin_control/freeze_button.dart index b33bc89fa..935fe3f94 100644 --- a/lib/pages_desktop_specific/coin_control/freeze_button.dart +++ b/lib/pages_desktop_specific/coin_control/freeze_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:async/async.dart'; import 'package:flutter/material.dart'; import 'package:isar/isar.dart'; diff --git a/lib/pages_desktop_specific/coin_control/utxo_row.dart b/lib/pages_desktop_specific/coin_control/utxo_row.dart index 4d3796e06..167e7b5e0 100644 --- a/lib/pages_desktop_specific/coin_control/utxo_row.dart +++ b/lib/pages_desktop_specific/coin_control/utxo_row.dart @@ -1,13 +1,23 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:isar/isar.dart'; import 'package:stackwallet/db/isar/main_db.dart'; import 'package:stackwallet/models/isar/models/isar_models.dart'; import 'package:stackwallet/pages/coin_control/utxo_details_view.dart'; -import 'package:stackwallet/providers/global/locale_provider.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; @@ -144,16 +154,12 @@ class _UtxoRowState extends ConsumerState { ), if (!widget.compact) Text( - "${Amount( - rawValue: BigInt.from(utxo.value), - fractionDigits: coin.decimals, - ).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, + ref.watch(pAmountFormatter(coin)).format( + Amount( + rawValue: BigInt.from(utxo.value), + fractionDigits: coin.decimals, + ), ), - ), - )} ${coin.ticker}", textAlign: TextAlign.right, style: STextStyles.w600_14(context), ), @@ -170,16 +176,12 @@ class _UtxoRowState extends ConsumerState { mainAxisSize: MainAxisSize.min, children: [ Text( - "${Amount( - rawValue: BigInt.from(utxo.value), - fractionDigits: coin.decimals, - ).localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, + ref.watch(pAmountFormatter(coin)).format( + Amount( + rawValue: BigInt.from(utxo.value), + fractionDigits: coin.decimals, + ), ), - ), - )} ${coin.ticker}", textAlign: TextAlign.right, style: STextStyles.w600_14(context), ), diff --git a/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart b/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart index 45f9cc0be..e56d2644c 100644 --- a/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart +++ b/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages/buy_view/buy_form.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages_desktop_specific/desktop_exchange/desktop_all_trades_view.dart b/lib/pages_desktop_specific/desktop_exchange/desktop_all_trades_view.dart index e92d743ba..8a2596ef3 100644 --- a/lib/pages_desktop_specific/desktop_exchange/desktop_all_trades_view.dart +++ b/lib/pages_desktop_specific/desktop_exchange/desktop_all_trades_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart index f63165567..22cb046cf 100644 --- a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart +++ b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/exchange_view/exchange_form.dart'; diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart index 0412541e9..b1a3e3327 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:decimal/decimal.dart'; @@ -374,7 +384,7 @@ class _StepScaffoldState extends ConsumerState { height: 48, ), Center( - child: QrImage( + child: QrImageView( // TODO: grab coin uri scheme from somewhere // data: "${coin.uriScheme}:$receivingAddress", data: ref.watch(desktopExchangeModelProvider diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_1.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_1.dart index af5f93408..049ec20b3 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_1.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_1.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart'; diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_2.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_2.dart index d8e131c77..773bb9195 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_2.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_2.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_3.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_3.dart index 5641070b5..5bd59ce49 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_3.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_3.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart'; diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_4.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_4.dart index c88db957e..8b30b2e2a 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_4.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_4.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_item.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_item.dart index b5eb35a49..d49d9053c 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_item.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_choose_from_stack.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_choose_from_stack.dart index 9d6106129..16d62b502 100644 --- a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_choose_from_stack.dart +++ b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_choose_from_stack.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -5,6 +15,7 @@ import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -279,8 +290,6 @@ class _BalanceDisplay extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final manager = ref.watch(walletsChangeNotifierProvider .select((value) => value.getManager(walletId))); - final locale = ref.watch( - localeServiceChangeNotifierProvider.select((value) => value.locale)); Amount total = manager.balance.total; if (manager.coin == Coin.firo || manager.coin == Coin.firoTestNet) { @@ -289,8 +298,7 @@ class _BalanceDisplay extends ConsumerWidget { } return Text( - "${total.localizedStringAsFixed(locale: locale)} " - "${manager.coin.ticker}", + ref.watch(pAmountFormatter(manager.coin)).format(total), style: STextStyles.desktopTextExtraSmall(context).copyWith( color: Theme.of(context).extension()!.textSubtitle1, ), diff --git a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart index 880b0a5a0..426a69811 100644 --- a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart +++ b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart index 29919098e..67578f76e 100644 --- a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart +++ b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/desktop_home_view.dart b/lib/pages_desktop_specific/desktop_home_view.dart index 0b2f99c81..37fbd9693 100644 --- a/lib/pages_desktop_specific/desktop_home_view.dart +++ b/lib/pages_desktop_specific/desktop_home_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/address_book_view/desktop_address_book.dart'; diff --git a/lib/pages_desktop_specific/desktop_menu.dart b/lib/pages_desktop_specific/desktop_menu.dart index bcdf7f031..1a0a1f09f 100644 --- a/lib/pages_desktop_specific/desktop_menu.dart +++ b/lib/pages_desktop_specific/desktop_menu.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/desktop_menu_item.dart b/lib/pages_desktop_specific/desktop_menu_item.dart index a194c87b2..1a7a533a9 100644 --- a/lib/pages_desktop_specific/desktop_menu_item.dart +++ b/lib/pages_desktop_specific/desktop_menu_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/coin_wallets_table.dart b/lib/pages_desktop_specific/my_stack_view/coin_wallets_table.dart index 16b43a5e3..e945aec9a 100644 --- a/lib/pages_desktop_specific/my_stack_view/coin_wallets_table.dart +++ b/lib/pages_desktop_specific/my_stack_view/coin_wallets_table.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/desktop_favorite_wallets.dart b/lib/pages_desktop_specific/my_stack_view/desktop_favorite_wallets.dart index b9ce38eb4..6b332a9e6 100644 --- a/lib/pages_desktop_specific/my_stack_view/desktop_favorite_wallets.dart +++ b/lib/pages_desktop_specific/my_stack_view/desktop_favorite_wallets.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -74,7 +84,6 @@ class DesktopFavoriteWallets extends ConsumerWidget { key: Key(walletName), width: cardWidth, height: cardHeight, - managerProvider: managerProvider, ); }) ], diff --git a/lib/pages_desktop_specific/my_stack_view/dialogs/desktop_expanding_wallet_card.dart b/lib/pages_desktop_specific/my_stack_view/dialogs/desktop_expanding_wallet_card.dart index e6f64a25a..38171f763 100644 --- a/lib/pages_desktop_specific/my_stack_view/dialogs/desktop_expanding_wallet_card.dart +++ b/lib/pages_desktop_specific/my_stack_view/dialogs/desktop_expanding_wallet_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart b/lib/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart index e210f1653..3b91e24f5 100644 --- a/lib/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart b/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart index cf231a30c..819ec2a90 100644 --- a/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart +++ b/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/my_wallets.dart b/lib/pages_desktop_specific/my_stack_view/my_wallets.dart index ecd21186d..d83a188be 100644 --- a/lib/pages_desktop_specific/my_stack_view/my_wallets.dart +++ b/lib/pages_desktop_specific/my_stack_view/my_wallets.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/paynym/desktop_paynym_send_dialog.dart b/lib/pages_desktop_specific/my_stack_view/paynym/desktop_paynym_send_dialog.dart index 8776a3394..d68d0a3e6 100644 --- a/lib/pages_desktop_specific/my_stack_view/paynym/desktop_paynym_send_dialog.dart +++ b/lib/pages_desktop_specific/my_stack_view/paynym/desktop_paynym_send_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; @@ -15,6 +25,7 @@ import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -124,15 +135,24 @@ class _DesktopPaynymSendDialogState crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - "${!isFiro ? manager.balance.spendable.localizedStringAsFixed( - locale: locale, - ) : ref.watch( - publicPrivateBalanceStateProvider.state, - ).state == "Private" ? (manager.wallet as FiroWallet).availablePrivateBalance().localizedStringAsFixed( - locale: locale, - ) : (manager.wallet as FiroWallet).availablePublicBalance().localizedStringAsFixed( - locale: locale, - )} ${coin.ticker}", + !isFiro + ? ref + .watch(pAmountFormatter(coin)) + .format(manager.balance.spendable) + : ref + .watch( + publicPrivateBalanceStateProvider + .state, + ) + .state == + "Private" + ? ref.watch(pAmountFormatter(coin)).format( + (manager.wallet as FiroWallet) + .availablePrivateBalance()) + : ref.watch(pAmountFormatter(coin)).format( + (manager.wallet as FiroWallet) + .availablePublicBalance(), + ), style: STextStyles.titleBold12(context), textAlign: TextAlign.right, ), @@ -140,7 +160,15 @@ class _DesktopPaynymSendDialogState height: 2, ), Text( - "${((!isFiro ? manager.balance.spendable.decimal : ref.watch(publicPrivateBalanceStateProvider.state).state == "Private" ? (manager.wallet as FiroWallet).availablePrivateBalance().decimal : (manager.wallet as FiroWallet).availablePublicBalance().decimal) * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getPrice(coin).item1))).toAmount(fractionDigits: 2).localizedStringAsFixed(locale: locale)} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}", + "${((!isFiro ? manager.balance.spendable.decimal : ref.watch(publicPrivateBalanceStateProvider.state).state == "Private" ? (manager.wallet as FiroWallet).availablePrivateBalance().decimal : (manager.wallet as FiroWallet).availablePublicBalance().decimal) * ref.watch( + priceAnd24hChangeNotifierProvider.select( + (value) => value.getPrice(coin).item1, + ), + )).toAmount(fractionDigits: 2).fiatString( + locale: locale, + )} ${ref.watch(prefsChangeNotifierProvider.select( + (value) => value.currency, + ))}", style: STextStyles.baseXS(context).copyWith( color: Theme.of(context) .extension()! diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_summary_table.dart b/lib/pages_desktop_specific/my_stack_view/wallet_summary_table.dart index 4a14cb5a5..c5383d64e 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_summary_table.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_summary_table.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; @@ -214,13 +224,12 @@ class TablePriceInfo extends ConsumerWidget { final priceString = Amount.fromDecimal( tuple.item1, fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: ref .watch( localeServiceChangeNotifierProvider.notifier, ) .locale, - decimalPlaces: 2, ); final double percentChange = tuple.item2; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_token_view.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_token_view.dart index 153feb92c..18edc2bff 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_token_view.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_token_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart index 59fe4acf9..003c735b2 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/address_book_address_chooser.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/address_book_address_chooser.dart index 1078bea5d..13c501f70 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/address_book_address_chooser.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/address_book_address_chooser.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart index e18070686..4d05f73a4 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/address_book_service_provider.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/delete_wallet_keys_popup.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/delete_wallet_keys_popup.dart index 006b5141c..90ecddd35 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/delete_wallet_keys_popup.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/delete_wallet_keys_popup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_attention_delete_wallet.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_attention_delete_wallet.dart index 06ddb59d5..cf18c4518 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_attention_delete_wallet.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_attention_delete_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/delete_wallet_keys_popup.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_auth_send.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_auth_send.dart index 0ee5d9ff1..b574d377e 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_auth_send.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_auth_send.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_balance_toggle_button.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_balance_toggle_button.dart index aaaa306a7..355badbd3 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_balance_toggle_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_balance_toggle_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/wallet/wallet_balance_toggle_state_provider.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_delete_wallet_dialog.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_delete_wallet_dialog.dart index bd9e1f03d..6e1c8e3c4 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_delete_wallet_dialog.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_delete_wallet_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_fee_dropdown.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_fee_dropdown.dart index cabe94d81..7260e5654 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_fee_dropdown.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_fee_dropdown.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:cw_core/monero_transaction_priority.dart'; import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; @@ -12,6 +22,7 @@ import 'package:stackwallet/providers/wallet/public_private_balance_state_provid import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -189,73 +200,47 @@ class _DesktopFeeDropDownState extends ConsumerState { .select((value) => value.getManager(walletId))); return FutureBuilder( - future: manager.fees, - builder: (context, AsyncSnapshot snapshot) { - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - feeObject = snapshot.data!; - } - return DropdownButtonHideUnderline( - child: DropdownButton2( - offset: const Offset(0, -10), - isExpanded: true, - dropdownElevation: 0, - value: ref.watch(feeRateTypeStateProvider.state).state, - // selectedItemBuilder: (s) { - // return [ - // ...FeeRateType.values.map( - // (e) => DropdownMenuItem( - // value: e, - // child: FeeDropDownChild( - // feeObject: feeObject, - // feeRateType: e, - // walletId: walletId, - // amount: amount, - // feeFor: feeFor, - // isSelected: true, - // ), - // ), - // ), - // ]; - // }, - items: [ - ...FeeRateType.values.map( - (e) => DropdownMenuItem( - value: e, - child: FeeDropDownChild( - feeObject: feeObject, - feeRateType: e, - walletId: walletId, - feeFor: feeFor, - isSelected: false, - ), + future: manager.fees, + builder: (context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + feeObject = snapshot.data!; + } + return DropdownButtonHideUnderline( + child: DropdownButton2( + isExpanded: true, + value: ref.watch(feeRateTypeStateProvider.state).state, + items: [ + ...FeeRateType.values.map( + (e) => DropdownMenuItem( + value: e, + child: FeeDropDownChild( + feeObject: feeObject, + feeRateType: e, + walletId: walletId, + feeFor: feeFor, + isSelected: false, ), ), - ], - onChanged: (newRateType) { - if (newRateType is FeeRateType) { - ref.read(feeRateTypeStateProvider.state).state = newRateType; - } - }, + ), + ], + onChanged: (newRateType) { + if (newRateType is FeeRateType) { + ref.read(feeRateTypeStateProvider.state).state = newRateType; + } + }, + iconStyleData: IconStyleData( icon: SvgPicture.asset( Assets.svg.chevronDown, width: 12, height: 6, color: Theme.of(context).extension()!.textDark3, ), - buttonPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - buttonDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - ), - dropdownDecoration: BoxDecoration( + ), + dropdownStyleData: DropdownStyleData( + offset: const Offset(0, -10), + elevation: 0, + decoration: BoxDecoration( color: Theme.of(context) .extension()! .textFieldDefaultBG, @@ -264,8 +249,16 @@ class _DesktopFeeDropDownState extends ConsumerState { ), ), ), - ); - }); + menuItemStyleData: const MenuItemStyleData( + padding: EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, + ), + ), + ), + ); + }, + ); } } @@ -360,10 +353,10 @@ class FeeDropDownChild extends ConsumerWidget { children: [ Text( "${feeRateType.prettyName} " - "(~${snapshot.data!.decimal.toStringAsFixed( - manager.coin.decimals, - )} " - "${manager.coin.ticker})", + "(~${ref.watch(pAmountFormatter(manager.coin)).format( + snapshot.data!, + indicatePrecisionLoss: false, + )})", style: STextStyles.desktopTextExtraExtraSmall(context).copyWith( color: Theme.of(context) diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart index 11e74ce5a..7b972eab3 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -205,11 +215,17 @@ class _DesktopReceiveState extends ConsumerState { ), ), ), - if (coin != Coin.epicCash && coin != Coin.ethereum) + if (coin != Coin.epicCash && + coin != Coin.ethereum && + coin != Coin.banano && + coin != Coin.nano) const SizedBox( height: 20, ), - if (coin != Coin.epicCash && coin != Coin.ethereum) + if (coin != Coin.epicCash && + coin != Coin.ethereum && + coin != Coin.banano && + coin != Coin.nano) SecondaryButton( buttonHeight: ButtonHeight.l, onPressed: generateNewAddress, @@ -219,7 +235,7 @@ class _DesktopReceiveState extends ConsumerState { height: 32, ), Center( - child: QrImage( + child: QrImageView( data: "${coin.uriScheme}:$receivingAddress", size: 200, foregroundColor: diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart index 19854a017..44c292555 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart @@ -1,4 +1,15 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; +import 'dart:math'; import 'package:bip47/bip47.dart'; import 'package:decimal/decimal.dart'; @@ -27,6 +38,8 @@ import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; @@ -429,14 +442,26 @@ class _DesktopSendState extends ConsumerState { void _cryptoAmountChanged() async { if (!_cryptoAmountChangeLock) { - final String cryptoAmount = cryptoAmountController.text; + String cryptoAmount = cryptoAmountController.text; if (cryptoAmount.isNotEmpty && cryptoAmount != "." && cryptoAmount != ",") { + if (cryptoAmount.startsWith("~")) { + cryptoAmount = cryptoAmount.substring(1); + } + if (cryptoAmount.contains(" ")) { + cryptoAmount = cryptoAmount.split(" ").first; + } + + // ensure we don't shift past minimum atomic value + final shift = min(ref.read(pAmountUnit(coin)).shift, coin.decimals); + _amountToSend = cryptoAmount.contains(",") ? Decimal.parse(cryptoAmount.replaceFirst(",", ".")) + .shift(0 - shift) .toAmount(fractionDigits: coin.decimals) : Decimal.parse(cryptoAmount) + .shift(0 - shift) .toAmount(fractionDigits: coin.decimals); if (_cachedAmountToSend != null && _cachedAmountToSend == _amountToSend) { @@ -452,7 +477,7 @@ class _DesktopSendState extends ConsumerState { if (price > Decimal.zero) { final String fiatAmountString = (_amountToSend!.decimal * price) .toAmount(fractionDigits: 2) - .localizedStringAsFixed( + .fiatString( locale: ref.read(localeServiceChangeNotifierProvider).locale, ); @@ -506,10 +531,7 @@ class _DesktopSendState extends ConsumerState { } else { balance = wallet.availablePublicBalance(); } - return balance.localizedStringAsFixed( - locale: locale, - decimalPlaces: coin.decimals, - ); + return ref.read(pAmountFormatter(coin)).format(balance); } return null; @@ -529,12 +551,12 @@ class _DesktopSendState extends ConsumerState { } if (private && _privateBalanceString != null) { return Text( - "$_privateBalanceString ${coin.ticker}", + "$_privateBalanceString", style: STextStyles.itemSubtitle(context), ); } else if (!private && _publicBalanceString != null) { return Text( - "$_publicBalanceString ${coin.ticker}", + "$_publicBalanceString", style: STextStyles.itemSubtitle(context), ); } else { @@ -583,11 +605,9 @@ class _DesktopSendState extends ConsumerState { final amount = Decimal.parse(results["amount"]!).toAmount( fractionDigits: coin.decimals, ); - cryptoAmountController.text = amount.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - decimalPlaces: Constants.decimalPlacesForCoin(coin), - ); - amount.toString(); + cryptoAmountController.text = ref + .read(pAmountFormatter(coin)) + .format(amount, withUnitName: false); _amountToSend = amount; } @@ -669,10 +689,10 @@ class _DesktopSendState extends ConsumerState { Logging.instance.log("it changed $_amountToSend $_cachedAmountToSend", level: LogLevel.Info); - final amountString = _amountToSend!.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - decimalPlaces: coin.decimals, - ); + final amountString = ref.read(pAmountFormatter(coin)).format( + _amountToSend!, + withUnitName: false, + ); _cryptoAmountChangeLock = true; cryptoAmountController.text = amountString; @@ -861,9 +881,7 @@ class _DesktopSendState extends ConsumerState { if (coin == Coin.firo) DropdownButtonHideUnderline( child: DropdownButton2( - offset: const Offset(0, -10), isExpanded: true, - dropdownElevation: 0, value: ref.watch(publicPrivateBalanceStateProvider.state).state, items: [ DropdownMenuItem( @@ -921,30 +939,30 @@ class _DesktopSendState extends ConsumerState { }); } }, - icon: SvgPicture.asset( - Assets.svg.chevronDown, - width: 12, - height: 6, - color: Theme.of(context).extension()!.textDark3, - ), - buttonPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - buttonDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + iconStyleData: IconStyleData( + icon: SvgPicture.asset( + Assets.svg.chevronDown, + width: 12, + height: 6, + color: Theme.of(context).extension()!.textDark3, ), ), - dropdownDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + dropdownStyleData: DropdownStyleData( + offset: const Offset(0, -10), + elevation: 0, + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + ), + menuItemStyleData: const MenuItemStyleData( + padding: EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, ), ), ), @@ -1047,7 +1065,7 @@ class _DesktopSendState extends ConsumerState { child: Padding( padding: const EdgeInsets.all(12), child: Text( - coin.ticker, + ref.watch(pAmountUnit(coin)).unitForCoin(coin), style: STextStyles.smallMed14(context).copyWith( color: Theme.of(context) .extension()! @@ -1412,7 +1430,7 @@ class _DesktopSendState extends ConsumerState { const SizedBox( height: 20, ), - if (coin != Coin.epicCash) + if (!([Coin.nano, Coin.banano, Coin.epicCash].contains(coin))) Text( "Transaction fee (${coin == Coin.ethereum ? "max" : "estimated"})", style: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -1422,11 +1440,11 @@ class _DesktopSendState extends ConsumerState { ), textAlign: TextAlign.left, ), - if (coin != Coin.epicCash) + if (!([Coin.nano, Coin.banano, Coin.epicCash].contains(coin))) const SizedBox( height: 10, ), - if (coin != Coin.epicCash) + if (!([Coin.nano, Coin.banano, Coin.epicCash].contains(coin))) DesktopFeeDropDown( walletId: walletId, ), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_token_send.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_token_send.dart index 226de4300..90a130476 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_token_send.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_token_send.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:decimal/decimal.dart'; @@ -20,6 +30,7 @@ import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; @@ -383,9 +394,8 @@ class _DesktopTokenSendState extends ConsumerState { final String fiatAmountString = Amount.fromDecimal( _amountToSend!.decimal * price, fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: ref.read(localeServiceChangeNotifierProvider).locale, - decimalPlaces: 2, ); baseAmountController.text = fiatAmountString; @@ -453,11 +463,11 @@ class _DesktopTokenSendState extends ConsumerState { fractionDigits: ref.read(tokenServiceProvider)!.tokenContract.decimals, ); - cryptoAmountController.text = amount.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - ); + cryptoAmountController.text = ref.read(pAmountFormatter(coin)).format( + amount, + withUnitName: false, + ); - amount.toString(); _amountToSend = amount; } @@ -541,10 +551,11 @@ class _DesktopTokenSendState extends ConsumerState { Logging.instance.log("it changed $_amountToSend $_cachedAmountToSend", level: LogLevel.Info); - final amountString = _amountToSend!.localizedStringAsFixed( - locale: ref.read(localeServiceChangeNotifierProvider).locale, - decimalPlaces: tokenDecimals, - ); + final amountString = ref.read(pAmountFormatter(coin)).format( + _amountToSend!, + withUnitName: false, + ethContract: ref.read(tokenServiceProvider)!.tokenContract, + ); _cryptoAmountChangeLock = true; cryptoAmountController.text = amountString; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart index f118a88e2..aa5922959 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_summary.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_summary.dart index c0422a686..73b003ab6 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_summary.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_summary.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/balance.dart'; @@ -10,6 +20,7 @@ import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -60,10 +71,14 @@ class _WDesktopWalletSummaryState extends ConsumerState { final baseCurrency = ref .watch(prefsChangeNotifierProvider.select((value) => value.currency)); + final tokenContract = widget.isToken + ? ref + .watch(tokenServiceProvider.select((value) => value!.tokenContract)) + : null; + final priceTuple = widget.isToken - ? ref.watch(priceAnd24hChangeNotifierProvider.select((value) => - value.getTokenPrice(ref.watch(tokenServiceProvider - .select((value) => value!.tokenContract.address))))) + ? ref.watch(priceAnd24hChangeNotifierProvider + .select((value) => value.getTokenPrice(tokenContract!.address))) : ref.watch(priceAnd24hChangeNotifierProvider .select((value) => value.getPrice(coin))); @@ -71,15 +86,6 @@ class _WDesktopWalletSummaryState extends ConsumerState { ref.watch(walletBalanceToggleStateProvider.state).state == WalletBalanceToggleState.available; - final unit = widget.isToken - ? ref.watch( - tokenServiceProvider.select((value) => value!.tokenContract.symbol)) - : coin.ticker; - final decimalPlaces = widget.isToken - ? ref.watch(tokenServiceProvider - .select((value) => value!.tokenContract.decimals)) - : coin.decimals; - Balance balance = widget.isToken ? ref.watch(tokenServiceProvider.select((value) => value!.balance)) : ref.watch(walletsChangeNotifierProvider @@ -124,10 +130,9 @@ class _WDesktopWalletSummaryState extends ConsumerState { FittedBox( fit: BoxFit.scaleDown, child: Text( - "${balanceToShow.localizedStringAsFixed( - locale: locale, - decimalPlaces: decimalPlaces, - )} $unit", + ref + .watch(pAmountFormatter(coin)) + .format(balanceToShow, ethContract: tokenContract), style: STextStyles.desktopH3(context), ), ), @@ -136,9 +141,8 @@ class _WDesktopWalletSummaryState extends ConsumerState { "${Amount.fromDecimal( priceTuple.item1 * balanceToShow.decimal, fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: locale, - decimalPlaces: 2, )} $baseCurrency", style: STextStyles.desktopTextExtraSmall(context).copyWith( color: Theme.of(context) diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart index 1549bf1c9..4c8f47c25 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/my_wallet.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/my_wallet.dart index f57ad8c2b..975f0bd80 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/my_wallet.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/my_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/transactions_list.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/network_info_button.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/network_info_button.dart index b44efa09b..cf7ff1235 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/network_info_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/network_info_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:event_bus/event_bus.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/qr_code_desktop_popup_content.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/qr_code_desktop_popup_content.dart index 3e5d23ab1..4ba42d4b2 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/qr_code_desktop_popup_content.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/qr_code_desktop_popup_content.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:qr_flutter/qr_flutter.dart'; import 'package:stackwallet/themes/stack_colors.dart'; @@ -20,16 +30,16 @@ class QRCodeDesktopPopupContent extends StatelessWidget { maxWidth: 614, child: Column( children: [ - Row( + const Row( mainAxisAlignment: MainAxisAlignment.end, - children: const [ + children: [ DesktopDialogCloseButton(), ], ), const SizedBox( height: 14, ), - QrImage( + QrImageView( data: value, size: 300, foregroundColor: diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart index e6f01f8fb..09220899a 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_button.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_button.dart index 85cb2ef6c..464f3371a 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_desktop_popup.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_desktop_popup.dart index 7ee97045b..14574a083 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_desktop_popup.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_desktop_popup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart index 9a91bb039..68fe09aa8 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/notifications/desktop_notifications_view.dart b/lib/pages_desktop_specific/notifications/desktop_notifications_view.dart index a73bd5238..eeb90e92c 100644 --- a/lib/pages_desktop_specific/notifications/desktop_notifications_view.dart +++ b/lib/pages_desktop_specific/notifications/desktop_notifications_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/notifications/notification_card.dart'; diff --git a/lib/pages_desktop_specific/password/create_password_view.dart b/lib/pages_desktop_specific/password/create_password_view.dart index 0cf9c0710..68205d077 100644 --- a/lib/pages_desktop_specific/password/create_password_view.dart +++ b/lib/pages_desktop_specific/password/create_password_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/password/delete_password_warning_view.dart b/lib/pages_desktop_specific/password/delete_password_warning_view.dart index be2b29ab7..22fb801c7 100644 --- a/lib/pages_desktop_specific/password/delete_password_warning_view.dart +++ b/lib/pages_desktop_specific/password/delete_password_warning_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -5,6 +15,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:hive/hive.dart'; +import 'package:isar/isar.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/intro_view.dart'; @@ -42,7 +53,21 @@ class _ForgotPasswordDesktopViewState try { await Hive.close(); - if (Platform.isWindows || Platform.isLinux) { + if (Platform.isWindows) { + final xmrDir = Directory("${appRoot.path}/wallets"); + if (xmrDir.existsSync()) { + await xmrDir.delete(recursive: true); + } + final epicDir = Directory("${appRoot.path}/epiccash"); + if (epicDir.existsSync()) { + await epicDir.delete(recursive: true); + } + + await Isar.getInstance("desktopStore")?.close(deleteFromDisk: true); + + await (await StackFileSystem.applicationHiveDirectory()) + .delete(recursive: true); + } else if (Platform.isLinux) { await appRoot.delete(recursive: true); } else { // macos in ipad mode diff --git a/lib/pages_desktop_specific/password/desktop_login_view.dart b/lib/pages_desktop_specific/password/desktop_login_view.dart index 6ec7e0115..10e1477b4 100644 --- a/lib/pages_desktop_specific/password/desktop_login_view.dart +++ b/lib/pages_desktop_specific/password/desktop_login_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart b/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart index 381247639..0de5069e8 100644 --- a/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart +++ b/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart b/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart index 475f82b6c..4bed14229 100644 --- a/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart +++ b/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages_desktop_specific/settings/desktop_settings_view.dart b/lib/pages_desktop_specific/settings/desktop_settings_view.dart index b30018370..596337925 100644 --- a/lib/pages_desktop_specific/settings/desktop_settings_view.dart +++ b/lib/pages_desktop_specific/settings/desktop_settings_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/settings/settings_menu.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu.dart b/lib/pages_desktop_specific/settings/settings_menu.dart index 743f633d0..f21398000 100644 --- a/lib/pages_desktop_specific/settings/settings_menu.dart +++ b/lib/pages_desktop_specific/settings/settings_menu.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart index 08eba6c0f..a514da74d 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart @@ -1,6 +1,17 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/manage_coin_units_view.dart'; import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/advanced_settings/debug_info_dialog.dart'; import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/advanced_settings/desktop_manage_block_explorers_dialog.dart'; import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/advanced_settings/stack_privacy_dialog.dart'; @@ -278,6 +289,47 @@ class _AdvancedSettings extends ConsumerState { ], ), ), + const Padding( + padding: EdgeInsets.all(10.0), + child: Divider( + thickness: 0.5, + ), + ), + Padding( + padding: const EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Units", + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark), + textAlign: TextAlign.left, + ), + PrimaryButton( + buttonHeight: ButtonHeight.xs, + label: "Edit", + width: 101, + onPressed: () async { + await showDialog( + context: context, + useSafeArea: false, + barrierDismissible: true, + builder: (context) { + return const ManageCoinUnitsView(); + }, + ); + }, + ), + ], + ), + ), + const SizedBox( + height: 10, + ), ], ), ), diff --git a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/debug_info_dialog.dart b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/debug_info_dialog.dart index 8ccd3abf4..0ae221621 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/debug_info_dialog.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/debug_info_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/desktop_manage_block_explorers_dialog.dart b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/desktop_manage_block_explorers_dialog.dart index 9042f41d4..18fffedfd 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/desktop_manage_block_explorers_dialog.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/desktop_manage_block_explorers_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/stack_privacy_dialog.dart b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/stack_privacy_dialog.dart index d99de9ee6..2b3009dc0 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/stack_privacy_dialog.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/advanced_settings/stack_privacy_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/appearance_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/appearance_settings.dart index a005028b1..d71dba011 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/appearance_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/appearance_settings.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -167,7 +177,7 @@ class ThemeToggle extends ConsumerStatefulWidget { class _ThemeToggle extends ConsumerState { late final StreamSubscription _subscription; - late int _current; + int _current = 0; List> installedThemeIdNames = []; diff --git a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_install_theme.dart b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_install_theme.dart index fcfb87471..243f2e570 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_install_theme.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_install_theme.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:desktop_drop/desktop_drop.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_manage_themes.dart b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_manage_themes.dart index 277bc0c9e..d4e6ec20b 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_manage_themes.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_manage_themes.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_install_theme.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_themes_gallery.dart b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_themes_gallery.dart index 3e0bf3ec3..41e33fb3a 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_themes_gallery.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings/sub_widgets/desktop_themes_gallery.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart index 15198449e..51a82619c 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart index 14e35d78c..677366c09 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -468,9 +478,7 @@ class _CreateAutoBackup extends ConsumerState { child: isDesktop ? DropdownButtonHideUnderline( child: DropdownButton2( - offset: const Offset(0, -10), isExpanded: true, - dropdownElevation: 0, value: _currentDropDownValue, items: [ ..._dropDownItems.map( @@ -515,32 +523,32 @@ class _CreateAutoBackup extends ConsumerState { }); } }, - icon: SvgPicture.asset( - Assets.svg.chevronDown, - width: 10, - height: 5, - color: Theme.of(context) - .extension()! - .textDark3, - ), - buttonPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - buttonDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + iconStyleData: IconStyleData( + icon: SvgPicture.asset( + Assets.svg.chevronDown, + width: 10, + height: 5, + color: Theme.of(context) + .extension()! + .textDark3, ), ), - dropdownDecoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + dropdownStyleData: DropdownStyleData( + offset: const Offset(0, -10), + elevation: 0, + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + ), + menuItemStyleData: const MenuItemStyleData( + padding: EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, ), ), ), diff --git a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/enable_backup_dialog.dart b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/enable_backup_dialog.dart index e6056e83d..d52b035dc 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/enable_backup_dialog.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/enable_backup_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/currency_settings/currency_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/currency_settings/currency_settings.dart index 9f5f42b7c..e163d7b6b 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/currency_settings/currency_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/currency_settings/currency_settings.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart b/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart index 45d748481..a54c0f443 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:flutter/gestures.dart'; @@ -391,7 +401,7 @@ class DesktopAboutView extends ConsumerWidget { .accentColorGreen); break; case CommitStatus - .isOldCommit: + .isOldCommit: indicationStyle = STextStyles .itemSubtitle( context) @@ -403,7 +413,7 @@ class DesktopAboutView extends ConsumerWidget { .accentColorYellow); break; case CommitStatus - .notACommit: + .notACommit: indicationStyle = STextStyles .itemSubtitle( context) @@ -497,7 +507,7 @@ class DesktopAboutView extends ConsumerWidget { .accentColorGreen); break; case CommitStatus - .isOldCommit: + .isOldCommit: indicationStyle = STextStyles .itemSubtitle( context) @@ -509,7 +519,7 @@ class DesktopAboutView extends ConsumerWidget { .accentColorYellow); break; case CommitStatus - .notACommit: + .notACommit: indicationStyle = STextStyles .itemSubtitle( context) @@ -601,7 +611,7 @@ class DesktopAboutView extends ConsumerWidget { .accentColorGreen); break; case CommitStatus - .isOldCommit: + .isOldCommit: indicationStyle = STextStyles .itemSubtitle( context) @@ -613,7 +623,7 @@ class DesktopAboutView extends ConsumerWidget { .accentColorYellow); break; case CommitStatus - .notACommit: + .notACommit: indicationStyle = STextStyles .itemSubtitle( context) diff --git a/lib/pages_desktop_specific/settings/settings_menu/desktop_support_view.dart b/lib/pages_desktop_specific/settings/settings_menu/desktop_support_view.dart index 1971cfcd2..d2dc00f3b 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/desktop_support_view.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/desktop_support_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/support_view.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/language_settings/language_dialog.dart b/lib/pages_desktop_specific/settings/settings_menu/language_settings/language_dialog.dart index 4d8510353..e3bb58526 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/language_settings/language_dialog.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/language_settings/language_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/language_settings/language_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/language_settings/language_settings.dart index f093e9951..4dab186b0 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/language_settings/language_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/language_settings/language_settings.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart index 1bab6ab58..da8ca07c9 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/security_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/security_settings.dart index 9ac684156..1d24a74f3 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/security_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/security_settings.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu/syncing_preferences_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/syncing_preferences_settings.dart index f8d1b8850..0522d1ed7 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/syncing_preferences_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/syncing_preferences_settings.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/pages_desktop_specific/settings/settings_menu_item.dart b/lib/pages_desktop_specific/settings/settings_menu_item.dart index 95845d282..673d3e318 100644 --- a/lib/pages_desktop_specific/settings/settings_menu_item.dart +++ b/lib/pages_desktop_specific/settings/settings_menu_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/providers/buy/buy_form_state_provider.dart b/lib/providers/buy/buy_form_state_provider.dart index 2a0dc719c..3e8d7cdf1 100644 --- a/lib/providers/buy/buy_form_state_provider.dart +++ b/lib/providers/buy/buy_form_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/buy/buy_form_state.dart'; diff --git a/lib/providers/buy/simplex_initial_load_status.dart b/lib/providers/buy/simplex_initial_load_status.dart index 9571f5b64..e73baab53 100644 --- a/lib/providers/buy/simplex_initial_load_status.dart +++ b/lib/providers/buy/simplex_initial_load_status.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; enum SimplexLoadStatus { diff --git a/lib/providers/buy/simplex_provider.dart b/lib/providers/buy/simplex_provider.dart index d15d335a5..e8e075455 100644 --- a/lib/providers/buy/simplex_provider.dart +++ b/lib/providers/buy/simplex_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/buy/simplex/simplex.dart'; diff --git a/lib/providers/db/main_db_provider.dart b/lib/providers/db/main_db_provider.dart index 2f3b6479c..c86ebf93c 100644 --- a/lib/providers/db/main_db_provider.dart +++ b/lib/providers/db/main_db_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/db/isar/main_db.dart'; diff --git a/lib/providers/desktop/current_desktop_menu_item.dart b/lib/providers/desktop/current_desktop_menu_item.dart index a9d3b17e1..409a48a40 100644 --- a/lib/providers/desktop/current_desktop_menu_item.dart +++ b/lib/providers/desktop/current_desktop_menu_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_menu.dart'; diff --git a/lib/providers/desktop/storage_crypto_handler_provider.dart b/lib/providers/desktop/storage_crypto_handler_provider.dart index 5b15ccaf3..6f25571a6 100644 --- a/lib/providers/desktop/storage_crypto_handler_provider.dart +++ b/lib/providers/desktop/storage_crypto_handler_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/utilities/desktop_password_service.dart'; diff --git a/lib/providers/exchange/changenow_initial_load_status.dart b/lib/providers/exchange/changenow_initial_load_status.dart index 0cb4f1278..a65bc9ded 100644 --- a/lib/providers/exchange/changenow_initial_load_status.dart +++ b/lib/providers/exchange/changenow_initial_load_status.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; enum ChangeNowLoadStatus { diff --git a/lib/providers/exchange/exchange_flow_is_active_state_provider.dart b/lib/providers/exchange/exchange_flow_is_active_state_provider.dart index 7c01830b7..6ff96d60c 100644 --- a/lib/providers/exchange/exchange_flow_is_active_state_provider.dart +++ b/lib/providers/exchange/exchange_flow_is_active_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; final exchangeFlowIsActiveStateProvider = StateProvider((_) => false); diff --git a/lib/providers/exchange/exchange_form_state_provider.dart b/lib/providers/exchange/exchange_form_state_provider.dart index afac49de8..07447f169 100644 --- a/lib/providers/exchange/exchange_form_state_provider.dart +++ b/lib/providers/exchange/exchange_form_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/exchange/active_pair.dart'; diff --git a/lib/providers/exchange/exchange_send_from_wallet_id_provider.dart b/lib/providers/exchange/exchange_send_from_wallet_id_provider.dart index 6b46dba82..b2fbec990 100644 --- a/lib/providers/exchange/exchange_send_from_wallet_id_provider.dart +++ b/lib/providers/exchange/exchange_send_from_wallet_id_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:tuple/tuple.dart'; diff --git a/lib/providers/exchange/trade_note_service_provider.dart b/lib/providers/exchange/trade_note_service_provider.dart index d2565d5b3..6d54eba8b 100644 --- a/lib/providers/exchange/trade_note_service_provider.dart +++ b/lib/providers/exchange/trade_note_service_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/trade_notes_service.dart'; diff --git a/lib/providers/exchange/trade_sent_from_stack_lookup_provider.dart b/lib/providers/exchange/trade_sent_from_stack_lookup_provider.dart index ee6af542c..d443ac390 100644 --- a/lib/providers/exchange/trade_sent_from_stack_lookup_provider.dart +++ b/lib/providers/exchange/trade_sent_from_stack_lookup_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/trade_sent_from_stack_service.dart'; diff --git a/lib/providers/global/address_book_service_provider.dart b/lib/providers/global/address_book_service_provider.dart index bc0438ae1..efb0b7a1d 100644 --- a/lib/providers/global/address_book_service_provider.dart +++ b/lib/providers/global/address_book_service_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/address_book_service.dart'; diff --git a/lib/providers/global/auto_swb_service_provider.dart b/lib/providers/global/auto_swb_service_provider.dart index 10cf2592f..a37f52061 100644 --- a/lib/providers/global/auto_swb_service_provider.dart +++ b/lib/providers/global/auto_swb_service_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/secure_store_provider.dart'; import 'package:stackwallet/services/auto_swb_service.dart'; diff --git a/lib/providers/global/base_currencies_provider.dart b/lib/providers/global/base_currencies_provider.dart index 1deaaa3ed..88086fde4 100644 --- a/lib/providers/global/base_currencies_provider.dart +++ b/lib/providers/global/base_currencies_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/price.dart'; diff --git a/lib/providers/global/debug_service_provider.dart b/lib/providers/global/debug_service_provider.dart index a781c0d5d..15868959b 100644 --- a/lib/providers/global/debug_service_provider.dart +++ b/lib/providers/global/debug_service_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/debug_service.dart'; diff --git a/lib/providers/global/favorites_provider.dart b/lib/providers/global/favorites_provider.dart index a934aa3e8..d55c2409e 100644 --- a/lib/providers/global/favorites_provider.dart +++ b/lib/providers/global/favorites_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/coins/manager.dart'; diff --git a/lib/providers/global/has_authenticated_start_state_provider.dart b/lib/providers/global/has_authenticated_start_state_provider.dart index 3a4a1f098..3ad11becd 100644 --- a/lib/providers/global/has_authenticated_start_state_provider.dart +++ b/lib/providers/global/has_authenticated_start_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // import 'package:flutter_riverpod/flutter_riverpod.dart'; // // final hasAuthenticatedOnStartStateProvider = diff --git a/lib/providers/global/locale_provider.dart b/lib/providers/global/locale_provider.dart index 7af3f88b6..903bab614 100644 --- a/lib/providers/global/locale_provider.dart +++ b/lib/providers/global/locale_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/locale_service.dart'; diff --git a/lib/providers/global/node_service_provider.dart b/lib/providers/global/node_service_provider.dart index 8ed0c599a..c8ef578ab 100644 --- a/lib/providers/global/node_service_provider.dart +++ b/lib/providers/global/node_service_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/secure_store_provider.dart'; diff --git a/lib/providers/global/non_favorites_provider.dart b/lib/providers/global/non_favorites_provider.dart index 9b20acd94..7bfdefeb6 100644 --- a/lib/providers/global/non_favorites_provider.dart +++ b/lib/providers/global/non_favorites_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/coins/manager.dart'; diff --git a/lib/providers/global/notifications_provider.dart b/lib/providers/global/notifications_provider.dart index 7875ced60..56eb18dd8 100644 --- a/lib/providers/global/notifications_provider.dart +++ b/lib/providers/global/notifications_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/notifications_service.dart'; diff --git a/lib/providers/global/paynym_api_provider.dart b/lib/providers/global/paynym_api_provider.dart index 482b4c2ba..310d7da43 100644 --- a/lib/providers/global/paynym_api_provider.dart +++ b/lib/providers/global/paynym_api_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/utilities/paynym_is_api.dart'; diff --git a/lib/providers/global/prefs_provider.dart b/lib/providers/global/prefs_provider.dart index d13dba876..bc61d44ed 100644 --- a/lib/providers/global/prefs_provider.dart +++ b/lib/providers/global/prefs_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/utilities/prefs.dart'; diff --git a/lib/providers/global/price_provider.dart b/lib/providers/global/price_provider.dart index 7b721230e..a2a91f49e 100644 --- a/lib/providers/global/price_provider.dart +++ b/lib/providers/global/price_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; diff --git a/lib/providers/global/secure_store_provider.dart b/lib/providers/global/secure_store_provider.dart index 32304d0f2..6f4a9e602 100644 --- a/lib/providers/global/secure_store_provider.dart +++ b/lib/providers/global/secure_store_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:stackwallet/providers/desktop/storage_crypto_handler_provider.dart'; diff --git a/lib/providers/global/should_show_lockscreen_on_resume_state_provider.dart b/lib/providers/global/should_show_lockscreen_on_resume_state_provider.dart index a2af8af37..8ad4e3d3c 100644 --- a/lib/providers/global/should_show_lockscreen_on_resume_state_provider.dart +++ b/lib/providers/global/should_show_lockscreen_on_resume_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // import 'package:flutter_riverpod/flutter_riverpod.dart'; // // final shouldShowLockscreenOnResumeStateProvider = diff --git a/lib/providers/global/trades_service_provider.dart b/lib/providers/global/trades_service_provider.dart index c1f734e2c..252333c54 100644 --- a/lib/providers/global/trades_service_provider.dart +++ b/lib/providers/global/trades_service_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/trade_service.dart'; diff --git a/lib/providers/global/wallets_provider.dart b/lib/providers/global/wallets_provider.dart index 9b2ea3657..57ccf2971 100644 --- a/lib/providers/global/wallets_provider.dart +++ b/lib/providers/global/wallets_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/node_service_provider.dart'; diff --git a/lib/providers/global/wallets_service_provider.dart b/lib/providers/global/wallets_service_provider.dart index 0c5009ad7..93800f01a 100644 --- a/lib/providers/global/wallets_service_provider.dart +++ b/lib/providers/global/wallets_service_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/secure_store_provider.dart'; diff --git a/lib/providers/providers.dart b/lib/providers/providers.dart index 2c027b169..3e6de2b0d 100644 --- a/lib/providers/providers.dart +++ b/lib/providers/providers.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + export './buy/buy_form_state_provider.dart'; export './buy/simplex_initial_load_status.dart'; export './buy/simplex_provider.dart'; diff --git a/lib/providers/stack_restore/stack_restoring_ui_state_provider.dart b/lib/providers/stack_restore/stack_restoring_ui_state_provider.dart index c78740fc9..60db49575 100644 --- a/lib/providers/stack_restore/stack_restoring_ui_state_provider.dart +++ b/lib/providers/stack_restore/stack_restoring_ui_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/stack_restoring_ui_state.dart'; diff --git a/lib/providers/ui/add_wallet_selected_coin_provider.dart b/lib/providers/ui/add_wallet_selected_coin_provider.dart index 6acf51db8..e7f006f37 100644 --- a/lib/providers/ui/add_wallet_selected_coin_provider.dart +++ b/lib/providers/ui/add_wallet_selected_coin_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/add_wallet_list_entity/add_wallet_list_entity.dart'; diff --git a/lib/providers/ui/address_book_providers/address_book_filter_provider.dart b/lib/providers/ui/address_book_providers/address_book_filter_provider.dart index fb34c0f70..51fe8c07d 100644 --- a/lib/providers/ui/address_book_providers/address_book_filter_provider.dart +++ b/lib/providers/ui/address_book_providers/address_book_filter_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/address_book_filter.dart'; diff --git a/lib/providers/ui/address_book_providers/address_entry_data_provider.dart b/lib/providers/ui/address_book_providers/address_entry_data_provider.dart index 127ec7202..3df3af34f 100644 --- a/lib/providers/ui/address_book_providers/address_entry_data_provider.dart +++ b/lib/providers/ui/address_book_providers/address_entry_data_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/contact_address_entry_data.dart'; diff --git a/lib/providers/ui/address_book_providers/contact_name_is_not_empty_state_provider.dart b/lib/providers/ui/address_book_providers/contact_name_is_not_empty_state_provider.dart index c4bafb0b6..9c882ab7e 100644 --- a/lib/providers/ui/address_book_providers/contact_name_is_not_empty_state_provider.dart +++ b/lib/providers/ui/address_book_providers/contact_name_is_not_empty_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; final contactNameIsNotEmptyStateProvider = diff --git a/lib/providers/ui/address_book_providers/valid_contact_state_provider.dart b/lib/providers/ui/address_book_providers/valid_contact_state_provider.dart index 6cb0687ed..16845149f 100644 --- a/lib/providers/ui/address_book_providers/valid_contact_state_provider.dart +++ b/lib/providers/ui/address_book_providers/valid_contact_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/ui/address_book_providers/address_entry_data_provider.dart'; diff --git a/lib/providers/ui/check_box_state_provider.dart b/lib/providers/ui/check_box_state_provider.dart index 2bab7912e..456dcf813 100644 --- a/lib/providers/ui/check_box_state_provider.dart +++ b/lib/providers/ui/check_box_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/providers/ui/fee_rate_type_state_provider.dart b/lib/providers/ui/fee_rate_type_state_provider.dart index 02b49210c..f78b21f9e 100644 --- a/lib/providers/ui/fee_rate_type_state_provider.dart +++ b/lib/providers/ui/fee_rate_type_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; diff --git a/lib/providers/ui/home_view_index_provider.dart b/lib/providers/ui/home_view_index_provider.dart index b9cfa140b..ace63eda2 100644 --- a/lib/providers/ui/home_view_index_provider.dart +++ b/lib/providers/ui/home_view_index_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/providers/ui/preview_tx_button_state_provider.dart b/lib/providers/ui/preview_tx_button_state_provider.dart index 68d4fc531..842ac5658 100644 --- a/lib/providers/ui/preview_tx_button_state_provider.dart +++ b/lib/providers/ui/preview_tx_button_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; final previewTxButtonStateProvider = StateProvider.autoDispose((_) { diff --git a/lib/providers/ui/selected_paynym_details_item_Provider.dart b/lib/providers/ui/selected_paynym_details_item_Provider.dart index 153145710..4d160fde1 100644 --- a/lib/providers/ui/selected_paynym_details_item_Provider.dart +++ b/lib/providers/ui/selected_paynym_details_item_Provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/paynym/paynym_account_lite.dart'; diff --git a/lib/providers/ui/transaction_filter_provider.dart b/lib/providers/ui/transaction_filter_provider.dart index 31133327b..69b4ea650 100644 --- a/lib/providers/ui/transaction_filter_provider.dart +++ b/lib/providers/ui/transaction_filter_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/transaction_filter.dart'; diff --git a/lib/providers/ui/unread_notifications_provider.dart b/lib/providers/ui/unread_notifications_provider.dart index 4e799c979..1425537fd 100644 --- a/lib/providers/ui/unread_notifications_provider.dart +++ b/lib/providers/ui/unread_notifications_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; final unreadNotificationsStateProvider = StateProvider>((ref) => {}); diff --git a/lib/providers/ui/verify_recovery_phrase/correct_word_provider.dart b/lib/providers/ui/verify_recovery_phrase/correct_word_provider.dart index 2ed8e2692..c3a6dde85 100644 --- a/lib/providers/ui/verify_recovery_phrase/correct_word_provider.dart +++ b/lib/providers/ui/verify_recovery_phrase/correct_word_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart b/lib/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart index 4620d0df3..60697187b 100644 --- a/lib/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart +++ b/lib/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; final mnemonicWordCountStateProvider = StateProvider((ref) => 0); diff --git a/lib/providers/ui/verify_recovery_phrase/random_index_provider.dart b/lib/providers/ui/verify_recovery_phrase/random_index_provider.dart index ab8907151..900a812bc 100644 --- a/lib/providers/ui/verify_recovery_phrase/random_index_provider.dart +++ b/lib/providers/ui/verify_recovery_phrase/random_index_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/providers/ui/verify_recovery_phrase/selected_word_provider.dart b/lib/providers/ui/verify_recovery_phrase/selected_word_provider.dart index f179588fb..e8d59ae93 100644 --- a/lib/providers/ui/verify_recovery_phrase/selected_word_provider.dart +++ b/lib/providers/ui/verify_recovery_phrase/selected_word_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/providers/wallet/my_paynym_account_state_provider.dart b/lib/providers/wallet/my_paynym_account_state_provider.dart index 1919e2ace..9ee4cc89e 100644 --- a/lib/providers/wallet/my_paynym_account_state_provider.dart +++ b/lib/providers/wallet/my_paynym_account_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/paynym/paynym_account.dart'; diff --git a/lib/providers/wallet/notes_service_provider.dart b/lib/providers/wallet/notes_service_provider.dart index 8e34565b0..acc947f33 100644 --- a/lib/providers/wallet/notes_service_provider.dart +++ b/lib/providers/wallet/notes_service_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/services/notes_service.dart'; diff --git a/lib/providers/wallet/public_private_balance_state_provider.dart b/lib/providers/wallet/public_private_balance_state_provider.dart index 351489f04..1fb641072 100644 --- a/lib/providers/wallet/public_private_balance_state_provider.dart +++ b/lib/providers/wallet/public_private_balance_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; final publicPrivateBalanceStateProvider = diff --git a/lib/providers/wallet/wallet_balance_toggle_state_provider.dart b/lib/providers/wallet/wallet_balance_toggle_state_provider.dart index 477f4fb03..12e6ce8e7 100644 --- a/lib/providers/wallet/wallet_balance_toggle_state_provider.dart +++ b/lib/providers/wallet/wallet_balance_toggle_state_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart'; diff --git a/lib/providers/wallet_provider.dart b/lib/providers/wallet_provider.dart index 15c7952b6..54168abed 100644 --- a/lib/providers/wallet_provider.dart +++ b/lib/providers/wallet_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:equatable/equatable.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/db/main_db_provider.dart'; diff --git a/lib/route_generator.dart b/lib/route_generator.dart index 2791974e6..7ccc378c9 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -62,6 +72,8 @@ import 'package:stackwallet/pages/send_view/token_send_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/about_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/debug_view.dart'; +import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/edit_coin_units_view.dart'; +import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/manage_coin_units/manage_coin_units_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/manage_explorer_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/appearance_settings_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/manage_themes.dart'; @@ -154,6 +166,11 @@ import 'package:tuple/tuple.dart'; import 'models/isar/models/contact_entry.dart'; +/* + * This file contains all the routes for the app. + * To add a new route, add it to the switch statement in the generateRoute method. + */ + class RouteGenerator { static const bool useMaterialPageRoute = true; @@ -627,6 +644,26 @@ class RouteGenerator { } return _routeError("${settings.name} invalid args: ${args.toString()}"); + case ManageCoinUnitsView.routeName: + return getRoute( + shouldUseMaterialRoute: useMaterialPageRoute, + builder: (_) => const ManageCoinUnitsView(), + settings: RouteSettings(name: settings.name)); + + case EditCoinUnitsView.routeName: + if (args is Coin) { + return getRoute( + shouldUseMaterialRoute: useMaterialPageRoute, + builder: (_) => EditCoinUnitsView( + coin: args, + ), + settings: RouteSettings( + name: settings.name, + ), + ); + } + return _routeError("${settings.name} invalid args: ${args.toString()}"); + case CreateBackupInfoView.routeName: return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, diff --git a/lib/services/address_book_service.dart b/lib/services/address_book_service.dart index 793dccb8b..d925a3b0d 100644 --- a/lib/services/address_book_service.dart +++ b/lib/services/address_book_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:stackwallet/db/isar/main_db.dart'; diff --git a/lib/services/auto_swb_service.dart b/lib/services/auto_swb_service.dart index 15b4b9f77..7dcb5e421 100644 --- a/lib/services/auto_swb_service.dart +++ b/lib/services/auto_swb_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/lib/services/buy/buy.dart b/lib/services/buy/buy.dart index 84e38487c..9e2a54a7b 100644 --- a/lib/services/buy/buy.dart +++ b/lib/services/buy/buy.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + abstract class Buy { String get name; } diff --git a/lib/services/buy/buy_data_loading_service.dart b/lib/services/buy/buy_data_loading_service.dart index 93999c221..8cf102591 100644 --- a/lib/services/buy/buy_data_loading_service.dart +++ b/lib/services/buy/buy_data_loading_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // import 'package:flutter_riverpod/flutter_riverpod.dart'; // import 'package:stackwallet/providers/providers.dart'; // import 'package:stackwallet/services/buy/simplex/simplex_api.dart'; diff --git a/lib/services/buy/buy_response.dart b/lib/services/buy/buy_response.dart index 6510ece4c..60494aefa 100644 --- a/lib/services/buy/buy_response.dart +++ b/lib/services/buy/buy_response.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum BuyExceptionType { generic, serializeResponseError, diff --git a/lib/services/buy/simplex/simplex_api.dart b/lib/services/buy/simplex/simplex_api.dart index d1a110128..8158c6b8c 100644 --- a/lib/services/buy/simplex/simplex_api.dart +++ b/lib/services/buy/simplex/simplex_api.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; diff --git a/lib/services/coins/banano/banano_wallet.dart b/lib/services/coins/banano/banano_wallet.dart new file mode 100644 index 000000000..8511f5599 --- /dev/null +++ b/lib/services/coins/banano/banano_wallet.dart @@ -0,0 +1,928 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:http/http.dart' as http; +import 'package:isar/isar.dart'; +import 'package:nanodart/nanodart.dart'; +import 'package:stackwallet/db/isar/main_db.dart'; +import 'package:stackwallet/models/balance.dart'; +import 'package:stackwallet/models/isar/models/isar_models.dart'; +import 'package:stackwallet/models/node_model.dart'; +import 'package:stackwallet/models/paymint/fee_object_model.dart'; +import 'package:stackwallet/services/coins/coin_service.dart'; +import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/events/global/updated_in_background_event.dart'; +import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/global_event_bus.dart'; +import 'package:stackwallet/services/mixins/coin_control_interface.dart'; +import 'package:stackwallet/services/mixins/wallet_cache.dart'; +import 'package:stackwallet/services/mixins/wallet_db.dart'; +import 'package:stackwallet/services/node_service.dart'; +import 'package:stackwallet/services/transaction_notification_tracker.dart'; +import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/default_nodes.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; +import 'package:stackwallet/utilities/logger.dart'; +import 'package:stackwallet/utilities/prefs.dart'; +import 'package:tuple/tuple.dart'; + +const int MINIMUM_CONFIRMATIONS = 1; +const String DEFAULT_REPRESENTATIVE = + "ban_1ka1ium4pfue3uxtntqsrib8mumxgazsjf58gidh1xeo5te3whsq8z476goo"; + +class BananoWallet extends CoinServiceAPI + with WalletCache, WalletDB, CoinControlInterface { + BananoWallet({ + required String walletId, + required String walletName, + required Coin coin, + required TransactionNotificationTracker tracker, + required SecureStorageInterface secureStore, + MainDB? mockableOverride, + }) { + txTracker = tracker; + _walletId = walletId; + _walletName = walletName; + _coin = coin; + _secureStore = secureStore; + initCache(walletId, coin); + initWalletDB(mockableOverride: mockableOverride); + } + + NodeModel? _xnoNode; + + @override + Future get mnemonicPassphrase => _secureStore.read( + key: '${_walletId}_mnemonicPassphrase', + ); + + @override + Future get mnemonicString => + _secureStore.read(key: '${_walletId}_mnemonic'); + + Future getSeedFromMnemonic() async { + var mnemonic = await mnemonicString; + return NanoMnemomics.mnemonicListToSeed(mnemonic!.split(" ")); + } + + Future getPrivateKeyFromMnemonic() async { + var mnemonic = await mnemonicString; + var seed = NanoMnemomics.mnemonicListToSeed(mnemonic!.split(" ")); + return NanoKeys.seedToPrivate(seed, 0); + } + + Future getAddressFromMnemonic() async { + var mnemonic = await mnemonicString; + var seed = NanoMnemomics.mnemonicListToSeed(mnemonic!.split(' ')); + var address = NanoAccounts.createAccount(NanoAccountType.BANANO, + NanoKeys.createPublicKey(NanoKeys.seedToPrivate(seed, 0))); + return address; + } + + Future getPublicKeyFromMnemonic() async { + var mnemonic = await mnemonicString; + if (mnemonic == null) { + return ""; + } else { + var seed = NanoMnemomics.mnemonicListToSeed(mnemonic.split(" ")); + return NanoKeys.createPublicKey(NanoKeys.seedToPrivate(seed, 0)); + } + } + + @override + String get walletId => _walletId; + late String _walletId; + + @override + String get walletName => _walletName; + late String _walletName; + + @override + set walletName(String name) => _walletName = name; + + @override + set isFavorite(bool markFavorite) { + _isFavorite = markFavorite; + updateCachedIsFavorite(markFavorite); + } + + @override + bool get isFavorite => _isFavorite ??= getCachedIsFavorite(); + bool? _isFavorite; + + @override + Coin get coin => _coin; + late Coin _coin; + + late SecureStorageInterface _secureStore; + late final TransactionNotificationTracker txTracker; + final _prefs = Prefs.instance; + + Timer? timer; + bool _shouldAutoSync = false; + + @override + bool get shouldAutoSync => _shouldAutoSync; + + @override + set shouldAutoSync(bool shouldAutoSync) { + if (_shouldAutoSync != shouldAutoSync) { + _shouldAutoSync = shouldAutoSync; + if (!shouldAutoSync) { + timer?.cancel(); + timer = null; + stopNetworkAlivePinging(); + } else { + startNetworkAlivePinging(); + refresh(); + } + } + } + + @override + Balance get balance => _balance ??= getCachedBalance(); + Balance? _balance; + + Future requestWork(String hash) async { + return http + .post( + Uri.parse("https://rpc.nano.to"), // this should be a + headers: {'Content-type': 'application/json'}, + body: json.encode( + { + "action": "work_generate", + "hash": hash, + }, + ), + ) + .then((http.Response response) { + if (response.statusCode == 200) { + final Map decoded = + json.decode(response.body) as Map; + if (decoded.containsKey("error")) { + throw Exception("Received error ${decoded["error"]}"); + } + return decoded["work"] as String?; + } else { + throw Exception("Received error ${response.statusCode}"); + } + }); + } + + @override + Future confirmSend({required Map txData}) async { + try { + // our address: + final String publicAddress = await currentReceivingAddress; + + // first get the account balance: + final balanceBody = jsonEncode({ + "action": "account_balance", + "account": publicAddress, + }); + final headers = { + "Content-Type": "application/json", + }; + final balanceResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: balanceBody, + ); + final balanceData = jsonDecode(balanceResponse.body); + + final BigInt currentBalance = + BigInt.parse(balanceData["balance"].toString()); + final BigInt txAmount = txData["recipientAmt"].raw as BigInt; + final BigInt balanceAfterTx = currentBalance - txAmount; + + // get the account info (we need the frontier and representative): + final infoBody = jsonEncode({ + "action": "account_info", + "representative": "true", + "account": publicAddress, + }); + final infoResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: infoBody, + ); + + final String frontier = + jsonDecode(infoResponse.body)["frontier"].toString(); + final String representative = + jsonDecode(infoResponse.body)["representative"].toString(); + // link = destination address: + final String link = + NanoAccounts.extractPublicKey(txData["address"].toString()); + final String linkAsAccount = txData["address"].toString(); + + // construct the send block: + Map sendBlock = { + "type": "state", + "account": publicAddress, + "previous": frontier, + "representative": representative, + "balance": balanceAfterTx.toString(), + "link": link, + }; + + // sign the send block: + final String hash = NanoBlocks.computeStateHash( + NanoAccountType.BANANO, + sendBlock["account"]!, + sendBlock["previous"]!, + sendBlock["representative"]!, + BigInt.parse(sendBlock["balance"]!), + sendBlock["link"]!, + ); + final String privateKey = await getPrivateKeyFromMnemonic(); + final String signature = NanoSignatures.signBlock(hash, privateKey); + + // get PoW for the send block: + final String? work = await requestWork(frontier); + if (work == null) { + throw Exception("Failed to get PoW for send block"); + } + + sendBlock["link_as_account"] = linkAsAccount; + sendBlock["signature"] = signature; + sendBlock["work"] = work; + + final processBody = jsonEncode({ + "action": "process", + "json_block": "true", + "subtype": "send", + "block": sendBlock, + }); + final processResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: processBody, + ); + + final Map decoded = + json.decode(processResponse.body) as Map; + if (decoded.containsKey("error")) { + throw Exception("Received error ${decoded["error"]}"); + } + + // return the hash of the transaction: + return decoded["hash"].toString(); + } catch (e, s) { + Logging.instance + .log("Error sending transaction $e - $s", level: LogLevel.Error); + rethrow; + } + } + + Future get _currentReceivingAddress => db + .getAddresses(walletId) + .filter() + .typeEqualTo(AddressType.banano) + .and() + .subTypeEqualTo(AddressSubType.receiving) + .sortByDerivationIndexDesc() + .findFirst(); + + @override + Future get currentReceivingAddress async => + (await _currentReceivingAddress)?.value ?? await getAddressFromMnemonic(); + + @override + Future estimateFeeFor(Amount amount, int feeRate) { + // fees are always 0 :) + return Future.value( + Amount( + rawValue: BigInt.from(0), + fractionDigits: coin.decimals, + ), + ); + } + + @override + Future exit() async { + _hasCalledExit = true; + timer?.cancel(); + timer = null; + stopNetworkAlivePinging(); + } + + @override + // Banano has no fees + Future get fees async => FeeObject( + numberOfBlocksFast: 1, + numberOfBlocksAverage: 1, + numberOfBlocksSlow: 1, + fast: 0, + medium: 0, + slow: 0, + ); + + Future updateBalance() async { + final body = jsonEncode({ + "action": "account_balance", + "account": await currentReceivingAddress, + }); + final headers = { + "Content-Type": "application/json", + }; + final response = await http.post(Uri.parse(getCurrentNode().host), + headers: headers, body: body); + final data = jsonDecode(response.body); + _balance = Balance( + total: Amount( + rawValue: (BigInt.parse(data["balance"].toString()) + + BigInt.parse(data["receivable"].toString())), + fractionDigits: coin.decimals), + spendable: Amount( + rawValue: BigInt.parse(data["balance"].toString()), + fractionDigits: coin.decimals), + blockedTotal: + Amount(rawValue: BigInt.parse("0"), fractionDigits: coin.decimals), + pendingSpendable: Amount( + rawValue: BigInt.parse(data["receivable"].toString()), + fractionDigits: coin.decimals), + ); + await updateCachedBalance(_balance!); + } + + Future receiveBlock( + String blockHash, String source, String amountRaw) async { + // TODO: the opening block of an account is a special case + bool openBlock = false; + + final headers = { + "Content-Type": "application/json", + }; + + // our address: + final String publicAddress = await currentReceivingAddress; + + // first check if the account is open: + // get the account info (we need the frontier and representative): + final infoBody = jsonEncode({ + "action": "account_info", + "representative": "true", + "account": publicAddress, + }); + final infoResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: infoBody, + ); + final infoData = jsonDecode(infoResponse.body); + + if (infoData["error"] != null) { + // account is not open yet, we need to create an open block: + openBlock = true; + } + + // first get the account balance: + final balanceBody = jsonEncode({ + "action": "account_balance", + "account": publicAddress, + }); + + final balanceResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: balanceBody, + ); + + final balanceData = jsonDecode(balanceResponse.body); + final BigInt currentBalance = + BigInt.parse(balanceData["balance"].toString()); + final BigInt txAmount = BigInt.parse(amountRaw); + final BigInt balanceAfterTx = currentBalance + txAmount; + + String frontier = infoData["frontier"].toString(); + String representative = infoData["representative"].toString(); + + if (openBlock) { + // we don't have a representative set yet: + representative = DEFAULT_REPRESENTATIVE; + } + + // link = send block hash: + final String link = blockHash; + // this "linkAsAccount" is meaningless: + final String linkAsAccount = + NanoAccounts.createAccount(NanoAccountType.BANANO, blockHash); + + // construct the receive block: + Map receiveBlock = { + "type": "state", + "account": publicAddress, + "previous": openBlock + ? "0000000000000000000000000000000000000000000000000000000000000000" + : frontier, + "representative": representative, + "balance": balanceAfterTx.toString(), + "link": link, + "link_as_account": linkAsAccount, + }; + + // sign the receive block: + final String hash = NanoBlocks.computeStateHash( + NanoAccountType.BANANO, + receiveBlock["account"]!, + receiveBlock["previous"]!, + receiveBlock["representative"]!, + BigInt.parse(receiveBlock["balance"]!), + receiveBlock["link"]!, + ); + final String privateKey = await getPrivateKeyFromMnemonic(); + final String signature = NanoSignatures.signBlock(hash, privateKey); + + // get PoW for the receive block: + String? work; + if (openBlock) { + work = await requestWork(NanoAccounts.extractPublicKey(publicAddress)); + } else { + work = await requestWork(frontier); + } + if (work == null) { + throw Exception("Failed to get PoW for receive block"); + } + receiveBlock["link_as_account"] = linkAsAccount; + receiveBlock["signature"] = signature; + receiveBlock["work"] = work; + + // process the receive block: + + final processBody = jsonEncode({ + "action": "process", + "json_block": "true", + "subtype": "receive", + "block": receiveBlock, + }); + final processResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: processBody, + ); + + final Map decoded = + json.decode(processResponse.body) as Map; + if (decoded.containsKey("error")) { + throw Exception("Received error ${decoded["error"]}"); + } + } + + Future confirmAllReceivable() async { + final receivableResponse = await http.post(Uri.parse(getCurrentNode().host), + headers: {"Content-Type": "application/json"}, + body: jsonEncode({ + "action": "receivable", + "source": "true", + "account": await currentReceivingAddress, + "count": "-1", + })); + + final receivableData = await jsonDecode(receivableResponse.body); + if (receivableData["blocks"] == "") { + return; + } + final blocks = receivableData["blocks"] as Map; + // confirm all receivable blocks: + for (final blockHash in blocks.keys) { + final block = blocks[blockHash]; + final String amountRaw = block["amount"] as String; + final String source = block["source"] as String; + await receiveBlock(blockHash, source, amountRaw); + // a bit of a hack: + await Future.delayed(const Duration(seconds: 1)); + } + } + + Future updateTransactions() async { + await confirmAllReceivable(); + final receivingAddress = (await _currentReceivingAddress)!; + final String publicAddress = receivingAddress.value; + final response = await http.post(Uri.parse(getCurrentNode().host), + headers: {"Content-Type": "application/json"}, + body: jsonEncode({ + "action": "account_history", + "account": publicAddress, + "count": "-1", + })); + final data = await jsonDecode(response.body); + final transactions = + data["history"] is List ? data["history"] as List : []; + if (transactions.isEmpty) { + return; + } else { + List> transactionList = []; + for (var tx in transactions) { + var typeString = tx["type"].toString(); + TransactionType transactionType = TransactionType.unknown; + if (typeString == "send") { + transactionType = TransactionType.outgoing; + } else if (typeString == "receive") { + transactionType = TransactionType.incoming; + } + final amount = Amount( + rawValue: BigInt.parse(tx["amount"].toString()), + fractionDigits: coin.decimals, + ); + + var transaction = Transaction( + walletId: walletId, + txid: tx["hash"].toString(), + timestamp: int.parse(tx["local_timestamp"].toString()), + type: transactionType, + subType: TransactionSubType.none, + amount: 0, + amountString: amount.toJsonString(), + fee: 0, + height: int.parse(tx["height"].toString()), + isCancelled: false, + isLelantus: false, + slateId: "", + otherData: "", + inputs: [], + outputs: [], + nonce: 0, + numberOfMessages: null, + ); + + Address address = transactionType == TransactionType.incoming + ? receivingAddress + : Address( + walletId: walletId, + publicKey: [], + value: tx["account"].toString(), + derivationIndex: 0, + derivationPath: null, + type: AddressType.banano, + subType: AddressSubType.nonWallet, + ); + Tuple2 tuple = Tuple2(transaction, address); + transactionList.add(tuple); + } + + await db.addNewTransactionData(transactionList, walletId); + + if (transactionList.isNotEmpty) { + GlobalEventBus.instance.fire( + UpdatedInBackgroundEvent( + "Transactions updated/added for: $walletId $walletName ", + walletId, + ), + ); + } + } + } + + @override + Future fullRescan( + int maxUnusedAddressGap, int maxNumberOfIndexesToCheck) async { + await _prefs.init(); + await updateTransactions(); + await updateBalance(); + } + + @override + Future generateNewAddress() { + // TODO: implement generateNewAddress + throw UnimplementedError(); + } + + @override + bool get hasCalledExit => _hasCalledExit; + bool _hasCalledExit = false; + + @override + Future initializeExisting() async { + await _prefs.init(); + } + + @override + Future initializeNew() async { + if ((await mnemonicString) != null || (await mnemonicPassphrase) != null) { + throw Exception( + "Attempted to overwrite mnemonic on generate new wallet!"); + } + + await _prefs.init(); + + String seed = NanoSeeds.generateSeed(); + final mnemonic = NanoMnemomics.seedToMnemonic(seed); + await _secureStore.write( + key: '${_walletId}_mnemonic', + value: mnemonic.join(' '), + ); + await _secureStore.write( + key: '${_walletId}_mnemonicPassphrase', + value: "", + ); + String privateKey = NanoKeys.seedToPrivate(seed, 0); + String publicKey = NanoKeys.createPublicKey(privateKey); + String publicAddress = + NanoAccounts.createAccount(NanoAccountType.BANANO, publicKey); + + final address = Address( + walletId: walletId, + value: publicAddress, + publicKey: [], // TODO: add public key + derivationIndex: 0, + derivationPath: null, + type: AddressType.banano, + subType: AddressSubType.receiving, + ); + + await db.putAddress(address); + + await Future.wait( + [updateCachedId(walletId), updateCachedIsFavorite(false)]); + } + + @override + bool get isConnected => _isConnected; + + bool _isConnected = false; + + @override + bool get isRefreshing => refreshMutex; + + bool refreshMutex = false; + + @override + Future get maxFee => Future.value(0); + + @override + Future> get mnemonic => _getMnemonicList(); + + Future> _getMnemonicList() async { + final _mnemonicString = await mnemonicString; + if (_mnemonicString == null) { + return []; + } + final List data = _mnemonicString.split(' '); + return data; + } + + @override + Future> prepareSend({ + required String address, + required Amount amount, + Map? args, + }) async { + try { + if (amount.decimals != coin.decimals) { + throw ArgumentError("Banano prepareSend attempted with invalid Amount"); + } + + Map txData = { + "fee": 0, + "addresss": address, + "recipientAmt": amount, + }; + + Logging.instance.log("prepare send: $txData", level: LogLevel.Info); + return txData; + } catch (e, s) { + Logging.instance.log("Error getting fees $e - $s", level: LogLevel.Error); + rethrow; + } + } + + @override + Future recoverFromMnemonic( + {required String mnemonic, + String? mnemonicPassphrase, + required int maxUnusedAddressGap, + required int maxNumberOfIndexesToCheck, + required int height}) async { + try { + if ((await mnemonicString) != null || + (await this.mnemonicPassphrase) != null) { + throw Exception("Attempted to overwrite mnemonic on restore!"); + } + + await _secureStore.write( + key: '${_walletId}_mnemonic', value: mnemonic.trim()); + await _secureStore.write( + key: '${_walletId}_mnemonicPassphrase', + value: mnemonicPassphrase ?? "", + ); + + String seed = NanoMnemomics.mnemonicListToSeed(mnemonic.split(" ")); + String privateKey = NanoKeys.seedToPrivate(seed, 0); + String publicKey = NanoKeys.createPublicKey(privateKey); + String publicAddress = + NanoAccounts.createAccount(NanoAccountType.BANANO, publicKey); + + final address = Address( + walletId: walletId, + value: publicAddress, + publicKey: [], + derivationIndex: 0, + derivationPath: null, + type: AddressType.banano, + subType: AddressSubType.receiving, + ); + + await db.putAddress(address); + + await Future.wait( + [updateCachedId(walletId), updateCachedIsFavorite(false)]); + } catch (e) { + rethrow; + } + } + + @override + Future refresh() async { + if (refreshMutex) { + Logging.instance.log( + "$walletId $walletName refreshMutex denied", + level: LogLevel.Info, + ); + return; + } else { + refreshMutex = true; + } + + await _prefs.init(); + + try { + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.syncing, + walletId, + coin, + ), + ); + + await _prefs.init(); + + await updateChainHeight(); + await updateTransactions(); + await updateBalance(); + + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.synced, + walletId, + coin, + ), + ); + + if (shouldAutoSync) { + timer ??= Timer.periodic(const Duration(seconds: 30), (timer) async { + Logging.instance.log( + "Periodic refresh check for $walletId $walletName in object instance: $hashCode", + level: LogLevel.Info); + + await refresh(); + GlobalEventBus.instance.fire( + UpdatedInBackgroundEvent( + "New data found in $walletId $walletName in background!", + walletId, + ), + ); + }); + } + } catch (e, s) { + Logging.instance.log( + "Failed to refresh banano wallet $walletId: '$walletName': $e\n$s", + level: LogLevel.Warning, + ); + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.unableToSync, + walletId, + coin, + ), + ); + } + + refreshMutex = false; + } + + @override + int get storedChainHeight => getCachedChainHeight(); + + NodeModel getCurrentNode() { + return _xnoNode ?? + NodeService(secureStorageInterface: _secureStore) + .getPrimaryNodeFor(coin: coin) ?? + DefaultNodes.getNodeFor(coin); + } + + @override + Future testNetworkConnection() async { + final uri = Uri.parse(getCurrentNode().host); + + final response = await http.post( + uri, + headers: {"Content-Type": "application/json"}, + body: jsonEncode( + { + "action": "version", + }, + ), + ); + + return response.statusCode == 200; + } + + Timer? _networkAliveTimer; + + void startNetworkAlivePinging() { + // call once on start right away + _periodicPingCheck(); + + // then periodically check + _networkAliveTimer = Timer.periodic( + Constants.networkAliveTimerDuration, + (_) async { + _periodicPingCheck(); + }, + ); + } + + void _periodicPingCheck() async { + bool hasNetwork = await testNetworkConnection(); + + if (_isConnected != hasNetwork) { + NodeConnectionStatus status = hasNetwork + ? NodeConnectionStatus.connected + : NodeConnectionStatus.disconnected; + + GlobalEventBus.instance.fire( + NodeConnectionStatusChangedEvent( + status, + walletId, + coin, + ), + ); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } + } + } + + void stopNetworkAlivePinging() { + _networkAliveTimer?.cancel(); + _networkAliveTimer = null; + } + + @override + Future> get transactions => + db.getTransactions(walletId).findAll(); + + @override + Future updateNode(bool shouldRefresh) async { + _xnoNode = NodeService(secureStorageInterface: _secureStore) + .getPrimaryNodeFor(coin: coin) ?? + DefaultNodes.getNodeFor(coin); + + if (shouldRefresh) { + unawaited(refresh()); + } + } + + @override + Future updateSentCachedTxData(Map txData) async { + // not currently used for nano + return; + } + + @override + // TODO: implement utxos + Future> get utxos => throw UnimplementedError(); + + @override + bool validateAddress(String address) { + return NanoAccounts.isValid(NanoAccountType.BANANO, address); + } + + Future updateChainHeight() async { + final String publicAddress = await currentReceivingAddress; + // first get the account balance: + final infoBody = jsonEncode({ + "action": "account_info", + "account": publicAddress, + }); + final headers = { + "Content-Type": "application/json", + }; + final infoResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: infoBody, + ); + final infoData = jsonDecode(infoResponse.body); + + final int? height = int.tryParse( + infoData["confirmation_height"].toString(), + ); + await updateCachedChainHeight(height ?? 0); + } +} diff --git a/lib/services/coins/bitcoin/bitcoin_wallet.dart b/lib/services/coins/bitcoin/bitcoin_wallet.dart index 3fc44e177..1f868be71 100644 --- a/lib/services/coins/bitcoin/bitcoin_wallet.dart +++ b/lib/services/coins/bitcoin/bitcoin_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -278,7 +288,7 @@ class BitcoinWallet extends CoinServiceAPI Future get maxFee async { final fee = (await fees).fast as String; final satsFee = - Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin)); + Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin).toInt()); return satsFee.floor().toBigInt().toInt(); } @@ -1201,13 +1211,18 @@ class BitcoinWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -1288,6 +1303,7 @@ class BitcoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -1342,16 +1358,14 @@ class BitcoinWallet extends CoinServiceAPI )) .toList(); final newNode = await getCurrentNode(); - _cachedElectrumXClient = CachedElectrumX.from( - node: newNode, - prefs: _prefs, - failovers: failovers, - ); _electrumXClient = ElectrumX.from( node: newNode, prefs: _prefs, failovers: failovers, ); + _cachedElectrumXClient = CachedElectrumX.from( + electrumXClient: _electrumXClient, + ); if (shouldRefresh) { unawaited(refresh()); diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index 85c00d3ac..f5cc37d2c 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -1072,13 +1082,18 @@ class BitcoinCashWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -1153,6 +1168,7 @@ class BitcoinCashWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -1234,16 +1250,14 @@ class BitcoinCashWallet extends CoinServiceAPI )) .toList(); final newNode = await getCurrentNode(); - _cachedElectrumXClient = CachedElectrumX.from( - node: newNode, - prefs: _prefs, - failovers: failovers, - ); _electrumXClient = ElectrumX.from( node: newNode, prefs: _prefs, failovers: failovers, ); + _cachedElectrumXClient = CachedElectrumX.from( + electrumXClient: _electrumXClient, + ); if (shouldRefresh) { unawaited(refresh()); @@ -2139,6 +2153,7 @@ class BitcoinCashWallet extends CoinServiceAPI nonce: null, inputs: inputs, outputs: outputs, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); diff --git a/lib/services/coins/coin_service.dart b/lib/services/coins/coin_service.dart index 48fa59630..00a52eba5 100644 --- a/lib/services/coins/coin_service.dart +++ b/lib/services/coins/coin_service.dart @@ -1,9 +1,20 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart'; import 'package:stackwallet/electrumx_rpc/electrumx.dart'; import 'package:stackwallet/models/balance.dart'; import 'package:stackwallet/models/isar/models/isar_models.dart' as isar_models; import 'package:stackwallet/models/node_model.dart'; import 'package:stackwallet/models/paymint/fee_object_model.dart'; +import 'package:stackwallet/services/coins/banano/banano_wallet.dart'; import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart'; import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart'; import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'; @@ -14,6 +25,7 @@ import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/coins/litecoin/litecoin_wallet.dart'; import 'package:stackwallet/services/coins/monero/monero_wallet.dart'; import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart'; +import 'package:stackwallet/services/coins/nano/nano_wallet.dart'; import 'package:stackwallet/services/coins/particl/particl_wallet.dart'; import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart'; import 'package:stackwallet/services/transaction_notification_tracker.dart'; @@ -22,6 +34,18 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; import 'package:stackwallet/utilities/prefs.dart'; +/* + * This file implements the CoinServiceAPI abstract class that is used by wallet files to implement the coin specific functionality. + * @param coin: The coin type + * @param walletId: The wallet id + * @param walletName: The wallet name + * @param secureStorageInterface: The interface for securely storing data like private keys, mnemonics, passphrases, etc. + * @param node: The node to connect to + * @param tracker: The transaction notification tracker + * @param prefs: The preferences + * @return: The coin service API + */ + abstract class CoinServiceAPI { CoinServiceAPI(); @@ -56,17 +80,7 @@ abstract class CoinServiceAPI { prefs: prefs, ); final cachedClient = CachedElectrumX.from( - node: electrumxNode, - failovers: failovers - .map((e) => ElectrumXNode( - address: e.host, - port: e.port, - name: e.name, - id: e.id, - useSSL: e.useSSL, - )) - .toList(), - prefs: prefs, + electrumXClient: client, ); switch (coin) { case Coin.firo: @@ -224,6 +238,22 @@ abstract class CoinServiceAPI { client: client, ); + case Coin.nano: + return NanoWallet( + walletId: walletId, + walletName: walletName, + coin: coin, + tracker: tracker, + secureStore: secureStorageInterface); + + case Coin.banano: + return BananoWallet( + walletId: walletId, + walletName: walletName, + coin: coin, + tracker: tracker, + secureStore: secureStorageInterface); + case Coin.dogecoinTestNet: return DogecoinWallet( walletId: walletId, diff --git a/lib/services/coins/dogecoin/dogecoin_wallet.dart b/lib/services/coins/dogecoin/dogecoin_wallet.dart index 4721cb02a..8c6f5e683 100644 --- a/lib/services/coins/dogecoin/dogecoin_wallet.dart +++ b/lib/services/coins/dogecoin/dogecoin_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -1058,13 +1068,18 @@ class DogecoinWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -1140,6 +1155,7 @@ class DogecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -1194,16 +1210,14 @@ class DogecoinWallet extends CoinServiceAPI )) .toList(); final newNode = await getCurrentNode(); - _cachedElectrumXClient = CachedElectrumX.from( - node: newNode, - prefs: _prefs, - failovers: failovers, - ); _electrumXClient = ElectrumX.from( node: newNode, prefs: _prefs, failovers: failovers, ); + _cachedElectrumXClient = CachedElectrumX.from( + electrumXClient: _electrumXClient, + ); if (shouldRefresh) { unawaited(refresh()); diff --git a/lib/services/coins/ecash/ecash_wallet.dart b/lib/services/coins/ecash/ecash_wallet.dart index f45c23a73..34df71c5c 100644 --- a/lib/services/coins/ecash/ecash_wallet.dart +++ b/lib/services/coins/ecash/ecash_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; import 'dart:math'; @@ -47,7 +57,7 @@ import 'package:stackwallet/widgets/crypto_notifications.dart'; import 'package:tuple/tuple.dart'; import 'package:uuid/uuid.dart'; -const int MINIMUM_CONFIRMATIONS = 1; +const int MINIMUM_CONFIRMATIONS = 0; const String GENESIS_HASH_MAINNET = "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"; @@ -253,8 +263,8 @@ class ECashWallet extends CoinServiceAPI @override Future get maxFee async { final fee = (await fees).fast as String; - final satsFee = - Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin)); + final satsFee = Decimal.parse(fee) * + Decimal.fromInt(Constants.satsPerCoin(coin).toInt()); return satsFee.floor().toBigInt().toInt(); } @@ -361,9 +371,9 @@ class ECashWallet extends CoinServiceAPI print("format $format"); } - if (_coin == Coin.bitcoincashTestnet) { - return true; - } + // if (_coin == Coin.bitcoincashTestnet) { + // return true; + // } if (format == bitbox.Address.formatCashAddr) { return validateCashAddr(address); @@ -410,16 +420,14 @@ class ECashWallet extends CoinServiceAPI )) .toList(); final newNode = await getCurrentNode(); - _cachedElectrumXClient = CachedElectrumX.from( - node: newNode, - prefs: _prefs, - failovers: failovers, - ); _electrumXClient = ElectrumX.from( node: newNode, prefs: _prefs, failovers: failovers, ); + _cachedElectrumXClient = CachedElectrumX.from( + electrumXClient: _electrumXClient, + ); if (shouldRefresh) { unawaited(refresh()); @@ -1367,6 +1375,7 @@ class ECashWallet extends CoinServiceAPI nonce: null, inputs: inputs, outputs: outputs, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); @@ -1899,7 +1908,7 @@ class ECashWallet extends CoinServiceAPI required List satoshiAmounts, }) async { final builder = bitbox.Bitbox.transactionBuilder( - testnet: coin == Coin.bitcoincashTestnet, + testnet: false, //coin == Coin.bitcoincashTestnet, ); // retrieve address' utxos from the rest api @@ -2681,13 +2690,18 @@ class ECashWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -2772,6 +2786,7 @@ class ECashWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/epiccash/epiccash_wallet.dart b/lib/services/coins/epiccash/epiccash_wallet.dart index 137be8001..1cf75396b 100644 --- a/lib/services/coins/epiccash/epiccash_wallet.dart +++ b/lib/services/coins/epiccash/epiccash_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:ffi'; @@ -1153,10 +1163,6 @@ class EpicCashWallet extends CoinServiceAPI Future startScans() async { try { if (ListenerManager.pointer != null) { - Logging.instance - .log("LISTENER HANDLER IS NOT NULL ....", level: LogLevel.Info); - Logging.instance - .log("STOPPING ANY WALLET LISTENER ....", level: LogLevel.Info); epicboxListenerStop(ListenerManager.pointer!); } @@ -1620,13 +1626,18 @@ class EpicCashWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -1643,7 +1654,7 @@ class EpicCashWallet extends CoinServiceAPI Future _refreshTransactions() async { // final currentChainHeight = await chainHeight; final wallet = await _secureStore.read(key: '${_walletId}_wallet'); - const refreshFromNode = 0; + const refreshFromNode = 1; dynamic message; await m.protect(() async { @@ -1709,6 +1720,7 @@ class EpicCashWallet extends CoinServiceAPI ?[tx["tx_type"] == "TxReceived" ? "from" : "to"] as String? ?? ""; String? commitId = slatesToCommits[slateId]?['commitId'] as String?; + tx['numberOfMessages'] = tx['messages']?['messages']?.length; int? height; @@ -1721,6 +1733,7 @@ class EpicCashWallet extends CoinServiceAPI final isIncoming = (tx["tx_type"] == "TxReceived" || tx["tx_type"] == "TxReceivedCancelled"); + final txn = isar_models.Transaction( walletId: walletId, txid: commitId ?? tx["id"].toString(), @@ -1744,6 +1757,7 @@ class EpicCashWallet extends CoinServiceAPI otherData: tx["id"].toString(), inputs: [], outputs: [], + numberOfMessages: ((tx["numberOfMessages"] == null) ? 0 : tx["numberOfMessages"]) as int, ); // txn.address = diff --git a/lib/services/coins/ethereum/ethereum_wallet.dart b/lib/services/coins/ethereum/ethereum_wallet.dart index 2052ead4b..9a6c2dc47 100644 --- a/lib/services/coins/ethereum/ethereum_wallet.dart +++ b/lib/services/coins/ethereum/ethereum_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:bip39/bip39.dart' as bip39; @@ -944,6 +954,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { response.value?.nonce.toBigIntFromHex.toInt(), inputs: [], outputs: [], + numberOfMessages: null, ); Address? address = await db.getAddress( @@ -1035,6 +1046,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: tuple.item2, inputs: [], outputs: [], + numberOfMessages: null, ); Address? transactionAddress = await db diff --git a/lib/services/coins/firo/firo_wallet.dart b/lib/services/coins/firo/firo_wallet.dart index 88af91067..4e843d924 100644 --- a/lib/services/coins/firo/firo_wallet.dart +++ b/lib/services/coins/firo/firo_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -449,6 +459,7 @@ Future> staticProcessRestore( nonce: null, inputs: element.inputs, outputs: element.outputs, + numberOfMessages: null, )..address.value = element.address.value; } }); @@ -891,6 +902,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -985,13 +997,18 @@ class FiroWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -1840,16 +1857,14 @@ class FiroWallet extends CoinServiceAPI ) .toList(); final newNode = await _getCurrentNode(); - _cachedElectrumXClient = CachedElectrumX.from( - node: newNode, - prefs: _prefs, - failovers: failovers, - ); _electrumXClient = ElectrumX.from( node: newNode, prefs: _prefs, failovers: failovers, ); + _cachedElectrumXClient = CachedElectrumX.from( + electrumXClient: _electrumXClient, + ); if (shouldRefresh) { unawaited(refresh()); @@ -2237,7 +2252,7 @@ class FiroWallet extends CoinServiceAPI Future _fetchMaxFee() async { final balance = availablePrivateBalance(); int spendAmount = - (balance.decimal * Decimal.fromInt(Constants.satsPerCoin(coin))) + (balance.decimal * Decimal.fromInt(Constants.satsPerCoin(coin).toInt())) .toBigInt() .toInt(); int fee = await estimateJoinSplitFee(spendAmount); @@ -3035,6 +3050,7 @@ class FiroWallet extends CoinServiceAPI otherData: transactionInfo["otherData"] as String?, inputs: [], outputs: [], + numberOfMessages: null, ); final transactionAddress = await db @@ -3361,33 +3377,33 @@ class FiroWallet extends CoinServiceAPI List> allTransactions = []; - final currentHeight = await chainHeight; + // final currentHeight = await chainHeight; for (final txHash in allTxHashes) { - final storedTx = await db - .getTransactions(walletId) - .filter() - .txidEqualTo(txHash["tx_hash"] as String) - .findFirst(); + // final storedTx = await db + // .getTransactions(walletId) + // .filter() + // .txidEqualTo(txHash["tx_hash"] as String) + // .findFirst(); - if (storedTx == null || - !storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)) { - final tx = await cachedElectrumXClient.getTransaction( - txHash: txHash["tx_hash"] as String, - verbose: true, - coin: coin, - ); + // if (storedTx == null || + // !storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)) { + final tx = await cachedElectrumXClient.getTransaction( + txHash: txHash["tx_hash"] as String, + verbose: true, + coin: coin, + ); - if (!_duplicateTxCheck(allTransactions, tx["txid"] as String)) { - tx["address"] = await db - .getAddresses(walletId) - .filter() - .valueEqualTo(txHash["address"] as String) - .findFirst(); - tx["height"] = txHash["height"]; - allTransactions.add(tx); - } + if (!_duplicateTxCheck(allTransactions, tx["txid"] as String)) { + tx["address"] = await db + .getAddresses(walletId) + .filter() + .valueEqualTo(txHash["address"] as String) + .findFirst(); + tx["height"] = txHash["height"]; + allTransactions.add(tx); } + // } } final List> txnsData = @@ -3515,6 +3531,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(tx, null)); @@ -3637,6 +3654,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); txnsData.add(Tuple2(tx, transactionAddress)); @@ -3788,6 +3806,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); txnsData.add(Tuple2(tx, transactionAddress)); @@ -4824,9 +4843,10 @@ class FiroWallet extends CoinServiceAPI ) async { var lelantusEntry = await _getLelantusEntry(); final balance = availablePrivateBalance().decimal; - int spendAmount = (balance * Decimal.fromInt(Constants.satsPerCoin(coin))) - .toBigInt() - .toInt(); + int spendAmount = + (balance * Decimal.fromInt(Constants.satsPerCoin(coin).toInt())) + .toBigInt() + .toInt(); if (spendAmount == 0 || lelantusEntry.isEmpty) { return LelantusFeeData(0, 0, []).fee; } @@ -5066,6 +5086,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = await db diff --git a/lib/services/coins/litecoin/litecoin_wallet.dart b/lib/services/coins/litecoin/litecoin_wallet.dart index 274520f1d..eab762cd7 100644 --- a/lib/services/coins/litecoin/litecoin_wallet.dart +++ b/lib/services/coins/litecoin/litecoin_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -223,7 +233,7 @@ class LitecoinWallet extends CoinServiceAPI Future get maxFee async { final fee = (await fees).fast as String; final satsFee = - Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin)); + Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin).toInt()); return satsFee.floor().toBigInt().toInt(); } @@ -1189,13 +1199,18 @@ class LitecoinWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -1271,6 +1286,7 @@ class LitecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -1325,16 +1341,14 @@ class LitecoinWallet extends CoinServiceAPI )) .toList(); final newNode = await getCurrentNode(); - _cachedElectrumXClient = CachedElectrumX.from( - node: newNode, - prefs: _prefs, - failovers: failovers, - ); _electrumXClient = ElectrumX.from( node: newNode, prefs: _prefs, failovers: failovers, ); + _cachedElectrumXClient = CachedElectrumX.from( + electrumXClient: _electrumXClient, + ); if (shouldRefresh) { unawaited(refresh()); @@ -1793,6 +1807,18 @@ class LitecoinWallet extends CoinServiceAPI coin: coin, ); + bool shouldBlock = false; + String? blockReason; + String? label; + + final utxoAmount = jsonUTXO["value"] as int; + + if (utxoAmount <= 10000) { + shouldBlock = true; + blockReason = "May contain ordinal"; + label = "Possible ordinal"; + } + final vout = jsonUTXO["tx_pos"] as int; final outputs = txn["vout"] as List; @@ -1811,10 +1837,10 @@ class LitecoinWallet extends CoinServiceAPI walletId: walletId, txid: txn["txid"] as String, vout: vout, - value: jsonUTXO["value"] as int, - name: "", - isBlocked: false, - blockedReason: null, + value: utxoAmount, + name: label ?? "", + isBlocked: shouldBlock, + blockedReason: blockReason, isCoinbase: txn["is_coinbase"] as bool? ?? false, blockHash: txn["blockhash"] as String?, blockHeight: jsonUTXO["height"] as int?, @@ -1826,16 +1852,20 @@ class LitecoinWallet extends CoinServiceAPI } } - Logging.instance - .log('Outputs fetched: $outputArray', level: LogLevel.Info); + Logging.instance.log( + 'Outputs fetched: $outputArray', + level: LogLevel.Info, + ); await db.updateUTXOs(walletId, outputArray); // finally update balance await _updateBalance(); } catch (e, s) { - Logging.instance - .log("Output fetch unsuccessful: $e\n$s", level: LogLevel.Error); + Logging.instance.log( + "Output fetch unsuccessful: $e\n$s", + level: LogLevel.Error, + ); } } diff --git a/lib/services/coins/manager.dart b/lib/services/coins/manager.dart index b8bb6d6d4..4e3dd460e 100644 --- a/lib/services/coins/manager.dart +++ b/lib/services/coins/manager.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:event_bus/event_bus.dart'; diff --git a/lib/services/coins/monero/monero_wallet.dart b/lib/services/coins/monero/monero_wallet.dart index 29debe753..242d85214 100644 --- a/lib/services/coins/monero/monero_wallet.dart +++ b/lib/services/coins/monero/monero_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; import 'dart:math'; @@ -954,6 +964,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(txn, address)); diff --git a/lib/services/coins/namecoin/namecoin_wallet.dart b/lib/services/coins/namecoin/namecoin_wallet.dart index ebb3a9822..20fc01c26 100644 --- a/lib/services/coins/namecoin/namecoin_wallet.dart +++ b/lib/services/coins/namecoin/namecoin_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -215,7 +225,7 @@ class NamecoinWallet extends CoinServiceAPI Future get maxFee async { final fee = (await fees).fast as String; final satsFee = - Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin)); + Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin).toInt()); return satsFee.floor().toBigInt().toInt(); } @@ -1179,13 +1189,18 @@ class NamecoinWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -1260,6 +1275,7 @@ class NamecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -1314,16 +1330,14 @@ class NamecoinWallet extends CoinServiceAPI )) .toList(); final newNode = await getCurrentNode(); - _cachedElectrumXClient = CachedElectrumX.from( - node: newNode, - prefs: _prefs, - failovers: failovers, - ); _electrumXClient = ElectrumX.from( node: newNode, prefs: _prefs, failovers: failovers, ); + _cachedElectrumXClient = CachedElectrumX.from( + electrumXClient: _electrumXClient, + ); if (shouldRefresh) { unawaited(refresh()); @@ -2803,19 +2817,18 @@ class NamecoinWallet extends CoinServiceAPI // Add transaction output for (var i = 0; i < recipients.length; i++) { - txb.addOutput(recipients[i], satoshiAmounts[i], namecoin.bech32!); + txb.addOutput(recipients[i], satoshiAmounts[i], _network.bech32!); } try { // Sign the transaction accordingly for (var i = 0; i < utxoSigningData.length; i++) { - final txid = utxoSigningData[i].utxo.txid; - txb.addInput( - txid, - utxoSigningData[i].utxo.vout, - null, - utxoSigningData[i].output!, - _network.bech32!, + txb.sign( + vin: i, + keyPair: utxoSigningData[i].keyPair!, + witnessValue: utxoSigningData[i].utxo.value, + redeemScript: utxoSigningData[i].redeemScript, + overridePrefix: _network.bech32!, ); } } catch (e, s) { @@ -2824,7 +2837,7 @@ class NamecoinWallet extends CoinServiceAPI rethrow; } - final builtTx = txb.build(namecoin.bech32!); + final builtTx = txb.build(_network.bech32!); final vSize = builtTx.virtualSize(); return {"hex": builtTx.toHex(), "vSize": vSize}; diff --git a/lib/services/coins/nano/nano_wallet.dart b/lib/services/coins/nano/nano_wallet.dart new file mode 100644 index 000000000..1e783bf5f --- /dev/null +++ b/lib/services/coins/nano/nano_wallet.dart @@ -0,0 +1,940 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + +import 'dart:async'; +import 'dart:convert'; + +import 'package:http/http.dart' as http; +import 'package:isar/isar.dart'; +import 'package:nanodart/nanodart.dart'; +import 'package:stackwallet/db/isar/main_db.dart'; +import 'package:stackwallet/models/balance.dart'; +import 'package:stackwallet/models/isar/models/isar_models.dart'; +import 'package:stackwallet/models/node_model.dart'; +import 'package:stackwallet/models/paymint/fee_object_model.dart'; +import 'package:stackwallet/services/coins/coin_service.dart'; +import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/events/global/updated_in_background_event.dart'; +import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/global_event_bus.dart'; +import 'package:stackwallet/services/mixins/coin_control_interface.dart'; +import 'package:stackwallet/services/mixins/wallet_cache.dart'; +import 'package:stackwallet/services/mixins/wallet_db.dart'; +import 'package:stackwallet/services/node_service.dart'; +import 'package:stackwallet/services/transaction_notification_tracker.dart'; +import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/default_nodes.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; +import 'package:stackwallet/utilities/logger.dart'; +import 'package:stackwallet/utilities/prefs.dart'; +import 'package:tuple/tuple.dart'; + +const int MINIMUM_CONFIRMATIONS = 1; +const String DEFAULT_REPRESENTATIVE = + "nano_38713x95zyjsqzx6nm1dsom1jmm668owkeb9913ax6nfgj15az3nu8xkx579"; + +class NanoWallet extends CoinServiceAPI + with WalletCache, WalletDB, CoinControlInterface { + NanoWallet({ + required String walletId, + required String walletName, + required Coin coin, + required TransactionNotificationTracker tracker, + required SecureStorageInterface secureStore, + MainDB? mockableOverride, + }) { + txTracker = tracker; + _walletId = walletId; + _walletName = walletName; + _coin = coin; + _secureStore = secureStore; + initCache(walletId, coin); + initWalletDB(mockableOverride: mockableOverride); + } + + NodeModel? _xnoNode; + + @override + Future get mnemonicPassphrase => _secureStore.read( + key: '${_walletId}_mnemonicPassphrase', + ); + + @override + Future get mnemonicString => + _secureStore.read(key: '${_walletId}_mnemonic'); + + Future getSeedFromMnemonic() async { + var mnemonic = await mnemonicString; + return NanoMnemomics.mnemonicListToSeed(mnemonic!.split(" ")); + } + + Future getPrivateKeyFromMnemonic() async { + var mnemonic = await mnemonicString; + var seed = NanoMnemomics.mnemonicListToSeed(mnemonic!.split(" ")); + return NanoKeys.seedToPrivate(seed, 0); + } + + Future getAddressFromMnemonic() async { + var mnemonic = await mnemonicString; + var seed = NanoMnemomics.mnemonicListToSeed(mnemonic!.split(' ')); + var address = NanoAccounts.createAccount(NanoAccountType.NANO, + NanoKeys.createPublicKey(NanoKeys.seedToPrivate(seed, 0))); + return address; + } + + Future getPublicKeyFromMnemonic() async { + var mnemonic = await mnemonicString; + if (mnemonic == null) { + return ""; + } else { + var seed = NanoMnemomics.mnemonicListToSeed(mnemonic.split(" ")); + return NanoKeys.createPublicKey(NanoKeys.seedToPrivate(seed, 0)); + } + } + + @override + String get walletId => _walletId; + late String _walletId; + + @override + String get walletName => _walletName; + late String _walletName; + + @override + set walletName(String name) => _walletName = name; + + @override + set isFavorite(bool markFavorite) { + _isFavorite = markFavorite; + updateCachedIsFavorite(markFavorite); + } + + @override + bool get isFavorite => _isFavorite ??= getCachedIsFavorite(); + bool? _isFavorite; + + @override + Coin get coin => _coin; + late Coin _coin; + + late SecureStorageInterface _secureStore; + late final TransactionNotificationTracker txTracker; + final _prefs = Prefs.instance; + + Timer? timer; + bool _shouldAutoSync = false; + + @override + bool get shouldAutoSync => _shouldAutoSync; + + @override + set shouldAutoSync(bool shouldAutoSync) { + if (_shouldAutoSync != shouldAutoSync) { + _shouldAutoSync = shouldAutoSync; + if (!shouldAutoSync) { + timer?.cancel(); + timer = null; + stopNetworkAlivePinging(); + } else { + startNetworkAlivePinging(); + refresh(); + } + } + } + + @override + Balance get balance => _balance ??= getCachedBalance(); + Balance? _balance; + + Future requestWork(String hash) async { + return http + .post( + Uri.parse("https://rpc.nano.to"), // this should be a + headers: {'Content-type': 'application/json'}, + body: json.encode( + { + "action": "work_generate", + "hash": hash, + }, + ), + ) + .then((http.Response response) { + if (response.statusCode == 200) { + final Map decoded = + json.decode(response.body) as Map; + if (decoded.containsKey("error")) { + throw Exception("Received error ${decoded["error"]}"); + } + return decoded["work"] as String?; + } else { + throw Exception("Received error ${response.statusCode}"); + } + }); + } + + @override + Future confirmSend({required Map txData}) async { + try { + // our address: + final String publicAddress = await currentReceivingAddress; + + // first get the account balance: + final balanceBody = jsonEncode({ + "action": "account_balance", + "account": publicAddress, + }); + final headers = { + "Content-Type": "application/json", + }; + final balanceResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: balanceBody, + ); + final balanceData = jsonDecode(balanceResponse.body); + + final BigInt currentBalance = + BigInt.parse(balanceData["balance"].toString()); + final BigInt txAmount = txData["recipientAmt"].raw as BigInt; + final BigInt balanceAfterTx = currentBalance - txAmount; + + // get the account info (we need the frontier and representative): + final infoBody = jsonEncode({ + "action": "account_info", + "representative": "true", + "account": publicAddress, + }); + final infoResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: infoBody, + ); + + final String frontier = + jsonDecode(infoResponse.body)["frontier"].toString(); + final String representative = + jsonDecode(infoResponse.body)["representative"].toString(); + // link = destination address: + final String link = + NanoAccounts.extractPublicKey(txData["address"].toString()); + final String linkAsAccount = txData["address"].toString(); + + // construct the send block: + Map sendBlock = { + "type": "state", + "account": publicAddress, + "previous": frontier, + "representative": representative, + "balance": balanceAfterTx.toString(), + "link": link, + }; + + // sign the send block: + final String hash = NanoBlocks.computeStateHash( + NanoAccountType.NANO, + sendBlock["account"]!, + sendBlock["previous"]!, + sendBlock["representative"]!, + BigInt.parse(sendBlock["balance"]!), + sendBlock["link"]!, + ); + final String privateKey = await getPrivateKeyFromMnemonic(); + final String signature = NanoSignatures.signBlock(hash, privateKey); + + // get PoW for the send block: + final String? work = await requestWork(frontier); + if (work == null) { + throw Exception("Failed to get PoW for send block"); + } + + sendBlock["link_as_account"] = linkAsAccount; + sendBlock["signature"] = signature; + sendBlock["work"] = work; + + final processBody = jsonEncode({ + "action": "process", + "json_block": "true", + "subtype": "send", + "block": sendBlock, + }); + final processResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: processBody, + ); + + final Map decoded = + json.decode(processResponse.body) as Map; + if (decoded.containsKey("error")) { + throw Exception("Received error ${decoded["error"]}"); + } + + // return the hash of the transaction: + return decoded["hash"].toString(); + } catch (e, s) { + Logging.instance + .log("Error sending transaction $e - $s", level: LogLevel.Error); + rethrow; + } + } + + Future get _currentReceivingAddress => db + .getAddresses(walletId) + .filter() + .typeEqualTo(AddressType.nano) + .and() + .subTypeEqualTo(AddressSubType.receiving) + .sortByDerivationIndexDesc() + .findFirst(); + + @override + Future get currentReceivingAddress async => + (await _currentReceivingAddress)?.value ?? await getAddressFromMnemonic(); + + @override + Future estimateFeeFor(Amount amount, int feeRate) { + // fees are always 0 :) + return Future.value( + Amount(rawValue: BigInt.from(0), fractionDigits: coin.decimals)); + } + + @override + Future exit() async { + _hasCalledExit = true; + timer?.cancel(); + timer = null; + stopNetworkAlivePinging(); + } + + @override + // Nano has no fees + Future get fees async => FeeObject( + numberOfBlocksFast: 1, + numberOfBlocksAverage: 1, + numberOfBlocksSlow: 1, + fast: 0, + medium: 0, + slow: 0, + ); + + Future updateBalance() async { + final body = jsonEncode({ + "action": "account_balance", + "account": await currentReceivingAddress, + }); + final headers = { + "Content-Type": "application/json", + }; + final response = await http.post(Uri.parse(getCurrentNode().host), + headers: headers, body: body); + final data = jsonDecode(response.body); + _balance = Balance( + total: Amount( + rawValue: (BigInt.parse(data["balance"].toString()) + + BigInt.parse(data["receivable"].toString())), + fractionDigits: coin.decimals), + spendable: Amount( + rawValue: BigInt.parse(data["balance"].toString()), + fractionDigits: coin.decimals), + blockedTotal: + Amount(rawValue: BigInt.parse("0"), fractionDigits: coin.decimals), + pendingSpendable: Amount( + rawValue: BigInt.parse(data["receivable"].toString()), + fractionDigits: coin.decimals), + ); + await updateCachedBalance(_balance!); + } + + Future receiveBlock( + String blockHash, String source, String amountRaw) async { + // TODO: the opening block of an account is a special case + bool openBlock = false; + + final headers = { + "Content-Type": "application/json", + }; + + // our address: + final String publicAddress = await currentReceivingAddress; + + // first check if the account is open: + // get the account info (we need the frontier and representative): + final infoBody = jsonEncode({ + "action": "account_info", + "representative": "true", + "account": publicAddress, + }); + final infoResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: infoBody, + ); + final infoData = jsonDecode(infoResponse.body); + + if (infoData["error"] != null) { + // account is not open yet, we need to create an open block: + openBlock = true; + } + + // first get the account balance: + final balanceBody = jsonEncode({ + "action": "account_balance", + "account": publicAddress, + }); + + final balanceResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: balanceBody, + ); + + final balanceData = jsonDecode(balanceResponse.body); + final BigInt currentBalance = + BigInt.parse(balanceData["balance"].toString()); + final BigInt txAmount = BigInt.parse(amountRaw); + final BigInt balanceAfterTx = currentBalance + txAmount; + + String frontier = infoData["frontier"].toString(); + String representative = infoData["representative"].toString(); + + if (openBlock) { + // we don't have a representative set yet: + representative = DEFAULT_REPRESENTATIVE; + } + + // link = send block hash: + final String link = blockHash; + // this "linkAsAccount" is meaningless: + final String linkAsAccount = + NanoAccounts.createAccount(NanoAccountType.NANO, blockHash); + + // construct the receive block: + Map receiveBlock = { + "type": "state", + "account": publicAddress, + "previous": openBlock + ? "0000000000000000000000000000000000000000000000000000000000000000" + : frontier, + "representative": representative, + "balance": balanceAfterTx.toString(), + "link": link, + "link_as_account": linkAsAccount, + }; + + // sign the receive block: + final String hash = NanoBlocks.computeStateHash( + NanoAccountType.NANO, + receiveBlock["account"]!, + receiveBlock["previous"]!, + receiveBlock["representative"]!, + BigInt.parse(receiveBlock["balance"]!), + receiveBlock["link"]!, + ); + final String privateKey = await getPrivateKeyFromMnemonic(); + final String signature = NanoSignatures.signBlock(hash, privateKey); + + // get PoW for the receive block: + String? work; + if (openBlock) { + work = await requestWork(NanoAccounts.extractPublicKey(publicAddress)); + } else { + work = await requestWork(frontier); + } + if (work == null) { + throw Exception("Failed to get PoW for receive block"); + } + receiveBlock["link_as_account"] = linkAsAccount; + receiveBlock["signature"] = signature; + receiveBlock["work"] = work; + + // process the receive block: + + final processBody = jsonEncode({ + "action": "process", + "json_block": "true", + "subtype": "receive", + "block": receiveBlock, + }); + final processResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: processBody, + ); + + final Map decoded = + json.decode(processResponse.body) as Map; + if (decoded.containsKey("error")) { + throw Exception("Received error ${decoded["error"]}"); + } + } + + Future confirmAllReceivable() async { + final receivableResponse = await http.post(Uri.parse(getCurrentNode().host), + headers: {"Content-Type": "application/json"}, + body: jsonEncode({ + "action": "receivable", + "source": "true", + "account": await currentReceivingAddress, + "count": "-1", + })); + + final receivableData = await jsonDecode(receivableResponse.body); + if (receivableData["blocks"] == "") { + return; + } + final blocks = receivableData["blocks"] as Map; + // confirm all receivable blocks: + for (final blockHash in blocks.keys) { + final block = blocks[blockHash]; + final String amountRaw = block["amount"] as String; + final String source = block["source"] as String; + await receiveBlock(blockHash, source, amountRaw); + // a bit of a hack: + await Future.delayed(const Duration(seconds: 1)); + } + } + + Future updateTransactions() async { + await confirmAllReceivable(); + final receivingAddress = (await _currentReceivingAddress)!; + final String publicAddress = receivingAddress.value; + final response = await http.post(Uri.parse(getCurrentNode().host), + headers: {"Content-Type": "application/json"}, + body: jsonEncode({ + "action": "account_history", + "account": publicAddress, + "count": "-1", + })); + final data = await jsonDecode(response.body); + final transactions = + data["history"] is List ? data["history"] as List : []; + if (transactions.isEmpty) { + return; + } else { + List> transactionList = []; + for (var tx in transactions) { + var typeString = tx["type"].toString(); + TransactionType transactionType = TransactionType.unknown; + if (typeString == "send") { + transactionType = TransactionType.outgoing; + } else if (typeString == "receive") { + transactionType = TransactionType.incoming; + } + final amount = Amount( + rawValue: BigInt.parse(tx["amount"].toString()), + fractionDigits: coin.decimals, + ); + + var transaction = Transaction( + walletId: walletId, + txid: tx["hash"].toString(), + timestamp: int.parse(tx["local_timestamp"].toString()), + type: transactionType, + subType: TransactionSubType.none, + amount: 0, + amountString: amount.toJsonString(), + fee: 0, + height: int.parse(tx["height"].toString()), + isCancelled: false, + isLelantus: false, + slateId: "", + otherData: "", + inputs: [], + outputs: [], + nonce: 0, + numberOfMessages: null, + ); + + Address address = transactionType == TransactionType.incoming + ? receivingAddress + : Address( + walletId: walletId, + publicKey: [], + value: tx["account"].toString(), + derivationIndex: 0, + derivationPath: null, + type: AddressType.nano, + subType: AddressSubType.nonWallet, + ); + Tuple2 tuple = Tuple2(transaction, address); + transactionList.add(tuple); + } + + await db.addNewTransactionData(transactionList, walletId); + + if (transactionList.isNotEmpty) { + GlobalEventBus.instance.fire( + UpdatedInBackgroundEvent( + "Transactions updated/added for: $walletId $walletName ", + walletId, + ), + ); + } + } + } + + @override + Future fullRescan( + int maxUnusedAddressGap, + int maxNumberOfIndexesToCheck, + ) async { + await _prefs.init(); + await updateTransactions(); + await updateBalance(); + } + + @override + Future generateNewAddress() { + // TODO: implement generateNewAddress + throw UnimplementedError(); + } + + @override + bool get hasCalledExit => _hasCalledExit; + bool _hasCalledExit = false; + + @override + Future initializeExisting() async { + await _prefs.init(); + } + + @override + Future initializeNew() async { + if ((await mnemonicString) != null || (await mnemonicPassphrase) != null) { + throw Exception( + "Attempted to overwrite mnemonic on generate new wallet!"); + } + + await _prefs.init(); + + String seed = NanoSeeds.generateSeed(); + final mnemonic = NanoMnemomics.seedToMnemonic(seed); + await _secureStore.write( + key: '${_walletId}_mnemonic', + value: mnemonic.join(' '), + ); + await _secureStore.write( + key: '${_walletId}_mnemonicPassphrase', + value: "", + ); + String privateKey = NanoKeys.seedToPrivate(seed, 0); + String publicKey = NanoKeys.createPublicKey(privateKey); + String publicAddress = NanoAccounts.createAccount( + NanoAccountType.NANO, + publicKey, + ); + + final address = Address( + walletId: walletId, + value: publicAddress, + publicKey: [], + derivationIndex: 0, + derivationPath: null, + type: AddressType.nano, + subType: AddressSubType.receiving, + ); + + await db.putAddress(address); + + await Future.wait([ + updateCachedId(walletId), + updateCachedIsFavorite(false), + ]); + } + + @override + bool get isConnected => _isConnected; + + bool _isConnected = false; + + @override + bool get isRefreshing => refreshMutex; + + bool refreshMutex = false; + + @override + Future get maxFee => Future.value(0); + + @override + Future> get mnemonic => _getMnemonicList(); + + Future> _getMnemonicList() async { + final _mnemonicString = await mnemonicString; + if (_mnemonicString == null) { + return []; + } + final List data = _mnemonicString.split(' '); + return data; + } + + @override + Future> prepareSend({ + required String address, + required Amount amount, + Map? args, + }) async { + try { + if (amount.decimals != coin.decimals) { + throw ArgumentError("Nano prepareSend attempted with invalid Amount"); + } + + Map txData = { + "fee": 0, + "addresss": address, + "recipientAmt": amount, + }; + + Logging.instance.log("prepare send: $txData", level: LogLevel.Info); + return txData; + } catch (e, s) { + Logging.instance.log("Error getting fees $e - $s", level: LogLevel.Error); + rethrow; + } + } + + @override + Future recoverFromMnemonic( + {required String mnemonic, + String? mnemonicPassphrase, + required int maxUnusedAddressGap, + required int maxNumberOfIndexesToCheck, + required int height}) async { + try { + if ((await mnemonicString) != null || + (await this.mnemonicPassphrase) != null) { + throw Exception("Attempted to overwrite mnemonic on restore!"); + } + + await _secureStore.write( + key: '${_walletId}_mnemonic', value: mnemonic.trim()); + await _secureStore.write( + key: '${_walletId}_mnemonicPassphrase', + value: mnemonicPassphrase ?? "", + ); + + String seed = NanoMnemomics.mnemonicListToSeed(mnemonic.split(" ")); + String privateKey = NanoKeys.seedToPrivate(seed, 0); + String publicKey = NanoKeys.createPublicKey(privateKey); + String publicAddress = + NanoAccounts.createAccount(NanoAccountType.NANO, publicKey); + + final address = Address( + walletId: walletId, + value: publicAddress, + publicKey: [], + derivationIndex: 0, + derivationPath: null, + type: AddressType.nano, + subType: AddressSubType.receiving, + ); + + await db.putAddress(address); + + await Future.wait([ + updateCachedId(walletId), + updateCachedIsFavorite(false), + ]); + } catch (e) { + rethrow; + } + } + + @override + Future refresh() async { + if (refreshMutex) { + Logging.instance.log( + "$walletId $walletName refreshMutex denied", + level: LogLevel.Info, + ); + return; + } else { + refreshMutex = true; + } + + try { + await _prefs.init(); + + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.syncing, + walletId, + coin, + ), + ); + + await updateChainHeight(); + await updateTransactions(); + await updateBalance(); + + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.synced, + walletId, + coin, + ), + ); + + if (shouldAutoSync) { + timer ??= Timer.periodic(const Duration(seconds: 30), (timer) async { + Logging.instance.log( + "Periodic refresh check for $walletId $walletName in object instance: $hashCode", + level: LogLevel.Info); + + await refresh(); + GlobalEventBus.instance.fire( + UpdatedInBackgroundEvent( + "New data found in $walletId $walletName in background!", + walletId, + ), + ); + }); + } + } catch (e, s) { + Logging.instance.log( + "Failed to refresh nano wallet $walletId: '$walletName': $e\n$s", + level: LogLevel.Warning, + ); + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.unableToSync, + walletId, + coin, + ), + ); + } + + refreshMutex = false; + } + + @override + int get storedChainHeight => getCachedChainHeight(); + + NodeModel getCurrentNode() { + return _xnoNode ?? + NodeService(secureStorageInterface: _secureStore) + .getPrimaryNodeFor(coin: coin) ?? + DefaultNodes.getNodeFor(coin); + } + + @override + Future testNetworkConnection() async { + final uri = Uri.parse(getCurrentNode().host); + + final response = await http.post( + uri, + headers: {"Content-Type": "application/json"}, + body: jsonEncode( + { + "action": "version", + }, + ), + ); + + return response.statusCode == 200; + } + + Timer? _networkAliveTimer; + + void startNetworkAlivePinging() { + // call once on start right away + _periodicPingCheck(); + + // then periodically check + _networkAliveTimer = Timer.periodic( + Constants.networkAliveTimerDuration, + (_) async { + _periodicPingCheck(); + }, + ); + } + + void _periodicPingCheck() async { + bool hasNetwork = await testNetworkConnection(); + + if (_isConnected != hasNetwork) { + NodeConnectionStatus status = hasNetwork + ? NodeConnectionStatus.connected + : NodeConnectionStatus.disconnected; + + GlobalEventBus.instance.fire( + NodeConnectionStatusChangedEvent( + status, + walletId, + coin, + ), + ); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } + } + } + + void stopNetworkAlivePinging() { + _networkAliveTimer?.cancel(); + _networkAliveTimer = null; + } + + @override + Future> get transactions => + db.getTransactions(walletId).findAll(); + + @override + Future updateNode(bool shouldRefresh) async { + _xnoNode = NodeService(secureStorageInterface: _secureStore) + .getPrimaryNodeFor(coin: coin) ?? + DefaultNodes.getNodeFor(coin); + + if (shouldRefresh) { + unawaited(refresh()); + } + } + + @override + Future updateSentCachedTxData(Map txData) async { + // not currently used for nano + return; + } + + @override + // TODO: implement utxos + Future> get utxos => throw UnimplementedError(); + + @override + bool validateAddress(String address) { + return NanoAccounts.isValid(NanoAccountType.NANO, address); + } + + Future updateChainHeight() async { + final String publicAddress = await currentReceivingAddress; + // first get the account balance: + final infoBody = jsonEncode({ + "action": "account_info", + "account": publicAddress, + }); + final headers = { + "Content-Type": "application/json", + }; + final infoResponse = await http.post( + Uri.parse(getCurrentNode().host), + headers: headers, + body: infoBody, + ); + final infoData = jsonDecode(infoResponse.body); + + final int? height = int.tryParse( + infoData["confirmation_height"].toString(), + ); + await updateCachedChainHeight(height ?? 0); + } +} diff --git a/lib/services/coins/particl/particl_wallet.dart b/lib/services/coins/particl/particl_wallet.dart index 8eb1b7b28..b4028ffca 100644 --- a/lib/services/coins/particl/particl_wallet.dart +++ b/lib/services/coins/particl/particl_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -210,7 +220,7 @@ class ParticlWallet extends CoinServiceAPI Future get maxFee async { final fee = (await fees).fast as String; final satsFee = - Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin)); + Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin).toInt()); return satsFee.floor().toBigInt().toInt(); } @@ -1106,13 +1116,18 @@ class ParticlWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } @@ -1188,6 +1203,7 @@ class ParticlWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -1242,16 +1258,14 @@ class ParticlWallet extends CoinServiceAPI )) .toList(); final newNode = await getCurrentNode(); - _cachedElectrumXClient = CachedElectrumX.from( - node: newNode, - prefs: _prefs, - failovers: failovers, - ); _electrumXClient = ElectrumX.from( node: newNode, prefs: _prefs, failovers: failovers, ); + _cachedElectrumXClient = CachedElectrumX.from( + electrumXClient: _electrumXClient, + ); if (shouldRefresh) { unawaited(refresh()); @@ -2191,7 +2205,7 @@ class ParticlWallet extends CoinServiceAPI if (prevOut == out["n"]) { inputAmtSentFromWallet += (Decimal.parse(out["value"]!.toString()) * - Decimal.fromInt(Constants.satsPerCoin(coin))) + Decimal.fromInt(Constants.satsPerCoin(coin).toInt())) .toBigInt() .toInt(); } @@ -2210,7 +2224,7 @@ class ParticlWallet extends CoinServiceAPI output["scriptPubKey"]!["addresses"][0] as String; final value = output["value"]!; final _value = (Decimal.parse(value.toString()) * - Decimal.fromInt(Constants.satsPerCoin(coin))) + Decimal.fromInt(Constants.satsPerCoin(coin).toInt())) .toBigInt() .toInt(); totalOutput += _value; @@ -2245,7 +2259,7 @@ class ParticlWallet extends CoinServiceAPI level: LogLevel.Info); final ctFee = output["ct_fee"]!; final feeValue = (Decimal.parse(ctFee.toString()) * - Decimal.fromInt(Constants.satsPerCoin(coin))) + Decimal.fromInt(Constants.satsPerCoin(coin).toInt())) .toBigInt() .toInt(); Logging.instance.log( @@ -2280,7 +2294,7 @@ class ParticlWallet extends CoinServiceAPI output["scriptPubKey"]?["addresses"]?[0] as String?; if (address != null) { final value = (Decimal.parse((output["value"] ?? 0).toString()) * - Decimal.fromInt(Constants.satsPerCoin(coin))) + Decimal.fromInt(Constants.satsPerCoin(coin).toInt())) .toBigInt() .toInt(); totalOut += value; @@ -2306,7 +2320,7 @@ class ParticlWallet extends CoinServiceAPI for (final out in tx["vout"] as List) { if (prevOut == out["n"]) { totalIn += (Decimal.parse((out["value"] ?? 0).toString()) * - Decimal.fromInt(Constants.satsPerCoin(coin))) + Decimal.fromInt(Constants.satsPerCoin(coin).toInt())) .toBigInt() .toInt(); } @@ -2393,6 +2407,7 @@ class ParticlWallet extends CoinServiceAPI nonce: null, slateId: null, otherData: null, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); diff --git a/lib/services/coins/wownero/wownero_wallet.dart b/lib/services/coins/wownero/wownero_wallet.dart index c07582fa5..722313341 100644 --- a/lib/services/coins/wownero/wownero_wallet.dart +++ b/lib/services/coins/wownero/wownero_wallet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; import 'dart:math'; @@ -1041,6 +1051,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(txn, address)); diff --git a/lib/services/debug_service.dart b/lib/services/debug_service.dart index dadb76990..a0d2efac1 100644 --- a/lib/services/debug_service.dart +++ b/lib/services/debug_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:io'; @@ -34,7 +44,7 @@ class DebugService extends ChangeNotifier { // }); } - List get recentLogs => isar.logs.where().limit(200).findAllSync(); + List get recentLogs => isar.logs.where().sortByTimestampInMillisUTCDesc().limit(100).findAllSync(); // Future updateRecentLogs() async { // int totalCount = await isar.logs.count(); diff --git a/lib/services/ethereum/cached_eth_token_balance.dart b/lib/services/ethereum/cached_eth_token_balance.dart index d477d0460..aad4b3f68 100644 --- a/lib/services/ethereum/cached_eth_token_balance.dart +++ b/lib/services/ethereum/cached_eth_token_balance.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/balance.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/services/ethereum/ethereum_api.dart'; diff --git a/lib/services/ethereum/ethereum_api.dart b/lib/services/ethereum/ethereum_api.dart index fcc5de192..de4a91540 100644 --- a/lib/services/ethereum/ethereum_api.dart +++ b/lib/services/ethereum/ethereum_api.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:decimal/decimal.dart'; @@ -15,7 +25,7 @@ import 'package:stackwallet/utilities/extensions/extensions.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:tuple/tuple.dart'; -class EthApiException with Exception { +class EthApiException implements Exception { EthApiException(this.message); final String message; diff --git a/lib/services/ethereum/ethereum_token_service.dart b/lib/services/ethereum/ethereum_token_service.dart index c7007c905..b00551854 100644 --- a/lib/services/ethereum/ethereum_token_service.dart +++ b/lib/services/ethereum/ethereum_token_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:ethereum_addresses/ethereum_addresses.dart'; @@ -169,6 +179,7 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache { response.value?.nonce.toBigIntFromHex.toInt(), inputs: [], outputs: [], + numberOfMessages: null, ); Address? address = await ethWallet.db.getAddress( @@ -519,6 +530,7 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache { otherData: tuple.item1.address, inputs: [], outputs: [], + numberOfMessages: null, ); Address? transactionAddress = await ethWallet.db diff --git a/lib/services/event_bus/events/global/balance_refreshed_event.dart b/lib/services/event_bus/events/global/balance_refreshed_event.dart index cc6e6efc3..5dce5f7d5 100644 --- a/lib/services/event_bus/events/global/balance_refreshed_event.dart +++ b/lib/services/event_bus/events/global/balance_refreshed_event.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/logger.dart'; class BalanceRefreshedEvent { diff --git a/lib/services/event_bus/events/global/blocks_remaining_event.dart b/lib/services/event_bus/events/global/blocks_remaining_event.dart index 8466557f2..14f25a058 100644 --- a/lib/services/event_bus/events/global/blocks_remaining_event.dart +++ b/lib/services/event_bus/events/global/blocks_remaining_event.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/logger.dart'; class BlocksRemainingEvent { diff --git a/lib/services/event_bus/events/global/node_connection_status_changed_event.dart b/lib/services/event_bus/events/global/node_connection_status_changed_event.dart index 6bc102b69..0361f3720 100644 --- a/lib/services/event_bus/events/global/node_connection_status_changed_event.dart +++ b/lib/services/event_bus/events/global/node_connection_status_changed_event.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/services/event_bus/events/global/refresh_percent_changed_event.dart b/lib/services/event_bus/events/global/refresh_percent_changed_event.dart index 8391b66af..abb5b75e4 100644 --- a/lib/services/event_bus/events/global/refresh_percent_changed_event.dart +++ b/lib/services/event_bus/events/global/refresh_percent_changed_event.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/logger.dart'; class RefreshPercentChangedEvent { diff --git a/lib/services/event_bus/events/global/updated_in_background_event.dart b/lib/services/event_bus/events/global/updated_in_background_event.dart index 4f462acbf..a7345a731 100644 --- a/lib/services/event_bus/events/global/updated_in_background_event.dart +++ b/lib/services/event_bus/events/global/updated_in_background_event.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/logger.dart'; class UpdatedInBackgroundEvent { diff --git a/lib/services/event_bus/events/global/wallet_sync_status_changed_event.dart b/lib/services/event_bus/events/global/wallet_sync_status_changed_event.dart index 169fde31a..fb2a47614 100644 --- a/lib/services/event_bus/events/global/wallet_sync_status_changed_event.dart +++ b/lib/services/event_bus/events/global/wallet_sync_status_changed_event.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/services/event_bus/global_event_bus.dart b/lib/services/event_bus/global_event_bus.dart index f773e9f02..5a90e8741 100644 --- a/lib/services/event_bus/global_event_bus.dart +++ b/lib/services/event_bus/global_event_bus.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:event_bus/event_bus.dart'; abstract class GlobalEventBus { diff --git a/lib/services/exchange/change_now/change_now_api.dart b/lib/services/exchange/change_now/change_now_api.dart index e14b2f128..a9d628448 100644 --- a/lib/services/exchange/change_now/change_now_api.dart +++ b/lib/services/exchange/change_now/change_now_api.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:decimal/decimal.dart'; diff --git a/lib/services/exchange/change_now/change_now_exchange.dart b/lib/services/exchange/change_now/change_now_exchange.dart index a6037b511..953d17077 100644 --- a/lib/services/exchange/change_now/change_now_exchange.dart +++ b/lib/services/exchange/change_now/change_now_exchange.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'; import 'package:stackwallet/models/exchange/response_objects/estimate.dart'; diff --git a/lib/services/exchange/exchange.dart b/lib/services/exchange/exchange.dart index 1db451457..5b750ec6c 100644 --- a/lib/services/exchange/exchange.dart +++ b/lib/services/exchange/exchange.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/exchange/response_objects/estimate.dart'; import 'package:stackwallet/models/exchange/response_objects/range.dart'; diff --git a/lib/services/exchange/exchange_data_loading_service.dart b/lib/services/exchange/exchange_data_loading_service.dart index c0aa2e2b0..6fefba289 100644 --- a/lib/services/exchange/exchange_data_loading_service.dart +++ b/lib/services/exchange/exchange_data_loading_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:isar/isar.dart'; import 'package:stackwallet/db/hive/db.dart'; diff --git a/lib/services/exchange/exchange_response.dart b/lib/services/exchange/exchange_response.dart index 79339e5f7..eafb63453 100644 --- a/lib/services/exchange/exchange_response.dart +++ b/lib/services/exchange/exchange_response.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/exceptions/exchange/exchange_exception.dart'; class ExchangeResponse { diff --git a/lib/services/exchange/majestic_bank/majestic_bank_api.dart b/lib/services/exchange/majestic_bank/majestic_bank_api.dart index 61eb886a4..613899f9c 100644 --- a/lib/services/exchange/majestic_bank/majestic_bank_api.dart +++ b/lib/services/exchange/majestic_bank/majestic_bank_api.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:decimal/decimal.dart'; diff --git a/lib/services/exchange/majestic_bank/majestic_bank_exchange.dart b/lib/services/exchange/majestic_bank/majestic_bank_exchange.dart index 95031490c..60e97d723 100644 --- a/lib/services/exchange/majestic_bank/majestic_bank_exchange.dart +++ b/lib/services/exchange/majestic_bank/majestic_bank_exchange.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/exceptions/exchange/exchange_exception.dart'; import 'package:stackwallet/exceptions/exchange/majestic_bank/mb_exception.dart'; diff --git a/lib/services/exchange/simpleswap/simpleswap_api.dart b/lib/services/exchange/simpleswap/simpleswap_api.dart index 8f14c222e..adca1f567 100644 --- a/lib/services/exchange/simpleswap/simpleswap_api.dart +++ b/lib/services/exchange/simpleswap/simpleswap_api.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:decimal/decimal.dart'; diff --git a/lib/services/exchange/simpleswap/simpleswap_exchange.dart b/lib/services/exchange/simpleswap/simpleswap_exchange.dart index 0bfe93a38..80ffb7601 100644 --- a/lib/services/exchange/simpleswap/simpleswap_exchange.dart +++ b/lib/services/exchange/simpleswap/simpleswap_exchange.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/models/exchange/response_objects/estimate.dart'; import 'package:stackwallet/models/exchange/response_objects/range.dart'; diff --git a/lib/services/exchange/trocador/response_objects/trocador_coin.dart b/lib/services/exchange/trocador/response_objects/trocador_coin.dart index aea01d2f1..cb2aed0f2 100644 --- a/lib/services/exchange/trocador/response_objects/trocador_coin.dart +++ b/lib/services/exchange/trocador/response_objects/trocador_coin.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; class TrocadorCoin { diff --git a/lib/services/exchange/trocador/response_objects/trocador_quote.dart b/lib/services/exchange/trocador/response_objects/trocador_quote.dart index ada8725f5..cb478a25e 100644 --- a/lib/services/exchange/trocador/response_objects/trocador_quote.dart +++ b/lib/services/exchange/trocador/response_objects/trocador_quote.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; class TrocadorQuote { diff --git a/lib/services/exchange/trocador/response_objects/trocador_rate.dart b/lib/services/exchange/trocador/response_objects/trocador_rate.dart index 5c3d18da2..229487bbd 100644 --- a/lib/services/exchange/trocador/response_objects/trocador_rate.dart +++ b/lib/services/exchange/trocador/response_objects/trocador_rate.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; import 'package:stackwallet/services/exchange/trocador/response_objects/trocador_quote.dart'; diff --git a/lib/services/exchange/trocador/response_objects/trocador_trade.dart b/lib/services/exchange/trocador/response_objects/trocador_trade.dart index 5768a9423..5d1f5d72a 100644 --- a/lib/services/exchange/trocador/response_objects/trocador_trade.dart +++ b/lib/services/exchange/trocador/response_objects/trocador_trade.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; class TrocadorTrade { diff --git a/lib/services/exchange/trocador/response_objects/trocador_trade_new.dart b/lib/services/exchange/trocador/response_objects/trocador_trade_new.dart index 4dc8ae380..4a61dee24 100644 --- a/lib/services/exchange/trocador/response_objects/trocador_trade_new.dart +++ b/lib/services/exchange/trocador/response_objects/trocador_trade_new.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:decimal/decimal.dart'; class TrocadorTradeNew { diff --git a/lib/services/exchange/trocador/trocador_api.dart b/lib/services/exchange/trocador/trocador_api.dart index d74ff2460..4c9b2cbac 100644 --- a/lib/services/exchange/trocador/trocador_api.dart +++ b/lib/services/exchange/trocador/trocador_api.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:flutter/foundation.dart'; diff --git a/lib/services/exchange/trocador/trocador_exchange.dart b/lib/services/exchange/trocador/trocador_exchange.dart index e0becb11c..e4f14ff17 100644 --- a/lib/services/exchange/trocador/trocador_exchange.dart +++ b/lib/services/exchange/trocador/trocador_exchange.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:math'; import 'package:decimal/decimal.dart'; diff --git a/lib/services/locale_service.dart b/lib/services/locale_service.dart index edb8bfc98..7f5cde716 100644 --- a/lib/services/locale_service.dart +++ b/lib/services/locale_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:devicelocale/devicelocale.dart'; diff --git a/lib/services/mixins/coin_control_interface.dart b/lib/services/mixins/coin_control_interface.dart index d3e6079a0..25fbf9a37 100644 --- a/lib/services/mixins/coin_control_interface.dart +++ b/lib/services/mixins/coin_control_interface.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:isar/isar.dart'; diff --git a/lib/services/mixins/electrum_x_parsing.dart b/lib/services/mixins/electrum_x_parsing.dart index c313a91eb..d0b88ba35 100644 --- a/lib/services/mixins/electrum_x_parsing.dart +++ b/lib/services/mixins/electrum_x_parsing.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:bip47/src/util.dart'; @@ -148,19 +158,31 @@ mixin ElectrumXParsing { type = TransactionType.outgoing; amount = amountSentFromWallet - changeAmount - fee; - final possible = - outputAddresses.difference(myChangeReceivedOnAddresses).first; + // non wallet addresses found in tx outputs + final nonWalletOutAddresses = outputAddresses.difference( + myChangeReceivedOnAddresses, + ); - if (transactionAddress.value != possible) { - transactionAddress = Address( - walletId: walletId, - value: possible, - derivationIndex: -1, - derivationPath: null, - subType: AddressSubType.nonWallet, - type: AddressType.nonWallet, - publicKey: [], - ); + if (nonWalletOutAddresses.isNotEmpty) { + final possible = nonWalletOutAddresses.first; + + if (transactionAddress.value != possible) { + transactionAddress = Address( + walletId: walletId, + value: possible, + derivationIndex: -1, + derivationPath: null, + subType: AddressSubType.nonWallet, + type: AddressType.nonWallet, + publicKey: [], + ); + } + } else { + // some other type of tx where the receiving address is + // one of my change addresses + + type = TransactionType.sentToSelf; + amount = changeAmount; } } else { // incoming tx @@ -246,6 +268,7 @@ mixin ElectrumXParsing { nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); return Tuple2(tx, transactionAddress); diff --git a/lib/services/mixins/epic_cash_hive.dart b/lib/services/mixins/epic_cash_hive.dart index 3c5c91b07..014b9e02d 100644 --- a/lib/services/mixins/epic_cash_hive.dart +++ b/lib/services/mixins/epic_cash_hive.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/db/hive/db.dart'; mixin EpicCashHive { diff --git a/lib/services/mixins/eth_token_cache.dart b/lib/services/mixins/eth_token_cache.dart index b1fdf6bb3..fde3cb9e9 100644 --- a/lib/services/mixins/eth_token_cache.dart +++ b/lib/services/mixins/eth_token_cache.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/balance.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; diff --git a/lib/services/mixins/firo_hive.dart b/lib/services/mixins/firo_hive.dart index 180c9f278..be9845453 100644 --- a/lib/services/mixins/firo_hive.dart +++ b/lib/services/mixins/firo_hive.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/db/hive/db.dart'; mixin FiroHive { diff --git a/lib/services/mixins/paynym_wallet_interface.dart b/lib/services/mixins/paynym_wallet_interface.dart index a6902fd2b..e0c162045 100644 --- a/lib/services/mixins/paynym_wallet_interface.dart +++ b/lib/services/mixins/paynym_wallet_interface.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:math'; import 'dart:typed_data'; diff --git a/lib/services/mixins/wallet_cache.dart b/lib/services/mixins/wallet_cache.dart index 435e28717..69ebce551 100644 --- a/lib/services/mixins/wallet_cache.dart +++ b/lib/services/mixins/wallet_cache.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/balance.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; diff --git a/lib/services/mixins/wallet_db.dart b/lib/services/mixins/wallet_db.dart index bb46be7d1..012ce6330 100644 --- a/lib/services/mixins/wallet_db.dart +++ b/lib/services/mixins/wallet_db.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/db/isar/main_db.dart'; mixin WalletDB { diff --git a/lib/services/mixins/xpubable.dart b/lib/services/mixins/xpubable.dart index bd3d74d60..163662b17 100644 --- a/lib/services/mixins/xpubable.dart +++ b/lib/services/mixins/xpubable.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + mixin XPubAble { Future get xpub; } diff --git a/lib/services/node_service.dart b/lib/services/node_service.dart index fc588fa6a..88d032940 100644 --- a/lib/services/node_service.dart +++ b/lib/services/node_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:flutter/material.dart'; diff --git a/lib/services/notes_service.dart b/lib/services/notes_service.dart index eac8b6c22..1682b1bb0 100644 --- a/lib/services/notes_service.dart +++ b/lib/services/notes_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/services/notifications_api.dart b/lib/services/notifications_api.dart index dca342090..e1c42fabe 100644 --- a/lib/services/notifications_api.dart +++ b/lib/services/notifications_api.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:rxdart/rxdart.dart'; import 'package:stackwallet/models/notification_model.dart'; diff --git a/lib/services/notifications_service.dart b/lib/services/notifications_service.dart index 54f6d60ae..a23de66d0 100644 --- a/lib/services/notifications_service.dart +++ b/lib/services/notifications_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/foundation.dart'; diff --git a/lib/services/price.dart b/lib/services/price.dart index 16bd93c6a..22f0e79aa 100644 --- a/lib/services/price.dart +++ b/lib/services/price.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:convert'; @@ -90,7 +100,7 @@ class PriceAPI { Uri.parse("https://api.coingecko.com/api/v3/coins/markets?vs_currency" "=${baseCurrency.toLowerCase()}" "&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," - "bitcoin-cash,namecoin,wownero,ethereum,particl" + "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano" "&order=market_cap_desc&per_page=50&page=1&sparkline=false"); final coinGeckoResponse = await client.get( @@ -105,8 +115,9 @@ class PriceAPI { final coin = coinFromPrettyName(coinName); final price = Decimal.parse(map["current_price"].toString()); - final change24h = - double.parse(map["price_change_percentage_24h"].toString()); + final change24h = map["price_change_percentage_24h"] != null + ? double.parse(map["price_change_percentage_24h"].toString()) + : 0.0; result[coin] = Tuple2(price, change24h); } diff --git a/lib/services/price_service.dart b/lib/services/price_service.dart index b699af943..46c0ff85a 100644 --- a/lib/services/price_service.dart +++ b/lib/services/price_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:decimal/decimal.dart'; diff --git a/lib/services/trade_notes_service.dart b/lib/services/trade_notes_service.dart index ba5226001..7d92d4a2b 100644 --- a/lib/services/trade_notes_service.dart +++ b/lib/services/trade_notes_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/db/hive/db.dart'; diff --git a/lib/services/trade_sent_from_stack_service.dart b/lib/services/trade_sent_from_stack_service.dart index 20d2b0ffb..7f5140abe 100644 --- a/lib/services/trade_sent_from_stack_service.dart +++ b/lib/services/trade_sent_from_stack_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/trade_wallet_lookup.dart'; diff --git a/lib/services/trade_service.dart b/lib/services/trade_service.dart index 7d1a3e00c..c960c9f2a 100644 --- a/lib/services/trade_service.dart +++ b/lib/services/trade_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/exchange/response_objects/trade.dart'; diff --git a/lib/services/transaction_notification_tracker.dart b/lib/services/transaction_notification_tracker.dart index 732c4a110..440246d0a 100644 --- a/lib/services/transaction_notification_tracker.dart +++ b/lib/services/transaction_notification_tracker.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/db/hive/db.dart'; class TransactionNotificationTracker { diff --git a/lib/services/wallets.dart b/lib/services/wallets.dart index ab3886015..3ae837f44 100644 --- a/lib/services/wallets.dart +++ b/lib/services/wallets.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/db/hive/db.dart'; @@ -78,7 +88,12 @@ class Wallets extends ChangeNotifier { result.add(Tuple2(coin, map[coin]!)); } - result.sort((a, b) => a.item1.prettyName.compareTo(b.item1.prettyName)); + // result.sort((a, b) => a.item1.prettyName.compareTo(b.item1.prettyName)); + result.sort((a, b) => a.item1.prettyName == "Bitcoin" + ? -1 + : b.item1.prettyName == "Monero" + ? 1 + : a.item1.prettyName.compareTo(b.item1.prettyName)); return result; } diff --git a/lib/services/wallets_service.dart b/lib/services/wallets_service.dart index cbba6bf5a..8a0cb1ac0 100644 --- a/lib/services/wallets_service.dart +++ b/lib/services/wallets_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:flutter/material.dart'; diff --git a/lib/themes/coin_card_provider.dart b/lib/themes/coin_card_provider.dart new file mode 100644 index 000000000..fc84faebd --- /dev/null +++ b/lib/themes/coin_card_provider.dart @@ -0,0 +1,24 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:stackwallet/models/isar/stack_theme.dart'; +import 'package:stackwallet/themes/theme_providers.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; + +final coinCardProvider = Provider.family((ref, coin) { + final assets = ref.watch(themeAssetsProvider); + + if (assets is ThemeAssetsV3) { + return assets.coinCardImages?[coin.mainNetVersion]; + } else { + return null; + } +}); diff --git a/lib/themes/coin_icon_provider.dart b/lib/themes/coin_icon_provider.dart index 6c17969e6..57695caa0 100644 --- a/lib/themes/coin_icon_provider.dart +++ b/lib/themes/coin_icon_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/isar/stack_theme.dart'; import 'package:stackwallet/themes/theme_providers.dart'; @@ -37,8 +47,12 @@ final coinIconProvider = Provider.family((ref, coin) { return assets.particl; case Coin.ethereum: return assets.ethereum; + default: + return assets.bitcoin; } + } else if (assets is ThemeAssetsV2) { + return (assets).coinIcons[coin.mainNetVersion]!; } else { - return (assets as ThemeAssetsV2).coinIcons[coin.mainNetVersion]!; + return (assets as ThemeAssetsV3).coinIcons[coin.mainNetVersion]!; } }); diff --git a/lib/themes/coin_image_provider.dart b/lib/themes/coin_image_provider.dart index 239e1d1cb..6ca839fb9 100644 --- a/lib/themes/coin_image_provider.dart +++ b/lib/themes/coin_image_provider.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/isar/stack_theme.dart'; import 'package:stackwallet/themes/theme_providers.dart'; @@ -41,9 +51,13 @@ final coinImageProvider = Provider.family((ref, coin) { return assets.dogecoinImage; case Coin.ethereum: return assets.ethereumImage; + default: + return assets.stackIcon; } + } else if (assets is ThemeAssetsV2) { + return (assets).coinImages[coin.mainNetVersion]!; } else { - return (assets as ThemeAssetsV2).coinImages[coin.mainNetVersion]!; + return (assets as ThemeAssetsV3).coinImages[coin.mainNetVersion]!; } }); @@ -85,8 +99,13 @@ final coinImageSecondaryProvider = Provider.family((ref, coin) { return assets.dogecoinImageSecondary; case Coin.ethereum: return assets.ethereumImageSecondary; + + default: + return assets.stackIcon; } + } else if (assets is ThemeAssetsV2) { + return (assets).coinSecondaryImages[coin.mainNetVersion]!; } else { - return (assets as ThemeAssetsV2).coinSecondaryImages[coin.mainNetVersion]!; + return (assets as ThemeAssetsV3).coinSecondaryImages[coin.mainNetVersion]!; } }); diff --git a/lib/themes/color_theme.dart b/lib/themes/color_theme.dart index b4f00adcf..bcfa45ac9 100644 --- a/lib/themes/color_theme.dart +++ b/lib/themes/color_theme.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -18,6 +28,8 @@ class CoinThemeColorDefault { Color get namecoin => const Color(0xFF91B1E1); Color get wownero => const Color(0xFFED80C1); Color get particl => const Color(0xFF8175BD); + Color get nano => const Color(0xFF209CE9); + Color get banano => const Color(0xFFFBDD11); Color forCoin(Coin coin) { switch (coin) { @@ -50,6 +62,10 @@ class CoinThemeColorDefault { return wownero; case Coin.particl: return particl; + case Coin.nano: + return nano; + case Coin.banano: + return banano; } } } diff --git a/lib/themes/stack_colors.dart b/lib/themes/stack_colors.dart index 6717615b1..b9e58a5ca 100644 --- a/lib/themes/stack_colors.dart +++ b/lib/themes/stack_colors.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/models/isar/stack_theme.dart'; import 'package:stackwallet/themes/color_theme.dart'; @@ -1697,6 +1707,10 @@ class StackColors extends ThemeExtension { return _coin.wownero; case Coin.particl: return _coin.particl; + case Coin.nano: + return _coin.nano; + case Coin.banano: + return _coin.banano; } } diff --git a/lib/themes/theme_providers.dart b/lib/themes/theme_providers.dart index 08a5be65c..1219079a5 100644 --- a/lib/themes/theme_providers.dart +++ b/lib/themes/theme_providers.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/isar/stack_theme.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/themes/theme_service.dart b/lib/themes/theme_service.dart index e130daba8..f384a0f19 100644 --- a/lib/themes/theme_service.dart +++ b/lib/themes/theme_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:io'; @@ -17,7 +27,7 @@ final pThemeService = Provider((ref) { }); class ThemeService { - static const _currentDefaultThemeVersion = 2; + static const _currentDefaultThemeVersion = 3; ThemeService._(); static ThemeService? _instance; static ThemeService get instance => _instance ??= ThemeService._(); @@ -40,9 +50,7 @@ class ThemeService { throw Exception("Invalid theme archive: Missing theme.json"); } - final OutputStream os = OutputStream(); - themeJsonFiles.first.decompress(os); - final String jsonString = utf8.decode(os.getBytes()); + final jsonString = utf8.decode(themeJsonFiles.first.content as List); final json = jsonDecode(jsonString) as Map; final theme = StackTheme.fromJson( @@ -50,6 +58,12 @@ class ThemeService { applicationThemesDirectoryPath: themesDir.path, ); + try { + theme.assets; + } catch (_) { + throw Exception("Invalid theme: Failed to create assets object"); + } + final String assetsPath = "${themesDir.path}/${theme.themeId}"; for (final file in archive.files) { @@ -159,9 +173,15 @@ class ThemeService { // TODO more thorough check/verification of theme Future verifyInstalled({required String themeId}) async { - final dbHasTheme = - await db.isar.stackThemes.where().themeIdEqualTo(themeId).count() > 0; - if (dbHasTheme) { + final theme = + await db.isar.stackThemes.where().themeIdEqualTo(themeId).findFirst(); + if (theme != null) { + try { + theme.assets; + } catch (_) { + return false; + } + final themesDir = await StackFileSystem.applicationThemesDirectory(); final jsonFileExists = await File("${themesDir.path}/$themeId/theme.json").exists(); diff --git a/lib/utilities/address_utils.dart b/lib/utilities/address_utils.dart index 44850bc65..93f776d98 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -1,8 +1,19 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:bitcoindart/bitcoindart.dart'; import 'package:crypto/crypto.dart'; import 'package:flutter_libepiccash/epic_cash.dart'; +import 'package:nanodart/nanodart.dart'; import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart'; import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'; import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart'; @@ -74,6 +85,10 @@ class AddressUtils { return Address.validateAddress(address, namecoin, namecoin.bech32!); case Coin.particl: return Address.validateAddress(address, particl); + case Coin.nano: + return NanoAccounts.isValid(NanoAccountType.NANO, address); + case Coin.banano: + return NanoAccounts.isValid(NanoAccountType.BANANO, address); case Coin.bitcoinTestNet: return Address.validateAddress(address, testnet); case Coin.litecoinTestNet: diff --git a/lib/utilities/amount/amount.dart b/lib/utilities/amount/amount.dart index 30619bb0d..e0225d34f 100644 --- a/lib/utilities/amount/amount.dart +++ b/lib/utilities/amount/amount.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:decimal/decimal.dart'; @@ -52,19 +62,11 @@ class Amount { return jsonEncode(toMap()); } - String localizedStringAsFixed({ + String fiatString({ required String locale, - int? decimalPlaces, }) { - decimalPlaces ??= fractionDigits; - assert(decimalPlaces >= 0); - final wholeNumber = decimal.truncate(); - if (decimalPlaces == 0) { - return wholeNumber.toStringAsFixed(0); - } - final String separator = (numberFormatSymbols[locale] as NumberSymbols?)?.DECIMAL_SEP ?? (numberFormatSymbols[locale.substring(0, 2)] as NumberSymbols?) @@ -73,8 +75,31 @@ class Amount { final fraction = decimal - wholeNumber; - return "${wholeNumber.toStringAsFixed(0)}$separator${fraction.toStringAsFixed(decimalPlaces).substring(2)}"; + return "${wholeNumber.toStringAsFixed(0)}$separator${fraction.toStringAsFixed(2).substring(2)}"; } + // String localizedStringAsFixed({ + // required String locale, + // int? decimalPlaces, + // }) { + // decimalPlaces ??= fractionDigits; + // assert(decimalPlaces >= 0); + // + // final wholeNumber = decimal.truncate(); + // + // if (decimalPlaces == 0) { + // return wholeNumber.toStringAsFixed(0); + // } + // + // final String separator = + // (numberFormatSymbols[locale] as NumberSymbols?)?.DECIMAL_SEP ?? + // (numberFormatSymbols[locale.substring(0, 2)] as NumberSymbols?) + // ?.DECIMAL_SEP ?? + // "."; + // + // final fraction = decimal - wholeNumber; + // + // return "${wholeNumber.toStringAsFixed(0)}$separator${fraction.toStringAsFixed(decimalPlaces).substring(2)}"; + // } // =========================================================================== // ======= Deserialization =================================================== diff --git a/lib/utilities/amount/amount_formatter.dart b/lib/utilities/amount/amount_formatter.dart new file mode 100644 index 000000000..3e556c95f --- /dev/null +++ b/lib/utilities/amount/amount_formatter.dart @@ -0,0 +1,66 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; +import 'package:stackwallet/providers/global/locale_provider.dart'; +import 'package:stackwallet/providers/global/prefs_provider.dart'; +import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; + +final pAmountUnit = Provider.family( + (ref, coin) => ref.watch( + prefsChangeNotifierProvider.select( + (value) => value.amountUnit(coin), + ), + ), +); +final pMaxDecimals = Provider.family( + (ref, coin) => ref.watch( + prefsChangeNotifierProvider.select( + (value) => value.maxDecimals(coin), + ), + ), +); + +final pAmountFormatter = Provider.family((ref, coin) { + return AmountFormatter( + unit: ref.watch(pAmountUnit(coin)), + locale: ref.watch( + localeServiceChangeNotifierProvider.select((value) => value.locale), + ), + coin: coin, + maxDecimals: ref.watch(pMaxDecimals(coin)), + ); +}); + +class AmountFormatter { + final AmountUnit unit; + final String locale; + final Coin coin; + final int maxDecimals; + + AmountFormatter({ + required this.unit, + required this.locale, + required this.coin, + required this.maxDecimals, + }); + + String format( + Amount amount, { + String? overrideUnit, + EthContract? ethContract, + bool withUnitName = true, + bool indicatePrecisionLoss = true, + }) { + return unit.displayAmount( + amount: amount, + locale: locale, + coin: coin, + maxDecimalPlaces: maxDecimals, + withUnitName: withUnitName, + indicatePrecisionLoss: indicatePrecisionLoss, + overrideUnit: overrideUnit, + tokenContract: ethContract, + ); + } +} diff --git a/lib/utilities/amount/amount_unit.dart b/lib/utilities/amount/amount_unit.dart index 2dd64202c..ee54f6d1a 100644 --- a/lib/utilities/amount/amount_unit.dart +++ b/lib/utilities/amount/amount_unit.dart @@ -1,11 +1,23 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:math' as math; import 'package:decimal/decimal.dart'; import 'package:intl/number_symbols.dart'; import 'package:intl/number_symbols_data.dart'; +import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +// preserve index order as index is used to store value in preferences enum AmountUnit { normal(0), milli(3), @@ -14,10 +26,45 @@ enum AmountUnit { pico(12), femto(15), atto(18), + zepto(21), + yocto(24), + ronto(27), + quecto(30), ; const AmountUnit(this.shift); final int shift; + + static List valuesForCoin(Coin coin) { + switch (coin) { + case Coin.firo: + case Coin.litecoin: + case Coin.particl: + case Coin.namecoin: + case Coin.bitcoinTestNet: + case Coin.litecoinTestNet: + case Coin.bitcoincashTestnet: + case Coin.dogecoinTestNet: + case Coin.firoTestNet: + case Coin.bitcoin: + case Coin.bitcoincash: + case Coin.dogecoin: + case Coin.eCash: + case Coin.epicCash: + return AmountUnit.values.sublist(0, 4); + + case Coin.monero: + case Coin.wownero: + return AmountUnit.values.sublist(0, 5); + + case Coin.ethereum: + return AmountUnit.values.sublist(0, 7); + + case Coin.nano: + case Coin.banano: + return AmountUnit.values; + } + } } extension AmountUnitExt on AmountUnit { @@ -32,7 +79,10 @@ extension AmountUnitExt on AmountUnit { case AmountUnit.nano: if (coin == Coin.ethereum) { return "gwei"; - } else if (coin == Coin.wownero || coin == Coin.monero) { + } else if (coin == Coin.wownero || + coin == Coin.monero || + coin == Coin.nano || + coin == Coin.banano) { return "n${coin.ticker}"; } else { return "sats"; @@ -40,7 +90,10 @@ extension AmountUnitExt on AmountUnit { case AmountUnit.pico: if (coin == Coin.ethereum) { return "mwei"; - } else if (coin == Coin.wownero || coin == Coin.monero) { + } else if (coin == Coin.wownero || + coin == Coin.monero || + coin == Coin.nano || + coin == Coin.banano) { return "p${coin.ticker}"; } else { return "invalid"; @@ -48,15 +101,66 @@ extension AmountUnitExt on AmountUnit { case AmountUnit.femto: if (coin == Coin.ethereum) { return "kwei"; + } else if (coin == Coin.nano || coin == Coin.banano) { + return "f${coin.ticker}"; } else { return "invalid"; } case AmountUnit.atto: if (coin == Coin.ethereum) { return "wei"; + } else if (coin == Coin.nano || coin == Coin.banano) { + return "a${coin.ticker}"; } else { return "invalid"; } + case AmountUnit.zepto: + if (coin == Coin.nano || coin == Coin.banano) { + return "z${coin.ticker}"; + } else { + return "invalid"; + } + case AmountUnit.yocto: + if (coin == Coin.nano || coin == Coin.banano) { + return "y${coin.ticker}"; + } else { + return "invalid"; + } + case AmountUnit.ronto: + if (coin == Coin.nano || coin == Coin.banano) { + return "r${coin.ticker}"; + } else { + return "invalid"; + } + case AmountUnit.quecto: + if (coin == Coin.nano || coin == Coin.banano) { + return "q${coin.ticker}"; + } else { + return "invalid"; + } + } + } + + String unitForContract(EthContract contract) { + switch (this) { + case AmountUnit.normal: + return contract.symbol; + case AmountUnit.milli: + return "m${contract.symbol}"; + case AmountUnit.micro: + return "µ${contract.symbol}"; + case AmountUnit.nano: + return "gwei"; + case AmountUnit.pico: + return "mwei"; + case AmountUnit.femto: + return "kwei"; + case AmountUnit.atto: + return "wei"; + default: + throw ArgumentError( + "Does eth even allow more than 18 decimal places?", + ); } } @@ -65,8 +169,13 @@ extension AmountUnitExt on AmountUnit { required String locale, required Coin coin, required int maxDecimalPlaces, + bool withUnitName = true, + bool indicatePrecisionLoss = true, + String? overrideUnit, + EthContract? tokenContract, }) { assert(maxDecimalPlaces >= 0); + // ensure we don't shift past minimum atomic value final realShift = math.min(shift, amount.fractionDigits); @@ -82,18 +191,44 @@ extension AmountUnitExt on AmountUnit { // start building the return value with just the whole value String returnValue = wholeNumber.toString(); + // if true and withUnitName is true, we will show "~" prepended on amount + bool didLosePrecision = false; + // if any decimal places should be shown continue building the return value if (places > 0) { // get the fractional value final Decimal fraction = shifted - shifted.truncate(); - // get final decimal based on max precision wanted - final int actualDecimalPlaces = math.min(places, maxDecimalPlaces); + // get final decimal based on max precision wanted while ensuring that + // maxDecimalPlaces doesn't exceed the max per coin + final int updatedMax; + if (tokenContract != null) { + updatedMax = maxDecimalPlaces > tokenContract.decimals + ? tokenContract.decimals + : maxDecimalPlaces; + } else { + updatedMax = + maxDecimalPlaces > coin.decimals ? coin.decimals : maxDecimalPlaces; + } + final int actualDecimalPlaces = math.min(places, updatedMax); // get remainder string without the prepending "0." - String remainder = fraction.toString().substring(2); + final fractionString = fraction.toString(); + String remainder; + if (fractionString.length > 2) { + remainder = fraction.toString().substring(2); + } else { + remainder = "0"; + } if (remainder.length > actualDecimalPlaces) { + // check for loss of precision + final remainingRemainder = + BigInt.tryParse(remainder.substring(actualDecimalPlaces)); + if (remainingRemainder != null) { + didLosePrecision = remainingRemainder > BigInt.zero; + } + // trim unwanted trailing digits remainder = remainder.substring(0, actualDecimalPlaces); } else if (remainder.length < actualDecimalPlaces) { @@ -114,7 +249,23 @@ extension AmountUnitExt on AmountUnit { returnValue += "$separator$remainder"; } + if (!withUnitName && !indicatePrecisionLoss) { + return returnValue; + } + + if (didLosePrecision && indicatePrecisionLoss) { + returnValue = "~$returnValue"; + } + + if (!withUnitName && indicatePrecisionLoss) { + return returnValue; + } + // return the value with the proper unit symbol - return "$returnValue ${unitForCoin(coin)}"; + if (tokenContract != null) { + overrideUnit = unitForContract(tokenContract); + } + + return "$returnValue ${overrideUnit ?? unitForCoin(coin)}"; } } diff --git a/lib/utilities/assets.dart b/lib/utilities/assets.dart index e9ea7ad58..7f92a9d1d 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart'; import 'package:stackwallet/services/exchange/majestic_bank/majestic_bank_exchange.dart'; diff --git a/lib/utilities/barcode_scanner_interface.dart b/lib/utilities/barcode_scanner_interface.dart index 916c95dcb..77df4904f 100644 --- a/lib/utilities/barcode_scanner_interface.dart +++ b/lib/utilities/barcode_scanner_interface.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:barcode_scan2/barcode_scan2.dart'; abstract class BarcodeScannerInterface { diff --git a/lib/utilities/biometrics.dart b/lib/utilities/biometrics.dart index cac2ccdf0..13262fadb 100644 --- a/lib/utilities/biometrics.dart +++ b/lib/utilities/biometrics.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/cupertino.dart'; diff --git a/lib/utilities/bip32_utils.dart b/lib/utilities/bip32_utils.dart index 71dcf7fcb..dcfdc329a 100644 --- a/lib/utilities/bip32_utils.dart +++ b/lib/utilities/bip32_utils.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:bip32/bip32.dart' as bip32; import 'package:bip39/bip39.dart' as bip39; import 'package:bitcoindart/bitcoindart.dart'; diff --git a/lib/utilities/bip47_utils.dart b/lib/utilities/bip47_utils.dart index 6433f4e1d..5f7b88c45 100644 --- a/lib/utilities/bip47_utils.dart +++ b/lib/utilities/bip47_utils.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:typed_data'; import 'package:bip47/src/util.dart'; diff --git a/lib/utilities/block_explorers.dart b/lib/utilities/block_explorers.dart index cf0628fd2..7ff0cf349 100644 --- a/lib/utilities/block_explorers.dart +++ b/lib/utilities/block_explorers.dart @@ -1,7 +1,18 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/db/isar/main_db.dart'; import 'package:stackwallet/models/isar/models/block_explorer.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +// Returns the default block explorer URL for the given coin and txid Uri getDefaultBlockExplorerUrlFor({ required Coin coin, required String txid, @@ -43,10 +54,14 @@ Uri getDefaultBlockExplorerUrlFor({ return Uri.parse("https://chainz.cryptoid.info/nmc/tx.dws?$txid.htm"); case Coin.particl: return Uri.parse("https://chainz.cryptoid.info/part/tx.dws?$txid.htm"); + case Coin.nano: + return Uri.parse("https://www.nanolooker.com/block/$txid"); + case Coin.banano: + return Uri.parse("https://www.bananolooker.com/block/$txid"); } } -/// returns internal Isar ID for the inserted object/record +// Returns internal Isar ID for the inserted object/record Future setBlockExplorerForCoin({ required Coin coin, required Uri url, @@ -59,6 +74,7 @@ Future setBlockExplorerForCoin({ ); } +// Returns the block explorer URL for the given coin and txid Uri getBlockExplorerTransactionUrlFor({ required Coin coin, required String txid, diff --git a/lib/utilities/clipboard_interface.dart b/lib/utilities/clipboard_interface.dart index 80cdf8a47..e185f81c6 100644 --- a/lib/utilities/clipboard_interface.dart +++ b/lib/utilities/clipboard_interface.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/services.dart'; abstract class ClipboardInterface { @@ -23,8 +33,8 @@ class FakeClipboard implements ClipboardInterface { String? _value; @override - Future getData(String format) async { - return ClipboardData(text: _value); + Future getData(String format) async { + return _value == null ? null : ClipboardData(text: _value!); } @override diff --git a/lib/utilities/constants.dart b/lib/utilities/constants.dart index b3295b3c8..2dd7be287 100644 --- a/lib/utilities/constants.dart +++ b/lib/utilities/constants.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -25,12 +35,18 @@ abstract class Constants { // static bool enableBuy = enableExchange; // // true; // true for development, - static const int _satsPerCoinEthereum = 1000000000000000000; - static const int _satsPerCoinECash = 100; - static const int _satsPerCoinMonero = 1000000000000; - static const int _satsPerCoinWownero = 100000000000; - static const int _satsPerCoin = 100000000; + static final BigInt _satsPerCoinECash = BigInt.from(100); + static final BigInt _satsPerCoinEthereum = BigInt.from(1000000000000000000); + static final BigInt _satsPerCoinMonero = BigInt.from(1000000000000); + static final BigInt _satsPerCoinWownero = BigInt.from(100000000000); + static final BigInt _satsPerCoinNano = + BigInt.parse("1000000000000000000000000000000"); // 1*10^30 + static final BigInt _satsPerCoinBanano = + BigInt.parse("100000000000000000000000000000"); // 1*10^29 + static final BigInt _satsPerCoin = BigInt.from(100000000); static const int _decimalPlaces = 8; + static const int _decimalPlacesNano = 30; + static const int _decimalPlacesBanano = 29; static const int _decimalPlacesWownero = 11; static const int _decimalPlacesMonero = 12; static const int _decimalPlacesEthereum = 18; @@ -39,8 +55,6 @@ abstract class Constants { static const int notificationsMax = 0xFFFFFFFF; static const Duration networkAliveTimerDuration = Duration(seconds: 10); - static const int pinLength = 4; - // Enable Logger.print statements static const bool disableLogger = false; @@ -48,7 +62,7 @@ abstract class Constants { static const int rescanV1 = 1; - static int satsPerCoin(Coin coin) { + static BigInt satsPerCoin(Coin coin) { switch (coin) { case Coin.bitcoin: case Coin.litecoin: @@ -65,6 +79,12 @@ abstract class Constants { case Coin.particl: return _satsPerCoin; + case Coin.nano: + return _satsPerCoinNano; + + case Coin.banano: + return _satsPerCoinBanano; + case Coin.wownero: return _satsPerCoinWownero; @@ -96,6 +116,12 @@ abstract class Constants { case Coin.particl: return _decimalPlaces; + case Coin.nano: + return _decimalPlacesNano; + + case Coin.banano: + return _decimalPlacesBanano; + case Coin.wownero: return _decimalPlacesWownero; @@ -128,7 +154,11 @@ abstract class Constants { case Coin.ethereum: case Coin.namecoin: case Coin.particl: - values.addAll([24, 21, 18, 15, 12]); + case Coin.nano: + values.addAll([24, 12]); + break; + case Coin.banano: + values.addAll([24, 12]); break; case Coin.monero: @@ -180,11 +210,43 @@ abstract class Constants { case Coin.particl: return 600; + + case Coin.nano: // TODO: Verify this + case Coin.banano: // TODO: Verify this + return 1; } } - static const int seedPhraseWordCountBip39 = 12; - static const int seedPhraseWordCountMonero = 25; + static int defaultSeedPhraseLengthFor({required Coin coin}) { + switch (coin) { + case Coin.bitcoin: + case Coin.bitcoinTestNet: + case Coin.bitcoincash: + case Coin.bitcoincashTestnet: + case Coin.eCash: + case Coin.dogecoin: + case Coin.dogecoinTestNet: + case Coin.litecoin: + case Coin.litecoinTestNet: + case Coin.firo: + case Coin.firoTestNet: + case Coin.epicCash: + case Coin.namecoin: + case Coin.particl: + case Coin.ethereum: + return 12; + + case Coin.wownero: + return 14; + + case Coin.nano: + case Coin.banano: + return 24; + + case Coin.monero: + return 25; + } + } static const Map monthMapShort = { 1: 'Jan', diff --git a/lib/utilities/custom_text_selection_controls.dart b/lib/utilities/custom_text_selection_controls.dart index e51f317fe..6817d5f1e 100644 --- a/lib/utilities/custom_text_selection_controls.dart +++ b/lib/utilities/custom_text_selection_controls.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/utilities/db_version_migration.dart b/lib/utilities/db_version_migration.dart index a83ea4305..cc58818bc 100644 --- a/lib/utilities/db_version_migration.dart +++ b/lib/utilities/db_version_migration.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; import 'package:isar/isar.dart'; import 'package:stackwallet/db/hive/db.dart'; @@ -397,6 +407,7 @@ class DbVersionMigrator with WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: tx.numberOfMessages, ); if (tx.address.isEmpty) { diff --git a/lib/utilities/default_epicboxes.dart b/lib/utilities/default_epicboxes.dart index ecbd4524a..567ef7cb1 100644 --- a/lib/utilities/default_epicboxes.dart +++ b/lib/utilities/default_epicboxes.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/epicbox_server_model.dart'; abstract class DefaultEpicBoxes { diff --git a/lib/utilities/default_eth_tokens.dart b/lib/utilities/default_eth_tokens.dart index eb04118bc..2383a24a2 100644 --- a/lib/utilities/default_eth_tokens.dart +++ b/lib/utilities/default_eth_tokens.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; abstract class DefaultTokens { diff --git a/lib/utilities/default_nodes.dart b/lib/utilities/default_nodes.dart index 0f8425c88..c8ff94120 100644 --- a/lib/utilities/default_nodes.dart +++ b/lib/utilities/default_nodes.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/models/node_model.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -171,6 +181,28 @@ abstract class DefaultNodes { isFailover: true, isDown: false); + static NodeModel get nano => NodeModel( + host: "https://rainstorm.city/api", + port: 443, + name: defaultName, + id: _nodeId(Coin.nano), + useSSL: true, + enabled: true, + coinName: Coin.nano.name, + isFailover: true, + isDown: false); + + static NodeModel get banano => NodeModel( + host: "https://kaliumapi.appditto.com/api", + port: 443, + name: defaultName, + id: _nodeId(Coin.banano), + useSSL: true, + enabled: true, + coinName: Coin.banano.name, + isFailover: true, + isDown: false); + static NodeModel get bitcoinTestnet => NodeModel( host: "bitcoin-testnet.stackwallet.com", port: 51002, @@ -269,6 +301,12 @@ abstract class DefaultNodes { case Coin.particl: return particl; + case Coin.nano: + return nano; + + case Coin.banano: + return banano; + case Coin.bitcoinTestNet: return bitcoinTestnet; diff --git a/lib/utilities/delete_everything.dart b/lib/utilities/delete_everything.dart index 3c12fba85..65a1c36a4 100644 --- a/lib/utilities/delete_everything.dart +++ b/lib/utilities/delete_everything.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/utilities/desktop_password_service.dart b/lib/utilities/desktop_password_service.dart index dc32b8254..c2de6c72f 100644 --- a/lib/utilities/desktop_password_service.dart +++ b/lib/utilities/desktop_password_service.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:hive/hive.dart'; import 'package:stack_wallet_backup/secure_storage.dart'; import 'package:stackwallet/db/hive/db.dart'; diff --git a/lib/utilities/enums/add_wallet_type_enum.dart b/lib/utilities/enums/add_wallet_type_enum.dart index 77a94c00a..3a450027a 100644 --- a/lib/utilities/enums/add_wallet_type_enum.dart +++ b/lib/utilities/enums/add_wallet_type_enum.dart @@ -1 +1,11 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum AddWalletType { New, Restore } diff --git a/lib/utilities/enums/backup_frequency_type.dart b/lib/utilities/enums/backup_frequency_type.dart index f2329539e..daec5df4e 100644 --- a/lib/utilities/enums/backup_frequency_type.dart +++ b/lib/utilities/enums/backup_frequency_type.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum BackupFrequencyType { everyTenMinutes, everyAppStart, diff --git a/lib/utilities/enums/coin_enum.dart b/lib/utilities/enums/coin_enum.dart index f1109a626..c656b2c62 100644 --- a/lib/utilities/enums/coin_enum.dart +++ b/lib/utilities/enums/coin_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as btc; import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart' as bch; @@ -14,6 +24,7 @@ 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/namecoin/namecoin_wallet.dart' as nmc; +import 'package:stackwallet/services/coins/nano/nano_wallet.dart' as nano; import 'package:stackwallet/services/coins/particl/particl_wallet.dart' as particl; import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart' as wow; @@ -21,6 +32,8 @@ import 'package:stackwallet/utilities/constants.dart'; enum Coin { bitcoin, + monero, + banano, bitcoincash, dogecoin, eCash, @@ -28,8 +41,8 @@ enum Coin { ethereum, firo, litecoin, - monero, namecoin, + nano, particl, wownero, @@ -39,10 +52,10 @@ enum Coin { /// bitcoinTestNet, - litecoinTestNet, bitcoincashTestnet, dogecoinTestNet, firoTestNet, + litecoinTestNet, } final int kTestNetCoinCount = 4; // Util.isDesktop ? 5 : 4; @@ -62,7 +75,7 @@ extension CoinExt on Coin { case Coin.epicCash: return "Epic Cash"; case Coin.eCash: - return "E-Cash"; + return "eCash"; case Coin.ethereum: return "Ethereum"; case Coin.firo: @@ -75,6 +88,10 @@ extension CoinExt on Coin { return "Wownero"; case Coin.namecoin: return "Namecoin"; + case Coin.nano: + return "Nano"; + case Coin.banano: + return "Banano"; case Coin.bitcoinTestNet: return "tBitcoin"; case Coin.litecoinTestNet: @@ -114,6 +131,10 @@ extension CoinExt on Coin { return "WOW"; case Coin.namecoin: return "NMC"; + case Coin.nano: + return "XNO"; + case Coin.banano: + return "BAN"; case Coin.bitcoinTestNet: return "tBTC"; case Coin.litecoinTestNet: @@ -154,6 +175,10 @@ extension CoinExt on Coin { return "wownero"; case Coin.namecoin: return "namecoin"; + case Coin.nano: + return "nano"; + case Coin.banano: + return "ban"; case Coin.bitcoinTestNet: return "bitcoin"; case Coin.litecoinTestNet: @@ -188,6 +213,8 @@ extension CoinExt on Coin { case Coin.ethereum: case Coin.monero: case Coin.wownero: + case Coin.nano: + case Coin.banano: return false; } } @@ -213,6 +240,8 @@ extension CoinExt on Coin { case Coin.litecoinTestNet: case Coin.bitcoincashTestnet: case Coin.firoTestNet: + case Coin.nano: + case Coin.banano: return false; } } @@ -230,6 +259,8 @@ extension CoinExt on Coin { case Coin.ethereum: case Coin.monero: case Coin.wownero: + case Coin.nano: + case Coin.banano: case Coin.eCash: return false; @@ -255,6 +286,8 @@ extension CoinExt on Coin { case Coin.ethereum: case Coin.monero: case Coin.wownero: + case Coin.nano: + case Coin.banano: case Coin.eCash: return this; @@ -317,6 +350,10 @@ extension CoinExt on Coin { case Coin.namecoin: return nmc.MINIMUM_CONFIRMATIONS; + + case Coin.nano: + case Coin.banano: + return nano.MINIMUM_CONFIRMATIONS; } } @@ -403,6 +440,14 @@ Coin coinFromPrettyName(String name) { case "wownero": return Coin.wownero; + case "Nano": + case "nano": + return Coin.nano; + + case "Banano": + case "banano": + return Coin.banano; + default: throw ArgumentError.value( name, @@ -448,6 +493,10 @@ Coin coinFromTickerCaseInsensitive(String ticker) { return Coin.dogecoinTestNet; case "wow": return Coin.wownero; + case "xno": + return Coin.nano; + case "ban": + return Coin.banano; default: throw ArgumentError.value( ticker, "name", "No Coin enum value with that ticker"); diff --git a/lib/utilities/enums/create_wallet_type.dart b/lib/utilities/enums/create_wallet_type.dart index 6ad21e298..f79246a65 100644 --- a/lib/utilities/enums/create_wallet_type.dart +++ b/lib/utilities/enums/create_wallet_type.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum CreateWalletType { NEW, RESTORE, diff --git a/lib/utilities/enums/derive_path_type_enum.dart b/lib/utilities/enums/derive_path_type_enum.dart index 72899f5bd..f3e7f86df 100644 --- a/lib/utilities/enums/derive_path_type_enum.dart +++ b/lib/utilities/enums/derive_path_type_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:stackwallet/utilities/enums/coin_enum.dart'; enum DerivePathType { @@ -37,6 +47,8 @@ extension DerivePathTypeExt on DerivePathType { case Coin.epicCash: case Coin.monero: case Coin.wownero: + case Coin.nano: + case Coin.banano: throw UnsupportedError( "$coin does not use bitcoin style derivation paths"); } diff --git a/lib/utilities/enums/exchange_rate_type_enum.dart b/lib/utilities/enums/exchange_rate_type_enum.dart index 2b6267805..3cdf7f15d 100644 --- a/lib/utilities/enums/exchange_rate_type_enum.dart +++ b/lib/utilities/enums/exchange_rate_type_enum.dart @@ -1 +1,11 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum ExchangeRateType { estimated, fixed } diff --git a/lib/utilities/enums/fee_rate_type_enum.dart b/lib/utilities/enums/fee_rate_type_enum.dart index 95374453e..9ed14801c 100644 --- a/lib/utilities/enums/fee_rate_type_enum.dart +++ b/lib/utilities/enums/fee_rate_type_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum FeeRateType { fast, average, slow } extension FeeRateTypeExt on FeeRateType { diff --git a/lib/utilities/enums/fiat_enum.dart b/lib/utilities/enums/fiat_enum.dart index 2a7303c86..a563112cf 100644 --- a/lib/utilities/enums/fiat_enum.dart +++ b/lib/utilities/enums/fiat_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum Fiats { AED, AFN, diff --git a/lib/utilities/enums/flush_bar_type.dart b/lib/utilities/enums/flush_bar_type.dart index e356991d6..6038687ff 100644 --- a/lib/utilities/enums/flush_bar_type.dart +++ b/lib/utilities/enums/flush_bar_type.dart @@ -1 +1,11 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum FlushBarType { success, info, warning } diff --git a/lib/utilities/enums/form_input_status_enum.dart b/lib/utilities/enums/form_input_status_enum.dart index aa989e534..5cd87c155 100644 --- a/lib/utilities/enums/form_input_status_enum.dart +++ b/lib/utilities/enums/form_input_status_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum FormInputStatus { empty, valid, diff --git a/lib/utilities/enums/languages_enum.dart b/lib/utilities/enums/languages_enum.dart index 970cd3dd7..fa8d9cb3e 100644 --- a/lib/utilities/enums/languages_enum.dart +++ b/lib/utilities/enums/languages_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum Language { englishUS, // TODO: add more diff --git a/lib/utilities/enums/log_level_enum.dart b/lib/utilities/enums/log_level_enum.dart index b9b5fd69f..6e5e14a8f 100644 --- a/lib/utilities/enums/log_level_enum.dart +++ b/lib/utilities/enums/log_level_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // Used in Isar db and stored there as int indexes so adding/removing values // in this definition should be done extremely carefully in production enum LogLevel { diff --git a/lib/utilities/enums/stack_restoring_status.dart b/lib/utilities/enums/stack_restoring_status.dart index 186d1c6f3..b5877e761 100644 --- a/lib/utilities/enums/stack_restoring_status.dart +++ b/lib/utilities/enums/stack_restoring_status.dart @@ -1 +1,11 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum StackRestoringStatus { waiting, restoring, success, failed } diff --git a/lib/utilities/enums/sync_type_enum.dart b/lib/utilities/enums/sync_type_enum.dart index 3069765d9..57a2a4e30 100644 --- a/lib/utilities/enums/sync_type_enum.dart +++ b/lib/utilities/enums/sync_type_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum SyncingType { currentWalletOnly, selectedWalletsAtStartup, diff --git a/lib/utilities/enums/wallet_balance_toggle_state.dart b/lib/utilities/enums/wallet_balance_toggle_state.dart index 60edde12e..90df2325b 100644 --- a/lib/utilities/enums/wallet_balance_toggle_state.dart +++ b/lib/utilities/enums/wallet_balance_toggle_state.dart @@ -1 +1,11 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum WalletBalanceToggleState { full, available } diff --git a/lib/utilities/eth_commons.dart b/lib/utilities/eth_commons.dart index 466a4aff0..7ea32cf2c 100644 --- a/lib/utilities/eth_commons.dart +++ b/lib/utilities/eth_commons.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:bip32/bip32.dart' as bip32; import 'package:bip39/bip39.dart' as bip39; import 'package:decimal/decimal.dart'; diff --git a/lib/utilities/extensions/extensions.dart b/lib/utilities/extensions/extensions.dart index 792ebe0b3..4a9aac287 100644 --- a/lib/utilities/extensions/extensions.dart +++ b/lib/utilities/extensions/extensions.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + export 'impl/big_int.dart'; export 'impl/string.dart'; export 'impl/uint8_list.dart'; diff --git a/lib/utilities/extensions/impl/big_int.dart b/lib/utilities/extensions/impl/big_int.dart index c9b78ab55..d0b84ff98 100644 --- a/lib/utilities/extensions/impl/big_int.dart +++ b/lib/utilities/extensions/impl/big_int.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:typed_data'; extension BigIntExtensions on BigInt { diff --git a/lib/utilities/extensions/impl/box_shadow.dart b/lib/utilities/extensions/impl/box_shadow.dart index c5c53794d..39dd84c4e 100644 --- a/lib/utilities/extensions/impl/box_shadow.dart +++ b/lib/utilities/extensions/impl/box_shadow.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; // todo: delete this map (example) diff --git a/lib/utilities/extensions/impl/contract_abi.dart b/lib/utilities/extensions/impl/contract_abi.dart index 61827b32d..ad091bb18 100644 --- a/lib/utilities/extensions/impl/contract_abi.dart +++ b/lib/utilities/extensions/impl/contract_abi.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:stackwallet/utilities/logger.dart'; diff --git a/lib/utilities/extensions/impl/gradient.dart b/lib/utilities/extensions/impl/gradient.dart index 8af06d421..1e1058de5 100644 --- a/lib/utilities/extensions/impl/gradient.dart +++ b/lib/utilities/extensions/impl/gradient.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/extensions/impl/string.dart'; diff --git a/lib/utilities/extensions/impl/string.dart b/lib/utilities/extensions/impl/string.dart index e5021e3f1..3b214205d 100644 --- a/lib/utilities/extensions/impl/string.dart +++ b/lib/utilities/extensions/impl/string.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:typed_data'; diff --git a/lib/utilities/extensions/impl/uint8_list.dart b/lib/utilities/extensions/impl/uint8_list.dart index 04980f91a..1c09fffc6 100644 --- a/lib/utilities/extensions/impl/uint8_list.dart +++ b/lib/utilities/extensions/impl/uint8_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:typed_data'; diff --git a/lib/utilities/featured_paynyms.dart b/lib/utilities/featured_paynyms.dart index a04fa9a7d..a5231144d 100644 --- a/lib/utilities/featured_paynyms.dart +++ b/lib/utilities/featured_paynyms.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + abstract class FeaturedPaynyms { // TODO: replace with actual value // static const String samouraiWalletDevFund = diff --git a/lib/utilities/flutter_secure_storage_interface.dart b/lib/utilities/flutter_secure_storage_interface.dart index 3c49ebd28..a1d159c6b 100644 --- a/lib/utilities/flutter_secure_storage_interface.dart +++ b/lib/utilities/flutter_secure_storage_interface.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:isar/isar.dart'; import 'package:stack_wallet_backup/secure_storage.dart'; diff --git a/lib/utilities/format.dart b/lib/utilities/format.dart index 56d7059b7..2139a750e 100644 --- a/lib/utilities/format.dart +++ b/lib/utilities/format.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:typed_data'; import 'package:stackwallet/utilities/constants.dart'; diff --git a/lib/utilities/listenable_list.dart b/lib/utilities/listenable_list.dart index ef07478aa..0286fecad 100644 --- a/lib/utilities/listenable_list.dart +++ b/lib/utilities/listenable_list.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; class ListenableList extends ChangeNotifier { diff --git a/lib/utilities/listenable_map.dart b/lib/utilities/listenable_map.dart index a0d4caf79..f519769c4 100644 --- a/lib/utilities/listenable_map.dart +++ b/lib/utilities/listenable_map.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/foundation.dart'; class ListenableMap extends ChangeNotifier { diff --git a/lib/utilities/logger.dart b/lib/utilities/logger.dart index c6e04f0ef..79b61d6ca 100644 --- a/lib/utilities/logger.dart +++ b/lib/utilities/logger.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'dart:core' as core; import 'dart:core'; diff --git a/lib/utilities/name_generator.dart b/lib/utilities/name_generator.dart index 1f876c5e9..73cc77064 100644 --- a/lib/utilities/name_generator.dart +++ b/lib/utilities/name_generator.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:math'; const kNames = { diff --git a/lib/utilities/paynym_is_api.dart b/lib/utilities/paynym_is_api.dart index edbd4f416..f69e751cd 100644 --- a/lib/utilities/paynym_is_api.dart +++ b/lib/utilities/paynym_is_api.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:flutter/cupertino.dart'; diff --git a/lib/utilities/prefs.dart b/lib/utilities/prefs.dart index a57e08755..7c306bfe5 100644 --- a/lib/utilities/prefs.dart +++ b/lib/utilities/prefs.dart @@ -1,7 +1,19 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; import 'package:stackwallet/db/hive/db.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/languages_enum.dart'; import 'package:stackwallet/utilities/enums/sync_type_enum.dart'; import 'package:uuid/uuid.dart'; @@ -46,6 +58,8 @@ class Prefs extends ChangeNotifier { _themeId = await _getThemeId(); _systemBrightnessLightThemeId = await _getSystemBrightnessLightThemeId(); _systemBrightnessDarkThemeId = await _getSystemBrightnessDarkTheme(); + await _setAmountUnits(); + await _setMaxDecimals(); _initialized = true; } @@ -796,4 +810,63 @@ class Prefs extends ChangeNotifier { ) as String? ?? "dark"; } + + // coin amount unit settings + + final Map _amountUnits = {}; + + AmountUnit amountUnit(Coin coin) => _amountUnits[coin] ?? AmountUnit.normal; + + void updateAmountUnit({required Coin coin, required AmountUnit amountUnit}) { + if (this.amountUnit(coin) != amountUnit) { + DB.instance.put( + boxName: DB.boxNamePrefs, + key: "amountUnitFor${coin.name}", + value: amountUnit.index, + ); + _amountUnits[coin] = amountUnit; + notifyListeners(); + } + } + + Future _setAmountUnits() async { + for (final coin in Coin.values) { + final unitIndex = await DB.instance.get( + boxName: DB.boxNamePrefs, + key: "amountUnitFor${coin.name}", + ) as int? ?? + 0; // 0 is "normal" + _amountUnits[coin] = AmountUnit.values[unitIndex]; + } + } + + // coin precision setting (max decimal places to show) + + final Map _amountDecimals = {}; + + int maxDecimals(Coin coin) => _amountDecimals[coin] ?? coin.decimals; + + void updateMaxDecimals({required Coin coin, required int maxDecimals}) { + if (this.maxDecimals(coin) != maxDecimals) { + DB.instance.put( + boxName: DB.boxNamePrefs, + key: "maxDecimalsFor${coin.name}", + value: maxDecimals, + ); + _amountDecimals[coin] = maxDecimals; + notifyListeners(); + } + } + + Future _setMaxDecimals() async { + for (final coin in Coin.values) { + final decimals = await DB.instance.get( + boxName: DB.boxNamePrefs, + key: "maxDecimalsFor${coin.name}", + ) as int? ?? + (coin.decimals > 18 ? 18 : coin.decimals); + // use some sane max rather than up to 30 that nano uses + _amountDecimals[coin] = decimals; + } + } } diff --git a/lib/utilities/show_loading.dart b/lib/utilities/show_loading.dart index d24770663..db4437d6f 100644 --- a/lib/utilities/show_loading.dart +++ b/lib/utilities/show_loading.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/utilities/stack_file_system.dart b/lib/utilities/stack_file_system.dart index 77ecab511..2bb7b5d80 100644 --- a/lib/utilities/stack_file_system.dart +++ b/lib/utilities/stack_file_system.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:path_provider/path_provider.dart'; diff --git a/lib/utilities/test_epic_box_connection.dart b/lib/utilities/test_epic_box_connection.dart index 4b728fb59..c65f85ac7 100644 --- a/lib/utilities/test_epic_box_connection.dart +++ b/lib/utilities/test_epic_box_connection.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'package:http/http.dart' as http; diff --git a/lib/utilities/test_eth_node_connection.dart b/lib/utilities/test_eth_node_connection.dart new file mode 100644 index 000000000..f90ae1353 --- /dev/null +++ b/lib/utilities/test_eth_node_connection.dart @@ -0,0 +1,12 @@ +import 'package:http/http.dart'; +import 'package:web3dart/web3dart.dart' as web3; + +Future testEthNodeConnection(String host) async { + web3.Web3Client client = web3.Web3Client(host, Client()); + try { + await client.getBlockNumber(); + return true; + } catch (_) { + return false; + } +} diff --git a/lib/utilities/test_monero_node_connection.dart b/lib/utilities/test_monero_node_connection.dart index 5e35f9a03..f63ff57fb 100644 --- a/lib/utilities/test_monero_node_connection.dart +++ b/lib/utilities/test_monero_node_connection.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:io'; diff --git a/lib/utilities/text_styles.dart b/lib/utilities/text_styles.dart index 9d2f55eda..4a1ced812 100644 --- a/lib/utilities/text_styles.dart +++ b/lib/utilities/text_styles.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/utilities/util.dart b/lib/utilities/util.dart index ecd9a7cca..265cd2e06 100644 --- a/lib/utilities/util.dart +++ b/lib/utilities/util.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:convert'; import 'dart:developer'; import 'dart:io'; diff --git a/lib/widgets/address_book_card.dart b/lib/widgets/address_book_card.dart index ee4f9c2db..fed6deb03 100644 --- a/lib/widgets/address_book_card.dart +++ b/lib/widgets/address_book_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; @@ -127,29 +137,31 @@ class _AddressBookCardState extends ConsumerState { const SizedBox( width: 16, ), - if (isDesktop && !desktopSendFrom) const Spacer(), - if (isDesktop) - Text( - coinsString, - style: STextStyles.label(context), - ), - if (!isDesktop) - Column( - crossAxisAlignment: CrossAxisAlignment.start, + Expanded( + child: Column( + crossAxisAlignment: isDesktop && !desktopSendFrom + ? CrossAxisAlignment.end + : CrossAxisAlignment.start, children: [ - Text( - contact.name, - style: STextStyles.itemSubtitle12(context), - ), - const SizedBox( - height: 4, - ), + if (!isDesktop) + Text( + contact.name, + style: STextStyles.itemSubtitle12(context), + ), + if (!isDesktop) + const SizedBox( + height: 4, + ), Text( coinsString, style: STextStyles.label(context), + textAlign: isDesktop && !desktopSendFrom + ? TextAlign.right + : TextAlign.left, ), ], ), + ), if (isDesktop && desktopSendFrom) const Spacer(), if (isDesktop && desktopSendFrom) SvgPicture.asset( diff --git a/lib/widgets/animated_text.dart b/lib/widgets/animated_text.dart index e00d5fd84..136da21c6 100644 --- a/lib/widgets/animated_text.dart +++ b/lib/widgets/animated_text.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/cupertino.dart'; diff --git a/lib/widgets/animated_widgets/rotate_icon.dart b/lib/widgets/animated_widgets/rotate_icon.dart index d93f6b36a..2b54b1367 100644 --- a/lib/widgets/animated_widgets/rotate_icon.dart +++ b/lib/widgets/animated_widgets/rotate_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/widgets.dart'; class RotateIconController { diff --git a/lib/widgets/animated_widgets/rotating_arrows.dart b/lib/widgets/animated_widgets/rotating_arrows.dart index 1d0e2562e..df7c72897 100644 --- a/lib/widgets/animated_widgets/rotating_arrows.dart +++ b/lib/widgets/animated_widgets/rotating_arrows.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:lottie/lottie.dart'; import 'package:stackwallet/themes/stack_colors.dart'; @@ -7,6 +17,8 @@ class RotatingArrowsController { VoidCallback? forward; VoidCallback? repeat; VoidCallback? stop; + + bool hasLoadedAnimation = false; } class RotatingArrows extends StatefulWidget { @@ -76,6 +88,7 @@ class _RotatingArrowsState extends State ), onLoaded: (composition) { animationController.duration = composition.duration; + widget.controller?.hasLoadedAnimation = true; // if controller was not set just assume continuous repeat if (widget.spinByDefault) { diff --git a/lib/widgets/app_bar_field.dart b/lib/widgets/app_bar_field.dart index d579dc3db..53a226865 100644 --- a/lib/widgets/app_bar_field.dart +++ b/lib/widgets/app_bar_field.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/widgets/background.dart b/lib/widgets/background.dart index 91332c291..3f13f96a2 100644 --- a/lib/widgets/background.dart +++ b/lib/widgets/background.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/choose_coin_view.dart b/lib/widgets/choose_coin_view.dart index ee67d8cee..5bf6f6996 100644 --- a/lib/widgets/choose_coin_view.dart +++ b/lib/widgets/choose_coin_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; @@ -13,6 +23,14 @@ import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; +/* + * This widget is used to choose a coin from a list of coins. + * @param title: The title of the page. + * @param coinAdditional: Additional text to be displayed after the coin name. + * @param nextRouteName: The name of the route to be pushed when a coin is selected. + * @return A widget that displays a list of coins. + */ + class ChooseCoinView extends ConsumerStatefulWidget { const ChooseCoinView({ Key? key, diff --git a/lib/widgets/coin_card.dart b/lib/widgets/coin_card.dart new file mode 100644 index 000000000..3d122c42a --- /dev/null +++ b/lib/widgets/coin_card.dart @@ -0,0 +1,123 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:stackwallet/providers/providers.dart'; +import 'package:stackwallet/themes/coin_card_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/assets.dart'; +import 'package:stackwallet/utilities/constants.dart'; + +class CoinCard extends ConsumerWidget { + const CoinCard({ + super.key, + required this.walletId, + required this.width, + required this.height, + }); + + final String walletId; + final double width; + final double height; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final coin = ref.watch( + walletsChangeNotifierProvider + .select((value) => value.getManager(walletId).coin), + ); + + final bool hasCardImageBg = ref.watch(coinCardProvider(coin)) != null; + + return Stack( + children: [ + if (hasCardImageBg) + Container( + width: width, + height: height, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: FileImage( + File( + ref.watch(coinCardProvider(coin))!, + ), + ), + ), + ), + ), + if (!hasCardImageBg) + Container( + width: width, + height: height, + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .colorForCoin(coin), + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + ), + if (!hasCardImageBg) + Column( + children: [ + const Spacer(), + SizedBox( + height: width * 0.3, + child: Row( + children: [ + const Spacer( + flex: 9, + ), + SvgPicture.asset( + Assets.svg.ellipse2, + height: width * 0.3, + ), + // ), + const Spacer( + flex: 2, + ), + ], + ), + ), + ], + ), + if (!hasCardImageBg) + Row( + children: [ + const Spacer( + flex: 5, + ), + SizedBox( + width: width * 0.45, + child: Column( + children: [ + SvgPicture.asset( + Assets.svg.ellipse1, + width: width * 0.45, + ), + const Spacer(), + ], + ), + ), + const Spacer( + flex: 1, + ), + ], + ), + ], + ); + } +} diff --git a/lib/widgets/conditional_parent.dart b/lib/widgets/conditional_parent.dart index e8c60884a..e664c581e 100644 --- a/lib/widgets/conditional_parent.dart +++ b/lib/widgets/conditional_parent.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; class ConditionalParent extends StatelessWidget { diff --git a/lib/widgets/crypto_notifications.dart b/lib/widgets/crypto_notifications.dart index 8dab9ff31..f94c74ed9 100644 --- a/lib/widgets/crypto_notifications.dart +++ b/lib/widgets/crypto_notifications.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:event_bus/event_bus.dart'; diff --git a/lib/widgets/custom_buttons/app_bar_icon_button.dart b/lib/widgets/custom_buttons/app_bar_icon_button.dart index 0753c490c..96bd533ea 100644 --- a/lib/widgets/custom_buttons/app_bar_icon_button.dart +++ b/lib/widgets/custom_buttons/app_bar_icon_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/custom_buttons/blue_text_button.dart b/lib/widgets/custom_buttons/blue_text_button.dart index 4034ac935..e0432caeb 100644 --- a/lib/widgets/custom_buttons/blue_text_button.dart +++ b/lib/widgets/custom_buttons/blue_text_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/custom_buttons/draggable_switch_button.dart b/lib/widgets/custom_buttons/draggable_switch_button.dart index b7582211c..a3e8a9926 100644 --- a/lib/widgets/custom_buttons/draggable_switch_button.dart +++ b/lib/widgets/custom_buttons/draggable_switch_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/custom_buttons/dropdown_button.dart b/lib/widgets/custom_buttons/dropdown_button.dart index 0d5a2a738..df6ef56f8 100644 --- a/lib/widgets/custom_buttons/dropdown_button.dart +++ b/lib/widgets/custom_buttons/dropdown_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/custom_buttons/favorite_toggle.dart b/lib/widgets/custom_buttons/favorite_toggle.dart index b74827cd9..7dcb204ea 100644 --- a/lib/widgets/custom_buttons/favorite_toggle.dart +++ b/lib/widgets/custom_buttons/favorite_toggle.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/widgets/custom_buttons/paynym_follow_toggle_button.dart b/lib/widgets/custom_buttons/paynym_follow_toggle_button.dart index 3c999a84c..6dc9f4ae3 100644 --- a/lib/widgets/custom_buttons/paynym_follow_toggle_button.dart +++ b/lib/widgets/custom_buttons/paynym_follow_toggle_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/custom_buttons/simple_copy_button.dart b/lib/widgets/custom_buttons/simple_copy_button.dart index eab69a25d..5bd7c5501 100644 --- a/lib/widgets/custom_buttons/simple_copy_button.dart +++ b/lib/widgets/custom_buttons/simple_copy_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/custom_buttons/simple_edit_button.dart b/lib/widgets/custom_buttons/simple_edit_button.dart index 8260fe659..26b7042b9 100644 --- a/lib/widgets/custom_buttons/simple_edit_button.dart +++ b/lib/widgets/custom_buttons/simple_edit_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/pages/generic/single_field_edit_view.dart'; diff --git a/lib/widgets/custom_loading_overlay.dart b/lib/widgets/custom_loading_overlay.dart index 349448fbc..cd9dac032 100644 --- a/lib/widgets/custom_loading_overlay.dart +++ b/lib/widgets/custom_loading_overlay.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:event_bus/event_bus.dart'; diff --git a/lib/widgets/custom_page_view/custom_page_view.dart b/lib/widgets/custom_page_view/custom_page_view.dart index 7b0e9ba54..825abac26 100644 --- a/lib/widgets/custom_page_view/custom_page_view.dart +++ b/lib/widgets/custom_page_view/custom_page_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -255,6 +265,7 @@ class PageMetrics extends FixedScrollMetrics { required double? pixels, required double? viewportDimension, required AxisDirection axisDirection, + required double devicePixelRatio, required this.viewportFraction, }) : super( minScrollExtent: minScrollExtent, @@ -262,6 +273,7 @@ class PageMetrics extends FixedScrollMetrics { pixels: pixels, viewportDimension: viewportDimension, axisDirection: axisDirection, + devicePixelRatio: devicePixelRatio, ); @override @@ -271,6 +283,7 @@ class PageMetrics extends FixedScrollMetrics { double? pixels, double? viewportDimension, AxisDirection? axisDirection, + double? devicePixelRatio, double? viewportFraction, }) { return PageMetrics( @@ -282,6 +295,7 @@ class PageMetrics extends FixedScrollMetrics { viewportDimension: viewportDimension ?? (hasViewportDimension ? this.viewportDimension : null), axisDirection: axisDirection ?? this.axisDirection, + devicePixelRatio: devicePixelRatio ?? this.devicePixelRatio, viewportFraction: viewportFraction ?? this.viewportFraction, ); } @@ -397,7 +411,7 @@ class _PagePosition extends ScrollPositionWithSingleContext @override void saveScrollOffset() { - PageStorage.of(context.storageContext)?.writeState(context.storageContext, + PageStorage.of(context.storageContext).writeState(context.storageContext, _cachedPage ?? getPageFromPixels(pixels, viewportDimension)); } @@ -405,7 +419,7 @@ class _PagePosition extends ScrollPositionWithSingleContext void restoreScrollOffset() { if (!hasPixels) { final double? value = PageStorage.of(context.storageContext) - ?.readState(context.storageContext) as double?; + .readState(context.storageContext) as double?; if (value != null) _pageToUseOnStartup = value; } } @@ -472,6 +486,7 @@ class _PagePosition extends ScrollPositionWithSingleContext double? pixels, double? viewportDimension, AxisDirection? axisDirection, + double? devicePixelRatio, double? viewportFraction, }) { return PageMetrics( @@ -483,6 +498,7 @@ class _PagePosition extends ScrollPositionWithSingleContext viewportDimension: viewportDimension ?? (hasViewportDimension ? this.viewportDimension : null), axisDirection: axisDirection ?? this.axisDirection, + devicePixelRatio: devicePixelRatio ?? this.devicePixelRatio, viewportFraction: viewportFraction ?? this.viewportFraction, ); } diff --git a/lib/widgets/custom_page_view/custom_sliver_fill_viewport.dart b/lib/widgets/custom_page_view/custom_sliver_fill_viewport.dart index b9585ab36..94f6a2e35 100644 --- a/lib/widgets/custom_page_view/custom_sliver_fill_viewport.dart +++ b/lib/widgets/custom_page_view/custom_sliver_fill_viewport.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/lib/widgets/custom_pin_put/custom_pin_put.dart b/lib/widgets/custom_pin_put/custom_pin_put.dart index 4a4e4a4e4..d49391ac1 100644 --- a/lib/widgets/custom_pin_put/custom_pin_put.dart +++ b/lib/widgets/custom_pin_put/custom_pin_put.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put_state.dart'; @@ -53,8 +63,10 @@ class CustomPinPut extends StatefulWidget { this.mainAxisSize = MainAxisSize.max, this.autofillHints, this.customKey, - }) : assert(fieldsCount > 0), - super(key: key); + this.onPinLengthChanged, + }) : super(key: key); + + final void Function(int)? onPinLengthChanged; final double? width; final double? height; diff --git a/lib/widgets/custom_pin_put/custom_pin_put_state.dart b/lib/widgets/custom_pin_put/custom_pin_put_state.dart index 355656638..4f37d2147 100644 --- a/lib/widgets/custom_pin_put/custom_pin_put_state.dart +++ b/lib/widgets/custom_pin_put/custom_pin_put_state.dart @@ -1,3 +1,15 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + +import 'dart:math'; + import 'package:flutter/material.dart'; import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put.dart'; import 'package:stackwallet/widgets/custom_pin_put/pin_keyboard.dart'; @@ -10,6 +22,13 @@ class CustomPinPutState extends State int get selectedIndex => _controller.value.text.length; + int _pinCount = 0; + int get pinCount => _pinCount; + set pinCount(int newCount) { + _pinCount = newCount; + widget.onPinLengthChanged?.call(newCount); + } + @override void initState() { _controller = widget.controller ?? TextEditingController(); @@ -50,22 +69,19 @@ class CustomPinPutState extends State @override Widget build(BuildContext context) { - // final bool randomize = ref - // .read(prefsChangeNotifierProvider) - // .randomizePIN; return SizedBox( width: widget.width, height: widget.height, child: Column( children: [ SizedBox( - width: (30 * widget.fieldsCount) - 18, + width: max((30 * pinCount) - 18, 1), child: Stack( children: [ _hiddenTextField, Align( alignment: Alignment.bottomCenter, - child: _fields, + child: _fields(pinCount), ), ], ), @@ -75,15 +91,22 @@ class CustomPinPutState extends State isRandom: widget.isRandom, customKey: widget.customKey, onNumberKeyPressed: (number) { - if (_controller.text.length < widget.fieldsCount) { - _controller.text += number; - } + _controller.text += number; + + // add a set state and have the counter increment + setState(() { + pinCount = _controller.text.length; + }); }, onBackPressed: () { final text = _controller.text; if (text.isNotEmpty) { _controller.text = text.substring(0, text.length - 1); + setState(() { + pinCount = _controller.text.length; + }); } + // decrement counter here }, onSubmitPressed: () { final pin = _controller.value.text; @@ -117,7 +140,7 @@ class CustomPinPutState extends State textCapitalization: widget.textCapitalization, inputFormatters: widget.inputFormatters, enableInteractiveSelection: false, - maxLength: widget.fieldsCount, + maxLength: 10, showCursor: false, scrollPadding: EdgeInsets.zero, decoration: widget.inputDecoration, @@ -127,21 +150,22 @@ class CustomPinPutState extends State ); } - Widget get _fields { + // have it include an int as a param + Widget _fields(int count) { return ValueListenableBuilder( valueListenable: _textControllerValue, builder: (BuildContext context, value, Widget? child) { return Row( mainAxisSize: widget.mainAxisSize, mainAxisAlignment: widget.fieldsAlignment, - children: _buildFieldsWithSeparator(), + children: _buildFieldsWithSeparator(count), ); }, ); } - List _buildFieldsWithSeparator() { - final fields = Iterable.generate(widget.fieldsCount).map((index) { + List _buildFieldsWithSeparator(int count) { + final fields = Iterable.generate(count).map((index) { return _getField(index); }).toList(); diff --git a/lib/widgets/custom_pin_put/pin_keyboard.dart b/lib/widgets/custom_pin_put/pin_keyboard.dart index d5874dcb0..71bbbcc0e 100644 --- a/lib/widgets/custom_pin_put/pin_keyboard.dart +++ b/lib/widgets/custom_pin_put/pin_keyboard.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/widgets/custom_tab_view.dart b/lib/widgets/custom_tab_view.dart index 78e7a1809..0931aecce 100644 --- a/lib/widgets/custom_tab_view.dart +++ b/lib/widgets/custom_tab_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/widgets/desktop/custom_text_button.dart b/lib/widgets/desktop/custom_text_button.dart index 90b75c459..c2908842e 100644 --- a/lib/widgets/desktop/custom_text_button.dart +++ b/lib/widgets/desktop/custom_text_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/util.dart'; diff --git a/lib/widgets/desktop/delete_button.dart b/lib/widgets/desktop/delete_button.dart index af13518b8..fe0a29ba1 100644 --- a/lib/widgets/desktop/delete_button.dart +++ b/lib/widgets/desktop/delete_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/desktop/desktop_app_bar.dart b/lib/widgets/desktop/desktop_app_bar.dart index 848d4c0a3..e39af59d1 100644 --- a/lib/widgets/desktop/desktop_app_bar.dart +++ b/lib/widgets/desktop/desktop_app_bar.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; diff --git a/lib/widgets/desktop/desktop_dialog.dart b/lib/widgets/desktop/desktop_dialog.dart index 1aa7eda3f..5e8a4a548 100644 --- a/lib/widgets/desktop/desktop_dialog.dart +++ b/lib/widgets/desktop/desktop_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/desktop/desktop_dialog_close_button.dart b/lib/widgets/desktop/desktop_dialog_close_button.dart index 4199278df..b7a945233 100644 --- a/lib/widgets/desktop/desktop_dialog_close_button.dart +++ b/lib/widgets/desktop/desktop_dialog_close_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/desktop/desktop_scaffold.dart b/lib/widgets/desktop/desktop_scaffold.dart index 3486bc013..1f6bc2a70 100644 --- a/lib/widgets/desktop/desktop_scaffold.dart +++ b/lib/widgets/desktop/desktop_scaffold.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/widgets/background.dart'; diff --git a/lib/widgets/desktop/living_stack_icon.dart b/lib/widgets/desktop/living_stack_icon.dart index 166f30f9c..58568c0e0 100644 --- a/lib/widgets/desktop/living_stack_icon.dart +++ b/lib/widgets/desktop/living_stack_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/desktop/outline_blue_button.dart b/lib/widgets/desktop/outline_blue_button.dart index 406337f84..356336ae0 100644 --- a/lib/widgets/desktop/outline_blue_button.dart +++ b/lib/widgets/desktop/outline_blue_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/widgets/desktop/paynym_search_button.dart b/lib/widgets/desktop/paynym_search_button.dart index 8603e0079..d49d1e7dd 100644 --- a/lib/widgets/desktop/paynym_search_button.dart +++ b/lib/widgets/desktop/paynym_search_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/desktop/primary_button.dart b/lib/widgets/desktop/primary_button.dart index b1201f354..edf70b493 100644 --- a/lib/widgets/desktop/primary_button.dart +++ b/lib/widgets/desktop/primary_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/widgets/desktop/secondary_button.dart b/lib/widgets/desktop/secondary_button.dart index 48370e55c..5f4e9d63a 100644 --- a/lib/widgets/desktop/secondary_button.dart +++ b/lib/widgets/desktop/secondary_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/widgets/desktop/simple_desktop_dialog.dart b/lib/widgets/desktop/simple_desktop_dialog.dart index 1260deb3b..6fa12c8c7 100644 --- a/lib/widgets/desktop/simple_desktop_dialog.dart +++ b/lib/widgets/desktop/simple_desktop_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; diff --git a/lib/widgets/dialogs/basic_dialog.dart b/lib/widgets/dialogs/basic_dialog.dart index f6dab30f0..271d82049 100644 --- a/lib/widgets/dialogs/basic_dialog.dart +++ b/lib/widgets/dialogs/basic_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; diff --git a/lib/widgets/emoji_select_sheet.dart b/lib/widgets/emoji_select_sheet.dart index 5fc49782c..01a9f8478 100644 --- a/lib/widgets/emoji_select_sheet.dart +++ b/lib/widgets/emoji_select_sheet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:emojis/emoji.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/widgets/eth_wallet_radio.dart b/lib/widgets/eth_wallet_radio.dart index 8398a6584..936e83362 100644 --- a/lib/widgets/eth_wallet_radio.dart +++ b/lib/widgets/eth_wallet_radio.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; diff --git a/lib/widgets/exchange/trocador/trocador_kyc_icon.dart b/lib/widgets/exchange/trocador/trocador_kyc_icon.dart index eb0b04834..9a63523de 100644 --- a/lib/widgets/exchange/trocador/trocador_kyc_icon.dart +++ b/lib/widgets/exchange/trocador/trocador_kyc_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/exchange/trocador/trocador_kyc_info_button.dart b/lib/widgets/exchange/trocador/trocador_kyc_info_button.dart index 785ca9457..e9c0caad6 100644 --- a/lib/widgets/exchange/trocador/trocador_kyc_info_button.dart +++ b/lib/widgets/exchange/trocador/trocador_kyc_info_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/widgets/exchange/trocador/trocador_kyc_icon.dart'; import 'package:stackwallet/widgets/exchange/trocador/trocador_rating_type_enum.dart'; diff --git a/lib/widgets/exchange/trocador/trocador_rating_type_enum.dart b/lib/widgets/exchange/trocador/trocador_rating_type_enum.dart index 538ee8c37..43645f174 100644 --- a/lib/widgets/exchange/trocador/trocador_rating_type_enum.dart +++ b/lib/widgets/exchange/trocador/trocador_rating_type_enum.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + enum TrocadorKYCType { a, b, diff --git a/lib/widgets/expandable.dart b/lib/widgets/expandable.dart index dbd5c67f6..2d84e29a7 100644 --- a/lib/widgets/expandable.dart +++ b/lib/widgets/expandable.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; enum ExpandableState { diff --git a/lib/widgets/expandable2.dart b/lib/widgets/expandable2.dart index 5ae64e3fc..6baf055e3 100644 --- a/lib/widgets/expandable2.dart +++ b/lib/widgets/expandable2.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/constants.dart'; diff --git a/lib/widgets/fade_stack.dart b/lib/widgets/fade_stack.dart index 6cac16030..08557ac16 100644 --- a/lib/widgets/fade_stack.dart +++ b/lib/widgets/fade_stack.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; class FadeStack extends StatefulWidget { diff --git a/lib/widgets/gradient_card.dart b/lib/widgets/gradient_card.dart index c0b276c13..ca961886e 100644 --- a/lib/widgets/gradient_card.dart +++ b/lib/widgets/gradient_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // import 'package:flutter/material.dart'; // import 'package:stackwallet/utilities/cfcolors.dart'; // const GradientCard( diff --git a/lib/widgets/hover_text_field.dart b/lib/widgets/hover_text_field.dart index 30e018192..54a1e9372 100644 --- a/lib/widgets/hover_text_field.dart +++ b/lib/widgets/hover_text_field.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/icon_widgets/addressbook_icon.dart b/lib/widgets/icon_widgets/addressbook_icon.dart index 342c9638b..7c564d59a 100644 --- a/lib/widgets/icon_widgets/addressbook_icon.dart +++ b/lib/widgets/icon_widgets/addressbook_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/icon_widgets/clipboard_icon.dart b/lib/widgets/icon_widgets/clipboard_icon.dart index 56e2bbedb..38228b751 100644 --- a/lib/widgets/icon_widgets/clipboard_icon.dart +++ b/lib/widgets/icon_widgets/clipboard_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/icon_widgets/copy_icon.dart b/lib/widgets/icon_widgets/copy_icon.dart index b30925152..91d3647bc 100644 --- a/lib/widgets/icon_widgets/copy_icon.dart +++ b/lib/widgets/icon_widgets/copy_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/icon_widgets/dice_icon.dart b/lib/widgets/icon_widgets/dice_icon.dart index 8fa9dfbe9..e71f398a7 100644 --- a/lib/widgets/icon_widgets/dice_icon.dart +++ b/lib/widgets/icon_widgets/dice_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/icon_widgets/eth_token_icon.dart b/lib/widgets/icon_widgets/eth_token_icon.dart index cd5cfbbd1..dbc2d6794 100644 --- a/lib/widgets/icon_widgets/eth_token_icon.dart +++ b/lib/widgets/icon_widgets/eth_token_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/widgets/icon_widgets/pencil_icon.dart b/lib/widgets/icon_widgets/pencil_icon.dart index cb747f0c2..a12c0d0a6 100644 --- a/lib/widgets/icon_widgets/pencil_icon.dart +++ b/lib/widgets/icon_widgets/pencil_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/icon_widgets/qrcode_icon.dart b/lib/widgets/icon_widgets/qrcode_icon.dart index 4ef18012e..f7e417ad8 100644 --- a/lib/widgets/icon_widgets/qrcode_icon.dart +++ b/lib/widgets/icon_widgets/qrcode_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/icon_widgets/share_icon.dart b/lib/widgets/icon_widgets/share_icon.dart index 58e0a3d32..b61f0860a 100644 --- a/lib/widgets/icon_widgets/share_icon.dart +++ b/lib/widgets/icon_widgets/share_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/icon_widgets/utxo_status_icon.dart b/lib/widgets/icon_widgets/utxo_status_icon.dart index e5434921d..b409fcebf 100644 --- a/lib/widgets/icon_widgets/utxo_status_icon.dart +++ b/lib/widgets/icon_widgets/utxo_status_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/icon_widgets/x_icon.dart b/lib/widgets/icon_widgets/x_icon.dart index 39d00571e..b0730d472 100644 --- a/lib/widgets/icon_widgets/x_icon.dart +++ b/lib/widgets/icon_widgets/x_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/loading_indicator.dart b/lib/widgets/loading_indicator.dart index 1d95ca616..a535fb251 100644 --- a/lib/widgets/loading_indicator.dart +++ b/lib/widgets/loading_indicator.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/managed_favorite.dart b/lib/widgets/managed_favorite.dart index 6383c8501..ae10939df 100644 --- a/lib/widgets/managed_favorite.dart +++ b/lib/widgets/managed_favorite.dart @@ -1,11 +1,24 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/providers.dart'; +import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -34,6 +47,28 @@ class _ManagedFavoriteCardState extends ConsumerState { final isDesktop = Util.isDesktop; + final balance = ref.watch( + walletsChangeNotifierProvider.select( + (value) => value.getManager(widget.walletId).balance, + ), + ); + + Amount total = balance.total; + if (manager.coin == Coin.firo || manager.coin == Coin.firoTestNet) { + final balancePrivate = ref.watch( + walletsChangeNotifierProvider.select( + (value) => (value + .getManager( + widget.walletId, + ) + .wallet as FiroWallet) + .balancePrivate, + ), + ); + + total += balancePrivate.total; + } + return RoundedWhiteContainer( padding: EdgeInsets.all(isDesktop ? 0 : 4.0), child: RawMaterialButton( @@ -107,14 +142,11 @@ class _ManagedFavoriteCardState extends ConsumerState { ), Expanded( child: Text( - "${manager.balance.total.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - decimalPlaces: manager.coin.decimals, - )} ${manager.coin.ticker}", + ref + .watch( + pAmountFormatter(manager.coin), + ) + .format(total), style: STextStyles.itemSubtitle(context), ), ), @@ -150,14 +182,11 @@ class _ManagedFavoriteCardState extends ConsumerState { height: 2, ), Text( - "${manager.balance.total.localizedStringAsFixed( - locale: ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ), - decimalPlaces: manager.coin.decimals, - )} ${manager.coin.ticker}", + ref + .watch( + pAmountFormatter(manager.coin), + ) + .format(total), style: STextStyles.itemSubtitle(context), ), ], diff --git a/lib/widgets/master_wallet_card.dart b/lib/widgets/master_wallet_card.dart index b5a3802cb..a3fc626a7 100644 --- a/lib/widgets/master_wallet_card.dart +++ b/lib/widgets/master_wallet_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/lib/widgets/node_card.dart b/lib/widgets/node_card.dart index da0c20ccf..9214e3e0a 100644 --- a/lib/widgets/node_card.dart +++ b/lib/widgets/node_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -17,6 +27,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/sync_type_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/test_epic_box_connection.dart'; +import 'package:stackwallet/utilities/test_eth_node_connection.dart'; import 'package:stackwallet/utilities/test_monero_node_connection.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -156,6 +167,7 @@ class _NodeCardState extends ConsumerState { case Coin.litecoinTestNet: case Coin.namecoin: case Coin.bitcoincashTestnet: + case Coin.eCash: final client = ElectrumX( host: node.host, port: node.port, @@ -171,6 +183,18 @@ class _NodeCardState extends ConsumerState { } break; + + case Coin.ethereum: + try { + testPassed = await testEthNodeConnection(node.host); + } catch (_) { + testPassed = false; + } + break; + + case Coin.nano: + case Coin.banano: + //TODO: check network/node } if (testPassed) { diff --git a/lib/widgets/node_options_sheet.dart b/lib/widgets/node_options_sheet.dart index 3c02c2ba7..16e87581c 100644 --- a/lib/widgets/node_options_sheet.dart +++ b/lib/widgets/node_options_sheet.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -17,6 +27,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/sync_type_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/test_epic_box_connection.dart'; +import 'package:stackwallet/utilities/test_eth_node_connection.dart'; import 'package:stackwallet/utilities/test_monero_node_connection.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -139,6 +150,7 @@ class NodeOptionsSheet extends ConsumerWidget { case Coin.litecoinTestNet: case Coin.namecoin: case Coin.bitcoincashTestnet: + case Coin.eCash: final client = ElectrumX( host: node.host, port: node.port, @@ -154,6 +166,18 @@ class NodeOptionsSheet extends ConsumerWidget { } break; + + case Coin.ethereum: + try { + testPassed = await testEthNodeConnection(node.host); + } catch (_) { + testPassed = false; + } + break; + + case Coin.nano: + case Coin.banano: + //TODO: check network/node } if (testPassed) { diff --git a/lib/widgets/progress_bar.dart b/lib/widgets/progress_bar.dart index a4c71d68d..a58c42c69 100644 --- a/lib/widgets/progress_bar.dart +++ b/lib/widgets/progress_bar.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; class ProgressBar extends StatelessWidget { diff --git a/lib/widgets/rounded_container.dart b/lib/widgets/rounded_container.dart index ef679472b..8a29ca7ad 100644 --- a/lib/widgets/rounded_container.dart +++ b/lib/widgets/rounded_container.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; diff --git a/lib/widgets/rounded_date_picker/flutter_rounded_date_picker_dialog.dart b/lib/widgets/rounded_date_picker/flutter_rounded_date_picker_dialog.dart index 6d7f775cd..3c8ff39bb 100644 --- a/lib/widgets/rounded_date_picker/flutter_rounded_date_picker_dialog.dart +++ b/lib/widgets/rounded_date_picker/flutter_rounded_date_picker_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter/services.dart'; diff --git a/lib/widgets/rounded_date_picker/flutter_rounded_date_picker_widget.dart b/lib/widgets/rounded_date_picker/flutter_rounded_date_picker_widget.dart index 5f576f480..6f6db0580 100644 --- a/lib/widgets/rounded_date_picker/flutter_rounded_date_picker_widget.dart +++ b/lib/widgets/rounded_date_picker/flutter_rounded_date_picker_widget.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + // Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/lib/widgets/rounded_white_container.dart b/lib/widgets/rounded_white_container.dart index d3acfcbb6..93efb63ec 100644 --- a/lib/widgets/rounded_white_container.dart +++ b/lib/widgets/rounded_white_container.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/widgets/rounded_container.dart'; diff --git a/lib/widgets/shake/shake.dart b/lib/widgets/shake/shake.dart index f44ddca69..c19241ee1 100644 --- a/lib/widgets/shake/shake.dart +++ b/lib/widgets/shake/shake.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/cupertino.dart'; class Shake extends StatefulWidget { diff --git a/lib/widgets/stack_dialog.dart b/lib/widgets/stack_dialog.dart index 50f248e6b..fead6a00a 100644 --- a/lib/widgets/stack_dialog.dart +++ b/lib/widgets/stack_dialog.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/widgets/stack_text_field.dart b/lib/widgets/stack_text_field.dart index edc336bdb..5cd0691d5 100644 --- a/lib/widgets/stack_text_field.dart +++ b/lib/widgets/stack_text_field.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; diff --git a/lib/widgets/table_view/table_view.dart b/lib/widgets/table_view/table_view.dart index ed1bc8cf7..4fedb067a 100644 --- a/lib/widgets/table_view/table_view.dart +++ b/lib/widgets/table_view/table_view.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; class TableView extends StatelessWidget { diff --git a/lib/widgets/table_view/table_view_cell.dart b/lib/widgets/table_view/table_view_cell.dart index 16a807d3c..fb87ce86d 100644 --- a/lib/widgets/table_view/table_view_cell.dart +++ b/lib/widgets/table_view/table_view_cell.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; class TableViewCell extends StatelessWidget { diff --git a/lib/widgets/table_view/table_view_row.dart b/lib/widgets/table_view/table_view_row.dart index 0b4fc8d16..548d829ad 100644 --- a/lib/widgets/table_view/table_view_row.dart +++ b/lib/widgets/table_view/table_view_row.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/widgets/expandable.dart'; diff --git a/lib/widgets/textfield_icon_button.dart b/lib/widgets/textfield_icon_button.dart index df231a781..b600e98cc 100644 --- a/lib/widgets/textfield_icon_button.dart +++ b/lib/widgets/textfield_icon_button.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; class TextFieldIconButton extends StatefulWidget { diff --git a/lib/widgets/textfields/exchange_textfield.dart b/lib/widgets/textfields/exchange_textfield.dart index ab23eabbf..f981f023a 100644 --- a/lib/widgets/textfields/exchange_textfield.dart +++ b/lib/widgets/textfields/exchange_textfield.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/lib/widgets/toggle.dart b/lib/widgets/toggle.dart index b1434045d..1a5591eab 100644 --- a/lib/widgets/toggle.dart +++ b/lib/widgets/toggle.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/trade_card.dart b/lib/widgets/trade_card.dart index 3e442e07a..ae6197070 100644 --- a/lib/widgets/trade_card.dart +++ b/lib/widgets/trade_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:decimal/decimal.dart'; diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index 8cb613152..7791ff3a0 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; @@ -10,6 +20,7 @@ import 'package:stackwallet/providers/db/main_db_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/format.dart'; @@ -39,6 +50,7 @@ class _TransactionCardState extends ConsumerState { late final String prefix; late final String unit; late final Coin coin; + late final EthContract? tokenContract; String whatIsIt( TransactionType type, @@ -116,12 +128,11 @@ class _TransactionCardState extends ConsumerState { .getManager(widget.walletId) .coin; - unit = isTokenTx - ? ref - .read(mainDBProvider) - .getEthContractSync(_transaction.otherData!)! - .symbol - : coin.ticker; + tokenContract = ref + .read(mainDBProvider) + .getEthContractSync(_transaction.otherData ?? ""); + + unit = isTokenTx ? tokenContract!.symbol : coin.ticker; super.initState(); } @@ -240,9 +251,7 @@ class _TransactionCardState extends ConsumerState { final amount = _transaction.realAmount; return Text( - "$prefix${amount.localizedStringAsFixed( - locale: locale, - )} $unit", + "$prefix${ref.watch(pAmountFormatter(coin)).format(amount, ethContract: tokenContract)}", style: STextStyles.itemSubtitle12(context), ); }, @@ -285,9 +294,8 @@ class _TransactionCardState extends ConsumerState { "$prefix${Amount.fromDecimal( amount.decimal * price, fractionDigits: 2, - ).localizedStringAsFixed( + ).fiatString( locale: locale, - decimalPlaces: 2, )} $baseCurrency", style: STextStyles.label(context), ); diff --git a/lib/widgets/trocador_kyc_rating_info.dart b/lib/widgets/trocador_kyc_rating_info.dart index f7d531da7..a35c03fcc 100644 --- a/lib/widgets/trocador_kyc_rating_info.dart +++ b/lib/widgets/trocador_kyc_rating_info.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; diff --git a/lib/widgets/wallet_card.dart b/lib/widgets/wallet_card.dart index a5130dd1e..831b2077e 100644 --- a/lib/widgets/wallet_card.dart +++ b/lib/widgets/wallet_card.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:async'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance.dart b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance.dart index 051e96f70..f679c1659 100644 --- a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance.dart +++ b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance.dart @@ -1,11 +1,23 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/db/isar/main_db.dart'; +import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_formatter.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -26,36 +38,25 @@ class WalletInfoRowBalance extends ConsumerWidget { .watch(walletsChangeNotifierProvider.notifier) .getManagerProvider(walletId)); - final locale = ref.watch( - localeServiceChangeNotifierProvider.select( - (value) => value.locale, - ), - ); - Amount totalBalance; - int decimals; - String unit; + EthContract? contract; if (contractAddress == null) { totalBalance = manager.balance.total; if (manager.coin == Coin.firo || manager.coin == Coin.firoTestNet) { totalBalance = totalBalance + (manager.wallet as FiroWallet).balancePrivate.total; } - unit = manager.coin.ticker; - decimals = manager.coin.decimals; + contract = null; } else { final ethWallet = manager.wallet as EthereumWallet; - final contract = MainDB.instance.getEthContractSync(contractAddress!)!; + contract = MainDB.instance.getEthContractSync(contractAddress!)!; totalBalance = ethWallet.getCachedTokenBalance(contract).total; - unit = contract.symbol; - decimals = contract.decimals; } return Text( - "${totalBalance.localizedStringAsFixed( - locale: locale, - decimalPlaces: decimals, - )} $unit", + ref + .watch(pAmountFormatter(manager.coin)) + .format(totalBalance, ethContract: contract), style: Util.isDesktop ? STextStyles.desktopTextExtraSmall(context).copyWith( color: Theme.of(context).extension()!.textSubtitle1, diff --git a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart index 5d87cd90b..1da53d402 100644 --- a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart +++ b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/wallet_info_row/wallet_info_row.dart b/lib/widgets/wallet_info_row/wallet_info_row.dart index 4a3a35b57..73c03ea04 100644 --- a/lib/widgets/wallet_info_row/wallet_info_row.dart +++ b/lib/widgets/wallet_info_row/wallet_info_row.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; diff --git a/lib/widgets/wallet_navigation_bar/components/icons/buy_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/buy_nav_icon.dart index 5f0e30df8..84800acba 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/buy_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/buy_nav_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/wallet_navigation_bar/components/icons/coin_control_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/coin_control_nav_icon.dart index 3d8e2cea4..a95b36015 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/coin_control_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/coin_control_nav_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/wallet_navigation_bar/components/icons/exchange_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/exchange_nav_icon.dart index 223703334..25a71c7b7 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/exchange_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/exchange_nav_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/wallet_navigation_bar/components/icons/paynym_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/paynym_nav_icon.dart index 63ca7617e..cdf881432 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/paynym_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/paynym_nav_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart index 4690382c2..832899aa4 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart index 3df04f4ee..122cc4d17 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/wallet_navigation_bar/components/icons/whirlpool_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/whirlpool_nav_icon.dart index 9a3eff747..6be7a1953 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/whirlpool_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/whirlpool_nav_icon.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/wallet_navigation_bar/components/wallet_navigation_bar_item.dart b/lib/widgets/wallet_navigation_bar/components/wallet_navigation_bar_item.dart index 8fed3c4e4..4394cef92 100644 --- a/lib/widgets/wallet_navigation_bar/components/wallet_navigation_bar_item.dart +++ b/lib/widgets/wallet_navigation_bar/components/wallet_navigation_bar_item.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/themes/stack_colors.dart'; diff --git a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart index f389b2c85..a462f9927 100644 --- a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart +++ b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart @@ -1,3 +1,13 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 570461de7..b741c3c0a 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,7 +5,7 @@ import FlutterMacOS import Foundation -import connectivity_plus_macos +import connectivity_plus import desktop_drop import device_info_plus import devicelocale @@ -13,7 +13,7 @@ import flutter_libepiccash import flutter_local_notifications import flutter_secure_storage_macos import isar_flutter_libs -import package_info_plus_macos +import package_info_plus import path_provider_foundation import share_plus import shared_preferences_foundation @@ -29,7 +29,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin")) FlutterLibepiccashPlugin.register(with: registry.registrar(forPlugin: "FlutterLibepiccashPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) - FlutterSecureStorageMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageMacosPlugin")) + FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 600a92d67..0fd25520b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,58 +5,42 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "4897882604d919befd350648c7f91926a9d5de99e67b455bf0917cc2362f4bb8" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a url: "https://pub.dev" source: hosted - version: "47.0.0" + version: "61.0.0" analyzer: dependency: "direct dev" description: name: analyzer - sha256: "690e335554a8385bc9d787117d9eb52c0c03ee207a607e593de3c9d71b1cfe80" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 url: "https://pub.dev" source: hosted - version: "4.7.0" - animations: - dependency: "direct main" - description: - name: animations - sha256: fe8a6bdca435f718bb1dc8a11661b2c22504c6da40ef934cee8327ed77934164 - url: "https://pub.dev" - source: hosted - version: "2.0.7" + version: "5.13.0" another_flushbar: dependency: "direct main" description: name: another_flushbar - sha256: fa09f8a4ca582c417669b7b1d0e85ce65bd074d80bb0dcbb1302ad1b22bdc3ef + sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" url: "https://pub.dev" source: hosted - version: "1.12.29" - app_settings: - dependency: "direct main" - description: - name: app_settings - sha256: "66715a323ac36d6c8201035ba678777c0d2ea869e4d7064300d95af10c3bb8cb" - url: "https://pub.dev" - source: hosted - version: "4.2.0" + version: "1.12.30" archive: dependency: "direct main" description: name: archive - sha256: "80e5141fafcb3361653ce308776cfd7d45e6e9fbb429e14eec571382c0c5fecb" + sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" url: "https://pub.dev" source: hosted - version: "3.3.2" + version: "3.3.7" args: dependency: transitive description: name: args - sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" + sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" asn1lib: dependency: transitive description: @@ -69,24 +53,32 @@ packages: dependency: "direct main" description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" barcode_scan2: dependency: "direct main" description: name: barcode_scan2 - sha256: f9af9252b8f3f5fa446f5456fd45f8871d09f883d8389a1d608b39231bfbc3fa + sha256: "0b0625d27841a21e36e896195d86b2aada335e3c486f63647cce701495718e16" url: "https://pub.dev" source: hosted - version: "4.2.3" + version: "4.2.4" + basic_utils: + dependency: "direct main" + description: + name: basic_utils + sha256: "8815477fcf58499e42326bd858e391442425fa57db9a45e48e15224c62049262" + url: "https://pub.dev" + source: hosted + version: "5.5.4" bech32: dependency: "direct main" description: path: "." - ref: "22279d4bb24ed541b431acd269a1bc50af0f36a0" - resolved-ref: "22279d4bb24ed541b431acd269a1bc50af0f36a0" + ref: b6d2a5b4cd17311d917787c0f9505f04932659b1 + resolved-ref: b6d2a5b4cd17311d917787c0f9505f04932659b1 url: "https://github.com/cypherstack/bech32.git" source: git version: "0.2.1" @@ -102,8 +94,8 @@ packages: dependency: "direct main" description: path: "." - ref: "3bef5acc21340f3cc78df0ad1dce5868a3ed68a5" - resolved-ref: "3bef5acc21340f3cc78df0ad1dce5868a3ed68a5" + ref: "0cd6d54e2860bea68fc50c801cb9db2a760192fb" + resolved-ref: "0cd6d54e2860bea68fc50c801cb9db2a760192fb" url: "https://github.com/cypherstack/stack-bip39.git" source: git version: "1.0.6" @@ -111,8 +103,8 @@ packages: dependency: "direct main" description: path: "." - ref: "38847255d035c0f6ec5bc93d19130ec804cf90e9" - resolved-ref: "38847255d035c0f6ec5bc93d19130ec804cf90e9" + ref: "081ca1863c2feba00c35bb5b297902f12f499941" + resolved-ref: "081ca1863c2feba00c35bb5b297902f12f499941" url: "https://github.com/cypherstack/bip47.git" source: git version: "2.0.0" @@ -129,8 +121,8 @@ packages: dependency: "direct main" description: path: "." - ref: "004d6f82dff7389b561e5078b4649adcd2d9c10f" - resolved-ref: "004d6f82dff7389b561e5078b4649adcd2d9c10f" + ref: af6d6c27edfe2e7cc35772ed2684eb4cc826f0e4 + resolved-ref: af6d6c27edfe2e7cc35772ed2684eb4cc826f0e4 url: "https://github.com/cypherstack/bitcoindart.git" source: git version: "3.0.1" @@ -154,10 +146,10 @@ packages: dependency: transitive description: name: build - sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + sha256: "43865b79fbb78532e4bff7c33087aa43b1d488c4fdef014eaef568af6d8016dc" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.0" build_config: dependency: transitive description: @@ -170,34 +162,34 @@ packages: dependency: transitive description: name: build_daemon - sha256: "6bc5544ea6ce4428266e7ea680e945c68806c4aae2da0eb5e9ccf38df8d6acbf" + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.0.0" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "687cf90a3951affac1bd5f9ecb5e3e90b60487f3d9cdc359bb310f8876bb02a6" + sha256: db49b8609ef8c81cca2b310618c3017c00f03a92af44c04d310b907b2d692d95 url: "https://pub.dev" source: hosted - version: "2.0.10" + version: "2.2.0" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "93f05c041932674be039b0a2323d6cf57e5f2bbf884a3c0382f9e53fc45ebace" + sha256: "220ae4553e50d7c21a17c051afc7b183d28a24a420502e842f303f8e4e6edced" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.4" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" + sha256: "88a57f2ac99849362e73878334caa9f06ee25f31d2adced882b8337838c84e1e" url: "https://pub.dev" source: hosted - version: "7.2.7" + version: "7.2.9" built_collection: dependency: transitive description: @@ -210,26 +202,26 @@ packages: dependency: transitive description: name: built_value - sha256: "169565c8ad06adb760c3645bf71f00bff161b00002cace266cad42c5d22a7725" + sha256: "7dd62d9faf105c434f3d829bbe9c4be02ec67f5ed94832222116122df67c5452" url: "https://pub.dev" source: hosted - version: "8.4.3" + version: "8.6.0" characters: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" checked_yaml: dependency: transitive description: name: checked_yaml - sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" cli_util: dependency: transitive description: @@ -258,34 +250,18 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" connectivity_plus: dependency: "direct main" description: name: connectivity_plus - sha256: e18bbd0243342ceca6fb33718fd2737c468c1a881ad7fed4b0a47258b5838d9d + sha256: "8599ae9edca5ff96163fca3e36f8e481ea917d1e71cdad912c084b5579913f34" url: "https://pub.dev" source: hosted - version: "2.3.6+1" - connectivity_plus_linux: - dependency: transitive - description: - name: connectivity_plus_linux - sha256: "3caf859d001f10407b8e48134c761483e4495ae38094ffcca97193f6c271f5e2" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - connectivity_plus_macos: - dependency: transitive - description: - name: connectivity_plus_macos - sha256: "488d2de1e47e1224ad486e501b20b088686ba1f4ee9c4420ecbc3b9824f0b920" - url: "https://pub.dev" - source: hosted - version: "1.2.6" + version: "4.0.1" connectivity_plus_platform_interface: dependency: transitive description: @@ -294,38 +270,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.4" - connectivity_plus_web: - dependency: transitive - description: - name: connectivity_plus_web - sha256: "81332be1b4baf8898fed17bb4fdef27abb7c6fd990bf98c54fd978478adf2f1a" - url: "https://pub.dev" - source: hosted - version: "1.2.5" - connectivity_plus_windows: - dependency: transitive - description: - name: connectivity_plus_windows - sha256: "535b0404b4d5605c4dd8453d67e5d6d2ea0dd36e3b477f50f31af51b0aeab9dd" - url: "https://pub.dev" - source: hosted - version: "1.2.2" convert: dependency: transitive description: name: convert - sha256: "196284f26f69444b7f5c50692b55ec25da86d9e500451dc09333bf2e3ad69259" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.1" coverage: dependency: transitive description: name: coverage - sha256: "525ac94733f9ce82507a050bfd62ad89eb1dcbc56308e1e2e17ab11abeee4a75" + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.6.3" cross_file: dependency: transitive description: @@ -346,18 +306,18 @@ packages: dependency: transitive description: name: cryptography - sha256: ffd770340e5a48f57e473c42d9036a773c43b396e80b41a2dd164ffaf53f57a4 + sha256: df156c5109286340817d21fa7b62f9140f17915077127dd70f8bd7a2a0997a35 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.5.0" csslib: dependency: transitive description: name: csslib - sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 + sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f" url: "https://pub.dev" source: hosted - version: "0.17.2" + version: "0.17.3" cw_core: dependency: "direct main" description: @@ -422,10 +382,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4" + sha256: f4f1f73ab3fd2afcbcca165ee601fe980d966af6a21b5970c6c9376955c528ad url: "https://pub.dev" source: hosted - version: "2.2.4" + version: "2.3.1" dartx: dependency: transitive description: @@ -470,34 +430,50 @@ packages: dependency: "direct main" description: name: device_info_plus - sha256: "8d99246809e63d93e4e68fade79495d81f445ad735bde2b129b19c0adddcaf1a" + sha256: "2c35b6d1682b028e42d07b3aee4b98fa62996c10bc12cb651ec856a80d6a761b" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "9.0.2" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - sha256: "8b8b65e598b84fdb82c26cf9b3f05a6c4978636e99b0c070bae5905a24728199" + sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 url: "https://pub.dev" source: hosted - version: "6.0.1" + version: "7.0.0" devicelocale: dependency: "direct main" description: name: devicelocale - sha256: "5fd46b8c2a987b1c14b1551433be1974dbca5ec6ab00e7d53288b5197a21863e" + sha256: "09cc0bce937b34dafcaac0b2a9b350d763dd16770f15e59560b7abaaaad3d65b" url: "https://pub.dev" source: hosted - version: "0.5.5" + version: "0.6.0" dropdown_button2: dependency: "direct main" description: name: dropdown_button2 - sha256: "1a00301a1ec87666b1f1938f373865e3f5fb3056e4e36e1b3c2c0dc0c11f4737" + sha256: "374f2390161bf782b4896f0b1b24cbb2b5daaa1cfb11047c3307461dcdf44e07" url: "https://pub.dev" source: hosted - version: "1.7.2" + version: "2.1.3" + eip1559: + dependency: transitive + description: + name: eip1559 + sha256: de454d6321bd753eb79116e9ec4f8df20895c2e97f9a3839a032f3a728985516 + url: "https://pub.dev" + source: hosted + version: "0.6.1" + eip55: + dependency: transitive + description: + name: eip55 + sha256: "213a9b86add87a5216328e8494b0ab836e401210c4d55eb5e521bd39e39169e1" + url: "https://pub.dev" + source: hosted + version: "1.0.2" emojis: dependency: "direct main" description: @@ -550,10 +526,10 @@ packages: dependency: "direct main" description: name: ffi - sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" file: dependency: transitive description: @@ -566,26 +542,26 @@ packages: dependency: "direct main" description: name: file_picker - sha256: d090ae03df98b0247b82e5928f44d1b959867049d18d73635e2e0bc3f49542b9 + sha256: "9d6e95ec73abbd31ec54d0e0df8a961017e165aba1395e462e5b31ea0c165daf" url: "https://pub.dev" source: hosted - version: "5.2.5" + version: "5.3.1" fixnum: dependency: transitive description: name: fixnum - sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" url: "https://pub.dev" source: hosted - version: "1.0.1" - flare_flutter: - dependency: "direct main" + version: "1.1.0" + fixnum_nanodart: + dependency: transitive description: - name: flare_flutter - sha256: "99d63c60f00fac81249ce6410ee015d7b125c63d8278a30da81edf3317a1f6a0" + name: fixnum_nanodart + sha256: "4b0132d11ecddc0d2ca64b6d7dee6726db432ed02cac1349d7532a08be5c54fc" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "1.0.0" flutter: dependency: "direct main" description: flutter @@ -678,10 +654,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "60fc7b78455b94e6de2333d2f95196d32cf5c22f4b0b0520a628804cb463503b" + sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.15" flutter_riverpod: dependency: "direct main" description: @@ -694,18 +670,18 @@ packages: dependency: "direct main" description: name: flutter_rounded_date_picker - sha256: "369f7c63c1518d24c63f5da889ea9a6fb9a0a6f105ba9d22ccbba7665475784f" + sha256: e7143cc5cbf3aec1536286653e38b0809abc99fb76c91bd910dbd98ae003d890 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" flutter_secure_storage: dependency: "direct main" description: name: flutter_secure_storage - sha256: "5abe3d5c25ab435e48c47fb61bac25606062a305fac637c2f020e25abd30014a" + sha256: "98352186ee7ad3639ccc77ad7924b773ff6883076ab952437d20f18a61f0a7c5" url: "https://pub.dev" source: hosted - version: "5.1.2" + version: "8.0.0" flutter_secure_storage_linux: dependency: transitive description: @@ -718,10 +694,10 @@ packages: dependency: transitive description: name: flutter_secure_storage_macos - sha256: "388f76fd0f093e7415a39ec4c169ae7cceeee6d9f9ba529d788a13f2be4de7bd" + sha256: "083add01847fc1c80a07a08e1ed6927e9acd9618a35e330239d4422cd2a58c50" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "3.0.0" flutter_secure_storage_platform_interface: dependency: transitive description: @@ -742,18 +718,10 @@ packages: dependency: transitive description: name: flutter_secure_storage_windows - sha256: ca89c8059cf439985aa83c59619b3674c7ef6cc2e86943d169a7369d6a69cab5 + sha256: fc2910ec9b28d60598216c29ea763b3a96c401f0ce1d13cdf69ccb0e5c93c3ee url: "https://pub.dev" source: hosted - version: "1.1.3" - flutter_spinkit: - dependency: "direct main" - description: - name: flutter_spinkit - sha256: "77a2117c0517ff909221f3160b8eb20052ab5216107581168af574ac1f05dff8" - url: "https://pub.dev" - source: hosted - version: "5.1.0" + version: "2.0.0" flutter_svg: dependency: "direct main" description: @@ -776,10 +744,10 @@ packages: dependency: transitive description: name: frontend_server_client - sha256: "4f4a162323c86ffc1245765cfe138872b8f069deb42f7dbb36115fa27f31469b" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "3.2.0" fuchsia_remote_debug_protocol: dependency: transitive description: flutter @@ -789,26 +757,26 @@ packages: dependency: transitive description: name: glob - sha256: c51b4fdfee4d281f49b8c957f1add91b815473597f76bcf07377987f66a55729 + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" google_fonts: dependency: "direct main" description: name: google_fonts - sha256: e70521755a6b08c6bde14ddae27dff5bf21010033888fc61da6c595f8a9f58c1 + sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "4.0.4" graphs: dependency: transitive description: name: graphs - sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.1" hex: dependency: "direct main" description: @@ -837,10 +805,10 @@ packages: dependency: "direct dev" description: name: hive_generator - sha256: "81fd20125cb2ce8fd23623d7744ffbaf653aae93706c9bd3bf7019ea0ace3938" + sha256: "65998cc4d2cd9680a3d9709d893d2f6bb15e6c1f92626c3f1fa650b4b3281521" url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "2.0.0" hive_test: dependency: "direct dev" description: @@ -853,18 +821,18 @@ packages: dependency: transitive description: name: html - sha256: d9793e10dbe0e6c364f4c59bf3e01fb33a9b2a674bc7a1081693dba0614b6269 + sha256: "58e3491f7bf0b6a4ea5110c0c688877460d1a6366731155c4a4580e7ded773e8" url: "https://pub.dev" source: hosted - version: "0.15.1" + version: "0.15.3" http: dependency: "direct main" description: name: http - sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "0.13.6" http_multi_server: dependency: transitive description: @@ -946,18 +914,18 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" json_annotation: dependency: transitive description: name: json_annotation - sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.8.1" json_rpc_2: dependency: transitive description: @@ -966,14 +934,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" - jsonrpc2: - dependency: "direct main" - description: - name: jsonrpc2 - sha256: "98a71b834240ca6d003499ab8f28d1c35aa8ca90235b51e972e0f70596b86bd3" - url: "https://pub.dev" - source: hosted - version: "3.0.1" keyboard_dismisser: dependency: "direct main" description: @@ -993,10 +953,10 @@ packages: dependency: transitive description: name: lints - sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.0" local_auth: dependency: "direct main" description: @@ -1009,26 +969,26 @@ packages: dependency: transitive description: name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" lottie: dependency: "direct main" description: name: lottie - sha256: "893da7a0022ec2fcaa616f34529a081f617e86cc501105b856e5a3184c58c7c2" + sha256: "23522951540d20a57a60202ed7022e6376bed206a4eee1c347a91f58bd57eb9f" url: "https://pub.dev" source: hosted - version: "1.4.3" + version: "2.3.2" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -1041,10 +1001,10 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mime: dependency: transitive description: @@ -1057,10 +1017,10 @@ packages: dependency: transitive description: name: mobx - sha256: "6738620307a424d2c9ad8b873f4dce391c44e9135eb4e75668ac8202fec7a9b8" + sha256: "0afcf88b3ee9d6819890bf16c11a727fc8c62cf736fda8e5d3b9b4eace4e62ea" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" mockingjay: dependency: "direct dev" description: @@ -1073,10 +1033,10 @@ packages: dependency: "direct dev" description: name: mockito - sha256: "2a8a17b82b1bde04d514e75d90d634a0ac23f6cb4991f6098009dd56836aeafe" + sha256: "8b46d7eb40abdda92d62edd01546051f0c27365e65608c284de336dccfef88cc" url: "https://pub.dev" source: hosted - version: "5.3.2" + version: "5.4.1" mocktail: dependency: transitive description: @@ -1093,6 +1053,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.1" + nanodart: + dependency: "direct main" + description: + name: nanodart + sha256: "4b2f42d60307b54e8cf384d6193a567d07f8efd773858c0d5948246153c13282" + url: "https://pub.dev" + source: hosted + version: "2.0.0" nm: dependency: transitive description: @@ -1105,10 +1073,10 @@ packages: dependency: transitive description: name: node_preamble - sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" package_config: dependency: transitive description: @@ -1121,58 +1089,26 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: f62d7253edc197fe3c88d7c2ddab82d68f555e778d55390ccc3537eca8e8d637 + sha256: ceb027f6bc6a60674a233b4a90a7658af1aebdea833da0b5b53c1e9821a78c7b url: "https://pub.dev" source: hosted - version: "1.4.3+1" - package_info_plus_linux: - dependency: transitive - description: - name: package_info_plus_linux - sha256: "04b575f44233d30edbb80a94e57cad9107aada334fc02aabb42b6becd13c43fc" - url: "https://pub.dev" - source: hosted - version: "1.0.5" - package_info_plus_macos: - dependency: transitive - description: - name: package_info_plus_macos - sha256: a2ad8b4acf4cd479d4a0afa5a74ea3f5b1c7563b77e52cc32b3ee6956d5482a6 - url: "https://pub.dev" - source: hosted - version: "1.3.0" + version: "4.0.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: f7a0c8f1e7e981bc65f8b64137a53fd3c195b18d429fba960babc59a5a1c7ae8 + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" url: "https://pub.dev" source: hosted - version: "1.0.2" - package_info_plus_web: - dependency: transitive - description: - name: package_info_plus_web - sha256: f0829327eb534789e0a16ccac8936a80beed4e2401c4d3a74f3f39094a822d3b - url: "https://pub.dev" - source: hosted - version: "1.0.6" - package_info_plus_windows: - dependency: transitive - description: - name: package_info_plus_windows - sha256: "79524f11c42dd9078b96d797b3cf79c0a2883a50c4920dc43da8562c115089bc" - url: "https://pub.dev" - source: hosted - version: "2.1.0" + version: "2.0.1" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_drawing: dependency: transitive description: @@ -1193,50 +1129,50 @@ packages: dependency: "direct main" description: name: path_provider - sha256: dcea5feb97d8abf90cab9e9030b497fb7c3cbf26b7a1fe9e3ef7dcb0a1ddec95 + sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" url: "https://pub.dev" source: hosted - version: "2.0.12" + version: "2.0.15" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: a776c088d671b27f6e3aa8881d64b87b3e80201c64e8869b811325de7a76c15e + sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" url: "https://pub.dev" source: hosted - version: "2.0.22" + version: "2.0.27" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "62a68e7e1c6c459f9289859e2fae58290c981ce21d1697faf54910fe1faa4c74" + sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.2.3" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: "2e32f1640f07caef0d3cb993680f181c79e54a3827b997d5ee221490d131fbd9" + sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 url: "https://pub.dev" source: hosted - version: "2.1.8" + version: "2.1.11" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76 + sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.6" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c + sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.6" permission_handler: dependency: "direct main" description: @@ -1249,18 +1185,18 @@ packages: dependency: transitive description: name: permission_handler_android - sha256: "8028362b40c4a45298f1cbfccd227c8dd6caf0e27088a69f2ba2ab15464159e2" + sha256: d8cc6a62ded6d0f49c6eac337e080b066ee3bce4d405bd9439a61e1f1927bfe8 url: "https://pub.dev" source: hosted - version: "10.2.0" + version: "10.2.1" permission_handler_apple: dependency: transitive description: name: permission_handler_apple - sha256: "9c370ef6a18b1c4b2f7f35944d644a56aa23576f23abee654cf73968de93f163" + sha256: ee96ac32f5a8e6f80756e25b25b9f8e535816c8e6665a96b6d70681f8c4f7e85 url: "https://pub.dev" source: hosted - version: "9.0.7" + version: "9.0.8" permission_handler_platform_interface: dependency: transitive description: @@ -1281,10 +1217,10 @@ packages: dependency: transitive description: name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "5.4.0" platform: dependency: transitive description: @@ -1297,18 +1233,18 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" pointycastle: dependency: "direct main" description: name: pointycastle - sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" url: "https://pub.dev" source: hosted - version: "3.6.2" + version: "3.7.3" pool: dependency: transitive description: @@ -1337,36 +1273,36 @@ packages: dependency: transitive description: name: pub_semver - sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.3" qr: dependency: transitive description: name: qr - sha256: "5c4208b4dc0d55c3184d10d83ee0ded6212dc2b5e2ba17c5a0c0aab279128d21" + sha256: "64957a3930367bf97cc211a5af99551d630f2f4625e38af10edd6b19131b64b3" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.0.1" qr_flutter: dependency: "direct main" description: name: qr_flutter - sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e + sha256: "5095f0fc6e3f71d08adef8feccc8cea4f12eec18a2e31c2e8d82cb6019f4b097" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.1.0" rational: - dependency: "direct main" + dependency: transitive description: name: rational sha256: ba58e9e18df9abde280e8b10051e4bce85091e41e8e7e411b6cde2e738d357cf @@ -1381,22 +1317,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.3" - rpc_dispatcher: - dependency: transitive - description: - name: rpc_dispatcher - sha256: b6ddcae58b3fbc1172a7c2dc8ab30d2f1090db8c7a728e4405bd10142dc48a47 - url: "https://pub.dev" - source: hosted - version: "1.0.1" - rpc_exceptions: - dependency: transitive - description: - name: rpc_exceptions - sha256: "09b2e5f3f805b65a262b40e3410d79fb916ff5be2a65e2f6b8b0eeef7aa965b7" - url: "https://pub.dev" - source: hosted - version: "1.0.1" rxdart: dependency: "direct main" description: @@ -1405,110 +1325,118 @@ packages: url: "https://pub.dev" source: hosted version: "0.27.7" + sec: + dependency: transitive + description: + name: sec + sha256: "8bbd56df884502192a441b5f5d667265498f2f8728a282beccd9db79e215f379" + url: "https://pub.dev" + source: hosted + version: "1.1.0" share_plus: dependency: "direct main" description: name: share_plus - sha256: "8c6892037b1824e2d7e8f59d54b3105932899008642e6372e5079c6939b4b625" + sha256: ed3fcea4f789ed95913328e629c0c53e69e80e08b6c24542f1b3576046c614e8 url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "7.0.2" share_plus_platform_interface: dependency: transitive description: name: share_plus_platform_interface - sha256: "82ddd4ab9260c295e6e39612d4ff00390b9a7a21f1bb1da771e2f232d80ab8a1" + sha256: "0c6e61471bd71b04a138b8b588fa388e66d8b005e6f2deda63371c5c505a0981" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.1" shared_preferences: dependency: transitive description: name: shared_preferences - sha256: "5949029e70abe87f75cfe59d17bf5c397619c4b74a099b10116baeb34786fad9" + sha256: "16d3fb6b3692ad244a695c0183fca18cf81fd4b821664394a781de42386bf022" url: "https://pub.dev" source: hosted - version: "2.0.17" + version: "2.1.1" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "955e9736a12ba776bdd261cf030232b30eadfcd9c79b32a3250dd4a494e8c8f7" + sha256: "6478c6bbbecfe9aced34c483171e90d7c078f5883558b30ec3163cf18402c749" url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.1.4" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "2b55c18636a4edc529fa5cd44c03d3f3100c00513f518c5127c951978efcccd0" + sha256: e014107bb79d6d3297196f4f2d0db54b5d1f85b8ea8ff63b8e8b391a02700feb url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.2.2" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: f8ea038aa6da37090093974ebdcf4397010605fd2ff65c37a66f9d28394cb874 + sha256: "9d387433ca65717bbf1be88f4d5bb18f10508917a8fa2fb02e0fd0d7479a9afa" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.2.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: da9431745ede5ece47bc26d5d73a9d3c6936ef6945c101a5aca46f62e52c1cf3 + sha256: fb5cf25c0235df2d0640ac1b1174f6466bd311f621574997ac59018a6664548d url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958 + sha256: "74083203a8eae241e0de4a0d597dbedab3b8fef5563f33cf3c12d7e93c655ca5" url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.1.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "5eaf05ae77658d3521d0e993ede1af962d4b326cd2153d312df716dc250f00c9" + sha256: "5e588e2efef56916a3b229c3bfe81e6a525665a454519ca51dbcc4236a274173" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.2.0" shelf: dependency: transitive description: name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306 + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -1518,10 +1446,10 @@ packages: dependency: transitive description: name: source_gen - sha256: "2d79738b6bbf38a43920e2b8d189e9a3ce6cc201f4b8fc76be5e4fe377b1c38d" + sha256: "373f96cf5a8744bc9816c1ff41cf5391bbdbe3d7a96fe98c622b6738a8a7bd33" url: "https://pub.dev" source: hosted - version: "1.2.6" + version: "1.3.2" source_helper: dependency: transitive description: @@ -1566,8 +1494,8 @@ packages: dependency: "direct main" description: path: "." - ref: e4b08d2b8965a5ae49bd57f598fa9011dd0c25e9 - resolved-ref: e4b08d2b8965a5ae49bd57f598fa9011dd0c25e9 + ref: ee1da8a9ba1cbeb50c5b354ea1fd5a25b7c5a3ed + resolved-ref: ee1da8a9ba1cbeb50c5b354ea1fd5a25b7c5a3ed url: "https://github.com/cypherstack/stack_wallet_backup.git" source: git version: "0.0.1" @@ -1603,14 +1531,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" - string_to_hex: - dependency: "direct main" - description: - name: string_to_hex - sha256: "63e5dc1f4821a2449d505033fbd4569f7020ebf30ddffb54d00ebaba8e144a49" - url: "https://pub.dev" - source: hosted - version: "0.2.2" string_validator: dependency: "direct main" description: @@ -1639,26 +1559,26 @@ packages: dependency: transitive description: name: test - sha256: a5fcd2d25eeadbb6589e80198a47d6a464ba3e2049da473943b8af9797900c2d + sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" url: "https://pub.dev" source: hosted - version: "1.22.0" + version: "1.24.1" test_api: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" test_core: dependency: transitive description: name: test_core - sha256: "0ef9755ec6d746951ba0aabe62f874b707690b5ede0fecc818b138fcc9b14888" + sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" url: "https://pub.dev" source: hosted - version: "0.4.20" + version: "0.5.1" time: dependency: transitive description: @@ -1691,14 +1611,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" - toast: - dependency: "direct main" - description: - name: toast - sha256: bedb96d37030acf9c4c06a7ac2ffd1f1f365e780cda9458c9e24e6a1e1ab6fd9 - url: "https://pub.dev" - source: hosted - version: "0.1.5" tuple: dependency: "direct main" description: @@ -1711,10 +1623,10 @@ packages: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" universal_io: dependency: transitive description: @@ -1727,66 +1639,66 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: e8f2efc804810c0f2f5b485f49e7942179f56eabcfe81dce3387fec4bb55876b + sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3 url: "https://pub.dev" source: hosted - version: "6.1.9" + version: "6.1.11" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1" + sha256: eed4e6a1164aa9794409325c3b707ff424d4d1c2a785e7db67f8bbda00e36e51 url: "https://pub.dev" source: hosted - version: "6.0.23" + version: "6.0.35" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "0a5af0aefdd8cf820dd739886efb1637f1f24489900204f50984634c07a54815" + sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.1.4" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc" + sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.5" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094" + sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.5" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6" + sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0" + sha256: "6bb1e5d7fe53daf02a8fee85352432a40b1f868a81880e99ec7440113d5cfcab" url: "https://pub.dev" source: hosted - version: "2.0.14" + version: "2.0.17" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: b6217370f8eb1fd85c8890c539f5a639a01ab209a36db82c921ebeacefc7a615 + sha256: "254708f17f7c20a9c8c471f67d86d76d4a3f9c1591aad1e15292008aceb82771" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.6" uuid: dependency: "direct main" description: @@ -1807,10 +1719,10 @@ packages: dependency: transitive description: name: vm_service - sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 + sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe url: "https://pub.dev" source: hosted - version: "9.4.0" + version: "11.3.0" wakelock: dependency: "direct main" description: @@ -1844,45 +1756,54 @@ packages: source: hosted version: "0.4.0" wakelock_windows: + dependency: "direct overridden" + description: + path: wakelock_windows + ref: "2a9bca63a540771f241d688562351482b2cf234c" + resolved-ref: "2a9bca63a540771f241d688562351482b2cf234c" + url: "https://github.com/timsneath/wakelock" + source: git + version: "0.2.2" + wallet: dependency: transitive description: - name: wakelock_windows - sha256: "857f77b3fe6ae82dd045455baa626bc4b93cb9bb6c86bf3f27c182167c3a5567" + name: wallet + sha256: "569c91c2af13a9e1119c001f9c09218eccf3f383eb8d15ba13a5b558010c1bc0" url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "0.0.12+1" watcher: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" web3dart: dependency: "direct main" description: name: web3dart - sha256: "48b89a5fac0029770a18d1a8bd05ce8431722bacf76184e4301dae05781565e5" + sha256: "0b96223a6b284e3146e65dc842ded139eca68a85c4ab79c5ba1a73284927d3cd" url: "https://pub.dev" source: hosted - version: "2.3.5" + version: "2.6.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.0" webdriver: dependency: transitive description: name: webdriver - sha256: ef67178f0cc7e32c1494645b11639dd1335f1d18814aa8435113a92e9ef9d841 + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" webkit_inspection_protocol: dependency: transitive description: @@ -1895,24 +1816,32 @@ packages: dependency: "direct main" description: name: websocket_universal - sha256: c12656930ceb52dc22505bcb0705f93418c97ab70b8bbc31e6cc7e79a3717fd6 + sha256: "681e3050bd70b9c94617394f87a021746d24d4b3c8302be8c6b0b2a3e4209d7f" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.5.2" win32: dependency: transitive description: name: win32 - sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 + sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "4.1.4" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "1c52f994bdccb77103a6231ad4ea331a244dbcef5d1f37d8462f713143b0bfae" + url: "https://pub.dev" + source: hosted + version: "1.1.0" window_size: dependency: "direct main" description: path: "plugins/window_size" ref: HEAD - resolved-ref: "17d4710c17f4913137e7ec931f6e71eaef443363" + resolved-ref: "6c66ad23ee79749f30a8eece542cf54eaf157ed8" url: "https://github.com/google/flutter-desktop-embedding.git" source: git version: "0.1.0" @@ -1928,10 +1857,10 @@ packages: dependency: transitive description: name: xml - sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.3.0" xxh3: dependency: transitive description: @@ -1944,10 +1873,10 @@ packages: dependency: transitive description: name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" zxcvbn: dependency: "direct main" description: @@ -1957,5 +1886,5 @@ packages: source: hosted version: "1.0.0" sdks: - dart: ">=2.18.5 <3.0.0" - flutter: ">=3.3.0" + dart: ">=3.0.2 <4.0.0" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 3533282bf..14366c00b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,10 +11,11 @@ description: Stack Wallet # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.7.10+174 +version: 1.7.13+179 environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=3.0.2 <4.0.0" + flutter: ^3.10.0 dependencies: flutter: @@ -41,35 +42,27 @@ dependencies: flutter_libepiccash: path: ./crypto_plugins/flutter_libepiccash -# firo_flutter: -# git: -# url: https://github.com/cypherstack/firo_flutter.git -# ref: update - # path: ./crypto_plugins/firo_flutter - bitcoindart: git: url: https://github.com/cypherstack/bitcoindart.git - ref: 004d6f82dff7389b561e5078b4649adcd2d9c10f + ref: af6d6c27edfe2e7cc35772ed2684eb4cc826f0e4 stack_wallet_backup: git: url: https://github.com/cypherstack/stack_wallet_backup.git - ref: e4b08d2b8965a5ae49bd57f598fa9011dd0c25e9 + ref: ee1da8a9ba1cbeb50c5b354ea1fd5a25b7c5a3ed bip47: git: url: https://github.com/cypherstack/bip47.git - ref: 38847255d035c0f6ec5bc93d19130ec804cf90e9 + ref: 081ca1863c2feba00c35bb5b297902f12f499941 # Utility plugins -# provider: ^6.0.1 - http: ^0.13.4 + http: ^0.13.0 local_auth: ^1.1.10 permission_handler: ^10.0.0 flutter_local_notifications: ^9.4.0 rxdart: ^0.27.3 -# filesystem_picker: ^3.0.0-beta.1 zxcvbn: ^1.0.0 dart_numerics: ^0.0.6 @@ -82,7 +75,7 @@ dependencies: bip39: git: url: https://github.com/cypherstack/stack-bip39.git - ref: 3bef5acc21340f3cc78df0ad1dce5868a3ed68a5 + ref: 0cd6d54e2860bea68fc50c801cb9db2a760192fb bitbox: git: url: https://github.com/PiRK/bitbox-flutter.git @@ -91,68 +84,60 @@ dependencies: bech32: git: url: https://github.com/cypherstack/bech32.git - ref: 22279d4bb24ed541b431acd269a1bc50af0f36a0 + ref: b6d2a5b4cd17311d917787c0f9505f04932659b1 bs58check: ^1.0.2 # Eth Plugins - web3dart: 2.3.5 - string_to_hex: 0.2.2 + web3dart: 2.6.1 ethereum_addresses: 1.0.2 # Storage plugins - flutter_secure_storage: ^5.0.2 + flutter_secure_storage: ^8.0.0 hive: ^2.0.5 hive_flutter: ^1.1.0 - path_provider: ^2.0.8 + path_provider: ^2.0.15 # UI/Component plugins flutter_native_splash: ^2.2.4 - animations: ^2.0.2 - toast: ^0.1.5 - flare_flutter: ^3.0.2 - google_fonts: ^2.2.0 + google_fonts: ^4.0.4 url_launcher: ^6.0.5 flutter_svg: ^1.0.1 flutter_feather_icons: ^2.0.0+1 - flutter_spinkit: ^5.1.0 decimal: ^2.1.0 event_bus: ^2.0.0 uuid: ^3.0.5 flutter_rounded_date_picker: ^3.0.1 crypto: ^3.0.2 - jsonrpc2: ^3.0.1 barcode_scan2: ^4.2.0 - app_settings: ^4.1.1 wakelock: ^0.6.2 intl: ^0.17.0 - devicelocale: ^0.5.0 - device_info_plus: ^7.0.1 + devicelocale: ^0.6.0 + device_info_plus: ^9.0.2 keyboard_dismisser: ^3.0.0 another_flushbar: ^1.10.28 tuple: ^2.0.0 flutter_riverpod: ^1.0.3 qr_flutter: ^4.0.0 - share_plus: ^6.3.0 + share_plus: ^7.0.2 emojis: ^0.9.9 pointycastle: ^3.6.0 - package_info_plus: ^1.4.2 - lottie: ^1.3.0 -# shared_preferences: ^2.0.15 - file_picker: ^5.0.1 - connectivity_plus: 2.3.6+1 -# document_file_save_plus: ^1.0.5 + package_info_plus: ^4.0.2 + lottie: ^2.3.2 + file_picker: ^5.3.1 + connectivity_plus: ^4.0.1 isar: 3.0.5 isar_flutter_libs: 3.0.5 # contains the binaries - dropdown_button2: 1.7.2 + dropdown_button2: ^2.1.3 string_validator: ^0.3.0 equatable: ^2.0.5 async: ^2.10.0 dart_bs58: ^1.0.1 dart_bs58check: ^3.0.2 hex: ^0.2.0 - rational: ^2.2.2 archive: ^3.3.2 desktop_drop: ^0.4.1 + nanodart: ^2.0.0 + basic_utils: ^5.5.4 dev_dependencies: flutter_test: @@ -161,13 +146,13 @@ dev_dependencies: sdk: flutter build_runner: ^2.1.7 flutter_launcher_icons: ^0.11.0 - hive_generator: ^1.1.2 + hive_generator: ^2.0.0 dependency_validator: ^3.1.2 hive_test: ^1.0.1 - mockito: ^5.1.0 + mockito: ^5.4.1 mockingjay: ^0.2.0 # lint: ^1.10.0 - analyzer: ^4.6.0 + analyzer: ^5.13.0 import_sorter: ^4.6.0 flutter_lints: ^2.0.1 isar_generator: 3.0.5 @@ -193,11 +178,27 @@ flutter_native_splash: android_disable_fullscreen: true dependency_overrides: + + # required for dart 3, at least until a fix is merged upstream + wakelock_windows: + git: + url: https://github.com/timsneath/wakelock + ref: 2a9bca63a540771f241d688562351482b2cf234c + path: wakelock_windows + + # required for libmonero - can remove once libmonero has been updated, PR has been merged in swb + stack_wallet_backup: + git: + url: https://github.com/cypherstack/stack_wallet_backup.git + ref: ee1da8a9ba1cbeb50c5b354ea1fd5a25b7c5a3ed + + # required override for nanodart bip39: git: url: https://github.com/cypherstack/stack-bip39.git - ref: 3bef5acc21340f3cc78df0ad1dce5868a3ed68a5 - crypto: 3.0.2 + ref: 0cd6d54e2860bea68fc50c801cb9db2a760192fb + + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/scripts/doc/copyright.py b/scripts/doc/copyright.py new file mode 100644 index 000000000..4849b40fe --- /dev/null +++ b/scripts/doc/copyright.py @@ -0,0 +1,50 @@ +import os + +path = "../../lib" + +ignore = [".g.dart", "LICENSE", "external_api_keys.dart"] + +# To update the header, only change the variable below + +header = """/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ +""" + +def add_text_to_files(folder_path, text, ignored_extensions=[]): + should_ignore = False + for root, dirs, files in os.walk(folder_path): + for filename in files: + file_path = os.path.join(root, filename) + should_ignore = False + for ignored_extension in ignored_extensions: + if file_path.endswith(ignored_extension): + should_ignore = True + break + if not should_ignore: + with open(file_path, 'r') as file: + lines = file.readlines() + if len(lines) >= 4: + second_line = lines[0] + third_line = lines[1] + fourth_line = lines[2] + if second_line.startswith("/*") and third_line.startswith(" *") and fourth_line.startswith(" *"): + with open(file_path, 'w') as file: + file.seek(0, 0) + file.write(text + ''.join(lines[9:])) + else: + with open(file_path, 'w') as file: + file.seek(0, 0) + file.write(text + '\n' + ''.join(lines)) + else: + with open(file_path, 'w') as file: + file.seek(0, 0) # Move the file cursor to the start + file.write(text + '\n' + ''.join(lines)) + +add_text_to_files(path, header, ignore) \ No newline at end of file diff --git a/scripts/prebuild.ps1 b/scripts/prebuild.ps1 new file mode 100644 index 000000000..80a6991b7 --- /dev/null +++ b/scripts/prebuild.ps1 @@ -0,0 +1,17 @@ +# Create template lib/external_api_keys.dart file if it doesn't already exist +$KEYS = "..\lib\external_api_keys.dart" +if (-not (Test-Path $KEYS)) { + Write-Host "prebuild.ps1: creating template lib/external_api_keys.dart file" + "const kChangeNowApiKey = '';" + "`nconst kSimpleSwapApiKey = '';" | Out-File $KEYS -Encoding UTF8 +} + +# Create template wallet test parameter files if they don't already exist +$coins = @("bitcoin", "bitcoincash", "dogecoin", "namecoin", "firo", "particl") # TODO add monero and wownero when those tests are updated to use the .gitignored test wallet setup: when doing that, make sure to update the test vectors for a new, private development seed + +foreach ($coin in $coins) { + $WALLETTESTPARAMFILE = "..\test\services\coins\$coin\${coin}_wallet_test_parameters.dart" + if (-not (Test-Path $WALLETTESTPARAMFILE)) { + Write-Host "prebuild.ps1: creating template test/services/coins/$coin/${coin}_wallet_test_parameters.dart file" + "const TEST_MNEMONIC = "";" + "`nconst ROOT_WIF = "";" + "`nconst NODE_WIF_84 = "";" | Out-File -FilePath $WALLETTESTPARAMFILE -Encoding UTF8 + } +} diff --git a/scripts/setup.sh b/scripts/setup.sh index 7bf07ef5a..529d2d7ec 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -18,20 +18,6 @@ echo 'export PATH="$PATH:'${FLUTTER_DIR}'"' >> ~/.bashrc source ~/.bashrc flutter doctor -# setup stack_wallet github -cd $PROJECTS -git clone https://github.com/cypherstack/stack_wallet.git -cd stack_wallet -export STACK_WALLET=$(pwd) -git submodule update --init --recursive - -# create template lib/external_api_keys.dart file if it doesn't already exist -KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart" -if ! test -f "$KEYS"; then - echo 'prebuild.sh: creating template lib/external_api_keys.dart file' - printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS -fi - # install stack wallet dependencies sudo apt-get install -y unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm @@ -46,9 +32,23 @@ source "$HOME/.cargo/env" cargo install cargo-ndk rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android -# build stack wallet plugins -cd $STACK_WALLET -cd scripts/android -./build_all.sh -cd ../linux -./build_all.sh +# # setup stack_wallet github +# cd $PROJECTS +# git clone https://github.com/cypherstack/stack_wallet.git +# cd stack_wallet +# export STACK_WALLET=$(pwd) +# git submodule update --init --recursive + +# # create template lib/external_api_keys.dart file if it doesn't already exist +# KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart" +# if ! test -f "$KEYS"; then +# echo 'prebuild.sh: creating template lib/external_api_keys.dart file' +# printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS +# fi + +# # build stack wallet plugins +# cd $STACK_WALLET +# cd scripts/android +# ./build_all.sh +# cd ../linux +# ./build_all.sh diff --git a/scripts/windows/build_all.sh b/scripts/windows/build_all.sh index d890ed70a..a96271cc3 100755 --- a/scripts/windows/build_all.sh +++ b/scripts/windows/build_all.sh @@ -3,7 +3,7 @@ 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) & +# (cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./build_all.sh) & wait echo "Done building" diff --git a/scripts/windows/deps.ps1 b/scripts/windows/deps.ps1 new file mode 100644 index 000000000..2d90ed7fe --- /dev/null +++ b/scripts/windows/deps.ps1 @@ -0,0 +1,75 @@ +# Create C:\development +New-Item -Path 'C:\development' -ItemType Directory -ErrorAction Ignore + +# $wc = [System.Net.WebClient]::new() +# $publishedHash = '8E28E54D601F0751922DE24632C1E716B4684876255CF82304A9B19E89A9CCAC' +# $FileHash = Get-FileHash -InputStream ($wc.OpenRead("C:\development\flutter_windows_3.7.12-stable.zip")) + +# if (-Not [System.IO.File]::Exists("C:\development\flutter_windows_3.7.12-stable.zip") or -Not ($FileHash.Hash -eq $publishedHash)) { +# } else { +# Download flutter_windows_3.7.12-stable.zip +# Write-Output "Downloading flutter_windows_3.7.12-stable.zip" +# $ProgressPreference = 'SilentlyContinue' # Speed up download process, see https://stackoverflow.com/questions/28682642/powershell-why-is-using-invoke-webrequest-much-slower-than-a-browser-download +# Invoke-WebRequest "https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.7.12-stable.zip" -OutFile "C:\development\flutter_windows_3.7.12-stable.zip" +# } + +# Extract Flutter SDK +Write-Output "Extracting flutter_windows_3.7.12-stable.zip" +$progressPreference = 'SilentlyContinue' # Speed up extraction process, see https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/32#issuecomment-642582179 +# Add-MpPreference -ExclusionPath C:\development +# Expand-Archive "C:\development\flutter_windows_3.7.12-stable.zip" -DestinationPath "C:\development" +Add-Type -Assembly "System.IO.Compression.Filesystem" +[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\development\flutter_windows_3.7.12-stable.zip", "C:\development") + +# See https://stackoverflow.com/a/69239861 +function Add-Path { + + param( + [Parameter(Mandatory, Position=0)] + [string] $LiteralPath, + [ValidateSet('User', 'CurrentUser', 'Machine', 'LocalMachine')] + [string] $Scope + ) + + Set-StrictMode -Version 1; $ErrorActionPreference = 'Stop' + + $isMachineLevel = $Scope -in 'Machine', 'LocalMachine' + if ($isMachineLevel -and -not $($ErrorActionPreference = 'Continue'; net session 2>$null)) { throw "You must run AS ADMIN to update the machine-level Path environment variable." } + + $regPath = 'registry::' + ('HKEY_CURRENT_USER\Environment', 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment')[$isMachineLevel] + + # Note the use of the .GetValue() method to ensure that the *unexpanded* value is returned. + $currDirs = (Get-Item -LiteralPath $regPath).GetValue('Path', '', 'DoNotExpandEnvironmentNames') -split ';' -ne '' + + if ($LiteralPath -in $currDirs) { + Write-Verbose "Already present in the persistent $(('user', 'machine')[$isMachineLevel])-level Path: $LiteralPath" + return + } + + $newValue = ($currDirs + $LiteralPath) -join ';' + + # Update the registry. + Set-ItemProperty -Type ExpandString -LiteralPath $regPath Path $newValue + + # Broadcast WM_SETTINGCHANGE to get the Windows shell to reload the + # updated environment, via a dummy [Environment]::SetEnvironmentVariable() operation. + $dummyName = [guid]::NewGuid().ToString() + [Environment]::SetEnvironmentVariable($dummyName, 'foo', 'User') + [Environment]::SetEnvironmentVariable($dummyName, [NullString]::value, 'User') + + # Finally, also update the current session's `$env:Path` definition. + # Note: For simplicity, we always append to the in-process *composite* value, + # even though for a -Scope Machine update this isn't strictly the same. + $env:Path = ($env:Path -replace ';$') + ';' + $LiteralPath + + Write-Verbose "`"$LiteralPath`" successfully appended to the persistent $(('user', 'machine')[$isMachineLevel])-level Path and also the current-process value." + +} + +# Add Flutter SDK to PATH if it's not there already +if ($Env:Path -split ";" -contains 'C:\development\flutter\bin') { + Write-Output "Flutter SDK in PATH, done" +} else { + Write-Output "Attempting to add Flutter SDK to PATH" + Add-Path("C:\development\flutter\bin") +} diff --git a/scripts/windows/deps.sh b/scripts/windows/deps.sh new file mode 100644 index 000000000..0f6642068 --- /dev/null +++ b/scripts/windows/deps.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./deps.sh ) & +(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./mxedeps.sh ) & +# (cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./monerodeps.sh && ./mxedeps.sh) & + +wait +echo "Done building" diff --git a/test/cached_electrumx_test.dart b/test/cached_electrumx_test.dart index 329de9daf..f1c3a0c41 100644 --- a/test/cached_electrumx_test.dart +++ b/test/cached_electrumx_test.dart @@ -126,12 +126,8 @@ void main() { ).thenThrow(Exception()); final cachedClient = CachedElectrumX( - electrumXClient: client, - port: 0, - failovers: [], - server: '', - useSSL: true, - prefs: Prefs.instance); + electrumXClient: client, + ); expect( () async => await cachedClient.getTransaction( @@ -143,12 +139,8 @@ void main() { test("clearSharedTransactionCache", () async { final cachedClient = CachedElectrumX( - server: '', - electrumXClient: MockElectrumX(), - port: 0, - useSSL: true, - prefs: MockPrefs(), - failovers: []); + electrumXClient: MockElectrumX(), + ); bool didThrow = false; try { @@ -174,11 +166,7 @@ void main() { useSSL: true, ); - final client = CachedElectrumX.from( - node: node, - prefs: MockPrefs(), - failovers: [], - electrumXClient: MockElectrumX()); + final client = CachedElectrumX.from(electrumXClient: MockElectrumX()); expect(client, isA()); }); diff --git a/test/cached_electrumx_test.mocks.dart b/test/cached_electrumx_test.mocks.dart index b83e96ed9..45cd27285 100644 --- a/test/cached_electrumx_test.mocks.dart +++ b/test/cached_electrumx_test.mocks.dart @@ -1,15 +1,19 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/cached_electrumx_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; -import 'dart:ui' as _i8; +import 'dart:ui' as _i10; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i8; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i9; import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i6; import 'package:stackwallet/utilities/prefs.dart' as _i5; @@ -782,7 +786,55 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs { returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - void addListener(_i8.VoidCallback? listener) => super.noSuchMethod( + _i8.AmountUnit amountUnit(_i9.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #amountUnit, + [coin], + ), + returnValue: _i8.AmountUnit.normal, + ) as _i8.AmountUnit); + @override + void updateAmountUnit({ + required _i9.Coin? coin, + required _i8.AmountUnit? amountUnit, + }) => + super.noSuchMethod( + Invocation.method( + #updateAmountUnit, + [], + { + #coin: coin, + #amountUnit: amountUnit, + }, + ), + returnValueForMissingStub: null, + ); + @override + int maxDecimals(_i9.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #maxDecimals, + [coin], + ), + returnValue: 0, + ) as int); + @override + void updateMaxDecimals({ + required _i9.Coin? coin, + required int? maxDecimals, + }) => + super.noSuchMethod( + Invocation.method( + #updateMaxDecimals, + [], + { + #coin: coin, + #maxDecimals: maxDecimals, + }, + ), + returnValueForMissingStub: null, + ); + @override + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -790,7 +842,7 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs { returnValueForMissingStub: null, ); @override - void removeListener(_i8.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/electrumx_test.dart b/test/electrumx_test.dart index 3ae162529..8d29f63e9 100644 --- a/test/electrumx_test.dart +++ b/test/electrumx_test.dart @@ -57,16 +57,18 @@ void main() { const jsonArgs = '["",true]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "error": { "code": 1, "message": "None should be a transaction hash", }, "id": "some requestId", - }, + }), ); final mockPrefs = MockPrefs(); @@ -93,13 +95,15 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": {"height": 520481, "hex": "some block hex string"}, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -126,7 +130,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -153,9 +159,15 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => {"jsonrpc": "2.0", "result": null, "id": "some requestId"}, + (_) async => JsonRPCResponse(data: { + "jsonrpc": "2.0", + "result": null, + "id": "some requestId", + }), ); final mockPrefs = MockPrefs(); @@ -181,7 +193,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -208,9 +222,11 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": { "genesis_hash": @@ -225,7 +241,7 @@ void main() { "hash_function": "sha256" }, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -263,7 +279,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -290,13 +308,15 @@ void main() { const jsonArgs = '["some raw transaction string"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": "the txid of the rawtx", "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -323,7 +343,9 @@ void main() { const jsonArgs = '["some raw transaction string"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -353,16 +375,18 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": { "confirmed": 103873966, "unconfirmed": 23684400, }, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -389,7 +413,9 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -418,9 +444,11 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": [ { @@ -435,7 +463,7 @@ void main() { } ], "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -473,7 +501,9 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -502,9 +532,11 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": [ { @@ -523,7 +555,7 @@ void main() { } ], "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -565,7 +597,9 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -594,13 +628,15 @@ void main() { const jsonArgs = '["${SampleGetTransactionData.txHash0}",true]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": SampleGetTransactionData.txData0, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -629,7 +665,9 @@ void main() { const jsonArgs = '["${SampleGetTransactionData.txHash0}",true]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -659,13 +697,15 @@ void main() { const jsonArgs = '["1",""]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": GetAnonymitySetSampleData.data, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -692,7 +732,9 @@ void main() { const jsonArgs = '["1",""]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -721,13 +763,15 @@ void main() { const jsonArgs = '["some mints"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": "mint meta data", "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -754,7 +798,9 @@ void main() { const jsonArgs = '["some mints"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -783,13 +829,15 @@ void main() { const jsonArgs = '["0"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": GetUsedSerialsSampleData.serials, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -816,7 +864,9 @@ void main() { const jsonArgs = '["0"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -845,9 +895,15 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => {"jsonrpc": "2.0", "result": 1, "id": "some requestId"}, + (_) async => JsonRPCResponse(data: { + "jsonrpc": "2.0", + "result": 1, + "id": "some requestId", + }), ); final mockPrefs = MockPrefs(); @@ -873,7 +929,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -886,7 +944,10 @@ void main() { prefs: mockPrefs, failovers: []); - expect(() => client.getLatestCoinId(requestID: "some requestId"), + expect( + () => client.getLatestCoinId( + requestID: "some requestId", + ), throwsA(isA())); verify(mockPrefs.wifiOnly).called(1); verifyNoMoreInteractions(mockPrefs); @@ -900,13 +961,15 @@ void main() { const jsonArgs = '["1",""]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": GetAnonymitySetSampleData.data, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -933,7 +996,9 @@ void main() { const jsonArgs = '["1",""]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -947,8 +1012,10 @@ void main() { failovers: []); expect( - () => - client.getAnonymitySet(groupId: "1", requestID: "some requestId"), + () => client.getAnonymitySet( + groupId: "1", + requestID: "some requestId", + ), throwsA(isA())); verify(mockPrefs.wifiOnly).called(1); verifyNoMoreInteractions(mockPrefs); @@ -962,13 +1029,15 @@ void main() { const jsonArgs = '["some mints"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": "mint meta data", "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -995,7 +1064,9 @@ void main() { const jsonArgs = '["some mints"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -1010,7 +1081,9 @@ void main() { expect( () => client.getMintData( - mints: "some mints", requestID: "some requestId"), + mints: "some mints", + requestID: "some requestId", + ), throwsA(isA())); verify(mockPrefs.wifiOnly).called(1); verifyNoMoreInteractions(mockPrefs); @@ -1024,13 +1097,15 @@ void main() { const jsonArgs = '["0"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": GetUsedSerialsSampleData.serials, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -1057,7 +1132,9 @@ void main() { const jsonArgs = '["0"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -1086,9 +1163,15 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => {"jsonrpc": "2.0", "result": 1, "id": "some requestId"}, + (_) async => JsonRPCResponse(data: { + "jsonrpc": "2.0", + "result": 1, + "id": "some requestId", + }), ); final mockPrefs = MockPrefs(); @@ -1114,7 +1197,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -1141,15 +1226,17 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": { "rate": 1000, }, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -1175,7 +1262,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); diff --git a/test/electrumx_test.mocks.dart b/test/electrumx_test.mocks.dart index 1cfe9cf4a..41fd2d3b3 100644 --- a/test/electrumx_test.mocks.dart +++ b/test/electrumx_test.mocks.dart @@ -1,14 +1,18 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/electrumx_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i7; +import 'dart:ui' as _i9; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/electrumx_rpc/rpc.dart' as _i2; +import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i7; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i6; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8; import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i5; import 'package:stackwallet/utilities/prefs.dart' as _i4; @@ -33,6 +37,17 @@ class _FakeDuration_0 extends _i1.SmartFake implements Duration { ); } +class _FakeJsonRPCResponse_1 extends _i1.SmartFake + implements _i2.JsonRPCResponse { + _FakeJsonRPCResponse_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [JsonRPC]. /// /// See the documentation for Mockito's code generation for more information. @@ -47,40 +62,16 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { returnValue: false, ) as bool); @override - set useSSL(bool? _useSSL) => super.noSuchMethod( - Invocation.setter( - #useSSL, - _useSSL, - ), - returnValueForMissingStub: null, - ); - @override String get host => (super.noSuchMethod( Invocation.getter(#host), returnValue: '', ) as String); @override - set host(String? _host) => super.noSuchMethod( - Invocation.setter( - #host, - _host, - ), - returnValueForMissingStub: null, - ); - @override int get port => (super.noSuchMethod( Invocation.getter(#port), returnValue: 0, ) as int); @override - set port(int? _port) => super.noSuchMethod( - Invocation.setter( - #port, - _port, - ), - returnValueForMissingStub: null, - ); - @override Duration get connectionTimeout => (super.noSuchMethod( Invocation.getter(#connectionTimeout), returnValue: _FakeDuration_0( @@ -89,21 +80,40 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { ), ) as Duration); @override - set connectionTimeout(Duration? _connectionTimeout) => super.noSuchMethod( - Invocation.setter( - #connectionTimeout, - _connectionTimeout, - ), - returnValueForMissingStub: null, - ); - @override - _i3.Future request(String? jsonRpcRequest) => (super.noSuchMethod( + _i3.Future<_i2.JsonRPCResponse> request(String? jsonRpcRequest) => + (super.noSuchMethod( Invocation.method( #request, [jsonRpcRequest], ), - returnValue: _i3.Future.value(), - ) as _i3.Future); + returnValue: + _i3.Future<_i2.JsonRPCResponse>.value(_FakeJsonRPCResponse_1( + this, + Invocation.method( + #request, + [jsonRpcRequest], + ), + )), + ) as _i3.Future<_i2.JsonRPCResponse>); + @override + _i3.Future disconnect({required String? reason}) => (super.noSuchMethod( + Invocation.method( + #disconnect, + [], + {#reason: reason}, + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + @override + _i3.Future connect() => (super.noSuchMethod( + Invocation.method( + #connect, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [Prefs]. @@ -503,7 +513,55 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs { returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( + _i7.AmountUnit amountUnit(_i8.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #amountUnit, + [coin], + ), + returnValue: _i7.AmountUnit.normal, + ) as _i7.AmountUnit); + @override + void updateAmountUnit({ + required _i8.Coin? coin, + required _i7.AmountUnit? amountUnit, + }) => + super.noSuchMethod( + Invocation.method( + #updateAmountUnit, + [], + { + #coin: coin, + #amountUnit: amountUnit, + }, + ), + returnValueForMissingStub: null, + ); + @override + int maxDecimals(_i8.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #maxDecimals, + [coin], + ), + returnValue: 0, + ) as int); + @override + void updateMaxDecimals({ + required _i8.Coin? coin, + required int? maxDecimals, + }) => + super.noSuchMethod( + Invocation.method( + #updateMaxDecimals, + [], + { + #coin: coin, + #maxDecimals: maxDecimals, + }, + ), + returnValueForMissingStub: null, + ); + @override + void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -511,7 +569,7 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs { returnValueForMissingStub: null, ); @override - void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/flutter_secure_storage_interface_test.mocks.dart b/test/flutter_secure_storage_interface_test.mocks.dart index b784fda7f..aa9520e43 100644 --- a/test/flutter_secure_storage_interface_test.mocks.dart +++ b/test/flutter_secure_storage_interface_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/flutter_secure_storage_interface_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; diff --git a/test/json_rpc_test.dart b/test/json_rpc_test.dart index ea6b214be..1c7cc4a00 100644 --- a/test/json_rpc_test.dart +++ b/test/json_rpc_test.dart @@ -17,7 +17,7 @@ void main() { '{"jsonrpc": "2.0", "id": "some id","method": "server.ping","params": []}'; final result = await jsonRPC.request(jsonRequestString); - expect(result, {"jsonrpc": "2.0", "result": null, "id": "some id"}); + expect(result.data, {"jsonrpc": "2.0", "result": null, "id": "some id"}); }); test("JsonRPC.request fails due to SocketException", () async { diff --git a/test/models/transactions_model_test.dart b/test/models/transactions_model_test.dart index 1e19f769a..7547d03fe 100644 --- a/test/models/transactions_model_test.dart +++ b/test/models/transactions_model_test.dart @@ -143,7 +143,7 @@ void main() { ] }); expect(txChunk.toString(), - "timestamp: 993260735 transactions: [\n {txid: txid, type: txType, subType: mint, value: 10, fee: 1, height: 1, confirm: true, confirmations: 1, address: address, timestamp: 1876352482, worthNow: 1, inputs: [], slateid: slateId } \n]"); + "timestamp: 993260735 transactions: [\n {txid: txid, type: txType, subType: mint, value: 10, fee: 1, height: 1, confirm: true, confirmations: 1, address: address, timestamp: 1876352482, worthNow: 1, inputs: [], slateid: slateId, numberOfMessages: null } \n]"); }); }); diff --git a/test/models/type_adapter_tests/lelantus_coin_adapter_test.mocks.dart b/test/models/type_adapter_tests/lelantus_coin_adapter_test.mocks.dart index 37a40b380..a77b63d95 100644 --- a/test/models/type_adapter_tests/lelantus_coin_adapter_test.mocks.dart +++ b/test/models/type_adapter_tests/lelantus_coin_adapter_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/models/type_adapter_tests/lelantus_coin_adapter_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:convert' as _i5; import 'dart:typed_data' as _i4; diff --git a/test/models/type_adapter_tests/transactions_model_adapter_test.mocks.dart b/test/models/type_adapter_tests/transactions_model_adapter_test.mocks.dart index 1a8eb42f8..fce3b87a7 100644 --- a/test/models/type_adapter_tests/transactions_model_adapter_test.mocks.dart +++ b/test/models/type_adapter_tests/transactions_model_adapter_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/models/type_adapter_tests/transactions_model_adapter_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:convert' as _i5; import 'dart:typed_data' as _i4; diff --git a/test/models/type_adapter_tests/utxo_model_adapter_test.mocks.dart b/test/models/type_adapter_tests/utxo_model_adapter_test.mocks.dart index af621edf1..7ac8384e6 100644 --- a/test/models/type_adapter_tests/utxo_model_adapter_test.mocks.dart +++ b/test/models/type_adapter_tests/utxo_model_adapter_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/models/type_adapter_tests/utxo_model_adapter_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:convert' as _i5; import 'dart:typed_data' as _i4; diff --git a/test/notifications/notification_card_test.mocks.dart b/test/notifications/notification_card_test.mocks.dart index 7f60b97c9..30790fd20 100644 --- a/test/notifications/notification_card_test.mocks.dart +++ b/test/notifications/notification_card_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/notifications/notification_card_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:typed_data' as _i6; @@ -83,6 +85,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/pages/send_view/send_view_test.dart b/test/pages/send_view/send_view_test.dart index 0759110e0..1747ddc17 100644 --- a/test/pages/send_view/send_view_test.dart +++ b/test/pages/send_view/send_view_test.dart @@ -16,6 +16,7 @@ import 'package:stackwallet/services/wallets.dart'; import 'package:stackwallet/services/wallets_service.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_service.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/prefs.dart'; @@ -63,6 +64,9 @@ void main() { ); when(mockPrefs.currency).thenAnswer((_) => "USD"); when(mockPrefs.enableCoinControl).thenAnswer((_) => false); + when(mockPrefs.amountUnit(Coin.bitcoin)).thenAnswer( + (_) => AmountUnit.normal, + ); when(wallet.validateAddress("send to address")) .thenAnswer((realInvocation) => true); @@ -131,6 +135,9 @@ void main() { when(mockLocaleService.locale).thenAnswer((_) => "en_US"); when(mockPrefs.currency).thenAnswer((_) => "USD"); when(mockPrefs.enableCoinControl).thenAnswer((_) => false); + when(mockPrefs.amountUnit(Coin.bitcoin)).thenAnswer( + (_) => AmountUnit.normal, + ); when(wallet.validateAddress("send to address")) .thenAnswer((realInvocation) => false); when(mockThemeService.getTheme(themeId: "light")).thenAnswer( diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index 8a33fcb87..631b28ca5 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/pages/send_view/send_view_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i23; import 'dart:typed_data' as _i30; @@ -33,6 +35,7 @@ import 'package:stackwallet/services/wallets.dart' as _i21; import 'package:stackwallet/services/wallets_service.dart' as _i2; import 'package:stackwallet/themes/theme_service.dart' as _i32; import 'package:stackwallet/utilities/amount/amount.dart' as _i15; +import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i36; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i35; import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i22; import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i28; @@ -337,9 +340,8 @@ class MockWallets extends _i1.Mock implements _i21.Wallets { #getManagerProvidersByCoin, [], ), - returnValue: < - _i16.Tuple2<_i22.Coin, - List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + returnValue: <_i16.Tuple2<_i22.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< _i16.Tuple2<_i22.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @@ -985,7 +987,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override _i23.Future> get utxos => (super.noSuchMethod( @@ -1734,14 +1736,12 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { required int Function({ required int feeRatePerKB, required int vSize, - })? - estimateTxFee, + })? estimateTxFee, required _i23.Future> Function({ required String address, required _i15.Amount amount, Map? args, - })? - prepareSend, + })? prepareSend, required _i23.Future Function({required String address})? getTxCount, required _i23.Future> Function(List<_i18.UTXO>)? fetchBuildTxData, @@ -2278,6 +2278,15 @@ class MockThemeService extends _i1.Mock implements _i32.ThemeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override _i23.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( @@ -2714,6 +2723,54 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + _i36.AmountUnit amountUnit(_i22.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #amountUnit, + [coin], + ), + returnValue: _i36.AmountUnit.normal, + ) as _i36.AmountUnit); + @override + void updateAmountUnit({ + required _i22.Coin? coin, + required _i36.AmountUnit? amountUnit, + }) => + super.noSuchMethod( + Invocation.method( + #updateAmountUnit, + [], + { + #coin: coin, + #amountUnit: amountUnit, + }, + ), + returnValueForMissingStub: null, + ); + @override + int maxDecimals(_i22.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #maxDecimals, + [coin], + ), + returnValue: 0, + ) as int); + @override + void updateMaxDecimals({ + required _i22.Coin? coin, + required int? maxDecimals, + }) => + super.noSuchMethod( + Invocation.method( + #updateMaxDecimals, + [], + { + #coin: coin, + #maxDecimals: maxDecimals, + }, + ), + returnValueForMissingStub: null, + ); + @override void addListener(_i25.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, @@ -2780,7 +2837,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override bool get isRefreshing => (super.noSuchMethod( @@ -3148,7 +3205,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/price_test.dart b/test/price_test.dart index cc7427489..f611c5450 100644 --- a/test/price_test.dart +++ b/test/price_test.dart @@ -28,7 +28,7 @@ void main() { Uri.parse( "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids" "=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,bitcoin-cash" - ",namecoin,wownero,ethereum,particl&order=market_cap_desc&per_page=50" + ",namecoin,wownero,ethereum,particl,nano,banano&order=market_cap_desc&per_page=50" "&page=1&sparkline=false"), headers: { 'Content-Type': 'application/json' @@ -99,22 +99,33 @@ void main() { expect( price.toString(), - '{Coin.bitcoin: [1, 0.0], Coin.bitcoincash: [0, 0.0], ' + '{' + 'Coin.bitcoin: [1, 0.0], ' + 'Coin.monero: [0.00717236, -0.77656], ' + 'Coin.banano: [0, 0.0], ' + 'Coin.bitcoincash: [0, 0.0], ' 'Coin.dogecoin: [0.00000315, -2.68533], ' - 'Coin.eCash: [0, 0.0], Coin.epicCash: [0.00002803, 7.27524], ' + 'Coin.eCash: [0, 0.0], ' + 'Coin.epicCash: [0.00002803, 7.27524], ' 'Coin.ethereum: [0, 0.0], ' - 'Coin.firo: [0.0001096, -0.89304], Coin.litecoin: [0, 0.0], ' - 'Coin.monero: [0.00717236, -0.77656], Coin.namecoin: [0, 0.0], ' - 'Coin.particl: [0, 0.0], Coin.wownero: [0, 0.0], ' - 'Coin.bitcoinTestNet: [0, 0.0],' - ' Coin.litecoinTestNet: [0, 0.0], Coin.bitcoincashTestnet: [0, 0.0], ' - 'Coin.dogecoinTestNet: [0, 0.0], Coin.firoTestNet: [0, 0.0]}', + 'Coin.firo: [0.0001096, -0.89304], ' + 'Coin.litecoin: [0, 0.0], ' + 'Coin.namecoin: [0, 0.0], ' + 'Coin.nano: [0, 0.0], ' + 'Coin.particl: [0, 0.0], ' + 'Coin.wownero: [0, 0.0], ' + 'Coin.bitcoinTestNet: [0, 0.0], ' + 'Coin.bitcoincashTestnet: [0, 0.0], ' + 'Coin.dogecoinTestNet: [0, 0.0], ' + 'Coin.firoTestNet: [0, 0.0], ' + 'Coin.litecoinTestNet: [0, 0.0]' + '}', ); verify(client.get( Uri.parse( "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc" "&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," - "bitcoin-cash,namecoin,wownero,ethereum,particl" + "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano" "&order=market_cap_desc&per_page=50&page=1&sparkline=false", ), headers: {'Content-Type': 'application/json'})).called(1); @@ -129,7 +140,7 @@ void main() { Uri.parse( "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&" "ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," - "bitcoin-cash,namecoin,wownero,ethereum,particl" + "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano" "&order=market_cap_desc&per_page=50&page=1&sparkline=false"), headers: { 'Content-Type': 'application/json' @@ -204,22 +215,36 @@ void main() { await priceAPI.getPricesAnd24hChange(baseCurrency: "btc"); expect( - cachedPrice.toString(), - '{Coin.bitcoin: [1, 0.0], Coin.bitcoincash: [0, 0.0],' - ' Coin.dogecoin: [0.00000315, -2.68533], Coin.eCash: [0, 0.0], Coin.epicCash: [0.00002803, 7.27524],' - ' Coin.ethereum: [0, 0.0], Coin.firo: [0.0001096, -0.89304], ' - 'Coin.litecoin: [0, 0.0], Coin.monero: [0.00717236, -0.77656], ' - 'Coin.namecoin: [0, 0.0], Coin.particl: [0, 0.0], Coin.wownero: [0, 0.0], ' - 'Coin.bitcoinTestNet: [0, 0.0], Coin.litecoinTestNet: [0, 0.0], ' - 'Coin.bitcoincashTestnet: [0, 0.0], Coin.dogecoinTestNet: [0, 0.0], ' - 'Coin.firoTestNet: [0, 0.0]}'); + cachedPrice.toString(), + '{' + 'Coin.bitcoin: [1, 0.0], ' + 'Coin.monero: [0.00717236, -0.77656], ' + 'Coin.banano: [0, 0.0], ' + 'Coin.bitcoincash: [0, 0.0], ' + 'Coin.dogecoin: [0.00000315, -2.68533], ' + 'Coin.eCash: [0, 0.0], ' + 'Coin.epicCash: [0.00002803, 7.27524], ' + 'Coin.ethereum: [0, 0.0], ' + 'Coin.firo: [0.0001096, -0.89304], ' + 'Coin.litecoin: [0, 0.0], ' + 'Coin.namecoin: [0, 0.0], ' + 'Coin.nano: [0, 0.0], ' + 'Coin.particl: [0, 0.0], ' + 'Coin.wownero: [0, 0.0], ' + 'Coin.bitcoinTestNet: [0, 0.0], ' + 'Coin.bitcoincashTestnet: [0, 0.0], ' + 'Coin.dogecoinTestNet: [0, 0.0], ' + 'Coin.firoTestNet: [0, 0.0], ' + 'Coin.litecoinTestNet: [0, 0.0]' + '}', + ); // verify only called once during filling of cache verify(client.get( Uri.parse( "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids" "=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," - "bitcoin-cash,namecoin,wownero,ethereum,particl" + "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano" "&order=market_cap_desc&per_page=50&page=1&sparkline=false"), headers: {'Content-Type': 'application/json'})).called(1); @@ -233,7 +258,7 @@ void main() { Uri.parse( "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc" "&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," - "bitcoin-cash,namecoin,wownero,ethereum,particl" + "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano" "&order=market_cap_desc&per_page=50&page=1&sparkline=false"), headers: { 'Content-Type': 'application/json' @@ -304,14 +329,29 @@ void main() { final price = await priceAPI.getPricesAnd24hChange(baseCurrency: "btc"); expect( - price.toString(), - '{Coin.bitcoin: [0, 0.0], Coin.bitcoincash: [0, 0.0], Coin.dogecoin: ' - '[0, 0.0], Coin.eCash: [0, 0.0], Coin.epicCash: [0, 0.0], Coin.ethereum: [0, 0.0],' - ' Coin.firo: [0, 0.0], Coin.litecoin: [0, 0.0], Coin.monero: [0, 0.0],' - ' Coin.namecoin: [0, 0.0], Coin.particl: [0, 0.0], Coin.wownero: [0, 0.0],' - ' Coin.bitcoinTestNet: [0, 0.0], Coin.litecoinTestNet: [0, 0.0], ' - 'Coin.bitcoincashTestnet: [0, 0.0], Coin.dogecoinTestNet: [0, 0.0],' - ' Coin.firoTestNet: [0, 0.0]}'); + price.toString(), + '{' + 'Coin.bitcoin: [0, 0.0], ' + 'Coin.monero: [0, 0.0], ' + 'Coin.banano: [0, 0.0], ' + 'Coin.bitcoincash: [0, 0.0], ' + 'Coin.dogecoin: [0, 0.0], ' + 'Coin.eCash: [0, 0.0], ' + 'Coin.epicCash: [0, 0.0], ' + 'Coin.ethereum: [0, 0.0], ' + 'Coin.firo: [0, 0.0], ' + 'Coin.litecoin: [0, 0.0], ' + 'Coin.namecoin: [0, 0.0], ' + 'Coin.nano: [0, 0.0], ' + 'Coin.particl: [0, 0.0], ' + 'Coin.wownero: [0, 0.0], ' + 'Coin.bitcoinTestNet: [0, 0.0], ' + 'Coin.bitcoincashTestnet: [0, 0.0], ' + 'Coin.dogecoinTestNet: [0, 0.0], ' + 'Coin.firoTestNet: [0, 0.0], ' + 'Coin.litecoinTestNet: [0, 0.0]' + '}', + ); }); test("no internet available", () async { @@ -321,7 +361,7 @@ void main() { Uri.parse( "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc" "&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," - "bitcoin-cash,namecoin,wownero,ethereum,particl" + "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano" "&order=market_cap_desc&per_page=50&page=1&sparkline=false"), headers: { 'Content-Type': 'application/json' @@ -334,14 +374,29 @@ void main() { final price = await priceAPI.getPricesAnd24hChange(baseCurrency: "btc"); expect( - price.toString(), - '{Coin.bitcoin: [0, 0.0], Coin.bitcoincash: [0, 0.0], ' - 'Coin.dogecoin: [0, 0.0], Coin.eCash: [0, 0.0], Coin.epicCash: [0, 0.0], Coin.ethereum: [0, 0.0],' - ' Coin.firo: [0, 0.0], Coin.litecoin: [0, 0.0], Coin.monero: [0, 0.0],' - ' Coin.namecoin: [0, 0.0], Coin.particl: [0, 0.0], Coin.wownero: [0, 0.0],' - ' Coin.bitcoinTestNet: [0, 0.0], Coin.litecoinTestNet: [0, 0.0], ' - 'Coin.bitcoincashTestnet: [0, 0.0], Coin.dogecoinTestNet: [0, 0.0], ' - 'Coin.firoTestNet: [0, 0.0]}'); + price.toString(), + '{' + 'Coin.bitcoin: [0, 0.0], ' + 'Coin.monero: [0, 0.0], ' + 'Coin.banano: [0, 0.0], ' + 'Coin.bitcoincash: [0, 0.0], ' + 'Coin.dogecoin: [0, 0.0], ' + 'Coin.eCash: [0, 0.0], ' + 'Coin.epicCash: [0, 0.0], ' + 'Coin.ethereum: [0, 0.0], ' + 'Coin.firo: [0, 0.0], ' + 'Coin.litecoin: [0, 0.0], ' + 'Coin.namecoin: [0, 0.0], ' + 'Coin.nano: [0, 0.0], ' + 'Coin.particl: [0, 0.0], ' + 'Coin.wownero: [0, 0.0], ' + 'Coin.bitcoinTestNet: [0, 0.0], ' + 'Coin.bitcoincashTestnet: [0, 0.0], ' + 'Coin.dogecoinTestNet: [0, 0.0], ' + 'Coin.firoTestNet: [0, 0.0], ' + 'Coin.litecoinTestNet: [0, 0.0]' + '}', + ); }); tearDown(() async { diff --git a/test/price_test.mocks.dart b/test/price_test.mocks.dart index 3850f3b75..09b4af616 100644 --- a/test/price_test.mocks.dart +++ b/test/price_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/price_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; import 'dart:convert' as _i4; diff --git a/test/screen_tests/address_book_view/address_book_view_screen_test.mocks.dart b/test/screen_tests/address_book_view/address_book_view_screen_test.mocks.dart index 68c48dd34..5504140a9 100644 --- a/test/screen_tests/address_book_view/address_book_view_screen_test.mocks.dart +++ b/test/screen_tests/address_book_view/address_book_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/address_book_view/address_book_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; import 'dart:ui' as _i5; diff --git a/test/screen_tests/address_book_view/subviews/add_address_book_view_screen_test.mocks.dart b/test/screen_tests/address_book_view/subviews/add_address_book_view_screen_test.mocks.dart index 80a28f732..343c90563 100644 --- a/test/screen_tests/address_book_view/subviews/add_address_book_view_screen_test.mocks.dart +++ b/test/screen_tests/address_book_view/subviews/add_address_book_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/address_book_view/subviews/add_address_book_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i9; import 'dart:ui' as _i11; @@ -267,7 +269,7 @@ class MockManager extends _i1.Mock implements _i12.Manager { @override _i13.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i13.Coin.bitcoin, + returnValue: _i13.Coin.banano, ) as _i13.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/address_book_view/subviews/address_book_entry_details_view_screen_test.mocks.dart b/test/screen_tests/address_book_view/subviews/address_book_entry_details_view_screen_test.mocks.dart index 935ea5526..c32b1051a 100644 --- a/test/screen_tests/address_book_view/subviews/address_book_entry_details_view_screen_test.mocks.dart +++ b/test/screen_tests/address_book_view/subviews/address_book_entry_details_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/address_book_view/subviews/address_book_entry_details_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i9; @@ -228,7 +230,7 @@ class MockManager extends _i1.Mock implements _i10.Manager { @override _i11.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i11.Coin.bitcoin, + returnValue: _i11.Coin.banano, ) as _i11.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/address_book_view/subviews/edit_address_book_entry_view_screen_test.mocks.dart b/test/screen_tests/address_book_view/subviews/edit_address_book_entry_view_screen_test.mocks.dart index 8874682ae..8b2e70ac8 100644 --- a/test/screen_tests/address_book_view/subviews/edit_address_book_entry_view_screen_test.mocks.dart +++ b/test/screen_tests/address_book_view/subviews/edit_address_book_entry_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/address_book_view/subviews/edit_address_book_entry_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i9; @@ -226,7 +228,7 @@ class MockManager extends _i1.Mock implements _i10.Manager { @override _i11.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i11.Coin.bitcoin, + returnValue: _i11.Coin.banano, ) as _i11.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/exchange/exchange_view_test.mocks.dart b/test/screen_tests/exchange/exchange_view_test.mocks.dart index e51fd926f..bf61af30c 100644 --- a/test/screen_tests/exchange/exchange_view_test.mocks.dart +++ b/test/screen_tests/exchange/exchange_view_test.mocks.dart @@ -1,35 +1,40 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/exchange/exchange_view_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i6; -import 'dart:ui' as _i7; +import 'dart:ui' as _i9; -import 'package:decimal/decimal.dart' as _i14; -import 'package:http/http.dart' as _i12; +import 'package:decimal/decimal.dart' as _i16; +import 'package:http/http.dart' as _i14; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart' - as _i17; -import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart' as _i19; +import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart' + as _i21; import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart' - as _i20; + as _i22; import 'package:stackwallet/models/exchange/response_objects/estimate.dart' - as _i16; -import 'package:stackwallet/models/exchange/response_objects/fixed_rate_market.dart' as _i18; +import 'package:stackwallet/models/exchange/response_objects/fixed_rate_market.dart' + as _i20; import 'package:stackwallet/models/exchange/response_objects/range.dart' - as _i15; -import 'package:stackwallet/models/exchange/response_objects/trade.dart' as _i9; -import 'package:stackwallet/models/isar/exchange_cache/currency.dart' as _i13; -import 'package:stackwallet/models/isar/exchange_cache/pair.dart' as _i21; -import 'package:stackwallet/services/exchange/change_now/change_now_api.dart' + as _i17; +import 'package:stackwallet/models/exchange/response_objects/trade.dart' as _i11; +import 'package:stackwallet/models/isar/exchange_cache/currency.dart' as _i15; +import 'package:stackwallet/models/isar/exchange_cache/pair.dart' as _i23; +import 'package:stackwallet/services/exchange/change_now/change_now_api.dart' + as _i13; import 'package:stackwallet/services/exchange/exchange_response.dart' as _i2; -import 'package:stackwallet/services/trade_notes_service.dart' as _i10; -import 'package:stackwallet/services/trade_service.dart' as _i8; +import 'package:stackwallet/services/trade_notes_service.dart' as _i12; +import 'package:stackwallet/services/trade_service.dart' as _i10; +import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i7; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i5; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8; import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i4; import 'package:stackwallet/utilities/prefs.dart' as _i3; @@ -452,7 +457,55 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs { returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); @override - void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( + _i7.AmountUnit amountUnit(_i8.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #amountUnit, + [coin], + ), + returnValue: _i7.AmountUnit.normal, + ) as _i7.AmountUnit); + @override + void updateAmountUnit({ + required _i8.Coin? coin, + required _i7.AmountUnit? amountUnit, + }) => + super.noSuchMethod( + Invocation.method( + #updateAmountUnit, + [], + { + #coin: coin, + #amountUnit: amountUnit, + }, + ), + returnValueForMissingStub: null, + ); + @override + int maxDecimals(_i8.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #maxDecimals, + [coin], + ), + returnValue: 0, + ) as int); + @override + void updateMaxDecimals({ + required _i8.Coin? coin, + required int? maxDecimals, + }) => + super.noSuchMethod( + Invocation.method( + #updateMaxDecimals, + [], + { + #coin: coin, + #maxDecimals: maxDecimals, + }, + ), + returnValueForMissingStub: null, + ); + @override + void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -460,7 +513,7 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs { returnValueForMissingStub: null, ); @override - void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -488,29 +541,29 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs { /// A class which mocks [TradesService]. /// /// See the documentation for Mockito's code generation for more information. -class MockTradesService extends _i1.Mock implements _i8.TradesService { +class MockTradesService extends _i1.Mock implements _i10.TradesService { MockTradesService() { _i1.throwOnMissingStub(this); } @override - List<_i9.Trade> get trades => (super.noSuchMethod( + List<_i11.Trade> get trades => (super.noSuchMethod( Invocation.getter(#trades), - returnValue: <_i9.Trade>[], - ) as List<_i9.Trade>); + returnValue: <_i11.Trade>[], + ) as List<_i11.Trade>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i9.Trade? get(String? tradeId) => (super.noSuchMethod(Invocation.method( + _i11.Trade? get(String? tradeId) => (super.noSuchMethod(Invocation.method( #get, [tradeId], - )) as _i9.Trade?); + )) as _i11.Trade?); @override _i6.Future add({ - required _i9.Trade? trade, + required _i11.Trade? trade, required bool? shouldNotifyListeners, }) => (super.noSuchMethod( @@ -527,7 +580,7 @@ class MockTradesService extends _i1.Mock implements _i8.TradesService { ) as _i6.Future); @override _i6.Future edit({ - required _i9.Trade? trade, + required _i11.Trade? trade, required bool? shouldNotifyListeners, }) => (super.noSuchMethod( @@ -544,7 +597,7 @@ class MockTradesService extends _i1.Mock implements _i8.TradesService { ) as _i6.Future); @override _i6.Future delete({ - required _i9.Trade? trade, + required _i11.Trade? trade, required bool? shouldNotifyListeners, }) => (super.noSuchMethod( @@ -577,7 +630,7 @@ class MockTradesService extends _i1.Mock implements _i8.TradesService { returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); @override - void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -585,7 +638,7 @@ class MockTradesService extends _i1.Mock implements _i8.TradesService { returnValueForMissingStub: null, ); @override - void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -613,7 +666,7 @@ class MockTradesService extends _i1.Mock implements _i8.TradesService { /// A class which mocks [TradeNotesService]. /// /// See the documentation for Mockito's code generation for more information. -class MockTradeNotesService extends _i1.Mock implements _i10.TradeNotesService { +class MockTradeNotesService extends _i1.Mock implements _i12.TradeNotesService { MockTradeNotesService() { _i1.throwOnMissingStub(this); } @@ -665,7 +718,7 @@ class MockTradeNotesService extends _i1.Mock implements _i10.TradeNotesService { returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); @override - void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -673,7 +726,7 @@ class MockTradeNotesService extends _i1.Mock implements _i10.TradeNotesService { returnValueForMissingStub: null, ); @override - void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -701,13 +754,13 @@ class MockTradeNotesService extends _i1.Mock implements _i10.TradeNotesService { /// A class which mocks [ChangeNowAPI]. /// /// See the documentation for Mockito's code generation for more information. -class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { +class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI { MockChangeNowAPI() { _i1.throwOnMissingStub(this); } @override - set client(_i12.Client? _client) => super.noSuchMethod( + set client(_i14.Client? _client) => super.noSuchMethod( Invocation.setter( #client, _client, @@ -715,7 +768,7 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { returnValueForMissingStub: null, ); @override - _i6.Future<_i2.ExchangeResponse>> getAvailableCurrencies({ + _i6.Future<_i2.ExchangeResponse>> getAvailableCurrencies({ bool? fixedRate, bool? active, }) => @@ -729,8 +782,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), returnValue: - _i6.Future<_i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>( + _i6.Future<_i2.ExchangeResponse>>.value( + _FakeExchangeResponse_0>( this, Invocation.method( #getAvailableCurrencies, @@ -741,26 +794,26 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse>>); + ) as _i6.Future<_i2.ExchangeResponse>>); @override - _i6.Future<_i2.ExchangeResponse>> getCurrenciesV2() => + _i6.Future<_i2.ExchangeResponse>> getCurrenciesV2() => (super.noSuchMethod( Invocation.method( #getCurrenciesV2, [], ), returnValue: - _i6.Future<_i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>( + _i6.Future<_i2.ExchangeResponse>>.value( + _FakeExchangeResponse_0>( this, Invocation.method( #getCurrenciesV2, [], ), )), - ) as _i6.Future<_i2.ExchangeResponse>>); + ) as _i6.Future<_i2.ExchangeResponse>>); @override - _i6.Future<_i2.ExchangeResponse>> getPairedCurrencies({ + _i6.Future<_i2.ExchangeResponse>> getPairedCurrencies({ required String? ticker, bool? fixedRate, }) => @@ -774,8 +827,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), returnValue: - _i6.Future<_i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>( + _i6.Future<_i2.ExchangeResponse>>.value( + _FakeExchangeResponse_0>( this, Invocation.method( #getPairedCurrencies, @@ -786,9 +839,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse>>); + ) as _i6.Future<_i2.ExchangeResponse>>); @override - _i6.Future<_i2.ExchangeResponse<_i14.Decimal>> getMinimalExchangeAmount({ + _i6.Future<_i2.ExchangeResponse<_i16.Decimal>> getMinimalExchangeAmount({ required String? fromTicker, required String? toTicker, String? apiKey, @@ -803,8 +856,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { #apiKey: apiKey, }, ), - returnValue: _i6.Future<_i2.ExchangeResponse<_i14.Decimal>>.value( - _FakeExchangeResponse_0<_i14.Decimal>( + returnValue: _i6.Future<_i2.ExchangeResponse<_i16.Decimal>>.value( + _FakeExchangeResponse_0<_i16.Decimal>( this, Invocation.method( #getMinimalExchangeAmount, @@ -816,9 +869,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse<_i14.Decimal>>); + ) as _i6.Future<_i2.ExchangeResponse<_i16.Decimal>>); @override - _i6.Future<_i2.ExchangeResponse<_i15.Range>> getRange({ + _i6.Future<_i2.ExchangeResponse<_i17.Range>> getRange({ required String? fromTicker, required String? toTicker, required bool? isFixedRate, @@ -835,8 +888,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { #apiKey: apiKey, }, ), - returnValue: _i6.Future<_i2.ExchangeResponse<_i15.Range>>.value( - _FakeExchangeResponse_0<_i15.Range>( + returnValue: _i6.Future<_i2.ExchangeResponse<_i17.Range>>.value( + _FakeExchangeResponse_0<_i17.Range>( this, Invocation.method( #getRange, @@ -849,12 +902,12 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse<_i15.Range>>); + ) as _i6.Future<_i2.ExchangeResponse<_i17.Range>>); @override - _i6.Future<_i2.ExchangeResponse<_i16.Estimate>> getEstimatedExchangeAmount({ + _i6.Future<_i2.ExchangeResponse<_i18.Estimate>> getEstimatedExchangeAmount({ required String? fromTicker, required String? toTicker, - required _i14.Decimal? fromAmount, + required _i16.Decimal? fromAmount, String? apiKey, }) => (super.noSuchMethod( @@ -868,8 +921,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { #apiKey: apiKey, }, ), - returnValue: _i6.Future<_i2.ExchangeResponse<_i16.Estimate>>.value( - _FakeExchangeResponse_0<_i16.Estimate>( + returnValue: _i6.Future<_i2.ExchangeResponse<_i18.Estimate>>.value( + _FakeExchangeResponse_0<_i18.Estimate>( this, Invocation.method( #getEstimatedExchangeAmount, @@ -882,13 +935,13 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse<_i16.Estimate>>); + ) as _i6.Future<_i2.ExchangeResponse<_i18.Estimate>>); @override - _i6.Future<_i2.ExchangeResponse<_i16.Estimate>> + _i6.Future<_i2.ExchangeResponse<_i18.Estimate>> getEstimatedExchangeAmountFixedRate({ required String? fromTicker, required String? toTicker, - required _i14.Decimal? fromAmount, + required _i16.Decimal? fromAmount, required bool? reversed, bool? useRateId = true, String? apiKey, @@ -906,8 +959,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { #apiKey: apiKey, }, ), - returnValue: _i6.Future<_i2.ExchangeResponse<_i16.Estimate>>.value( - _FakeExchangeResponse_0<_i16.Estimate>( + returnValue: _i6.Future<_i2.ExchangeResponse<_i18.Estimate>>.value( + _FakeExchangeResponse_0<_i18.Estimate>( this, Invocation.method( #getEstimatedExchangeAmountFixedRate, @@ -922,17 +975,17 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse<_i16.Estimate>>); + ) as _i6.Future<_i2.ExchangeResponse<_i18.Estimate>>); @override - _i6.Future<_i2.ExchangeResponse<_i17.CNExchangeEstimate>> + _i6.Future<_i2.ExchangeResponse<_i19.CNExchangeEstimate>> getEstimatedExchangeAmountV2({ required String? fromTicker, required String? toTicker, - required _i17.CNEstimateType? fromOrTo, - required _i14.Decimal? amount, + required _i19.CNEstimateType? fromOrTo, + required _i16.Decimal? amount, String? fromNetwork, String? toNetwork, - _i17.CNFlowType? flow = _i17.CNFlowType.standard, + _i19.CNFlowType? flow = _i19.CNFlowType.standard, String? apiKey, }) => (super.noSuchMethod( @@ -951,8 +1004,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), returnValue: - _i6.Future<_i2.ExchangeResponse<_i17.CNExchangeEstimate>>.value( - _FakeExchangeResponse_0<_i17.CNExchangeEstimate>( + _i6.Future<_i2.ExchangeResponse<_i19.CNExchangeEstimate>>.value( + _FakeExchangeResponse_0<_i19.CNExchangeEstimate>( this, Invocation.method( #getEstimatedExchangeAmountV2, @@ -969,9 +1022,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse<_i17.CNExchangeEstimate>>); + ) as _i6.Future<_i2.ExchangeResponse<_i19.CNExchangeEstimate>>); @override - _i6.Future<_i2.ExchangeResponse>> + _i6.Future<_i2.ExchangeResponse>> getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod( Invocation.method( #getAvailableFixedRateMarkets, @@ -979,8 +1032,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { {#apiKey: apiKey}, ), returnValue: _i6.Future< - _i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>( + _i2.ExchangeResponse>>.value( + _FakeExchangeResponse_0>( this, Invocation.method( #getAvailableFixedRateMarkets, @@ -988,14 +1041,14 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { {#apiKey: apiKey}, ), )), - ) as _i6.Future<_i2.ExchangeResponse>>); + ) as _i6.Future<_i2.ExchangeResponse>>); @override - _i6.Future<_i2.ExchangeResponse<_i19.ExchangeTransaction>> + _i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>> createStandardExchangeTransaction({ required String? fromTicker, required String? toTicker, required String? receivingAddress, - required _i14.Decimal? amount, + required _i16.Decimal? amount, String? extraId = r'', String? userId = r'', String? contactEmail = r'', @@ -1021,8 +1074,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), returnValue: _i6.Future< - _i2.ExchangeResponse<_i19.ExchangeTransaction>>.value( - _FakeExchangeResponse_0<_i19.ExchangeTransaction>( + _i2.ExchangeResponse<_i21.ExchangeTransaction>>.value( + _FakeExchangeResponse_0<_i21.ExchangeTransaction>( this, Invocation.method( #createStandardExchangeTransaction, @@ -1041,14 +1094,14 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse<_i19.ExchangeTransaction>>); + ) as _i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>); @override - _i6.Future<_i2.ExchangeResponse<_i19.ExchangeTransaction>> + _i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>> createFixedRateExchangeTransaction({ required String? fromTicker, required String? toTicker, required String? receivingAddress, - required _i14.Decimal? amount, + required _i16.Decimal? amount, required String? rateId, required bool? reversed, String? extraId = r'', @@ -1078,8 +1131,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), returnValue: _i6.Future< - _i2.ExchangeResponse<_i19.ExchangeTransaction>>.value( - _FakeExchangeResponse_0<_i19.ExchangeTransaction>( + _i2.ExchangeResponse<_i21.ExchangeTransaction>>.value( + _FakeExchangeResponse_0<_i21.ExchangeTransaction>( this, Invocation.method( #createFixedRateExchangeTransaction, @@ -1100,9 +1153,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), )), - ) as _i6.Future<_i2.ExchangeResponse<_i19.ExchangeTransaction>>); + ) as _i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>); @override - _i6.Future<_i2.ExchangeResponse<_i20.ExchangeTransactionStatus>> + _i6.Future<_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>> getTransactionStatus({ required String? id, String? apiKey, @@ -1117,8 +1170,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { }, ), returnValue: _i6.Future< - _i2.ExchangeResponse<_i20.ExchangeTransactionStatus>>.value( - _FakeExchangeResponse_0<_i20.ExchangeTransactionStatus>( + _i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>.value( + _FakeExchangeResponse_0<_i22.ExchangeTransactionStatus>( this, Invocation.method( #getTransactionStatus, @@ -1130,9 +1183,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { ), )), ) as _i6 - .Future<_i2.ExchangeResponse<_i20.ExchangeTransactionStatus>>); + .Future<_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>); @override - _i6.Future<_i2.ExchangeResponse>> + _i6.Future<_i2.ExchangeResponse>> getAvailableFloatingRatePairs({bool? includePartners = false}) => (super.noSuchMethod( Invocation.method( @@ -1141,8 +1194,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { {#includePartners: includePartners}, ), returnValue: - _i6.Future<_i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>( + _i6.Future<_i2.ExchangeResponse>>.value( + _FakeExchangeResponse_0>( this, Invocation.method( #getAvailableFloatingRatePairs, @@ -1150,5 +1203,5 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { {#includePartners: includePartners}, ), )), - ) as _i6.Future<_i2.ExchangeResponse>>); + ) as _i6.Future<_i2.ExchangeResponse>>); } diff --git a/test/screen_tests/lockscreen_view_screen_test.mocks.dart b/test/screen_tests/lockscreen_view_screen_test.mocks.dart index acdd22a94..af9c67151 100644 --- a/test/screen_tests/lockscreen_view_screen_test.mocks.dart +++ b/test/screen_tests/lockscreen_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/lockscreen_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -546,7 +548,7 @@ class MockManager extends _i1.Mock implements _i13.Manager { @override _i9.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i9.Coin.bitcoin, + returnValue: _i9.Coin.banano, ) as _i9.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/main_view_tests/main_view_screen_testA_test.mocks.dart b/test/screen_tests/main_view_tests/main_view_screen_testA_test.mocks.dart index 23054bf14..150f48ffa 100644 --- a/test/screen_tests/main_view_tests/main_view_screen_testA_test.mocks.dart +++ b/test/screen_tests/main_view_tests/main_view_screen_testA_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testA_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; import 'dart:ui' as _i9; @@ -333,7 +335,7 @@ class MockManager extends _i1.Mock implements _i10.Manager { @override _i8.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i8.Coin.bitcoin, + returnValue: _i8.Coin.banano, ) as _i8.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/main_view_tests/main_view_screen_testB_test.mocks.dart b/test/screen_tests/main_view_tests/main_view_screen_testB_test.mocks.dart index d511d0e22..0fcebe54f 100644 --- a/test/screen_tests/main_view_tests/main_view_screen_testB_test.mocks.dart +++ b/test/screen_tests/main_view_tests/main_view_screen_testB_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testB_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; import 'dart:ui' as _i9; @@ -333,7 +335,7 @@ class MockManager extends _i1.Mock implements _i10.Manager { @override _i8.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i8.Coin.bitcoin, + returnValue: _i8.Coin.banano, ) as _i8.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/main_view_tests/main_view_screen_testC_test.mocks.dart b/test/screen_tests/main_view_tests/main_view_screen_testC_test.mocks.dart index 7d1a3f0fc..b6796580c 100644 --- a/test/screen_tests/main_view_tests/main_view_screen_testC_test.mocks.dart +++ b/test/screen_tests/main_view_tests/main_view_screen_testC_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testC_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; import 'dart:ui' as _i9; @@ -333,7 +335,7 @@ class MockManager extends _i1.Mock implements _i10.Manager { @override _i8.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i8.Coin.bitcoin, + returnValue: _i8.Coin.banano, ) as _i8.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/onboarding/backup_key_view_screen_test.mocks.dart b/test/screen_tests/onboarding/backup_key_view_screen_test.mocks.dart index 7a0270532..c89b92af5 100644 --- a/test/screen_tests/onboarding/backup_key_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/backup_key_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/onboarding/backup_key_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -100,7 +102,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/onboarding/backup_key_warning_view_screen_test.mocks.dart b/test/screen_tests/onboarding/backup_key_warning_view_screen_test.mocks.dart index ff835bf64..96feb3c23 100644 --- a/test/screen_tests/onboarding/backup_key_warning_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/backup_key_warning_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/onboarding/backup_key_warning_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; import 'dart:ui' as _i9; @@ -331,7 +333,7 @@ class MockManager extends _i1.Mock implements _i10.Manager { @override _i8.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i8.Coin.bitcoin, + returnValue: _i8.Coin.banano, ) as _i8.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/onboarding/create_pin_view_screen_test.mocks.dart b/test/screen_tests/onboarding/create_pin_view_screen_test.mocks.dart index 796f4fd13..6be5c8995 100644 --- a/test/screen_tests/onboarding/create_pin_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/create_pin_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/onboarding/create_pin_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -546,7 +548,7 @@ class MockManager extends _i1.Mock implements _i13.Manager { @override _i9.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i9.Coin.bitcoin, + returnValue: _i9.Coin.banano, ) as _i9.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/onboarding/name_your_wallet_view_screen_test.mocks.dart b/test/screen_tests/onboarding/name_your_wallet_view_screen_test.mocks.dart index 65cd8fea1..809c10f8f 100644 --- a/test/screen_tests/onboarding/name_your_wallet_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/name_your_wallet_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/onboarding/name_your_wallet_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; import 'dart:ui' as _i5; diff --git a/test/screen_tests/onboarding/restore_wallet_view_screen_test.mocks.dart b/test/screen_tests/onboarding/restore_wallet_view_screen_test.mocks.dart index 6ea1fd2c5..d45ffc46d 100644 --- a/test/screen_tests/onboarding/restore_wallet_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/restore_wallet_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/onboarding/restore_wallet_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i9; import 'dart:ui' as _i12; @@ -387,7 +389,7 @@ class MockManager extends _i1.Mock implements _i13.Manager { @override _i11.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i11.Coin.bitcoin, + returnValue: _i11.Coin.banano, ) as _i11.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/onboarding/verify_backup_key_view_screen_test.mocks.dart b/test/screen_tests/onboarding/verify_backup_key_view_screen_test.mocks.dart index 8d2715174..3a50f9e38 100644 --- a/test/screen_tests/onboarding/verify_backup_key_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/verify_backup_key_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/onboarding/verify_backup_key_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -100,7 +102,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/settings_view/settings_subviews/currency_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/currency_view_screen_test.mocks.dart index 742d98a9c..6def2231b 100644 --- a/test/screen_tests/settings_view/settings_subviews/currency_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/currency_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/currency_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -100,7 +102,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/add_custom_node_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/add_custom_node_view_screen_test.mocks.dart index 0db6ce111..5acdfe1e5 100644 --- a/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/add_custom_node_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/add_custom_node_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/add_custom_node_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i9; import 'dart:ui' as _i11; @@ -315,7 +317,7 @@ class MockManager extends _i1.Mock implements _i12.Manager { @override _i10.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i10.Coin.bitcoin, + returnValue: _i10.Coin.banano, ) as _i10.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/node_details_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/node_details_view_screen_test.mocks.dart index 865ed2f88..5f1e62ae0 100644 --- a/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/node_details_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/node_details_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/network_settings_subviews/node_details_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i9; import 'dart:ui' as _i11; @@ -315,7 +317,7 @@ class MockManager extends _i1.Mock implements _i12.Manager { @override _i10.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i10.Coin.bitcoin, + returnValue: _i10.Coin.banano, ) as _i10.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/settings_view/settings_subviews/network_settings_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/network_settings_view_screen_test.mocks.dart index cf3ed4e9a..7aa96da8b 100644 --- a/test/screen_tests/settings_view/settings_subviews/network_settings_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/network_settings_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/network_settings_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:ui' as _i7; diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_backup_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_backup_view_screen_test.mocks.dart index 25a849858..bce263d8a 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_backup_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_backup_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_backup_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -100,7 +102,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.mocks.dart index 799feb0cb..1475c23e2 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; import 'dart:ui' as _i5; diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.mocks.dart index b11c9ad89..38c18d714 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; import 'dart:ui' as _i5; diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rescan_warning_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rescan_warning_view_screen_test.mocks.dart index 63bbf9990..0e843bd14 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rescan_warning_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rescan_warning_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rescan_warning_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -100,7 +102,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.mocks.dart index 49ddcebd3..dc8e09b91 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; import 'dart:ui' as _i9; @@ -331,7 +333,7 @@ class MockManager extends _i1.Mock implements _i10.Manager { @override _i8.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i8.Coin.bitcoin, + returnValue: _i8.Coin.banano, ) as _i8.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart index b63e29f34..3771527e0 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart @@ -1,26 +1,27 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.dart. // Do not manually edit this file. -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i9; -import 'dart:ui' as _i15; +// @dart=2.19 -import 'package:local_auth/auth_strings.dart' as _i12; -import 'package:local_auth/local_auth.dart' as _i11; +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i8; +import 'dart:ui' as _i14; + +import 'package:local_auth/auth_strings.dart' as _i11; +import 'package:local_auth/local_auth.dart' as _i10; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i7; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i8; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i2; import 'package:stackwallet/models/balance.dart' as _i5; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16; import 'package:stackwallet/models/models.dart' as _i4; import 'package:stackwallet/services/coins/coin_service.dart' as _i3; -import 'package:stackwallet/services/coins/manager.dart' as _i16; -import 'package:stackwallet/services/wallets_service.dart' as _i14; +import 'package:stackwallet/services/coins/manager.dart' as _i15; +import 'package:stackwallet/services/wallets_service.dart' as _i13; import 'package:stackwallet/utilities/amount/amount.dart' as _i6; -import 'package:stackwallet/utilities/biometrics.dart' as _i13; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10; -import 'package:stackwallet/utilities/prefs.dart' as _i2; +import 'package:stackwallet/utilities/biometrics.dart' as _i12; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i9; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -33,8 +34,8 @@ import 'package:stackwallet/utilities/prefs.dart' as _i2; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakePrefs_0 extends _i1.SmartFake implements _i2.Prefs { - _FakePrefs_0( +class _FakeElectrumX_0 extends _i1.SmartFake implements _i2.ElectrumX { + _FakeElectrumX_0( Object parent, Invocation parentInvocation, ) : super( @@ -93,38 +94,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i2.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_0( + _i2.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_0( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i2.Prefs); + ) as _i2.ElectrumX); @override - List<_i8.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i8.ElectrumXNode>[], - ) as List<_i8.ElectrumXNode>); - @override - _i9.Future> getAnonymitySet({ + _i8.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i10.Coin? coin, + required _i9.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -137,8 +118,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { }, ), returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -156,9 +137,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { returnValue: '', ) as String); @override - _i9.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, - required _i10.Coin? coin, + required _i9.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -172,11 +153,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { }, ), returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i9.Future> getUsedCoinSerials({ - required _i10.Coin? coin, + _i8.Future> getUsedCoinSerials({ + required _i9.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -188,43 +169,43 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i9.Future>.value([]), - ) as _i9.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i9.Future clearSharedTransactionCache({required _i10.Coin? coin}) => + _i8.Future clearSharedTransactionCache({required _i9.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [LocalAuthentication]. /// /// See the documentation for Mockito's code generation for more information. class MockLocalAuthentication extends _i1.Mock - implements _i11.LocalAuthentication { + implements _i10.LocalAuthentication { MockLocalAuthentication() { _i1.throwOnMissingStub(this); } @override - _i9.Future get canCheckBiometrics => (super.noSuchMethod( + _i8.Future get canCheckBiometrics => (super.noSuchMethod( Invocation.getter(#canCheckBiometrics), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future authenticateWithBiometrics({ + _i8.Future authenticateWithBiometrics({ required String? localizedReason, bool? useErrorDialogs = true, bool? stickyAuth = false, - _i12.AndroidAuthMessages? androidAuthStrings = - const _i12.AndroidAuthMessages(), - _i12.IOSAuthMessages? iOSAuthStrings = const _i12.IOSAuthMessages(), + _i11.AndroidAuthMessages? androidAuthStrings = + const _i11.AndroidAuthMessages(), + _i11.IOSAuthMessages? iOSAuthStrings = const _i11.IOSAuthMessages(), bool? sensitiveTransaction = true, }) => (super.noSuchMethod( @@ -240,16 +221,16 @@ class MockLocalAuthentication extends _i1.Mock #sensitiveTransaction: sensitiveTransaction, }, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future authenticate({ + _i8.Future authenticate({ required String? localizedReason, bool? useErrorDialogs = true, bool? stickyAuth = false, - _i12.AndroidAuthMessages? androidAuthStrings = - const _i12.AndroidAuthMessages(), - _i12.IOSAuthMessages? iOSAuthStrings = const _i12.IOSAuthMessages(), + _i11.AndroidAuthMessages? androidAuthStrings = + const _i11.AndroidAuthMessages(), + _i11.IOSAuthMessages? iOSAuthStrings = const _i11.IOSAuthMessages(), bool? sensitiveTransaction = true, bool? biometricOnly = false, }) => @@ -267,46 +248,46 @@ class MockLocalAuthentication extends _i1.Mock #biometricOnly: biometricOnly, }, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future stopAuthentication() => (super.noSuchMethod( + _i8.Future stopAuthentication() => (super.noSuchMethod( Invocation.method( #stopAuthentication, [], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future isDeviceSupported() => (super.noSuchMethod( + _i8.Future isDeviceSupported() => (super.noSuchMethod( Invocation.method( #isDeviceSupported, [], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future> getAvailableBiometrics() => + _i8.Future> getAvailableBiometrics() => (super.noSuchMethod( Invocation.method( #getAvailableBiometrics, [], ), returnValue: - _i9.Future>.value(<_i11.BiometricType>[]), - ) as _i9.Future>); + _i8.Future>.value(<_i10.BiometricType>[]), + ) as _i8.Future>); } /// A class which mocks [Biometrics]. /// /// See the documentation for Mockito's code generation for more information. -class MockBiometrics extends _i1.Mock implements _i13.Biometrics { +class MockBiometrics extends _i1.Mock implements _i12.Biometrics { MockBiometrics() { _i1.throwOnMissingStub(this); } @override - _i9.Future authenticate({ + _i8.Future authenticate({ required String? cancelButtonText, required String? localizedReason, required String? title, @@ -321,28 +302,28 @@ class MockBiometrics extends _i1.Mock implements _i13.Biometrics { #title: title, }, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); } /// A class which mocks [WalletsService]. /// /// See the documentation for Mockito's code generation for more information. -class MockWalletsService extends _i1.Mock implements _i14.WalletsService { +class MockWalletsService extends _i1.Mock implements _i13.WalletsService { @override - _i9.Future> get walletNames => + _i8.Future> get walletNames => (super.noSuchMethod( Invocation.getter(#walletNames), - returnValue: _i9.Future>.value( - {}), - ) as _i9.Future>); + returnValue: _i8.Future>.value( + {}), + ) as _i8.Future>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i9.Future renameWallet({ + _i8.Future renameWallet({ required String? from, required String? to, required bool? shouldNotifyListeners, @@ -357,21 +338,21 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { #shouldNotifyListeners: shouldNotifyListeners, }, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - Map fetchWalletsData() => (super.noSuchMethod( + Map fetchWalletsData() => (super.noSuchMethod( Invocation.method( #fetchWalletsData, [], ), - returnValue: {}, - ) as Map); + returnValue: {}, + ) as Map); @override - _i9.Future addExistingStackWallet({ + _i8.Future addExistingStackWallet({ required String? name, required String? walletId, - required _i10.Coin? coin, + required _i9.Coin? coin, required bool? shouldNotifyListeners, }) => (super.noSuchMethod( @@ -385,13 +366,13 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { #shouldNotifyListeners: shouldNotifyListeners, }, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future addNewWallet({ + _i8.Future addNewWallet({ required String? name, - required _i10.Coin? coin, + required _i9.Coin? coin, required bool? shouldNotifyListeners, }) => (super.noSuchMethod( @@ -404,46 +385,46 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { #shouldNotifyListeners: shouldNotifyListeners, }, ), - returnValue: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future> getFavoriteWalletIds() => (super.noSuchMethod( + _i8.Future> getFavoriteWalletIds() => (super.noSuchMethod( Invocation.method( #getFavoriteWalletIds, [], ), - returnValue: _i9.Future>.value([]), - ) as _i9.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i9.Future saveFavoriteWalletIds(List? walletIds) => + _i8.Future saveFavoriteWalletIds(List? walletIds) => (super.noSuchMethod( Invocation.method( #saveFavoriteWalletIds, [walletIds], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future addFavorite(String? walletId) => (super.noSuchMethod( + _i8.Future addFavorite(String? walletId) => (super.noSuchMethod( Invocation.method( #addFavorite, [walletId], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future removeFavorite(String? walletId) => (super.noSuchMethod( + _i8.Future removeFavorite(String? walletId) => (super.noSuchMethod( Invocation.method( #removeFavorite, [walletId], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future moveFavorite({ + _i8.Future moveFavorite({ required int? fromIndex, required int? toIndex, }) => @@ -456,48 +437,48 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { #toIndex: toIndex, }, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future checkForDuplicate(String? name) => (super.noSuchMethod( + _i8.Future checkForDuplicate(String? name) => (super.noSuchMethod( Invocation.method( #checkForDuplicate, [name], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future getWalletId(String? walletName) => (super.noSuchMethod( + _i8.Future getWalletId(String? walletName) => (super.noSuchMethod( Invocation.method( #getWalletId, [walletName], ), - returnValue: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future isMnemonicVerified({required String? walletId}) => + _i8.Future isMnemonicVerified({required String? walletId}) => (super.noSuchMethod( Invocation.method( #isMnemonicVerified, [], {#walletId: walletId}, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future setMnemonicVerified({required String? walletId}) => + _i8.Future setMnemonicVerified({required String? walletId}) => (super.noSuchMethod( Invocation.method( #setMnemonicVerified, [], {#walletId: walletId}, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future deleteWallet( + _i8.Future deleteWallet( String? name, bool? shouldNotifyListeners, ) => @@ -509,20 +490,20 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { shouldNotifyListeners, ], ), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i9.Future refreshWallets(bool? shouldNotifyListeners) => + _i8.Future refreshWallets(bool? shouldNotifyListeners) => (super.noSuchMethod( Invocation.method( #refreshWallets, [shouldNotifyListeners], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - void addListener(_i15.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -530,7 +511,7 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -558,7 +539,7 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { /// A class which mocks [Manager]. /// /// See the documentation for Mockito's code generation for more information. -class MockManager extends _i1.Mock implements _i16.Manager { +class MockManager extends _i1.Mock implements _i15.Manager { @override bool get isActiveWallet => (super.noSuchMethod( Invocation.getter(#isActiveWallet), @@ -586,10 +567,10 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: false, ) as bool); @override - _i10.Coin get coin => (super.noSuchMethod( + _i9.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i10.Coin.bitcoin, - ) as _i10.Coin); + returnValue: _i9.Coin.banano, + ) as _i9.Coin); @override bool get isRefreshing => (super.noSuchMethod( Invocation.getter(#isRefreshing), @@ -622,23 +603,23 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValueForMissingStub: null, ); @override - _i9.Future<_i4.FeeObject> get fees => (super.noSuchMethod( + _i8.Future<_i4.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i9.Future<_i4.FeeObject>.value(_FakeFeeObject_2( + returnValue: _i8.Future<_i4.FeeObject>.value(_FakeFeeObject_2( this, Invocation.getter(#fees), )), - ) as _i9.Future<_i4.FeeObject>); + ) as _i8.Future<_i4.FeeObject>); @override - _i9.Future get maxFee => (super.noSuchMethod( + _i8.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i9.Future get currentReceivingAddress => (super.noSuchMethod( + _i8.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), - returnValue: _i9.Future.value(''), - ) as _i9.Future); + returnValue: _i8.Future.value(''), + ) as _i8.Future); @override _i5.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), @@ -648,16 +629,16 @@ class MockManager extends _i1.Mock implements _i16.Manager { ), ) as _i5.Balance); @override - _i9.Future> get transactions => (super.noSuchMethod( + _i8.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i9.Future>.value(<_i17.Transaction>[]), - ) as _i9.Future>); + _i8.Future>.value(<_i16.Transaction>[]), + ) as _i8.Future>); @override - _i9.Future> get utxos => (super.noSuchMethod( + _i8.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i9.Future>.value(<_i17.UTXO>[]), - ) as _i9.Future>); + returnValue: _i8.Future>.value(<_i16.UTXO>[]), + ) as _i8.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -677,15 +658,15 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: '', ) as String); @override - _i9.Future> get mnemonic => (super.noSuchMethod( + _i8.Future> get mnemonic => (super.noSuchMethod( Invocation.getter(#mnemonic), - returnValue: _i9.Future>.value([]), - ) as _i9.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i9.Future get mnemonicPassphrase => (super.noSuchMethod( + _i8.Future get mnemonicPassphrase => (super.noSuchMethod( Invocation.getter(#mnemonicPassphrase), - returnValue: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override bool get isConnected => (super.noSuchMethod( Invocation.getter(#isConnected), @@ -727,24 +708,24 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: false, ) as bool); @override - _i9.Future get xpub => (super.noSuchMethod( + _i8.Future get xpub => (super.noSuchMethod( Invocation.getter(#xpub), - returnValue: _i9.Future.value(''), - ) as _i9.Future); + returnValue: _i8.Future.value(''), + ) as _i8.Future); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i9.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + _i8.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( Invocation.method( #updateNode, [shouldRefresh], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override void dispose() => super.noSuchMethod( Invocation.method( @@ -754,7 +735,7 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValueForMissingStub: null, ); @override - _i9.Future> prepareSend({ + _i8.Future> prepareSend({ required String? address, required _i6.Amount? amount, Map? args, @@ -770,27 +751,27 @@ class MockManager extends _i1.Mock implements _i16.Manager { }, ), returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i9.Future confirmSend({required Map? txData}) => + _i8.Future confirmSend({required Map? txData}) => (super.noSuchMethod( Invocation.method( #confirmSend, [], {#txData: txData}, ), - returnValue: _i9.Future.value(''), - ) as _i9.Future); + returnValue: _i8.Future.value(''), + ) as _i8.Future); @override - _i9.Future refresh() => (super.noSuchMethod( + _i8.Future refresh() => (super.noSuchMethod( Invocation.method( #refresh, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override bool validateAddress(String? address) => (super.noSuchMethod( Invocation.method( @@ -800,33 +781,33 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: false, ) as bool); @override - _i9.Future testNetworkConnection() => (super.noSuchMethod( + _i8.Future testNetworkConnection() => (super.noSuchMethod( Invocation.method( #testNetworkConnection, [], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future initializeNew() => (super.noSuchMethod( + _i8.Future initializeNew() => (super.noSuchMethod( Invocation.method( #initializeNew, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future initializeExisting() => (super.noSuchMethod( + _i8.Future initializeExisting() => (super.noSuchMethod( Invocation.method( #initializeExisting, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future recoverFromMnemonic({ + _i8.Future recoverFromMnemonic({ required String? mnemonic, String? mnemonicPassphrase, required int? maxUnusedAddressGap, @@ -845,20 +826,20 @@ class MockManager extends _i1.Mock implements _i16.Manager { #height: height, }, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future exitCurrentWallet() => (super.noSuchMethod( + _i8.Future exitCurrentWallet() => (super.noSuchMethod( Invocation.method( #exitCurrentWallet, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future fullRescan( + _i8.Future fullRescan( int? maxUnusedAddressGap, int? maxNumberOfIndexesToCheck, ) => @@ -870,11 +851,11 @@ class MockManager extends _i1.Mock implements _i16.Manager { maxNumberOfIndexesToCheck, ], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future<_i6.Amount> estimateFeeFor( + _i8.Future<_i6.Amount> estimateFeeFor( _i6.Amount? amount, int? feeRate, ) => @@ -886,7 +867,7 @@ class MockManager extends _i1.Mock implements _i16.Manager { feeRate, ], ), - returnValue: _i9.Future<_i6.Amount>.value(_FakeAmount_4( + returnValue: _i8.Future<_i6.Amount>.value(_FakeAmount_4( this, Invocation.method( #estimateFeeFor, @@ -896,26 +877,26 @@ class MockManager extends _i1.Mock implements _i16.Manager { ], ), )), - ) as _i9.Future<_i6.Amount>); + ) as _i8.Future<_i6.Amount>); @override - _i9.Future generateNewAddress() => (super.noSuchMethod( + _i8.Future generateNewAddress() => (super.noSuchMethod( Invocation.method( #generateNewAddress, [], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future resetRescanOnOpen() => (super.noSuchMethod( + _i8.Future resetRescanOnOpen() => (super.noSuchMethod( Invocation.method( #resetRescanOnOpen, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - void addListener(_i15.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -923,7 +904,7 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValueForMissingStub: null, ); @override - void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/settings_view/settings_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_view_screen_test.mocks.dart index d918b1684..2b4b9e638 100644 --- a/test/screen_tests/settings_view/settings_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/settings_view/settings_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; import 'dart:ui' as _i9; @@ -331,7 +333,7 @@ class MockManager extends _i1.Mock implements _i10.Manager { @override _i8.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i8.Coin.bitcoin, + returnValue: _i8.Coin.banano, ) as _i8.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/transaction_subviews/transaction_details_view_screen_test.mocks.dart b/test/screen_tests/transaction_subviews/transaction_details_view_screen_test.mocks.dart index 73941fed6..fd928ab12 100644 --- a/test/screen_tests/transaction_subviews/transaction_details_view_screen_test.mocks.dart +++ b/test/screen_tests/transaction_subviews/transaction_details_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/transaction_subviews/transaction_details_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; import 'dart:ui' as _i5; diff --git a/test/screen_tests/transaction_subviews/transaction_search_results_view_screen_test.mocks.dart b/test/screen_tests/transaction_subviews/transaction_search_results_view_screen_test.mocks.dart index 52c9776df..7a61b1f58 100644 --- a/test/screen_tests/transaction_subviews/transaction_search_results_view_screen_test.mocks.dart +++ b/test/screen_tests/transaction_subviews/transaction_search_results_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/transaction_subviews/transaction_search_results_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -102,7 +104,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/transaction_subviews/transaction_search_view_screen_test.mocks.dart b/test/screen_tests/transaction_subviews/transaction_search_view_screen_test.mocks.dart index 02b5eb2b7..52b725907 100644 --- a/test/screen_tests/transaction_subviews/transaction_search_view_screen_test.mocks.dart +++ b/test/screen_tests/transaction_subviews/transaction_search_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/transaction_subviews/transaction_search_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; import 'dart:ui' as _i5; diff --git a/test/screen_tests/wallet_view/confirm_send_view_screen_test.mocks.dart b/test/screen_tests/wallet_view/confirm_send_view_screen_test.mocks.dart index 245da71d8..8c3a5a39a 100644 --- a/test/screen_tests/wallet_view/confirm_send_view_screen_test.mocks.dart +++ b/test/screen_tests/wallet_view/confirm_send_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/wallet_view/confirm_send_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -101,7 +103,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/wallet_view/receive_view_screen_test.mocks.dart b/test/screen_tests/wallet_view/receive_view_screen_test.mocks.dart index 57de0b1b7..148289626 100644 --- a/test/screen_tests/wallet_view/receive_view_screen_test.mocks.dart +++ b/test/screen_tests/wallet_view/receive_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/wallet_view/receive_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -100,7 +102,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/wallet_view/send_view_screen_test.mocks.dart b/test/screen_tests/wallet_view/send_view_screen_test.mocks.dart index 48dc8f554..71e0ca110 100644 --- a/test/screen_tests/wallet_view/send_view_screen_test.mocks.dart +++ b/test/screen_tests/wallet_view/send_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/wallet_view/send_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i12; @@ -142,7 +144,7 @@ class MockManager extends _i1.Mock implements _i9.Manager { @override _i10.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i10.Coin.bitcoin, + returnValue: _i10.Coin.banano, ) as _i10.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/screen_tests/wallet_view/wallet_view_screen_test.mocks.dart b/test/screen_tests/wallet_view/wallet_view_screen_test.mocks.dart index 190da405c..60bf5ef5f 100644 --- a/test/screen_tests/wallet_view/wallet_view_screen_test.mocks.dart +++ b/test/screen_tests/wallet_view/wallet_view_screen_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/screen_tests/wallet_view/wallet_view_screen_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; import 'dart:ui' as _i10; @@ -102,7 +104,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i7.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i7.Coin.bitcoin, + returnValue: _i7.Coin.banano, ) as _i7.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/services/change_now/change_now_test.mocks.dart b/test/services/change_now/change_now_test.mocks.dart index 808b27671..233216e30 100644 --- a/test/services/change_now/change_now_test.mocks.dart +++ b/test/services/change_now/change_now_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/change_now/change_now_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; import 'dart:convert' as _i4; diff --git a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart index 93eb0e1c8..806152407 100644 --- a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart +++ b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart @@ -1,18 +1,19 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/coins/bitcoin/bitcoin_wallet_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +36,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +49,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +91,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +110,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +130,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +147,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +158,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +169,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +185,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +202,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +218,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +230,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +247,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +259,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +279,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +298,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +314,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +331,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +351,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +367,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +378,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +394,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +430,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +449,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +465,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +481,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +529,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +546,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart index 05cd24ebd..992f7d49a 100644 --- a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart +++ b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart @@ -1,18 +1,19 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/coins/bitcoincash/bitcoincash_wallet_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +36,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +49,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +91,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +110,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +130,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +147,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +158,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +169,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +185,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +202,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +218,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +230,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +247,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +259,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +279,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +298,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +314,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +331,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +351,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +367,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +378,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +394,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +430,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +449,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +465,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +481,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +529,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +546,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart index ff04b9f73..7413c926a 100644 --- a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart +++ b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart @@ -1,18 +1,19 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/coins/dogecoin/dogecoin_wallet_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +36,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +49,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +91,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +110,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +130,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +147,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +158,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +169,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +185,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +202,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +218,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +230,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +247,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +259,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +279,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +298,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +314,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +331,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +351,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +367,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +378,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +394,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +430,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +449,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +465,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +481,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +529,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +546,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/firo/firo_wallet_test.dart b/test/services/coins/firo/firo_wallet_test.dart index 766df279f..68db15437 100644 --- a/test/services/coins/firo/firo_wallet_test.dart +++ b/test/services/coins/firo/firo_wallet_test.dart @@ -105,6 +105,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ), ) .toList(); diff --git a/test/services/coins/firo/firo_wallet_test.mocks.dart b/test/services/coins/firo/firo_wallet_test.mocks.dart index bb6d13ca7..95d1750e9 100644 --- a/test/services/coins/firo/firo_wallet_test.mocks.dart +++ b/test/services/coins/firo/firo_wallet_test.mocks.dart @@ -1,24 +1,25 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/coins/firo/firo_wallet_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; +import 'dart:async' as _i5; import 'package:decimal/decimal.dart' as _i2; import 'package:isar/isar.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/db/isar/main_db.dart' as _i10; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i7; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i5; -import 'package:stackwallet/models/isar/models/block_explorer.dart' as _i12; -import 'package:stackwallet/models/isar/models/contact_entry.dart' as _i11; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i13; +import 'package:stackwallet/db/isar/main_db.dart' as _i9; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/models/isar/models/block_explorer.dart' as _i11; +import 'package:stackwallet/models/isar/models/contact_entry.dart' as _i10; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i12; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i9; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8; -import 'package:stackwallet/utilities/prefs.dart' as _i3; -import 'package:tuple/tuple.dart' as _i14; + as _i8; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; +import 'package:tuple/tuple.dart' as _i13; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -41,8 +42,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -75,13 +76,13 @@ class _FakeQueryBuilder_3 extends _i1.SmartFake /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i5.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -117,7 +118,7 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { returnValue: false, ) as bool); @override - _i6.Future request({ + _i5.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -136,10 +137,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #retries: retries, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future>> batchRequest({ + _i5.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -156,11 +157,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #retries: retries, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i5.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i5.Future>>); @override - _i6.Future ping({ + _i5.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -173,10 +174,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i6.Future> getBlockHeadTip({String? requestID}) => + _i5.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -184,10 +185,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future> getServerFeatures({String? requestID}) => + _i5.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -195,10 +196,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future broadcastTransaction({ + _i5.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -211,10 +212,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #requestID: requestID, }, ), - returnValue: _i6.Future.value(''), - ) as _i6.Future); + returnValue: _i5.Future.value(''), + ) as _i5.Future); @override - _i6.Future> getBalance({ + _i5.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -228,10 +229,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future>> getHistory({ + _i5.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -244,11 +245,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i5.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i5.Future>>); @override - _i6.Future>>> getBatchHistory( + _i5.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -256,11 +257,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i5.Future>>>.value( >>{}), - ) as _i6.Future>>>); + ) as _i5.Future>>>); @override - _i6.Future>> getUTXOs({ + _i5.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -273,11 +274,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i5.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i5.Future>>); @override - _i6.Future>>> getBatchUTXOs( + _i5.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -285,11 +286,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i5.Future>>>.value( >>{}), - ) as _i6.Future>>>); + ) as _i5.Future>>>); @override - _i6.Future> getTransaction({ + _i5.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -305,10 +306,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future> getAnonymitySet({ + _i5.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -324,10 +325,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future getMintData({ + _i5.Future getMintData({ dynamic mints, String? requestID, }) => @@ -340,10 +341,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #requestID: requestID, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future> getUsedCoinSerials({ + _i5.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -357,19 +358,19 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future> getFeeRate({String? requestID}) => + _i5.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -377,10 +378,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future<_i2.Decimal> estimateFee({ + _i5.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -393,7 +394,7 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #blocks: blocks, }, ), - returnValue: _i6.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -404,15 +405,15 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), )), - ) as _i6.Future<_i2.Decimal>); + ) as _i5.Future<_i2.Decimal>); @override - _i6.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i6.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -420,50 +421,30 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { {#requestID: requestID}, ), )), - ) as _i6.Future<_i2.Decimal>); + ) as _i5.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i5.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i5.ElectrumXNode>[], - ) as List<_i5.ElectrumXNode>); - @override - _i6.Future> getAnonymitySet({ + _i5.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i8.Coin? coin, + required _i7.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -476,8 +457,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -495,9 +476,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { returnValue: '', ) as String); @override - _i6.Future> getTransaction({ + _i5.Future> getTransaction({ required String? txHash, - required _i8.Coin? coin, + required _i7.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -511,11 +492,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future> getUsedCoinSerials({ - required _i8.Coin? coin, + _i5.Future> getUsedCoinSerials({ + required _i7.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -527,26 +508,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); @override - _i6.Future clearSharedTransactionCache({required _i8.Coin? coin}) => + _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i9.TransactionNotificationTracker { + implements _i8.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -575,14 +556,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i6.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -592,29 +573,29 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i6.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [MainDB]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainDB extends _i1.Mock implements _i10.MainDB { +class MockMainDB extends _i1.Mock implements _i9.MainDB { MockMainDB() { _i1.throwOnMissingStub(this); } @@ -628,86 +609,86 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { ), ) as _i4.Isar); @override - _i6.Future initMainDB({_i4.Isar? mock}) => (super.noSuchMethod( + _i5.Future initMainDB({_i4.Isar? mock}) => (super.noSuchMethod( Invocation.method( #initMainDB, [], {#mock: mock}, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - List<_i11.ContactEntry> getContactEntries() => (super.noSuchMethod( + List<_i10.ContactEntry> getContactEntries() => (super.noSuchMethod( Invocation.method( #getContactEntries, [], ), - returnValue: <_i11.ContactEntry>[], - ) as List<_i11.ContactEntry>); + returnValue: <_i10.ContactEntry>[], + ) as List<_i10.ContactEntry>); @override - _i6.Future deleteContactEntry({required String? id}) => + _i5.Future deleteContactEntry({required String? id}) => (super.noSuchMethod( Invocation.method( #deleteContactEntry, [], {#id: id}, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i6.Future isContactEntryExists({required String? id}) => + _i5.Future isContactEntryExists({required String? id}) => (super.noSuchMethod( Invocation.method( #isContactEntryExists, [], {#id: id}, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i11.ContactEntry? getContactEntry({required String? id}) => + _i10.ContactEntry? getContactEntry({required String? id}) => (super.noSuchMethod(Invocation.method( #getContactEntry, [], {#id: id}, - )) as _i11.ContactEntry?); + )) as _i10.ContactEntry?); @override - _i6.Future putContactEntry( - {required _i11.ContactEntry? contactEntry}) => + _i5.Future putContactEntry( + {required _i10.ContactEntry? contactEntry}) => (super.noSuchMethod( Invocation.method( #putContactEntry, [], {#contactEntry: contactEntry}, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i12.TransactionBlockExplorer? getTransactionBlockExplorer( - {required _i8.Coin? coin}) => + _i11.TransactionBlockExplorer? getTransactionBlockExplorer( + {required _i7.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getTransactionBlockExplorer, [], {#coin: coin}, - )) as _i12.TransactionBlockExplorer?); + )) as _i11.TransactionBlockExplorer?); @override - _i6.Future putTransactionBlockExplorer( - _i12.TransactionBlockExplorer? explorer) => + _i5.Future putTransactionBlockExplorer( + _i11.TransactionBlockExplorer? explorer) => (super.noSuchMethod( Invocation.method( #putTransactionBlockExplorer, [explorer], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i4.QueryBuilder<_i13.Address, _i13.Address, _i4.QAfterWhereClause> + _i4.QueryBuilder<_i12.Address, _i12.Address, _i4.QAfterWhereClause> getAddresses(String? walletId) => (super.noSuchMethod( Invocation.method( #getAddresses, [walletId], ), - returnValue: _FakeQueryBuilder_3<_i13.Address, _i13.Address, + returnValue: _FakeQueryBuilder_3<_i12.Address, _i12.Address, _i4.QAfterWhereClause>( this, Invocation.method( @@ -716,35 +697,35 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { ), ), ) as _i4 - .QueryBuilder<_i13.Address, _i13.Address, _i4.QAfterWhereClause>); + .QueryBuilder<_i12.Address, _i12.Address, _i4.QAfterWhereClause>); @override - _i6.Future putAddress(_i13.Address? address) => (super.noSuchMethod( + _i5.Future putAddress(_i12.Address? address) => (super.noSuchMethod( Invocation.method( #putAddress, [address], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future> putAddresses(List<_i13.Address>? addresses) => + _i5.Future> putAddresses(List<_i12.Address>? addresses) => (super.noSuchMethod( Invocation.method( #putAddresses, [addresses], ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); @override - _i6.Future> updateOrPutAddresses(List<_i13.Address>? addresses) => + _i5.Future> updateOrPutAddresses(List<_i12.Address>? addresses) => (super.noSuchMethod( Invocation.method( #updateOrPutAddresses, [addresses], ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); @override - _i6.Future<_i13.Address?> getAddress( + _i5.Future<_i12.Address?> getAddress( String? walletId, String? address, ) => @@ -756,12 +737,12 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { address, ], ), - returnValue: _i6.Future<_i13.Address?>.value(), - ) as _i6.Future<_i13.Address?>); + returnValue: _i5.Future<_i12.Address?>.value(), + ) as _i5.Future<_i12.Address?>); @override - _i6.Future updateAddress( - _i13.Address? oldAddress, - _i13.Address? newAddress, + _i5.Future updateAddress( + _i12.Address? oldAddress, + _i12.Address? newAddress, ) => (super.noSuchMethod( Invocation.method( @@ -771,16 +752,16 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { newAddress, ], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i4.QueryBuilder<_i13.Transaction, _i13.Transaction, _i4.QAfterWhereClause> + _i4.QueryBuilder<_i12.Transaction, _i12.Transaction, _i4.QAfterWhereClause> getTransactions(String? walletId) => (super.noSuchMethod( Invocation.method( #getTransactions, [walletId], ), - returnValue: _FakeQueryBuilder_3<_i13.Transaction, _i13.Transaction, + returnValue: _FakeQueryBuilder_3<_i12.Transaction, _i12.Transaction, _i4.QAfterWhereClause>( this, Invocation.method( @@ -788,28 +769,28 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { [walletId], ), ), - ) as _i4.QueryBuilder<_i13.Transaction, _i13.Transaction, + ) as _i4.QueryBuilder<_i12.Transaction, _i12.Transaction, _i4.QAfterWhereClause>); @override - _i6.Future putTransaction(_i13.Transaction? transaction) => + _i5.Future putTransaction(_i12.Transaction? transaction) => (super.noSuchMethod( Invocation.method( #putTransaction, [transaction], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future> putTransactions(List<_i13.Transaction>? transactions) => + _i5.Future> putTransactions(List<_i12.Transaction>? transactions) => (super.noSuchMethod( Invocation.method( #putTransactions, [transactions], ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); @override - _i6.Future<_i13.Transaction?> getTransaction( + _i5.Future<_i12.Transaction?> getTransaction( String? walletId, String? txid, ) => @@ -821,10 +802,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { txid, ], ), - returnValue: _i6.Future<_i13.Transaction?>.value(), - ) as _i6.Future<_i13.Transaction?>); + returnValue: _i5.Future<_i12.Transaction?>.value(), + ) as _i5.Future<_i12.Transaction?>); @override - _i6.Stream<_i13.Transaction?> watchTransaction({ + _i5.Stream<_i12.Transaction?> watchTransaction({ required int? id, bool? fireImmediately = false, }) => @@ -837,10 +818,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #fireImmediately: fireImmediately, }, ), - returnValue: _i6.Stream<_i13.Transaction?>.empty(), - ) as _i6.Stream<_i13.Transaction?>); + returnValue: _i5.Stream<_i12.Transaction?>.empty(), + ) as _i5.Stream<_i12.Transaction?>); @override - _i4.QueryBuilder<_i13.UTXO, _i13.UTXO, _i4.QAfterWhereClause> getUTXOs( + _i4.QueryBuilder<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause> getUTXOs( String? walletId) => (super.noSuchMethod( Invocation.method( @@ -848,36 +829,36 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { [walletId], ), returnValue: - _FakeQueryBuilder_3<_i13.UTXO, _i13.UTXO, _i4.QAfterWhereClause>( + _FakeQueryBuilder_3<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause>( this, Invocation.method( #getUTXOs, [walletId], ), ), - ) as _i4.QueryBuilder<_i13.UTXO, _i13.UTXO, _i4.QAfterWhereClause>); + ) as _i4.QueryBuilder<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause>); @override - _i6.Future putUTXO(_i13.UTXO? utxo) => (super.noSuchMethod( + _i5.Future putUTXO(_i12.UTXO? utxo) => (super.noSuchMethod( Invocation.method( #putUTXO, [utxo], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future putUTXOs(List<_i13.UTXO>? utxos) => (super.noSuchMethod( + _i5.Future putUTXOs(List<_i12.UTXO>? utxos) => (super.noSuchMethod( Invocation.method( #putUTXOs, [utxos], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future updateUTXOs( + _i5.Future updateUTXOs( String? walletId, - List<_i13.UTXO>? utxos, + List<_i12.UTXO>? utxos, ) => (super.noSuchMethod( Invocation.method( @@ -887,11 +868,11 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { utxos, ], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Stream<_i13.UTXO?> watchUTXO({ + _i5.Stream<_i12.UTXO?> watchUTXO({ required int? id, bool? fireImmediately = false, }) => @@ -904,10 +885,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #fireImmediately: fireImmediately, }, ), - returnValue: _i6.Stream<_i13.UTXO?>.empty(), - ) as _i6.Stream<_i13.UTXO?>); + returnValue: _i5.Stream<_i12.UTXO?>.empty(), + ) as _i5.Stream<_i12.UTXO?>); @override - _i4.QueryBuilder<_i13.TransactionNote, _i13.TransactionNote, + _i4.QueryBuilder<_i12.TransactionNote, _i12.TransactionNote, _i4.QAfterWhereClause> getTransactionNotes( String? walletId) => (super.noSuchMethod( @@ -915,39 +896,39 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #getTransactionNotes, [walletId], ), - returnValue: _FakeQueryBuilder_3<_i13.TransactionNote, - _i13.TransactionNote, _i4.QAfterWhereClause>( + returnValue: _FakeQueryBuilder_3<_i12.TransactionNote, + _i12.TransactionNote, _i4.QAfterWhereClause>( this, Invocation.method( #getTransactionNotes, [walletId], ), ), - ) as _i4.QueryBuilder<_i13.TransactionNote, _i13.TransactionNote, + ) as _i4.QueryBuilder<_i12.TransactionNote, _i12.TransactionNote, _i4.QAfterWhereClause>); @override - _i6.Future putTransactionNote(_i13.TransactionNote? transactionNote) => + _i5.Future putTransactionNote(_i12.TransactionNote? transactionNote) => (super.noSuchMethod( Invocation.method( #putTransactionNote, [transactionNote], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future putTransactionNotes( - List<_i13.TransactionNote>? transactionNotes) => + _i5.Future putTransactionNotes( + List<_i12.TransactionNote>? transactionNotes) => (super.noSuchMethod( Invocation.method( #putTransactionNotes, [transactionNotes], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future<_i13.TransactionNote?> getTransactionNote( + _i5.Future<_i12.TransactionNote?> getTransactionNote( String? walletId, String? txid, ) => @@ -959,10 +940,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { txid, ], ), - returnValue: _i6.Future<_i13.TransactionNote?>.value(), - ) as _i6.Future<_i13.TransactionNote?>); + returnValue: _i5.Future<_i12.TransactionNote?>.value(), + ) as _i5.Future<_i12.TransactionNote?>); @override - _i6.Stream<_i13.TransactionNote?> watchTransactionNote({ + _i5.Stream<_i12.TransactionNote?> watchTransactionNote({ required int? id, bool? fireImmediately = false, }) => @@ -975,36 +956,36 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #fireImmediately: fireImmediately, }, ), - returnValue: _i6.Stream<_i13.TransactionNote?>.empty(), - ) as _i6.Stream<_i13.TransactionNote?>); + returnValue: _i5.Stream<_i12.TransactionNote?>.empty(), + ) as _i5.Stream<_i12.TransactionNote?>); @override - _i4.QueryBuilder<_i13.AddressLabel, _i13.AddressLabel, _i4.QAfterWhereClause> + _i4.QueryBuilder<_i12.AddressLabel, _i12.AddressLabel, _i4.QAfterWhereClause> getAddressLabels(String? walletId) => (super.noSuchMethod( Invocation.method( #getAddressLabels, [walletId], ), - returnValue: _FakeQueryBuilder_3<_i13.AddressLabel, - _i13.AddressLabel, _i4.QAfterWhereClause>( + returnValue: _FakeQueryBuilder_3<_i12.AddressLabel, + _i12.AddressLabel, _i4.QAfterWhereClause>( this, Invocation.method( #getAddressLabels, [walletId], ), ), - ) as _i4.QueryBuilder<_i13.AddressLabel, _i13.AddressLabel, + ) as _i4.QueryBuilder<_i12.AddressLabel, _i12.AddressLabel, _i4.QAfterWhereClause>); @override - _i6.Future putAddressLabel(_i13.AddressLabel? addressLabel) => + _i5.Future putAddressLabel(_i12.AddressLabel? addressLabel) => (super.noSuchMethod( Invocation.method( #putAddressLabel, [addressLabel], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - int putAddressLabelSync(_i13.AddressLabel? addressLabel) => + int putAddressLabelSync(_i12.AddressLabel? addressLabel) => (super.noSuchMethod( Invocation.method( #putAddressLabelSync, @@ -1013,17 +994,17 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { returnValue: 0, ) as int); @override - _i6.Future putAddressLabels(List<_i13.AddressLabel>? addressLabels) => + _i5.Future putAddressLabels(List<_i12.AddressLabel>? addressLabels) => (super.noSuchMethod( Invocation.method( #putAddressLabels, [addressLabels], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future<_i13.AddressLabel?> getAddressLabel( + _i5.Future<_i12.AddressLabel?> getAddressLabel( String? walletId, String? addressString, ) => @@ -1035,10 +1016,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { addressString, ], ), - returnValue: _i6.Future<_i13.AddressLabel?>.value(), - ) as _i6.Future<_i13.AddressLabel?>); + returnValue: _i5.Future<_i12.AddressLabel?>.value(), + ) as _i5.Future<_i12.AddressLabel?>); @override - _i13.AddressLabel? getAddressLabelSync( + _i12.AddressLabel? getAddressLabelSync( String? walletId, String? addressString, ) => @@ -1048,9 +1029,9 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { walletId, addressString, ], - )) as _i13.AddressLabel?); + )) as _i12.AddressLabel?); @override - _i6.Stream<_i13.AddressLabel?> watchAddressLabel({ + _i5.Stream<_i12.AddressLabel?> watchAddressLabel({ required int? id, bool? fireImmediately = false, }) => @@ -1063,49 +1044,49 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #fireImmediately: fireImmediately, }, ), - returnValue: _i6.Stream<_i13.AddressLabel?>.empty(), - ) as _i6.Stream<_i13.AddressLabel?>); + returnValue: _i5.Stream<_i12.AddressLabel?>.empty(), + ) as _i5.Stream<_i12.AddressLabel?>); @override - _i6.Future updateAddressLabel(_i13.AddressLabel? addressLabel) => + _i5.Future updateAddressLabel(_i12.AddressLabel? addressLabel) => (super.noSuchMethod( Invocation.method( #updateAddressLabel, [addressLabel], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future deleteWalletBlockchainData(String? walletId) => + _i5.Future deleteWalletBlockchainData(String? walletId) => (super.noSuchMethod( Invocation.method( #deleteWalletBlockchainData, [walletId], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future deleteAddressLabels(String? walletId) => (super.noSuchMethod( + _i5.Future deleteAddressLabels(String? walletId) => (super.noSuchMethod( Invocation.method( #deleteAddressLabels, [walletId], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future deleteTransactionNotes(String? walletId) => + _i5.Future deleteTransactionNotes(String? walletId) => (super.noSuchMethod( Invocation.method( #deleteTransactionNotes, [walletId], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future addNewTransactionData( - List<_i14.Tuple2<_i13.Transaction, _i13.Address?>>? transactionsData, + _i5.Future addNewTransactionData( + List<_i13.Tuple2<_i12.Transaction, _i12.Address?>>? transactionsData, String? walletId, ) => (super.noSuchMethod( @@ -1116,17 +1097,17 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { walletId, ], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.QueryBuilder<_i13.EthContract, _i13.EthContract, _i4.QWhere> + _i4.QueryBuilder<_i12.EthContract, _i12.EthContract, _i4.QWhere> getEthContracts() => (super.noSuchMethod( Invocation.method( #getEthContracts, [], ), - returnValue: _FakeQueryBuilder_3<_i13.EthContract, _i13.EthContract, + returnValue: _FakeQueryBuilder_3<_i12.EthContract, _i12.EthContract, _i4.QWhere>( this, Invocation.method( @@ -1135,39 +1116,39 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { ), ), ) as _i4 - .QueryBuilder<_i13.EthContract, _i13.EthContract, _i4.QWhere>); + .QueryBuilder<_i12.EthContract, _i12.EthContract, _i4.QWhere>); @override - _i6.Future<_i13.EthContract?> getEthContract(String? contractAddress) => + _i5.Future<_i12.EthContract?> getEthContract(String? contractAddress) => (super.noSuchMethod( Invocation.method( #getEthContract, [contractAddress], ), - returnValue: _i6.Future<_i13.EthContract?>.value(), - ) as _i6.Future<_i13.EthContract?>); + returnValue: _i5.Future<_i12.EthContract?>.value(), + ) as _i5.Future<_i12.EthContract?>); @override - _i13.EthContract? getEthContractSync(String? contractAddress) => + _i12.EthContract? getEthContractSync(String? contractAddress) => (super.noSuchMethod(Invocation.method( #getEthContractSync, [contractAddress], - )) as _i13.EthContract?); + )) as _i12.EthContract?); @override - _i6.Future putEthContract(_i13.EthContract? contract) => + _i5.Future putEthContract(_i12.EthContract? contract) => (super.noSuchMethod( Invocation.method( #putEthContract, [contract], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future putEthContracts(List<_i13.EthContract>? contracts) => + _i5.Future putEthContracts(List<_i12.EthContract>? contracts) => (super.noSuchMethod( Invocation.method( #putEthContracts, [contracts], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/test/services/coins/manager_test.dart b/test/services/coins/manager_test.dart index 65a2de918..fcc246882 100644 --- a/test/services/coins/manager_test.dart +++ b/test/services/coins/manager_test.dart @@ -126,6 +126,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); when(wallet.transactions).thenAnswer((_) async => [ tx, diff --git a/test/services/coins/manager_test.mocks.dart b/test/services/coins/manager_test.mocks.dart index 8a607f14f..97992e3ed 100644 --- a/test/services/coins/manager_test.mocks.dart +++ b/test/services/coins/manager_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/coins/manager_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i11; @@ -215,7 +217,7 @@ class MockFiroWallet extends _i1.Mock implements _i10.FiroWallet { @override _i12.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i12.Coin.bitcoin, + returnValue: _i12.Coin.banano, ) as _i12.Coin); @override _i11.Future> get mnemonic => (super.noSuchMethod( @@ -1086,6 +1088,14 @@ class MockFiroWallet extends _i1.Mock implements _i10.FiroWallet { returnValueForMissingStub: _i11.Future.value(), ) as _i11.Future); @override + int firoGetMintIndex() => (super.noSuchMethod( + Invocation.method( + #firoGetMintIndex, + [], + ), + returnValue: 0, + ) as int); + @override _i11.Future firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod( Invocation.method( #firoUpdateMintIndex, diff --git a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart index 3e9fd4fde..b464d141c 100644 --- a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart +++ b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart @@ -1,18 +1,19 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/coins/namecoin/namecoin_wallet_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +36,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +49,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +91,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +110,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +130,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +147,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +158,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +169,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +185,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +202,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +218,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +230,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +247,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +259,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +279,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +298,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +314,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +331,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +351,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +367,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +378,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +394,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +430,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +449,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +465,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +481,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +529,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +546,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/particl/particl_wallet_test.mocks.dart b/test/services/coins/particl/particl_wallet_test.mocks.dart index 11a8de944..f0e94f2ec 100644 --- a/test/services/coins/particl/particl_wallet_test.mocks.dart +++ b/test/services/coins/particl/particl_wallet_test.mocks.dart @@ -1,18 +1,19 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/coins/particl/particl_wallet_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +36,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +49,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +91,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +110,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +130,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +147,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +158,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +169,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +185,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +202,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +218,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +230,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +247,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +259,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +279,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +298,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +314,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +331,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +351,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +367,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +378,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +394,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +430,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +449,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +465,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +481,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +529,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +546,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/wallets_service_test.mocks.dart b/test/services/wallets_service_test.mocks.dart index c4085b7c3..4e2b60412 100644 --- a/test/services/wallets_service_test.mocks.dart +++ b/test/services/wallets_service_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/services/wallets_service_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; diff --git a/test/utilities/amount/amount_test.dart b/test/utilities/amount/amount_test.dart index c909ff122..e212c8ef4 100644 --- a/test/utilities/amount/amount_test.dart +++ b/test/utilities/amount/amount_test.dart @@ -78,33 +78,33 @@ void main() { ); }); - test("localizedStringAsFixed", () { - expect( - Amount(rawValue: BigInt.two, fractionDigits: 8) - .localizedStringAsFixed(locale: "en_US"), - "0.00000002", - ); - expect( - Amount(rawValue: BigInt.two, fractionDigits: 8) - .localizedStringAsFixed(locale: "en_US", decimalPlaces: 2), - "0.00", - ); - expect( - Amount.fromDecimal(Decimal.fromInt(2), fractionDigits: 8) - .localizedStringAsFixed(locale: "en_US"), - "2.00000000", - ); - expect( - Amount.fromDecimal(Decimal.fromInt(2), fractionDigits: 8) - .localizedStringAsFixed(locale: "en_US", decimalPlaces: 4), - "2.0000", - ); - expect( - Amount.fromDecimal(Decimal.fromInt(2), fractionDigits: 8) - .localizedStringAsFixed(locale: "en_US", decimalPlaces: 0), - "2", - ); - }); + // test("localizedStringAsFixed", () { + // expect( + // Amount(rawValue: BigInt.two, fractionDigits: 8) + // .localizedStringAsFixed(locale: "en_US"), + // "0.00000002", + // ); + // expect( + // Amount(rawValue: BigInt.two, fractionDigits: 8) + // .localizedStringAsFixed(locale: "en_US", decimalPlaces: 2), + // "0.00", + // ); + // expect( + // Amount.fromDecimal(Decimal.fromInt(2), fractionDigits: 8) + // .localizedStringAsFixed(locale: "en_US"), + // "2.00000000", + // ); + // expect( + // Amount.fromDecimal(Decimal.fromInt(2), fractionDigits: 8) + // .localizedStringAsFixed(locale: "en_US", decimalPlaces: 4), + // "2.0000", + // ); + // expect( + // Amount.fromDecimal(Decimal.fromInt(2), fractionDigits: 8) + // .localizedStringAsFixed(locale: "en_US", decimalPlaces: 0), + // "2", + // ); + // }); }); group("deserialization", () { diff --git a/test/utilities/amount/amount_unit_test.dart b/test/utilities/amount/amount_unit_test.dart index 2dcd5125c..7af988def 100644 --- a/test/utilities/amount/amount_unit_test.dart +++ b/test/utilities/amount/amount_unit_test.dart @@ -68,7 +68,17 @@ void main() { coin: Coin.ethereum, maxDecimalPlaces: 8, ), - "10.12345678 ETH", + "~10.12345678 ETH", + ); + + expect( + AmountUnit.normal.displayAmount( + amount: amount, + locale: "en_US", + coin: Coin.ethereum, + maxDecimalPlaces: 4, + ), + "~10.1234 ETH", ); expect( @@ -88,7 +98,7 @@ void main() { coin: Coin.ethereum, maxDecimalPlaces: 9, ), - "10123.456789123 mETH", + "~10123.456789123 mETH", ); expect( @@ -98,7 +108,7 @@ void main() { coin: Coin.ethereum, maxDecimalPlaces: 8, ), - "10123456.78912345 µETH", + "~10123456.78912345 µETH", ); expect( @@ -108,7 +118,7 @@ void main() { coin: Coin.ethereum, maxDecimalPlaces: 1, ), - "10123456789.1 gwei", + "~10123456789.1 gwei", ); expect( diff --git a/test/widget_tests/address_book_card_test.mocks.dart b/test/widget_tests/address_book_card_test.mocks.dart index f26ca5dbd..1956952d8 100644 --- a/test/widget_tests/address_book_card_test.mocks.dart +++ b/test/widget_tests/address_book_card_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/address_book_card_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; import 'dart:ui' as _i5; diff --git a/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart b/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart index 9bccdcc86..142582194 100644 --- a/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart +++ b/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/custom_buttons/favorite_toggle_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:typed_data' as _i6; @@ -83,6 +85,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/custom_loading_overlay_test.mocks.dart b/test/widget_tests/custom_loading_overlay_test.mocks.dart index c2244014e..c70d52974 100644 --- a/test/widget_tests/custom_loading_overlay_test.mocks.dart +++ b/test/widget_tests/custom_loading_overlay_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/custom_loading_overlay_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:typed_data' as _i6; @@ -83,6 +85,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/custom_pin_put_test.dart b/test/widget_tests/custom_pin_put_test.dart index 28bc583d4..13b2bc892 100644 --- a/test/widget_tests/custom_pin_put_test.dart +++ b/test/widget_tests/custom_pin_put_test.dart @@ -3,20 +3,63 @@ import 'package:flutter_svg/svg.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:stackwallet/models/isar/stack_theme.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put.dart'; import 'package:stackwallet/widgets/custom_pin_put/pin_keyboard.dart'; import '../sample_data/theme_json.dart'; +class PinWidget extends StatefulWidget { + const PinWidget({ + super.key, + this.onSubmit, + this.controller, + required this.pinAnimation, + required this.isRandom, + }); + + final void Function(String)? onSubmit; + final TextEditingController? controller; + final bool isRandom; + final PinAnimationType pinAnimation; + + @override + PinWidgetState createState() => PinWidgetState(); +} + +class PinWidgetState extends State { + int pinCount = 1; + + @override + Widget build(BuildContext context) { + bool submittedPinMatches = false; + + return CustomPinPut( + fieldsCount: pinCount, + isRandom: widget.isRandom, + useNativeKeyboard: false, + eachFieldHeight: 12, + eachFieldWidth: 12, + textStyle: STextStyles.label(context).copyWith( + fontSize: 1, + ), + obscureText: "", + onPinLengthChanged: (newLength) { + setState(() { + pinCount = newLength; + }); + }, + onSubmit: widget.onSubmit, + controller: widget.controller, + pinAnimationType: widget.pinAnimation, + ); + } +} + void main() { group("CustomPinPut tests, non-random PIN", () { testWidgets("CustomPinPut with 4 fields builds correctly, non-random PIN", (tester) async { - const pinPut = CustomPinPut( - fieldsCount: 4, - isRandom: false, - ); - await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -30,13 +73,16 @@ void main() { ], ), home: const Material( - child: pinPut, + child: PinWidget( + pinAnimation: PinAnimationType.none, + isRandom: false, + ), ), ), ); // expects 5 here. Four + the actual text field text - expect(find.text(""), findsNWidgets(5)); + expect(find.text(""), findsNWidgets(1)); expect(find.byType(PinKeyboard), findsOneWidget); expect(find.byType(BackspaceKey), findsOneWidget); expect(find.byType(NumberKey), findsNWidgets(10)); @@ -45,15 +91,6 @@ void main() { testWidgets("CustomPinPut entering a pin successfully, non-random PIN", (tester) async { bool submittedPinMatches = false; - final pinPut = CustomPinPut( - fieldsCount: 4, - onSubmit: (pin) { - submittedPinMatches = pin == "1234"; - print("pin entered: $pin"); - }, - useNativeKeyboard: false, - isRandom: false, - ); await tester.pumpWidget( MaterialApp( @@ -68,7 +105,14 @@ void main() { ], ), home: Material( - child: pinPut, + child: PinWidget( + pinAnimation: PinAnimationType.none, + isRandom: false, + onSubmit: (pin) { + submittedPinMatches = pin == "1234"; + print("pin entered: $pin"); + }, + ), ), ), ); @@ -99,12 +143,6 @@ void main() { testWidgets("CustomPinPut pin enter fade animation, non-random PIN", (tester) async { final controller = TextEditingController(); - final pinPut = CustomPinPut( - fieldsCount: 4, - pinAnimationType: PinAnimationType.fade, - controller: controller, - isRandom: false, - ); await tester.pumpWidget( MaterialApp( @@ -119,7 +157,11 @@ void main() { ], ), home: Material( - child: pinPut, + child: PinWidget( + pinAnimation: PinAnimationType.none, + isRandom: false, + controller: controller, + ), ), ), ); @@ -137,12 +179,6 @@ void main() { testWidgets("CustomPinPut pin enter scale animation, non-random PIN", (tester) async { final controller = TextEditingController(); - final pinPut = CustomPinPut( - fieldsCount: 4, - pinAnimationType: PinAnimationType.scale, - controller: controller, - isRandom: false, - ); await tester.pumpWidget( MaterialApp( @@ -157,7 +193,11 @@ void main() { ], ), home: Material( - child: pinPut, + child: PinWidget( + pinAnimation: PinAnimationType.scale, + isRandom: false, + controller: controller, + ), ), ), ); @@ -175,12 +215,6 @@ void main() { testWidgets("CustomPinPut pin enter rotate animation, non-random PIN", (tester) async { final controller = TextEditingController(); - final pinPut = CustomPinPut( - fieldsCount: 4, - pinAnimationType: PinAnimationType.rotation, - controller: controller, - isRandom: false, - ); await tester.pumpWidget( MaterialApp( @@ -195,7 +229,11 @@ void main() { ], ), home: Material( - child: pinPut, + child: PinWidget( + pinAnimation: PinAnimationType.rotation, + isRandom: false, + controller: controller, + ), ), ), ); @@ -256,11 +294,6 @@ void main() { group("CustomPinPut tests, with random PIN", () { testWidgets("CustomPinPut with 4 fields builds correctly, with random PIN", (tester) async { - const pinPut = CustomPinPut( - fieldsCount: 4, - isRandom: true, - ); - await tester.pumpWidget( MaterialApp( theme: ThemeData( @@ -274,81 +307,76 @@ void main() { ], ), home: const Material( - child: pinPut, + child: PinWidget( + pinAnimation: PinAnimationType.none, + isRandom: true, + ), ), ), ); // expects 5 here. Four + the actual text field text - expect(find.text(""), findsNWidgets(5)); + expect(find.text(""), findsNWidgets(1)); expect(find.byType(PinKeyboard), findsOneWidget); expect(find.byType(BackspaceKey), findsOneWidget); expect(find.byType(NumberKey), findsNWidgets(10)); }); - testWidgets("CustomPinPut entering a pin successfully, with random PIN", - (tester) async { - bool submittedPinMatches = false; - final pinPut = CustomPinPut( - fieldsCount: 4, - onSubmit: (pin) { - submittedPinMatches = pin == "1234"; - print("pin entered: $pin"); - }, - useNativeKeyboard: false, - isRandom: true, - ); - - await tester.pumpWidget( - MaterialApp( - theme: ThemeData( - extensions: [ - StackColors.fromStackColorTheme( - StackTheme.fromJson( - json: lightThemeJsonMap, - applicationThemesDirectoryPath: "test", - ), - ), - ], - ), - home: Material( - child: pinPut, - ), - ), - ); - - await tester.tap(find.byWidgetPredicate( - (widget) => widget is NumberKey && widget.number == "1")); - await tester.pumpAndSettle(); - await tester.tap(find.byWidgetPredicate( - (widget) => widget is NumberKey && widget.number == "2")); - await tester.pumpAndSettle(); - await tester.tap(find.byWidgetPredicate( - (widget) => widget is NumberKey && widget.number == "6")); - await tester.pumpAndSettle(); - await tester.tap(find.byType(BackspaceKey)); - await tester.pumpAndSettle(); - await tester.tap(find.byWidgetPredicate( - (widget) => widget is NumberKey && widget.number == "3")); - await tester.pumpAndSettle(); - await tester.tap(find.byWidgetPredicate( - (widget) => widget is NumberKey && widget.number == "4")); - await tester.pumpAndSettle(); - await tester.tap(find.byType(SubmitKey)); - await tester.pumpAndSettle(); - - expect(submittedPinMatches, true); - }); + // testWidgets("CustomPinPut entering a pin successfully, with random PIN", + // (tester) async { + // bool submittedPinMatches = false; + // + // await tester.pumpWidget( + // MaterialApp( + // theme: ThemeData( + // extensions: [ + // StackColors.fromStackColorTheme( + // StackTheme.fromJson( + // json: lightThemeJsonMap, + // applicationThemesDirectoryPath: "test", + // ), + // ), + // ], + // ), + // home: Material( + // child: PinWidget( + // pinAnimation: PinAnimationType.none, + // isRandom: true, + // onSubmit: (pin) { + // submittedPinMatches = pin == "1234"; + // print("pin entered: $pin"); + // }, + // ), + // ), + // ), + // ); + // + // await tester.tap(find.byWidgetPredicate( + // (widget) => widget is NumberKey && widget.number == "1")); + // await tester.pumpAndSettle(); + // await tester.tap(find.byWidgetPredicate( + // (widget) => widget is NumberKey && widget.number == "2")); + // await tester.pumpAndSettle(); + // await tester.tap(find.byWidgetPredicate( + // (widget) => widget is NumberKey && widget.number == "6")); + // await tester.pumpAndSettle(); + // await tester.tap(find.byType(BackspaceKey)); + // await tester.pumpAndSettle(); + // await tester.tap(find.byWidgetPredicate( + // (widget) => widget is NumberKey && widget.number == "3")); + // await tester.pumpAndSettle(); + // await tester.tap(find.byWidgetPredicate( + // (widget) => widget is NumberKey && widget.number == "4")); + // await tester.pumpAndSettle(); + // await tester.tap(find.byType(SubmitKey)); + // await tester.pumpAndSettle(); + // + // expect(submittedPinMatches, true); + // }); testWidgets("CustomPinPut pin enter fade animation, with random PIN", (tester) async { final controller = TextEditingController(); - final pinPut = CustomPinPut( - fieldsCount: 4, - pinAnimationType: PinAnimationType.fade, - controller: controller, - isRandom: true, - ); await tester.pumpWidget( MaterialApp( @@ -363,7 +391,11 @@ void main() { ], ), home: Material( - child: pinPut, + child: PinWidget( + pinAnimation: PinAnimationType.fade, + isRandom: true, + controller: controller, + ), ), ), ); @@ -401,7 +433,11 @@ void main() { ], ), home: Material( - child: pinPut, + child: PinWidget( + isRandom: true, + controller: controller, + pinAnimation: PinAnimationType.scale, + ), ), ), ); @@ -439,7 +475,11 @@ void main() { ], ), home: Material( - child: pinPut, + child: PinWidget( + isRandom: true, + controller: controller, + pinAnimation: PinAnimationType.rotation, + ), ), ), ); diff --git a/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart b/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart index aa5f1260d..c292cdafa 100644 --- a/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart +++ b/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/desktop/desktop_scaffold_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:typed_data' as _i6; @@ -83,6 +85,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/managed_favorite_test.dart b/test/widget_tests/managed_favorite_test.dart index 569785374..e0cb0dfc7 100644 --- a/test/widget_tests/managed_favorite_test.dart +++ b/test/widget_tests/managed_favorite_test.dart @@ -17,8 +17,10 @@ import 'package:stackwallet/services/wallets_service.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_service.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/listenable_list.dart'; +import 'package:stackwallet/utilities/prefs.dart'; import 'package:stackwallet/widgets/managed_favorite.dart'; import '../sample_data/theme_json.dart'; @@ -36,6 +38,7 @@ Amount _a(int i) => Amount.fromDecimal( WalletsService, BitcoinWallet, ThemeService, + Prefs, LocaleService ], customMocks: [ MockSpec(returnNullOnMissingStub: true), @@ -47,6 +50,7 @@ void main() { final wallets = MockWallets(); final CoinServiceAPI wallet = MockBitcoinWallet(); final mockThemeService = MockThemeService(); + final mockPrefs = MockPrefs(); when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( @@ -58,6 +62,13 @@ void main() { when(wallet.walletName).thenAnswer((_) => "some wallet"); when(wallet.walletId).thenAnswer((_) => "some wallet id"); + when(mockPrefs.amountUnit(Coin.bitcoin)).thenAnswer( + (_) => AmountUnit.normal, + ); + when(mockPrefs.maxDecimals(Coin.bitcoin)).thenAnswer( + (_) => 8, + ); + final manager = Manager(wallet); when(wallets.getManager("some wallet id")) .thenAnswer((realInvocation) => manager); @@ -78,6 +89,7 @@ void main() { overrides: [ walletsChangeNotifierProvider.overrideWithValue(wallets), pThemeService.overrideWithValue(mockThemeService), + prefsChangeNotifierProvider.overrideWithValue(mockPrefs), ], child: MaterialApp( theme: ThemeData( @@ -109,6 +121,7 @@ void main() { final mockLocaleService = MockLocaleService(); final mockWalletsService = MockWalletsService(); final mockThemeService = MockThemeService(); + final mockPrefs = MockPrefs(); when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( @@ -119,6 +132,9 @@ void main() { when(wallet.coin).thenAnswer((_) => Coin.bitcoin); when(wallet.walletName).thenAnswer((_) => "some wallet"); when(wallet.walletId).thenAnswer((_) => "some wallet id"); + when(mockPrefs.amountUnit(Coin.bitcoin)).thenAnswer( + (_) => AmountUnit.normal, + ); final manager = Manager(wallet); @@ -135,6 +151,10 @@ void main() { when(manager.isFavorite).thenAnswer((realInvocation) => false); + when(mockPrefs.maxDecimals(Coin.bitcoin)).thenAnswer( + (_) => 8, + ); + when(mockLocaleService.locale).thenAnswer((_) => "en_US"); when(wallets.getManagerProvider("some wallet id")).thenAnswer( @@ -157,7 +177,8 @@ void main() { nonFavoritesProvider.overrideWithValue(nonfavorites), pThemeService.overrideWithValue(mockThemeService), walletsServiceChangeNotifierProvider - .overrideWithValue(mockWalletsService) + .overrideWithValue(mockWalletsService), + prefsChangeNotifierProvider.overrideWithValue(mockPrefs), ], child: MaterialApp( theme: ThemeData( @@ -188,6 +209,7 @@ void main() { final mockLocaleService = MockLocaleService(); final mockWalletsService = MockWalletsService(); final mockThemeService = MockThemeService(); + final mockPrefs = MockPrefs(); when(mockThemeService.getTheme(themeId: "light")).thenAnswer( (_) => StackTheme.fromJson( @@ -199,6 +221,10 @@ void main() { when(wallet.walletName).thenAnswer((_) => "some wallet"); when(wallet.walletId).thenAnswer((_) => "some wallet id"); + when(mockPrefs.maxDecimals(Coin.bitcoin)).thenAnswer( + (_) => 8, + ); + final manager = Manager(wallet); when(wallets.getManager("some wallet id")) @@ -213,6 +239,9 @@ void main() { pendingSpendable: _a(0), ), ); + when(mockPrefs.amountUnit(Coin.bitcoin)).thenAnswer( + (_) => AmountUnit.normal, + ); when(mockLocaleService.locale).thenAnswer((_) => "en_US"); @@ -235,6 +264,7 @@ void main() { favoritesProvider.overrideWithValue(favorites), nonFavoritesProvider.overrideWithValue(nonfavorites), pThemeService.overrideWithValue(mockThemeService), + prefsChangeNotifierProvider.overrideWithValue(mockPrefs), walletsServiceChangeNotifierProvider .overrideWithValue(mockWalletsService) ], diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index 1be169e52..1c47708fe 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/managed_favorite_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i23; import 'dart:typed_data' as _i29; @@ -19,13 +21,13 @@ import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9; import 'package:stackwallet/models/balance.dart' as _i11; import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; import 'package:stackwallet/models/isar/stack_theme.dart' as _i31; -import 'package:stackwallet/models/node_model.dart' as _i33; +import 'package:stackwallet/models/node_model.dart' as _i36; import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8; import 'package:stackwallet/models/signing_data.dart' as _i28; import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i26; import 'package:stackwallet/services/coins/coin_service.dart' as _i20; import 'package:stackwallet/services/coins/manager.dart' as _i6; -import 'package:stackwallet/services/locale_service.dart' as _i32; +import 'package:stackwallet/services/locale_service.dart' as _i35; import 'package:stackwallet/services/node_service.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' as _i7; @@ -33,8 +35,11 @@ import 'package:stackwallet/services/wallets.dart' as _i21; import 'package:stackwallet/services/wallets_service.dart' as _i2; import 'package:stackwallet/themes/theme_service.dart' as _i30; import 'package:stackwallet/utilities/amount/amount.dart' as _i14; +import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i34; +import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i33; import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i22; import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i27; +import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i32; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' as _i19; import 'package:stackwallet/utilities/prefs.dart' as _i24; @@ -334,9 +339,8 @@ class MockWallets extends _i1.Mock implements _i21.Wallets { #getManagerProvidersByCoin, [], ), - returnValue: < - _i15.Tuple2<_i22.Coin, - List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + returnValue: <_i15.Tuple2<_i22.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< _i15.Tuple2<_i22.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @@ -778,7 +782,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override _i23.Future> get utxos => (super.noSuchMethod( @@ -1526,14 +1530,12 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required int Function({ required int feeRatePerKB, required int vSize, - })? - estimateTxFee, + })? estimateTxFee, required _i23.Future> Function({ required String address, required _i14.Amount amount, Map? args, - })? - prepareSend, + })? prepareSend, required _i23.Future Function({required String address})? getTxCount, required _i23.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, @@ -2008,6 +2010,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override _i23.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( @@ -2047,10 +2058,488 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService { )) as _i31.StackTheme?); } +/// A class which mocks [Prefs]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockPrefs extends _i1.Mock implements _i24.Prefs { + MockPrefs() { + _i1.throwOnMissingStub(this); + } + + @override + bool get isInitialized => (super.noSuchMethod( + Invocation.getter(#isInitialized), + returnValue: false, + ) as bool); + @override + int get lastUnlockedTimeout => (super.noSuchMethod( + Invocation.getter(#lastUnlockedTimeout), + returnValue: 0, + ) as int); + @override + set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + Invocation.setter( + #lastUnlockedTimeout, + lastUnlockedTimeout, + ), + returnValueForMissingStub: null, + ); + @override + int get lastUnlocked => (super.noSuchMethod( + Invocation.getter(#lastUnlocked), + returnValue: 0, + ) as int); + @override + set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + Invocation.setter( + #lastUnlocked, + lastUnlocked, + ), + returnValueForMissingStub: null, + ); + @override + int get currentNotificationId => (super.noSuchMethod( + Invocation.getter(#currentNotificationId), + returnValue: 0, + ) as int); + @override + List get walletIdsSyncOnStartup => (super.noSuchMethod( + Invocation.getter(#walletIdsSyncOnStartup), + returnValue: [], + ) as List); + @override + set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => + super.noSuchMethod( + Invocation.setter( + #walletIdsSyncOnStartup, + walletIdsSyncOnStartup, + ), + returnValueForMissingStub: null, + ); + @override + _i32.SyncingType get syncType => (super.noSuchMethod( + Invocation.getter(#syncType), + returnValue: _i32.SyncingType.currentWalletOnly, + ) as _i32.SyncingType); + @override + set syncType(_i32.SyncingType? syncType) => super.noSuchMethod( + Invocation.setter( + #syncType, + syncType, + ), + returnValueForMissingStub: null, + ); + @override + bool get wifiOnly => (super.noSuchMethod( + Invocation.getter(#wifiOnly), + returnValue: false, + ) as bool); + @override + set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + Invocation.setter( + #wifiOnly, + wifiOnly, + ), + returnValueForMissingStub: null, + ); + @override + bool get showFavoriteWallets => (super.noSuchMethod( + Invocation.getter(#showFavoriteWallets), + returnValue: false, + ) as bool); + @override + set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( + Invocation.setter( + #showFavoriteWallets, + showFavoriteWallets, + ), + returnValueForMissingStub: null, + ); + @override + String get language => (super.noSuchMethod( + Invocation.getter(#language), + returnValue: '', + ) as String); + @override + set language(String? newLanguage) => super.noSuchMethod( + Invocation.setter( + #language, + newLanguage, + ), + returnValueForMissingStub: null, + ); + @override + String get currency => (super.noSuchMethod( + Invocation.getter(#currency), + returnValue: '', + ) as String); + @override + set currency(String? newCurrency) => super.noSuchMethod( + Invocation.setter( + #currency, + newCurrency, + ), + returnValueForMissingStub: null, + ); + @override + bool get randomizePIN => (super.noSuchMethod( + Invocation.getter(#randomizePIN), + returnValue: false, + ) as bool); + @override + set randomizePIN(bool? randomizePIN) => super.noSuchMethod( + Invocation.setter( + #randomizePIN, + randomizePIN, + ), + returnValueForMissingStub: null, + ); + @override + bool get useBiometrics => (super.noSuchMethod( + Invocation.getter(#useBiometrics), + returnValue: false, + ) as bool); + @override + set useBiometrics(bool? useBiometrics) => super.noSuchMethod( + Invocation.setter( + #useBiometrics, + useBiometrics, + ), + returnValueForMissingStub: null, + ); + @override + bool get hasPin => (super.noSuchMethod( + Invocation.getter(#hasPin), + returnValue: false, + ) as bool); + @override + set hasPin(bool? hasPin) => super.noSuchMethod( + Invocation.setter( + #hasPin, + hasPin, + ), + returnValueForMissingStub: null, + ); + @override + int get familiarity => (super.noSuchMethod( + Invocation.getter(#familiarity), + returnValue: 0, + ) as int); + @override + set familiarity(int? familiarity) => super.noSuchMethod( + Invocation.setter( + #familiarity, + familiarity, + ), + returnValueForMissingStub: null, + ); + @override + bool get showTestNetCoins => (super.noSuchMethod( + Invocation.getter(#showTestNetCoins), + returnValue: false, + ) as bool); + @override + set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( + Invocation.setter( + #showTestNetCoins, + showTestNetCoins, + ), + returnValueForMissingStub: null, + ); + @override + bool get isAutoBackupEnabled => (super.noSuchMethod( + Invocation.getter(#isAutoBackupEnabled), + returnValue: false, + ) as bool); + @override + set isAutoBackupEnabled(bool? isAutoBackupEnabled) => super.noSuchMethod( + Invocation.setter( + #isAutoBackupEnabled, + isAutoBackupEnabled, + ), + returnValueForMissingStub: null, + ); + @override + set autoBackupLocation(String? autoBackupLocation) => super.noSuchMethod( + Invocation.setter( + #autoBackupLocation, + autoBackupLocation, + ), + returnValueForMissingStub: null, + ); + @override + _i33.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( + Invocation.getter(#backupFrequencyType), + returnValue: _i33.BackupFrequencyType.everyTenMinutes, + ) as _i33.BackupFrequencyType); + @override + set backupFrequencyType(_i33.BackupFrequencyType? backupFrequencyType) => + super.noSuchMethod( + Invocation.setter( + #backupFrequencyType, + backupFrequencyType, + ), + returnValueForMissingStub: null, + ); + @override + set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( + Invocation.setter( + #lastAutoBackup, + lastAutoBackup, + ), + returnValueForMissingStub: null, + ); + @override + bool get hideBlockExplorerWarning => (super.noSuchMethod( + Invocation.getter(#hideBlockExplorerWarning), + returnValue: false, + ) as bool); + @override + set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => + super.noSuchMethod( + Invocation.setter( + #hideBlockExplorerWarning, + hideBlockExplorerWarning, + ), + returnValueForMissingStub: null, + ); + @override + bool get gotoWalletOnStartup => (super.noSuchMethod( + Invocation.getter(#gotoWalletOnStartup), + returnValue: false, + ) as bool); + @override + set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( + Invocation.setter( + #gotoWalletOnStartup, + gotoWalletOnStartup, + ), + returnValueForMissingStub: null, + ); + @override + set startupWalletId(String? startupWalletId) => super.noSuchMethod( + Invocation.setter( + #startupWalletId, + startupWalletId, + ), + returnValueForMissingStub: null, + ); + @override + bool get externalCalls => (super.noSuchMethod( + Invocation.getter(#externalCalls), + returnValue: false, + ) as bool); + @override + set externalCalls(bool? externalCalls) => super.noSuchMethod( + Invocation.setter( + #externalCalls, + externalCalls, + ), + returnValueForMissingStub: null, + ); + @override + bool get enableCoinControl => (super.noSuchMethod( + Invocation.getter(#enableCoinControl), + returnValue: false, + ) as bool); + @override + set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( + Invocation.setter( + #enableCoinControl, + enableCoinControl, + ), + returnValueForMissingStub: null, + ); + @override + bool get enableSystemBrightness => (super.noSuchMethod( + Invocation.getter(#enableSystemBrightness), + returnValue: false, + ) as bool); + @override + set enableSystemBrightness(bool? enableSystemBrightness) => + super.noSuchMethod( + Invocation.setter( + #enableSystemBrightness, + enableSystemBrightness, + ), + returnValueForMissingStub: null, + ); + @override + String get themeId => (super.noSuchMethod( + Invocation.getter(#themeId), + returnValue: '', + ) as String); + @override + set themeId(String? themeId) => super.noSuchMethod( + Invocation.setter( + #themeId, + themeId, + ), + returnValueForMissingStub: null, + ); + @override + String get systemBrightnessLightThemeId => (super.noSuchMethod( + Invocation.getter(#systemBrightnessLightThemeId), + returnValue: '', + ) as String); + @override + set systemBrightnessLightThemeId(String? systemBrightnessLightThemeId) => + super.noSuchMethod( + Invocation.setter( + #systemBrightnessLightThemeId, + systemBrightnessLightThemeId, + ), + returnValueForMissingStub: null, + ); + @override + String get systemBrightnessDarkThemeId => (super.noSuchMethod( + Invocation.getter(#systemBrightnessDarkThemeId), + returnValue: '', + ) as String); + @override + set systemBrightnessDarkThemeId(String? systemBrightnessDarkThemeId) => + super.noSuchMethod( + Invocation.setter( + #systemBrightnessDarkThemeId, + systemBrightnessDarkThemeId, + ), + returnValueForMissingStub: null, + ); + @override + bool get hasListeners => (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + ) as bool); + @override + _i23.Future init() => (super.noSuchMethod( + Invocation.method( + #init, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( + Invocation.method( + #incrementCurrentNotificationIndex, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future isExternalCallsSet() => (super.noSuchMethod( + Invocation.method( + #isExternalCallsSet, + [], + ), + returnValue: _i23.Future.value(false), + ) as _i23.Future); + @override + _i23.Future saveUserID(String? userId) => (super.noSuchMethod( + Invocation.method( + #saveUserID, + [userId], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( + Invocation.method( + #saveSignupEpoch, + [signupEpoch], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i34.AmountUnit amountUnit(_i22.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #amountUnit, + [coin], + ), + returnValue: _i34.AmountUnit.normal, + ) as _i34.AmountUnit); + @override + void updateAmountUnit({ + required _i22.Coin? coin, + required _i34.AmountUnit? amountUnit, + }) => + super.noSuchMethod( + Invocation.method( + #updateAmountUnit, + [], + { + #coin: coin, + #amountUnit: amountUnit, + }, + ), + returnValueForMissingStub: null, + ); + @override + int maxDecimals(_i22.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #maxDecimals, + [coin], + ), + returnValue: 0, + ) as int); + @override + void updateMaxDecimals({ + required _i22.Coin? coin, + required int? maxDecimals, + }) => + super.noSuchMethod( + Invocation.method( + #updateMaxDecimals, + [], + { + #coin: coin, + #maxDecimals: maxDecimals, + }, + ), + returnValueForMissingStub: null, + ); + @override + void addListener(_i25.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #addListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void removeListener(_i25.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #removeListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method( + #notifyListeners, + [], + ), + returnValueForMissingStub: null, + ); +} + /// A class which mocks [LocaleService]. /// /// See the documentation for Mockito's code generation for more information. -class MockLocaleService extends _i1.Mock implements _i32.LocaleService { +class MockLocaleService extends _i1.Mock implements _i35.LocaleService { MockLocaleService() { _i1.throwOnMissingStub(this); } @@ -2122,15 +2611,15 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { ), ) as _i19.SecureStorageInterface); @override - List<_i33.NodeModel> get primaryNodes => (super.noSuchMethod( + List<_i36.NodeModel> get primaryNodes => (super.noSuchMethod( Invocation.getter(#primaryNodes), - returnValue: <_i33.NodeModel>[], - ) as List<_i33.NodeModel>); + returnValue: <_i36.NodeModel>[], + ) as List<_i36.NodeModel>); @override - List<_i33.NodeModel> get nodes => (super.noSuchMethod( + List<_i36.NodeModel> get nodes => (super.noSuchMethod( Invocation.getter(#nodes), - returnValue: <_i33.NodeModel>[], - ) as List<_i33.NodeModel>); + returnValue: <_i36.NodeModel>[], + ) as List<_i36.NodeModel>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), @@ -2148,7 +2637,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { @override _i23.Future setPrimaryNodeFor({ required _i22.Coin? coin, - required _i33.NodeModel? node, + required _i36.NodeModel? node, bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( @@ -2165,40 +2654,40 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i33.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) => + _i36.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getPrimaryNodeFor, [], {#coin: coin}, - )) as _i33.NodeModel?); + )) as _i36.NodeModel?); @override - List<_i33.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod( + List<_i36.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod( Invocation.method( #getNodesFor, [coin], ), - returnValue: <_i33.NodeModel>[], - ) as List<_i33.NodeModel>); + returnValue: <_i36.NodeModel>[], + ) as List<_i36.NodeModel>); @override - _i33.NodeModel? getNodeById({required String? id}) => + _i36.NodeModel? getNodeById({required String? id}) => (super.noSuchMethod(Invocation.method( #getNodeById, [], {#id: id}, - )) as _i33.NodeModel?); + )) as _i36.NodeModel?); @override - List<_i33.NodeModel> failoverNodesFor({required _i22.Coin? coin}) => + List<_i36.NodeModel> failoverNodesFor({required _i22.Coin? coin}) => (super.noSuchMethod( Invocation.method( #failoverNodesFor, [], {#coin: coin}, ), - returnValue: <_i33.NodeModel>[], - ) as List<_i33.NodeModel>); + returnValue: <_i36.NodeModel>[], + ) as List<_i36.NodeModel>); @override _i23.Future add( - _i33.NodeModel? node, + _i36.NodeModel? node, String? password, bool? shouldNotifyListeners, ) => @@ -2250,7 +2739,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { ) as _i23.Future); @override _i23.Future edit( - _i33.NodeModel? editedNode, + _i36.NodeModel? editedNode, String? password, bool? shouldNotifyListeners, ) => @@ -2342,7 +2831,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override bool get isRefreshing => (super.noSuchMethod( @@ -2710,7 +3199,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/widget_tests/node_card_test.mocks.dart b/test/widget_tests/node_card_test.mocks.dart index 6b85a4f5d..da768f3c6 100644 --- a/test/widget_tests/node_card_test.mocks.dart +++ b/test/widget_tests/node_card_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/node_card_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:ui' as _i7; diff --git a/test/widget_tests/node_options_sheet_test.mocks.dart b/test/widget_tests/node_options_sheet_test.mocks.dart index d90ee6681..7b35c18e9 100644 --- a/test/widget_tests/node_options_sheet_test.mocks.dart +++ b/test/widget_tests/node_options_sheet_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/node_options_sheet_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i11; import 'dart:ui' as _i13; @@ -9,11 +11,12 @@ import 'dart:ui' as _i13; import 'package:flutter/foundation.dart' as _i4; import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/models/node_model.dart' as _i16; +import 'package:stackwallet/models/node_model.dart' as _i17; import 'package:stackwallet/services/coins/manager.dart' as _i6; import 'package:stackwallet/services/node_service.dart' as _i3; import 'package:stackwallet/services/wallets.dart' as _i8; import 'package:stackwallet/services/wallets_service.dart' as _i2; +import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i16; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i15; import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i9; import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i14; @@ -172,9 +175,8 @@ class MockWallets extends _i1.Mock implements _i8.Wallets { #getManagerProvidersByCoin, [], ), - returnValue: < - _i10.Tuple2<_i9.Coin, - List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + returnValue: <_i10.Tuple2<_i9.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< _i10.Tuple2<_i9.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @@ -691,6 +693,54 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { returnValueForMissingStub: _i11.Future.value(), ) as _i11.Future); @override + _i16.AmountUnit amountUnit(_i9.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #amountUnit, + [coin], + ), + returnValue: _i16.AmountUnit.normal, + ) as _i16.AmountUnit); + @override + void updateAmountUnit({ + required _i9.Coin? coin, + required _i16.AmountUnit? amountUnit, + }) => + super.noSuchMethod( + Invocation.method( + #updateAmountUnit, + [], + { + #coin: coin, + #amountUnit: amountUnit, + }, + ), + returnValueForMissingStub: null, + ); + @override + int maxDecimals(_i9.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #maxDecimals, + [coin], + ), + returnValue: 0, + ) as int); + @override + void updateMaxDecimals({ + required _i9.Coin? coin, + required int? maxDecimals, + }) => + super.noSuchMethod( + Invocation.method( + #updateMaxDecimals, + [], + { + #coin: coin, + #maxDecimals: maxDecimals, + }, + ), + returnValueForMissingStub: null, + ); + @override void addListener(_i13.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, @@ -741,15 +791,15 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { ), ) as _i7.SecureStorageInterface); @override - List<_i16.NodeModel> get primaryNodes => (super.noSuchMethod( + List<_i17.NodeModel> get primaryNodes => (super.noSuchMethod( Invocation.getter(#primaryNodes), - returnValue: <_i16.NodeModel>[], - ) as List<_i16.NodeModel>); + returnValue: <_i17.NodeModel>[], + ) as List<_i17.NodeModel>); @override - List<_i16.NodeModel> get nodes => (super.noSuchMethod( + List<_i17.NodeModel> get nodes => (super.noSuchMethod( Invocation.getter(#nodes), - returnValue: <_i16.NodeModel>[], - ) as List<_i16.NodeModel>); + returnValue: <_i17.NodeModel>[], + ) as List<_i17.NodeModel>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), @@ -767,7 +817,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { @override _i11.Future setPrimaryNodeFor({ required _i9.Coin? coin, - required _i16.NodeModel? node, + required _i17.NodeModel? node, bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( @@ -784,40 +834,40 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { returnValueForMissingStub: _i11.Future.value(), ) as _i11.Future); @override - _i16.NodeModel? getPrimaryNodeFor({required _i9.Coin? coin}) => + _i17.NodeModel? getPrimaryNodeFor({required _i9.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getPrimaryNodeFor, [], {#coin: coin}, - )) as _i16.NodeModel?); + )) as _i17.NodeModel?); @override - List<_i16.NodeModel> getNodesFor(_i9.Coin? coin) => (super.noSuchMethod( + List<_i17.NodeModel> getNodesFor(_i9.Coin? coin) => (super.noSuchMethod( Invocation.method( #getNodesFor, [coin], ), - returnValue: <_i16.NodeModel>[], - ) as List<_i16.NodeModel>); + returnValue: <_i17.NodeModel>[], + ) as List<_i17.NodeModel>); @override - _i16.NodeModel? getNodeById({required String? id}) => + _i17.NodeModel? getNodeById({required String? id}) => (super.noSuchMethod(Invocation.method( #getNodeById, [], {#id: id}, - )) as _i16.NodeModel?); + )) as _i17.NodeModel?); @override - List<_i16.NodeModel> failoverNodesFor({required _i9.Coin? coin}) => + List<_i17.NodeModel> failoverNodesFor({required _i9.Coin? coin}) => (super.noSuchMethod( Invocation.method( #failoverNodesFor, [], {#coin: coin}, ), - returnValue: <_i16.NodeModel>[], - ) as List<_i16.NodeModel>); + returnValue: <_i17.NodeModel>[], + ) as List<_i17.NodeModel>); @override _i11.Future add( - _i16.NodeModel? node, + _i17.NodeModel? node, String? password, bool? shouldNotifyListeners, ) => @@ -869,7 +919,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { ) as _i11.Future); @override _i11.Future edit( - _i16.NodeModel? editedNode, + _i17.NodeModel? editedNode, String? password, bool? shouldNotifyListeners, ) => diff --git a/test/widget_tests/table_view/table_view_row_test.mocks.dart b/test/widget_tests/table_view/table_view_row_test.mocks.dart index 62a4e3bd5..56607efda 100644 --- a/test/widget_tests/table_view/table_view_row_test.mocks.dart +++ b/test/widget_tests/table_view/table_view_row_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/table_view/table_view_row_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i22; import 'dart:typed_data' as _i27; @@ -322,9 +324,8 @@ class MockWallets extends _i1.Mock implements _i20.Wallets { #getManagerProvidersByCoin, [], ), - returnValue: < - _i15.Tuple2<_i21.Coin, - List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + returnValue: <_i15.Tuple2<_i21.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< _i15.Tuple2<_i21.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @@ -729,6 +730,15 @@ class MockThemeService extends _i1.Mock implements _i25.ThemeService { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override + _i22.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); + @override _i22.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( @@ -856,7 +866,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i28.BitcoinWallet { @override _i21.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i21.Coin.bitcoin, + returnValue: _i21.Coin.banano, ) as _i21.Coin); @override _i22.Future> get utxos => (super.noSuchMethod( @@ -1605,14 +1615,12 @@ class MockBitcoinWallet extends _i1.Mock implements _i28.BitcoinWallet { required int Function({ required int feeRatePerKB, required int vSize, - })? - estimateTxFee, + })? estimateTxFee, required _i22.Future> Function({ required String address, required _i14.Amount amount, Map? args, - })? - prepareSend, + })? prepareSend, required _i22.Future Function({required String address})? getTxCount, required _i22.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, @@ -2069,7 +2077,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i21.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i21.Coin.bitcoin, + returnValue: _i21.Coin.banano, ) as _i21.Coin); @override bool get isRefreshing => (super.noSuchMethod( @@ -2437,7 +2445,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i19.CoinServiceAPI { @override _i21.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i21.Coin.bitcoin, + returnValue: _i21.Coin.banano, ) as _i21.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/widget_tests/trade_card_test.mocks.dart b/test/widget_tests/trade_card_test.mocks.dart index b4092378c..bf205972c 100644 --- a/test/widget_tests/trade_card_test.mocks.dart +++ b/test/widget_tests/trade_card_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/trade_card_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:typed_data' as _i6; @@ -83,6 +85,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/transaction_card_test.dart b/test/widget_tests/transaction_card_test.dart index fcad532fa..3a9765720 100644 --- a/test/widget_tests/transaction_card_test.dart +++ b/test/widget_tests/transaction_card_test.dart @@ -6,11 +6,15 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockingjay/mockingjay.dart' as mockingjay; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:stackwallet/models/isar/models/blockchain_data/address.dart'; -import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +import 'package:stackwallet/db/isar/main_db.dart'; +import 'package:stackwallet/models/isar/models/isar_models.dart'; import 'package:stackwallet/models/isar/stack_theme.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; -import 'package:stackwallet/providers/providers.dart'; +import 'package:stackwallet/providers/db/main_db_provider.dart'; +import 'package:stackwallet/providers/global/locale_provider.dart'; +import 'package:stackwallet/providers/global/prefs_provider.dart'; +import 'package:stackwallet/providers/global/price_provider.dart'; +import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/services/coins/coin_service.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/coins/manager.dart'; @@ -21,6 +25,7 @@ import 'package:stackwallet/services/wallets.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_service.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/prefs.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -40,6 +45,7 @@ import 'transaction_card_test.mocks.dart'; PriceService, NotesService, ThemeService, + MainDB, ], customMocks: []) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -50,6 +56,7 @@ void main() { final mockPrefs = MockPrefs(); final mockPriceService = MockPriceService(); final mockThemeService = MockThemeService(); + final mockDB = MockMainDB(); final tx = Transaction( txid: "some txid", @@ -71,6 +78,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -101,6 +109,17 @@ void main() { .thenAnswer((realInvocation) => Manager(wallet)); when(wallet.storedChainHeight).thenAnswer((_) => 6000000); + + when(mockPrefs.amountUnit(Coin.firo)).thenAnswer( + (_) => AmountUnit.normal, + ); + when(mockPrefs.maxDecimals(Coin.firo)).thenAnswer( + (_) => 8, + ); + + when(mockDB.getEthContractSync("")).thenAnswer( + (_) => null, + ); // await tester.pumpWidget( ProviderScope( @@ -110,7 +129,8 @@ void main() { .overrideWithValue(mockLocaleService), pThemeService.overrideWithValue(mockThemeService), prefsChangeNotifierProvider.overrideWithValue(mockPrefs), - priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService) + priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService), + mainDBProvider.overrideWithValue(mockDB), ], child: MaterialApp( theme: ThemeData( @@ -154,7 +174,7 @@ void main() { verify(mockPriceService.getPrice(Coin.firo)).called(1); verify(wallet.coin.ticker).called(1); - verify(mockLocaleService.locale).called(1); + verify(mockLocaleService.locale).called(2); verifyNoMoreInteractions(mockManager); verifyNoMoreInteractions(mockLocaleService); @@ -167,6 +187,7 @@ void main() { final mockPrefs = MockPrefs(); final mockPriceService = MockPriceService(); final mockThemeService = MockThemeService(); + final mockDB = MockMainDB(); final tx = Transaction( txid: "some txid", @@ -188,6 +209,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -215,6 +237,17 @@ void main() { when(wallet.coin).thenAnswer((_) => Coin.firo); when(wallet.storedChainHeight).thenAnswer((_) => 6000000); + when(mockPrefs.amountUnit(Coin.firo)).thenAnswer( + (_) => AmountUnit.normal, + ); + when(mockPrefs.maxDecimals(Coin.firo)).thenAnswer( + (_) => 8, + ); + + when(mockDB.getEthContractSync("")).thenAnswer( + (_) => null, + ); + when(wallets.getManager("wallet-id")) .thenAnswer((realInvocation) => Manager(wallet)); // @@ -226,6 +259,7 @@ void main() { .overrideWithValue(mockLocaleService), prefsChangeNotifierProvider.overrideWithValue(mockPrefs), pThemeService.overrideWithValue(mockThemeService), + mainDBProvider.overrideWithValue(mockDB), priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService) ], child: MaterialApp( @@ -268,7 +302,7 @@ void main() { verify(mockPriceService.getPrice(Coin.firo)).called(1); verify(wallet.coin.ticker).called(1); - verify(mockLocaleService.locale).called(1); + verify(mockLocaleService.locale).called(2); verifyNoMoreInteractions(mockManager); verifyNoMoreInteractions(mockLocaleService); @@ -281,6 +315,7 @@ void main() { final mockPrefs = MockPrefs(); final mockPriceService = MockPriceService(); final mockThemeService = MockThemeService(); + final mockDB = MockMainDB(); final tx = Transaction( txid: "some txid", @@ -302,6 +337,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -333,6 +369,17 @@ void main() { when(wallet.storedChainHeight).thenAnswer((_) => 6000000); + when(mockPrefs.amountUnit(Coin.firo)).thenAnswer( + (_) => AmountUnit.normal, + ); + when(mockPrefs.maxDecimals(Coin.firo)).thenAnswer( + (_) => 8, + ); + + when(mockDB.getEthContractSync("")).thenAnswer( + (_) => null, + ); + await tester.pumpWidget( ProviderScope( overrides: [ @@ -341,6 +388,7 @@ void main() { .overrideWithValue(mockLocaleService), prefsChangeNotifierProvider.overrideWithValue(mockPrefs), pThemeService.overrideWithValue(mockThemeService), + mainDBProvider.overrideWithValue(mockDB), priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService) ], child: MaterialApp( @@ -375,7 +423,7 @@ void main() { verify(mockPriceService.getPrice(Coin.firo)).called(1); verify(wallet.coin.ticker).called(1); - verify(mockLocaleService.locale).called(1); + verify(mockLocaleService.locale).called(2); verifyNoMoreInteractions(mockManager); verifyNoMoreInteractions(mockLocaleService); @@ -388,6 +436,7 @@ void main() { final mockPrefs = MockPrefs(); final mockPriceService = MockPriceService(); final mockThemeService = MockThemeService(); + final mockDB = MockMainDB(); final navigator = mockingjay.MockNavigator(); final tx = Transaction( @@ -410,6 +459,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -446,6 +496,17 @@ void main() { arguments: Tuple3(tx, Coin.firo, "wallet id"))) .thenAnswer((_) async => {}); + when(mockPrefs.amountUnit(Coin.firo)).thenAnswer( + (_) => AmountUnit.normal, + ); + when(mockPrefs.maxDecimals(Coin.firo)).thenAnswer( + (_) => 8, + ); + + when(mockDB.getEthContractSync("")).thenAnswer( + (_) => null, + ); + await tester.pumpWidget( ProviderScope( overrides: [ @@ -454,6 +515,7 @@ void main() { .overrideWithValue(mockLocaleService), prefsChangeNotifierProvider.overrideWithValue(mockPrefs), pThemeService.overrideWithValue(mockThemeService), + mainDBProvider.overrideWithValue(mockDB), priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService) ], child: MaterialApp( @@ -482,7 +544,7 @@ void main() { verify(mockLocaleService.addListener(any)).called(1); verify(mockPrefs.currency).called(2); - verify(mockLocaleService.locale).called(4); + verify(mockLocaleService.locale).called(3); verify(wallet.coin.ticker).called(1); verify(wallet.storedChainHeight).called(2); diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index 67081a304..9f2817de9 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -1,41 +1,47 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/transaction_card_test.dart. // Do not manually edit this file. -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i18; -import 'dart:typed_data' as _i32; -import 'dart:ui' as _i20; +// @dart=2.19 -import 'package:decimal/decimal.dart' as _i28; +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i19; +import 'dart:typed_data' as _i34; +import 'dart:ui' as _i21; + +import 'package:decimal/decimal.dart' as _i30; import 'package:flutter/foundation.dart' as _i4; import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5; +import 'package:isar/isar.dart' as _i16; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/db/isar/main_db.dart' as _i14; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i13; import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i12; import 'package:stackwallet/models/balance.dart' as _i9; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i21; -import 'package:stackwallet/models/isar/stack_theme.dart' as _i31; +import 'package:stackwallet/models/isar/models/block_explorer.dart' as _i36; +import 'package:stackwallet/models/isar/models/contact_entry.dart' as _i35; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i22; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i33; import 'package:stackwallet/models/models.dart' as _i8; -import 'package:stackwallet/models/signing_data.dart' as _i23; +import 'package:stackwallet/models/signing_data.dart' as _i24; import 'package:stackwallet/services/coins/coin_service.dart' as _i7; -import 'package:stackwallet/services/coins/firo/firo_wallet.dart' as _i22; +import 'package:stackwallet/services/coins/firo/firo_wallet.dart' as _i23; import 'package:stackwallet/services/coins/manager.dart' as _i6; -import 'package:stackwallet/services/locale_service.dart' as _i24; +import 'package:stackwallet/services/locale_service.dart' as _i25; import 'package:stackwallet/services/node_service.dart' as _i3; -import 'package:stackwallet/services/notes_service.dart' as _i29; -import 'package:stackwallet/services/price_service.dart' as _i27; +import 'package:stackwallet/services/notes_service.dart' as _i31; +import 'package:stackwallet/services/price_service.dart' as _i29; import 'package:stackwallet/services/transaction_notification_tracker.dart' as _i11; -import 'package:stackwallet/services/wallets.dart' as _i16; +import 'package:stackwallet/services/wallets.dart' as _i17; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/themes/theme_service.dart' as _i30; +import 'package:stackwallet/themes/theme_service.dart' as _i32; import 'package:stackwallet/utilities/amount/amount.dart' as _i10; -import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i26; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i17; -import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i25; -import 'package:stackwallet/utilities/prefs.dart' as _i19; +import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i28; +import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i27; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i18; +import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i26; +import 'package:stackwallet/utilities/prefs.dart' as _i20; import 'package:tuple/tuple.dart' as _i15; // ignore_for_file: type=lint @@ -195,10 +201,31 @@ class _FakeTuple2_13 extends _i1.SmartFake ); } +class _FakeIsar_14 extends _i1.SmartFake implements _i16.Isar { + _FakeIsar_14( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeQueryBuilder_15 extends _i1.SmartFake + implements _i16.QueryBuilder { + _FakeQueryBuilder_15( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [Wallets]. /// /// See the documentation for Mockito's code generation for more information. -class MockWallets extends _i1.Mock implements _i16.Wallets { +class MockWallets extends _i1.Mock implements _i17.Wallets { MockWallets() { _i1.throwOnMissingStub(this); } @@ -265,7 +292,7 @@ class MockWallets extends _i1.Mock implements _i16.Wallets { returnValueForMissingStub: null, ); @override - List getWalletIdsFor({required _i17.Coin? coin}) => + List getWalletIdsFor({required _i18.Coin? coin}) => (super.noSuchMethod( Invocation.method( #getWalletIdsFor, @@ -275,21 +302,20 @@ class MockWallets extends _i1.Mock implements _i16.Wallets { returnValue: [], ) as List); @override - List<_i15.Tuple2<_i17.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>> + List<_i15.Tuple2<_i18.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>> getManagerProvidersByCoin() => (super.noSuchMethod( Invocation.method( #getManagerProvidersByCoin, [], ), - returnValue: < - _i15.Tuple2<_i17.Coin, - List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + returnValue: <_i15.Tuple2<_i18.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< - _i15.Tuple2<_i17.Coin, + _i15.Tuple2<_i18.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @override List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( - _i17.Coin? coin) => + _i18.Coin? coin) => (super.noSuchMethod( Invocation.method( #getManagerProvidersForCoin, @@ -353,17 +379,17 @@ class MockWallets extends _i1.Mock implements _i16.Wallets { returnValueForMissingStub: null, ); @override - _i18.Future load(_i19.Prefs? prefs) => (super.noSuchMethod( + _i19.Future load(_i20.Prefs? prefs) => (super.noSuchMethod( Invocation.method( #load, [prefs], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future loadAfterStackRestore( - _i19.Prefs? prefs, + _i19.Future loadAfterStackRestore( + _i20.Prefs? prefs, List<_i6.Manager>? managers, ) => (super.noSuchMethod( @@ -374,11 +400,11 @@ class MockWallets extends _i1.Mock implements _i16.Wallets { managers, ], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -386,7 +412,7 @@ class MockWallets extends _i1.Mock implements _i16.Wallets { returnValueForMissingStub: null, ); @override - void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -438,10 +464,10 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override - _i17.Coin get coin => (super.noSuchMethod( + _i18.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i17.Coin.bitcoin, - ) as _i17.Coin); + returnValue: _i18.Coin.banano, + ) as _i18.Coin); @override bool get isRefreshing => (super.noSuchMethod( Invocation.getter(#isRefreshing), @@ -474,23 +500,23 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValueForMissingStub: null, ); @override - _i18.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i19.Future<_i8.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i18.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i19.Future<_i8.FeeObject>.value(_FakeFeeObject_5( this, Invocation.getter(#fees), )), - ) as _i18.Future<_i8.FeeObject>); + ) as _i19.Future<_i8.FeeObject>); @override - _i18.Future get maxFee => (super.noSuchMethod( + _i19.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), - returnValue: _i18.Future.value(0), - ) as _i18.Future); + returnValue: _i19.Future.value(0), + ) as _i19.Future); @override - _i18.Future get currentReceivingAddress => (super.noSuchMethod( + _i19.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override _i9.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), @@ -500,16 +526,16 @@ class MockManager extends _i1.Mock implements _i6.Manager { ), ) as _i9.Balance); @override - _i18.Future> get transactions => (super.noSuchMethod( + _i19.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i18.Future>.value(<_i21.Transaction>[]), - ) as _i18.Future>); + _i19.Future>.value(<_i22.Transaction>[]), + ) as _i19.Future>); @override - _i18.Future> get utxos => (super.noSuchMethod( + _i19.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i18.Future>.value(<_i21.UTXO>[]), - ) as _i18.Future>); + returnValue: _i19.Future>.value(<_i22.UTXO>[]), + ) as _i19.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -529,15 +555,15 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: '', ) as String); @override - _i18.Future> get mnemonic => (super.noSuchMethod( + _i19.Future> get mnemonic => (super.noSuchMethod( Invocation.getter(#mnemonic), - returnValue: _i18.Future>.value([]), - ) as _i18.Future>); + returnValue: _i19.Future>.value([]), + ) as _i19.Future>); @override - _i18.Future get mnemonicPassphrase => (super.noSuchMethod( + _i19.Future get mnemonicPassphrase => (super.noSuchMethod( Invocation.getter(#mnemonicPassphrase), - returnValue: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + ) as _i19.Future); @override bool get isConnected => (super.noSuchMethod( Invocation.getter(#isConnected), @@ -579,24 +605,24 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override - _i18.Future get xpub => (super.noSuchMethod( + _i19.Future get xpub => (super.noSuchMethod( Invocation.getter(#xpub), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i18.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + _i19.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( Invocation.method( #updateNode, [shouldRefresh], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override void dispose() => super.noSuchMethod( Invocation.method( @@ -606,7 +632,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValueForMissingStub: null, ); @override - _i18.Future> prepareSend({ + _i19.Future> prepareSend({ required String? address, required _i10.Amount? amount, Map? args, @@ -622,27 +648,27 @@ class MockManager extends _i1.Mock implements _i6.Manager { }, ), returnValue: - _i18.Future>.value({}), - ) as _i18.Future>); + _i19.Future>.value({}), + ) as _i19.Future>); @override - _i18.Future confirmSend({required Map? txData}) => + _i19.Future confirmSend({required Map? txData}) => (super.noSuchMethod( Invocation.method( #confirmSend, [], {#txData: txData}, ), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override - _i18.Future refresh() => (super.noSuchMethod( + _i19.Future refresh() => (super.noSuchMethod( Invocation.method( #refresh, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override bool validateAddress(String? address) => (super.noSuchMethod( Invocation.method( @@ -652,33 +678,33 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override - _i18.Future testNetworkConnection() => (super.noSuchMethod( + _i19.Future testNetworkConnection() => (super.noSuchMethod( Invocation.method( #testNetworkConnection, [], ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override - _i18.Future initializeNew() => (super.noSuchMethod( + _i19.Future initializeNew() => (super.noSuchMethod( Invocation.method( #initializeNew, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future initializeExisting() => (super.noSuchMethod( + _i19.Future initializeExisting() => (super.noSuchMethod( Invocation.method( #initializeExisting, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future recoverFromMnemonic({ + _i19.Future recoverFromMnemonic({ required String? mnemonic, String? mnemonicPassphrase, required int? maxUnusedAddressGap, @@ -697,20 +723,20 @@ class MockManager extends _i1.Mock implements _i6.Manager { #height: height, }, ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future exitCurrentWallet() => (super.noSuchMethod( + _i19.Future exitCurrentWallet() => (super.noSuchMethod( Invocation.method( #exitCurrentWallet, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future fullRescan( + _i19.Future fullRescan( int? maxUnusedAddressGap, int? maxNumberOfIndexesToCheck, ) => @@ -722,11 +748,11 @@ class MockManager extends _i1.Mock implements _i6.Manager { maxNumberOfIndexesToCheck, ], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future<_i10.Amount> estimateFeeFor( + _i19.Future<_i10.Amount> estimateFeeFor( _i10.Amount? amount, int? feeRate, ) => @@ -738,7 +764,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { feeRate, ], ), - returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( + returnValue: _i19.Future<_i10.Amount>.value(_FakeAmount_7( this, Invocation.method( #estimateFeeFor, @@ -748,26 +774,26 @@ class MockManager extends _i1.Mock implements _i6.Manager { ], ), )), - ) as _i18.Future<_i10.Amount>); + ) as _i19.Future<_i10.Amount>); @override - _i18.Future generateNewAddress() => (super.noSuchMethod( + _i19.Future generateNewAddress() => (super.noSuchMethod( Invocation.method( #generateNewAddress, [], ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override - _i18.Future resetRescanOnOpen() => (super.noSuchMethod( + _i19.Future resetRescanOnOpen() => (super.noSuchMethod( Invocation.method( #resetRescanOnOpen, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -775,7 +801,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValueForMissingStub: null, ); @override - void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -810,10 +836,10 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValueForMissingStub: null, ); @override - _i17.Coin get coin => (super.noSuchMethod( + _i18.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i17.Coin.bitcoin, - ) as _i17.Coin); + returnValue: _i18.Coin.banano, + ) as _i18.Coin); @override bool get isRefreshing => (super.noSuchMethod( Invocation.getter(#isRefreshing), @@ -846,23 +872,23 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValueForMissingStub: null, ); @override - _i18.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i19.Future<_i8.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i18.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i19.Future<_i8.FeeObject>.value(_FakeFeeObject_5( this, Invocation.getter(#fees), )), - ) as _i18.Future<_i8.FeeObject>); + ) as _i19.Future<_i8.FeeObject>); @override - _i18.Future get maxFee => (super.noSuchMethod( + _i19.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), - returnValue: _i18.Future.value(0), - ) as _i18.Future); + returnValue: _i19.Future.value(0), + ) as _i19.Future); @override - _i18.Future get currentReceivingAddress => (super.noSuchMethod( + _i19.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override _i9.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), @@ -872,16 +898,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { ), ) as _i9.Balance); @override - _i18.Future> get transactions => (super.noSuchMethod( + _i19.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i18.Future>.value(<_i21.Transaction>[]), - ) as _i18.Future>); + _i19.Future>.value(<_i22.Transaction>[]), + ) as _i19.Future>); @override - _i18.Future> get utxos => (super.noSuchMethod( + _i19.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i18.Future>.value(<_i21.UTXO>[]), - ) as _i18.Future>); + returnValue: _i19.Future>.value(<_i22.UTXO>[]), + ) as _i19.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -901,20 +927,20 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValue: '', ) as String); @override - _i18.Future> get mnemonic => (super.noSuchMethod( + _i19.Future> get mnemonic => (super.noSuchMethod( Invocation.getter(#mnemonic), - returnValue: _i18.Future>.value([]), - ) as _i18.Future>); + returnValue: _i19.Future>.value([]), + ) as _i19.Future>); @override - _i18.Future get mnemonicString => (super.noSuchMethod( + _i19.Future get mnemonicString => (super.noSuchMethod( Invocation.getter(#mnemonicString), - returnValue: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future get mnemonicPassphrase => (super.noSuchMethod( + _i19.Future get mnemonicPassphrase => (super.noSuchMethod( Invocation.getter(#mnemonicPassphrase), - returnValue: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + ) as _i19.Future); @override bool get hasCalledExit => (super.noSuchMethod( Invocation.getter(#hasCalledExit), @@ -931,7 +957,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValue: 0, ) as int); @override - _i18.Future> prepareSend({ + _i19.Future> prepareSend({ required String? address, required _i10.Amount? amount, Map? args, @@ -947,36 +973,36 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { }, ), returnValue: - _i18.Future>.value({}), - ) as _i18.Future>); + _i19.Future>.value({}), + ) as _i19.Future>); @override - _i18.Future confirmSend({required Map? txData}) => + _i19.Future confirmSend({required Map? txData}) => (super.noSuchMethod( Invocation.method( #confirmSend, [], {#txData: txData}, ), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override - _i18.Future refresh() => (super.noSuchMethod( + _i19.Future refresh() => (super.noSuchMethod( Invocation.method( #refresh, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + _i19.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( Invocation.method( #updateNode, [shouldRefresh], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override bool validateAddress(String? address) => (super.noSuchMethod( Invocation.method( @@ -986,15 +1012,15 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValue: false, ) as bool); @override - _i18.Future testNetworkConnection() => (super.noSuchMethod( + _i19.Future testNetworkConnection() => (super.noSuchMethod( Invocation.method( #testNetworkConnection, [], ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override - _i18.Future recoverFromMnemonic({ + _i19.Future recoverFromMnemonic({ required String? mnemonic, String? mnemonicPassphrase, required int? maxUnusedAddressGap, @@ -1013,38 +1039,38 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { #height: height, }, ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future initializeNew() => (super.noSuchMethod( + _i19.Future initializeNew() => (super.noSuchMethod( Invocation.method( #initializeNew, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future initializeExisting() => (super.noSuchMethod( + _i19.Future initializeExisting() => (super.noSuchMethod( Invocation.method( #initializeExisting, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future exit() => (super.noSuchMethod( + _i19.Future exit() => (super.noSuchMethod( Invocation.method( #exit, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future fullRescan( + _i19.Future fullRescan( int? maxUnusedAddressGap, int? maxNumberOfIndexesToCheck, ) => @@ -1056,11 +1082,11 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { maxNumberOfIndexesToCheck, ], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future<_i10.Amount> estimateFeeFor( + _i19.Future<_i10.Amount> estimateFeeFor( _i10.Amount? amount, int? feeRate, ) => @@ -1072,7 +1098,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { feeRate, ], ), - returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( + returnValue: _i19.Future<_i10.Amount>.value(_FakeAmount_7( this, Invocation.method( #estimateFeeFor, @@ -1082,37 +1108,37 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { ], ), )), - ) as _i18.Future<_i10.Amount>); + ) as _i19.Future<_i10.Amount>); @override - _i18.Future generateNewAddress() => (super.noSuchMethod( + _i19.Future generateNewAddress() => (super.noSuchMethod( Invocation.method( #generateNewAddress, [], ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override - _i18.Future updateSentCachedTxData(Map? txData) => + _i19.Future updateSentCachedTxData(Map? txData) => (super.noSuchMethod( Invocation.method( #updateSentCachedTxData, [txData], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); } /// A class which mocks [FiroWallet]. /// /// See the documentation for Mockito's code generation for more information. -class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { +class MockFiroWallet extends _i1.Mock implements _i23.FiroWallet { MockFiroWallet() { _i1.throwOnMissingStub(this); } @override - set timer(_i18.Timer? _timer) => super.noSuchMethod( + set timer(_i19.Timer? _timer) => super.noSuchMethod( Invocation.setter( #timer, _timer, @@ -1202,48 +1228,48 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValue: false, ) as bool); @override - _i17.Coin get coin => (super.noSuchMethod( + _i18.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i17.Coin.bitcoin, - ) as _i17.Coin); + returnValue: _i18.Coin.banano, + ) as _i18.Coin); @override - _i18.Future> get mnemonic => (super.noSuchMethod( + _i19.Future> get mnemonic => (super.noSuchMethod( Invocation.getter(#mnemonic), - returnValue: _i18.Future>.value([]), - ) as _i18.Future>); + returnValue: _i19.Future>.value([]), + ) as _i19.Future>); @override - _i18.Future get mnemonicString => (super.noSuchMethod( + _i19.Future get mnemonicString => (super.noSuchMethod( Invocation.getter(#mnemonicString), - returnValue: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future get mnemonicPassphrase => (super.noSuchMethod( + _i19.Future get mnemonicPassphrase => (super.noSuchMethod( Invocation.getter(#mnemonicPassphrase), - returnValue: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future get maxFee => (super.noSuchMethod( + _i19.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), - returnValue: _i18.Future.value(0), - ) as _i18.Future); + returnValue: _i19.Future.value(0), + ) as _i19.Future); @override - _i18.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i19.Future<_i8.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i18.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i19.Future<_i8.FeeObject>.value(_FakeFeeObject_5( this, Invocation.getter(#fees), )), - ) as _i18.Future<_i8.FeeObject>); + ) as _i19.Future<_i8.FeeObject>); @override - _i18.Future get currentReceivingAddress => (super.noSuchMethod( + _i19.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override - _i18.Future get currentChangeAddress => (super.noSuchMethod( + _i19.Future get currentChangeAddress => (super.noSuchMethod( Invocation.getter(#currentChangeAddress), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override String get walletName => (super.noSuchMethod( Invocation.getter(#walletName), @@ -1294,10 +1320,10 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValue: false, ) as bool); @override - _i18.Future get chainHeight => (super.noSuchMethod( + _i19.Future get chainHeight => (super.noSuchMethod( Invocation.getter(#chainHeight), - returnValue: _i18.Future.value(0), - ) as _i18.Future); + returnValue: _i19.Future.value(0), + ) as _i19.Future); @override int get storedChainHeight => (super.noSuchMethod( Invocation.getter(#storedChainHeight), @@ -1320,21 +1346,21 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { ), ) as _i9.Balance); @override - _i18.Future> get utxos => (super.noSuchMethod( + _i19.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i18.Future>.value(<_i21.UTXO>[]), - ) as _i18.Future>); + returnValue: _i19.Future>.value(<_i22.UTXO>[]), + ) as _i19.Future>); @override - _i18.Future> get transactions => (super.noSuchMethod( + _i19.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i18.Future>.value(<_i21.Transaction>[]), - ) as _i18.Future>); + _i19.Future>.value(<_i22.Transaction>[]), + ) as _i19.Future>); @override - _i18.Future get xpub => (super.noSuchMethod( + _i19.Future get xpub => (super.noSuchMethod( Invocation.getter(#xpub), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override set onIsActiveWalletChanged(void Function(bool)? _onIsActiveWalletChanged) => super.noSuchMethod( @@ -1361,23 +1387,23 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValue: false, ) as bool); @override - _i18.Future updateSentCachedTxData(Map? txData) => + _i19.Future updateSentCachedTxData(Map? txData) => (super.noSuchMethod( Invocation.method( #updateSentCachedTxData, [txData], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future testNetworkConnection() => (super.noSuchMethod( + _i19.Future testNetworkConnection() => (super.noSuchMethod( Invocation.method( #testNetworkConnection, [], ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override void startNetworkAlivePinging() => super.noSuchMethod( Invocation.method( @@ -1395,7 +1421,7 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValueForMissingStub: null, ); @override - _i18.Future> prepareSendPublic({ + _i19.Future> prepareSendPublic({ required String? address, required _i10.Amount? amount, Map? args, @@ -1411,20 +1437,20 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { }, ), returnValue: - _i18.Future>.value({}), - ) as _i18.Future>); + _i19.Future>.value({}), + ) as _i19.Future>); @override - _i18.Future confirmSendPublic({dynamic txData}) => + _i19.Future confirmSendPublic({dynamic txData}) => (super.noSuchMethod( Invocation.method( #confirmSendPublic, [], {#txData: txData}, ), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override - _i18.Future> prepareSend({ + _i19.Future> prepareSend({ required String? address, required _i10.Amount? amount, Map? args, @@ -1440,18 +1466,18 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { }, ), returnValue: - _i18.Future>.value({}), - ) as _i18.Future>); + _i19.Future>.value({}), + ) as _i19.Future>); @override - _i18.Future confirmSend({required Map? txData}) => + _i19.Future confirmSend({required Map? txData}) => (super.noSuchMethod( Invocation.method( #confirmSend, [], {#txData: txData}, ), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override int estimateTxFee({ required int? vSize, @@ -1475,7 +1501,7 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { String? _recipientAddress, bool? isSendAll, { int? additionalOutputs = 0, - List<_i21.UTXO>? utxos, + List<_i22.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, @@ -1491,19 +1517,19 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { }, )); @override - _i18.Future> fetchBuildTxData( - List<_i21.UTXO>? utxosToUse) => + _i19.Future> fetchBuildTxData( + List<_i22.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( #fetchBuildTxData, [utxosToUse], ), returnValue: - _i18.Future>.value(<_i23.SigningData>[]), - ) as _i18.Future>); + _i19.Future>.value(<_i24.SigningData>[]), + ) as _i19.Future>); @override - _i18.Future> buildTransaction({ - required List<_i23.SigningData>? utxoSigningData, + _i19.Future> buildTransaction({ + required List<_i24.SigningData>? utxoSigningData, required List? recipients, required List? satoshiAmounts, }) => @@ -1518,61 +1544,61 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { }, ), returnValue: - _i18.Future>.value({}), - ) as _i18.Future>); + _i19.Future>.value({}), + ) as _i19.Future>); @override - _i18.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + _i19.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( Invocation.method( #updateNode, [shouldRefresh], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future initializeNew() => (super.noSuchMethod( + _i19.Future initializeNew() => (super.noSuchMethod( Invocation.method( #initializeNew, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future initializeExisting() => (super.noSuchMethod( + _i19.Future initializeExisting() => (super.noSuchMethod( Invocation.method( #initializeExisting, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future refreshIfThereIsNewData() => (super.noSuchMethod( + _i19.Future refreshIfThereIsNewData() => (super.noSuchMethod( Invocation.method( #refreshIfThereIsNewData, [], ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override - _i18.Future getAllTxsToWatch() => (super.noSuchMethod( + _i19.Future getAllTxsToWatch() => (super.noSuchMethod( Invocation.method( #getAllTxsToWatch, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future refresh() => (super.noSuchMethod( + _i19.Future refresh() => (super.noSuchMethod( Invocation.method( #refresh, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override List> getLelantusCoinMap() => (super.noSuchMethod( @@ -1583,35 +1609,35 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValue: >[], ) as List>); @override - _i18.Future anonymizeAllPublicFunds() => (super.noSuchMethod( + _i19.Future anonymizeAllPublicFunds() => (super.noSuchMethod( Invocation.method( #anonymizeAllPublicFunds, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future>> createMintsFromAmount(int? total) => + _i19.Future>> createMintsFromAmount(int? total) => (super.noSuchMethod( Invocation.method( #createMintsFromAmount, [total], ), - returnValue: _i18.Future>>.value( + returnValue: _i19.Future>>.value( >[]), - ) as _i18.Future>>); + ) as _i19.Future>>); @override - _i18.Future submitHexToNetwork(String? hex) => (super.noSuchMethod( + _i19.Future submitHexToNetwork(String? hex) => (super.noSuchMethod( Invocation.method( #submitHexToNetwork, [hex], ), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override - _i18.Future> buildMintTransaction( - List<_i21.UTXO>? utxosToUse, + _i19.Future> buildMintTransaction( + List<_i22.UTXO>? utxosToUse, int? satoshisPerRecipient, List>? mintsMap, ) => @@ -1625,29 +1651,29 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { ], ), returnValue: - _i18.Future>.value({}), - ) as _i18.Future>); + _i19.Future>.value({}), + ) as _i19.Future>); @override - _i18.Future checkReceivingAddressForTransactions() => + _i19.Future checkReceivingAddressForTransactions() => (super.noSuchMethod( Invocation.method( #checkReceivingAddressForTransactions, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future checkChangeAddressForTransactions() => (super.noSuchMethod( + _i19.Future checkChangeAddressForTransactions() => (super.noSuchMethod( Invocation.method( #checkChangeAddressForTransactions, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future fullRescan( + _i19.Future fullRescan( int? maxUnusedAddressGap, int? maxNumberOfIndexesToCheck, ) => @@ -1659,11 +1685,11 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { maxNumberOfIndexesToCheck, ], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future recoverFromMnemonic({ + _i19.Future recoverFromMnemonic({ required String? mnemonic, String? mnemonicPassphrase, required int? maxUnusedAddressGap, @@ -1682,83 +1708,83 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { #height: height, }, ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future> getSetDataMap(int? latestSetId) => + _i19.Future> getSetDataMap(int? latestSetId) => (super.noSuchMethod( Invocation.method( #getSetDataMap, [latestSetId], ), - returnValue: _i18.Future>.value({}), - ) as _i18.Future>); + returnValue: _i19.Future>.value({}), + ) as _i19.Future>); @override - _i18.Future getTransactionCacheEarly(List? allAddresses) => + _i19.Future getTransactionCacheEarly(List? allAddresses) => (super.noSuchMethod( Invocation.method( #getTransactionCacheEarly, [allAddresses], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future>> fetchAnonymitySets() => + _i19.Future>> fetchAnonymitySets() => (super.noSuchMethod( Invocation.method( #fetchAnonymitySets, [], ), - returnValue: _i18.Future>>.value( + returnValue: _i19.Future>>.value( >[]), - ) as _i18.Future>>); + ) as _i19.Future>>); @override - _i18.Future getLatestSetId() => (super.noSuchMethod( + _i19.Future getLatestSetId() => (super.noSuchMethod( Invocation.method( #getLatestSetId, [], ), - returnValue: _i18.Future.value(0), - ) as _i18.Future); + returnValue: _i19.Future.value(0), + ) as _i19.Future); @override - _i18.Future> getUsedCoinSerials() => (super.noSuchMethod( + _i19.Future> getUsedCoinSerials() => (super.noSuchMethod( Invocation.method( #getUsedCoinSerials, [], ), - returnValue: _i18.Future>.value([]), - ) as _i18.Future>); + returnValue: _i19.Future>.value([]), + ) as _i19.Future>); @override - _i18.Future exit() => (super.noSuchMethod( + _i19.Future exit() => (super.noSuchMethod( Invocation.method( #exit, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future getCoinsToJoinSplit(int? required) => + _i19.Future getCoinsToJoinSplit(int? required) => (super.noSuchMethod( Invocation.method( #getCoinsToJoinSplit, [required], ), - returnValue: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future estimateJoinSplitFee(int? spendAmount) => + _i19.Future estimateJoinSplitFee(int? spendAmount) => (super.noSuchMethod( Invocation.method( #estimateJoinSplitFee, [spendAmount], ), - returnValue: _i18.Future.value(0), - ) as _i18.Future); + returnValue: _i19.Future.value(0), + ) as _i19.Future); @override - _i18.Future<_i10.Amount> estimateFeeFor( + _i19.Future<_i10.Amount> estimateFeeFor( _i10.Amount? amount, int? feeRate, ) => @@ -1770,7 +1796,7 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { feeRate, ], ), - returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( + returnValue: _i19.Future<_i10.Amount>.value(_FakeAmount_7( this, Invocation.method( #estimateFeeFor, @@ -1780,9 +1806,9 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { ], ), )), - ) as _i18.Future<_i10.Amount>); + ) as _i19.Future<_i10.Amount>); @override - _i18.Future<_i10.Amount> estimateFeeForPublic( + _i19.Future<_i10.Amount> estimateFeeForPublic( _i10.Amount? amount, int? feeRate, ) => @@ -1794,7 +1820,7 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { feeRate, ], ), - returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( + returnValue: _i19.Future<_i10.Amount>.value(_FakeAmount_7( this, Invocation.method( #estimateFeeForPublic, @@ -1804,7 +1830,7 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { ], ), )), - ) as _i18.Future<_i10.Amount>); + ) as _i19.Future<_i10.Amount>); @override _i10.Amount roughFeeEstimate( int? inputCount, @@ -1833,36 +1859,36 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { ), ) as _i10.Amount); @override - _i18.Future<_i10.Amount> sweepAllEstimate(int? feeRate) => + _i19.Future<_i10.Amount> sweepAllEstimate(int? feeRate) => (super.noSuchMethod( Invocation.method( #sweepAllEstimate, [feeRate], ), - returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( + returnValue: _i19.Future<_i10.Amount>.value(_FakeAmount_7( this, Invocation.method( #sweepAllEstimate, [feeRate], ), )), - ) as _i18.Future<_i10.Amount>); + ) as _i19.Future<_i10.Amount>); @override - _i18.Future>> fastFetch( + _i19.Future>> fastFetch( List? allTxHashes) => (super.noSuchMethod( Invocation.method( #fastFetch, [allTxHashes], ), - returnValue: _i18.Future>>.value( + returnValue: _i19.Future>>.value( >[]), - ) as _i18.Future>>); + ) as _i19.Future>>); @override - _i18.Future> getJMintTransactions( + _i19.Future> getJMintTransactions( _i13.CachedElectrumX? cachedClient, List? transactions, - _i17.Coin? coin, + _i18.Coin? coin, ) => (super.noSuchMethod( Invocation.method( @@ -1873,17 +1899,17 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { coin, ], ), - returnValue: _i18.Future>.value( - <_i21.Address, _i21.Transaction>{}), - ) as _i18.Future>); + returnValue: _i19.Future>.value( + <_i22.Address, _i22.Transaction>{}), + ) as _i19.Future>); @override - _i18.Future generateNewAddress() => (super.noSuchMethod( + _i19.Future generateNewAddress() => (super.noSuchMethod( Invocation.method( #generateNewAddress, [], ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override _i10.Amount availablePrivateBalance() => (super.noSuchMethod( Invocation.method( @@ -1915,7 +1941,7 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { @override void initCache( String? walletId, - _i17.Coin? coin, + _i18.Coin? coin, ) => super.noSuchMethod( Invocation.method( @@ -1928,14 +1954,14 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValueForMissingStub: null, ); @override - _i18.Future updateCachedId(String? id) => (super.noSuchMethod( + _i19.Future updateCachedId(String? id) => (super.noSuchMethod( Invocation.method( #updateCachedId, [id], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override int getCachedChainHeight() => (super.noSuchMethod( Invocation.method( @@ -1945,14 +1971,14 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValue: 0, ) as int); @override - _i18.Future updateCachedChainHeight(int? height) => (super.noSuchMethod( + _i19.Future updateCachedChainHeight(int? height) => (super.noSuchMethod( Invocation.method( #updateCachedChainHeight, [height], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override bool getCachedIsFavorite() => (super.noSuchMethod( Invocation.method( @@ -1962,15 +1988,15 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValue: false, ) as bool); @override - _i18.Future updateCachedIsFavorite(bool? isFavorite) => + _i19.Future updateCachedIsFavorite(bool? isFavorite) => (super.noSuchMethod( Invocation.method( #updateCachedIsFavorite, [isFavorite], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override _i9.Balance getCachedBalance() => (super.noSuchMethod( Invocation.method( @@ -1986,15 +2012,15 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { ), ) as _i9.Balance); @override - _i18.Future updateCachedBalance(_i9.Balance? balance) => + _i19.Future updateCachedBalance(_i9.Balance? balance) => (super.noSuchMethod( Invocation.method( #updateCachedBalance, [balance], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override _i9.Balance getCachedBalanceSecondary() => (super.noSuchMethod( Invocation.method( @@ -2010,15 +2036,15 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { ), ) as _i9.Balance); @override - _i18.Future updateCachedBalanceSecondary(_i9.Balance? balance) => + _i19.Future updateCachedBalanceSecondary(_i9.Balance? balance) => (super.noSuchMethod( Invocation.method( #updateCachedBalanceSecondary, [balance], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override List getWalletTokenContractAddresses() => (super.noSuchMethod( Invocation.method( @@ -2028,16 +2054,16 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValue: [], ) as List); @override - _i18.Future updateWalletTokenContractAddresses( + _i19.Future updateWalletTokenContractAddresses( List? contractAddresses) => (super.noSuchMethod( Invocation.method( #updateWalletTokenContractAddresses, [contractAddresses], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override void initWalletDB({_i14.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( @@ -2056,40 +2082,48 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValueForMissingStub: null, ); @override - _i18.Future firoUpdateJIndex(List? jIndex) => + _i19.Future firoUpdateJIndex(List? jIndex) => (super.noSuchMethod( Invocation.method( #firoUpdateJIndex, [jIndex], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future firoUpdateLelantusCoins(List? lelantusCoins) => + _i19.Future firoUpdateLelantusCoins(List? lelantusCoins) => (super.noSuchMethod( Invocation.method( #firoUpdateLelantusCoins, [lelantusCoins], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod( + int firoGetMintIndex() => (super.noSuchMethod( + Invocation.method( + #firoGetMintIndex, + [], + ), + returnValue: 0, + ) as int); + @override + _i19.Future firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod( Invocation.method( #firoUpdateMintIndex, [mintIndex], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); } /// A class which mocks [LocaleService]. /// /// See the documentation for Mockito's code generation for more information. -class MockLocaleService extends _i1.Mock implements _i24.LocaleService { +class MockLocaleService extends _i1.Mock implements _i25.LocaleService { MockLocaleService() { _i1.throwOnMissingStub(this); } @@ -2105,17 +2139,17 @@ class MockLocaleService extends _i1.Mock implements _i24.LocaleService { returnValue: false, ) as bool); @override - _i18.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( + _i19.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( Invocation.method( #loadLocale, [], {#notify: notify}, ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -2123,7 +2157,7 @@ class MockLocaleService extends _i1.Mock implements _i24.LocaleService { returnValueForMissingStub: null, ); @override - void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -2151,7 +2185,7 @@ class MockLocaleService extends _i1.Mock implements _i24.LocaleService { /// A class which mocks [Prefs]. /// /// See the documentation for Mockito's code generation for more information. -class MockPrefs extends _i1.Mock implements _i19.Prefs { +class MockPrefs extends _i1.Mock implements _i20.Prefs { MockPrefs() { _i1.throwOnMissingStub(this); } @@ -2207,12 +2241,12 @@ class MockPrefs extends _i1.Mock implements _i19.Prefs { returnValueForMissingStub: null, ); @override - _i25.SyncingType get syncType => (super.noSuchMethod( + _i26.SyncingType get syncType => (super.noSuchMethod( Invocation.getter(#syncType), - returnValue: _i25.SyncingType.currentWalletOnly, - ) as _i25.SyncingType); + returnValue: _i26.SyncingType.currentWalletOnly, + ) as _i26.SyncingType); @override - set syncType(_i25.SyncingType? syncType) => super.noSuchMethod( + set syncType(_i26.SyncingType? syncType) => super.noSuchMethod( Invocation.setter( #syncType, syncType, @@ -2358,12 +2392,12 @@ class MockPrefs extends _i1.Mock implements _i19.Prefs { returnValueForMissingStub: null, ); @override - _i26.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( + _i27.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( Invocation.getter(#backupFrequencyType), - returnValue: _i26.BackupFrequencyType.everyTenMinutes, - ) as _i26.BackupFrequencyType); + returnValue: _i27.BackupFrequencyType.everyTenMinutes, + ) as _i27.BackupFrequencyType); @override - set backupFrequencyType(_i26.BackupFrequencyType? backupFrequencyType) => + set backupFrequencyType(_i27.BackupFrequencyType? backupFrequencyType) => super.noSuchMethod( Invocation.setter( #backupFrequencyType, @@ -2501,51 +2535,99 @@ class MockPrefs extends _i1.Mock implements _i19.Prefs { returnValue: false, ) as bool); @override - _i18.Future init() => (super.noSuchMethod( + _i19.Future init() => (super.noSuchMethod( Invocation.method( #init, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( + _i19.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( Invocation.method( #incrementCurrentNotificationIndex, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future isExternalCallsSet() => (super.noSuchMethod( + _i19.Future isExternalCallsSet() => (super.noSuchMethod( Invocation.method( #isExternalCallsSet, [], ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override - _i18.Future saveUserID(String? userId) => (super.noSuchMethod( + _i19.Future saveUserID(String? userId) => (super.noSuchMethod( Invocation.method( #saveUserID, [userId], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( + _i19.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( Invocation.method( #saveSignupEpoch, [signupEpoch], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( + _i28.AmountUnit amountUnit(_i18.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #amountUnit, + [coin], + ), + returnValue: _i28.AmountUnit.normal, + ) as _i28.AmountUnit); + @override + void updateAmountUnit({ + required _i18.Coin? coin, + required _i28.AmountUnit? amountUnit, + }) => + super.noSuchMethod( + Invocation.method( + #updateAmountUnit, + [], + { + #coin: coin, + #amountUnit: amountUnit, + }, + ), + returnValueForMissingStub: null, + ); + @override + int maxDecimals(_i18.Coin? coin) => (super.noSuchMethod( + Invocation.method( + #maxDecimals, + [coin], + ), + returnValue: 0, + ) as int); + @override + void updateMaxDecimals({ + required _i18.Coin? coin, + required int? maxDecimals, + }) => + super.noSuchMethod( + Invocation.method( + #updateMaxDecimals, + [], + { + #coin: coin, + #maxDecimals: maxDecimals, + }, + ), + returnValueForMissingStub: null, + ); + @override + void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -2553,7 +2635,7 @@ class MockPrefs extends _i1.Mock implements _i19.Prefs { returnValueForMissingStub: null, ); @override - void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -2581,7 +2663,7 @@ class MockPrefs extends _i1.Mock implements _i19.Prefs { /// A class which mocks [PriceService]. /// /// See the documentation for Mockito's code generation for more information. -class MockPriceService extends _i1.Mock implements _i27.PriceService { +class MockPriceService extends _i1.Mock implements _i29.PriceService { MockPriceService() { _i1.throwOnMissingStub(this); } @@ -2618,44 +2700,44 @@ class MockPriceService extends _i1.Mock implements _i27.PriceService { returnValue: false, ) as bool); @override - _i15.Tuple2<_i28.Decimal, double> getPrice(_i17.Coin? coin) => + _i15.Tuple2<_i30.Decimal, double> getPrice(_i18.Coin? coin) => (super.noSuchMethod( Invocation.method( #getPrice, [coin], ), - returnValue: _FakeTuple2_13<_i28.Decimal, double>( + returnValue: _FakeTuple2_13<_i30.Decimal, double>( this, Invocation.method( #getPrice, [coin], ), ), - ) as _i15.Tuple2<_i28.Decimal, double>); + ) as _i15.Tuple2<_i30.Decimal, double>); @override - _i15.Tuple2<_i28.Decimal, double> getTokenPrice(String? contractAddress) => + _i15.Tuple2<_i30.Decimal, double> getTokenPrice(String? contractAddress) => (super.noSuchMethod( Invocation.method( #getTokenPrice, [contractAddress], ), - returnValue: _FakeTuple2_13<_i28.Decimal, double>( + returnValue: _FakeTuple2_13<_i30.Decimal, double>( this, Invocation.method( #getTokenPrice, [contractAddress], ), ), - ) as _i15.Tuple2<_i28.Decimal, double>); + ) as _i15.Tuple2<_i30.Decimal, double>); @override - _i18.Future updatePrice() => (super.noSuchMethod( + _i19.Future updatePrice() => (super.noSuchMethod( Invocation.method( #updatePrice, [], ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override void cancel() => super.noSuchMethod( Invocation.method( @@ -2681,7 +2763,7 @@ class MockPriceService extends _i1.Mock implements _i27.PriceService { returnValueForMissingStub: null, ); @override - void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -2689,7 +2771,7 @@ class MockPriceService extends _i1.Mock implements _i27.PriceService { returnValueForMissingStub: null, ); @override - void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -2709,7 +2791,7 @@ class MockPriceService extends _i1.Mock implements _i27.PriceService { /// A class which mocks [NotesService]. /// /// See the documentation for Mockito's code generation for more information. -class MockNotesService extends _i1.Mock implements _i29.NotesService { +class MockNotesService extends _i1.Mock implements _i31.NotesService { MockNotesService() { _i1.throwOnMissingStub(this); } @@ -2725,35 +2807,35 @@ class MockNotesService extends _i1.Mock implements _i29.NotesService { returnValue: {}, ) as Map); @override - _i18.Future> get notes => (super.noSuchMethod( + _i19.Future> get notes => (super.noSuchMethod( Invocation.getter(#notes), - returnValue: _i18.Future>.value({}), - ) as _i18.Future>); + returnValue: _i19.Future>.value({}), + ) as _i19.Future>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i18.Future> search(String? text) => (super.noSuchMethod( + _i19.Future> search(String? text) => (super.noSuchMethod( Invocation.method( #search, [text], ), - returnValue: _i18.Future>.value({}), - ) as _i18.Future>); + returnValue: _i19.Future>.value({}), + ) as _i19.Future>); @override - _i18.Future getNoteFor({required String? txid}) => + _i19.Future getNoteFor({required String? txid}) => (super.noSuchMethod( Invocation.method( #getNoteFor, [], {#txid: txid}, ), - returnValue: _i18.Future.value(''), - ) as _i18.Future); + returnValue: _i19.Future.value(''), + ) as _i19.Future); @override - _i18.Future editOrAddNote({ + _i19.Future editOrAddNote({ required String? txid, required String? note, }) => @@ -2766,21 +2848,21 @@ class MockNotesService extends _i1.Mock implements _i29.NotesService { #note: note, }, ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future deleteNote({required String? txid}) => (super.noSuchMethod( + _i19.Future deleteNote({required String? txid}) => (super.noSuchMethod( Invocation.method( #deleteNote, [], {#txid: txid}, ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -2788,7 +2870,7 @@ class MockNotesService extends _i1.Mock implements _i29.NotesService { returnValueForMissingStub: null, ); @override - void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -2816,7 +2898,7 @@ class MockNotesService extends _i1.Mock implements _i29.NotesService { /// A class which mocks [ThemeService]. /// /// See the documentation for Mockito's code generation for more information. -class MockThemeService extends _i1.Mock implements _i30.ThemeService { +class MockThemeService extends _i1.Mock implements _i32.ThemeService { MockThemeService() { _i1.throwOnMissingStub(this); } @@ -2830,10 +2912,10 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService { ), ) as _i14.MainDB); @override - List<_i31.StackTheme> get installedThemes => (super.noSuchMethod( + List<_i33.StackTheme> get installedThemes => (super.noSuchMethod( Invocation.getter(#installedThemes), - returnValue: <_i31.StackTheme>[], - ) as List<_i31.StackTheme>); + returnValue: <_i33.StackTheme>[], + ) as List<_i33.StackTheme>); @override void init(_i14.MainDB? db) => super.noSuchMethod( Invocation.method( @@ -2843,62 +2925,636 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService { returnValueForMissingStub: null, ); @override - _i18.Future install({required _i32.Uint8List? themeArchiveData}) => + _i19.Future install({required _i34.Uint8List? themeArchiveData}) => (super.noSuchMethod( Invocation.method( #install, [], {#themeArchiveData: themeArchiveData}, ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future remove({required String? themeId}) => (super.noSuchMethod( + _i19.Future remove({required String? themeId}) => (super.noSuchMethod( Invocation.method( #remove, [], {#themeId: themeId}, ), - returnValue: _i18.Future.value(), - returnValueForMissingStub: _i18.Future.value(), - ) as _i18.Future); + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); @override - _i18.Future verifyInstalled({required String? themeId}) => + _i19.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( #verifyInstalled, [], {#themeId: themeId}, ), - returnValue: _i18.Future.value(false), - ) as _i18.Future); + returnValue: _i19.Future.value(false), + ) as _i19.Future); @override - _i18.Future> fetchThemes() => + _i19.Future> fetchThemes() => (super.noSuchMethod( Invocation.method( #fetchThemes, [], ), - returnValue: _i18.Future>.value( - <_i30.StackThemeMetaData>[]), - ) as _i18.Future>); + returnValue: _i19.Future>.value( + <_i32.StackThemeMetaData>[]), + ) as _i19.Future>); @override - _i18.Future<_i32.Uint8List> fetchTheme( - {required _i30.StackThemeMetaData? themeMetaData}) => + _i19.Future<_i34.Uint8List> fetchTheme( + {required _i32.StackThemeMetaData? themeMetaData}) => (super.noSuchMethod( Invocation.method( #fetchTheme, [], {#themeMetaData: themeMetaData}, ), - returnValue: _i18.Future<_i32.Uint8List>.value(_i32.Uint8List(0)), - ) as _i18.Future<_i32.Uint8List>); + returnValue: _i19.Future<_i34.Uint8List>.value(_i34.Uint8List(0)), + ) as _i19.Future<_i34.Uint8List>); @override - _i31.StackTheme? getTheme({required String? themeId}) => + _i33.StackTheme? getTheme({required String? themeId}) => (super.noSuchMethod(Invocation.method( #getTheme, [], {#themeId: themeId}, - )) as _i31.StackTheme?); + )) as _i33.StackTheme?); +} + +/// A class which mocks [MainDB]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockMainDB extends _i1.Mock implements _i14.MainDB { + MockMainDB() { + _i1.throwOnMissingStub(this); + } + + @override + _i16.Isar get isar => (super.noSuchMethod( + Invocation.getter(#isar), + returnValue: _FakeIsar_14( + this, + Invocation.getter(#isar), + ), + ) as _i16.Isar); + @override + _i19.Future initMainDB({_i16.Isar? mock}) => (super.noSuchMethod( + Invocation.method( + #initMainDB, + [], + {#mock: mock}, + ), + returnValue: _i19.Future.value(false), + ) as _i19.Future); + @override + List<_i35.ContactEntry> getContactEntries() => (super.noSuchMethod( + Invocation.method( + #getContactEntries, + [], + ), + returnValue: <_i35.ContactEntry>[], + ) as List<_i35.ContactEntry>); + @override + _i19.Future deleteContactEntry({required String? id}) => + (super.noSuchMethod( + Invocation.method( + #deleteContactEntry, + [], + {#id: id}, + ), + returnValue: _i19.Future.value(false), + ) as _i19.Future); + @override + _i19.Future isContactEntryExists({required String? id}) => + (super.noSuchMethod( + Invocation.method( + #isContactEntryExists, + [], + {#id: id}, + ), + returnValue: _i19.Future.value(false), + ) as _i19.Future); + @override + _i35.ContactEntry? getContactEntry({required String? id}) => + (super.noSuchMethod(Invocation.method( + #getContactEntry, + [], + {#id: id}, + )) as _i35.ContactEntry?); + @override + _i19.Future putContactEntry( + {required _i35.ContactEntry? contactEntry}) => + (super.noSuchMethod( + Invocation.method( + #putContactEntry, + [], + {#contactEntry: contactEntry}, + ), + returnValue: _i19.Future.value(false), + ) as _i19.Future); + @override + _i36.TransactionBlockExplorer? getTransactionBlockExplorer( + {required _i18.Coin? coin}) => + (super.noSuchMethod(Invocation.method( + #getTransactionBlockExplorer, + [], + {#coin: coin}, + )) as _i36.TransactionBlockExplorer?); + @override + _i19.Future putTransactionBlockExplorer( + _i36.TransactionBlockExplorer? explorer) => + (super.noSuchMethod( + Invocation.method( + #putTransactionBlockExplorer, + [explorer], + ), + returnValue: _i19.Future.value(0), + ) as _i19.Future); + @override + _i16.QueryBuilder<_i22.Address, _i22.Address, _i16.QAfterWhereClause> + getAddresses(String? walletId) => (super.noSuchMethod( + Invocation.method( + #getAddresses, + [walletId], + ), + returnValue: _FakeQueryBuilder_15<_i22.Address, _i22.Address, + _i16.QAfterWhereClause>( + this, + Invocation.method( + #getAddresses, + [walletId], + ), + ), + ) as _i16.QueryBuilder<_i22.Address, _i22.Address, + _i16.QAfterWhereClause>); + @override + _i19.Future putAddress(_i22.Address? address) => (super.noSuchMethod( + Invocation.method( + #putAddress, + [address], + ), + returnValue: _i19.Future.value(0), + ) as _i19.Future); + @override + _i19.Future> putAddresses(List<_i22.Address>? addresses) => + (super.noSuchMethod( + Invocation.method( + #putAddresses, + [addresses], + ), + returnValue: _i19.Future>.value([]), + ) as _i19.Future>); + @override + _i19.Future> updateOrPutAddresses(List<_i22.Address>? addresses) => + (super.noSuchMethod( + Invocation.method( + #updateOrPutAddresses, + [addresses], + ), + returnValue: _i19.Future>.value([]), + ) as _i19.Future>); + @override + _i19.Future<_i22.Address?> getAddress( + String? walletId, + String? address, + ) => + (super.noSuchMethod( + Invocation.method( + #getAddress, + [ + walletId, + address, + ], + ), + returnValue: _i19.Future<_i22.Address?>.value(), + ) as _i19.Future<_i22.Address?>); + @override + _i19.Future updateAddress( + _i22.Address? oldAddress, + _i22.Address? newAddress, + ) => + (super.noSuchMethod( + Invocation.method( + #updateAddress, + [ + oldAddress, + newAddress, + ], + ), + returnValue: _i19.Future.value(0), + ) as _i19.Future); + @override + _i16.QueryBuilder<_i22.Transaction, _i22.Transaction, _i16.QAfterWhereClause> + getTransactions(String? walletId) => (super.noSuchMethod( + Invocation.method( + #getTransactions, + [walletId], + ), + returnValue: _FakeQueryBuilder_15<_i22.Transaction, + _i22.Transaction, _i16.QAfterWhereClause>( + this, + Invocation.method( + #getTransactions, + [walletId], + ), + ), + ) as _i16.QueryBuilder<_i22.Transaction, _i22.Transaction, + _i16.QAfterWhereClause>); + @override + _i19.Future putTransaction(_i22.Transaction? transaction) => + (super.noSuchMethod( + Invocation.method( + #putTransaction, + [transaction], + ), + returnValue: _i19.Future.value(0), + ) as _i19.Future); + @override + _i19.Future> putTransactions( + List<_i22.Transaction>? transactions) => + (super.noSuchMethod( + Invocation.method( + #putTransactions, + [transactions], + ), + returnValue: _i19.Future>.value([]), + ) as _i19.Future>); + @override + _i19.Future<_i22.Transaction?> getTransaction( + String? walletId, + String? txid, + ) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [ + walletId, + txid, + ], + ), + returnValue: _i19.Future<_i22.Transaction?>.value(), + ) as _i19.Future<_i22.Transaction?>); + @override + _i19.Stream<_i22.Transaction?> watchTransaction({ + required int? id, + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchTransaction, + [], + { + #id: id, + #fireImmediately: fireImmediately, + }, + ), + returnValue: _i19.Stream<_i22.Transaction?>.empty(), + ) as _i19.Stream<_i22.Transaction?>); + @override + _i16.QueryBuilder<_i22.UTXO, _i22.UTXO, _i16.QAfterWhereClause> getUTXOs( + String? walletId) => + (super.noSuchMethod( + Invocation.method( + #getUTXOs, + [walletId], + ), + returnValue: + _FakeQueryBuilder_15<_i22.UTXO, _i22.UTXO, _i16.QAfterWhereClause>( + this, + Invocation.method( + #getUTXOs, + [walletId], + ), + ), + ) as _i16.QueryBuilder<_i22.UTXO, _i22.UTXO, _i16.QAfterWhereClause>); + @override + _i19.Future putUTXO(_i22.UTXO? utxo) => (super.noSuchMethod( + Invocation.method( + #putUTXO, + [utxo], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future putUTXOs(List<_i22.UTXO>? utxos) => (super.noSuchMethod( + Invocation.method( + #putUTXOs, + [utxos], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future updateUTXOs( + String? walletId, + List<_i22.UTXO>? utxos, + ) => + (super.noSuchMethod( + Invocation.method( + #updateUTXOs, + [ + walletId, + utxos, + ], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Stream<_i22.UTXO?> watchUTXO({ + required int? id, + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchUTXO, + [], + { + #id: id, + #fireImmediately: fireImmediately, + }, + ), + returnValue: _i19.Stream<_i22.UTXO?>.empty(), + ) as _i19.Stream<_i22.UTXO?>); + @override + _i16.QueryBuilder<_i22.TransactionNote, _i22.TransactionNote, + _i16.QAfterWhereClause> getTransactionNotes( + String? walletId) => + (super.noSuchMethod( + Invocation.method( + #getTransactionNotes, + [walletId], + ), + returnValue: _FakeQueryBuilder_15<_i22.TransactionNote, + _i22.TransactionNote, _i16.QAfterWhereClause>( + this, + Invocation.method( + #getTransactionNotes, + [walletId], + ), + ), + ) as _i16.QueryBuilder<_i22.TransactionNote, _i22.TransactionNote, + _i16.QAfterWhereClause>); + @override + _i19.Future putTransactionNote(_i22.TransactionNote? transactionNote) => + (super.noSuchMethod( + Invocation.method( + #putTransactionNote, + [transactionNote], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future putTransactionNotes( + List<_i22.TransactionNote>? transactionNotes) => + (super.noSuchMethod( + Invocation.method( + #putTransactionNotes, + [transactionNotes], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future<_i22.TransactionNote?> getTransactionNote( + String? walletId, + String? txid, + ) => + (super.noSuchMethod( + Invocation.method( + #getTransactionNote, + [ + walletId, + txid, + ], + ), + returnValue: _i19.Future<_i22.TransactionNote?>.value(), + ) as _i19.Future<_i22.TransactionNote?>); + @override + _i19.Stream<_i22.TransactionNote?> watchTransactionNote({ + required int? id, + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchTransactionNote, + [], + { + #id: id, + #fireImmediately: fireImmediately, + }, + ), + returnValue: _i19.Stream<_i22.TransactionNote?>.empty(), + ) as _i19.Stream<_i22.TransactionNote?>); + @override + _i16.QueryBuilder<_i22.AddressLabel, _i22.AddressLabel, + _i16.QAfterWhereClause> getAddressLabels( + String? walletId) => + (super.noSuchMethod( + Invocation.method( + #getAddressLabels, + [walletId], + ), + returnValue: _FakeQueryBuilder_15<_i22.AddressLabel, _i22.AddressLabel, + _i16.QAfterWhereClause>( + this, + Invocation.method( + #getAddressLabels, + [walletId], + ), + ), + ) as _i16.QueryBuilder<_i22.AddressLabel, _i22.AddressLabel, + _i16.QAfterWhereClause>); + @override + _i19.Future putAddressLabel(_i22.AddressLabel? addressLabel) => + (super.noSuchMethod( + Invocation.method( + #putAddressLabel, + [addressLabel], + ), + returnValue: _i19.Future.value(0), + ) as _i19.Future); + @override + int putAddressLabelSync(_i22.AddressLabel? addressLabel) => + (super.noSuchMethod( + Invocation.method( + #putAddressLabelSync, + [addressLabel], + ), + returnValue: 0, + ) as int); + @override + _i19.Future putAddressLabels(List<_i22.AddressLabel>? addressLabels) => + (super.noSuchMethod( + Invocation.method( + #putAddressLabels, + [addressLabels], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future<_i22.AddressLabel?> getAddressLabel( + String? walletId, + String? addressString, + ) => + (super.noSuchMethod( + Invocation.method( + #getAddressLabel, + [ + walletId, + addressString, + ], + ), + returnValue: _i19.Future<_i22.AddressLabel?>.value(), + ) as _i19.Future<_i22.AddressLabel?>); + @override + _i22.AddressLabel? getAddressLabelSync( + String? walletId, + String? addressString, + ) => + (super.noSuchMethod(Invocation.method( + #getAddressLabelSync, + [ + walletId, + addressString, + ], + )) as _i22.AddressLabel?); + @override + _i19.Stream<_i22.AddressLabel?> watchAddressLabel({ + required int? id, + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchAddressLabel, + [], + { + #id: id, + #fireImmediately: fireImmediately, + }, + ), + returnValue: _i19.Stream<_i22.AddressLabel?>.empty(), + ) as _i19.Stream<_i22.AddressLabel?>); + @override + _i19.Future updateAddressLabel(_i22.AddressLabel? addressLabel) => + (super.noSuchMethod( + Invocation.method( + #updateAddressLabel, + [addressLabel], + ), + returnValue: _i19.Future.value(0), + ) as _i19.Future); + @override + _i19.Future deleteWalletBlockchainData(String? walletId) => + (super.noSuchMethod( + Invocation.method( + #deleteWalletBlockchainData, + [walletId], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future deleteAddressLabels(String? walletId) => + (super.noSuchMethod( + Invocation.method( + #deleteAddressLabels, + [walletId], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future deleteTransactionNotes(String? walletId) => + (super.noSuchMethod( + Invocation.method( + #deleteTransactionNotes, + [walletId], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i19.Future addNewTransactionData( + List<_i15.Tuple2<_i22.Transaction, _i22.Address?>>? transactionsData, + String? walletId, + ) => + (super.noSuchMethod( + Invocation.method( + #addNewTransactionData, + [ + transactionsData, + walletId, + ], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); + @override + _i16.QueryBuilder<_i22.EthContract, _i22.EthContract, _i16.QWhere> + getEthContracts() => (super.noSuchMethod( + Invocation.method( + #getEthContracts, + [], + ), + returnValue: _FakeQueryBuilder_15<_i22.EthContract, + _i22.EthContract, _i16.QWhere>( + this, + Invocation.method( + #getEthContracts, + [], + ), + ), + ) as _i16 + .QueryBuilder<_i22.EthContract, _i22.EthContract, _i16.QWhere>); + @override + _i19.Future<_i22.EthContract?> getEthContract(String? contractAddress) => + (super.noSuchMethod( + Invocation.method( + #getEthContract, + [contractAddress], + ), + returnValue: _i19.Future<_i22.EthContract?>.value(), + ) as _i19.Future<_i22.EthContract?>); + @override + _i22.EthContract? getEthContractSync(String? contractAddress) => + (super.noSuchMethod(Invocation.method( + #getEthContractSync, + [contractAddress], + )) as _i22.EthContract?); + @override + _i19.Future putEthContract(_i22.EthContract? contract) => + (super.noSuchMethod( + Invocation.method( + #putEthContract, + [contract], + ), + returnValue: _i19.Future.value(0), + ) as _i19.Future); + @override + _i19.Future putEthContracts(List<_i22.EthContract>? contracts) => + (super.noSuchMethod( + Invocation.method( + #putEthContracts, + [contracts], + ), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), + ) as _i19.Future); } diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart index af1d78fdd..10f3e12bc 100644 --- a/test/widget_tests/wallet_card_test.mocks.dart +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/wallet_card_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i21; import 'dart:typed_data' as _i28; @@ -310,9 +312,8 @@ class MockWallets extends _i1.Mock implements _i19.Wallets { #getManagerProvidersByCoin, [], ), - returnValue: < - _i15.Tuple2<_i20.Coin, - List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + returnValue: <_i15.Tuple2<_i20.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< _i15.Tuple2<_i20.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @@ -520,7 +521,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { @override _i20.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i20.Coin.bitcoin, + returnValue: _i20.Coin.banano, ) as _i20.Coin); @override _i21.Future> get utxos => (super.noSuchMethod( @@ -1268,14 +1269,12 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { required int Function({ required int feeRatePerKB, required int vSize, - })? - estimateTxFee, + })? estimateTxFee, required _i21.Future> Function({ required String address, required _i14.Amount amount, Map? args, - })? - prepareSend, + })? prepareSend, required _i21.Future Function({required String address})? getTxCount, required _i21.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, @@ -1812,6 +1811,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService { returnValueForMissingStub: _i21.Future.value(), ) as _i21.Future); @override + _i21.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override _i21.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart index 70954c6db..e45b66f9e 100644 --- a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i23; import 'dart:typed_data' as _i29; @@ -331,9 +333,8 @@ class MockWallets extends _i1.Mock implements _i21.Wallets { #getManagerProvidersByCoin, [], ), - returnValue: < - _i15.Tuple2<_i22.Coin, - List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + returnValue: <_i15.Tuple2<_i22.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< _i15.Tuple2<_i22.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @@ -775,7 +776,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override _i23.Future> get utxos => (super.noSuchMethod( @@ -1523,14 +1524,12 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required int Function({ required int feeRatePerKB, required int vSize, - })? - estimateTxFee, + })? estimateTxFee, required _i23.Future> Function({ required String address, required _i14.Amount amount, Map? args, - })? - prepareSend, + })? prepareSend, required _i23.Future Function({required String address})? getTxCount, required _i23.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, @@ -2187,7 +2186,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override bool get isRefreshing => (super.noSuchMethod( @@ -2555,7 +2554,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart index 8c8fdc9df..64aca3224 100644 --- a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stackwallet/test/widget_tests/wallet_info_row/wallet_info_row_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i23; import 'dart:typed_data' as _i28; @@ -334,9 +336,8 @@ class MockWallets extends _i1.Mock implements _i21.Wallets { #getManagerProvidersByCoin, [], ), - returnValue: < - _i15.Tuple2<_i22.Coin, - List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + returnValue: <_i15.Tuple2<_i22.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< _i15.Tuple2<_i22.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @@ -741,6 +742,15 @@ class MockThemeService extends _i1.Mock implements _i26.ThemeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override _i23.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( @@ -868,7 +878,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i29.BitcoinWallet { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override _i23.Future> get utxos => (super.noSuchMethod( @@ -1617,14 +1627,12 @@ class MockBitcoinWallet extends _i1.Mock implements _i29.BitcoinWallet { required int Function({ required int feeRatePerKB, required int vSize, - })? - estimateTxFee, + })? estimateTxFee, required _i23.Future> Function({ required String address, required _i14.Amount amount, Map? args, - })? - prepareSend, + })? prepareSend, required _i23.Future Function({required String address})? getTxCount, required _i23.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, @@ -2281,7 +2289,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override bool get isRefreshing => (super.noSuchMethod( @@ -2649,7 +2657,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { @override _i22.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i22.Coin.bitcoin, + returnValue: _i22.Coin.banano, ) as _i22.Coin); @override bool get isRefreshing => (super.noSuchMethod( diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 3ed364885..eddd46e4d 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -80,6 +80,12 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR} install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/windows/build/libepic_cash_wallet.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/windows/build/libmobileliblelantus.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 53dc112e6..f886b2cc1 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,7 +6,7 @@ #include "generated_plugin_registrant.h" -#include +#include #include #include #include diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index fb11dd376..324c950be 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,7 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST - connectivity_plus_windows + connectivity_plus desktop_drop flutter_libepiccash flutter_secure_storage_windows