From 470a8ac21222b42d9a18b741525aed16dcbcfc5c Mon Sep 17 00:00:00 2001 From: vekamo Date: Sat, 26 Oct 2024 16:31:05 +0400 Subject: [PATCH 001/178] init mwc --- .gitmodules | 3 + README.md | 1 + crypto_plugins/flutter_libmwc | 1 + lib/db/db_version_migration.dart | 75 +- lib/db/migrate_wallets_to_isar.dart | 16 + .../blockchain_data/v2/transaction_v2.dart | 37 + lib/models/isar/stack_theme.dart | 9 + .../restore_wallet_view.dart | 27 +- .../send_view/confirm_transaction_view.dart | 24 +- lib/pages/send_view/send_view.dart | 44 +- .../global_settings_view/about_view.dart | 48 + .../advanced_views/debug_view.dart | 6 + .../add_edit_node_view.dart | 40 +- .../helpers/restore_create_backup.dart | 3 +- .../wallet_network_settings_view.dart | 34 +- .../wallet_settings_view.dart | 103 ++ .../all_transactions_view.dart | 17 + .../tx_v2/transaction_v2_details_view.dart | 131 +- .../wallet_view/sub_widgets/desktop_send.dart | 64 +- .../delete_password_warning_view.dart | 12 + .../settings_menu/desktop_about_view.dart | 171 ++- lib/services/price.dart | 1 + lib/services/wallets.dart | 10 + lib/themes/coin_icon_provider.dart | 2 + lib/utilities/address_utils.dart | 27 + lib/utilities/amount/amount_unit.dart | 1 + lib/utilities/assets.dart | 1 + lib/utilities/default_mwcmqs.dart | 53 + lib/utilities/git_status.dart | 74 +- lib/utilities/test_node_connection.dart | 1 - .../coins/mimblewimblecoin.dart | 128 ++ .../crypto_currency/crypto_currency.dart | 3 +- lib/wallets/isar/models/wallet_info.dart | 1 + .../wallet/impl/mimblewimblecoin_wallet.dart | 1197 +++++++++++++++++ ...imblewimblecoin_wallet_info_extension.dart | 111 ++ lib/wallets/wallet/wallet.dart | 4 + .../tor_has_been_add_dialog.dart | 2 +- lib/widgets/transaction_card.dart | 19 + linux/flutter/generated_plugin_registrant.cc | 5 +- linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 7 + scripts/app_config/configure_stack_wallet.sh | 1 + .../app_config/templates/linux/CMakeLists.txt | 5 +- scripts/app_config/templates/pubspec.template | 3 + .../templates/windows/CMakeLists.txt | 3 + scripts/ios/build_all.sh | 2 + scripts/ios/build_all_campfire.sh | 2 + scripts/ios/build_all_duo.sh | 2 + scripts/linux/build_all.sh | 2 + scripts/linux/build_all_campfire.sh | 2 + scripts/linux/build_all_duo.sh | 2 + scripts/macos/build_all.sh | 2 + scripts/macos/build_all_campfire.sh | 2 + scripts/macos/build_all_duo.sh | 2 + scripts/rust_version.sh | 9 + scripts/windows/build_all.sh | 2 + scripts/windows/build_all_campfire.sh | 2 + scripts/windows/build_all_duo.sh | 2 + scripts/windows/deps.sh | 7 +- test/price_test.dart | 2 + test/sample_data/theme_json.dart | 4 + test/sample_data/theme_json_v2.dart | 4 + test/services/node_service_test.dart | 13 + .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 66 files changed, 2464 insertions(+), 131 deletions(-) create mode 160000 crypto_plugins/flutter_libmwc create mode 100644 lib/utilities/default_mwcmqs.dart create mode 100644 lib/wallets/crypto_currency/coins/mimblewimblecoin.dart create mode 100644 lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart create mode 100644 lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart diff --git a/.gitmodules b/.gitmodules index 2186826df3..f1b4eb8746 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "crypto_plugins/frostdart"] path = crypto_plugins/frostdart url = https://github.com/cypherstack/frostdart +[submodule "crypto_plugins/flutter_libmwc"] + path = crypto_plugins/flutter_libmwc + url = https://github.com/vekamo/flutter_libmwc diff --git a/README.md b/README.md index 4c18c3181a..286bb6f544 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Highlights include: - [Bitcoin Cash](https://bch.info/en/) - [Dogecoin](https://dogecoin.com/) - [Epic Cash](https://linktr.ee/epiccash) + - [MimbleWimbleCoin](https://mwc.mw) - [Ethereum](https://ethereum.org/en/) - [Firo](https://firo.org/) - [Litecoin](https://litecoin.org/) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc new file mode 160000 index 0000000000..ff25b65406 --- /dev/null +++ b/crypto_plugins/flutter_libmwc @@ -0,0 +1 @@ +Subproject commit ff25b6540698e6fe3e89dda5f0480552a882369d diff --git a/lib/db/db_version_migration.dart b/lib/db/db_version_migration.dart index 1415803e4f..f350af42e7 100644 --- a/lib/db/db_version_migration.dart +++ b/lib/db/db_version_migration.dart @@ -528,6 +528,71 @@ class DbVersionMigrator with WalletDB { await MainDB.instance.addNewTransactionData(transactionsData, walletId); } + // we need to manually migrate mimblewimblecoin transactions as they are not + // stored on the mimblewimblecoin blockchain + final mimblewimblecoin = Mimblewimblecoin(CryptoCurrencyNetwork.main); + if (info.coinIdentifier == mimblewimblecoin.identifier) { + final txnData = walletBox.get("latest_tx_model") as TransactionData?; + + // we ever only used index 0 in the past + const rcvIndex = 0; + + final List> + transactionsData = []; + if (txnData != null) { + final txns = txnData.getAllTransactions(); + + for (final tx in txns.values) { + final bool isIncoming = tx.txType == "Received"; + + final iTx = isar_models.Transaction( + walletId: walletId, + txid: tx.txid, + timestamp: tx.timestamp, + type: isIncoming + ? isar_models.TransactionType.incoming + : isar_models.TransactionType.outgoing, + subType: isar_models.TransactionSubType.none, + amount: tx.amount, + amountString: Amount( + rawValue: BigInt.from(tx.amount), + fractionDigits: mimblewimblecoin.fractionDigits, + ).toJsonString(), + fee: tx.fees, + height: tx.height, + isCancelled: tx.isCancelled, + isLelantus: false, + slateId: tx.slateId, + otherData: tx.otherData, + nonce: null, + inputs: [], + outputs: [], + numberOfMessages: tx.numberOfMessages, + ); + + if (tx.address.isEmpty) { + transactionsData.add(Tuple2(iTx, null)); + } else { + final address = isar_models.Address( + walletId: walletId, + value: tx.address, + publicKey: [], + derivationIndex: isIncoming ? rcvIndex : -1, + derivationPath: null, + type: isIncoming + ? isar_models.AddressType.mimbleWimble + : isar_models.AddressType.unknown, + subType: isIncoming + ? isar_models.AddressSubType.receiving + : isar_models.AddressSubType.unknown, + ); + transactionsData.add(Tuple2(iTx, address)); + } + } + } + await MainDB.instance.addNewTransactionData(transactionsData, walletId); + } + // delete data from hive await walletBox.delete(receiveAddressesPrefix); await walletBox.delete("${receiveAddressesPrefix}P2PKH"); @@ -549,9 +614,13 @@ class DbVersionMigrator with WalletDB { ); } - // doing this for epic cash will delete transaction history as it is not - // stored on the epic cash blockchain - if (info.coinIdentifier != epic.identifier) { + // doing this for epiccash/mimblewimblecoin will delete transaction history as it is not + // stored on the epiccash/mimblewimblecoin blockchain + final excludedIdentifiers = [ + epic.identifier, + mimblewimblecoin.identifier + ]; + if ((!excludedIdentifiers.contains(info.coinIdentifier))) { // set flag to initiate full rescan on opening wallet await DB.instance.put( boxName: DB.boxNameDBInfo, diff --git a/lib/db/migrate_wallets_to_isar.dart b/lib/db/migrate_wallets_to_isar.dart index cd54a4063f..d0f75a2e37 100644 --- a/lib/db/migrate_wallets_to_isar.dart +++ b/lib/db/migrate_wallets_to_isar.dart @@ -11,6 +11,7 @@ import '../wallets/isar/models/token_wallet_info.dart'; import '../wallets/isar/models/wallet_info.dart'; import '../wallets/isar/models/wallet_info_meta.dart'; import '../wallets/wallet/supporting/epiccash_wallet_info_extension.dart'; +import '../wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart'; import 'hive/db.dart'; import 'isar/main_db.dart'; @@ -146,6 +147,21 @@ Future migrateWalletsToIsar({ otherData[WalletInfoKeys.epiccashData] = jsonEncode( epicWalletInfo.toMap(), ); + } else if (old.coinIdentifier == + Mimblewimblecoin(CryptoCurrencyNetwork.main)) { + final mimblewimblecoinWalletInfo = + ExtraMimblewimblecoinWalletInfo.fromMap({ + "receivingIndex": walletBox.get("receivingIndex") as int? ?? 0, + "changeIndex": walletBox.get("changeIndex") as int? ?? 0, + "slatesToAddresses": walletBox.get("slate_to_address") as Map? ?? {}, + "slatesToCommits": walletBox.get("slatesToCommits") as Map? ?? {}, + "lastScannedBlock": walletBox.get("lastScannedBlock") as int? ?? 0, + "restoreHeight": walletBox.get("restoreHeight") as int? ?? 0, + "creationHeight": walletBox.get("creationHeight") as int? ?? 0, + }); + otherData[WalletInfoKeys.mimblewimblecoinData] = jsonEncode( + mimblewimblecoinWalletInfo.toMap(), + ); } else if (old.coinIdentifier == Firo(CryptoCurrencyNetwork.main).identifier || old.coinIdentifier == Firo(CryptoCurrencyNetwork.test).identifier) { diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart index 4582ef47d2..cde1c965f5 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart @@ -95,6 +95,8 @@ class TransactionV2 { bool get isEpiccashTransaction => _getFromOtherData(key: TxV2OdKeys.isEpiccashTransaction) == true; + bool get isMimblewimblecoinTransaction => + _getFromOtherData(key: TxV2OdKeys.isMimblewimblecoinTransaction) == true; int? get numberOfMessages => _getFromOtherData(key: TxV2OdKeys.numberOfMessages) as int?; String? get slateId => _getFromOtherData(key: TxV2OdKeys.slateId) as String?; @@ -274,6 +276,40 @@ class TransactionV2 { } } + if (isMimblewimblecoinTransaction) { + if (slateId == null) { + return "Restored Funds"; + } + + if (isCancelled) { + return "Cancelled"; + } else if (type == TransactionType.incoming) { + if (isConfirmed(currentChainHeight, minConfirms)) { + return "Received"; + } else { + if (numberOfMessages == 1) { + return "Receiving (waiting for sender)"; + } else if ((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 ${prettyConfirms()}"; + } + } + } else if (type == TransactionType.outgoing) { + if (isConfirmed(currentChainHeight, minConfirms)) { + return "Sent (confirmed)"; + } else { + if (numberOfMessages == 1) { + return "Sending (waiting for receiver)"; + } else if ((numberOfMessages ?? 0) > 1) { + return "Sending (waiting for confirmations)"; + } else { + return "Sending ${prettyConfirms()}"; + } + } + } + } + if (type == TransactionType.incoming) { // if (_transaction.isMinting) { // return "Minting"; @@ -331,6 +367,7 @@ abstract final class TxV2OdKeys { static const size = "size"; static const vSize = "vSize"; static const isEpiccashTransaction = "isEpiccashTransaction"; + static const isMimblewimblecoinTransaction = "isMimblewimblecoinTransaction"; static const numberOfMessages = "numberOfMessages"; static const slateId = "slateId"; static const onChainNote = "onChainNote"; diff --git a/lib/models/isar/stack_theme.dart b/lib/models/isar/stack_theme.dart index ce5002a1d5..4f831732f0 100644 --- a/lib/models/isar/stack_theme.dart +++ b/lib/models/isar/stack_theme.dart @@ -1939,6 +1939,7 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincash; late final String dogecoin; late final String epicCash; + late final String mimblewimblecoin; late final String ethereum; late final String firo; late final String monero; @@ -1949,6 +1950,7 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincashImage; late final String dogecoinImage; late final String epicCashImage; + late final String mimblewimblecoinImage; late final String ethereumImage; late final String firoImage; late final String litecoinImage; @@ -1960,6 +1962,7 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincashImageSecondary; late final String dogecoinImageSecondary; late final String epicCashImageSecondary; + late final String mimblewimblecoinImageSecondary; late final String ethereumImageSecondary; late final String firoImageSecondary; late final String litecoinImageSecondary; @@ -2006,6 +2009,8 @@ class ThemeAssets implements IThemeAssets { ..bitcoincash = "$themeId/assets/${json["bitcoincash"] as String}" ..dogecoin = "$themeId/assets/${json["dogecoin"] as String}" ..epicCash = "$themeId/assets/${json["epicCash"] as String}" + ..mimblewimblecoin = + "$themeId/assets/${json["mimblewimblecoin"] as String}" ..ethereum = "$themeId/assets/${json["ethereum"] as String}" ..firo = "$themeId/assets/${json["firo"] as String}" ..monero = "$themeId/assets/${json["monero"] as String}" @@ -2017,6 +2022,8 @@ class ThemeAssets implements IThemeAssets { "$themeId/assets/${json["bitcoincash_image"] as String}" ..dogecoinImage = "$themeId/assets/${json["dogecoin_image"] as String}" ..epicCashImage = "$themeId/assets/${json["epicCash_image"] as String}" + ..mimblewimblecoinImage = + "$themeId/assets/${json["mimblewimblecoin_image"] as String}" ..ethereumImage = "$themeId/assets/${json["ethereum_image"] as String}" ..firoImage = "$themeId/assets/${json["firo_image"] as String}" ..litecoinImage = "$themeId/assets/${json["litecoin_image"] as String}" @@ -2032,6 +2039,8 @@ class ThemeAssets implements IThemeAssets { "$themeId/assets/${json["dogecoin_image_secondary"] as String}" ..epicCashImageSecondary = "$themeId/assets/${json["epicCash_image_secondary"] as String}" + ..mimblewimblecoinImageSecondary = + "$themeId/assets/${json["mimblewimblecoin_image_secondary"] as String}" ..ethereumImageSecondary = "$themeId/assets/${json["ethereum_image_secondary"] as String}" ..firoImageSecondary = 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 2fae2352cc..20bf9fd8b1 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 @@ -46,9 +46,11 @@ import '../../../utilities/util.dart'; import '../../../wallets/crypto_currency/crypto_currency.dart'; import '../../../wallets/isar/models/wallet_info.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../wallets/wallet/impl/wownero_wallet.dart'; import '../../../wallets/wallet/supporting/epiccash_wallet_info_extension.dart'; +import '../../../wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart'; import '../../../wallets/wallet/wallet.dart'; import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../../widgets/desktop/desktop_app_bar.dart'; @@ -253,10 +255,27 @@ class _RestoreWalletViewState extends ConsumerState { height = 0; } + // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index + if (widget.coin is Mimblewimblecoin) { + final int secondsSinceEpoch = + widget.restoreFromDate.millisecondsSinceEpoch ~/ 1000; + const int mimblewimblecoinFirstBlock = 1565370278; + const double overestimateSecondsPerBlock = 61; + final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; + final int approximateHeight = + chosenSeconds ~/ overestimateSecondsPerBlock; + //todo: check if print needed + // debugPrint( + // "approximate height: $approximateHeight chosen_seconds: $chosenSeconds"); + height = approximateHeight; + if (height < 0) { + height = 0; + } + otherDataJsonString = jsonEncode( { - WalletInfoKeys.epiccashData: jsonEncode( - ExtraEpiccashWalletInfo( + WalletInfoKeys.mimblewimblecoinData: jsonEncode( + ExtraMimblewimblecoinWalletInfo( receivingIndex: 0, changeIndex: 0, slatesToAddresses: {}, @@ -354,6 +373,10 @@ class _RestoreWalletViewState extends ConsumerState { case const (EpiccashWallet): await (wallet as EpiccashWallet).init(isRestore: true); break; + + case const (MimblewimblecoinWallet): + await (wallet as MimblewimblecoinWallet).init(isRestore: true); + break; case const (MoneroWallet): await (wallet as MoneroWallet).init(isRestore: true); diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index 5090645e30..ce08150f35 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -14,6 +14,7 @@ import 'dart:io'; import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_libepiccash/lib.dart'; +import 'package:flutter_libmwc/lib.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -33,6 +34,7 @@ import '../../utilities/constants.dart'; import '../../utilities/text_styles.dart'; import '../../utilities/util.dart'; import '../../wallets/crypto_currency/coins/epiccash.dart'; +import '../../wallets/crypto_currency/coins/mimblewimblecoin.dart'; import '../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../wallets/isar/providers/eth/current_token_wallet_provider.dart'; import '../../wallets/isar/providers/wallet_info_provider.dart'; @@ -159,7 +161,7 @@ class _ConfirmTransactionViewState break; } } else { - if (coin is Epiccash) { + if (coin is Epiccash || coin is Mimblewimblecoin) { txDataFuture = wallet.confirmSend( txData: widget.txData.copyWith( noteOnChain: onChainNoteController.text, @@ -578,11 +580,13 @@ class _ConfirmTransactionViewState ], ), ), - if (coin is Epiccash && widget.txData.noteOnChain!.isNotEmpty) + if ((coin is Epiccash || coin is Mimblewimblecoin) && + widget.txData.noteOnChain!.isNotEmpty) const SizedBox( height: 12, ), - if (coin is Epiccash && widget.txData.noteOnChain!.isNotEmpty) + if ((coin is Epiccash || coin is Mimblewimblecoin) && + widget.txData.noteOnChain!.isNotEmpty) RoundedWhiteContainer( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, @@ -611,7 +615,9 @@ class _ConfirmTransactionViewState crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text( - (coin is Epiccash) ? "Local Note" : "Note", + (coin is Epiccash || coin is Mimblewimblecoin) + ? "Local Note" + : "Note", style: STextStyles.smallMed12(context), ), const SizedBox( @@ -913,17 +919,17 @@ class _ConfirmTransactionViewState mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) Text( "On chain Note (optional)", style: STextStyles.smallMed12(context), textAlign: TextAlign.left, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox( height: 8, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -963,12 +969,12 @@ class _ConfirmTransactionViewState ), ), ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox( height: 12, ), SelectableText( - (coin is Epiccash) + (coin is Epiccash || coin is Mimblewimblecoin) ? "Local Note (optional)" : "Note (optional)", style: diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 584d868d28..63c6b267cf 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -311,7 +311,9 @@ class _SendViewState extends ConsumerState { _cryptoAmountChangedFeeUpdateTimer?.cancel(); _cryptoAmountChangedFeeUpdateTimer = Timer(updateFeesTimerDuration, () { - if (coin is! Epiccash && !_baseFocus.hasFocus) { + if (coin is! Epiccash && + coin is! Mimblewimblecoin && + !_baseFocus.hasFocus) { setState(() { _calculateFeesFuture = calculateFees( amount == null @@ -332,7 +334,9 @@ class _SendViewState extends ConsumerState { void _baseAmountChanged() { _baseAmountChangedFeeUpdateTimer?.cancel(); _baseAmountChangedFeeUpdateTimer = Timer(updateFeesTimerDuration, () { - if (coin is! Epiccash && !_cryptoFocus.hasFocus) { + if (coin is! Epiccash && + coin is! Mimblewimblecoin && + !_cryptoFocus.hasFocus) { setState(() { _calculateFeesFuture = calculateFees( ref.read(pSendAmount) == null @@ -1116,6 +1120,21 @@ class _SendViewState extends ConsumerState { }); } + if (coin is Mimblewimblecoin) { + sendToController.addListener(() { + _address = sendToController.text.trim(); + + if (_address != null && _address!.isNotEmpty) { + _address = _address!.trim(); + if (_address!.contains("\n")) { + _address = _address!.substring(0, _address!.indexOf("\n")); + } + + sendToController.text = AddressUtils().formatAddress(_address!); + } + }); + } + return Background( child: Scaffold( backgroundColor: Theme.of(context).extension()!.background, @@ -1447,6 +1466,14 @@ class _SendViewState extends ConsumerState { content, ); } + if (coin + is Mimblewimblecoin) { + // strip http:// and https:// if content contains @ + content = AddressUtils() + .formatAddress( + content, + ); + } sendToController.text = content.trim(); _address = content.trim(); @@ -2030,17 +2057,17 @@ class _SendViewState extends ConsumerState { const SizedBox( height: 12, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) Text( "On chain Note (optional)", style: STextStyles.smallMed12(context), textAlign: TextAlign.left, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox( height: 8, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -2084,12 +2111,12 @@ class _SendViewState extends ConsumerState { ), ), ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox( height: 12, ), Text( - (coin is Epiccash) + (coin is Epiccash || coin is Mimblewimblecoin) ? "Local Note (optional)" : "Note (optional)", style: STextStyles.smallMed12(context), @@ -2141,6 +2168,7 @@ class _SendViewState extends ConsumerState { height: 12, ), if (coin is! Epiccash && + coin is! Mimblewimblecoin && coin is! NanoCurrency && coin is! Tezos) Text( @@ -2149,12 +2177,14 @@ class _SendViewState extends ConsumerState { textAlign: TextAlign.left, ), if (coin is! Epiccash && + coin is! Mimblewimblecoin && coin is! NanoCurrency && coin is! Tezos) const SizedBox( height: 8, ), if (coin is! Epiccash && + coin is! Mimblewimblecoin && coin is! NanoCurrency && coin is! Tezos) Stack( 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 b72c3222cc..d29aae7dc3 100644 --- a/lib/pages/settings_views/global_settings_view/about_view.dart +++ b/lib/pages/settings_views/global_settings_view/about_view.dart @@ -268,6 +268,54 @@ class AboutView extends ConsumerWidget { ); }, ), + if (AppConfig.coins + .whereType() + .isNotEmpty) + const SizedBox( + height: 12, + ), + if (AppConfig.coins + .whereType() + .isNotEmpty) + FutureBuilder( + future: GitStatus.getMimblewimblecoinCommitStatus(), + builder: ( + context, + AsyncSnapshot snapshot, + ) { + CommitStatus stateOfCommit = + CommitStatus.notLoaded; + + if (snapshot.connectionState == + ConnectionState.done && + snapshot.hasData) { + stateOfCommit = snapshot.data!; + } + + return RoundedWhiteContainer( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + Text( + "Mimblewimblecoin Build Commit", + style: STextStyles.titleBold12(context), + ), + const SizedBox( + height: 4, + ), + SelectableText( + GitStatus.mimblewimblecoinCommit, + style: GitStatus.styleForStatus( + stateOfCommit, + context, + ), + ), + ], + ), + ); + }, + ), if (AppConfig.coins.whereType().isNotEmpty) const SizedBox( height: 12, 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 92e5cc256d..8315302df7 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 @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_libepiccash/git_versions.dart' as EPIC_VERSIONS; // import 'package:flutter_libmonero/git_versions.dart' as MONERO_VERSIONS; +import 'package:flutter_libmwc/git_versions.dart' as MIMBLEWIMBLECOIN_VERSIONS; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS; @@ -315,6 +316,9 @@ class _DebugViewState extends ConsumerState { EPIC_VERSIONS.getPluginVersion(); // final String moneroCommit = // MONERO_VERSIONS.getPluginVersion(); + final String mimblewimblecoinCommit = + MIMBLEWIMBLECOIN_VERSIONS + .getPluginVersion(); final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); final deviceInfo = @@ -348,6 +352,8 @@ class _DebugViewState extends ConsumerState { "firoCommit": firoCommit, "epicCashCommit": epicCashCommit, // "moneroCommit": moneroCommit, + "mimblewimblecoinCommit": + mimblewimblecoinCommit, "deviceInfoMap": deviceInfoMap, "errorLogs": errorLogs, }; 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 7888635b76..e9b15cc307 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 @@ -78,6 +78,17 @@ class _AddEditNodeViewState extends ConsumerState { ref.read(nodeFormDataProvider).host = data.host; ref.read(nodeFormDataProvider).port = data.port; ref.read(nodeFormDataProvider).useSSL = data.useSSL; + } else if (coin is Mimblewimblecoin) { + ref.read(nodeFormDataProvider).host = data.host; + ref.read(nodeFormDataProvider).port = data.port; + ref.read(nodeFormDataProvider).useSSL = data.useSSL; + } else if (coin is CryptonoteCurrency) { + ref.read(nodeFormDataProvider).host = data.host; + } + if (coin is Mimblewimblecoin) { + ref.read(nodeFormDataProvider).host = data.host; + ref.read(nodeFormDataProvider).port = data.port; + ref.read(nodeFormDataProvider).useSSL = data.useSSL; } else if (coin is CryptonoteCurrency) { ref.read(nodeFormDataProvider).host = data.host; } @@ -706,6 +717,8 @@ class _NodeFormState extends ConsumerState { _trusted = node.trusted ?? false; if (widget.coin is Epiccash) { enableSSLCheckbox = !node.host.startsWith("http"); + } else if (widget.coin is Mimblewimblecoin) { + enableSSLCheckbox = !node.host.startsWith("http"); } else { enableSSLCheckbox = true; } @@ -846,6 +859,25 @@ class _NodeFormState extends ConsumerState { _useSSL = true; } } + if (widget.coin is Mimblewimblecoin) { + if (newValue.startsWith("https://")) { + _useSSL = true; + enableSSLCheckbox = false; + } else if (newValue.startsWith("http://")) { + _useSSL = false; + enableSSLCheckbox = false; + } else { + enableSSLCheckbox = true; + } + } else if (widget.coin is CwBasedInterface) { + if (newValue.startsWith("https://")) { + _useSSL = true; + } else if (newValue.startsWith("http://")) { + _useSSL = false; + } else { + _useSSL = true; + } + } _updateState(); setState(() {}); }, @@ -1105,11 +1137,15 @@ class _NodeFormState extends ConsumerState { ), ], ), - if (widget.coin is! CryptonoteCurrency && widget.coin is! Epiccash) + if (widget.coin is! CryptonoteCurrency && + widget.coin is! Epiccash && + widget.coin is! Mimblewimblecoin) const SizedBox( height: 8, ), - if (widget.coin is! CryptonoteCurrency && widget.coin is! Epiccash) + if (widget.coin is! CryptonoteCurrency && + widget.coin is! Epiccash && + widget.coin is! Mimblewimblecoin) Row( children: [ GestureDetector( 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 32430d228a..2dcc604568 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 @@ -52,6 +52,7 @@ import '../../../../../wallets/isar/models/frost_wallet_info.dart'; import '../../../../../wallets/isar/models/wallet_info.dart'; import '../../../../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; import '../../../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../../../wallets/wallet/impl/wownero_wallet.dart'; import '../../../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; @@ -503,7 +504,7 @@ abstract class SWB { Future? restoringFuture; - if (!(wallet is LibMoneroWallet || wallet is EpiccashWallet)) { + if (!(wallet is LibMoneroWallet || wallet is EpiccashWallet || wallet is MimblewimblecoinWallet)) { if (wallet is BitcoinFrostWallet) { restoringFuture = wallet.recover( isRescan: false, 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 1be577f1d4..b88e9ce92f 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 @@ -33,10 +33,12 @@ import '../../../../utilities/constants.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; import '../../../../wallets/crypto_currency/coins/epiccash.dart'; +import '../../../../wallets/crypto_currency/coins/mimblewimblecoin.dart'; import '../../../../wallets/crypto_currency/coins/monero.dart'; import '../../../../wallets/crypto_currency/coins/wownero.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../../wallets/wallet/impl/wownero_wallet.dart'; import '../../../../widgets/animated_text.dart'; @@ -263,7 +265,10 @@ class _WalletNetworkSettingsViewState final coin = ref.read(pWalletCoin(widget.walletId)); - if (coin is Monero || coin is Wownero || coin is Epiccash) { + if (coin is Monero || + coin is Wownero || + coin is Epiccash || + coin is Mimblewimblecoin) { _blocksRemainingSubscription = eventBus.on().listen( (event) async { if (event.walletId == widget.walletId) { @@ -343,6 +348,14 @@ class _WalletNetworkSettingsViewState if (_percent < highestPercent) { _percent = highestPercent.clamp(0.0, 1.0); } + } else if (coin is Mimblewimblecoin) { + final double highestPercent = (ref + .watch(pWallets) + .getWallet(widget.walletId) as MimblewimblecoinWallet) + .highestPercent; + if (_percent < highestPercent) { + _percent = highestPercent.clamp(0.0, 1.0); + } } return ConditionalParent( @@ -363,7 +376,11 @@ class _WalletNetworkSettingsViewState style: STextStyles.navBarTitle(context), ), actions: [ - if (ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) + if (ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && + ref.watch(pWalletCoin(widget.walletId)) + is! Mimblewimblecoin || + ref.watch(pWalletCoin(widget.walletId)) + is! Mimblewimblecoin) Padding( padding: const EdgeInsets.only( top: 10, @@ -627,6 +644,7 @@ class _WalletNetworkSettingsViewState ), if (coin is Monero || coin is Wownero || + coin is Mimblewimblecoin || coin is Epiccash) Text( " (Blocks to go: ${_blocksRemaining == -1 ? "?" : _blocksRemaining})", @@ -950,11 +968,15 @@ class _WalletNetworkSettingsViewState coin: ref.watch(pWalletCoin(widget.walletId)), popBackToRoute: WalletNetworkSettingsView.routeName, ), - if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) + if (isDesktop && + ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && + ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) const SizedBox( height: 32, ), - if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) + if (isDesktop && + ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && + ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) Padding( padding: const EdgeInsets.only( bottom: 12, @@ -970,7 +992,9 @@ class _WalletNetworkSettingsViewState ], ), ), - if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) + if (isDesktop && + ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && + ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) RoundedWhiteContainer( borderColor: isDesktop ? Theme.of(context).extension()!.background 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 494834b029..0135d5cac0 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 @@ -18,6 +18,7 @@ import 'package:tuple/tuple.dart'; import '../../../db/hive/db.dart'; import '../../../db/sqlite/firo_cache.dart'; import '../../../models/epicbox_config_model.dart'; +import '../../../models/mwcmqs_config_model.dart'; import '../../../models/keys/key_data_interface.dart'; import '../../../notifications/show_flush_bar.dart'; import '../../../providers/global/wallets_provider.dart'; @@ -37,6 +38,8 @@ import '../../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; import '../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; +import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; +import '../../../wallets/wallet/wallet_mixin_interfaces/cw_based_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; @@ -694,3 +697,103 @@ class _EpiBoxInfoFormState extends ConsumerState { ); } } + +class MwcMqsInfoForm extends ConsumerStatefulWidget { + const MwcMqsInfoForm({ + super.key, + required this.walletId, + }); + + final String walletId; + + @override + ConsumerState createState() => _MwcMqsInfoFormState(); +} + +class _MwcmqsInfoFormState extends ConsumerState { + final hostController = TextEditingController(); + final portController = TextEditingController(); + + late MimblewimblecoinWallet wallet; + + @override + void initState() { + wallet = + ref.read(pWallets).getWallet(widget.walletId) as MimblewimblecoinWallet; + + wallet.getMwcMqsConfig().then((MwcMqsConfigModel mwcmqsConfig) { + hostController.text = mwcmqsConfig.host; + portController.text = "${mwcmqsConfig.port ?? 443}"; + }); + super.initState(); + } + + @override + void dispose() { + hostController.dispose(); + portController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop ? false : true, + controller: hostController, + decoration: const InputDecoration(hintText: "Host"), + ), + const SizedBox( + height: 8, + ), + TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop ? false : true, + controller: portController, + decoration: const InputDecoration(hintText: "Port"), + keyboardType: + Util.isDesktop ? null : const TextInputType.numberWithOptions(), + ), + const SizedBox( + height: 8, + ), + TextButton( + onPressed: () async { + try { + await wallet.updateMwcmqsConfig( + hostController.text, + int.parse(portController.text), + ); + if (mounted) { + await showFloatingFlushBar( + context: context, + message: "Mwcmqs info saved!", + type: FlushBarType.success, + ); + } + unawaited(wallet.refresh()); + } catch (e) { + await showFloatingFlushBar( + context: context, + message: "Failed to save mwcmqs info: $e", + type: FlushBarType.warning, + ); + } + }, + child: Text( + "Save", + style: STextStyles.button(context).copyWith( + color: + Theme.of(context).extension()!.accentColorDark, + ), + ), + ), + ], + ), + ); + } +} 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 5afd82597f..385bb8a2e0 100644 --- a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart +++ b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart @@ -873,6 +873,10 @@ class _DesktopTransactionCardRowState return "Restored Funds"; } + if (coin is Mimblewimblecoin && _transaction.slateId == null) { + return "Restored Funds"; + } + if (_transaction.subType == TransactionSubType.mint) { if (_transaction.isConfirmed(height, minConfirms)) { return "Anonymized"; @@ -967,6 +971,19 @@ class _DesktopTransactionCardRowState ); return; } + + if (coin is Mimblewimblecoin && _transaction.slateId == null) { + unawaited( + showFloatingFlushBar( + context: context, + message: + "Restored Mimblewimblecoin funds from your Seed have no Data.", + type: FlushBarType.warning, + duration: const Duration(seconds: 5), + ), + ); + return; + } if (Util.isDesktop) { await showDialog( context: context, diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index 666d8d041f..03316599f6 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -42,6 +42,7 @@ import '../../../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../../../wallets/isar/models/spark_coin.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import '../../../../widgets/background.dart'; @@ -241,6 +242,33 @@ class _TransactionV2DetailsViewState ), ) .toList(); + } else if (_transaction.isMimblewimblecoinTransaction) { + switch (_transaction.type) { + case TransactionType.outgoing: + case TransactionType.unknown: + amount = _transaction.getAmountSentFromThisWallet( + fractionDigits: fractionDigits, + ); + break; + + case TransactionType.incoming: + case TransactionType.sentToSelf: + amount = _transaction.getAmountReceivedInThisWallet( + fractionDigits: fractionDigits, + ); + break; + } + data = _transaction.outputs + .map( + (e) => ( + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ) + ), + ) + .toList(); } else if (_transaction.subType == TransactionSubType.cashFusion) { amount = _transaction.getAmountReceivedInThisWallet( fractionDigits: fractionDigits, @@ -1053,13 +1081,13 @@ class _TransactionV2DetailsViewState ], ), ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) isDesktop ? const _Divider() : const SizedBox( height: 12, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) RoundedWhiteContainer( padding: isDesktop ? const EdgeInsets.all(16) @@ -1131,7 +1159,8 @@ class _TransactionV2DetailsViewState MainAxisAlignment.spaceBetween, children: [ Text( - (coin is Epiccash) + (coin is Epiccash || + coin is Mimblewimblecoin) ? "Local Note" : "Note ", style: isDesktop @@ -1202,7 +1231,9 @@ class _TransactionV2DetailsViewState .watch( pTransactionNote( ( - txid: (coin is Epiccash) + txid: (coin is Epiccash || + coin + is Mimblewimblecoin) ? _transaction.slateId .toString() : _transaction.txid, @@ -1478,8 +1509,9 @@ class _TransactionV2DetailsViewState ? "${_transaction.height!}" : "Pending"; confirmations = confirms.toString(); - } else if (widget.coin is Epiccash && - _transaction.slateId == null) { + } else if (widget.coin is Epiccash || + coin is Mimblewimblecoin && + _transaction.slateId == null) { confirmations = "Unknown"; height = "Unknown"; } else { @@ -1487,7 +1519,9 @@ class _TransactionV2DetailsViewState currentHeight, minConfirms, ); - if (widget.coin is! Epiccash && confirmed) { + if (widget.coin is! Epiccash && + widget.coin is! Mimblewimblecoin && + confirmed) { height = "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; } else { @@ -1748,11 +1782,13 @@ class _TransactionV2DetailsViewState context, ), ), - if (coin is! Epiccash) + if (coin is! Epiccash && + coin is! Mimblewimblecoin) const SizedBox( height: 8, ), - if (coin is! Epiccash) + if (coin is! Epiccash && + coin is! Mimblewimblecoin) CustomTextButton( text: "Open in block explorer", onTap: () async { @@ -1909,13 +1945,13 @@ class _TransactionV2DetailsViewState // ], // ), // ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) isDesktop ? const _Divider() : const SizedBox( height: 12, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) RoundedWhiteContainer( padding: isDesktop ? const EdgeInsets.all(16) @@ -1999,9 +2035,10 @@ class _TransactionV2DetailsViewState ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: (coin is Epiccash && - _transaction.getConfirmations(currentHeight) < 1 && - _transaction.isCancelled == false) + floatingActionButton: (coin is Epiccash || + coin is Mimblewimblecoin && + _transaction.getConfirmations(currentHeight) < 1 && + _transaction.isCancelled == false) ? ConditionalParent( condition: isDesktop, builder: (child) => Padding( @@ -2085,6 +2122,72 @@ class _TransactionV2DetailsViewState ); return; } + + if (wallet is MimblewimblecoinWallet) { + final String? id = _transaction.slateId; + if (id == null) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: + "Could not find Mimblewimblecoin transaction ID", + context: context, + ), + ); + return; + } + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = + await wallet.cancelPendingTransactionAndPost(id); + if (mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + wallet.refresh(); + Navigator.of(context).popUntil( + ModalRoute.withName( + WalletView.routeName, + ), + ); + }, + ), + ); + } else { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + ), + ); + } + } + } else { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: + "ERROR: Wallet type is not Mimblewimblecoin", + context: context, + ), + ); + return; + } }, child: Text( "Cancel Transaction", 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 80dea67954..a09f60b104 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 @@ -482,6 +482,11 @@ class _DesktopSendState extends ConsumerState { noteOnChain: _onChainNote ?? "", ); } + if (coin is Mimblewimblecoin) { + txData = txData.copyWith( + noteOnChain: _onChainNote ?? "", + ); + } } // pop building dialog Navigator.of( @@ -840,6 +845,9 @@ class _DesktopSendState extends ConsumerState { if (coin is Epiccash) { content = AddressUtils().formatAddress(content); } + if (coin is Mimblewimblecoin) { + content = AddressUtils().formatAddressMwc(content); + } sendToController.text = content; _address = content; @@ -855,6 +863,10 @@ class _DesktopSendState extends ConsumerState { // strip http:// and https:// if content contains @ content = AddressUtils().formatAddress(content); } + if (coin is Mimblewimblecoin) { + // strip http:// and https:// if content contains @ + content = AddressUtils().formatAddressMwc(content); + } sendToController.text = content; _address = content; @@ -1092,6 +1104,21 @@ class _DesktopSendState extends ConsumerState { }); } + if (coin is Mimblewimblecoin) { + sendToController.addListener(() { + _address = sendToController.text; + + if (_address != null && _address!.isNotEmpty) { + _address = _address!.trim(); + if (_address!.contains("\n")) { + _address = _address!.substring(0, _address!.indexOf("\n")); + } + + sendToController.text = formatAddressMwc(_address!); + } + }); + } + final firoType = ref.watch(publicPrivateBalanceStateProvider); final isExchangeAddress = ref.watch(pIsExchangeAddress); @@ -1765,7 +1792,10 @@ class _DesktopSendState extends ConsumerState { const SizedBox( height: 20, ), - if (coin is! NanoCurrency && coin is! Epiccash && coin is! Tezos) + if (coin is! NanoCurrency && + coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! Tezos) ConditionalParent( condition: ref.watch(pWallets).getWallet(walletId) is ElectrumXInterface && @@ -1821,11 +1851,17 @@ class _DesktopSendState extends ConsumerState { textAlign: TextAlign.left, ), ), - if (coin is! NanoCurrency && coin is! Epiccash && coin is! Tezos) + if (coin is! NanoCurrency && + coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! Tezos) const SizedBox( height: 10, ), - if (coin is! NanoCurrency && coin is! Epiccash && coin is! Tezos) + if (coin is! NanoCurrency && + coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! Tezos) if (!isCustomFee) Padding( padding: const EdgeInsets.all(10), @@ -2030,3 +2066,25 @@ String formatAddress(String epicAddress) { } return epicAddress; } + +String formatAddressMwc(String mimblewimblecoinAddress) { + // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an mwcmqs address) + if ((mimblewimblecoinAddress.startsWith("http://") || + mimblewimblecoinAddress.startsWith("https://")) && + mimblewimblecoinAddress.contains("@")) { + mimblewimblecoinAddress = mimblewimblecoinAddress.replaceAll("http://", ""); + mimblewimblecoinAddress = + mimblewimblecoinAddress.replaceAll("https://", ""); + } + // strip mailto: prefix + if (mimblewimblecoinAddress.startsWith("mailto:")) { + mimblewimblecoinAddress = mimblewimblecoinAddress.replaceAll("mailto:", ""); + } + // strip / suffix if the address contains an @ symbol (and is thus an mwcmqs address) + if (mimblewimblecoinAddress.endsWith("/") && + mimblewimblecoinAddress.contains("@")) { + mimblewimblecoinAddress = mimblewimblecoinAddress.substring( + 0, mimblewimblecoinAddress.length - 1); + } + return mimblewimblecoinAddress; +} 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 e8a4c5256b..2aae2e1fc6 100644 --- a/lib/pages_desktop_specific/password/delete_password_warning_view.dart +++ b/lib/pages_desktop_specific/password/delete_password_warning_view.dart @@ -63,6 +63,12 @@ class _ForgotPasswordDesktopViewState await epicDir.delete(recursive: true); } + final mimblewimblecoinDir = + Directory("${appRoot.path}/mimblewimblecoin"); + if (mimblewimblecoinDir.existsSync()) { + await mimblewimblecoinDir.delete(recursive: true); + } + await Isar.getInstance("desktopStore")?.close(deleteFromDisk: true); await (await StackFileSystem.applicationHiveDirectory()) @@ -79,6 +85,12 @@ class _ForgotPasswordDesktopViewState if (epicDir.existsSync()) { await epicDir.delete(recursive: true); } + final mimblewimblecoinDir = + Directory("${appRoot.path}/mimblewimblecoin"); + if (mimblewimblecoinDir.existsSync()) { + await mimblewimblecoinDir.delete(recursive: true); + } + await (await StackFileSystem.applicationHiveDirectory()) .delete(recursive: true); await (await StackFileSystem.applicationIsarDirectory()) 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 98a7dec344..7d48217bc0 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 @@ -434,63 +434,122 @@ class DesktopAboutView extends ConsumerWidget { ); }, ), - // if (AppConfig.coins - // .whereType() - // .isNotEmpty) - // FutureBuilder( - // future: GitStatus - // .getMoneroCommitStatus(), - // builder: ( - // context, - // AsyncSnapshot - // snapshot, - // ) { - // CommitStatus stateOfCommit = - // CommitStatus.notLoaded; + if (AppConfig.coins + .whereType() + .isNotEmpty) + FutureBuilder( + future: GitStatus + .getMimblewimblecoinCommitStatus(), + builder: ( + context, + AsyncSnapshot + snapshot, + ) { + CommitStatus stateOfCommit = + CommitStatus.notLoaded; + + if (snapshot.connectionState == + ConnectionState + .done && + snapshot.hasData) { + stateOfCommit = + snapshot.data!; + } + + return Column( + mainAxisSize: + MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + "Mimblewimblecoin Build Commit", + style: STextStyles + .desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of( + context, + ) + .extension< + StackColors>()! + .textDark, + ), + ), + const SizedBox( + height: 2, + ), + SelectableText( + GitStatus + .mimblewimblecoinCommit, + style: GitStatus + .styleForStatus( + stateOfCommit, + context, + ), + ), + ], + ); + }, + ), + //if (AppConfig.coins + // .whereType() + // .isNotEmpty) + // FutureBuilder( + // future: GitStatus + // .getMoneroCommitStatus(), + // builder: ( + // context, + // AsyncSnapshot + // snapshot, + // ) { + // CommitStatus stateOfCommit = + // CommitStatus.notLoaded; // - // if (snapshot.connectionState == - // ConnectionState - // .done && - // snapshot.hasData) { - // stateOfCommit = - // snapshot.data!; - // } - // return Column( - // mainAxisSize: - // MainAxisSize.min, - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // Text( - // "Monero Build Commit", - // style: STextStyles - // .desktopTextExtraExtraSmall( - // context, - // ).copyWith( - // color: Theme.of( - // context, - // ) - // .extension< - // StackColors>()! - // .textDark, - // ), - // ), - // const SizedBox( - // height: 2, - // ), - // SelectableText( - // GitStatus.moneroCommit, - // style: GitStatus - // .styleForStatus( - // stateOfCommit, - // context, - // ), - // ), - // ], - // ); - // }, - // ), + // if (snapshot.connectionState == + // ConnectionState + // .done && + // snapshot.hasData) { + // stateOfCommit = + // snapshot.data!; + // } + // return Column( + // mainAxisSize: + // MainAxisSize.min, + // crossAxisAlignment: + // CrossAxisAlignment + // .start, + // children: [ + // Text( + // "Monero Build Commit", + // style: STextStyles + // .desktopTextExtraExtraSmall( + // context, + // ).copyWith( + // color: Theme.of( + // context, + // ) + // .extension< + // StackColors>()! + // .textDark, + // ), + // ), + // const SizedBox( + // height: 2, + // ), + // SelectableText( + // GitStatus.moneroCommit, + // style: GitStatus + // .styleForStatus( + // stateOfCommit, + // context, + // ), + // ), + // ], + // ); + // }, + // ), ], ), const SizedBox(height: 35), diff --git a/lib/services/price.dart b/lib/services/price.dart index 5a97e43cbc..071ce59804 100644 --- a/lib/services/price.dart +++ b/lib/services/price.dart @@ -34,6 +34,7 @@ class PriceAPI { Dash: "dash", Dogecoin: "dogecoin", Epiccash: "epic-cash", + Mimblewimblecoin: "mimblewimblecoin", Ecash: "ecash", Ethereum: "ethereum", Firo: "zcoin", diff --git a/lib/services/wallets.dart b/lib/services/wallets.dart index d7b93cf33f..1e6c250b79 100644 --- a/lib/services/wallets.dart +++ b/lib/services/wallets.dart @@ -25,6 +25,7 @@ import '../wallets/crypto_currency/crypto_currency.dart'; import '../wallets/isar/models/wallet_info.dart'; import '../wallets/wallet/impl/epiccash_wallet.dart'; import '../wallets/wallet/intermediate/lib_monero_wallet.dart'; +import '../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../wallets/wallet/wallet.dart'; import 'event_bus/events/wallet_added_event.dart'; import 'event_bus/global_event_bus.dart'; @@ -110,6 +111,15 @@ class Wallets { "epic wallet: $walletId deleted with result: $deleteResult", level: LogLevel.Info, ); + } else if (info.coin is Mimblewimblecoin) { + final deleteResult = await deleteMimblewimblecoinWallet( + walletId: walletId, + secureStore: secureStorage, + ); + Logging.instance.log( + "Mimblewimblecoin wallet: $walletId deleted with result: $deleteResult", + level: LogLevel.Info, + ); } // delete wallet data in main db diff --git a/lib/themes/coin_icon_provider.dart b/lib/themes/coin_icon_provider.dart index 4a789ad76a..1deb22b4e1 100644 --- a/lib/themes/coin_icon_provider.dart +++ b/lib/themes/coin_icon_provider.dart @@ -28,6 +28,8 @@ final coinIconProvider = Provider.family((ref, coin) { return assets.dogecoin; case const (Epiccash): return assets.epicCash; + case const (Mimblewimblecoin): + return assets.mimblewimblecoin; case const (Firo): return assets.firo; case const (Monero): diff --git a/lib/utilities/address_utils.dart b/lib/utilities/address_utils.dart index 869aa58956..9cd952b3e8 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -46,6 +46,8 @@ class AddressUtils { // return Dogecoin(CryptoCurrencyNetwork.main).validateAddress(address); // case Coin.epicCash: // return Epiccash(CryptoCurrencyNetwork.main).validateAddress(address); + // case Coin.mimblewimblecoin: + // return Mimblewimblecoin(CryptoCurrencyNetwork.main).validateAddress(address); // case Coin.ethereum: // return Ethereum(CryptoCurrencyNetwork.main).validateAddress(address); // case Coin.firo: @@ -372,6 +374,31 @@ class AddressUtils { } return epicAddress; } + + /// Formats an address string to remove any unnecessary prefixes or suffixes. + String formatMimblewimblecoinAddress(String mimblewimblecoinAddress) { + // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an mwcmqs address) + if ((mimblewimblecoinAddress.startsWith("http://") || + mimblewimblecoinAddress.startsWith("https://")) && + mimblewimblecoinAddress.contains("@")) { + mimblewimblecoinAddress = + mimblewimblecoinAddress.replaceAll("http://", ""); + mimblewimblecoinAddress = + mimblewimblecoinAddress.replaceAll("https://", ""); + } + // strip mailto: prefix + if (mimblewimblecoinAddress.startsWith("mailto:")) { + mimblewimblecoinAddress = + mimblewimblecoinAddress.replaceAll("mailto:", ""); + } + // strip / suffix if the address contains an @ symbol (and is thus an mwcmqs address) + if (mimblewimblecoinAddress.endsWith("/") && + mimblewimblecoinAddress.contains("@")) { + mimblewimblecoinAddress = mimblewimblecoinAddress.substring( + 0, mimblewimblecoinAddress.length - 1); + } + return mimblewimblecoinAddress; + } } class PaymentUriData { diff --git a/lib/utilities/amount/amount_unit.dart b/lib/utilities/amount/amount_unit.dart index a8cbfa701e..79e45232b3 100644 --- a/lib/utilities/amount/amount_unit.dart +++ b/lib/utilities/amount/amount_unit.dart @@ -63,6 +63,7 @@ enum AmountUnit { // case Coin.dogecoin: // case Coin.eCash: // case Coin.epicCash: + // case Coin.mimblewimblecoin: // case Coin.stellar: // TODO: check if this is correct // case Coin.stellarTestnet: // case Coin.tezos: diff --git a/lib/utilities/assets.dart b/lib/utilities/assets.dart index e0245131a9..3a1001ad8f 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -245,6 +245,7 @@ class _SVG { String get bitcoincash => "assets/svg/coin_icons/Bitcoincash.svg"; String get dogecoin => "assets/svg/coin_icons/Dogecoin.svg"; String get epicCash => "assets/svg/coin_icons/EpicCash.svg"; + String get mimblewimblecoin => "assets/svg/coin_icons/Mimblewimblecoin.svg"; String get ethereum => "assets/svg/coin_icons/Ethereum.svg"; String get firo => "assets/svg/coin_icons/Firo.svg"; String get monero => "assets/svg/coin_icons/Monero.svg"; diff --git a/lib/utilities/default_mwcmqs.dart b/lib/utilities/default_mwcmqs.dart new file mode 100644 index 0000000000..75be1d247b --- /dev/null +++ b/lib/utilities/default_mwcmqs.dart @@ -0,0 +1,53 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + +import '../models/mwcmqs_server_model.dart'; + +abstract class DefaultMwcMqs { + static const String defaultName = "Default"; + + static List get all => [americas, asia, europe]; + static List get defaultIds => ['americas', 'asia', 'europe']; + + static MwcMqsServerModel get americas => MwcMqsServerModel( + host: 'MwcMqs.stackwallet.com', + port: 443, + name: 'Americas', + id: 'americas', + useSSL: true, + enabled: true, + isFailover: true, + isDown: false, + ); + + static MwcMqsServerModel get asia => MwcMqsServerModel( + host: 'MwcMqs.hyperbig.com', + port: 443, + name: 'Asia', + id: 'asia', + useSSL: true, + enabled: true, + isFailover: true, + isDown: false, + ); + + static MwcMqsServerModel get europe => MwcMqsServerModel( + host: 'MwcMqs.fastepic.eu', + port: 443, + name: 'Europe', + id: 'europe', + useSSL: true, + enabled: true, + isFailover: true, + isDown: false, + ); + + static final defaultMwcMqsServer = americas; +} diff --git a/lib/utilities/git_status.dart b/lib/utilities/git_status.dart index 093bc39af3..17617c0fa7 100644 --- a/lib/utilities/git_status.dart +++ b/lib/utilities/git_status.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_libepiccash/git_versions.dart' as epic_versions; // import 'package:flutter_libmonero/git_versions.dart' as monero_versions; +import 'package:flutter_libmwc/git_versions.dart' as mimblewimblecoin_versions; import 'package:http/http.dart'; import 'package:lelantus/git_versions.dart' as firo_versions; @@ -21,6 +22,8 @@ abstract class GitStatus { static String get firoCommit => firo_versions.getPluginVersion(); static String get epicCashCommit => epic_versions.getPluginVersion(); // static String get moneroCommit => monero_versions.getPluginVersion(); + static String get mimblewimblecoinCommit => + mimblewimblecoin_versions.getPluginVersion(); static String get appCommitHash => AppConfig.commitHash; @@ -78,31 +81,60 @@ abstract class GitStatus { return _cachedEpicStatus!; } + + static CommitStatus? _cachedMimblewimblecoinStatus; + static Future getMimblewimblecoinCommitStatus() async { + if (_cachedMimblewimblecoinStatus != null) { + return _cachedMimblewimblecoinStatus!; + } + final List results = await Future.wait([ + _doesCommitExist("cypherstack", "flutter_libmwc", mimblewimblecoinCommit), + _isHeadCommit( + "cypherstack", + "flutter_libmwc", + "main", + mimblewimblecoinCommit, + ), + ]); + + final commitExists = results[0]; + final commitIsHead = results[1]; + + if (commitExists && commitIsHead) { + _cachedMimblewimblecoinStatus = CommitStatus.isHead; + } else if (commitExists) { + _cachedMimblewimblecoinStatus = CommitStatus.isOldCommit; + } else { + _cachedMimblewimblecoinStatus = CommitStatus.notACommit; + } + + return _cachedMimblewimblecoinStatus!; + } + + //static CommitStatus? _cachedMoneroStatus; + //static Future getMoneroCommitStatus() async { + // if (_cachedMoneroStatus != null) { + // return _cachedMoneroStatus!; + // } // - // static CommitStatus? _cachedMoneroStatus; - // static Future getMoneroCommitStatus() async { - // if (_cachedMoneroStatus != null) { - // return _cachedMoneroStatus!; - // } - // - // final List results = await Future.wait([ - // _doesCommitExist("cypherstack", "flutter_libmonero", moneroCommit), - // _isHeadCommit("cypherstack", "flutter_libmonero", "main", moneroCommit), - // ]); + // final List results = await Future.wait([ + // _doesCommitExist("cypherstack", "flutter_libmonero", moneroCommit), + // _isHeadCommit("cypherstack", "flutter_libmonero", "main", moneroCommit), + // ]); // - // final commitExists = results[0]; - // final commitIsHead = results[1]; + // final commitExists = results[0]; + // final commitIsHead = results[1]; // - // if (commitExists && commitIsHead) { - // _cachedMoneroStatus = CommitStatus.isHead; - // } else if (commitExists) { - // _cachedMoneroStatus = CommitStatus.isOldCommit; - // } else { - // _cachedMoneroStatus = CommitStatus.notACommit; - // } + // if (commitExists && commitIsHead) { + // _cachedMoneroStatus = CommitStatus.isHead; + // } else if (commitExists) { + // _cachedMoneroStatus = CommitStatus.isOldCommit; + // } else { + // _cachedMoneroStatus = CommitStatus.notACommit; + // } // - // return _cachedMoneroStatus!; - // } + // return _cachedMoneroStatus!; + //} static TextStyle styleForStatus(CommitStatus status, BuildContext context) { final Color color; diff --git a/lib/utilities/test_node_connection.dart b/lib/utilities/test_node_connection.dart index 458e04e4d9..c83bf39e19 100644 --- a/lib/utilities/test_node_connection.dart +++ b/lib/utilities/test_node_connection.dart @@ -45,7 +45,6 @@ Future _xmrHelper( final uriString = "${uri.scheme}://${uri.host}:${port ?? 0}$path"; - if (proxyInfo == null && uri.host.endsWith(".onion")) { return false; } diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart new file mode 100644 index 0000000000..b06ec1f1d4 --- /dev/null +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -0,0 +1,128 @@ +import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; + +import '../../../models/isar/models/blockchain_data/address.dart'; +import '../../../models/node_model.dart'; +import '../../../utilities/default_nodes.dart'; +import '../../../utilities/enums/derive_path_type_enum.dart'; +import '../crypto_currency.dart'; +import '../intermediate/bip39_currency.dart'; + +class Mimblewimblecoin extends Bip39Currency { + Mimblewimblecoin(super.network) { + _idMain = "mimblewimblecoin"; + _uriScheme = "mimblewimblecoin"; // ? + switch (network) { + case CryptoCurrencyNetwork.main: + _id = _idMain; + _name = "Mimblewimblecoin"; + _ticker = "MWC"; + default: + throw Exception("Unsupported network: $network"); + } + } + + late final String _id; + @override + String get identifier => _id; + + late final String _idMain; + @override + String get mainNetId => _idMain; + + late final String _name; + @override + String get prettyName => _name; + + late final String _uriScheme; + @override + String get uriScheme => _uriScheme; + + late final String _ticker; + @override + String get ticker => _ticker; + + @override + String get genesisHash { + return "not used in mimblewimblecoin"; + } + + @override + // change this to change the number of confirms a tx needs in order to show as confirmed + int get minConfirms => 3; + + @override + bool validateAddress(String address) { + // Invalid address that contains HTTP and mwcmqs domain + if ((address.startsWith("http://") || address.startsWith("https://")) && + address.contains("@")) { + return false; + } + if (address.startsWith("http://") || address.startsWith("https://")) { + if (Uri.tryParse(address) != null) { + return true; + } + } + + return mimblewimblecoin.LibMwc.validateSendAddress(address: address); + } + + @override + NodeModel get defaultNode { + switch (network) { + case CryptoCurrencyNetwork.main: + return NodeModel( + host: "http://epiccash.stackwallet.com", + port: 3413, + name: DefaultNodes.defaultName, + id: DefaultNodes.buildId(this), + useSSL: false, + enabled: true, + coinName: identifier, + isFailover: true, + isDown: false, + ); + + default: + throw UnimplementedError(); + } + } + + @override + int get defaultSeedPhraseLength => 24; + + @override + int get fractionDigits => 8; + + @override + bool get hasBuySupport => false; + + @override + bool get hasMnemonicPassphraseSupport => false; + + @override + List get possibleMnemonicLengths => [defaultSeedPhraseLength, 12]; + + @override + AddressType get defaultAddressType => AddressType.mimbleWimble; + + @override + BigInt get satsPerCoin => BigInt.from(100000000); + + @override + int get targetBlockTimeSeconds => 60; + + @override + DerivePathType get defaultDerivePathType => throw UnsupportedError( + "$runtimeType does not use bitcoin style derivation paths", + ); + + @override + Uri defaultBlockExplorer(String txid) { + switch (network) { + default: + throw Exception( + "Unsupported network for defaultBlockExplorer(): $network", + ); + } + } +} diff --git a/lib/wallets/crypto_currency/crypto_currency.dart b/lib/wallets/crypto_currency/crypto_currency.dart index 074536be65..4d2acc4015 100644 --- a/lib/wallets/crypto_currency/crypto_currency.dart +++ b/lib/wallets/crypto_currency/crypto_currency.dart @@ -11,6 +11,7 @@ export 'coins/dash.dart'; export 'coins/dogecoin.dart'; export 'coins/ecash.dart'; export 'coins/epiccash.dart'; +export 'coins/mimblewimblecoin.dart'; export 'coins/ethereum.dart'; export 'coins/firo.dart'; export 'coins/litecoin.dart'; @@ -61,7 +62,7 @@ abstract class CryptoCurrency { int get minConfirms; - // TODO: [prio=low] could be handled differently as (at least) epiccash does not use this + // TODO: [prio=low] could be handled differently as (at least) epiccash/mimblewimblecoin does not use this String get genesisHash; bool validateAddress(String address); diff --git a/lib/wallets/isar/models/wallet_info.dart b/lib/wallets/isar/models/wallet_info.dart index 3e296a3a0b..ec805e6aca 100644 --- a/lib/wallets/isar/models/wallet_info.dart +++ b/lib/wallets/isar/models/wallet_info.dart @@ -507,6 +507,7 @@ class WalletInfo implements IsarId { abstract class WalletInfoKeys { static const String tokenContractAddresses = "tokenContractAddressesKey"; static const String epiccashData = "epiccashDataKey"; + static const String mimblewimblecoinData = "mimblewimblecoinDataKey"; static const String bananoMonkeyImageBytes = "monkeyImageBytesKey"; static const String tezosDerivationPath = "tezosDerivationPathKey"; static const String lelantusCoinIsarRescanRequired = diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart new file mode 100644 index 0000000000..ed77e34bc7 --- /dev/null +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -0,0 +1,1197 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:decimal/decimal.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; +import 'package:flutter_libmwc/models/transaction.dart' + as mimblewimblecoin_models; +import 'package:isar/isar.dart'; +import 'package:mutex/mutex.dart'; +import 'package:stack_wallet_backup/generate_password.dart'; +import 'package:web_socket_channel/web_socket_channel.dart'; + +import '../../../models/balance.dart'; +import '../../../models/mwcmqs_config_model.dart'; +import '../../../models/isar/models/blockchain_data/address.dart'; +import '../../../models/isar/models/blockchain_data/transaction.dart'; +import '../../../models/isar/models/blockchain_data/v2/input_v2.dart'; +import '../../../models/isar/models/blockchain_data/v2/output_v2.dart'; +import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; +import '../../../models/node_model.dart'; +import '../../../models/paymint/fee_object_model.dart'; +import '../../../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; +import '../../../services/event_bus/events/global/blocks_remaining_event.dart'; +import '../../../services/event_bus/events/global/node_connection_status_changed_event.dart'; +import '../../../services/event_bus/events/global/refresh_percent_changed_event.dart'; +import '../../../services/event_bus/events/global/wallet_sync_status_changed_event.dart'; +import '../../../services/event_bus/global_event_bus.dart'; +import '../../../utilities/amount/amount.dart'; +import '../../../utilities/flutter_secure_storage_interface.dart'; +import '../../../utilities/logger.dart'; +import '../../../utilities/stack_file_system.dart'; +//import '../../../utilities/test_epic_box_connection.dart'; +import '../../crypto_currency/crypto_currency.dart'; +import '../../models/tx_data.dart'; +import '../intermediate/bip39_wallet.dart'; +import '../supporting/mimblewimblecoin_wallet_info_extension.dart'; + +// +// refactor of https://github.com/cypherstack/stack_wallet/blob/1d9fb4cd069f22492ece690ac788e05b8f8b1209/lib/services/coins/epiccash/epiccash_wallet.dart +// +class MimblewimblecoinWallet extends Bip39Wallet { + MimblewimblecoinWallet(CryptoCurrencyNetwork network) + : super(Mimblewimblecoin(network)); + + final syncMutex = Mutex(); + NodeModel? _mimblewimblecoinNode; + Timer? timer; + + double highestPercent = 0; + Future get getSyncPercent async { + final int lastScannedBlock = + info.mimblewimblecoinData?.lastScannedBlock ?? 0; + final _chainHeight = await chainHeight; + final double restorePercent = lastScannedBlock / _chainHeight; + GlobalEventBus.instance + .fire(RefreshPercentChangedEvent(highestPercent, walletId)); + if (restorePercent > highestPercent) { + highestPercent = restorePercent; + } + + final int blocksRemaining = _chainHeight - lastScannedBlock; + GlobalEventBus.instance + .fire(BlocksRemainingEvent(blocksRemaining, walletId)); + + return restorePercent < 0 ? 0.0 : restorePercent; + } + + /*Future updateEpicboxConfig(String host, int port) async { + final String stringConfig = jsonEncode({ + "epicbox_domain": host, + "epicbox_port": port, + "epicbox_protocol_unsecure": false, + "epicbox_address_index": 0, + }); + await secureStorageInterface.write( + key: '${walletId}_epicboxConfig', + value: stringConfig, + ); + // TODO: refresh anything that needs to be refreshed/updated due to epicbox info changed + } + */ + /// returns an empty String on success, error message on failure + Future cancelPendingTransactionAndPost(String txSlateId) async { + try { + final String wallet = (await secureStorageInterface.read( + key: '${walletId}_wallet', + ))!; + + final result = await mimblewimblecoin.LibMwc.cancelTransaction( + wallet: wallet, + transactionId: txSlateId, + ); + Logging.instance.log( + "cancel $txSlateId result: $result", + level: LogLevel.Info, + ); + return result; + } catch (e, s) { + Logging.instance.log("$e, $s", level: LogLevel.Error); + return e.toString(); + } + } + + Future getMwcMqsConfig() async { + final MwcMqsConfigModel _mwcMqsConfig = MwcMqsConfigModel.fromServer( + DefaultMwcMqs.defaultMwcMqsServer, + ); + + //Get the default Epicbox server and check if it's conected + // bool isEpicboxConnected = await _testEpicboxServer( + // DefaultEpicBoxes.defaultEpicBoxServer.host, DefaultEpicBoxes.defaultEpicBoxServer.port ?? 443); + + // if (isEpicboxConnected) { + //Use default server for as Epicbox config + + // } + // else { + // //Use Europe config + // _epicBoxConfig = EpicBoxConfigModel.fromServer(DefaultEpicBoxes.europe); + // } + // // example of selecting another random server from the default list + // // alternative servers: copy list of all default EB servers but remove the default default + // // List alternativeServers = DefaultEpicBoxes.all; + // // alternativeServers.removeWhere((opt) => opt.name == DefaultEpicBoxes.defaultEpicBoxServer.name); + // // alternativeServers.shuffle(); // randomize which server is used + // // _epicBoxConfig = EpicBoxConfigModel.fromServer(alternativeServers.first); + // + // // TODO test this connection before returning it + // } + + return _mwcMqsConfig; + } + + // ================= Private ================================================= + + Future _getConfig() async { + if (_mimblewimblecoinNode == null) { + await updateNode(); + } + final NodeModel node = _mimblewimblecoinNode!; + final String nodeAddress = node.host; + final int port = node.port; + + final uri = Uri.parse(nodeAddress).replace(port: port); + + final String nodeApiAddress = uri.toString(); + + final walletDir = await _currentWalletDirPath(); + + final Map config = {}; + config["wallet_dir"] = walletDir; + config["check_node_api_http_addr"] = nodeApiAddress; + config["chain"] = "mainnet"; + config["account"] = "default"; + config["api_listen_port"] = port; + config["api_listen_interface"] = + nodeApiAddress.replaceFirst(uri.scheme, ""); + final String stringConfig = jsonEncode(config); + return stringConfig; + } + + Future _currentWalletDirPath() async { + final Directory appDir = await StackFileSystem.applicationRootDirectory(); + + final path = "${appDir.path}/mimblewimblecoin"; + final String name = walletId.trim(); + return '$path/$name'; + } + + Future _nativeFee( + int satoshiAmount, { + bool ifErrorEstimateFee = false, + }) async { + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + try { + final available = info.cachedBalance.spendable.raw.toInt(); + + final transactionFees = await mimblewimblecoin.LibMwc.getTransactionFees( + wallet: wallet!, + amount: satoshiAmount, + minimumConfirmations: cryptoCurrency.minConfirms, + available: available, + ); + + int realFee = 0; + try { + realFee = + (Decimal.parse(transactionFees.fee.toString())).toBigInt().toInt(); + } catch (e, s) { + //todo: come back to this + debugPrint("$e $s"); + } + return realFee; + } catch (e, s) { + Logging.instance.log("Error getting fees $e - $s", level: LogLevel.Error); + rethrow; + } + } + + Future _startSync() async { + Logging.instance.log("request start sync", level: LogLevel.Info); + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + const int refreshFromNode = 1; + if (!syncMutex.isLocked) { + await syncMutex.protect(() async { + // How does getWalletBalances start syncing???? + await mimblewimblecoin.LibMwc.getWalletBalances( + wallet: wallet!, + refreshFromNode: refreshFromNode, + minimumConfirmations: 10, + ); + }); + } else { + Logging.instance.log("request start sync denied", level: LogLevel.Info); + } + } + + Future< + ({ + double awaitingFinalization, + double pending, + double spendable, + double total + })> _allWalletBalances() async { + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + const refreshFromNode = 0; + return await mimblewimblecoin.LibMwc.getWalletBalances( + wallet: wallet!, + refreshFromNode: refreshFromNode, + minimumConfirmations: cryptoCurrency.minConfirms, + ); + } + + /*Future _testEpicboxServer(EpicBoxConfigModel epicboxConfig) async { + final host = epicboxConfig.host; + final port = epicboxConfig.port ?? 443; + WebSocketChannel? channel; + try { + final uri = Uri.parse('wss://$host:$port'); + + channel = WebSocketChannel.connect( + uri, + ); + + await channel.ready; + + final response = await channel.stream.first.timeout( + const Duration(seconds: 2), + ); + + return response is String && response.contains("Challenge"); + } catch (_) { + Logging.instance.log( + "_testEpicBoxConnection failed on \"$host:$port\"", + level: LogLevel.Info, + ); + return false; + } finally { + await channel?.sink.close(); + } + }*/ + + Future _putSendToAddresses( + ({String slateId, String commitId}) slateData, + Map txAddressInfo, + ) async { + try { + final slatesToCommits = info.mimblewimblecoinData?.slatesToCommits ?? {}; + final from = txAddressInfo['from']; + final to = txAddressInfo['to']; + slatesToCommits[slateData.slateId] = { + "commitId": slateData.commitId, + "from": from, + "to": to, + }; + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: info.mimblewimblecoinData!.copyWith( + slatesToCommits: slatesToCommits, + ), + isar: mainDB.isar, + ); + return true; + } catch (e, s) { + Logging.instance + .log("ERROR STORING ADDRESS $e $s", level: LogLevel.Error); + return false; + } + } + + Future _getCurrentIndex() async { + try { + final int receivingIndex = info.mimblewimblecoinData!.receivingIndex; + // TODO: go through pendingarray and processed array and choose the index + // of the last one that has not been processed, or the index after the one most recently processed; + return receivingIndex; + } catch (e, s) { + Logging.instance.log("$e $s", level: LogLevel.Error); + return 0; + } + } + + Future
_generateAndStoreReceivingAddressForIndex( + int index, + ) async { + Address? address = await getCurrentReceivingAddress(); + + if (address != null) { + final splitted = address.value.split('@'); + //Check if the address is the same as the current epicbox domain + //Since we're only using one epicbpox now this doesn't apply but will be + // useful in the future + final mwcmqsConfig = await getMwcMqsConfig(); + if (splitted[1] != mwcmqsConfig.host) { + //Update the address + address = await thisWalletAddress(index, mwcmqsConfig); + } + } else { + final mwcmqsConfig = await getMwcMqsConfig(); + address = await thisWalletAddress(index, mwcmqsConfig); + } + + if (info.cachedReceivingAddress != address.value) { + await info.updateReceivingAddress( + newAddress: address.value, + isar: mainDB.isar, + ); + } + return address; + } + + Future
thisWalletAddress( + int index, + MwcMqsConfigModel mwcmqsConfig, + ) async { + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + + final walletAddress = await mimblewimblecoin.LibMwc.getAddressInfo( + wallet: wallet!, + index: index, + mwcmqsConfig: mwcmqsConfig.toString(), + ); + + Logging.instance.log( + "WALLET_ADDRESS_IS $walletAddress", + level: LogLevel.Info, + ); + + final address = Address( + walletId: walletId, + value: walletAddress, + derivationIndex: index, + derivationPath: null, + type: AddressType.mimbleWimble, + subType: AddressSubType.receiving, + publicKey: [], // ?? + ); + await mainDB.updateOrPutAddresses([address]); + return address; + } + + Future _startScans() async { + try { + //First stop the current listener + mimblewimblecoin.LibMwc.stopMwcmqsListener(); + final wallet = + await secureStorageInterface.read(key: '${walletId}_wallet'); + + // max number of blocks to scan per loop iteration + const scanChunkSize = 10000; + + // force firing of scan progress event + await getSyncPercent; + + // fetch current chain height and last scanned block (should be the + // restore height if full rescan or a wallet restore) + int chainHeight = await this.chainHeight; + int lastScannedBlock = info.mimblewimblecoinData!.lastScannedBlock; + + // loop while scanning in chain in chunks (of blocks?) + while (lastScannedBlock < chainHeight) { + Logging.instance.log( + "chainHeight: $chainHeight, lastScannedBlock: $lastScannedBlock", + level: LogLevel.Info, + ); + + final int nextScannedBlock = await mimblewimblecoin.LibMwc.scanOutputs( + wallet: wallet!, + startHeight: lastScannedBlock, + numberOfBlocks: scanChunkSize, + ); + + // update local cache + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: info.mimblewimblecoinData!.copyWith( + lastScannedBlock: nextScannedBlock, + ), + isar: mainDB.isar, + ); + + // force firing of scan progress event + await getSyncPercent; + + // update while loop condition variables + chainHeight = await this.chainHeight; + lastScannedBlock = nextScannedBlock; + } + + Logging.instance.log( + "_startScans successfully at the tip", + level: LogLevel.Info, + ); + //Once scanner completes restart listener + await _listenToMwcmqs(); + } catch (e, s) { + Logging.instance.log( + "_startScans failed: $e\n$s", + level: LogLevel.Error, + ); + rethrow; + } + } + + Future _listenToMwcmqs() async { + Logging.instance.log("STARTING WALLET LISTENER ....", level: LogLevel.Info); + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); + mimblewimblecoin.LibMwc.startMwcMqsListener( + wallet: wallet!, + mwcmqsConfig: mwcmqsConfig.toString(), + ); + } + + // As opposed to fake config? + Future _getRealConfig() async { + String? config = await secureStorageInterface.read( + key: '${walletId}_config', + ); + if (Platform.isIOS) { + final walletDir = await _currentWalletDirPath(); + final editConfig = jsonDecode(config as String); + + editConfig["wallet_dir"] = walletDir; + config = jsonEncode(editConfig); + } + return config!; + } + + // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index + int _calculateRestoreHeightFrom({required DateTime date}) { + final int secondsSinceEpoch = date.millisecondsSinceEpoch ~/ 1000; + const int mimblewimblecoinFirstBlock = 1565370278; + const double overestimateSecondsPerBlock = 61; + final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; + final int approximateHeight = chosenSeconds ~/ overestimateSecondsPerBlock; + int height = approximateHeight; + if (height < 0) { + height = 0; + } + return height; + } + + // ============== Overrides ================================================== + + @override + int get isarTransactionVersion => 2; + + @override + FilterOperation? get changeAddressFilterOperation => + FilterGroup.and(standardChangeAddressFilters); + + @override + FilterOperation? get receivingAddressFilterOperation => + FilterGroup.and(standardReceivingAddressFilters); + + @override + Future checkSaveInitialReceivingAddress() async { + // epiccash seems ok with nothing here? + } + + @override + Future init({bool? isRestore}) async { + if (isRestore != true) { + String? encodedWallet = + await secureStorageInterface.read(key: "${walletId}_wallet"); + + // check if should create a new wallet + if (encodedWallet == null) { + await updateNode(); + final mnemonicString = await getMnemonic(); + + final String password = generatePassword(); + final String stringConfig = await _getConfig(); + final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); + + await secureStorageInterface.write( + key: '${walletId}_config', + value: stringConfig, + ); + await secureStorageInterface.write( + key: '${walletId}_password', + value: password, + ); + await secureStorageInterface.write( + key: '${walletId}_mwcmqsConfig', + value: mwcmqsConfig.toString(), + ); + + final String name = walletId; + + await mimblewimblecoin.LibMwc.initializeNewWallet( + config: stringConfig, + mnemonic: mnemonicString, + password: password, + name: name, + ); + + //Open wallet + encodedWallet = await mimblewimblecoin.LibMwc.openWallet( + config: stringConfig, + password: password, + ); + await secureStorageInterface.write( + key: '${walletId}_wallet', + value: encodedWallet, + ); + + //Store MwcMqs address info + await _generateAndStoreReceivingAddressForIndex(0); + + // subtract a couple days to ensure we have a buffer for SWB + final bufferedCreateHeight = _calculateRestoreHeightFrom( + date: DateTime.now().subtract(const Duration(days: 2)), + ); + + final mimblewimblecoinData = ExtraMimblewimblecoinWalletInfo( + receivingIndex: 0, + changeIndex: 0, + slatesToAddresses: {}, + slatesToCommits: {}, + lastScannedBlock: bufferedCreateHeight, + restoreHeight: bufferedCreateHeight, + creationHeight: bufferedCreateHeight, + ); + + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: mimblewimblecoinData, + isar: mainDB.isar, + ); + } else { + try { + Logging.instance.log( + "initializeExisting() ${cryptoCurrency.prettyName} wallet", + level: LogLevel.Info, + ); + + final config = await _getRealConfig(); + final password = + await secureStorageInterface.read(key: '${walletId}_password'); + + final walletOpen = await mimblewimblecoin.LibMwc.openWallet( + config: config, + password: password!, + ); + await secureStorageInterface.write( + key: '${walletId}_wallet', + value: walletOpen, + ); + + await updateNode(); + } catch (e, s) { + // do nothing, still allow user into wallet + Logging.instance.log( + "$runtimeType init() failed: $e\n$s", + level: LogLevel.Error, + ); + } + } + } + + return await super.init(); + } + + @override + Future confirmSend({required TxData txData}) async { + try { + final wallet = + await secureStorageInterface.read(key: '${walletId}_wallet'); + final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); + + // TODO determine whether it is worth sending change to a change address. + + final String receiverAddress = txData.recipients!.first.address; + + if (!receiverAddress.startsWith("http://") || + !receiverAddress.startsWith("https://")) { + final bool isMwcmqsConnected = await _testMwcmqsServer( + mwcmqsConfig, + ); + if (!isMwcmqsConnected) { + throw Exception( + "Failed to send TX : Unable to reach mimblewimblecoin server"); + } + } + + ({String commitId, String slateId}) transaction; + + if (receiverAddress.startsWith("http://") || + receiverAddress.startsWith("https://")) { + transaction = await mimblewimblecoin.LibMwc.txHttpSend( + wallet: wallet!, + selectionStrategyIsAll: 0, + minimumConfirmations: cryptoCurrency.minConfirms, + message: txData.noteOnChain ?? "", + amount: txData.recipients!.first.amount.raw.toInt(), + address: txData.recipients!.first.address, + ); + } else { + transaction = await mimblewimblecoin.LibMwc.createTransaction( + wallet: wallet!, + amount: txData.recipients!.first.amount.raw.toInt(), + address: txData.recipients!.first.address, + secretKeyIndex: 0, + mwcmqsConfig: mwsmqsConfig.toString(), + minimumConfirmations: cryptoCurrency.minConfirms, + note: txData.noteOnChain!, + ); + } + + final Map txAddressInfo = {}; + txAddressInfo['from'] = (await getCurrentReceivingAddress())!.value; + txAddressInfo['to'] = txData.recipients!.first.address; + await _putSendToAddresses(transaction, txAddressInfo); + + return txData.copyWith( + txid: transaction.slateId, + ); + } catch (e, s) { + Logging.instance.log( + "Mimblewimblecoin confirmSend: $e\n$s", + level: LogLevel.Error, + ); + rethrow; + } + } + + @override + Future prepareSend({required TxData txData}) async { + try { + if (txData.recipients?.length != 1) { + throw Exception( + "Mimblewimblecoin prepare send requires a single recipient!"); + } + + ({String address, Amount amount, bool isChange}) recipient = + txData.recipients!.first; + + final int realFee = await _nativeFee(recipient.amount.raw.toInt()); + final feeAmount = Amount( + rawValue: BigInt.from(realFee), + fractionDigits: cryptoCurrency.fractionDigits, + ); + + if (feeAmount > info.cachedBalance.spendable) { + throw Exception( + "Mimblewimblecoin prepare send fee is greater than available balance!", + ); + } + + if (info.cachedBalance.spendable == recipient.amount) { + recipient = ( + address: recipient.address, + amount: recipient.amount - feeAmount, + isChange: recipient.isChange, + ); + } + + return txData.copyWith( + recipients: [recipient], + fee: feeAmount, + ); + } catch (e, s) { + Logging.instance + .log("Mimblewimblecoin prepareSend: $e\n$s", level: LogLevel.Error); + rethrow; + } + } + + @override + Future recover({required bool isRescan}) async { + try { + await refreshMutex.protect(() async { + if (isRescan) { + // clear blockchain info + await mainDB.deleteWalletBlockchainData(walletId); + + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: info.mimblewimblecoinData!.copyWith( + lastScannedBlock: info.mimblewimblecoinData!.restoreHeight, + ), + isar: mainDB.isar, + ); + + unawaited(_startScans()); + } else { + await updateNode(); + final String password = generatePassword(); + + final String stringConfig = await _getConfig(); + final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); + + await secureStorageInterface.write( + key: '${walletId}_config', + value: stringConfig, + ); + await secureStorageInterface.write( + key: '${walletId}_password', + value: password, + ); + + await secureStorageInterface.write( + key: '${walletId}_mwcmqsConfig', + value: mwcmqsConfig.toString(), + ); + + await mimblewimblecoin.LibMwc.recoverWallet( + config: stringConfig, + password: password, + mnemonic: await getMnemonic(), + name: info.walletId, + ); + + final mimblewimblecoinData = ExtraMimblewimblecoinWalletInfo( + receivingIndex: 0, + changeIndex: 0, + slatesToAddresses: {}, + slatesToCommits: {}, + lastScannedBlock: info.restoreHeight, + restoreHeight: info.restoreHeight, + creationHeight: + info.mimblewimblecoinData?.creationHeight ?? info.restoreHeight, + ); + + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: mimblewimblecoinData, + isar: mainDB.isar, + ); + + //Open Wallet + final walletOpen = await mimblewimblecoin.LibMwc.openWallet( + config: stringConfig, + password: password, + ); + await secureStorageInterface.write( + key: '${walletId}_wallet', + value: walletOpen, + ); + + await _generateAndStoreReceivingAddressForIndex( + mimblewimblecoinData.receivingIndex, + ); + } + }); + + unawaited(refresh()); + } catch (e, s) { + Logging.instance.log( + "Exception rethrown from electrumx_mixin recover(): $e\n$s", + level: LogLevel.Info, + ); + + rethrow; + } + } + + @override + Future refresh() async { + // Awaiting this lock could be dangerous. + // Since refresh is periodic (generally) + if (refreshMutex.isLocked) { + return; + } + + try { + // this acquire should be almost instant due to above check. + // Slight possibility of race but should be irrelevant + await refreshMutex.acquire(); + + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.syncing, + walletId, + cryptoCurrency, + ), + ); + + // if (info.epicData?.creationHeight == null) { + // await info.updateExtraEpiccashWalletInfo(epicData: inf, isar: isar) + // await epicUpdateCreationHeight(await chainHeight); + // } + + // this will always be zero???? + final int curAdd = await _getCurrentIndex(); + await _generateAndStoreReceivingAddressForIndex(curAdd); + + await _startScans(); + + unawaited(_startSync()); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.0, walletId)); + await updateChainHeight(); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.1, walletId)); + + // if (this is MultiAddressInterface) { + // await (this as MultiAddressInterface) + // .checkReceivingAddressForTransactions(); + // } + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.2, walletId)); + + // // TODO: [prio=low] handle this differently. Extra modification of this file for coin specific functionality should be avoided. + // if (this is MultiAddressInterface) { + // await (this as MultiAddressInterface) + // .checkChangeAddressForTransactions(); + // } + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.3, walletId)); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.50, walletId)); + final fetchFuture = updateTransactions(); + // if (currentHeight != storedHeight) { + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.60, walletId)); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.70, walletId)); + + await fetchFuture; + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.80, walletId)); + + // await getAllTxsToWatch(); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.90, walletId)); + + await updateBalance(); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(1.0, walletId)); + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.synced, + walletId, + cryptoCurrency, + ), + ); + + if (shouldAutoSync) { + timer ??= Timer.periodic(const Duration(seconds: 150), (timer) async { + // chain height check currently broken + // if ((await chainHeight) != (await storedChainHeight)) { + + // TODO: [prio=med] some kind of quick check if wallet needs to refresh to replace the old refreshIfThereIsNewData call + // if (await refreshIfThereIsNewData()) { + unawaited(refresh()); + + // } + // } + }); + } + } catch (error, strace) { + GlobalEventBus.instance.fire( + NodeConnectionStatusChangedEvent( + NodeConnectionStatus.disconnected, + walletId, + cryptoCurrency, + ), + ); + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.unableToSync, + walletId, + cryptoCurrency, + ), + ); + Logging.instance.log( + "Caught exception in refreshWalletData(): $error\n$strace", + level: LogLevel.Error, + ); + } finally { + refreshMutex.release(); + } + } + + @override + Future updateBalance() async { + try { + final balances = await _allWalletBalances(); + final balance = Balance( + total: Amount.fromDecimal( + Decimal.parse(balances.total.toString()) + + Decimal.parse(balances.awaitingFinalization.toString()), + fractionDigits: cryptoCurrency.fractionDigits, + ), + spendable: Amount.fromDecimal( + Decimal.parse(balances.spendable.toString()), + fractionDigits: cryptoCurrency.fractionDigits, + ), + blockedTotal: Amount.zeroWith( + fractionDigits: cryptoCurrency.fractionDigits, + ), + pendingSpendable: Amount.fromDecimal( + Decimal.parse(balances.pending.toString()), + fractionDigits: cryptoCurrency.fractionDigits, + ), + ); + + await info.updateBalance( + newBalance: balance, + isar: mainDB.isar, + ); + } catch (e, s) { + Logging.instance.log( + "Mimblewimblecoin wallet failed to update balance: $e\n$s", + level: LogLevel.Warning, + ); + } + } + + @override + Future updateTransactions() async { + try { + final wallet = + await secureStorageInterface.read(key: '${walletId}_wallet'); + const refreshFromNode = 1; + + final myAddresses = await mainDB + .getAddresses(walletId) + .filter() + .typeEqualTo(AddressType.mimbleWimble) + .and() + .subTypeEqualTo(AddressSubType.receiving) + .and() + .valueIsNotEmpty() + .valueProperty() + .findAll(); + final myAddressesSet = myAddresses.toSet(); + + final transactions = await mimblewimblecoin.LibMwc.getTransactions( + wallet: wallet!, + refreshFromNode: refreshFromNode, + ); + + final List txns = []; + + final slatesToCommits = info.mimblewimblecoinData?.slatesToCommits ?? {}; + + for (final tx in transactions) { + Logging.instance.log("tx: $tx", level: LogLevel.Info); + + final isIncoming = + tx.txType == mimblewimblecoin_models.TransactionType.TxReceived || + tx.txType == + mimblewimblecoin_models.TransactionType.TxReceivedCancelled; + final slateId = tx.txSlateId; + final commitId = slatesToCommits[slateId]?['commitId'] as String?; + final numberOfMessages = tx.messages?.messages.length; + final onChainNote = tx.messages?.messages[0].message; + final addressFrom = slatesToCommits[slateId]?["from"] as String?; + final addressTo = slatesToCommits[slateId]?["to"] as String?; + + final credit = int.parse(tx.amountCredited); + final debit = int.parse(tx.amountDebited); + final fee = int.tryParse(tx.fee ?? "0") ?? 0; + + // hack Mimblewimblecoin tx data into inputs and outputs + final List outputs = []; + final List inputs = []; + final addressFromIsMine = myAddressesSet.contains(addressFrom); + final addressToIsMine = myAddressesSet.contains(addressTo); + + OutputV2 output = OutputV2.isarCantDoRequiredInDefaultConstructor( + scriptPubKeyHex: "00", + valueStringSats: credit.toString(), + addresses: [ + if (addressFrom != null) addressFrom, + ], + walletOwns: true, + ); + final InputV2 input = InputV2.isarCantDoRequiredInDefaultConstructor( + scriptSigHex: null, + scriptSigAsm: null, + sequence: null, + outpoint: null, + addresses: [if (addressTo != null) addressTo], + valueStringSats: debit.toString(), + witness: null, + innerRedeemScriptAsm: null, + coinbase: null, + walletOwns: true, + ); + + final TransactionType txType; + if (isIncoming) { + if (addressToIsMine && addressFromIsMine) { + txType = TransactionType.sentToSelf; + } else { + txType = TransactionType.incoming; + } + output = output.copyWith( + addresses: [ + myAddressesSet + .first, // Must be changed if we ever do more than a single wallet address!!! + ], + walletOwns: true, + ); + } else { + txType = TransactionType.outgoing; + } + + outputs.add(output); + inputs.add(input); + + final otherData = { + "isMimblewimblecoinTransaction": true, + "numberOfMessages": numberOfMessages, + "slateId": slateId, + "onChainNote": onChainNote, + "isCancelled": tx.txType == + mimblewimblecoin_models.TransactionType.TxSentCancelled || + tx.txType == + mimblewimblecoin_models.TransactionType.TxReceivedCancelled, + "overrideFee": Amount( + rawValue: BigInt.from(fee), + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), + }; + + final txn = TransactionV2( + walletId: walletId, + blockHash: null, + hash: commitId ?? tx.id.toString(), + txid: commitId ?? tx.id.toString(), + timestamp: + DateTime.parse(tx.creationTs).millisecondsSinceEpoch ~/ 1000, + height: tx.confirmed ? tx.kernelLookupMinHeight ?? 1 : null, + inputs: List.unmodifiable(inputs), + outputs: List.unmodifiable(outputs), + version: 0, + type: txType, + subType: TransactionSubType.none, + otherData: jsonEncode(otherData), + ); + + txns.add(txn); + } + + await mainDB.isar.writeTxn(() async { + await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .deleteAll(); + await mainDB.isar.transactionV2s.putAll(txns); + }); + } catch (e, s) { + Logging.instance.log( + "${cryptoCurrency.runtimeType} ${cryptoCurrency.network} net wallet" + " \"${info.name}\"_${info.walletId} updateTransactions() failed: $e\n$s", + level: LogLevel.Warning, + ); + } + } + + @override + Future updateUTXOs() async { + // not used for mimblewimblecoin + return false; + } + + @override + Future updateNode() async { + _mimblewimblecoinNode = getCurrentNode(); + + // TODO: [prio=low] move this out of secure storage if secure storage not needed + final String stringConfig = await _getConfig(); + await secureStorageInterface.write( + key: '${walletId}_config', + value: stringConfig, + ); + + // unawaited(refresh()); + } + + @override + Future pingCheck() async { + try { + final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); + + // force unwrap optional as we want connection test to fail if wallet + // wasn't initialized or mwcmqs node was set to null + return await testMimblewimblecoinNodeConnection( + NodeFormData() + ..host = node!.host + ..useSSL = node.useSSL + ..port = node.port, + ) != + null; + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Info); + return false; + } + } + + @override + Future updateChainHeight() async { + final config = await _getRealConfig(); + final latestHeight = + await mimblewimblecoin.LibMwc.getChainHeight(config: config); + await info.updateCachedChainHeight( + newHeight: latestHeight, + isar: mainDB.isar, + ); + } + + @override + Future estimateFeeFor(Amount amount, int feeRate) async { + // setting ifErrorEstimateFee doesn't do anything as its not used in the nativeFee function????? + final int currentFee = await _nativeFee( + amount.raw.toInt(), + ifErrorEstimateFee: true, + ); + return Amount( + rawValue: BigInt.from(currentFee), + fractionDigits: cryptoCurrency.fractionDigits, + ); + } + + @override + Future get fees async { + // this wasn't done before the refactor either so... + // TODO: implement _getFees + return FeeObject( + numberOfBlocksFast: 10, + numberOfBlocksAverage: 10, + numberOfBlocksSlow: 10, + fast: 1, + medium: 1, + slow: 1, + ); + } + + @override + Future updateSentCachedTxData({required TxData txData}) async { + // TODO: [prio=low] Was not used before refactor so maybe not required(?) + return txData; + } + + @override + Future exit() async { + timer?.cancel(); + timer = null; + await super.exit(); + Logging.instance + .log("Mimblewimblecoin_wallet exit finished", level: LogLevel.Info); + } +} + +Future deleteMimblewimblecoinWallet({ + required String walletId, + required SecureStorageInterface secureStore, +}) async { + final wallet = await secureStore.read(key: '${walletId}_wallet'); + String? config = await secureStore.read(key: '${walletId}_config'); + if (Platform.isIOS) { + final Directory appDir = await StackFileSystem.applicationRootDirectory(); + + final path = "${appDir.path}/mimblewimblecoin"; + final String name = walletId.trim(); + final walletDir = '$path/$name'; + + final editConfig = jsonDecode(config as String); + + editConfig["wallet_dir"] = walletDir; + config = jsonEncode(editConfig); + } + + if (wallet == null) { + return "Tried to delete non existent mimblewimblecoin wallet file with walletId=$walletId"; + } else { + try { + return mimblewimblecoin.LibMwc.deleteWallet( + wallet: wallet, + config: config!, + ); + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Error); + return "deleteMimblewimblecoinWallet($walletId) failed..."; + } + } +} diff --git a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart new file mode 100644 index 0000000000..724657079e --- /dev/null +++ b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart @@ -0,0 +1,111 @@ +import 'dart:convert'; + +import 'package:isar/isar.dart'; +import '../../../utilities/logger.dart'; +import '../../isar/models/wallet_info.dart'; + +extension MimblewimblecoinWalletInfoExtension on WalletInfo { + ExtraMimblewimblecoinWalletInfo? get epicData { + final String? data = + otherData[WalletInfoKeys.mimblewimblecoinData] as String?; + if (data == null) { + return null; + } + try { + return ExtraMimblewimblecoinWalletInfo.fromMap( + Map.from( + jsonDecode(data) as Map, + ), + ); + } catch (e, s) { + Logging.instance.log( + "ExtraMimblewimblecoinWalletInfo.fromMap failed: $e\n$s", + level: LogLevel.Error, + ); + return null; + } + } + + Future updateExtraMimblewimblecoinWalletInfo({ + required ExtraMimblewimblecoinWalletInfo epicData, + required Isar isar, + }) async { + await updateOtherData( + newEntries: { + WalletInfoKeys.mimblewimblecoinData: jsonEncode(epicData.toMap()), + }, + isar: isar, + ); + } +} + +/// Holds data previously stored in hive +class ExtraMimblewimblecoinWalletInfo { + final int receivingIndex; + final int changeIndex; + + // TODO [prio=low] strongly type these maps at some point + final Map slatesToAddresses; + final Map slatesToCommits; + + final int lastScannedBlock; + final int restoreHeight; + final int creationHeight; + + ExtraMimblewimblecoinWalletInfo({ + required this.receivingIndex, + required this.changeIndex, + required this.slatesToAddresses, + required this.slatesToCommits, + required this.lastScannedBlock, + required this.restoreHeight, + required this.creationHeight, + }); + + // Convert the object to JSON + Map toMap() { + return { + 'receivingIndex': receivingIndex, + 'changeIndex': changeIndex, + 'slatesToAddresses': slatesToAddresses, + 'slatesToCommits': slatesToCommits, + 'lastScannedBlock': lastScannedBlock, + 'restoreHeight': restoreHeight, + 'creationHeight': creationHeight, + }; + } + + ExtraMimblewimblecoinWalletInfo.fromMap(Map json) + : receivingIndex = json['receivingIndex'] as int, + changeIndex = json['changeIndex'] as int, + slatesToAddresses = json['slatesToAddresses'] as Map, + slatesToCommits = json['slatesToCommits'] as Map, + lastScannedBlock = json['lastScannedBlock'] as int, + restoreHeight = json['restoreHeight'] as int, + creationHeight = json['creationHeight'] as int; + + ExtraMimblewimblecoinWalletInfo copyWith({ + int? receivingIndex, + int? changeIndex, + Map? slatesToAddresses, + Map? slatesToCommits, + int? lastScannedBlock, + int? restoreHeight, + int? creationHeight, + }) { + return ExtraMimblewimblecoinWalletInfo( + receivingIndex: receivingIndex ?? this.receivingIndex, + changeIndex: changeIndex ?? this.changeIndex, + slatesToAddresses: slatesToAddresses ?? this.slatesToAddresses, + slatesToCommits: slatesToCommits ?? this.slatesToCommits, + lastScannedBlock: lastScannedBlock ?? this.lastScannedBlock, + restoreHeight: restoreHeight ?? this.restoreHeight, + creationHeight: creationHeight ?? this.creationHeight, + ); + } + + @override + String toString() { + return toMap().toString(); + } +} diff --git a/lib/wallets/wallet/wallet.dart b/lib/wallets/wallet/wallet.dart index 4f69b6056d..1372d0f3c0 100644 --- a/lib/wallets/wallet/wallet.dart +++ b/lib/wallets/wallet/wallet.dart @@ -33,6 +33,7 @@ import 'impl/dash_wallet.dart'; import 'impl/dogecoin_wallet.dart'; import 'impl/ecash_wallet.dart'; import 'impl/epiccash_wallet.dart'; +import 'impl/mimblewimblecoin_wallet.dart'; import 'impl/ethereum_wallet.dart'; import 'impl/firo_wallet.dart'; import 'impl/litecoin_wallet.dart'; @@ -358,6 +359,9 @@ abstract class Wallet { case const (Epiccash): return EpiccashWallet(net); + case const (Mimblewimblecoin): + return Mimblewimblecoin(net); + case const (Ethereum): return EthereumWallet(net); diff --git a/lib/widgets/onetime_popups/tor_has_been_add_dialog.dart b/lib/widgets/onetime_popups/tor_has_been_add_dialog.dart index 9709c46b3d..05dd4311da 100644 --- a/lib/widgets/onetime_popups/tor_has_been_add_dialog.dart +++ b/lib/widgets/onetime_popups/tor_has_been_add_dialog.dart @@ -153,7 +153,7 @@ class _TorHasBeenAddedDialogState extends State<_TorHasBeenAddedDialog> { height: Util.isDesktop ? 24 : 16, ), Text( - "Note: Tor does NOT yet work for Monero or Epic Cash wallets. " + "Note: Tor does NOT yet work for Monero, Mimblewimblecoin or Epic Cash wallets. " "Opening one of these will leak your IP address.", style: Util.isDesktop ? STextStyles.desktopTextMedium(context) diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index cab5043d66..f842858e9f 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -27,6 +27,7 @@ import '../utilities/constants.dart'; import '../utilities/format.dart'; import '../utilities/text_styles.dart'; import '../utilities/util.dart'; +import '../wallets/crypto_currency/coins/mimblewimblecoin.dart'; import '../wallets/crypto_currency/crypto_currency.dart'; import 'desktop/desktop_dialog.dart'; @@ -63,6 +64,10 @@ class _TransactionCardState extends ConsumerState { return "Restored Funds"; } + if (coin is Mimblewimblecoin && _transaction.slateId == null) { + return "Restored Funds"; + } + final confirmedStatus = _transaction.isConfirmed( currentHeight, minConfirms, @@ -188,6 +193,20 @@ class _TransactionCardState extends ConsumerState { ); return; } + + if (coin is Mimblewimblecoin && _transaction.slateId == null) { + unawaited( + showFloatingFlushBar( + context: context, + message: + "Restored Mimblewimblecoin funds from your Seed have no Data.", + type: FlushBarType.warning, + duration: const Duration(seconds: 5), + ), + ); + return; + } + if (Util.isDesktop) { await showDialog( context: context, diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 88c196c5ed..8faaf8a515 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -30,6 +30,9 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) flutter_libepiccash_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLibepiccashPlugin"); flutter_libepiccash_plugin_register_with_registrar(flutter_libepiccash_registrar); + g_autoptr(FlPluginRegistrar) flutter_libmwc_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLibmwcPlugin"); + flutter_libmwc_plugin_register_with_registrar(flutter_libmwc_registrar); g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 72a81025cb..52a5ce0a5c 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST desktop_drop devicelocale flutter_libepiccash + flutter_libmwc flutter_secure_storage_linux isar_flutter_libs sqlite3_flutter_libs diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 66db749d95..6c71495b0f 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,6 +12,7 @@ import desktop_drop import device_info_plus import devicelocale import flutter_libepiccash +import flutter_libmwc import flutter_local_notifications import flutter_secure_storage_macos import isar_flutter_libs @@ -34,6 +35,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin")) FlutterLibepiccashPlugin.register(with: registry.registrar(forPlugin: "FlutterLibepiccashPlugin")) + FlutterLibmwcPlugin.register(with: registry.registrar(forPlugin: "FlutterLibmwcPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 96a16a3ae2..48728fb53c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -810,6 +810,13 @@ packages: relative: true source: path version: "0.0.1" + flutter_libmwc: + dependency: "direct main" + description: + path: "crypto_plugins/flutter_libmwc" + relative: true + source: path + version: "0.0.1" flutter_libsparkmobile: dependency: "direct main" description: diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index 0fd8e5e8a0..1139cbfc8d 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -62,6 +62,7 @@ final List _supportedCoins = List.unmodifiable([ Dogecoin(CryptoCurrencyNetwork.main), Ecash(CryptoCurrencyNetwork.main), Epiccash(CryptoCurrencyNetwork.main), + Mimblewimblecoin(CryptoCurrencyNetwork.main), Ethereum(CryptoCurrencyNetwork.main), Firo(CryptoCurrencyNetwork.main), Litecoin(CryptoCurrencyNetwork.main), diff --git a/scripts/app_config/templates/linux/CMakeLists.txt b/scripts/app_config/templates/linux/CMakeLists.txt index 25750ef4f6..d6ac3f66d3 100644 --- a/scripts/app_config/templates/linux/CMakeLists.txt +++ b/scripts/app_config/templates/linux/CMakeLists.txt @@ -137,7 +137,10 @@ install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libepic_cash_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/linux/build/libmobileliblelantus.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libemwc/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/linux/build/libmobileliblelantus.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so.1.7.4" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index e54f270b7e..59279398d1 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -45,6 +45,9 @@ dependencies: flutter_libepiccash: path: ./crypto_plugins/flutter_libepiccash + flutter_libmwc: + path: ./crypto_plugins/flutter_libmwc + bitcoindart: git: url: https://github.com/cypherstack/bitcoindart.git diff --git a/scripts/app_config/templates/windows/CMakeLists.txt b/scripts/app_config/templates/windows/CMakeLists.txt index b9add856d7..dd039195e2 100644 --- a/scripts/app_config/templates/windows/CMakeLists.txt +++ b/scripts/app_config/templates/windows/CMakeLists.txt @@ -83,6 +83,9 @@ install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 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_libmwc/scripts/windows/build/libmwc_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) diff --git a/scripts/ios/build_all.sh b/scripts/ios/build_all.sh index bcb03e9912..aa9d52aeef 100755 --- a/scripts/ios/build_all.sh +++ b/scripts/ios/build_all.sh @@ -16,6 +16,8 @@ rustup target add x86_64-apple-ios (cd ../../crypto_plugins/flutter_liblelantus/scripts/ios && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) diff --git a/scripts/ios/build_all_campfire.sh b/scripts/ios/build_all_campfire.sh index bcb03e9912..aa9d52aeef 100755 --- a/scripts/ios/build_all_campfire.sh +++ b/scripts/ios/build_all_campfire.sh @@ -16,6 +16,8 @@ rustup target add x86_64-apple-ios (cd ../../crypto_plugins/flutter_liblelantus/scripts/ios && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) diff --git a/scripts/ios/build_all_duo.sh b/scripts/ios/build_all_duo.sh index 89e6f46417..c6c11add7a 100755 --- a/scripts/ios/build_all_duo.sh +++ b/scripts/ios/build_all_duo.sh @@ -18,6 +18,8 @@ rustup target add x86_64-apple-ios (cd ../../crypto_plugins/flutter_liblelantus/scripts/ios && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) diff --git a/scripts/linux/build_all.sh b/scripts/linux/build_all.sh index 423646185e..4cc1ad8a09 100755 --- a/scripts/linux/build_all.sh +++ b/scripts/linux/build_all.sh @@ -14,6 +14,8 @@ mkdir -p build ./build_secure_storage_deps.sh (cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) diff --git a/scripts/linux/build_all_campfire.sh b/scripts/linux/build_all_campfire.sh index 423646185e..4cc1ad8a09 100755 --- a/scripts/linux/build_all_campfire.sh +++ b/scripts/linux/build_all_campfire.sh @@ -14,6 +14,8 @@ mkdir -p build ./build_secure_storage_deps.sh (cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) diff --git a/scripts/linux/build_all_duo.sh b/scripts/linux/build_all_duo.sh index 78067b4786..ace233fd8e 100755 --- a/scripts/linux/build_all_duo.sh +++ b/scripts/linux/build_all_duo.sh @@ -16,6 +16,8 @@ mkdir -p build ./build_secure_storage_deps.sh & (cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) diff --git a/scripts/macos/build_all.sh b/scripts/macos/build_all.sh index af608846fe..2e28e2605d 100755 --- a/scripts/macos/build_all.sh +++ b/scripts/macos/build_all.sh @@ -8,6 +8,8 @@ set_rust_to_1671 (cd ../../crypto_plugins/flutter_liblelantus/scripts/macos && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) diff --git a/scripts/macos/build_all_campfire.sh b/scripts/macos/build_all_campfire.sh index af608846fe..2e28e2605d 100755 --- a/scripts/macos/build_all_campfire.sh +++ b/scripts/macos/build_all_campfire.sh @@ -8,6 +8,8 @@ set_rust_to_1671 (cd ../../crypto_plugins/flutter_liblelantus/scripts/macos && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) diff --git a/scripts/macos/build_all_duo.sh b/scripts/macos/build_all_duo.sh index 8a53e58015..ac3788cc86 100755 --- a/scripts/macos/build_all_duo.sh +++ b/scripts/macos/build_all_duo.sh @@ -10,6 +10,8 @@ set_rust_to_1671 (cd ../../crypto_plugins/flutter_liblelantus/scripts/macos && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) diff --git a/scripts/rust_version.sh b/scripts/rust_version.sh index 8cda1229ba..a95729573d 100755 --- a/scripts/rust_version.sh +++ b/scripts/rust_version.sh @@ -16,4 +16,13 @@ set_rust_to_1720() { echo "Rust version 1.72.0 is not installed. Please install it using 'rustup install 1.72.0'." >&2 exit 1 fi +} + +set_rust_to_1810() { + if rustup toolchain list | grep -q "1.72.0"; then + rustup default 1.81.0 + else + echo "Rust version 1.81.0 is not installed. Please install it using 'rustup install 1.81.0'." >&2 + exit 1 + fi } \ No newline at end of file diff --git a/scripts/windows/build_all.sh b/scripts/windows/build_all.sh index 191a46cc07..53c035a3da 100755 --- a/scripts/windows/build_all.sh +++ b/scripts/windows/build_all.sh @@ -9,6 +9,8 @@ set_rust_to_1671 mkdir -p build (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) (cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) diff --git a/scripts/windows/build_all_campfire.sh b/scripts/windows/build_all_campfire.sh index 191a46cc07..53c035a3da 100755 --- a/scripts/windows/build_all_campfire.sh +++ b/scripts/windows/build_all_campfire.sh @@ -9,6 +9,8 @@ set_rust_to_1671 mkdir -p build (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) (cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) diff --git a/scripts/windows/build_all_duo.sh b/scripts/windows/build_all_duo.sh index 3e27eff02a..e5667b188d 100755 --- a/scripts/windows/build_all_duo.sh +++ b/scripts/windows/build_all_duo.sh @@ -11,6 +11,8 @@ set_rust_to_1671 mkdir -p build (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) (cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) diff --git a/scripts/windows/deps.sh b/scripts/windows/deps.sh index 4914d074f1..513a8ce7f2 100644 --- a/scripts/windows/deps.sh +++ b/scripts/windows/deps.sh @@ -1,8 +1,9 @@ #!/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 +(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./deps.sh ) +(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./mxedeps.sh ) +(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./deps.sh) +# (cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./monerodeps.sh && ./mxedeps.sh) & wait echo "Done building" diff --git a/test/price_test.dart b/test/price_test.dart index dc7aaeb9e1..e15a7b95d7 100644 --- a/test/price_test.dart +++ b/test/price_test.dart @@ -1,3 +1,5 @@ +// TODO MWC + import 'dart:convert'; import 'dart:io'; diff --git a/test/sample_data/theme_json.dart b/test/sample_data/theme_json.dart index 6f7601b42b..660e680e68 100644 --- a/test/sample_data/theme_json.dart +++ b/test/sample_data/theme_json.dart @@ -10,6 +10,7 @@ const Map lightThemeJsonMap = { "firo": "0xFFFF897A", "dogecoin": "0xFFFFE079", "epicCash": "0xFFC5C7CB", + "mimblewimblecoin": "0xFFC5C7CB", "ethereum": "0xFFA7ADE9", "monero": "0xFFFF9E6B", "namecoin": "0xFF91B1E1", @@ -186,6 +187,7 @@ const Map lightThemeJsonMap = { "bitcoincash": "dummy.svg", "dogecoin": "dummy.svg", "epicCash": "dummy.svg", + "mimblewimblecoin": "dummy.svg", "ethereum": "dummy.svg", "firo": "dummy.svg", "monero": "dummy.svg", @@ -197,6 +199,7 @@ const Map lightThemeJsonMap = { "bitcoincash_image": "dummy.svg", "dogecoin_image": "dummy.svg", "epicCash_image": "dummy.svg.svg", + "mimblewimblecoin_image": "dummy.svg", "ethereum_image": "dummy.svg", "firo_image": "dummy.svg", "monero_image": "dummy.svg", @@ -208,6 +211,7 @@ const Map lightThemeJsonMap = { "bitcoincash_image_secondary": "dummy.svg", "dogecoin_image_secondary": "dummy.svg", "epicCash_image_secondary": "dummy.svg.svg", + "mimblewimblecoin_image_secondary": "dummy.svg", "ethereum_image_secondary": "dummy.svg", "firo_image_secondary": "dummy.svg", "monero_image_secondary": "dummy.svg", diff --git a/test/sample_data/theme_json_v2.dart b/test/sample_data/theme_json_v2.dart index 3f9fbfb7f3..1327789c02 100644 --- a/test/sample_data/theme_json_v2.dart +++ b/test/sample_data/theme_json_v2.dart @@ -13,6 +13,7 @@ const Map lightThemeJsonMap = { "dogecoin": "0xFFFFE079", "eCash": "0xFFC5C7CB", "epicCash": "0xFFC5C7CB", + "mimblewimblecoin": "0xFFC5C7CB", "ethereum": "0xFFA7ADE9", "monero": "0xFFFF9E6B", "namecoin": "0xFF91B1E1", @@ -194,6 +195,7 @@ const Map lightThemeJsonMap = { "dogecoin": "dummy.svg", "eCash": "dummy.svg", "epicCash": "dummy.svg", + "mimblewimblecoin": "dummy.svg", "ethereum": "dummy.svg", "firo": "dummy.svg", "monero": "dummy.svg", @@ -208,6 +210,7 @@ const Map lightThemeJsonMap = { "dogecoin": "dummy.svg", "eCash": "dummy.svg", "epicCash": "dummy.svg", + "mimblewimblecoin": "dummy.svg", "ethereum": "dummy.svg", "firo": "dummy.svg", "monero": "dummy.svg", @@ -222,6 +225,7 @@ const Map lightThemeJsonMap = { "dogecoin": "dummy.svg", "eCash": "dummy.svg", "epicCash": "dummy.svg", + "mimblewimblecoin": "dummy.svg", "ethereum": "dummy.svg", "firo": "dummy.svg", "monero": "dummy.svg", diff --git a/test/services/node_service_test.dart b/test/services/node_service_test.dart index 5b4f1e6358..b44ebf3231 100644 --- a/test/services/node_service_test.dart +++ b/test/services/node_service_test.dart @@ -1,3 +1,5 @@ +// TODO MWC + import 'package:flutter_test/flutter_test.dart'; import 'package:hive/hive.dart'; import 'package:hive_test/hive_test.dart'; @@ -152,6 +154,17 @@ void main() { isFailover: true, isDown: false, ); + final nodeD = NodeModel( + host: "host3", + port: 423, + name: "btcnode", + id: "pnodeID3", + useSSL: true, + enabled: true, + coinName: "mimblewimblecoin", + isFailover: true, + isDown: false, + ); setUp(() async { await NodeService(secureStorageInterface: FakeSecureStorage()) diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 74ef33c4e5..bb0e286970 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("DesktopDropPlugin")); FlutterLibepiccashPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterLibepiccashPluginCApi")); + FlutterLibmwcPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FlutterLibmwcPluginCApi")); FlutterSecureStorageWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); IsarFlutterLibsPluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 2f370e6855..0cd9af7943 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -8,6 +8,7 @@ list(APPEND FLUTTER_PLUGIN_LIST cs_monero_flutter_libs_windows desktop_drop flutter_libepiccash + flutter_libmwc flutter_secure_storage_windows isar_flutter_libs local_auth_windows From 9d04e479e74d087f46b847c32e7d3790576f0bc8 Mon Sep 17 00:00:00 2001 From: vekamo Date: Sun, 27 Oct 2024 15:54:52 +0400 Subject: [PATCH 002/178] continuous integration mwc v2 --- .../blockchain_data/v2/transaction_v2.g.dart | 142 +++-- lib/models/isar/stack_theme.g.dart | 603 +++++++++++++++--- lib/models/mwcmqs_config_model.dart | 118 ++++ lib/models/mwcmqs_server_model.dart | 93 +++ .../type_adaptors/mwcmqs_config_model.g.dart | 50 ++ .../type_adaptors/mwcmqs_server_model.g.dart | 62 ++ .../restore_wallet_view.dart | 28 +- .../wallet_settings_view.dart | 2 +- lib/utilities/address_utils.dart | 2 +- lib/utilities/test_mwcmqs_connection.dart | 81 +++ .../coins/mimblewimblecoin.dart | 6 +- .../wallet/impl/mimblewimblecoin_wallet.dart | 95 ++- ...imblewimblecoin_wallet_info_extension.dart | 6 +- lib/wallets/wallet/wallet.dart | 2 +- pubspec.lock | 2 +- .../app_config/templates/linux/CMakeLists.txt | 2 +- scripts/linux/build_secp256k1.sh | 2 +- test/cached_electrumx_test.mocks.dart | 13 + .../pages/send_view/send_view_test.mocks.dart | 13 + .../exchange/exchange_view_test.mocks.dart | 13 + .../managed_favorite_test.mocks.dart | 13 + .../node_options_sheet_test.mocks.dart | 13 + .../transaction_card_test.mocks.dart | 13 + 23 files changed, 1181 insertions(+), 193 deletions(-) create mode 100644 lib/models/mwcmqs_config_model.dart create mode 100644 lib/models/mwcmqs_server_model.dart create mode 100644 lib/models/type_adaptors/mwcmqs_config_model.g.dart create mode 100644 lib/models/type_adaptors/mwcmqs_server_model.g.dart create mode 100644 lib/utilities/test_mwcmqs_connection.dart diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart index 68d8a18c57..3bb48c3508 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart @@ -53,66 +53,71 @@ const TransactionV2Schema = CollectionSchema( name: r'isEpiccashTransaction', type: IsarType.bool, ), - r'nonce': PropertySchema( + r'isMimblewimblecoinTransaction': PropertySchema( id: 7, + name: r'isMimblewimblecoinTransaction', + type: IsarType.bool, + ), + r'nonce': PropertySchema( + id: 8, name: r'nonce', type: IsarType.long, ), r'numberOfMessages': PropertySchema( - id: 8, + id: 9, name: r'numberOfMessages', type: IsarType.long, ), r'onChainNote': PropertySchema( - id: 9, + id: 10, name: r'onChainNote', type: IsarType.string, ), r'otherData': PropertySchema( - id: 10, + id: 11, name: r'otherData', type: IsarType.string, ), r'outputs': PropertySchema( - id: 11, + id: 12, name: r'outputs', type: IsarType.objectList, target: r'OutputV2', ), r'slateId': PropertySchema( - id: 12, + id: 13, name: r'slateId', type: IsarType.string, ), r'subType': PropertySchema( - id: 13, + id: 14, name: r'subType', type: IsarType.byte, enumMap: _TransactionV2subTypeEnumValueMap, ), r'timestamp': PropertySchema( - id: 14, + id: 15, name: r'timestamp', type: IsarType.long, ), r'txid': PropertySchema( - id: 15, + id: 16, name: r'txid', type: IsarType.string, ), r'type': PropertySchema( - id: 16, + id: 17, name: r'type', type: IsarType.byte, enumMap: _TransactionV2typeEnumValueMap, ), r'version': PropertySchema( - id: 17, + id: 18, name: r'version', type: IsarType.long, ), r'walletId': PropertySchema( - id: 18, + id: 19, name: r'walletId', type: IsarType.string, ) @@ -256,23 +261,24 @@ void _transactionV2Serialize( ); writer.writeBool(offsets[5], object.isCancelled); writer.writeBool(offsets[6], object.isEpiccashTransaction); - writer.writeLong(offsets[7], object.nonce); - writer.writeLong(offsets[8], object.numberOfMessages); - writer.writeString(offsets[9], object.onChainNote); - writer.writeString(offsets[10], object.otherData); + writer.writeBool(offsets[7], object.isMimblewimblecoinTransaction); + writer.writeLong(offsets[8], object.nonce); + writer.writeLong(offsets[9], object.numberOfMessages); + writer.writeString(offsets[10], object.onChainNote); + writer.writeString(offsets[11], object.otherData); writer.writeObjectList( - offsets[11], + offsets[12], allOffsets, OutputV2Schema.serialize, object.outputs, ); - writer.writeString(offsets[12], object.slateId); - writer.writeByte(offsets[13], object.subType.index); - writer.writeLong(offsets[14], object.timestamp); - writer.writeString(offsets[15], object.txid); - writer.writeByte(offsets[16], object.type.index); - writer.writeLong(offsets[17], object.version); - writer.writeString(offsets[18], object.walletId); + writer.writeString(offsets[13], object.slateId); + writer.writeByte(offsets[14], object.subType.index); + writer.writeLong(offsets[15], object.timestamp); + writer.writeString(offsets[16], object.txid); + writer.writeByte(offsets[17], object.type.index); + writer.writeLong(offsets[18], object.version); + writer.writeString(offsets[19], object.walletId); } TransactionV2 _transactionV2Deserialize( @@ -292,23 +298,23 @@ TransactionV2 _transactionV2Deserialize( InputV2(), ) ?? [], - otherData: reader.readStringOrNull(offsets[10]), + otherData: reader.readStringOrNull(offsets[11]), outputs: reader.readObjectList( - offsets[11], + offsets[12], OutputV2Schema.deserialize, allOffsets, OutputV2(), ) ?? [], subType: - _TransactionV2subTypeValueEnumMap[reader.readByteOrNull(offsets[13])] ?? + _TransactionV2subTypeValueEnumMap[reader.readByteOrNull(offsets[14])] ?? TransactionSubType.none, - timestamp: reader.readLong(offsets[14]), - txid: reader.readString(offsets[15]), - type: _TransactionV2typeValueEnumMap[reader.readByteOrNull(offsets[16])] ?? + timestamp: reader.readLong(offsets[15]), + txid: reader.readString(offsets[16]), + type: _TransactionV2typeValueEnumMap[reader.readByteOrNull(offsets[17])] ?? TransactionType.outgoing, - version: reader.readLong(offsets[17]), - walletId: reader.readString(offsets[18]), + version: reader.readLong(offsets[18]), + walletId: reader.readString(offsets[19]), ); object.id = id; return object; @@ -342,14 +348,16 @@ P _transactionV2DeserializeProp

( case 6: return (reader.readBool(offset)) as P; case 7: - return (reader.readLongOrNull(offset)) as P; + return (reader.readBool(offset)) as P; case 8: return (reader.readLongOrNull(offset)) as P; case 9: - return (reader.readStringOrNull(offset)) as P; + return (reader.readLongOrNull(offset)) as P; case 10: return (reader.readStringOrNull(offset)) as P; case 11: + return (reader.readStringOrNull(offset)) as P; + case 12: return (reader.readObjectList( offset, OutputV2Schema.deserialize, @@ -357,22 +365,22 @@ P _transactionV2DeserializeProp

( OutputV2(), ) ?? []) as P; - case 12: - return (reader.readStringOrNull(offset)) as P; case 13: + return (reader.readStringOrNull(offset)) as P; + case 14: return (_TransactionV2subTypeValueEnumMap[ reader.readByteOrNull(offset)] ?? TransactionSubType.none) as P; - case 14: - return (reader.readLong(offset)) as P; case 15: - return (reader.readString(offset)) as P; + return (reader.readLong(offset)) as P; case 16: + return (reader.readString(offset)) as P; + case 17: return (_TransactionV2typeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionType.outgoing) as P; - case 17: - return (reader.readLong(offset)) as P; case 18: + return (reader.readLong(offset)) as P; + case 19: return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); @@ -1513,6 +1521,16 @@ extension TransactionV2QueryFilter }); } + QueryBuilder + isMimblewimblecoinTransactionEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'isMimblewimblecoinTransaction', + value: value, + )); + }); + } + QueryBuilder nonceIsNull() { return QueryBuilder.apply(this, (query) { @@ -2807,6 +2825,20 @@ extension TransactionV2QuerySortBy }); } + QueryBuilder + sortByIsMimblewimblecoinTransaction() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.asc); + }); + } + + QueryBuilder + sortByIsMimblewimblecoinTransactionDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.desc); + }); + } + QueryBuilder sortByNonce() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'nonce', Sort.asc); @@ -3038,6 +3070,20 @@ extension TransactionV2QuerySortThenBy }); } + QueryBuilder + thenByIsMimblewimblecoinTransaction() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.asc); + }); + } + + QueryBuilder + thenByIsMimblewimblecoinTransactionDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.desc); + }); + } + QueryBuilder thenByNonce() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'nonce', Sort.asc); @@ -3221,6 +3267,13 @@ extension TransactionV2QueryWhereDistinct }); } + QueryBuilder + distinctByIsMimblewimblecoinTransaction() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'isMimblewimblecoinTransaction'); + }); + } + QueryBuilder distinctByNonce() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'nonce'); @@ -3347,6 +3400,13 @@ extension TransactionV2QueryProperty }); } + QueryBuilder + isMimblewimblecoinTransactionProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'isMimblewimblecoinTransaction'); + }); + } + QueryBuilder nonceProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'nonce'); diff --git a/lib/models/isar/stack_theme.g.dart b/lib/models/isar/stack_theme.g.dart index c77d979f54..0117ef7b9b 100644 --- a/lib/models/isar/stack_theme.g.dart +++ b/lib/models/isar/stack_theme.g.dart @@ -18148,138 +18148,153 @@ const ThemeAssetsSchema = Schema( name: r'loadingGif', type: IsarType.string, ), - r'monero': PropertySchema( + r'mimblewimblecoin': PropertySchema( id: 26, + name: r'mimblewimblecoin', + type: IsarType.string, + ), + r'mimblewimblecoinImage': PropertySchema( + id: 27, + name: r'mimblewimblecoinImage', + type: IsarType.string, + ), + r'mimblewimblecoinImageSecondary': PropertySchema( + id: 28, + name: r'mimblewimblecoinImageSecondary', + type: IsarType.string, + ), + r'monero': PropertySchema( + id: 29, name: r'monero', type: IsarType.string, ), r'moneroImage': PropertySchema( - id: 27, + id: 30, name: r'moneroImage', type: IsarType.string, ), r'moneroImageSecondary': PropertySchema( - id: 28, + id: 31, name: r'moneroImageSecondary', type: IsarType.string, ), r'namecoin': PropertySchema( - id: 29, + id: 32, name: r'namecoin', type: IsarType.string, ), r'namecoinImage': PropertySchema( - id: 30, + id: 33, name: r'namecoinImage', type: IsarType.string, ), r'namecoinImageSecondary': PropertySchema( - id: 31, + id: 34, name: r'namecoinImageSecondary', type: IsarType.string, ), r'particl': PropertySchema( - id: 32, + id: 35, name: r'particl', type: IsarType.string, ), r'particlImage': PropertySchema( - id: 33, + id: 36, name: r'particlImage', type: IsarType.string, ), r'particlImageSecondary': PropertySchema( - id: 34, + id: 37, name: r'particlImageSecondary', type: IsarType.string, ), r'personaEasy': PropertySchema( - id: 35, + id: 38, name: r'personaEasy', type: IsarType.string, ), r'personaIncognito': PropertySchema( - id: 36, + id: 39, name: r'personaIncognito', type: IsarType.string, ), r'receive': PropertySchema( - id: 37, + id: 40, name: r'receive', type: IsarType.string, ), r'receiveCancelled': PropertySchema( - id: 38, + id: 41, name: r'receiveCancelled', type: IsarType.string, ), r'receivePending': PropertySchema( - id: 39, + id: 42, name: r'receivePending', type: IsarType.string, ), r'send': PropertySchema( - id: 40, + id: 43, name: r'send', type: IsarType.string, ), r'sendCancelled': PropertySchema( - id: 41, + id: 44, name: r'sendCancelled', type: IsarType.string, ), r'sendPending': PropertySchema( - id: 42, + id: 45, name: r'sendPending', type: IsarType.string, ), r'stack': PropertySchema( - id: 43, + id: 46, name: r'stack', type: IsarType.string, ), r'stackIcon': PropertySchema( - id: 44, + id: 47, name: r'stackIcon', type: IsarType.string, ), r'themePreview': PropertySchema( - id: 45, + id: 48, name: r'themePreview', type: IsarType.string, ), r'themeSelector': PropertySchema( - id: 46, + id: 49, name: r'themeSelector', type: IsarType.string, ), r'txExchange': PropertySchema( - id: 47, + id: 50, name: r'txExchange', type: IsarType.string, ), r'txExchangeFailed': PropertySchema( - id: 48, + id: 51, name: r'txExchangeFailed', type: IsarType.string, ), r'txExchangePending': PropertySchema( - id: 49, + id: 52, name: r'txExchangePending', type: IsarType.string, ), r'wownero': PropertySchema( - id: 50, + id: 53, name: r'wownero', type: IsarType.string, ), r'wowneroImage': PropertySchema( - id: 51, + id: 54, name: r'wowneroImage', type: IsarType.string, ), r'wowneroImageSecondary': PropertySchema( - id: 52, + id: 55, name: r'wowneroImageSecondary', type: IsarType.string, ) @@ -18332,6 +18347,9 @@ int _themeAssetsEstimateSize( bytesCount += 3 + value.length * 3; } } + bytesCount += 3 + object.mimblewimblecoin.length * 3; + bytesCount += 3 + object.mimblewimblecoinImage.length * 3; + bytesCount += 3 + object.mimblewimblecoinImageSecondary.length * 3; bytesCount += 3 + object.monero.length * 3; bytesCount += 3 + object.moneroImage.length * 3; bytesCount += 3 + object.moneroImageSecondary.length * 3; @@ -18394,33 +18412,36 @@ void _themeAssetsSerialize( writer.writeString(offsets[23], object.litecoinImage); writer.writeString(offsets[24], object.litecoinImageSecondary); writer.writeString(offsets[25], object.loadingGif); - writer.writeString(offsets[26], object.monero); - writer.writeString(offsets[27], object.moneroImage); - writer.writeString(offsets[28], object.moneroImageSecondary); - writer.writeString(offsets[29], object.namecoin); - writer.writeString(offsets[30], object.namecoinImage); - writer.writeString(offsets[31], object.namecoinImageSecondary); - writer.writeString(offsets[32], object.particl); - writer.writeString(offsets[33], object.particlImage); - writer.writeString(offsets[34], object.particlImageSecondary); - writer.writeString(offsets[35], object.personaEasy); - writer.writeString(offsets[36], object.personaIncognito); - writer.writeString(offsets[37], object.receive); - writer.writeString(offsets[38], object.receiveCancelled); - writer.writeString(offsets[39], object.receivePending); - writer.writeString(offsets[40], object.send); - writer.writeString(offsets[41], object.sendCancelled); - writer.writeString(offsets[42], object.sendPending); - writer.writeString(offsets[43], object.stack); - writer.writeString(offsets[44], object.stackIcon); - writer.writeString(offsets[45], object.themePreview); - writer.writeString(offsets[46], object.themeSelector); - writer.writeString(offsets[47], object.txExchange); - writer.writeString(offsets[48], object.txExchangeFailed); - writer.writeString(offsets[49], object.txExchangePending); - writer.writeString(offsets[50], object.wownero); - writer.writeString(offsets[51], object.wowneroImage); - writer.writeString(offsets[52], object.wowneroImageSecondary); + writer.writeString(offsets[26], object.mimblewimblecoin); + writer.writeString(offsets[27], object.mimblewimblecoinImage); + writer.writeString(offsets[28], object.mimblewimblecoinImageSecondary); + writer.writeString(offsets[29], object.monero); + writer.writeString(offsets[30], object.moneroImage); + writer.writeString(offsets[31], object.moneroImageSecondary); + writer.writeString(offsets[32], object.namecoin); + writer.writeString(offsets[33], object.namecoinImage); + writer.writeString(offsets[34], object.namecoinImageSecondary); + writer.writeString(offsets[35], object.particl); + writer.writeString(offsets[36], object.particlImage); + writer.writeString(offsets[37], object.particlImageSecondary); + writer.writeString(offsets[38], object.personaEasy); + writer.writeString(offsets[39], object.personaIncognito); + writer.writeString(offsets[40], object.receive); + writer.writeString(offsets[41], object.receiveCancelled); + writer.writeString(offsets[42], object.receivePending); + writer.writeString(offsets[43], object.send); + writer.writeString(offsets[44], object.sendCancelled); + writer.writeString(offsets[45], object.sendPending); + writer.writeString(offsets[46], object.stack); + writer.writeString(offsets[47], object.stackIcon); + writer.writeString(offsets[48], object.themePreview); + writer.writeString(offsets[49], object.themeSelector); + writer.writeString(offsets[50], object.txExchange); + writer.writeString(offsets[51], object.txExchangeFailed); + writer.writeString(offsets[52], object.txExchangePending); + writer.writeString(offsets[53], object.wownero); + writer.writeString(offsets[54], object.wowneroImage); + writer.writeString(offsets[55], object.wowneroImageSecondary); } ThemeAssets _themeAssetsDeserialize( @@ -18456,33 +18477,36 @@ ThemeAssets _themeAssetsDeserialize( object.litecoinImage = reader.readString(offsets[23]); object.litecoinImageSecondary = reader.readString(offsets[24]); object.loadingGif = reader.readStringOrNull(offsets[25]); - object.monero = reader.readString(offsets[26]); - object.moneroImage = reader.readString(offsets[27]); - object.moneroImageSecondary = reader.readString(offsets[28]); - object.namecoin = reader.readString(offsets[29]); - object.namecoinImage = reader.readString(offsets[30]); - object.namecoinImageSecondary = reader.readString(offsets[31]); - object.particl = reader.readString(offsets[32]); - object.particlImage = reader.readString(offsets[33]); - object.particlImageSecondary = reader.readString(offsets[34]); - object.personaEasy = reader.readString(offsets[35]); - object.personaIncognito = reader.readString(offsets[36]); - object.receive = reader.readString(offsets[37]); - object.receiveCancelled = reader.readString(offsets[38]); - object.receivePending = reader.readString(offsets[39]); - object.send = reader.readString(offsets[40]); - object.sendCancelled = reader.readString(offsets[41]); - object.sendPending = reader.readString(offsets[42]); - object.stack = reader.readString(offsets[43]); - object.stackIcon = reader.readString(offsets[44]); - object.themePreview = reader.readString(offsets[45]); - object.themeSelector = reader.readString(offsets[46]); - object.txExchange = reader.readString(offsets[47]); - object.txExchangeFailed = reader.readString(offsets[48]); - object.txExchangePending = reader.readString(offsets[49]); - object.wownero = reader.readString(offsets[50]); - object.wowneroImage = reader.readString(offsets[51]); - object.wowneroImageSecondary = reader.readString(offsets[52]); + object.mimblewimblecoin = reader.readString(offsets[26]); + object.mimblewimblecoinImage = reader.readString(offsets[27]); + object.mimblewimblecoinImageSecondary = reader.readString(offsets[28]); + object.monero = reader.readString(offsets[29]); + object.moneroImage = reader.readString(offsets[30]); + object.moneroImageSecondary = reader.readString(offsets[31]); + object.namecoin = reader.readString(offsets[32]); + object.namecoinImage = reader.readString(offsets[33]); + object.namecoinImageSecondary = reader.readString(offsets[34]); + object.particl = reader.readString(offsets[35]); + object.particlImage = reader.readString(offsets[36]); + object.particlImageSecondary = reader.readString(offsets[37]); + object.personaEasy = reader.readString(offsets[38]); + object.personaIncognito = reader.readString(offsets[39]); + object.receive = reader.readString(offsets[40]); + object.receiveCancelled = reader.readString(offsets[41]); + object.receivePending = reader.readString(offsets[42]); + object.send = reader.readString(offsets[43]); + object.sendCancelled = reader.readString(offsets[44]); + object.sendPending = reader.readString(offsets[45]); + object.stack = reader.readString(offsets[46]); + object.stackIcon = reader.readString(offsets[47]); + object.themePreview = reader.readString(offsets[48]); + object.themeSelector = reader.readString(offsets[49]); + object.txExchange = reader.readString(offsets[50]); + object.txExchangeFailed = reader.readString(offsets[51]); + object.txExchangePending = reader.readString(offsets[52]); + object.wownero = reader.readString(offsets[53]); + object.wowneroImage = reader.readString(offsets[54]); + object.wowneroImageSecondary = reader.readString(offsets[55]); return object; } @@ -18599,6 +18623,12 @@ P _themeAssetsDeserializeProp

( return (reader.readString(offset)) as P; case 52: return (reader.readString(offset)) as P; + case 53: + return (reader.readString(offset)) as P; + case 54: + return (reader.readString(offset)) as P; + case 55: + return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); } @@ -22170,6 +22200,417 @@ extension ThemeAssetsQueryFilter }); } + QueryBuilder + mimblewimblecoinEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinBetween( + 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'mimblewimblecoin', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'mimblewimblecoin', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoin', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'mimblewimblecoin', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinImageEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageBetween( + 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'mimblewimblecoinImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'mimblewimblecoinImage', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoinImage', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinImageIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'mimblewimblecoinImage', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryBetween( + 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'mimblewimblecoinImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'mimblewimblecoinImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoinImageSecondary', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'mimblewimblecoinImageSecondary', + value: '', + )); + }); + } + QueryBuilder moneroEqualTo( String value, { bool caseSensitive = true, diff --git a/lib/models/mwcmqs_config_model.dart b/lib/models/mwcmqs_config_model.dart new file mode 100644 index 0000000000..6970905106 --- /dev/null +++ b/lib/models/mwcmqs_config_model.dart @@ -0,0 +1,118 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * 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'; + +import 'mwcmqs_server_model.dart'; + +part 'type_adaptors/mwcmqs_config_model.g.dart'; + +@HiveType(typeId: 82) +class MwcMqsConfigModel { + @HiveField(1) + final String host; + @HiveField(2) + final int? port; + @HiveField(3) + final bool? protocolInsecure; + @HiveField(4) + final int? addressIndex; + + MwcMqsConfigModel({ + required this.host, + this.port, + this.protocolInsecure, + this.addressIndex, + }); + + MwcMqsConfigModel copyWith({ + int? port, + bool? protocolInsecure, + int? addressIndex, + String? id, + String? name, + }) { + return MwcMqsConfigModel( + host: host, + port: this.port ?? 443, + protocolInsecure: this.protocolInsecure ?? false, + addressIndex: this.addressIndex ?? 0, + ); + } + + Map toMap() { + final Map map = {}; + map['mwcmqs_domain'] = host; + map['mwcmqs_port'] = port; + map['mwcmqs_protocol_insecure'] = protocolInsecure; + map['mwcmqs_address_index'] = addressIndex; + return map; + } + + Map toJson() { + return { + 'mwcmqs_domain': host, + 'mwcmqs_port': port, + 'mwcmqs_protocol_insecure': protocolInsecure, + 'mwcmqs_address_index': addressIndex, + }; + } + + @override + String toString() { + return json.encode(toJson()); + } + + static MwcMqsConfigModel fromString(String MwcMqsConfigString) { + final dynamic _mwcmqs = json.decode(MwcMqsConfigString); + + final oldDomain = _mwcmqs["domain"] ?? "empty"; + if (oldDomain != "empty") { + _mwcmqs['mwcmqs_domain'] = _mwcmqs['domain']; + } + final oldPort = _mwcmqs["port"] ?? "empty"; + if (oldPort != "empty") { + _mwcmqs['mwcmqs_port'] = _mwcmqs['port']; + } + final oldProtocolInsecure = _mwcmqs["protocol_insecure"] ?? "empty"; + if (oldProtocolInsecure != "empty") { + _mwcmqs['mwcmqs_protocol_insecure'] = _mwcmqs['protocol_insecure']; + } + final oldAddressIndex = _mwcmqs["address_index"] ?? "empty"; + if (oldAddressIndex != "empty") { + _mwcmqs['mwcmqs_address_index'] = _mwcmqs['address_index']; + } + + _mwcmqs['mwcmqs_protocol_insecure'] ??= false; + _mwcmqs['mwcmqs_address_index'] ??= 0; + + return MwcMqsConfigModel( + host: _mwcmqs['mwcmqs_domain'] as String, + port: _mwcmqs['mwcmqs_port'] as int, + protocolInsecure: _mwcmqs['mwcmqs_protocol_insecure'] as bool, + addressIndex: _mwcmqs['mwcmqs_address_index'] as int, + ); + } + + static MwcMqsConfigModel fromServer( + MwcMqsServerModel server, { + bool? protocolInsecure, + int? addressIndex, + }) { + return MwcMqsConfigModel( + host: server.host, + port: server.port ?? 443, + protocolInsecure: protocolInsecure ?? false, + addressIndex: addressIndex ?? 0, + ); + } +} diff --git a/lib/models/mwcmqs_server_model.dart b/lib/models/mwcmqs_server_model.dart new file mode 100644 index 0000000000..c6ffd757f9 --- /dev/null +++ b/lib/models/mwcmqs_server_model.dart @@ -0,0 +1,93 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All 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/mwcmqs_server_model.g.dart'; + +@HiveType(typeId: 81) +class MwcMqsServerModel { + @HiveField(0) + final String id; + @HiveField(1) + final String host; + @HiveField(2) + final int? port; + @HiveField(3) + final String name; + @HiveField(4) + final bool? useSSL; + @HiveField(5) + final bool? enabled; + @HiveField(6) + final bool? isFailover; + @HiveField(7) + final bool? isDown; + + MwcMqsServerModel({ + required this.id, + required this.host, + this.port, + required this.name, + this.useSSL, + this.enabled, + this.isFailover, + this.isDown, + }); + + MwcMqsServerModel copyWith({ + String? host, + int? port, + String? name, + bool? useSSL, + bool? enabled, + bool? isFailover, + bool? isDown, + }) { + return MwcMqsServerModel( + id: id, + host: host ?? this.host, + port: port ?? this.port, + name: name ?? this.name, + useSSL: useSSL ?? this.useSSL, + enabled: enabled ?? this.enabled, + isFailover: isFailover ?? this.isFailover, + isDown: isDown ?? this.isDown, + ); + } + + Map toMap() { + final Map map = {}; + map['id'] = id; + map['host'] = host; + map['port'] = port; + map['name'] = name; + map['useSSL'] = useSSL; + map['enabled'] = enabled; + map['isFailover'] = isFailover; + map['isDown'] = isDown; + return map; + } + + bool get isDefault => id.startsWith("default_"); + + Map toJson() { + return { + 'id': id, + 'host': host, + 'port': port, + 'name': name, + 'useSSL': useSSL, + 'enabled': enabled, + 'isFailover': isFailover, + 'isDown': isDown, + }; + } +} diff --git a/lib/models/type_adaptors/mwcmqs_config_model.g.dart b/lib/models/type_adaptors/mwcmqs_config_model.g.dart new file mode 100644 index 0000000000..e64fc54082 --- /dev/null +++ b/lib/models/type_adaptors/mwcmqs_config_model.g.dart @@ -0,0 +1,50 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of '../mwcmqs_config_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class MwcMqsConfigModelAdapter extends TypeAdapter { + @override + final int typeId = 82; + + @override + MwcMqsConfigModel read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return MwcMqsConfigModel( + host: fields[1] as String, + port: fields[2] as int?, + protocolInsecure: fields[3] as bool?, + addressIndex: fields[4] as int?, + ); + } + + @override + void write(BinaryWriter writer, MwcMqsConfigModel obj) { + writer + ..writeByte(4) + ..writeByte(1) + ..write(obj.host) + ..writeByte(2) + ..write(obj.port) + ..writeByte(3) + ..write(obj.protocolInsecure) + ..writeByte(4) + ..write(obj.addressIndex); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MwcMqsConfigModelAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/models/type_adaptors/mwcmqs_server_model.g.dart b/lib/models/type_adaptors/mwcmqs_server_model.g.dart new file mode 100644 index 0000000000..dabdd9464d --- /dev/null +++ b/lib/models/type_adaptors/mwcmqs_server_model.g.dart @@ -0,0 +1,62 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of '../mwcmqs_server_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class MwcMqsServerModelAdapter extends TypeAdapter { + @override + final int typeId = 81; + + @override + MwcMqsServerModel read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return MwcMqsServerModel( + id: fields[0] as String, + host: fields[1] as String, + port: fields[2] as int?, + name: fields[3] as String, + useSSL: fields[4] as bool?, + enabled: fields[5] as bool?, + isFailover: fields[6] as bool?, + isDown: fields[7] as bool?, + ); + } + + @override + void write(BinaryWriter writer, MwcMqsServerModel obj) { + writer + ..writeByte(8) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.host) + ..writeByte(2) + ..write(obj.port) + ..writeByte(3) + ..write(obj.name) + ..writeByte(4) + ..write(obj.useSSL) + ..writeByte(5) + ..write(obj.enabled) + ..writeByte(6) + ..write(obj.isFailover) + ..writeByte(7) + ..write(obj.isDown); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MwcMqsServerModelAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} 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 20bf9fd8b1..e56694fed0 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 @@ -254,24 +254,32 @@ class _RestoreWalletViewState extends ConsumerState { if (height < 0) { height = 0; } - - // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index - if (widget.coin is Mimblewimblecoin) { - final int secondsSinceEpoch = - widget.restoreFromDate.millisecondsSinceEpoch ~/ 1000; - const int mimblewimblecoinFirstBlock = 1565370278; + otherDataJsonString = jsonEncode( + { + WalletInfoKeys.mimblewimblecoinData: jsonEncode( + ExtraMimblewimblecoinWalletInfo( + receivingIndex: 0, + changeIndex: 0, + slatesToAddresses: {}, + slatesToCommits: {}, + lastScannedBlock: height, + restoreHeight: height, + creationHeight: height, + ).toMap(), + ), + }, + ); + } else if (widget.coin is Mimblewimblecoin) { + final int secondsSinceEpoch = widget.restoreFromDate.millisecondsSinceEpoch ~/ 1000; + const int mimblewimblecoinFirstBlock = 1573462801; const double overestimateSecondsPerBlock = 61; final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; final int approximateHeight = chosenSeconds ~/ overestimateSecondsPerBlock; - //todo: check if print needed - // debugPrint( - // "approximate height: $approximateHeight chosen_seconds: $chosenSeconds"); height = approximateHeight; if (height < 0) { height = 0; } - otherDataJsonString = jsonEncode( { WalletInfoKeys.mimblewimblecoinData: jsonEncode( 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 0135d5cac0..e8a485be87 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 @@ -707,7 +707,7 @@ class MwcMqsInfoForm extends ConsumerStatefulWidget { final String walletId; @override - ConsumerState createState() => _MwcMqsInfoFormState(); + ConsumerState createState() => _MwcmqsInfoFormState(); } class _MwcmqsInfoFormState extends ConsumerState { diff --git a/lib/utilities/address_utils.dart b/lib/utilities/address_utils.dart index 9cd952b3e8..b3c2404f07 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -376,7 +376,7 @@ class AddressUtils { } /// Formats an address string to remove any unnecessary prefixes or suffixes. - String formatMimblewimblecoinAddress(String mimblewimblecoinAddress) { + String formatAddressMwc(String mimblewimblecoinAddress) { // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an mwcmqs address) if ((mimblewimblecoinAddress.startsWith("http://") || mimblewimblecoinAddress.startsWith("https://")) && diff --git a/lib/utilities/test_mwcmqs_connection.dart b/lib/utilities/test_mwcmqs_connection.dart new file mode 100644 index 0000000000..44433a1036 --- /dev/null +++ b/lib/utilities/test_mwcmqs_connection.dart @@ -0,0 +1,81 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * 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 '../networking/http.dart'; +import '../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; +import '../services/tor_service.dart'; +import 'logger.dart'; +import 'prefs.dart'; + +Future _testMwcMqsNodeConnection(Uri uri) async { + final HTTP client = HTTP(); + try { + final response = await client + .get( + url: uri, + headers: {'Content-Type': 'application/json'}, + proxyInfo: Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, + ) + .timeout( + const Duration(milliseconds: 2000), + onTimeout: () async => Response(utf8.encode('Error'), 408), + ); + + final json = jsonDecode(response.body); + + if (response.code == 200 && json["node_version"] != null) { + return true; + } else { + return false; + } + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Warning); + return false; + } +} + +// returns node data with properly formatted host/url if successful, otherwise null +Future testMwcNodeConnection(NodeFormData data) async { + if (data.host == null || data.port == null || data.useSSL == null) { + return null; + } + const String path_postfix = "/v1/version"; + + if (data.host!.startsWith("https://")) { + data.useSSL = true; + } else if (data.host!.startsWith("http://")) { + data.useSSL = false; + } else { + if (data.useSSL!) { + data.host = "https://${data.host!}"; + } else { + data.host = "http://${data.host!}"; + } + } + + Uri uri = Uri.parse(data.host! + path_postfix); + + uri = uri.replace(port: data.port); + + try { + if (await _testMwcMqsNodeConnection(uri)) { + return data; + } else { + return null; + } + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Warning); + return null; + } +} diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index b06ec1f1d4..9ea295dd4e 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -14,7 +14,7 @@ class Mimblewimblecoin extends Bip39Currency { switch (network) { case CryptoCurrencyNetwork.main: _id = _idMain; - _name = "Mimblewimblecoin"; + _name = "MimbleWimbleCoin"; _ticker = "MWC"; default: throw Exception("Unsupported network: $network"); @@ -63,7 +63,7 @@ class Mimblewimblecoin extends Bip39Currency { } } - return mimblewimblecoin.LibMwc.validateSendAddress(address: address); + return mimblewimblecoin.Libmwc.validateSendAddress(address: address); } @override @@ -71,7 +71,7 @@ class Mimblewimblecoin extends Bip39Currency { switch (network) { case CryptoCurrencyNetwork.main: return NodeModel( - host: "http://epiccash.stackwallet.com", + host: "http://mwc713.mwc.mw", port: 3413, name: DefaultNodes.defaultName, id: DefaultNodes.buildId(this), diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index ed77e34bc7..9edce8a5a1 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -31,7 +31,8 @@ import '../../../utilities/amount/amount.dart'; import '../../../utilities/flutter_secure_storage_interface.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; -//import '../../../utilities/test_epic_box_connection.dart'; +import '../../../utilities/default_mwcmqs.dart'; +import '../../../utilities/test_mwcmqs_connection.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../models/tx_data.dart'; import '../intermediate/bip39_wallet.dart'; @@ -67,20 +68,20 @@ class MimblewimblecoinWallet extends Bip39Wallet { return restorePercent < 0 ? 0.0 : restorePercent; } - /*Future updateEpicboxConfig(String host, int port) async { + Future updateMwcmqsConfig(String host, int port) async { final String stringConfig = jsonEncode({ - "epicbox_domain": host, - "epicbox_port": port, - "epicbox_protocol_unsecure": false, - "epicbox_address_index": 0, + "mwcmqs_domain": host, + "mwcmqs_port": port, + "mwcmqs_protocol_unsecure": false, + "mwcmqs_address_index": 0, }); await secureStorageInterface.write( - key: '${walletId}_epicboxConfig', + key: '${walletId}_mwcmqsConfig', value: stringConfig, ); - // TODO: refresh anything that needs to be refreshed/updated due to epicbox info changed + // TODO: refresh anything that needs to be refreshed/updated due to mwcmqs info changed } - */ + /// returns an empty String on success, error message on failure Future cancelPendingTransactionAndPost(String txSlateId) async { try { @@ -88,7 +89,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_wallet', ))!; - final result = await mimblewimblecoin.LibMwc.cancelTransaction( + final result = await mimblewimblecoin.Libmwc.cancelTransaction( wallet: wallet, transactionId: txSlateId, ); @@ -108,24 +109,24 @@ class MimblewimblecoinWallet extends Bip39Wallet { DefaultMwcMqs.defaultMwcMqsServer, ); - //Get the default Epicbox server and check if it's conected - // bool isEpicboxConnected = await _testEpicboxServer( - // DefaultEpicBoxes.defaultEpicBoxServer.host, DefaultEpicBoxes.defaultEpicBoxServer.port ?? 443); + //Get the default mwcmqs server and check if it's conected + // bool ismwcmqsConnected = await _testmwcmqsServer( + // Defaultmwcmqses.defaultmwcmqsServer.host, Defaultmwcmqses.defaultmwcmqsServer.port ?? 443); - // if (isEpicboxConnected) { - //Use default server for as Epicbox config + // if (ismwcmqsConnected) { + //Use default server for as mwcmqs config // } // else { // //Use Europe config - // _epicBoxConfig = EpicBoxConfigModel.fromServer(DefaultEpicBoxes.europe); + // _mwcmqsConfig = mwcmqsConfigModel.fromServer(Defaultmwcmqses.europe); // } // // example of selecting another random server from the default list // // alternative servers: copy list of all default EB servers but remove the default default - // // List alternativeServers = DefaultEpicBoxes.all; - // // alternativeServers.removeWhere((opt) => opt.name == DefaultEpicBoxes.defaultEpicBoxServer.name); + // // List alternativeServers = Defaultmwcmqses.all; + // // alternativeServers.removeWhere((opt) => opt.name == Defaultmwcmqses.defaultmwcmqsServer.name); // // alternativeServers.shuffle(); // randomize which server is used - // // _epicBoxConfig = EpicBoxConfigModel.fromServer(alternativeServers.first); + // // _mwcmqsConfig = mwcmqsConfigModel.fromServer(alternativeServers.first); // // // TODO test this connection before returning it // } @@ -154,9 +155,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { config["check_node_api_http_addr"] = nodeApiAddress; config["chain"] = "mainnet"; config["account"] = "default"; - config["api_listen_port"] = port; - config["api_listen_interface"] = - nodeApiAddress.replaceFirst(uri.scheme, ""); final String stringConfig = jsonEncode(config); return stringConfig; } @@ -177,7 +175,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { try { final available = info.cachedBalance.spendable.raw.toInt(); - final transactionFees = await mimblewimblecoin.LibMwc.getTransactionFees( + final transactionFees = await mimblewimblecoin.Libmwc.getTransactionFees( wallet: wallet!, amount: satoshiAmount, minimumConfirmations: cryptoCurrency.minConfirms, @@ -206,7 +204,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (!syncMutex.isLocked) { await syncMutex.protect(() async { // How does getWalletBalances start syncing???? - await mimblewimblecoin.LibMwc.getWalletBalances( + await mimblewimblecoin.Libmwc.getWalletBalances( wallet: wallet!, refreshFromNode: refreshFromNode, minimumConfirmations: 10, @@ -226,16 +224,16 @@ class MimblewimblecoinWallet extends Bip39Wallet { })> _allWalletBalances() async { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); const refreshFromNode = 0; - return await mimblewimblecoin.LibMwc.getWalletBalances( + return await mimblewimblecoin.Libmwc.getWalletBalances( wallet: wallet!, refreshFromNode: refreshFromNode, minimumConfirmations: cryptoCurrency.minConfirms, ); } - /*Future _testEpicboxServer(EpicBoxConfigModel epicboxConfig) async { - final host = epicboxConfig.host; - final port = epicboxConfig.port ?? 443; + Future _testMwcmqsServer(MwcMqsConfigModel mwcmqsConfig) async { + final host = mwcmqsConfig.host; + final port = mwcmqsConfig.port ?? 443; WebSocketChannel? channel; try { final uri = Uri.parse('wss://$host:$port'); @@ -253,14 +251,14 @@ class MimblewimblecoinWallet extends Bip39Wallet { return response is String && response.contains("Challenge"); } catch (_) { Logging.instance.log( - "_testEpicBoxConnection failed on \"$host:$port\"", + "_testMwcmqsConnection failed on \"$host:$port\"", level: LogLevel.Info, ); return false; } finally { await channel?.sink.close(); } - }*/ + } Future _putSendToAddresses( ({String slateId, String commitId}) slateData, @@ -308,7 +306,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (address != null) { final splitted = address.value.split('@'); - //Check if the address is the same as the current epicbox domain + //Check if the address is the same as the current mwcmqs domain //Since we're only using one epicbpox now this doesn't apply but will be // useful in the future final mwcmqsConfig = await getMwcMqsConfig(); @@ -336,10 +334,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { ) async { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); - final walletAddress = await mimblewimblecoin.LibMwc.getAddressInfo( + final walletAddress = await mimblewimblecoin.Libmwc.getAddressInfo( wallet: wallet!, - index: index, - mwcmqsConfig: mwcmqsConfig.toString(), + index: index ); Logging.instance.log( @@ -363,7 +360,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Future _startScans() async { try { //First stop the current listener - mimblewimblecoin.LibMwc.stopMwcmqsListener(); + mimblewimblecoin.Libmwc.stopMwcMqsListener(); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); @@ -385,7 +382,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { level: LogLevel.Info, ); - final int nextScannedBlock = await mimblewimblecoin.LibMwc.scanOutputs( + final int nextScannedBlock = await mimblewimblecoin.Libmwc.scanOutputs( wallet: wallet!, startHeight: lastScannedBlock, numberOfBlocks: scanChunkSize, @@ -426,7 +423,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Logging.instance.log("STARTING WALLET LISTENER ....", level: LogLevel.Info); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); - mimblewimblecoin.LibMwc.startMwcMqsListener( + mimblewimblecoin.Libmwc.startMwcMqsListener( wallet: wallet!, mwcmqsConfig: mwcmqsConfig.toString(), ); @@ -509,7 +506,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String name = walletId; - await mimblewimblecoin.LibMwc.initializeNewWallet( + await mimblewimblecoin.Libmwc.initializeNewWallet( config: stringConfig, mnemonic: mnemonicString, password: password, @@ -517,7 +514,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); //Open wallet - encodedWallet = await mimblewimblecoin.LibMwc.openWallet( + encodedWallet = await mimblewimblecoin.Libmwc.openWallet( config: stringConfig, password: password, ); @@ -559,7 +556,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final password = await secureStorageInterface.read(key: '${walletId}_password'); - final walletOpen = await mimblewimblecoin.LibMwc.openWallet( + final walletOpen = await mimblewimblecoin.Libmwc.openWallet( config: config, password: password!, ); @@ -608,7 +605,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (receiverAddress.startsWith("http://") || receiverAddress.startsWith("https://")) { - transaction = await mimblewimblecoin.LibMwc.txHttpSend( + transaction = await mimblewimblecoin.Libmwc.txHttpSend( wallet: wallet!, selectionStrategyIsAll: 0, minimumConfirmations: cryptoCurrency.minConfirms, @@ -617,12 +614,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { address: txData.recipients!.first.address, ); } else { - transaction = await mimblewimblecoin.LibMwc.createTransaction( + transaction = await mimblewimblecoin.Libmwc.createTransaction( wallet: wallet!, amount: txData.recipients!.first.amount.raw.toInt(), address: txData.recipients!.first.address, secretKeyIndex: 0, - mwcmqsConfig: mwsmqsConfig.toString(), + mwcmqsConfig: mwcmqsConfig.toString(), minimumConfirmations: cryptoCurrency.minConfirms, note: txData.noteOnChain!, ); @@ -724,7 +721,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { value: mwcmqsConfig.toString(), ); - await mimblewimblecoin.LibMwc.recoverWallet( + await mimblewimblecoin.Libmwc.recoverWallet( config: stringConfig, password: password, mnemonic: await getMnemonic(), @@ -748,7 +745,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); //Open Wallet - final walletOpen = await mimblewimblecoin.LibMwc.openWallet( + final walletOpen = await mimblewimblecoin.Libmwc.openWallet( config: stringConfig, password: password, ); @@ -943,7 +940,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { .findAll(); final myAddressesSet = myAddresses.toSet(); - final transactions = await mimblewimblecoin.LibMwc.getTransactions( + final transactions = await mimblewimblecoin.Libmwc.getTransactions( wallet: wallet!, refreshFromNode: refreshFromNode, ); @@ -1095,7 +1092,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { // force unwrap optional as we want connection test to fail if wallet // wasn't initialized or mwcmqs node was set to null - return await testMimblewimblecoinNodeConnection( + return await testMwcNodeConnection( NodeFormData() ..host = node!.host ..useSSL = node.useSSL @@ -1112,7 +1109,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Future updateChainHeight() async { final config = await _getRealConfig(); final latestHeight = - await mimblewimblecoin.LibMwc.getChainHeight(config: config); + await mimblewimblecoin.Libmwc.getChainHeight(config: config); await info.updateCachedChainHeight( newHeight: latestHeight, isar: mainDB.isar, @@ -1185,7 +1182,7 @@ Future deleteMimblewimblecoinWallet({ return "Tried to delete non existent mimblewimblecoin wallet file with walletId=$walletId"; } else { try { - return mimblewimblecoin.LibMwc.deleteWallet( + return mimblewimblecoin.Libmwc.deleteWallet( wallet: wallet, config: config!, ); diff --git a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart index 724657079e..0c876d5c57 100644 --- a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart +++ b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart @@ -5,7 +5,7 @@ import '../../../utilities/logger.dart'; import '../../isar/models/wallet_info.dart'; extension MimblewimblecoinWalletInfoExtension on WalletInfo { - ExtraMimblewimblecoinWalletInfo? get epicData { + ExtraMimblewimblecoinWalletInfo? get mimblewimblecoinData { final String? data = otherData[WalletInfoKeys.mimblewimblecoinData] as String?; if (data == null) { @@ -27,12 +27,12 @@ extension MimblewimblecoinWalletInfoExtension on WalletInfo { } Future updateExtraMimblewimblecoinWalletInfo({ - required ExtraMimblewimblecoinWalletInfo epicData, + required ExtraMimblewimblecoinWalletInfo mimblewimblecoinData, required Isar isar, }) async { await updateOtherData( newEntries: { - WalletInfoKeys.mimblewimblecoinData: jsonEncode(epicData.toMap()), + WalletInfoKeys.mimblewimblecoinData: jsonEncode(mimblewimblecoinData.toMap()), }, isar: isar, ); diff --git a/lib/wallets/wallet/wallet.dart b/lib/wallets/wallet/wallet.dart index 1372d0f3c0..3a4ccd3d34 100644 --- a/lib/wallets/wallet/wallet.dart +++ b/lib/wallets/wallet/wallet.dart @@ -360,7 +360,7 @@ abstract class Wallet { return EpiccashWallet(net); case const (Mimblewimblecoin): - return Mimblewimblecoin(net); + return MimblewimblecoinWallet(net); case const (Ethereum): return EthereumWallet(net); diff --git a/pubspec.lock b/pubspec.lock index 48728fb53c..1346803686 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -957,7 +957,7 @@ packages: source: hosted version: "2.4.4" frontend_server_client: - dependency: transitive + dependency: "direct dev" description: name: frontend_server_client sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 diff --git a/scripts/app_config/templates/linux/CMakeLists.txt b/scripts/app_config/templates/linux/CMakeLists.txt index d6ac3f66d3..3707ec1b4e 100644 --- a/scripts/app_config/templates/linux/CMakeLists.txt +++ b/scripts/app_config/templates/linux/CMakeLists.txt @@ -137,7 +137,7 @@ install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libepic_cash_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libemwc/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmwc/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/linux/build/libmobileliblelantus.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" diff --git a/scripts/linux/build_secp256k1.sh b/scripts/linux/build_secp256k1.sh index f00b6b82bf..cf7650ffe1 100755 --- a/scripts/linux/build_secp256k1.sh +++ b/scripts/linux/build_secp256k1.sh @@ -10,5 +10,5 @@ mkdir -p build && cd build cmake .. cmake --build . mkdir -p ../../../../../build -cp lib/libsecp256k1.so.2.2.2 "../../../../../build/libsecp256k1.so" +cp lib/libsecp256k1.so.2.*.* "../../../../../build/libsecp256k1.so" cd ../../../ diff --git a/test/cached_electrumx_test.mocks.dart b/test/cached_electrumx_test.mocks.dart index 993f73f694..e37380e0b1 100644 --- a/test/cached_electrumx_test.mocks.dart +++ b/test/cached_electrumx_test.mocks.dart @@ -1113,6 +1113,19 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index fee6a0d7f5..c20fd4e293 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -1129,6 +1129,19 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/screen_tests/exchange/exchange_view_test.mocks.dart b/test/screen_tests/exchange/exchange_view_test.mocks.dart index b7a8d49d51..3f04c3fc27 100644 --- a/test/screen_tests/exchange/exchange_view_test.mocks.dart +++ b/test/screen_tests/exchange/exchange_view_test.mocks.dart @@ -558,6 +558,19 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index c2bc00d2c0..ee2de45f91 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -834,6 +834,19 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/widget_tests/node_options_sheet_test.mocks.dart b/test/widget_tests/node_options_sheet_test.mocks.dart index 5e878015ff..26f7b6cf34 100644 --- a/test/widget_tests/node_options_sheet_test.mocks.dart +++ b/test/widget_tests/node_options_sheet_test.mocks.dart @@ -709,6 +709,19 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index a5816bdcbb..d9234ff9bf 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -818,6 +818,19 @@ class MockPrefs extends _i1.Mock implements _i14.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, From 68a6769a239fba117f9ee80c265b24455c7b8639 Mon Sep 17 00:00:00 2001 From: vekamo Date: Sun, 27 Oct 2024 17:07:52 +0400 Subject: [PATCH 003/178] disable PingCheck --- crypto_plugins/flutter_libmwc | 2 +- lib/utilities/default_mwcmqs.dart | 6 +-- .../wallet/impl/mimblewimblecoin_wallet.dart | 43 ++++++++++--------- pubspec.lock | 2 +- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index ff25b65406..19764f5c8a 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit ff25b6540698e6fe3e89dda5f0480552a882369d +Subproject commit 19764f5c8adbf93567962ea94e9ff146205aaf45 diff --git a/lib/utilities/default_mwcmqs.dart b/lib/utilities/default_mwcmqs.dart index 75be1d247b..84e7356d84 100644 --- a/lib/utilities/default_mwcmqs.dart +++ b/lib/utilities/default_mwcmqs.dart @@ -17,7 +17,7 @@ abstract class DefaultMwcMqs { static List get defaultIds => ['americas', 'asia', 'europe']; static MwcMqsServerModel get americas => MwcMqsServerModel( - host: 'MwcMqs.stackwallet.com', + host: 'mqs.mwc.mw', port: 443, name: 'Americas', id: 'americas', @@ -28,7 +28,7 @@ abstract class DefaultMwcMqs { ); static MwcMqsServerModel get asia => MwcMqsServerModel( - host: 'MwcMqs.hyperbig.com', + host: 'mqs.mwc.mw', port: 443, name: 'Asia', id: 'asia', @@ -39,7 +39,7 @@ abstract class DefaultMwcMqs { ); static MwcMqsServerModel get europe => MwcMqsServerModel( - host: 'MwcMqs.fastepic.eu', + host: 'mqs.mwc.mw', port: 443, name: 'Europe', id: 'europe', diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 9edce8a5a1..83d038e9dd 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -524,7 +524,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); //Store MwcMqs address info - await _generateAndStoreReceivingAddressForIndex(0); + // await _generateAndStoreReceivingAddressForIndex(0); // subtract a couple days to ensure we have a buffer for SWB final bufferedCreateHeight = _calculateRestoreHeightFrom( @@ -754,9 +754,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { value: walletOpen, ); - await _generateAndStoreReceivingAddressForIndex( - mimblewimblecoinData.receivingIndex, - ); + // await _generateAndStoreReceivingAddressForIndex( + // mimblewimblecoinData.receivingIndex, + // ); } }); @@ -799,7 +799,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { // this will always be zero???? final int curAdd = await _getCurrentIndex(); - await _generateAndStoreReceivingAddressForIndex(curAdd); + // await _generateAndStoreReceivingAddressForIndex(curAdd); await _startScans(); @@ -1087,22 +1087,23 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future pingCheck() async { - try { - final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); - - // force unwrap optional as we want connection test to fail if wallet - // wasn't initialized or mwcmqs node was set to null - return await testMwcNodeConnection( - NodeFormData() - ..host = node!.host - ..useSSL = node.useSSL - ..port = node.port, - ) != - null; - } catch (e, s) { - Logging.instance.log("$e\n$s", level: LogLevel.Info); - return false; - } + return true; + //try { + // final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); +// + // // force unwrap optional as we want connection test to fail if wallet + // // wasn't initialized or mwcmqs node was set to null + // return await testMwcNodeConnection( + // NodeFormData() + // ..host = node!.host + // ..useSSL = node.useSSL + // ..port = node.port, + // ) != + // null; + //} catch (e, s) { + // Logging.instance.log("$e\n$s", level: LogLevel.Info); + // return false; + //} } @override diff --git a/pubspec.lock b/pubspec.lock index 1346803686..48728fb53c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -957,7 +957,7 @@ packages: source: hosted version: "2.4.4" frontend_server_client: - dependency: "direct dev" + dependency: transitive description: name: frontend_server_client sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 From 753710561f544cfc2f2408afd89de3c8acbe6699 Mon Sep 17 00:00:00 2001 From: vekamo Date: Tue, 12 Nov 2024 22:00:58 +0400 Subject: [PATCH 004/178] few fixes and remove mwc-wallet logs --- crypto_plugins/flutter_libmwc | 2 +- .../transaction_details_view.dart | 58 ++++++++++- .../tx_v2/transaction_v2_details_view.dart | 16 +-- lib/utilities/test_mwcmqs_connection.dart | 16 ++- lib/utilities/test_node_connection.dart | 14 +++ .../coins/mimblewimblecoin.dart | 41 ++++---- .../wallet/impl/mimblewimblecoin_wallet.dart | 99 +++++++++---------- 7 files changed, 149 insertions(+), 97 deletions(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 19764f5c8a..fe78fd4528 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 19764f5c8adbf93567962ea94e9ff146205aaf45 +Subproject commit fe78fd45284f99f26a40bba15e8d1a53c718be1a 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 1071ffdaec..777f2b75ee 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -15,6 +15,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:stackwallet/wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import 'package:tuple/tuple.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -1730,7 +1731,7 @@ class _TransactionDetailsViewState ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: (coin is Epiccash && + floatingActionButton: ((coin is Epiccash || coin is Mimblewimblecoin) && _transaction.getConfirmations(currentHeight) < 1 && _transaction.isCancelled == false) ? ConditionalParent( @@ -1775,6 +1776,59 @@ class _TransactionDetailsViewState ), ); + final result = + await wallet.cancelPendingTransactionAndPost(id); + if (mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + wallet.refresh(); + Navigator.of(context).popUntil( + ModalRoute.withName( + WalletView.routeName, + ), + ); + }, + ), + ); + } else { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + ), + ); + } + } + } else if (wallet is MimblewimblecoinWallet) { + final String? id = _transaction.slateId; + if (id == null) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Could not find MWC transaction ID", + context: context, + ), + ); + return; + } + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: (_) => + const CancellingTransactionProgressDialog(), + ), + ); + final result = await wallet.cancelPendingTransactionAndPost(id); if (mounted) { @@ -1810,7 +1864,7 @@ class _TransactionDetailsViewState unawaited( showFloatingFlushBar( type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash", + message: "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", context: context, ), ); diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index 03316599f6..737b5e6605 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -2112,18 +2112,7 @@ class _TransactionV2DetailsViewState ); } } - } else { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash", - context: context, - ), - ); - return; - } - - if (wallet is MimblewimblecoinWallet) { + } else if (wallet is MimblewimblecoinWallet) { final String? id = _transaction.slateId; if (id == null) { unawaited( @@ -2181,8 +2170,7 @@ class _TransactionV2DetailsViewState unawaited( showFloatingFlushBar( type: FlushBarType.warning, - message: - "ERROR: Wallet type is not Mimblewimblecoin", + message: "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", context: context, ), ); diff --git a/lib/utilities/test_mwcmqs_connection.dart b/lib/utilities/test_mwcmqs_connection.dart index 44433a1036..cfcd4a098f 100644 --- a/lib/utilities/test_mwcmqs_connection.dart +++ b/lib/utilities/test_mwcmqs_connection.dart @@ -18,11 +18,21 @@ import 'prefs.dart'; Future _testMwcMqsNodeConnection(Uri uri) async { final HTTP client = HTTP(); - try { + try { + final headers = { + 'Content-Type': 'application/json', + }; + + if (uri.toString() == 'https://mwc713.mwc.mw/v1/version') { + const username = 'mwcmain'; + const password = '11ne3EAUtOXVKwhxm84U'; + final credentials = base64Encode(utf8.encode('$username:$password')); + headers['Authorization'] = 'Basic $credentials'; + } final response = await client .get( url: uri, - headers: {'Content-Type': 'application/json'}, + headers: headers, proxyInfo: Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, @@ -67,7 +77,7 @@ Future testMwcNodeConnection(NodeFormData data) async { Uri uri = Uri.parse(data.host! + path_postfix); uri = uri.replace(port: data.port); - + try { if (await _testMwcMqsNodeConnection(uri)) { return data; diff --git a/lib/utilities/test_node_connection.dart b/lib/utilities/test_node_connection.dart index c83bf39e19..a66352453c 100644 --- a/lib/utilities/test_node_connection.dart +++ b/lib/utilities/test_node_connection.dart @@ -22,6 +22,7 @@ import '../wallets/wallet/impl/solana_wallet.dart'; import 'connection_check/electrum_connection_check.dart'; import 'logger.dart'; import 'test_epic_box_connection.dart'; +import 'test_mwcmqs_connection.dart'; import 'test_eth_node_connection.dart'; import 'test_monero_node_connection.dart'; import 'test_stellar_node_connection.dart'; @@ -108,6 +109,19 @@ Future testNodeConnection({ } break; + case Mimblewimblecoin(): + try { + final data = await testMwcNodeConnection(formData); + + if (data != null) { + testPassed = true; + onSuccess?.call(data); + } + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Warning); + } + break; + case CryptonoteCurrency(): try { final proxyInfo = ref diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index 9ea295dd4e..3127ef035b 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -50,36 +50,33 @@ class Mimblewimblecoin extends Bip39Currency { // change this to change the number of confirms a tx needs in order to show as confirmed int get minConfirms => 3; - @override - bool validateAddress(String address) { - // Invalid address that contains HTTP and mwcmqs domain - if ((address.startsWith("http://") || address.startsWith("https://")) && - address.contains("@")) { - return false; - } - if (address.startsWith("http://") || address.startsWith("https://")) { - if (Uri.tryParse(address) != null) { - return true; - } - } - - return mimblewimblecoin.Libmwc.validateSendAddress(address: address); + @override +bool validateAddress(String address) { + Uri? uri = Uri.tryParse(address); + if (uri != null && + (uri.scheme == "http" || uri.scheme == "https" || uri.scheme == "mwcmqs") && + uri.host.isNotEmpty && + !uri.host.endsWith(".onion")) { + return true; } + return mimblewimblecoin.Libmwc.validateSendAddress(address: address); +} + @override NodeModel get defaultNode { switch (network) { case CryptoCurrencyNetwork.main: return NodeModel( - host: "http://mwc713.mwc.mw", - port: 3413, + host: "https://mwc713.mwc.mw", + port: 443, name: DefaultNodes.defaultName, id: DefaultNodes.buildId(this), - useSSL: false, + useSSL: true, enabled: true, coinName: identifier, isFailover: true, - isDown: false, + isDown: false ); default: @@ -88,10 +85,10 @@ class Mimblewimblecoin extends Bip39Currency { } @override - int get defaultSeedPhraseLength => 24; + int get defaultSeedPhraseLength => 12; @override - int get fractionDigits => 8; + int get fractionDigits => 9; @override bool get hasBuySupport => false; @@ -100,13 +97,13 @@ class Mimblewimblecoin extends Bip39Currency { bool get hasMnemonicPassphraseSupport => false; @override - List get possibleMnemonicLengths => [defaultSeedPhraseLength, 12]; + List get possibleMnemonicLengths => [defaultSeedPhraseLength, 24]; @override AddressType get defaultAddressType => AddressType.mimbleWimble; @override - BigInt get satsPerCoin => BigInt.from(100000000); + BigInt get satsPerCoin => BigInt.from(1000000000); @override int get targetBlockTimeSeconds => 60; diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 83d038e9dd..5ce8a6b0ea 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -38,6 +38,7 @@ import '../../models/tx_data.dart'; import '../intermediate/bip39_wallet.dart'; import '../supporting/mimblewimblecoin_wallet_info_extension.dart'; + // // refactor of https://github.com/cypherstack/stack_wallet/blob/1d9fb4cd069f22492ece690ac788e05b8f8b1209/lib/services/coins/epiccash/epiccash_wallet.dart // @@ -48,7 +49,8 @@ class MimblewimblecoinWallet extends Bip39Wallet { final syncMutex = Mutex(); NodeModel? _mimblewimblecoinNode; Timer? timer; - + bool _logsInitialized = false; + double highestPercent = 0; Future get getSyncPercent async { final int lastScannedBlock = @@ -147,7 +149,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { final uri = Uri.parse(nodeAddress).replace(port: port); final String nodeApiAddress = uri.toString(); - final walletDir = await _currentWalletDirPath(); final Map config = {}; @@ -174,7 +175,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); try { final available = info.cachedBalance.spendable.raw.toInt(); - final transactionFees = await mimblewimblecoin.Libmwc.getTransactionFees( wallet: wallet!, amount: satoshiAmount, @@ -304,17 +304,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ) async { Address? address = await getCurrentReceivingAddress(); - if (address != null) { - final splitted = address.value.split('@'); - //Check if the address is the same as the current mwcmqs domain - //Since we're only using one epicbpox now this doesn't apply but will be - // useful in the future - final mwcmqsConfig = await getMwcMqsConfig(); - if (splitted[1] != mwcmqsConfig.host) { - //Update the address - address = await thisWalletAddress(index, mwcmqsConfig); - } - } else { + if (address == null) { final mwcmqsConfig = await getMwcMqsConfig(); address = await thisWalletAddress(index, mwcmqsConfig); } @@ -478,6 +468,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future init({bool? isRestore}) async { + if (isRestore != true) { String? encodedWallet = await secureStorageInterface.read(key: "${walletId}_wallet"); @@ -490,7 +481,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String password = generatePassword(); final String stringConfig = await _getConfig(); final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); - + //if (!_logsInitialized) { + // await mimblewimblecoin.Libmwc.initLogs(config: stringConfig); + // _logsInitialized = true; // Set flag to true after initializing + // } await secureStorageInterface.write( key: '${walletId}_config', value: stringConfig, @@ -522,9 +516,8 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_wallet', value: encodedWallet, ); - //Store MwcMqs address info - // await _generateAndStoreReceivingAddressForIndex(0); + await _generateAndStoreReceivingAddressForIndex(0); // subtract a couple days to ensure we have a buffer for SWB final bufferedCreateHeight = _calculateRestoreHeightFrom( @@ -547,12 +540,11 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); } else { try { - Logging.instance.log( - "initializeExisting() ${cryptoCurrency.prettyName} wallet", - level: LogLevel.Info, - ); - final config = await _getRealConfig(); + //if (!_logsInitialized) { + // await mimblewimblecoin.Libmwc.initLogs(config: config); + // _logsInitialized = true; // Set flag to true after initializing + //} final password = await secureStorageInterface.read(key: '${walletId}_password'); @@ -590,21 +582,22 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String receiverAddress = txData.recipients!.first.address; - if (!receiverAddress.startsWith("http://") || - !receiverAddress.startsWith("https://")) { - final bool isMwcmqsConnected = await _testMwcmqsServer( - mwcmqsConfig, - ); - if (!isMwcmqsConnected) { - throw Exception( - "Failed to send TX : Unable to reach mimblewimblecoin server"); - } - } + //if (!receiverAddress.startsWith("http://") || + // !receiverAddress.startsWith("https://")) { + // final bool isMwcmqsConnected = await _testMwcmqsServer( + // mwcmqsConfig, + // ); + // if (!isMwcmqsConnected) { + // throw Exception( + // "Failed to send TX : Unable to reach mimblewimblecoin server"); + // } + //} ({String commitId, String slateId}) transaction; if (receiverAddress.startsWith("http://") || - receiverAddress.startsWith("https://")) { + receiverAddress.startsWith("https://") || + receiverAddress.startsWith("mwcmqcs://")) { transaction = await mimblewimblecoin.Libmwc.txHttpSend( wallet: wallet!, selectionStrategyIsAll: 0, @@ -753,10 +746,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_wallet', value: walletOpen, ); - - // await _generateAndStoreReceivingAddressForIndex( - // mimblewimblecoinData.receivingIndex, - // ); + + await _generateAndStoreReceivingAddressForIndex( + mimblewimblecoinData.receivingIndex, + ); } }); @@ -799,7 +792,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { // this will always be zero???? final int curAdd = await _getCurrentIndex(); - // await _generateAndStoreReceivingAddressForIndex(curAdd); + await _generateAndStoreReceivingAddressForIndex(curAdd); await _startScans(); @@ -1087,23 +1080,19 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future pingCheck() async { - return true; - //try { - // final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); -// - // // force unwrap optional as we want connection test to fail if wallet - // // wasn't initialized or mwcmqs node was set to null - // return await testMwcNodeConnection( - // NodeFormData() - // ..host = node!.host - // ..useSSL = node.useSSL - // ..port = node.port, - // ) != - // null; - //} catch (e, s) { - // Logging.instance.log("$e\n$s", level: LogLevel.Info); - // return false; - //} + try { + final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); + return await testMwcNodeConnection( + NodeFormData() + ..host = node!.host + ..useSSL = node.useSSL + ..port = node.port, + ) != + null; + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Info); + return false; + } } @override From 0accfffbab5a1eede900096329a196110a288a9d Mon Sep 17 00:00:00 2001 From: vekamo Date: Sun, 17 Nov 2024 14:59:54 +0400 Subject: [PATCH 005/178] last fixes mwc and clean up --- crypto_plugins/flutter_libmwc | 2 +- lib/models/mwcmqs_config_model.dart | 35 ++----------------- .../type_adaptors/mwcmqs_config_model.g.dart | 10 ++---- .../restore_options_view.dart | 12 +++---- .../restore_view_only_wallet_view.dart | 5 +++ .../restore_wallet_view.dart | 2 +- .../add_edit_node_view.dart | 8 ----- .../wallet_settings_view.dart | 1 - .../wallet/impl/mimblewimblecoin_wallet.dart | 19 +++++----- 9 files changed, 27 insertions(+), 67 deletions(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index fe78fd4528..2008080fd8 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit fe78fd45284f99f26a40bba15e8d1a53c718be1a +Subproject commit 2008080fd8e3a68081f4ca1334c2568421539157 diff --git a/lib/models/mwcmqs_config_model.dart b/lib/models/mwcmqs_config_model.dart index 6970905106..067d1a8ee5 100644 --- a/lib/models/mwcmqs_config_model.dart +++ b/lib/models/mwcmqs_config_model.dart @@ -22,30 +22,19 @@ class MwcMqsConfigModel { final String host; @HiveField(2) final int? port; - @HiveField(3) - final bool? protocolInsecure; - @HiveField(4) - final int? addressIndex; MwcMqsConfigModel({ required this.host, - this.port, - this.protocolInsecure, - this.addressIndex, + this.port }); MwcMqsConfigModel copyWith({ int? port, bool? protocolInsecure, - int? addressIndex, - String? id, - String? name, }) { return MwcMqsConfigModel( host: host, port: this.port ?? 443, - protocolInsecure: this.protocolInsecure ?? false, - addressIndex: this.addressIndex ?? 0, ); } @@ -53,8 +42,6 @@ class MwcMqsConfigModel { final Map map = {}; map['mwcmqs_domain'] = host; map['mwcmqs_port'] = port; - map['mwcmqs_protocol_insecure'] = protocolInsecure; - map['mwcmqs_address_index'] = addressIndex; return map; } @@ -62,8 +49,6 @@ class MwcMqsConfigModel { return { 'mwcmqs_domain': host, 'mwcmqs_port': port, - 'mwcmqs_protocol_insecure': protocolInsecure, - 'mwcmqs_address_index': addressIndex, }; } @@ -83,23 +68,11 @@ class MwcMqsConfigModel { if (oldPort != "empty") { _mwcmqs['mwcmqs_port'] = _mwcmqs['port']; } - final oldProtocolInsecure = _mwcmqs["protocol_insecure"] ?? "empty"; - if (oldProtocolInsecure != "empty") { - _mwcmqs['mwcmqs_protocol_insecure'] = _mwcmqs['protocol_insecure']; - } - final oldAddressIndex = _mwcmqs["address_index"] ?? "empty"; - if (oldAddressIndex != "empty") { - _mwcmqs['mwcmqs_address_index'] = _mwcmqs['address_index']; - } - _mwcmqs['mwcmqs_protocol_insecure'] ??= false; - _mwcmqs['mwcmqs_address_index'] ??= 0; return MwcMqsConfigModel( host: _mwcmqs['mwcmqs_domain'] as String, - port: _mwcmqs['mwcmqs_port'] as int, - protocolInsecure: _mwcmqs['mwcmqs_protocol_insecure'] as bool, - addressIndex: _mwcmqs['mwcmqs_address_index'] as int, + port: _mwcmqs['mwcmqs_port'] as int ); } @@ -110,9 +83,7 @@ class MwcMqsConfigModel { }) { return MwcMqsConfigModel( host: server.host, - port: server.port ?? 443, - protocolInsecure: protocolInsecure ?? false, - addressIndex: addressIndex ?? 0, + port: server.port ?? 443 ); } } diff --git a/lib/models/type_adaptors/mwcmqs_config_model.g.dart b/lib/models/type_adaptors/mwcmqs_config_model.g.dart index e64fc54082..f66fbdb56b 100644 --- a/lib/models/type_adaptors/mwcmqs_config_model.g.dart +++ b/lib/models/type_adaptors/mwcmqs_config_model.g.dart @@ -19,23 +19,17 @@ class MwcMqsConfigModelAdapter extends TypeAdapter { return MwcMqsConfigModel( host: fields[1] as String, port: fields[2] as int?, - protocolInsecure: fields[3] as bool?, - addressIndex: fields[4] as int?, ); } @override void write(BinaryWriter writer, MwcMqsConfigModel obj) { writer - ..writeByte(4) + ..writeByte(2) ..writeByte(1) ..write(obj.host) ..writeByte(2) - ..write(obj.port) - ..writeByte(3) - ..write(obj.protocolInsecure) - ..writeByte(4) - ..write(obj.addressIndex); + ..write(obj.port); } @override 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 9d2ac8c1d0..f95440e8d7 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 @@ -361,7 +361,7 @@ class _SeedRestoreOptionState extends ConsumerState { return Column( children: [ - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) Text( "Choose start date", style: Util.isDesktop @@ -372,20 +372,20 @@ class _SeedRestoreOptionState extends ConsumerState { : STextStyles.smallMed12(context), textAlign: TextAlign.left, ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) SizedBox( height: Util.isDesktop ? 16 : 8, ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) RestoreFromDatePicker( onTap: widget.dateChooserFunction, controller: widget.dateController, ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) const SizedBox( height: 8, ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) RoundedWhiteContainer( child: Center( child: Text( @@ -402,7 +402,7 @@ class _SeedRestoreOptionState extends ConsumerState { ), ), ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) SizedBox( height: Util.isDesktop ? 24 : 16, ), diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_view_only_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_view_only_wallet_view.dart index 5f2bd08b06..8878b305c2 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_view_only_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_view_only_wallet_view.dart @@ -21,6 +21,7 @@ import '../../../utilities/util.dart'; import '../../../wallets/crypto_currency/crypto_currency.dart'; import '../../../wallets/isar/models/wallet_info.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../wallets/wallet/impl/wownero_wallet.dart'; import '../../../wallets/wallet/wallet.dart'; @@ -196,6 +197,10 @@ class _RestoreViewOnlyWalletViewState case const (EpiccashWallet): await (wallet as EpiccashWallet).init(isRestore: true); break; + + case const (MimblewimblecoinWallet): + await (wallet as MimblewimblecoinWallet).init(isRestore: true); + break; case const (MoneroWallet): await (wallet as MoneroWallet).init(isRestore: true); 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 e56694fed0..9c9f4ec7e0 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 @@ -270,7 +270,7 @@ class _RestoreWalletViewState extends ConsumerState { }, ); } else if (widget.coin is Mimblewimblecoin) { - final int secondsSinceEpoch = widget.restoreFromDate.millisecondsSinceEpoch ~/ 1000; + final int secondsSinceEpoch = widget.restoreFromDate!.millisecondsSinceEpoch ~/ 1000; const int mimblewimblecoinFirstBlock = 1573462801; const double overestimateSecondsPerBlock = 61; final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; 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 e9b15cc307..7b5f4f25ef 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 @@ -869,14 +869,6 @@ class _NodeFormState extends ConsumerState { } else { enableSSLCheckbox = true; } - } else if (widget.coin is CwBasedInterface) { - if (newValue.startsWith("https://")) { - _useSSL = true; - } else if (newValue.startsWith("http://")) { - _useSSL = false; - } else { - _useSSL = true; - } } _updateState(); setState(() {}); 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 e8a485be87..7fcfa9be9b 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 @@ -39,7 +39,6 @@ import '../../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; import '../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; -import '../../../wallets/wallet/wallet_mixin_interfaces/cw_based_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 5ce8a6b0ea..31339e2fcb 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -39,9 +39,6 @@ import '../intermediate/bip39_wallet.dart'; import '../supporting/mimblewimblecoin_wallet_info_extension.dart'; -// -// refactor of https://github.com/cypherstack/stack_wallet/blob/1d9fb4cd069f22492ece690ac788e05b8f8b1209/lib/services/coins/epiccash/epiccash_wallet.dart -// class MimblewimblecoinWallet extends Bip39Wallet { MimblewimblecoinWallet(CryptoCurrencyNetwork network) : super(Mimblewimblecoin(network)); @@ -73,9 +70,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Future updateMwcmqsConfig(String host, int port) async { final String stringConfig = jsonEncode({ "mwcmqs_domain": host, - "mwcmqs_port": port, - "mwcmqs_protocol_unsecure": false, - "mwcmqs_address_index": 0, + "mwcmqs_port": port }); await secureStorageInterface.write( key: '${walletId}_mwcmqsConfig', @@ -434,7 +429,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { return config!; } - // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index int _calculateRestoreHeightFrom({required DateTime date}) { final int secondsSinceEpoch = date.millisecondsSinceEpoch ~/ 1000; const int mimblewimblecoinFirstBlock = 1565370278; @@ -596,8 +590,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ({String commitId, String slateId}) transaction; if (receiverAddress.startsWith("http://") || - receiverAddress.startsWith("https://") || - receiverAddress.startsWith("mwcmqcs://")) { + receiverAddress.startsWith("https://")) { transaction = await mimblewimblecoin.Libmwc.txHttpSend( wallet: wallet!, selectionStrategyIsAll: 0, @@ -606,7 +599,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { amount: txData.recipients!.first.amount.raw.toInt(), address: txData.recipients!.first.address, ); - } else { + } else if (receiverAddress.startsWith("mwcmqs://")) { transaction = await mimblewimblecoin.Libmwc.createTransaction( wallet: wallet!, amount: txData.recipients!.first.amount.raw.toInt(), @@ -616,6 +609,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { minimumConfirmations: cryptoCurrency.minConfirms, note: txData.noteOnChain!, ); + + } else { + throw Exception( + "Unsupported address format: $receiverAddress. Please use a valid address.", + ); + } final Map txAddressInfo = {}; From 356c640d82a069a4a157e226157c19cf2289977d Mon Sep 17 00:00:00 2001 From: vekamo Date: Sat, 26 Oct 2024 16:31:05 +0400 Subject: [PATCH 006/178] init mwc --- .gitmodules | 3 + README.md | 1 + crypto_plugins/flutter_libmwc | 1 + lib/db/db_version_migration.dart | 75 +- lib/db/migrate_wallets_to_isar.dart | 16 + .../blockchain_data/v2/transaction_v2.dart | 37 + lib/models/isar/stack_theme.dart | 9 + .../restore_wallet_view.dart | 27 +- .../send_view/confirm_transaction_view.dart | 24 +- lib/pages/send_view/send_view.dart | 44 +- .../global_settings_view/about_view.dart | 48 + .../advanced_views/debug_view.dart | 6 + .../add_edit_node_view.dart | 40 +- .../helpers/restore_create_backup.dart | 7 +- .../wallet_network_settings_view.dart | 34 +- .../wallet_settings_view.dart | 103 ++ .../all_transactions_view.dart | 17 + .../tx_v2/transaction_v2_details_view.dart | 131 +- .../wallet_view/sub_widgets/desktop_send.dart | 64 +- .../delete_password_warning_view.dart | 12 + .../settings_menu/desktop_about_view.dart | 171 ++- lib/services/price.dart | 1 + lib/services/wallets.dart | 10 + lib/themes/coin_icon_provider.dart | 2 + lib/utilities/address_utils.dart | 25 + lib/utilities/amount/amount_unit.dart | 1 + lib/utilities/assets.dart | 1 + lib/utilities/default_mwcmqs.dart | 53 + lib/utilities/git_status.dart | 74 +- .../coins/mimblewimblecoin.dart | 128 ++ .../crypto_currency/crypto_currency.dart | 3 +- lib/wallets/isar/models/wallet_info.dart | 1 + .../wallet/impl/mimblewimblecoin_wallet.dart | 1197 +++++++++++++++++ ...imblewimblecoin_wallet_info_extension.dart | 111 ++ lib/wallets/wallet/wallet.dart | 4 + .../tor_has_been_add_dialog.dart | 2 +- lib/widgets/transaction_card.dart | 19 + linux/flutter/generated_plugin_registrant.cc | 5 +- linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 7 + scripts/app_config/configure_stack_wallet.sh | 1 + .../app_config/templates/linux/CMakeLists.txt | 5 +- scripts/app_config/templates/pubspec.template | 3 + .../templates/windows/CMakeLists.txt | 3 + scripts/ios/build_all.sh | 2 + scripts/ios/build_all_campfire.sh | 2 + scripts/ios/build_all_duo.sh | 2 + scripts/linux/build_all.sh | 2 + scripts/linux/build_all_campfire.sh | 2 + scripts/linux/build_all_duo.sh | 2 + scripts/macos/build_all.sh | 2 + scripts/macos/build_all_campfire.sh | 2 + scripts/macos/build_all_duo.sh | 2 + scripts/rust_version.sh | 9 + scripts/windows/build_all.sh | 2 + scripts/windows/build_all_campfire.sh | 2 + scripts/windows/build_all_duo.sh | 2 + scripts/windows/deps.sh | 8 +- test/price_test.dart | 2 + test/sample_data/theme_json.dart | 4 + test/sample_data/theme_json_v2.dart | 4 + test/services/node_service_test.dart | 13 + .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 65 files changed, 2466 insertions(+), 131 deletions(-) create mode 160000 crypto_plugins/flutter_libmwc create mode 100644 lib/utilities/default_mwcmqs.dart create mode 100644 lib/wallets/crypto_currency/coins/mimblewimblecoin.dart create mode 100644 lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart create mode 100644 lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart diff --git a/.gitmodules b/.gitmodules index 2186826df3..f1b4eb8746 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "crypto_plugins/frostdart"] path = crypto_plugins/frostdart url = https://github.com/cypherstack/frostdart +[submodule "crypto_plugins/flutter_libmwc"] + path = crypto_plugins/flutter_libmwc + url = https://github.com/vekamo/flutter_libmwc diff --git a/README.md b/README.md index 4c18c3181a..286bb6f544 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Highlights include: - [Bitcoin Cash](https://bch.info/en/) - [Dogecoin](https://dogecoin.com/) - [Epic Cash](https://linktr.ee/epiccash) + - [MimbleWimbleCoin](https://mwc.mw) - [Ethereum](https://ethereum.org/en/) - [Firo](https://firo.org/) - [Litecoin](https://litecoin.org/) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc new file mode 160000 index 0000000000..2008080fd8 --- /dev/null +++ b/crypto_plugins/flutter_libmwc @@ -0,0 +1 @@ +Subproject commit 2008080fd8e3a68081f4ca1334c2568421539157 diff --git a/lib/db/db_version_migration.dart b/lib/db/db_version_migration.dart index fcf632669c..81aec9b255 100644 --- a/lib/db/db_version_migration.dart +++ b/lib/db/db_version_migration.dart @@ -532,6 +532,71 @@ class DbVersionMigrator with WalletDB { await MainDB.instance.addNewTransactionData(transactionsData, walletId); } + // we need to manually migrate mimblewimblecoin transactions as they are not + // stored on the mimblewimblecoin blockchain + final mimblewimblecoin = Mimblewimblecoin(CryptoCurrencyNetwork.main); + if (info.coinIdentifier == mimblewimblecoin.identifier) { + final txnData = walletBox.get("latest_tx_model") as TransactionData?; + + // we ever only used index 0 in the past + const rcvIndex = 0; + + final List> + transactionsData = []; + if (txnData != null) { + final txns = txnData.getAllTransactions(); + + for (final tx in txns.values) { + final bool isIncoming = tx.txType == "Received"; + + final iTx = isar_models.Transaction( + walletId: walletId, + txid: tx.txid, + timestamp: tx.timestamp, + type: isIncoming + ? isar_models.TransactionType.incoming + : isar_models.TransactionType.outgoing, + subType: isar_models.TransactionSubType.none, + amount: tx.amount, + amountString: Amount( + rawValue: BigInt.from(tx.amount), + fractionDigits: mimblewimblecoin.fractionDigits, + ).toJsonString(), + fee: tx.fees, + height: tx.height, + isCancelled: tx.isCancelled, + isLelantus: false, + slateId: tx.slateId, + otherData: tx.otherData, + nonce: null, + inputs: [], + outputs: [], + numberOfMessages: tx.numberOfMessages, + ); + + if (tx.address.isEmpty) { + transactionsData.add(Tuple2(iTx, null)); + } else { + final address = isar_models.Address( + walletId: walletId, + value: tx.address, + publicKey: [], + derivationIndex: isIncoming ? rcvIndex : -1, + derivationPath: null, + type: isIncoming + ? isar_models.AddressType.mimbleWimble + : isar_models.AddressType.unknown, + subType: isIncoming + ? isar_models.AddressSubType.receiving + : isar_models.AddressSubType.unknown, + ); + transactionsData.add(Tuple2(iTx, address)); + } + } + } + await MainDB.instance.addNewTransactionData(transactionsData, walletId); + } + // delete data from hive await walletBox.delete(receiveAddressesPrefix); await walletBox.delete("${receiveAddressesPrefix}P2PKH"); @@ -553,9 +618,13 @@ class DbVersionMigrator with WalletDB { ); } - // doing this for epic cash will delete transaction history as it is not - // stored on the epic cash blockchain - if (info.coinIdentifier != epic.identifier) { + // doing this for epiccash/mimblewimblecoin will delete transaction history as it is not + // stored on the epiccash/mimblewimblecoin blockchain + final excludedIdentifiers = [ + epic.identifier, + mimblewimblecoin.identifier + ]; + if ((!excludedIdentifiers.contains(info.coinIdentifier))) { // set flag to initiate full rescan on opening wallet await DB.instance.put( boxName: DB.boxNameDBInfo, diff --git a/lib/db/migrate_wallets_to_isar.dart b/lib/db/migrate_wallets_to_isar.dart index cd54a4063f..d0f75a2e37 100644 --- a/lib/db/migrate_wallets_to_isar.dart +++ b/lib/db/migrate_wallets_to_isar.dart @@ -11,6 +11,7 @@ import '../wallets/isar/models/token_wallet_info.dart'; import '../wallets/isar/models/wallet_info.dart'; import '../wallets/isar/models/wallet_info_meta.dart'; import '../wallets/wallet/supporting/epiccash_wallet_info_extension.dart'; +import '../wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart'; import 'hive/db.dart'; import 'isar/main_db.dart'; @@ -146,6 +147,21 @@ Future migrateWalletsToIsar({ otherData[WalletInfoKeys.epiccashData] = jsonEncode( epicWalletInfo.toMap(), ); + } else if (old.coinIdentifier == + Mimblewimblecoin(CryptoCurrencyNetwork.main)) { + final mimblewimblecoinWalletInfo = + ExtraMimblewimblecoinWalletInfo.fromMap({ + "receivingIndex": walletBox.get("receivingIndex") as int? ?? 0, + "changeIndex": walletBox.get("changeIndex") as int? ?? 0, + "slatesToAddresses": walletBox.get("slate_to_address") as Map? ?? {}, + "slatesToCommits": walletBox.get("slatesToCommits") as Map? ?? {}, + "lastScannedBlock": walletBox.get("lastScannedBlock") as int? ?? 0, + "restoreHeight": walletBox.get("restoreHeight") as int? ?? 0, + "creationHeight": walletBox.get("creationHeight") as int? ?? 0, + }); + otherData[WalletInfoKeys.mimblewimblecoinData] = jsonEncode( + mimblewimblecoinWalletInfo.toMap(), + ); } else if (old.coinIdentifier == Firo(CryptoCurrencyNetwork.main).identifier || old.coinIdentifier == Firo(CryptoCurrencyNetwork.test).identifier) { diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart index 3d89033916..f05cce21e0 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart @@ -95,6 +95,8 @@ class TransactionV2 { bool get isEpiccashTransaction => _getFromOtherData(key: TxV2OdKeys.isEpiccashTransaction) == true; + bool get isMimblewimblecoinTransaction => + _getFromOtherData(key: TxV2OdKeys.isMimblewimblecoinTransaction) == true; int? get numberOfMessages => _getFromOtherData(key: TxV2OdKeys.numberOfMessages) as int?; String? get slateId => _getFromOtherData(key: TxV2OdKeys.slateId) as String?; @@ -287,6 +289,40 @@ class TransactionV2 { } } + if (isMimblewimblecoinTransaction) { + if (slateId == null) { + return "Restored Funds"; + } + + if (isCancelled) { + return "Cancelled"; + } else if (type == TransactionType.incoming) { + if (isConfirmed(currentChainHeight, minConfirms)) { + return "Received"; + } else { + if (numberOfMessages == 1) { + return "Receiving (waiting for sender)"; + } else if ((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 ${prettyConfirms()}"; + } + } + } else if (type == TransactionType.outgoing) { + if (isConfirmed(currentChainHeight, minConfirms)) { + return "Sent (confirmed)"; + } else { + if (numberOfMessages == 1) { + return "Sending (waiting for receiver)"; + } else if ((numberOfMessages ?? 0) > 1) { + return "Sending (waiting for confirmations)"; + } else { + return "Sending ${prettyConfirms()}"; + } + } + } + } + if (type == TransactionType.incoming) { // if (_transaction.isMinting) { // return "Minting"; @@ -347,6 +383,7 @@ abstract final class TxV2OdKeys { static const size = "size"; static const vSize = "vSize"; static const isEpiccashTransaction = "isEpiccashTransaction"; + static const isMimblewimblecoinTransaction = "isMimblewimblecoinTransaction"; static const numberOfMessages = "numberOfMessages"; static const slateId = "slateId"; static const onChainNote = "onChainNote"; diff --git a/lib/models/isar/stack_theme.dart b/lib/models/isar/stack_theme.dart index ce5002a1d5..4f831732f0 100644 --- a/lib/models/isar/stack_theme.dart +++ b/lib/models/isar/stack_theme.dart @@ -1939,6 +1939,7 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincash; late final String dogecoin; late final String epicCash; + late final String mimblewimblecoin; late final String ethereum; late final String firo; late final String monero; @@ -1949,6 +1950,7 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincashImage; late final String dogecoinImage; late final String epicCashImage; + late final String mimblewimblecoinImage; late final String ethereumImage; late final String firoImage; late final String litecoinImage; @@ -1960,6 +1962,7 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincashImageSecondary; late final String dogecoinImageSecondary; late final String epicCashImageSecondary; + late final String mimblewimblecoinImageSecondary; late final String ethereumImageSecondary; late final String firoImageSecondary; late final String litecoinImageSecondary; @@ -2006,6 +2009,8 @@ class ThemeAssets implements IThemeAssets { ..bitcoincash = "$themeId/assets/${json["bitcoincash"] as String}" ..dogecoin = "$themeId/assets/${json["dogecoin"] as String}" ..epicCash = "$themeId/assets/${json["epicCash"] as String}" + ..mimblewimblecoin = + "$themeId/assets/${json["mimblewimblecoin"] as String}" ..ethereum = "$themeId/assets/${json["ethereum"] as String}" ..firo = "$themeId/assets/${json["firo"] as String}" ..monero = "$themeId/assets/${json["monero"] as String}" @@ -2017,6 +2022,8 @@ class ThemeAssets implements IThemeAssets { "$themeId/assets/${json["bitcoincash_image"] as String}" ..dogecoinImage = "$themeId/assets/${json["dogecoin_image"] as String}" ..epicCashImage = "$themeId/assets/${json["epicCash_image"] as String}" + ..mimblewimblecoinImage = + "$themeId/assets/${json["mimblewimblecoin_image"] as String}" ..ethereumImage = "$themeId/assets/${json["ethereum_image"] as String}" ..firoImage = "$themeId/assets/${json["firo_image"] as String}" ..litecoinImage = "$themeId/assets/${json["litecoin_image"] as String}" @@ -2032,6 +2039,8 @@ class ThemeAssets implements IThemeAssets { "$themeId/assets/${json["dogecoin_image_secondary"] as String}" ..epicCashImageSecondary = "$themeId/assets/${json["epicCash_image_secondary"] as String}" + ..mimblewimblecoinImageSecondary = + "$themeId/assets/${json["mimblewimblecoin_image_secondary"] as String}" ..ethereumImageSecondary = "$themeId/assets/${json["ethereum_image_secondary"] as String}" ..firoImageSecondary = 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 58e51b34e7..44a0c2157d 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 @@ -46,10 +46,12 @@ import '../../../utilities/util.dart'; import '../../../wallets/crypto_currency/crypto_currency.dart'; import '../../../wallets/isar/models/wallet_info.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../wallets/wallet/impl/wownero_wallet.dart'; import '../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../../wallets/wallet/supporting/epiccash_wallet_info_extension.dart'; +import '../../../wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart'; import '../../../wallets/wallet/wallet.dart'; import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../../widgets/desktop/desktop_app_bar.dart'; @@ -254,10 +256,27 @@ class _RestoreWalletViewState extends ConsumerState { height = 0; } + // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index + if (widget.coin is Mimblewimblecoin) { + final int secondsSinceEpoch = + widget.restoreFromDate.millisecondsSinceEpoch ~/ 1000; + const int mimblewimblecoinFirstBlock = 1565370278; + const double overestimateSecondsPerBlock = 61; + final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; + final int approximateHeight = + chosenSeconds ~/ overestimateSecondsPerBlock; + //todo: check if print needed + // debugPrint( + // "approximate height: $approximateHeight chosen_seconds: $chosenSeconds"); + height = approximateHeight; + if (height < 0) { + height = 0; + } + otherDataJsonString = jsonEncode( { - WalletInfoKeys.epiccashData: jsonEncode( - ExtraEpiccashWalletInfo( + WalletInfoKeys.mimblewimblecoinData: jsonEncode( + ExtraMimblewimblecoinWalletInfo( receivingIndex: 0, changeIndex: 0, slatesToAddresses: {}, @@ -355,6 +374,10 @@ class _RestoreWalletViewState extends ConsumerState { case const (EpiccashWallet): await (wallet as EpiccashWallet).init(isRestore: true); break; + + case const (MimblewimblecoinWallet): + await (wallet as MimblewimblecoinWallet).init(isRestore: true); + break; case const (MoneroWallet): await (wallet as MoneroWallet).init(isRestore: true); diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index 5090645e30..ce08150f35 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -14,6 +14,7 @@ import 'dart:io'; import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_libepiccash/lib.dart'; +import 'package:flutter_libmwc/lib.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -33,6 +34,7 @@ import '../../utilities/constants.dart'; import '../../utilities/text_styles.dart'; import '../../utilities/util.dart'; import '../../wallets/crypto_currency/coins/epiccash.dart'; +import '../../wallets/crypto_currency/coins/mimblewimblecoin.dart'; import '../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../wallets/isar/providers/eth/current_token_wallet_provider.dart'; import '../../wallets/isar/providers/wallet_info_provider.dart'; @@ -159,7 +161,7 @@ class _ConfirmTransactionViewState break; } } else { - if (coin is Epiccash) { + if (coin is Epiccash || coin is Mimblewimblecoin) { txDataFuture = wallet.confirmSend( txData: widget.txData.copyWith( noteOnChain: onChainNoteController.text, @@ -578,11 +580,13 @@ class _ConfirmTransactionViewState ], ), ), - if (coin is Epiccash && widget.txData.noteOnChain!.isNotEmpty) + if ((coin is Epiccash || coin is Mimblewimblecoin) && + widget.txData.noteOnChain!.isNotEmpty) const SizedBox( height: 12, ), - if (coin is Epiccash && widget.txData.noteOnChain!.isNotEmpty) + if ((coin is Epiccash || coin is Mimblewimblecoin) && + widget.txData.noteOnChain!.isNotEmpty) RoundedWhiteContainer( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, @@ -611,7 +615,9 @@ class _ConfirmTransactionViewState crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text( - (coin is Epiccash) ? "Local Note" : "Note", + (coin is Epiccash || coin is Mimblewimblecoin) + ? "Local Note" + : "Note", style: STextStyles.smallMed12(context), ), const SizedBox( @@ -913,17 +919,17 @@ class _ConfirmTransactionViewState mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) Text( "On chain Note (optional)", style: STextStyles.smallMed12(context), textAlign: TextAlign.left, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox( height: 8, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -963,12 +969,12 @@ class _ConfirmTransactionViewState ), ), ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox( height: 12, ), SelectableText( - (coin is Epiccash) + (coin is Epiccash || coin is Mimblewimblecoin) ? "Local Note (optional)" : "Note (optional)", style: diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 1dd9b68efa..f101130c2d 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -311,7 +311,9 @@ class _SendViewState extends ConsumerState { _cryptoAmountChangedFeeUpdateTimer?.cancel(); _cryptoAmountChangedFeeUpdateTimer = Timer(updateFeesTimerDuration, () { - if (coin is! Epiccash && !_baseFocus.hasFocus) { + if (coin is! Epiccash && + coin is! Mimblewimblecoin && + !_baseFocus.hasFocus) { setState(() { _calculateFeesFuture = calculateFees( amount == null @@ -332,7 +334,9 @@ class _SendViewState extends ConsumerState { void _baseAmountChanged() { _baseAmountChangedFeeUpdateTimer?.cancel(); _baseAmountChangedFeeUpdateTimer = Timer(updateFeesTimerDuration, () { - if (coin is! Epiccash && !_cryptoFocus.hasFocus) { + if (coin is! Epiccash && + coin is! Mimblewimblecoin && + !_cryptoFocus.hasFocus) { setState(() { _calculateFeesFuture = calculateFees( ref.read(pSendAmount) == null @@ -1116,6 +1120,21 @@ class _SendViewState extends ConsumerState { }); } + if (coin is Mimblewimblecoin) { + sendToController.addListener(() { + _address = sendToController.text.trim(); + + if (_address != null && _address!.isNotEmpty) { + _address = _address!.trim(); + if (_address!.contains("\n")) { + _address = _address!.substring(0, _address!.indexOf("\n")); + } + + sendToController.text = AddressUtils().formatAddress(_address!); + } + }); + } + return Background( child: Scaffold( backgroundColor: Theme.of(context).extension()!.background, @@ -1447,6 +1466,14 @@ class _SendViewState extends ConsumerState { content, ); } + if (coin + is Mimblewimblecoin) { + // strip http:// and https:// if content contains @ + content = AddressUtils() + .formatAddress( + content, + ); + } sendToController.text = content.trim(); _address = content.trim(); @@ -2030,17 +2057,17 @@ class _SendViewState extends ConsumerState { const SizedBox( height: 12, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) Text( "On chain Note (optional)", style: STextStyles.smallMed12(context), textAlign: TextAlign.left, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox( height: 8, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -2084,12 +2111,12 @@ class _SendViewState extends ConsumerState { ), ), ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox( height: 12, ), Text( - (coin is Epiccash) + (coin is Epiccash || coin is Mimblewimblecoin) ? "Local Note (optional)" : "Note (optional)", style: STextStyles.smallMed12(context), @@ -2141,6 +2168,7 @@ class _SendViewState extends ConsumerState { height: 12, ), if (coin is! Epiccash && + coin is! Mimblewimblecoin && coin is! NanoCurrency && coin is! Tezos) Text( @@ -2149,12 +2177,14 @@ class _SendViewState extends ConsumerState { textAlign: TextAlign.left, ), if (coin is! Epiccash && + coin is! Mimblewimblecoin && coin is! NanoCurrency && coin is! Tezos) const SizedBox( height: 8, ), if (coin is! Epiccash && + coin is! Mimblewimblecoin && coin is! NanoCurrency && coin is! Tezos) Stack( 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 b72c3222cc..d29aae7dc3 100644 --- a/lib/pages/settings_views/global_settings_view/about_view.dart +++ b/lib/pages/settings_views/global_settings_view/about_view.dart @@ -268,6 +268,54 @@ class AboutView extends ConsumerWidget { ); }, ), + if (AppConfig.coins + .whereType() + .isNotEmpty) + const SizedBox( + height: 12, + ), + if (AppConfig.coins + .whereType() + .isNotEmpty) + FutureBuilder( + future: GitStatus.getMimblewimblecoinCommitStatus(), + builder: ( + context, + AsyncSnapshot snapshot, + ) { + CommitStatus stateOfCommit = + CommitStatus.notLoaded; + + if (snapshot.connectionState == + ConnectionState.done && + snapshot.hasData) { + stateOfCommit = snapshot.data!; + } + + return RoundedWhiteContainer( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + Text( + "Mimblewimblecoin Build Commit", + style: STextStyles.titleBold12(context), + ), + const SizedBox( + height: 4, + ), + SelectableText( + GitStatus.mimblewimblecoinCommit, + style: GitStatus.styleForStatus( + stateOfCommit, + context, + ), + ), + ], + ), + ); + }, + ), if (AppConfig.coins.whereType().isNotEmpty) const SizedBox( height: 12, 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 92e5cc256d..8315302df7 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 @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_libepiccash/git_versions.dart' as EPIC_VERSIONS; // import 'package:flutter_libmonero/git_versions.dart' as MONERO_VERSIONS; +import 'package:flutter_libmwc/git_versions.dart' as MIMBLEWIMBLECOIN_VERSIONS; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS; @@ -315,6 +316,9 @@ class _DebugViewState extends ConsumerState { EPIC_VERSIONS.getPluginVersion(); // final String moneroCommit = // MONERO_VERSIONS.getPluginVersion(); + final String mimblewimblecoinCommit = + MIMBLEWIMBLECOIN_VERSIONS + .getPluginVersion(); final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); final deviceInfo = @@ -348,6 +352,8 @@ class _DebugViewState extends ConsumerState { "firoCommit": firoCommit, "epicCashCommit": epicCashCommit, // "moneroCommit": moneroCommit, + "mimblewimblecoinCommit": + mimblewimblecoinCommit, "deviceInfoMap": deviceInfoMap, "errorLogs": errorLogs, }; 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 fb18a4716d..e7f0824e40 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 @@ -88,6 +88,17 @@ class _AddEditNodeViewState extends ConsumerState { ref.read(nodeFormDataProvider).host = data.host; ref.read(nodeFormDataProvider).port = data.port; ref.read(nodeFormDataProvider).useSSL = data.useSSL; + } else if (coin is Mimblewimblecoin) { + ref.read(nodeFormDataProvider).host = data.host; + ref.read(nodeFormDataProvider).port = data.port; + ref.read(nodeFormDataProvider).useSSL = data.useSSL; + } else if (coin is CryptonoteCurrency) { + ref.read(nodeFormDataProvider).host = data.host; + } + if (coin is Mimblewimblecoin) { + ref.read(nodeFormDataProvider).host = data.host; + ref.read(nodeFormDataProvider).port = data.port; + ref.read(nodeFormDataProvider).useSSL = data.useSSL; } else if (coin is CryptonoteCurrency) { ref.read(nodeFormDataProvider).host = data.host; } @@ -917,6 +928,8 @@ class _NodeFormState extends ConsumerState { if (widget.coin is Epiccash) { enableSSLCheckbox = !node.host.startsWith("http"); + } else if (widget.coin is Mimblewimblecoin) { + enableSSLCheckbox = !node.host.startsWith("http"); } else { enableSSLCheckbox = true; } @@ -1058,6 +1071,25 @@ class _NodeFormState extends ConsumerState { _useSSL = true; } } + if (widget.coin is Mimblewimblecoin) { + if (newValue.startsWith("https://")) { + _useSSL = true; + enableSSLCheckbox = false; + } else if (newValue.startsWith("http://")) { + _useSSL = false; + enableSSLCheckbox = false; + } else { + enableSSLCheckbox = true; + } + } else if (widget.coin is CwBasedInterface) { + if (newValue.startsWith("https://")) { + _useSSL = true; + } else if (newValue.startsWith("http://")) { + _useSSL = false; + } else { + _useSSL = true; + } + } _updateState(); setState(() {}); }, @@ -1317,11 +1349,15 @@ class _NodeFormState extends ConsumerState { ), ], ), - if (widget.coin is! CryptonoteCurrency && widget.coin is! Epiccash) + if (widget.coin is! CryptonoteCurrency && + widget.coin is! Epiccash && + widget.coin is! Mimblewimblecoin) const SizedBox( height: 8, ), - if (widget.coin is! CryptonoteCurrency && widget.coin is! Epiccash) + if (widget.coin is! CryptonoteCurrency && + widget.coin is! Epiccash && + widget.coin is! Mimblewimblecoin) Row( children: [ GestureDetector( 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 0ffa6bcf91..c83d927e80 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 @@ -53,6 +53,7 @@ import '../../../../../wallets/isar/models/frost_wallet_info.dart'; import '../../../../../wallets/isar/models/wallet_info.dart'; import '../../../../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; import '../../../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../../../wallets/wallet/impl/wownero_wallet.dart'; import '../../../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; @@ -507,6 +508,10 @@ abstract class SWB { case const (EpiccashWallet): await (wallet as EpiccashWallet).init(isRestore: true); break; + + case const (MimblewimblecoinWallet): + await (wallet as MimblewimblecoinWallet).init(isRestore: true); + break; case const (MoneroWallet): await (wallet as MoneroWallet).init(isRestore: true); @@ -522,7 +527,7 @@ abstract class SWB { int restoreHeight = walletbackup['restoreHeight'] as int? ?? 0; if (restoreHeight <= 0) { - if (wallet is EpiccashWallet || wallet is LibMoneroWallet) { + if (wallet is EpiccashWallet || wallet is MimblewimblecoinWallet || wallet is LibMoneroWallet) { restoreHeight = 0; } else { restoreHeight = walletbackup['storedChainHeight'] as int? ?? 0; 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 1be577f1d4..b88e9ce92f 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 @@ -33,10 +33,12 @@ import '../../../../utilities/constants.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; import '../../../../wallets/crypto_currency/coins/epiccash.dart'; +import '../../../../wallets/crypto_currency/coins/mimblewimblecoin.dart'; import '../../../../wallets/crypto_currency/coins/monero.dart'; import '../../../../wallets/crypto_currency/coins/wownero.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../../wallets/wallet/impl/wownero_wallet.dart'; import '../../../../widgets/animated_text.dart'; @@ -263,7 +265,10 @@ class _WalletNetworkSettingsViewState final coin = ref.read(pWalletCoin(widget.walletId)); - if (coin is Monero || coin is Wownero || coin is Epiccash) { + if (coin is Monero || + coin is Wownero || + coin is Epiccash || + coin is Mimblewimblecoin) { _blocksRemainingSubscription = eventBus.on().listen( (event) async { if (event.walletId == widget.walletId) { @@ -343,6 +348,14 @@ class _WalletNetworkSettingsViewState if (_percent < highestPercent) { _percent = highestPercent.clamp(0.0, 1.0); } + } else if (coin is Mimblewimblecoin) { + final double highestPercent = (ref + .watch(pWallets) + .getWallet(widget.walletId) as MimblewimblecoinWallet) + .highestPercent; + if (_percent < highestPercent) { + _percent = highestPercent.clamp(0.0, 1.0); + } } return ConditionalParent( @@ -363,7 +376,11 @@ class _WalletNetworkSettingsViewState style: STextStyles.navBarTitle(context), ), actions: [ - if (ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) + if (ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && + ref.watch(pWalletCoin(widget.walletId)) + is! Mimblewimblecoin || + ref.watch(pWalletCoin(widget.walletId)) + is! Mimblewimblecoin) Padding( padding: const EdgeInsets.only( top: 10, @@ -627,6 +644,7 @@ class _WalletNetworkSettingsViewState ), if (coin is Monero || coin is Wownero || + coin is Mimblewimblecoin || coin is Epiccash) Text( " (Blocks to go: ${_blocksRemaining == -1 ? "?" : _blocksRemaining})", @@ -950,11 +968,15 @@ class _WalletNetworkSettingsViewState coin: ref.watch(pWalletCoin(widget.walletId)), popBackToRoute: WalletNetworkSettingsView.routeName, ), - if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) + if (isDesktop && + ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && + ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) const SizedBox( height: 32, ), - if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) + if (isDesktop && + ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && + ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) Padding( padding: const EdgeInsets.only( bottom: 12, @@ -970,7 +992,9 @@ class _WalletNetworkSettingsViewState ], ), ), - if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) + if (isDesktop && + ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && + ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) RoundedWhiteContainer( borderColor: isDesktop ? Theme.of(context).extension()!.background 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 8e889ed7c5..2a217dcb92 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 @@ -18,6 +18,7 @@ import 'package:tuple/tuple.dart'; import '../../../db/hive/db.dart'; import '../../../db/sqlite/firo_cache.dart'; import '../../../models/epicbox_config_model.dart'; +import '../../../models/mwcmqs_config_model.dart'; import '../../../models/keys/key_data_interface.dart'; import '../../../models/keys/view_only_wallet_data.dart'; import '../../../notifications/show_flush_bar.dart'; @@ -38,6 +39,8 @@ import '../../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; import '../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; +import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; +import '../../../wallets/wallet/wallet_mixin_interfaces/cw_based_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; @@ -719,3 +722,103 @@ class _EpiBoxInfoFormState extends ConsumerState { ); } } + +class MwcMqsInfoForm extends ConsumerStatefulWidget { + const MwcMqsInfoForm({ + super.key, + required this.walletId, + }); + + final String walletId; + + @override + ConsumerState createState() => _MwcMqsInfoFormState(); +} + +class _MwcmqsInfoFormState extends ConsumerState { + final hostController = TextEditingController(); + final portController = TextEditingController(); + + late MimblewimblecoinWallet wallet; + + @override + void initState() { + wallet = + ref.read(pWallets).getWallet(widget.walletId) as MimblewimblecoinWallet; + + wallet.getMwcMqsConfig().then((MwcMqsConfigModel mwcmqsConfig) { + hostController.text = mwcmqsConfig.host; + portController.text = "${mwcmqsConfig.port ?? 443}"; + }); + super.initState(); + } + + @override + void dispose() { + hostController.dispose(); + portController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop ? false : true, + controller: hostController, + decoration: const InputDecoration(hintText: "Host"), + ), + const SizedBox( + height: 8, + ), + TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop ? false : true, + controller: portController, + decoration: const InputDecoration(hintText: "Port"), + keyboardType: + Util.isDesktop ? null : const TextInputType.numberWithOptions(), + ), + const SizedBox( + height: 8, + ), + TextButton( + onPressed: () async { + try { + await wallet.updateMwcmqsConfig( + hostController.text, + int.parse(portController.text), + ); + if (mounted) { + await showFloatingFlushBar( + context: context, + message: "Mwcmqs info saved!", + type: FlushBarType.success, + ); + } + unawaited(wallet.refresh()); + } catch (e) { + await showFloatingFlushBar( + context: context, + message: "Failed to save mwcmqs info: $e", + type: FlushBarType.warning, + ); + } + }, + child: Text( + "Save", + style: STextStyles.button(context).copyWith( + color: + Theme.of(context).extension()!.accentColorDark, + ), + ), + ), + ], + ), + ); + } +} 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 5afd82597f..385bb8a2e0 100644 --- a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart +++ b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart @@ -873,6 +873,10 @@ class _DesktopTransactionCardRowState return "Restored Funds"; } + if (coin is Mimblewimblecoin && _transaction.slateId == null) { + return "Restored Funds"; + } + if (_transaction.subType == TransactionSubType.mint) { if (_transaction.isConfirmed(height, minConfirms)) { return "Anonymized"; @@ -967,6 +971,19 @@ class _DesktopTransactionCardRowState ); return; } + + if (coin is Mimblewimblecoin && _transaction.slateId == null) { + unawaited( + showFloatingFlushBar( + context: context, + message: + "Restored Mimblewimblecoin funds from your Seed have no Data.", + type: FlushBarType.warning, + duration: const Duration(seconds: 5), + ), + ); + return; + } if (Util.isDesktop) { await showDialog( context: context, diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index 7081f59290..53c54ae22a 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -43,6 +43,7 @@ import '../../../../wallets/isar/models/spark_coin.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/epiccash_wallet.dart'; import '../../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import '../../../../widgets/background.dart'; @@ -251,6 +252,33 @@ class _TransactionV2DetailsViewState ), ) .toList(); + } else if (_transaction.isMimblewimblecoinTransaction) { + switch (_transaction.type) { + case TransactionType.outgoing: + case TransactionType.unknown: + amount = _transaction.getAmountSentFromThisWallet( + fractionDigits: fractionDigits, + ); + break; + + case TransactionType.incoming: + case TransactionType.sentToSelf: + amount = _transaction.getAmountReceivedInThisWallet( + fractionDigits: fractionDigits, + ); + break; + } + data = _transaction.outputs + .map( + (e) => ( + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ) + ), + ) + .toList(); } else if (_transaction.subType == TransactionSubType.cashFusion) { amount = _transaction.getAmountReceivedInThisWallet( fractionDigits: fractionDigits, @@ -1069,13 +1097,13 @@ class _TransactionV2DetailsViewState ], ), ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) isDesktop ? const _Divider() : const SizedBox( height: 12, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) RoundedWhiteContainer( padding: isDesktop ? const EdgeInsets.all(16) @@ -1147,7 +1175,8 @@ class _TransactionV2DetailsViewState MainAxisAlignment.spaceBetween, children: [ Text( - (coin is Epiccash) + (coin is Epiccash || + coin is Mimblewimblecoin) ? "Local Note" : "Note ", style: isDesktop @@ -1218,7 +1247,9 @@ class _TransactionV2DetailsViewState .watch( pTransactionNote( ( - txid: (coin is Epiccash) + txid: (coin is Epiccash || + coin + is Mimblewimblecoin) ? _transaction.slateId .toString() : _transaction.txid, @@ -1495,8 +1526,9 @@ class _TransactionV2DetailsViewState ? "${_transaction.height!}" : "Pending"; confirmations = confirms.toString(); - } else if (widget.coin is Epiccash && - _transaction.slateId == null) { + } else if (widget.coin is Epiccash || + coin is Mimblewimblecoin && + _transaction.slateId == null) { confirmations = "Unknown"; height = "Unknown"; } else { @@ -1504,7 +1536,9 @@ class _TransactionV2DetailsViewState currentHeight, minConfirms, coin.minCoinbaseConfirms); - if (widget.coin is! Epiccash && confirmed) { + if (widget.coin is! Epiccash && + widget.coin is! Mimblewimblecoin && + confirmed) { height = "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; } else { @@ -1787,11 +1821,13 @@ class _TransactionV2DetailsViewState context, ), ), - if (coin is! Epiccash) + if (coin is! Epiccash && + coin is! Mimblewimblecoin) const SizedBox( height: 8, ), - if (coin is! Epiccash) + if (coin is! Epiccash && + coin is! Mimblewimblecoin) CustomTextButton( text: "Open in block explorer", onTap: () async { @@ -1948,13 +1984,13 @@ class _TransactionV2DetailsViewState // ], // ), // ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) isDesktop ? const _Divider() : const SizedBox( height: 12, ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) RoundedWhiteContainer( padding: isDesktop ? const EdgeInsets.all(16) @@ -2038,9 +2074,10 @@ class _TransactionV2DetailsViewState ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: (coin is Epiccash && - _transaction.getConfirmations(currentHeight) < 1 && - _transaction.isCancelled == false) + floatingActionButton: (coin is Epiccash || + coin is Mimblewimblecoin && + _transaction.getConfirmations(currentHeight) < 1 && + _transaction.isCancelled == false) ? ConditionalParent( condition: isDesktop, builder: (child) => Padding( @@ -2124,6 +2161,72 @@ class _TransactionV2DetailsViewState ); return; } + + if (wallet is MimblewimblecoinWallet) { + final String? id = _transaction.slateId; + if (id == null) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: + "Could not find Mimblewimblecoin transaction ID", + context: context, + ), + ); + return; + } + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = + await wallet.cancelPendingTransactionAndPost(id); + if (mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + wallet.refresh(); + Navigator.of(context).popUntil( + ModalRoute.withName( + WalletView.routeName, + ), + ); + }, + ), + ); + } else { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + ), + ); + } + } + } else { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: + "ERROR: Wallet type is not Mimblewimblecoin", + context: context, + ), + ); + return; + } }, child: Text( "Cancel Transaction", 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 0fb65c6353..0721bbb832 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 @@ -488,6 +488,11 @@ class _DesktopSendState extends ConsumerState { noteOnChain: _onChainNote ?? "", ); } + if (coin is Mimblewimblecoin) { + txData = txData.copyWith( + noteOnChain: _onChainNote ?? "", + ); + } } // pop building dialog Navigator.of( @@ -790,6 +795,9 @@ class _DesktopSendState extends ConsumerState { if (coin is Epiccash) { content = AddressUtils().formatAddress(content); } + if (coin is Mimblewimblecoin) { + content = AddressUtils().formatAddressMwc(content); + } sendToController.text = content; _address = content; @@ -805,6 +813,10 @@ class _DesktopSendState extends ConsumerState { // strip http:// and https:// if content contains @ content = AddressUtils().formatAddress(content); } + if (coin is Mimblewimblecoin) { + // strip http:// and https:// if content contains @ + content = AddressUtils().formatAddressMwc(content); + } sendToController.text = content; _address = content; @@ -1042,6 +1054,21 @@ class _DesktopSendState extends ConsumerState { }); } + if (coin is Mimblewimblecoin) { + sendToController.addListener(() { + _address = sendToController.text; + + if (_address != null && _address!.isNotEmpty) { + _address = _address!.trim(); + if (_address!.contains("\n")) { + _address = _address!.substring(0, _address!.indexOf("\n")); + } + + sendToController.text = formatAddressMwc(_address!); + } + }); + } + final firoType = ref.watch(publicPrivateBalanceStateProvider); final isExchangeAddress = ref.watch(pIsExchangeAddress); @@ -1715,7 +1742,10 @@ class _DesktopSendState extends ConsumerState { const SizedBox( height: 20, ), - if (coin is! NanoCurrency && coin is! Epiccash && coin is! Tezos) + if (coin is! NanoCurrency && + coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! Tezos) ConditionalParent( condition: ref.watch(pWallets).getWallet(walletId) is ElectrumXInterface && @@ -1771,11 +1801,17 @@ class _DesktopSendState extends ConsumerState { textAlign: TextAlign.left, ), ), - if (coin is! NanoCurrency && coin is! Epiccash && coin is! Tezos) + if (coin is! NanoCurrency && + coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! Tezos) const SizedBox( height: 10, ), - if (coin is! NanoCurrency && coin is! Epiccash && coin is! Tezos) + if (coin is! NanoCurrency && + coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! Tezos) if (!isCustomFee) Padding( padding: const EdgeInsets.all(10), @@ -1980,3 +2016,25 @@ String formatAddress(String epicAddress) { } return epicAddress; } + +String formatAddressMwc(String mimblewimblecoinAddress) { + // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an mwcmqs address) + if ((mimblewimblecoinAddress.startsWith("http://") || + mimblewimblecoinAddress.startsWith("https://")) && + mimblewimblecoinAddress.contains("@")) { + mimblewimblecoinAddress = mimblewimblecoinAddress.replaceAll("http://", ""); + mimblewimblecoinAddress = + mimblewimblecoinAddress.replaceAll("https://", ""); + } + // strip mailto: prefix + if (mimblewimblecoinAddress.startsWith("mailto:")) { + mimblewimblecoinAddress = mimblewimblecoinAddress.replaceAll("mailto:", ""); + } + // strip / suffix if the address contains an @ symbol (and is thus an mwcmqs address) + if (mimblewimblecoinAddress.endsWith("/") && + mimblewimblecoinAddress.contains("@")) { + mimblewimblecoinAddress = mimblewimblecoinAddress.substring( + 0, mimblewimblecoinAddress.length - 1); + } + return mimblewimblecoinAddress; +} 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 e8a4c5256b..2aae2e1fc6 100644 --- a/lib/pages_desktop_specific/password/delete_password_warning_view.dart +++ b/lib/pages_desktop_specific/password/delete_password_warning_view.dart @@ -63,6 +63,12 @@ class _ForgotPasswordDesktopViewState await epicDir.delete(recursive: true); } + final mimblewimblecoinDir = + Directory("${appRoot.path}/mimblewimblecoin"); + if (mimblewimblecoinDir.existsSync()) { + await mimblewimblecoinDir.delete(recursive: true); + } + await Isar.getInstance("desktopStore")?.close(deleteFromDisk: true); await (await StackFileSystem.applicationHiveDirectory()) @@ -79,6 +85,12 @@ class _ForgotPasswordDesktopViewState if (epicDir.existsSync()) { await epicDir.delete(recursive: true); } + final mimblewimblecoinDir = + Directory("${appRoot.path}/mimblewimblecoin"); + if (mimblewimblecoinDir.existsSync()) { + await mimblewimblecoinDir.delete(recursive: true); + } + await (await StackFileSystem.applicationHiveDirectory()) .delete(recursive: true); await (await StackFileSystem.applicationIsarDirectory()) 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 98a7dec344..7d48217bc0 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 @@ -434,63 +434,122 @@ class DesktopAboutView extends ConsumerWidget { ); }, ), - // if (AppConfig.coins - // .whereType() - // .isNotEmpty) - // FutureBuilder( - // future: GitStatus - // .getMoneroCommitStatus(), - // builder: ( - // context, - // AsyncSnapshot - // snapshot, - // ) { - // CommitStatus stateOfCommit = - // CommitStatus.notLoaded; + if (AppConfig.coins + .whereType() + .isNotEmpty) + FutureBuilder( + future: GitStatus + .getMimblewimblecoinCommitStatus(), + builder: ( + context, + AsyncSnapshot + snapshot, + ) { + CommitStatus stateOfCommit = + CommitStatus.notLoaded; + + if (snapshot.connectionState == + ConnectionState + .done && + snapshot.hasData) { + stateOfCommit = + snapshot.data!; + } + + return Column( + mainAxisSize: + MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + "Mimblewimblecoin Build Commit", + style: STextStyles + .desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of( + context, + ) + .extension< + StackColors>()! + .textDark, + ), + ), + const SizedBox( + height: 2, + ), + SelectableText( + GitStatus + .mimblewimblecoinCommit, + style: GitStatus + .styleForStatus( + stateOfCommit, + context, + ), + ), + ], + ); + }, + ), + //if (AppConfig.coins + // .whereType() + // .isNotEmpty) + // FutureBuilder( + // future: GitStatus + // .getMoneroCommitStatus(), + // builder: ( + // context, + // AsyncSnapshot + // snapshot, + // ) { + // CommitStatus stateOfCommit = + // CommitStatus.notLoaded; // - // if (snapshot.connectionState == - // ConnectionState - // .done && - // snapshot.hasData) { - // stateOfCommit = - // snapshot.data!; - // } - // return Column( - // mainAxisSize: - // MainAxisSize.min, - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // Text( - // "Monero Build Commit", - // style: STextStyles - // .desktopTextExtraExtraSmall( - // context, - // ).copyWith( - // color: Theme.of( - // context, - // ) - // .extension< - // StackColors>()! - // .textDark, - // ), - // ), - // const SizedBox( - // height: 2, - // ), - // SelectableText( - // GitStatus.moneroCommit, - // style: GitStatus - // .styleForStatus( - // stateOfCommit, - // context, - // ), - // ), - // ], - // ); - // }, - // ), + // if (snapshot.connectionState == + // ConnectionState + // .done && + // snapshot.hasData) { + // stateOfCommit = + // snapshot.data!; + // } + // return Column( + // mainAxisSize: + // MainAxisSize.min, + // crossAxisAlignment: + // CrossAxisAlignment + // .start, + // children: [ + // Text( + // "Monero Build Commit", + // style: STextStyles + // .desktopTextExtraExtraSmall( + // context, + // ).copyWith( + // color: Theme.of( + // context, + // ) + // .extension< + // StackColors>()! + // .textDark, + // ), + // ), + // const SizedBox( + // height: 2, + // ), + // SelectableText( + // GitStatus.moneroCommit, + // style: GitStatus + // .styleForStatus( + // stateOfCommit, + // context, + // ), + // ), + // ], + // ); + // }, + // ), ], ), const SizedBox(height: 35), diff --git a/lib/services/price.dart b/lib/services/price.dart index 5a97e43cbc..071ce59804 100644 --- a/lib/services/price.dart +++ b/lib/services/price.dart @@ -34,6 +34,7 @@ class PriceAPI { Dash: "dash", Dogecoin: "dogecoin", Epiccash: "epic-cash", + Mimblewimblecoin: "mimblewimblecoin", Ecash: "ecash", Ethereum: "ethereum", Firo: "zcoin", diff --git a/lib/services/wallets.dart b/lib/services/wallets.dart index c606a75cfa..b2b445ddd3 100644 --- a/lib/services/wallets.dart +++ b/lib/services/wallets.dart @@ -25,6 +25,7 @@ import '../wallets/crypto_currency/crypto_currency.dart'; import '../wallets/isar/models/wallet_info.dart'; import '../wallets/wallet/impl/epiccash_wallet.dart'; import '../wallets/wallet/intermediate/lib_monero_wallet.dart'; +import '../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../wallets/wallet/wallet.dart'; import 'event_bus/events/wallet_added_event.dart'; import 'event_bus/global_event_bus.dart'; @@ -113,6 +114,15 @@ class Wallets { "epic wallet: $walletId deleted with result: $deleteResult", level: LogLevel.Info, ); + } else if (info.coin is Mimblewimblecoin) { + final deleteResult = await deleteMimblewimblecoinWallet( + walletId: walletId, + secureStore: secureStorage, + ); + Logging.instance.log( + "Mimblewimblecoin wallet: $walletId deleted with result: $deleteResult", + level: LogLevel.Info, + ); } // delete wallet data in main db diff --git a/lib/themes/coin_icon_provider.dart b/lib/themes/coin_icon_provider.dart index 4a789ad76a..1deb22b4e1 100644 --- a/lib/themes/coin_icon_provider.dart +++ b/lib/themes/coin_icon_provider.dart @@ -28,6 +28,8 @@ final coinIconProvider = Provider.family((ref, coin) { return assets.dogecoin; case const (Epiccash): return assets.epicCash; + case const (Mimblewimblecoin): + return assets.mimblewimblecoin; case const (Firo): return assets.firo; case const (Monero): diff --git a/lib/utilities/address_utils.dart b/lib/utilities/address_utils.dart index 2e6b241b88..aa9bb6c3c9 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -232,6 +232,31 @@ class AddressUtils { } return epicAddress; } + + /// Formats an address string to remove any unnecessary prefixes or suffixes. + String formatMimblewimblecoinAddress(String mimblewimblecoinAddress) { + // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an mwcmqs address) + if ((mimblewimblecoinAddress.startsWith("http://") || + mimblewimblecoinAddress.startsWith("https://")) && + mimblewimblecoinAddress.contains("@")) { + mimblewimblecoinAddress = + mimblewimblecoinAddress.replaceAll("http://", ""); + mimblewimblecoinAddress = + mimblewimblecoinAddress.replaceAll("https://", ""); + } + // strip mailto: prefix + if (mimblewimblecoinAddress.startsWith("mailto:")) { + mimblewimblecoinAddress = + mimblewimblecoinAddress.replaceAll("mailto:", ""); + } + // strip / suffix if the address contains an @ symbol (and is thus an mwcmqs address) + if (mimblewimblecoinAddress.endsWith("/") && + mimblewimblecoinAddress.contains("@")) { + mimblewimblecoinAddress = mimblewimblecoinAddress.substring( + 0, mimblewimblecoinAddress.length - 1); + } + return mimblewimblecoinAddress; + } } class PaymentUriData { diff --git a/lib/utilities/amount/amount_unit.dart b/lib/utilities/amount/amount_unit.dart index a8cbfa701e..79e45232b3 100644 --- a/lib/utilities/amount/amount_unit.dart +++ b/lib/utilities/amount/amount_unit.dart @@ -63,6 +63,7 @@ enum AmountUnit { // case Coin.dogecoin: // case Coin.eCash: // case Coin.epicCash: + // case Coin.mimblewimblecoin: // case Coin.stellar: // TODO: check if this is correct // case Coin.stellarTestnet: // case Coin.tezos: diff --git a/lib/utilities/assets.dart b/lib/utilities/assets.dart index 73c5204100..9d62c75f3b 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -245,6 +245,7 @@ class _SVG { String get bitcoincash => "assets/svg/coin_icons/Bitcoincash.svg"; String get dogecoin => "assets/svg/coin_icons/Dogecoin.svg"; String get epicCash => "assets/svg/coin_icons/EpicCash.svg"; + String get mimblewimblecoin => "assets/svg/coin_icons/Mimblewimblecoin.svg"; String get ethereum => "assets/svg/coin_icons/Ethereum.svg"; String get firo => "assets/svg/coin_icons/Firo.svg"; String get monero => "assets/svg/coin_icons/Monero.svg"; diff --git a/lib/utilities/default_mwcmqs.dart b/lib/utilities/default_mwcmqs.dart new file mode 100644 index 0000000000..75be1d247b --- /dev/null +++ b/lib/utilities/default_mwcmqs.dart @@ -0,0 +1,53 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + +import '../models/mwcmqs_server_model.dart'; + +abstract class DefaultMwcMqs { + static const String defaultName = "Default"; + + static List get all => [americas, asia, europe]; + static List get defaultIds => ['americas', 'asia', 'europe']; + + static MwcMqsServerModel get americas => MwcMqsServerModel( + host: 'MwcMqs.stackwallet.com', + port: 443, + name: 'Americas', + id: 'americas', + useSSL: true, + enabled: true, + isFailover: true, + isDown: false, + ); + + static MwcMqsServerModel get asia => MwcMqsServerModel( + host: 'MwcMqs.hyperbig.com', + port: 443, + name: 'Asia', + id: 'asia', + useSSL: true, + enabled: true, + isFailover: true, + isDown: false, + ); + + static MwcMqsServerModel get europe => MwcMqsServerModel( + host: 'MwcMqs.fastepic.eu', + port: 443, + name: 'Europe', + id: 'europe', + useSSL: true, + enabled: true, + isFailover: true, + isDown: false, + ); + + static final defaultMwcMqsServer = americas; +} diff --git a/lib/utilities/git_status.dart b/lib/utilities/git_status.dart index 093bc39af3..17617c0fa7 100644 --- a/lib/utilities/git_status.dart +++ b/lib/utilities/git_status.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_libepiccash/git_versions.dart' as epic_versions; // import 'package:flutter_libmonero/git_versions.dart' as monero_versions; +import 'package:flutter_libmwc/git_versions.dart' as mimblewimblecoin_versions; import 'package:http/http.dart'; import 'package:lelantus/git_versions.dart' as firo_versions; @@ -21,6 +22,8 @@ abstract class GitStatus { static String get firoCommit => firo_versions.getPluginVersion(); static String get epicCashCommit => epic_versions.getPluginVersion(); // static String get moneroCommit => monero_versions.getPluginVersion(); + static String get mimblewimblecoinCommit => + mimblewimblecoin_versions.getPluginVersion(); static String get appCommitHash => AppConfig.commitHash; @@ -78,31 +81,60 @@ abstract class GitStatus { return _cachedEpicStatus!; } + + static CommitStatus? _cachedMimblewimblecoinStatus; + static Future getMimblewimblecoinCommitStatus() async { + if (_cachedMimblewimblecoinStatus != null) { + return _cachedMimblewimblecoinStatus!; + } + final List results = await Future.wait([ + _doesCommitExist("cypherstack", "flutter_libmwc", mimblewimblecoinCommit), + _isHeadCommit( + "cypherstack", + "flutter_libmwc", + "main", + mimblewimblecoinCommit, + ), + ]); + + final commitExists = results[0]; + final commitIsHead = results[1]; + + if (commitExists && commitIsHead) { + _cachedMimblewimblecoinStatus = CommitStatus.isHead; + } else if (commitExists) { + _cachedMimblewimblecoinStatus = CommitStatus.isOldCommit; + } else { + _cachedMimblewimblecoinStatus = CommitStatus.notACommit; + } + + return _cachedMimblewimblecoinStatus!; + } + + //static CommitStatus? _cachedMoneroStatus; + //static Future getMoneroCommitStatus() async { + // if (_cachedMoneroStatus != null) { + // return _cachedMoneroStatus!; + // } // - // static CommitStatus? _cachedMoneroStatus; - // static Future getMoneroCommitStatus() async { - // if (_cachedMoneroStatus != null) { - // return _cachedMoneroStatus!; - // } - // - // final List results = await Future.wait([ - // _doesCommitExist("cypherstack", "flutter_libmonero", moneroCommit), - // _isHeadCommit("cypherstack", "flutter_libmonero", "main", moneroCommit), - // ]); + // final List results = await Future.wait([ + // _doesCommitExist("cypherstack", "flutter_libmonero", moneroCommit), + // _isHeadCommit("cypherstack", "flutter_libmonero", "main", moneroCommit), + // ]); // - // final commitExists = results[0]; - // final commitIsHead = results[1]; + // final commitExists = results[0]; + // final commitIsHead = results[1]; // - // if (commitExists && commitIsHead) { - // _cachedMoneroStatus = CommitStatus.isHead; - // } else if (commitExists) { - // _cachedMoneroStatus = CommitStatus.isOldCommit; - // } else { - // _cachedMoneroStatus = CommitStatus.notACommit; - // } + // if (commitExists && commitIsHead) { + // _cachedMoneroStatus = CommitStatus.isHead; + // } else if (commitExists) { + // _cachedMoneroStatus = CommitStatus.isOldCommit; + // } else { + // _cachedMoneroStatus = CommitStatus.notACommit; + // } // - // return _cachedMoneroStatus!; - // } + // return _cachedMoneroStatus!; + //} static TextStyle styleForStatus(CommitStatus status, BuildContext context) { final Color color; diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart new file mode 100644 index 0000000000..b06ec1f1d4 --- /dev/null +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -0,0 +1,128 @@ +import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; + +import '../../../models/isar/models/blockchain_data/address.dart'; +import '../../../models/node_model.dart'; +import '../../../utilities/default_nodes.dart'; +import '../../../utilities/enums/derive_path_type_enum.dart'; +import '../crypto_currency.dart'; +import '../intermediate/bip39_currency.dart'; + +class Mimblewimblecoin extends Bip39Currency { + Mimblewimblecoin(super.network) { + _idMain = "mimblewimblecoin"; + _uriScheme = "mimblewimblecoin"; // ? + switch (network) { + case CryptoCurrencyNetwork.main: + _id = _idMain; + _name = "Mimblewimblecoin"; + _ticker = "MWC"; + default: + throw Exception("Unsupported network: $network"); + } + } + + late final String _id; + @override + String get identifier => _id; + + late final String _idMain; + @override + String get mainNetId => _idMain; + + late final String _name; + @override + String get prettyName => _name; + + late final String _uriScheme; + @override + String get uriScheme => _uriScheme; + + late final String _ticker; + @override + String get ticker => _ticker; + + @override + String get genesisHash { + return "not used in mimblewimblecoin"; + } + + @override + // change this to change the number of confirms a tx needs in order to show as confirmed + int get minConfirms => 3; + + @override + bool validateAddress(String address) { + // Invalid address that contains HTTP and mwcmqs domain + if ((address.startsWith("http://") || address.startsWith("https://")) && + address.contains("@")) { + return false; + } + if (address.startsWith("http://") || address.startsWith("https://")) { + if (Uri.tryParse(address) != null) { + return true; + } + } + + return mimblewimblecoin.LibMwc.validateSendAddress(address: address); + } + + @override + NodeModel get defaultNode { + switch (network) { + case CryptoCurrencyNetwork.main: + return NodeModel( + host: "http://epiccash.stackwallet.com", + port: 3413, + name: DefaultNodes.defaultName, + id: DefaultNodes.buildId(this), + useSSL: false, + enabled: true, + coinName: identifier, + isFailover: true, + isDown: false, + ); + + default: + throw UnimplementedError(); + } + } + + @override + int get defaultSeedPhraseLength => 24; + + @override + int get fractionDigits => 8; + + @override + bool get hasBuySupport => false; + + @override + bool get hasMnemonicPassphraseSupport => false; + + @override + List get possibleMnemonicLengths => [defaultSeedPhraseLength, 12]; + + @override + AddressType get defaultAddressType => AddressType.mimbleWimble; + + @override + BigInt get satsPerCoin => BigInt.from(100000000); + + @override + int get targetBlockTimeSeconds => 60; + + @override + DerivePathType get defaultDerivePathType => throw UnsupportedError( + "$runtimeType does not use bitcoin style derivation paths", + ); + + @override + Uri defaultBlockExplorer(String txid) { + switch (network) { + default: + throw Exception( + "Unsupported network for defaultBlockExplorer(): $network", + ); + } + } +} diff --git a/lib/wallets/crypto_currency/crypto_currency.dart b/lib/wallets/crypto_currency/crypto_currency.dart index 066675d288..58d7e010f9 100644 --- a/lib/wallets/crypto_currency/crypto_currency.dart +++ b/lib/wallets/crypto_currency/crypto_currency.dart @@ -11,6 +11,7 @@ export 'coins/dash.dart'; export 'coins/dogecoin.dart'; export 'coins/ecash.dart'; export 'coins/epiccash.dart'; +export 'coins/mimblewimblecoin.dart'; export 'coins/ethereum.dart'; export 'coins/firo.dart'; export 'coins/litecoin.dart'; @@ -62,7 +63,7 @@ abstract class CryptoCurrency { int get minConfirms; int get minCoinbaseConfirms => minConfirms; - // TODO: [prio=low] could be handled differently as (at least) epiccash does not use this + // TODO: [prio=low] could be handled differently as (at least) epiccash/mimblewimblecoin does not use this String get genesisHash; bool validateAddress(String address); diff --git a/lib/wallets/isar/models/wallet_info.dart b/lib/wallets/isar/models/wallet_info.dart index eb6a4e9ea2..dd7dcba413 100644 --- a/lib/wallets/isar/models/wallet_info.dart +++ b/lib/wallets/isar/models/wallet_info.dart @@ -515,6 +515,7 @@ class WalletInfo implements IsarId { abstract class WalletInfoKeys { static const String tokenContractAddresses = "tokenContractAddressesKey"; static const String epiccashData = "epiccashDataKey"; + static const String mimblewimblecoinData = "mimblewimblecoinDataKey"; static const String bananoMonkeyImageBytes = "monkeyImageBytesKey"; static const String tezosDerivationPath = "tezosDerivationPathKey"; static const String lelantusCoinIsarRescanRequired = diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart new file mode 100644 index 0000000000..ed77e34bc7 --- /dev/null +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -0,0 +1,1197 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:decimal/decimal.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; +import 'package:flutter_libmwc/models/transaction.dart' + as mimblewimblecoin_models; +import 'package:isar/isar.dart'; +import 'package:mutex/mutex.dart'; +import 'package:stack_wallet_backup/generate_password.dart'; +import 'package:web_socket_channel/web_socket_channel.dart'; + +import '../../../models/balance.dart'; +import '../../../models/mwcmqs_config_model.dart'; +import '../../../models/isar/models/blockchain_data/address.dart'; +import '../../../models/isar/models/blockchain_data/transaction.dart'; +import '../../../models/isar/models/blockchain_data/v2/input_v2.dart'; +import '../../../models/isar/models/blockchain_data/v2/output_v2.dart'; +import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; +import '../../../models/node_model.dart'; +import '../../../models/paymint/fee_object_model.dart'; +import '../../../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; +import '../../../services/event_bus/events/global/blocks_remaining_event.dart'; +import '../../../services/event_bus/events/global/node_connection_status_changed_event.dart'; +import '../../../services/event_bus/events/global/refresh_percent_changed_event.dart'; +import '../../../services/event_bus/events/global/wallet_sync_status_changed_event.dart'; +import '../../../services/event_bus/global_event_bus.dart'; +import '../../../utilities/amount/amount.dart'; +import '../../../utilities/flutter_secure_storage_interface.dart'; +import '../../../utilities/logger.dart'; +import '../../../utilities/stack_file_system.dart'; +//import '../../../utilities/test_epic_box_connection.dart'; +import '../../crypto_currency/crypto_currency.dart'; +import '../../models/tx_data.dart'; +import '../intermediate/bip39_wallet.dart'; +import '../supporting/mimblewimblecoin_wallet_info_extension.dart'; + +// +// refactor of https://github.com/cypherstack/stack_wallet/blob/1d9fb4cd069f22492ece690ac788e05b8f8b1209/lib/services/coins/epiccash/epiccash_wallet.dart +// +class MimblewimblecoinWallet extends Bip39Wallet { + MimblewimblecoinWallet(CryptoCurrencyNetwork network) + : super(Mimblewimblecoin(network)); + + final syncMutex = Mutex(); + NodeModel? _mimblewimblecoinNode; + Timer? timer; + + double highestPercent = 0; + Future get getSyncPercent async { + final int lastScannedBlock = + info.mimblewimblecoinData?.lastScannedBlock ?? 0; + final _chainHeight = await chainHeight; + final double restorePercent = lastScannedBlock / _chainHeight; + GlobalEventBus.instance + .fire(RefreshPercentChangedEvent(highestPercent, walletId)); + if (restorePercent > highestPercent) { + highestPercent = restorePercent; + } + + final int blocksRemaining = _chainHeight - lastScannedBlock; + GlobalEventBus.instance + .fire(BlocksRemainingEvent(blocksRemaining, walletId)); + + return restorePercent < 0 ? 0.0 : restorePercent; + } + + /*Future updateEpicboxConfig(String host, int port) async { + final String stringConfig = jsonEncode({ + "epicbox_domain": host, + "epicbox_port": port, + "epicbox_protocol_unsecure": false, + "epicbox_address_index": 0, + }); + await secureStorageInterface.write( + key: '${walletId}_epicboxConfig', + value: stringConfig, + ); + // TODO: refresh anything that needs to be refreshed/updated due to epicbox info changed + } + */ + /// returns an empty String on success, error message on failure + Future cancelPendingTransactionAndPost(String txSlateId) async { + try { + final String wallet = (await secureStorageInterface.read( + key: '${walletId}_wallet', + ))!; + + final result = await mimblewimblecoin.LibMwc.cancelTransaction( + wallet: wallet, + transactionId: txSlateId, + ); + Logging.instance.log( + "cancel $txSlateId result: $result", + level: LogLevel.Info, + ); + return result; + } catch (e, s) { + Logging.instance.log("$e, $s", level: LogLevel.Error); + return e.toString(); + } + } + + Future getMwcMqsConfig() async { + final MwcMqsConfigModel _mwcMqsConfig = MwcMqsConfigModel.fromServer( + DefaultMwcMqs.defaultMwcMqsServer, + ); + + //Get the default Epicbox server and check if it's conected + // bool isEpicboxConnected = await _testEpicboxServer( + // DefaultEpicBoxes.defaultEpicBoxServer.host, DefaultEpicBoxes.defaultEpicBoxServer.port ?? 443); + + // if (isEpicboxConnected) { + //Use default server for as Epicbox config + + // } + // else { + // //Use Europe config + // _epicBoxConfig = EpicBoxConfigModel.fromServer(DefaultEpicBoxes.europe); + // } + // // example of selecting another random server from the default list + // // alternative servers: copy list of all default EB servers but remove the default default + // // List alternativeServers = DefaultEpicBoxes.all; + // // alternativeServers.removeWhere((opt) => opt.name == DefaultEpicBoxes.defaultEpicBoxServer.name); + // // alternativeServers.shuffle(); // randomize which server is used + // // _epicBoxConfig = EpicBoxConfigModel.fromServer(alternativeServers.first); + // + // // TODO test this connection before returning it + // } + + return _mwcMqsConfig; + } + + // ================= Private ================================================= + + Future _getConfig() async { + if (_mimblewimblecoinNode == null) { + await updateNode(); + } + final NodeModel node = _mimblewimblecoinNode!; + final String nodeAddress = node.host; + final int port = node.port; + + final uri = Uri.parse(nodeAddress).replace(port: port); + + final String nodeApiAddress = uri.toString(); + + final walletDir = await _currentWalletDirPath(); + + final Map config = {}; + config["wallet_dir"] = walletDir; + config["check_node_api_http_addr"] = nodeApiAddress; + config["chain"] = "mainnet"; + config["account"] = "default"; + config["api_listen_port"] = port; + config["api_listen_interface"] = + nodeApiAddress.replaceFirst(uri.scheme, ""); + final String stringConfig = jsonEncode(config); + return stringConfig; + } + + Future _currentWalletDirPath() async { + final Directory appDir = await StackFileSystem.applicationRootDirectory(); + + final path = "${appDir.path}/mimblewimblecoin"; + final String name = walletId.trim(); + return '$path/$name'; + } + + Future _nativeFee( + int satoshiAmount, { + bool ifErrorEstimateFee = false, + }) async { + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + try { + final available = info.cachedBalance.spendable.raw.toInt(); + + final transactionFees = await mimblewimblecoin.LibMwc.getTransactionFees( + wallet: wallet!, + amount: satoshiAmount, + minimumConfirmations: cryptoCurrency.minConfirms, + available: available, + ); + + int realFee = 0; + try { + realFee = + (Decimal.parse(transactionFees.fee.toString())).toBigInt().toInt(); + } catch (e, s) { + //todo: come back to this + debugPrint("$e $s"); + } + return realFee; + } catch (e, s) { + Logging.instance.log("Error getting fees $e - $s", level: LogLevel.Error); + rethrow; + } + } + + Future _startSync() async { + Logging.instance.log("request start sync", level: LogLevel.Info); + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + const int refreshFromNode = 1; + if (!syncMutex.isLocked) { + await syncMutex.protect(() async { + // How does getWalletBalances start syncing???? + await mimblewimblecoin.LibMwc.getWalletBalances( + wallet: wallet!, + refreshFromNode: refreshFromNode, + minimumConfirmations: 10, + ); + }); + } else { + Logging.instance.log("request start sync denied", level: LogLevel.Info); + } + } + + Future< + ({ + double awaitingFinalization, + double pending, + double spendable, + double total + })> _allWalletBalances() async { + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + const refreshFromNode = 0; + return await mimblewimblecoin.LibMwc.getWalletBalances( + wallet: wallet!, + refreshFromNode: refreshFromNode, + minimumConfirmations: cryptoCurrency.minConfirms, + ); + } + + /*Future _testEpicboxServer(EpicBoxConfigModel epicboxConfig) async { + final host = epicboxConfig.host; + final port = epicboxConfig.port ?? 443; + WebSocketChannel? channel; + try { + final uri = Uri.parse('wss://$host:$port'); + + channel = WebSocketChannel.connect( + uri, + ); + + await channel.ready; + + final response = await channel.stream.first.timeout( + const Duration(seconds: 2), + ); + + return response is String && response.contains("Challenge"); + } catch (_) { + Logging.instance.log( + "_testEpicBoxConnection failed on \"$host:$port\"", + level: LogLevel.Info, + ); + return false; + } finally { + await channel?.sink.close(); + } + }*/ + + Future _putSendToAddresses( + ({String slateId, String commitId}) slateData, + Map txAddressInfo, + ) async { + try { + final slatesToCommits = info.mimblewimblecoinData?.slatesToCommits ?? {}; + final from = txAddressInfo['from']; + final to = txAddressInfo['to']; + slatesToCommits[slateData.slateId] = { + "commitId": slateData.commitId, + "from": from, + "to": to, + }; + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: info.mimblewimblecoinData!.copyWith( + slatesToCommits: slatesToCommits, + ), + isar: mainDB.isar, + ); + return true; + } catch (e, s) { + Logging.instance + .log("ERROR STORING ADDRESS $e $s", level: LogLevel.Error); + return false; + } + } + + Future _getCurrentIndex() async { + try { + final int receivingIndex = info.mimblewimblecoinData!.receivingIndex; + // TODO: go through pendingarray and processed array and choose the index + // of the last one that has not been processed, or the index after the one most recently processed; + return receivingIndex; + } catch (e, s) { + Logging.instance.log("$e $s", level: LogLevel.Error); + return 0; + } + } + + Future

_generateAndStoreReceivingAddressForIndex( + int index, + ) async { + Address? address = await getCurrentReceivingAddress(); + + if (address != null) { + final splitted = address.value.split('@'); + //Check if the address is the same as the current epicbox domain + //Since we're only using one epicbpox now this doesn't apply but will be + // useful in the future + final mwcmqsConfig = await getMwcMqsConfig(); + if (splitted[1] != mwcmqsConfig.host) { + //Update the address + address = await thisWalletAddress(index, mwcmqsConfig); + } + } else { + final mwcmqsConfig = await getMwcMqsConfig(); + address = await thisWalletAddress(index, mwcmqsConfig); + } + + if (info.cachedReceivingAddress != address.value) { + await info.updateReceivingAddress( + newAddress: address.value, + isar: mainDB.isar, + ); + } + return address; + } + + Future
thisWalletAddress( + int index, + MwcMqsConfigModel mwcmqsConfig, + ) async { + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + + final walletAddress = await mimblewimblecoin.LibMwc.getAddressInfo( + wallet: wallet!, + index: index, + mwcmqsConfig: mwcmqsConfig.toString(), + ); + + Logging.instance.log( + "WALLET_ADDRESS_IS $walletAddress", + level: LogLevel.Info, + ); + + final address = Address( + walletId: walletId, + value: walletAddress, + derivationIndex: index, + derivationPath: null, + type: AddressType.mimbleWimble, + subType: AddressSubType.receiving, + publicKey: [], // ?? + ); + await mainDB.updateOrPutAddresses([address]); + return address; + } + + Future _startScans() async { + try { + //First stop the current listener + mimblewimblecoin.LibMwc.stopMwcmqsListener(); + final wallet = + await secureStorageInterface.read(key: '${walletId}_wallet'); + + // max number of blocks to scan per loop iteration + const scanChunkSize = 10000; + + // force firing of scan progress event + await getSyncPercent; + + // fetch current chain height and last scanned block (should be the + // restore height if full rescan or a wallet restore) + int chainHeight = await this.chainHeight; + int lastScannedBlock = info.mimblewimblecoinData!.lastScannedBlock; + + // loop while scanning in chain in chunks (of blocks?) + while (lastScannedBlock < chainHeight) { + Logging.instance.log( + "chainHeight: $chainHeight, lastScannedBlock: $lastScannedBlock", + level: LogLevel.Info, + ); + + final int nextScannedBlock = await mimblewimblecoin.LibMwc.scanOutputs( + wallet: wallet!, + startHeight: lastScannedBlock, + numberOfBlocks: scanChunkSize, + ); + + // update local cache + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: info.mimblewimblecoinData!.copyWith( + lastScannedBlock: nextScannedBlock, + ), + isar: mainDB.isar, + ); + + // force firing of scan progress event + await getSyncPercent; + + // update while loop condition variables + chainHeight = await this.chainHeight; + lastScannedBlock = nextScannedBlock; + } + + Logging.instance.log( + "_startScans successfully at the tip", + level: LogLevel.Info, + ); + //Once scanner completes restart listener + await _listenToMwcmqs(); + } catch (e, s) { + Logging.instance.log( + "_startScans failed: $e\n$s", + level: LogLevel.Error, + ); + rethrow; + } + } + + Future _listenToMwcmqs() async { + Logging.instance.log("STARTING WALLET LISTENER ....", level: LogLevel.Info); + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); + mimblewimblecoin.LibMwc.startMwcMqsListener( + wallet: wallet!, + mwcmqsConfig: mwcmqsConfig.toString(), + ); + } + + // As opposed to fake config? + Future _getRealConfig() async { + String? config = await secureStorageInterface.read( + key: '${walletId}_config', + ); + if (Platform.isIOS) { + final walletDir = await _currentWalletDirPath(); + final editConfig = jsonDecode(config as String); + + editConfig["wallet_dir"] = walletDir; + config = jsonEncode(editConfig); + } + return config!; + } + + // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index + int _calculateRestoreHeightFrom({required DateTime date}) { + final int secondsSinceEpoch = date.millisecondsSinceEpoch ~/ 1000; + const int mimblewimblecoinFirstBlock = 1565370278; + const double overestimateSecondsPerBlock = 61; + final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; + final int approximateHeight = chosenSeconds ~/ overestimateSecondsPerBlock; + int height = approximateHeight; + if (height < 0) { + height = 0; + } + return height; + } + + // ============== Overrides ================================================== + + @override + int get isarTransactionVersion => 2; + + @override + FilterOperation? get changeAddressFilterOperation => + FilterGroup.and(standardChangeAddressFilters); + + @override + FilterOperation? get receivingAddressFilterOperation => + FilterGroup.and(standardReceivingAddressFilters); + + @override + Future checkSaveInitialReceivingAddress() async { + // epiccash seems ok with nothing here? + } + + @override + Future init({bool? isRestore}) async { + if (isRestore != true) { + String? encodedWallet = + await secureStorageInterface.read(key: "${walletId}_wallet"); + + // check if should create a new wallet + if (encodedWallet == null) { + await updateNode(); + final mnemonicString = await getMnemonic(); + + final String password = generatePassword(); + final String stringConfig = await _getConfig(); + final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); + + await secureStorageInterface.write( + key: '${walletId}_config', + value: stringConfig, + ); + await secureStorageInterface.write( + key: '${walletId}_password', + value: password, + ); + await secureStorageInterface.write( + key: '${walletId}_mwcmqsConfig', + value: mwcmqsConfig.toString(), + ); + + final String name = walletId; + + await mimblewimblecoin.LibMwc.initializeNewWallet( + config: stringConfig, + mnemonic: mnemonicString, + password: password, + name: name, + ); + + //Open wallet + encodedWallet = await mimblewimblecoin.LibMwc.openWallet( + config: stringConfig, + password: password, + ); + await secureStorageInterface.write( + key: '${walletId}_wallet', + value: encodedWallet, + ); + + //Store MwcMqs address info + await _generateAndStoreReceivingAddressForIndex(0); + + // subtract a couple days to ensure we have a buffer for SWB + final bufferedCreateHeight = _calculateRestoreHeightFrom( + date: DateTime.now().subtract(const Duration(days: 2)), + ); + + final mimblewimblecoinData = ExtraMimblewimblecoinWalletInfo( + receivingIndex: 0, + changeIndex: 0, + slatesToAddresses: {}, + slatesToCommits: {}, + lastScannedBlock: bufferedCreateHeight, + restoreHeight: bufferedCreateHeight, + creationHeight: bufferedCreateHeight, + ); + + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: mimblewimblecoinData, + isar: mainDB.isar, + ); + } else { + try { + Logging.instance.log( + "initializeExisting() ${cryptoCurrency.prettyName} wallet", + level: LogLevel.Info, + ); + + final config = await _getRealConfig(); + final password = + await secureStorageInterface.read(key: '${walletId}_password'); + + final walletOpen = await mimblewimblecoin.LibMwc.openWallet( + config: config, + password: password!, + ); + await secureStorageInterface.write( + key: '${walletId}_wallet', + value: walletOpen, + ); + + await updateNode(); + } catch (e, s) { + // do nothing, still allow user into wallet + Logging.instance.log( + "$runtimeType init() failed: $e\n$s", + level: LogLevel.Error, + ); + } + } + } + + return await super.init(); + } + + @override + Future confirmSend({required TxData txData}) async { + try { + final wallet = + await secureStorageInterface.read(key: '${walletId}_wallet'); + final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); + + // TODO determine whether it is worth sending change to a change address. + + final String receiverAddress = txData.recipients!.first.address; + + if (!receiverAddress.startsWith("http://") || + !receiverAddress.startsWith("https://")) { + final bool isMwcmqsConnected = await _testMwcmqsServer( + mwcmqsConfig, + ); + if (!isMwcmqsConnected) { + throw Exception( + "Failed to send TX : Unable to reach mimblewimblecoin server"); + } + } + + ({String commitId, String slateId}) transaction; + + if (receiverAddress.startsWith("http://") || + receiverAddress.startsWith("https://")) { + transaction = await mimblewimblecoin.LibMwc.txHttpSend( + wallet: wallet!, + selectionStrategyIsAll: 0, + minimumConfirmations: cryptoCurrency.minConfirms, + message: txData.noteOnChain ?? "", + amount: txData.recipients!.first.amount.raw.toInt(), + address: txData.recipients!.first.address, + ); + } else { + transaction = await mimblewimblecoin.LibMwc.createTransaction( + wallet: wallet!, + amount: txData.recipients!.first.amount.raw.toInt(), + address: txData.recipients!.first.address, + secretKeyIndex: 0, + mwcmqsConfig: mwsmqsConfig.toString(), + minimumConfirmations: cryptoCurrency.minConfirms, + note: txData.noteOnChain!, + ); + } + + final Map txAddressInfo = {}; + txAddressInfo['from'] = (await getCurrentReceivingAddress())!.value; + txAddressInfo['to'] = txData.recipients!.first.address; + await _putSendToAddresses(transaction, txAddressInfo); + + return txData.copyWith( + txid: transaction.slateId, + ); + } catch (e, s) { + Logging.instance.log( + "Mimblewimblecoin confirmSend: $e\n$s", + level: LogLevel.Error, + ); + rethrow; + } + } + + @override + Future prepareSend({required TxData txData}) async { + try { + if (txData.recipients?.length != 1) { + throw Exception( + "Mimblewimblecoin prepare send requires a single recipient!"); + } + + ({String address, Amount amount, bool isChange}) recipient = + txData.recipients!.first; + + final int realFee = await _nativeFee(recipient.amount.raw.toInt()); + final feeAmount = Amount( + rawValue: BigInt.from(realFee), + fractionDigits: cryptoCurrency.fractionDigits, + ); + + if (feeAmount > info.cachedBalance.spendable) { + throw Exception( + "Mimblewimblecoin prepare send fee is greater than available balance!", + ); + } + + if (info.cachedBalance.spendable == recipient.amount) { + recipient = ( + address: recipient.address, + amount: recipient.amount - feeAmount, + isChange: recipient.isChange, + ); + } + + return txData.copyWith( + recipients: [recipient], + fee: feeAmount, + ); + } catch (e, s) { + Logging.instance + .log("Mimblewimblecoin prepareSend: $e\n$s", level: LogLevel.Error); + rethrow; + } + } + + @override + Future recover({required bool isRescan}) async { + try { + await refreshMutex.protect(() async { + if (isRescan) { + // clear blockchain info + await mainDB.deleteWalletBlockchainData(walletId); + + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: info.mimblewimblecoinData!.copyWith( + lastScannedBlock: info.mimblewimblecoinData!.restoreHeight, + ), + isar: mainDB.isar, + ); + + unawaited(_startScans()); + } else { + await updateNode(); + final String password = generatePassword(); + + final String stringConfig = await _getConfig(); + final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); + + await secureStorageInterface.write( + key: '${walletId}_config', + value: stringConfig, + ); + await secureStorageInterface.write( + key: '${walletId}_password', + value: password, + ); + + await secureStorageInterface.write( + key: '${walletId}_mwcmqsConfig', + value: mwcmqsConfig.toString(), + ); + + await mimblewimblecoin.LibMwc.recoverWallet( + config: stringConfig, + password: password, + mnemonic: await getMnemonic(), + name: info.walletId, + ); + + final mimblewimblecoinData = ExtraMimblewimblecoinWalletInfo( + receivingIndex: 0, + changeIndex: 0, + slatesToAddresses: {}, + slatesToCommits: {}, + lastScannedBlock: info.restoreHeight, + restoreHeight: info.restoreHeight, + creationHeight: + info.mimblewimblecoinData?.creationHeight ?? info.restoreHeight, + ); + + await info.updateExtraMimblewimblecoinWalletInfo( + mimblewimblecoinData: mimblewimblecoinData, + isar: mainDB.isar, + ); + + //Open Wallet + final walletOpen = await mimblewimblecoin.LibMwc.openWallet( + config: stringConfig, + password: password, + ); + await secureStorageInterface.write( + key: '${walletId}_wallet', + value: walletOpen, + ); + + await _generateAndStoreReceivingAddressForIndex( + mimblewimblecoinData.receivingIndex, + ); + } + }); + + unawaited(refresh()); + } catch (e, s) { + Logging.instance.log( + "Exception rethrown from electrumx_mixin recover(): $e\n$s", + level: LogLevel.Info, + ); + + rethrow; + } + } + + @override + Future refresh() async { + // Awaiting this lock could be dangerous. + // Since refresh is periodic (generally) + if (refreshMutex.isLocked) { + return; + } + + try { + // this acquire should be almost instant due to above check. + // Slight possibility of race but should be irrelevant + await refreshMutex.acquire(); + + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.syncing, + walletId, + cryptoCurrency, + ), + ); + + // if (info.epicData?.creationHeight == null) { + // await info.updateExtraEpiccashWalletInfo(epicData: inf, isar: isar) + // await epicUpdateCreationHeight(await chainHeight); + // } + + // this will always be zero???? + final int curAdd = await _getCurrentIndex(); + await _generateAndStoreReceivingAddressForIndex(curAdd); + + await _startScans(); + + unawaited(_startSync()); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.0, walletId)); + await updateChainHeight(); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.1, walletId)); + + // if (this is MultiAddressInterface) { + // await (this as MultiAddressInterface) + // .checkReceivingAddressForTransactions(); + // } + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.2, walletId)); + + // // TODO: [prio=low] handle this differently. Extra modification of this file for coin specific functionality should be avoided. + // if (this is MultiAddressInterface) { + // await (this as MultiAddressInterface) + // .checkChangeAddressForTransactions(); + // } + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.3, walletId)); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.50, walletId)); + final fetchFuture = updateTransactions(); + // if (currentHeight != storedHeight) { + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.60, walletId)); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.70, walletId)); + + await fetchFuture; + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.80, walletId)); + + // await getAllTxsToWatch(); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.90, walletId)); + + await updateBalance(); + + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(1.0, walletId)); + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.synced, + walletId, + cryptoCurrency, + ), + ); + + if (shouldAutoSync) { + timer ??= Timer.periodic(const Duration(seconds: 150), (timer) async { + // chain height check currently broken + // if ((await chainHeight) != (await storedChainHeight)) { + + // TODO: [prio=med] some kind of quick check if wallet needs to refresh to replace the old refreshIfThereIsNewData call + // if (await refreshIfThereIsNewData()) { + unawaited(refresh()); + + // } + // } + }); + } + } catch (error, strace) { + GlobalEventBus.instance.fire( + NodeConnectionStatusChangedEvent( + NodeConnectionStatus.disconnected, + walletId, + cryptoCurrency, + ), + ); + GlobalEventBus.instance.fire( + WalletSyncStatusChangedEvent( + WalletSyncStatus.unableToSync, + walletId, + cryptoCurrency, + ), + ); + Logging.instance.log( + "Caught exception in refreshWalletData(): $error\n$strace", + level: LogLevel.Error, + ); + } finally { + refreshMutex.release(); + } + } + + @override + Future updateBalance() async { + try { + final balances = await _allWalletBalances(); + final balance = Balance( + total: Amount.fromDecimal( + Decimal.parse(balances.total.toString()) + + Decimal.parse(balances.awaitingFinalization.toString()), + fractionDigits: cryptoCurrency.fractionDigits, + ), + spendable: Amount.fromDecimal( + Decimal.parse(balances.spendable.toString()), + fractionDigits: cryptoCurrency.fractionDigits, + ), + blockedTotal: Amount.zeroWith( + fractionDigits: cryptoCurrency.fractionDigits, + ), + pendingSpendable: Amount.fromDecimal( + Decimal.parse(balances.pending.toString()), + fractionDigits: cryptoCurrency.fractionDigits, + ), + ); + + await info.updateBalance( + newBalance: balance, + isar: mainDB.isar, + ); + } catch (e, s) { + Logging.instance.log( + "Mimblewimblecoin wallet failed to update balance: $e\n$s", + level: LogLevel.Warning, + ); + } + } + + @override + Future updateTransactions() async { + try { + final wallet = + await secureStorageInterface.read(key: '${walletId}_wallet'); + const refreshFromNode = 1; + + final myAddresses = await mainDB + .getAddresses(walletId) + .filter() + .typeEqualTo(AddressType.mimbleWimble) + .and() + .subTypeEqualTo(AddressSubType.receiving) + .and() + .valueIsNotEmpty() + .valueProperty() + .findAll(); + final myAddressesSet = myAddresses.toSet(); + + final transactions = await mimblewimblecoin.LibMwc.getTransactions( + wallet: wallet!, + refreshFromNode: refreshFromNode, + ); + + final List txns = []; + + final slatesToCommits = info.mimblewimblecoinData?.slatesToCommits ?? {}; + + for (final tx in transactions) { + Logging.instance.log("tx: $tx", level: LogLevel.Info); + + final isIncoming = + tx.txType == mimblewimblecoin_models.TransactionType.TxReceived || + tx.txType == + mimblewimblecoin_models.TransactionType.TxReceivedCancelled; + final slateId = tx.txSlateId; + final commitId = slatesToCommits[slateId]?['commitId'] as String?; + final numberOfMessages = tx.messages?.messages.length; + final onChainNote = tx.messages?.messages[0].message; + final addressFrom = slatesToCommits[slateId]?["from"] as String?; + final addressTo = slatesToCommits[slateId]?["to"] as String?; + + final credit = int.parse(tx.amountCredited); + final debit = int.parse(tx.amountDebited); + final fee = int.tryParse(tx.fee ?? "0") ?? 0; + + // hack Mimblewimblecoin tx data into inputs and outputs + final List outputs = []; + final List inputs = []; + final addressFromIsMine = myAddressesSet.contains(addressFrom); + final addressToIsMine = myAddressesSet.contains(addressTo); + + OutputV2 output = OutputV2.isarCantDoRequiredInDefaultConstructor( + scriptPubKeyHex: "00", + valueStringSats: credit.toString(), + addresses: [ + if (addressFrom != null) addressFrom, + ], + walletOwns: true, + ); + final InputV2 input = InputV2.isarCantDoRequiredInDefaultConstructor( + scriptSigHex: null, + scriptSigAsm: null, + sequence: null, + outpoint: null, + addresses: [if (addressTo != null) addressTo], + valueStringSats: debit.toString(), + witness: null, + innerRedeemScriptAsm: null, + coinbase: null, + walletOwns: true, + ); + + final TransactionType txType; + if (isIncoming) { + if (addressToIsMine && addressFromIsMine) { + txType = TransactionType.sentToSelf; + } else { + txType = TransactionType.incoming; + } + output = output.copyWith( + addresses: [ + myAddressesSet + .first, // Must be changed if we ever do more than a single wallet address!!! + ], + walletOwns: true, + ); + } else { + txType = TransactionType.outgoing; + } + + outputs.add(output); + inputs.add(input); + + final otherData = { + "isMimblewimblecoinTransaction": true, + "numberOfMessages": numberOfMessages, + "slateId": slateId, + "onChainNote": onChainNote, + "isCancelled": tx.txType == + mimblewimblecoin_models.TransactionType.TxSentCancelled || + tx.txType == + mimblewimblecoin_models.TransactionType.TxReceivedCancelled, + "overrideFee": Amount( + rawValue: BigInt.from(fee), + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), + }; + + final txn = TransactionV2( + walletId: walletId, + blockHash: null, + hash: commitId ?? tx.id.toString(), + txid: commitId ?? tx.id.toString(), + timestamp: + DateTime.parse(tx.creationTs).millisecondsSinceEpoch ~/ 1000, + height: tx.confirmed ? tx.kernelLookupMinHeight ?? 1 : null, + inputs: List.unmodifiable(inputs), + outputs: List.unmodifiable(outputs), + version: 0, + type: txType, + subType: TransactionSubType.none, + otherData: jsonEncode(otherData), + ); + + txns.add(txn); + } + + await mainDB.isar.writeTxn(() async { + await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .deleteAll(); + await mainDB.isar.transactionV2s.putAll(txns); + }); + } catch (e, s) { + Logging.instance.log( + "${cryptoCurrency.runtimeType} ${cryptoCurrency.network} net wallet" + " \"${info.name}\"_${info.walletId} updateTransactions() failed: $e\n$s", + level: LogLevel.Warning, + ); + } + } + + @override + Future updateUTXOs() async { + // not used for mimblewimblecoin + return false; + } + + @override + Future updateNode() async { + _mimblewimblecoinNode = getCurrentNode(); + + // TODO: [prio=low] move this out of secure storage if secure storage not needed + final String stringConfig = await _getConfig(); + await secureStorageInterface.write( + key: '${walletId}_config', + value: stringConfig, + ); + + // unawaited(refresh()); + } + + @override + Future pingCheck() async { + try { + final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); + + // force unwrap optional as we want connection test to fail if wallet + // wasn't initialized or mwcmqs node was set to null + return await testMimblewimblecoinNodeConnection( + NodeFormData() + ..host = node!.host + ..useSSL = node.useSSL + ..port = node.port, + ) != + null; + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Info); + return false; + } + } + + @override + Future updateChainHeight() async { + final config = await _getRealConfig(); + final latestHeight = + await mimblewimblecoin.LibMwc.getChainHeight(config: config); + await info.updateCachedChainHeight( + newHeight: latestHeight, + isar: mainDB.isar, + ); + } + + @override + Future estimateFeeFor(Amount amount, int feeRate) async { + // setting ifErrorEstimateFee doesn't do anything as its not used in the nativeFee function????? + final int currentFee = await _nativeFee( + amount.raw.toInt(), + ifErrorEstimateFee: true, + ); + return Amount( + rawValue: BigInt.from(currentFee), + fractionDigits: cryptoCurrency.fractionDigits, + ); + } + + @override + Future get fees async { + // this wasn't done before the refactor either so... + // TODO: implement _getFees + return FeeObject( + numberOfBlocksFast: 10, + numberOfBlocksAverage: 10, + numberOfBlocksSlow: 10, + fast: 1, + medium: 1, + slow: 1, + ); + } + + @override + Future updateSentCachedTxData({required TxData txData}) async { + // TODO: [prio=low] Was not used before refactor so maybe not required(?) + return txData; + } + + @override + Future exit() async { + timer?.cancel(); + timer = null; + await super.exit(); + Logging.instance + .log("Mimblewimblecoin_wallet exit finished", level: LogLevel.Info); + } +} + +Future deleteMimblewimblecoinWallet({ + required String walletId, + required SecureStorageInterface secureStore, +}) async { + final wallet = await secureStore.read(key: '${walletId}_wallet'); + String? config = await secureStore.read(key: '${walletId}_config'); + if (Platform.isIOS) { + final Directory appDir = await StackFileSystem.applicationRootDirectory(); + + final path = "${appDir.path}/mimblewimblecoin"; + final String name = walletId.trim(); + final walletDir = '$path/$name'; + + final editConfig = jsonDecode(config as String); + + editConfig["wallet_dir"] = walletDir; + config = jsonEncode(editConfig); + } + + if (wallet == null) { + return "Tried to delete non existent mimblewimblecoin wallet file with walletId=$walletId"; + } else { + try { + return mimblewimblecoin.LibMwc.deleteWallet( + wallet: wallet, + config: config!, + ); + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Error); + return "deleteMimblewimblecoinWallet($walletId) failed..."; + } + } +} diff --git a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart new file mode 100644 index 0000000000..724657079e --- /dev/null +++ b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart @@ -0,0 +1,111 @@ +import 'dart:convert'; + +import 'package:isar/isar.dart'; +import '../../../utilities/logger.dart'; +import '../../isar/models/wallet_info.dart'; + +extension MimblewimblecoinWalletInfoExtension on WalletInfo { + ExtraMimblewimblecoinWalletInfo? get epicData { + final String? data = + otherData[WalletInfoKeys.mimblewimblecoinData] as String?; + if (data == null) { + return null; + } + try { + return ExtraMimblewimblecoinWalletInfo.fromMap( + Map.from( + jsonDecode(data) as Map, + ), + ); + } catch (e, s) { + Logging.instance.log( + "ExtraMimblewimblecoinWalletInfo.fromMap failed: $e\n$s", + level: LogLevel.Error, + ); + return null; + } + } + + Future updateExtraMimblewimblecoinWalletInfo({ + required ExtraMimblewimblecoinWalletInfo epicData, + required Isar isar, + }) async { + await updateOtherData( + newEntries: { + WalletInfoKeys.mimblewimblecoinData: jsonEncode(epicData.toMap()), + }, + isar: isar, + ); + } +} + +/// Holds data previously stored in hive +class ExtraMimblewimblecoinWalletInfo { + final int receivingIndex; + final int changeIndex; + + // TODO [prio=low] strongly type these maps at some point + final Map slatesToAddresses; + final Map slatesToCommits; + + final int lastScannedBlock; + final int restoreHeight; + final int creationHeight; + + ExtraMimblewimblecoinWalletInfo({ + required this.receivingIndex, + required this.changeIndex, + required this.slatesToAddresses, + required this.slatesToCommits, + required this.lastScannedBlock, + required this.restoreHeight, + required this.creationHeight, + }); + + // Convert the object to JSON + Map toMap() { + return { + 'receivingIndex': receivingIndex, + 'changeIndex': changeIndex, + 'slatesToAddresses': slatesToAddresses, + 'slatesToCommits': slatesToCommits, + 'lastScannedBlock': lastScannedBlock, + 'restoreHeight': restoreHeight, + 'creationHeight': creationHeight, + }; + } + + ExtraMimblewimblecoinWalletInfo.fromMap(Map json) + : receivingIndex = json['receivingIndex'] as int, + changeIndex = json['changeIndex'] as int, + slatesToAddresses = json['slatesToAddresses'] as Map, + slatesToCommits = json['slatesToCommits'] as Map, + lastScannedBlock = json['lastScannedBlock'] as int, + restoreHeight = json['restoreHeight'] as int, + creationHeight = json['creationHeight'] as int; + + ExtraMimblewimblecoinWalletInfo copyWith({ + int? receivingIndex, + int? changeIndex, + Map? slatesToAddresses, + Map? slatesToCommits, + int? lastScannedBlock, + int? restoreHeight, + int? creationHeight, + }) { + return ExtraMimblewimblecoinWalletInfo( + receivingIndex: receivingIndex ?? this.receivingIndex, + changeIndex: changeIndex ?? this.changeIndex, + slatesToAddresses: slatesToAddresses ?? this.slatesToAddresses, + slatesToCommits: slatesToCommits ?? this.slatesToCommits, + lastScannedBlock: lastScannedBlock ?? this.lastScannedBlock, + restoreHeight: restoreHeight ?? this.restoreHeight, + creationHeight: creationHeight ?? this.creationHeight, + ); + } + + @override + String toString() { + return toMap().toString(); + } +} diff --git a/lib/wallets/wallet/wallet.dart b/lib/wallets/wallet/wallet.dart index 0beaf2a809..78079da970 100644 --- a/lib/wallets/wallet/wallet.dart +++ b/lib/wallets/wallet/wallet.dart @@ -34,6 +34,7 @@ import 'impl/dash_wallet.dart'; import 'impl/dogecoin_wallet.dart'; import 'impl/ecash_wallet.dart'; import 'impl/epiccash_wallet.dart'; +import 'impl/mimblewimblecoin_wallet.dart'; import 'impl/ethereum_wallet.dart'; import 'impl/firo_wallet.dart'; import 'impl/litecoin_wallet.dart'; @@ -359,6 +360,9 @@ abstract class Wallet { case const (Epiccash): return EpiccashWallet(net); + case const (Mimblewimblecoin): + return Mimblewimblecoin(net); + case const (Ethereum): return EthereumWallet(net); diff --git a/lib/widgets/onetime_popups/tor_has_been_add_dialog.dart b/lib/widgets/onetime_popups/tor_has_been_add_dialog.dart index 9709c46b3d..05dd4311da 100644 --- a/lib/widgets/onetime_popups/tor_has_been_add_dialog.dart +++ b/lib/widgets/onetime_popups/tor_has_been_add_dialog.dart @@ -153,7 +153,7 @@ class _TorHasBeenAddedDialogState extends State<_TorHasBeenAddedDialog> { height: Util.isDesktop ? 24 : 16, ), Text( - "Note: Tor does NOT yet work for Monero or Epic Cash wallets. " + "Note: Tor does NOT yet work for Monero, Mimblewimblecoin or Epic Cash wallets. " "Opening one of these will leak your IP address.", style: Util.isDesktop ? STextStyles.desktopTextMedium(context) diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index cab5043d66..f842858e9f 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -27,6 +27,7 @@ import '../utilities/constants.dart'; import '../utilities/format.dart'; import '../utilities/text_styles.dart'; import '../utilities/util.dart'; +import '../wallets/crypto_currency/coins/mimblewimblecoin.dart'; import '../wallets/crypto_currency/crypto_currency.dart'; import 'desktop/desktop_dialog.dart'; @@ -63,6 +64,10 @@ class _TransactionCardState extends ConsumerState { return "Restored Funds"; } + if (coin is Mimblewimblecoin && _transaction.slateId == null) { + return "Restored Funds"; + } + final confirmedStatus = _transaction.isConfirmed( currentHeight, minConfirms, @@ -188,6 +193,20 @@ class _TransactionCardState extends ConsumerState { ); return; } + + if (coin is Mimblewimblecoin && _transaction.slateId == null) { + unawaited( + showFloatingFlushBar( + context: context, + message: + "Restored Mimblewimblecoin funds from your Seed have no Data.", + type: FlushBarType.warning, + duration: const Duration(seconds: 5), + ), + ); + return; + } + if (Util.isDesktop) { await showDialog( context: context, diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 88c196c5ed..8faaf8a515 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -30,6 +30,9 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) flutter_libepiccash_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLibepiccashPlugin"); flutter_libepiccash_plugin_register_with_registrar(flutter_libepiccash_registrar); + g_autoptr(FlPluginRegistrar) flutter_libmwc_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLibmwcPlugin"); + flutter_libmwc_plugin_register_with_registrar(flutter_libmwc_registrar); g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 72a81025cb..52a5ce0a5c 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST desktop_drop devicelocale flutter_libepiccash + flutter_libmwc flutter_secure_storage_linux isar_flutter_libs sqlite3_flutter_libs diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 66db749d95..6c71495b0f 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,6 +12,7 @@ import desktop_drop import device_info_plus import devicelocale import flutter_libepiccash +import flutter_libmwc import flutter_local_notifications import flutter_secure_storage_macos import isar_flutter_libs @@ -34,6 +35,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin")) FlutterLibepiccashPlugin.register(with: registry.registrar(forPlugin: "FlutterLibepiccashPlugin")) + FlutterLibmwcPlugin.register(with: registry.registrar(forPlugin: "FlutterLibmwcPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 3ccce4760b..285d841128 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -812,6 +812,13 @@ packages: relative: true source: path version: "0.0.1" + flutter_libmwc: + dependency: "direct main" + description: + path: "crypto_plugins/flutter_libmwc" + relative: true + source: path + version: "0.0.1" flutter_libsparkmobile: dependency: "direct main" description: diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index 0fd8e5e8a0..1139cbfc8d 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -62,6 +62,7 @@ final List _supportedCoins = List.unmodifiable([ Dogecoin(CryptoCurrencyNetwork.main), Ecash(CryptoCurrencyNetwork.main), Epiccash(CryptoCurrencyNetwork.main), + Mimblewimblecoin(CryptoCurrencyNetwork.main), Ethereum(CryptoCurrencyNetwork.main), Firo(CryptoCurrencyNetwork.main), Litecoin(CryptoCurrencyNetwork.main), diff --git a/scripts/app_config/templates/linux/CMakeLists.txt b/scripts/app_config/templates/linux/CMakeLists.txt index 25750ef4f6..d6ac3f66d3 100644 --- a/scripts/app_config/templates/linux/CMakeLists.txt +++ b/scripts/app_config/templates/linux/CMakeLists.txt @@ -137,7 +137,10 @@ install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libepic_cash_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/linux/build/libmobileliblelantus.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libemwc/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/linux/build/libmobileliblelantus.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so.1.7.4" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index e44cdcab45..a0f43767b9 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -45,6 +45,9 @@ dependencies: flutter_libepiccash: path: ./crypto_plugins/flutter_libepiccash + flutter_libmwc: + path: ./crypto_plugins/flutter_libmwc + bitcoindart: git: url: https://github.com/cypherstack/bitcoindart.git diff --git a/scripts/app_config/templates/windows/CMakeLists.txt b/scripts/app_config/templates/windows/CMakeLists.txt index b9add856d7..dd039195e2 100644 --- a/scripts/app_config/templates/windows/CMakeLists.txt +++ b/scripts/app_config/templates/windows/CMakeLists.txt @@ -83,6 +83,9 @@ install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 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_libmwc/scripts/windows/build/libmwc_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) diff --git a/scripts/ios/build_all.sh b/scripts/ios/build_all.sh index bcb03e9912..aa9d52aeef 100755 --- a/scripts/ios/build_all.sh +++ b/scripts/ios/build_all.sh @@ -16,6 +16,8 @@ rustup target add x86_64-apple-ios (cd ../../crypto_plugins/flutter_liblelantus/scripts/ios && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) diff --git a/scripts/ios/build_all_campfire.sh b/scripts/ios/build_all_campfire.sh index bcb03e9912..aa9d52aeef 100755 --- a/scripts/ios/build_all_campfire.sh +++ b/scripts/ios/build_all_campfire.sh @@ -16,6 +16,8 @@ rustup target add x86_64-apple-ios (cd ../../crypto_plugins/flutter_liblelantus/scripts/ios && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) diff --git a/scripts/ios/build_all_duo.sh b/scripts/ios/build_all_duo.sh index 89e6f46417..c6c11add7a 100755 --- a/scripts/ios/build_all_duo.sh +++ b/scripts/ios/build_all_duo.sh @@ -18,6 +18,8 @@ rustup target add x86_64-apple-ios (cd ../../crypto_plugins/flutter_liblelantus/scripts/ios && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) diff --git a/scripts/linux/build_all.sh b/scripts/linux/build_all.sh index 423646185e..4cc1ad8a09 100755 --- a/scripts/linux/build_all.sh +++ b/scripts/linux/build_all.sh @@ -14,6 +14,8 @@ mkdir -p build ./build_secure_storage_deps.sh (cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) diff --git a/scripts/linux/build_all_campfire.sh b/scripts/linux/build_all_campfire.sh index 423646185e..4cc1ad8a09 100755 --- a/scripts/linux/build_all_campfire.sh +++ b/scripts/linux/build_all_campfire.sh @@ -14,6 +14,8 @@ mkdir -p build ./build_secure_storage_deps.sh (cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) diff --git a/scripts/linux/build_all_duo.sh b/scripts/linux/build_all_duo.sh index 78067b4786..ace233fd8e 100755 --- a/scripts/linux/build_all_duo.sh +++ b/scripts/linux/build_all_duo.sh @@ -16,6 +16,8 @@ mkdir -p build ./build_secure_storage_deps.sh & (cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) diff --git a/scripts/macos/build_all.sh b/scripts/macos/build_all.sh index af608846fe..2e28e2605d 100755 --- a/scripts/macos/build_all.sh +++ b/scripts/macos/build_all.sh @@ -8,6 +8,8 @@ set_rust_to_1671 (cd ../../crypto_plugins/flutter_liblelantus/scripts/macos && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) diff --git a/scripts/macos/build_all_campfire.sh b/scripts/macos/build_all_campfire.sh index af608846fe..2e28e2605d 100755 --- a/scripts/macos/build_all_campfire.sh +++ b/scripts/macos/build_all_campfire.sh @@ -8,6 +8,8 @@ set_rust_to_1671 (cd ../../crypto_plugins/flutter_liblelantus/scripts/macos && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) diff --git a/scripts/macos/build_all_duo.sh b/scripts/macos/build_all_duo.sh index 8a53e58015..ac3788cc86 100755 --- a/scripts/macos/build_all_duo.sh +++ b/scripts/macos/build_all_duo.sh @@ -10,6 +10,8 @@ set_rust_to_1671 (cd ../../crypto_plugins/flutter_liblelantus/scripts/macos && ./build_all.sh ) (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) diff --git a/scripts/rust_version.sh b/scripts/rust_version.sh index 8cda1229ba..a95729573d 100755 --- a/scripts/rust_version.sh +++ b/scripts/rust_version.sh @@ -16,4 +16,13 @@ set_rust_to_1720() { echo "Rust version 1.72.0 is not installed. Please install it using 'rustup install 1.72.0'." >&2 exit 1 fi +} + +set_rust_to_1810() { + if rustup toolchain list | grep -q "1.72.0"; then + rustup default 1.81.0 + else + echo "Rust version 1.81.0 is not installed. Please install it using 'rustup install 1.81.0'." >&2 + exit 1 + fi } \ No newline at end of file diff --git a/scripts/windows/build_all.sh b/scripts/windows/build_all.sh index 191a46cc07..53c035a3da 100755 --- a/scripts/windows/build_all.sh +++ b/scripts/windows/build_all.sh @@ -9,6 +9,8 @@ set_rust_to_1671 mkdir -p build (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) (cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) diff --git a/scripts/windows/build_all_campfire.sh b/scripts/windows/build_all_campfire.sh index 191a46cc07..53c035a3da 100755 --- a/scripts/windows/build_all_campfire.sh +++ b/scripts/windows/build_all_campfire.sh @@ -9,6 +9,8 @@ set_rust_to_1671 mkdir -p build (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) (cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) diff --git a/scripts/windows/build_all_duo.sh b/scripts/windows/build_all_duo.sh index 3e27eff02a..e5667b188d 100755 --- a/scripts/windows/build_all_duo.sh +++ b/scripts/windows/build_all_duo.sh @@ -11,6 +11,8 @@ set_rust_to_1671 mkdir -p build (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) (cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) +set_rust_to_1810 +(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) set_rust_to_1720 (cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) diff --git a/scripts/windows/deps.sh b/scripts/windows/deps.sh index c9975b4572..513a8ce7f2 100644 --- a/scripts/windows/deps.sh +++ b/scripts/windows/deps.sh @@ -1,9 +1,9 @@ #!/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 -sudo apt install libgtk2.0-dev +(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./deps.sh ) +(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./mxedeps.sh ) +(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./deps.sh) +# (cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./monerodeps.sh && ./mxedeps.sh) & wait echo "Done building" diff --git a/test/price_test.dart b/test/price_test.dart index dc7aaeb9e1..e15a7b95d7 100644 --- a/test/price_test.dart +++ b/test/price_test.dart @@ -1,3 +1,5 @@ +// TODO MWC + import 'dart:convert'; import 'dart:io'; diff --git a/test/sample_data/theme_json.dart b/test/sample_data/theme_json.dart index 6f7601b42b..660e680e68 100644 --- a/test/sample_data/theme_json.dart +++ b/test/sample_data/theme_json.dart @@ -10,6 +10,7 @@ const Map lightThemeJsonMap = { "firo": "0xFFFF897A", "dogecoin": "0xFFFFE079", "epicCash": "0xFFC5C7CB", + "mimblewimblecoin": "0xFFC5C7CB", "ethereum": "0xFFA7ADE9", "monero": "0xFFFF9E6B", "namecoin": "0xFF91B1E1", @@ -186,6 +187,7 @@ const Map lightThemeJsonMap = { "bitcoincash": "dummy.svg", "dogecoin": "dummy.svg", "epicCash": "dummy.svg", + "mimblewimblecoin": "dummy.svg", "ethereum": "dummy.svg", "firo": "dummy.svg", "monero": "dummy.svg", @@ -197,6 +199,7 @@ const Map lightThemeJsonMap = { "bitcoincash_image": "dummy.svg", "dogecoin_image": "dummy.svg", "epicCash_image": "dummy.svg.svg", + "mimblewimblecoin_image": "dummy.svg", "ethereum_image": "dummy.svg", "firo_image": "dummy.svg", "monero_image": "dummy.svg", @@ -208,6 +211,7 @@ const Map lightThemeJsonMap = { "bitcoincash_image_secondary": "dummy.svg", "dogecoin_image_secondary": "dummy.svg", "epicCash_image_secondary": "dummy.svg.svg", + "mimblewimblecoin_image_secondary": "dummy.svg", "ethereum_image_secondary": "dummy.svg", "firo_image_secondary": "dummy.svg", "monero_image_secondary": "dummy.svg", diff --git a/test/sample_data/theme_json_v2.dart b/test/sample_data/theme_json_v2.dart index 3f9fbfb7f3..1327789c02 100644 --- a/test/sample_data/theme_json_v2.dart +++ b/test/sample_data/theme_json_v2.dart @@ -13,6 +13,7 @@ const Map lightThemeJsonMap = { "dogecoin": "0xFFFFE079", "eCash": "0xFFC5C7CB", "epicCash": "0xFFC5C7CB", + "mimblewimblecoin": "0xFFC5C7CB", "ethereum": "0xFFA7ADE9", "monero": "0xFFFF9E6B", "namecoin": "0xFF91B1E1", @@ -194,6 +195,7 @@ const Map lightThemeJsonMap = { "dogecoin": "dummy.svg", "eCash": "dummy.svg", "epicCash": "dummy.svg", + "mimblewimblecoin": "dummy.svg", "ethereum": "dummy.svg", "firo": "dummy.svg", "monero": "dummy.svg", @@ -208,6 +210,7 @@ const Map lightThemeJsonMap = { "dogecoin": "dummy.svg", "eCash": "dummy.svg", "epicCash": "dummy.svg", + "mimblewimblecoin": "dummy.svg", "ethereum": "dummy.svg", "firo": "dummy.svg", "monero": "dummy.svg", @@ -222,6 +225,7 @@ const Map lightThemeJsonMap = { "dogecoin": "dummy.svg", "eCash": "dummy.svg", "epicCash": "dummy.svg", + "mimblewimblecoin": "dummy.svg", "ethereum": "dummy.svg", "firo": "dummy.svg", "monero": "dummy.svg", diff --git a/test/services/node_service_test.dart b/test/services/node_service_test.dart index cb402deedd..fed0f3eecd 100644 --- a/test/services/node_service_test.dart +++ b/test/services/node_service_test.dart @@ -1,3 +1,5 @@ +// TODO MWC + import 'package:flutter_test/flutter_test.dart'; import 'package:hive/hive.dart'; import 'package:hive_test/hive_test.dart'; @@ -160,6 +162,17 @@ void main() { torEnabled: true, clearnetEnabled: true, ); + final nodeD = NodeModel( + host: "host3", + port: 423, + name: "btcnode", + id: "pnodeID3", + useSSL: true, + enabled: true, + coinName: "mimblewimblecoin", + isFailover: true, + isDown: false, + ); setUp(() async { await NodeService(secureStorageInterface: FakeSecureStorage()) diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 74ef33c4e5..bb0e286970 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("DesktopDropPlugin")); FlutterLibepiccashPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterLibepiccashPluginCApi")); + FlutterLibmwcPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FlutterLibmwcPluginCApi")); FlutterSecureStorageWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); IsarFlutterLibsPluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 2f370e6855..0cd9af7943 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -8,6 +8,7 @@ list(APPEND FLUTTER_PLUGIN_LIST cs_monero_flutter_libs_windows desktop_drop flutter_libepiccash + flutter_libmwc flutter_secure_storage_windows isar_flutter_libs local_auth_windows From 652c1412c833037bb199905110a97c9b277ef82f Mon Sep 17 00:00:00 2001 From: vekamo Date: Sun, 27 Oct 2024 15:54:52 +0400 Subject: [PATCH 007/178] continuous integration mwc v2 --- .../blockchain_data/v2/transaction_v2.g.dart | 142 +++-- lib/models/isar/stack_theme.g.dart | 603 +++++++++++++++--- lib/models/mwcmqs_config_model.dart | 118 ++++ lib/models/mwcmqs_server_model.dart | 93 +++ .../type_adaptors/mwcmqs_config_model.g.dart | 50 ++ .../type_adaptors/mwcmqs_server_model.g.dart | 62 ++ .../restore_wallet_view.dart | 28 +- .../wallet_settings_view.dart | 2 +- lib/utilities/address_utils.dart | 2 +- lib/utilities/test_mwcmqs_connection.dart | 81 +++ .../coins/mimblewimblecoin.dart | 6 +- .../wallet/impl/mimblewimblecoin_wallet.dart | 95 ++- ...imblewimblecoin_wallet_info_extension.dart | 6 +- lib/wallets/wallet/wallet.dart | 2 +- pubspec.lock | 2 +- .../app_config/templates/linux/CMakeLists.txt | 2 +- scripts/linux/build_secp256k1.sh | 2 +- test/cached_electrumx_test.mocks.dart | 13 + .../pages/send_view/send_view_test.mocks.dart | 13 + .../exchange/exchange_view_test.mocks.dart | 13 + .../managed_favorite_test.mocks.dart | 13 + .../node_options_sheet_test.mocks.dart | 13 + .../transaction_card_test.mocks.dart | 13 + 23 files changed, 1181 insertions(+), 193 deletions(-) create mode 100644 lib/models/mwcmqs_config_model.dart create mode 100644 lib/models/mwcmqs_server_model.dart create mode 100644 lib/models/type_adaptors/mwcmqs_config_model.g.dart create mode 100644 lib/models/type_adaptors/mwcmqs_server_model.g.dart create mode 100644 lib/utilities/test_mwcmqs_connection.dart diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart index 68d8a18c57..3bb48c3508 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart @@ -53,66 +53,71 @@ const TransactionV2Schema = CollectionSchema( name: r'isEpiccashTransaction', type: IsarType.bool, ), - r'nonce': PropertySchema( + r'isMimblewimblecoinTransaction': PropertySchema( id: 7, + name: r'isMimblewimblecoinTransaction', + type: IsarType.bool, + ), + r'nonce': PropertySchema( + id: 8, name: r'nonce', type: IsarType.long, ), r'numberOfMessages': PropertySchema( - id: 8, + id: 9, name: r'numberOfMessages', type: IsarType.long, ), r'onChainNote': PropertySchema( - id: 9, + id: 10, name: r'onChainNote', type: IsarType.string, ), r'otherData': PropertySchema( - id: 10, + id: 11, name: r'otherData', type: IsarType.string, ), r'outputs': PropertySchema( - id: 11, + id: 12, name: r'outputs', type: IsarType.objectList, target: r'OutputV2', ), r'slateId': PropertySchema( - id: 12, + id: 13, name: r'slateId', type: IsarType.string, ), r'subType': PropertySchema( - id: 13, + id: 14, name: r'subType', type: IsarType.byte, enumMap: _TransactionV2subTypeEnumValueMap, ), r'timestamp': PropertySchema( - id: 14, + id: 15, name: r'timestamp', type: IsarType.long, ), r'txid': PropertySchema( - id: 15, + id: 16, name: r'txid', type: IsarType.string, ), r'type': PropertySchema( - id: 16, + id: 17, name: r'type', type: IsarType.byte, enumMap: _TransactionV2typeEnumValueMap, ), r'version': PropertySchema( - id: 17, + id: 18, name: r'version', type: IsarType.long, ), r'walletId': PropertySchema( - id: 18, + id: 19, name: r'walletId', type: IsarType.string, ) @@ -256,23 +261,24 @@ void _transactionV2Serialize( ); writer.writeBool(offsets[5], object.isCancelled); writer.writeBool(offsets[6], object.isEpiccashTransaction); - writer.writeLong(offsets[7], object.nonce); - writer.writeLong(offsets[8], object.numberOfMessages); - writer.writeString(offsets[9], object.onChainNote); - writer.writeString(offsets[10], object.otherData); + writer.writeBool(offsets[7], object.isMimblewimblecoinTransaction); + writer.writeLong(offsets[8], object.nonce); + writer.writeLong(offsets[9], object.numberOfMessages); + writer.writeString(offsets[10], object.onChainNote); + writer.writeString(offsets[11], object.otherData); writer.writeObjectList( - offsets[11], + offsets[12], allOffsets, OutputV2Schema.serialize, object.outputs, ); - writer.writeString(offsets[12], object.slateId); - writer.writeByte(offsets[13], object.subType.index); - writer.writeLong(offsets[14], object.timestamp); - writer.writeString(offsets[15], object.txid); - writer.writeByte(offsets[16], object.type.index); - writer.writeLong(offsets[17], object.version); - writer.writeString(offsets[18], object.walletId); + writer.writeString(offsets[13], object.slateId); + writer.writeByte(offsets[14], object.subType.index); + writer.writeLong(offsets[15], object.timestamp); + writer.writeString(offsets[16], object.txid); + writer.writeByte(offsets[17], object.type.index); + writer.writeLong(offsets[18], object.version); + writer.writeString(offsets[19], object.walletId); } TransactionV2 _transactionV2Deserialize( @@ -292,23 +298,23 @@ TransactionV2 _transactionV2Deserialize( InputV2(), ) ?? [], - otherData: reader.readStringOrNull(offsets[10]), + otherData: reader.readStringOrNull(offsets[11]), outputs: reader.readObjectList( - offsets[11], + offsets[12], OutputV2Schema.deserialize, allOffsets, OutputV2(), ) ?? [], subType: - _TransactionV2subTypeValueEnumMap[reader.readByteOrNull(offsets[13])] ?? + _TransactionV2subTypeValueEnumMap[reader.readByteOrNull(offsets[14])] ?? TransactionSubType.none, - timestamp: reader.readLong(offsets[14]), - txid: reader.readString(offsets[15]), - type: _TransactionV2typeValueEnumMap[reader.readByteOrNull(offsets[16])] ?? + timestamp: reader.readLong(offsets[15]), + txid: reader.readString(offsets[16]), + type: _TransactionV2typeValueEnumMap[reader.readByteOrNull(offsets[17])] ?? TransactionType.outgoing, - version: reader.readLong(offsets[17]), - walletId: reader.readString(offsets[18]), + version: reader.readLong(offsets[18]), + walletId: reader.readString(offsets[19]), ); object.id = id; return object; @@ -342,14 +348,16 @@ P _transactionV2DeserializeProp

( case 6: return (reader.readBool(offset)) as P; case 7: - return (reader.readLongOrNull(offset)) as P; + return (reader.readBool(offset)) as P; case 8: return (reader.readLongOrNull(offset)) as P; case 9: - return (reader.readStringOrNull(offset)) as P; + return (reader.readLongOrNull(offset)) as P; case 10: return (reader.readStringOrNull(offset)) as P; case 11: + return (reader.readStringOrNull(offset)) as P; + case 12: return (reader.readObjectList( offset, OutputV2Schema.deserialize, @@ -357,22 +365,22 @@ P _transactionV2DeserializeProp

( OutputV2(), ) ?? []) as P; - case 12: - return (reader.readStringOrNull(offset)) as P; case 13: + return (reader.readStringOrNull(offset)) as P; + case 14: return (_TransactionV2subTypeValueEnumMap[ reader.readByteOrNull(offset)] ?? TransactionSubType.none) as P; - case 14: - return (reader.readLong(offset)) as P; case 15: - return (reader.readString(offset)) as P; + return (reader.readLong(offset)) as P; case 16: + return (reader.readString(offset)) as P; + case 17: return (_TransactionV2typeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionType.outgoing) as P; - case 17: - return (reader.readLong(offset)) as P; case 18: + return (reader.readLong(offset)) as P; + case 19: return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); @@ -1513,6 +1521,16 @@ extension TransactionV2QueryFilter }); } + QueryBuilder + isMimblewimblecoinTransactionEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'isMimblewimblecoinTransaction', + value: value, + )); + }); + } + QueryBuilder nonceIsNull() { return QueryBuilder.apply(this, (query) { @@ -2807,6 +2825,20 @@ extension TransactionV2QuerySortBy }); } + QueryBuilder + sortByIsMimblewimblecoinTransaction() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.asc); + }); + } + + QueryBuilder + sortByIsMimblewimblecoinTransactionDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.desc); + }); + } + QueryBuilder sortByNonce() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'nonce', Sort.asc); @@ -3038,6 +3070,20 @@ extension TransactionV2QuerySortThenBy }); } + QueryBuilder + thenByIsMimblewimblecoinTransaction() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.asc); + }); + } + + QueryBuilder + thenByIsMimblewimblecoinTransactionDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.desc); + }); + } + QueryBuilder thenByNonce() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'nonce', Sort.asc); @@ -3221,6 +3267,13 @@ extension TransactionV2QueryWhereDistinct }); } + QueryBuilder + distinctByIsMimblewimblecoinTransaction() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'isMimblewimblecoinTransaction'); + }); + } + QueryBuilder distinctByNonce() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'nonce'); @@ -3347,6 +3400,13 @@ extension TransactionV2QueryProperty }); } + QueryBuilder + isMimblewimblecoinTransactionProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'isMimblewimblecoinTransaction'); + }); + } + QueryBuilder nonceProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'nonce'); diff --git a/lib/models/isar/stack_theme.g.dart b/lib/models/isar/stack_theme.g.dart index c77d979f54..0117ef7b9b 100644 --- a/lib/models/isar/stack_theme.g.dart +++ b/lib/models/isar/stack_theme.g.dart @@ -18148,138 +18148,153 @@ const ThemeAssetsSchema = Schema( name: r'loadingGif', type: IsarType.string, ), - r'monero': PropertySchema( + r'mimblewimblecoin': PropertySchema( id: 26, + name: r'mimblewimblecoin', + type: IsarType.string, + ), + r'mimblewimblecoinImage': PropertySchema( + id: 27, + name: r'mimblewimblecoinImage', + type: IsarType.string, + ), + r'mimblewimblecoinImageSecondary': PropertySchema( + id: 28, + name: r'mimblewimblecoinImageSecondary', + type: IsarType.string, + ), + r'monero': PropertySchema( + id: 29, name: r'monero', type: IsarType.string, ), r'moneroImage': PropertySchema( - id: 27, + id: 30, name: r'moneroImage', type: IsarType.string, ), r'moneroImageSecondary': PropertySchema( - id: 28, + id: 31, name: r'moneroImageSecondary', type: IsarType.string, ), r'namecoin': PropertySchema( - id: 29, + id: 32, name: r'namecoin', type: IsarType.string, ), r'namecoinImage': PropertySchema( - id: 30, + id: 33, name: r'namecoinImage', type: IsarType.string, ), r'namecoinImageSecondary': PropertySchema( - id: 31, + id: 34, name: r'namecoinImageSecondary', type: IsarType.string, ), r'particl': PropertySchema( - id: 32, + id: 35, name: r'particl', type: IsarType.string, ), r'particlImage': PropertySchema( - id: 33, + id: 36, name: r'particlImage', type: IsarType.string, ), r'particlImageSecondary': PropertySchema( - id: 34, + id: 37, name: r'particlImageSecondary', type: IsarType.string, ), r'personaEasy': PropertySchema( - id: 35, + id: 38, name: r'personaEasy', type: IsarType.string, ), r'personaIncognito': PropertySchema( - id: 36, + id: 39, name: r'personaIncognito', type: IsarType.string, ), r'receive': PropertySchema( - id: 37, + id: 40, name: r'receive', type: IsarType.string, ), r'receiveCancelled': PropertySchema( - id: 38, + id: 41, name: r'receiveCancelled', type: IsarType.string, ), r'receivePending': PropertySchema( - id: 39, + id: 42, name: r'receivePending', type: IsarType.string, ), r'send': PropertySchema( - id: 40, + id: 43, name: r'send', type: IsarType.string, ), r'sendCancelled': PropertySchema( - id: 41, + id: 44, name: r'sendCancelled', type: IsarType.string, ), r'sendPending': PropertySchema( - id: 42, + id: 45, name: r'sendPending', type: IsarType.string, ), r'stack': PropertySchema( - id: 43, + id: 46, name: r'stack', type: IsarType.string, ), r'stackIcon': PropertySchema( - id: 44, + id: 47, name: r'stackIcon', type: IsarType.string, ), r'themePreview': PropertySchema( - id: 45, + id: 48, name: r'themePreview', type: IsarType.string, ), r'themeSelector': PropertySchema( - id: 46, + id: 49, name: r'themeSelector', type: IsarType.string, ), r'txExchange': PropertySchema( - id: 47, + id: 50, name: r'txExchange', type: IsarType.string, ), r'txExchangeFailed': PropertySchema( - id: 48, + id: 51, name: r'txExchangeFailed', type: IsarType.string, ), r'txExchangePending': PropertySchema( - id: 49, + id: 52, name: r'txExchangePending', type: IsarType.string, ), r'wownero': PropertySchema( - id: 50, + id: 53, name: r'wownero', type: IsarType.string, ), r'wowneroImage': PropertySchema( - id: 51, + id: 54, name: r'wowneroImage', type: IsarType.string, ), r'wowneroImageSecondary': PropertySchema( - id: 52, + id: 55, name: r'wowneroImageSecondary', type: IsarType.string, ) @@ -18332,6 +18347,9 @@ int _themeAssetsEstimateSize( bytesCount += 3 + value.length * 3; } } + bytesCount += 3 + object.mimblewimblecoin.length * 3; + bytesCount += 3 + object.mimblewimblecoinImage.length * 3; + bytesCount += 3 + object.mimblewimblecoinImageSecondary.length * 3; bytesCount += 3 + object.monero.length * 3; bytesCount += 3 + object.moneroImage.length * 3; bytesCount += 3 + object.moneroImageSecondary.length * 3; @@ -18394,33 +18412,36 @@ void _themeAssetsSerialize( writer.writeString(offsets[23], object.litecoinImage); writer.writeString(offsets[24], object.litecoinImageSecondary); writer.writeString(offsets[25], object.loadingGif); - writer.writeString(offsets[26], object.monero); - writer.writeString(offsets[27], object.moneroImage); - writer.writeString(offsets[28], object.moneroImageSecondary); - writer.writeString(offsets[29], object.namecoin); - writer.writeString(offsets[30], object.namecoinImage); - writer.writeString(offsets[31], object.namecoinImageSecondary); - writer.writeString(offsets[32], object.particl); - writer.writeString(offsets[33], object.particlImage); - writer.writeString(offsets[34], object.particlImageSecondary); - writer.writeString(offsets[35], object.personaEasy); - writer.writeString(offsets[36], object.personaIncognito); - writer.writeString(offsets[37], object.receive); - writer.writeString(offsets[38], object.receiveCancelled); - writer.writeString(offsets[39], object.receivePending); - writer.writeString(offsets[40], object.send); - writer.writeString(offsets[41], object.sendCancelled); - writer.writeString(offsets[42], object.sendPending); - writer.writeString(offsets[43], object.stack); - writer.writeString(offsets[44], object.stackIcon); - writer.writeString(offsets[45], object.themePreview); - writer.writeString(offsets[46], object.themeSelector); - writer.writeString(offsets[47], object.txExchange); - writer.writeString(offsets[48], object.txExchangeFailed); - writer.writeString(offsets[49], object.txExchangePending); - writer.writeString(offsets[50], object.wownero); - writer.writeString(offsets[51], object.wowneroImage); - writer.writeString(offsets[52], object.wowneroImageSecondary); + writer.writeString(offsets[26], object.mimblewimblecoin); + writer.writeString(offsets[27], object.mimblewimblecoinImage); + writer.writeString(offsets[28], object.mimblewimblecoinImageSecondary); + writer.writeString(offsets[29], object.monero); + writer.writeString(offsets[30], object.moneroImage); + writer.writeString(offsets[31], object.moneroImageSecondary); + writer.writeString(offsets[32], object.namecoin); + writer.writeString(offsets[33], object.namecoinImage); + writer.writeString(offsets[34], object.namecoinImageSecondary); + writer.writeString(offsets[35], object.particl); + writer.writeString(offsets[36], object.particlImage); + writer.writeString(offsets[37], object.particlImageSecondary); + writer.writeString(offsets[38], object.personaEasy); + writer.writeString(offsets[39], object.personaIncognito); + writer.writeString(offsets[40], object.receive); + writer.writeString(offsets[41], object.receiveCancelled); + writer.writeString(offsets[42], object.receivePending); + writer.writeString(offsets[43], object.send); + writer.writeString(offsets[44], object.sendCancelled); + writer.writeString(offsets[45], object.sendPending); + writer.writeString(offsets[46], object.stack); + writer.writeString(offsets[47], object.stackIcon); + writer.writeString(offsets[48], object.themePreview); + writer.writeString(offsets[49], object.themeSelector); + writer.writeString(offsets[50], object.txExchange); + writer.writeString(offsets[51], object.txExchangeFailed); + writer.writeString(offsets[52], object.txExchangePending); + writer.writeString(offsets[53], object.wownero); + writer.writeString(offsets[54], object.wowneroImage); + writer.writeString(offsets[55], object.wowneroImageSecondary); } ThemeAssets _themeAssetsDeserialize( @@ -18456,33 +18477,36 @@ ThemeAssets _themeAssetsDeserialize( object.litecoinImage = reader.readString(offsets[23]); object.litecoinImageSecondary = reader.readString(offsets[24]); object.loadingGif = reader.readStringOrNull(offsets[25]); - object.monero = reader.readString(offsets[26]); - object.moneroImage = reader.readString(offsets[27]); - object.moneroImageSecondary = reader.readString(offsets[28]); - object.namecoin = reader.readString(offsets[29]); - object.namecoinImage = reader.readString(offsets[30]); - object.namecoinImageSecondary = reader.readString(offsets[31]); - object.particl = reader.readString(offsets[32]); - object.particlImage = reader.readString(offsets[33]); - object.particlImageSecondary = reader.readString(offsets[34]); - object.personaEasy = reader.readString(offsets[35]); - object.personaIncognito = reader.readString(offsets[36]); - object.receive = reader.readString(offsets[37]); - object.receiveCancelled = reader.readString(offsets[38]); - object.receivePending = reader.readString(offsets[39]); - object.send = reader.readString(offsets[40]); - object.sendCancelled = reader.readString(offsets[41]); - object.sendPending = reader.readString(offsets[42]); - object.stack = reader.readString(offsets[43]); - object.stackIcon = reader.readString(offsets[44]); - object.themePreview = reader.readString(offsets[45]); - object.themeSelector = reader.readString(offsets[46]); - object.txExchange = reader.readString(offsets[47]); - object.txExchangeFailed = reader.readString(offsets[48]); - object.txExchangePending = reader.readString(offsets[49]); - object.wownero = reader.readString(offsets[50]); - object.wowneroImage = reader.readString(offsets[51]); - object.wowneroImageSecondary = reader.readString(offsets[52]); + object.mimblewimblecoin = reader.readString(offsets[26]); + object.mimblewimblecoinImage = reader.readString(offsets[27]); + object.mimblewimblecoinImageSecondary = reader.readString(offsets[28]); + object.monero = reader.readString(offsets[29]); + object.moneroImage = reader.readString(offsets[30]); + object.moneroImageSecondary = reader.readString(offsets[31]); + object.namecoin = reader.readString(offsets[32]); + object.namecoinImage = reader.readString(offsets[33]); + object.namecoinImageSecondary = reader.readString(offsets[34]); + object.particl = reader.readString(offsets[35]); + object.particlImage = reader.readString(offsets[36]); + object.particlImageSecondary = reader.readString(offsets[37]); + object.personaEasy = reader.readString(offsets[38]); + object.personaIncognito = reader.readString(offsets[39]); + object.receive = reader.readString(offsets[40]); + object.receiveCancelled = reader.readString(offsets[41]); + object.receivePending = reader.readString(offsets[42]); + object.send = reader.readString(offsets[43]); + object.sendCancelled = reader.readString(offsets[44]); + object.sendPending = reader.readString(offsets[45]); + object.stack = reader.readString(offsets[46]); + object.stackIcon = reader.readString(offsets[47]); + object.themePreview = reader.readString(offsets[48]); + object.themeSelector = reader.readString(offsets[49]); + object.txExchange = reader.readString(offsets[50]); + object.txExchangeFailed = reader.readString(offsets[51]); + object.txExchangePending = reader.readString(offsets[52]); + object.wownero = reader.readString(offsets[53]); + object.wowneroImage = reader.readString(offsets[54]); + object.wowneroImageSecondary = reader.readString(offsets[55]); return object; } @@ -18599,6 +18623,12 @@ P _themeAssetsDeserializeProp

( return (reader.readString(offset)) as P; case 52: return (reader.readString(offset)) as P; + case 53: + return (reader.readString(offset)) as P; + case 54: + return (reader.readString(offset)) as P; + case 55: + return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); } @@ -22170,6 +22200,417 @@ extension ThemeAssetsQueryFilter }); } + QueryBuilder + mimblewimblecoinEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinBetween( + 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'mimblewimblecoin', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'mimblewimblecoin', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoin', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'mimblewimblecoin', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinImageEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageBetween( + 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'mimblewimblecoinImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'mimblewimblecoinImage', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'mimblewimblecoinImage', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoinImage', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinImageIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'mimblewimblecoinImage', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryBetween( + 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'mimblewimblecoinImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'mimblewimblecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'mimblewimblecoinImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'mimblewimblecoinImageSecondary', + value: '', + )); + }); + } + + QueryBuilder + mimblewimblecoinImageSecondaryIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'mimblewimblecoinImageSecondary', + value: '', + )); + }); + } + QueryBuilder moneroEqualTo( String value, { bool caseSensitive = true, diff --git a/lib/models/mwcmqs_config_model.dart b/lib/models/mwcmqs_config_model.dart new file mode 100644 index 0000000000..6970905106 --- /dev/null +++ b/lib/models/mwcmqs_config_model.dart @@ -0,0 +1,118 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * 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'; + +import 'mwcmqs_server_model.dart'; + +part 'type_adaptors/mwcmqs_config_model.g.dart'; + +@HiveType(typeId: 82) +class MwcMqsConfigModel { + @HiveField(1) + final String host; + @HiveField(2) + final int? port; + @HiveField(3) + final bool? protocolInsecure; + @HiveField(4) + final int? addressIndex; + + MwcMqsConfigModel({ + required this.host, + this.port, + this.protocolInsecure, + this.addressIndex, + }); + + MwcMqsConfigModel copyWith({ + int? port, + bool? protocolInsecure, + int? addressIndex, + String? id, + String? name, + }) { + return MwcMqsConfigModel( + host: host, + port: this.port ?? 443, + protocolInsecure: this.protocolInsecure ?? false, + addressIndex: this.addressIndex ?? 0, + ); + } + + Map toMap() { + final Map map = {}; + map['mwcmqs_domain'] = host; + map['mwcmqs_port'] = port; + map['mwcmqs_protocol_insecure'] = protocolInsecure; + map['mwcmqs_address_index'] = addressIndex; + return map; + } + + Map toJson() { + return { + 'mwcmqs_domain': host, + 'mwcmqs_port': port, + 'mwcmqs_protocol_insecure': protocolInsecure, + 'mwcmqs_address_index': addressIndex, + }; + } + + @override + String toString() { + return json.encode(toJson()); + } + + static MwcMqsConfigModel fromString(String MwcMqsConfigString) { + final dynamic _mwcmqs = json.decode(MwcMqsConfigString); + + final oldDomain = _mwcmqs["domain"] ?? "empty"; + if (oldDomain != "empty") { + _mwcmqs['mwcmqs_domain'] = _mwcmqs['domain']; + } + final oldPort = _mwcmqs["port"] ?? "empty"; + if (oldPort != "empty") { + _mwcmqs['mwcmqs_port'] = _mwcmqs['port']; + } + final oldProtocolInsecure = _mwcmqs["protocol_insecure"] ?? "empty"; + if (oldProtocolInsecure != "empty") { + _mwcmqs['mwcmqs_protocol_insecure'] = _mwcmqs['protocol_insecure']; + } + final oldAddressIndex = _mwcmqs["address_index"] ?? "empty"; + if (oldAddressIndex != "empty") { + _mwcmqs['mwcmqs_address_index'] = _mwcmqs['address_index']; + } + + _mwcmqs['mwcmqs_protocol_insecure'] ??= false; + _mwcmqs['mwcmqs_address_index'] ??= 0; + + return MwcMqsConfigModel( + host: _mwcmqs['mwcmqs_domain'] as String, + port: _mwcmqs['mwcmqs_port'] as int, + protocolInsecure: _mwcmqs['mwcmqs_protocol_insecure'] as bool, + addressIndex: _mwcmqs['mwcmqs_address_index'] as int, + ); + } + + static MwcMqsConfigModel fromServer( + MwcMqsServerModel server, { + bool? protocolInsecure, + int? addressIndex, + }) { + return MwcMqsConfigModel( + host: server.host, + port: server.port ?? 443, + protocolInsecure: protocolInsecure ?? false, + addressIndex: addressIndex ?? 0, + ); + } +} diff --git a/lib/models/mwcmqs_server_model.dart b/lib/models/mwcmqs_server_model.dart new file mode 100644 index 0000000000..c6ffd757f9 --- /dev/null +++ b/lib/models/mwcmqs_server_model.dart @@ -0,0 +1,93 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All 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/mwcmqs_server_model.g.dart'; + +@HiveType(typeId: 81) +class MwcMqsServerModel { + @HiveField(0) + final String id; + @HiveField(1) + final String host; + @HiveField(2) + final int? port; + @HiveField(3) + final String name; + @HiveField(4) + final bool? useSSL; + @HiveField(5) + final bool? enabled; + @HiveField(6) + final bool? isFailover; + @HiveField(7) + final bool? isDown; + + MwcMqsServerModel({ + required this.id, + required this.host, + this.port, + required this.name, + this.useSSL, + this.enabled, + this.isFailover, + this.isDown, + }); + + MwcMqsServerModel copyWith({ + String? host, + int? port, + String? name, + bool? useSSL, + bool? enabled, + bool? isFailover, + bool? isDown, + }) { + return MwcMqsServerModel( + id: id, + host: host ?? this.host, + port: port ?? this.port, + name: name ?? this.name, + useSSL: useSSL ?? this.useSSL, + enabled: enabled ?? this.enabled, + isFailover: isFailover ?? this.isFailover, + isDown: isDown ?? this.isDown, + ); + } + + Map toMap() { + final Map map = {}; + map['id'] = id; + map['host'] = host; + map['port'] = port; + map['name'] = name; + map['useSSL'] = useSSL; + map['enabled'] = enabled; + map['isFailover'] = isFailover; + map['isDown'] = isDown; + return map; + } + + bool get isDefault => id.startsWith("default_"); + + Map toJson() { + return { + 'id': id, + 'host': host, + 'port': port, + 'name': name, + 'useSSL': useSSL, + 'enabled': enabled, + 'isFailover': isFailover, + 'isDown': isDown, + }; + } +} diff --git a/lib/models/type_adaptors/mwcmqs_config_model.g.dart b/lib/models/type_adaptors/mwcmqs_config_model.g.dart new file mode 100644 index 0000000000..e64fc54082 --- /dev/null +++ b/lib/models/type_adaptors/mwcmqs_config_model.g.dart @@ -0,0 +1,50 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of '../mwcmqs_config_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class MwcMqsConfigModelAdapter extends TypeAdapter { + @override + final int typeId = 82; + + @override + MwcMqsConfigModel read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return MwcMqsConfigModel( + host: fields[1] as String, + port: fields[2] as int?, + protocolInsecure: fields[3] as bool?, + addressIndex: fields[4] as int?, + ); + } + + @override + void write(BinaryWriter writer, MwcMqsConfigModel obj) { + writer + ..writeByte(4) + ..writeByte(1) + ..write(obj.host) + ..writeByte(2) + ..write(obj.port) + ..writeByte(3) + ..write(obj.protocolInsecure) + ..writeByte(4) + ..write(obj.addressIndex); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MwcMqsConfigModelAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/models/type_adaptors/mwcmqs_server_model.g.dart b/lib/models/type_adaptors/mwcmqs_server_model.g.dart new file mode 100644 index 0000000000..dabdd9464d --- /dev/null +++ b/lib/models/type_adaptors/mwcmqs_server_model.g.dart @@ -0,0 +1,62 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of '../mwcmqs_server_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class MwcMqsServerModelAdapter extends TypeAdapter { + @override + final int typeId = 81; + + @override + MwcMqsServerModel read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return MwcMqsServerModel( + id: fields[0] as String, + host: fields[1] as String, + port: fields[2] as int?, + name: fields[3] as String, + useSSL: fields[4] as bool?, + enabled: fields[5] as bool?, + isFailover: fields[6] as bool?, + isDown: fields[7] as bool?, + ); + } + + @override + void write(BinaryWriter writer, MwcMqsServerModel obj) { + writer + ..writeByte(8) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.host) + ..writeByte(2) + ..write(obj.port) + ..writeByte(3) + ..write(obj.name) + ..writeByte(4) + ..write(obj.useSSL) + ..writeByte(5) + ..write(obj.enabled) + ..writeByte(6) + ..write(obj.isFailover) + ..writeByte(7) + ..write(obj.isDown); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MwcMqsServerModelAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} 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 44a0c2157d..47400a0acb 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 @@ -255,24 +255,32 @@ class _RestoreWalletViewState extends ConsumerState { if (height < 0) { height = 0; } - - // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index - if (widget.coin is Mimblewimblecoin) { - final int secondsSinceEpoch = - widget.restoreFromDate.millisecondsSinceEpoch ~/ 1000; - const int mimblewimblecoinFirstBlock = 1565370278; + otherDataJsonString = jsonEncode( + { + WalletInfoKeys.mimblewimblecoinData: jsonEncode( + ExtraMimblewimblecoinWalletInfo( + receivingIndex: 0, + changeIndex: 0, + slatesToAddresses: {}, + slatesToCommits: {}, + lastScannedBlock: height, + restoreHeight: height, + creationHeight: height, + ).toMap(), + ), + }, + ); + } else if (widget.coin is Mimblewimblecoin) { + final int secondsSinceEpoch = widget.restoreFromDate.millisecondsSinceEpoch ~/ 1000; + const int mimblewimblecoinFirstBlock = 1573462801; const double overestimateSecondsPerBlock = 61; final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; final int approximateHeight = chosenSeconds ~/ overestimateSecondsPerBlock; - //todo: check if print needed - // debugPrint( - // "approximate height: $approximateHeight chosen_seconds: $chosenSeconds"); height = approximateHeight; if (height < 0) { height = 0; } - otherDataJsonString = jsonEncode( { WalletInfoKeys.mimblewimblecoinData: jsonEncode( 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 2a217dcb92..ea21bd3250 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 @@ -732,7 +732,7 @@ class MwcMqsInfoForm extends ConsumerStatefulWidget { final String walletId; @override - ConsumerState createState() => _MwcMqsInfoFormState(); + ConsumerState createState() => _MwcmqsInfoFormState(); } class _MwcmqsInfoFormState extends ConsumerState { diff --git a/lib/utilities/address_utils.dart b/lib/utilities/address_utils.dart index aa9bb6c3c9..eab56867d9 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -234,7 +234,7 @@ class AddressUtils { } /// Formats an address string to remove any unnecessary prefixes or suffixes. - String formatMimblewimblecoinAddress(String mimblewimblecoinAddress) { + String formatAddressMwc(String mimblewimblecoinAddress) { // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an mwcmqs address) if ((mimblewimblecoinAddress.startsWith("http://") || mimblewimblecoinAddress.startsWith("https://")) && diff --git a/lib/utilities/test_mwcmqs_connection.dart b/lib/utilities/test_mwcmqs_connection.dart new file mode 100644 index 0000000000..44433a1036 --- /dev/null +++ b/lib/utilities/test_mwcmqs_connection.dart @@ -0,0 +1,81 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * 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 '../networking/http.dart'; +import '../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; +import '../services/tor_service.dart'; +import 'logger.dart'; +import 'prefs.dart'; + +Future _testMwcMqsNodeConnection(Uri uri) async { + final HTTP client = HTTP(); + try { + final response = await client + .get( + url: uri, + headers: {'Content-Type': 'application/json'}, + proxyInfo: Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, + ) + .timeout( + const Duration(milliseconds: 2000), + onTimeout: () async => Response(utf8.encode('Error'), 408), + ); + + final json = jsonDecode(response.body); + + if (response.code == 200 && json["node_version"] != null) { + return true; + } else { + return false; + } + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Warning); + return false; + } +} + +// returns node data with properly formatted host/url if successful, otherwise null +Future testMwcNodeConnection(NodeFormData data) async { + if (data.host == null || data.port == null || data.useSSL == null) { + return null; + } + const String path_postfix = "/v1/version"; + + if (data.host!.startsWith("https://")) { + data.useSSL = true; + } else if (data.host!.startsWith("http://")) { + data.useSSL = false; + } else { + if (data.useSSL!) { + data.host = "https://${data.host!}"; + } else { + data.host = "http://${data.host!}"; + } + } + + Uri uri = Uri.parse(data.host! + path_postfix); + + uri = uri.replace(port: data.port); + + try { + if (await _testMwcMqsNodeConnection(uri)) { + return data; + } else { + return null; + } + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Warning); + return null; + } +} diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index b06ec1f1d4..9ea295dd4e 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -14,7 +14,7 @@ class Mimblewimblecoin extends Bip39Currency { switch (network) { case CryptoCurrencyNetwork.main: _id = _idMain; - _name = "Mimblewimblecoin"; + _name = "MimbleWimbleCoin"; _ticker = "MWC"; default: throw Exception("Unsupported network: $network"); @@ -63,7 +63,7 @@ class Mimblewimblecoin extends Bip39Currency { } } - return mimblewimblecoin.LibMwc.validateSendAddress(address: address); + return mimblewimblecoin.Libmwc.validateSendAddress(address: address); } @override @@ -71,7 +71,7 @@ class Mimblewimblecoin extends Bip39Currency { switch (network) { case CryptoCurrencyNetwork.main: return NodeModel( - host: "http://epiccash.stackwallet.com", + host: "http://mwc713.mwc.mw", port: 3413, name: DefaultNodes.defaultName, id: DefaultNodes.buildId(this), diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index ed77e34bc7..9edce8a5a1 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -31,7 +31,8 @@ import '../../../utilities/amount/amount.dart'; import '../../../utilities/flutter_secure_storage_interface.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; -//import '../../../utilities/test_epic_box_connection.dart'; +import '../../../utilities/default_mwcmqs.dart'; +import '../../../utilities/test_mwcmqs_connection.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../models/tx_data.dart'; import '../intermediate/bip39_wallet.dart'; @@ -67,20 +68,20 @@ class MimblewimblecoinWallet extends Bip39Wallet { return restorePercent < 0 ? 0.0 : restorePercent; } - /*Future updateEpicboxConfig(String host, int port) async { + Future updateMwcmqsConfig(String host, int port) async { final String stringConfig = jsonEncode({ - "epicbox_domain": host, - "epicbox_port": port, - "epicbox_protocol_unsecure": false, - "epicbox_address_index": 0, + "mwcmqs_domain": host, + "mwcmqs_port": port, + "mwcmqs_protocol_unsecure": false, + "mwcmqs_address_index": 0, }); await secureStorageInterface.write( - key: '${walletId}_epicboxConfig', + key: '${walletId}_mwcmqsConfig', value: stringConfig, ); - // TODO: refresh anything that needs to be refreshed/updated due to epicbox info changed + // TODO: refresh anything that needs to be refreshed/updated due to mwcmqs info changed } - */ + /// returns an empty String on success, error message on failure Future cancelPendingTransactionAndPost(String txSlateId) async { try { @@ -88,7 +89,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_wallet', ))!; - final result = await mimblewimblecoin.LibMwc.cancelTransaction( + final result = await mimblewimblecoin.Libmwc.cancelTransaction( wallet: wallet, transactionId: txSlateId, ); @@ -108,24 +109,24 @@ class MimblewimblecoinWallet extends Bip39Wallet { DefaultMwcMqs.defaultMwcMqsServer, ); - //Get the default Epicbox server and check if it's conected - // bool isEpicboxConnected = await _testEpicboxServer( - // DefaultEpicBoxes.defaultEpicBoxServer.host, DefaultEpicBoxes.defaultEpicBoxServer.port ?? 443); + //Get the default mwcmqs server and check if it's conected + // bool ismwcmqsConnected = await _testmwcmqsServer( + // Defaultmwcmqses.defaultmwcmqsServer.host, Defaultmwcmqses.defaultmwcmqsServer.port ?? 443); - // if (isEpicboxConnected) { - //Use default server for as Epicbox config + // if (ismwcmqsConnected) { + //Use default server for as mwcmqs config // } // else { // //Use Europe config - // _epicBoxConfig = EpicBoxConfigModel.fromServer(DefaultEpicBoxes.europe); + // _mwcmqsConfig = mwcmqsConfigModel.fromServer(Defaultmwcmqses.europe); // } // // example of selecting another random server from the default list // // alternative servers: copy list of all default EB servers but remove the default default - // // List alternativeServers = DefaultEpicBoxes.all; - // // alternativeServers.removeWhere((opt) => opt.name == DefaultEpicBoxes.defaultEpicBoxServer.name); + // // List alternativeServers = Defaultmwcmqses.all; + // // alternativeServers.removeWhere((opt) => opt.name == Defaultmwcmqses.defaultmwcmqsServer.name); // // alternativeServers.shuffle(); // randomize which server is used - // // _epicBoxConfig = EpicBoxConfigModel.fromServer(alternativeServers.first); + // // _mwcmqsConfig = mwcmqsConfigModel.fromServer(alternativeServers.first); // // // TODO test this connection before returning it // } @@ -154,9 +155,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { config["check_node_api_http_addr"] = nodeApiAddress; config["chain"] = "mainnet"; config["account"] = "default"; - config["api_listen_port"] = port; - config["api_listen_interface"] = - nodeApiAddress.replaceFirst(uri.scheme, ""); final String stringConfig = jsonEncode(config); return stringConfig; } @@ -177,7 +175,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { try { final available = info.cachedBalance.spendable.raw.toInt(); - final transactionFees = await mimblewimblecoin.LibMwc.getTransactionFees( + final transactionFees = await mimblewimblecoin.Libmwc.getTransactionFees( wallet: wallet!, amount: satoshiAmount, minimumConfirmations: cryptoCurrency.minConfirms, @@ -206,7 +204,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (!syncMutex.isLocked) { await syncMutex.protect(() async { // How does getWalletBalances start syncing???? - await mimblewimblecoin.LibMwc.getWalletBalances( + await mimblewimblecoin.Libmwc.getWalletBalances( wallet: wallet!, refreshFromNode: refreshFromNode, minimumConfirmations: 10, @@ -226,16 +224,16 @@ class MimblewimblecoinWallet extends Bip39Wallet { })> _allWalletBalances() async { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); const refreshFromNode = 0; - return await mimblewimblecoin.LibMwc.getWalletBalances( + return await mimblewimblecoin.Libmwc.getWalletBalances( wallet: wallet!, refreshFromNode: refreshFromNode, minimumConfirmations: cryptoCurrency.minConfirms, ); } - /*Future _testEpicboxServer(EpicBoxConfigModel epicboxConfig) async { - final host = epicboxConfig.host; - final port = epicboxConfig.port ?? 443; + Future _testMwcmqsServer(MwcMqsConfigModel mwcmqsConfig) async { + final host = mwcmqsConfig.host; + final port = mwcmqsConfig.port ?? 443; WebSocketChannel? channel; try { final uri = Uri.parse('wss://$host:$port'); @@ -253,14 +251,14 @@ class MimblewimblecoinWallet extends Bip39Wallet { return response is String && response.contains("Challenge"); } catch (_) { Logging.instance.log( - "_testEpicBoxConnection failed on \"$host:$port\"", + "_testMwcmqsConnection failed on \"$host:$port\"", level: LogLevel.Info, ); return false; } finally { await channel?.sink.close(); } - }*/ + } Future _putSendToAddresses( ({String slateId, String commitId}) slateData, @@ -308,7 +306,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (address != null) { final splitted = address.value.split('@'); - //Check if the address is the same as the current epicbox domain + //Check if the address is the same as the current mwcmqs domain //Since we're only using one epicbpox now this doesn't apply but will be // useful in the future final mwcmqsConfig = await getMwcMqsConfig(); @@ -336,10 +334,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { ) async { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); - final walletAddress = await mimblewimblecoin.LibMwc.getAddressInfo( + final walletAddress = await mimblewimblecoin.Libmwc.getAddressInfo( wallet: wallet!, - index: index, - mwcmqsConfig: mwcmqsConfig.toString(), + index: index ); Logging.instance.log( @@ -363,7 +360,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Future _startScans() async { try { //First stop the current listener - mimblewimblecoin.LibMwc.stopMwcmqsListener(); + mimblewimblecoin.Libmwc.stopMwcMqsListener(); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); @@ -385,7 +382,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { level: LogLevel.Info, ); - final int nextScannedBlock = await mimblewimblecoin.LibMwc.scanOutputs( + final int nextScannedBlock = await mimblewimblecoin.Libmwc.scanOutputs( wallet: wallet!, startHeight: lastScannedBlock, numberOfBlocks: scanChunkSize, @@ -426,7 +423,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Logging.instance.log("STARTING WALLET LISTENER ....", level: LogLevel.Info); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); - mimblewimblecoin.LibMwc.startMwcMqsListener( + mimblewimblecoin.Libmwc.startMwcMqsListener( wallet: wallet!, mwcmqsConfig: mwcmqsConfig.toString(), ); @@ -509,7 +506,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String name = walletId; - await mimblewimblecoin.LibMwc.initializeNewWallet( + await mimblewimblecoin.Libmwc.initializeNewWallet( config: stringConfig, mnemonic: mnemonicString, password: password, @@ -517,7 +514,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); //Open wallet - encodedWallet = await mimblewimblecoin.LibMwc.openWallet( + encodedWallet = await mimblewimblecoin.Libmwc.openWallet( config: stringConfig, password: password, ); @@ -559,7 +556,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final password = await secureStorageInterface.read(key: '${walletId}_password'); - final walletOpen = await mimblewimblecoin.LibMwc.openWallet( + final walletOpen = await mimblewimblecoin.Libmwc.openWallet( config: config, password: password!, ); @@ -608,7 +605,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (receiverAddress.startsWith("http://") || receiverAddress.startsWith("https://")) { - transaction = await mimblewimblecoin.LibMwc.txHttpSend( + transaction = await mimblewimblecoin.Libmwc.txHttpSend( wallet: wallet!, selectionStrategyIsAll: 0, minimumConfirmations: cryptoCurrency.minConfirms, @@ -617,12 +614,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { address: txData.recipients!.first.address, ); } else { - transaction = await mimblewimblecoin.LibMwc.createTransaction( + transaction = await mimblewimblecoin.Libmwc.createTransaction( wallet: wallet!, amount: txData.recipients!.first.amount.raw.toInt(), address: txData.recipients!.first.address, secretKeyIndex: 0, - mwcmqsConfig: mwsmqsConfig.toString(), + mwcmqsConfig: mwcmqsConfig.toString(), minimumConfirmations: cryptoCurrency.minConfirms, note: txData.noteOnChain!, ); @@ -724,7 +721,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { value: mwcmqsConfig.toString(), ); - await mimblewimblecoin.LibMwc.recoverWallet( + await mimblewimblecoin.Libmwc.recoverWallet( config: stringConfig, password: password, mnemonic: await getMnemonic(), @@ -748,7 +745,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); //Open Wallet - final walletOpen = await mimblewimblecoin.LibMwc.openWallet( + final walletOpen = await mimblewimblecoin.Libmwc.openWallet( config: stringConfig, password: password, ); @@ -943,7 +940,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { .findAll(); final myAddressesSet = myAddresses.toSet(); - final transactions = await mimblewimblecoin.LibMwc.getTransactions( + final transactions = await mimblewimblecoin.Libmwc.getTransactions( wallet: wallet!, refreshFromNode: refreshFromNode, ); @@ -1095,7 +1092,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { // force unwrap optional as we want connection test to fail if wallet // wasn't initialized or mwcmqs node was set to null - return await testMimblewimblecoinNodeConnection( + return await testMwcNodeConnection( NodeFormData() ..host = node!.host ..useSSL = node.useSSL @@ -1112,7 +1109,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Future updateChainHeight() async { final config = await _getRealConfig(); final latestHeight = - await mimblewimblecoin.LibMwc.getChainHeight(config: config); + await mimblewimblecoin.Libmwc.getChainHeight(config: config); await info.updateCachedChainHeight( newHeight: latestHeight, isar: mainDB.isar, @@ -1185,7 +1182,7 @@ Future deleteMimblewimblecoinWallet({ return "Tried to delete non existent mimblewimblecoin wallet file with walletId=$walletId"; } else { try { - return mimblewimblecoin.LibMwc.deleteWallet( + return mimblewimblecoin.Libmwc.deleteWallet( wallet: wallet, config: config!, ); diff --git a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart index 724657079e..0c876d5c57 100644 --- a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart +++ b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart @@ -5,7 +5,7 @@ import '../../../utilities/logger.dart'; import '../../isar/models/wallet_info.dart'; extension MimblewimblecoinWalletInfoExtension on WalletInfo { - ExtraMimblewimblecoinWalletInfo? get epicData { + ExtraMimblewimblecoinWalletInfo? get mimblewimblecoinData { final String? data = otherData[WalletInfoKeys.mimblewimblecoinData] as String?; if (data == null) { @@ -27,12 +27,12 @@ extension MimblewimblecoinWalletInfoExtension on WalletInfo { } Future updateExtraMimblewimblecoinWalletInfo({ - required ExtraMimblewimblecoinWalletInfo epicData, + required ExtraMimblewimblecoinWalletInfo mimblewimblecoinData, required Isar isar, }) async { await updateOtherData( newEntries: { - WalletInfoKeys.mimblewimblecoinData: jsonEncode(epicData.toMap()), + WalletInfoKeys.mimblewimblecoinData: jsonEncode(mimblewimblecoinData.toMap()), }, isar: isar, ); diff --git a/lib/wallets/wallet/wallet.dart b/lib/wallets/wallet/wallet.dart index 78079da970..2b5ee1ac4d 100644 --- a/lib/wallets/wallet/wallet.dart +++ b/lib/wallets/wallet/wallet.dart @@ -361,7 +361,7 @@ abstract class Wallet { return EpiccashWallet(net); case const (Mimblewimblecoin): - return Mimblewimblecoin(net); + return MimblewimblecoinWallet(net); case const (Ethereum): return EthereumWallet(net); diff --git a/pubspec.lock b/pubspec.lock index 285d841128..9122380698 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -959,7 +959,7 @@ packages: source: hosted version: "2.4.4" frontend_server_client: - dependency: transitive + dependency: "direct dev" description: name: frontend_server_client sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 diff --git a/scripts/app_config/templates/linux/CMakeLists.txt b/scripts/app_config/templates/linux/CMakeLists.txt index d6ac3f66d3..3707ec1b4e 100644 --- a/scripts/app_config/templates/linux/CMakeLists.txt +++ b/scripts/app_config/templates/linux/CMakeLists.txt @@ -137,7 +137,7 @@ install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libepic_cash_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libemwc/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmwc/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/linux/build/libmobileliblelantus.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" diff --git a/scripts/linux/build_secp256k1.sh b/scripts/linux/build_secp256k1.sh index f00b6b82bf..cf7650ffe1 100755 --- a/scripts/linux/build_secp256k1.sh +++ b/scripts/linux/build_secp256k1.sh @@ -10,5 +10,5 @@ mkdir -p build && cd build cmake .. cmake --build . mkdir -p ../../../../../build -cp lib/libsecp256k1.so.2.2.2 "../../../../../build/libsecp256k1.so" +cp lib/libsecp256k1.so.2.*.* "../../../../../build/libsecp256k1.so" cd ../../../ diff --git a/test/cached_electrumx_test.mocks.dart b/test/cached_electrumx_test.mocks.dart index 993f73f694..e37380e0b1 100644 --- a/test/cached_electrumx_test.mocks.dart +++ b/test/cached_electrumx_test.mocks.dart @@ -1113,6 +1113,19 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index fee6a0d7f5..c20fd4e293 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -1129,6 +1129,19 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/screen_tests/exchange/exchange_view_test.mocks.dart b/test/screen_tests/exchange/exchange_view_test.mocks.dart index b7a8d49d51..3f04c3fc27 100644 --- a/test/screen_tests/exchange/exchange_view_test.mocks.dart +++ b/test/screen_tests/exchange/exchange_view_test.mocks.dart @@ -558,6 +558,19 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index c2bc00d2c0..ee2de45f91 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -834,6 +834,19 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/widget_tests/node_options_sheet_test.mocks.dart b/test/widget_tests/node_options_sheet_test.mocks.dart index 5e878015ff..26f7b6cf34 100644 --- a/test/widget_tests/node_options_sheet_test.mocks.dart +++ b/test/widget_tests/node_options_sheet_test.mocks.dart @@ -709,6 +709,19 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index a5816bdcbb..d9234ff9bf 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -818,6 +818,19 @@ class MockPrefs extends _i1.Mock implements _i14.Prefs { ); @override + bool get enableExchange => (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) as bool); + @override + set enableExchange(bool? showExchange) => super.noSuchMethod( + Invocation.setter( + #enableExchange, + showExchange, + ), + returnValueForMissingStub: null, + ); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, From 8610a7261ca57a9d55dbcfce15ff1f7fa21e5163 Mon Sep 17 00:00:00 2001 From: vekamo Date: Sun, 27 Oct 2024 17:07:52 +0400 Subject: [PATCH 008/178] disable PingCheck --- crypto_plugins/flutter_libepiccash | 2 +- crypto_plugins/flutter_liblelantus | 2 +- lib/utilities/default_mwcmqs.dart | 6 +-- .../wallet/impl/mimblewimblecoin_wallet.dart | 43 ++++++++++--------- pubspec.lock | 2 +- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/crypto_plugins/flutter_libepiccash b/crypto_plugins/flutter_libepiccash index 0bb1b1ced6..1d48c0a8aa 160000 --- a/crypto_plugins/flutter_libepiccash +++ b/crypto_plugins/flutter_libepiccash @@ -1 +1 @@ -Subproject commit 0bb1b1ced6e0d3c66e383698f89825754c692986 +Subproject commit 1d48c0a8aa394324e7c39267e5654038834aff95 diff --git a/crypto_plugins/flutter_liblelantus b/crypto_plugins/flutter_liblelantus index 5b08645a5b..8e9e20e2f9 160000 --- a/crypto_plugins/flutter_liblelantus +++ b/crypto_plugins/flutter_liblelantus @@ -1 +1 @@ -Subproject commit 5b08645a5b5d30955f4bde2a624ff89ef516e452 +Subproject commit 8e9e20e2f90387dcc6e23833d186a84ad3ac372a diff --git a/lib/utilities/default_mwcmqs.dart b/lib/utilities/default_mwcmqs.dart index 75be1d247b..84e7356d84 100644 --- a/lib/utilities/default_mwcmqs.dart +++ b/lib/utilities/default_mwcmqs.dart @@ -17,7 +17,7 @@ abstract class DefaultMwcMqs { static List get defaultIds => ['americas', 'asia', 'europe']; static MwcMqsServerModel get americas => MwcMqsServerModel( - host: 'MwcMqs.stackwallet.com', + host: 'mqs.mwc.mw', port: 443, name: 'Americas', id: 'americas', @@ -28,7 +28,7 @@ abstract class DefaultMwcMqs { ); static MwcMqsServerModel get asia => MwcMqsServerModel( - host: 'MwcMqs.hyperbig.com', + host: 'mqs.mwc.mw', port: 443, name: 'Asia', id: 'asia', @@ -39,7 +39,7 @@ abstract class DefaultMwcMqs { ); static MwcMqsServerModel get europe => MwcMqsServerModel( - host: 'MwcMqs.fastepic.eu', + host: 'mqs.mwc.mw', port: 443, name: 'Europe', id: 'europe', diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 9edce8a5a1..83d038e9dd 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -524,7 +524,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); //Store MwcMqs address info - await _generateAndStoreReceivingAddressForIndex(0); + // await _generateAndStoreReceivingAddressForIndex(0); // subtract a couple days to ensure we have a buffer for SWB final bufferedCreateHeight = _calculateRestoreHeightFrom( @@ -754,9 +754,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { value: walletOpen, ); - await _generateAndStoreReceivingAddressForIndex( - mimblewimblecoinData.receivingIndex, - ); + // await _generateAndStoreReceivingAddressForIndex( + // mimblewimblecoinData.receivingIndex, + // ); } }); @@ -799,7 +799,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { // this will always be zero???? final int curAdd = await _getCurrentIndex(); - await _generateAndStoreReceivingAddressForIndex(curAdd); + // await _generateAndStoreReceivingAddressForIndex(curAdd); await _startScans(); @@ -1087,22 +1087,23 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future pingCheck() async { - try { - final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); - - // force unwrap optional as we want connection test to fail if wallet - // wasn't initialized or mwcmqs node was set to null - return await testMwcNodeConnection( - NodeFormData() - ..host = node!.host - ..useSSL = node.useSSL - ..port = node.port, - ) != - null; - } catch (e, s) { - Logging.instance.log("$e\n$s", level: LogLevel.Info); - return false; - } + return true; + //try { + // final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); +// + // // force unwrap optional as we want connection test to fail if wallet + // // wasn't initialized or mwcmqs node was set to null + // return await testMwcNodeConnection( + // NodeFormData() + // ..host = node!.host + // ..useSSL = node.useSSL + // ..port = node.port, + // ) != + // null; + //} catch (e, s) { + // Logging.instance.log("$e\n$s", level: LogLevel.Info); + // return false; + //} } @override diff --git a/pubspec.lock b/pubspec.lock index 9122380698..285d841128 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -959,7 +959,7 @@ packages: source: hosted version: "2.4.4" frontend_server_client: - dependency: "direct dev" + dependency: transitive description: name: frontend_server_client sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 From 1bd8efe04461608951f6bbe8ab50e505eb350716 Mon Sep 17 00:00:00 2001 From: vekamo Date: Tue, 12 Nov 2024 22:00:58 +0400 Subject: [PATCH 009/178] few fixes and remove mwc-wallet logs --- .../transaction_details_view.dart | 58 ++++++++++- .../tx_v2/transaction_v2_details_view.dart | 16 +-- lib/utilities/test_mwcmqs_connection.dart | 16 ++- lib/utilities/test_node_connection.dart | 14 +++ .../coins/mimblewimblecoin.dart | 41 ++++---- .../wallet/impl/mimblewimblecoin_wallet.dart | 99 +++++++++---------- 6 files changed, 148 insertions(+), 96 deletions(-) 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 1071ffdaec..777f2b75ee 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -15,6 +15,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:stackwallet/wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import 'package:tuple/tuple.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -1730,7 +1731,7 @@ class _TransactionDetailsViewState ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: (coin is Epiccash && + floatingActionButton: ((coin is Epiccash || coin is Mimblewimblecoin) && _transaction.getConfirmations(currentHeight) < 1 && _transaction.isCancelled == false) ? ConditionalParent( @@ -1775,6 +1776,59 @@ class _TransactionDetailsViewState ), ); + final result = + await wallet.cancelPendingTransactionAndPost(id); + if (mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + wallet.refresh(); + Navigator.of(context).popUntil( + ModalRoute.withName( + WalletView.routeName, + ), + ); + }, + ), + ); + } else { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + ), + ); + } + } + } else if (wallet is MimblewimblecoinWallet) { + final String? id = _transaction.slateId; + if (id == null) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Could not find MWC transaction ID", + context: context, + ), + ); + return; + } + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: (_) => + const CancellingTransactionProgressDialog(), + ), + ); + final result = await wallet.cancelPendingTransactionAndPost(id); if (mounted) { @@ -1810,7 +1864,7 @@ class _TransactionDetailsViewState unawaited( showFloatingFlushBar( type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash", + message: "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", context: context, ), ); diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index 53c54ae22a..3468351888 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -2151,18 +2151,7 @@ class _TransactionV2DetailsViewState ); } } - } else { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash", - context: context, - ), - ); - return; - } - - if (wallet is MimblewimblecoinWallet) { + } else if (wallet is MimblewimblecoinWallet) { final String? id = _transaction.slateId; if (id == null) { unawaited( @@ -2220,8 +2209,7 @@ class _TransactionV2DetailsViewState unawaited( showFloatingFlushBar( type: FlushBarType.warning, - message: - "ERROR: Wallet type is not Mimblewimblecoin", + message: "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", context: context, ), ); diff --git a/lib/utilities/test_mwcmqs_connection.dart b/lib/utilities/test_mwcmqs_connection.dart index 44433a1036..cfcd4a098f 100644 --- a/lib/utilities/test_mwcmqs_connection.dart +++ b/lib/utilities/test_mwcmqs_connection.dart @@ -18,11 +18,21 @@ import 'prefs.dart'; Future _testMwcMqsNodeConnection(Uri uri) async { final HTTP client = HTTP(); - try { + try { + final headers = { + 'Content-Type': 'application/json', + }; + + if (uri.toString() == 'https://mwc713.mwc.mw/v1/version') { + const username = 'mwcmain'; + const password = '11ne3EAUtOXVKwhxm84U'; + final credentials = base64Encode(utf8.encode('$username:$password')); + headers['Authorization'] = 'Basic $credentials'; + } final response = await client .get( url: uri, - headers: {'Content-Type': 'application/json'}, + headers: headers, proxyInfo: Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, @@ -67,7 +77,7 @@ Future testMwcNodeConnection(NodeFormData data) async { Uri uri = Uri.parse(data.host! + path_postfix); uri = uri.replace(port: data.port); - + try { if (await _testMwcMqsNodeConnection(uri)) { return data; diff --git a/lib/utilities/test_node_connection.dart b/lib/utilities/test_node_connection.dart index 127702b14c..9050087882 100644 --- a/lib/utilities/test_node_connection.dart +++ b/lib/utilities/test_node_connection.dart @@ -21,6 +21,7 @@ import '../wallets/wallet/impl/solana_wallet.dart'; import 'connection_check/electrum_connection_check.dart'; import 'logger.dart'; import 'test_epic_box_connection.dart'; +import 'test_mwcmqs_connection.dart'; import 'test_eth_node_connection.dart'; import 'test_monero_node_connection.dart'; import 'test_stellar_node_connection.dart'; @@ -126,6 +127,19 @@ Future testNodeConnection({ } break; + case Mimblewimblecoin(): + try { + final data = await testMwcNodeConnection(formData); + + if (data != null) { + testPassed = true; + onSuccess?.call(data); + } + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Warning); + } + break; + case CryptonoteCurrency(): try { final proxyInfo = ref.read(prefsChangeNotifierProvider).useTor diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index 9ea295dd4e..3127ef035b 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -50,36 +50,33 @@ class Mimblewimblecoin extends Bip39Currency { // change this to change the number of confirms a tx needs in order to show as confirmed int get minConfirms => 3; - @override - bool validateAddress(String address) { - // Invalid address that contains HTTP and mwcmqs domain - if ((address.startsWith("http://") || address.startsWith("https://")) && - address.contains("@")) { - return false; - } - if (address.startsWith("http://") || address.startsWith("https://")) { - if (Uri.tryParse(address) != null) { - return true; - } - } - - return mimblewimblecoin.Libmwc.validateSendAddress(address: address); + @override +bool validateAddress(String address) { + Uri? uri = Uri.tryParse(address); + if (uri != null && + (uri.scheme == "http" || uri.scheme == "https" || uri.scheme == "mwcmqs") && + uri.host.isNotEmpty && + !uri.host.endsWith(".onion")) { + return true; } + return mimblewimblecoin.Libmwc.validateSendAddress(address: address); +} + @override NodeModel get defaultNode { switch (network) { case CryptoCurrencyNetwork.main: return NodeModel( - host: "http://mwc713.mwc.mw", - port: 3413, + host: "https://mwc713.mwc.mw", + port: 443, name: DefaultNodes.defaultName, id: DefaultNodes.buildId(this), - useSSL: false, + useSSL: true, enabled: true, coinName: identifier, isFailover: true, - isDown: false, + isDown: false ); default: @@ -88,10 +85,10 @@ class Mimblewimblecoin extends Bip39Currency { } @override - int get defaultSeedPhraseLength => 24; + int get defaultSeedPhraseLength => 12; @override - int get fractionDigits => 8; + int get fractionDigits => 9; @override bool get hasBuySupport => false; @@ -100,13 +97,13 @@ class Mimblewimblecoin extends Bip39Currency { bool get hasMnemonicPassphraseSupport => false; @override - List get possibleMnemonicLengths => [defaultSeedPhraseLength, 12]; + List get possibleMnemonicLengths => [defaultSeedPhraseLength, 24]; @override AddressType get defaultAddressType => AddressType.mimbleWimble; @override - BigInt get satsPerCoin => BigInt.from(100000000); + BigInt get satsPerCoin => BigInt.from(1000000000); @override int get targetBlockTimeSeconds => 60; diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 83d038e9dd..5ce8a6b0ea 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -38,6 +38,7 @@ import '../../models/tx_data.dart'; import '../intermediate/bip39_wallet.dart'; import '../supporting/mimblewimblecoin_wallet_info_extension.dart'; + // // refactor of https://github.com/cypherstack/stack_wallet/blob/1d9fb4cd069f22492ece690ac788e05b8f8b1209/lib/services/coins/epiccash/epiccash_wallet.dart // @@ -48,7 +49,8 @@ class MimblewimblecoinWallet extends Bip39Wallet { final syncMutex = Mutex(); NodeModel? _mimblewimblecoinNode; Timer? timer; - + bool _logsInitialized = false; + double highestPercent = 0; Future get getSyncPercent async { final int lastScannedBlock = @@ -147,7 +149,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { final uri = Uri.parse(nodeAddress).replace(port: port); final String nodeApiAddress = uri.toString(); - final walletDir = await _currentWalletDirPath(); final Map config = {}; @@ -174,7 +175,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); try { final available = info.cachedBalance.spendable.raw.toInt(); - final transactionFees = await mimblewimblecoin.Libmwc.getTransactionFees( wallet: wallet!, amount: satoshiAmount, @@ -304,17 +304,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ) async { Address? address = await getCurrentReceivingAddress(); - if (address != null) { - final splitted = address.value.split('@'); - //Check if the address is the same as the current mwcmqs domain - //Since we're only using one epicbpox now this doesn't apply but will be - // useful in the future - final mwcmqsConfig = await getMwcMqsConfig(); - if (splitted[1] != mwcmqsConfig.host) { - //Update the address - address = await thisWalletAddress(index, mwcmqsConfig); - } - } else { + if (address == null) { final mwcmqsConfig = await getMwcMqsConfig(); address = await thisWalletAddress(index, mwcmqsConfig); } @@ -478,6 +468,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future init({bool? isRestore}) async { + if (isRestore != true) { String? encodedWallet = await secureStorageInterface.read(key: "${walletId}_wallet"); @@ -490,7 +481,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String password = generatePassword(); final String stringConfig = await _getConfig(); final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); - + //if (!_logsInitialized) { + // await mimblewimblecoin.Libmwc.initLogs(config: stringConfig); + // _logsInitialized = true; // Set flag to true after initializing + // } await secureStorageInterface.write( key: '${walletId}_config', value: stringConfig, @@ -522,9 +516,8 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_wallet', value: encodedWallet, ); - //Store MwcMqs address info - // await _generateAndStoreReceivingAddressForIndex(0); + await _generateAndStoreReceivingAddressForIndex(0); // subtract a couple days to ensure we have a buffer for SWB final bufferedCreateHeight = _calculateRestoreHeightFrom( @@ -547,12 +540,11 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); } else { try { - Logging.instance.log( - "initializeExisting() ${cryptoCurrency.prettyName} wallet", - level: LogLevel.Info, - ); - final config = await _getRealConfig(); + //if (!_logsInitialized) { + // await mimblewimblecoin.Libmwc.initLogs(config: config); + // _logsInitialized = true; // Set flag to true after initializing + //} final password = await secureStorageInterface.read(key: '${walletId}_password'); @@ -590,21 +582,22 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String receiverAddress = txData.recipients!.first.address; - if (!receiverAddress.startsWith("http://") || - !receiverAddress.startsWith("https://")) { - final bool isMwcmqsConnected = await _testMwcmqsServer( - mwcmqsConfig, - ); - if (!isMwcmqsConnected) { - throw Exception( - "Failed to send TX : Unable to reach mimblewimblecoin server"); - } - } + //if (!receiverAddress.startsWith("http://") || + // !receiverAddress.startsWith("https://")) { + // final bool isMwcmqsConnected = await _testMwcmqsServer( + // mwcmqsConfig, + // ); + // if (!isMwcmqsConnected) { + // throw Exception( + // "Failed to send TX : Unable to reach mimblewimblecoin server"); + // } + //} ({String commitId, String slateId}) transaction; if (receiverAddress.startsWith("http://") || - receiverAddress.startsWith("https://")) { + receiverAddress.startsWith("https://") || + receiverAddress.startsWith("mwcmqcs://")) { transaction = await mimblewimblecoin.Libmwc.txHttpSend( wallet: wallet!, selectionStrategyIsAll: 0, @@ -753,10 +746,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_wallet', value: walletOpen, ); - - // await _generateAndStoreReceivingAddressForIndex( - // mimblewimblecoinData.receivingIndex, - // ); + + await _generateAndStoreReceivingAddressForIndex( + mimblewimblecoinData.receivingIndex, + ); } }); @@ -799,7 +792,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { // this will always be zero???? final int curAdd = await _getCurrentIndex(); - // await _generateAndStoreReceivingAddressForIndex(curAdd); + await _generateAndStoreReceivingAddressForIndex(curAdd); await _startScans(); @@ -1087,23 +1080,19 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future pingCheck() async { - return true; - //try { - // final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); -// - // // force unwrap optional as we want connection test to fail if wallet - // // wasn't initialized or mwcmqs node was set to null - // return await testMwcNodeConnection( - // NodeFormData() - // ..host = node!.host - // ..useSSL = node.useSSL - // ..port = node.port, - // ) != - // null; - //} catch (e, s) { - // Logging.instance.log("$e\n$s", level: LogLevel.Info); - // return false; - //} + try { + final node = nodeService.getPrimaryNodeFor(currency: cryptoCurrency); + return await testMwcNodeConnection( + NodeFormData() + ..host = node!.host + ..useSSL = node.useSSL + ..port = node.port, + ) != + null; + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Info); + return false; + } } @override From adb65319245cd3d13336c0b0940f8b84db6ef952 Mon Sep 17 00:00:00 2001 From: vekamo Date: Sun, 17 Nov 2024 14:59:54 +0400 Subject: [PATCH 010/178] last fixes mwc and clean up --- lib/models/mwcmqs_config_model.dart | 35 ++----------------- .../type_adaptors/mwcmqs_config_model.g.dart | 10 ++---- .../restore_options_view.dart | 12 +++---- .../restore_view_only_wallet_view.dart | 5 +++ .../restore_wallet_view.dart | 2 +- .../add_edit_node_view.dart | 8 ----- .../wallet_settings_view.dart | 1 - .../wallet/impl/mimblewimblecoin_wallet.dart | 19 +++++----- 8 files changed, 26 insertions(+), 66 deletions(-) diff --git a/lib/models/mwcmqs_config_model.dart b/lib/models/mwcmqs_config_model.dart index 6970905106..067d1a8ee5 100644 --- a/lib/models/mwcmqs_config_model.dart +++ b/lib/models/mwcmqs_config_model.dart @@ -22,30 +22,19 @@ class MwcMqsConfigModel { final String host; @HiveField(2) final int? port; - @HiveField(3) - final bool? protocolInsecure; - @HiveField(4) - final int? addressIndex; MwcMqsConfigModel({ required this.host, - this.port, - this.protocolInsecure, - this.addressIndex, + this.port }); MwcMqsConfigModel copyWith({ int? port, bool? protocolInsecure, - int? addressIndex, - String? id, - String? name, }) { return MwcMqsConfigModel( host: host, port: this.port ?? 443, - protocolInsecure: this.protocolInsecure ?? false, - addressIndex: this.addressIndex ?? 0, ); } @@ -53,8 +42,6 @@ class MwcMqsConfigModel { final Map map = {}; map['mwcmqs_domain'] = host; map['mwcmqs_port'] = port; - map['mwcmqs_protocol_insecure'] = protocolInsecure; - map['mwcmqs_address_index'] = addressIndex; return map; } @@ -62,8 +49,6 @@ class MwcMqsConfigModel { return { 'mwcmqs_domain': host, 'mwcmqs_port': port, - 'mwcmqs_protocol_insecure': protocolInsecure, - 'mwcmqs_address_index': addressIndex, }; } @@ -83,23 +68,11 @@ class MwcMqsConfigModel { if (oldPort != "empty") { _mwcmqs['mwcmqs_port'] = _mwcmqs['port']; } - final oldProtocolInsecure = _mwcmqs["protocol_insecure"] ?? "empty"; - if (oldProtocolInsecure != "empty") { - _mwcmqs['mwcmqs_protocol_insecure'] = _mwcmqs['protocol_insecure']; - } - final oldAddressIndex = _mwcmqs["address_index"] ?? "empty"; - if (oldAddressIndex != "empty") { - _mwcmqs['mwcmqs_address_index'] = _mwcmqs['address_index']; - } - _mwcmqs['mwcmqs_protocol_insecure'] ??= false; - _mwcmqs['mwcmqs_address_index'] ??= 0; return MwcMqsConfigModel( host: _mwcmqs['mwcmqs_domain'] as String, - port: _mwcmqs['mwcmqs_port'] as int, - protocolInsecure: _mwcmqs['mwcmqs_protocol_insecure'] as bool, - addressIndex: _mwcmqs['mwcmqs_address_index'] as int, + port: _mwcmqs['mwcmqs_port'] as int ); } @@ -110,9 +83,7 @@ class MwcMqsConfigModel { }) { return MwcMqsConfigModel( host: server.host, - port: server.port ?? 443, - protocolInsecure: protocolInsecure ?? false, - addressIndex: addressIndex ?? 0, + port: server.port ?? 443 ); } } diff --git a/lib/models/type_adaptors/mwcmqs_config_model.g.dart b/lib/models/type_adaptors/mwcmqs_config_model.g.dart index e64fc54082..f66fbdb56b 100644 --- a/lib/models/type_adaptors/mwcmqs_config_model.g.dart +++ b/lib/models/type_adaptors/mwcmqs_config_model.g.dart @@ -19,23 +19,17 @@ class MwcMqsConfigModelAdapter extends TypeAdapter { return MwcMqsConfigModel( host: fields[1] as String, port: fields[2] as int?, - protocolInsecure: fields[3] as bool?, - addressIndex: fields[4] as int?, ); } @override void write(BinaryWriter writer, MwcMqsConfigModel obj) { writer - ..writeByte(4) + ..writeByte(2) ..writeByte(1) ..write(obj.host) ..writeByte(2) - ..write(obj.port) - ..writeByte(3) - ..write(obj.protocolInsecure) - ..writeByte(4) - ..write(obj.addressIndex); + ..write(obj.port); } @override 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 384cacb0ca..c80eb13a28 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 @@ -362,7 +362,7 @@ class _SeedRestoreOptionState extends ConsumerState { return Column( children: [ - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) Text( "Choose start date", style: Util.isDesktop @@ -373,20 +373,20 @@ class _SeedRestoreOptionState extends ConsumerState { : STextStyles.smallMed12(context), textAlign: TextAlign.left, ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) SizedBox( height: Util.isDesktop ? 16 : 8, ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) RestoreFromDatePicker( onTap: widget.dateChooserFunction, controller: widget.dateController, ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) const SizedBox( height: 8, ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) RoundedWhiteContainer( child: Center( child: Text( @@ -403,7 +403,7 @@ class _SeedRestoreOptionState extends ConsumerState { ), ), ), - if (isMoneroAnd25 || widget.coin is Epiccash || isWowneroAnd25) + if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) SizedBox( height: Util.isDesktop ? 24 : 16, ), diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_view_only_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_view_only_wallet_view.dart index 3a7131762b..a116197071 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_view_only_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_view_only_wallet_view.dart @@ -29,6 +29,7 @@ import '../../../wallets/crypto_currency/intermediate/bip39_hd_currency.dart'; import '../../../wallets/crypto_currency/intermediate/cryptonote_currency.dart'; import '../../../wallets/isar/models/wallet_info.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../wallets/wallet/impl/wownero_wallet.dart'; import '../../../wallets/wallet/wallet.dart'; @@ -255,6 +256,10 @@ class _RestoreViewOnlyWalletViewState case const (EpiccashWallet): await (wallet as EpiccashWallet).init(isRestore: true); break; + + case const (MimblewimblecoinWallet): + await (wallet as MimblewimblecoinWallet).init(isRestore: true); + break; case const (MoneroWallet): await (wallet as MoneroWallet).init(isRestore: true); 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 47400a0acb..e7e0e4691b 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 @@ -271,7 +271,7 @@ class _RestoreWalletViewState extends ConsumerState { }, ); } else if (widget.coin is Mimblewimblecoin) { - final int secondsSinceEpoch = widget.restoreFromDate.millisecondsSinceEpoch ~/ 1000; + final int secondsSinceEpoch = widget.restoreFromDate!.millisecondsSinceEpoch ~/ 1000; const int mimblewimblecoinFirstBlock = 1573462801; const double overestimateSecondsPerBlock = 61; final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; 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 e7f0824e40..b899201c2c 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 @@ -1081,14 +1081,6 @@ class _NodeFormState extends ConsumerState { } else { enableSSLCheckbox = true; } - } else if (widget.coin is CwBasedInterface) { - if (newValue.startsWith("https://")) { - _useSSL = true; - } else if (newValue.startsWith("http://")) { - _useSSL = false; - } else { - _useSSL = true; - } } _updateState(); setState(() {}); 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 ea21bd3250..d0b8913a5f 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 @@ -40,7 +40,6 @@ import '../../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; import '../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; -import '../../../wallets/wallet/wallet_mixin_interfaces/cw_based_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 5ce8a6b0ea..31339e2fcb 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -39,9 +39,6 @@ import '../intermediate/bip39_wallet.dart'; import '../supporting/mimblewimblecoin_wallet_info_extension.dart'; -// -// refactor of https://github.com/cypherstack/stack_wallet/blob/1d9fb4cd069f22492ece690ac788e05b8f8b1209/lib/services/coins/epiccash/epiccash_wallet.dart -// class MimblewimblecoinWallet extends Bip39Wallet { MimblewimblecoinWallet(CryptoCurrencyNetwork network) : super(Mimblewimblecoin(network)); @@ -73,9 +70,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Future updateMwcmqsConfig(String host, int port) async { final String stringConfig = jsonEncode({ "mwcmqs_domain": host, - "mwcmqs_port": port, - "mwcmqs_protocol_unsecure": false, - "mwcmqs_address_index": 0, + "mwcmqs_port": port }); await secureStorageInterface.write( key: '${walletId}_mwcmqsConfig', @@ -434,7 +429,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { return config!; } - // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index int _calculateRestoreHeightFrom({required DateTime date}) { final int secondsSinceEpoch = date.millisecondsSinceEpoch ~/ 1000; const int mimblewimblecoinFirstBlock = 1565370278; @@ -596,8 +590,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ({String commitId, String slateId}) transaction; if (receiverAddress.startsWith("http://") || - receiverAddress.startsWith("https://") || - receiverAddress.startsWith("mwcmqcs://")) { + receiverAddress.startsWith("https://")) { transaction = await mimblewimblecoin.Libmwc.txHttpSend( wallet: wallet!, selectionStrategyIsAll: 0, @@ -606,7 +599,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { amount: txData.recipients!.first.amount.raw.toInt(), address: txData.recipients!.first.address, ); - } else { + } else if (receiverAddress.startsWith("mwcmqs://")) { transaction = await mimblewimblecoin.Libmwc.createTransaction( wallet: wallet!, amount: txData.recipients!.first.amount.raw.toInt(), @@ -616,6 +609,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { minimumConfirmations: cryptoCurrency.minConfirms, note: txData.noteOnChain!, ); + + } else { + throw Exception( + "Unsupported address format: $receiverAddress. Please use a valid address.", + ); + } final Map txAddressInfo = {}; From ab525e8db88482d0ac9a0b829ffd82f88ffa3d26 Mon Sep 17 00:00:00 2001 From: vekamo Date: Sun, 15 Dec 2024 13:13:35 +0400 Subject: [PATCH 011/178] tor enabled & minCoinbaseConfirms --- .../isar/models/blockchain_data/v2/transaction_v2.dart | 8 ++++---- lib/wallets/crypto_currency/coins/mimblewimblecoin.dart | 4 +++- linux/flutter/generated_plugin_registrant.cc | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart index 32ade6e6b1..01f1e440bc 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart @@ -297,7 +297,7 @@ class TransactionV2 { if (isCancelled) { return "Cancelled"; } else if (type == TransactionType.incoming) { - if (isConfirmed(currentChainHeight, minConfirms)) { + if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) { return "Received"; } else { if (numberOfMessages == 1) { @@ -309,7 +309,7 @@ class TransactionV2 { } } } else if (type == TransactionType.outgoing) { - if (isConfirmed(currentChainHeight, minConfirms)) { + if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) { return "Sent (confirmed)"; } else { if (numberOfMessages == 1) { @@ -331,7 +331,7 @@ class TransactionV2 { if (isCancelled) { return "Cancelled"; } else if (type == TransactionType.incoming) { - if (isConfirmed(currentChainHeight, minConfirms)) { + if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) { return "Received"; } else { if (numberOfMessages == 1) { @@ -343,7 +343,7 @@ class TransactionV2 { } } } else if (type == TransactionType.outgoing) { - if (isConfirmed(currentChainHeight, minConfirms)) { + if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) { return "Sent (confirmed)"; } else { if (numberOfMessages == 1) { diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index 3127ef035b..cd0066828e 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -76,7 +76,9 @@ bool validateAddress(String address) { enabled: true, coinName: identifier, isFailover: true, - isDown: false + isDown: false, + torEnabled: true, + clearnetEnabled: true, ); default: diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 8faaf8a515..aefca0f569 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include From e225b4c9f874f3c4a1706384189d4188c57b534e Mon Sep 17 00:00:00 2001 From: vekamo Date: Fri, 20 Dec 2024 22:35:44 +0100 Subject: [PATCH 012/178] submodule repo update --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 2008080fd8..2eb30bee56 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 2008080fd8e3a68081f4ca1334c2568421539157 +Subproject commit 2eb30bee56944ac50d0c1f82423d3944a2f7a04c From f05631a14e519f58d9991042c0473507f3d3f4cb Mon Sep 17 00:00:00 2001 From: vekamo Date: Sat, 21 Dec 2024 14:14:17 +0100 Subject: [PATCH 013/178] receive slatepack ui --- .../desktop_mwc_txs_method_toggle.dart | 63 ++++ .../sub_widgets/desktop_receive.dart | 290 ++++++++++++++++-- lib/utilities/enums/txs_method_mwc_enum.dart | 14 + 3 files changed, 343 insertions(+), 24 deletions(-) create mode 100644 lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart create mode 100644 lib/utilities/enums/txs_method_mwc_enum.dart diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart new file mode 100644 index 0000000000..18bab217ae --- /dev/null +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart @@ -0,0 +1,63 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights 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 '../../../../themes/stack_colors.dart'; +import '../../../../utilities/assets.dart'; +import '../../../../utilities/constants.dart'; +import '../../../../utilities/enums/txs_method_mwc_enum.dart'; +import '../../../../utilities/util.dart'; +import '../../../../widgets/toggle.dart'; + +class MwcTxsMethodToggle extends ConsumerWidget { + const MwcTxsMethodToggle({ + super.key, + this.onChanged, + }); + + final void Function(TxsMethodMwcType)? onChanged; + + @override + Widget build(BuildContext context, WidgetRef ref) { + debugPrint("BUILD: $runtimeType"); + final isDesktop = Util.isDesktop; + + return Toggle( + onValueChanged: (value) { + if (value) { + onChanged?.call(TxsMethodMwcType.slatepack); + } else { + onChanged?.call(TxsMethodMwcType.automatic); + } + }, + isOn: false, + onColor: isDesktop + ? Theme.of(context) + .extension()! + .rateTypeToggleDesktopColorOn + : Theme.of(context).extension()!.rateTypeToggleColorOn, + offColor: isDesktop + ? Theme.of(context) + .extension()! + .rateTypeToggleDesktopColorOff + : Theme.of(context).extension()!.rateTypeToggleColorOff, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + onIcon: Assets.svg.gear, + onText: "Slatepack", + offIcon: Assets.svg.radioSyncing, + offText: "Automatic", + ); + } +} 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 b90cc2f6a0..de9682b9ec 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 @@ -10,6 +10,7 @@ import 'dart:async'; +import 'package:decimal/decimal.dart'; import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -27,16 +28,20 @@ import '../../../../providers/providers.dart'; import '../../../../route_generator.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/address_utils.dart'; +import '../../../../utilities/amount/amount.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; import '../../../../utilities/enums/derive_path_type_enum.dart'; +import '../../../../utilities/enums/txs_method_mwc_enum.dart'; +import '../../../../utilities/logger.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; import '../../../../wallets/crypto_currency/crypto_currency.dart'; import '../../../../wallets/isar/providers/eth/current_token_wallet_provider.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/bitcoin_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/intermediate/bip39_hd_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart'; @@ -44,12 +49,19 @@ import '../../../../wallets/wallet/wallet_mixin_interfaces/multi_address_interfa import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; import '../../../../widgets/conditional_parent.dart'; +import '../../../../widgets/desktop/primary_button.dart'; +import '../../../../widgets/icon_widgets/clipboard_icon.dart'; +import '../../../../widgets/icon_widgets/x_icon.dart'; +import '../../../../widgets/stack_text_field.dart'; +import '../../../../widgets/textfield_icon_button.dart'; +import '../../../../widgets/toggle.dart'; import '../../../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../../../widgets/custom_loading_overlay.dart'; import '../../../../widgets/desktop/desktop_dialog.dart'; import '../../../../widgets/desktop/secondary_button.dart'; import '../../../../widgets/qr.dart'; import '../../../../widgets/rounded_white_container.dart'; +import 'desktop_mwc_txs_method_toggle.dart'; class DesktopReceive extends ConsumerStatefulWidget { const DesktopReceive({ @@ -73,13 +85,71 @@ class _DesktopReceiveState extends ConsumerState { late final ClipboardInterface clipboard; late final bool supportsSpark; late final bool showMultiType; + late final bool isMimblewimblecoin; + late TextEditingController receiveSlateController; + String? _address; + bool _addressToggleFlag = false; + final _addressFocusNode = FocusNode(); int _currentIndex = 0; + String? _selectedMethodMwc; // Variable to store selected dropdown value + String? _note; final List _walletAddressTypes = []; final Map _addressMap = {}; final Map> _addressSubMap = {}; + + + Future pasteAddress() async { + final ClipboardData? data = await clipboard.getData(Clipboard.kTextPlain); + if (data?.text != null && data!.text!.isNotEmpty) { + String content = data.text!.trim(); + if (content.contains("\n")) { + content = content.substring(0, content.indexOf("\n")); + } + + try { + final paymentData = AddressUtils.parsePaymentUri( + content, + logging: Logging.instance, + ); + if (paymentData != null && + paymentData.coin?.uriScheme == coin.uriScheme) { + _address = paymentData.address; + receiveSlateController.text = _address!; + setState(() { + _addressToggleFlag = receiveSlateController.text.isNotEmpty; + }); + } else { + content = content.split("\n").first.trim(); + if (coin is Mimblewimblecoin) { + content = AddressUtils().formatAddressMwc(content); + } + + receiveSlateController.text = content; + _address = content; + + //_setValidAddressProviders(_address); + setState(() { + _addressToggleFlag = receiveSlateController.text.isNotEmpty; + }); + } + } catch (e) { + if (coin is Mimblewimblecoin) { + // strip http:// and https:// if content contains @ + content = AddressUtils().formatAddressMwc(content); + } + receiveSlateController.text = content; + _address = content; + // Trigger validation after pasting. + //_setValidAddressProviders(_address); + setState(() { + _addressToggleFlag = receiveSlateController.text.isNotEmpty; + }); + } + } + } Future generateNewAddress() async { final wallet = ref.read(pWallets).getWallet(walletId); if (wallet is MultiAddressInterface) { @@ -200,11 +270,19 @@ class _DesktopReceiveState extends ConsumerState { @override void initState() { + receiveSlateController = TextEditingController(); walletId = widget.walletId; coin = ref.read(pWalletInfo(walletId)).coin; clipboard = widget.clipboard; final wallet = ref.read(pWallets).getWallet(walletId); supportsSpark = ref.read(pWallets).getWallet(walletId) is SparkInterface; + + isMimblewimblecoin = wallet is MimblewimblecoinWallet; + if (isMimblewimblecoin) { + _selectedMethodMwc = "Slatepack"; + } + debugPrint("Address generated: $isMimblewimblecoin"); + if (wallet is ViewOnlyOptionInterface && wallet.isViewOnly) { showMultiType = false; @@ -299,6 +377,31 @@ class _DesktopReceiveState extends ConsumerState { return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ + if (isMimblewimblecoin) + Padding( + padding: const EdgeInsets.all(16.0), + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).extension()?.textFieldDefaultBG ?? Colors.white, // Fallback color + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: Theme.of(context).extension()?.backgroundAppBar ?? Colors.grey, // Fallback color + width: 1, + ), + ), + child: SizedBox( + height: 50, // Provide an explicit height to avoid infinite constraints + child: MwcTxsMethodToggle( + onChanged: (TxsMethodMwcType type) { + setState(() { + _selectedMethodMwc = type == TxsMethodMwcType.automatic ? 'Slatepack' : 'Automatic'; + }); + }, + ), + ), + ), + ), + ConditionalParent( condition: showMultiType, builder: (child) => Column( @@ -484,6 +587,126 @@ class _DesktopReceiveState extends ConsumerState { const SizedBox( height: 32, ), + if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Label Text + Text( + "Send to", + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, + ), + textAlign: TextAlign.left, + ), + const SizedBox(height: 8), + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + minLines: 1, + maxLines: 5, + key: const Key("sendViewAddressFieldKey"), + controller: receiveSlateController, + readOnly: false, + autocorrect: false, + enableSuggestions: false, + toolbarOptions: const ToolbarOptions( + copy: false, + cut: false, + paste: true, + selectAll: false, + ), + onChanged: (newValue) { + _address = newValue; + //_setValidAddressProviders(_address); + + setState(() { + _addressToggleFlag = newValue.isNotEmpty; + }); + }, + focusNode: _addressFocusNode, + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveText, + height: 1.8, + ), + decoration: standardInputDecoration( + "Enter Slatepack Message", + _addressFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 12, // Adjust vertical padding for better alignment + ), + suffixIcon: Padding( + padding: receiveSlateController.text.isEmpty + ? const EdgeInsets.only(right: 8) + : const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _addressToggleFlag + ? TextFieldIconButton( + key: const Key("sendViewClearAddressFieldButtonKey"), + onTap: () { + receiveSlateController.text = ""; + _address = ""; + setState(() { + _addressToggleFlag = false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + key: const Key( + "sendViewPasteAddressFieldButtonKey", + ), + onTap: pasteAddress, + child: receiveSlateController.text.isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + ], + ), + ), + ), + ), + ), + ), + ], + ) + + //Padding( + // padding: const EdgeInsets.symmetric(vertical: 8.0), + // child: TextField( + // maxLines: 8, // Set to a higher number to make the height larger + // minLines: 5, // Allow it to shrink if input is small + // decoration: InputDecoration( + // labelText: 'Enter Slatepack Message', + // alignLabelWithHint: true, + // border: OutlineInputBorder( + // borderRadius: BorderRadius.circular(8), + // ), + // filled: true, + // fillColor: Theme.of(context).extension()?.textFieldDefaultBG ?? Colors.white, + // contentPadding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 12.0), + // ), + // onChanged: (value) { + // // Handle text input changes (e.g., store in a state variable) + // debugPrint('Slatepack Message: $value'); + // }, + // ), + //) + + else Center( child: QR( data: AddressUtils.buildUriString( @@ -498,6 +721,21 @@ class _DesktopReceiveState extends ConsumerState { height: 32, ), // TODO: create transparent button class to account for hover + // Conditional logic for 'Submit' button or QR code + + if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: PrimaryButton( + buttonHeight: ButtonHeight.l, + label: "Submit", + enabled: true, + onPressed: () { + debugPrint('Submit button pressed for Mimblewimblecoin Slatepack'); + }, + ), + ) + else GestureDetector( onTap: () async { if (Util.isDesktop) { @@ -555,38 +793,42 @@ class _DesktopReceiveState extends ConsumerState { } }, child: Container( - color: Colors.transparent, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - Assets.svg.qrcode, - width: 14, - height: 16, - color: Theme.of(context) - .extension()! - .accentColorBlue, - ), - const SizedBox( - width: 8, - ), - Padding( - padding: const EdgeInsets.only(bottom: 2), - child: Text( - "Create new QR code", - style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: Colors.transparent, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + children: [ + SvgPicture.asset( + Assets.svg.qrcode, + width: 14, + height: 16, color: Theme.of(context) .extension()! .accentColorBlue, ), - ), + const SizedBox(width: 8), + Padding( + padding: const EdgeInsets.only(bottom: 2), + child: Text( + "Create new QR code", + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of(context) + .extension()! + .accentColorBlue, + ), + ), + ), + ], ), - ], - ), + ], ), ), + ), ], ); } } + + diff --git a/lib/utilities/enums/txs_method_mwc_enum.dart b/lib/utilities/enums/txs_method_mwc_enum.dart new file mode 100644 index 0000000000..a77e08492e --- /dev/null +++ b/lib/utilities/enums/txs_method_mwc_enum.dart @@ -0,0 +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 + * + */ + +enum TxsMethodMwcType { + slatepack, + automatic +} From e60b3600c17c91bcc6fd0ea08e1d4c6f8a66418b Mon Sep 17 00:00:00 2001 From: vekamo Date: Sat, 21 Dec 2024 14:14:41 +0100 Subject: [PATCH 014/178] aligment receive ui --- .../wallet_view/sub_widgets/desktop_receive.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 de9682b9ec..b9ef65119f 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 @@ -379,7 +379,7 @@ class _DesktopReceiveState extends ConsumerState { children: [ if (isMimblewimblecoin) Padding( - padding: const EdgeInsets.all(16.0), + padding: const EdgeInsets.all(0), child: Container( decoration: BoxDecoration( color: Theme.of(context).extension()?.textFieldDefaultBG ?? Colors.white, // Fallback color @@ -401,7 +401,9 @@ class _DesktopReceiveState extends ConsumerState { ), ), ), - + const SizedBox( + height: 20, + ), ConditionalParent( condition: showMultiType, builder: (child) => Column( @@ -585,7 +587,7 @@ class _DesktopReceiveState extends ConsumerState { label: "Generate new address", ), const SizedBox( - height: 32, + height: 20, ), if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') Column( @@ -593,7 +595,7 @@ class _DesktopReceiveState extends ConsumerState { children: [ // Label Text Text( - "Send to", + "Receive Slatepack", style: STextStyles.desktopTextExtraSmall(context).copyWith( color: Theme.of(context) .extension()! @@ -728,7 +730,7 @@ class _DesktopReceiveState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 8.0), child: PrimaryButton( buttonHeight: ButtonHeight.l, - label: "Submit", + label: "Preview Receive Slatepack", enabled: true, onPressed: () { debugPrint('Submit button pressed for Mimblewimblecoin Slatepack'); From 1466110c1bb40b44816f963c9bb5d0e979a016a5 Mon Sep 17 00:00:00 2001 From: vekamo Date: Sat, 21 Dec 2024 14:46:08 +0100 Subject: [PATCH 015/178] send ui slatepack --- .../sub_widgets/desktop_receive.dart | 3 ++ .../wallet_view/sub_widgets/desktop_send.dart | 37 ++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) 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 b9ef65119f..1ecf44cde9 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 @@ -377,6 +377,9 @@ class _DesktopReceiveState extends ConsumerState { return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ + const SizedBox( + height: 4, + ), if (isMimblewimblecoin) Padding( padding: const EdgeInsets.all(0), 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 0721bbb832..369806dbbc 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 @@ -40,6 +40,7 @@ import '../../../../utilities/barcode_scanner_interface.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; import '../../../../utilities/enums/fee_rate_type_enum.dart'; +import '../../../../utilities/enums/txs_method_mwc_enum.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/prefs.dart'; import '../../../../utilities/text_styles.dart'; @@ -75,6 +76,7 @@ import '../../../coin_control/desktop_coin_control_use_dialog.dart'; import '../../../desktop_home_view.dart'; import 'address_book_address_chooser/address_book_address_chooser.dart'; import 'desktop_fee_dropdown.dart'; +import 'desktop_mwc_txs_method_toggle.dart'; class DesktopSend extends ConsumerStatefulWidget { const DesktopSend({ @@ -108,6 +110,7 @@ class _DesktopSendState extends ConsumerState { // late TextEditingController feeController; late TextEditingController memoController; + late final SendViewAutoFillData? _data; final _addressFocusNode = FocusNode(); @@ -116,7 +119,9 @@ class _DesktopSendState extends ConsumerState { final _memoFocus = FocusNode(); late final bool isStellar; + late final bool isMimblewimblecoin; + String? _selectedMethodMwc; String? _note; String? _onChainNote; @@ -963,6 +968,10 @@ class _DesktopSendState extends ConsumerState { clipboard = widget.clipboard; scanner = widget.barcodeScanner; isStellar = coin is Stellar; + isMimblewimblecoin = coin is Mimblewimblecoin; + if (isMimblewimblecoin) { + _selectedMethodMwc = "Slatepack"; + } sendToController = TextEditingController(); cryptoAmountController = TextEditingController(); @@ -1101,6 +1110,32 @@ class _DesktopSendState extends ConsumerState { const SizedBox( height: 4, ), + if (isMimblewimblecoin) + Padding( + padding: const EdgeInsets.all(0), + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).extension()?.textFieldDefaultBG ?? Colors.white, // Fallback color + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: Theme.of(context).extension()?.backgroundAppBar ?? Colors.grey, // Fallback color + width: 1, + ), + ), + child: SizedBox( + height: 50, // Provide an explicit height to avoid infinite constraints + child: MwcTxsMethodToggle( + onChanged: (TxsMethodMwcType type) { + setState(() { + _selectedMethodMwc = type == TxsMethodMwcType.automatic ? 'Slatepack' : 'Automatic'; + }); + }, + ), + ), + ), + ), + if (isMimblewimblecoin) + if (coin is Firo) Text( "Send from", @@ -1225,7 +1260,7 @@ class _DesktopSendState extends ConsumerState { ), ), ), - if (coin is Firo) + if (coin is Firo || isMimblewimblecoin) const SizedBox( height: 20, ), From 041ce04254c77779a84cd380045dc7ee29fdf09e Mon Sep 17 00:00:00 2001 From: vekamo Date: Sat, 21 Dec 2024 14:46:21 +0100 Subject: [PATCH 016/178] finalize ui slatepack --- .../sub_widgets/desktop_finalize.dart | 374 ++++++++++++++++++ .../wallet_view/sub_widgets/my_wallet.dart | 16 + 2 files changed, 390 insertions(+) create mode 100644 lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart new file mode 100644 index 0000000000..2f07f39563 --- /dev/null +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart @@ -0,0 +1,374 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * 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'; +import 'package:dropdown_button2/dropdown_button2.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:isar/isar.dart'; +import 'package:tuple/tuple.dart'; + +import '../../../../models/isar/models/isar_models.dart'; +import '../../../../models/keys/view_only_wallet_data.dart'; +import '../../../../notifications/show_flush_bar.dart'; +import '../../../../pages/receive_view/generate_receiving_uri_qr_code_view.dart'; +import '../../../../providers/db/main_db_provider.dart'; +import '../../../../providers/providers.dart'; +import '../../../../route_generator.dart'; +import '../../../../themes/stack_colors.dart'; +import '../../../../utilities/address_utils.dart'; +import '../../../../utilities/amount/amount.dart'; +import '../../../../utilities/assets.dart'; +import '../../../../utilities/clipboard_interface.dart'; +import '../../../../utilities/constants.dart'; +import '../../../../utilities/enums/derive_path_type_enum.dart'; +import '../../../../utilities/enums/txs_method_mwc_enum.dart'; +import '../../../../utilities/logger.dart'; +import '../../../../utilities/text_styles.dart'; +import '../../../../utilities/util.dart'; +import '../../../../wallets/crypto_currency/crypto_currency.dart'; +import '../../../../wallets/isar/providers/eth/current_token_wallet_provider.dart'; +import '../../../../wallets/isar/providers/wallet_info_provider.dart'; +import '../../../../wallets/wallet/impl/bitcoin_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; +import '../../../../wallets/wallet/intermediate/bip39_hd_wallet.dart'; +import '../../../../wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart'; +import '../../../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart'; +import '../../../../wallets/wallet/wallet_mixin_interfaces/multi_address_interface.dart'; +import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; +import '../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; +import '../../../../widgets/conditional_parent.dart'; +import '../../../../widgets/desktop/primary_button.dart'; +import '../../../../widgets/icon_widgets/clipboard_icon.dart'; +import '../../../../widgets/icon_widgets/x_icon.dart'; +import '../../../../widgets/stack_text_field.dart'; +import '../../../../widgets/textfield_icon_button.dart'; +import '../../../../widgets/toggle.dart'; +import '../../../../widgets/custom_buttons/app_bar_icon_button.dart'; +import '../../../../widgets/custom_loading_overlay.dart'; +import '../../../../widgets/desktop/desktop_dialog.dart'; +import '../../../../widgets/desktop/secondary_button.dart'; +import '../../../../widgets/qr.dart'; +import '../../../../widgets/rounded_white_container.dart'; +import 'desktop_mwc_txs_method_toggle.dart'; + +class DesktopFinalize extends ConsumerStatefulWidget { + const DesktopFinalize({ + super.key, + required this.walletId, + this.contractAddress, + this.clipboard = const ClipboardWrapper(), + }); + + final String walletId; + final String? contractAddress; + final ClipboardInterface clipboard; + + @override + ConsumerState createState() => _DesktopFinalizeState(); +} + +class _DesktopFinalizeState extends ConsumerState { + late final CryptoCurrency coin; + late final String walletId; + late final ClipboardInterface clipboard; + late final bool supportsSpark; + late final bool showMultiType; + late final bool isMimblewimblecoin; + late TextEditingController receiveSlateController; + String? _address; + bool _addressToggleFlag = false; + final _addressFocusNode = FocusNode(); + + int _currentIndex = 0; + String? _selectedMethodMwc; // Variable to store selected dropdown value + String? _note; + + final List _walletAddressTypes = []; + final Map _addressMap = {}; + final Map> _addressSubMap = {}; + + + + Future pasteAddress() async { + final ClipboardData? data = await clipboard.getData(Clipboard.kTextPlain); + if (data?.text != null && data!.text!.isNotEmpty) { + String content = data.text!.trim(); + if (content.contains("\n")) { + content = content.substring(0, content.indexOf("\n")); + } + + try { + final paymentData = AddressUtils.parsePaymentUri( + content, + logging: Logging.instance, + ); + if (paymentData != null && + paymentData.coin?.uriScheme == coin.uriScheme) { + _address = paymentData.address; + receiveSlateController.text = _address!; + setState(() { + _addressToggleFlag = receiveSlateController.text.isNotEmpty; + }); + } else { + content = content.split("\n").first.trim(); + if (coin is Mimblewimblecoin) { + content = AddressUtils().formatAddressMwc(content); + } + + receiveSlateController.text = content; + _address = content; + + //_setValidAddressProviders(_address); + setState(() { + _addressToggleFlag = receiveSlateController.text.isNotEmpty; + }); + } + } catch (e) { + if (coin is Mimblewimblecoin) { + // strip http:// and https:// if content contains @ + content = AddressUtils().formatAddressMwc(content); + } + receiveSlateController.text = content; + _address = content; + // Trigger validation after pasting. + //_setValidAddressProviders(_address); + setState(() { + _addressToggleFlag = receiveSlateController.text.isNotEmpty; + }); + } + } + } + + + @override + void initState() { + receiveSlateController = TextEditingController(); + walletId = widget.walletId; + coin = ref.read(pWalletInfo(walletId)).coin; + clipboard = widget.clipboard; + final wallet = ref.read(pWallets).getWallet(walletId); + supportsSpark = ref.read(pWallets).getWallet(walletId) is SparkInterface; + + isMimblewimblecoin = wallet is MimblewimblecoinWallet; + if (isMimblewimblecoin) { + _selectedMethodMwc = "Slatepack"; + } + debugPrint("Address generated: $isMimblewimblecoin"); + + + if (wallet is ViewOnlyOptionInterface && wallet.isViewOnly) { + showMultiType = false; + } else { + showMultiType = supportsSpark || + (wallet is! BCashInterface && + wallet is Bip39HDWallet && + wallet.supportedAddressTypes.length > 1); + } + + _walletAddressTypes.add(wallet.info.mainAddressType); + + if (showMultiType) { + if (supportsSpark) { + _walletAddressTypes.insert(0, AddressType.spark); + } else { + _walletAddressTypes.addAll( + (wallet as Bip39HDWallet) + .supportedAddressTypes + .where((e) => e != wallet.info.mainAddressType), + ); + } + } + + if (_walletAddressTypes.length > 1 && wallet is BitcoinWallet) { + _walletAddressTypes.removeWhere((e) => e == AddressType.p2pkh); + } + + _addressMap[_walletAddressTypes[_currentIndex]] = + ref.read(pWalletReceivingAddress(walletId)); + + if (showMultiType) { + for (final type in _walletAddressTypes) { + _addressSubMap[type] = ref + .read(mainDBProvider) + .isar + .addresses + .where() + .walletIdEqualTo(walletId) + .filter() + .typeEqualTo(type) + .sortByDerivationIndexDesc() + .findFirst() + .asStream() + .listen((event) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) { + setState(() { + _addressMap[type] = + event?.value ?? _addressMap[type] ?? "[No address yet]"; + }); + } + }); + }); + } + } + + super.initState(); + } + + @override + void dispose() { + for (final subscription in _addressSubMap.values) { + subscription.cancel(); + } + super.dispose(); + } + + @override + Widget build(BuildContext context) { + debugPrint("BUILD: $runtimeType"); + + final String address; + if (showMultiType) { + address = _addressMap[_walletAddressTypes[_currentIndex]]!; + } else { + address = ref.watch(pWalletReceivingAddress(walletId)); + } + + final wallet = ref.watch(pWallets.select((value) => value.getWallet(walletId))); + + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + const SizedBox( + height: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Label Text + Text( + "Finalize Slatepack", + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, + ), + textAlign: TextAlign.left, + ), + const SizedBox(height: 8), + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + minLines: 1, + maxLines: 5, + key: const Key("sendViewAddressFieldKey"), + controller: receiveSlateController, + readOnly: false, + autocorrect: false, + enableSuggestions: false, + toolbarOptions: const ToolbarOptions( + copy: false, + cut: false, + paste: true, + selectAll: false, + ), + onChanged: (newValue) { + _address = newValue; + //_setValidAddressProviders(_address); + + setState(() { + _addressToggleFlag = newValue.isNotEmpty; + }); + }, + focusNode: _addressFocusNode, + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveText, + height: 1.8, + ), + decoration: standardInputDecoration( + "Enter Final Slatepack Message", + _addressFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 12, // Adjust vertical padding for better alignment + ), + suffixIcon: Padding( + padding: receiveSlateController.text.isEmpty + ? const EdgeInsets.only(right: 8) + : const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _addressToggleFlag + ? TextFieldIconButton( + key: const Key("sendViewClearAddressFieldButtonKey"), + onTap: () { + receiveSlateController.text = ""; + _address = ""; + setState(() { + _addressToggleFlag = false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + key: const Key( + "sendViewPasteAddressFieldButtonKey", + ), + onTap: pasteAddress, + child: receiveSlateController.text.isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + ], + ), + ), + ), + ), + ), + ), + ], + ), + const SizedBox( + height: 32, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: PrimaryButton( + buttonHeight: ButtonHeight.l, + label: "Preview Receive Slatepack", + enabled: true, + onPressed: () { + debugPrint('Submit button pressed for Mimblewimblecoin Slatepack'); + }, + ), + ) + ], + ); + } +} + + 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 622630c4a7..e16254aa51 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 @@ -17,12 +17,14 @@ import '../../../../pages/wallet_view/transaction_views/tx_v2/transaction_v2_lis import '../../../../providers/global/wallets_provider.dart'; import '../../../../wallets/crypto_currency/crypto_currency.dart'; import '../../../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; import '../../../../widgets/custom_tab_view.dart'; import '../../../../widgets/desktop/secondary_button.dart'; import '../../../../widgets/frost_scaffold.dart'; import '../../../../widgets/rounded_white_container.dart'; import '../../my_stack_view.dart'; +import 'desktop_finalize.dart'; import 'desktop_receive.dart'; import 'desktop_send.dart'; import 'desktop_token_send.dart'; @@ -50,6 +52,7 @@ class _MyWalletState extends ConsumerState { late final bool isEth; late final CryptoCurrency coin; late final bool isFrost; + late final bool isMimblewimblecoin; late final bool isViewOnly; @override @@ -59,6 +62,11 @@ class _MyWalletState extends ConsumerState { isFrost = wallet is BitcoinFrostWallet; isEth = coin is Ethereum; + + if (isMimblewimblecoin) { + titles.add("Finalize"); + } + if (isEth && widget.contractAddress == null) { titles.add("Transactions"); } @@ -167,6 +175,14 @@ class _MyWalletState extends ConsumerState { contractAddress: widget.contractAddress, ), ), + if (isMimblewimblecoin) + Padding( + padding: const EdgeInsets.all(20), + child: DesktopFinalize( + walletId: widget.walletId, + ), + ), + if (isEth && widget.contractAddress == null) Padding( padding: const EdgeInsets.only(top: 8.0), From 928676e2cdeed68a67324d5a4fbfb7b0513f51a2 Mon Sep 17 00:00:00 2001 From: Julian Date: Sun, 3 Aug 2025 11:51:22 -0600 Subject: [PATCH 017/178] dialog safe area fix --- lib/main.dart | 2 +- lib/widgets/stack_dialog.dart | 128 +++++++++++++++------------------- 2 files changed, 57 insertions(+), 73 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 0eb4c224c5..6a042070d0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -217,7 +217,7 @@ void main(List args) async { await CampfireMigration.init(); } - if (kDebugMode) { + if (kDebugMode && !Platform.isIOS) { unawaited( MwebdService.instance .logsStream(CryptoCurrencyNetwork.main) diff --git a/lib/widgets/stack_dialog.dart b/lib/widgets/stack_dialog.dart index ff921d24c5..f601330b6f 100644 --- a/lib/widgets/stack_dialog.dart +++ b/lib/widgets/stack_dialog.dart @@ -28,39 +28,37 @@ class StackDialogBase extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( - padding: EdgeInsets.only( - top: 16, - left: 16, - right: 16, - bottom: 16 + keyboardPaddingAmount, - ), - child: Column( - mainAxisAlignment: - !Util.isDesktop ? MainAxisAlignment.end : MainAxisAlignment.center, - children: [ - Flexible( - child: SingleChildScrollView( - child: Material( - borderRadius: BorderRadius.circular( - 20, - ), - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).extension()!.popupBG, - borderRadius: BorderRadius.circular( - 20, + return SafeArea( + child: Padding( + padding: EdgeInsets.only( + top: 16, + left: 16, + right: 16, + bottom: 16 + keyboardPaddingAmount, + ), + child: Column( + mainAxisAlignment: + !Util.isDesktop + ? MainAxisAlignment.end + : MainAxisAlignment.center, + children: [ + Flexible( + child: SingleChildScrollView( + child: Material( + borderRadius: BorderRadius.circular(20), + child: Container( + decoration: BoxDecoration( + color: + Theme.of(context).extension()!.popupBG, + borderRadius: BorderRadius.circular(20), ), - ), - child: Padding( - padding: padding, - child: child, + child: Padding(padding: padding, child: child), ), ), ), ), - ), - ], + ], + ), ), ); } @@ -102,10 +100,7 @@ class StackDialog extends StatelessWidget { icon != null ? icon! : Container(), ], ), - if (message != null) - const SizedBox( - height: 8, - ), + if (message != null) const SizedBox(height: 8), if (message != null) Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -117,18 +112,14 @@ class StackDialog extends StatelessWidget { ], ), if (leftButton != null || rightButton != null) - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), if (leftButton != null || rightButton != null) Row( children: [ leftButton == null ? const Spacer() : Expanded(child: leftButton!), - const SizedBox( - width: 8, - ), + const SizedBox(width: 8), rightButton == null ? const Spacer() : Expanded(child: rightButton!), @@ -174,23 +165,18 @@ class StackOkDialog extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Flexible( - child: Text( - title, - style: STextStyles.pageTitleH2(context), - ), + child: Text(title, style: STextStyles.pageTitleH2(context)), ), icon != null ? icon! : Container(), ], ), ), - if (message != null) - const SizedBox( - height: 8, - ), + if (message != null) const SizedBox(height: 8), if (message != null) ConstrainedBox( - constraints: - BoxConstraints(maxWidth: maxWidth ?? double.infinity), + constraints: BoxConstraints( + maxWidth: maxWidth ?? double.infinity, + ), child: Row( children: [ Flexible( @@ -202,9 +188,7 @@ class StackOkDialog extends StatelessWidget { ], ), ), - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), ConstrainedBox( constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity), child: Row( @@ -212,33 +196,33 @@ class StackOkDialog extends StatelessWidget { leftButton == null ? const Spacer() : Expanded(child: leftButton!), - const SizedBox( - width: 8, - ), + const SizedBox(width: 8), Expanded( child: TextButton( - onPressed: !Util.isDesktop - ? () { - Navigator.of(context).pop(); - onOkPressed?.call("OK"); - } - : () { - if (desktopPopRootNavigator) { - Navigator.of(context, rootNavigator: true).pop(); - } else { - int count = 0; - Navigator.of(context) - .popUntil((_) => count++ >= 2); - // onOkPressed?.call("OK"); + onPressed: + !Util.isDesktop + ? () { + Navigator.of(context).pop(); + onOkPressed?.call("OK"); } - }, + : () { + if (desktopPopRootNavigator) { + Navigator.of( + context, + rootNavigator: true, + ).pop(); + } else { + int count = 0; + Navigator.of( + context, + ).popUntil((_) => count++ >= 2); + // onOkPressed?.call("OK"); + } + }, style: Theme.of(context) .extension()! .getPrimaryEnabledButtonStyle(context), - child: Text( - "Ok", - style: STextStyles.button(context), - ), + child: Text("Ok", style: STextStyles.button(context)), ), ), ], From f01ce8095f2cad83cc6637f0fdf5f161e304a9f2 Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 4 Aug 2025 09:52:49 -0600 Subject: [PATCH 018/178] eth related navigation fixes --- lib/main.dart | 9 +- .../verify_recovery_phrase_view.dart | 20 +- lib/pages/wallets_view/wallets_overview.dart | 213 +++++++++--------- .../global/global_nav_key_provider.dart | 4 + lib/providers/providers.dart | 1 + 5 files changed, 122 insertions(+), 125 deletions(-) create mode 100644 lib/providers/global/global_nav_key_provider.dart diff --git a/lib/main.dart b/lib/main.dart index 6a042070d0..c750009507 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -344,7 +344,6 @@ class MaterialAppWithTheme extends ConsumerStatefulWidget { class _MaterialAppWithThemeState extends ConsumerState with WidgetsBindingObserver { static const platform = MethodChannel("STACK_WALLET_RESTORE"); - final GlobalKey navigatorKey = GlobalKey(); // late final Wallets _wallets; // late final Prefs _prefs; @@ -659,10 +658,10 @@ class _MaterialAppWithThemeState extends ConsumerState Future goToRestoreSWB(String encrypted) async { if (!ref.read(prefsChangeNotifierProvider).hasPin) { await Navigator.of( - navigatorKey.currentContext!, + ref.read(pNavKey).currentContext!, ).pushNamed(CreatePinView.routeName, arguments: true).then((value) { if (value is! bool || value == false) { - Navigator.of(navigatorKey.currentContext!).pushNamed( + Navigator.of(ref.read(pNavKey).currentContext!).pushNamed( RestoreFromEncryptedStringView.routeName, arguments: encrypted, ); @@ -671,7 +670,7 @@ class _MaterialAppWithThemeState extends ConsumerState } else { unawaited( Navigator.push( - navigatorKey.currentContext!, + ref.read(pNavKey).currentContext!, RouteGenerator.getRoute( shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, builder: @@ -711,7 +710,7 @@ class _MaterialAppWithThemeState extends ConsumerState return MaterialApp( key: GlobalKey(), - navigatorKey: navigatorKey, + navigatorKey: ref.read(pNavKey), title: AppConfig.appName, onGenerateRoute: RouteGenerator.generateRoute, theme: ThemeData( 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 c562ec88e4..9d79a315eb 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 @@ -95,11 +95,6 @@ class _VerifyRecoveryPhraseViewState super.initState(); } - @override - dispose() { - super.dispose(); - } - Future _verifyMnemonicPassphrase() async { final result = await showDialog( context: context, @@ -391,12 +386,15 @@ class _VerifyRecoveryPhraseViewState ).pushNamedAndRemoveUntil(HomeView.routeName, (route) => false), ); if (_coin is Ethereum) { - unawaited( - Navigator.of(context).pushNamed( - EditWalletTokensView.routeName, - arguments: widget.wallet.walletId, - ), - ); + WidgetsBinding.instance.addPostFrameCallback((_) { + ref + .read(pNavKey) + .currentState + ?.pushNamed( + EditWalletTokensView.routeName, + arguments: widget.wallet.walletId, + ); + }); } } } diff --git a/lib/pages/wallets_view/wallets_overview.dart b/lib/pages/wallets_view/wallets_overview.dart index 95e38b07d0..7ba524713f 100644 --- a/lib/pages/wallets_view/wallets_overview.dart +++ b/lib/pages/wallets_view/wallets_overview.dart @@ -17,7 +17,6 @@ import '../../app_config.dart'; import '../../models/add_wallet_list_entity/sub_classes/coin_entity.dart'; import '../../models/isar/models/ethereum/eth_contract.dart'; import '../../pages_desktop_specific/my_stack_view/dialogs/desktop_expanding_wallet_card.dart'; -import '../../providers/db/main_db_provider.dart'; import '../../providers/providers.dart'; import '../../services/event_bus/events/wallet_added_event.dart'; import '../../services/event_bus/global_event_bus.dart'; @@ -28,6 +27,7 @@ import '../../utilities/text_styles.dart'; import '../../utilities/util.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; import '../../wallets/isar/models/wallet_info.dart'; +import '../../wallets/isar/providers/all_wallets_info_provider.dart'; import '../../wallets/isar/providers/wallet_info_provider.dart'; import '../../wallets/wallet/wallet.dart'; import '../../widgets/background.dart'; @@ -73,13 +73,14 @@ class _EthWalletsOverviewState extends ConsumerState { List _filter(String searchTerm) { // clean out deleted wallets - final existingWalletIds = ref - .read(mainDBProvider) - .isar - .walletInfo - .where() - .walletIdProperty() - .findAllSync(); + final existingWalletIds = + ref + .read(mainDBProvider) + .isar + .walletInfo + .where() + .walletIdProperty() + .findAllSync(); wallets.removeWhere((k, v) => !existingWalletIds.contains(k)); if (searchTerm.isEmpty) { @@ -127,25 +128,22 @@ class _EthWalletsOverviewState extends ConsumerState { } void updateWallets() { - final walletsData = - ref.read(mainDBProvider).isar.walletInfo.where().findAllSync(); + final walletsData = ref.read(pAllWalletsInfo); + walletsData.removeWhere((e) => e.coin != widget.coin); if (widget.coin is Ethereum) { for (final data in walletsData) { final List contracts = []; - final contractAddresses = - ref.read(pWalletTokenAddresses(data.walletId)); + final contractAddresses = ref.read( + pWalletTokenAddresses(data.walletId), + ); // fetch each contract for (final contractAddress in contractAddresses) { final contract = ref - .read( - mainDBProvider, - ) - .getEthContractSync( - contractAddress, - ); + .read(mainDBProvider) + .getEthContractSync(contractAddress); // add it to list if it exists in DB if (contract != null) { @@ -155,9 +153,7 @@ class _EthWalletsOverviewState extends ConsumerState { // add tuple to list wallets[data.walletId] = ( - wallet: ref.read(pWallets).getWallet( - data.walletId, - ), + wallet: ref.read(pWallets).getWallet(data.walletId), contracts: contracts, ); } @@ -167,9 +163,7 @@ class _EthWalletsOverviewState extends ConsumerState { // desktop single coin apps may cause issues so lets just ignore the error and move on try { wallets[data.walletId] = ( - wallet: ref.read(pWallets).getWallet( - data.walletId, - ), + wallet: ref.read(pWallets).getWallet(data.walletId), contracts: [], ); } catch (_) { @@ -211,46 +205,45 @@ class _EthWalletsOverviewState extends ConsumerState { Widget build(BuildContext context) { return ConditionalParent( condition: !isDesktop && !AppConfig.isSingleCoinApp, - builder: (child) => Background( - child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, - appBar: AppBar( - leading: const AppBarBackButton(), - title: Text( - "${widget.coin.prettyName} (${widget.coin.ticker}) wallets", - style: STextStyles.navBarTitle(context), - ), - actions: [ - AspectRatio( - aspectRatio: 1, - child: AppBarIconButton( - icon: SvgPicture.asset( - Assets.svg.plus, - width: 18, - height: 18, - color: Theme.of(context) - .extension()! - .topNavIconPrimary, - ), - onPressed: () { - Navigator.of(context).pushNamed( - CreateOrRestoreWalletView.routeName, - arguments: CoinEntity(widget.coin), - ); - }, + builder: + (child) => Background( + child: Scaffold( + backgroundColor: + Theme.of(context).extension()!.background, + appBar: AppBar( + leading: const AppBarBackButton(), + title: Text( + "${widget.coin.prettyName} (${widget.coin.ticker}) wallets", + style: STextStyles.navBarTitle(context), ), + actions: [ + AspectRatio( + aspectRatio: 1, + child: AppBarIconButton( + icon: SvgPicture.asset( + Assets.svg.plus, + width: 18, + height: 18, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, + ), + onPressed: () { + Navigator.of(context).pushNamed( + CreateOrRestoreWalletView.routeName, + arguments: CoinEntity(widget.coin), + ); + }, + ), + ), + ], + ), + body: SafeArea( + child: Padding(padding: const EdgeInsets.all(16), child: child), ), - ], - ), - body: SafeArea( - child: Padding( - padding: const EdgeInsets.all(16), - child: child, ), ), - ), - ), child: Column( children: [ ClipRRect( @@ -267,14 +260,16 @@ class _EthWalletsOverviewState extends ConsumerState { _searchString = value; }); }, - style: isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, - height: 1.8, - ) - : STextStyles.field(context), + style: + isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textFieldActiveText, + height: 1.8, + ) + : STextStyles.field(context), decoration: standardInputDecoration( "Search...", searchFieldFocusNode, @@ -292,32 +287,31 @@ class _EthWalletsOverviewState extends ConsumerState { height: isDesktop ? 20 : 16, ), ), - suffixIcon: _searchController.text.isNotEmpty - ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - _searchController.text = ""; - _searchString = ""; - }); - }, - ), - ], + suffixIcon: + _searchController.text.isNotEmpty + ? Padding( + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + _searchController.text = ""; + _searchString = ""; + }); + }, + ), + ], + ), ), - ), - ) - : null, + ) + : null, ), ), ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), Expanded( child: Builder( builder: (context) { @@ -346,33 +340,34 @@ class _EthWalletsOverviewState extends ConsumerState { return ConditionalParent( key: Key(wallet.walletId), condition: isDesktop, - builder: (child) => RoundedWhiteContainer( - padding: const EdgeInsets.symmetric( - vertical: 14, - horizontal: 20, - ), - borderColor: Theme.of(context) - .extension()! - .backgroundAppBar, - child: child, - ), + builder: + (child) => RoundedWhiteContainer( + padding: const EdgeInsets.symmetric( + vertical: 14, + horizontal: 20, + ), + borderColor: + Theme.of( + context, + ).extension()!.backgroundAppBar, + child: child, + ), child: SimpleWalletCard( walletId: wallet.walletId, - popPrevious: widget - .overrideSimpleWalletCardPopPreviousValueWith == - null - ? isDesktop - : widget - .overrideSimpleWalletCardPopPreviousValueWith!, + popPrevious: + widget.overrideSimpleWalletCardPopPreviousValueWith == + null + ? isDesktop + : widget + .overrideSimpleWalletCardPopPreviousValueWith!, desktopNavigatorState: isDesktop ? widget.navigatorState : null, ), ); } }, - separatorBuilder: (_, __) => SizedBox( - height: isDesktop ? 10 : 8, - ), + separatorBuilder: + (_, __) => SizedBox(height: isDesktop ? 10 : 8), itemCount: data.length, ); }, diff --git a/lib/providers/global/global_nav_key_provider.dart b/lib/providers/global/global_nav_key_provider.dart new file mode 100644 index 0000000000..1cf0ad7ba5 --- /dev/null +++ b/lib/providers/global/global_nav_key_provider.dart @@ -0,0 +1,4 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +final pNavKey = Provider((_) => GlobalKey()); diff --git a/lib/providers/providers.dart b/lib/providers/providers.dart index d86e4de3bc..598f3a3d0c 100644 --- a/lib/providers/providers.dart +++ b/lib/providers/providers.dart @@ -27,6 +27,7 @@ export './global/mweb_service_provider.dart'; export './global/node_service_provider.dart'; export './global/notifications_provider.dart'; export './global/prefs_provider.dart'; +export './global/global_nav_key_provider.dart'; export './global/price_provider.dart'; export './global/should_show_lockscreen_on_resume_state_provider.dart'; export './global/wallets_provider.dart'; From fed6ff39ae2a7b424f2c5b4d4bcc9377d3045023 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 5 Aug 2025 07:26:09 -0600 Subject: [PATCH 019/178] mweb fee calc bandaid and rounding fix --- .../wallet/wallet_mixin_interfaces/mweb_interface.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart index 4480ef81b8..c7fded3865 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart @@ -952,13 +952,14 @@ mixin MwebInterface BigInt feeIncrease = posOutputSum - expectedPegin; if (expectedPegin > BigInt.zero) { - feeIncrease += BigInt.from( - (txData.feeRateAmount! / BigInt.from(1000) * 41).ceil(), - ); + feeIncrease += + BigInt.from((txData.feeRateAmount! / BigInt.from(1000)).ceil()) * + BigInt.from(41); } + // bandaid: add one to account for a rounding error that happens sometimes return Amount( - rawValue: fee + feeIncrease, + rawValue: fee + feeIncrease + BigInt.one, fractionDigits: cryptoCurrency.fractionDigits, ); } From 6c7231cc09dc1ae4f20d0544d607609e0dd30cdd Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 5 Aug 2025 08:04:32 -0600 Subject: [PATCH 020/178] mweb pegout send all error fix --- .../wallet/wallet_mixin_interfaces/electrumx_interface.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart index e978a0bd79..fd9b67ccbb 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart @@ -276,7 +276,7 @@ mixin ElectrumXInterface // hack check if (!(txData.type == TxType.mwebPegIn || - (txData.type == TxType.mweb && overrideFeeAmount != null))) { + (txData.type.isMweb() && overrideFeeAmount != null))) { throw Exception( "Something happened that should never actually happen. " "Please report this error to the developers.", From d13acd62645c8cfec9142bc68874cb4c3f21eb9b Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 5 Aug 2025 11:39:58 -0600 Subject: [PATCH 021/178] Silly hack(?) to temporarily show mweb spends. Note: Unless wallet is open when the transaction confirms the tx details view will show the wrong transaction height. --- lib/wallets/wallet/impl/litecoin_wallet.dart | 4 ++ .../electrumx_interface.dart | 17 ++++++- .../mweb_interface.dart | 50 +++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/lib/wallets/wallet/impl/litecoin_wallet.dart b/lib/wallets/wallet/impl/litecoin_wallet.dart index 76205c2523..740710d1dd 100644 --- a/lib/wallets/wallet/impl/litecoin_wallet.dart +++ b/lib/wallets/wallet/impl/litecoin_wallet.dart @@ -361,6 +361,10 @@ class LitecoinWallet } await mainDB.updateOrPutTransactionV2s(txns); + + if (info.isMwebEnabled) { + await checkMwebSpends(); + } } @override diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart index fd9b67ccbb..dbfc8d45f5 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart @@ -907,8 +907,23 @@ mixin ElectrumXInterface // dirty shortcut for peercoin's weirdness vSize: this is PeercoinWallet ? clTx.size : clTx.vSize(), tempTx: - txData.type.isMweb() + txData.type == TxType.mwebPegIn ? null + : txData.type.isMweb() + ? TransactionV2( + walletId: walletId, + blockHash: null, + hash: clTx.hashHex, + txid: clTx.txid, + height: null, + timestamp: DateTime.timestamp().millisecondsSinceEpoch ~/ 1000, + inputs: List.unmodifiable(tempInputs), + outputs: List.unmodifiable(tempOutputs), + version: clTx.version, + type: TransactionType.outgoing, + subType: TransactionSubType.mweb, + otherData: null, + ) : TransactionV2( walletId: walletId, blockHash: null, diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart index c7fded3865..1f7babc79f 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart @@ -358,6 +358,56 @@ mixin MwebInterface ); } + Future checkMwebSpends() async { + final pending = + await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .filter() + .heightIsNull() + .and() + .blockHashIsNull() + .and() + .subTypeEqualTo(TransactionSubType.mweb) + .and() + .typeEqualTo(TransactionType.outgoing) + .findAll(); + + Logging.instance.f(pending); + + final client = await _client; + for (final tx in pending) { + for (final input in tx.inputs) { + if (input.addresses.length == 1) { + final address = await mainDB.getAddress( + walletId, + input.addresses.first, + ); + if (address?.type == AddressType.mweb) { + final response = await client.spent( + SpentRequest(outputId: [input.outpoint!.txid]), + ); + if (response.outputId.contains(input.outpoint!.txid)) { + // dummy to show tx as confirmed. Need a better way to handle this as its kind of stupid, resulting in terrible UX + final dummyHeight = await chainHeight; + + TransactionV2? transaction = + await mainDB.isar.transactionV2s + .where() + .txidWalletIdEqualTo(tx.txid, walletId) + .findFirst(); + + if (transaction == null || transaction.height == null) { + transaction = (transaction ?? tx).copyWith(height: dummyHeight); + await mainDB.updateOrPutTransactionV2s([transaction]); + } + } + } + } + } + } + } + Future processMwebTransaction(TxData txData) async { final client = await _client; final response = await client.create( From 70f4ef25b3a4bd393007765bf17ff9fac8eb3f81 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 13 Aug 2025 12:38:40 -0600 Subject: [PATCH 022/178] pre cache mobile settings icons --- lib/pages/home_view/home_view.dart | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index 126a16bfb0..4beb066630 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -29,6 +29,7 @@ import '../../utilities/constants.dart'; import '../../utilities/idle_monitor.dart'; import '../../utilities/prefs.dart'; import '../../utilities/text_styles.dart'; +import '../../utilities/util.dart'; import '../../widgets/animated_widgets/rotate_icon.dart'; import '../../widgets/app_icon.dart'; import '../../widgets/background.dart'; @@ -171,6 +172,41 @@ class _HomeViewState extends ConsumerState { ); } + Future precacheSettingsIcons(BuildContext context) async { + if (Util.isDesktop) return; + + final icons = [ + Assets.svg.addressBook, + Assets.svg.downloadFolder, + Assets.svg.lock, + Assets.svg.dollarSign, + Assets.svg.language, + Assets.svg.node, + Assets.svg.arrowRotate, + Assets.svg.arrowUpRight, + Assets.svg.sun, + Assets.svg.circleAlert, + Assets.svg.ellipsis, + Assets.svg.solidSliders, + Assets.svg.questionMessage, + ]; + + for (final asset in icons) { + final loader = SvgAssetLoader(asset); + await svg.cache.putIfAbsent( + loader.cacheKey(context), + () => loader.loadBytes(context), + ); + } + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + precacheSettingsIcons(context); + } + @override void initState() { _autoLockInfo = ref.read(prefsChangeNotifierProvider).autoLockInfo; From e8117528904b1691b5d23156568819724878e582 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 13 Aug 2025 19:11:30 -0600 Subject: [PATCH 023/178] auto one time clear of possible bad used tags cache. --- lib/db/sqlite/firo_cache.dart | 57 +++++++-------- lib/db/sqlite/firo_cache_coordinator.dart | 69 +++++++++---------- lib/wallets/isar/models/wallet_info.dart | 2 + lib/wallets/wallet/wallet.dart | 7 ++ .../spark_interface.dart | 15 ++++ 5 files changed, 85 insertions(+), 65 deletions(-) diff --git a/lib/db/sqlite/firo_cache.dart b/lib/db/sqlite/firo_cache.dart index c2ebbfe66f..4478f421f4 100644 --- a/lib/db/sqlite/firo_cache.dart +++ b/lib/db/sqlite/firo_cache.dart @@ -65,11 +65,13 @@ abstract class _FiroCache { await StackFileSystem.applicationFiroCacheSQLiteDirectory(); for (final network in networks) { - final sparkSetCacheFile = - File("${sqliteDir.path}/${sparkSetCacheFileName(network)}"); + final sparkSetCacheFile = File( + "${sqliteDir.path}/${sparkSetCacheFileName(network)}", + ); - final sparkUsedTagsCacheFile = - File("${sqliteDir.path}/${sparkUsedTagsCacheFileName(network)}"); + final sparkUsedTagsCacheFile = File( + "${sqliteDir.path}/${sparkUsedTagsCacheFileName(network)}", + ); if (!(await sparkSetCacheFile.exists())) { await _createSparkSetCacheDb(sparkSetCacheFile.path); @@ -91,35 +93,40 @@ abstract class _FiroCache { static Future _deleteAllCache(CryptoCurrencyNetwork network) async { final start = DateTime.now(); - setCacheDB(network).execute( - """ + setCacheDB(network).execute(""" DELETE FROM SparkSet; DELETE FROM SparkCoin; DELETE FROM SparkSetCoins; VACUUM; - """, + """); + await _deleteUsedTagsCache(network); + + Logging.instance.d( + "_deleteAllCache() " + "duration = ${DateTime.now().difference(start)}", ); - usedTagsCacheDB(network).execute( - """ + } + + static Future _deleteUsedTagsCache( + CryptoCurrencyNetwork network, + ) async { + final start = DateTime.now(); + + usedTagsCacheDB(network).execute(""" DELETE FROM SparkUsedCoinTags; VACUUM; - """, - ); + """); Logging.instance.d( - "_deleteAllCache() " + "_deleteUsedTagsCache() " "duration = ${DateTime.now().difference(start)}", ); } static Future _createSparkSetCacheDb(String file) async { - final db = sqlite3.open( - file, - mode: OpenMode.readWriteCreate, - ); + final db = sqlite3.open(file, mode: OpenMode.readWriteCreate); - db.execute( - """ + db.execute(""" CREATE TABLE SparkSet ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, blockHash TEXT NOT NULL, @@ -145,27 +152,21 @@ abstract class _FiroCache { FOREIGN KEY (setId) REFERENCES SparkSet(id), FOREIGN KEY (coinId) REFERENCES SparkCoin(id) ); - """, - ); + """); db.dispose(); } static Future _createSparkUsedTagsCacheDb(String file) async { - final db = sqlite3.open( - file, - mode: OpenMode.readWriteCreate, - ); + final db = sqlite3.open(file, mode: OpenMode.readWriteCreate); - db.execute( - """ + db.execute(""" CREATE TABLE SparkUsedCoinTags ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, tag TEXT NOT NULL UNIQUE, txid TEXT NOT NULL ); - """, - ); + """); db.dispose(); } diff --git a/lib/db/sqlite/firo_cache_coordinator.dart b/lib/db/sqlite/firo_cache_coordinator.dart index 6adeba520b..71f01e92b2 100644 --- a/lib/db/sqlite/firo_cache_coordinator.dart +++ b/lib/db/sqlite/firo_cache_coordinator.dart @@ -23,7 +23,13 @@ abstract class FiroCacheCoordinator { } } - static Future clearSharedCache(CryptoCurrencyNetwork network) async { + static Future clearSharedCache( + CryptoCurrencyNetwork network, { + bool clearOnlyUsedTagsCache = false, + }) async { + if (clearOnlyUsedTagsCache) { + return await _FiroCache._deleteUsedTagsCache(network); + } return await _FiroCache._deleteAllCache(network); } @@ -38,9 +44,10 @@ abstract class FiroCacheCoordinator { final setSize = (await setCacheFile.exists()) ? await setCacheFile.length() : 0; - final tagsSize = (await usedTagsCacheFile.exists()) - ? await usedTagsCacheFile.length() - : 0; + final tagsSize = + (await usedTagsCacheFile.exists()) + ? await usedTagsCacheFile.length() + : 0; Logging.instance.d("Spark cache used tags size: $tagsSize"); Logging.instance.d("Spark cache anon set size: $setSize"); @@ -67,16 +74,11 @@ abstract class FiroCacheCoordinator { ) async { await _tagLocks[network]!.protect(() async { final count = await FiroCacheCoordinator.getUsedCoinTagsCount(network); - final unhashedTags = - await client.getSparkUnhashedUsedCoinsTagsWithTxHashes( - startNumber: count, - ); + final unhashedTags = await client + .getSparkUnhashedUsedCoinsTagsWithTxHashes(startNumber: count); if (unhashedTags.isNotEmpty) { await _workers[network]!.runTask( - FCTask( - func: FCFuncName._updateSparkUsedTagsWith, - data: unhashedTags, - ), + FCTask(func: FCFuncName._updateSparkUsedTagsWith, data: unhashedTags), ); } }); @@ -98,9 +100,7 @@ abstract class FiroCacheCoordinator { final prevSize = prevMeta?.size ?? 0; - final meta = await client.getSparkAnonymitySetMeta( - coinGroupId: groupId, - ); + final meta = await client.getSparkAnonymitySetMeta(coinGroupId: groupId); progressUpdated?.call(prevSize, meta.size); @@ -141,9 +141,10 @@ abstract class FiroCacheCoordinator { coins.addAll(data); } - final result = coins - .map((e) => RawSparkCoin.fromRPCResponse(e as List, groupId)) - .toList(); + final result = + coins + .map((e) => RawSparkCoin.fromRPCResponse(e as List, groupId)) + .toList(); await _workers[network]!.runTask( FCTask( @@ -167,9 +168,7 @@ abstract class FiroCacheCoordinator { return result.map((e) => e["tag"] as String).toSet(); } - static Future getUsedCoinTagsCount( - CryptoCurrencyNetwork network, - ) async { + static Future getUsedCoinTagsCount(CryptoCurrencyNetwork network) async { final result = await _Reader._getUsedCoinTagsCount( db: _FiroCache.usedTagsCacheDB(network), ); @@ -195,12 +194,7 @@ abstract class FiroCacheCoordinator { return []; } return result.rows - .map( - (e) => ( - tag: e[0] as String, - txid: e[1] as String, - ), - ) + .map((e) => (tag: e[0] as String, txid: e[1] as String)) .toList(); } @@ -230,16 +224,17 @@ abstract class FiroCacheCoordinator { String? afterBlockHash, required CryptoCurrencyNetwork network, }) async { - final resultSet = afterBlockHash == null - ? await _Reader._getSetCoinsForGroupId( - groupId, - db: _FiroCache.setCacheDB(network), - ) - : await _Reader._getSetCoinsForGroupIdAndBlockHash( - groupId, - afterBlockHash, - db: _FiroCache.setCacheDB(network), - ); + final resultSet = + afterBlockHash == null + ? await _Reader._getSetCoinsForGroupId( + groupId, + db: _FiroCache.setCacheDB(network), + ) + : await _Reader._getSetCoinsForGroupIdAndBlockHash( + groupId, + afterBlockHash, + db: _FiroCache.setCacheDB(network), + ); return resultSet .map( diff --git a/lib/wallets/isar/models/wallet_info.dart b/lib/wallets/isar/models/wallet_info.dart index 6df8dc456c..9d790a8308 100644 --- a/lib/wallets/isar/models/wallet_info.dart +++ b/lib/wallets/isar/models/wallet_info.dart @@ -521,4 +521,6 @@ abstract class WalletInfoKeys { "duressMarkedVisibleWalletKey"; static const String mwebEnabled = "mwebEnabledKey"; static const String mwebScanHeight = "mwebScanHeightKey"; + static const String firoSparkUsedTagsCacheResetVersion = + "firoSparkUsedTagsCacheResetVersionKey"; } diff --git a/lib/wallets/wallet/wallet.dart b/lib/wallets/wallet/wallet.dart index 554e04313b..55319d12e8 100644 --- a/lib/wallets/wallet/wallet.dart +++ b/lib/wallets/wallet/wallet.dart @@ -225,6 +225,13 @@ abstract class Wallet { await wallet.mainDB.isar.walletInfo.put(walletInfo); }); + if (wallet is SparkInterface) { + await walletInfo.updateOtherData( + newEntries: {WalletInfoKeys.firoSparkUsedTagsCacheResetVersion: 1}, + isar: mainDB.isar, + ); + } + return wallet; } diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart index 671c79770b..6a5b6c4fc3 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart @@ -148,6 +148,21 @@ mixin SparkInterface @override Future init() async { try { + final sparkUsedTagsResetVersion = + info.otherData[WalletInfoKeys.firoSparkUsedTagsCacheResetVersion] + as int? ?? + 0; + if (sparkUsedTagsResetVersion == 0) { + await info.updateOtherData( + newEntries: {WalletInfoKeys.firoSparkUsedTagsCacheResetVersion: 1}, + isar: mainDB.isar, + ); + await FiroCacheCoordinator.clearSharedCache( + cryptoCurrency.network, + clearOnlyUsedTagsCache: true, + ); + } + Address? address = await getCurrentReceivingSparkAddress(); if (address == null) { address = await generateNextSparkAddress(); From 7bf0f903808620ef511b0457c2e8127e9ff3b561 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 15 Aug 2025 10:50:11 -0600 Subject: [PATCH 024/178] various firo tweaks --- lib/db/sqlite/firo_cache_coordinator.dart | 8 ++++---- lib/db/sqlite/firo_cache_writer.dart | 19 ++++++------------ lib/electrumx_rpc/electrumx_client.dart | 2 +- .../spark_names/buy_spark_name_view.dart | 15 ++++++++++++-- .../confirm_spark_name_transaction_view.dart | 20 +++++++++++++++++++ .../buy_spark_name_option_widget.dart | 10 ++++++++++ .../sub_widgets/owned_spark_name_card.dart | 5 ++++- .../sub_widgets/spark_name_details.dart | 5 ++++- .../spark_interface.dart | 2 +- pubspec.lock | 4 ++-- scripts/app_config/templates/pubspec.template | 2 +- 11 files changed, 66 insertions(+), 26 deletions(-) diff --git a/lib/db/sqlite/firo_cache_coordinator.dart b/lib/db/sqlite/firo_cache_coordinator.dart index 71f01e92b2..5ecd7534b9 100644 --- a/lib/db/sqlite/firo_cache_coordinator.dart +++ b/lib/db/sqlite/firo_cache_coordinator.dart @@ -157,7 +157,7 @@ abstract class FiroCacheCoordinator { // =========================================================================== - static Future> getUsedCoinTags( + static Future> getUsedCoinTags( int startNumber, CryptoCurrencyNetwork network, ) async { @@ -165,7 +165,7 @@ abstract class FiroCacheCoordinator { startNumber, db: _FiroCache.usedTagsCacheDB(network), ); - return result.map((e) => e["tag"] as String).toSet(); + return result.map((e) => e["tag"] as String).toList(); } static Future getUsedCoinTagsCount(CryptoCurrencyNetwork network) async { @@ -198,7 +198,7 @@ abstract class FiroCacheCoordinator { .toList(); } - static Future> getUsedCoinTagsFor({ + static Future> getUsedCoinTagsFor({ required String txid, required CryptoCurrencyNetwork network, }) async { @@ -206,7 +206,7 @@ abstract class FiroCacheCoordinator { txid, db: _FiroCache.usedTagsCacheDB(network), ); - return result.map((e) => e["tag"] as String).toSet(); + return result.map((e) => e["tag"] as String).toList(); } static Future checkTagIsUsed( diff --git a/lib/db/sqlite/firo_cache_writer.dart b/lib/db/sqlite/firo_cache_writer.dart index 63192d9646..09383601ea 100644 --- a/lib/db/sqlite/firo_cache_writer.dart +++ b/lib/db/sqlite/firo_cache_writer.dart @@ -13,15 +13,12 @@ class FCResult { /// update the sqlite cache /// Expected json format: /// returns true if successful, otherwise some exception -FCResult _updateSparkUsedTagsWith( - Database db, - List> tags, -) { +FCResult _updateSparkUsedTagsWith(Database db, List> tags) { // hash the tags here since this function is called in a background isolate - final hashedTags = LibSpark.hashTags( - base64Tags: tags.map((e) => e[0] as String).toSet(), - ).toList(); - + final hashedTags = + LibSpark.hashTags( + base64Tags: tags.map((e) => e[0] as String).toList(), + ).toList(); if (hashedTags.isEmpty) { // nothing to add, return early return FCResult(success: true); @@ -70,11 +67,7 @@ FCResult _updateSparkAnonSetCoinsWith( FROM SparkSet WHERE blockHash = ? AND setHash = ? AND groupId = ?; """, - [ - meta.blockHash, - meta.setHash, - meta.coinGroupId, - ], + [meta.blockHash, meta.setHash, meta.coinGroupId], ); if (checkResult.isNotEmpty) { diff --git a/lib/electrumx_rpc/electrumx_client.dart b/lib/electrumx_rpc/electrumx_client.dart index befe70fc37..c0d497a9e2 100644 --- a/lib/electrumx_rpc/electrumx_client.dart +++ b/lib/electrumx_rpc/electrumx_client.dart @@ -1129,7 +1129,7 @@ class ElectrumXClient { "Duration=${DateTime.now().difference(start)}", ); - return tags; + return tags.reversed.toList(); } catch (e, s) { Logging.instance.e(e, error: e, stackTrace: s); rethrow; diff --git a/lib/pages/spark_names/buy_spark_name_view.dart b/lib/pages/spark_names/buy_spark_name_view.dart index 036a551d38..fa2cae828c 100644 --- a/lib/pages/spark_names/buy_spark_name_view.dart +++ b/lib/pages/spark_names/buy_spark_name_view.dart @@ -69,11 +69,22 @@ class _BuySparkNameViewState extends ConsumerState { try { final wallet = ref.read(pWallets).getWallet(widget.walletId) as SparkInterface; - final myAddress = await wallet.getCurrentReceivingSparkAddress(); + Address? myAddress = await wallet.getCurrentReceivingSparkAddress(); if (myAddress == null) { throw Exception("No spark address found"); } - addressController.text = myAddress.value; + + final db = ref.read(pDrift(widget.walletId)); + final myNames = await db.select(db.sparkNames).get(); + while (myNames.where((e) => e.address == myAddress!.value).isNotEmpty) { + Logging.instance.t( + "Found address that already has a spark name. Generating next address...", + ); + myAddress = await wallet.generateNextSparkAddress(); + await ref.read(mainDBProvider).updateOrPutAddresses([myAddress]); + } + + addressController.text = myAddress!.value; } catch (e, s) { Logging.instance.e("_fillCurrentReceiving", error: e, stackTrace: s); } finally { diff --git a/lib/pages/spark_names/confirm_spark_name_transaction_view.dart b/lib/pages/spark_names/confirm_spark_name_transaction_view.dart index c98409dfd9..3282b1f1fb 100644 --- a/lib/pages/spark_names/confirm_spark_name_transaction_view.dart +++ b/lib/pages/spark_names/confirm_spark_name_transaction_view.dart @@ -16,6 +16,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; +import '../../models/isar/models/blockchain_data/address.dart'; import '../../models/isar/models/transaction_note.dart'; import '../../notifications/show_flush_bar.dart'; import '../../pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart'; @@ -128,6 +129,25 @@ class _ConfirmSparkNameTransactionViewState ); } + final address = txData.sparkNameInfo?.sparkAddress; + final currentReceiving = await wallet.getCurrentReceivingSparkAddress(); + if (currentReceiving?.value == address?.value) { + final address = await wallet.generateNextSparkAddress(); + await ref.read(mainDBProvider).isar.writeTxn(() async { + await ref.read(mainDBProvider).isar.addresses.put(address); + }); + } + + final db = ref.read(pDrift(walletId)); + await db.upsertSparkNames([ + ( + name: txData.sparkNameInfo!.name, + address: txData.sparkNameInfo!.sparkAddress.value, + validUntil: -99999, + additionalInfo: txData.sparkNameInfo!.additionalInfo, + ), + ]); + unawaited(wallet.refresh()); if (mounted) { diff --git a/lib/pages/spark_names/sub_widgets/buy_spark_name_option_widget.dart b/lib/pages/spark_names/sub_widgets/buy_spark_name_option_widget.dart index 18b6bb6f4a..cc7fcfa0e6 100644 --- a/lib/pages/spark_names/sub_widgets/buy_spark_name_option_widget.dart +++ b/lib/pages/spark_names/sub_widgets/buy_spark_name_option_widget.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:drift/drift.dart' as drift; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart'; @@ -55,6 +56,15 @@ class _BuySparkNameWidgetState extends ConsumerState { )) { rethrow; } + final db = ref.read(pDrift(widget.walletId)); + final results = + await (db.select(db.sparkNames) + ..where((e) => e.name.lower().equals(name))).get(); + + if (results.isNotEmpty) { + return false; + } + // name not found return true; } diff --git a/lib/pages/spark_names/sub_widgets/owned_spark_name_card.dart b/lib/pages/spark_names/sub_widgets/owned_spark_name_card.dart index fc813efb9f..3971fdd4e2 100644 --- a/lib/pages/spark_names/sub_widgets/owned_spark_name_card.dart +++ b/lib/pages/spark_names/sub_widgets/owned_spark_name_card.dart @@ -32,7 +32,10 @@ class _OwnedSparkNameCardState extends ConsumerState { final remaining = widget.name.validUntil - currentChainHeight; - if (remaining <= 0) { + if (widget.name.validUntil == -99999) { + color = theme.accentColorYellow; + message = "Pending"; + } else if (remaining <= 0) { color = theme.accentColorRed; message = "Expired"; } else { diff --git a/lib/pages/spark_names/sub_widgets/spark_name_details.dart b/lib/pages/spark_names/sub_widgets/spark_name_details.dart index 3acaad8f50..97983735ab 100644 --- a/lib/pages/spark_names/sub_widgets/spark_name_details.dart +++ b/lib/pages/spark_names/sub_widgets/spark_name_details.dart @@ -53,7 +53,10 @@ class _SparkNameDetailsViewState extends ConsumerState { final remaining = name.validUntil - currentChainHeight; - if (remaining <= 0) { + if (widget.name.validUntil == -99999) { + color = theme.accentColorYellow; + message = "Pending"; + } else if (remaining <= 0) { color = theme.accentColorRed; message = "Expired"; } else { diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart index 6a5b6c4fc3..c3aff94fd8 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart @@ -1118,7 +1118,7 @@ mixin SparkInterface .isUsedEqualTo(false) .findAll(); - Set? spentCoinTags; + List? spentCoinTags; // only fetch tags from db if we need them to compare against any items // in coinsToCheck if (coinsToCheck.isNotEmpty) { diff --git a/pubspec.lock b/pubspec.lock index ab6a397109..4ef194c2bb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -944,8 +944,8 @@ packages: dependency: "direct main" description: path: "." - ref: f5fd2238fca4ffe82f7e14646a613a04d2c243d6 - resolved-ref: f5fd2238fca4ffe82f7e14646a613a04d2c243d6 + ref: "5f0dde009c969bf6425da35382305b2c0b65bc46" + resolved-ref: "5f0dde009c969bf6425da35382305b2c0b65bc46" url: "https://github.com/cypherstack/flutter_libsparkmobile.git" source: git version: "0.1.0" diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index ef0f72984e..27bdc19901 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -35,7 +35,7 @@ dependencies: flutter_libsparkmobile: git: url: https://github.com/cypherstack/flutter_libsparkmobile.git - ref: f5fd2238fca4ffe82f7e14646a613a04d2c243d6 + ref: 5f0dde009c969bf6425da35382305b2c0b65bc46 # cs_monero compat (unpublished) compat: From c097c4cabfddea0ba6888297831f44370ac70d83 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 15 Aug 2025 18:10:52 -0500 Subject: [PATCH 025/178] feat(arti): bump arti 1.2.4->1.4.6 --- scripts/app_config/templates/pubspec.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index ef0f72984e..7c01e11903 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -65,7 +65,7 @@ dependencies: tor_ffi_plugin: git: url: https://github.com/cypherstack/tor.git - ref: 752f054b65c500adb9cad578bf183a978e012502 + ref: 16c9e709e984ec89e8715ce378b038c93ad7add3 fusiondart: git: @@ -181,7 +181,7 @@ dependencies: electrum_adapter: git: url: https://github.com/cypherstack/electrum_adapter.git - ref: f0b1300140d45c13e7722f8f8d20308efeba8449 + ref: 794ab2d7b88b34d64a89518f9b9f41dcc235aca1 stream_channel: ^2.1.0 solana: git: # TODO [prio=low]: Revert to official package once Tor support is merged upstream. From 8a03ff1d1d083ed94e339ce9ad02e39bfffb711f Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 18 Aug 2025 11:37:58 -0500 Subject: [PATCH 026/178] chore: update fusiondart's socks_socket dependency from git to versioned --- scripts/app_config/templates/pubspec.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index 9f74ec807d..396c7e790b 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -70,7 +70,7 @@ dependencies: fusiondart: git: url: https://github.com/cypherstack/fusiondart.git - ref: afaad488f5215a9c2c211e5e2f8460237eef60f1 + ref: ad8587ef3f4d2ffac86e352a91040f4a3e0bd07c # Utility plugins http: ^0.13.0 From 5444321892ddc4afd007193eb01049250591fa41 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 18 Aug 2025 11:45:35 -0500 Subject: [PATCH 027/178] chore: update fusiondart dep to point to fusiondart#main --- scripts/app_config/templates/pubspec.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index 396c7e790b..84826bc289 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -70,7 +70,7 @@ dependencies: fusiondart: git: url: https://github.com/cypherstack/fusiondart.git - ref: ad8587ef3f4d2ffac86e352a91040f4a3e0bd07c + ref: 540d0bc7dc27a97d45d63f412f26818a7f3b8b51 # Utility plugins http: ^0.13.0 From 4f1a3fea2e929ebae75ffb9606fe2f9518705e1c Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 18 Aug 2025 11:53:10 -0500 Subject: [PATCH 028/178] fix: use socks_socket's socks_socket in monero connection test --- lib/utilities/test_monero_node_connection.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utilities/test_monero_node_connection.dart b/lib/utilities/test_monero_node_connection.dart index 7eba0ee309..6a4fbfa455 100644 --- a/lib/utilities/test_monero_node_connection.dart +++ b/lib/utilities/test_monero_node_connection.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:http/io_client.dart'; import 'package:monero_rpc/monero_rpc.dart'; import 'package:socks5_proxy/socks.dart'; -import 'package:tor_ffi_plugin/socks_socket.dart'; +import 'package:socks_socket/socks_socket.dart'; import '../widgets/desktop/primary_button.dart'; import '../widgets/desktop/secondary_button.dart'; From e84f705d474dd58ba09b959c0fa6ee406d007bd0 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 18 Aug 2025 15:33:52 -0500 Subject: [PATCH 029/178] docs: update README.md to list 13 new coins and remove roadmap.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit would prefer to put building.md here ( ͡° ͜ʖ ͡°) force pushed to replace "24" with "23" bc altho btc frost is implemented thru a plugin and pretty different, it's not its own cryptocurrency. idk --- README.md | 17 ++++++++++++++--- docs/roadmap.md | 5 ----- 2 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 docs/roadmap.md diff --git a/README.md b/README.md index 4c18c3181a..6ad2e21094 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,31 @@ Stack Wallet is a fully open source cryptocurrency wallet. With an easy to use u ## Feature List Highlights include: -- 11 Different cryptocurrencies: +- 23 Different cryptocurrencies: - [Bitcoin](https://bitcoin.org/en/) + - Bitcoin Frost - [Bitcoin Cash](https://bch.info/en/) + - [Banano](https://banano.cc/) + - [Cardano](https://cardano.org/) + - [Dash](https://www.dash.org/) - [Dogecoin](https://dogecoin.com/) - [Epic Cash](https://linktr.ee/epiccash) - [Ethereum](https://ethereum.org/en/) + - [Ecash](https://e.cash/) + - [Fact0rn](https://www.fact0rn.io/) - [Firo](https://firo.org/) - [Litecoin](https://litecoin.org/) - [Monero](https://www.getmonero.org/) + - [Nano](https://nano.org/) - [Namecoin](https://www.namecoin.org/) - [Particl](https://particl.io/) + - [Peercoin](https://www.peercoin.net/) + - [Salvium](https://salvium.io/) + - [Solana](https://solana.com/) + - [Stellar](https://stellar.org/) + - [Tezos](https://tezos.com/) - [Wownero](https://wownero.org/) + - [Xelis](https://xelis.org/) - All private keys and seeds stay on device and are never shared. - Easy backup and restore feature to save all the information that's important to you. - Trading cryptocurrencies through our partners. @@ -31,8 +44,6 @@ Highlights include: - Open source software. - No ads. -> You can find the roadmap [here](docs/roadmap.md). - ## Building You can look at the [build instructions](docs/building.md) for more details. diff --git a/docs/roadmap.md b/docs/roadmap.md deleted file mode 100644 index 384f6f3604..0000000000 --- a/docs/roadmap.md +++ /dev/null @@ -1,5 +0,0 @@ -# Roadmap - -This document describes the roadmap for the project. It is a living document that will be updated as the project evolves. - -- [ ] Fill in the roadmap \ No newline at end of file From d8eb90d49967b682aefa52824cd6765b5c52fc40 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 3 Sep 2025 11:42:09 -0500 Subject: [PATCH 030/178] fix: revert mwc db migration code see https://github.com/cypherstack/stack_wallet/pull/1016/files/041ce04254c77779a84cd380045dc7ee29fdf09e#r2021465080 --- lib/db/db_version_migration.dart | 75 ++------------------------------ 1 file changed, 3 insertions(+), 72 deletions(-) diff --git a/lib/db/db_version_migration.dart b/lib/db/db_version_migration.dart index 81aec9b255..fcf632669c 100644 --- a/lib/db/db_version_migration.dart +++ b/lib/db/db_version_migration.dart @@ -532,71 +532,6 @@ class DbVersionMigrator with WalletDB { await MainDB.instance.addNewTransactionData(transactionsData, walletId); } - // we need to manually migrate mimblewimblecoin transactions as they are not - // stored on the mimblewimblecoin blockchain - final mimblewimblecoin = Mimblewimblecoin(CryptoCurrencyNetwork.main); - if (info.coinIdentifier == mimblewimblecoin.identifier) { - final txnData = walletBox.get("latest_tx_model") as TransactionData?; - - // we ever only used index 0 in the past - const rcvIndex = 0; - - final List> - transactionsData = []; - if (txnData != null) { - final txns = txnData.getAllTransactions(); - - for (final tx in txns.values) { - final bool isIncoming = tx.txType == "Received"; - - final iTx = isar_models.Transaction( - walletId: walletId, - txid: tx.txid, - timestamp: tx.timestamp, - type: isIncoming - ? isar_models.TransactionType.incoming - : isar_models.TransactionType.outgoing, - subType: isar_models.TransactionSubType.none, - amount: tx.amount, - amountString: Amount( - rawValue: BigInt.from(tx.amount), - fractionDigits: mimblewimblecoin.fractionDigits, - ).toJsonString(), - fee: tx.fees, - height: tx.height, - isCancelled: tx.isCancelled, - isLelantus: false, - slateId: tx.slateId, - otherData: tx.otherData, - nonce: null, - inputs: [], - outputs: [], - numberOfMessages: tx.numberOfMessages, - ); - - if (tx.address.isEmpty) { - transactionsData.add(Tuple2(iTx, null)); - } else { - final address = isar_models.Address( - walletId: walletId, - value: tx.address, - publicKey: [], - derivationIndex: isIncoming ? rcvIndex : -1, - derivationPath: null, - type: isIncoming - ? isar_models.AddressType.mimbleWimble - : isar_models.AddressType.unknown, - subType: isIncoming - ? isar_models.AddressSubType.receiving - : isar_models.AddressSubType.unknown, - ); - transactionsData.add(Tuple2(iTx, address)); - } - } - } - await MainDB.instance.addNewTransactionData(transactionsData, walletId); - } - // delete data from hive await walletBox.delete(receiveAddressesPrefix); await walletBox.delete("${receiveAddressesPrefix}P2PKH"); @@ -618,13 +553,9 @@ class DbVersionMigrator with WalletDB { ); } - // doing this for epiccash/mimblewimblecoin will delete transaction history as it is not - // stored on the epiccash/mimblewimblecoin blockchain - final excludedIdentifiers = [ - epic.identifier, - mimblewimblecoin.identifier - ]; - if ((!excludedIdentifiers.contains(info.coinIdentifier))) { + // doing this for epic cash will delete transaction history as it is not + // stored on the epic cash blockchain + if (info.coinIdentifier != epic.identifier) { // set flag to initiate full rescan on opening wallet await DB.instance.put( boxName: DB.boxNameDBInfo, From 62f111ea85fd48ecca7f16e0f6b4cdb7a6e7457c Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 3 Sep 2025 11:43:45 -0500 Subject: [PATCH 031/178] fix: revert mwc db migration code see https://github.com/cypherstack/stack_wallet/pull/1016/files/041ce04254c77779a84cd380045dc7ee29fdf09e#r2021465367 --- lib/db/migrate_wallets_to_isar.dart | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/db/migrate_wallets_to_isar.dart b/lib/db/migrate_wallets_to_isar.dart index d0f75a2e37..cd54a4063f 100644 --- a/lib/db/migrate_wallets_to_isar.dart +++ b/lib/db/migrate_wallets_to_isar.dart @@ -11,7 +11,6 @@ import '../wallets/isar/models/token_wallet_info.dart'; import '../wallets/isar/models/wallet_info.dart'; import '../wallets/isar/models/wallet_info_meta.dart'; import '../wallets/wallet/supporting/epiccash_wallet_info_extension.dart'; -import '../wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart'; import 'hive/db.dart'; import 'isar/main_db.dart'; @@ -147,21 +146,6 @@ Future migrateWalletsToIsar({ otherData[WalletInfoKeys.epiccashData] = jsonEncode( epicWalletInfo.toMap(), ); - } else if (old.coinIdentifier == - Mimblewimblecoin(CryptoCurrencyNetwork.main)) { - final mimblewimblecoinWalletInfo = - ExtraMimblewimblecoinWalletInfo.fromMap({ - "receivingIndex": walletBox.get("receivingIndex") as int? ?? 0, - "changeIndex": walletBox.get("changeIndex") as int? ?? 0, - "slatesToAddresses": walletBox.get("slate_to_address") as Map? ?? {}, - "slatesToCommits": walletBox.get("slatesToCommits") as Map? ?? {}, - "lastScannedBlock": walletBox.get("lastScannedBlock") as int? ?? 0, - "restoreHeight": walletBox.get("restoreHeight") as int? ?? 0, - "creationHeight": walletBox.get("creationHeight") as int? ?? 0, - }); - otherData[WalletInfoKeys.mimblewimblecoinData] = jsonEncode( - mimblewimblecoinWalletInfo.toMap(), - ); } else if (old.coinIdentifier == Firo(CryptoCurrencyNetwork.main).identifier || old.coinIdentifier == Firo(CryptoCurrencyNetwork.test).identifier) { From e6035e1025b60dc7d69169db0f2820b759c7038b Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 3 Sep 2025 11:44:51 -0500 Subject: [PATCH 032/178] fix: ignore generating and updating the isar schema for this value see https://github.com/cypherstack/stack_wallet/pull/1016/files/041ce04254c77779a84cd380045dc7ee29fdf09e#r2021529886 --- lib/models/isar/models/blockchain_data/v2/transaction_v2.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart index 01f1e440bc..47b18ad725 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart @@ -95,8 +95,11 @@ class TransactionV2 { bool get isEpiccashTransaction => _getFromOtherData(key: TxV2OdKeys.isEpiccashTransaction) == true; + + @ignore bool get isMimblewimblecoinTransaction => _getFromOtherData(key: TxV2OdKeys.isMimblewimblecoinTransaction) == true; + int? get numberOfMessages => _getFromOtherData(key: TxV2OdKeys.numberOfMessages) as int?; String? get slateId => _getFromOtherData(key: TxV2OdKeys.slateId) as String?; From ccfdb665298c58503c2cca40d561ec98ae3fa750 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 3 Sep 2025 12:01:08 -0500 Subject: [PATCH 033/178] fix: revert mwc tx migration scaffolding see https://github.com/cypherstack/stack_wallet/pull/1016/files/041ce04254c77779a84cd380045dc7ee29fdf09e#r2021531199 --- .../blockchain_data/v2/transaction_v2.g.dart | 142 +++++------------- 1 file changed, 41 insertions(+), 101 deletions(-) diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart index 3bb48c3508..68d8a18c57 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart @@ -53,71 +53,66 @@ const TransactionV2Schema = CollectionSchema( name: r'isEpiccashTransaction', type: IsarType.bool, ), - r'isMimblewimblecoinTransaction': PropertySchema( - id: 7, - name: r'isMimblewimblecoinTransaction', - type: IsarType.bool, - ), r'nonce': PropertySchema( - id: 8, + id: 7, name: r'nonce', type: IsarType.long, ), r'numberOfMessages': PropertySchema( - id: 9, + id: 8, name: r'numberOfMessages', type: IsarType.long, ), r'onChainNote': PropertySchema( - id: 10, + id: 9, name: r'onChainNote', type: IsarType.string, ), r'otherData': PropertySchema( - id: 11, + id: 10, name: r'otherData', type: IsarType.string, ), r'outputs': PropertySchema( - id: 12, + id: 11, name: r'outputs', type: IsarType.objectList, target: r'OutputV2', ), r'slateId': PropertySchema( - id: 13, + id: 12, name: r'slateId', type: IsarType.string, ), r'subType': PropertySchema( - id: 14, + id: 13, name: r'subType', type: IsarType.byte, enumMap: _TransactionV2subTypeEnumValueMap, ), r'timestamp': PropertySchema( - id: 15, + id: 14, name: r'timestamp', type: IsarType.long, ), r'txid': PropertySchema( - id: 16, + id: 15, name: r'txid', type: IsarType.string, ), r'type': PropertySchema( - id: 17, + id: 16, name: r'type', type: IsarType.byte, enumMap: _TransactionV2typeEnumValueMap, ), r'version': PropertySchema( - id: 18, + id: 17, name: r'version', type: IsarType.long, ), r'walletId': PropertySchema( - id: 19, + id: 18, name: r'walletId', type: IsarType.string, ) @@ -261,24 +256,23 @@ void _transactionV2Serialize( ); writer.writeBool(offsets[5], object.isCancelled); writer.writeBool(offsets[6], object.isEpiccashTransaction); - writer.writeBool(offsets[7], object.isMimblewimblecoinTransaction); - writer.writeLong(offsets[8], object.nonce); - writer.writeLong(offsets[9], object.numberOfMessages); - writer.writeString(offsets[10], object.onChainNote); - writer.writeString(offsets[11], object.otherData); + writer.writeLong(offsets[7], object.nonce); + writer.writeLong(offsets[8], object.numberOfMessages); + writer.writeString(offsets[9], object.onChainNote); + writer.writeString(offsets[10], object.otherData); writer.writeObjectList( - offsets[12], + offsets[11], allOffsets, OutputV2Schema.serialize, object.outputs, ); - writer.writeString(offsets[13], object.slateId); - writer.writeByte(offsets[14], object.subType.index); - writer.writeLong(offsets[15], object.timestamp); - writer.writeString(offsets[16], object.txid); - writer.writeByte(offsets[17], object.type.index); - writer.writeLong(offsets[18], object.version); - writer.writeString(offsets[19], object.walletId); + writer.writeString(offsets[12], object.slateId); + writer.writeByte(offsets[13], object.subType.index); + writer.writeLong(offsets[14], object.timestamp); + writer.writeString(offsets[15], object.txid); + writer.writeByte(offsets[16], object.type.index); + writer.writeLong(offsets[17], object.version); + writer.writeString(offsets[18], object.walletId); } TransactionV2 _transactionV2Deserialize( @@ -298,23 +292,23 @@ TransactionV2 _transactionV2Deserialize( InputV2(), ) ?? [], - otherData: reader.readStringOrNull(offsets[11]), + otherData: reader.readStringOrNull(offsets[10]), outputs: reader.readObjectList( - offsets[12], + offsets[11], OutputV2Schema.deserialize, allOffsets, OutputV2(), ) ?? [], subType: - _TransactionV2subTypeValueEnumMap[reader.readByteOrNull(offsets[14])] ?? + _TransactionV2subTypeValueEnumMap[reader.readByteOrNull(offsets[13])] ?? TransactionSubType.none, - timestamp: reader.readLong(offsets[15]), - txid: reader.readString(offsets[16]), - type: _TransactionV2typeValueEnumMap[reader.readByteOrNull(offsets[17])] ?? + timestamp: reader.readLong(offsets[14]), + txid: reader.readString(offsets[15]), + type: _TransactionV2typeValueEnumMap[reader.readByteOrNull(offsets[16])] ?? TransactionType.outgoing, - version: reader.readLong(offsets[18]), - walletId: reader.readString(offsets[19]), + version: reader.readLong(offsets[17]), + walletId: reader.readString(offsets[18]), ); object.id = id; return object; @@ -348,16 +342,14 @@ P _transactionV2DeserializeProp

( case 6: return (reader.readBool(offset)) as P; case 7: - return (reader.readBool(offset)) as P; + return (reader.readLongOrNull(offset)) as P; case 8: return (reader.readLongOrNull(offset)) as P; case 9: - return (reader.readLongOrNull(offset)) as P; + 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.readObjectList( offset, OutputV2Schema.deserialize, @@ -365,22 +357,22 @@ P _transactionV2DeserializeProp

( OutputV2(), ) ?? []) as P; - case 13: + case 12: return (reader.readStringOrNull(offset)) as P; - case 14: + case 13: return (_TransactionV2subTypeValueEnumMap[ reader.readByteOrNull(offset)] ?? TransactionSubType.none) as P; - case 15: + case 14: return (reader.readLong(offset)) as P; - case 16: + case 15: return (reader.readString(offset)) as P; - case 17: + case 16: return (_TransactionV2typeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionType.outgoing) as P; - case 18: + case 17: return (reader.readLong(offset)) as P; - case 19: + case 18: return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); @@ -1521,16 +1513,6 @@ extension TransactionV2QueryFilter }); } - QueryBuilder - isMimblewimblecoinTransactionEqualTo(bool value) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isMimblewimblecoinTransaction', - value: value, - )); - }); - } - QueryBuilder nonceIsNull() { return QueryBuilder.apply(this, (query) { @@ -2825,20 +2807,6 @@ extension TransactionV2QuerySortBy }); } - QueryBuilder - sortByIsMimblewimblecoinTransaction() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.asc); - }); - } - - QueryBuilder - sortByIsMimblewimblecoinTransactionDesc() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.desc); - }); - } - QueryBuilder sortByNonce() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'nonce', Sort.asc); @@ -3070,20 +3038,6 @@ extension TransactionV2QuerySortThenBy }); } - QueryBuilder - thenByIsMimblewimblecoinTransaction() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.asc); - }); - } - - QueryBuilder - thenByIsMimblewimblecoinTransactionDesc() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'isMimblewimblecoinTransaction', Sort.desc); - }); - } - QueryBuilder thenByNonce() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'nonce', Sort.asc); @@ -3267,13 +3221,6 @@ extension TransactionV2QueryWhereDistinct }); } - QueryBuilder - distinctByIsMimblewimblecoinTransaction() { - return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'isMimblewimblecoinTransaction'); - }); - } - QueryBuilder distinctByNonce() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'nonce'); @@ -3400,13 +3347,6 @@ extension TransactionV2QueryProperty }); } - QueryBuilder - isMimblewimblecoinTransactionProperty() { - return QueryBuilder.apply(this, (query) { - return query.addPropertyName(r'isMimblewimblecoinTransaction'); - }); - } - QueryBuilder nonceProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'nonce'); From 3442aab0dcfa0d16fe9dec57d0035b1f21522b54 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 3 Sep 2025 12:03:27 -0500 Subject: [PATCH 034/178] fix: revert legacy theme mwc changes see https://github.com/cypherstack/stack_wallet/pull/1016/files/041ce04254c77779a84cd380045dc7ee29fdf09e#r2021493501 --- lib/models/isar/stack_theme.dart | 15 +- lib/models/isar/stack_theme.g.dart | 603 ++++------------------------- 2 files changed, 83 insertions(+), 535 deletions(-) diff --git a/lib/models/isar/stack_theme.dart b/lib/models/isar/stack_theme.dart index 4f831732f0..efa2f7d05e 100644 --- a/lib/models/isar/stack_theme.dart +++ b/lib/models/isar/stack_theme.dart @@ -13,6 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:isar/isar.dart'; + import '../../app_config.dart'; import '../../utilities/extensions/impl/box_shadow.dart'; import '../../utilities/extensions/impl/gradient.dart'; @@ -1884,10 +1885,7 @@ class StackTheme { (map[mainNetId] as String).toBigIntFromHex.toInt(), ); } else { - Logging.instance.log( - "Color not found in theme for $mainNetId", - level: LogLevel.Error, - ); + Logging.instance.w("Color not found in theme for $mainNetId"); } } @@ -1939,7 +1937,6 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincash; late final String dogecoin; late final String epicCash; - late final String mimblewimblecoin; late final String ethereum; late final String firo; late final String monero; @@ -1950,7 +1947,6 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincashImage; late final String dogecoinImage; late final String epicCashImage; - late final String mimblewimblecoinImage; late final String ethereumImage; late final String firoImage; late final String litecoinImage; @@ -1962,7 +1958,6 @@ class ThemeAssets implements IThemeAssets { late final String bitcoincashImageSecondary; late final String dogecoinImageSecondary; late final String epicCashImageSecondary; - late final String mimblewimblecoinImageSecondary; late final String ethereumImageSecondary; late final String firoImageSecondary; late final String litecoinImageSecondary; @@ -2009,8 +2004,6 @@ class ThemeAssets implements IThemeAssets { ..bitcoincash = "$themeId/assets/${json["bitcoincash"] as String}" ..dogecoin = "$themeId/assets/${json["dogecoin"] as String}" ..epicCash = "$themeId/assets/${json["epicCash"] as String}" - ..mimblewimblecoin = - "$themeId/assets/${json["mimblewimblecoin"] as String}" ..ethereum = "$themeId/assets/${json["ethereum"] as String}" ..firo = "$themeId/assets/${json["firo"] as String}" ..monero = "$themeId/assets/${json["monero"] as String}" @@ -2022,8 +2015,6 @@ class ThemeAssets implements IThemeAssets { "$themeId/assets/${json["bitcoincash_image"] as String}" ..dogecoinImage = "$themeId/assets/${json["dogecoin_image"] as String}" ..epicCashImage = "$themeId/assets/${json["epicCash_image"] as String}" - ..mimblewimblecoinImage = - "$themeId/assets/${json["mimblewimblecoin_image"] as String}" ..ethereumImage = "$themeId/assets/${json["ethereum_image"] as String}" ..firoImage = "$themeId/assets/${json["firo_image"] as String}" ..litecoinImage = "$themeId/assets/${json["litecoin_image"] as String}" @@ -2039,8 +2030,6 @@ class ThemeAssets implements IThemeAssets { "$themeId/assets/${json["dogecoin_image_secondary"] as String}" ..epicCashImageSecondary = "$themeId/assets/${json["epicCash_image_secondary"] as String}" - ..mimblewimblecoinImageSecondary = - "$themeId/assets/${json["mimblewimblecoin_image_secondary"] as String}" ..ethereumImageSecondary = "$themeId/assets/${json["ethereum_image_secondary"] as String}" ..firoImageSecondary = diff --git a/lib/models/isar/stack_theme.g.dart b/lib/models/isar/stack_theme.g.dart index 0117ef7b9b..c77d979f54 100644 --- a/lib/models/isar/stack_theme.g.dart +++ b/lib/models/isar/stack_theme.g.dart @@ -18148,153 +18148,138 @@ const ThemeAssetsSchema = Schema( name: r'loadingGif', type: IsarType.string, ), - r'mimblewimblecoin': PropertySchema( - id: 26, - name: r'mimblewimblecoin', - type: IsarType.string, - ), - r'mimblewimblecoinImage': PropertySchema( - id: 27, - name: r'mimblewimblecoinImage', - type: IsarType.string, - ), - r'mimblewimblecoinImageSecondary': PropertySchema( - id: 28, - name: r'mimblewimblecoinImageSecondary', - type: IsarType.string, - ), r'monero': PropertySchema( - id: 29, + id: 26, name: r'monero', type: IsarType.string, ), r'moneroImage': PropertySchema( - id: 30, + id: 27, name: r'moneroImage', type: IsarType.string, ), r'moneroImageSecondary': PropertySchema( - id: 31, + id: 28, name: r'moneroImageSecondary', type: IsarType.string, ), r'namecoin': PropertySchema( - id: 32, + id: 29, name: r'namecoin', type: IsarType.string, ), r'namecoinImage': PropertySchema( - id: 33, + id: 30, name: r'namecoinImage', type: IsarType.string, ), r'namecoinImageSecondary': PropertySchema( - id: 34, + id: 31, name: r'namecoinImageSecondary', type: IsarType.string, ), r'particl': PropertySchema( - id: 35, + id: 32, name: r'particl', type: IsarType.string, ), r'particlImage': PropertySchema( - id: 36, + id: 33, name: r'particlImage', type: IsarType.string, ), r'particlImageSecondary': PropertySchema( - id: 37, + id: 34, name: r'particlImageSecondary', type: IsarType.string, ), r'personaEasy': PropertySchema( - id: 38, + id: 35, name: r'personaEasy', type: IsarType.string, ), r'personaIncognito': PropertySchema( - id: 39, + id: 36, name: r'personaIncognito', type: IsarType.string, ), r'receive': PropertySchema( - id: 40, + id: 37, name: r'receive', type: IsarType.string, ), r'receiveCancelled': PropertySchema( - id: 41, + id: 38, name: r'receiveCancelled', type: IsarType.string, ), r'receivePending': PropertySchema( - id: 42, + id: 39, name: r'receivePending', type: IsarType.string, ), r'send': PropertySchema( - id: 43, + id: 40, name: r'send', type: IsarType.string, ), r'sendCancelled': PropertySchema( - id: 44, + id: 41, name: r'sendCancelled', type: IsarType.string, ), r'sendPending': PropertySchema( - id: 45, + id: 42, name: r'sendPending', type: IsarType.string, ), r'stack': PropertySchema( - id: 46, + id: 43, name: r'stack', type: IsarType.string, ), r'stackIcon': PropertySchema( - id: 47, + id: 44, name: r'stackIcon', type: IsarType.string, ), r'themePreview': PropertySchema( - id: 48, + id: 45, name: r'themePreview', type: IsarType.string, ), r'themeSelector': PropertySchema( - id: 49, + id: 46, name: r'themeSelector', type: IsarType.string, ), r'txExchange': PropertySchema( - id: 50, + id: 47, name: r'txExchange', type: IsarType.string, ), r'txExchangeFailed': PropertySchema( - id: 51, + id: 48, name: r'txExchangeFailed', type: IsarType.string, ), r'txExchangePending': PropertySchema( - id: 52, + id: 49, name: r'txExchangePending', type: IsarType.string, ), r'wownero': PropertySchema( - id: 53, + id: 50, name: r'wownero', type: IsarType.string, ), r'wowneroImage': PropertySchema( - id: 54, + id: 51, name: r'wowneroImage', type: IsarType.string, ), r'wowneroImageSecondary': PropertySchema( - id: 55, + id: 52, name: r'wowneroImageSecondary', type: IsarType.string, ) @@ -18347,9 +18332,6 @@ int _themeAssetsEstimateSize( bytesCount += 3 + value.length * 3; } } - bytesCount += 3 + object.mimblewimblecoin.length * 3; - bytesCount += 3 + object.mimblewimblecoinImage.length * 3; - bytesCount += 3 + object.mimblewimblecoinImageSecondary.length * 3; bytesCount += 3 + object.monero.length * 3; bytesCount += 3 + object.moneroImage.length * 3; bytesCount += 3 + object.moneroImageSecondary.length * 3; @@ -18412,36 +18394,33 @@ void _themeAssetsSerialize( writer.writeString(offsets[23], object.litecoinImage); writer.writeString(offsets[24], object.litecoinImageSecondary); writer.writeString(offsets[25], object.loadingGif); - writer.writeString(offsets[26], object.mimblewimblecoin); - writer.writeString(offsets[27], object.mimblewimblecoinImage); - writer.writeString(offsets[28], object.mimblewimblecoinImageSecondary); - writer.writeString(offsets[29], object.monero); - writer.writeString(offsets[30], object.moneroImage); - writer.writeString(offsets[31], object.moneroImageSecondary); - writer.writeString(offsets[32], object.namecoin); - writer.writeString(offsets[33], object.namecoinImage); - writer.writeString(offsets[34], object.namecoinImageSecondary); - writer.writeString(offsets[35], object.particl); - writer.writeString(offsets[36], object.particlImage); - writer.writeString(offsets[37], object.particlImageSecondary); - writer.writeString(offsets[38], object.personaEasy); - writer.writeString(offsets[39], object.personaIncognito); - writer.writeString(offsets[40], object.receive); - writer.writeString(offsets[41], object.receiveCancelled); - writer.writeString(offsets[42], object.receivePending); - writer.writeString(offsets[43], object.send); - writer.writeString(offsets[44], object.sendCancelled); - writer.writeString(offsets[45], object.sendPending); - writer.writeString(offsets[46], object.stack); - writer.writeString(offsets[47], object.stackIcon); - writer.writeString(offsets[48], object.themePreview); - writer.writeString(offsets[49], object.themeSelector); - writer.writeString(offsets[50], object.txExchange); - writer.writeString(offsets[51], object.txExchangeFailed); - writer.writeString(offsets[52], object.txExchangePending); - writer.writeString(offsets[53], object.wownero); - writer.writeString(offsets[54], object.wowneroImage); - writer.writeString(offsets[55], object.wowneroImageSecondary); + writer.writeString(offsets[26], object.monero); + writer.writeString(offsets[27], object.moneroImage); + writer.writeString(offsets[28], object.moneroImageSecondary); + writer.writeString(offsets[29], object.namecoin); + writer.writeString(offsets[30], object.namecoinImage); + writer.writeString(offsets[31], object.namecoinImageSecondary); + writer.writeString(offsets[32], object.particl); + writer.writeString(offsets[33], object.particlImage); + writer.writeString(offsets[34], object.particlImageSecondary); + writer.writeString(offsets[35], object.personaEasy); + writer.writeString(offsets[36], object.personaIncognito); + writer.writeString(offsets[37], object.receive); + writer.writeString(offsets[38], object.receiveCancelled); + writer.writeString(offsets[39], object.receivePending); + writer.writeString(offsets[40], object.send); + writer.writeString(offsets[41], object.sendCancelled); + writer.writeString(offsets[42], object.sendPending); + writer.writeString(offsets[43], object.stack); + writer.writeString(offsets[44], object.stackIcon); + writer.writeString(offsets[45], object.themePreview); + writer.writeString(offsets[46], object.themeSelector); + writer.writeString(offsets[47], object.txExchange); + writer.writeString(offsets[48], object.txExchangeFailed); + writer.writeString(offsets[49], object.txExchangePending); + writer.writeString(offsets[50], object.wownero); + writer.writeString(offsets[51], object.wowneroImage); + writer.writeString(offsets[52], object.wowneroImageSecondary); } ThemeAssets _themeAssetsDeserialize( @@ -18477,36 +18456,33 @@ ThemeAssets _themeAssetsDeserialize( object.litecoinImage = reader.readString(offsets[23]); object.litecoinImageSecondary = reader.readString(offsets[24]); object.loadingGif = reader.readStringOrNull(offsets[25]); - object.mimblewimblecoin = reader.readString(offsets[26]); - object.mimblewimblecoinImage = reader.readString(offsets[27]); - object.mimblewimblecoinImageSecondary = reader.readString(offsets[28]); - object.monero = reader.readString(offsets[29]); - object.moneroImage = reader.readString(offsets[30]); - object.moneroImageSecondary = reader.readString(offsets[31]); - object.namecoin = reader.readString(offsets[32]); - object.namecoinImage = reader.readString(offsets[33]); - object.namecoinImageSecondary = reader.readString(offsets[34]); - object.particl = reader.readString(offsets[35]); - object.particlImage = reader.readString(offsets[36]); - object.particlImageSecondary = reader.readString(offsets[37]); - object.personaEasy = reader.readString(offsets[38]); - object.personaIncognito = reader.readString(offsets[39]); - object.receive = reader.readString(offsets[40]); - object.receiveCancelled = reader.readString(offsets[41]); - object.receivePending = reader.readString(offsets[42]); - object.send = reader.readString(offsets[43]); - object.sendCancelled = reader.readString(offsets[44]); - object.sendPending = reader.readString(offsets[45]); - object.stack = reader.readString(offsets[46]); - object.stackIcon = reader.readString(offsets[47]); - object.themePreview = reader.readString(offsets[48]); - object.themeSelector = reader.readString(offsets[49]); - object.txExchange = reader.readString(offsets[50]); - object.txExchangeFailed = reader.readString(offsets[51]); - object.txExchangePending = reader.readString(offsets[52]); - object.wownero = reader.readString(offsets[53]); - object.wowneroImage = reader.readString(offsets[54]); - object.wowneroImageSecondary = reader.readString(offsets[55]); + object.monero = reader.readString(offsets[26]); + object.moneroImage = reader.readString(offsets[27]); + object.moneroImageSecondary = reader.readString(offsets[28]); + object.namecoin = reader.readString(offsets[29]); + object.namecoinImage = reader.readString(offsets[30]); + object.namecoinImageSecondary = reader.readString(offsets[31]); + object.particl = reader.readString(offsets[32]); + object.particlImage = reader.readString(offsets[33]); + object.particlImageSecondary = reader.readString(offsets[34]); + object.personaEasy = reader.readString(offsets[35]); + object.personaIncognito = reader.readString(offsets[36]); + object.receive = reader.readString(offsets[37]); + object.receiveCancelled = reader.readString(offsets[38]); + object.receivePending = reader.readString(offsets[39]); + object.send = reader.readString(offsets[40]); + object.sendCancelled = reader.readString(offsets[41]); + object.sendPending = reader.readString(offsets[42]); + object.stack = reader.readString(offsets[43]); + object.stackIcon = reader.readString(offsets[44]); + object.themePreview = reader.readString(offsets[45]); + object.themeSelector = reader.readString(offsets[46]); + object.txExchange = reader.readString(offsets[47]); + object.txExchangeFailed = reader.readString(offsets[48]); + object.txExchangePending = reader.readString(offsets[49]); + object.wownero = reader.readString(offsets[50]); + object.wowneroImage = reader.readString(offsets[51]); + object.wowneroImageSecondary = reader.readString(offsets[52]); return object; } @@ -18623,12 +18599,6 @@ P _themeAssetsDeserializeProp

( return (reader.readString(offset)) as P; case 52: return (reader.readString(offset)) as P; - case 53: - return (reader.readString(offset)) as P; - case 54: - return (reader.readString(offset)) as P; - case 55: - return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); } @@ -22200,417 +22170,6 @@ extension ThemeAssetsQueryFilter }); } - QueryBuilder - mimblewimblecoinEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'mimblewimblecoin', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinGreaterThan( - String value, { - bool include = false, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'mimblewimblecoin', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinLessThan( - String value, { - bool include = false, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'mimblewimblecoin', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinBetween( - 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'mimblewimblecoin', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'mimblewimblecoin', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'mimblewimblecoin', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'mimblewimblecoin', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'mimblewimblecoin', - wildcard: pattern, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinIsEmpty() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'mimblewimblecoin', - value: '', - )); - }); - } - - QueryBuilder - mimblewimblecoinIsNotEmpty() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'mimblewimblecoin', - value: '', - )); - }); - } - - QueryBuilder - mimblewimblecoinImageEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'mimblewimblecoinImage', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageGreaterThan( - String value, { - bool include = false, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'mimblewimblecoinImage', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageLessThan( - String value, { - bool include = false, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'mimblewimblecoinImage', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageBetween( - 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'mimblewimblecoinImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'mimblewimblecoinImage', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'mimblewimblecoinImage', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'mimblewimblecoinImage', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageMatches(String pattern, - {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'mimblewimblecoinImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageIsEmpty() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'mimblewimblecoinImage', - value: '', - )); - }); - } - - QueryBuilder - mimblewimblecoinImageIsNotEmpty() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'mimblewimblecoinImage', - value: '', - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'mimblewimblecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryGreaterThan( - String value, { - bool include = false, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'mimblewimblecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryLessThan( - String value, { - bool include = false, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'mimblewimblecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryBetween( - 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'mimblewimblecoinImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'mimblewimblecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'mimblewimblecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryContains(String value, - {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'mimblewimblecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'mimblewimblecoinImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryIsEmpty() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'mimblewimblecoinImageSecondary', - value: '', - )); - }); - } - - QueryBuilder - mimblewimblecoinImageSecondaryIsNotEmpty() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'mimblewimblecoinImageSecondary', - value: '', - )); - }); - } - QueryBuilder moneroEqualTo( String value, { bool caseSensitive = true, From aaba3cf9372c0dacd29e1b213d79971622e449b5 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 3 Sep 2025 12:08:41 -0500 Subject: [PATCH 035/178] fix: deduplicate cases see https://github.com/cypherstack/stack_wallet/pull/1016/files/041ce04254c77779a84cd380045dc7ee29fdf09e#r2021536139 --- .../manage_nodes_views/add_edit_node_view.dart | 7 ------- 1 file changed, 7 deletions(-) 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 b899201c2c..f81246b5fb 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 @@ -95,13 +95,6 @@ class _AddEditNodeViewState extends ConsumerState { } else if (coin is CryptonoteCurrency) { ref.read(nodeFormDataProvider).host = data.host; } - if (coin is Mimblewimblecoin) { - ref.read(nodeFormDataProvider).host = data.host; - ref.read(nodeFormDataProvider).port = data.port; - ref.read(nodeFormDataProvider).useSSL = data.useSSL; - } else if (coin is CryptonoteCurrency) { - ref.read(nodeFormDataProvider).host = data.host; - } } Future attemptSave() async { From 5bd8175ee7539731c933fe31d33018ba0acf1911 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 3 Sep 2025 12:11:29 -0500 Subject: [PATCH 036/178] feat: latest flutter_libmwc --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 2eb30bee56..2008080fd8 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 2eb30bee56944ac50d0c1f82423d3944a2f7a04c +Subproject commit 2008080fd8e3a68081f4ca1334c2568421539157 From 05592cc517590c0cbac60fbddda3e88614026ff9 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 5 Sep 2025 12:17:48 -0500 Subject: [PATCH 037/178] fix(epic): fix sqlite column name errors in database queries --- crypto_plugins/flutter_libepiccash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libepiccash b/crypto_plugins/flutter_libepiccash index 25e6cb3a3e..ada6254ee8 160000 --- a/crypto_plugins/flutter_libepiccash +++ b/crypto_plugins/flutter_libepiccash @@ -1 +1 @@ -Subproject commit 25e6cb3a3e7bee04e425af6beccb47e8d0708fdb +Subproject commit ada6254ee8bab4a50e0d45bb6206a970dbac960d From 84073b62cf82e364a7646c22e7836cbdc7a2e493 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 4 Sep 2025 16:36:29 -0500 Subject: [PATCH 038/178] fix(mwc): fix rust versions script --- scripts/rust_version.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/rust_version.sh b/scripts/rust_version.sh index c6a7f3584a..3f658fead0 100755 --- a/scripts/rust_version.sh +++ b/scripts/rust_version.sh @@ -20,6 +20,15 @@ set_rust_version_for_libepiccash() { } set_rust_to_1810() { + if rustup toolchain list | grep -q "1.81.0"; then + rustup default 1.81.0 + else + echo "Rust version 1.81.0 is not installed. Please install it using 'rustup install 1.81.0'." >&2 + exit 1 + fi +} + +set_rust_to_1720() { if rustup toolchain list | grep -q "1.72.0"; then rustup default 1.72.0 else From c87506f89b55b838f777cefb731a476289035834 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 5 Sep 2025 15:55:26 -0500 Subject: [PATCH 039/178] fix(mwc): initialize isMimblewimblecoin --- .../my_stack_view/wallet_view/sub_widgets/my_wallet.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e16254aa51..a644a2175c 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 @@ -61,7 +61,7 @@ class _MyWalletState extends ConsumerState { coin = wallet.info.coin; isFrost = wallet is BitcoinFrostWallet; isEth = coin is Ethereum; - + isMimblewimblecoin = coin is Mimblewimblecoin; if (isMimblewimblecoin) { titles.add("Finalize"); From aac8a64aec3cbce093895961d7fad5300d2f2557 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 3 Sep 2025 21:56:48 -0500 Subject: [PATCH 040/178] fix(mwc): resolve some merge conflicts (wip) these are still untested as issues remain, so are a WIP. some conflicts may have been merged incorrectly --- lib/models/isar/stack_theme.dart | 1 + .../new/steps/frost_create_step_5.dart | 7 +- .../restore_options_view.dart | 97 +-- .../restore_wallet_view.dart | 80 +-- lib/pages/coin_control/utxo_details_view.dart | 379 +++++----- .../exchange_view/trade_details_view.dart | 26 +- .../sub_widgets/name_details.dart | 680 +++++++++--------- .../addresses/address_details_view.dart | 5 +- .../send_steps/frost_send_step_4.dart | 204 +++--- lib/pages/send_view/send_view.dart | 566 ++++++--------- .../global_settings_view/about_view.dart | 238 +++--- .../helpers/restore_create_backup.dart | 9 +- .../frost_ms/frost_participants_view.dart | 143 ++-- .../wallet_backup_view.dart | 11 +- .../wallet_network_settings_view.dart | 42 +- .../delete_wallet_recovery_phrase_view.dart | 11 +- .../sub_widgets/spark_name_details.dart | 9 +- .../all_transactions_view.dart | 7 +- .../transaction_details_view.dart | 152 ++-- .../tx_v2/all_transactions_v2_view.dart | 7 +- .../tx_v2/transaction_v2_card.dart | 6 +- .../tx_v2/transaction_v2_details_view.dart | 2 +- lib/route_generator.dart | 7 +- lib/services/wallets.dart | 5 +- lib/utilities/test_mwcmqs_connection.dart | 19 +- lib/utilities/test_node_connection.dart | 65 +- .../coins/mimblewimblecoin.dart | 3 +- .../wallet/impl/mimblewimblecoin_wallet.dart | 234 +++--- ...imblewimblecoin_wallet_info_extension.dart | 26 +- lib/widgets/tx_key_widget.dart | 57 +- 30 files changed, 1361 insertions(+), 1737 deletions(-) diff --git a/lib/models/isar/stack_theme.dart b/lib/models/isar/stack_theme.dart index efa2f7d05e..7c2f0b7ab0 100644 --- a/lib/models/isar/stack_theme.dart +++ b/lib/models/isar/stack_theme.dart @@ -1943,6 +1943,7 @@ class ThemeAssets implements IThemeAssets { late final String wownero; late final String namecoin; late final String particl; + late final String mimblewimblecoin; late final String bitcoinImage; late final String bitcoincashImage; late final String dogecoinImage; diff --git a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_5.dart b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_5.dart index 9d835ea4ef..0d7c53e8b0 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_5.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_5.dart @@ -27,7 +27,8 @@ import '../../../../../widgets/detail_item.dart'; import '../../../../../widgets/loading_indicator.dart'; import '../../../../../widgets/rounded_container.dart'; import '../../../../home_view/home_view.dart'; -import '../../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart'; +import '../../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart' + as tvd; class FrostCreateStep5 extends ConsumerStatefulWidget { const FrostCreateStep5({super.key}); @@ -90,7 +91,7 @@ class _FrostCreateStep5State extends ConsumerState { detail: multisigConfig, button: Util.isDesktop - ? IconCopyButton(data: multisigConfig) + ? tvd.IconCopyButton(data: multisigConfig) : SimpleCopyButton(data: multisigConfig), ), const SizedBox(height: 12), @@ -99,7 +100,7 @@ class _FrostCreateStep5State extends ConsumerState { detail: serializedKeys, button: Util.isDesktop - ? IconCopyButton(data: serializedKeys) + ? tvd.IconCopyButton(data: serializedKeys) : SimpleCopyButton(data: serializedKeys), ), if (!Util.isDesktop) const Spacer(), 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 3133675b09..c230578940 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 @@ -419,8 +419,9 @@ class _SeedRestoreOptionState extends ConsumerState { return Column( children: [ -<<<<<<< - if (isCnAnd25 || widget.coin is Epiccash) + if (isCnAnd25 || + widget.coin is Epiccash || + widget.coin is Mimblewimblecoin) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -446,23 +447,14 @@ class _SeedRestoreOptionState extends ConsumerState { !ref.read(_pIsUsingDate), ), ], -======= - if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) - Text( - "Choose start date", - style: Util.isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of(context).extension()!.textDark3, - ) - : STextStyles.smallMed12(context), - textAlign: TextAlign.left, ->>>>>>> ), -<<<<<<< - if (isCnAnd25 || widget.coin is Epiccash) + if (isCnAnd25 || + widget.coin is Epiccash || + widget.coin is Mimblewimblecoin) SizedBox(height: Util.isDesktop ? 16 : 8), - if (isCnAnd25 || widget.coin is Epiccash) + if (isCnAnd25 || + widget.coin is Epiccash || + widget.coin is Mimblewimblecoin) ref.watch(_pIsUsingDate) ? RestoreFromDatePicker( onTap: widget.dateChooserFunction, @@ -519,53 +511,36 @@ class _SeedRestoreOptionState extends ConsumerState { ), ), ), - if (isCnAnd25 || widget.coin is Epiccash) const SizedBox(height: 8), - if (isCnAnd25 || widget.coin is Epiccash) -======= - if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) - SizedBox( - height: Util.isDesktop ? 16 : 8, - ), - if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) - RestoreFromDatePicker( - onTap: widget.dateChooserFunction, - controller: widget.dateController, - ), - if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) - const SizedBox( - height: 8, - ), - if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) ->>>>>>> - RoundedWhiteContainer( - child: Center( - child: Text( - ref.watch(_pIsUsingDate) - ? "Choose the date you made the wallet (approximate is fine)" - : "Enter the initial block height of the wallet", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textSubtitle1, - ) - : STextStyles.smallMed12( - context, - ).copyWith(fontSize: 10), - ), + if (isCnAnd25 || + widget.coin is Epiccash || + widget.coin is Mimblewimblecoin) + const SizedBox(height: 8), + if (isCnAnd25 || + widget.coin is Epiccash || + widget.coin is Mimblewimblecoin) + SizedBox(height: Util.isDesktop ? 16 : 8), + RoundedWhiteContainer( + child: Center( + child: Text( + ref.watch(_pIsUsingDate) + ? "Choose the date you made the wallet (approximate is fine)" + : "Enter the initial block height of the wallet", + style: + Util.isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle1, + ) + : STextStyles.smallMed12(context).copyWith(fontSize: 10), ), ), -<<<<<<< - if (isCnAnd25 || widget.coin is Epiccash) + ), + if (isCnAnd25 || + widget.coin is Epiccash || + widget.coin is Mimblewimblecoin) SizedBox(height: Util.isDesktop ? 24 : 16), -======= - if (isMoneroAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin || isWowneroAnd25) - SizedBox( - height: Util.isDesktop ? 24 : 16, - ), ->>>>>>> Text( "Choose recovery phrase length", style: 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 2bf3ef2735..dceb76d80d 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 @@ -226,12 +226,11 @@ class _RestoreWalletViewState extends ConsumerState { } mnemonic = mnemonic.trim(); - final int height = widget.restoreBlockHeight; + int height = widget.restoreBlockHeight; String? otherDataJsonString; // TODO: make more robust estimate of date maybe using https://explorer.epic.tech/api-index if (widget.coin is Epiccash) { -<<<<<<< otherDataJsonString = jsonEncode({ WalletInfoKeys.epiccashData: jsonEncode( ExtraEpiccashWalletInfo( @@ -245,71 +244,34 @@ class _RestoreWalletViewState extends ConsumerState { ).toMap(), ), }); -======= - if (widget.restoreFromDate != null) { - final int secondsSinceEpoch = - widget.restoreFromDate!.millisecondsSinceEpoch ~/ 1000; - const int epicCashFirstBlock = 1565370278; - const double overestimateSecondsPerBlock = 61; - final int chosenSeconds = secondsSinceEpoch - epicCashFirstBlock; - final int approximateHeight = - chosenSeconds ~/ overestimateSecondsPerBlock; - - height = approximateHeight; - } - if (height < 0) { - height = 0; - } - otherDataJsonString = jsonEncode( - { - WalletInfoKeys.mimblewimblecoinData: jsonEncode( - ExtraMimblewimblecoinWalletInfo( - receivingIndex: 0, - changeIndex: 0, - slatesToAddresses: {}, - slatesToCommits: {}, - lastScannedBlock: height, - restoreHeight: height, - creationHeight: height, - ).toMap(), - ), - }, - ); } else if (widget.coin is Mimblewimblecoin) { - final int secondsSinceEpoch = widget.restoreFromDate!.millisecondsSinceEpoch ~/ 1000; + // final int secondsSinceEpoch = + // widget.restoreFromDate!.millisecondsSinceEpoch ~/ 1000; + final int secondsSinceEpoch = + DateTime.now().millisecondsSinceEpoch ~/ 1000; const int mimblewimblecoinFirstBlock = 1573462801; const double overestimateSecondsPerBlock = 61; - final int chosenSeconds = secondsSinceEpoch - mimblewimblecoinFirstBlock; + final int chosenSeconds = + secondsSinceEpoch - mimblewimblecoinFirstBlock; final int approximateHeight = chosenSeconds ~/ overestimateSecondsPerBlock; height = approximateHeight; if (height < 0) { height = 0; } - otherDataJsonString = jsonEncode( - { - WalletInfoKeys.mimblewimblecoinData: jsonEncode( - ExtraMimblewimblecoinWalletInfo( - receivingIndex: 0, - changeIndex: 0, - slatesToAddresses: {}, - slatesToCommits: {}, - lastScannedBlock: height, - restoreHeight: height, - creationHeight: height, - ).toMap(), - ), - }, - ); - } else if (widget.coin is Firo) { - otherDataJsonString = jsonEncode( - { - WalletInfoKeys.lelantusCoinIsarRescanRequired: false, - WalletInfoKeys.enableLelantusScanning: - widget.enableLelantusScanning, - }, - ); ->>>>>>> + otherDataJsonString = jsonEncode({ + WalletInfoKeys.mimblewimblecoinData: jsonEncode( + ExtraMimblewimblecoinWalletInfo( + receivingIndex: 0, + changeIndex: 0, + slatesToAddresses: {}, + slatesToCommits: {}, + lastScannedBlock: height, + restoreHeight: height, + creationHeight: height, + ).toMap(), + ), + }); } // TODO: do actual check to make sure it is a valid mnemonic for monero + xelis @@ -392,7 +354,7 @@ class _RestoreWalletViewState extends ConsumerState { case const (EpiccashWallet): await (wallet as EpiccashWallet).init(isRestore: true); break; - + case const (MimblewimblecoinWallet): await (wallet as MimblewimblecoinWallet).init(isRestore: true); break; diff --git a/lib/pages/coin_control/utxo_details_view.dart b/lib/pages/coin_control/utxo_details_view.dart index 9959abdda6..3e4a93670a 100644 --- a/lib/pages/coin_control/utxo_details_view.dart +++ b/lib/pages/coin_control/utxo_details_view.dart @@ -35,7 +35,7 @@ import '../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../widgets/desktop/secondary_button.dart'; import '../../widgets/icon_widgets/utxo_status_icon.dart'; import '../../widgets/rounded_container.dart'; -import '../wallet_view/transaction_views/transaction_details_view.dart'; +import '../wallet_view/transaction_views/transaction_details_view.dart' as tdv; class UtxoDetailsView extends ConsumerStatefulWidget { const UtxoDetailsView({ @@ -83,10 +83,11 @@ class _UtxoDetailsViewState extends ConsumerState { @override void initState() { - utxo = MainDB.instance.isar.utxos - .where() - .idEqualTo(widget.utxoId) - .findFirstSync()!; + utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(widget.utxoId) + .findFirstSync()!; streamUTXO = MainDB.instance.watchUTXO(id: widget.utxoId); @@ -112,53 +113,50 @@ class _UtxoDetailsViewState extends ConsumerState { final confirmed = _isConfirmed( utxo!, currentHeight, - ref.watch( - pWallets.select( - (s) => s.getWallet(widget.walletId), - ), - ), + ref.watch(pWallets.select((s) => s.getWallet(widget.walletId))), ); return ConditionalParent( condition: !isDesktop, - builder: (child) => Background( - child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, - appBar: AppBar( - backgroundColor: - Theme.of(context).extension()!.background, - leading: AppBarBackButton( - onPressed: () { - Navigator.of(context).pop(_popWithRefresh ? "refresh" : null); - }, - ), - title: Text( - "Output details", - style: STextStyles.navBarTitle(context), - ), - ), - body: SafeArea( - child: LayoutBuilder( - builder: (context, constraints) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: constraints.maxHeight, - ), - child: IntrinsicHeight( - child: child, + builder: + (child) => Background( + child: Scaffold( + backgroundColor: + Theme.of(context).extension()!.background, + appBar: AppBar( + backgroundColor: + Theme.of(context).extension()!.background, + leading: AppBarBackButton( + onPressed: () { + Navigator.of( + context, + ).pop(_popWithRefresh ? "refresh" : null); + }, + ), + title: Text( + "Output details", + style: STextStyles.navBarTitle(context), + ), + ), + body: SafeArea( + child: LayoutBuilder( + builder: (context, constraints) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight, + ), + child: IntrinsicHeight(child: child), + ), ), - ), - ), - ); - }, + ); + }, + ), + ), ), ), - ), - ), child: StreamBuilder( stream: streamUTXO, builder: (context, snapshot) { @@ -184,8 +182,9 @@ class _UtxoDetailsViewState extends ConsumerState { ), DesktopDialogCloseButton( onPressedOverride: () { - Navigator.of(context) - .pop(_popWithRefresh ? "refresh" : null); + Navigator.of( + context, + ).pop(_popWithRefresh ? "refresh" : null); }, ), ], @@ -204,15 +203,14 @@ class _UtxoDetailsViewState extends ConsumerState { child: RoundedContainer( padding: EdgeInsets.zero, color: Colors.transparent, - borderColor: Theme.of(context) - .extension()! - .textFieldDefaultBG, + borderColor: + Theme.of(context) + .extension()! + .textFieldDefaultBG, child: child, ), ), - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), SecondaryButton( buttonHeight: ButtonHeight.l, label: utxo!.isBlocked ? "Unfreeze" : "Freeze", @@ -229,15 +227,13 @@ class _UtxoDetailsViewState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - if (!isDesktop) - const SizedBox( - height: 10, - ), + if (!isDesktop) const SizedBox(height: 10), RoundedContainer( padding: const EdgeInsets.all(12), - color: isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.popupBG, + color: + isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.popupBG, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -246,22 +242,23 @@ class _UtxoDetailsViewState extends ConsumerState { if (isDesktop) UTXOStatusIcon( blocked: utxo!.isBlocked, - status: confirmed - ? UTXOStatusIconStatus.confirmed - : UTXOStatusIconStatus.unconfirmed, - background: Theme.of(context) - .extension()! - .popupBG, + status: + confirmed + ? UTXOStatusIconStatus.confirmed + : UTXOStatusIconStatus.unconfirmed, + background: + Theme.of( + context, + ).extension()!.popupBG, selected: false, width: 32, height: 32, ), - if (isDesktop) - const SizedBox( - width: 16, - ), + if (isDesktop) const SizedBox(width: 16), Text( - ref.watch(pAmountFormatter(coin)).format( + ref + .watch(pAmountFormatter(coin)) + .format( utxo!.value.toAmountAsRaw( fractionDigits: coin.fractionDigits, ), @@ -274,18 +271,19 @@ class _UtxoDetailsViewState extends ConsumerState { utxo!.isBlocked ? "Frozen" : confirmed - ? "Available" - : "Unconfirmed", + ? "Available" + : "Unconfirmed", style: STextStyles.w500_14(context).copyWith( - color: utxo!.isBlocked - ? const Color(0xFF7FA2D4) // todo theme - : confirmed - ? Theme.of(context) - .extension()! - .accentColorGreen - : Theme.of(context) - .extension()! - .accentColorYellow, + color: + utxo!.isBlocked + ? const Color(0xFF7FA2D4) // todo theme + : confirmed + ? Theme.of( + context, + ).extension()!.accentColorGreen + : Theme.of( + context, + ).extension()!.accentColorYellow, ), ), ], @@ -293,12 +291,14 @@ class _UtxoDetailsViewState extends ConsumerState { ), const _Div(), RoundedContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.popupBG, + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.popupBG, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -309,9 +309,10 @@ class _UtxoDetailsViewState extends ConsumerState { Text( "Label", style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), ), SimpleEditButton( @@ -319,32 +320,27 @@ class _UtxoDetailsViewState extends ConsumerState { editLabel: "label", onValueChanged: (newName) { MainDB.instance.putUTXO( - utxo!.copyWith( - name: newName, - ), + utxo!.copyWith(name: newName), ); }, ), ], ), - const SizedBox( - height: 4, - ), - Text( - utxo!.name, - style: STextStyles.w500_14(context), - ), + const SizedBox(height: 4), + Text(utxo!.name, style: STextStyles.w500_14(context)), ], ), ), const _Div(), RoundedContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.popupBG, + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.popupBG, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -355,39 +351,35 @@ class _UtxoDetailsViewState extends ConsumerState { Text( "Address", style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), ), isDesktop - ? IconCopyButton( - data: utxo!.address!, - ) - : SimpleCopyButton( - data: utxo!.address!, - ), + ? tdv.IconCopyButton(data: utxo!.address!) + : SimpleCopyButton(data: utxo!.address!), ], ), - const SizedBox( - height: 4, - ), - Text( - utxo!.address!, - style: STextStyles.w500_14(context), - ), + const SizedBox(height: 4), + Text(utxo!.address!, style: STextStyles.w500_14(context)), ], ), ), if (label != null && label!.value.isNotEmpty) const _Div(), if (label != null && label!.value.isNotEmpty) RoundedContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.popupBG, + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + isDesktop + ? Colors.transparent + : Theme.of( + context, + ).extension()!.popupBG, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -398,38 +390,32 @@ class _UtxoDetailsViewState extends ConsumerState { Text( "Address label", style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), ), isDesktop - ? IconCopyButton( - data: label!.value, - ) - : SimpleCopyButton( - data: label!.value, - ), + ? tdv.IconCopyButton(data: label!.value) + : SimpleCopyButton(data: label!.value), ], ), - const SizedBox( - height: 4, - ), - Text( - label!.value, - style: STextStyles.w500_14(context), - ), + const SizedBox(height: 4), + Text(label!.value, style: STextStyles.w500_14(context)), ], ), ), const _Div(), RoundedContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.popupBG, + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.popupBG, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -440,38 +426,32 @@ class _UtxoDetailsViewState extends ConsumerState { Text( "Transaction ID", style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), ), isDesktop - ? IconCopyButton( - data: utxo!.txid, - ) - : SimpleCopyButton( - data: utxo!.txid, - ), + ? tdv.IconCopyButton(data: utxo!.txid) + : SimpleCopyButton(data: utxo!.txid), ], ), - const SizedBox( - height: 4, - ), - Text( - utxo!.txid, - style: STextStyles.w500_14(context), - ), + const SizedBox(height: 4), + Text(utxo!.txid, style: STextStyles.w500_14(context)), ], ), ), const _Div(), RoundedContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.popupBG, + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.popupBG, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -479,14 +459,13 @@ class _UtxoDetailsViewState extends ConsumerState { Text( "Confirmations", style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), ), - const SizedBox( - height: 4, - ), + const SizedBox(height: 4), Text( "${utxo!.getConfirmations(currentHeight)}", style: STextStyles.w500_14(context), @@ -501,14 +480,16 @@ class _UtxoDetailsViewState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ RoundedContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: isDesktop - ? Colors.transparent - : Theme.of(context) - .extension()! - .popupBG, + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + isDesktop + ? Colors.transparent + : Theme.of( + context, + ).extension()!.popupBG, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -519,9 +500,10 @@ class _UtxoDetailsViewState extends ConsumerState { Text( "Freeze reason", style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of(context) + .extension()! + .textSubtitle1, ), ), SimpleEditButton( @@ -529,17 +511,13 @@ class _UtxoDetailsViewState extends ConsumerState { editLabel: "freeze reason", onValueChanged: (newReason) { MainDB.instance.putUTXO( - utxo!.copyWith( - blockedReason: newReason, - ), + utxo!.copyWith(blockedReason: newReason), ); }, ), ], ), - const SizedBox( - height: 4, - ), + const SizedBox(height: 4), Text( utxo!.blockedReason ?? "", style: STextStyles.w500_14(context), @@ -556,10 +534,7 @@ class _UtxoDetailsViewState extends ConsumerState { label: utxo!.isBlocked ? "Unfreeze" : "Freeze", onPressed: _toggleFreeze, ), - if (!isDesktop) - const SizedBox( - height: 16, - ), + if (!isDesktop) const SizedBox(height: 16), ], ), ); @@ -581,9 +556,7 @@ class _Div extends StatelessWidget { color: Theme.of(context).extension()!.textFieldDefaultBG, ); } else { - return const SizedBox( - height: 12, - ); + return const SizedBox(height: 12); } } } diff --git a/lib/pages/exchange_view/trade_details_view.dart b/lib/pages/exchange_view/trade_details_view.dart index 6e56e57553..39623c3d84 100644 --- a/lib/pages/exchange_view/trade_details_view.dart +++ b/lib/pages/exchange_view/trade_details_view.dart @@ -57,7 +57,7 @@ import '../../widgets/rounded_container.dart'; import '../../widgets/rounded_white_container.dart'; import '../../widgets/stack_dialog.dart'; import '../wallet_view/transaction_views/edit_note_view.dart'; -import '../wallet_view/transaction_views/transaction_details_view.dart'; +import '../wallet_view/transaction_views/transaction_details_view.dart' as tdv; import 'edit_trade_note_view.dart'; import 'send_from_view.dart'; @@ -518,7 +518,7 @@ class _TradeDetailsViewState extends ConsumerState { ), ], ), - IconCopyButton(data: trade.payInAmount), + tdv.IconCopyButton(data: trade.payInAmount), ], ), const SizedBox(height: 6), @@ -604,20 +604,20 @@ class _TradeDetailsViewState extends ConsumerState { maxHeight: MediaQuery.of(context).size.height - 64, maxWidth: 580, - child: TransactionDetailsView( + child: tdv.TransactionDetailsView( coin: coin, transaction: transactionIfSentFromStack!, walletId: walletId!, ), ), const RouteSettings( - name: TransactionDetailsView.routeName, + name: tdv.TransactionDetailsView.routeName, ), ), ); } else { Navigator.of(context).pushNamed( - TransactionDetailsView.routeName, + tdv.TransactionDetailsView.routeName, arguments: Tuple3( transactionIfSentFromStack!, coin, @@ -664,7 +664,7 @@ class _TradeDetailsViewState extends ConsumerState { ], ), ), - if (isDesktop) IconCopyButton(data: trade.payInAddress), + if (isDesktop) tdv.IconCopyButton(data: trade.payInAddress), ], ), ), @@ -687,7 +687,7 @@ class _TradeDetailsViewState extends ConsumerState { style: STextStyles.itemSubtitle(context), ), isDesktop - ? IconCopyButton(data: trade.payInAddress) + ? tdv.IconCopyButton(data: trade.payInAddress) : GestureDetector( onTap: () async { final address = trade.payInAddress; @@ -840,7 +840,7 @@ class _TradeDetailsViewState extends ConsumerState { children: [ Text("Memo", style: STextStyles.itemSubtitle(context)), isDesktop - ? IconCopyButton(data: trade.payInExtraId) + ? tdv.IconCopyButton(data: trade.payInExtraId) : GestureDetector( onTap: () async { final address = trade.payInExtraId; @@ -904,7 +904,7 @@ class _TradeDetailsViewState extends ConsumerState { style: STextStyles.itemSubtitle(context), ), isDesktop - ? IconPencilButton( + ? tdv.IconPencilButton( onPressed: () { showDialog( context: context, @@ -984,7 +984,7 @@ class _TradeDetailsViewState extends ConsumerState { style: STextStyles.itemSubtitle(context), ), isDesktop - ? IconPencilButton( + ? tdv.IconPencilButton( onPressed: () { showDialog( context: context, @@ -1088,7 +1088,7 @@ class _TradeDetailsViewState extends ConsumerState { style: STextStyles.itemSubtitle12(context), ), if (isDesktop) - IconCopyButton( + tdv.IconCopyButton( data: Format.extractDateFrom( trade.timestamp.millisecondsSinceEpoch ~/ 1000, ), @@ -1121,7 +1121,7 @@ class _TradeDetailsViewState extends ConsumerState { ), ], ), - if (isDesktop) IconCopyButton(data: trade.exchangeName), + if (isDesktop) tdv.IconCopyButton(data: trade.exchangeName), if (!isDesktop) SelectableText( trade.exchangeName, @@ -1155,7 +1155,7 @@ class _TradeDetailsViewState extends ConsumerState { ), ], ), - if (isDesktop) IconCopyButton(data: trade.tradeId), + if (isDesktop) tdv.IconCopyButton(data: trade.tradeId), if (!isDesktop) Row( children: [ diff --git a/lib/pages/namecoin_names/sub_widgets/name_details.dart b/lib/pages/namecoin_names/sub_widgets/name_details.dart index 7fa77f807f..d16ca0b1ac 100644 --- a/lib/pages/namecoin_names/sub_widgets/name_details.dart +++ b/lib/pages/namecoin_names/sub_widgets/name_details.dart @@ -23,7 +23,8 @@ import '../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../widgets/desktop/secondary_button.dart'; import '../../../widgets/dialogs/s_dialog.dart'; import '../../../widgets/rounded_container.dart'; -import '../../wallet_view/transaction_views/transaction_details_view.dart'; +import '../../wallet_view/transaction_views/transaction_details_view.dart' + as tdv; import '../manage_domain_view.dart'; import 'transfer_option_widget.dart'; import 'update_option_widget.dart'; @@ -60,8 +61,10 @@ class _ManageDomainsWidgetState extends ConsumerState { final data = jsonDecode(utxo.otherData!) as Map; final nameData = jsonDecode(data["nameOpData"] as String) as Map; - opNameData = - OpNameData(nameData.cast(), utxo.blockHeight ?? currentHeight); + opNameData = OpNameData( + nameData.cast(), + utxo.blockHeight ?? currentHeight, + ); _setName(); } @@ -76,32 +79,29 @@ class _ManageDomainsWidgetState extends ConsumerState { ref .read(secureStoreProvider) .read( - key: nameSaltKeyBuilder( - utxo!.txid, - widget.walletId, - utxo!.vout, - ), + key: nameSaltKeyBuilder(utxo!.txid, widget.walletId, utxo!.vout), ) .then((onValue) { - if (onValue != null) { - final data = (jsonDecode(onValue) as Map).cast(); - WidgetsBinding.instance.addPostFrameCallback((_) { - constructedName = data["name"]!; - value = data["value"]!; - if (mounted) { - setState(() {}); - } - }); - } else { - WidgetsBinding.instance.addPostFrameCallback((_) { - constructedName = "UNKNOWN"; - value = ""; - if (mounted) { - setState(() {}); + if (onValue != null) { + final data = + (jsonDecode(onValue) as Map).cast(); + WidgetsBinding.instance.addPostFrameCallback((_) { + constructedName = data["name"]!; + value = data["value"]!; + if (mounted) { + setState(() {}); + } + }); + } else { + WidgetsBinding.instance.addPostFrameCallback((_) { + constructedName = "UNKNOWN"; + value = ""; + if (mounted) { + setState(() {}); + } + }); } }); - } - }); } } } @@ -114,10 +114,7 @@ class _ManageDomainsWidgetState extends ConsumerState { message = "Expires in $blocksNameExpiration+ blocks"; color = theme.accentColorGreen; } else { - final remaining = opNameData?.expiredBlockLeft( - currentChainHeight, - false, - ); + final remaining = opNameData?.expiredBlockLeft(currentChainHeight, false); final semiRemaining = opNameData?.expiredBlockLeft( currentChainHeight, true, @@ -141,10 +138,7 @@ class _ManageDomainsWidgetState extends ConsumerState { bool _checkConfirmedUtxo(int currentHeight) { return (ref.read(pWallets).getWallet(widget.walletId) as NamecoinWallet) - .checkUtxoConfirmed( - utxo!, - currentHeight, - ); + .checkUtxoConfirmed(utxo!, currentHeight); } @override @@ -165,10 +159,9 @@ class _ManageDomainsWidgetState extends ConsumerState { _setName(); if (utxo?.address != null) { - label = ref.read(mainDBProvider).getAddressLabelSync( - widget.walletId, - utxo!.address!, - ); + label = ref + .read(mainDBProvider) + .getAddressLabelSync(widget.walletId, utxo!.address!); if (label != null) { streamLabel = ref.read(mainDBProvider).watchAddressLabel(id: label!.id); @@ -187,67 +180,73 @@ class _ManageDomainsWidgetState extends ConsumerState { Theme.of(context).extension()!, ); - final canManage = utxo != null && + final canManage = + utxo != null && _checkConfirmedUtxo(currentHeight) && (opNameData?.op == OpName.nameUpdate || opNameData?.op == OpName.nameFirstUpdate); return ConditionalParent( condition: !Util.isDesktop, - builder: (child) => Background( - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - // Theme.of(context).extension()!.background, - leading: const AppBarBackButton(), - title: Text( - "Domain details", - style: STextStyles.navBarTitle(context), - ), - actions: canManage - ? [ - Padding( - padding: const EdgeInsets.only( - top: 10, - bottom: 10, - right: 10, - ), - child: CustomTextButton( - key: const Key("addAddressBookEntryFavoriteButtonKey"), - text: "Manage", - onTap: () { - Navigator.of(context).pushNamed( - ManageDomainView.routeName, - arguments: (walletId: widget.walletId, utxo: utxo!), - ); - }, - ), - ), - ] - : null, - ), - body: SafeArea( - child: LayoutBuilder( - builder: (context, constraints) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: constraints.maxHeight, - ), - child: IntrinsicHeight( - child: child, + builder: + (child) => Background( + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + // Theme.of(context).extension()!.background, + leading: const AppBarBackButton(), + title: Text( + "Domain details", + style: STextStyles.navBarTitle(context), + ), + actions: + canManage + ? [ + Padding( + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + right: 10, + ), + child: CustomTextButton( + key: const Key( + "addAddressBookEntryFavoriteButtonKey", + ), + text: "Manage", + onTap: () { + Navigator.of(context).pushNamed( + ManageDomainView.routeName, + arguments: ( + walletId: widget.walletId, + utxo: utxo!, + ), + ); + }, + ), + ), + ] + : null, + ), + body: SafeArea( + child: LayoutBuilder( + builder: (context, constraints) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight, + ), + child: IntrinsicHeight(child: child), + ), ), - ), - ), - ); - }, + ); + }, + ), + ), ), ), - ), - ), child: ConditionalParent( condition: Util.isDesktop, builder: (child) { @@ -278,9 +277,10 @@ class _ManageDomainsWidgetState extends ConsumerState { child: RoundedContainer( padding: EdgeInsets.zero, color: Colors.transparent, - borderColor: Theme.of(context) - .extension()! - .textFieldDefaultBG, + borderColor: + Theme.of( + context, + ).extension()!.textFieldDefaultBG, child: child, ), ), @@ -341,9 +341,7 @@ class _ManageDomainsWidgetState extends ConsumerState { }, ), ), - const SizedBox( - width: 32, - ), + const SizedBox(width: 32), Expanded( child: SecondaryButton( label: "Update", @@ -398,10 +396,7 @@ class _ManageDomainsWidgetState extends ConsumerState { ], ), ), - if (canManage) - const SizedBox( - height: 32, - ), + if (canManage) const SizedBox(height: 32), ], ), ); @@ -415,193 +410,148 @@ class _ManageDomainsWidgetState extends ConsumerState { return utxo == null ? Center( - child: Text( - "Missing output. Was it used recently?", - style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .accentColorRed, - ), + child: Text( + "Missing output. Was it used recently?", + style: STextStyles.w500_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.accentColorRed, ), - ) + ), + ) : Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - // if (!isDesktop) - // const SizedBox( - // height: 10, - // ), - RoundedContainer( - padding: const EdgeInsets.all(12), - color: Util.isDesktop - ? Colors.transparent - : Theme.of(context) - .extension()! - .popupBG, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SelectableText( - constructedName ?? "", - style: STextStyles.pageTitleH2(context), - ), - if (Util.isDesktop) - SelectableText( - opNameData!.op.name, - style: STextStyles.w500_14(context), - ), - ], - ), - if (!Util.isDesktop) + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // if (!isDesktop) + // const SizedBox( + // height: 10, + // ), + RoundedContainer( + padding: const EdgeInsets.all(12), + color: + Util.isDesktop + ? Colors.transparent + : Theme.of( + context, + ).extension()!.popupBG, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ SelectableText( - opNameData!.op.name, - style: STextStyles.w500_14(context), + constructedName ?? "", + style: STextStyles.pageTitleH2(context), ), - ], - ), - ), - const _Div(), - RoundedContainer( - padding: Util.isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: Util.isDesktop - ? Colors.transparent - : Theme.of(context) - .extension()! - .popupBG, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Value", - style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, - ), + if (Util.isDesktop) + SelectableText( + opNameData!.op.name, + style: STextStyles.w500_14(context), ), - ], - ), - const SizedBox( - height: 4, - ), + ], + ), + if (!Util.isDesktop) SelectableText( - value ?? "", + opNameData!.op.name, style: STextStyles.w500_14(context), ), - ], - ), + ], ), - const _Div(), - RoundedContainer( - padding: Util.isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: Util.isDesktop - ? Colors.transparent - : Theme.of(context) - .extension()! - .popupBG, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Address", - style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, - ), + ), + const _Div(), + RoundedContainer( + padding: + Util.isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + Util.isDesktop + ? Colors.transparent + : Theme.of( + context, + ).extension()!.popupBG, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Value", + style: STextStyles.w500_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), - Util.isDesktop - ? IconCopyButton( - data: utxo!.address!, - ) - : SimpleCopyButton( - data: utxo!.address!, - ), - ], - ), - const SizedBox( - height: 4, - ), - SelectableText( - utxo!.address!, - style: STextStyles.w500_14(context), - ), - ], - ), + ), + ], + ), + const SizedBox(height: 4), + SelectableText( + value ?? "", + style: STextStyles.w500_14(context), + ), + ], ), - if (label != null && label!.value.isNotEmpty) - const _Div(), - if (label != null && label!.value.isNotEmpty) - RoundedContainer( - padding: Util.isDesktop + ), + const _Div(), + RoundedContainer( + padding: + Util.isDesktop ? const EdgeInsets.all(16) : const EdgeInsets.all(12), - color: Util.isDesktop + color: + Util.isDesktop ? Colors.transparent - : Theme.of(context) - .extension()! - .popupBG, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, + : Theme.of( + context, + ).extension()!.popupBG, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - "Address label", - style: - STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, - ), - ), - Util.isDesktop - ? IconCopyButton( - data: label!.value, - ) - : SimpleCopyButton( - data: label!.value, - ), - ], - ), - const SizedBox( - height: 4, - ), - SelectableText( - label!.value, - style: STextStyles.w500_14(context), + Text( + "Address", + style: STextStyles.w500_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle1, + ), ), + Util.isDesktop + ? tdv.IconCopyButton(data: utxo!.address!) + : SimpleCopyButton(data: utxo!.address!), ], ), - ), - const _Div(), + const SizedBox(height: 4), + SelectableText( + utxo!.address!, + style: STextStyles.w500_14(context), + ), + ], + ), + ), + if (label != null && label!.value.isNotEmpty) const _Div(), + if (label != null && label!.value.isNotEmpty) RoundedContainer( - padding: Util.isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: Util.isDesktop - ? Colors.transparent - : Theme.of(context) - .extension()! - .popupBG, + padding: + Util.isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + Util.isDesktop + ? Colors.transparent + : Theme.of( + context, + ).extension()!.popupBG, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -610,100 +560,138 @@ class _ManageDomainsWidgetState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "Transaction ID", + "Address label", style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of(context) + .extension()! + .textSubtitle1, ), ), Util.isDesktop - ? IconCopyButton( - data: utxo!.txid, - ) - : SimpleCopyButton( - data: utxo!.txid, - ), + ? tdv.IconCopyButton(data: label!.value) + : SimpleCopyButton(data: label!.value), ], ), - const SizedBox( - height: 4, - ), + const SizedBox(height: 4), SelectableText( - utxo!.txid, + label!.value, style: STextStyles.w500_14(context), ), ], ), ), - const _Div(), - RoundedContainer( - padding: Util.isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: Util.isDesktop - ? Colors.transparent - : Theme.of(context) - .extension()! - .popupBG, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Expiry", - style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, - ), - ), - const SizedBox( - height: 4, - ), - SelectableText( - message, - style: STextStyles.w500_14(context).copyWith( - color: color, + const _Div(), + RoundedContainer( + padding: + Util.isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + Util.isDesktop + ? Colors.transparent + : Theme.of( + context, + ).extension()!.popupBG, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Transaction ID", + style: STextStyles.w500_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle1, + ), ), - ), - ], - ), + Util.isDesktop + ? tdv.IconCopyButton(data: utxo!.txid) + : SimpleCopyButton(data: utxo!.txid), + ], + ), + const SizedBox(height: 4), + SelectableText( + utxo!.txid, + style: STextStyles.w500_14(context), + ), + ], ), - const _Div(), - RoundedContainer( - padding: Util.isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - color: Util.isDesktop - ? Colors.transparent - : Theme.of(context) - .extension()! - .popupBG, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Confirmations", - style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, - ), - ), - const SizedBox( - height: 4, + ), + const _Div(), + RoundedContainer( + padding: + Util.isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + Util.isDesktop + ? Colors.transparent + : Theme.of( + context, + ).extension()!.popupBG, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Expiry", + style: STextStyles.w500_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), - SelectableText( - "${utxo!.getConfirmations(currentHeight)}", - style: STextStyles.w500_14(context), + ), + const SizedBox(height: 4), + SelectableText( + message, + style: STextStyles.w500_14( + context, + ).copyWith(color: color), + ), + ], + ), + ), + const _Div(), + RoundedContainer( + padding: + Util.isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + color: + Util.isDesktop + ? Colors.transparent + : Theme.of( + context, + ).extension()!.popupBG, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Confirmations", + style: STextStyles.w500_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), - ], - ), + ), + const SizedBox(height: 4), + SelectableText( + "${utxo!.getConfirmations(currentHeight)}", + style: STextStyles.w500_14(context), + ), + ], ), - ], - ); + ), + ], + ); }, ), ), @@ -723,9 +711,7 @@ class _Div extends StatelessWidget { color: Theme.of(context).extension()!.textFieldDefaultBG, ); } else { - return const SizedBox( - height: 12, - ); + return const SizedBox(height: 12); } } } diff --git a/lib/pages/receive_view/addresses/address_details_view.dart b/lib/pages/receive_view/addresses/address_details_view.dart index 96c2e66a62..51dfd7e4ee 100644 --- a/lib/pages/receive_view/addresses/address_details_view.dart +++ b/lib/pages/receive_view/addresses/address_details_view.dart @@ -38,7 +38,8 @@ import '../../../widgets/qr.dart'; import '../../../widgets/rounded_white_container.dart'; import '../../../widgets/transaction_card.dart'; import '../../wallet_view/sub_widgets/no_transactions_found.dart'; -import '../../wallet_view/transaction_views/transaction_details_view.dart'; +import '../../wallet_view/transaction_views/transaction_details_view.dart' + as tdv; import '../../wallet_view/transaction_views/tx_v2/transaction_v2_card.dart'; import 'address_tag.dart'; @@ -306,7 +307,7 @@ class _AddressDetailsViewState extends ConsumerState { detail: address.value, button: isDesktop - ? IconCopyButton(data: address.value) + ? tdv.IconCopyButton(data: address.value) : SimpleCopyButton(data: address.value), ), const _Div(height: 12), diff --git a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_4.dart b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_4.dart index ee45a6e70a..927a09b3cf 100644 --- a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_4.dart +++ b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_4.dart @@ -21,7 +21,8 @@ import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/detail_item.dart'; import '../../../../widgets/expandable.dart'; import '../../../../widgets/stack_dialog.dart'; -import '../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart'; +import '../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart' + as tvd; import '../../../wallet_view/wallet_view.dart'; class FrostSendStep4 extends ConsumerStatefulWidget { @@ -43,9 +44,9 @@ class _FrostSendStep4State extends ConsumerState { @override void initState() { - final wallet = ref.read(pWallets).getWallet( - ref.read(pFrostScaffoldArgs)!.walletId!, - ) as BitcoinFrostWallet; + final wallet = + ref.read(pWallets).getWallet(ref.read(pFrostScaffoldArgs)!.walletId!) + as BitcoinFrostWallet; cryptoCurrency = wallet.cryptoCurrency; @@ -80,79 +81,70 @@ class _FrostSendStep4State extends ConsumerState { DetailItem( title: "Tx hex (debug mode only)", detail: ref.watch(pFrostTxData)!.raw!, - button: Util.isDesktop - ? IconCopyButton( - data: ref.watch(pFrostTxData)!.raw!, - ) - : SimpleCopyButton( - data: ref.watch(pFrostTxData)!.raw!, - ), - ), - if (kDebugMode) - const SizedBox( - height: 12, + button: + Util.isDesktop + ? tvd.IconCopyButton(data: ref.watch(pFrostTxData)!.raw!) + : SimpleCopyButton(data: ref.watch(pFrostTxData)!.raw!), ), + if (kDebugMode) const SizedBox(height: 12), Text( "Send ${cryptoCurrency.ticker}", style: STextStyles.w600_20(context), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), recipients.length == 1 ? _Recipient( - address: recipients[0].address, - amount: ref - .watch(pAmountFormatter(cryptoCurrency)) - .format(recipients[0].amount), - ) + address: recipients[0].address, + amount: ref + .watch(pAmountFormatter(cryptoCurrency)) + .format(recipients[0].amount), + ) : Column( - children: [ - for (int i = 0; i < recipients.length; i++) - Padding( - padding: const EdgeInsets.only(top: 10), - child: Expandable( - onExpandChanged: (state) { - setState(() { - _expandedStates[i] = - state == ExpandableState.expanded; - }); - }, - header: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 6), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Recipient ${i + 1}", - style: STextStyles.itemSubtitle(context), - ), - SvgPicture.asset( - _expandedStates[i] - ? Assets.svg.chevronUp - : Assets.svg.chevronDown, - width: 12, - height: 6, - color: Theme.of(context) - .extension()! - .textSubtitle1, - ), - ], - ), - ), - body: _Recipient( - address: recipients[i].address, - amount: ref - .watch(pAmountFormatter(cryptoCurrency)) - .format(recipients[i].amount), + children: [ + for (int i = 0; i < recipients.length; i++) + Padding( + padding: const EdgeInsets.only(top: 10), + child: Expandable( + onExpandChanged: (state) { + setState(() { + _expandedStates[i] = + state == ExpandableState.expanded; + }); + }, + header: Padding( + padding: const EdgeInsets.only(top: 12, bottom: 6), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Recipient ${i + 1}", + style: STextStyles.itemSubtitle(context), + ), + SvgPicture.asset( + _expandedStates[i] + ? Assets.svg.chevronUp + : Assets.svg.chevronDown, + width: 12, + height: 6, + color: + Theme.of( + context, + ).extension()!.textSubtitle1, + ), + ], ), ), + body: _Recipient( + address: recipients[i].address, + amount: ref + .watch(pAmountFormatter(cryptoCurrency)) + .format(recipients[i].amount), + ), ), - ], - ), - const SizedBox( - height: 12, - ), + ), + ], + ), + const SizedBox(height: 12), DetailItem( title: "Transaction fee", detail: ref @@ -160,38 +152,27 @@ class _FrostSendStep4State extends ConsumerState { .format(ref.watch(pFrostTxData)!.fee!), horizontal: true, ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), DetailItem( title: "Total", - detail: ref.watch(pAmountFormatter(cryptoCurrency)).format( + detail: ref + .watch(pAmountFormatter(cryptoCurrency)) + .format( ref.watch(pFrostTxData)!.fee! + recipients.map((e) => e.amount).reduce((v, e) => v += e), ), horizontal: true, ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), DetailItem( title: "Note", detail: ref.watch(pFrostTxData)!.note ?? "", ), - const SizedBox( - height: 12, - ), - DetailItem( - title: "Signers", - detail: signers, - ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), + DetailItem(title: "Signers", detail: signers), + const SizedBox(height: 12), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), PrimaryButton( label: "Approve transaction", onPressed: () async { @@ -205,12 +186,8 @@ class _FrostSendStep4State extends ConsumerState { final txData = await showLoading( whileFuture: ref .read(pWallets) - .getWallet( - ref.read(pFrostScaffoldArgs)!.walletId!, - ) - .confirmSend( - txData: ref.read(pFrostTxData)!, - ), + .getWallet(ref.read(pFrostScaffoldArgs)!.walletId!) + .confirmSend(txData: ref.read(pFrostTxData)!), context: context, message: "Broadcasting transaction to network", rootNavigator: true, // used to pop using root nav @@ -227,7 +204,10 @@ class _FrostSendStep4State extends ConsumerState { if (txData != null) { ref.read(pFrostScaffoldCanPopDesktop.notifier).state = true; ref.read(pFrostTxData.state).state = txData; - ref.read(pFrostScaffoldArgs)!.parentNav.popUntil( + ref + .read(pFrostScaffoldArgs)! + .parentNav + .popUntil( ModalRoute.withName( Util.isDesktop ? MyStackView.routeName @@ -237,17 +217,18 @@ class _FrostSendStep4State extends ConsumerState { } } } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (context.mounted) { return await showDialog( context: context, - builder: (_) => StackOkDialog( - title: "Broadcast error", - message: e.toString(), - desktopPopRootNavigator: Util.isDesktop, - onOkPressed: - Navigator.of(context, rootNavigator: true).pop, - ), + builder: + (_) => StackOkDialog( + title: "Broadcast error", + message: e.toString(), + desktopPopRootNavigator: Util.isDesktop, + onOkPressed: + Navigator.of(context, rootNavigator: true).pop, + ), ); } } finally { @@ -262,11 +243,7 @@ class _FrostSendStep4State extends ConsumerState { } class _Recipient extends StatelessWidget { - const _Recipient({ - super.key, - required this.address, - required this.amount, - }); + const _Recipient({super.key, required this.address, required this.amount}); final String address; final String amount; @@ -276,18 +253,9 @@ class _Recipient extends StatelessWidget { return Column( mainAxisSize: MainAxisSize.min, children: [ - DetailItem( - title: "Address", - detail: address, - ), - const SizedBox( - height: 6, - ), - DetailItem( - title: "Amount", - detail: amount, - horizontal: true, - ), + DetailItem(title: "Address", detail: address), + const SizedBox(height: 6), + DetailItem(title: "Amount", detail: amount, horizontal: true), ], ); } diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index e4c637e53e..923283bb70 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -242,9 +242,11 @@ class _SendViewState extends ConsumerState { }); } } catch (e) { + // strip http:// and https:// if content contains @ if (coin is Epiccash) { - // strip http:// and https:// if content contains @ content = AddressUtils().formatEpicCashAddress(content); + } else if (coin is Mimblewimblecoin) { + content = AddressUtils().formatAddressMwc(content); } await _checkSparkNameAndOrSetAddress(content); @@ -1281,7 +1283,6 @@ class _SendViewState extends ConsumerState { }); } -<<<<<<< Decimal? price; if (ref.watch(prefsChangeNotifierProvider.select((s) => s.externalCalls))) { price = ref.watch( @@ -1291,23 +1292,22 @@ class _SendViewState extends ConsumerState { ); } -======= - if (coin is Mimblewimblecoin) { - sendToController.addListener(() { - _address = sendToController.text.trim(); - - if (_address != null && _address!.isNotEmpty) { - _address = _address!.trim(); - if (_address!.contains("\n")) { - _address = _address!.substring(0, _address!.indexOf("\n")); - } - - sendToController.text = AddressUtils().formatAddress(_address!); - } - }); - } + // Probably not be needed. + // if (coin is Mimblewimblecoin) { + // sendToController.addListener(() { + // _address = sendToController.text.trim(); + // + // if (_address != null && _address!.isNotEmpty) { + // _address = _address!.trim(); + // if (_address!.contains("\n")) { + // _address = _address!.substring(0, _address!.indexOf("\n")); + // } + // + // sendToController.text = AddressUtils().formatAddressMwc(_address!); + // } + // }); + // } ->>>>>>> return Background( child: Scaffold( backgroundColor: Theme.of(context).extension()!.background, @@ -1621,7 +1621,6 @@ class _SendViewState extends ConsumerState { key: const Key( "sendViewPasteAddressFieldButtonKey", ), -<<<<<<< onTap: _pasteAddress, child: sendToController @@ -1629,63 +1628,6 @@ class _SendViewState extends ConsumerState { .isEmpty ? const ClipboardIcon() : const XIcon(), -======= - onTap: () async { - final ClipboardData? data = - await clipboard.getData( - Clipboard.kTextPlain, - ); - if (data?.text != null && - data! - .text!.isNotEmpty) { - String content = - data.text!.trim(); - if (content - .contains("\n")) { - content = - content.substring( - 0, - content.indexOf( - "\n", - ), - ); - } - - if (coin is Epiccash) { - // strip http:// and https:// if content contains @ - content = AddressUtils() - .formatAddress( - content, - ); - } - if (coin - is Mimblewimblecoin) { - // strip http:// and https:// if content contains @ - content = AddressUtils() - .formatAddress( - content, - ); - } - sendToController.text = - content.trim(); - _address = content.trim(); - - _setValidAddressProviders( - _address, - ); - setState(() { - _addressToggleFlag = - sendToController - .text - .isNotEmpty; - }); - } - }, - child: sendToController - .text.isEmpty - ? const ClipboardIcon() - : const XIcon(), ->>>>>>> ), if (sendToController.text.isEmpty) TextFieldIconButton( @@ -2288,15 +2230,8 @@ class _SendViewState extends ConsumerState { ), ), ), -<<<<<<< - if (coin is Epiccash) const SizedBox(height: 12), -======= - ), - const SizedBox( - height: 12, - ), - if (coin is Epiccash || coin is Mimblewimblecoin) ->>>>>>> + if (coin is Epiccash || coin is Mimblewimblecoin) + const SizedBox(height: 12), Text( (coin is Epiccash) ? "Local Note (optional)" @@ -2304,15 +2239,62 @@ class _SendViewState extends ConsumerState { style: STextStyles.smallMed12(context), textAlign: TextAlign.left, ), -<<<<<<< - const SizedBox(height: 8), -======= - if (coin is Epiccash || coin is Mimblewimblecoin) - const SizedBox( - height: 8, + if (coin is Epiccash || coin is Mimblewimblecoin) + const SizedBox(height: 8), + if (coin is Epiccash || coin is Mimblewimblecoin) + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: + Util.isDesktop ? false : true, + controller: noteController, + focusNode: _noteFocusNode, + style: STextStyles.field(context), + onChanged: (_) => setState(() {}), + decoration: standardInputDecoration( + "Type something...", + _noteFocusNode, + context, + ).copyWith( + suffixIcon: + noteController.text.isNotEmpty + ? Padding( + padding: const EdgeInsets.only( + right: 0, + ), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + noteController.text = + ""; + }); + }, + ), + ], + ), + ), + ) + : null, + ), + ), + ), + if (coin is Epiccash || coin is Mimblewimblecoin) + const SizedBox(height: 12), + Text( + (coin is Epiccash || coin is Mimblewimblecoin) + ? "Local Note (optional)" + : "Note (optional)", + style: STextStyles.smallMed12(context), + textAlign: TextAlign.left, ), - if (coin is Epiccash || coin is Mimblewimblecoin) ->>>>>>> + const SizedBox(height: 8), ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -2356,73 +2338,25 @@ class _SendViewState extends ConsumerState { ), ), ), -<<<<<<< const SizedBox(height: 12), - if (hasFees) + if (coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! NanoCurrency && + coin is! Tezos) Text( - "Transaction fee ${isEth - ? isCustomFee.value - ? "" - : "(max)" - : "(estimated)"}", + "Transaction fee (estimated)", style: STextStyles.smallMed12(context), textAlign: TextAlign.left, -======= - if (coin is Epiccash || coin is Mimblewimblecoin) - const SizedBox( - height: 12, - ), - Text( - (coin is Epiccash || coin is Mimblewimblecoin) - ? "Local Note (optional)" - : "Note (optional)", - style: STextStyles.smallMed12(context), - textAlign: TextAlign.left, - ), - const SizedBox( - height: 8, - ), - ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - child: TextField( - autocorrect: Util.isDesktop ? false : true, - enableSuggestions: Util.isDesktop ? false : true, - controller: noteController, - focusNode: _noteFocusNode, - style: STextStyles.field(context), - onChanged: (_) => setState(() {}), - decoration: standardInputDecoration( - "Type something...", - _noteFocusNode, - context, - ).copyWith( - suffixIcon: noteController.text.isNotEmpty - ? Padding( - padding: - const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - noteController.text = ""; - }); - }, - ), - ], - ), - ), - ) - : null, ->>>>>>> ), -<<<<<<< - if (hasFees) const SizedBox(height: 8), - if (hasFees) + if (coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! NanoCurrency && + coin is! Tezos) + const SizedBox(height: 8), + if (coin is! Epiccash && + coin is! Mimblewimblecoin && + coin is! NanoCurrency && + coin is! Tezos) Stack( children: [ TextField( @@ -2432,192 +2366,160 @@ class _SendViewState extends ConsumerState { controller: feeController, readOnly: true, textInputAction: TextInputAction.none, -======= - ), - ), - const SizedBox( - height: 12, - ), - if (coin is! Epiccash && - coin is! Mimblewimblecoin && - coin is! NanoCurrency && - coin is! Tezos) - Text( - "Transaction fee (estimated)", - style: STextStyles.smallMed12(context), - textAlign: TextAlign.left, - ), - if (coin is! Epiccash && - coin is! Mimblewimblecoin && - coin is! NanoCurrency && - coin is! Tezos) - const SizedBox( - height: 8, - ), - if (coin is! Epiccash && - coin is! Mimblewimblecoin && - coin is! NanoCurrency && - coin is! Tezos) - Stack( - children: [ - TextField( - autocorrect: Util.isDesktop ? false : true, - enableSuggestions: - Util.isDesktop ? false : true, - controller: feeController, - readOnly: true, - textInputAction: TextInputAction.none, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 12, ->>>>>>> ), Padding( padding: const EdgeInsets.symmetric( horizontal: 12, ), - child: RawMaterialButton( - splashColor: - Theme.of( - context, - ).extension()!.highlight, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 12, ), - onPressed: - isFiro && - ref - .watch( - publicPrivateBalanceStateProvider - .state, - ) - .state != - BalanceType.public - ? null - : _onFeeSelectPressed, - child: - (isFiro && - ref - .watch( - publicPrivateBalanceStateProvider - .state, - ) - .state != - BalanceType.public) - ? Row( - children: [ - FutureBuilder( - future: - _calculateFeesFuture, - builder: ( - context, - snapshot, - ) { - if (snapshot.connectionState == - ConnectionState - .done && - snapshot.hasData) { - _setCurrentFee( - snapshot.data!, - false, - ); - return Text( - "~${snapshot.data!}", - style: - STextStyles.itemSubtitle( - context, - ), - ); - } else { - return AnimatedText( - stringsToLoopThrough: - stringsToLoopThrough, - style: - STextStyles.itemSubtitle( - context, - ), - ); - } - }, - ), - ], - ) - : Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Row( - children: [ - Text( - ref + child: RawMaterialButton( + splashColor: + Theme.of(context) + .extension()! + .highlight, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + onPressed: + isFiro && + ref .watch( - feeRateTypeMobileStateProvider + publicPrivateBalanceStateProvider .state, ) - .state - .prettyName, - style: - STextStyles.itemSubtitle12( - context, - ), - ), - const SizedBox(width: 10), - FutureBuilder( - future: - _calculateFeesFuture, - builder: ( - context, - snapshot, - ) { - if (snapshot.connectionState == - ConnectionState - .done && - snapshot - .hasData) { - _setCurrentFee( - snapshot.data!, - false, - ); - return Text( - isCustomFee.value - ? "" - : "~${snapshot.data!}", - style: - STextStyles.itemSubtitle( - context, - ), - ); - } else { - return AnimatedText( - stringsToLoopThrough: - stringsToLoopThrough, - style: - STextStyles.itemSubtitle( - context, - ), - ); - } - }, - ), - ], - ), - SvgPicture.asset( - Assets.svg.chevronDown, - width: 8, - height: 4, - color: - Theme.of(context) - .extension< - StackColors - >()! - .textSubtitle2, - ), - ], - ), + .state != + BalanceType.public + ? null + : _onFeeSelectPressed, + child: + (isFiro && + ref + .watch( + publicPrivateBalanceStateProvider + .state, + ) + .state != + BalanceType.public) + ? Row( + children: [ + FutureBuilder( + future: + _calculateFeesFuture, + builder: ( + context, + snapshot, + ) { + if (snapshot.connectionState == + ConnectionState + .done && + snapshot.hasData) { + _setCurrentFee( + snapshot.data!, + false, + ); + return Text( + "~${snapshot.data!}", + style: + STextStyles.itemSubtitle( + context, + ), + ); + } else { + return AnimatedText( + stringsToLoopThrough: + stringsToLoopThrough, + style: + STextStyles.itemSubtitle( + context, + ), + ); + } + }, + ), + ], + ) + : Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Row( + children: [ + Text( + ref + .watch( + feeRateTypeMobileStateProvider + .state, + ) + .state + .prettyName, + style: + STextStyles.itemSubtitle12( + context, + ), + ), + const SizedBox( + width: 10, + ), + FutureBuilder( + future: + _calculateFeesFuture, + builder: ( + context, + snapshot, + ) { + if (snapshot.connectionState == + ConnectionState + .done && + snapshot + .hasData) { + _setCurrentFee( + snapshot.data!, + false, + ); + return Text( + isCustomFee + .value + ? "" + : "~${snapshot.data!}", + style: + STextStyles.itemSubtitle( + context, + ), + ); + } else { + return AnimatedText( + stringsToLoopThrough: + stringsToLoopThrough, + style: + STextStyles.itemSubtitle( + context, + ), + ); + } + }, + ), + ], + ), + SvgPicture.asset( + Assets.svg.chevronDown, + width: 8, + height: 4, + color: + Theme.of(context) + .extension< + StackColors + >()! + .textSubtitle2, + ), + ], + ), + ), ), ), ], 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 9cbc155329..88ed1a06fe 100644 --- a/lib/pages/settings_views/global_settings_view/about_view.dart +++ b/lib/pages/settings_views/global_settings_view/about_view.dart @@ -204,7 +204,6 @@ class AboutView extends ConsumerWidget { "Epic Cash Build Commit", style: STextStyles.titleBold12(context), ), -<<<<<<< const SizedBox(height: 4), SelectableText( GitStatus.epicCashCommit, @@ -219,136 +218,95 @@ class AboutView extends ConsumerWidget { }, ), const SizedBox(height: 12), -======= - ), - ], - ), - ); - }, - ), - if (AppConfig.coins - .whereType() - .isNotEmpty) - const SizedBox( - height: 12, - ), - if (AppConfig.coins - .whereType() - .isNotEmpty) - FutureBuilder( - future: GitStatus.getMimblewimblecoinCommitStatus(), - builder: ( - context, - AsyncSnapshot snapshot, - ) { - CommitStatus stateOfCommit = - CommitStatus.notLoaded; + if (AppConfig.coins + .whereType() + .isNotEmpty) + const SizedBox(height: 12), + if (AppConfig.coins + .whereType() + .isNotEmpty) + FutureBuilder( + future: + GitStatus.getMimblewimblecoinCommitStatus(), + builder: ( + context, + AsyncSnapshot snapshot, + ) { + CommitStatus stateOfCommit = + CommitStatus.notLoaded; - if (snapshot.connectionState == - ConnectionState.done && - snapshot.hasData) { - stateOfCommit = snapshot.data!; - } + if (snapshot.connectionState == + ConnectionState.done && + snapshot.hasData) { + stateOfCommit = snapshot.data!; + } - return RoundedWhiteContainer( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - Text( - "Mimblewimblecoin Build Commit", - style: STextStyles.titleBold12(context), - ), - const SizedBox( - height: 4, - ), - SelectableText( - GitStatus.mimblewimblecoinCommit, - style: GitStatus.styleForStatus( - stateOfCommit, - context, + return RoundedWhiteContainer( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + Text( + "Mimblewimblecoin Build Commit", + style: STextStyles.titleBold12(context), ), - ), - ], - ), - ); - }, - ), - if (AppConfig.coins.whereType().isNotEmpty) - const SizedBox( - height: 12, - ), - // if (AppConfig.coins.whereType().isNotEmpty) - // FutureBuilder( - // future: GitStatus.getMoneroCommitStatus(), - // builder: ( - // context, - // AsyncSnapshot snapshot, - // ) { - // CommitStatus stateOfCommit = - // CommitStatus.notLoaded; - // - // if (snapshot.connectionState == - // ConnectionState.done && - // snapshot.hasData) { - // stateOfCommit = snapshot.data!; - // } - // return RoundedWhiteContainer( - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.stretch, - // children: [ - // Text( - // "Monero Build Commit", - // style: STextStyles.titleBold12(context), - // ), - // const SizedBox( - // height: 4, - // ), - // SelectableText( - // GitStatus.moneroCommit, - // style: GitStatus.styleForStatus( - // stateOfCommit, - // context, - // ), - // ), - // ], - // ), - // ); - // }, - // ), - // const SizedBox( - // height: 12, - // ), - RoundedWhiteContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Website", - style: STextStyles.titleBold12(context), - ), - const SizedBox( - height: 4, - ), - CustomTextButton( - text: "https://stackwallet.com", - onTap: () { - launchUrl( - Uri.parse("https://stackwallet.com"), - mode: LaunchMode.externalApplication, - ); - }, - ), - ], - ), - ), - if (AppConfig.coins.whereType().isNotEmpty) - const SizedBox( - height: 12, - ), - if (AppConfig.coins.whereType().isNotEmpty) ->>>>>>> + const SizedBox(height: 4), + SelectableText( + GitStatus.mimblewimblecoinCommit, + style: GitStatus.styleForStatus( + stateOfCommit, + context, + ), + ), + ], + ), + ); + }, + ), + if (AppConfig.coins.whereType().isNotEmpty) + const SizedBox(height: 12), + // if (AppConfig.coins.whereType().isNotEmpty) + // FutureBuilder( + // future: GitStatus.getMoneroCommitStatus(), + // builder: ( + // context, + // AsyncSnapshot snapshot, + // ) { + // CommitStatus stateOfCommit = + // CommitStatus.notLoaded; + // + // if (snapshot.connectionState == + // ConnectionState.done && + // snapshot.hasData) { + // stateOfCommit = snapshot.data!; + // } + // return RoundedWhiteContainer( + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.stretch, + // children: [ + // Text( + // "Monero Build Commit", + // style: STextStyles.titleBold12(context), + // ), + // const SizedBox( + // height: 4, + // ), + // SelectableText( + // GitStatus.moneroCommit, + // style: GitStatus.styleForStatus( + // stateOfCommit, + // context, + // ), + // ), + // ], + // ), + // ); + // }, + // ), + // const SizedBox( + // height: 12, + // ), RoundedWhiteContainer( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -370,6 +328,30 @@ class AboutView extends ConsumerWidget { ], ), ), + if (AppConfig.coins.whereType().isNotEmpty) + const SizedBox(height: 12), + if (AppConfig.coins.whereType().isNotEmpty) + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Website", + style: STextStyles.titleBold12(context), + ), + const SizedBox(height: 4), + CustomTextButton( + text: "https://stackwallet.com", + onTap: () { + launchUrl( + Uri.parse("https://stackwallet.com"), + mode: LaunchMode.externalApplication, + ); + }, + ), + ], + ), + ), if (AppConfig.coins.whereType().isNotEmpty) const SizedBox(height: 12), if (AppConfig.coins.whereType().isNotEmpty) 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 e1f263d3b2..a178dddab9 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 @@ -476,7 +476,7 @@ abstract class SWB { case const (EpiccashWallet): await (wallet as EpiccashWallet).init(isRestore: true); break; - + case const (MimblewimblecoinWallet): await (wallet as MimblewimblecoinWallet).init(isRestore: true); break; @@ -499,13 +499,10 @@ abstract class SWB { int restoreHeight = walletbackup['restoreHeight'] as int? ?? 0; if (restoreHeight <= 0) { -<<<<<<< if (wallet is EpiccashWallet || wallet is LibMoneroWallet || - wallet is LibSalviumWallet) { -======= - if (wallet is EpiccashWallet || wallet is MimblewimblecoinWallet || wallet is LibMoneroWallet) { ->>>>>>> + wallet is LibSalviumWallet || + wallet is MimblewimblecoinWallet) { restoreHeight = 0; } else { restoreHeight = walletbackup['storedChainHeight'] as int? ?? 0; diff --git a/lib/pages/settings_views/wallet_settings_view/frost_ms/frost_participants_view.dart b/lib/pages/settings_views/wallet_settings_view/frost_ms/frost_participants_view.dart index a0b502da24..71064a134b 100644 --- a/lib/pages/settings_views/wallet_settings_view/frost_ms/frost_participants_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/frost_ms/frost_participants_view.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import '../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart'; + import '../../../../pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; import '../../../../providers/db/main_db_provider.dart'; import '../../../../themes/stack_colors.dart'; @@ -15,12 +15,11 @@ import '../../../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../../../widgets/desktop/desktop_app_bar.dart'; import '../../../../widgets/desktop/desktop_scaffold.dart'; import '../../../../widgets/rounded_white_container.dart'; +import '../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart' + as tdv; class FrostParticipantsView extends ConsumerWidget { - const FrostParticipantsView({ - super.key, - required this.walletId, - }); + const FrostParticipantsView({super.key, required this.walletId}); static const String routeName = "/frostParticipantsView"; @@ -29,74 +28,73 @@ class FrostParticipantsView extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { // TODO: optimize this by creating watcher providers (similar to normal WalletInfo) - final frostInfo = ref - .read(mainDBProvider) - .isar - .frostWalletInfo - .getByWalletIdSync(walletId)!; + final frostInfo = + ref + .read(mainDBProvider) + .isar + .frostWalletInfo + .getByWalletIdSync(walletId)!; return ConditionalParent( condition: Util.isDesktop, - builder: (child) => DesktopScaffold( - background: Theme.of(context).extension()!.background, - appBar: const DesktopAppBar( - isCompactHeight: false, - leading: AppBarBackButton(), - trailing: ExitToMyStackButton(), - ), - body: SizedBox( - width: 480, - child: child, - ), - ), + builder: + (child) => DesktopScaffold( + background: Theme.of(context).extension()!.background, + appBar: const DesktopAppBar( + isCompactHeight: false, + leading: AppBarBackButton(), + trailing: ExitToMyStackButton(), + ), + body: SizedBox(width: 480, 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( - "Participants", - style: STextStyles.navBarTitle(context), - ), - ), - body: SafeArea( - child: LayoutBuilder( - builder: (context, constraints) { - return SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: constraints.maxHeight, - ), - child: IntrinsicHeight( - child: Padding( - padding: const EdgeInsets.all(16), - child: child, + builder: + (child) => Background( + child: Scaffold( + backgroundColor: + Theme.of(context).extension()!.background, + appBar: AppBar( + leading: AppBarBackButton( + onPressed: () { + Navigator.of(context).pop(); + }, + ), + title: Text( + "Participants", + style: STextStyles.navBarTitle(context), + ), + ), + body: SafeArea( + child: LayoutBuilder( + builder: (context, constraints) { + return SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight, + ), + child: IntrinsicHeight( + child: Padding( + padding: const EdgeInsets.all(16), + child: child, + ), + ), ), - ), - ), - ); - }, + ); + }, + ), + ), ), ), - ), - ), child: Column( - crossAxisAlignment: Util.isDesktop - ? CrossAxisAlignment.start - : CrossAxisAlignment.stretch, + crossAxisAlignment: + Util.isDesktop + ? CrossAxisAlignment.start + : CrossAxisAlignment.stretch, children: [ for (int i = 0; i < frostInfo.participants.length; i++) Padding( - padding: const EdgeInsets.symmetric( - vertical: 5, - ), + padding: const EdgeInsets.symmetric(vertical: 5), child: RoundedWhiteContainer( child: Row( children: [ @@ -104,12 +102,11 @@ class FrostParticipantsView extends ConsumerWidget { width: 26, height: 26, decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldActiveBG, - borderRadius: BorderRadius.circular( - 200, - ), + color: + Theme.of( + context, + ).extension()!.textFieldActiveBG, + borderRadius: BorderRadius.circular(200), ), child: Center( child: SvgPicture.asset( @@ -119,9 +116,7 @@ class FrostParticipantsView extends ConsumerWidget { ), ), ), - const SizedBox( - width: 8, - ), + const SizedBox(width: 8), Expanded( child: Text( frostInfo.participants[i] == frostInfo.myName @@ -130,12 +125,8 @@ class FrostParticipantsView extends ConsumerWidget { style: STextStyles.w500_14(context), ), ), - const SizedBox( - width: 8, - ), - IconCopyButton( - data: frostInfo.participants[i], - ), + const SizedBox(width: 8), + tdv.IconCopyButton(data: frostInfo.participants[i]), ], ), ), 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 d94cca0882..dded7630c0 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 @@ -39,7 +39,8 @@ import '../../../../widgets/qr.dart'; import '../../../../widgets/rounded_white_container.dart'; import '../../../../widgets/stack_dialog.dart'; import '../../../add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart'; -import '../../../wallet_view/transaction_views/transaction_details_view.dart'; +import '../../../wallet_view/transaction_views/transaction_details_view.dart' + as tdv; import '../../sub_widgets/view_only_wallet_data_widget.dart'; import 'cn_wallet_keys.dart'; import 'wallet_xprivs.dart'; @@ -323,7 +324,7 @@ class _FrostKeys extends StatelessWidget { detail: frostWalletData!.config, button: Util.isDesktop - ? IconCopyButton(data: frostWalletData!.config) + ? tdv.IconCopyButton(data: frostWalletData!.config) : SimpleCopyButton(data: frostWalletData!.config), ), const SizedBox(height: 16), @@ -332,7 +333,7 @@ class _FrostKeys extends StatelessWidget { detail: frostWalletData!.keys, button: Util.isDesktop - ? IconCopyButton(data: frostWalletData!.keys) + ? tdv.IconCopyButton(data: frostWalletData!.keys) : SimpleCopyButton(data: frostWalletData!.keys), ), if (prevGen) const SizedBox(height: 24), @@ -350,7 +351,7 @@ class _FrostKeys extends StatelessWidget { detail: frostWalletData!.prevGen!.config, button: Util.isDesktop - ? IconCopyButton( + ? tdv.IconCopyButton( data: frostWalletData!.prevGen!.config, ) : SimpleCopyButton( @@ -364,7 +365,7 @@ class _FrostKeys extends StatelessWidget { detail: frostWalletData!.prevGen!.keys, button: Util.isDesktop - ? IconCopyButton( + ? tdv.IconCopyButton( data: frostWalletData!.prevGen!.keys, ) : SimpleCopyButton( 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 95a081d85f..75b121ff36 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 @@ -33,26 +33,18 @@ import '../../../../utilities/constants.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; import '../../../../wallets/crypto_currency/coins/epiccash.dart'; -<<<<<<< import '../../../../wallets/crypto_currency/coins/litecoin.dart'; -======= import '../../../../wallets/crypto_currency/coins/mimblewimblecoin.dart'; ->>>>>>> import '../../../../wallets/crypto_currency/coins/monero.dart'; import '../../../../wallets/crypto_currency/coins/salvium.dart'; import '../../../../wallets/crypto_currency/coins/wownero.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/epiccash_wallet.dart'; -<<<<<<< +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/impl/salvium_wallet.dart'; import '../../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart'; -======= -import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; -import '../../../../wallets/wallet/impl/monero_wallet.dart'; -import '../../../../wallets/wallet/impl/wownero_wallet.dart'; ->>>>>>> import '../../../../widgets/animated_text.dart'; import '../../../../widgets/background.dart'; import '../../../../widgets/conditional_parent.dart'; @@ -282,20 +274,14 @@ class _WalletNetworkSettingsViewState final coin = ref.read(pWalletCoin(widget.walletId)); -<<<<<<< // TODO: handle isMwebEnabled toggled if (coin is Monero || coin is Wownero || coin is Epiccash || coin is Salvium || + coin is Mimblewimblecoin || (coin is Litecoin && ref.read(pWalletInfo(widget.walletId)).isMwebEnabled)) { -======= - if (coin is Monero || - coin is Wownero || - coin is Epiccash || - coin is Mimblewimblecoin) { ->>>>>>> _blocksRemainingSubscription = eventBus.on().listen( (event) async { if (event.walletId == widget.walletId) { @@ -384,10 +370,10 @@ class _WalletNetworkSettingsViewState _percent = highestPercent.clamp(0.0, 1.0); } } else if (coin is Mimblewimblecoin) { - final double highestPercent = (ref - .watch(pWallets) - .getWallet(widget.walletId) as MimblewimblecoinWallet) - .highestPercent; + final double highestPercent = + (ref.watch(pWallets).getWallet(widget.walletId) + as MimblewimblecoinWallet) + .highestPercent; if (_percent < highestPercent) { _percent = highestPercent.clamp(0.0, 1.0); } @@ -682,19 +668,15 @@ class _WalletNetworkSettingsViewState ), if (coin is Monero || coin is Wownero || -<<<<<<< coin is Epiccash || coin is Salvium || + coin is Mimblewimblecoin || (coin is Litecoin && ref.watch( pWalletInfo( widget.walletId, ).select((s) => s.isMwebEnabled), ))) -======= - coin is Mimblewimblecoin || - coin is Epiccash) ->>>>>>> Text( " (Blocks to go: ${_blocksRemaining == -1 ? "?" : _blocksRemaining})", style: STextStyles.syncPercent( @@ -1024,21 +1006,13 @@ class _WalletNetworkSettingsViewState coin: ref.watch(pWalletCoin(widget.walletId)), popBackToRoute: WalletNetworkSettingsView.routeName, ), -<<<<<<< - if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) - const SizedBox(height: 32), - if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash) -======= if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) - const SizedBox( - height: 32, - ), + const SizedBox(height: 32), if (isDesktop && ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) ->>>>>>> Padding( padding: const EdgeInsets.only(bottom: 12), child: Row( 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 03ba8cdf0e..2bcf90827f 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 @@ -35,7 +35,8 @@ import '../../../../widgets/rounded_white_container.dart'; import '../../../../widgets/stack_dialog.dart'; import '../../../add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart'; import '../../../home_view/home_view.dart'; -import '../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart'; +import '../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart' + as tdv; class DeleteWalletRecoveryPhraseView extends ConsumerStatefulWidget { const DeleteWalletRecoveryPhraseView({ @@ -236,7 +237,7 @@ class _DeleteWalletRecoveryPhraseViewState detail: widget.frostWalletData!.config, button: Util.isDesktop - ? IconCopyButton( + ? tdv.IconCopyButton( data: widget .frostWalletData! @@ -255,7 +256,7 @@ class _DeleteWalletRecoveryPhraseViewState detail: widget.frostWalletData!.keys, button: Util.isDesktop - ? IconCopyButton( + ? tdv.IconCopyButton( data: widget.frostWalletData!.keys, ) @@ -283,7 +284,7 @@ class _DeleteWalletRecoveryPhraseViewState .config, button: Util.isDesktop - ? IconCopyButton( + ? tdv.IconCopyButton( data: widget .frostWalletData! @@ -306,7 +307,7 @@ class _DeleteWalletRecoveryPhraseViewState widget.frostWalletData!.prevGen!.keys, button: Util.isDesktop - ? IconCopyButton( + ? tdv.IconCopyButton( data: widget .frostWalletData! diff --git a/lib/pages/spark_names/sub_widgets/spark_name_details.dart b/lib/pages/spark_names/sub_widgets/spark_name_details.dart index 97983735ab..372f7484e6 100644 --- a/lib/pages/spark_names/sub_widgets/spark_name_details.dart +++ b/lib/pages/spark_names/sub_widgets/spark_name_details.dart @@ -17,7 +17,8 @@ import '../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../widgets/desktop/primary_button.dart'; import '../../../widgets/dialogs/s_dialog.dart'; import '../../../widgets/rounded_container.dart'; -import '../../wallet_view/transaction_views/transaction_details_view.dart'; +import '../../wallet_view/transaction_views/transaction_details_view.dart' + as tvd; import '../buy_spark_name_view.dart'; class SparkNameDetailsView extends ConsumerStatefulWidget { @@ -288,7 +289,7 @@ class _SparkNameDetailsViewState extends ConsumerState { ), ), Util.isDesktop - ? IconCopyButton(data: name.address) + ? tvd.IconCopyButton(data: name.address) : SimpleCopyButton(data: name.address), ], ), @@ -344,7 +345,9 @@ class _SparkNameDetailsViewState extends ConsumerState { ), ), Util.isDesktop - ? IconCopyButton(data: label!.value) + ? tvd.IconCopyButton( + data: label!.value, + ) : SimpleCopyButton( data: label!.value, ), 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 9f8575e999..397fd7d798 100644 --- a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart +++ b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart @@ -22,7 +22,6 @@ import '../../../models/isar/models/contact_entry.dart'; import '../../../models/isar/models/transaction_note.dart'; import '../../../models/transaction_filter.dart'; import '../../../notifications/show_flush_bar.dart'; -import '../../../providers/db/main_db_provider.dart'; import '../../../providers/global/address_book_service_provider.dart'; import '../../../providers/providers.dart'; import '../../../providers/ui/transaction_filter_provider.dart'; @@ -49,7 +48,7 @@ import '../../../widgets/stack_text_field.dart'; import '../../../widgets/textfield_icon_button.dart'; import '../../../widgets/transaction_card.dart'; import '../sub_widgets/tx_icon.dart'; -import 'transaction_details_view.dart'; +import 'transaction_details_view.dart' as tvd; import 'transaction_search_filter_view.dart'; typedef _GroupedTransactions = @@ -978,7 +977,7 @@ class _DesktopTransactionCardRowState (context) => DesktopDialog( maxHeight: MediaQuery.of(context).size.height - 64, maxWidth: 580, - child: TransactionDetailsView( + child: tvd.TransactionDetailsView( transaction: _transaction, coin: coin, walletId: walletId, @@ -988,7 +987,7 @@ class _DesktopTransactionCardRowState } else { unawaited( Navigator.of(context).pushNamed( - TransactionDetailsView.routeName, + tvd.TransactionDetailsView.routeName, arguments: Tuple3(_transaction, coin, walletId), ), ); 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 1d01598996..ca997e70b6 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -1770,9 +1770,8 @@ class _TransactionDetailsViewState ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, -<<<<<<< floatingActionButton: - (coin is Epiccash && + ((coin is Epiccash || coin is Mimblewimblecoin) && _transaction.getConfirmations(currentHeight) < 1 && _transaction.isCancelled == false) ? ConditionalParent( @@ -1784,26 +1783,6 @@ class _TransactionDetailsViewState vertical: 16, ), child: child, -======= - floatingActionButton: ((coin is Epiccash || coin is Mimblewimblecoin) && - _transaction.getConfirmations(currentHeight) < 1 && - _transaction.isCancelled == false) - ? ConditionalParent( - condition: isDesktop, - builder: (child) => Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 16, - ), - child: child, - ), - child: SizedBox( - width: MediaQuery.of(context).size.width - 32, - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Theme.of(context).extension()!.textError, ->>>>>>> ), child: SizedBox( width: MediaQuery.of(context).size.width - 32, @@ -1845,6 +1824,62 @@ class _TransactionDetailsViewState // pop progress dialog Navigator.of(context).pop(); + if (result.isEmpty) { + await showDialog( + context: context, + builder: + (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + wallet.refresh(); + Navigator.of(context).popUntil( + ModalRoute.withName( + WalletView.routeName, + ), + ); + }, + ), + ); + } else { + await showDialog( + context: context, + builder: + (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + ), + ); + } + } + } else if (wallet is MimblewimblecoinWallet) { + final String? id = _transaction.slateId; + if (id == null) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Could not find MWC transaction ID", + context: context, + ), + ); + return; + } + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: + (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = await wallet + .cancelPendingTransactionAndPost(id); + if (mounted) { + // pop progress dialog + Navigator.of(context).pop(); + if (result.isEmpty) { await showDialog( context: context, @@ -1876,87 +1911,18 @@ class _TransactionDetailsViewState unawaited( showFloatingFlushBar( type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash", + message: + "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", context: context, ), ); return; } -<<<<<<< }, child: Text( "Cancel Transaction", style: STextStyles.button(context), ), -======= - } else if (wallet is MimblewimblecoinWallet) { - final String? id = _transaction.slateId; - if (id == null) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Could not find MWC transaction ID", - context: context, - ), - ); - return; - } - - unawaited( - showDialog( - barrierDismissible: false, - context: context, - builder: (_) => - const CancellingTransactionProgressDialog(), - ), - ); - - final result = - await wallet.cancelPendingTransactionAndPost(id); - if (mounted) { - // pop progress dialog - Navigator.of(context).pop(); - - if (result.isEmpty) { - await showDialog( - context: context, - builder: (_) => StackOkDialog( - title: "Transaction cancelled", - onOkPressed: (_) { - wallet.refresh(); - Navigator.of(context).popUntil( - ModalRoute.withName( - WalletView.routeName, - ), - ); - }, - ), - ); - } else { - await showDialog( - context: context, - builder: (_) => StackOkDialog( - title: "Failed to cancel transaction", - message: result, - ), - ); - } - } - } else { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", - context: context, - ), - ); - return; - } - }, - child: Text( - "Cancel Transaction", - style: STextStyles.button(context), ->>>>>>> ), ), ) diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart index 3532646000..b4b95f1cb1 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart @@ -21,7 +21,6 @@ import '../../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; import '../../../../models/isar/models/contact_entry.dart'; import '../../../../models/isar/models/isar_models.dart'; import '../../../../models/transaction_filter.dart'; -import '../../../../providers/db/main_db_provider.dart'; import '../../../../providers/global/address_book_service_provider.dart'; import '../../../../providers/providers.dart'; import '../../../../providers/ui/transaction_filter_provider.dart'; @@ -51,7 +50,7 @@ import '../../../../widgets/textfield_icon_button.dart'; import '../../sub_widgets/tx_icon.dart'; import '../transaction_search_filter_view.dart'; import 'transaction_v2_card.dart'; -import 'transaction_v2_details_view.dart'; +import 'transaction_v2_details_view.dart' as tvd; typedef _GroupedTransactions = ({String label, DateTime startDate, List transactions}); @@ -992,7 +991,7 @@ class _DesktopTransactionCardRowState (context) => DesktopDialog( maxHeight: MediaQuery.of(context).size.height - 64, maxWidth: 580, - child: TransactionV2DetailsView( + child: tvd.TransactionV2DetailsView( transaction: _transaction, coin: coin, walletId: walletId, @@ -1002,7 +1001,7 @@ class _DesktopTransactionCardRowState } else { unawaited( Navigator.of(context).pushNamed( - TransactionV2DetailsView.routeName, + tvd.TransactionV2DetailsView.routeName, arguments: (tx: _transaction, coin: coin, walletId: walletId), ), ); diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_card.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_card.dart index 3fb0aaaab4..a8b30fd5ae 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_card.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_card.dart @@ -25,7 +25,7 @@ import '../../../../widgets/coin_ticker_tag.dart'; import '../../../../widgets/conditional_parent.dart'; import '../../../../widgets/desktop/desktop_dialog.dart'; import '../../sub_widgets/tx_icon.dart'; -import 'transaction_v2_details_view.dart'; +import 'transaction_v2_details_view.dart' as tvd; class TransactionCardV2 extends ConsumerStatefulWidget { const TransactionCardV2({super.key, required this.transaction}); @@ -200,7 +200,7 @@ class _TransactionCardStateV2 extends ConsumerState { (context) => DesktopDialog( maxHeight: MediaQuery.of(context).size.height - 64, maxWidth: 580, - child: TransactionV2DetailsView( + child: tvd.TransactionV2DetailsView( transaction: _transaction, coin: coin, walletId: walletId, @@ -210,7 +210,7 @@ class _TransactionCardStateV2 extends ConsumerState { } else { unawaited( Navigator.of(context).pushNamed( - TransactionV2DetailsView.routeName, + tvd.TransactionV2DetailsView.routeName, arguments: (tx: _transaction, coin: coin, walletId: walletId), ), ); diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index 89ec1299dc..e57a1f33d7 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -1228,7 +1228,7 @@ class _TransactionV2DetailsViewState padding: isDesktop ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), +e : const EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/route_generator.dart b/lib/route_generator.dart index ee09bdba0a..4c5e16ccfd 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -165,7 +165,8 @@ import 'pages/wallet_view/transaction_views/transaction_search_filter_view.dart' import 'pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart'; import 'pages/wallet_view/transaction_views/tx_v2/boost_transaction_view.dart'; import 'pages/wallet_view/transaction_views/tx_v2/fusion_group_details_view.dart'; -import 'pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart'; +import 'pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart' + as tvd; import 'pages/wallet_view/wallet_view.dart'; import 'pages/wallets_view/wallets_overview.dart'; import 'pages/wallets_view/wallets_view.dart'; @@ -1614,13 +1615,13 @@ class RouteGenerator { } return _routeError("${settings.name} invalid args: ${args.toString()}"); - case TransactionV2DetailsView.routeName: + case tvd.TransactionV2DetailsView.routeName: if (args is ({TransactionV2 tx, CryptoCurrency coin, String walletId})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, builder: - (_) => TransactionV2DetailsView( + (_) => tvd.TransactionV2DetailsView( transaction: args.tx, coin: args.coin, walletId: args.walletId, diff --git a/lib/services/wallets.dart b/lib/services/wallets.dart index 3bfcb96b97..0f478d6ddc 100644 --- a/lib/services/wallets.dart +++ b/lib/services/wallets.dart @@ -26,9 +26,9 @@ import '../wallets/crypto_currency/crypto_currency.dart'; import '../wallets/crypto_currency/intermediate/cryptonote_currency.dart'; import '../wallets/isar/models/wallet_info.dart'; import '../wallets/wallet/impl/epiccash_wallet.dart'; +import '../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../wallets/wallet/intermediate/lib_salvium_wallet.dart'; -import '../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../wallets/wallet/wallet.dart'; import 'event_bus/events/wallet_added_event.dart'; import 'event_bus/global_event_bus.dart'; @@ -138,9 +138,8 @@ class Wallets { walletId: walletId, secureStore: secureStorage, ); - Logging.instance.log( + Logging.instance.i( "Mimblewimblecoin wallet: $walletId deleted with result: $deleteResult", - level: LogLevel.Info, ); } diff --git a/lib/utilities/test_mwcmqs_connection.dart b/lib/utilities/test_mwcmqs_connection.dart index cfcd4a098f..c0615b25da 100644 --- a/lib/utilities/test_mwcmqs_connection.dart +++ b/lib/utilities/test_mwcmqs_connection.dart @@ -18,10 +18,8 @@ import 'prefs.dart'; Future _testMwcMqsNodeConnection(Uri uri) async { final HTTP client = HTTP(); - try { - final headers = { - 'Content-Type': 'application/json', - }; + try { + final headers = {'Content-Type': 'application/json'}; if (uri.toString() == 'https://mwc713.mwc.mw/v1/version') { const username = 'mwcmain'; @@ -33,9 +31,10 @@ Future _testMwcMqsNodeConnection(Uri uri) async { .get( url: uri, headers: headers, - proxyInfo: Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: + Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ) .timeout( const Duration(milliseconds: 2000), @@ -50,7 +49,7 @@ Future _testMwcMqsNodeConnection(Uri uri) async { return false; } } catch (e, s) { - Logging.instance.log("$e\n$s", level: LogLevel.Warning); + Logging.instance.w("$e\n$s"); return false; } } @@ -77,7 +76,7 @@ Future testMwcNodeConnection(NodeFormData data) async { Uri uri = Uri.parse(data.host! + path_postfix); uri = uri.replace(port: data.port); - + try { if (await _testMwcMqsNodeConnection(uri)) { return data; @@ -85,7 +84,7 @@ Future testMwcNodeConnection(NodeFormData data) async { return null; } } catch (e, s) { - Logging.instance.log("$e\n$s", level: LogLevel.Warning); + Logging.instance.w("$e\n$s"); return null; } } diff --git a/lib/utilities/test_node_connection.dart b/lib/utilities/test_node_connection.dart index 5b4d559d86..8491ca3db5 100644 --- a/lib/utilities/test_node_connection.dart +++ b/lib/utilities/test_node_connection.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:on_chain/ada/ada.dart'; import 'package:socks5_proxy/socks.dart'; +import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; import '../networking/http.dart'; import '../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; @@ -21,22 +22,17 @@ import '../wallets/wallet/impl/solana_wallet.dart'; import 'connection_check/electrum_connection_check.dart'; import 'logger.dart'; import 'test_epic_box_connection.dart'; -import 'test_mwcmqs_connection.dart'; import 'test_eth_node_connection.dart'; import 'test_monero_node_connection.dart'; +import 'test_mwcmqs_connection.dart'; import 'test_stellar_node_connection.dart'; import 'tor_plain_net_option_enum.dart'; -import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; - Future _xmrHelper( NodeFormData nodeFormData, BuildContext context, void Function(NodeFormData)? onSuccess, - ({ - InternetAddress host, - int port, - })? proxyInfo, + ({InternetAddress host, int port})? proxyInfo, ) async { final data = nodeFormData; final url = data.host!; @@ -129,11 +125,7 @@ Future testNodeConnection({ onSuccess?.call(data); } } catch (e, s) { - Logging.instance.w( - "$e\n$s", - error: e, - stackTrace: s, - ); + Logging.instance.w("$e\n$s", error: e, stackTrace: s); } break; @@ -146,15 +138,16 @@ Future testNodeConnection({ onSuccess?.call(data); } } catch (e, s) { - Logging.instance.log("$e\n$s", level: LogLevel.Warning); + Logging.instance.w("$e\n$s"); } break; case CryptonoteCurrency(): try { - final proxyInfo = ref.read(prefsChangeNotifierProvider).useTor - ? ref.read(pTorService).getProxyInfo() - : null; + final proxyInfo = + ref.read(prefsChangeNotifierProvider).useTor + ? ref.read(pTorService).getProxyInfo() + : null; final url = formData.host!; final uri = Uri.tryParse(url); @@ -193,11 +186,7 @@ Future testNodeConnection({ } } } catch (e, s) { - Logging.instance.w( - "$e\n$s", - error: e, - stackTrace: s, - ); + Logging.instance.w("$e\n$s", error: e, stackTrace: s); } break; @@ -228,8 +217,10 @@ Future testNodeConnection({ case Stellar(): try { - testPassed = - await testStellarNodeConnection(formData.host!, formData.port!); + testPassed = await testStellarNodeConnection( + formData.host!, + formData.port!, + ); } catch (_) {} break; @@ -240,14 +231,11 @@ Future testNodeConnection({ final response = await HTTP().post( url: uri, headers: {"Content-Type": "application/json"}, - body: jsonEncode( - { - "action": "version", - }, - ), - proxyInfo: ref.read(prefsChangeNotifierProvider).useTor - ? ref.read(pTorService).getProxyInfo() - : null, + body: jsonEncode({"action": "version"}), + proxyInfo: + ref.read(prefsChangeNotifierProvider).useTor + ? ref.read(pTorService).getProxyInfo() + : null, ); testPassed = response.code == 200; @@ -273,9 +261,7 @@ Future testNodeConnection({ ); final health = await rpcClient.getHealth(); - Logging.instance.i( - "Solana testNodeConnection \"health=$health\"", - ); + Logging.instance.i("Solana testNodeConnection \"health=$health\""); return true; } catch (_) { testPassed = false; @@ -287,10 +273,7 @@ Future testNodeConnection({ final client = HttpClient(); if (ref.read(prefsChangeNotifierProvider).useTor) { final proxyInfo = TorService.sharedInstance.getProxyInfo(); - final proxySettings = ProxySettings( - proxyInfo.host, - proxyInfo.port, - ); + final proxySettings = ProxySettings(proxyInfo.host, proxyInfo.port); SocksTCPClient.assignToHttpClient(client, [proxySettings]); } final blockfrostProvider = BlockforestProvider( @@ -304,9 +287,7 @@ Future testNodeConnection({ BlockfrostRequestBackendHealthStatus(), ); - Logging.instance.i( - "Cardano testNodeConnection \"health=$health\"", - ); + Logging.instance.i("Cardano testNodeConnection \"health=$health\""); return health; } catch (_) { @@ -319,7 +300,7 @@ Future testNodeConnection({ final daemon = xelis_sdk.DaemonClient( endPoint: "${formData.host!}:${formData.port!}", secureWebSocket: formData.useSSL ?? false, - timeout: 5000 + timeout: 5000, ); daemon.connect(); diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index cd0066828e..4dd1138062 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -64,7 +64,7 @@ bool validateAddress(String address) { @override - NodeModel get defaultNode { + NodeModel defaultNode({required bool isPrimary}) { switch (network) { case CryptoCurrencyNetwork.main: return NodeModel( @@ -79,6 +79,7 @@ bool validateAddress(String address) { isDown: false, torEnabled: true, clearnetEnabled: true, + isPrimary: isPrimary, ); default: diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 31339e2fcb..1a349a777b 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -13,12 +13,12 @@ import 'package:stack_wallet_backup/generate_password.dart'; import 'package:web_socket_channel/web_socket_channel.dart'; import '../../../models/balance.dart'; -import '../../../models/mwcmqs_config_model.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; import '../../../models/isar/models/blockchain_data/v2/input_v2.dart'; import '../../../models/isar/models/blockchain_data/v2/output_v2.dart'; import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; +import '../../../models/mwcmqs_config_model.dart'; import '../../../models/node_model.dart'; import '../../../models/paymint/fee_object_model.dart'; import '../../../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; @@ -28,41 +28,42 @@ import '../../../services/event_bus/events/global/refresh_percent_changed_event. import '../../../services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import '../../../services/event_bus/global_event_bus.dart'; import '../../../utilities/amount/amount.dart'; +import '../../../utilities/default_mwcmqs.dart'; import '../../../utilities/flutter_secure_storage_interface.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; -import '../../../utilities/default_mwcmqs.dart'; import '../../../utilities/test_mwcmqs_connection.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../models/tx_data.dart'; import '../intermediate/bip39_wallet.dart'; import '../supporting/mimblewimblecoin_wallet_info_extension.dart'; - class MimblewimblecoinWallet extends Bip39Wallet { MimblewimblecoinWallet(CryptoCurrencyNetwork network) - : super(Mimblewimblecoin(network)); + : super(Mimblewimblecoin(network)); final syncMutex = Mutex(); NodeModel? _mimblewimblecoinNode; Timer? timer; bool _logsInitialized = false; - + double highestPercent = 0; Future get getSyncPercent async { final int lastScannedBlock = info.mimblewimblecoinData?.lastScannedBlock ?? 0; final _chainHeight = await chainHeight; final double restorePercent = lastScannedBlock / _chainHeight; - GlobalEventBus.instance - .fire(RefreshPercentChangedEvent(highestPercent, walletId)); + GlobalEventBus.instance.fire( + RefreshPercentChangedEvent(highestPercent, walletId), + ); if (restorePercent > highestPercent) { highestPercent = restorePercent; } final int blocksRemaining = _chainHeight - lastScannedBlock; - GlobalEventBus.instance - .fire(BlocksRemainingEvent(blocksRemaining, walletId)); + GlobalEventBus.instance.fire( + BlocksRemainingEvent(blocksRemaining, walletId), + ); return restorePercent < 0 ? 0.0 : restorePercent; } @@ -70,7 +71,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Future updateMwcmqsConfig(String host, int port) async { final String stringConfig = jsonEncode({ "mwcmqs_domain": host, - "mwcmqs_port": port + "mwcmqs_port": port, }); await secureStorageInterface.write( key: '${walletId}_mwcmqsConfig', @@ -82,21 +83,17 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// returns an empty String on success, error message on failure Future cancelPendingTransactionAndPost(String txSlateId) async { try { - final String wallet = (await secureStorageInterface.read( - key: '${walletId}_wallet', - ))!; + final String wallet = + (await secureStorageInterface.read(key: '${walletId}_wallet'))!; final result = await mimblewimblecoin.Libmwc.cancelTransaction( wallet: wallet, transactionId: txSlateId, ); - Logging.instance.log( - "cancel $txSlateId result: $result", - level: LogLevel.Info, - ); + Logging.instance.i("cancel $txSlateId result: $result"); return result; } catch (e, s) { - Logging.instance.log("$e, $s", level: LogLevel.Error); + Logging.instance.e("$e, $s"); return e.toString(); } } @@ -187,13 +184,13 @@ class MimblewimblecoinWallet extends Bip39Wallet { } return realFee; } catch (e, s) { - Logging.instance.log("Error getting fees $e - $s", level: LogLevel.Error); + Logging.instance.e("Error getting fees $e - $s"); rethrow; } } Future _startSync() async { - Logging.instance.log("request start sync", level: LogLevel.Info); + Logging.instance.i("request start sync"); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); const int refreshFromNode = 1; if (!syncMutex.isLocked) { @@ -206,17 +203,19 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); }); } else { - Logging.instance.log("request start sync denied", level: LogLevel.Info); + Logging.instance.i("request start sync denied"); } } Future< - ({ - double awaitingFinalization, - double pending, - double spendable, - double total - })> _allWalletBalances() async { + ({ + double awaitingFinalization, + double pending, + double spendable, + double total, + }) + > + _allWalletBalances() async { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); const refreshFromNode = 0; return await mimblewimblecoin.Libmwc.getWalletBalances( @@ -233,9 +232,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { try { final uri = Uri.parse('wss://$host:$port'); - channel = WebSocketChannel.connect( - uri, - ); + channel = WebSocketChannel.connect(uri); await channel.ready; @@ -245,10 +242,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { return response is String && response.contains("Challenge"); } catch (_) { - Logging.instance.log( - "_testMwcmqsConnection failed on \"$host:$port\"", - level: LogLevel.Info, - ); + Logging.instance.i("_testMwcmqsConnection failed on \"$host:$port\""); return false; } finally { await channel?.sink.close(); @@ -276,8 +270,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); return true; } catch (e, s) { - Logging.instance - .log("ERROR STORING ADDRESS $e $s", level: LogLevel.Error); + Logging.instance.e("ERROR STORING ADDRESS $e $s"); return false; } } @@ -289,14 +282,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { // of the last one that has not been processed, or the index after the one most recently processed; return receivingIndex; } catch (e, s) { - Logging.instance.log("$e $s", level: LogLevel.Error); + Logging.instance.e("$e $s"); return 0; } } - Future

_generateAndStoreReceivingAddressForIndex( - int index, - ) async { + Future
_generateAndStoreReceivingAddressForIndex(int index) async { Address? address = await getCurrentReceivingAddress(); if (address == null) { @@ -321,13 +312,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { final walletAddress = await mimblewimblecoin.Libmwc.getAddressInfo( wallet: wallet!, - index: index + index: index, ); - Logging.instance.log( - "WALLET_ADDRESS_IS $walletAddress", - level: LogLevel.Info, - ); + Logging.instance.i("WALLET_ADDRESS_IS $walletAddress"); final address = Address( walletId: walletId, @@ -346,8 +334,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { try { //First stop the current listener mimblewimblecoin.Libmwc.stopMwcMqsListener(); - final wallet = - await secureStorageInterface.read(key: '${walletId}_wallet'); + final wallet = await secureStorageInterface.read( + key: '${walletId}_wallet', + ); // max number of blocks to scan per loop iteration const scanChunkSize = 10000; @@ -362,9 +351,8 @@ class MimblewimblecoinWallet extends Bip39Wallet { // loop while scanning in chain in chunks (of blocks?) while (lastScannedBlock < chainHeight) { - Logging.instance.log( + Logging.instance.i( "chainHeight: $chainHeight, lastScannedBlock: $lastScannedBlock", - level: LogLevel.Info, ); final int nextScannedBlock = await mimblewimblecoin.Libmwc.scanOutputs( @@ -389,23 +377,17 @@ class MimblewimblecoinWallet extends Bip39Wallet { lastScannedBlock = nextScannedBlock; } - Logging.instance.log( - "_startScans successfully at the tip", - level: LogLevel.Info, - ); + Logging.instance.i("_startScans successfully at the tip"); //Once scanner completes restart listener await _listenToMwcmqs(); } catch (e, s) { - Logging.instance.log( - "_startScans failed: $e\n$s", - level: LogLevel.Error, - ); + Logging.instance.e("_startScans failed: $e\n$s"); rethrow; } } Future _listenToMwcmqs() async { - Logging.instance.log("STARTING WALLET LISTENER ....", level: LogLevel.Info); + Logging.instance.i("STARTING WALLET LISTENER ...."); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); mimblewimblecoin.Libmwc.startMwcMqsListener( @@ -462,10 +444,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future init({bool? isRestore}) async { - if (isRestore != true) { - String? encodedWallet = - await secureStorageInterface.read(key: "${walletId}_wallet"); + String? encodedWallet = await secureStorageInterface.read( + key: "${walletId}_wallet", + ); // check if should create a new wallet if (encodedWallet == null) { @@ -539,8 +521,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { // await mimblewimblecoin.Libmwc.initLogs(config: config); // _logsInitialized = true; // Set flag to true after initializing //} - final password = - await secureStorageInterface.read(key: '${walletId}_password'); + final password = await secureStorageInterface.read( + key: '${walletId}_password', + ); final walletOpen = await mimblewimblecoin.Libmwc.openWallet( config: config, @@ -554,10 +537,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { await updateNode(); } catch (e, s) { // do nothing, still allow user into wallet - Logging.instance.log( - "$runtimeType init() failed: $e\n$s", - level: LogLevel.Error, - ); + Logging.instance.e("$runtimeType init() failed: $e\n$s"); } } } @@ -568,8 +548,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future confirmSend({required TxData txData}) async { try { - final wallet = - await secureStorageInterface.read(key: '${walletId}_wallet'); + final wallet = await secureStorageInterface.read( + key: '${walletId}_wallet', + ); final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); // TODO determine whether it is worth sending change to a change address. @@ -609,12 +590,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { minimumConfirmations: cryptoCurrency.minConfirms, note: txData.noteOnChain!, ); - } else { throw Exception( "Unsupported address format: $receiverAddress. Please use a valid address.", ); - } final Map txAddressInfo = {}; @@ -622,14 +601,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { txAddressInfo['to'] = txData.recipients!.first.address; await _putSendToAddresses(transaction, txAddressInfo); - return txData.copyWith( - txid: transaction.slateId, - ); + return txData.copyWith(txid: transaction.slateId); } catch (e, s) { - Logging.instance.log( - "Mimblewimblecoin confirmSend: $e\n$s", - level: LogLevel.Error, - ); + Logging.instance.e("Mimblewimblecoin confirmSend: $e\n$s"); rethrow; } } @@ -639,11 +613,11 @@ class MimblewimblecoinWallet extends Bip39Wallet { try { if (txData.recipients?.length != 1) { throw Exception( - "Mimblewimblecoin prepare send requires a single recipient!"); + "Mimblewimblecoin prepare send requires a single recipient!", + ); } - ({String address, Amount amount, bool isChange}) recipient = - txData.recipients!.first; + TxRecipient recipient = txData.recipients!.first; final int realFee = await _nativeFee(recipient.amount.raw.toInt()); final feeAmount = Amount( @@ -658,20 +632,17 @@ class MimblewimblecoinWallet extends Bip39Wallet { } if (info.cachedBalance.spendable == recipient.amount) { - recipient = ( + recipient = TxRecipient( address: recipient.address, amount: recipient.amount - feeAmount, isChange: recipient.isChange, + addressType: AddressType.mimbleWimble, ); } - return txData.copyWith( - recipients: [recipient], - fee: feeAmount, - ); + return txData.copyWith(recipients: [recipient], fee: feeAmount); } catch (e, s) { - Logging.instance - .log("Mimblewimblecoin prepareSend: $e\n$s", level: LogLevel.Error); + Logging.instance.e("Mimblewimblecoin prepareSend: $e\n$s"); rethrow; } } @@ -745,7 +716,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_wallet', value: walletOpen, ); - + await _generateAndStoreReceivingAddressForIndex( mimblewimblecoinData.receivingIndex, ); @@ -754,9 +725,8 @@ class MimblewimblecoinWallet extends Bip39Wallet { unawaited(refresh()); } catch (e, s) { - Logging.instance.log( + Logging.instance.i( "Exception rethrown from electrumx_mixin recover(): $e\n$s", - level: LogLevel.Info, ); rethrow; @@ -869,9 +839,8 @@ class MimblewimblecoinWallet extends Bip39Wallet { cryptoCurrency, ), ); - Logging.instance.log( + Logging.instance.e( "Caught exception in refreshWalletData(): $error\n$strace", - level: LogLevel.Error, ); } finally { refreshMutex.release(); @@ -901,14 +870,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { ), ); - await info.updateBalance( - newBalance: balance, - isar: mainDB.isar, - ); + await info.updateBalance(newBalance: balance, isar: mainDB.isar); } catch (e, s) { - Logging.instance.log( + Logging.instance.e( "Mimblewimblecoin wallet failed to update balance: $e\n$s", - level: LogLevel.Warning, ); } } @@ -916,20 +881,22 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future updateTransactions() async { try { - final wallet = - await secureStorageInterface.read(key: '${walletId}_wallet'); + final wallet = await secureStorageInterface.read( + key: '${walletId}_wallet', + ); const refreshFromNode = 1; - final myAddresses = await mainDB - .getAddresses(walletId) - .filter() - .typeEqualTo(AddressType.mimbleWimble) - .and() - .subTypeEqualTo(AddressSubType.receiving) - .and() - .valueIsNotEmpty() - .valueProperty() - .findAll(); + final myAddresses = + await mainDB + .getAddresses(walletId) + .filter() + .typeEqualTo(AddressType.mimbleWimble) + .and() + .subTypeEqualTo(AddressSubType.receiving) + .and() + .valueIsNotEmpty() + .valueProperty() + .findAll(); final myAddressesSet = myAddresses.toSet(); final transactions = await mimblewimblecoin.Libmwc.getTransactions( @@ -942,12 +909,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { final slatesToCommits = info.mimblewimblecoinData?.slatesToCommits ?? {}; for (final tx in transactions) { - Logging.instance.log("tx: $tx", level: LogLevel.Info); + Logging.instance.i("tx: $tx"); final isIncoming = tx.txType == mimblewimblecoin_models.TransactionType.TxReceived || - tx.txType == - mimblewimblecoin_models.TransactionType.TxReceivedCancelled; + tx.txType == + mimblewimblecoin_models.TransactionType.TxReceivedCancelled; final slateId = tx.txSlateId; final commitId = slatesToCommits[slateId]?['commitId'] as String?; final numberOfMessages = tx.messages?.messages.length; @@ -968,9 +935,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { OutputV2 output = OutputV2.isarCantDoRequiredInDefaultConstructor( scriptPubKeyHex: "00", valueStringSats: credit.toString(), - addresses: [ - if (addressFrom != null) addressFrom, - ], + addresses: [if (addressFrom != null) addressFrom], walletOwns: true, ); final InputV2 input = InputV2.isarCantDoRequiredInDefaultConstructor( @@ -1012,14 +977,16 @@ class MimblewimblecoinWallet extends Bip39Wallet { "numberOfMessages": numberOfMessages, "slateId": slateId, "onChainNote": onChainNote, - "isCancelled": tx.txType == + "isCancelled": + tx.txType == mimblewimblecoin_models.TransactionType.TxSentCancelled || tx.txType == mimblewimblecoin_models.TransactionType.TxReceivedCancelled, - "overrideFee": Amount( - rawValue: BigInt.from(fee), - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), + "overrideFee": + Amount( + rawValue: BigInt.from(fee), + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), }; final txn = TransactionV2( @@ -1049,10 +1016,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { await mainDB.isar.transactionV2s.putAll(txns); }); } catch (e, s) { - Logging.instance.log( + Logging.instance.w( "${cryptoCurrency.runtimeType} ${cryptoCurrency.network} net wallet" " \"${info.name}\"_${info.walletId} updateTransactions() failed: $e\n$s", - level: LogLevel.Warning, ); } } @@ -1089,7 +1055,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ) != null; } catch (e, s) { - Logging.instance.log("$e\n$s", level: LogLevel.Info); + Logging.instance.i("$e\n$s"); return false; } } @@ -1097,8 +1063,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future updateChainHeight() async { final config = await _getRealConfig(); - final latestHeight = - await mimblewimblecoin.Libmwc.getChainHeight(config: config); + final latestHeight = await mimblewimblecoin.Libmwc.getChainHeight( + config: config, + ); await info.updateCachedChainHeight( newHeight: latestHeight, isar: mainDB.isar, @@ -1106,7 +1073,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { } @override - Future estimateFeeFor(Amount amount, int feeRate) async { + Future estimateFeeFor(Amount amount, BigInt feeRate) async { // setting ifErrorEstimateFee doesn't do anything as its not used in the nativeFee function????? final int currentFee = await _nativeFee( amount.raw.toInt(), @@ -1126,9 +1093,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { numberOfBlocksFast: 10, numberOfBlocksAverage: 10, numberOfBlocksSlow: 10, - fast: 1, - medium: 1, - slow: 1, + fast: BigInt.one, + medium: BigInt.one, + slow: BigInt.one, ); } @@ -1143,8 +1110,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { timer?.cancel(); timer = null; await super.exit(); - Logging.instance - .log("Mimblewimblecoin_wallet exit finished", level: LogLevel.Info); + Logging.instance.i("Mimblewimblecoin_wallet exit finished"); } } @@ -1176,7 +1142,7 @@ Future deleteMimblewimblecoinWallet({ config: config!, ); } catch (e, s) { - Logging.instance.log("$e\n$s", level: LogLevel.Error); + Logging.instance.e("$e\n$s"); return "deleteMimblewimblecoinWallet($walletId) failed..."; } } diff --git a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart index 0c876d5c57..f9de38fca5 100644 --- a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart +++ b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:isar/isar.dart'; + import '../../../utilities/logger.dart'; import '../../isar/models/wallet_info.dart'; @@ -13,14 +14,11 @@ extension MimblewimblecoinWalletInfoExtension on WalletInfo { } try { return ExtraMimblewimblecoinWalletInfo.fromMap( - Map.from( - jsonDecode(data) as Map, - ), + Map.from(jsonDecode(data) as Map), ); } catch (e, s) { - Logging.instance.log( + Logging.instance.e( "ExtraMimblewimblecoinWalletInfo.fromMap failed: $e\n$s", - level: LogLevel.Error, ); return null; } @@ -32,7 +30,9 @@ extension MimblewimblecoinWalletInfoExtension on WalletInfo { }) async { await updateOtherData( newEntries: { - WalletInfoKeys.mimblewimblecoinData: jsonEncode(mimblewimblecoinData.toMap()), + WalletInfoKeys.mimblewimblecoinData: jsonEncode( + mimblewimblecoinData.toMap(), + ), }, isar: isar, ); @@ -76,13 +76,13 @@ class ExtraMimblewimblecoinWalletInfo { } ExtraMimblewimblecoinWalletInfo.fromMap(Map json) - : receivingIndex = json['receivingIndex'] as int, - changeIndex = json['changeIndex'] as int, - slatesToAddresses = json['slatesToAddresses'] as Map, - slatesToCommits = json['slatesToCommits'] as Map, - lastScannedBlock = json['lastScannedBlock'] as int, - restoreHeight = json['restoreHeight'] as int, - creationHeight = json['creationHeight'] as int; + : receivingIndex = json['receivingIndex'] as int, + changeIndex = json['changeIndex'] as int, + slatesToAddresses = json['slatesToAddresses'] as Map, + slatesToCommits = json['slatesToCommits'] as Map, + lastScannedBlock = json['lastScannedBlock'] as int, + restoreHeight = json['restoreHeight'] as int, + creationHeight = json['creationHeight'] as int; ExtraMimblewimblecoinWalletInfo copyWith({ int? receivingIndex, diff --git a/lib/widgets/tx_key_widget.dart b/lib/widgets/tx_key_widget.dart index ba8e9b33c4..f9e1fb4bc5 100644 --- a/lib/widgets/tx_key_widget.dart +++ b/lib/widgets/tx_key_widget.dart @@ -2,7 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../pages/pinpad_views/pinpad_dialog.dart'; -import '../pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart'; +import '../pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart' + as tvd; import '../pages_desktop_specific/password/request_desktop_auth_dialog.dart'; import '../providers/global/wallets_provider.dart'; import '../utilities/text_styles.dart'; @@ -14,11 +15,7 @@ import 'detail_item.dart'; class TxKeyWidget extends ConsumerStatefulWidget { /// The [walletId] MUST be the id of a [LibMoneroWallet]! - const TxKeyWidget({ - super.key, - required this.walletId, - required this.txid, - }); + const TxKeyWidget({super.key, required this.walletId, required this.txid}); final String walletId; final String txid; @@ -41,14 +38,18 @@ class _TxKeyWidgetState extends ConsumerState { try { final verified = await showDialog( context: context, - builder: (context) => Util.isDesktop - ? const RequestDesktopAuthDialog(title: "Show private view key") - : const PinpadDialog( - biometricsAuthenticationTitle: "Show private view key", - biometricsLocalizedReason: - "Authenticate to show private view key", - biometricsCancelButtonString: "CANCEL", - ), + builder: + (context) => + Util.isDesktop + ? const RequestDesktopAuthDialog( + title: "Show private view key", + ) + : const PinpadDialog( + biometricsAuthenticationTitle: "Show private view key", + biometricsLocalizedReason: + "Authenticate to show private view key", + biometricsCancelButtonString: "CANCEL", + ), barrierDismissible: !Util.isDesktop, ); @@ -75,23 +76,17 @@ class _TxKeyWidgetState extends ConsumerState { @override Widget build(BuildContext context) { return DetailItemBase( - button: _private == null - ? CustomTextButton( - text: "Show", - onTap: _loadTxKey, - enabled: _private == null, - ) - : Util.isDesktop - ? IconCopyButton( - data: _private!, - ) - : SimpleCopyButton( - data: _private!, - ), - title: Text( - "Private view key", - style: STextStyles.itemSubtitle(context), - ), + button: + _private == null + ? CustomTextButton( + text: "Show", + onTap: _loadTxKey, + enabled: _private == null, + ) + : Util.isDesktop + ? tvd.IconCopyButton(data: _private!) + : SimpleCopyButton(data: _private!), + title: Text("Private view key", style: STextStyles.itemSubtitle(context)), detail: SelectableText( // TODO _private ?? "*" * 52, // 52 is approx length From 7cbb227035964066554716ca2cd8e6926580de75 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 4 Sep 2025 16:00:33 -0500 Subject: [PATCH 041/178] fix(mwc): resolve some more merge conflicts (wip) I'm less sure about these than those in the previous commit --- .../sub_widgets/desktop_receive.dart | 377 +++++++++--------- .../wallet_view/sub_widgets/desktop_send.dart | 317 ++------------- .../coins/mimblewimblecoin.dart | 34 +- 3 files changed, 245 insertions(+), 483 deletions(-) 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 ee9ebd300b..3e74a6258c 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 @@ -10,7 +10,6 @@ import 'dart:async'; -import 'package:decimal/decimal.dart'; import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -27,7 +26,6 @@ import '../../../../providers/providers.dart'; import '../../../../route_generator.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/address_utils.dart'; -import '../../../../utilities/amount/amount.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; @@ -50,18 +48,17 @@ import '../../../../wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; import '../../../../widgets/conditional_parent.dart'; -import '../../../../widgets/desktop/primary_button.dart'; -import '../../../../widgets/icon_widgets/clipboard_icon.dart'; -import '../../../../widgets/icon_widgets/x_icon.dart'; -import '../../../../widgets/stack_text_field.dart'; -import '../../../../widgets/textfield_icon_button.dart'; -import '../../../../widgets/toggle.dart'; import '../../../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../../../widgets/custom_loading_overlay.dart'; import '../../../../widgets/desktop/desktop_dialog.dart'; +import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/desktop/secondary_button.dart'; +import '../../../../widgets/icon_widgets/clipboard_icon.dart'; +import '../../../../widgets/icon_widgets/x_icon.dart'; import '../../../../widgets/qr.dart'; import '../../../../widgets/rounded_white_container.dart'; +import '../../../../widgets/stack_text_field.dart'; +import '../../../../widgets/textfield_icon_button.dart'; import 'desktop_mwc_txs_method_toggle.dart'; class DesktopReceive extends ConsumerStatefulWidget { @@ -101,8 +98,6 @@ class _DesktopReceiveState extends ConsumerState { final Map _addressMap = {}; final Map> _addressSubMap = {}; - - Future pasteAddress() async { final ClipboardData? data = await clipboard.getData(Clipboard.kTextPlain); if (data?.text != null && data!.text!.isNotEmpty) { @@ -152,6 +147,7 @@ class _DesktopReceiveState extends ConsumerState { } } } + Future generateNewAddress() async { final wallet = ref.read(pWallets).getWallet(walletId); if (wallet is MultiAddressInterface) { @@ -307,13 +303,12 @@ class _DesktopReceiveState extends ConsumerState { wallet is MwebInterface && !wallet.info.isViewOnly && wallet.info.isMwebEnabled; - + isMimblewimblecoin = wallet is MimblewimblecoinWallet; if (isMimblewimblecoin) { _selectedMethodMwc = "Slatepack"; } debugPrint("Address generated: $isMimblewimblecoin"); - if (wallet is ViewOnlyOptionInterface && wallet.isViewOnly) { showMultiType = false; @@ -471,36 +466,44 @@ class _DesktopReceiveState extends ConsumerState { return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - const SizedBox( - height: 4, - ), - if (isMimblewimblecoin) - Padding( - padding: const EdgeInsets.all(0), - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).extension()?.textFieldDefaultBG ?? Colors.white, // Fallback color - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: Theme.of(context).extension()?.backgroundAppBar ?? Colors.grey, // Fallback color - width: 1, + const SizedBox(height: 4), + if (isMimblewimblecoin) + Padding( + padding: const EdgeInsets.all(0), + child: Container( + decoration: BoxDecoration( + color: + Theme.of( + context, + ).extension()?.textFieldDefaultBG ?? + Colors.white, // Fallback color + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: + Theme.of( + context, + ).extension()?.backgroundAppBar ?? + Colors.grey, // Fallback color + width: 1, + ), ), - ), - child: SizedBox( - height: 50, // Provide an explicit height to avoid infinite constraints - child: MwcTxsMethodToggle( - onChanged: (TxsMethodMwcType type) { - setState(() { - _selectedMethodMwc = type == TxsMethodMwcType.automatic ? 'Slatepack' : 'Automatic'; - }); - }, + child: SizedBox( + height: + 50, // Provide an explicit height to avoid infinite constraints + child: MwcTxsMethodToggle( + onChanged: (TxsMethodMwcType type) { + setState(() { + _selectedMethodMwc = + type == TxsMethodMwcType.automatic + ? 'Slatepack' + : 'Automatic'; + }); + }, + ), ), ), ), - ), - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), ConditionalParent( condition: showMultiType, builder: @@ -675,9 +678,7 @@ class _DesktopReceiveState extends ConsumerState { : generateNewAddress, label: "Generate new address", ), - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -686,9 +687,10 @@ class _DesktopReceiveState extends ConsumerState { Text( "Receive Slatepack", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, + color: + Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, ), textAlign: TextAlign.left, ), @@ -721,9 +723,10 @@ class _DesktopReceiveState extends ConsumerState { }, focusNode: _addressFocusNode, style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, + color: + Theme.of( + context, + ).extension()!.textFieldActiveText, height: 1.8, ), decoration: standardInputDecoration( @@ -734,37 +737,42 @@ class _DesktopReceiveState extends ConsumerState { ).copyWith( contentPadding: const EdgeInsets.symmetric( horizontal: 16, - vertical: 12, // Adjust vertical padding for better alignment + vertical: + 12, // Adjust vertical padding for better alignment ), suffixIcon: Padding( - padding: receiveSlateController.text.isEmpty - ? const EdgeInsets.only(right: 8) - : const EdgeInsets.only(right: 0), + padding: + receiveSlateController.text.isEmpty + ? const EdgeInsets.only(right: 8) + : const EdgeInsets.only(right: 0), child: UnconstrainedBox( child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ _addressToggleFlag ? TextFieldIconButton( - key: const Key("sendViewClearAddressFieldButtonKey"), - onTap: () { - receiveSlateController.text = ""; - _address = ""; - setState(() { - _addressToggleFlag = false; - }); - }, - child: const XIcon(), - ) + key: const Key( + "sendViewClearAddressFieldButtonKey", + ), + onTap: () { + receiveSlateController.text = ""; + _address = ""; + setState(() { + _addressToggleFlag = false; + }); + }, + child: const XIcon(), + ) : TextFieldIconButton( - key: const Key( - "sendViewPasteAddressFieldButtonKey", - ), - onTap: pasteAddress, - child: receiveSlateController.text.isEmpty - ? const ClipboardIcon() - : const XIcon(), + key: const Key( + "sendViewPasteAddressFieldButtonKey", ), + onTap: pasteAddress, + child: + receiveSlateController.text.isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), ], ), ), @@ -774,40 +782,38 @@ class _DesktopReceiveState extends ConsumerState { ), ], ) - - //Padding( - // padding: const EdgeInsets.symmetric(vertical: 8.0), - // child: TextField( - // maxLines: 8, // Set to a higher number to make the height larger - // minLines: 5, // Allow it to shrink if input is small - // decoration: InputDecoration( - // labelText: 'Enter Slatepack Message', - // alignLabelWithHint: true, - // border: OutlineInputBorder( - // borderRadius: BorderRadius.circular(8), - // ), - // filled: true, - // fillColor: Theme.of(context).extension()?.textFieldDefaultBG ?? Colors.white, - // contentPadding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 12.0), - // ), - // onChanged: (value) { - // // Handle text input changes (e.g., store in a state variable) - // debugPrint('Slatepack Message: $value'); - // }, - // ), - //) - + //Padding( + // padding: const EdgeInsets.symmetric(vertical: 8.0), + // child: TextField( + // maxLines: 8, // Set to a higher number to make the height larger + // minLines: 5, // Allow it to shrink if input is small + // decoration: InputDecoration( + // labelText: 'Enter Slatepack Message', + // alignLabelWithHint: true, + // border: OutlineInputBorder( + // borderRadius: BorderRadius.circular(8), + // ), + // filled: true, + // fillColor: Theme.of(context).extension()?.textFieldDefaultBG ?? Colors.white, + // contentPadding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 12.0), + // ), + // onChanged: (value) { + // // Handle text input changes (e.g., store in a state variable) + // debugPrint('Slatepack Message: $value'); + // }, + // ), + //) else - Center( - child: QR( - data: AddressUtils.buildUriString(coin.uriScheme, address, {}), - size: 200, + Center( + child: QR( + data: AddressUtils.buildUriString(coin.uriScheme, address, {}), + size: 200, + ), ), - ), const SizedBox(height: 32), + // TODO: create transparent button class to account for hover - // Conditional logic for 'Submit' button or QR code - + // Conditional logic for 'Submit' button or QR code if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), @@ -816,86 +822,87 @@ class _DesktopReceiveState extends ConsumerState { label: "Preview Receive Slatepack", enabled: true, onPressed: () { - debugPrint('Submit button pressed for Mimblewimblecoin Slatepack'); + debugPrint( + 'Submit button pressed for Mimblewimblecoin Slatepack', + ); }, ), ) else - GestureDetector( - onTap: () async { - if (Util.isDesktop) { - await showDialog( - context: context, - builder: - (context) => DesktopDialog( - maxHeight: double.infinity, - maxWidth: 580, - child: Column( - children: [ - Row( - children: [ - const AppBarBackButton(size: 40, iconSize: 24), - Text( - "Generate QR code", - style: STextStyles.desktopH3(context), - ), - ], - ), - IntrinsicHeight( - child: Navigator( - onGenerateRoute: RouteGenerator.generateRoute, - onGenerateInitialRoutes: - (_, __) => [ - RouteGenerator.generateRoute( - RouteSettings( - name: GenerateUriQrCodeView.routeName, - arguments: Tuple2(coin, address), + GestureDetector( + onTap: () async { + if (Util.isDesktop) { + await showDialog( + context: context, + builder: + (context) => DesktopDialog( + maxHeight: double.infinity, + maxWidth: 580, + child: Column( + children: [ + Row( + children: [ + const AppBarBackButton(size: 40, iconSize: 24), + Text( + "Generate QR code", + style: STextStyles.desktopH3(context), + ), + ], + ), + IntrinsicHeight( + child: Navigator( + onGenerateRoute: RouteGenerator.generateRoute, + onGenerateInitialRoutes: + (_, __) => [ + RouteGenerator.generateRoute( + RouteSettings( + name: GenerateUriQrCodeView.routeName, + arguments: Tuple2(coin, address), + ), ), - ), - ], + ], + ), ), + ], + ), + ), + ); + } else { + unawaited( + Navigator.of(context).push( + RouteGenerator.getRoute( + shouldUseMaterialRoute: + RouteGenerator.useMaterialPageRoute, + builder: + (_) => GenerateUriQrCodeView( + coin: coin, + receivingAddress: address, ), - ], + settings: const RouteSettings( + name: GenerateUriQrCodeView.routeName, ), ), - ); - } else { - unawaited( - Navigator.of(context).push( - RouteGenerator.getRoute( - shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, - builder: - (_) => GenerateUriQrCodeView( - coin: coin, - receivingAddress: address, - ), - settings: const RouteSettings( - name: GenerateUriQrCodeView.routeName, - ), ), - ), - ); - } - }, - child: Container( - color: Colors.transparent, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - Assets.svg.qrcode, - width: 14, - height: 16, - color: - Theme.of( - context, - ).extension()!.accentColorBlue, - ), - const SizedBox(width: 8), - Padding( - padding: const EdgeInsets.only(bottom: 2), - child: Text( + ); + } + }, + child: Container( + color: Colors.transparent, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + Assets.svg.qrcode, + width: 14, + height: 16, + color: + Theme.of( + context, + ).extension()!.accentColorBlue, + ), + const SizedBox(width: 8), + Text( "Create new QR code", style: STextStyles.desktopTextExtraSmall(context).copyWith( color: @@ -903,27 +910,27 @@ class _DesktopReceiveState extends ConsumerState { context, ).extension()!.accentColorBlue, ), - const SizedBox(width: 8), - Padding( - padding: const EdgeInsets.only(bottom: 2), - child: Text( - "Create new QR code", - style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .accentColorBlue, - ), + ), + const SizedBox(width: 8), + Padding( + padding: const EdgeInsets.only(bottom: 2), + child: Text( + "Create new QR code", + style: STextStyles.desktopTextExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ).extension()!.accentColorBlue, ), ), - ], - ), - ], + ), + ], + ), + ), ), - ), - ), ], ); } } - - 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 f0f924919d..ae5733c968 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 @@ -40,12 +40,7 @@ import '../../../../utilities/amount/amount_unit.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; -<<<<<<< - -======= -import '../../../../utilities/enums/fee_rate_type_enum.dart'; import '../../../../utilities/enums/txs_method_mwc_enum.dart'; ->>>>>>> import '../../../../utilities/logger.dart'; import '../../../../utilities/prefs.dart'; import '../../../../utilities/text_styles.dart'; @@ -77,12 +72,8 @@ import '../../../../widgets/textfield_icon_button.dart'; import '../../../coin_control/desktop_coin_control_use_dialog.dart'; import '../../../desktop_home_view.dart'; import 'address_book_address_chooser/address_book_address_chooser.dart'; -<<<<<<< -import 'desktop_send_fee_form.dart'; -======= -import 'desktop_fee_dropdown.dart'; import 'desktop_mwc_txs_method_toggle.dart'; ->>>>>>> +import 'desktop_send_fee_form.dart'; class DesktopSend extends ConsumerStatefulWidget { const DesktopSend({ @@ -114,7 +105,6 @@ class _DesktopSendState extends ConsumerState { late TextEditingController memoController; late TextEditingController nonceController; - late final SendViewAutoFillData? _data; final _addressFocusNode = FocusNode(); @@ -126,7 +116,7 @@ class _DesktopSendState extends ConsumerState { late final bool isStellar; late final bool isMimblewimblecoin; - String? _selectedMethodMwc; + String? _selectedMethodMwc; String? _note; String? _onChainNote; @@ -492,9 +482,7 @@ class _DesktopSendState extends ConsumerState { txData = txData.copyWith(noteOnChain: _onChainNote ?? ""); } if (coin is Mimblewimblecoin) { - txData = txData.copyWith( - noteOnChain: _onChainNote ?? "", - ); + txData = txData.copyWith(noteOnChain: _onChainNote ?? ""); } } // pop building dialog @@ -1054,9 +1042,8 @@ class _DesktopSendState extends ConsumerState { }); } -<<<<<<< final balType = ref.watch(publicPrivateBalanceStateProvider); -======= + if (coin is Mimblewimblecoin) { sendToController.addListener(() { _address = sendToController.text; @@ -1072,9 +1059,6 @@ class _DesktopSendState extends ConsumerState { }); } - final firoType = ref.watch(publicPrivateBalanceStateProvider); ->>>>>>> - final isMwebEnabled = ref.watch( pWalletInfo(walletId).select((s) => s.isMwebEnabled), ); @@ -1107,41 +1091,46 @@ class _DesktopSendState extends ConsumerState { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ -<<<<<<< const SizedBox(height: 4), - if (showPrivateBalance) -======= - const SizedBox( - height: 4, - ), + if (showPrivateBalance) const SizedBox(height: 4), if (isMimblewimblecoin) Padding( padding: const EdgeInsets.all(0), child: Container( decoration: BoxDecoration( - color: Theme.of(context).extension()?.textFieldDefaultBG ?? Colors.white, // Fallback color + color: + Theme.of( + context, + ).extension()?.textFieldDefaultBG ?? + Colors.white, // Fallback color borderRadius: BorderRadius.circular(8), border: Border.all( - color: Theme.of(context).extension()?.backgroundAppBar ?? Colors.grey, // Fallback color + color: + Theme.of( + context, + ).extension()?.backgroundAppBar ?? + Colors.grey, // Fallback color width: 1, ), ), child: SizedBox( - height: 50, // Provide an explicit height to avoid infinite constraints + height: + 50, // Provide an explicit height to avoid infinite constraints child: MwcTxsMethodToggle( onChanged: (TxsMethodMwcType type) { setState(() { - _selectedMethodMwc = type == TxsMethodMwcType.automatic ? 'Slatepack' : 'Automatic'; + _selectedMethodMwc = + type == TxsMethodMwcType.automatic + ? 'Slatepack' + : 'Automatic'; }); }, ), ), ), ), - if (isMimblewimblecoin) if (coin is Firo) ->>>>>>> Text( "Send from", style: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -1243,14 +1232,7 @@ class _DesktopSendState extends ConsumerState { ), ), ), -<<<<<<< if (showPrivateBalance) const SizedBox(height: 20), -======= - if (coin is Firo || isMimblewimblecoin) - const SizedBox( - height: 20, - ), ->>>>>>> if (isPaynymSend) Text( "Send to PayNym address", @@ -1747,9 +1729,11 @@ class _DesktopSendState extends ConsumerState { ), ), ), -<<<<<<< if (!isPaynymSend) const SizedBox(height: 20), - if (coin is! NanoCurrency && coin is! Epiccash && coin is! Tezos) + if (coin is! NanoCurrency && + coin is! Epiccash && + coin is! Tezos && + coin is! Mimblewimblecoin) DesktopSendFeeForm( walletId: walletId, isToken: false, @@ -1770,59 +1754,6 @@ class _DesktopSendState extends ConsumerState { Theme.of( context, ).extension()!.textFieldActiveSearchIconRight, -======= - if (!isPaynymSend) - const SizedBox( - height: 20, - ), - if (coin is! NanoCurrency && - coin is! Epiccash && - coin is! Mimblewimblecoin && - coin is! Tezos) - ConditionalParent( - condition: ref.watch(pWallets).getWallet(walletId) - is ElectrumXInterface && - !(((coin is Firo) && - (ref.watch(publicPrivateBalanceStateProvider.state).state == - FiroType.lelantus || - ref - .watch(publicPrivateBalanceStateProvider.state) - .state == - FiroType.spark))), - builder: (child) => Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - child, - CustomTextButton( - text: "Edit", - onTap: () async { - feeSelectionResult = await showDialog< - ( - FeeRateType, - String?, - String?, - )?>( - context: context, - builder: (_) => DesktopFeeDialog( - walletId: walletId, - ), - ); - - if (feeSelectionResult != null) { - if (isCustomFee && - feeSelectionResult!.$1 != FeeRateType.custom) { - isCustomFee = false; - } else if (!isCustomFee && - feeSelectionResult!.$1 == FeeRateType.custom) { - isCustomFee = true; - } - } - - setState(() {}); - }, - ), - ], ->>>>>>> ), textAlign: TextAlign.left, ), @@ -1864,195 +1795,7 @@ class _DesktopSendState extends ConsumerState { ), ), ), -<<<<<<< const SizedBox(height: 36), -======= - if (coin is! NanoCurrency && - coin is! Epiccash && - coin is! Mimblewimblecoin && - coin is! Tezos) - const SizedBox( - height: 10, - ), - if (coin is! NanoCurrency && - coin is! Epiccash && - coin is! Mimblewimblecoin && - coin is! Tezos) - if (!isCustomFee) - Padding( - padding: const EdgeInsets.all(10), - child: (feeSelectionResult?.$2 == null) - ? FutureBuilder( - future: ref.watch( - pWallets.select( - (value) => value.getWallet(walletId).fees, - ), - ), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - return DesktopFeeItem( - feeObject: snapshot.data, - feeRateType: FeeRateType.average, - walletId: walletId, - isButton: false, - feeFor: ({ - required Amount amount, - required FeeRateType feeRateType, - required int feeRate, - required CryptoCurrency coin, - }) async { - if (ref - .read(feeSheetSessionCacheProvider) - .average[amount] == - null) { - final wallet = - ref.read(pWallets).getWallet(walletId); - - if (coin is Monero || coin is Wownero) { - final fee = await wallet.estimateFeeFor( - amount, - lib_monero.TransactionPriority.medium.value, - ); - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = fee; - } else if ((coin is Firo) && - ref - .read( - publicPrivateBalanceStateProvider - .state, - ) - .state != - FiroType.public) { - final firoWallet = wallet as FiroWallet; - - if (ref - .read( - publicPrivateBalanceStateProvider - .state, - ) - .state == - FiroType.lelantus) { - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = - await firoWallet - .estimateFeeForLelantus(amount); - } else if (ref - .read( - publicPrivateBalanceStateProvider - .state, - ) - .state == - FiroType.spark) { - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = - await firoWallet - .estimateFeeForSpark(amount); - } - } else { - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = - await wallet.estimateFeeFor( - amount, - feeRate, - ); - } - } - return ref - .read(feeSheetSessionCacheProvider) - .average[amount]!; - }, - isSelected: true, - ); - } else { - return Row( - children: [ - AnimatedText( - stringsToLoopThrough: stringsToLoopThrough, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, - ), - ), - ], - ); - } - }, - ) - : (coin is Firo) && - ref - .watch( - publicPrivateBalanceStateProvider.state, - ) - .state == - FiroType.lelantus - ? Text( - "~${ref.watch(pAmountFormatter(coin)).format( - Amount( - rawValue: BigInt.parse("3794"), - fractionDigits: coin.fractionDigits, - ), - indicatePrecisionLoss: false, - )}", - style: STextStyles.desktopTextExtraExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, - ), - textAlign: TextAlign.left, - ) - : Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - feeSelectionResult?.$2 ?? "", - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, - ), - textAlign: TextAlign.left, - ), - Text( - feeSelectionResult?.$3 ?? "", - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, - ), - ), - ], - ), - ), - if (isCustomFee) - Padding( - padding: const EdgeInsets.only( - bottom: 12, - top: 16, - ), - child: FeeSlider( - coin: coin, - onSatVByteChanged: (rate) { - customFeeRate = rate; - }, - ), - ), - const SizedBox( - height: 36, - ), ->>>>>>> PrimaryButton( buttonHeight: ButtonHeight.l, label: "Preview send", @@ -2090,8 +1833,10 @@ String formatAddressMwc(String mimblewimblecoinAddress) { mimblewimblecoinAddress.startsWith("https://")) && mimblewimblecoinAddress.contains("@")) { mimblewimblecoinAddress = mimblewimblecoinAddress.replaceAll("http://", ""); - mimblewimblecoinAddress = - mimblewimblecoinAddress.replaceAll("https://", ""); + mimblewimblecoinAddress = mimblewimblecoinAddress.replaceAll( + "https://", + "", + ); } // strip mailto: prefix if (mimblewimblecoinAddress.startsWith("mailto:")) { @@ -2101,7 +1846,9 @@ String formatAddressMwc(String mimblewimblecoinAddress) { if (mimblewimblecoinAddress.endsWith("/") && mimblewimblecoinAddress.contains("@")) { mimblewimblecoinAddress = mimblewimblecoinAddress.substring( - 0, mimblewimblecoinAddress.length - 1); + 0, + mimblewimblecoinAddress.length - 1, + ); } return mimblewimblecoinAddress; } diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index 4dd1138062..cc6d397c39 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -50,18 +50,19 @@ class Mimblewimblecoin extends Bip39Currency { // change this to change the number of confirms a tx needs in order to show as confirmed int get minConfirms => 3; - @override -bool validateAddress(String address) { - Uri? uri = Uri.tryParse(address); - if (uri != null && - (uri.scheme == "http" || uri.scheme == "https" || uri.scheme == "mwcmqs") && - uri.host.isNotEmpty && - !uri.host.endsWith(".onion")) { - return true; + @override + bool validateAddress(String address) { + Uri? uri = Uri.tryParse(address); + if (uri != null && + (uri.scheme == "http" || + uri.scheme == "https" || + uri.scheme == "mwcmqs") && + uri.host.isNotEmpty && + !uri.host.endsWith(".onion")) { + return true; + } + return mimblewimblecoin.Libmwc.validateSendAddress(address: address); } - return mimblewimblecoin.Libmwc.validateSendAddress(address: address); -} - @override NodeModel defaultNode({required bool isPrimary}) { @@ -79,7 +80,7 @@ bool validateAddress(String address) { isDown: false, torEnabled: true, clearnetEnabled: true, - isPrimary: isPrimary, + isPrimary: true, ); default: @@ -112,7 +113,8 @@ bool validateAddress(String address) { int get targetBlockTimeSeconds => 60; @override - DerivePathType get defaultDerivePathType => throw UnsupportedError( + DerivePathType get defaultDerivePathType => + throw UnsupportedError( "$runtimeType does not use bitcoin style derivation paths", ); @@ -125,4 +127,10 @@ bool validateAddress(String address) { ); } } + + @override + AddressType? getAddressType(String address) { + // TODO: implement getAddressType. + throw UnimplementedError(); + } } From b6e0796800507a9776fc4c1e6d12d1a053c5ef77 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 5 Sep 2025 01:05:14 -0500 Subject: [PATCH 042/178] fix(mwc): revert transaction details view changes these will need to be incorporated correctly later. for now, I just want to test that flutter_libmwc integration has gone well. --- .../tx_v2/transaction_v2_details_view.dart | 2759 +++++++---------- 1 file changed, 1127 insertions(+), 1632 deletions(-) diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index e57a1f33d7..af044e6825 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -44,7 +44,6 @@ import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/epiccash_wallet.dart'; import '../../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../../../wallets/wallet/intermediate/lib_salvium_wallet.dart'; -import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import '../../../../widgets/background.dart'; @@ -137,34 +136,34 @@ class _TransactionV2DetailsViewState context: context, builder: (context) => DesktopDialog( - maxHeight: null, - maxWidth: 580, - child: Column( - mainAxisSize: MainAxisSize.min, + maxHeight: null, + maxWidth: 580, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only(left: 32), - child: Text( - "Boost transaction", - style: STextStyles.desktopH3(context), - ), - ), - const DesktopDialogCloseButton(), - ], - ), - Flexible( - child: SingleChildScrollView( - child: BoostTransactionView( - transaction: _transaction, - ), + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Boost transaction", + style: STextStyles.desktopH3(context), ), ), + const DesktopDialogCloseButton(), ], ), - ), + Flexible( + child: SingleChildScrollView( + child: BoostTransactionView( + transaction: _transaction, + ), + ), + ), + ], + ), + ), ); } } else { @@ -189,14 +188,14 @@ class _TransactionV2DetailsViewState hasTxKeyProbably = (wallet is LibMoneroWallet || wallet is LibSalviumWallet) && - (_transaction.type == TransactionType.outgoing || - _transaction.type == TransactionType.sentToSelf); + (_transaction.type == TransactionType.outgoing || + _transaction.type == TransactionType.sentToSelf); if (_transaction.type - case TransactionType.sentToSelf || TransactionType.outgoing) { + case TransactionType.sentToSelf || TransactionType.outgoing) { supportsRbf = _transaction.subType == TransactionSubType.none && - wallet is RbfInterface; + wallet is RbfInterface; } else { supportsRbf = false; } @@ -249,43 +248,14 @@ class _TransactionV2DetailsViewState _transaction.outputs .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, ), - ) - .toList(); - } else if (_transaction.isMimblewimblecoinTransaction) { - switch (_transaction.type) { - case TransactionType.outgoing: - case TransactionType.unknown: - amount = _transaction.getAmountSentFromThisWallet( - fractionDigits: fractionDigits, - ); - break; - - case TransactionType.incoming: - case TransactionType.sentToSelf: - amount = _transaction.getAmountReceivedInThisWallet( - fractionDigits: fractionDigits, - ); - break; - } - data = _transaction.outputs - .map( - (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ) ), ) - .toList(); + .toList(); } else if (_transaction.subType == TransactionSubType.cashFusion) { amount = _transaction.getAmountReceivedInThisWallet( fractionDigits: fractionDigits, @@ -295,13 +265,13 @@ class _TransactionV2DetailsViewState .where((e) => e.walletOwns) .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); } else { switch (_transaction.type) { @@ -315,13 +285,13 @@ class _TransactionV2DetailsViewState .where((e) => !e.walletOwns) .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); break; @@ -341,17 +311,17 @@ class _TransactionV2DetailsViewState .and() .heightEqualTo(_transaction.height) .anyOf( - _transaction.outputs - .where( - (e) => - e.walletOwns && - e.addresses.isEmpty && - e.scriptPubKeyHex.length >= 488, - ) - .map((e) => e.scriptPubKeyHex.substring(2, 488)) - .toList(), + _transaction.outputs + .where( + (e) => + e.walletOwns && + e.addresses.isEmpty && + e.scriptPubKeyHex.length >= 488, + ) + .map((e) => e.scriptPubKeyHex.substring(2, 488)) + .toList(), (q, element) => q.serializedCoinB64StartsWith(element), - ) + ) .memoProperty() .findFirstSync(); } @@ -368,7 +338,7 @@ class _TransactionV2DetailsViewState rawValue: _transaction.outputs .where( (e) => e.walletOwns && !e.addresses.contains(changeAddress), - ) + ) .fold(BigInt.zero, (p, e) => p + e.value), fractionDigits: coin.fractionDigits, ); @@ -382,13 +352,13 @@ class _TransactionV2DetailsViewState .where((e) => e.walletOwns) .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); break; @@ -402,13 +372,13 @@ class _TransactionV2DetailsViewState .where((e) => e.walletOwns) .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); break; } @@ -426,11 +396,11 @@ class _TransactionV2DetailsViewState currentChainHeight: height, minConfirms: minConfirms, minCoinbaseConfirms: - ref - .read(pWallets) - .getWallet(walletId) - .cryptoCurrency - .minCoinbaseConfirms, + ref + .read(pWallets) + .getWallet(walletId) + .cryptoCurrency + .minCoinbaseConfirms, ); Future fetchContactNameFor(String address) async { @@ -443,10 +413,10 @@ class _TransactionV2DetailsViewState .contacts .where( (element) => - element.addresses - .where((element) => element.address == address) - .isNotEmpty, - ); + element.addresses + .where((element) => element.address == address) + .isNotEmpty, + ); if (contacts.isNotEmpty) { return contacts.first.name; } else { @@ -467,7 +437,7 @@ class _TransactionV2DetailsViewState return StackDialog( title: "Attention", message: - "You are about to view this transaction in a block explorer. The explorer may log your IP address and link it to the transaction. Only proceed if you trust $explorer.", + "You are about to view this transaction in a block explorer. The explorer may log your IP address and link it to the transaction. Only proceed if you trust $explorer.", icon: Row( children: [ Consumer( @@ -475,7 +445,7 @@ class _TransactionV2DetailsViewState return Checkbox( value: ref.watch( prefsChangeNotifierProvider.select( - (value) => value.hideBlockExplorerWarning, + (value) => value.hideBlockExplorerWarning, ), ), onChanged: (value) { @@ -503,9 +473,9 @@ class _TransactionV2DetailsViewState "Cancel", style: STextStyles.button(context).copyWith( color: - Theme.of( - context, - ).extension()!.accentColorDark, + Theme.of( + context, + ).extension()!.accentColorDark, ), ), ), @@ -538,7 +508,7 @@ class _TransactionV2DetailsViewState return Checkbox( value: ref.watch( prefsChangeNotifierProvider.select( - (value) => value.hideBlockExplorerWarning, + (value) => value.hideBlockExplorerWarning, ), ), onChanged: (value) { @@ -628,10 +598,10 @@ class _TransactionV2DetailsViewState )) { price = ref.watch( priceAnd24hChangeNotifierProvider.select( - (value) => - isTokenTx - ? value.getTokenPrice(_transaction.contractAddress!)?.value - : value.getPrice(coin)?.value, + (value) => + isTokenTx + ? value.getTokenPrice(_transaction.contractAddress!)?.value + : value.getPrice(coin)?.value, ), ); } @@ -641,37 +611,37 @@ class _TransactionV2DetailsViewState builder: (child) => Background(child: child), child: Scaffold( backgroundColor: - isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.background, + isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.background, appBar: - isDesktop - ? null - : AppBar( - backgroundColor: - Theme.of(context).extension()!.background, - leading: AppBarBackButton( - onPressed: () async { - // if (FocusScope.of(context).hasFocus) { - // FocusScope.of(context).unfocus(); - // await Future.delayed(Duration(milliseconds: 50)); - // } - Navigator.of(context).pop(); - }, - ), - title: Text( - "Transaction details", - style: STextStyles.navBarTitle(context), - ), - ), + isDesktop + ? null + : AppBar( + backgroundColor: + Theme.of(context).extension()!.background, + leading: AppBarBackButton( + onPressed: () async { + // if (FocusScope.of(context).hasFocus) { + // FocusScope.of(context).unfocus(); + // await Future.delayed(Duration(milliseconds: 50)); + // } + Navigator.of(context).pop(); + }, + ), + title: Text( + "Transaction details", + style: STextStyles.navBarTitle(context), + ), + ), body: ConditionalParent( condition: !isDesktop, builder: (child) => SafeArea(child: child), child: Padding( padding: - isDesktop - ? const EdgeInsets.only(left: 32) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.only(left: 32) + : const EdgeInsets.all(12), child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -689,19 +659,19 @@ class _TransactionV2DetailsViewState Flexible( child: Padding( padding: - isDesktop - ? const EdgeInsets.only(right: 32, bottom: 32) - : const EdgeInsets.all(0), + isDesktop + ? const EdgeInsets.only(right: 32, bottom: 32) + : const EdgeInsets.all(0), child: ConditionalParent( condition: isDesktop, builder: (child) { return RoundedWhiteContainer( borderColor: - isDesktop - ? Theme.of( - context, - ).extension()!.backgroundAppBar - : null, + isDesktop + ? Theme.of( + context, + ).extension()!.backgroundAppBar + : null, padding: const EdgeInsets.all(0), child: child, ); @@ -710,43 +680,43 @@ class _TransactionV2DetailsViewState primary: isDesktop ? false : null, child: Padding( padding: - isDesktop - ? const EdgeInsets.all(0) - : const EdgeInsets.all(4), + isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(4), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(0) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(12), child: Container( decoration: - isDesktop - ? BoxDecoration( - color: - Theme.of(context) - .extension()! - .backgroundAppBar, - borderRadius: BorderRadius.vertical( - top: Radius.circular( - Constants - .size - .circularBorderRadius, - ), - ), - ) - : null, + isDesktop + ? BoxDecoration( + color: + Theme.of(context) + .extension()! + .backgroundAppBar, + borderRadius: BorderRadius.vertical( + top: Radius.circular( + Constants + .size + .circularBorderRadius, + ), + ), + ) + : null, child: Padding( padding: - isDesktop - ? const EdgeInsets.all(12) - : const EdgeInsets.all(0), + isDesktop + ? const EdgeInsets.all(12) + : const EdgeInsets.all(0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ if (isDesktop) Row( @@ -763,73 +733,73 @@ class _TransactionV2DetailsViewState currentHeight, ), style: - STextStyles.desktopTextMedium( - context, - ), + STextStyles.desktopTextMedium( + context, + ), ), ], ), Column( crossAxisAlignment: - isDesktop - ? CrossAxisAlignment.end - : CrossAxisAlignment.start, + isDesktop + ? CrossAxisAlignment.end + : CrossAxisAlignment.start, children: [ SelectableText( "$amountPrefix${ref.watch(pAmountFormatter(coin)).format(amount, ethContract: ethContract)}", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.titleBold12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.titleBold12( + context, + ), ), const SizedBox(height: 2), if (price != null) Builder( builder: (context) { final total = - (amount.decimal * price!) - .toAmount( - fractionDigits: 2, - ); + (amount.decimal * price!) + .toAmount( + fractionDigits: 2, + ); final formatted = total .fiatString( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => - value - .locale, - ), - ), - ); + locale: ref.watch( + localeServiceChangeNotifierProvider + .select( + (value) => + value + .locale, + ), + ), + ); final ticker = ref.watch( prefsChangeNotifierProvider .select( (value) => - value.currency, - ), + value.currency, + ), ); return SelectableText( "$amountPrefix$formatted $ticker", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ); }, ), @@ -852,23 +822,23 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( "Status", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), // Flexible( // child: FittedBox( @@ -877,32 +847,32 @@ class _TransactionV2DetailsViewState SelectableText( whatIsIt(_transaction, currentHeight), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - _transaction.type == - TransactionType - .outgoing && - _transaction - .subType != - TransactionSubType - .cashFusion - ? Theme.of(context) - .extension< - StackColors - >()! - .accentColorOrange - : Theme.of(context) - .extension< - StackColors - >()! - .accentColorGreen, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + _transaction.type == + TransactionType + .outgoing && + _transaction + .subType != + TransactionSubType + .cashFusion + ? Theme.of(context) + .extension< + StackColors + >()! + .accentColorOrange + : Theme.of(context) + .extension< + StackColors + >()! + .accentColorGreen, + ) + : STextStyles.itemSubtitle12( + context, + ), ), // ), // ), @@ -910,8 +880,8 @@ class _TransactionV2DetailsViewState ), ), if (!((coin is Monero || coin is Wownero) && - _transaction.type == - TransactionType.outgoing) && + _transaction.type == + TransactionType.outgoing) && !((coin is Firo) && _transaction.subType == TransactionSubType.mint)) @@ -919,34 +889,34 @@ class _TransactionV2DetailsViewState ? const _Divider() : const SizedBox(height: 12), if (!((coin is Monero || coin is Wownero) && - _transaction.type == - TransactionType.outgoing) && + _transaction.type == + TransactionType.outgoing) && !((coin is Firo) && _transaction.subType == TransactionSubType.mint)) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Expanded( child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ ConditionalParent( condition: kDebugMode, builder: (child) { return Row( mainAxisAlignment: - MainAxisAlignment - .spaceBetween, + MainAxisAlignment + .spaceBetween, children: [ child, // CustomTextButton( @@ -996,25 +966,25 @@ class _TransactionV2DetailsViewState child: Text( outputLabel, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), ), const SizedBox(height: 8), Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ if (data.length == 1 && data - .first - .addresses - .length == + .first + .addresses + .length == 1) FutureBuilder( future: fetchContactNameFor( @@ -1024,10 +994,10 @@ class _TransactionV2DetailsViewState .first, ), builder: ( - builderContext, - AsyncSnapshot - snapshot, - ) { + builderContext, + AsyncSnapshot + snapshot, + ) { String addressOrContactName = data @@ -1035,87 +1005,87 @@ class _TransactionV2DetailsViewState .addresses .first; if (snapshot.connectionState == - ConnectionState - .done && + ConnectionState + .done && snapshot.hasData) { addressOrContactName = - snapshot.data!; + snapshot.data!; } return SelectableText( addressOrContactName, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ); }, ) else for ( - int i = 0; - i < data.length; - i++ + int i = 0; + i < data.length; + i++ ) ConditionalParent( condition: i > 0, builder: (child) => Column( - crossAxisAlignment: - CrossAxisAlignment - .stretch, - children: [ - const _Divider(), - child, - ], - ), + crossAxisAlignment: + CrossAxisAlignment + .stretch, + children: [ + const _Divider(), + child, + ], + ), child: Padding( padding: - const EdgeInsets.all( - 8.0, - ), + const EdgeInsets.all( + 8.0, + ), child: Column( crossAxisAlignment: - CrossAxisAlignment - .start, + CrossAxisAlignment + .start, children: [ ...data[i].addresses.map(( - e, - ) { + e, + ) { return FutureBuilder( future: - fetchContactNameFor( - e, - ), + fetchContactNameFor( + e, + ), builder: ( - builderContext, - AsyncSnapshot< - String - > - snapshot, - ) { + builderContext, + AsyncSnapshot< + String + > + snapshot, + ) { final String addressOrContactName; if (snapshot.connectionState == - ConnectionState - .done && + ConnectionState + .done && snapshot .hasData) { addressOrContactName = - snapshot - .data!; + snapshot + .data!; } else { addressOrContactName = e; @@ -1123,10 +1093,10 @@ class _TransactionV2DetailsViewState return OutputCard( address: - addressOrContactName, + addressOrContactName, amount: - data[i] - .amount, + data[i] + .amount, coin: coin, ); }, @@ -1148,7 +1118,6 @@ class _TransactionV2DetailsViewState ], ), ), -<<<<<<< if (coin is Epiccash) isDesktop ? const _Divider() @@ -1156,49 +1125,49 @@ class _TransactionV2DetailsViewState if (coin is Epiccash) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Expanded( child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "On chain note", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), const SizedBox(height: 8), SelectableText( _transaction.onChainNote ?? "", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1210,258 +1179,117 @@ class _TransactionV2DetailsViewState ], ), ), -======= - ), - if (coin is Epiccash || coin is Mimblewimblecoin) ->>>>>>> isDesktop ? const _Divider() -<<<<<<< : const SizedBox(height: 12), -======= - : const SizedBox( - height: 12, - ), - if (coin is Epiccash || coin is Mimblewimblecoin) ->>>>>>> RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) -e : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( (coin is Epiccash) ? "Local Note" : "Note ", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), -<<<<<<< - ), - isDesktop - ? IconPencilButton( -======= - ), - const SizedBox( - height: 8, + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, ), - SelectableText( - _transaction.onChainNote ?? "", - style: isDesktop - ? STextStyles - .desktopTextExtraExtraSmall( - context, - ).copyWith( - color: Theme.of(context) - .extension< - StackColors>()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, + ), + isDesktop + ? IconPencilButton( + onPressed: () { + showDialog( + context: context, + builder: (context) { + return DesktopDialog( + maxWidth: 580, + maxHeight: 360, + child: EditNoteView( + txid: _transaction.txid, + walletId: walletId, ), - ), - ], - ), - ), - if (isDesktop) - IconCopyButton( - data: _transaction.onChainNote ?? "", - ), - ], - ), - ), - isDesktop - ? const _Divider() - : const SizedBox( - height: 12, - ), - RoundedWhiteContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - (coin is Epiccash || - coin is Mimblewimblecoin) - ? "Local Note" - : "Note ", - style: isDesktop - ? STextStyles - .desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle(context), - ), - isDesktop - ? IconPencilButton( ->>>>>>> - onPressed: () { - showDialog( - context: context, - builder: (context) { - return DesktopDialog( - maxWidth: 580, - maxHeight: 360, - child: EditNoteView( - txid: _transaction.txid, - walletId: walletId, - ), - ); - }, ); }, - ) + ); + }, + ) : GestureDetector( - onTap: () { - Navigator.of(context).pushNamed( - EditNoteView.routeName, - arguments: Tuple2( - _transaction.txid, - walletId, - ), - ); - }, - child: Row( - children: [ - SvgPicture.asset( - Assets.svg.pencil, - width: 10, - height: 10, - color: - Theme.of(context) - .extension< - StackColors - >()! - .infoItemIcons, - ), - const SizedBox(width: 4), - Text( - "Edit", - style: STextStyles.link2( - context, - ), - ), - ], + onTap: () { + Navigator.of(context).pushNamed( + EditNoteView.routeName, + arguments: Tuple2( + _transaction.txid, + walletId, ), - ), -<<<<<<< - -======= - ], - ), - const SizedBox( - height: 8, - ), - SelectableText( - ref - .watch( - pTransactionNote( - ( - txid: (coin is Epiccash || - coin - is Mimblewimblecoin) - ? _transaction.slateId - .toString() - : _transaction.txid, - walletId: walletId - ), + ); + }, + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.pencil, + width: 10, + height: 10, + color: + Theme.of(context) + .extension< + StackColors + >()! + .infoItemIcons, ), - ) - ?.value ?? - "", - style: isDesktop - ? STextStyles - .desktopTextExtraExtraSmall( - context, - ).copyWith( - color: Theme.of(context) - .extension()! - .textDark, - ) - : STextStyles.itemSubtitle12(context), - ), - ], - ), - ), - if (_sparkMemo != null) - isDesktop - ? const _Divider() - : const SizedBox( - height: 12, - ), - if (_sparkMemo != null) - RoundedWhiteContainer( - padding: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - "Memo", - style: isDesktop - ? STextStyles - .desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( + const SizedBox(width: 4), + Text( + "Edit", + style: STextStyles.link2( context, ), + ), + ], + ), ), ->>>>>>> ], ), const SizedBox(height: 8), SelectableText( ref - .watch( - pTransactionNote(( - txid: - (coin is Epiccash) - ? _transaction.slateId - .toString() - : _transaction.txid, - walletId: walletId, - )), - ) - ?.value ?? + .watch( + pTransactionNote(( + txid: + (coin is Epiccash) + ? _transaction.slateId + .toString() + : _transaction.txid, + walletId: walletId, + )), + ) + ?.value ?? "", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1473,25 +1301,25 @@ e : const EdgeInsets.all(12), if (_sparkMemo != null) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Row( children: [ Text( "Memo", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), ], ), @@ -1499,20 +1327,20 @@ e : const EdgeInsets.all(12), SelectableText( _sparkMemo!, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1522,28 +1350,28 @@ e : const EdgeInsets.all(12), : const SizedBox(height: 12), RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Date", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1553,20 +1381,20 @@ e : const EdgeInsets.all(12), _transaction.timestamp, ), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1576,20 +1404,20 @@ e : const EdgeInsets.all(12), _transaction.timestamp, ), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton( @@ -1600,7 +1428,6 @@ e : const EdgeInsets.all(12), ], ), ), -<<<<<<< if (coin is! NanoCurrency && !(coin is Xelis && _transaction.type == @@ -1614,98 +1441,48 @@ e : const EdgeInsets.all(12), TransactionType.incoming)) RoundedWhiteContainer( padding: - isDesktop -======= - isDesktop - ? const _Divider() - : const SizedBox( - height: 12, - ), - Builder( - builder: (context) { - final String height; - final String confirmations; - final confirms = _transaction.getConfirmations( - currentHeight, - ); - - if (widget.coin is Bitcoincash || - widget.coin is Ecash) { - height = _transaction.height != null && - _transaction.height! > 0 - ? "${_transaction.height!}" - : "Pending"; - confirmations = confirms.toString(); - } else if (widget.coin is Epiccash || - coin is Mimblewimblecoin && - _transaction.slateId == null) { - confirmations = "Unknown"; - height = "Unknown"; - } else { - final confirmed = _transaction.isConfirmed( - currentHeight, - minConfirms, - coin.minCoinbaseConfirms); - if (widget.coin is! Epiccash && - widget.coin is! Mimblewimblecoin && - confirmed) { - height = - "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; - } else { - height = confirms > 0 - ? "${_transaction.height}" - : "Pending"; - } - - confirmations = confirms.toString(); - } - - return Column( - children: [ - RoundedWhiteContainer( - padding: isDesktop ->>>>>>> - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Builder( builder: (context) { final String feeString = - showFeePending - ? _transaction.isConfirmed( - currentHeight, - minConfirms, - coin.minCoinbaseConfirms, - ) - ? ref - .watch( - pAmountFormatter(coin), - ) - .format(fee) - : "Pending" - : ref - .watch(pAmountFormatter(coin)) - .format(fee); + showFeePending + ? _transaction.isConfirmed( + currentHeight, + minConfirms, + coin.minCoinbaseConfirms, + ) + ? ref + .watch( + pAmountFormatter(coin), + ) + .format(fee) + : "Pending" + : ref + .watch(pAmountFormatter(coin)) + .format(fee); return Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Transaction fee", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1713,22 +1490,22 @@ e : const EdgeInsets.all(12), SelectableText( feeString, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (supportsRbf && !confirmedTxn) const SizedBox(height: 8), @@ -1743,20 +1520,20 @@ e : const EdgeInsets.all(12), SelectableText( feeString, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: feeString), @@ -1778,10 +1555,10 @@ e : const EdgeInsets.all(12), if (widget.coin is Bitcoincash || widget.coin is Ecash) { height = - _transaction.height != null && - _transaction.height! > 0 - ? "${_transaction.height!}" - : "Pending"; + _transaction.height != null && + _transaction.height! > 0 + ? "${_transaction.height!}" + : "Pending"; confirmations = confirms.toString(); } else if (widget.coin is Epiccash && _transaction.slateId == null) { @@ -1795,12 +1572,12 @@ e : const EdgeInsets.all(12), ); if (widget.coin is! Epiccash && confirmed) { height = - "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; + "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; } else { height = - confirms > 0 - ? "${_transaction.height}" - : "Pending"; + confirms > 0 + ? "${_transaction.height}" + : "Pending"; } confirmations = confirms.toString(); @@ -1810,29 +1587,29 @@ e : const EdgeInsets.all(12), children: [ RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Block height", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1840,22 +1617,22 @@ e : const EdgeInsets.all(12), SelectableText( height, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1863,20 +1640,20 @@ e : const EdgeInsets.all(12), SelectableText( height, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: height), @@ -1888,29 +1665,29 @@ e : const EdgeInsets.all(12), : const SizedBox(height: 12), RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Confirmations", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1918,22 +1695,22 @@ e : const EdgeInsets.all(12), SelectableText( confirmations, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1941,20 +1718,20 @@ e : const EdgeInsets.all(12), SelectableText( confirmations, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: height), @@ -1974,43 +1751,43 @@ e : const EdgeInsets.all(12), _transaction.type != TransactionType.incoming) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( "Nonce", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), SelectableText( _transaction.nonce.toString(), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -2022,548 +1799,359 @@ e : const EdgeInsets.all(12), if (kDebugMode) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( "Tx sub type", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), SelectableText( _transaction.subType.toString(), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), - ), - ], - ), - ), - if (hasTxKeyProbably) - isDesktop - ? const _Divider() - : const SizedBox(height: 12), - if (hasTxKeyProbably) - TxKeyWidget( - walletId: walletId, - txid: _transaction.txid, - ), - isDesktop - ? const _Divider() - : const SizedBox(height: 12), - - _transaction.txid.startsWith("mweb_outputId_") && - _transaction.subType == - TransactionSubType.mweb - ? RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ConditionalParent( - condition: !isDesktop, - builder: - (child) => Row( - children: [ - Expanded(child: child), - SimpleCopyButton( - data: _transaction - .txid - .replaceFirst( - "mweb_outputId_", - "", - ), - ), - ], - ), - child: Text( - "MWEB Output ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), - ), - ), - const SizedBox(height: 8), - SelectableText( - _transaction.txid.replaceFirst( - "mweb_outputId_", - "", - ), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), - ), - // if (coin is Litecoin && - // coin.network == - // CryptoCurrencyNetwork - // .main) - // const SizedBox(height: 8), - // if (coin is Litecoin && - // coin.network == - // CryptoCurrencyNetwork - // .main) - // CustomTextButton( - // text: - // "Open in block explorer", - // onTap: () async { - // final uri = - // getBlockExplorerTransactionUrlFor( - // coin: coin, - // txid: _transaction - // .txid - // .replaceFirst( - // "mweb_outputId_", - // "", - // ), - // ); - // - // if (ref - // .read( - // prefsChangeNotifierProvider, - // ) - // .hideBlockExplorerWarning == - // false) { - // final shouldContinue = - // await showExplorerWarning( - // "${uri.scheme}://${uri.host}", - // ); - // - // if (!shouldContinue) { - // return; - // } - // } - // try { - // await launchUrl( - // uri, - // mode: - // LaunchMode - // .externalApplication, - // ); - // } catch (_) { - // if (context.mounted) { - // unawaited( - // showDialog( - // context: context, - // builder: - // ( - // _, - // ) => StackOkDialog( - // title: - // "Could not open in block explorer", - // message: - // "Failed to open \"${uri.toString()}\"", - // ), - // ), - // ); - // } - // } - // }, - // ), - ], - ), - ), - if (isDesktop) - const SizedBox(width: 12), - if (isDesktop) - IconCopyButton( - data: _transaction.txid - .replaceFirst( - "mweb_outputId_", - "", - ), -<<<<<<< - -======= - ), - if (coin is! Epiccash && - coin is! Mimblewimblecoin) - const SizedBox( - height: 8, ->>>>>>> - ), -<<<<<<< - -======= - if (coin is! Epiccash && - coin is! Mimblewimblecoin) - CustomTextButton( - text: "Open in block explorer", - onTap: () async { - final uri = - getBlockExplorerTransactionUrlFor( - coin: coin, - txid: _transaction.txid, - ); - - if (ref - .read( - prefsChangeNotifierProvider, - ) - .hideBlockExplorerWarning == - false) { - final shouldContinue = - await showExplorerWarning( - "${uri.scheme}://${uri.host}", - ); - - if (!shouldContinue) { - return; - } - } - - // ref - // .read( - // shouldShowLockscreenOnResumeStateProvider - // .state) - // .state = false; - try { - await launchUrl( - uri, - mode: LaunchMode - .externalApplication, - ); - } catch (_) { - if (mounted) { - unawaited( - showDialog( - context: context, - builder: (_) => - StackOkDialog( - title: - "Could not open in block explorer", - message: - "Failed to open \"${uri.toString()}\"", - ), - ), - ); - } - } finally { - // Future.delayed( - // const Duration(seconds: 1), - // () => ref - // .read( - // shouldShowLockscreenOnResumeStateProvider - // .state) - // .state = true, - // ); - } - }, - ), - // ), - // ), ->>>>>>> - ], - ), -<<<<<<< - ) - : RoundedWhiteContainer( - padding: + style: isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Row( -======= + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), + ), + ], ), - if (isDesktop) - const SizedBox( - width: 12, - ), - if (isDesktop) - IconCopyButton( - data: _transaction.txid, - ), - ], - ), - ), - // if ((coin is FiroTestNet || coin is Firo) && - // _transaction.subType == "mint") - // const SizedBox( - // height: 12, - // ), - // if ((coin is FiroTestNet || coin is Firo) && - // _transaction.subType == "mint") - // RoundedWhiteContainer( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Text( - // "Mint Transaction ID", - // style: STextStyles.itemSubtitle(context), - // ), - // ], - // ), - // const SizedBox( - // height: 8, - // ), - // // Flexible( - // // child: FittedBox( - // // fit: BoxFit.scaleDown, - // // child: - // SelectableText( - // _transaction.otherData ?? "Unknown", - // style: STextStyles.itemSubtitle12(context), - // ), - // // ), - // // ), - // const SizedBox( - // height: 8, - // ), - // BlueTextButton( - // text: "Open in block explorer", - // onTap: () async { - // final uri = getBlockExplorerTransactionUrlFor( - // coin: coin, - // txid: _transaction.otherData ?? "Unknown", - // ); - // // ref - // // .read( - // // shouldShowLockscreenOnResumeStateProvider - // // .state) - // // .state = false; - // try { - // await launchUrl( - // uri, - // mode: LaunchMode.externalApplication, - // ); - // } catch (_) { - // unawaited(showDialog( - // context: context, - // builder: (_) => StackOkDialog( - // title: "Could not open in block explorer", - // message: - // "Failed to open \"${uri.toString()}\"", - // ), - // )); - // } finally { - // // Future.delayed( - // // const Duration(seconds: 1), - // // () => ref - // // .read( - // // shouldShowLockscreenOnResumeStateProvider - // // .state) - // // .state = true, - // // ); - // } - // }, - // ), - // ], - // ), - // ), - if (coin is Epiccash || coin is Mimblewimblecoin) + ), + if (hasTxKeyProbably) + isDesktop + ? const _Divider() + : const SizedBox(height: 12), + if (hasTxKeyProbably) + TxKeyWidget( + walletId: walletId, + txid: _transaction.txid, + ), isDesktop ? const _Divider() - : const SizedBox( - height: 12, - ), - if (coin is Epiccash || coin is Mimblewimblecoin) - RoundedWhiteContainer( - padding: isDesktop + : const SizedBox(height: 12), + + _transaction.txid.startsWith("mweb_outputId_") && + _transaction.subType == + TransactionSubType.mweb + ? RoundedWhiteContainer( + padding: + isDesktop ? const EdgeInsets.all(16) : const EdgeInsets.all(12), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ - Column( ->>>>>>> - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ConditionalParent( - condition: !isDesktop, - builder: - (child) => Row( - children: [ - Expanded(child: child), - SimpleCopyButton( - data: - _transaction.txid, - ), - ], - ), - child: Text( - "Transaction ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ConditionalParent( + condition: !isDesktop, + builder: + (child) => Row( + children: [ + Expanded(child: child), + SimpleCopyButton( + data: _transaction + .txid + .replaceFirst( + "mweb_outputId_", + "", + ), ), + ], + ), + child: Text( + "MWEB Output ID", + style: + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, ), - const SizedBox(height: 8), - // Flexible( - // child: FittedBox( - // fit: BoxFit.scaleDown, - // child: - SelectableText( - _transaction.txid, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), - ), - if (coin is! Epiccash) - const SizedBox(height: 8), - if (coin is! Epiccash) - CustomTextButton( - text: - "Open in block explorer", - onTap: () async { - final uri = - getBlockExplorerTransactionUrlFor( - coin: coin, - txid: - _transaction.txid, - ); - - if (ref - .read( - prefsChangeNotifierProvider, - ) - .hideBlockExplorerWarning == - false) { - final shouldContinue = - await showExplorerWarning( - "${uri.scheme}://${uri.host}", - ); - - if (!shouldContinue) { - return; - } - } - - // ref - // .read( - // shouldShowLockscreenOnResumeStateProvider - // .state) - // .state = false; - try { - await launchUrl( - uri, - mode: - LaunchMode - .externalApplication, - ); - } catch (_) { - if (context.mounted) { - unawaited( - showDialog( - context: context, - builder: - ( - _, - ) => StackOkDialog( - title: - "Could not open in block explorer", - message: - "Failed to open \"${uri.toString()}\"", - ), - ), - ); - } - } finally { - // Future.delayed( - // const Duration(seconds: 1), - // () => ref - // .read( - // shouldShowLockscreenOnResumeStateProvider - // .state) - // .state = true, - // ); - } - }, - ), - // ), - // ), - ], + ), ), + const SizedBox(height: 8), + SelectableText( + _transaction.txid.replaceFirst( + "mweb_outputId_", + "", + ), + style: + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), + ), + // if (coin is Litecoin && + // coin.network == + // CryptoCurrencyNetwork + // .main) + // const SizedBox(height: 8), + // if (coin is Litecoin && + // coin.network == + // CryptoCurrencyNetwork + // .main) + // CustomTextButton( + // text: + // "Open in block explorer", + // onTap: () async { + // final uri = + // getBlockExplorerTransactionUrlFor( + // coin: coin, + // txid: _transaction + // .txid + // .replaceFirst( + // "mweb_outputId_", + // "", + // ), + // ); + // + // if (ref + // .read( + // prefsChangeNotifierProvider, + // ) + // .hideBlockExplorerWarning == + // false) { + // final shouldContinue = + // await showExplorerWarning( + // "${uri.scheme}://${uri.host}", + // ); + // + // if (!shouldContinue) { + // return; + // } + // } + // try { + // await launchUrl( + // uri, + // mode: + // LaunchMode + // .externalApplication, + // ); + // } catch (_) { + // if (context.mounted) { + // unawaited( + // showDialog( + // context: context, + // builder: + // ( + // _, + // ) => StackOkDialog( + // title: + // "Could not open in block explorer", + // message: + // "Failed to open \"${uri.toString()}\"", + // ), + // ), + // ); + // } + // } + // }, + // ), + ], + ), + ), + if (isDesktop) + const SizedBox(width: 12), + if (isDesktop) + IconCopyButton( + data: _transaction.txid + .replaceFirst( + "mweb_outputId_", + "", ), - if (isDesktop) - const SizedBox(width: 12), - if (isDesktop) - IconCopyButton( - data: _transaction.txid, + ), + ], + ), + ) + : RoundedWhiteContainer( + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ConditionalParent( + condition: !isDesktop, + builder: + (child) => Row( + children: [ + Expanded(child: child), + SimpleCopyButton( + data: + _transaction.txid, + ), + ], + ), + child: Text( + "Transaction ID", + style: + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), + ), ), - ], + const SizedBox(height: 8), + // Flexible( + // child: FittedBox( + // fit: BoxFit.scaleDown, + // child: + SelectableText( + _transaction.txid, + style: + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), + ), + if (coin is! Epiccash) + const SizedBox(height: 8), + if (coin is! Epiccash) + CustomTextButton( + text: + "Open in block explorer", + onTap: () async { + final uri = + getBlockExplorerTransactionUrlFor( + coin: coin, + txid: + _transaction.txid, + ); + + if (ref + .read( + prefsChangeNotifierProvider, + ) + .hideBlockExplorerWarning == + false) { + final shouldContinue = + await showExplorerWarning( + "${uri.scheme}://${uri.host}", + ); + + if (!shouldContinue) { + return; + } + } + + // ref + // .read( + // shouldShowLockscreenOnResumeStateProvider + // .state) + // .state = false; + try { + await launchUrl( + uri, + mode: + LaunchMode + .externalApplication, + ); + } catch (_) { + if (context.mounted) { + unawaited( + showDialog( + context: context, + builder: + ( + _, + ) => StackOkDialog( + title: + "Could not open in block explorer", + message: + "Failed to open \"${uri.toString()}\"", + ), + ), + ); + } + } finally { + // Future.delayed( + // const Duration(seconds: 1), + // () => ref + // .read( + // shouldShowLockscreenOnResumeStateProvider + // .state) + // .state = true, + // ); + } + }, + ), + // ), + // ), + ], + ), ), - ), + if (isDesktop) + const SizedBox(width: 12), + if (isDesktop) + IconCopyButton( + data: _transaction.txid, + ), + ], + ), + ), // if ((coin is FiroTestNet || coin is Firo) && // _transaction.subType == "mint") // const SizedBox( @@ -2648,29 +2236,29 @@ e : const EdgeInsets.all(12), if (coin is Epiccash) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Slate ID", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), // Flexible( // child: FittedBox( @@ -2679,20 +2267,20 @@ e : const EdgeInsets.all(12), SelectableText( _transaction.slateId ?? "Unknown", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), // ), // ), @@ -2702,7 +2290,7 @@ e : const EdgeInsets.all(12), if (isDesktop) IconCopyButton( data: - _transaction.slateId ?? "Unknown", + _transaction.slateId ?? "Unknown", ), ], ), @@ -2730,199 +2318,106 @@ e : const EdgeInsets.all(12), ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, -<<<<<<< floatingActionButton: - (coin is Epiccash && - _transaction.getConfirmations(currentHeight) < 1 && - _transaction.isCancelled == false) - ? ConditionalParent( - condition: isDesktop, - builder: - (child) => Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 16, - ), - child: child, -======= - floatingActionButton: (coin is Epiccash || - coin is Mimblewimblecoin && - _transaction.getConfirmations(currentHeight) < 1 && - _transaction.isCancelled == false) + (coin is Epiccash && + _transaction.getConfirmations(currentHeight) < 1 && + _transaction.isCancelled == false) ? ConditionalParent( - condition: isDesktop, - builder: (child) => Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 16, - ), - child: child, + condition: isDesktop, + builder: + (child) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: 32, + vertical: 16, + ), + child: child, + ), + child: SizedBox( + width: MediaQuery.of(context).size.width - 32, + child: TextButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + Theme.of(context).extension()!.textError, ), - child: SizedBox( - width: MediaQuery.of(context).size.width - 32, - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Theme.of(context).extension()!.textError, ->>>>>>> - ), - child: SizedBox( - width: MediaQuery.of(context).size.width - 32, - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Theme.of(context).extension()!.textError, - ), - ), - onPressed: () async { - final wallet = ref.read(pWallets).getWallet(walletId); - - if (wallet is EpiccashWallet) { - final String? id = _transaction.slateId; - if (id == null) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Could not find Epic transaction ID", - context: context, - ), - ); - return; - } - - unawaited( - showDialog( - barrierDismissible: false, - context: context, - builder: - (_) => - const CancellingTransactionProgressDialog(), - ), - ); - - final result = await wallet - .cancelPendingTransactionAndPost(id); - if (context.mounted) { - // pop progress dialog - Navigator.of(context).pop(); - - if (result.isEmpty) { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Transaction cancelled", - onOkPressed: (_) { - wallet.refresh(); - Navigator.of(context).popUntil( - ModalRoute.withName( - WalletView.routeName, - ), - ); - }, - ), - ); - } else { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Failed to cancel transaction", - message: result, - ), - ); - } - } - } else { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash", - context: context, - ), - ); - return; - } -<<<<<<< - }, - child: Text( - "Cancel Transaction", - style: STextStyles.button(context), + ), + onPressed: () async { + final wallet = ref.read(pWallets).getWallet(walletId); + + if (wallet is EpiccashWallet) { + final String? id = _transaction.slateId; + if (id == null) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Could not find Epic transaction ID", + context: context, ), -======= - } else if (wallet is MimblewimblecoinWallet) { - final String? id = _transaction.slateId; - if (id == null) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: - "Could not find Mimblewimblecoin transaction ID", - context: context, - ), - ); - return; - } - - unawaited( - showDialog( - barrierDismissible: false, - context: context, - builder: (_) => - const CancellingTransactionProgressDialog(), - ), - ); - - final result = - await wallet.cancelPendingTransactionAndPost(id); - if (mounted) { - // pop progress dialog - Navigator.of(context).pop(); - - if (result.isEmpty) { - await showDialog( - context: context, - builder: (_) => StackOkDialog( - title: "Transaction cancelled", - onOkPressed: (_) { - wallet.refresh(); - Navigator.of(context).popUntil( - ModalRoute.withName( - WalletView.routeName, - ), - ); - }, - ), - ); - } else { - await showDialog( - context: context, - builder: (_) => StackOkDialog( - title: "Failed to cancel transaction", - message: result, + ); + return; + } + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: + (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = await wallet + .cancelPendingTransactionAndPost(id); + if (context.mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: + (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + wallet.refresh(); + Navigator.of(context).popUntil( + ModalRoute.withName( + WalletView.routeName, ), ); - } - } - } else { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", - context: context, - ), - ); - return; - } - }, - child: Text( - "Cancel Transaction", - style: STextStyles.button(context), ->>>>>>> + }, + ), + ); + } else { + await showDialog( + context: context, + builder: + (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + ), + ); + } + } + } else { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: "ERROR: Wallet type is not Epic Cash", + context: context, ), - ), - ) - : null, + ); + return; + } + }, + child: Text( + "Cancel Transaction", + style: STextStyles.button(context), + ), + ), + ), + ) + : null, ), ); } @@ -2948,18 +2443,18 @@ class OutputCard extends ConsumerWidget { Text( "Address", style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.itemSubtitle(context), + Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.itemSubtitle(context), ), SelectableText( address, style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context).extension()!.textDark, - ) - : STextStyles.itemSubtitle12(context), + Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context).copyWith( + color: Theme.of(context).extension()!.textDark, + ) + : STextStyles.itemSubtitle12(context), ), const SizedBox(height: 10), Row( @@ -2968,23 +2463,23 @@ class OutputCard extends ConsumerWidget { Text( "Amount", style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.itemSubtitle(context), + Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.itemSubtitle(context), ), SelectableText( ref.watch(pAmountFormatter(coin)).format(amount), style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark, - ) - : STextStyles.itemSubtitle12(context), + Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ).extension()!.textDark, + ) + : STextStyles.itemSubtitle12(context), ), ], ), @@ -3017,7 +2512,7 @@ class IconCopyButton extends StatelessWidget { width: 26, child: RawMaterialButton( fillColor: - Theme.of(context).extension()!.buttonBackSecondary, + Theme.of(context).extension()!.buttonBackSecondary, elevation: 0, hoverElevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), @@ -3058,7 +2553,7 @@ class IconPencilButton extends StatelessWidget { width: 26, child: RawMaterialButton( fillColor: - Theme.of(context).extension()!.buttonBackSecondary, + Theme.of(context).extension()!.buttonBackSecondary, elevation: 0, hoverElevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), From 10f46559cc47afc02f6e20686ce99e98f6de7004 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 5 Sep 2025 12:17:48 -0500 Subject: [PATCH 043/178] fix(epic): fix sqlite column name errors in database queries --- crypto_plugins/flutter_libepiccash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libepiccash b/crypto_plugins/flutter_libepiccash index 25e6cb3a3e..ada6254ee8 160000 --- a/crypto_plugins/flutter_libepiccash +++ b/crypto_plugins/flutter_libepiccash @@ -1 +1 @@ -Subproject commit 25e6cb3a3e7bee04e425af6beccb47e8d0708fdb +Subproject commit ada6254ee8bab4a50e0d45bb6206a970dbac960d From 574e24ce51fef86611f2431b66da4c75c08bd83d Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 00:02:46 -0500 Subject: [PATCH 044/178] feat(mwc): MWCMQS, Slatepack txs. WIP UI --- crypto_plugins/flutter_libmwc | 2 +- lib/models/mwc_transaction_method.dart | 70 + lib/pages/receive_view/receive_view.dart | 22 + .../mwc_slatepack_import_dialog.dart | 587 +++++ .../send_view/confirm_transaction_view.dart | 119 +- lib/pages/send_view/send_view.dart | 398 +-- .../sub_widgets/mwc_slatepack_dialog.dart | 323 +++ .../mwc_transaction_method_selector.dart | 272 ++ .../tx_v2/transaction_v2_details_view.dart | 2344 +++++++++-------- .../sub_widgets/desktop_finalize.dart | 274 +- .../desktop_mwc_txs_method_toggle.dart | 36 +- .../sub_widgets/desktop_receive.dart | 22 +- .../wallet_view/sub_widgets/desktop_send.dart | 166 +- .../ui/preview_tx_button_state_provider.dart | 13 + lib/services/mwc_wallet_service.dart | 552 ++++ .../coins/mimblewimblecoin.dart | 92 +- .../wallet/impl/mimblewimblecoin_wallet.dart | 450 +++- 17 files changed, 4245 insertions(+), 1497 deletions(-) create mode 100644 lib/models/mwc_transaction_method.dart create mode 100644 lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart create mode 100644 lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart create mode 100644 lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart create mode 100644 lib/services/mwc_wallet_service.dart diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 2008080fd8..29c7ea5267 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 2008080fd8e3a68081f4ca1334c2568421539157 +Subproject commit 29c7ea526772a170d1f9488c4661333c0b2564fd diff --git a/lib/models/mwc_transaction_method.dart b/lib/models/mwc_transaction_method.dart new file mode 100644 index 0000000000..1663d834c6 --- /dev/null +++ b/lib/models/mwc_transaction_method.dart @@ -0,0 +1,70 @@ +/// Enum to represent different MWC transaction methods. +enum TransactionMethod { + /// Manual slatepack exchange (copy/paste, QR codes, files). + slatepack, + + /// Automatic transaction via MWCMQS. + mwcmqs, + + /// Direct HTTP/HTTPS to recipient's wallet. + http, + + /// Unknown or unsupported method. + unknown; + + /// Human readable name for the transaction method. + String get displayName { + switch (this) { + case TransactionMethod.slatepack: + return 'Slatepack'; + case TransactionMethod.mwcmqs: + return 'MWCMQS'; + case TransactionMethod.http: + return 'HTTP'; + case TransactionMethod.unknown: + return 'Unknown'; + } + } + + /// Description of how the transaction method works. + String get description { + switch (this) { + case TransactionMethod.slatepack: + return 'Manual exchange via text, QR codes, or files'; + case TransactionMethod.mwcmqs: + return 'Automatic exchange via MWCMQS messaging'; + case TransactionMethod.http: + return 'Direct connection to recipient wallet'; + case TransactionMethod.unknown: + return 'Unsupported transaction method'; + } + } + + /// Whether this method requires manual intervention. + bool get isManual { + switch (this) { + case TransactionMethod.slatepack: + return true; + case TransactionMethod.mwcmqs: + return false; + case TransactionMethod.http: + return false; + case TransactionMethod.unknown: + return true; + } + } + + /// Whether this method works offline. + bool get worksOffline { + switch (this) { + case TransactionMethod.slatepack: + return true; + case TransactionMethod.mwcmqs: + return false; + case TransactionMethod.http: + return false; + case TransactionMethod.unknown: + return false; + } + } +} diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index fe44acc9bf..e461978e2b 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -33,6 +33,7 @@ import '../../utilities/text_styles.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; import '../../wallets/isar/providers/wallet_info_provider.dart'; import '../../wallets/wallet/impl/bitcoin_wallet.dart'; +import '../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../wallets/wallet/intermediate/bip39_hd_wallet.dart'; import '../../wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart'; import '../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart'; @@ -51,6 +52,7 @@ import '../../widgets/qr.dart'; import '../../widgets/rounded_white_container.dart'; import 'addresses/wallet_addresses_view.dart'; import 'generate_receiving_uri_qr_code_view.dart'; +import 'sub_widgets/mwc_slatepack_import_dialog.dart'; class ReceiveView extends ConsumerStatefulWidget { const ReceiveView({ @@ -692,6 +694,26 @@ class _ReceiveViewState extends ConsumerState { ? generateNewSparkAddress : generateNewAddress, ), + // MWC Slatepack import button. + if (coin is Mimblewimblecoin) ...[ + const SizedBox(height: 12), + SecondaryButton( + label: "Import Slatepack", + onPressed: () async { + final wallet = ref.read(pWallets).getWallet(walletId); + if (wallet is MimblewimblecoinWallet) { + await showDialog( + context: context, + builder: + (context) => MwcSlatepackImportDialog( + wallet: wallet, + clipboard: clipboard, + ), + ); + } + }, + ), + ], const SizedBox(height: 30), RoundedWhiteContainer( child: Padding( diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart new file mode 100644 index 0000000000..300e11656d --- /dev/null +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -0,0 +1,587 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +import '../../../notifications/show_flush_bar.dart'; +import '../../../services/mwc_wallet_service.dart'; +import '../../../themes/stack_colors.dart'; +import '../../../utilities/assets.dart'; +import '../../../utilities/clipboard_interface.dart'; +import '../../../utilities/text_styles.dart'; +import '../../../wallets/crypto_currency/coins/mimblewimblecoin.dart'; +import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; +import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; +import '../../../widgets/desktop/primary_button.dart'; +import '../../../widgets/desktop/secondary_button.dart'; +import '../../../widgets/rounded_white_container.dart'; +import '../../../widgets/stack_dialog.dart'; + +class MwcSlatepackImportDialog extends ConsumerStatefulWidget { + const MwcSlatepackImportDialog({ + super.key, + required this.wallet, + this.clipboard = const ClipboardWrapper(), + }); + + final MimblewimblecoinWallet wallet; + final ClipboardInterface clipboard; + + @override + ConsumerState createState() => + _MwcSlatepackImportDialogState(); +} + +class _MwcSlatepackImportDialogState + extends ConsumerState { + late final TextEditingController slatepackController; + late final FocusNode slatepackFocusNode; + + bool _isProcessing = false; + String? _validationError; + SlatepackDecodeResult? _decodedSlatepack; + String? _slatepackType; + + @override + void initState() { + super.initState(); + slatepackController = TextEditingController(); + slatepackFocusNode = FocusNode(); + } + + @override + void dispose() { + slatepackController.dispose(); + slatepackFocusNode.dispose(); + super.dispose(); + } + + void _pasteFromClipboard() async { + try { + final data = await widget.clipboard.getData(Clipboard.kTextPlain); + if (data?.text != null) { + slatepackController.text = data!.text!; + _validateSlatepack(); + } + } catch (e) { + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Failed to paste from clipboard", + context: context, + ); + } + } + + void _validateSlatepack() async { + final text = slatepackController.text.trim(); + + if (text.isEmpty) { + setState(() { + _validationError = null; + _decodedSlatepack = null; + _slatepackType = null; + }); + return; + } + + // Basic format validation. + final coin = widget.wallet.cryptoCurrency as Mimblewimblecoin; + if (!coin.isSlatepack(text)) { + setState(() { + _validationError = "Invalid slatepack format"; + _decodedSlatepack = null; + _slatepackType = null; + }); + return; + } + + try { + // Attempt to decode. + final decoded = await widget.wallet.decodeSlatepack(text); + + if (decoded.success) { + final analysis = await widget.wallet.analyzeSlatepack(text); + + final String slatepackType = switch (analysis.status) { + 'S1' => "S1 (Initial Send)", + 'S2' => "S2 (Response)", + 'S3' => "S3 (Finalized)", + _ => _determineSlatepackType(decoded), // Fallback. + }; + + setState(() { + _validationError = null; + _decodedSlatepack = decoded; + _slatepackType = slatepackType; + }); + } else { + setState(() { + _validationError = decoded.error ?? "Failed to decode slatepack"; + _decodedSlatepack = null; + _slatepackType = null; + }); + } + } catch (e) { + setState(() { + _validationError = "Error decoding slatepack: $e"; + _decodedSlatepack = null; + _slatepackType = null; + }); + } + } + + String _determineSlatepackType(SlatepackDecodeResult decoded) { + // Fallback analysis based on sender/recipient addresses. + if (decoded.senderAddress != null && decoded.recipientAddress != null) { + return "S2 (Response)"; + } else if (decoded.senderAddress != null) { + return "S1 (Initial)"; + } else { + return "Unknown"; + } + } + + void _processSlatepack() async { + if (_decodedSlatepack == null || slatepackController.text.trim().isEmpty) { + return; + } + + setState(() { + _isProcessing = true; + }); + + try { + final slatepackText = slatepackController.text.trim(); + + // Determine action based on slatepack type. + if (_slatepackType?.contains("S1") == true) { + // This is an initial slatepack - receive it and create response. + final result = await widget.wallet.receiveSlatepack(slatepackText); + + if (result.success && result.responseSlatepack != null) { + // Show response slatepack. + if (mounted) { + Navigator.of(context).pop(); // Close this dialog. + + await showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => _SlatepackResponseDialog( + responseSlatepack: result.responseSlatepack!, + wasEncrypted: result.wasEncrypted ?? false, + clipboard: widget.clipboard, + ), + ); + } + } else { + throw Exception(result.error ?? 'Failed to process slatepack'); + } + } else if (_slatepackType?.contains("S2") == true) { + // This is a response slatepack - finalize it. + final result = await widget.wallet.finalizeSlatepack(slatepackText); + + if (result.success) { + if (mounted) { + Navigator.of(context).pop(); // Close this dialog. + + showFloatingFlushBar( + type: FlushBarType.success, + message: "Transaction finalized and broadcast successfully!", + context: context, + ); + } + } else { + throw Exception(result.error ?? 'Failed to finalize slatepack'); + } + } else { + throw Exception('Unsupported slatepack type: $_slatepackType'); + } + } catch (e) { + if (mounted) { + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Failed to process slatepack: $e", + context: context, + ); + } + } finally { + if (mounted) { + setState(() { + _isProcessing = false; + }); + } + } + } + + @override + Widget build(BuildContext context) { + final isDesktop = + Platform.isLinux || Platform.isMacOS || Platform.isWindows; + final canProcess = _decodedSlatepack != null && !_isProcessing; + + return StackDialogBase( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Import Slatepack", style: STextStyles.pageTitleH2(context)), + AppBarIconButton( + size: 36, + color: Theme.of(context).extension()!.background, + shadows: const [], + icon: SvgPicture.asset( + Assets.svg.x, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, + width: 24, + height: 24, + ), + onPressed: + _isProcessing ? null : () => Navigator.of(context).pop(), + ), + ], + ), + const SizedBox(height: 16), + Padding( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + "Paste or enter a slatepack to process the transaction.", + style: STextStyles.subtitle(context), + textAlign: TextAlign.center, + ), + const SizedBox(height: 24), + + // Slatepack input field. + Container( + decoration: BoxDecoration( + color: + Theme.of( + context, + ).extension()!.textFieldDefaultBG, + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: + Theme.of(context) + .extension()! + .textFieldDefaultSearchIconLeft, + ), + ), + child: TextField( + controller: slatepackController, + focusNode: slatepackFocusNode, + maxLines: 8, + onChanged: (_) => _validateSlatepack(), + decoration: InputDecoration( + hintText: "BEGINSLATEPACK...", + labelText: "Slatepack", + border: InputBorder.none, + contentPadding: const EdgeInsets.all(12), + suffixIcon: IconButton( + onPressed: _pasteFromClipboard, + icon: SvgPicture.asset( + Assets.svg.clipboard, + width: 16, + height: 16, + color: + Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, + ), + ), + ), + ), + ), + + // Validation status. + if (_validationError != null) ...[ + const SizedBox(height: 8), + Row( + children: [ + Icon( + Icons.error_outline, + size: 16, + color: + Theme.of( + context, + ).extension()!.textError, + ), + const SizedBox(width: 8), + Expanded( + child: Text( + _validationError!, + style: STextStyles.w400_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textError, + ), + ), + ), + ], + ), + ] else if (_decodedSlatepack != null) ...[ + const SizedBox(height: 8), + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon( + Icons.check_circle_outline, + size: 16, + color: + Theme.of( + context, + ).extension()!.accentColorGreen, + ), + const SizedBox(width: 8), + Text( + "Valid Slatepack", + style: STextStyles.label(context).copyWith( + color: + Theme.of(context) + .extension()! + .accentColorGreen, + ), + ), + ], + ), + const SizedBox(height: 8), + Text( + "Type: $_slatepackType", + style: STextStyles.w400_14(context), + ), + if (_decodedSlatepack!.wasEncrypted == true) + Text( + "Encrypted: Yes", + style: STextStyles.w400_14(context), + ), + if (_decodedSlatepack!.senderAddress != null) + Text( + "From: ${_decodedSlatepack!.senderAddress}", + style: STextStyles.w400_14(context), + ), + ], + ), + ), + ], + + const SizedBox(height: 24), + + // Action buttons. + if (isDesktop) ...[ + Row( + children: [ + Expanded( + child: SecondaryButton( + label: "Cancel", + onPressed: + _isProcessing + ? null + : () => Navigator.of(context).pop(), + ), + ), + const SizedBox(width: 12), + Expanded( + child: PrimaryButton( + label: _isProcessing ? "Processing..." : "Process", + onPressed: canProcess ? _processSlatepack : null, + ), + ), + ], + ), + ] else ...[ + PrimaryButton( + label: + _isProcessing ? "Processing..." : "Process Slatepack", + onPressed: canProcess ? _processSlatepack : null, + ), + const SizedBox(height: 12), + SecondaryButton( + label: "Cancel", + onPressed: + _isProcessing + ? null + : () => Navigator.of(context).pop(), + ), + ], + ], + ), + ), + ], + ), + ); + } +} + +class _SlatepackResponseDialog extends StatelessWidget { + const _SlatepackResponseDialog({ + required this.responseSlatepack, + required this.wasEncrypted, + required this.clipboard, + }); + + final String responseSlatepack; + final bool wasEncrypted; + final ClipboardInterface clipboard; + + void _copySlatepack(BuildContext context) { + clipboard.setData(ClipboardData(text: responseSlatepack)); + showFloatingFlushBar( + type: FlushBarType.info, + message: "Response slatepack copied to clipboard", + iconAsset: Assets.svg.copy, + context: context, + ); + } + + @override + Widget build(BuildContext context) { + return StackDialogBase( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Response Slatepack", + style: STextStyles.pageTitleH2(context), + ), + AppBarIconButton( + size: 36, + color: Theme.of(context).extension()!.background, + shadows: const [], + icon: SvgPicture.asset( + Assets.svg.x, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, + width: 24, + height: 24, + ), + onPressed: () => Navigator.of(context).pop(), + ), + ], + ), + const SizedBox(height: 16), + Padding( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "Return this slatepack to the sender to complete the transaction.", + style: STextStyles.subtitle(context), + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + + if (wasEncrypted) + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 8, + ), + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .infoItemIcons + .withOpacity(0.1), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.lock, + size: 16, + color: + Theme.of( + context, + ).extension()!.infoItemIcons, + ), + const SizedBox(width: 8), + Text( + "Encrypted Response", + style: STextStyles.label(context), + ), + ], + ), + ), + const SizedBox(height: 16), + + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + children: [ + Text( + "Response Slatepack", + style: STextStyles.itemSubtitle(context), + ), + const Spacer(), + GestureDetector( + onTap: () => _copySlatepack(context), + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.copy, + width: 10, + height: 10, + ), + const SizedBox(width: 4), + Text("Copy", style: STextStyles.link2(context)), + ], + ), + ), + ], + ), + const SizedBox(height: 8), + Container( + constraints: const BoxConstraints( + maxHeight: 200, + minHeight: 100, + ), + child: SingleChildScrollView( + child: SelectableText( + responseSlatepack, + style: STextStyles.w400_14( + context, + ).copyWith(fontFamily: 'monospace'), + ), + ), + ), + ], + ), + ), + + const SizedBox(height: 24), + PrimaryButton( + label: "Copy Response", + onPressed: () => _copySlatepack(context), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index b584b036d0..d30e62fef7 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -9,12 +9,12 @@ */ import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_libepiccash/lib.dart'; -import 'package:flutter_libmwc/lib.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -41,6 +41,7 @@ import '../../wallets/isar/providers/eth/current_token_wallet_provider.dart'; import '../../wallets/isar/providers/wallet_info_provider.dart'; import '../../wallets/models/tx_data.dart'; import '../../wallets/wallet/impl/firo_wallet.dart'; +import '../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart'; import '../../widgets/background.dart'; import '../../widgets/conditional_parent.dart'; @@ -56,6 +57,7 @@ import '../../widgets/stack_text_field.dart'; import '../../widgets/textfield_icon_button.dart'; import '../pinpad_views/lock_screen_view.dart'; import '../wallet_view/wallet_view.dart'; +import 'sub_widgets/mwc_slatepack_dialog.dart'; import 'sub_widgets/sending_transaction_dialog.dart'; class ConfirmTransactionView extends ConsumerStatefulWidget { @@ -101,6 +103,83 @@ class _ConfirmTransactionViewState late final FocusNode _onChainNoteFocusNode; late final TextEditingController onChainNoteController; + /// Handle MWC slatepack creation for manual exchange. + Future _handleMwcSlatepackCreation( + BuildContext context, + MimblewimblecoinWallet wallet, + ) async { + try { + // Close the progress dialog first. + Navigator.of(context).pop(); + + // Get recipient information from txData. + final recipient = widget.txData.recipients?.first; + if (recipient == null) { + throw Exception('No recipient found in transaction data'); + } + + // Create slatepack. + final slatepackResult = await wallet.createSlatepack( + amount: recipient.amount, + recipientAddress: + recipient.address.isNotEmpty ? recipient.address : null, + message: + onChainNoteController.text.isNotEmpty + ? onChainNoteController.text + : null, + encrypt: + recipient + .address + .isNotEmpty, // Encrypt if we have a recipient address. + ); + + if (!slatepackResult.success || slatepackResult.slatepack == null) { + throw Exception(slatepackResult.error ?? 'Failed to create slatepack'); + } + + // Show slatepack dialog. + if (context.mounted) { + await showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => MwcSlatepackDialog(slatepackResult: slatepackResult), + ); + + // After slatepack dialog is closed, navigate back to wallet. + if (context.mounted) { + widget.onSuccess.call(); + if (widget.onSuccessInsteadOfRouteOnSuccess == null) { + Navigator.of( + context, + ).popUntil(ModalRoute.withName(routeOnSuccessName)); + } else { + widget.onSuccessInsteadOfRouteOnSuccess!.call(); + } + } + } + } catch (e, s) { + Logging.instance.e('Failed to create MWC slatepack: $e\n$s'); + + if (context.mounted) { + await showDialog( + context: context, + builder: + (context) => AlertDialog( + title: const Text('Slatepack Creation Failed'), + content: Text('Failed to create slatepack: $e'), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: const Text('OK'), + ), + ], + ), + ); + } + } + } + Future _attemptSend(BuildContext context) async { final wallet = ref.read(pWallets).getWallet(walletId); final coin = wallet.info.coin; @@ -157,7 +236,31 @@ class _ConfirmTransactionViewState break; } } else { - if (coin is Epiccash || coin is Mimblewimblecoin) { + if (coin is Mimblewimblecoin) { + // Check if this is a slatepack transaction (manual exchange). + final otherDataMap = + widget.txData.otherData != null + ? jsonDecode(widget.txData.otherData!) + : null; + final transactionMethod = + otherDataMap?['transactionMethod'] as String?; + + if (transactionMethod == 'slatepack') { + // Handle slatepack creation instead of direct send. + await _handleMwcSlatepackCreation( + context, + wallet as MimblewimblecoinWallet, + ); + return; // Exit early, don't continue with normal transaction flow. + } else { + // Handle MWCMQS or HTTP transactions normally. + txDataFuture = wallet.confirmSend( + txData: widget.txData.copyWith( + noteOnChain: onChainNoteController.text, + ), + ); + } + } else if (coin is Epiccash) { txDataFuture = wallet.confirmSend( txData: widget.txData.copyWith( noteOnChain: onChainNoteController.text, @@ -566,9 +669,7 @@ class _ConfirmTransactionViewState ), if ((coin is Epiccash || coin is Mimblewimblecoin) && widget.txData.noteOnChain!.isNotEmpty) - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), if ((coin is Epiccash || coin is Mimblewimblecoin) && widget.txData.noteOnChain!.isNotEmpty) RoundedWhiteContainer( @@ -941,9 +1042,7 @@ class _ConfirmTransactionViewState textAlign: TextAlign.left, ), if (coin is Epiccash || coin is Mimblewimblecoin) - const SizedBox( - height: 8, - ), + const SizedBox(height: 8), if (coin is Epiccash || coin is Mimblewimblecoin) ClipRRect( borderRadius: BorderRadius.circular( @@ -987,9 +1086,7 @@ class _ConfirmTransactionViewState ), ), if (coin is Epiccash || coin is Mimblewimblecoin) - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), SelectableText( (coin is Epiccash || coin is Mimblewimblecoin) ? "Local Note (optional)" diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 923283bb70..795befa109 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -9,6 +9,7 @@ */ import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:cs_monero/cs_monero.dart' as lib_monero; @@ -21,6 +22,7 @@ import 'package:tuple/tuple.dart'; import '../../models/input.dart'; import '../../models/isar/models/isar_models.dart'; +import '../../models/mwc_transaction_method.dart'; import '../../models/paynym/paynym_account_lite.dart'; import '../../models/send_view_auto_fill_data.dart'; import '../../providers/providers.dart'; @@ -76,6 +78,7 @@ import '../coin_control/coin_control_view.dart'; import 'confirm_transaction_view.dart'; import 'sub_widgets/building_transaction_dialog.dart'; import 'sub_widgets/dual_balance_selection_sheet.dart'; +import 'sub_widgets/mwc_transaction_method_selector.dart'; import 'sub_widgets/transaction_fee_selection_sheet.dart'; class SendView extends ConsumerStatefulWidget { @@ -145,6 +148,9 @@ class _SendViewState extends ConsumerState { Set selectedUTXOs = {}; + // MWC transaction method selection. + TransactionMethod? _selectedTransactionMethod; + void _applyUri(PaymentUriData paymentData) { try { // auto fill address @@ -846,6 +852,40 @@ class _SendViewState extends ConsumerState { ); } else { final memo = coin is Stellar ? memoController.text : null; + + // For MWC, determine transaction method and add it to otherData. + Map? otherData; + if (coin is Mimblewimblecoin) { + String transactionMethod = 'slatepack'; // Default to slatepack. + + if (_selectedTransactionMethod != null) { + switch (_selectedTransactionMethod!) { + case TransactionMethod.slatepack: + transactionMethod = 'slatepack'; + break; + case TransactionMethod.mwcmqs: + transactionMethod = 'mwcmqs'; + break; + case TransactionMethod.http: + transactionMethod = 'http'; + break; + case TransactionMethod.unknown: + // Auto-detect from address format. + final mwcCoin = coin as Mimblewimblecoin; + final method = mwcCoin.getTransactionMethod(_address!); + transactionMethod = method.toString().split('.').last; + break; + } + } else { + // Auto-detect from address format if no method selected. + final mwcCoin = coin as Mimblewimblecoin; + final method = mwcCoin.getTransactionMethod(_address!); + transactionMethod = method.toString().split('.').last; + } + + otherData = {'transactionMethod': transactionMethod}; + } + txDataFuture = wallet.prepareSend( txData: TxData( recipients: [ @@ -860,6 +900,10 @@ class _SendViewState extends ConsumerState { feeRateType: ref.read(feeRateTypeMobileStateProvider), satsPerVByte: isCustomFee.value ? customFeeRate : null, ethEIP1559Fee: ethFee, + otherData: + otherData != null + ? jsonEncode(otherData) + : null, // Include MWC transaction method info. utxos: (wallet is CoinControlInterface && coinControlEnabled && @@ -1091,6 +1135,12 @@ class _SendViewState extends ConsumerState { WidgetsBinding.instance.addPostFrameCallback((_) { ref.refresh(feeSheetSessionCacheProvider); ref.refresh(pIsExchangeAddress); + + // Initialize MWC transaction method to default (non-slatepack). + if (coin is Mimblewimblecoin) { + ref.read(pSelectedMwcTransactionMethod.notifier).state = + null; // No method selected initially. + } }); isCustomFee.addListener(() { if (!isCustomFee.value) { @@ -1483,186 +1533,222 @@ class _SendViewState extends ConsumerState { ), ), const SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - isPaynymSend - ? "Send to PayNym address" - : "Send to", - style: STextStyles.smallMed12(context), - textAlign: TextAlign.left, - ), - // if (coin is Monero) - // CustomTextButton( - // text: "Use OpenAlias", - // onTap: () async { - // await showModalBottomSheet( - // context: context, - // builder: (context) => - // OpenAliasBottomSheet( - // onSelected: (address) { - // sendToController.text = address; - // }, - // ), - // ); - // }, - // ), - ], - ), - const SizedBox(height: 8), - if (isPaynymSend) - TextField( - key: const Key("sendViewPaynymAddressFieldKey"), - controller: sendToController, - enabled: false, - readOnly: true, - style: STextStyles.fieldLabel(context), + + // MWC Transaction Method Selector (moved before "Send to" field). + if (coin is Mimblewimblecoin) ...[ + MwcTransactionMethodSelector( + onMethodSelected: (method) { + setState(() { + _selectedTransactionMethod = method; + }); + // Update the provider as well. + ref + .read( + pSelectedMwcTransactionMethod.notifier, + ) + .state = method; + }, + selectedMethod: _selectedTransactionMethod, + addressText: sendToController.text.trim(), ), - if (!isPaynymSend) - ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - child: TextField( - key: const Key("sendViewAddressFieldKey"), + const SizedBox(height: 16), + ], + + // Hide "Send to" field for MWC slatepack transactions. + if (!(coin is Mimblewimblecoin && + _selectedTransactionMethod == + TransactionMethod.slatepack)) ...[ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + isPaynymSend + ? "Send to PayNym address" + : "Send to", + style: STextStyles.smallMed12(context), + textAlign: TextAlign.left, + ), + // if (coin is Monero) + // CustomTextButton( + // text: "Use OpenAlias", + // onTap: () async { + // await showModalBottomSheet( + // context: context, + // builder: (context) => + // OpenAliasBottomSheet( + // onSelected: (address) { + // sendToController.text = address; + // }, + // ), + // ); + // }, + // ), + ], + ), + const SizedBox(height: 8), + if (isPaynymSend) + TextField( + key: const Key( + "sendViewPaynymAddressFieldKey", + ), controller: sendToController, - readOnly: false, - autocorrect: false, - enableSuggestions: false, - // inputFormatters: [ - // FilteringTextInputFormatter.allow( - // RegExp("[a-zA-Z0-9]{34}")), - // ], - toolbarOptions: const ToolbarOptions( - copy: false, - cut: false, - paste: true, - selectAll: false, + enabled: false, + readOnly: true, + style: STextStyles.fieldLabel(context), + ), + if (!isPaynymSend) + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, ), - onChanged: (newValue) async { - final trimmed = newValue.trim(); - - if ((trimmed.length - - (_address?.length ?? 0)) - .abs() > - 1) { - final parsed = - AddressUtils.parsePaymentUri( - trimmed, - logging: Logging.instance, + child: TextField( + key: const Key("sendViewAddressFieldKey"), + controller: sendToController, + readOnly: false, + autocorrect: false, + enableSuggestions: false, + // inputFormatters: [ + // FilteringTextInputFormatter.allow( + // RegExp("[a-zA-Z0-9]{34}")), + // ], + toolbarOptions: const ToolbarOptions( + copy: false, + cut: false, + paste: true, + selectAll: false, + ), + onChanged: (newValue) async { + final trimmed = newValue.trim(); + + if ((trimmed.length - + (_address?.length ?? 0)) + .abs() > + 1) { + final parsed = + AddressUtils.parsePaymentUri( + trimmed, + logging: Logging.instance, + ); + if (parsed != null) { + _applyUri(parsed); + } else { + await _checkSparkNameAndOrSetAddress( + newValue, ); - if (parsed != null) { - _applyUri(parsed); + } } else { await _checkSparkNameAndOrSetAddress( newValue, + setController: false, ); } - } else { - await _checkSparkNameAndOrSetAddress( - newValue, - setController: false, - ); - } - - _setValidAddressProviders(_address); - - setState(() { - _addressToggleFlag = newValue.isNotEmpty; - }); - }, - focusNode: _addressFocusNode, - style: STextStyles.field(context), - decoration: standardInputDecoration( - "Enter ${coin.ticker} address", - _addressFocusNode, - context, - ).copyWith( - contentPadding: const EdgeInsets.only( - left: 16, - top: 6, - bottom: 8, - right: 5, - ), - suffixIcon: Padding( - padding: - sendToController.text.isEmpty - ? const EdgeInsets.only(right: 8) - : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - children: [ - _addressToggleFlag - ? TextFieldIconButton( + + _setValidAddressProviders(_address); + + setState(() { + _addressToggleFlag = + newValue.isNotEmpty; + }); + }, + focusNode: _addressFocusNode, + style: STextStyles.field(context), + decoration: standardInputDecoration( + "Enter ${coin.ticker} address", + _addressFocusNode, + context, + ).copyWith( + contentPadding: const EdgeInsets.only( + left: 16, + top: 6, + bottom: 8, + right: 5, + ), + suffixIcon: Padding( + padding: + sendToController.text.isEmpty + ? const EdgeInsets.only( + right: 8, + ) + : const EdgeInsets.only( + right: 0, + ), + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + _addressToggleFlag + ? TextFieldIconButton( + semanticsLabel: + "Clear Button. Clears The Address Field Input.", + key: const Key( + "sendViewClearAddressFieldButtonKey", + ), + onTap: () { + sendToController.text = + ""; + _address = ""; + _setValidAddressProviders( + _address, + ); + setState(() { + _addressToggleFlag = + false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + semanticsLabel: + "Paste Button. Pastes From Clipboard To Address Field Input.", + key: const Key( + "sendViewPasteAddressFieldButtonKey", + ), + onTap: _pasteAddress, + child: + sendToController + .text + .isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + if (sendToController.text.isEmpty) + TextFieldIconButton( semanticsLabel: - "Clear Button. Clears The Address Field Input.", + "Address Book Button. Opens Address Book For Address Field.", key: const Key( - "sendViewClearAddressFieldButtonKey", + "sendViewAddressBookButtonKey", ), onTap: () { - sendToController.text = ""; - _address = ""; - _setValidAddressProviders( - _address, + Navigator.of( + context, + ).pushNamed( + AddressBookView.routeName, + arguments: widget.coin, ); - setState(() { - _addressToggleFlag = - false; - }); }, - child: const XIcon(), - ) - : TextFieldIconButton( + child: + const AddressBookIcon(), + ), + if (sendToController.text.isEmpty) + TextFieldIconButton( semanticsLabel: - "Paste Button. Pastes From Clipboard To Address Field Input.", + "Scan QR Button. Opens Camera For Scanning QR Code.", key: const Key( - "sendViewPasteAddressFieldButtonKey", + "sendViewScanQrButtonKey", ), - onTap: _pasteAddress, - child: - sendToController - .text - .isEmpty - ? const ClipboardIcon() - : const XIcon(), - ), - if (sendToController.text.isEmpty) - TextFieldIconButton( - semanticsLabel: - "Address Book Button. Opens Address Book For Address Field.", - key: const Key( - "sendViewAddressBookButtonKey", - ), - onTap: () { - Navigator.of( - context, - ).pushNamed( - AddressBookView.routeName, - arguments: widget.coin, - ); - }, - child: const AddressBookIcon(), - ), - if (sendToController.text.isEmpty) - TextFieldIconButton( - semanticsLabel: - "Scan QR Button. Opens Camera For Scanning QR Code.", - key: const Key( - "sendViewScanQrButtonKey", + onTap: _scanQr, + child: const QrCodeIcon(), ), - onTap: _scanQr, - child: const QrCodeIcon(), - ), - ], + ], + ), ), ), ), ), ), - ), + ], // End of conditional hiding "Send to" field for MWC slatepack const SizedBox(height: 10), if (isStellar || ref.watch(pValidSparkSendToAddress)) diff --git a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart new file mode 100644 index 0000000000..d04ef92c47 --- /dev/null +++ b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart @@ -0,0 +1,323 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + +import '../../../notifications/show_flush_bar.dart'; +import '../../../services/mwc_wallet_service.dart'; +import '../../../themes/stack_colors.dart'; +import '../../../utilities/assets.dart'; +import '../../../utilities/clipboard_interface.dart'; +import '../../../utilities/text_styles.dart'; +import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; +import '../../../widgets/desktop/primary_button.dart'; +import '../../../widgets/desktop/secondary_button.dart'; +import '../../../widgets/rounded_white_container.dart'; +import '../../../widgets/stack_dialog.dart'; + +class MwcSlatepackDialog extends ConsumerStatefulWidget { + const MwcSlatepackDialog({ + super.key, + required this.slatepackResult, + this.clipboard = const ClipboardWrapper(), + }); + + final SlatepackResult slatepackResult; + final ClipboardInterface clipboard; + + @override + ConsumerState createState() => _MwcSlatepackDialogState(); +} + +class _MwcSlatepackDialogState extends ConsumerState { + int _currentView = 0; // 0: Slatepack text, 1: QR Code. + + void _copySlatepack() { + widget.clipboard.setData( + ClipboardData(text: widget.slatepackResult.slatepack!), + ); + showFloatingFlushBar( + type: FlushBarType.info, + message: "Slatepack copied to clipboard", + iconAsset: Assets.svg.copy, + context: context, + ); + } + + void _shareSlatepack() { + // TODO: Implement file sharing for desktop platforms. + showFloatingFlushBar( + type: FlushBarType.info, + message: "Share functionality coming soon", + context: context, + ); + } + + @override + Widget build(BuildContext context) { + final isDesktop = + Platform.isLinux || Platform.isMacOS || Platform.isWindows; + + return StackDialogBase( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Send Slatepack", style: STextStyles.pageTitleH2(context)), + AppBarIconButton( + size: 36, + color: Theme.of(context).extension()!.background, + shadows: const [], + icon: SvgPicture.asset( + Assets.svg.x, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, + width: 24, + height: 24, + ), + onPressed: () => Navigator.of(context).pop(), + ), + ], + ), + const SizedBox(height: 16), + Padding( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Info text. + Text( + "Share this slatepack with the recipient to complete the transaction.", + style: STextStyles.subtitle(context), + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + + // Encryption status. + if (widget.slatepackResult.wasEncrypted == true) + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 8, + ), + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .infoItemIcons + .withOpacity(0.1), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.lock, + size: 16, + color: + Theme.of( + context, + ).extension()!.infoItemIcons, + ), + const SizedBox(width: 8), + Text( + "Encrypted for recipient", + style: STextStyles.label(context).copyWith( + color: + Theme.of( + context, + ).extension()!.infoItemIcons, + ), + ), + ], + ), + ), + const SizedBox(height: 16), + + // View toggle buttons. + Row( + children: [ + Expanded( + child: SecondaryButton( + label: "Text", + buttonHeight: ButtonHeight.m, + onPressed: + _currentView == 0 + ? null + : () => setState(() => _currentView = 0), + ), + ), + const SizedBox(width: 12), + Expanded( + child: SecondaryButton( + label: "QR Code", + buttonHeight: ButtonHeight.m, + onPressed: + _currentView == 1 + ? null + : () => setState(() => _currentView = 1), + ), + ), + ], + ), + const SizedBox(height: 16), + + // Content display. + if (_currentView == 0) ...[ + // Slatepack text view. + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + children: [ + Text( + "Slatepack", + style: STextStyles.itemSubtitle(context), + ), + const Spacer(), + GestureDetector( + onTap: _copySlatepack, + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.copy, + width: 10, + height: 10, + color: + Theme.of(context) + .extension()! + .infoItemIcons, + ), + const SizedBox(width: 4), + Text( + "Copy", + style: STextStyles.link2(context), + ), + ], + ), + ), + ], + ), + const SizedBox(height: 8), + Container( + constraints: const BoxConstraints( + maxHeight: 200, + minHeight: 100, + ), + child: SingleChildScrollView( + child: SelectableText( + widget.slatepackResult.slatepack!, + style: STextStyles.w400_14( + context, + ).copyWith(fontFamily: 'monospace'), + ), + ), + ), + ], + ), + ), + ] else ...[ + // QR Code view. + RoundedWhiteContainer( + child: Column( + children: [ + Text( + "Scan QR Code", + style: STextStyles.itemSubtitle(context), + ), + const SizedBox(height: 16), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: QrImageView( + data: widget.slatepackResult.slatepack!, + size: 200, + backgroundColor: Colors.white, + foregroundColor: Colors.black, + errorCorrectionLevel: QrErrorCorrectLevel.M, + ), + ), + ], + ), + ), + ], + + const SizedBox(height: 24), + + // Action buttons. + if (isDesktop) ...[ + Row( + children: [ + Expanded( + child: SecondaryButton( + label: "Share File", + onPressed: _shareSlatepack, + ), + ), + const SizedBox(width: 12), + Expanded( + child: PrimaryButton( + label: "Copy Text", + onPressed: _copySlatepack, + ), + ), + ], + ), + ] else ...[ + PrimaryButton( + label: "Copy Slatepack", + onPressed: _copySlatepack, + ), + const SizedBox(height: 12), + SecondaryButton(label: "Share", onPressed: _shareSlatepack), + ], + + const SizedBox(height: 16), + + // Instructions. + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Theme.of( + context, + ).extension()!.infoItemIcons.withOpacity(0.05), + borderRadius: BorderRadius.circular(8), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Next Steps:", + style: STextStyles.label( + context, + ).copyWith(fontWeight: FontWeight.w600), + ), + const SizedBox(height: 8), + Text( + "1. Share this slatepack with the recipient\n" + "2. Wait for them to return the response slatepack\n" + "3. Import their response to finalize the transaction", + style: STextStyles.w400_14(context), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart b/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart new file mode 100644 index 0000000000..33cbcf5123 --- /dev/null +++ b/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart @@ -0,0 +1,272 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +import '../../../models/mwc_transaction_method.dart'; +import '../../../themes/stack_colors.dart'; +import '../../../utilities/assets.dart'; +import '../../../utilities/text_styles.dart'; +import '../../../widgets/rounded_white_container.dart'; + +class MwcTransactionMethodSelector extends ConsumerStatefulWidget { + const MwcTransactionMethodSelector({ + super.key, + required this.onMethodSelected, + this.selectedMethod, + this.addressText, + }); + + final void Function(TransactionMethod) onMethodSelected; + final TransactionMethod? selectedMethod; + final String? addressText; + + @override + ConsumerState createState() => + _MwcTransactionMethodSelectorState(); +} + +class _MwcTransactionMethodSelectorState + extends ConsumerState { + TransactionMethod? _selectedMethod; + + @override + void initState() { + super.initState(); + _selectedMethod = widget.selectedMethod; + } + + void _selectMethod(TransactionMethod method) { + setState(() { + _selectedMethod = method; + }); + widget.onMethodSelected(method); + } + + Widget _buildMethodTile({ + required TransactionMethod method, + required String title, + required String subtitle, + required IconData icon, + required bool available, + String? unavailableReason, + }) { + final isSelected = _selectedMethod == method; + final canSelect = available && widget.addressText?.isNotEmpty != true; + + return GestureDetector( + onTap: canSelect ? () => _selectMethod(method) : null, + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + decoration: BoxDecoration( + color: + isSelected + ? Theme.of(context) + .extension()! + .infoItemIcons + .withValues(alpha: 0.1) + : Theme.of(context).extension()!.popupBG, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: + isSelected + ? Theme.of(context).extension()!.infoItemIcons + : Theme.of(context).extension()!.background, + width: 2, + ), + ), + child: Padding( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: + available + ? Theme.of(context) + .extension()! + .infoItemIcons + .withValues(alpha: 0.1) + : Theme.of( + context, + ).extension()!.textFieldDefaultBG, + borderRadius: BorderRadius.circular(8), + ), + child: Icon( + icon, + size: 20, + color: + available + ? Theme.of( + context, + ).extension()!.infoItemIcons + : Theme.of( + context, + ).extension()!.textSubtitle2, + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: STextStyles.w600_14(context).copyWith( + color: + available + ? Theme.of( + context, + ).extension()!.textDark + : Theme.of( + context, + ).extension()!.textSubtitle2, + ), + ), + const SizedBox(height: 2), + Text( + available ? subtitle : (unavailableReason ?? subtitle), + style: STextStyles.w400_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle2, + ), + ), + ], + ), + ), + if (isSelected) + Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: + Theme.of( + context, + ).extension()!.infoItemIcons, + shape: BoxShape.circle, + ), + child: Icon( + Icons.check, + size: 12, + color: Theme.of(context).extension()!.popupBG, + ), + ), + ], + ), + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + final hasAddressInput = widget.addressText?.isNotEmpty == true; + + return RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + SvgPicture.asset( + Assets.svg.swap, + width: 16, + height: 16, + colorFilter: ColorFilter.mode( + Theme.of(context).extension()!.infoItemIcons, + BlendMode.srcIn, + ), + ), + const SizedBox(width: 8), + Text("Transaction Method", style: STextStyles.w600_14(context)), + ], + ), + const SizedBox(height: 4), + Text( + hasAddressInput + ? "Method detected from address format" + : "Choose how to send this transaction", + style: STextStyles.w400_14(context).copyWith( + color: Theme.of(context).extension()!.textSubtitle2, + ), + ), + const SizedBox(height: 16), + + Column( + children: [ + // Slatepack method. + _buildMethodTile( + method: TransactionMethod.slatepack, + title: "Slatepack (Manual)", + subtitle: "Copy/paste, QR codes, or files", + icon: Icons.qr_code, + available: true, + ), + const SizedBox(height: 12), + + // MWCMQS method. + _buildMethodTile( + method: TransactionMethod.mwcmqs, + title: "MWCMQS (Automatic)", + subtitle: "Direct messaging to recipient", + icon: Icons.message, + available: true, + unavailableReason: "Requires MWCMQS address", + ), + const SizedBox(height: 12), + + // HTTP method. + _buildMethodTile( + method: TransactionMethod.http, + title: "HTTP (Direct)", + subtitle: "Direct connection to wallet", + icon: Icons.http, + available: true, + unavailableReason: "Requires HTTP address", + ), + ], + ), + + if (hasAddressInput) ...[ + const SizedBox(height: 16), + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .infoItemIcons + .withValues(alpha: 0.05), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Icon( + Icons.info_outline, + size: 16, + color: + Theme.of( + context, + ).extension()!.infoItemIcons, + ), + const SizedBox(width: 8), + Expanded( + child: Text( + "Transaction method is automatically detected from the address format. Clear the address field to manually select a method.", + style: STextStyles.w400_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle2, + ), + ), + ), + ], + ), + ), + ], + ], + ), + ); + } +} diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index af044e6825..c7ef4cacb6 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -42,6 +42,7 @@ import '../../../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../../../wallets/isar/models/spark_coin.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../../../wallets/wallet/intermediate/lib_salvium_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart'; @@ -136,34 +137,34 @@ class _TransactionV2DetailsViewState context: context, builder: (context) => DesktopDialog( - maxHeight: null, - maxWidth: 580, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + maxHeight: null, + maxWidth: 580, + child: Column( + mainAxisSize: MainAxisSize.min, children: [ - Padding( - padding: const EdgeInsets.only(left: 32), - child: Text( - "Boost transaction", - style: STextStyles.desktopH3(context), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Boost transaction", + style: STextStyles.desktopH3(context), + ), + ), + const DesktopDialogCloseButton(), + ], + ), + Flexible( + child: SingleChildScrollView( + child: BoostTransactionView( + transaction: _transaction, + ), ), ), - const DesktopDialogCloseButton(), ], ), - Flexible( - child: SingleChildScrollView( - child: BoostTransactionView( - transaction: _transaction, - ), - ), - ), - ], - ), - ), + ), ); } } else { @@ -188,14 +189,14 @@ class _TransactionV2DetailsViewState hasTxKeyProbably = (wallet is LibMoneroWallet || wallet is LibSalviumWallet) && - (_transaction.type == TransactionType.outgoing || - _transaction.type == TransactionType.sentToSelf); + (_transaction.type == TransactionType.outgoing || + _transaction.type == TransactionType.sentToSelf); if (_transaction.type - case TransactionType.sentToSelf || TransactionType.outgoing) { + case TransactionType.sentToSelf || TransactionType.outgoing) { supportsRbf = _transaction.subType == TransactionSubType.none && - wallet is RbfInterface; + wallet is RbfInterface; } else { supportsRbf = false; } @@ -248,13 +249,13 @@ class _TransactionV2DetailsViewState _transaction.outputs .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); } else if (_transaction.subType == TransactionSubType.cashFusion) { amount = _transaction.getAmountReceivedInThisWallet( @@ -265,13 +266,42 @@ class _TransactionV2DetailsViewState .where((e) => e.walletOwns) .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) + .toList(); + } else if (_transaction.isMimblewimblecoinTransaction) { + switch (_transaction.type) { + case TransactionType.outgoing: + case TransactionType.unknown: + amount = _transaction.getAmountSentFromThisWallet( + fractionDigits: fractionDigits, + subtractFee: coin is! Ethereum, + ); + break; + + case TransactionType.incoming: + case TransactionType.sentToSelf: + amount = _transaction.getAmountReceivedInThisWallet( + fractionDigits: fractionDigits, + ); + break; + } + data = + _transaction.outputs + .map( + (e) => ( + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); } else { switch (_transaction.type) { @@ -285,13 +315,13 @@ class _TransactionV2DetailsViewState .where((e) => !e.walletOwns) .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); break; @@ -311,17 +341,17 @@ class _TransactionV2DetailsViewState .and() .heightEqualTo(_transaction.height) .anyOf( - _transaction.outputs - .where( - (e) => - e.walletOwns && - e.addresses.isEmpty && - e.scriptPubKeyHex.length >= 488, - ) - .map((e) => e.scriptPubKeyHex.substring(2, 488)) - .toList(), + _transaction.outputs + .where( + (e) => + e.walletOwns && + e.addresses.isEmpty && + e.scriptPubKeyHex.length >= 488, + ) + .map((e) => e.scriptPubKeyHex.substring(2, 488)) + .toList(), (q, element) => q.serializedCoinB64StartsWith(element), - ) + ) .memoProperty() .findFirstSync(); } @@ -338,7 +368,7 @@ class _TransactionV2DetailsViewState rawValue: _transaction.outputs .where( (e) => e.walletOwns && !e.addresses.contains(changeAddress), - ) + ) .fold(BigInt.zero, (p, e) => p + e.value), fractionDigits: coin.fractionDigits, ); @@ -352,13 +382,13 @@ class _TransactionV2DetailsViewState .where((e) => e.walletOwns) .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); break; @@ -372,13 +402,13 @@ class _TransactionV2DetailsViewState .where((e) => e.walletOwns) .map( (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) .toList(); break; } @@ -396,11 +426,11 @@ class _TransactionV2DetailsViewState currentChainHeight: height, minConfirms: minConfirms, minCoinbaseConfirms: - ref - .read(pWallets) - .getWallet(walletId) - .cryptoCurrency - .minCoinbaseConfirms, + ref + .read(pWallets) + .getWallet(walletId) + .cryptoCurrency + .minCoinbaseConfirms, ); Future fetchContactNameFor(String address) async { @@ -413,10 +443,10 @@ class _TransactionV2DetailsViewState .contacts .where( (element) => - element.addresses - .where((element) => element.address == address) - .isNotEmpty, - ); + element.addresses + .where((element) => element.address == address) + .isNotEmpty, + ); if (contacts.isNotEmpty) { return contacts.first.name; } else { @@ -437,7 +467,7 @@ class _TransactionV2DetailsViewState return StackDialog( title: "Attention", message: - "You are about to view this transaction in a block explorer. The explorer may log your IP address and link it to the transaction. Only proceed if you trust $explorer.", + "You are about to view this transaction in a block explorer. The explorer may log your IP address and link it to the transaction. Only proceed if you trust $explorer.", icon: Row( children: [ Consumer( @@ -445,7 +475,7 @@ class _TransactionV2DetailsViewState return Checkbox( value: ref.watch( prefsChangeNotifierProvider.select( - (value) => value.hideBlockExplorerWarning, + (value) => value.hideBlockExplorerWarning, ), ), onChanged: (value) { @@ -473,9 +503,9 @@ class _TransactionV2DetailsViewState "Cancel", style: STextStyles.button(context).copyWith( color: - Theme.of( - context, - ).extension()!.accentColorDark, + Theme.of( + context, + ).extension()!.accentColorDark, ), ), ), @@ -508,7 +538,7 @@ class _TransactionV2DetailsViewState return Checkbox( value: ref.watch( prefsChangeNotifierProvider.select( - (value) => value.hideBlockExplorerWarning, + (value) => value.hideBlockExplorerWarning, ), ), onChanged: (value) { @@ -598,10 +628,10 @@ class _TransactionV2DetailsViewState )) { price = ref.watch( priceAnd24hChangeNotifierProvider.select( - (value) => - isTokenTx - ? value.getTokenPrice(_transaction.contractAddress!)?.value - : value.getPrice(coin)?.value, + (value) => + isTokenTx + ? value.getTokenPrice(_transaction.contractAddress!)?.value + : value.getPrice(coin)?.value, ), ); } @@ -611,37 +641,37 @@ class _TransactionV2DetailsViewState builder: (child) => Background(child: child), child: Scaffold( backgroundColor: - isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.background, + isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.background, appBar: - isDesktop - ? null - : AppBar( - backgroundColor: - Theme.of(context).extension()!.background, - leading: AppBarBackButton( - onPressed: () async { - // if (FocusScope.of(context).hasFocus) { - // FocusScope.of(context).unfocus(); - // await Future.delayed(Duration(milliseconds: 50)); - // } - Navigator.of(context).pop(); - }, - ), - title: Text( - "Transaction details", - style: STextStyles.navBarTitle(context), - ), - ), + isDesktop + ? null + : AppBar( + backgroundColor: + Theme.of(context).extension()!.background, + leading: AppBarBackButton( + onPressed: () async { + // if (FocusScope.of(context).hasFocus) { + // FocusScope.of(context).unfocus(); + // await Future.delayed(Duration(milliseconds: 50)); + // } + Navigator.of(context).pop(); + }, + ), + title: Text( + "Transaction details", + style: STextStyles.navBarTitle(context), + ), + ), body: ConditionalParent( condition: !isDesktop, builder: (child) => SafeArea(child: child), child: Padding( padding: - isDesktop - ? const EdgeInsets.only(left: 32) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.only(left: 32) + : const EdgeInsets.all(12), child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -659,19 +689,19 @@ class _TransactionV2DetailsViewState Flexible( child: Padding( padding: - isDesktop - ? const EdgeInsets.only(right: 32, bottom: 32) - : const EdgeInsets.all(0), + isDesktop + ? const EdgeInsets.only(right: 32, bottom: 32) + : const EdgeInsets.all(0), child: ConditionalParent( condition: isDesktop, builder: (child) { return RoundedWhiteContainer( borderColor: - isDesktop - ? Theme.of( - context, - ).extension()!.backgroundAppBar - : null, + isDesktop + ? Theme.of( + context, + ).extension()!.backgroundAppBar + : null, padding: const EdgeInsets.all(0), child: child, ); @@ -680,43 +710,43 @@ class _TransactionV2DetailsViewState primary: isDesktop ? false : null, child: Padding( padding: - isDesktop - ? const EdgeInsets.all(0) - : const EdgeInsets.all(4), + isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(4), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(0) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(12), child: Container( decoration: - isDesktop - ? BoxDecoration( - color: - Theme.of(context) - .extension()! - .backgroundAppBar, - borderRadius: BorderRadius.vertical( - top: Radius.circular( - Constants - .size - .circularBorderRadius, - ), - ), - ) - : null, + isDesktop + ? BoxDecoration( + color: + Theme.of(context) + .extension()! + .backgroundAppBar, + borderRadius: BorderRadius.vertical( + top: Radius.circular( + Constants + .size + .circularBorderRadius, + ), + ), + ) + : null, child: Padding( padding: - isDesktop - ? const EdgeInsets.all(12) - : const EdgeInsets.all(0), + isDesktop + ? const EdgeInsets.all(12) + : const EdgeInsets.all(0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ if (isDesktop) Row( @@ -733,73 +763,73 @@ class _TransactionV2DetailsViewState currentHeight, ), style: - STextStyles.desktopTextMedium( - context, - ), + STextStyles.desktopTextMedium( + context, + ), ), ], ), Column( crossAxisAlignment: - isDesktop - ? CrossAxisAlignment.end - : CrossAxisAlignment.start, + isDesktop + ? CrossAxisAlignment.end + : CrossAxisAlignment.start, children: [ SelectableText( "$amountPrefix${ref.watch(pAmountFormatter(coin)).format(amount, ethContract: ethContract)}", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.titleBold12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.titleBold12( + context, + ), ), const SizedBox(height: 2), if (price != null) Builder( builder: (context) { final total = - (amount.decimal * price!) - .toAmount( - fractionDigits: 2, - ); + (amount.decimal * price!) + .toAmount( + fractionDigits: 2, + ); final formatted = total .fiatString( - locale: ref.watch( - localeServiceChangeNotifierProvider - .select( - (value) => - value - .locale, - ), - ), - ); + locale: ref.watch( + localeServiceChangeNotifierProvider + .select( + (value) => + value + .locale, + ), + ), + ); final ticker = ref.watch( prefsChangeNotifierProvider .select( (value) => - value.currency, - ), + value.currency, + ), ); return SelectableText( "$amountPrefix$formatted $ticker", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ); }, ), @@ -822,23 +852,23 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( "Status", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), // Flexible( // child: FittedBox( @@ -847,32 +877,32 @@ class _TransactionV2DetailsViewState SelectableText( whatIsIt(_transaction, currentHeight), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - _transaction.type == - TransactionType - .outgoing && - _transaction - .subType != - TransactionSubType - .cashFusion - ? Theme.of(context) - .extension< - StackColors - >()! - .accentColorOrange - : Theme.of(context) - .extension< - StackColors - >()! - .accentColorGreen, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + _transaction.type == + TransactionType + .outgoing && + _transaction + .subType != + TransactionSubType + .cashFusion + ? Theme.of(context) + .extension< + StackColors + >()! + .accentColorOrange + : Theme.of(context) + .extension< + StackColors + >()! + .accentColorGreen, + ) + : STextStyles.itemSubtitle12( + context, + ), ), // ), // ), @@ -880,8 +910,8 @@ class _TransactionV2DetailsViewState ), ), if (!((coin is Monero || coin is Wownero) && - _transaction.type == - TransactionType.outgoing) && + _transaction.type == + TransactionType.outgoing) && !((coin is Firo) && _transaction.subType == TransactionSubType.mint)) @@ -889,34 +919,34 @@ class _TransactionV2DetailsViewState ? const _Divider() : const SizedBox(height: 12), if (!((coin is Monero || coin is Wownero) && - _transaction.type == - TransactionType.outgoing) && + _transaction.type == + TransactionType.outgoing) && !((coin is Firo) && _transaction.subType == TransactionSubType.mint)) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Expanded( child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ ConditionalParent( condition: kDebugMode, builder: (child) { return Row( mainAxisAlignment: - MainAxisAlignment - .spaceBetween, + MainAxisAlignment + .spaceBetween, children: [ child, // CustomTextButton( @@ -966,25 +996,25 @@ class _TransactionV2DetailsViewState child: Text( outputLabel, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), ), const SizedBox(height: 8), Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ if (data.length == 1 && data - .first - .addresses - .length == + .first + .addresses + .length == 1) FutureBuilder( future: fetchContactNameFor( @@ -994,10 +1024,10 @@ class _TransactionV2DetailsViewState .first, ), builder: ( - builderContext, - AsyncSnapshot - snapshot, - ) { + builderContext, + AsyncSnapshot + snapshot, + ) { String addressOrContactName = data @@ -1005,87 +1035,87 @@ class _TransactionV2DetailsViewState .addresses .first; if (snapshot.connectionState == - ConnectionState - .done && + ConnectionState + .done && snapshot.hasData) { addressOrContactName = - snapshot.data!; + snapshot.data!; } return SelectableText( addressOrContactName, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ); }, ) else for ( - int i = 0; - i < data.length; - i++ + int i = 0; + i < data.length; + i++ ) ConditionalParent( condition: i > 0, builder: (child) => Column( - crossAxisAlignment: - CrossAxisAlignment - .stretch, - children: [ - const _Divider(), - child, - ], - ), + crossAxisAlignment: + CrossAxisAlignment + .stretch, + children: [ + const _Divider(), + child, + ], + ), child: Padding( padding: - const EdgeInsets.all( - 8.0, - ), + const EdgeInsets.all( + 8.0, + ), child: Column( crossAxisAlignment: - CrossAxisAlignment - .start, + CrossAxisAlignment + .start, children: [ ...data[i].addresses.map(( - e, - ) { + e, + ) { return FutureBuilder( future: - fetchContactNameFor( - e, - ), + fetchContactNameFor( + e, + ), builder: ( - builderContext, - AsyncSnapshot< - String - > - snapshot, - ) { + builderContext, + AsyncSnapshot< + String + > + snapshot, + ) { final String addressOrContactName; if (snapshot.connectionState == - ConnectionState - .done && + ConnectionState + .done && snapshot .hasData) { addressOrContactName = - snapshot - .data!; + snapshot + .data!; } else { addressOrContactName = e; @@ -1093,10 +1123,10 @@ class _TransactionV2DetailsViewState return OutputCard( address: - addressOrContactName, + addressOrContactName, amount: - data[i] - .amount, + data[i] + .amount, coin: coin, ); }, @@ -1118,56 +1148,56 @@ class _TransactionV2DetailsViewState ], ), ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) isDesktop ? const _Divider() : const SizedBox(height: 12), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Expanded( child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "On chain note", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), const SizedBox(height: 8), SelectableText( _transaction.onChainNote ?? "", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1184,112 +1214,115 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( - (coin is Epiccash) + (coin is Epiccash || + coin is Mimblewimblecoin) ? "Local Note" : "Note ", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), - ), - isDesktop - ? IconPencilButton( - onPressed: () { - showDialog( - context: context, - builder: (context) { - return DesktopDialog( - maxWidth: 580, - maxHeight: 360, - child: EditNoteView( - txid: _transaction.txid, - walletId: walletId, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), + ), + isDesktop + ? IconPencilButton( + onPressed: () { + showDialog( + context: context, + builder: (context) { + return DesktopDialog( + maxWidth: 580, + maxHeight: 360, + child: EditNoteView( + txid: _transaction.txid, + walletId: walletId, + ), + ); + }, ); }, - ); - }, - ) + ) : GestureDetector( - onTap: () { - Navigator.of(context).pushNamed( - EditNoteView.routeName, - arguments: Tuple2( - _transaction.txid, - walletId, - ), - ); - }, - child: Row( - children: [ - SvgPicture.asset( - Assets.svg.pencil, - width: 10, - height: 10, - color: - Theme.of(context) - .extension< - StackColors - >()! - .infoItemIcons, - ), - const SizedBox(width: 4), - Text( - "Edit", - style: STextStyles.link2( - context, - ), + onTap: () { + Navigator.of(context).pushNamed( + EditNoteView.routeName, + arguments: Tuple2( + _transaction.txid, + walletId, + ), + ); + }, + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.pencil, + width: 10, + height: 10, + color: + Theme.of(context) + .extension< + StackColors + >()! + .infoItemIcons, + ), + const SizedBox(width: 4), + Text( + "Edit", + style: STextStyles.link2( + context, + ), + ), + ], ), - ], - ), - ), + ), ], ), const SizedBox(height: 8), SelectableText( ref - .watch( - pTransactionNote(( - txid: - (coin is Epiccash) - ? _transaction.slateId - .toString() - : _transaction.txid, - walletId: walletId, - )), - ) - ?.value ?? + .watch( + pTransactionNote(( + txid: + (coin is Epiccash || + coin + is Mimblewimblecoin) + ? _transaction.slateId + .toString() + : _transaction.txid, + walletId: walletId, + )), + ) + ?.value ?? "", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1301,25 +1334,25 @@ class _TransactionV2DetailsViewState if (_sparkMemo != null) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Row( children: [ Text( "Memo", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), ], ), @@ -1327,20 +1360,20 @@ class _TransactionV2DetailsViewState SelectableText( _sparkMemo!, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1350,28 +1383,28 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Date", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1381,20 +1414,20 @@ class _TransactionV2DetailsViewState _transaction.timestamp, ), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1404,20 +1437,20 @@ class _TransactionV2DetailsViewState _transaction.timestamp, ), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton( @@ -1441,48 +1474,48 @@ class _TransactionV2DetailsViewState TransactionType.incoming)) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Builder( builder: (context) { final String feeString = - showFeePending - ? _transaction.isConfirmed( - currentHeight, - minConfirms, - coin.minCoinbaseConfirms, - ) - ? ref - .watch( - pAmountFormatter(coin), - ) - .format(fee) - : "Pending" - : ref - .watch(pAmountFormatter(coin)) - .format(fee); + showFeePending + ? _transaction.isConfirmed( + currentHeight, + minConfirms, + coin.minCoinbaseConfirms, + ) + ? ref + .watch( + pAmountFormatter(coin), + ) + .format(fee) + : "Pending" + : ref + .watch(pAmountFormatter(coin)) + .format(fee); return Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Transaction fee", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1490,22 +1523,22 @@ class _TransactionV2DetailsViewState SelectableText( feeString, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (supportsRbf && !confirmedTxn) const SizedBox(height: 8), @@ -1520,20 +1553,20 @@ class _TransactionV2DetailsViewState SelectableText( feeString, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: feeString), @@ -1555,10 +1588,10 @@ class _TransactionV2DetailsViewState if (widget.coin is Bitcoincash || widget.coin is Ecash) { height = - _transaction.height != null && - _transaction.height! > 0 - ? "${_transaction.height!}" - : "Pending"; + _transaction.height != null && + _transaction.height! > 0 + ? "${_transaction.height!}" + : "Pending"; confirmations = confirms.toString(); } else if (widget.coin is Epiccash && _transaction.slateId == null) { @@ -1572,12 +1605,12 @@ class _TransactionV2DetailsViewState ); if (widget.coin is! Epiccash && confirmed) { height = - "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; + "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; } else { height = - confirms > 0 - ? "${_transaction.height}" - : "Pending"; + confirms > 0 + ? "${_transaction.height}" + : "Pending"; } confirmations = confirms.toString(); @@ -1587,29 +1620,29 @@ class _TransactionV2DetailsViewState children: [ RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Block height", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1617,22 +1650,22 @@ class _TransactionV2DetailsViewState SelectableText( height, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1640,20 +1673,20 @@ class _TransactionV2DetailsViewState SelectableText( height, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: height), @@ -1665,29 +1698,29 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Confirmations", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1695,22 +1728,22 @@ class _TransactionV2DetailsViewState SelectableText( confirmations, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1718,20 +1751,20 @@ class _TransactionV2DetailsViewState SelectableText( confirmations, style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: height), @@ -1751,43 +1784,43 @@ class _TransactionV2DetailsViewState _transaction.type != TransactionType.incoming) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( "Nonce", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), SelectableText( _transaction.nonce.toString(), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1799,43 +1832,43 @@ class _TransactionV2DetailsViewState if (kDebugMode) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( "Tx sub type", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), SelectableText( _transaction.subType.toString(), style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1854,304 +1887,306 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), _transaction.txid.startsWith("mweb_outputId_") && - _transaction.subType == - TransactionSubType.mweb + _transaction.subType == + TransactionSubType.mweb ? RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ConditionalParent( - condition: !isDesktop, - builder: - (child) => Row( - children: [ - Expanded(child: child), - SimpleCopyButton( - data: _transaction - .txid - .replaceFirst( - "mweb_outputId_", - "", - ), + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ConditionalParent( + condition: !isDesktop, + builder: + (child) => Row( + children: [ + Expanded(child: child), + SimpleCopyButton( + data: _transaction + .txid + .replaceFirst( + "mweb_outputId_", + "", + ), + ), + ], + ), + child: Text( + "MWEB Output ID", + style: + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), - ], - ), - child: Text( - "MWEB Output ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, ), - ), + const SizedBox(height: 8), + SelectableText( + _transaction.txid.replaceFirst( + "mweb_outputId_", + "", + ), + style: + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), + ), + // if (coin is Litecoin && + // coin.network == + // CryptoCurrencyNetwork + // .main) + // const SizedBox(height: 8), + // if (coin is Litecoin && + // coin.network == + // CryptoCurrencyNetwork + // .main) + // CustomTextButton( + // text: + // "Open in block explorer", + // onTap: () async { + // final uri = + // getBlockExplorerTransactionUrlFor( + // coin: coin, + // txid: _transaction + // .txid + // .replaceFirst( + // "mweb_outputId_", + // "", + // ), + // ); + // + // if (ref + // .read( + // prefsChangeNotifierProvider, + // ) + // .hideBlockExplorerWarning == + // false) { + // final shouldContinue = + // await showExplorerWarning( + // "${uri.scheme}://${uri.host}", + // ); + // + // if (!shouldContinue) { + // return; + // } + // } + // try { + // await launchUrl( + // uri, + // mode: + // LaunchMode + // .externalApplication, + // ); + // } catch (_) { + // if (context.mounted) { + // unawaited( + // showDialog( + // context: context, + // builder: + // ( + // _, + // ) => StackOkDialog( + // title: + // "Could not open in block explorer", + // message: + // "Failed to open \"${uri.toString()}\"", + // ), + // ), + // ); + // } + // } + // }, + // ), + ], ), - const SizedBox(height: 8), - SelectableText( - _transaction.txid.replaceFirst( - "mweb_outputId_", - "", - ), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + ), + if (isDesktop) + const SizedBox(width: 12), + if (isDesktop) + IconCopyButton( + data: _transaction.txid + .replaceFirst( + "mweb_outputId_", + "", + ), ), - // if (coin is Litecoin && - // coin.network == - // CryptoCurrencyNetwork - // .main) - // const SizedBox(height: 8), - // if (coin is Litecoin && - // coin.network == - // CryptoCurrencyNetwork - // .main) - // CustomTextButton( - // text: - // "Open in block explorer", - // onTap: () async { - // final uri = - // getBlockExplorerTransactionUrlFor( - // coin: coin, - // txid: _transaction - // .txid - // .replaceFirst( - // "mweb_outputId_", - // "", - // ), - // ); - // - // if (ref - // .read( - // prefsChangeNotifierProvider, - // ) - // .hideBlockExplorerWarning == - // false) { - // final shouldContinue = - // await showExplorerWarning( - // "${uri.scheme}://${uri.host}", - // ); - // - // if (!shouldContinue) { - // return; - // } - // } - // try { - // await launchUrl( - // uri, - // mode: - // LaunchMode - // .externalApplication, - // ); - // } catch (_) { - // if (context.mounted) { - // unawaited( - // showDialog( - // context: context, - // builder: - // ( - // _, - // ) => StackOkDialog( - // title: - // "Could not open in block explorer", - // message: - // "Failed to open \"${uri.toString()}\"", - // ), - // ), - // ); - // } - // } - // }, - // ), - ], - ), + ], ), - if (isDesktop) - const SizedBox(width: 12), - if (isDesktop) - IconCopyButton( - data: _transaction.txid - .replaceFirst( - "mweb_outputId_", - "", - ), - ), - ], - ), - ) + ) : RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ConditionalParent( - condition: !isDesktop, - builder: - (child) => Row( - children: [ - Expanded(child: child), - SimpleCopyButton( - data: - _transaction.txid, + padding: + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ConditionalParent( + condition: !isDesktop, + builder: + (child) => Row( + children: [ + Expanded(child: child), + SimpleCopyButton( + data: + _transaction.txid, + ), + ], + ), + child: Text( + "Transaction ID", + style: + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), - ], - ), - child: Text( - "Transaction ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, ), - ), + const SizedBox(height: 8), + // Flexible( + // child: FittedBox( + // fit: BoxFit.scaleDown, + // child: + SelectableText( + _transaction.txid, + style: + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), + ), + if (coin is! Epiccash && + coin is! Mimblewimblecoin) + const SizedBox(height: 8), + if (coin is! Epiccash && + coin is! Mimblewimblecoin) + CustomTextButton( + text: + "Open in block explorer", + onTap: () async { + final uri = + getBlockExplorerTransactionUrlFor( + coin: coin, + txid: + _transaction.txid, + ); + + if (ref + .read( + prefsChangeNotifierProvider, + ) + .hideBlockExplorerWarning == + false) { + final shouldContinue = + await showExplorerWarning( + "${uri.scheme}://${uri.host}", + ); + + if (!shouldContinue) { + return; + } + } + + // ref + // .read( + // shouldShowLockscreenOnResumeStateProvider + // .state) + // .state = false; + try { + await launchUrl( + uri, + mode: + LaunchMode + .externalApplication, + ); + } catch (_) { + if (context.mounted) { + unawaited( + showDialog( + context: context, + builder: + ( + _, + ) => StackOkDialog( + title: + "Could not open in block explorer", + message: + "Failed to open \"${uri.toString()}\"", + ), + ), + ); + } + } finally { + // Future.delayed( + // const Duration(seconds: 1), + // () => ref + // .read( + // shouldShowLockscreenOnResumeStateProvider + // .state) + // .state = true, + // ); + } + }, + ), + // ), + // ), + ], ), - const SizedBox(height: 8), - // Flexible( - // child: FittedBox( - // fit: BoxFit.scaleDown, - // child: - SelectableText( - _transaction.txid, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + ), + if (isDesktop) + const SizedBox(width: 12), + if (isDesktop) + IconCopyButton( + data: _transaction.txid, ), - if (coin is! Epiccash) - const SizedBox(height: 8), - if (coin is! Epiccash) - CustomTextButton( - text: - "Open in block explorer", - onTap: () async { - final uri = - getBlockExplorerTransactionUrlFor( - coin: coin, - txid: - _transaction.txid, - ); - - if (ref - .read( - prefsChangeNotifierProvider, - ) - .hideBlockExplorerWarning == - false) { - final shouldContinue = - await showExplorerWarning( - "${uri.scheme}://${uri.host}", - ); - - if (!shouldContinue) { - return; - } - } - - // ref - // .read( - // shouldShowLockscreenOnResumeStateProvider - // .state) - // .state = false; - try { - await launchUrl( - uri, - mode: - LaunchMode - .externalApplication, - ); - } catch (_) { - if (context.mounted) { - unawaited( - showDialog( - context: context, - builder: - ( - _, - ) => StackOkDialog( - title: - "Could not open in block explorer", - message: - "Failed to open \"${uri.toString()}\"", - ), - ), - ); - } - } finally { - // Future.delayed( - // const Duration(seconds: 1), - // () => ref - // .read( - // shouldShowLockscreenOnResumeStateProvider - // .state) - // .state = true, - // ); - } - }, - ), - // ), - // ), - ], - ), + ], ), - if (isDesktop) - const SizedBox(width: 12), - if (isDesktop) - IconCopyButton( - data: _transaction.txid, - ), - ], - ), - ), + ), // if ((coin is FiroTestNet || coin is Firo) && // _transaction.subType == "mint") // const SizedBox( @@ -2229,36 +2264,36 @@ class _TransactionV2DetailsViewState // ], // ), // ), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) isDesktop ? const _Divider() : const SizedBox(height: 12), - if (coin is Epiccash) + if (coin is Epiccash || coin is Mimblewimblecoin) RoundedWhiteContainer( padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Text( "Slate ID", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), // Flexible( // child: FittedBox( @@ -2267,20 +2302,20 @@ class _TransactionV2DetailsViewState SelectableText( _transaction.slateId ?? "Unknown", style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), // ), // ), @@ -2290,7 +2325,7 @@ class _TransactionV2DetailsViewState if (isDesktop) IconCopyButton( data: - _transaction.slateId ?? "Unknown", + _transaction.slateId ?? "Unknown", ), ], ), @@ -2319,105 +2354,162 @@ class _TransactionV2DetailsViewState ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: - (coin is Epiccash && - _transaction.getConfirmations(currentHeight) < 1 && - _transaction.isCancelled == false) - ? ConditionalParent( - condition: isDesktop, - builder: - (child) => Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 16, - ), - child: child, - ), - child: SizedBox( - width: MediaQuery.of(context).size.width - 32, - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Theme.of(context).extension()!.textError, - ), - ), - onPressed: () async { - final wallet = ref.read(pWallets).getWallet(walletId); - - if (wallet is EpiccashWallet) { - final String? id = _transaction.slateId; - if (id == null) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Could not find Epic transaction ID", - context: context, + ((coin is Epiccash || coin is Mimblewimblecoin) && + _transaction.getConfirmations(currentHeight) < 1 && + _transaction.isCancelled == false) + ? ConditionalParent( + condition: isDesktop, + builder: + (child) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: 32, + vertical: 16, + ), + child: child, ), - ); - return; - } - - unawaited( - showDialog( - barrierDismissible: false, - context: context, - builder: - (_) => - const CancellingTransactionProgressDialog(), - ), - ); - - final result = await wallet - .cancelPendingTransactionAndPost(id); - if (context.mounted) { - // pop progress dialog - Navigator.of(context).pop(); - - if (result.isEmpty) { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Transaction cancelled", - onOkPressed: (_) { - wallet.refresh(); - Navigator.of(context).popUntil( - ModalRoute.withName( - WalletView.routeName, + child: SizedBox( + width: MediaQuery.of(context).size.width - 32, + child: TextButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + Theme.of(context).extension()!.textError, + ), + ), + onPressed: () async { + final wallet = ref.read(pWallets).getWallet(walletId); + + if (wallet is EpiccashWallet) { + final String? id = _transaction.slateId; + if (id == null) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Could not find Epic transaction ID", + context: context, ), ); - }, - ), - ); - } else { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Failed to cancel transaction", - message: result, - ), - ); - } - } - } else { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "ERROR: Wallet type is not Epic Cash", - context: context, + return; + } + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: + (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = await wallet + .cancelPendingTransactionAndPost(id); + if (context.mounted) { + // Pop progress dialog. + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: + (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + wallet.refresh(); + Navigator.of(context).popUntil( + ModalRoute.withName( + WalletView.routeName, + ), + ); + }, + ), + ); + } else { + await showDialog( + context: context, + builder: + (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + ), + ); + } + } + } else if (wallet is MimblewimblecoinWallet) { + final String? id = _transaction.slateId; + if (id == null) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Could not find MWC transaction ID", + context: context, + ), + ); + return; + } + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: + (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = await wallet + .cancelPendingTransactionAndPost(id); + if (context.mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: + (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + wallet.refresh(); + Navigator.of(context).popUntil( + ModalRoute.withName( + WalletView.routeName, + ), + ); + }, + ), + ); + } else { + await showDialog( + context: context, + builder: + (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + ), + ); + } + } + } else { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: + "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", + context: context, + ), + ); + return; + } + }, + child: Text( + "Cancel Transaction", + style: STextStyles.button(context), + ), ), - ); - return; - } - }, - child: Text( - "Cancel Transaction", - style: STextStyles.button(context), - ), - ), - ), - ) - : null, + ), + ) + : null, ), ); } @@ -2443,18 +2535,18 @@ class OutputCard extends ConsumerWidget { Text( "Address", style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.itemSubtitle(context), + Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.itemSubtitle(context), ), SelectableText( address, style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context).extension()!.textDark, - ) - : STextStyles.itemSubtitle12(context), + Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context).copyWith( + color: Theme.of(context).extension()!.textDark, + ) + : STextStyles.itemSubtitle12(context), ), const SizedBox(height: 10), Row( @@ -2463,23 +2555,23 @@ class OutputCard extends ConsumerWidget { Text( "Amount", style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.itemSubtitle(context), + Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.itemSubtitle(context), ), SelectableText( ref.watch(pAmountFormatter(coin)).format(amount), style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark, - ) - : STextStyles.itemSubtitle12(context), + Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ).extension()!.textDark, + ) + : STextStyles.itemSubtitle12(context), ), ], ), @@ -2512,7 +2604,7 @@ class IconCopyButton extends StatelessWidget { width: 26, child: RawMaterialButton( fillColor: - Theme.of(context).extension()!.buttonBackSecondary, + Theme.of(context).extension()!.buttonBackSecondary, elevation: 0, hoverElevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), @@ -2553,7 +2645,7 @@ class IconPencilButton extends StatelessWidget { width: 26, child: RawMaterialButton( fillColor: - Theme.of(context).extension()!.buttonBackSecondary, + Theme.of(context).extension()!.buttonBackSecondary, elevation: 0, hoverElevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart index 2f07f39563..c425f79e7a 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart @@ -10,58 +10,34 @@ import 'dart:async'; -import 'package:decimal/decimal.dart'; -import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:isar/isar.dart'; -import 'package:tuple/tuple.dart'; import '../../../../models/isar/models/isar_models.dart'; -import '../../../../models/keys/view_only_wallet_data.dart'; -import '../../../../notifications/show_flush_bar.dart'; -import '../../../../pages/receive_view/generate_receiving_uri_qr_code_view.dart'; -import '../../../../providers/db/main_db_provider.dart'; +import '../../../../pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart'; import '../../../../providers/providers.dart'; -import '../../../../route_generator.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/address_utils.dart'; -import '../../../../utilities/amount/amount.dart'; -import '../../../../utilities/assets.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; -import '../../../../utilities/enums/derive_path_type_enum.dart'; -import '../../../../utilities/enums/txs_method_mwc_enum.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/text_styles.dart'; -import '../../../../utilities/util.dart'; import '../../../../wallets/crypto_currency/crypto_currency.dart'; -import '../../../../wallets/isar/providers/eth/current_token_wallet_provider.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/bitcoin_wallet.dart'; import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/intermediate/bip39_hd_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart'; -import '../../../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart'; -import '../../../../wallets/wallet/wallet_mixin_interfaces/multi_address_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; -import '../../../../widgets/conditional_parent.dart'; +import '../../../../widgets/desktop/desktop_dialog.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/icon_widgets/clipboard_icon.dart'; import '../../../../widgets/icon_widgets/x_icon.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; -import '../../../../widgets/toggle.dart'; -import '../../../../widgets/custom_buttons/app_bar_icon_button.dart'; -import '../../../../widgets/custom_loading_overlay.dart'; -import '../../../../widgets/desktop/desktop_dialog.dart'; -import '../../../../widgets/desktop/secondary_button.dart'; -import '../../../../widgets/qr.dart'; -import '../../../../widgets/rounded_white_container.dart'; -import 'desktop_mwc_txs_method_toggle.dart'; class DesktopFinalize extends ConsumerStatefulWidget { const DesktopFinalize({ @@ -99,8 +75,6 @@ class _DesktopFinalizeState extends ConsumerState { final Map _addressMap = {}; final Map> _addressSubMap = {}; - - Future pasteAddress() async { final ClipboardData? data = await clipboard.getData(Clipboard.kTextPlain); if (data?.text != null && data!.text!.isNotEmpty) { @@ -150,7 +124,6 @@ class _DesktopFinalizeState extends ConsumerState { } } } - @override void initState() { @@ -160,18 +133,18 @@ class _DesktopFinalizeState extends ConsumerState { clipboard = widget.clipboard; final wallet = ref.read(pWallets).getWallet(walletId); supportsSpark = ref.read(pWallets).getWallet(walletId) is SparkInterface; - + isMimblewimblecoin = wallet is MimblewimblecoinWallet; if (isMimblewimblecoin) { _selectedMethodMwc = "Slatepack"; } debugPrint("Address generated: $isMimblewimblecoin"); - if (wallet is ViewOnlyOptionInterface && wallet.isViewOnly) { showMultiType = false; } else { - showMultiType = supportsSpark || + showMultiType = + supportsSpark || (wallet is! BCashInterface && wallet is Bip39HDWallet && wallet.supportedAddressTypes.length > 1); @@ -184,9 +157,9 @@ class _DesktopFinalizeState extends ConsumerState { _walletAddressTypes.insert(0, AddressType.spark); } else { _walletAddressTypes.addAll( - (wallet as Bip39HDWallet) - .supportedAddressTypes - .where((e) => e != wallet.info.mainAddressType), + (wallet as Bip39HDWallet).supportedAddressTypes.where( + (e) => e != wallet.info.mainAddressType, + ), ); } } @@ -195,8 +168,9 @@ class _DesktopFinalizeState extends ConsumerState { _walletAddressTypes.removeWhere((e) => e == AddressType.p2pkh); } - _addressMap[_walletAddressTypes[_currentIndex]] = - ref.read(pWalletReceivingAddress(walletId)); + _addressMap[_walletAddressTypes[_currentIndex]] = ref.read( + pWalletReceivingAddress(walletId), + ); if (showMultiType) { for (final type in _walletAddressTypes) { @@ -212,15 +186,15 @@ class _DesktopFinalizeState extends ConsumerState { .findFirst() .asStream() .listen((event) { - WidgetsBinding.instance.addPostFrameCallback((_) { - if (mounted) { - setState(() { - _addressMap[type] = - event?.value ?? _addressMap[type] ?? "[No address yet]"; + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) { + setState(() { + _addressMap[type] = + event?.value ?? _addressMap[type] ?? "[No address yet]"; + }); + } }); - } - }); - }); + }); } } @@ -246,129 +220,141 @@ class _DesktopFinalizeState extends ConsumerState { address = ref.watch(pWalletReceivingAddress(walletId)); } - final wallet = ref.watch(pWallets.select((value) => value.getWallet(walletId))); + final wallet = ref.watch( + pWallets.select((value) => value.getWallet(walletId)), + ); return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - const SizedBox( - height: 4, - ), - const SizedBox( - height: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Label Text - Text( - "Finalize Slatepack", - style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, - ), - textAlign: TextAlign.left, + const SizedBox(height: 4), + const SizedBox(height: 20), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Label Text + Text( + "Finalize Slatepack", + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, ), - const SizedBox(height: 8), - ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + textAlign: TextAlign.left, + ), + const SizedBox(height: 8), + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + minLines: 1, + maxLines: 5, + key: const Key("sendViewAddressFieldKey"), + controller: receiveSlateController, + readOnly: false, + autocorrect: false, + enableSuggestions: false, + toolbarOptions: const ToolbarOptions( + copy: false, + cut: false, + paste: true, + selectAll: false, ), - child: TextField( - minLines: 1, - maxLines: 5, - key: const Key("sendViewAddressFieldKey"), - controller: receiveSlateController, - readOnly: false, - autocorrect: false, - enableSuggestions: false, - toolbarOptions: const ToolbarOptions( - copy: false, - cut: false, - paste: true, - selectAll: false, - ), - onChanged: (newValue) { - _address = newValue; - //_setValidAddressProviders(_address); + onChanged: (newValue) { + _address = newValue; + //_setValidAddressProviders(_address); - setState(() { - _addressToggleFlag = newValue.isNotEmpty; - }); - }, - focusNode: _addressFocusNode, - style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, - height: 1.8, + setState(() { + _addressToggleFlag = newValue.isNotEmpty; + }); + }, + focusNode: _addressFocusNode, + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textFieldActiveText, + height: 1.8, + ), + decoration: standardInputDecoration( + "Enter Final Slatepack Message", + _addressFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: + 12, // Adjust vertical padding for better alignment ), - decoration: standardInputDecoration( - "Enter Final Slatepack Message", - _addressFocusNode, - context, - desktopMed: true, - ).copyWith( - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 12, // Adjust vertical padding for better alignment - ), - suffixIcon: Padding( - padding: receiveSlateController.text.isEmpty - ? const EdgeInsets.only(right: 8) - : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - _addressToggleFlag - ? TextFieldIconButton( - key: const Key("sendViewClearAddressFieldButtonKey"), - onTap: () { - receiveSlateController.text = ""; - _address = ""; - setState(() { - _addressToggleFlag = false; - }); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - key: const Key( - "sendViewPasteAddressFieldButtonKey", - ), - onTap: pasteAddress, - child: receiveSlateController.text.isEmpty + suffixIcon: Padding( + padding: + receiveSlateController.text.isEmpty + ? const EdgeInsets.only(right: 8) + : const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _addressToggleFlag + ? TextFieldIconButton( + key: const Key( + "sendViewClearAddressFieldButtonKey", + ), + onTap: () { + receiveSlateController.text = ""; + _address = ""; + setState(() { + _addressToggleFlag = false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + key: const Key( + "sendViewPasteAddressFieldButtonKey", + ), + onTap: pasteAddress, + child: + receiveSlateController.text.isEmpty ? const ClipboardIcon() : const XIcon(), - ), - ], - ), + ), + ], ), ), ), ), ), - ], - ), - const SizedBox( - height: 32, + ), + ], ), + const SizedBox(height: 32), Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: PrimaryButton( buttonHeight: ButtonHeight.l, - label: "Preview Receive Slatepack", + label: "Finalize Slatepack", enabled: true, - onPressed: () { - debugPrint('Submit button pressed for Mimblewimblecoin Slatepack'); + onPressed: () async { + final wallet = ref.read(pWallets).getWallet(walletId); + await showDialog( + context: context, + builder: + (context) => DesktopDialog( + maxHeight: MediaQuery.of(context).size.height - 64, + maxWidth: 700, + child: MwcSlatepackImportDialog( + wallet: wallet as MimblewimblecoinWallet, + ), + ), + ); }, ), - ) + ), ], ); } } - - diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart index 18bab217ae..918e0abaa8 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart @@ -10,6 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; + import '../../../../themes/stack_colors.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/constants.dart'; @@ -18,10 +19,7 @@ import '../../../../utilities/util.dart'; import '../../../../widgets/toggle.dart'; class MwcTxsMethodToggle extends ConsumerWidget { - const MwcTxsMethodToggle({ - super.key, - this.onChanged, - }); + const MwcTxsMethodToggle({super.key, this.onChanged}); final void Function(TxsMethodMwcType)? onChanged; @@ -33,22 +31,28 @@ class MwcTxsMethodToggle extends ConsumerWidget { return Toggle( onValueChanged: (value) { if (value) { - onChanged?.call(TxsMethodMwcType.slatepack); - } else { onChanged?.call(TxsMethodMwcType.automatic); + } else { + onChanged?.call(TxsMethodMwcType.slatepack); } }, isOn: false, - onColor: isDesktop - ? Theme.of(context) - .extension()! - .rateTypeToggleDesktopColorOn - : Theme.of(context).extension()!.rateTypeToggleColorOn, - offColor: isDesktop - ? Theme.of(context) - .extension()! - .rateTypeToggleDesktopColorOff - : Theme.of(context).extension()!.rateTypeToggleColorOff, + onColor: + isDesktop + ? Theme.of( + context, + ).extension()!.rateTypeToggleDesktopColorOn + : Theme.of( + context, + ).extension()!.rateTypeToggleColorOn, + offColor: + isDesktop + ? Theme.of( + context, + ).extension()!.rateTypeToggleDesktopColorOff + : Theme.of( + context, + ).extension()!.rateTypeToggleColorOff, decoration: BoxDecoration( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, 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 3e74a6258c..260637369f 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 @@ -22,6 +22,7 @@ import '../../../../models/isar/models/isar_models.dart'; import '../../../../models/keys/view_only_wallet_data.dart'; import '../../../../notifications/show_flush_bar.dart'; import '../../../../pages/receive_view/generate_receiving_uri_qr_code_view.dart'; +import '../../../../pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart'; import '../../../../providers/providers.dart'; import '../../../../route_generator.dart'; import '../../../../themes/stack_colors.dart'; @@ -114,7 +115,8 @@ class _DesktopReceiveState extends ConsumerState { if (paymentData != null && paymentData.coin?.uriScheme == coin.uriScheme) { _address = paymentData.address; - receiveSlateController.text = _address!; + receiveSlateController.text = + _selectedMethodMwc == "Slatepack" ? "" : _address!; setState(() { _addressToggleFlag = receiveSlateController.text.isNotEmpty; }); @@ -819,11 +821,21 @@ class _DesktopReceiveState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 8.0), child: PrimaryButton( buttonHeight: ButtonHeight.l, - label: "Preview Receive Slatepack", + label: "Receive Slatepack", enabled: true, - onPressed: () { - debugPrint( - 'Submit button pressed for Mimblewimblecoin Slatepack', + onPressed: () async { + final wallet = ref.read(pWallets).getWallet(walletId); + await showDialog( + context: context, + builder: + (context) => DesktopDialog( + maxHeight: MediaQuery.of(context).size.height - 64, + maxWidth: 700, + child: MwcSlatepackImportDialog( + wallet: wallet as MimblewimblecoinWallet, + clipboard: widget.clipboard, + ), + ), ); }, ), 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 ae5733c968..94a2043ed7 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 @@ -20,10 +20,12 @@ import 'package:flutter_svg/flutter_svg.dart'; import '../../../../models/isar/models/blockchain_data/address.dart'; import '../../../../models/isar/models/blockchain_data/utxo.dart'; import '../../../../models/isar/models/contact_entry.dart'; +import '../../../../models/mwc_transaction_method.dart'; import '../../../../models/paynym/paynym_account_lite.dart'; import '../../../../models/send_view_auto_fill_data.dart'; import '../../../../pages/send_view/confirm_transaction_view.dart'; import '../../../../pages/send_view/sub_widgets/building_transaction_dialog.dart'; +import '../../../../pages/send_view/sub_widgets/mwc_slatepack_dialog.dart'; import '../../../../pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart'; import '../../../../providers/providers.dart'; import '../../../../providers/ui/fee_rate_type_state_provider.dart'; @@ -50,6 +52,7 @@ import '../../../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/models/tx_data.dart'; import '../../../../wallets/wallet/impl/firo_wallet.dart'; +import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart'; @@ -116,7 +119,7 @@ class _DesktopSendState extends ConsumerState { late final bool isStellar; late final bool isMimblewimblecoin; - String? _selectedMethodMwc; + String? _selectedMethodMwc = 'Slatepack'; String? _note; String? _onChainNote; @@ -164,9 +167,135 @@ class _DesktopSendState extends ConsumerState { } } + /// Handle MWC slatepack creation for desktop. + Future _handleDesktopSlatepackCreation( + MimblewimblecoinWallet wallet, + ) async { + try { + final amount = ref.read(pSendAmount)!; + + // Show building dialog. + unawaited( + showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => BuildingTransactionDialog( + coin: coin, + onCancel: + () => Navigator.of(context, rootNavigator: true).pop(), + isSpark: false, + ), + ), + ); + + // Create slatepack. + final slatepackResult = await wallet.createSlatepack( + amount: amount, + recipientAddress: null, // No specific recipient for manual slatepack. + message: _onChainNote?.isNotEmpty == true ? _onChainNote : null, + encrypt: false, // No encryption without recipient address. + ); + + // Close building dialog. + if (mounted) { + Navigator.of(context, rootNavigator: true).pop(); + } + + if (!slatepackResult.success || slatepackResult.slatepack == null) { + throw Exception(slatepackResult.error ?? 'Failed to create slatepack'); + } + + // Show slatepack dialog. + if (mounted) { + await showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => DesktopDialog( + maxHeight: MediaQuery.of(context).size.height - 64, + maxWidth: 700, + child: MwcSlatepackDialog(slatepackResult: slatepackResult), + ), + ); + + // Clear form after slatepack dialog is closed. + clearSendForm(); + } + } catch (e, s) { + Logging.instance.e('Failed to create MWC slatepack on desktop: $e\n$s'); + + // Close building dialog if still open. + if (mounted) { + Navigator.of(context, rootNavigator: true).pop(); + } + + if (mounted) { + await showDialog( + context: context, + builder: + (context) => DesktopDialog( + maxWidth: 450, + maxHeight: double.infinity, + child: Padding( + padding: const EdgeInsets.only(left: 32, bottom: 32), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Slatepack Creation Failed', + style: STextStyles.desktopH3(context), + ), + const DesktopDialogCloseButton(), + ], + ), + const SizedBox(height: 12), + Padding( + padding: const EdgeInsets.only(right: 32), + child: Text( + 'Failed to create slatepack: $e', + textAlign: TextAlign.left, + style: STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith(fontSize: 18), + ), + ), + const SizedBox(height: 40), + Padding( + padding: const EdgeInsets.only(right: 32), + child: Row( + children: [ + Expanded( + child: PrimaryButton( + buttonHeight: ButtonHeight.l, + label: 'OK', + onPressed: () => Navigator.of(context).pop(), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + } + } + Future previewSend() async { final wallet = ref.read(pWallets).getWallet(walletId); + // Handle MWC slatepack transactions directly. + if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') { + await _handleDesktopSlatepackCreation(wallet as MimblewimblecoinWallet); + return; + } + final Amount amount = ref.read(pSendAmount)!; final Amount availableBalance; if (coin is Firo || ref.read(pWalletInfo(walletId)).isMwebEnabled) { @@ -442,10 +571,18 @@ class _DesktopSendState extends ConsumerState { txData: TxData( recipients: [ TxRecipient( - address: _address!, + address: + coin is Mimblewimblecoin && + _selectedMethodMwc == "Slatepack" + ? "BEGINSLATEPACK. .ENDSLATEPACK" // TODO: This is a hack so that the address validation does not fail. Need to handle this better. + : _address!, amount: amount, isChange: false, - addressType: wallet.cryptoCurrency.getAddressType(_address!)!, + addressType: + coin is Mimblewimblecoin && + _selectedMethodMwc == "Slatepack" + ? AddressType.mimbleWimble + : wallet.cryptoCurrency.getAddressType(_address!)!, ), ], memo: memo, @@ -949,6 +1086,11 @@ class _DesktopSendState extends ConsumerState { isMimblewimblecoin = coin is Mimblewimblecoin; if (isMimblewimblecoin) { _selectedMethodMwc = "Slatepack"; + // Initialize provider to MWCMQS (automatic method). + WidgetsBinding.instance.addPostFrameCallback((_) { + ref.read(pSelectedMwcTransactionMethod.notifier).state = + TransactionMethod.mwcmqs; + }); } sendToController = TextEditingController(); @@ -1120,10 +1262,15 @@ class _DesktopSendState extends ConsumerState { onChanged: (TxsMethodMwcType type) { setState(() { _selectedMethodMwc = - type == TxsMethodMwcType.automatic + type == TxsMethodMwcType.slatepack ? 'Slatepack' : 'Automatic'; }); + // Update the provider as well. + ref.read(pSelectedMwcTransactionMethod.notifier).state = + type == TxsMethodMwcType.slatepack + ? TransactionMethod.slatepack + : TransactionMethod.mwcmqs; }, ), ), @@ -1429,7 +1576,9 @@ class _DesktopSendState extends ConsumerState { ), ), const SizedBox(height: 20), - if (!isPaynymSend) + // Hide "Send to" field for MWC slatepack transactions. + if (!isPaynymSend && + !(isMimblewimblecoin && _selectedMethodMwc == 'Slatepack')) Text( "Send to", style: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -1440,8 +1589,11 @@ class _DesktopSendState extends ConsumerState { ), textAlign: TextAlign.left, ), - if (!isPaynymSend) const SizedBox(height: 10), - if (!isPaynymSend) + if (!isPaynymSend && + !(isMimblewimblecoin && _selectedMethodMwc == 'Slatepack')) + const SizedBox(height: 10), + if (!isPaynymSend && + !(isMimblewimblecoin && _selectedMethodMwc == 'Slatepack')) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, diff --git a/lib/providers/ui/preview_tx_button_state_provider.dart b/lib/providers/ui/preview_tx_button_state_provider.dart index 9ff71aca7d..f8955f8888 100644 --- a/lib/providers/ui/preview_tx_button_state_provider.dart +++ b/lib/providers/ui/preview_tx_button_state_provider.dart @@ -10,6 +10,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; +import '../../models/mwc_transaction_method.dart'; import '../../utilities/amount/amount.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; import '../wallet/public_private_balance_state_provider.dart'; @@ -20,10 +21,22 @@ final pValidSparkSendToAddress = StateProvider.autoDispose((_) => false); final pIsExchangeAddress = StateProvider((_) => false); +// MWC Transaction Method Provider. +final pSelectedMwcTransactionMethod = + StateProvider.autoDispose((_) => null); + final pPreviewTxButtonEnabled = Provider.autoDispose .family((ref, coin) { final amount = ref.watch(pSendAmount) ?? Amount.zero; + // For MWC slatepack transactions, address validation is not required. + if (coin is Mimblewimblecoin) { + final selectedMethod = ref.watch(pSelectedMwcTransactionMethod); + if (selectedMethod == TransactionMethod.slatepack) { + return amount > Amount.zero; + } + } + if (coin is Firo) { final firoType = ref.watch(publicPrivateBalanceStateProvider); switch (firoType) { diff --git a/lib/services/mwc_wallet_service.dart b/lib/services/mwc_wallet_service.dart new file mode 100644 index 0000000000..c44f84380a --- /dev/null +++ b/lib/services/mwc_wallet_service.dart @@ -0,0 +1,552 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:flutter_libmwc/lib.dart' as mwc; + +import '../models/mwcmqs_config_model.dart'; +import '../utilities/amount/amount.dart'; +import '../utilities/default_mwcmqs.dart'; +import '../utilities/logger.dart'; +import '../utilities/stack_file_system.dart'; + +/// Service layer that wraps flutter_libmwc FFI functions for Stack Wallet integration. +/// +/// Based on the flutter_libmwc example WalletService but adapted for Stack Wallet patterns. +class MwcWalletService { + static bool _isInitialized = false; + static final Map _walletHandles = {}; + + /// Initialize the MWC wallet service. + static Future initialize() async { + if (_isInitialized) return; + + Logging.instance.i('MWC Wallet Service initialized'); + _isInitialized = true; + } + + /// Create a new MWC wallet. + static Future createWallet({ + required String walletId, + required String password, + String? customMnemonic, + }) async { + try { + Logging.instance.i('Creating MWC wallet: $walletId'); + + final config = await _getWalletConfig(walletId); + final mnemonic = customMnemonic ?? mwc.Libmwc.getMnemonic(); + + final result = await mwc.Libmwc.initializeNewWallet( + config: config, + mnemonic: mnemonic, + password: password, + name: walletId, + ); + + if (result.toUpperCase().contains('ERROR')) { + return MwcWalletResult( + success: false, + error: 'Failed to create wallet: $result', + ); + } + + _walletHandles[walletId] = result; + + Logging.instance.i('MWC wallet created successfully: $walletId'); + return MwcWalletResult( + success: true, + walletId: walletId, + data: {'mnemonic': mnemonic, 'handle': result}, + ); + } catch (e, s) { + Logging.instance.e('Failed to create MWC wallet: $e\n$s'); + return MwcWalletResult( + success: false, + error: 'Failed to create wallet: $e', + ); + } + } + + /// Recover MWC wallet from mnemonic. + static Future recoverWallet({ + required String walletId, + required String password, + required String mnemonic, + }) async { + try { + Logging.instance.i('Recovering MWC wallet: $walletId'); + + final config = await _getWalletConfig(walletId); + + await mwc.Libmwc.recoverWallet( + config: config, + password: password, + mnemonic: mnemonic, + name: walletId, + ); + + final openResult = await openWallet( + walletId: walletId, + password: password, + ); + + if (openResult.success) { + Logging.instance.i('MWC wallet recovered successfully: $walletId'); + return MwcWalletResult( + success: true, + walletId: walletId, + data: {'recovered': true}, + ); + } + + return openResult; + } catch (e, s) { + Logging.instance.e('Failed to recover MWC wallet: $e\n$s'); + return MwcWalletResult( + success: false, + error: 'Failed to recover wallet: $e', + ); + } + } + + /// Open an existing MWC wallet. + static Future openWallet({ + required String walletId, + required String password, + }) async { + try { + Logging.instance.i('Opening MWC wallet: $walletId'); + + final config = await _getWalletConfig(walletId); + + final result = await mwc.Libmwc.openWallet( + config: config, + password: password, + ); + + if (result.toUpperCase().contains('ERROR')) { + return MwcWalletResult( + success: false, + error: 'Failed to open wallet: $result', + ); + } + + _walletHandles[walletId] = result; + + Logging.instance.i('MWC wallet opened successfully: $walletId'); + return MwcWalletResult( + success: true, + walletId: walletId, + data: {'handle': result}, + ); + } catch (e, s) { + Logging.instance.e('Failed to open MWC wallet: $e\n$s'); + return MwcWalletResult( + success: false, + error: 'Failed to open wallet: $e', + ); + } + } + + /// Create a slatepack for sending MWC. + static Future createSlatepack({ + required String walletId, + required Amount amount, + String? recipientAddress, + String? message, + bool encrypt = false, + int minimumConfirmations = 1, + }) async { + try { + final handle = _walletHandles[walletId]; + if (handle == null) { + return SlatepackResult( + success: false, + error: 'Wallet not open: $walletId', + ); + } + + Logging.instance.i('Creating slatepack for wallet: $walletId'); + + // Generate S1 slate JSON. + final s1Json = await mwc.Libmwc.txInit( + wallet: handle, + amount: amount.raw.toInt(), + minimumConfirmations: minimumConfirmations, + selectionStrategyIsAll: false, + message: message ?? '', + ); + + // Encode to slatepack. + final slatepackEncode = await mwc.Libmwc.encodeSlatepack( + slateJson: s1Json, + recipientAddress: recipientAddress, + encrypt: encrypt, + wallet: handle, + ); + + Logging.instance.i('Slatepack created successfully'); + return SlatepackResult( + success: true, + slatepack: slatepackEncode.slatepack, + slateJson: s1Json, + wasEncrypted: slatepackEncode.wasEncrypted, + recipientAddress: slatepackEncode.recipientAddress, + ); + } catch (e, s) { + Logging.instance.e('Failed to create slatepack: $e\n$s'); + return SlatepackResult( + success: false, + error: 'Failed to create slatepack: $e', + ); + } + } + + /// Decode a slatepack. + static Future decodeSlatepack({ + required String slatepack, + String? walletId, + }) async { + try { + Logging.instance.i('Decoding slatepack'); + + // Use wallet-aware decode if wallet is open (handles encrypted slatepacks) + final handle = walletId != null ? _walletHandles[walletId] : null; + final result = + (handle != null) + ? await mwc.Libmwc.decodeSlatepackWithWallet( + wallet: handle, + slatepack: slatepack, + ) + : await mwc.Libmwc.decodeSlatepack(slatepack: slatepack); + + Logging.instance.i('Slatepack decoded successfully'); + return SlatepackDecodeResult( + success: true, + slateJson: result.slateJson, + wasEncrypted: result.wasEncrypted, + senderAddress: result.senderAddress, + recipientAddress: result.recipientAddress, + ); + } catch (e, s) { + Logging.instance.e('Failed to decode slatepack: $e\n$s'); + return SlatepackDecodeResult( + success: false, + error: 'Failed to decode slatepack: $e', + ); + } + } + + /// Receive a slatepack and return response slatepack. + static Future receiveSlatepack({ + required String walletId, + required String slatepack, + }) async { + try { + final handle = _walletHandles[walletId]; + if (handle == null) { + return ReceiveResult( + success: false, + error: 'Wallet not open: $walletId', + ); + } + + Logging.instance.i('Receiving slatepack for wallet: $walletId'); + + // Decode to get slate JSON and sender address. + final decoded = await decodeSlatepack( + slatepack: slatepack, + walletId: walletId, + ); + if (!decoded.success || decoded.slateJson == null) { + return ReceiveResult( + success: false, + error: decoded.error ?? 'Failed to decode slatepack', + ); + } + + // Receive and get updated slate JSON. + final received = await mwc.Libmwc.txReceiveDetailed( + wallet: handle, + slateJson: decoded.slateJson!, + ); + + // Encode response slatepack back to sender. + final encoded = await mwc.Libmwc.encodeSlatepack( + slateJson: received.slateJson, + recipientAddress: decoded.senderAddress, + encrypt: decoded.senderAddress != null, + wallet: handle, + ); + + Logging.instance.i('Slatepack received successfully'); + return ReceiveResult( + success: true, + slateId: received.slateId, + commitId: received.commitId, + responseSlatepack: encoded.slatepack, + wasEncrypted: encoded.wasEncrypted, + recipientAddress: decoded.senderAddress, + ); + } catch (e, s) { + Logging.instance.e('Failed to receive slatepack: $e\n$s'); + return ReceiveResult( + success: false, + error: 'Failed to receive slatepack: $e', + ); + } + } + + /// Finalize a slatepack (sender step 3). + static Future finalizeSlatepack({ + required String walletId, + required String slatepack, + }) async { + try { + final handle = _walletHandles[walletId]; + if (handle == null) { + return FinalizeResult( + success: false, + error: 'Wallet not open: $walletId', + ); + } + + Logging.instance.i('Finalizing slatepack for wallet: $walletId'); + + // Decode to get slate JSON. + final decoded = await decodeSlatepack( + slatepack: slatepack, + walletId: walletId, + ); + if (!decoded.success || decoded.slateJson == null) { + return FinalizeResult( + success: false, + error: decoded.error ?? 'Failed to decode slatepack', + ); + } + + // Finalize transaction. + final finalized = await mwc.Libmwc.txFinalize( + wallet: handle, + slateJson: decoded.slateJson!, + ); + + Logging.instance.i('Slatepack finalized successfully'); + return FinalizeResult( + success: true, + slateId: finalized.slateId, + commitId: finalized.commitId, + ); + } catch (e, s) { + Logging.instance.e('Failed to finalize slatepack: $e\n$s'); + return FinalizeResult( + success: false, + error: 'Failed to finalize slatepack: $e', + ); + } + } + + /// Start MWCMQS listener. + static Future startMwcqsListener({ + required String walletId, + MwcMqsConfigModel? config, + }) async { + try { + final handle = _walletHandles[walletId]; + if (handle == null) { + throw Exception('Wallet not open: $walletId'); + } + + Logging.instance.i('Starting MWCMQS listener for wallet: $walletId'); + + final mwcmqsConfig = + config ?? + MwcMqsConfigModel.fromServer(DefaultMwcMqs.defaultMwcMqsServer); + + mwc.Libmwc.startMwcMqsListener( + wallet: handle, + mwcmqsConfig: mwcmqsConfig.toString(), + ); + + Logging.instance.i('MWCMQS listener started successfully'); + } catch (e, s) { + Logging.instance.e('Failed to start MWCMQS listener: $e\n$s'); + rethrow; + } + } + + /// Stop MWCMQS listener. + static Future stopMwcqsListener() async { + try { + Logging.instance.i('Stopping MWCMQS listener'); + + mwc.Libmwc.stopMwcMqsListener(); + + Logging.instance.i('MWCMQS listener stopped successfully'); + } catch (e, s) { + Logging.instance.e('Failed to stop MWCMQS listener: $e\n$s'); + } + } + + /// Get MWCMQS address for wallet. + static Future getMwcqsAddress({ + required String walletId, + int index = 0, + }) async { + try { + final handle = _walletHandles[walletId]; + if (handle == null) { + throw Exception('Wallet not open: $walletId'); + } + + final address = await mwc.Libmwc.getAddressInfo( + wallet: handle, + index: index, + ); + + return address; + } catch (e, s) { + Logging.instance.e('Failed to get MWCMQS address: $e\n$s'); + rethrow; + } + } + + /// Validate MWC address. + static bool validateAddress(String address) { + try { + return mwc.Libmwc.validateSendAddress(address: address); + } catch (e, s) { + Logging.instance.e('Failed to validate address: $e\n$s'); + return false; + } + } + + /// Generate mnemonic. + static String generateMnemonic() { + try { + return mwc.Libmwc.getMnemonic(); + } catch (e, s) { + Logging.instance.e('Failed to generate mnemonic: $e\n$s'); + rethrow; + } + } + + /// Check if wallet is open. + static bool isWalletOpen(String walletId) { + return _walletHandles.containsKey(walletId); + } + + /// Close wallet. + static void closeWallet(String walletId) { + _walletHandles.remove(walletId); + } + + /// Get wallet configuration. + static Future _getWalletConfig(String walletId) async { + final walletDir = await _getWalletDirectory(walletId); + + final config = { + 'wallet_dir': walletDir, + 'check_node_api_http_addr': 'https://mwc713.mwc.mw:443', + 'chain': 'mainnet', + 'account': 'default', + }; + + return jsonEncode(config); + } + + /// Get wallet directory path. + static Future _getWalletDirectory(String walletId) async { + final Directory appDir = await StackFileSystem.applicationRootDirectory(); + final path = "${appDir.path}/mimblewimblecoin"; + final String name = walletId.trim(); + return '$path/$name'; + } +} + +/// Result classes for MWC wallet operations. + +class MwcWalletResult { + final bool success; + final String? walletId; + final String? error; + final Map? data; + + MwcWalletResult({ + required this.success, + this.walletId, + this.error, + this.data, + }); +} + +class SlatepackResult { + final bool success; + final String? error; + final String? slatepack; + final String? slateJson; + final bool? wasEncrypted; + final String? recipientAddress; + + SlatepackResult({ + required this.success, + this.error, + this.slatepack, + this.slateJson, + this.wasEncrypted, + this.recipientAddress, + }); +} + +class SlatepackDecodeResult { + final bool success; + final String? error; + final String? slateJson; + final bool? wasEncrypted; + final String? senderAddress; + final String? recipientAddress; + + SlatepackDecodeResult({ + required this.success, + this.error, + this.slateJson, + this.wasEncrypted, + this.senderAddress, + this.recipientAddress, + }); +} + +class ReceiveResult { + final bool success; + final String? error; + final String? slateId; + final String? commitId; + final String? responseSlatepack; + final bool? wasEncrypted; + final String? recipientAddress; + + ReceiveResult({ + required this.success, + this.error, + this.slateId, + this.commitId, + this.responseSlatepack, + this.wasEncrypted, + this.recipientAddress, + }); +} + +class FinalizeResult { + final bool success; + final String? error; + final String? slateId; + final String? commitId; + + FinalizeResult({ + required this.success, + this.error, + this.slateId, + this.commitId, + }); +} diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index cc6d397c39..1e9e04691d 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -1,6 +1,7 @@ import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; import '../../../models/isar/models/blockchain_data/address.dart'; +import '../../../models/mwc_transaction_method.dart'; import '../../../models/node_model.dart'; import '../../../utilities/default_nodes.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; @@ -52,7 +53,13 @@ class Mimblewimblecoin extends Bip39Currency { @override bool validateAddress(String address) { - Uri? uri = Uri.tryParse(address); + // Check if it's a slatepack first. + if (isSlatepack(address)) { + return true; + } + + // Check URI schemes (HTTP, HTTPS, MWCMQS). + final Uri? uri = Uri.tryParse(address); if (uri != null && (uri.scheme == "http" || uri.scheme == "https" || @@ -61,9 +68,89 @@ class Mimblewimblecoin extends Bip39Currency { !uri.host.endsWith(".onion")) { return true; } + + // Use libmwc for other address validation. return mimblewimblecoin.Libmwc.validateSendAddress(address: address); } + /// Check if data is a slatepack. + bool isSlatepack(String data) { + return data.trim().startsWith('BEGINSLATE') && + (data.trim().endsWith('ENDSLATEPACK') || + data.trim().endsWith('ENDSLATEPACK.') || + data.trim().endsWith('ENDSLATE_BIN') || + data.trim().endsWith('ENDSLATE_BIN.')); + } + + /// Check if address is MWCMQS format. + bool isMwcmqsAddress(String address) { + return address.startsWith('mwcmqs://'); + } + + /// Check if address is HTTP format. + bool isHttpAddress(String address) { + return address.startsWith('http://') || address.startsWith('https://'); + } + + /// Detect transaction type based on address/data format. + TransactionMethod getTransactionMethod(String addressOrData) { + if (isSlatepack(addressOrData)) { + return TransactionMethod.slatepack; + } else if (isMwcmqsAddress(addressOrData)) { + return TransactionMethod.mwcmqs; + } else if (isHttpAddress(addressOrData)) { + return TransactionMethod.http; + } else { + return TransactionMethod.unknown; + } + } + + /// Validate slatepack format. + bool validateSlatepack(String slatepack) { + try { + final trimmed = slatepack.trim(); + if (!isSlatepack(trimmed)) { + return false; + } + + // Basic structure validation. + final lines = trimmed.split('\n'); + if (lines.length < 3) { + return false; + } + + // Should have header, content, and footer. + return lines.first.startsWith('BEGINSLATEPACK.') && + lines.last.endsWith('.ENDSLATEPACK') && + lines.length > 2; + } catch (e) { + return false; + } + } + + /// Get expected slatepack type from content (S1, S2, S3). + String? getSlatepackType(String slatepack) { + if (!validateSlatepack(slatepack)) { + return null; + } + + try { + // This is a simplified approach - in reality you'd need to decode + // the slatepack content to determine the exact type. + final lines = slatepack.trim().split('\n'); + final header = lines.first; + + // Basic heuristic based on header format. + if (header.contains('BEGINSLATEPACK.')) { + return 'unknown'; // Would need proper decoding to determine S1/S2/S3. + } + + return null; + } catch (e) { + return null; + } + } + @override NodeModel defaultNode({required bool isPrimary}) { switch (network) { @@ -130,7 +217,6 @@ class Mimblewimblecoin extends Bip39Currency { @override AddressType? getAddressType(String address) { - // TODO: implement getAddressType. - throw UnimplementedError(); + return AddressType.mimbleWimble; } } diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 1a349a777b..e9a8330169 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -10,7 +10,6 @@ import 'package:flutter_libmwc/models/transaction.dart' import 'package:isar/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; -import 'package:web_socket_channel/web_socket_channel.dart'; import '../../../models/balance.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; @@ -27,6 +26,7 @@ import '../../../services/event_bus/events/global/node_connection_status_changed import '../../../services/event_bus/events/global/refresh_percent_changed_event.dart'; import '../../../services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import '../../../services/event_bus/global_event_bus.dart'; +import '../../../services/mwc_wallet_service.dart'; import '../../../utilities/amount/amount.dart'; import '../../../utilities/default_mwcmqs.dart'; import '../../../utilities/flutter_secure_storage_interface.dart'; @@ -45,7 +45,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { final syncMutex = Mutex(); NodeModel? _mimblewimblecoinNode; Timer? timer; - bool _logsInitialized = false; double highestPercent = 0; Future get getSyncPercent async { @@ -128,6 +127,373 @@ class MimblewimblecoinWallet extends Bip39Wallet { return _mwcMqsConfig; } + // ================= Slatepack Operations =================================== + + /// Create a slatepack for sending MWC. + Future createSlatepack({ + required Amount amount, + String? recipientAddress, + String? message, + bool encrypt = false, + int? minimumConfirmations, + }) async { + try { + await MwcWalletService.initialize(); + + // Ensure wallet is open in service. + if (!MwcWalletService.isWalletOpen(walletId)) { + final password = await secureStorageInterface.read( + key: '${walletId}_password', + ); + if (password == null) { + throw Exception('Wallet password not found'); + } + + final openResult = await MwcWalletService.openWallet( + walletId: walletId, + password: password, + ); + + if (!openResult.success) { + throw Exception(openResult.error ?? 'Failed to open wallet'); + } + } + + return await MwcWalletService.createSlatepack( + walletId: walletId, + amount: amount, + recipientAddress: recipientAddress, + message: message, + encrypt: encrypt, + minimumConfirmations: + minimumConfirmations ?? cryptoCurrency.minConfirms, + ); + } catch (e, s) { + Logging.instance.e('Failed to create slatepack: $e\n$s'); + return SlatepackResult(success: false, error: e.toString()); + } + } + + /// Decode a slatepack. + Future decodeSlatepack(String slatepack) async { + try { + await MwcWalletService.initialize(); + return await MwcWalletService.decodeSlatepack( + slatepack: slatepack, + walletId: MwcWalletService.isWalletOpen(walletId) ? walletId : null, + ); + } catch (e, s) { + Logging.instance.e('Failed to decode slatepack: $e\n$s'); + return SlatepackDecodeResult(success: false, error: e.toString()); + } + } + + /// Receive a slatepack and return response slatepack. + Future receiveSlatepack(String slatepack) async { + try { + await MwcWalletService.initialize(); + + // Ensure wallet is open in service. + if (!MwcWalletService.isWalletOpen(walletId)) { + final password = await secureStorageInterface.read( + key: '${walletId}_password', + ); + if (password == null) { + throw Exception('Wallet password not found'); + } + + final openResult = await MwcWalletService.openWallet( + walletId: walletId, + password: password, + ); + + if (!openResult.success) { + throw Exception(openResult.error ?? 'Failed to open wallet'); + } + } + + return await MwcWalletService.receiveSlatepack( + walletId: walletId, + slatepack: slatepack, + ); + } catch (e, s) { + Logging.instance.e('Failed to receive slatepack: $e\n$s'); + return ReceiveResult(success: false, error: e.toString()); + } + } + + /// Finalize a slatepack (sender step 3). + Future finalizeSlatepack(String slatepack) async { + try { + await MwcWalletService.initialize(); + + // Ensure wallet is open in service. + if (!MwcWalletService.isWalletOpen(walletId)) { + final password = await secureStorageInterface.read( + key: '${walletId}_password', + ); + if (password == null) { + throw Exception('Wallet password not found'); + } + + final openResult = await MwcWalletService.openWallet( + walletId: walletId, + password: password, + ); + + if (!openResult.success) { + throw Exception(openResult.error ?? 'Failed to open wallet'); + } + } + + return await MwcWalletService.finalizeSlatepack( + walletId: walletId, + slatepack: slatepack, + ); + } catch (e, s) { + Logging.instance.e('Failed to finalize slatepack: $e\n$s'); + return FinalizeResult(success: false, error: e.toString()); + } + } + + /// Start MWCMQS listener for automatic transaction processing. + Future startSlatepackListener() async { + try { + await MwcWalletService.initialize(); + + if (!MwcWalletService.isWalletOpen(walletId)) { + final password = await secureStorageInterface.read( + key: '${walletId}_password', + ); + if (password == null) { + throw Exception('Wallet password not found'); + } + + final openResult = await MwcWalletService.openWallet( + walletId: walletId, + password: password, + ); + + if (!openResult.success) { + throw Exception(openResult.error ?? 'Failed to open wallet'); + } + } + + final mwcmqsConfig = await getMwcMqsConfig(); + await MwcWalletService.startMwcqsListener( + walletId: walletId, + config: mwcmqsConfig, + ); + } catch (e, s) { + Logging.instance.e('Failed to start slatepack listener: $e\n$s'); + rethrow; + } + } + + /// Stop MWCMQS listener. + Future stopSlatepackListener() async { + try { + await MwcWalletService.stopMwcqsListener(); + } catch (e, s) { + Logging.instance.e('Failed to stop slatepack listener: $e\n$s'); + } + } + + /// Validate MWC address. + bool validateMwcAddress(String address) { + return MwcWalletService.validateAddress(address); + } + + /// Detect if an address is a slatepack. + bool isSlatepack(String data) { + return data.trim().startsWith('BEGINSLATE') && + (data.trim().endsWith('ENDSLATEPACK') || + data.trim().endsWith('ENDSLATEPACK.') || + data.trim().endsWith('ENDSLATE_BIN') || + data.trim().endsWith('ENDSLATE_BIN.')); + } + + /// Detect if an address is MWCMQS format. + bool isMwcmqsAddress(String address) { + return address.startsWith('mwcmqs://'); + } + + /// Detect if an address is HTTP format. + bool isHttpAddress(String address) { + return address.startsWith('http://') || address.startsWith('https://'); + } + + /// Analyze a slatepack and determine transaction type and metadata. + /// Returns a record with transaction type and slate information. + Future< + ({ + String type, + String status, + String? amount, + bool wasEncrypted, + String? senderAddress, + String? recipientAddress, + String slateId, + }) + > + analyzeSlatepack(String slatepack) async { + try { + // Get wallet handle if available + final wallet = await secureStorageInterface.read( + key: '${walletId}_wallet', + ); + + // Decode the slatepack + final decoded = + wallet != null + ? await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( + wallet: wallet, + slatepack: slatepack, + ) + : await mimblewimblecoin.Libmwc.decodeSlatepack( + slatepack: slatepack, + ); + + // Parse the slate JSON to extract metadata + final slateData = jsonDecode(decoded.slateJson); + final String slateId = "${slateData['id'] ?? ''}"; + final String? amountStr = slateData['amount']?.toString(); + + print(121212); + print(slateData); + + // Determine slate status from the slate structure + String status = 'Unknown'; + String type = 'Unknown'; + + // Check participant data to determine slate status + final List? participants = + slateData['participant_data'] as List?; + if (participants != null && participants.isNotEmpty) { + // Count how many participants have signatures + int signedParticipants = 0; + for (final participant in participants) { + if (participant['part_sig'] != null) { + signedParticipants++; + } + } + + // Determine status based on signatures and participant count + if (signedParticipants == 0) { + status = 'S1'; + type = 'Outgoing'; // Initial send slate - this is outgoing + } else if (signedParticipants == 1) { + status = 'S2'; + type = 'Incoming'; // Response slate - this means we're receiving + } else if (signedParticipants >= participants.length) { + status = 'S3'; + type = 'Outgoing'; // Finalized slate - completed outgoing transaction + } + } + + // Fallback: check for explicit 'sta' field (some slates may have this) + if (status == 'Unknown' && slateData['sta'] != null) { + status = "${slateData['sta']}"; + if (status == 'S1') { + type = 'Outgoing'; + } else if (status == 'S2') { + type = 'Incoming'; + } else if (status == 'S3') { + type = 'Outgoing'; + } + } + + return ( + type: type, + status: status, + amount: amountStr, + wasEncrypted: decoded.wasEncrypted, + senderAddress: decoded.senderAddress, + recipientAddress: decoded.recipientAddress, + slateId: slateId, + ); + } catch (e) { + // If we can't decode it, return unknown + return ( + type: 'Unknown', + status: 'Unknown', + amount: null, + wasEncrypted: false, + senderAddress: null, + recipientAddress: null, + slateId: '', + ); + } + } + + /// Improved transaction type detection for slatepacks. + /// This replaces "Unknown" types with better determined types based on slate analysis. + Future getSlatepackTransactionType(String address) async { + try { + // Check if the address is actually a slatepack + if (!isSlatepack(address)) { + return 'Unknown'; + } + + // Analyze the slatepack to determine the actual transaction type + final analysis = await analyzeSlatepack(address); + + // Map slate status to meaningful transaction types + switch (analysis.status) { + case 'S1': + return 'Outgoing'; // Initial send slate - this is outgoing + case 'S2': + return 'Incoming'; // Response slate - this means we're receiving + case 'S3': + return 'Outgoing'; // Finalized slate - completed outgoing transaction + default: + return analysis.type; // Fall back to our basic analysis + } + } catch (e) { + // If analysis fails, return Unknown + return 'Unknown'; + } + } + + /// Enhanced transaction type detection that can analyze slatepack transactions. + /// Use this method to improve "Unknown" transaction types after they're loaded. + Future getEnhancedTransactionType( + TransactionV2 transaction, + ) async { + try { + // If transaction is already properly typed, return as-is + if (transaction.type != TransactionType.unknown) { + return transaction.type; + } + + // Check if this is a MWC transaction with slatepack data + if (transaction.isMimblewimblecoinTransaction) { + // Try to analyze any slatepack addresses in the transaction + for (final output in transaction.outputs) { + for (final address in output.addresses) { + if (isSlatepack(address)) { + final slatepackType = await getSlatepackTransactionType(address); + switch (slatepackType) { + case 'Outgoing': + return TransactionType.outgoing; + case 'Incoming': + return TransactionType.incoming; + default: + continue; + } + } + } + } + } + + // If we can't determine a better type, return unknown + return TransactionType.unknown; + } catch (e) { + Logging.instance.w("Failed to enhance transaction type: $e"); + return transaction.type; + } + } + // ================= Private ================================================= Future _getConfig() async { @@ -225,30 +591,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); } - Future _testMwcmqsServer(MwcMqsConfigModel mwcmqsConfig) async { - final host = mwcmqsConfig.host; - final port = mwcmqsConfig.port ?? 443; - WebSocketChannel? channel; - try { - final uri = Uri.parse('wss://$host:$port'); - - channel = WebSocketChannel.connect(uri); - - await channel.ready; - - final response = await channel.stream.first.timeout( - const Duration(seconds: 2), - ); - - return response is String && response.contains("Challenge"); - } catch (_) { - Logging.instance.i("_testMwcmqsConnection failed on \"$host:$port\""); - return false; - } finally { - await channel?.sink.close(); - } - } - Future _putSendToAddresses( ({String slateId, String commitId}) slateData, Map txAddressInfo, @@ -444,6 +786,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future init({bool? isRestore}) async { + // Initialize MWC wallet service. + await MwcWalletService.initialize(); + if (isRestore != true) { String? encodedWallet = await secureStorageInterface.read( key: "${walletId}_wallet", @@ -618,7 +963,19 @@ class MimblewimblecoinWallet extends Bip39Wallet { } TxRecipient recipient = txData.recipients!.first; + final String receiverAddress = recipient.address; + + // Check if this is a slatepack being provided instead of an address. + if (isSlatepack(receiverAddress)) { + // For slatepack input, we need different handling + // This would be used for receiving/finalizing slatepacks. + return txData.copyWith( + fee: Amount.zeroWith(fractionDigits: cryptoCurrency.fractionDigits), + otherData: jsonEncode({'isSlatepackInput': true}), + ); + } + // For regular address-based sends, calculate fee final int realFee = await _nativeFee(recipient.amount.raw.toInt()); final feeAmount = Amount( rawValue: BigInt.from(realFee), @@ -640,7 +997,21 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); } - return txData.copyWith(recipients: [recipient], fee: feeAmount); + // Determine transaction method based on address format. + String txMethod = 'unknown'; + if (isMwcmqsAddress(receiverAddress)) { + txMethod = 'mwcmqs'; + } else if (isHttpAddress(receiverAddress)) { + txMethod = 'http'; + } else if (validateMwcAddress(receiverAddress)) { + txMethod = 'slatepack'; // Manual slatepack exchange. + } + + return txData.copyWith( + recipients: [recipient], + fee: feeAmount, + otherData: jsonEncode({'transactionMethod': txMethod}), + ); } catch (e, s) { Logging.instance.e("Mimblewimblecoin prepareSend: $e\n$s"); rethrow; @@ -966,7 +1337,30 @@ class MimblewimblecoinWallet extends Bip39Wallet { walletOwns: true, ); } else { - txType = TransactionType.outgoing; + // For outgoing transactions, check if we have a slatepack address to analyze + TransactionType determinedType = TransactionType.outgoing; + + // Try to get better type determination for slatepack transactions + if (addressTo != null) { + try { + final slatepackType = await getSlatepackTransactionType( + addressTo, + ); + if (slatepackType == 'Incoming') { + determinedType = TransactionType.incoming; + } else if (slatepackType == 'Outgoing') { + determinedType = TransactionType.outgoing; + } + // If slatepackType is 'Unknown', we keep the original outgoing type + } catch (e) { + // If analysis fails, keep original type determination + Logging.instance.w( + "Failed to analyze slatepack for better type detection: $e", + ); + } + } + + txType = determinedType; } outputs.add(output); From 0f367d2c3cdba0aed11097d885735f686532546f Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 00:09:03 -0500 Subject: [PATCH 045/178] fix(mwc): fix logic error and remove slatepack validation hack TODO: make sure that we can enter the slatepack flow without an address /etc --- .../wallet_view/sub_widgets/desktop_send.dart | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 94a2043ed7..4537d32856 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 @@ -571,18 +571,10 @@ class _DesktopSendState extends ConsumerState { txData: TxData( recipients: [ TxRecipient( - address: - coin is Mimblewimblecoin && - _selectedMethodMwc == "Slatepack" - ? "BEGINSLATEPACK. .ENDSLATEPACK" // TODO: This is a hack so that the address validation does not fail. Need to handle this better. - : _address!, + address: _address!, amount: amount, isChange: false, - addressType: - coin is Mimblewimblecoin && - _selectedMethodMwc == "Slatepack" - ? AddressType.mimbleWimble - : wallet.cryptoCurrency.getAddressType(_address!)!, + addressType: wallet.cryptoCurrency.getAddressType(_address!)!, ), ], memo: memo, From e47c838b4be8184959055a9de4c4a5b2c3f22115 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 00:13:36 -0500 Subject: [PATCH 046/178] chore: fix typo, replace debug print w log, add logging --- lib/services/mwc_wallet_service.dart | 10 +++++++--- lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart | 7 +++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/services/mwc_wallet_service.dart b/lib/services/mwc_wallet_service.dart index c44f84380a..e9fa146db8 100644 --- a/lib/services/mwc_wallet_service.dart +++ b/lib/services/mwc_wallet_service.dart @@ -348,7 +348,7 @@ class MwcWalletService { } /// Start MWCMQS listener. - static Future startMwcqsListener({ + static Future startMwcmqsListener({ required String walletId, MwcMqsConfigModel? config, }) async { @@ -377,7 +377,7 @@ class MwcWalletService { } /// Stop MWCMQS listener. - static Future stopMwcqsListener() async { + static Future stopMwcmqsListener() async { try { Logging.instance.i('Stopping MWCMQS listener'); @@ -390,7 +390,7 @@ class MwcWalletService { } /// Get MWCMQS address for wallet. - static Future getMwcqsAddress({ + static Future getMwcmqsAddress({ required String walletId, int index = 0, }) async { @@ -405,6 +405,10 @@ class MwcWalletService { index: index, ); + if (address.isEmpty) { + throw Exception('Failed to generate MWCMQS address'); + } + return address; } catch (e, s) { Logging.instance.e('Failed to get MWCMQS address: $e\n$s'); diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index e9a8330169..2341c9152c 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -280,7 +280,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { } final mwcmqsConfig = await getMwcMqsConfig(); - await MwcWalletService.startMwcqsListener( + await MwcWalletService.startMwcmqsListener( walletId: walletId, config: mwcmqsConfig, ); @@ -293,7 +293,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Stop MWCMQS listener. Future stopSlatepackListener() async { try { - await MwcWalletService.stopMwcqsListener(); + await MwcWalletService.stopMwcmqsListener(); } catch (e, s) { Logging.instance.e('Failed to stop slatepack listener: $e\n$s'); } @@ -359,8 +359,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String slateId = "${slateData['id'] ?? ''}"; final String? amountStr = slateData['amount']?.toString(); - print(121212); - print(slateData); + Logging.instance.d('Analyzed slatepack with ID: $slateId'); // Determine slate status from the slate structure String status = 'Unknown'; From 97bca34832a20c69b3d26b42056530242b6d76ac Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 00:14:12 -0500 Subject: [PATCH 047/178] chore: user friendly error msg --- lib/pages/send_view/confirm_transaction_view.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index d30e62fef7..93a6f052ad 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -162,6 +162,13 @@ class _ConfirmTransactionViewState Logging.instance.e('Failed to create MWC slatepack: $e\n$s'); if (context.mounted) { + // Show user-friendly error message. + final errorMessage = e.toString().contains('insufficient funds') + ? 'Insufficient funds for this transaction' + : e.toString().contains('wallet not open') + ? 'Wallet not accessible. Please restart the app.' + : 'Failed to create slatepack: ${e.toString()}'; + await showDialog( context: context, builder: From 4af4522e36a3d03451d80edda43c88b5c3479b0a Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 00:17:01 -0500 Subject: [PATCH 048/178] feat: MWCMQS config needs more testing --- .../wallet/impl/mimblewimblecoin_wallet.dart | 61 +++++++++++-------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 2341c9152c..f31d8a65a5 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -76,10 +76,20 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_mwcmqsConfig', value: stringConfig, ); - // TODO: refresh anything that needs to be refreshed/updated due to mwcmqs info changed + + // Restart MWCMQS listener with new configuration if wallet is active. + try { + if (MwcWalletService.isWalletOpen(walletId)) { + await stopSlatepackListener(); + await startSlatepackListener(); + Logging.instance.i('Restarted MWCMQS listener with new config: $host:$port'); + } + } catch (e, s) { + Logging.instance.e('Failed to restart MWCMQS listener after config update: $e\n$s'); + } } - /// returns an empty String on success, error message on failure + /// Returns an empty String on success, error message on failure. Future cancelPendingTransactionAndPost(String txSlateId) async { try { final String wallet = @@ -98,33 +108,30 @@ class MimblewimblecoinWallet extends Bip39Wallet { } Future getMwcMqsConfig() async { - final MwcMqsConfigModel _mwcMqsConfig = MwcMqsConfigModel.fromServer( - DefaultMwcMqs.defaultMwcMqsServer, + // Check if there's a custom MWCMQS config stored. + final customConfigJson = await secureStorageInterface.read( + key: '${walletId}_mwcmqsConfig', ); - //Get the default mwcmqs server and check if it's conected - // bool ismwcmqsConnected = await _testmwcmqsServer( - // Defaultmwcmqses.defaultmwcmqsServer.host, Defaultmwcmqses.defaultmwcmqsServer.port ?? 443); - - // if (ismwcmqsConnected) { - //Use default server for as mwcmqs config - - // } - // else { - // //Use Europe config - // _mwcmqsConfig = mwcmqsConfigModel.fromServer(Defaultmwcmqses.europe); - // } - // // example of selecting another random server from the default list - // // alternative servers: copy list of all default EB servers but remove the default default - // // List alternativeServers = Defaultmwcmqses.all; - // // alternativeServers.removeWhere((opt) => opt.name == Defaultmwcmqses.defaultmwcmqsServer.name); - // // alternativeServers.shuffle(); // randomize which server is used - // // _mwcmqsConfig = mwcmqsConfigModel.fromServer(alternativeServers.first); - // - // // TODO test this connection before returning it - // } - - return _mwcMqsConfig; + if (customConfigJson != null) { + try { + final customConfig = jsonDecode(customConfigJson) as Map; + final host = customConfig['mwcmqs_domain'] as String?; + final port = customConfig['mwcmqs_port'] as int?; + + if (host != null && port != null) { + return MwcMqsConfigModel( + host: host, + port: port, + ); + } + } catch (e) { + Logging.instance.w('Failed to parse custom MWCMQS config: $e'); + } + } + + // Fall back to default server. + return MwcMqsConfigModel.fromServer(DefaultMwcMqs.defaultMwcMqsServer); } // ================= Slatepack Operations =================================== From 62e159abd77f9b9353147c30bbaee207f4b75f96 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 00:26:33 -0500 Subject: [PATCH 049/178] fix: fix inverted mwc txs method toggle logic, allow address w slatepacks --- lib/pages/send_view/send_view.dart | 337 +++++++++--------- .../desktop_mwc_txs_method_toggle.dart | 7 +- .../sub_widgets/desktop_receive.dart | 2 +- .../wallet_view/sub_widgets/desktop_send.dart | 29 +- 4 files changed, 185 insertions(+), 190 deletions(-) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 795befa109..e4a206ce96 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -1534,7 +1534,7 @@ class _SendViewState extends ConsumerState { ), const SizedBox(height: 16), - // MWC Transaction Method Selector (moved before "Send to" field). + // MWC Transaction Method Selector. if (coin is Mimblewimblecoin) ...[ MwcTransactionMethodSelector( onMethodSelected: (method) { @@ -1554,201 +1554,194 @@ class _SendViewState extends ConsumerState { const SizedBox(height: 16), ], - // Hide "Send to" field for MWC slatepack transactions. - if (!(coin is Mimblewimblecoin && - _selectedTransactionMethod == - TransactionMethod.slatepack)) ...[ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - isPaynymSend - ? "Send to PayNym address" - : "Send to", - style: STextStyles.smallMed12(context), - textAlign: TextAlign.left, - ), - // if (coin is Monero) - // CustomTextButton( - // text: "Use OpenAlias", - // onTap: () async { - // await showModalBottomSheet( - // context: context, - // builder: (context) => - // OpenAliasBottomSheet( - // onSelected: (address) { - // sendToController.text = address; - // }, - // ), - // ); - // }, - // ), - ], + // "Send to" field - optional for MWC slatepack transactions. + // Always show the field, but make it optional for slatepack. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + isPaynymSend + ? "Send to PayNym address" + : "Send to", + style: STextStyles.smallMed12(context), + textAlign: TextAlign.left, + ), + // if (coin is Monero) + // CustomTextButton( + // text: "Use OpenAlias", + // onTap: () async { + // await showModalBottomSheet( + // context: context, + // builder: (context) => + // OpenAliasBottomSheet( + // onSelected: (address) { + // sendToController.text = address; + // }, + // ), + // ); + // }, + // ), + ], + ), + const SizedBox(height: 8), + if (isPaynymSend) + TextField( + key: const Key("sendViewPaynymAddressFieldKey"), + controller: sendToController, + enabled: false, + readOnly: true, + style: STextStyles.fieldLabel(context), ), - const SizedBox(height: 8), - if (isPaynymSend) - TextField( - key: const Key( - "sendViewPaynymAddressFieldKey", - ), - controller: sendToController, - enabled: false, - readOnly: true, - style: STextStyles.fieldLabel(context), + if (!isPaynymSend) + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, ), - if (!isPaynymSend) - ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + child: TextField( + key: const Key("sendViewAddressFieldKey"), + controller: sendToController, + readOnly: false, + autocorrect: false, + enableSuggestions: false, + // inputFormatters: [ + // FilteringTextInputFormatter.allow( + // RegExp("[a-zA-Z0-9]{34}")), + // ], + toolbarOptions: const ToolbarOptions( + copy: false, + cut: false, + paste: true, + selectAll: false, ), - child: TextField( - key: const Key("sendViewAddressFieldKey"), - controller: sendToController, - readOnly: false, - autocorrect: false, - enableSuggestions: false, - // inputFormatters: [ - // FilteringTextInputFormatter.allow( - // RegExp("[a-zA-Z0-9]{34}")), - // ], - toolbarOptions: const ToolbarOptions( - copy: false, - cut: false, - paste: true, - selectAll: false, - ), - onChanged: (newValue) async { - final trimmed = newValue.trim(); - - if ((trimmed.length - - (_address?.length ?? 0)) - .abs() > - 1) { - final parsed = - AddressUtils.parsePaymentUri( - trimmed, - logging: Logging.instance, - ); - if (parsed != null) { - _applyUri(parsed); - } else { - await _checkSparkNameAndOrSetAddress( - newValue, + onChanged: (newValue) async { + final trimmed = newValue.trim(); + + if ((trimmed.length - + (_address?.length ?? 0)) + .abs() > + 1) { + final parsed = + AddressUtils.parsePaymentUri( + trimmed, + logging: Logging.instance, ); - } + if (parsed != null) { + _applyUri(parsed); } else { await _checkSparkNameAndOrSetAddress( newValue, - setController: false, ); } - - _setValidAddressProviders(_address); - - setState(() { - _addressToggleFlag = - newValue.isNotEmpty; - }); - }, - focusNode: _addressFocusNode, - style: STextStyles.field(context), - decoration: standardInputDecoration( - "Enter ${coin.ticker} address", - _addressFocusNode, - context, - ).copyWith( - contentPadding: const EdgeInsets.only( - left: 16, - top: 6, - bottom: 8, - right: 5, - ), - suffixIcon: Padding( - padding: - sendToController.text.isEmpty - ? const EdgeInsets.only( - right: 8, - ) - : const EdgeInsets.only( - right: 0, - ), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - children: [ - _addressToggleFlag - ? TextFieldIconButton( - semanticsLabel: - "Clear Button. Clears The Address Field Input.", - key: const Key( - "sendViewClearAddressFieldButtonKey", - ), - onTap: () { - sendToController.text = - ""; - _address = ""; - _setValidAddressProviders( - _address, - ); - setState(() { - _addressToggleFlag = - false; - }); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - semanticsLabel: - "Paste Button. Pastes From Clipboard To Address Field Input.", - key: const Key( - "sendViewPasteAddressFieldButtonKey", - ), - onTap: _pasteAddress, - child: - sendToController - .text - .isEmpty - ? const ClipboardIcon() - : const XIcon(), - ), - if (sendToController.text.isEmpty) - TextFieldIconButton( + } else { + await _checkSparkNameAndOrSetAddress( + newValue, + setController: false, + ); + } + + _setValidAddressProviders(_address); + + setState(() { + _addressToggleFlag = newValue.isNotEmpty; + }); + }, + focusNode: _addressFocusNode, + style: STextStyles.field(context), + decoration: standardInputDecoration( + coin is Mimblewimblecoin && + _selectedTransactionMethod == + TransactionMethod + .slatepack || + _selectedTransactionMethod == null + ? "Enter ${coin.ticker} address (optional)" + : "Enter ${coin.ticker} address", + _addressFocusNode, + context, + ).copyWith( + contentPadding: const EdgeInsets.only( + left: 16, + top: 6, + bottom: 8, + right: 5, + ), + suffixIcon: Padding( + padding: + sendToController.text.isEmpty + ? const EdgeInsets.only(right: 8) + : const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + _addressToggleFlag + ? TextFieldIconButton( semanticsLabel: - "Address Book Button. Opens Address Book For Address Field.", + "Clear Button. Clears The Address Field Input.", key: const Key( - "sendViewAddressBookButtonKey", + "sendViewClearAddressFieldButtonKey", ), onTap: () { - Navigator.of( - context, - ).pushNamed( - AddressBookView.routeName, - arguments: widget.coin, + sendToController.text = ""; + _address = ""; + _setValidAddressProviders( + _address, ); + setState(() { + _addressToggleFlag = + false; + }); }, - child: - const AddressBookIcon(), - ), - if (sendToController.text.isEmpty) - TextFieldIconButton( + child: const XIcon(), + ) + : TextFieldIconButton( semanticsLabel: - "Scan QR Button. Opens Camera For Scanning QR Code.", + "Paste Button. Pastes From Clipboard To Address Field Input.", key: const Key( - "sendViewScanQrButtonKey", + "sendViewPasteAddressFieldButtonKey", ), - onTap: _scanQr, - child: const QrCodeIcon(), + onTap: _pasteAddress, + child: + sendToController + .text + .isEmpty + ? const ClipboardIcon() + : const XIcon(), ), - ], - ), + if (sendToController.text.isEmpty) + TextFieldIconButton( + semanticsLabel: + "Address Book Button. Opens Address Book For Address Field.", + key: const Key( + "sendViewAddressBookButtonKey", + ), + onTap: () { + Navigator.of( + context, + ).pushNamed( + AddressBookView.routeName, + arguments: widget.coin, + ); + }, + child: const AddressBookIcon(), + ), + if (sendToController.text.isEmpty) + TextFieldIconButton( + semanticsLabel: + "Scan QR Button. Opens Camera For Scanning QR Code.", + key: const Key( + "sendViewScanQrButtonKey", + ), + onTap: _scanQr, + child: const QrCodeIcon(), + ), + ], ), ), ), ), ), - ], // End of conditional hiding "Send to" field for MWC slatepack + ), const SizedBox(height: 10), if (isStellar || ref.watch(pValidSparkSendToAddress)) diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart index 918e0abaa8..3817d139f6 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart @@ -30,10 +30,13 @@ class MwcTxsMethodToggle extends ConsumerWidget { return Toggle( onValueChanged: (value) { + // Align visual labels with callback semantics: + // When the toggle shows "Slatepack" (on), emit slatepack. + // When it shows "Automatic" (off), emit automatic. if (value) { - onChanged?.call(TxsMethodMwcType.automatic); - } else { onChanged?.call(TxsMethodMwcType.slatepack); + } else { + onChanged?.call(TxsMethodMwcType.automatic); } }, isOn: false, 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 260637369f..359d25ff60 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 @@ -496,7 +496,7 @@ class _DesktopReceiveState extends ConsumerState { onChanged: (TxsMethodMwcType type) { setState(() { _selectedMethodMwc = - type == TxsMethodMwcType.automatic + type == TxsMethodMwcType.slatepack ? 'Slatepack' : 'Automatic'; }); 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 4537d32856..694aae1861 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 @@ -1078,10 +1078,10 @@ class _DesktopSendState extends ConsumerState { isMimblewimblecoin = coin is Mimblewimblecoin; if (isMimblewimblecoin) { _selectedMethodMwc = "Slatepack"; - // Initialize provider to MWCMQS (automatic method). + // Initialize provider to match the UI (slatepack method). WidgetsBinding.instance.addPostFrameCallback((_) { ref.read(pSelectedMwcTransactionMethod.notifier).state = - TransactionMethod.mwcmqs; + TransactionMethod.slatepack; }); } @@ -1255,14 +1255,14 @@ class _DesktopSendState extends ConsumerState { setState(() { _selectedMethodMwc = type == TxsMethodMwcType.slatepack - ? 'Slatepack' - : 'Automatic'; + ? 'Automatic' + : 'Slatepack'; }); // Update the provider as well. ref.read(pSelectedMwcTransactionMethod.notifier).state = type == TxsMethodMwcType.slatepack - ? TransactionMethod.slatepack - : TransactionMethod.mwcmqs; + ? TransactionMethod.mwcmqs + : TransactionMethod.slatepack; }, ), ), @@ -1568,9 +1568,7 @@ class _DesktopSendState extends ConsumerState { ), ), const SizedBox(height: 20), - // Hide "Send to" field for MWC slatepack transactions. - if (!isPaynymSend && - !(isMimblewimblecoin && _selectedMethodMwc == 'Slatepack')) + if (!isPaynymSend) Text( "Send to", style: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -1581,11 +1579,8 @@ class _DesktopSendState extends ConsumerState { ), textAlign: TextAlign.left, ), - if (!isPaynymSend && - !(isMimblewimblecoin && _selectedMethodMwc == 'Slatepack')) - const SizedBox(height: 10), - if (!isPaynymSend && - !(isMimblewimblecoin && _selectedMethodMwc == 'Slatepack')) + if (!isPaynymSend) const SizedBox(height: 10), + if (!isPaynymSend) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -1643,7 +1638,11 @@ class _DesktopSendState extends ConsumerState { height: 1.8, ), decoration: standardInputDecoration( - "Enter ${coin.ticker} address", + _selectedMethodMwc == "Slatepack" || + _selectedMethodMwc == null || + _selectedMethodMwc == "" + ? "Enter ${coin.ticker} address (optional)" + : "Enter ${coin.ticker} address", _addressFocusNode, context, desktopMed: true, From 305a257abbe0018f51b27fa13dc0f2cf3000ddd6 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 00:27:41 -0500 Subject: [PATCH 050/178] fix: allow onion addresses for mwc idk if there are but there should be. make it so --- lib/wallets/crypto_currency/coins/mimblewimblecoin.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index 1e9e04691d..9e9f962e05 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -64,8 +64,7 @@ class Mimblewimblecoin extends Bip39Currency { (uri.scheme == "http" || uri.scheme == "https" || uri.scheme == "mwcmqs") && - uri.host.isNotEmpty && - !uri.host.endsWith(".onion")) { + uri.host.isNotEmpty) { return true; } From c891afcd7d92e9d8f53cef366f06d9ceb4a7b874 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 00:35:21 -0500 Subject: [PATCH 051/178] feat: collapse mwc slatepack service into mwc wallet needs more testing --- lib/models/mwc_slatepack_models.dart | 70 +++ .../mwc_slatepack_import_dialog.dart | 2 +- .../sub_widgets/mwc_slatepack_dialog.dart | 2 +- lib/services/mwc_wallet_service.dart | 556 ------------------ .../wallet/impl/mimblewimblecoin_wallet.dart | 204 +++---- 5 files changed, 176 insertions(+), 658 deletions(-) create mode 100644 lib/models/mwc_slatepack_models.dart delete mode 100644 lib/services/mwc_wallet_service.dart diff --git a/lib/models/mwc_slatepack_models.dart b/lib/models/mwc_slatepack_models.dart new file mode 100644 index 0000000000..f8a30fb3f5 --- /dev/null +++ b/lib/models/mwc_slatepack_models.dart @@ -0,0 +1,70 @@ +class SlatepackResult { + final bool success; + final String? error; + final String? slatepack; + final String? slateJson; + final bool? wasEncrypted; + final String? recipientAddress; + + SlatepackResult({ + required this.success, + this.error, + this.slatepack, + this.slateJson, + this.wasEncrypted, + this.recipientAddress, + }); +} + +class SlatepackDecodeResult { + final bool success; + final String? error; + final String? slateJson; + final bool? wasEncrypted; + final String? senderAddress; + final String? recipientAddress; + + SlatepackDecodeResult({ + required this.success, + this.error, + this.slateJson, + this.wasEncrypted, + this.senderAddress, + this.recipientAddress, + }); +} + +class ReceiveResult { + final bool success; + final String? error; + final String? slateId; + final String? commitId; + final String? responseSlatepack; + final bool? wasEncrypted; + final String? recipientAddress; + + ReceiveResult({ + required this.success, + this.error, + this.slateId, + this.commitId, + this.responseSlatepack, + this.wasEncrypted, + this.recipientAddress, + }); +} + +class FinalizeResult { + final bool success; + final String? error; + final String? slateId; + final String? commitId; + + FinalizeResult({ + required this.success, + this.error, + this.slateId, + this.commitId, + }); +} + diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart index 300e11656d..ba7cf88278 100644 --- a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -6,7 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; import '../../../notifications/show_flush_bar.dart'; -import '../../../services/mwc_wallet_service.dart'; +import '../../../models/mwc_slatepack_models.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/assets.dart'; import '../../../utilities/clipboard_interface.dart'; diff --git a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart index d04ef92c47..1941e7483c 100644 --- a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart +++ b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart @@ -7,7 +7,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:qr_flutter/qr_flutter.dart'; import '../../../notifications/show_flush_bar.dart'; -import '../../../services/mwc_wallet_service.dart'; +import '../../../models/mwc_slatepack_models.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/assets.dart'; import '../../../utilities/clipboard_interface.dart'; diff --git a/lib/services/mwc_wallet_service.dart b/lib/services/mwc_wallet_service.dart deleted file mode 100644 index e9fa146db8..0000000000 --- a/lib/services/mwc_wallet_service.dart +++ /dev/null @@ -1,556 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; - -import 'package:flutter_libmwc/lib.dart' as mwc; - -import '../models/mwcmqs_config_model.dart'; -import '../utilities/amount/amount.dart'; -import '../utilities/default_mwcmqs.dart'; -import '../utilities/logger.dart'; -import '../utilities/stack_file_system.dart'; - -/// Service layer that wraps flutter_libmwc FFI functions for Stack Wallet integration. -/// -/// Based on the flutter_libmwc example WalletService but adapted for Stack Wallet patterns. -class MwcWalletService { - static bool _isInitialized = false; - static final Map _walletHandles = {}; - - /// Initialize the MWC wallet service. - static Future initialize() async { - if (_isInitialized) return; - - Logging.instance.i('MWC Wallet Service initialized'); - _isInitialized = true; - } - - /// Create a new MWC wallet. - static Future createWallet({ - required String walletId, - required String password, - String? customMnemonic, - }) async { - try { - Logging.instance.i('Creating MWC wallet: $walletId'); - - final config = await _getWalletConfig(walletId); - final mnemonic = customMnemonic ?? mwc.Libmwc.getMnemonic(); - - final result = await mwc.Libmwc.initializeNewWallet( - config: config, - mnemonic: mnemonic, - password: password, - name: walletId, - ); - - if (result.toUpperCase().contains('ERROR')) { - return MwcWalletResult( - success: false, - error: 'Failed to create wallet: $result', - ); - } - - _walletHandles[walletId] = result; - - Logging.instance.i('MWC wallet created successfully: $walletId'); - return MwcWalletResult( - success: true, - walletId: walletId, - data: {'mnemonic': mnemonic, 'handle': result}, - ); - } catch (e, s) { - Logging.instance.e('Failed to create MWC wallet: $e\n$s'); - return MwcWalletResult( - success: false, - error: 'Failed to create wallet: $e', - ); - } - } - - /// Recover MWC wallet from mnemonic. - static Future recoverWallet({ - required String walletId, - required String password, - required String mnemonic, - }) async { - try { - Logging.instance.i('Recovering MWC wallet: $walletId'); - - final config = await _getWalletConfig(walletId); - - await mwc.Libmwc.recoverWallet( - config: config, - password: password, - mnemonic: mnemonic, - name: walletId, - ); - - final openResult = await openWallet( - walletId: walletId, - password: password, - ); - - if (openResult.success) { - Logging.instance.i('MWC wallet recovered successfully: $walletId'); - return MwcWalletResult( - success: true, - walletId: walletId, - data: {'recovered': true}, - ); - } - - return openResult; - } catch (e, s) { - Logging.instance.e('Failed to recover MWC wallet: $e\n$s'); - return MwcWalletResult( - success: false, - error: 'Failed to recover wallet: $e', - ); - } - } - - /// Open an existing MWC wallet. - static Future openWallet({ - required String walletId, - required String password, - }) async { - try { - Logging.instance.i('Opening MWC wallet: $walletId'); - - final config = await _getWalletConfig(walletId); - - final result = await mwc.Libmwc.openWallet( - config: config, - password: password, - ); - - if (result.toUpperCase().contains('ERROR')) { - return MwcWalletResult( - success: false, - error: 'Failed to open wallet: $result', - ); - } - - _walletHandles[walletId] = result; - - Logging.instance.i('MWC wallet opened successfully: $walletId'); - return MwcWalletResult( - success: true, - walletId: walletId, - data: {'handle': result}, - ); - } catch (e, s) { - Logging.instance.e('Failed to open MWC wallet: $e\n$s'); - return MwcWalletResult( - success: false, - error: 'Failed to open wallet: $e', - ); - } - } - - /// Create a slatepack for sending MWC. - static Future createSlatepack({ - required String walletId, - required Amount amount, - String? recipientAddress, - String? message, - bool encrypt = false, - int minimumConfirmations = 1, - }) async { - try { - final handle = _walletHandles[walletId]; - if (handle == null) { - return SlatepackResult( - success: false, - error: 'Wallet not open: $walletId', - ); - } - - Logging.instance.i('Creating slatepack for wallet: $walletId'); - - // Generate S1 slate JSON. - final s1Json = await mwc.Libmwc.txInit( - wallet: handle, - amount: amount.raw.toInt(), - minimumConfirmations: minimumConfirmations, - selectionStrategyIsAll: false, - message: message ?? '', - ); - - // Encode to slatepack. - final slatepackEncode = await mwc.Libmwc.encodeSlatepack( - slateJson: s1Json, - recipientAddress: recipientAddress, - encrypt: encrypt, - wallet: handle, - ); - - Logging.instance.i('Slatepack created successfully'); - return SlatepackResult( - success: true, - slatepack: slatepackEncode.slatepack, - slateJson: s1Json, - wasEncrypted: slatepackEncode.wasEncrypted, - recipientAddress: slatepackEncode.recipientAddress, - ); - } catch (e, s) { - Logging.instance.e('Failed to create slatepack: $e\n$s'); - return SlatepackResult( - success: false, - error: 'Failed to create slatepack: $e', - ); - } - } - - /// Decode a slatepack. - static Future decodeSlatepack({ - required String slatepack, - String? walletId, - }) async { - try { - Logging.instance.i('Decoding slatepack'); - - // Use wallet-aware decode if wallet is open (handles encrypted slatepacks) - final handle = walletId != null ? _walletHandles[walletId] : null; - final result = - (handle != null) - ? await mwc.Libmwc.decodeSlatepackWithWallet( - wallet: handle, - slatepack: slatepack, - ) - : await mwc.Libmwc.decodeSlatepack(slatepack: slatepack); - - Logging.instance.i('Slatepack decoded successfully'); - return SlatepackDecodeResult( - success: true, - slateJson: result.slateJson, - wasEncrypted: result.wasEncrypted, - senderAddress: result.senderAddress, - recipientAddress: result.recipientAddress, - ); - } catch (e, s) { - Logging.instance.e('Failed to decode slatepack: $e\n$s'); - return SlatepackDecodeResult( - success: false, - error: 'Failed to decode slatepack: $e', - ); - } - } - - /// Receive a slatepack and return response slatepack. - static Future receiveSlatepack({ - required String walletId, - required String slatepack, - }) async { - try { - final handle = _walletHandles[walletId]; - if (handle == null) { - return ReceiveResult( - success: false, - error: 'Wallet not open: $walletId', - ); - } - - Logging.instance.i('Receiving slatepack for wallet: $walletId'); - - // Decode to get slate JSON and sender address. - final decoded = await decodeSlatepack( - slatepack: slatepack, - walletId: walletId, - ); - if (!decoded.success || decoded.slateJson == null) { - return ReceiveResult( - success: false, - error: decoded.error ?? 'Failed to decode slatepack', - ); - } - - // Receive and get updated slate JSON. - final received = await mwc.Libmwc.txReceiveDetailed( - wallet: handle, - slateJson: decoded.slateJson!, - ); - - // Encode response slatepack back to sender. - final encoded = await mwc.Libmwc.encodeSlatepack( - slateJson: received.slateJson, - recipientAddress: decoded.senderAddress, - encrypt: decoded.senderAddress != null, - wallet: handle, - ); - - Logging.instance.i('Slatepack received successfully'); - return ReceiveResult( - success: true, - slateId: received.slateId, - commitId: received.commitId, - responseSlatepack: encoded.slatepack, - wasEncrypted: encoded.wasEncrypted, - recipientAddress: decoded.senderAddress, - ); - } catch (e, s) { - Logging.instance.e('Failed to receive slatepack: $e\n$s'); - return ReceiveResult( - success: false, - error: 'Failed to receive slatepack: $e', - ); - } - } - - /// Finalize a slatepack (sender step 3). - static Future finalizeSlatepack({ - required String walletId, - required String slatepack, - }) async { - try { - final handle = _walletHandles[walletId]; - if (handle == null) { - return FinalizeResult( - success: false, - error: 'Wallet not open: $walletId', - ); - } - - Logging.instance.i('Finalizing slatepack for wallet: $walletId'); - - // Decode to get slate JSON. - final decoded = await decodeSlatepack( - slatepack: slatepack, - walletId: walletId, - ); - if (!decoded.success || decoded.slateJson == null) { - return FinalizeResult( - success: false, - error: decoded.error ?? 'Failed to decode slatepack', - ); - } - - // Finalize transaction. - final finalized = await mwc.Libmwc.txFinalize( - wallet: handle, - slateJson: decoded.slateJson!, - ); - - Logging.instance.i('Slatepack finalized successfully'); - return FinalizeResult( - success: true, - slateId: finalized.slateId, - commitId: finalized.commitId, - ); - } catch (e, s) { - Logging.instance.e('Failed to finalize slatepack: $e\n$s'); - return FinalizeResult( - success: false, - error: 'Failed to finalize slatepack: $e', - ); - } - } - - /// Start MWCMQS listener. - static Future startMwcmqsListener({ - required String walletId, - MwcMqsConfigModel? config, - }) async { - try { - final handle = _walletHandles[walletId]; - if (handle == null) { - throw Exception('Wallet not open: $walletId'); - } - - Logging.instance.i('Starting MWCMQS listener for wallet: $walletId'); - - final mwcmqsConfig = - config ?? - MwcMqsConfigModel.fromServer(DefaultMwcMqs.defaultMwcMqsServer); - - mwc.Libmwc.startMwcMqsListener( - wallet: handle, - mwcmqsConfig: mwcmqsConfig.toString(), - ); - - Logging.instance.i('MWCMQS listener started successfully'); - } catch (e, s) { - Logging.instance.e('Failed to start MWCMQS listener: $e\n$s'); - rethrow; - } - } - - /// Stop MWCMQS listener. - static Future stopMwcmqsListener() async { - try { - Logging.instance.i('Stopping MWCMQS listener'); - - mwc.Libmwc.stopMwcMqsListener(); - - Logging.instance.i('MWCMQS listener stopped successfully'); - } catch (e, s) { - Logging.instance.e('Failed to stop MWCMQS listener: $e\n$s'); - } - } - - /// Get MWCMQS address for wallet. - static Future getMwcmqsAddress({ - required String walletId, - int index = 0, - }) async { - try { - final handle = _walletHandles[walletId]; - if (handle == null) { - throw Exception('Wallet not open: $walletId'); - } - - final address = await mwc.Libmwc.getAddressInfo( - wallet: handle, - index: index, - ); - - if (address.isEmpty) { - throw Exception('Failed to generate MWCMQS address'); - } - - return address; - } catch (e, s) { - Logging.instance.e('Failed to get MWCMQS address: $e\n$s'); - rethrow; - } - } - - /// Validate MWC address. - static bool validateAddress(String address) { - try { - return mwc.Libmwc.validateSendAddress(address: address); - } catch (e, s) { - Logging.instance.e('Failed to validate address: $e\n$s'); - return false; - } - } - - /// Generate mnemonic. - static String generateMnemonic() { - try { - return mwc.Libmwc.getMnemonic(); - } catch (e, s) { - Logging.instance.e('Failed to generate mnemonic: $e\n$s'); - rethrow; - } - } - - /// Check if wallet is open. - static bool isWalletOpen(String walletId) { - return _walletHandles.containsKey(walletId); - } - - /// Close wallet. - static void closeWallet(String walletId) { - _walletHandles.remove(walletId); - } - - /// Get wallet configuration. - static Future _getWalletConfig(String walletId) async { - final walletDir = await _getWalletDirectory(walletId); - - final config = { - 'wallet_dir': walletDir, - 'check_node_api_http_addr': 'https://mwc713.mwc.mw:443', - 'chain': 'mainnet', - 'account': 'default', - }; - - return jsonEncode(config); - } - - /// Get wallet directory path. - static Future _getWalletDirectory(String walletId) async { - final Directory appDir = await StackFileSystem.applicationRootDirectory(); - final path = "${appDir.path}/mimblewimblecoin"; - final String name = walletId.trim(); - return '$path/$name'; - } -} - -/// Result classes for MWC wallet operations. - -class MwcWalletResult { - final bool success; - final String? walletId; - final String? error; - final Map? data; - - MwcWalletResult({ - required this.success, - this.walletId, - this.error, - this.data, - }); -} - -class SlatepackResult { - final bool success; - final String? error; - final String? slatepack; - final String? slateJson; - final bool? wasEncrypted; - final String? recipientAddress; - - SlatepackResult({ - required this.success, - this.error, - this.slatepack, - this.slateJson, - this.wasEncrypted, - this.recipientAddress, - }); -} - -class SlatepackDecodeResult { - final bool success; - final String? error; - final String? slateJson; - final bool? wasEncrypted; - final String? senderAddress; - final String? recipientAddress; - - SlatepackDecodeResult({ - required this.success, - this.error, - this.slateJson, - this.wasEncrypted, - this.senderAddress, - this.recipientAddress, - }); -} - -class ReceiveResult { - final bool success; - final String? error; - final String? slateId; - final String? commitId; - final String? responseSlatepack; - final bool? wasEncrypted; - final String? recipientAddress; - - ReceiveResult({ - required this.success, - this.error, - this.slateId, - this.commitId, - this.responseSlatepack, - this.wasEncrypted, - this.recipientAddress, - }); -} - -class FinalizeResult { - final bool success; - final String? error; - final String? slateId; - final String? commitId; - - FinalizeResult({ - required this.success, - this.error, - this.slateId, - this.commitId, - }); -} diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index f31d8a65a5..3da15ba0e5 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -26,7 +26,7 @@ import '../../../services/event_bus/events/global/node_connection_status_changed import '../../../services/event_bus/events/global/refresh_percent_changed_event.dart'; import '../../../services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import '../../../services/event_bus/global_event_bus.dart'; -import '../../../services/mwc_wallet_service.dart'; +import '../../../models/mwc_slatepack_models.dart'; import '../../../utilities/amount/amount.dart'; import '../../../utilities/default_mwcmqs.dart'; import '../../../utilities/flutter_secure_storage_interface.dart'; @@ -77,9 +77,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { value: stringConfig, ); - // Restart MWCMQS listener with new configuration if wallet is active. + // Restart MWCMQS listener with new configuration if wallet has a handle. try { - if (MwcWalletService.isWalletOpen(walletId)) { + final handle = await secureStorageInterface.read(key: '${walletId}_wallet'); + if (handle != null && handle.isNotEmpty) { await stopSlatepackListener(); await startSlatepackListener(); Logging.instance.i('Restarted MWCMQS listener with new config: $host:$port'); @@ -89,6 +90,23 @@ class MimblewimblecoinWallet extends Bip39Wallet { } } + Future _ensureWalletOpen() async { + final existing = await secureStorageInterface.read(key: '${walletId}_wallet'); + if (existing != null && existing.isNotEmpty) return existing; + + final config = await _getRealConfig(); + final password = await secureStorageInterface.read(key: '${walletId}_password'); + if (password == null) { + throw Exception('Wallet password not found'); + } + final opened = await mimblewimblecoin.Libmwc.openWallet( + config: config, + password: password, + ); + await secureStorageInterface.write(key: '${walletId}_wallet', value: opened); + return opened; + } + /// Returns an empty String on success, error message on failure. Future cancelPendingTransactionAndPost(String txSlateId) async { try { @@ -145,35 +163,32 @@ class MimblewimblecoinWallet extends Bip39Wallet { int? minimumConfirmations, }) async { try { - await MwcWalletService.initialize(); + final handle = await _ensureWalletOpen(); - // Ensure wallet is open in service. - if (!MwcWalletService.isWalletOpen(walletId)) { - final password = await secureStorageInterface.read( - key: '${walletId}_password', - ); - if (password == null) { - throw Exception('Wallet password not found'); - } - - final openResult = await MwcWalletService.openWallet( - walletId: walletId, - password: password, - ); - - if (!openResult.success) { - throw Exception(openResult.error ?? 'Failed to open wallet'); - } - } + // Generate S1 slate JSON. + final s1Json = await mimblewimblecoin.Libmwc.txInit( + wallet: handle, + amount: amount.raw.toInt(), + minimumConfirmations: + minimumConfirmations ?? cryptoCurrency.minConfirms, + selectionStrategyIsAll: false, + message: message ?? '', + ); - return await MwcWalletService.createSlatepack( - walletId: walletId, - amount: amount, + // Encode to slatepack. + final encoded = await mimblewimblecoin.Libmwc.encodeSlatepack( + slateJson: s1Json, recipientAddress: recipientAddress, - message: message, encrypt: encrypt, - minimumConfirmations: - minimumConfirmations ?? cryptoCurrency.minConfirms, + wallet: handle, + ); + + return SlatepackResult( + success: true, + slatepack: encoded.slatepack, + slateJson: s1Json, + wasEncrypted: encoded.wasEncrypted, + recipientAddress: encoded.recipientAddress, ); } catch (e, s) { Logging.instance.e('Failed to create slatepack: $e\n$s'); @@ -184,10 +199,20 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Decode a slatepack. Future decodeSlatepack(String slatepack) async { try { - await MwcWalletService.initialize(); - return await MwcWalletService.decodeSlatepack( - slatepack: slatepack, - walletId: MwcWalletService.isWalletOpen(walletId) ? walletId : null, + final handle = await secureStorageInterface.read(key: '${walletId}_wallet'); + final result = handle != null + ? await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( + wallet: handle, + slatepack: slatepack, + ) + : await mimblewimblecoin.Libmwc.decodeSlatepack(slatepack: slatepack); + + return SlatepackDecodeResult( + success: true, + slateJson: result.slateJson, + wasEncrypted: result.wasEncrypted, + senderAddress: result.senderAddress, + recipientAddress: result.recipientAddress, ); } catch (e, s) { Logging.instance.e('Failed to decode slatepack: $e\n$s'); @@ -198,30 +223,35 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Receive a slatepack and return response slatepack. Future receiveSlatepack(String slatepack) async { try { - await MwcWalletService.initialize(); + final handle = await _ensureWalletOpen(); - // Ensure wallet is open in service. - if (!MwcWalletService.isWalletOpen(walletId)) { - final password = await secureStorageInterface.read( - key: '${walletId}_password', - ); - if (password == null) { - throw Exception('Wallet password not found'); - } + // Decode to get slate JSON and sender address. + final decoded = await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( + wallet: handle, + slatepack: slatepack, + ); - final openResult = await MwcWalletService.openWallet( - walletId: walletId, - password: password, - ); + // Receive and get updated slate JSON. + final received = await mimblewimblecoin.Libmwc.txReceiveDetailed( + wallet: handle, + slateJson: decoded.slateJson!, + ); - if (!openResult.success) { - throw Exception(openResult.error ?? 'Failed to open wallet'); - } - } + // Encode response back to sender if address available. + final encoded = await mimblewimblecoin.Libmwc.encodeSlatepack( + slateJson: received.slateJson, + recipientAddress: decoded.senderAddress, + encrypt: decoded.senderAddress != null, + wallet: handle, + ); - return await MwcWalletService.receiveSlatepack( - walletId: walletId, - slatepack: slatepack, + return ReceiveResult( + success: true, + slateId: received.slateId, + commitId: received.commitId, + responseSlatepack: encoded.slatepack, + wasEncrypted: encoded.wasEncrypted, + recipientAddress: decoded.senderAddress, ); } catch (e, s) { Logging.instance.e('Failed to receive slatepack: $e\n$s'); @@ -232,30 +262,24 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Finalize a slatepack (sender step 3). Future finalizeSlatepack(String slatepack) async { try { - await MwcWalletService.initialize(); - - // Ensure wallet is open in service. - if (!MwcWalletService.isWalletOpen(walletId)) { - final password = await secureStorageInterface.read( - key: '${walletId}_password', - ); - if (password == null) { - throw Exception('Wallet password not found'); - } + final handle = await _ensureWalletOpen(); - final openResult = await MwcWalletService.openWallet( - walletId: walletId, - password: password, - ); + // Decode to get slate JSON. + final decoded = await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( + wallet: handle, + slatepack: slatepack, + ); - if (!openResult.success) { - throw Exception(openResult.error ?? 'Failed to open wallet'); - } - } + // Finalize transaction. + final finalized = await mimblewimblecoin.Libmwc.txFinalize( + wallet: handle, + slateJson: decoded.slateJson!, + ); - return await MwcWalletService.finalizeSlatepack( - walletId: walletId, - slatepack: slatepack, + return FinalizeResult( + success: true, + slateId: finalized.slateId, + commitId: finalized.commitId, ); } catch (e, s) { Logging.instance.e('Failed to finalize slatepack: $e\n$s'); @@ -266,30 +290,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Start MWCMQS listener for automatic transaction processing. Future startSlatepackListener() async { try { - await MwcWalletService.initialize(); - - if (!MwcWalletService.isWalletOpen(walletId)) { - final password = await secureStorageInterface.read( - key: '${walletId}_password', - ); - if (password == null) { - throw Exception('Wallet password not found'); - } - - final openResult = await MwcWalletService.openWallet( - walletId: walletId, - password: password, - ); - - if (!openResult.success) { - throw Exception(openResult.error ?? 'Failed to open wallet'); - } - } - + await _ensureWalletOpen(); final mwcmqsConfig = await getMwcMqsConfig(); - await MwcWalletService.startMwcmqsListener( - walletId: walletId, - config: mwcmqsConfig, + final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + mimblewimblecoin.Libmwc.startMwcMqsListener( + wallet: wallet!, + mwcmqsConfig: mwcmqsConfig.toString(), ); } catch (e, s) { Logging.instance.e('Failed to start slatepack listener: $e\n$s'); @@ -300,7 +306,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Stop MWCMQS listener. Future stopSlatepackListener() async { try { - await MwcWalletService.stopMwcmqsListener(); + mimblewimblecoin.Libmwc.stopMwcMqsListener(); } catch (e, s) { Logging.instance.e('Failed to stop slatepack listener: $e\n$s'); } @@ -308,7 +314,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Validate MWC address. bool validateMwcAddress(String address) { - return MwcWalletService.validateAddress(address); + return mimblewimblecoin.Libmwc.validateSendAddress(address: address); } /// Detect if an address is a slatepack. @@ -792,8 +798,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future init({bool? isRestore}) async { - // Initialize MWC wallet service. - await MwcWalletService.initialize(); if (isRestore != true) { String? encodedWallet = await secureStorageInterface.read( From 00ae9a971daec1492b247877356adc6914fc7f2c Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 11:29:28 -0500 Subject: [PATCH 052/178] fix: remove unnecessary assertion --- lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 3da15ba0e5..42e807fc2a 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -234,7 +234,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { // Receive and get updated slate JSON. final received = await mimblewimblecoin.Libmwc.txReceiveDetailed( wallet: handle, - slateJson: decoded.slateJson!, + slateJson: decoded.slateJson, ); // Encode response back to sender if address available. @@ -273,7 +273,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { // Finalize transaction. final finalized = await mimblewimblecoin.Libmwc.txFinalize( wallet: handle, - slateJson: decoded.slateJson!, + slateJson: decoded.slateJson, ); return FinalizeResult( From 7eb25615865718edd9fc9c534066638b6b6ec02c Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 12:25:32 -0500 Subject: [PATCH 053/178] fix: unify txs selected method --- .../wallet_view/sub_widgets/desktop_send.dart | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) 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 694aae1861..a2728522ee 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 @@ -119,7 +119,6 @@ class _DesktopSendState extends ConsumerState { late final bool isStellar; late final bool isMimblewimblecoin; - String? _selectedMethodMwc = 'Slatepack'; String? _note; String? _onChainNote; @@ -291,7 +290,8 @@ class _DesktopSendState extends ConsumerState { final wallet = ref.read(pWallets).getWallet(walletId); // Handle MWC slatepack transactions directly. - if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') { + if (isMimblewimblecoin && + ref.read(pSelectedMwcTransactionMethod) == TransactionMethod.slatepack) { await _handleDesktopSlatepackCreation(wallet as MimblewimblecoinWallet); return; } @@ -1077,8 +1077,7 @@ class _DesktopSendState extends ConsumerState { isStellar = coin is Stellar; isMimblewimblecoin = coin is Mimblewimblecoin; if (isMimblewimblecoin) { - _selectedMethodMwc = "Slatepack"; - // Initialize provider to match the UI (slatepack method). + // Initialize provider to slatepack method. WidgetsBinding.instance.addPostFrameCallback((_) { ref.read(pSelectedMwcTransactionMethod.notifier).state = TransactionMethod.slatepack; @@ -1252,17 +1251,12 @@ class _DesktopSendState extends ConsumerState { 50, // Provide an explicit height to avoid infinite constraints child: MwcTxsMethodToggle( onChanged: (TxsMethodMwcType type) { - setState(() { - _selectedMethodMwc = - type == TxsMethodMwcType.slatepack - ? 'Automatic' - : 'Slatepack'; - }); - // Update the provider as well. + // Update the provider directly. ref.read(pSelectedMwcTransactionMethod.notifier).state = type == TxsMethodMwcType.slatepack ? TransactionMethod.mwcmqs : TransactionMethod.slatepack; + setState(() {}); // Trigger rebuild }, ), ), @@ -1638,9 +1632,7 @@ class _DesktopSendState extends ConsumerState { height: 1.8, ), decoration: standardInputDecoration( - _selectedMethodMwc == "Slatepack" || - _selectedMethodMwc == null || - _selectedMethodMwc == "" + ref.watch(pSelectedMwcTransactionMethod) == TransactionMethod.slatepack ? "Enter ${coin.ticker} address (optional)" : "Enter ${coin.ticker} address", _addressFocusNode, From 0360146fa656a562790d755e6411a1a92de5b0a9 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Sep 2025 17:01:38 -0500 Subject: [PATCH 054/178] fix: "Preview send" -> "Create slatepack" and formatting --- .../wallet_view/sub_widgets/desktop_send.dart | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 a2728522ee..3dee26b7cc 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 @@ -290,8 +290,9 @@ class _DesktopSendState extends ConsumerState { final wallet = ref.read(pWallets).getWallet(walletId); // Handle MWC slatepack transactions directly. - if (isMimblewimblecoin && - ref.read(pSelectedMwcTransactionMethod) == TransactionMethod.slatepack) { + if (isMimblewimblecoin && + ref.read(pSelectedMwcTransactionMethod) == + TransactionMethod.slatepack) { await _handleDesktopSlatepackCreation(wallet as MimblewimblecoinWallet); return; } @@ -1632,7 +1633,8 @@ class _DesktopSendState extends ConsumerState { height: 1.8, ), decoration: standardInputDecoration( - ref.watch(pSelectedMwcTransactionMethod) == TransactionMethod.slatepack + ref.watch(pSelectedMwcTransactionMethod) == + TransactionMethod.slatepack ? "Enter ${coin.ticker} address (optional)" : "Enter ${coin.ticker} address", _addressFocusNode, @@ -1933,7 +1935,11 @@ class _DesktopSendState extends ConsumerState { const SizedBox(height: 36), PrimaryButton( buttonHeight: ButtonHeight.l, - label: "Preview send", + label: + ref.read(pSelectedMwcTransactionMethod) == + TransactionMethod.slatepack + ? "Create slatepack" + : "Preview send", enabled: ref.watch(pPreviewTxButtonEnabled(coin)), onPressed: ref.watch(pPreviewTxButtonEnabled(coin)) ? previewSend : null, From 1bd11140da8de94406b7790bc8b1f96afae61f7a Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 15 Sep 2025 07:50:18 -0600 Subject: [PATCH 055/178] update frostdart --- crypto_plugins/frostdart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/frostdart b/crypto_plugins/frostdart index 5e8a515926..1bfdd5b908 160000 --- a/crypto_plugins/frostdart +++ b/crypto_plugins/frostdart @@ -1 +1 @@ -Subproject commit 5e8a51592690650e7ac63fafa81017dfc51ae6d5 +Subproject commit 1bfdd5b9085d83a7f4d877e538270636f3a87a5e From cf9cecd58c6e6fe275c5d31ae618a88282e96adc Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 16 Sep 2025 09:47:49 -0600 Subject: [PATCH 056/178] pubspec lock --- pubspec.lock | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 33c6da0ebf..866a1e3310 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -813,11 +813,11 @@ packages: dependency: "direct main" description: path: "." - ref: f0b1300140d45c13e7722f8f8d20308efeba8449 - resolved-ref: f0b1300140d45c13e7722f8f8d20308efeba8449 + ref: "794ab2d7b88b34d64a89518f9b9f41dcc235aca1" + resolved-ref: "794ab2d7b88b34d64a89518f9b9f41dcc235aca1" url: "https://github.com/cypherstack/electrum_adapter.git" source: git - version: "3.0.0" + version: "3.0.2" emojis: dependency: "direct main" description: @@ -1126,8 +1126,8 @@ packages: dependency: "direct main" description: path: "." - ref: afaad488f5215a9c2c211e5e2f8460237eef60f1 - resolved-ref: afaad488f5215a9c2c211e5e2f8460237eef60f1 + ref: "540d0bc7dc27a97d45d63f412f26818a7f3b8b51" + resolved-ref: "540d0bc7dc27a97d45d63f412f26818a7f3b8b51" url: "https://github.com/cypherstack/fusiondart.git" source: git version: "1.0.0" @@ -1970,11 +1970,10 @@ packages: socks_socket: dependency: transitive description: - path: "." - ref: master - resolved-ref: e6232c53c1595469931ababa878759a067c02e94 - url: "https://github.com/cypherstack/socks_socket.git" - source: git + name: socks_socket + sha256: "53bc7eae40a3aa16ea810b0e9de3bb23ba7beb0b40d09357b89190f2f44374cc" + url: "https://pub.dev" + source: hosted version: "1.1.1" solana: dependency: "direct main" @@ -2207,8 +2206,8 @@ packages: dependency: "direct main" description: path: "." - ref: "752f054b65c500adb9cad578bf183a978e012502" - resolved-ref: "752f054b65c500adb9cad578bf183a978e012502" + ref: "16c9e709e984ec89e8715ce378b038c93ad7add3" + resolved-ref: "16c9e709e984ec89e8715ce378b038c93ad7add3" url: "https://github.com/cypherstack/tor.git" source: git version: "0.0.1" From eccd9b6fbbb9d83dfec4654bcc98339b445b85e5 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 16 Sep 2025 09:48:14 -0600 Subject: [PATCH 057/178] remove duplicate desktop receive qr create button --- .../wallet_view/sub_widgets/desktop_receive.dart | 15 --------------- 1 file changed, 15 deletions(-) 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 359d25ff60..0e9f4e22bb 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 @@ -923,21 +923,6 @@ class _DesktopReceiveState extends ConsumerState { ).extension()!.accentColorBlue, ), ), - const SizedBox(width: 8), - Padding( - padding: const EdgeInsets.only(bottom: 2), - child: Text( - "Create new QR code", - style: STextStyles.desktopTextExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorBlue, - ), - ), - ), ], ), ), From 2f6d2a9ac3b08811d10575c1df07f6493fda9aac Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 16 Sep 2025 10:31:13 -0600 Subject: [PATCH 058/178] no need for extra string variables when there is an enum already... --- .../desktop_mwc_txs_method_toggle.dart | 4 ++-- .../wallet_view/sub_widgets/desktop_receive.dart | 15 +++++++-------- lib/utilities/enums/txs_method_mwc_enum.dart | 10 +++++++--- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart index 3817d139f6..4f157c88d4 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart @@ -62,9 +62,9 @@ class MwcTxsMethodToggle extends ConsumerWidget { ), ), onIcon: Assets.svg.gear, - onText: "Slatepack", + onText: TxsMethodMwcType.slatepack.value, offIcon: Assets.svg.radioSyncing, - offText: "Automatic", + offText: TxsMethodMwcType.automatic.value, ); } } 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 0e9f4e22bb..1629f14c81 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 @@ -92,7 +92,7 @@ class _DesktopReceiveState extends ConsumerState { final _addressFocusNode = FocusNode(); int _currentIndex = 0; - String? _selectedMethodMwc; // Variable to store selected dropdown value + late TxsMethodMwcType _selectedMethodMwc; String? _note; final List _walletAddressTypes = []; @@ -308,7 +308,7 @@ class _DesktopReceiveState extends ConsumerState { isMimblewimblecoin = wallet is MimblewimblecoinWallet; if (isMimblewimblecoin) { - _selectedMethodMwc = "Slatepack"; + _selectedMethodMwc = TxsMethodMwcType.slatepack; } debugPrint("Address generated: $isMimblewimblecoin"); @@ -495,10 +495,7 @@ class _DesktopReceiveState extends ConsumerState { child: MwcTxsMethodToggle( onChanged: (TxsMethodMwcType type) { setState(() { - _selectedMethodMwc = - type == TxsMethodMwcType.slatepack - ? 'Slatepack' - : 'Automatic'; + _selectedMethodMwc = type; }); }, ), @@ -681,7 +678,8 @@ class _DesktopReceiveState extends ConsumerState { label: "Generate new address", ), const SizedBox(height: 20), - if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') + if (isMimblewimblecoin && + _selectedMethodMwc == TxsMethodMwcType.slatepack) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -816,7 +814,8 @@ class _DesktopReceiveState extends ConsumerState { // TODO: create transparent button class to account for hover // Conditional logic for 'Submit' button or QR code - if (isMimblewimblecoin && _selectedMethodMwc == 'Slatepack') + if (isMimblewimblecoin && + _selectedMethodMwc == TxsMethodMwcType.slatepack) Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: PrimaryButton( diff --git a/lib/utilities/enums/txs_method_mwc_enum.dart b/lib/utilities/enums/txs_method_mwc_enum.dart index a77e08492e..23c04ab08a 100644 --- a/lib/utilities/enums/txs_method_mwc_enum.dart +++ b/lib/utilities/enums/txs_method_mwc_enum.dart @@ -8,7 +8,11 @@ * */ -enum TxsMethodMwcType { - slatepack, - automatic +enum TxsMethodMwcType { + slatepack("Slatepack"), + automatic("Automatic"); + + final String value; + + const TxsMethodMwcType(this.value); } From 3849f8ab5cf3f7dc238b798a565d8e1de3f6cae7 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 16 Sep 2025 10:35:34 -0600 Subject: [PATCH 059/178] fix scripts --- scripts/ios/build_all.sh | 2 -- scripts/ios/build_all_campfire.sh | 2 -- scripts/ios/build_all_duo.sh | 2 -- scripts/linux/build_all.sh | 2 -- scripts/linux/build_all_campfire.sh | 2 -- scripts/linux/build_all_duo.sh | 2 -- scripts/macos/build_all.sh | 2 -- scripts/macos/build_all_campfire.sh | 2 -- scripts/macos/build_all_duo.sh | 2 -- scripts/rust_version.sh | 18 ------------------ scripts/windows/build_all.sh | 5 ----- scripts/windows/build_all_campfire.sh | 5 ----- scripts/windows/build_all_duo.sh | 5 ----- 13 files changed, 51 deletions(-) diff --git a/scripts/ios/build_all.sh b/scripts/ios/build_all.sh index 0bc5777015..83177db5c2 100755 --- a/scripts/ios/build_all.sh +++ b/scripts/ios/build_all.sh @@ -14,9 +14,7 @@ rustup target add x86_64-apple-ios source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/ios/build_all_campfire.sh b/scripts/ios/build_all_campfire.sh index 0bc5777015..83177db5c2 100755 --- a/scripts/ios/build_all_campfire.sh +++ b/scripts/ios/build_all_campfire.sh @@ -14,9 +14,7 @@ rustup target add x86_64-apple-ios source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/ios/build_all_duo.sh b/scripts/ios/build_all_duo.sh index 48c1335fef..0b560202b6 100755 --- a/scripts/ios/build_all_duo.sh +++ b/scripts/ios/build_all_duo.sh @@ -16,9 +16,7 @@ rustup target add x86_64-apple-ios source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/linux/build_all.sh b/scripts/linux/build_all.sh index ca6ae2d2a5..50490b1979 100755 --- a/scripts/linux/build_all.sh +++ b/scripts/linux/build_all.sh @@ -13,9 +13,7 @@ mkdir -p build source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/linux/build_all_campfire.sh b/scripts/linux/build_all_campfire.sh index ca6ae2d2a5..50490b1979 100755 --- a/scripts/linux/build_all_campfire.sh +++ b/scripts/linux/build_all_campfire.sh @@ -13,9 +13,7 @@ mkdir -p build source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/linux/build_all_duo.sh b/scripts/linux/build_all_duo.sh index 5a98fe3814..a29947f4f6 100755 --- a/scripts/linux/build_all_duo.sh +++ b/scripts/linux/build_all_duo.sh @@ -16,9 +16,7 @@ mkdir -p build source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/macos/build_all.sh b/scripts/macos/build_all.sh index f8dabc3d3f..de9b79efaa 100755 --- a/scripts/macos/build_all.sh +++ b/scripts/macos/build_all.sh @@ -7,9 +7,7 @@ set -x -e source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/macos/build_all_campfire.sh b/scripts/macos/build_all_campfire.sh index f727c4268b..2bc4aaf4bb 100755 --- a/scripts/macos/build_all_campfire.sh +++ b/scripts/macos/build_all_campfire.sh @@ -7,9 +7,7 @@ set -x -e source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/macos/build_all_duo.sh b/scripts/macos/build_all_duo.sh index d817a02e2a..29a0d82420 100755 --- a/scripts/macos/build_all_duo.sh +++ b/scripts/macos/build_all_duo.sh @@ -9,9 +9,7 @@ set -x -e source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) -set_rust_to_1720 # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/rust_version.sh b/scripts/rust_version.sh index 3f658fead0..65bf911f49 100755 --- a/scripts/rust_version.sh +++ b/scripts/rust_version.sh @@ -18,21 +18,3 @@ set_rust_version_for_libepiccash() { exit 1 fi } - -set_rust_to_1810() { - if rustup toolchain list | grep -q "1.81.0"; then - rustup default 1.81.0 - else - echo "Rust version 1.81.0 is not installed. Please install it using 'rustup install 1.81.0'." >&2 - exit 1 - fi -} - -set_rust_to_1720() { - if rustup toolchain list | grep -q "1.72.0"; then - rustup default 1.72.0 - else - echo "Rust version 1.72.0 is not installed. Please install it using 'rustup install 1.72.0'." >&2 - exit 1 - fi -} \ No newline at end of file diff --git a/scripts/windows/build_all.sh b/scripts/windows/build_all.sh index 178868a8de..6d7395bbf3 100755 --- a/scripts/windows/build_all.sh +++ b/scripts/windows/build_all.sh @@ -8,11 +8,6 @@ mkdir -p build source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) - -mkdir -p build -(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/windows/build_all_campfire.sh b/scripts/windows/build_all_campfire.sh index 178868a8de..6d7395bbf3 100755 --- a/scripts/windows/build_all_campfire.sh +++ b/scripts/windows/build_all_campfire.sh @@ -8,11 +8,6 @@ mkdir -p build source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) - -mkdir -p build -(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/windows/build_all_duo.sh b/scripts/windows/build_all_duo.sh index 9e27fd8e03..6a19b94f52 100755 --- a/scripts/windows/build_all_duo.sh +++ b/scripts/windows/build_all_duo.sh @@ -10,11 +10,6 @@ mkdir -p build source ../rust_version.sh set_rust_version_for_libepiccash (cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) - -mkdir -p build -(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) -set_rust_to_1810 (cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else From acbce8ad0cf174321fec84a729dcec067cd53fb5 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 16 Sep 2025 13:14:58 -0500 Subject: [PATCH 060/178] fix: prevent UI crash on MWC error (hack) --- .../wallet_view/sub_widgets/desktop_send.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 3dee26b7cc..d7ad101951 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 @@ -170,6 +170,8 @@ class _DesktopSendState extends ConsumerState { Future _handleDesktopSlatepackCreation( MimblewimblecoinWallet wallet, ) async { + bool buildingDialogDismissed = false; + try { final amount = ref.read(pSendAmount)!; @@ -199,6 +201,7 @@ class _DesktopSendState extends ConsumerState { // Close building dialog. if (mounted) { Navigator.of(context, rootNavigator: true).pop(); + buildingDialogDismissed = true; } if (!slatepackResult.success || slatepackResult.slatepack == null) { @@ -224,8 +227,8 @@ class _DesktopSendState extends ConsumerState { } catch (e, s) { Logging.instance.e('Failed to create MWC slatepack on desktop: $e\n$s'); - // Close building dialog if still open. - if (mounted) { + // Close building dialog if still open and not already dismissed. + if (mounted && !buildingDialogDismissed) { Navigator.of(context, rootNavigator: true).pop(); } From da33a5d12f2920e2b4f7b4536693189a772f1210 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 16 Sep 2025 13:18:55 -0500 Subject: [PATCH 061/178] fix: prevent UI crash on MWC error with no hack --- .../wallet_view/sub_widgets/desktop_send.dart | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) 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 d7ad101951..c6834bfdb0 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 @@ -170,8 +170,6 @@ class _DesktopSendState extends ConsumerState { Future _handleDesktopSlatepackCreation( MimblewimblecoinWallet wallet, ) async { - bool buildingDialogDismissed = false; - try { final amount = ref.read(pSendAmount)!; @@ -183,8 +181,11 @@ class _DesktopSendState extends ConsumerState { builder: (context) => BuildingTransactionDialog( coin: coin, - onCancel: - () => Navigator.of(context, rootNavigator: true).pop(), + onCancel: () { + // Use maybePop so we never accidentally pop the base route + // if the dialog hasn't fully mounted yet. + Navigator.of(context, rootNavigator: true).maybePop(); + }, isSpark: false, ), ), @@ -198,10 +199,10 @@ class _DesktopSendState extends ConsumerState { encrypt: false, // No encryption without recipient address. ); - // Close building dialog. + // Close building dialog if present. Use maybePop to avoid popping the + // underlying page route in case the dialog hasn't mounted yet. if (mounted) { - Navigator.of(context, rootNavigator: true).pop(); - buildingDialogDismissed = true; + await Navigator.of(context, rootNavigator: true).maybePop(); } if (!slatepackResult.success || slatepackResult.slatepack == null) { @@ -227,9 +228,10 @@ class _DesktopSendState extends ConsumerState { } catch (e, s) { Logging.instance.e('Failed to create MWC slatepack on desktop: $e\n$s'); - // Close building dialog if still open and not already dismissed. - if (mounted && !buildingDialogDismissed) { - Navigator.of(context, rootNavigator: true).pop(); + // Close building dialog if still open. maybePop prevents popping the + // page route if the dialog wasn't pushed yet. + if (mounted) { + await Navigator.of(context, rootNavigator: true).maybePop(); } if (mounted) { @@ -618,8 +620,8 @@ class _DesktopSendState extends ConsumerState { txData = txData.copyWith(noteOnChain: _onChainNote ?? ""); } } - // pop building dialog - Navigator.of(context, rootNavigator: true).pop(); + // Close building dialog if present without risking popping the page. + await Navigator.of(context, rootNavigator: true).maybePop(); unawaited( showDialog( @@ -642,8 +644,8 @@ class _DesktopSendState extends ConsumerState { } catch (e, s) { Logging.instance.e("Desktop send: ", error: e, stackTrace: s); if (mounted) { - // pop building dialog - Navigator.of(context, rootNavigator: true).pop(); + // Close building dialog if present without risking popping the page. + await Navigator.of(context, rootNavigator: true).maybePop(); unawaited( showDialog( From 7ef8320fb1fa3b74985c2e5a3069833c0b386d22 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 16 Sep 2025 12:28:22 -0600 Subject: [PATCH 062/178] fix slatepack/auto type toggle on desktop --- lib/models/mwc_transaction_method.dart | 70 ------------------- lib/pages/send_view/send_view.dart | 38 +++++----- .../mwc_transaction_method_selector.dart | 38 +++++----- .../desktop_mwc_txs_method_toggle.dart | 29 ++++---- .../sub_widgets/desktop_receive.dart | 31 ++++---- .../wallet_view/sub_widgets/desktop_send.dart | 33 +++------ .../ui/preview_tx_button_state_provider.dart | 9 +-- .../enums/mwc_transaction_method.dart | 70 +++++++++++++++++++ lib/utilities/enums/txs_method_mwc_enum.dart | 18 ----- .../coins/mimblewimblecoin.dart | 15 ++-- 10 files changed, 159 insertions(+), 192 deletions(-) delete mode 100644 lib/models/mwc_transaction_method.dart create mode 100644 lib/utilities/enums/mwc_transaction_method.dart delete mode 100644 lib/utilities/enums/txs_method_mwc_enum.dart diff --git a/lib/models/mwc_transaction_method.dart b/lib/models/mwc_transaction_method.dart deleted file mode 100644 index 1663d834c6..0000000000 --- a/lib/models/mwc_transaction_method.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// Enum to represent different MWC transaction methods. -enum TransactionMethod { - /// Manual slatepack exchange (copy/paste, QR codes, files). - slatepack, - - /// Automatic transaction via MWCMQS. - mwcmqs, - - /// Direct HTTP/HTTPS to recipient's wallet. - http, - - /// Unknown or unsupported method. - unknown; - - /// Human readable name for the transaction method. - String get displayName { - switch (this) { - case TransactionMethod.slatepack: - return 'Slatepack'; - case TransactionMethod.mwcmqs: - return 'MWCMQS'; - case TransactionMethod.http: - return 'HTTP'; - case TransactionMethod.unknown: - return 'Unknown'; - } - } - - /// Description of how the transaction method works. - String get description { - switch (this) { - case TransactionMethod.slatepack: - return 'Manual exchange via text, QR codes, or files'; - case TransactionMethod.mwcmqs: - return 'Automatic exchange via MWCMQS messaging'; - case TransactionMethod.http: - return 'Direct connection to recipient wallet'; - case TransactionMethod.unknown: - return 'Unsupported transaction method'; - } - } - - /// Whether this method requires manual intervention. - bool get isManual { - switch (this) { - case TransactionMethod.slatepack: - return true; - case TransactionMethod.mwcmqs: - return false; - case TransactionMethod.http: - return false; - case TransactionMethod.unknown: - return true; - } - } - - /// Whether this method works offline. - bool get worksOffline { - switch (this) { - case TransactionMethod.slatepack: - return true; - case TransactionMethod.mwcmqs: - return false; - case TransactionMethod.http: - return false; - case TransactionMethod.unknown: - return false; - } - } -} diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index e4a206ce96..96a64f6550 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -22,7 +22,6 @@ import 'package:tuple/tuple.dart'; import '../../models/input.dart'; import '../../models/isar/models/isar_models.dart'; -import '../../models/mwc_transaction_method.dart'; import '../../models/paynym/paynym_account_lite.dart'; import '../../models/send_view_auto_fill_data.dart'; import '../../providers/providers.dart'; @@ -43,6 +42,7 @@ import '../../utilities/barcode_scanner_interface.dart'; import '../../utilities/clipboard_interface.dart'; import '../../utilities/constants.dart'; import '../../utilities/enums/fee_rate_type_enum.dart'; +import '../../utilities/enums/mwc_transaction_method.dart'; import '../../utilities/eth_commons.dart'; import '../../utilities/extensions/extensions.dart'; import '../../utilities/logger.dart'; @@ -149,7 +149,7 @@ class _SendViewState extends ConsumerState { Set selectedUTXOs = {}; // MWC transaction method selection. - TransactionMethod? _selectedTransactionMethod; + MwcTransactionMethod? _selectedTransactionMethod; void _applyUri(PaymentUriData paymentData) { try { @@ -860,21 +860,21 @@ class _SendViewState extends ConsumerState { if (_selectedTransactionMethod != null) { switch (_selectedTransactionMethod!) { - case TransactionMethod.slatepack: + case MwcTransactionMethod.slatepack: transactionMethod = 'slatepack'; break; - case TransactionMethod.mwcmqs: + case MwcTransactionMethod.mwcmqs: transactionMethod = 'mwcmqs'; break; - case TransactionMethod.http: - transactionMethod = 'http'; - break; - case TransactionMethod.unknown: - // Auto-detect from address format. - final mwcCoin = coin as Mimblewimblecoin; - final method = mwcCoin.getTransactionMethod(_address!); - transactionMethod = method.toString().split('.').last; - break; + // case MwcTransactionMethod.http: + // transactionMethod = 'http'; + // break; + // case MwcTransactionMethod.unknown: + // // Auto-detect from address format. + // final mwcCoin = coin as Mimblewimblecoin; + // final method = mwcCoin.getTransactionMethod(_address!); + // transactionMethod = method.toString().split('.').last; + // break; } } else { // Auto-detect from address format if no method selected. @@ -1136,11 +1136,11 @@ class _SendViewState extends ConsumerState { ref.refresh(feeSheetSessionCacheProvider); ref.refresh(pIsExchangeAddress); - // Initialize MWC transaction method to default (non-slatepack). - if (coin is Mimblewimblecoin) { - ref.read(pSelectedMwcTransactionMethod.notifier).state = - null; // No method selected initially. - } + // // Initialize MWC transaction method to default (non-slatepack). + // if (coin is Mimblewimblecoin) { + // ref.read(pSelectedMwcTransactionMethod.notifier).state = + // null; // No method selected initially. + // } }); isCustomFee.addListener(() { if (!isCustomFee.value) { @@ -1650,7 +1650,7 @@ class _SendViewState extends ConsumerState { decoration: standardInputDecoration( coin is Mimblewimblecoin && _selectedTransactionMethod == - TransactionMethod + MwcTransactionMethod .slatepack || _selectedTransactionMethod == null ? "Enter ${coin.ticker} address (optional)" diff --git a/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart b/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart index 33cbcf5123..123656faf5 100644 --- a/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart +++ b/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart @@ -2,9 +2,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import '../../../models/mwc_transaction_method.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/assets.dart'; +import '../../../utilities/enums/mwc_transaction_method.dart'; import '../../../utilities/text_styles.dart'; import '../../../widgets/rounded_white_container.dart'; @@ -16,8 +16,8 @@ class MwcTransactionMethodSelector extends ConsumerStatefulWidget { this.addressText, }); - final void Function(TransactionMethod) onMethodSelected; - final TransactionMethod? selectedMethod; + final void Function(MwcTransactionMethod) onMethodSelected; + final MwcTransactionMethod? selectedMethod; final String? addressText; @override @@ -27,7 +27,7 @@ class MwcTransactionMethodSelector extends ConsumerStatefulWidget { class _MwcTransactionMethodSelectorState extends ConsumerState { - TransactionMethod? _selectedMethod; + MwcTransactionMethod? _selectedMethod; @override void initState() { @@ -35,7 +35,7 @@ class _MwcTransactionMethodSelectorState _selectedMethod = widget.selectedMethod; } - void _selectMethod(TransactionMethod method) { + void _selectMethod(MwcTransactionMethod method) { setState(() { _selectedMethod = method; }); @@ -43,7 +43,7 @@ class _MwcTransactionMethodSelectorState } Widget _buildMethodTile({ - required TransactionMethod method, + required MwcTransactionMethod method, required String title, required String subtitle, required IconData icon, @@ -197,7 +197,7 @@ class _MwcTransactionMethodSelectorState children: [ // Slatepack method. _buildMethodTile( - method: TransactionMethod.slatepack, + method: MwcTransactionMethod.slatepack, title: "Slatepack (Manual)", subtitle: "Copy/paste, QR codes, or files", icon: Icons.qr_code, @@ -207,24 +207,24 @@ class _MwcTransactionMethodSelectorState // MWCMQS method. _buildMethodTile( - method: TransactionMethod.mwcmqs, + method: MwcTransactionMethod.mwcmqs, title: "MWCMQS (Automatic)", subtitle: "Direct messaging to recipient", icon: Icons.message, available: true, unavailableReason: "Requires MWCMQS address", ), - const SizedBox(height: 12), - - // HTTP method. - _buildMethodTile( - method: TransactionMethod.http, - title: "HTTP (Direct)", - subtitle: "Direct connection to wallet", - icon: Icons.http, - available: true, - unavailableReason: "Requires HTTP address", - ), + // const SizedBox(height: 12), + // + // // HTTP method. + // _buildMethodTile( + // method: MwcTransactionMethod.http, + // title: "HTTP (Direct)", + // subtitle: "Direct connection to wallet", + // icon: Icons.http, + // available: true, + // unavailableReason: "Requires HTTP address", + // ), ], ), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart index 4f157c88d4..1257d464cc 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart @@ -11,17 +11,16 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import '../../../../providers/ui/preview_tx_button_state_provider.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/constants.dart'; -import '../../../../utilities/enums/txs_method_mwc_enum.dart'; +import '../../../../utilities/enums/mwc_transaction_method.dart'; import '../../../../utilities/util.dart'; import '../../../../widgets/toggle.dart'; class MwcTxsMethodToggle extends ConsumerWidget { - const MwcTxsMethodToggle({super.key, this.onChanged}); - - final void Function(TxsMethodMwcType)? onChanged; + const MwcTxsMethodToggle({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { @@ -33,13 +32,19 @@ class MwcTxsMethodToggle extends ConsumerWidget { // Align visual labels with callback semantics: // When the toggle shows "Slatepack" (on), emit slatepack. // When it shows "Automatic" (off), emit automatic. - if (value) { - onChanged?.call(TxsMethodMwcType.slatepack); - } else { - onChanged?.call(TxsMethodMwcType.automatic); - } + // if (value) { + // onChanged?.call(TxsMethodMwcType.slatepack); + // } else { + // onChanged?.call(TxsMethodMwcType.automatic); + // } + ref.read(pSelectedMwcTransactionMethod.notifier).state = + value + ? MwcTransactionMethod.mwcmqs + : MwcTransactionMethod.slatepack; }, - isOn: false, + isOn: + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.mwcmqs, onColor: isDesktop ? Theme.of( @@ -62,9 +67,9 @@ class MwcTxsMethodToggle extends ConsumerWidget { ), ), onIcon: Assets.svg.gear, - onText: TxsMethodMwcType.slatepack.value, + onText: "Slatepack", offIcon: Assets.svg.radioSyncing, - offText: TxsMethodMwcType.automatic.value, + offText: "Automatic", ); } } 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 1629f14c81..b907489d95 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 @@ -24,6 +24,7 @@ import '../../../../notifications/show_flush_bar.dart'; import '../../../../pages/receive_view/generate_receiving_uri_qr_code_view.dart'; import '../../../../pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart'; import '../../../../providers/providers.dart'; +import '../../../../providers/ui/preview_tx_button_state_provider.dart'; import '../../../../route_generator.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/address_utils.dart'; @@ -31,7 +32,7 @@ import '../../../../utilities/assets.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; import '../../../../utilities/enums/derive_path_type_enum.dart'; -import '../../../../utilities/enums/txs_method_mwc_enum.dart'; +import '../../../../utilities/enums/mwc_transaction_method.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/show_loading.dart'; import '../../../../utilities/text_styles.dart'; @@ -92,7 +93,6 @@ class _DesktopReceiveState extends ConsumerState { final _addressFocusNode = FocusNode(); int _currentIndex = 0; - late TxsMethodMwcType _selectedMethodMwc; String? _note; final List _walletAddressTypes = []; @@ -116,7 +116,10 @@ class _DesktopReceiveState extends ConsumerState { paymentData.coin?.uriScheme == coin.uriScheme) { _address = paymentData.address; receiveSlateController.text = - _selectedMethodMwc == "Slatepack" ? "" : _address!; + ref.read(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack + ? "" + : _address!; setState(() { _addressToggleFlag = receiveSlateController.text.isNotEmpty; }); @@ -307,10 +310,6 @@ class _DesktopReceiveState extends ConsumerState { wallet.info.isMwebEnabled; isMimblewimblecoin = wallet is MimblewimblecoinWallet; - if (isMimblewimblecoin) { - _selectedMethodMwc = TxsMethodMwcType.slatepack; - } - debugPrint("Address generated: $isMimblewimblecoin"); if (wallet is ViewOnlyOptionInterface && wallet.isViewOnly) { showMultiType = false; @@ -489,16 +488,10 @@ class _DesktopReceiveState extends ConsumerState { width: 1, ), ), - child: SizedBox( + child: const SizedBox( height: - 50, // Provide an explicit height to avoid infinite constraints - child: MwcTxsMethodToggle( - onChanged: (TxsMethodMwcType type) { - setState(() { - _selectedMethodMwc = type; - }); - }, - ), + 60, // Provide an explicit height to avoid infinite constraints + child: MwcTxsMethodToggle(), ), ), ), @@ -679,7 +672,8 @@ class _DesktopReceiveState extends ConsumerState { ), const SizedBox(height: 20), if (isMimblewimblecoin && - _selectedMethodMwc == TxsMethodMwcType.slatepack) + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -815,7 +809,8 @@ class _DesktopReceiveState extends ConsumerState { // TODO: create transparent button class to account for hover // Conditional logic for 'Submit' button or QR code if (isMimblewimblecoin && - _selectedMethodMwc == TxsMethodMwcType.slatepack) + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack) Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: PrimaryButton( 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 c6834bfdb0..732d0e05e4 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 @@ -20,7 +20,6 @@ import 'package:flutter_svg/flutter_svg.dart'; import '../../../../models/isar/models/blockchain_data/address.dart'; import '../../../../models/isar/models/blockchain_data/utxo.dart'; import '../../../../models/isar/models/contact_entry.dart'; -import '../../../../models/mwc_transaction_method.dart'; import '../../../../models/paynym/paynym_account_lite.dart'; import '../../../../models/send_view_auto_fill_data.dart'; import '../../../../pages/send_view/confirm_transaction_view.dart'; @@ -42,7 +41,7 @@ import '../../../../utilities/amount/amount_unit.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; -import '../../../../utilities/enums/txs_method_mwc_enum.dart'; +import '../../../../utilities/enums/mwc_transaction_method.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/prefs.dart'; import '../../../../utilities/text_styles.dart'; @@ -297,7 +296,7 @@ class _DesktopSendState extends ConsumerState { // Handle MWC slatepack transactions directly. if (isMimblewimblecoin && ref.read(pSelectedMwcTransactionMethod) == - TransactionMethod.slatepack) { + MwcTransactionMethod.slatepack) { await _handleDesktopSlatepackCreation(wallet as MimblewimblecoinWallet); return; } @@ -1082,13 +1081,6 @@ class _DesktopSendState extends ConsumerState { isStellar = coin is Stellar; isMimblewimblecoin = coin is Mimblewimblecoin; - if (isMimblewimblecoin) { - // Initialize provider to slatepack method. - WidgetsBinding.instance.addPostFrameCallback((_) { - ref.read(pSelectedMwcTransactionMethod.notifier).state = - TransactionMethod.slatepack; - }); - } sendToController = TextEditingController(); cryptoAmountController = TextEditingController(); @@ -1234,7 +1226,7 @@ class _DesktopSendState extends ConsumerState { if (showPrivateBalance) const SizedBox(height: 4), if (isMimblewimblecoin) Padding( - padding: const EdgeInsets.all(0), + padding: const EdgeInsets.only(bottom: 16), child: Container( decoration: BoxDecoration( color: @@ -1252,19 +1244,10 @@ class _DesktopSendState extends ConsumerState { width: 1, ), ), - child: SizedBox( + child: const SizedBox( height: - 50, // Provide an explicit height to avoid infinite constraints - child: MwcTxsMethodToggle( - onChanged: (TxsMethodMwcType type) { - // Update the provider directly. - ref.read(pSelectedMwcTransactionMethod.notifier).state = - type == TxsMethodMwcType.slatepack - ? TransactionMethod.mwcmqs - : TransactionMethod.slatepack; - setState(() {}); // Trigger rebuild - }, - ), + 60, // Provide an explicit height to avoid infinite constraints + child: MwcTxsMethodToggle(), ), ), ), @@ -1639,7 +1622,7 @@ class _DesktopSendState extends ConsumerState { ), decoration: standardInputDecoration( ref.watch(pSelectedMwcTransactionMethod) == - TransactionMethod.slatepack + MwcTransactionMethod.slatepack ? "Enter ${coin.ticker} address (optional)" : "Enter ${coin.ticker} address", _addressFocusNode, @@ -1942,7 +1925,7 @@ class _DesktopSendState extends ConsumerState { buttonHeight: ButtonHeight.l, label: ref.read(pSelectedMwcTransactionMethod) == - TransactionMethod.slatepack + MwcTransactionMethod.slatepack ? "Create slatepack" : "Preview send", enabled: ref.watch(pPreviewTxButtonEnabled(coin)), diff --git a/lib/providers/ui/preview_tx_button_state_provider.dart b/lib/providers/ui/preview_tx_button_state_provider.dart index f8955f8888..de20131e11 100644 --- a/lib/providers/ui/preview_tx_button_state_provider.dart +++ b/lib/providers/ui/preview_tx_button_state_provider.dart @@ -10,8 +10,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; -import '../../models/mwc_transaction_method.dart'; import '../../utilities/amount/amount.dart'; +import '../../utilities/enums/mwc_transaction_method.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; import '../wallet/public_private_balance_state_provider.dart'; @@ -22,8 +22,9 @@ final pValidSparkSendToAddress = StateProvider.autoDispose((_) => false); final pIsExchangeAddress = StateProvider((_) => false); // MWC Transaction Method Provider. -final pSelectedMwcTransactionMethod = - StateProvider.autoDispose((_) => null); +final pSelectedMwcTransactionMethod = StateProvider( + (_) => MwcTransactionMethod.slatepack, +); final pPreviewTxButtonEnabled = Provider.autoDispose .family((ref, coin) { @@ -32,7 +33,7 @@ final pPreviewTxButtonEnabled = Provider.autoDispose // For MWC slatepack transactions, address validation is not required. if (coin is Mimblewimblecoin) { final selectedMethod = ref.watch(pSelectedMwcTransactionMethod); - if (selectedMethod == TransactionMethod.slatepack) { + if (selectedMethod == MwcTransactionMethod.slatepack) { return amount > Amount.zero; } } diff --git a/lib/utilities/enums/mwc_transaction_method.dart b/lib/utilities/enums/mwc_transaction_method.dart new file mode 100644 index 0000000000..4b24ad37f7 --- /dev/null +++ b/lib/utilities/enums/mwc_transaction_method.dart @@ -0,0 +1,70 @@ +/// Enum to represent different MWC transaction methods. +enum MwcTransactionMethod { + /// Manual slatepack exchange (copy/paste, QR codes, files). + slatepack, + + /// Automatic transaction via MWCMQS. + mwcmqs; + + // /// Direct HTTP/HTTPS to recipient's wallet. + // http, + // + // /// Unknown or unsupported method. + // unknown; + + /// Human readable name for the transaction method. + String get displayName { + switch (this) { + case MwcTransactionMethod.slatepack: + return 'Slatepack'; + case MwcTransactionMethod.mwcmqs: + return 'MWCMQS'; + // case MwcTransactionMethod.http: + // return 'HTTP'; + // case MwcTransactionMethod.unknown: + // return 'Unknown'; + } + } + + /// Description of how the transaction method works. + String get description { + switch (this) { + case MwcTransactionMethod.slatepack: + return 'Manual exchange via text, QR codes, or files'; + case MwcTransactionMethod.mwcmqs: + return 'Automatic exchange via MWCMQS messaging'; + // case MwcTransactionMethod.http: + // return 'Direct connection to recipient wallet'; + // case MwcTransactionMethod.unknown: + // return 'Unsupported transaction method'; + } + } + + /// Whether this method requires manual intervention. + bool get isManual { + switch (this) { + case MwcTransactionMethod.slatepack: + return true; + case MwcTransactionMethod.mwcmqs: + return false; + // case MwcTransactionMethod.http: + // return false; + // case MwcTransactionMethod.unknown: + // return true; + } + } + + /// Whether this method works offline. + bool get worksOffline { + switch (this) { + case MwcTransactionMethod.slatepack: + return true; + case MwcTransactionMethod.mwcmqs: + return false; + // case MwcTransactionMethod.http: + // return false; + // case MwcTransactionMethod.unknown: + // return false; + } + } +} diff --git a/lib/utilities/enums/txs_method_mwc_enum.dart b/lib/utilities/enums/txs_method_mwc_enum.dart deleted file mode 100644 index 23c04ab08a..0000000000 --- a/lib/utilities/enums/txs_method_mwc_enum.dart +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This file is part of Stack Wallet. - * - * Copyright (c) 2023 Cypher 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 TxsMethodMwcType { - slatepack("Slatepack"), - automatic("Automatic"); - - final String value; - - const TxsMethodMwcType(this.value); -} diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index 9e9f962e05..c495d58f0f 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -1,10 +1,10 @@ import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; import '../../../models/isar/models/blockchain_data/address.dart'; -import '../../../models/mwc_transaction_method.dart'; import '../../../models/node_model.dart'; import '../../../utilities/default_nodes.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; +import '../../../utilities/enums/mwc_transaction_method.dart'; import '../crypto_currency.dart'; import '../intermediate/bip39_currency.dart'; @@ -92,15 +92,16 @@ class Mimblewimblecoin extends Bip39Currency { } /// Detect transaction type based on address/data format. - TransactionMethod getTransactionMethod(String addressOrData) { + MwcTransactionMethod getTransactionMethod(String addressOrData) { if (isSlatepack(addressOrData)) { - return TransactionMethod.slatepack; + return MwcTransactionMethod.slatepack; } else if (isMwcmqsAddress(addressOrData)) { - return TransactionMethod.mwcmqs; - } else if (isHttpAddress(addressOrData)) { - return TransactionMethod.http; + return MwcTransactionMethod.mwcmqs; + // } else if (isHttpAddress(addressOrData)) { + // return MwcTransactionMethod.http; } else { - return TransactionMethod.unknown; + throw Exception("Unknown MwcTransactionMethod found!"); + // return MwcTransactionMethod.unknown; } } From e85accbeaea5b6c58e979a89eb3e4e4c0c09f5a9 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 16 Sep 2025 14:05:57 -0600 Subject: [PATCH 063/178] WIP partial refactor --- .../mwc_slatepack_import_dialog.dart | 340 +++++++++--------- .../sub_widgets/desktop_receive.dart | 14 +- .../custom_buttons/simple_paste_button.dart | 60 ++++ 3 files changed, 228 insertions(+), 186 deletions(-) create mode 100644 lib/widgets/custom_buttons/simple_paste_button.dart diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart index ba7cf88278..a8c6b3920b 100644 --- a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -1,19 +1,21 @@ -import 'dart:io'; - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import '../../../notifications/show_flush_bar.dart'; import '../../../models/mwc_slatepack_models.dart'; +import '../../../notifications/show_flush_bar.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/assets.dart'; import '../../../utilities/clipboard_interface.dart'; +import '../../../utilities/constants.dart'; import '../../../utilities/text_styles.dart'; +import '../../../utilities/util.dart'; import '../../../wallets/crypto_currency/coins/mimblewimblecoin.dart'; import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; +import '../../../widgets/custom_buttons/simple_paste_button.dart'; +import '../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../widgets/desktop/primary_button.dart'; import '../../../widgets/desktop/secondary_button.dart'; import '../../../widgets/rounded_white_container.dart'; @@ -58,11 +60,10 @@ class _MwcSlatepackImportDialogState super.dispose(); } - void _pasteFromClipboard() async { + void _pasteFromClipboard(String? content) async { try { - final data = await widget.clipboard.getData(Clipboard.kTextPlain); - if (data?.text != null) { - slatepackController.text = data!.text!; + if (content != null) { + slatepackController.text = content; _validateSlatepack(); } } catch (e) { @@ -106,7 +107,7 @@ class _MwcSlatepackImportDialogState final String slatepackType = switch (analysis.status) { 'S1' => "S1 (Initial Send)", - 'S2' => "S2 (Response)", + 'S2' => "S2 (Response)", 'S3' => "S3 (Finalized)", _ => _determineSlatepackType(decoded), // Fallback. }; @@ -218,211 +219,190 @@ class _MwcSlatepackImportDialogState @override Widget build(BuildContext context) { - final isDesktop = - Platform.isLinux || Platform.isMacOS || Platform.isWindows; + final isDesktop = Util.isDesktop; final canProcess = _decodedSlatepack != null && !_isProcessing; - return StackDialogBase( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - // Header with title and close button. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Import Slatepack", + style: STextStyles.pageTitleH2(context), + ), + ), + DesktopDialogCloseButton( + onPressedOverride: () async { + if (!_isProcessing) { + Navigator.of(context).pop(); + } + }, + ), + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 32), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Text("Import Slatepack", style: STextStyles.pageTitleH2(context)), - AppBarIconButton( - size: 36, - color: Theme.of(context).extension()!.background, - shadows: const [], - icon: SvgPicture.asset( - Assets.svg.x, - color: - Theme.of( - context, - ).extension()!.topNavIconPrimary, - width: 24, - height: 24, - ), - onPressed: - _isProcessing ? null : () => Navigator.of(context).pop(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Enter a slatepack to process the transaction.", + style: STextStyles.subtitle(context), + textAlign: TextAlign.center, + ), + SimplePasteButton( + onPaste: _pasteFromClipboard, + clipboard: widget.clipboard, + ), + ], ), - ], - ), - const SizedBox(height: 16), - Padding( - padding: const EdgeInsets.all(24), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - "Paste or enter a slatepack to process the transaction.", - style: STextStyles.subtitle(context), - textAlign: TextAlign.center, + const SizedBox(height: 24), + + // Slatepack input field. + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, ), - const SizedBox(height: 24), + child: TextField( + controller: slatepackController, + focusNode: slatepackFocusNode, + maxLines: 8, + onChanged: (_) => _validateSlatepack(), + decoration: InputDecoration( + isDense: true, + contentPadding: const EdgeInsets.all(16), + hintStyle: STextStyles.fieldLabel(context), + hintText: "BEGINSLATEPACK...", + border: InputBorder.none, + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + ), + ), + ), - // Slatepack input field. - Container( - decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, - borderRadius: BorderRadius.circular(8), - border: Border.all( + // Validation status. + if (_validationError != null) ...[ + const SizedBox(height: 8), + Row( + children: [ + Icon( + Icons.error_outline, + size: 16, color: - Theme.of(context) - .extension()! - .textFieldDefaultSearchIconLeft, + Theme.of(context).extension()!.textError, ), - ), - child: TextField( - controller: slatepackController, - focusNode: slatepackFocusNode, - maxLines: 8, - onChanged: (_) => _validateSlatepack(), - decoration: InputDecoration( - hintText: "BEGINSLATEPACK...", - labelText: "Slatepack", - border: InputBorder.none, - contentPadding: const EdgeInsets.all(12), - suffixIcon: IconButton( - onPressed: _pasteFromClipboard, - icon: SvgPicture.asset( - Assets.svg.clipboard, - width: 16, - height: 16, + const SizedBox(width: 8), + Expanded( + child: Text( + _validationError!, + style: STextStyles.w400_14(context).copyWith( color: - Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, + Theme.of( + context, + ).extension()!.textError, ), ), ), - ), + ], ), - - // Validation status. - if (_validationError != null) ...[ - const SizedBox(height: 8), - Row( + ] else if (_decodedSlatepack != null) ...[ + const SizedBox(height: 8), + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - Icons.error_outline, - size: 16, - color: - Theme.of( - context, - ).extension()!.textError, - ), - const SizedBox(width: 8), - Expanded( - child: Text( - _validationError!, - style: STextStyles.w400_14(context).copyWith( + Row( + children: [ + Icon( + Icons.check_circle_outline, + size: 16, color: Theme.of( context, - ).extension()!.textError, + ).extension()!.accentColorGreen, ), - ), - ), - ], - ), - ] else if (_decodedSlatepack != null) ...[ - const SizedBox(height: 8), - RoundedWhiteContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Icon( - Icons.check_circle_outline, - size: 16, + const SizedBox(width: 8), + Text( + "Valid Slatepack", + style: STextStyles.label(context).copyWith( color: Theme.of( context, ).extension()!.accentColorGreen, ), - const SizedBox(width: 8), - Text( - "Valid Slatepack", - style: STextStyles.label(context).copyWith( - color: - Theme.of(context) - .extension()! - .accentColorGreen, - ), - ), - ], + ), + ], + ), + const SizedBox(height: 8), + Text( + "Type: $_slatepackType", + style: STextStyles.w400_14(context), + ), + if (_decodedSlatepack!.wasEncrypted == true) + Text( + "Encrypted: Yes", + style: STextStyles.w400_14(context), ), - const SizedBox(height: 8), + if (_decodedSlatepack!.senderAddress != null) Text( - "Type: $_slatepackType", + "From: ${_decodedSlatepack!.senderAddress}", style: STextStyles.w400_14(context), ), - if (_decodedSlatepack!.wasEncrypted == true) - Text( - "Encrypted: Yes", - style: STextStyles.w400_14(context), - ), - if (_decodedSlatepack!.senderAddress != null) - Text( - "From: ${_decodedSlatepack!.senderAddress}", - style: STextStyles.w400_14(context), - ), - ], - ), + ], ), - ], - - const SizedBox(height: 24), + ), + ], - // Action buttons. - if (isDesktop) ...[ - Row( - children: [ - Expanded( - child: SecondaryButton( - label: "Cancel", - onPressed: - _isProcessing - ? null - : () => Navigator.of(context).pop(), - ), + const SizedBox(height: 24), + + // Action buttons. + if (isDesktop) ...[ + Row( + children: [ + Expanded( + child: SecondaryButton( + label: "Cancel", + onPressed: + _isProcessing + ? null + : () => Navigator.of(context).pop(), ), - const SizedBox(width: 12), - Expanded( - child: PrimaryButton( - label: _isProcessing ? "Processing..." : "Process", - onPressed: canProcess ? _processSlatepack : null, - ), + ), + const SizedBox(width: 12), + Expanded( + child: PrimaryButton( + label: _isProcessing ? "Processing..." : "Process", + onPressed: canProcess ? _processSlatepack : null, ), - ], - ), - ] else ...[ - PrimaryButton( - label: - _isProcessing ? "Processing..." : "Process Slatepack", - onPressed: canProcess ? _processSlatepack : null, - ), - const SizedBox(height: 12), - SecondaryButton( - label: "Cancel", - onPressed: - _isProcessing - ? null - : () => Navigator.of(context).pop(), - ), - ], + ), + ], + ), + ] else ...[ + PrimaryButton( + label: _isProcessing ? "Processing..." : "Process Slatepack", + onPressed: canProcess ? _processSlatepack : null, + ), + const SizedBox(height: 12), + SecondaryButton( + label: "Cancel", + onPressed: + _isProcessing ? null : () => Navigator.of(context).pop(), + ), ], - ), + ], ), - ], - ), + ), + const SizedBox(height: 32), + ], ); } } 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 b907489d95..93dfdf56ae 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 @@ -55,6 +55,7 @@ import '../../../../widgets/custom_loading_overlay.dart'; import '../../../../widgets/desktop/desktop_dialog.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/desktop/secondary_button.dart'; +import '../../../../widgets/dialogs/s_dialog.dart'; import '../../../../widgets/icon_widgets/clipboard_icon.dart'; import '../../../../widgets/icon_widgets/x_icon.dart'; import '../../../../widgets/qr.dart'; @@ -822,12 +823,13 @@ class _DesktopReceiveState extends ConsumerState { await showDialog( context: context, builder: - (context) => DesktopDialog( - maxHeight: MediaQuery.of(context).size.height - 64, - maxWidth: 700, - child: MwcSlatepackImportDialog( - wallet: wallet as MimblewimblecoinWallet, - clipboard: widget.clipboard, + (context) => SDialog( + child: SizedBox( + width: 700, + child: MwcSlatepackImportDialog( + wallet: wallet as MimblewimblecoinWallet, + clipboard: widget.clipboard, + ), ), ), ); diff --git a/lib/widgets/custom_buttons/simple_paste_button.dart b/lib/widgets/custom_buttons/simple_paste_button.dart new file mode 100644 index 0000000000..4dfdf3c7b4 --- /dev/null +++ b/lib/widgets/custom_buttons/simple_paste_button.dart @@ -0,0 +1,60 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2025 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2025-09-16 + * + */ + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +import '../../themes/stack_colors.dart'; +import '../../utilities/assets.dart'; +import '../../utilities/clipboard_interface.dart'; +import '../../utilities/text_styles.dart'; +import '../../utilities/util.dart'; +import '../conditional_parent.dart'; + +class SimplePasteButton extends StatelessWidget { + const SimplePasteButton({ + super.key, + required this.onPaste, + this.clipboard = const ClipboardWrapper(), + }); + + final void Function(String?) onPaste; + final ClipboardInterface clipboard; + + @override + Widget build(BuildContext context) { + return ConditionalParent( + condition: Util.isDesktop, + builder: + (child) => + MouseRegion(cursor: SystemMouseCursors.click, child: child), + child: GestureDetector( + onTap: () async { + // TODO handle async better here!!!!!!!!!!!!!!!!!!!!!!!! + final data = await clipboard.getData(Clipboard.kTextPlain); + onPaste(data?.text); + }, + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.clipboard, + width: 10, + height: 10, + color: Theme.of(context).extension()!.infoItemIcons, + ), + const SizedBox(width: 4), + Text("Paste", style: STextStyles.link2(context)), + ], + ), + ), + ); + } +} From 8dec49d4238e018b6f345f82504693649a51108d Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 16 Sep 2025 15:36:36 -0500 Subject: [PATCH 064/178] fix(mwc): hide "Send to" field when Slatepack tx method selected it currently does nothing. MWC supports encrypted slatepacks when supplied with an address, but this isn't implemented yet. --- .../wallet_view/sub_widgets/desktop_send.dart | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) 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 732d0e05e4..aef8fa2e1a 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 @@ -1551,7 +1551,10 @@ class _DesktopSendState extends ConsumerState { ), ), const SizedBox(height: 20), - if (!isPaynymSend) + if (!isPaynymSend && + !(isMimblewimblecoin && + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack)) Text( "Send to", style: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -1562,8 +1565,15 @@ class _DesktopSendState extends ConsumerState { ), textAlign: TextAlign.left, ), - if (!isPaynymSend) const SizedBox(height: 10), - if (!isPaynymSend) + if (!isPaynymSend && + !(isMimblewimblecoin && + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack)) + const SizedBox(height: 10), + if (!isPaynymSend && + !(isMimblewimblecoin && + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack)) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -1742,7 +1752,10 @@ class _DesktopSendState extends ConsumerState { ), ), ), - if (!isPaynymSend) + if (!isPaynymSend && + !(isMimblewimblecoin && + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack)) Builder( builder: (_) { final String? error; @@ -1761,6 +1774,12 @@ class _DesktopSendState extends ConsumerState { } else { if (_data != null && _data.contactLabel == _address) { error = null; + } else if (coin is Mimblewimblecoin && + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack) { + // For MWC slatepack transactions, address validation is not required. + // TODO: When implementing encrypted slatepacks, address validation will be required. + error = null; } else if (!ref.watch(pValidSendToAddress)) { error = "Invalid address"; } else { From c7cfe6b23fda5821372fa8e4a7c7f7fbb6adf64b Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 16 Sep 2025 14:51:53 -0600 Subject: [PATCH 065/178] clean up bad copy pasted code --- .../sub_widgets/desktop_receive.dart | 137 ++++++------------ 1 file changed, 47 insertions(+), 90 deletions(-) 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 93dfdf56ae..382b1a3a96 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 @@ -33,7 +33,6 @@ import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; import '../../../../utilities/enums/derive_path_type_enum.dart'; import '../../../../utilities/enums/mwc_transaction_method.dart'; -import '../../../../utilities/logger.dart'; import '../../../../utilities/show_loading.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; @@ -88,69 +87,25 @@ class _DesktopReceiveState extends ConsumerState { late bool supportsMweb; late final bool showMultiType; late final bool isMimblewimblecoin; - late TextEditingController receiveSlateController; - String? _address; - bool _addressToggleFlag = false; - final _addressFocusNode = FocusNode(); + late TextEditingController _receiveSlateController; + String? _slate; + bool _slateToggleFlag = false; + final _slateFocusNode = FocusNode(); int _currentIndex = 0; - String? _note; final List _walletAddressTypes = []; final Map _addressMap = {}; final Map> _addressSubMap = {}; - Future pasteAddress() async { + Future _pasteSlatepack() async { final ClipboardData? data = await clipboard.getData(Clipboard.kTextPlain); if (data?.text != null && data!.text!.isNotEmpty) { - String content = data.text!.trim(); - if (content.contains("\n")) { - content = content.substring(0, content.indexOf("\n")); - } - - try { - final paymentData = AddressUtils.parsePaymentUri( - content, - logging: Logging.instance, - ); - if (paymentData != null && - paymentData.coin?.uriScheme == coin.uriScheme) { - _address = paymentData.address; - receiveSlateController.text = - ref.read(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack - ? "" - : _address!; - setState(() { - _addressToggleFlag = receiveSlateController.text.isNotEmpty; - }); - } else { - content = content.split("\n").first.trim(); - if (coin is Mimblewimblecoin) { - content = AddressUtils().formatAddressMwc(content); - } - - receiveSlateController.text = content; - _address = content; - - //_setValidAddressProviders(_address); - setState(() { - _addressToggleFlag = receiveSlateController.text.isNotEmpty; - }); - } - } catch (e) { - if (coin is Mimblewimblecoin) { - // strip http:// and https:// if content contains @ - content = AddressUtils().formatAddressMwc(content); - } - receiveSlateController.text = content; - _address = content; - // Trigger validation after pasting. - //_setValidAddressProviders(_address); - setState(() { - _addressToggleFlag = receiveSlateController.text.isNotEmpty; - }); - } + _slate = data.text; + _receiveSlateController.text = _slate!; + setState(() { + _slateToggleFlag = _receiveSlateController.text.isNotEmpty; + }); } } @@ -299,7 +254,7 @@ class _DesktopReceiveState extends ConsumerState { @override void initState() { - receiveSlateController = TextEditingController(); + _receiveSlateController = TextEditingController(); walletId = widget.walletId; coin = ref.read(pWalletInfo(walletId)).coin; clipboard = widget.clipboard; @@ -383,6 +338,7 @@ class _DesktopReceiveState extends ConsumerState { @override void dispose() { + _receiveSlateController.dispose(); for (final subscription in _addressSubMap.values) { subscription.cancel(); } @@ -697,8 +653,8 @@ class _DesktopReceiveState extends ConsumerState { child: TextField( minLines: 1, maxLines: 5, - key: const Key("sendViewAddressFieldKey"), - controller: receiveSlateController, + key: const Key("receiveViewSlatepackFieldKey"), + controller: _receiveSlateController, readOnly: false, autocorrect: false, enableSuggestions: false, @@ -709,14 +665,12 @@ class _DesktopReceiveState extends ConsumerState { selectAll: false, ), onChanged: (newValue) { - _address = newValue; - //_setValidAddressProviders(_address); - + _slate = newValue; setState(() { - _addressToggleFlag = newValue.isNotEmpty; + _slateToggleFlag = newValue.isNotEmpty; }); }, - focusNode: _addressFocusNode, + focusNode: _slateFocusNode, style: STextStyles.desktopTextExtraSmall(context).copyWith( color: Theme.of( @@ -726,7 +680,7 @@ class _DesktopReceiveState extends ConsumerState { ), decoration: standardInputDecoration( "Enter Slatepack Message", - _addressFocusNode, + _slateFocusNode, context, desktopMed: true, ).copyWith( @@ -737,34 +691,34 @@ class _DesktopReceiveState extends ConsumerState { ), suffixIcon: Padding( padding: - receiveSlateController.text.isEmpty + _receiveSlateController.text.isEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), child: UnconstrainedBox( child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - _addressToggleFlag + _slateToggleFlag ? TextFieldIconButton( key: const Key( - "sendViewClearAddressFieldButtonKey", + "receiveViewClearSlatepackFieldButtonKey", ), onTap: () { - receiveSlateController.text = ""; - _address = ""; + _receiveSlateController.text = ""; + _slate = ""; setState(() { - _addressToggleFlag = false; + _slateToggleFlag = false; }); }, child: const XIcon(), ) : TextFieldIconButton( key: const Key( - "sendViewPasteAddressFieldButtonKey", + "receiveViewPasteSlatepackFieldButtonKey", ), - onTap: pasteAddress, + onTap: _pasteSlatepack, child: - receiveSlateController.text.isEmpty + _receiveSlateController.text.isEmpty ? const ClipboardIcon() : const XIcon(), ), @@ -817,23 +771,26 @@ class _DesktopReceiveState extends ConsumerState { child: PrimaryButton( buttonHeight: ButtonHeight.l, label: "Receive Slatepack", - enabled: true, - onPressed: () async { - final wallet = ref.read(pWallets).getWallet(walletId); - await showDialog( - context: context, - builder: - (context) => SDialog( - child: SizedBox( - width: 700, - child: MwcSlatepackImportDialog( - wallet: wallet as MimblewimblecoinWallet, - clipboard: widget.clipboard, - ), - ), - ), - ); - }, + enabled: _slateToggleFlag, + onPressed: + _slateToggleFlag + ? () async { + final wallet = ref.read(pWallets).getWallet(walletId); + await showDialog( + context: context, + builder: + (context) => SDialog( + child: SizedBox( + width: 700, + child: MwcSlatepackImportDialog( + wallet: wallet as MimblewimblecoinWallet, + clipboard: widget.clipboard, + ), + ), + ), + ); + } + : null, ), ) else From 6ce184128bf7f612e4f44835f44b81bd67a039da Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 10:09:07 -0600 Subject: [PATCH 066/178] add detail divider widget --- lib/widgets/detail_item.dart | 133 +++++++++++++++++------------------ 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/lib/widgets/detail_item.dart b/lib/widgets/detail_item.dart index 13e8975d31..91a662538d 100644 --- a/lib/widgets/detail_item.dart +++ b/lib/widgets/detail_item.dart @@ -35,9 +35,9 @@ class DetailItem extends StatelessWidget { TextStyle detailStyle = STextStyles.w500_14(context); String _detail = detail; if (overrideDetailTextColor != null) { - detailStyle = STextStyles.w500_14(context).copyWith( - color: overrideDetailTextColor, - ); + detailStyle = STextStyles.w500_14( + context, + ).copyWith(color: overrideDetailTextColor); } if (detail.isEmpty && showEmptyDetail) { @@ -51,24 +51,14 @@ class DetailItem extends StatelessWidget { horizontal: horizontal, borderColor: borderColor, expandDetail: expandDetail, - title: disableSelectableText - ? Text( - title, - style: STextStyles.itemSubtitle(context), - ) - : SelectableText( - title, - style: STextStyles.itemSubtitle(context), - ), - detail: disableSelectableText - ? Text( - _detail, - style: detailStyle, - ) - : SelectableText( - _detail, - style: detailStyle, - ), + title: + disableSelectableText + ? Text(title, style: STextStyles.itemSubtitle(context)) + : SelectableText(title, style: STextStyles.itemSubtitle(context)), + detail: + disableSelectableText + ? Text(_detail, style: detailStyle) + : SelectableText(_detail, style: detailStyle), ); } } @@ -95,56 +85,65 @@ class DetailItemBase extends StatelessWidget { Widget build(BuildContext context) { return ConditionalParent( condition: !Util.isDesktop || borderColor != null, - builder: (child) => RoundedWhiteContainer( - padding: Util.isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - borderColor: borderColor, - child: child, - ), + builder: + (child) => RoundedWhiteContainer( + padding: + Util.isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + borderColor: borderColor, + child: child, + ), child: ConditionalParent( condition: Util.isDesktop && borderColor == null, - builder: (child) => Padding( - padding: const EdgeInsets.all(16), - child: child, - ), - child: horizontal - ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - title, - if (expandDetail) - const SizedBox( - width: 16, + builder: + (child) => Padding(padding: const EdgeInsets.all(16), child: child), + child: + horizontal + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + title, + if (expandDetail) const SizedBox(width: 16), + ConditionalParent( + condition: expandDetail, + builder: (child) => Expanded(child: child), + child: detail, + ), + ], + ) + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [title, button ?? Container()], ), - ConditionalParent( - condition: expandDetail, - builder: (child) => Expanded(child: child), - child: detail, - ), - ], - ) - : Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - title, - button ?? Container(), - ], - ), - const SizedBox( - height: 5, - ), - ConditionalParent( - condition: expandDetail, - builder: (child) => Expanded(child: child), - child: detail, - ), - ], - ), + const SizedBox(height: 5), + ConditionalParent( + condition: expandDetail, + builder: (child) => Expanded(child: child), + child: detail, + ), + ], + ), ), ); } } + +class DetailDivider extends StatelessWidget { + const DetailDivider({super.key}); + + @override + Widget build(BuildContext context) { + if (Util.isDesktop) { + return Container( + height: 1, + color: Theme.of(context).extension()!.backgroundAppBar, + ); + } else { + return const SizedBox(height: 12); + } + } +} From a57a72c7b9bea970efcbe9cbc3660cc5357bdb90 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 10:09:40 -0600 Subject: [PATCH 067/178] add toString functions to mwc slate response objects --- lib/models/mwc_slatepack_models.dart | 48 +++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/lib/models/mwc_slatepack_models.dart b/lib/models/mwc_slatepack_models.dart index f8a30fb3f5..8b5c05b832 100644 --- a/lib/models/mwc_slatepack_models.dart +++ b/lib/models/mwc_slatepack_models.dart @@ -14,6 +14,18 @@ class SlatepackResult { this.wasEncrypted, this.recipientAddress, }); + + @override + String toString() { + return "SlatepackResult(" + "success: $success, " + "error: $error, " + "slatepack: $slatepack, " + "slateJson: $slateJson, " + "wasEncrypted: $wasEncrypted, " + "recipientAddress: $recipientAddress" + ")"; + } } class SlatepackDecodeResult { @@ -32,6 +44,18 @@ class SlatepackDecodeResult { this.senderAddress, this.recipientAddress, }); + + @override + String toString() { + return "SlatepackDecodeResult(" + "success: $success, " + "error: $error, " + "slateJson: $slateJson, " + "wasEncrypted: $wasEncrypted, " + "senderAddress: $senderAddress, " + "recipientAddress: $recipientAddress" + ")"; + } } class ReceiveResult { @@ -52,6 +76,19 @@ class ReceiveResult { this.wasEncrypted, this.recipientAddress, }); + + @override + String toString() { + return "ReceiveResult(" + "success: $success, " + "error: $error, " + "slateId: $slateId, " + "commitId: $commitId, " + "responseSlatepack: $responseSlatepack, " + "wasEncrypted: $wasEncrypted, " + "recipientAddress: $recipientAddress" + ")"; + } } class FinalizeResult { @@ -66,5 +103,14 @@ class FinalizeResult { this.slateId, this.commitId, }); -} + @override + String toString() { + return "FinalizeResult(" + "success: $success, " + "error: $error, " + "slateId: $slateId, " + "commitId: $commitId" + ")"; + } +} From 63b1ac76fb390925fa76628ca70edc29e14e2137 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 10:11:03 -0600 Subject: [PATCH 068/178] desktop receive slatepack ui updates --- .../mwc_slatepack_import_dialog.dart | 416 +++++------------- .../sub_widgets/desktop_receive.dart | 404 ++++++++++------- 2 files changed, 352 insertions(+), 468 deletions(-) diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart index a8c6b3920b..161f46d8e4 100644 --- a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -5,30 +5,35 @@ import 'package:flutter_svg/flutter_svg.dart'; import '../../../models/mwc_slatepack_models.dart'; import '../../../notifications/show_flush_bar.dart'; +import '../../../providers/global/wallets_provider.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/assets.dart'; import '../../../utilities/clipboard_interface.dart'; -import '../../../utilities/constants.dart'; +import '../../../utilities/show_loading.dart'; import '../../../utilities/text_styles.dart'; import '../../../utilities/util.dart'; -import '../../../wallets/crypto_currency/coins/mimblewimblecoin.dart'; import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; +import '../../../widgets/conditional_parent.dart'; import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; -import '../../../widgets/custom_buttons/simple_paste_button.dart'; import '../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../widgets/desktop/primary_button.dart'; import '../../../widgets/desktop/secondary_button.dart'; +import '../../../widgets/detail_item.dart'; import '../../../widgets/rounded_white_container.dart'; import '../../../widgets/stack_dialog.dart'; class MwcSlatepackImportDialog extends ConsumerStatefulWidget { const MwcSlatepackImportDialog({ super.key, - required this.wallet, + required this.walletId, + required this.decoded, + required this.slatepackType, this.clipboard = const ClipboardWrapper(), }); - final MimblewimblecoinWallet wallet; + final String walletId; + final SlatepackDecodeResult decoded; + final String slatepackType; final ClipboardInterface clipboard; @override @@ -38,189 +43,78 @@ class MwcSlatepackImportDialog extends ConsumerStatefulWidget { class _MwcSlatepackImportDialogState extends ConsumerState { - late final TextEditingController slatepackController; - late final FocusNode slatepackFocusNode; + Future<({String responseSlatepack, bool wasEncrypted})> + _processSlatepack() async { + // add delay for showloading exception catching hack fix + await Future.delayed(const Duration(seconds: 1)); - bool _isProcessing = false; - String? _validationError; - SlatepackDecodeResult? _decodedSlatepack; - String? _slatepackType; + final slatepackText = widget.decoded.slateJson!; - @override - void initState() { - super.initState(); - slatepackController = TextEditingController(); - slatepackFocusNode = FocusNode(); - } - - @override - void dispose() { - slatepackController.dispose(); - slatepackFocusNode.dispose(); - super.dispose(); - } - - void _pasteFromClipboard(String? content) async { - try { - if (content != null) { - slatepackController.text = content; - _validateSlatepack(); - } - } catch (e) { - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Failed to paste from clipboard", - context: context, - ); - } - } - - void _validateSlatepack() async { - final text = slatepackController.text.trim(); + final wallet = + ref.read(pWallets).getWallet(widget.walletId) as MimblewimblecoinWallet; - if (text.isEmpty) { - setState(() { - _validationError = null; - _decodedSlatepack = null; - _slatepackType = null; - }); - return; - } - - // Basic format validation. - final coin = widget.wallet.cryptoCurrency as Mimblewimblecoin; - if (!coin.isSlatepack(text)) { - setState(() { - _validationError = "Invalid slatepack format"; - _decodedSlatepack = null; - _slatepackType = null; - }); - return; - } - - try { - // Attempt to decode. - final decoded = await widget.wallet.decodeSlatepack(text); + // Determine action based on slatepack type. + if (widget.slatepackType.contains("S1")) { + // This is an initial slatepack - receive it and create response. + final result = await wallet.receiveSlatepack(slatepackText); - if (decoded.success) { - final analysis = await widget.wallet.analyzeSlatepack(text); - - final String slatepackType = switch (analysis.status) { - 'S1' => "S1 (Initial Send)", - 'S2' => "S2 (Response)", - 'S3' => "S3 (Finalized)", - _ => _determineSlatepackType(decoded), // Fallback. - }; - - setState(() { - _validationError = null; - _decodedSlatepack = decoded; - _slatepackType = slatepackType; - }); + if (result.success && result.responseSlatepack != null) { + return ( + responseSlatepack: result.responseSlatepack!, + wasEncrypted: result.wasEncrypted ?? false, + ); } else { - setState(() { - _validationError = decoded.error ?? "Failed to decode slatepack"; - _decodedSlatepack = null; - _slatepackType = null; - }); + throw Exception(result.error ?? 'Failed to process slatepack'); } - } catch (e) { - setState(() { - _validationError = "Error decoding slatepack: $e"; - _decodedSlatepack = null; - _slatepackType = null; - }); - } - } - - String _determineSlatepackType(SlatepackDecodeResult decoded) { - // Fallback analysis based on sender/recipient addresses. - if (decoded.senderAddress != null && decoded.recipientAddress != null) { - return "S2 (Response)"; - } else if (decoded.senderAddress != null) { - return "S1 (Initial)"; } else { - return "Unknown"; + throw Exception('Unsupported slatepack type: ${widget.slatepackType}'); } } - void _processSlatepack() async { - if (_decodedSlatepack == null || slatepackController.text.trim().isEmpty) { - return; - } - - setState(() { - _isProcessing = true; - }); - - try { - final slatepackText = slatepackController.text.trim(); - - // Determine action based on slatepack type. - if (_slatepackType?.contains("S1") == true) { - // This is an initial slatepack - receive it and create response. - final result = await widget.wallet.receiveSlatepack(slatepackText); - - if (result.success && result.responseSlatepack != null) { - // Show response slatepack. - if (mounted) { - Navigator.of(context).pop(); // Close this dialog. - - await showDialog( - context: context, - barrierDismissible: false, - builder: - (context) => _SlatepackResponseDialog( - responseSlatepack: result.responseSlatepack!, - wasEncrypted: result.wasEncrypted ?? false, - clipboard: widget.clipboard, - ), - ); - } - } else { - throw Exception(result.error ?? 'Failed to process slatepack'); - } - } else if (_slatepackType?.contains("S2") == true) { - // This is a response slatepack - finalize it. - final result = await widget.wallet.finalizeSlatepack(slatepackText); - - if (result.success) { - if (mounted) { - Navigator.of(context).pop(); // Close this dialog. + Future _processPressed() async { + Exception? ex; + final result = await showLoading( + whileFuture: _processSlatepack(), + context: context, + message: "Processing slatepack...", + onException: (e) => ex = e, + ); - showFloatingFlushBar( - type: FlushBarType.success, - message: "Transaction finalized and broadcast successfully!", - context: context, - ); - } - } else { - throw Exception(result.error ?? 'Failed to finalize slatepack'); - } - } else { - throw Exception('Unsupported slatepack type: $_slatepackType'); - } - } catch (e) { + if (result == null || ex != null) { if (mounted) { - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Failed to process slatepack: $e", + await showDialog( context: context, + useRootNavigator: true, + builder: + (context) => StackOkDialog( + desktopPopRootNavigator: true, + maxWidth: Util.isDesktop ? 400 : null, + title: "Slatepack receive error", + message: + ex?.toString() ?? "Unexpected result without exception", + ), ); } - } finally { - if (mounted) { - setState(() { - _isProcessing = false; - }); - } + return; + } + + if (mounted) { + await showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => _SlatepackResponseDialog( + responseSlatepack: result.responseSlatepack, + wasEncrypted: result.wasEncrypted, + clipboard: widget.clipboard, + ), + ); } } @override Widget build(BuildContext context) { final isDesktop = Util.isDesktop; - final canProcess = _decodedSlatepack != null && !_isProcessing; return Column( mainAxisSize: MainAxisSize.min, @@ -236,13 +130,7 @@ class _MwcSlatepackImportDialogState style: STextStyles.pageTitleH2(context), ), ), - DesktopDialogCloseButton( - onPressedOverride: () async { - if (!_isProcessing) { - Navigator.of(context).pop(); - } - }, - ), + const DesktopDialogCloseButton(), ], ), Padding( @@ -251,153 +139,63 @@ class _MwcSlatepackImportDialogState mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Enter a slatepack to process the transaction.", - style: STextStyles.subtitle(context), - textAlign: TextAlign.center, - ), - SimplePasteButton( - onPaste: _pasteFromClipboard, - clipboard: widget.clipboard, - ), - ], - ), - const SizedBox(height: 24), - - // Slatepack input field. - ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - child: TextField( - controller: slatepackController, - focusNode: slatepackFocusNode, - maxLines: 8, - onChanged: (_) => _validateSlatepack(), - decoration: InputDecoration( - isDense: true, - contentPadding: const EdgeInsets.all(16), - hintStyle: STextStyles.fieldLabel(context), - hintText: "BEGINSLATEPACK...", - border: InputBorder.none, - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - ), - ), - ), - - // Validation status. - if (_validationError != null) ...[ - const SizedBox(height: 8), - Row( + ConditionalParent( + condition: isDesktop, + builder: (child) => RoundedWhiteContainer(child: child), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Icon( - Icons.error_outline, - size: 16, - color: - Theme.of(context).extension()!.textError, + DetailItem(title: "Type", detail: widget.slatepackType), + const DetailDivider(), + DetailItem( + title: "Encrypted", + detail: (widget.decoded.wasEncrypted ?? false).toString(), ), - const SizedBox(width: 8), - Expanded( - child: Text( - _validationError!, - style: STextStyles.w400_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textError, - ), + if (widget.decoded.senderAddress != null) + const DetailDivider(), + if (widget.decoded.senderAddress != null) + DetailItem( + title: "From", + detail: widget.decoded.senderAddress!, + ), + if (widget.decoded.recipientAddress != null) + const DetailDivider(), + if (widget.decoded.recipientAddress != null) + DetailItem( + title: "To", + detail: widget.decoded.recipientAddress!, ), + const DetailDivider(), + DetailItem( + title: "Slatepack", + detail: widget.decoded.slateJson!, ), ], ), - ] else if (_decodedSlatepack != null) ...[ - const SizedBox(height: 8), - RoundedWhiteContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Icon( - Icons.check_circle_outline, - size: 16, - color: - Theme.of( - context, - ).extension()!.accentColorGreen, - ), - const SizedBox(width: 8), - Text( - "Valid Slatepack", - style: STextStyles.label(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorGreen, - ), - ), - ], - ), - const SizedBox(height: 8), - Text( - "Type: $_slatepackType", - style: STextStyles.w400_14(context), - ), - if (_decodedSlatepack!.wasEncrypted == true) - Text( - "Encrypted: Yes", - style: STextStyles.w400_14(context), - ), - if (_decodedSlatepack!.senderAddress != null) - Text( - "From: ${_decodedSlatepack!.senderAddress}", - style: STextStyles.w400_14(context), - ), - ], - ), - ), - ], - + ), const SizedBox(height: 24), - - // Action buttons. - if (isDesktop) ...[ - Row( - children: [ - Expanded( - child: SecondaryButton( - label: "Cancel", - onPressed: - _isProcessing - ? null - : () => Navigator.of(context).pop(), - ), - ), - const SizedBox(width: 12), - Expanded( - child: PrimaryButton( - label: _isProcessing ? "Processing..." : "Process", - onPressed: canProcess ? _processSlatepack : null, - ), + ConditionalParent( + condition: isDesktop, + builder: + (child) => Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [child], ), - ], - ), - ] else ...[ - PrimaryButton( - label: _isProcessing ? "Processing..." : "Process Slatepack", - onPressed: canProcess ? _processSlatepack : null, + child: PrimaryButton( + width: isDesktop ? 220 : null, + + buttonHeight: isDesktop ? ButtonHeight.l : null, + label: "Process", + onPressed: _processPressed, ), - const SizedBox(height: 12), + ), + if (!isDesktop) const SizedBox(height: 12), + if (!isDesktop) SecondaryButton( label: "Cancel", - onPressed: - _isProcessing ? null : () => Navigator.of(context).pop(), + onPressed: Navigator.of(context).pop, ), - ], ], ), ), 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 382b1a3a96..80b358206a 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 @@ -20,6 +20,7 @@ import 'package:tuple/tuple.dart'; import '../../../../models/isar/models/isar_models.dart'; import '../../../../models/keys/view_only_wallet_data.dart'; +import '../../../../models/mwc_slatepack_models.dart'; import '../../../../notifications/show_flush_bar.dart'; import '../../../../pages/receive_view/generate_receiving_uri_qr_code_view.dart'; import '../../../../pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart'; @@ -59,6 +60,7 @@ import '../../../../widgets/icon_widgets/clipboard_icon.dart'; import '../../../../widgets/icon_widgets/x_icon.dart'; import '../../../../widgets/qr.dart'; import '../../../../widgets/rounded_white_container.dart'; +import '../../../../widgets/stack_dialog.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; import 'desktop_mwc_txs_method_toggle.dart'; @@ -109,6 +111,102 @@ class _DesktopReceiveState extends ConsumerState { } } + Future<({SlatepackDecodeResult result, String type})?> + _decodeSlatepack() async { + // add delay for showloading exception catching hack fix + await Future.delayed(const Duration(seconds: 1)); + + final wallet = + ref.read(pWallets).getWallet(walletId) as MimblewimblecoinWallet; + final text = _receiveSlateController.text.trim(); + + if (text.isEmpty) { + return null; + } + + // Basic format validation. + final coin = wallet.cryptoCurrency as Mimblewimblecoin; + if (!coin.isSlatepack(text)) { + throw Exception("Invalid slatepack format"); + } + + // Attempt to decode. + final decoded = await wallet.decodeSlatepack(text); + + if (decoded.success) { + final analysis = await wallet.analyzeSlatepack(text); + + String _determineSlatepackType(SlatepackDecodeResult decoded) { + // Fallback analysis based on sender/recipient addresses. + if (decoded.senderAddress != null && decoded.recipientAddress != null) { + return "S2 (Response)"; + } else if (decoded.senderAddress != null) { + return "S1 (Initial)"; + } else { + return "Unknown"; + } + } + + final String slatepackType = switch (analysis.status) { + 'S1' => "S1 (Initial Send)", + 'S2' => "S2 (Response)", + 'S3' => "S3 (Finalized)", + _ => _determineSlatepackType(decoded), // Fallback. + }; + + return (result: decoded, type: slatepackType); + } else { + throw Exception(decoded.error ?? "Failed to decode slatepack"); + } + } + + Future _onReceiveSlatePressed() async { + Exception? ex; + final result = await showLoading( + whileFuture: _decodeSlatepack(), + context: context, + message: "Decoding slatepack...", + rootNavigator: Util.isDesktop, + onException: (e) => ex = e, + ); + + if (result == null || ex != null) { + if (mounted) { + await showDialog( + context: context, + useRootNavigator: true, + builder: + (context) => StackOkDialog( + desktopPopRootNavigator: true, + title: "Slatepack receive error", + message: + ex?.toString() ?? "Unexpected result without exception", + maxWidth: 400, + ), + ); + } + return; + } + + if (mounted) { + await showDialog( + context: context, + builder: + (context) => SDialog( + child: SizedBox( + width: 700, + child: MwcSlatepackImportDialog( + walletId: widget.walletId, + clipboard: widget.clipboard, + decoded: result.result, + slatepackType: result.type, + ), + ), + ), + ); + } + } + Future generateNewAddress() async { final wallet = ref.read(pWallets).getWallet(walletId); if (wallet is MultiAddressInterface) { @@ -452,165 +550,171 @@ class _DesktopReceiveState extends ConsumerState { ), ), ), - const SizedBox(height: 20), - ConditionalParent( - condition: showMultiType, - builder: - (child) => Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - DropdownButtonHideUnderline( - child: DropdownButton2( - value: _currentIndex, - items: [ - for (int i = 0; i < _walletAddressTypes.length; i++) - DropdownMenuItem( - value: i, - child: Text( - supportsSpark && - _walletAddressTypes[i] == - AddressType.p2pkh - ? "Transparent address" - : "${_walletAddressTypes[i].readableName} address", - style: STextStyles.w500_14(context), + if (!(isMimblewimblecoin && + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack)) + const SizedBox(height: 20), + if (!(isMimblewimblecoin && + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack)) + ConditionalParent( + condition: showMultiType, + builder: + (child) => Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + DropdownButtonHideUnderline( + child: DropdownButton2( + value: _currentIndex, + items: [ + for (int i = 0; i < _walletAddressTypes.length; i++) + DropdownMenuItem( + value: i, + child: Text( + supportsSpark && + _walletAddressTypes[i] == + AddressType.p2pkh + ? "Transparent address" + : "${_walletAddressTypes[i].readableName} address", + style: STextStyles.w500_14(context), + ), + ), + ], + onChanged: (value) { + if (value != null && value != _currentIndex) { + setState(() { + _currentIndex = value; + }); + } + }, + isExpanded: true, + iconStyleData: IconStyleData( + icon: Padding( + padding: const EdgeInsets.only(right: 10), + child: SvgPicture.asset( + Assets.svg.chevronDown, + width: 12, + height: 6, + color: + Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, ), ), - ], - onChanged: (value) { - if (value != null && value != _currentIndex) { - setState(() { - _currentIndex = value; - }); - } - }, - isExpanded: true, - iconStyleData: IconStyleData( - icon: Padding( - padding: const EdgeInsets.only(right: 10), - child: SvgPicture.asset( - Assets.svg.chevronDown, - width: 12, - height: 6, + ), + buttonStyleData: ButtonStyleData( + decoration: BoxDecoration( color: - Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, + Theme.of( + context, + ).extension()!.textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), ), ), - ), - buttonStyleData: ButtonStyleData( - decoration: 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, + ), ), ), - ), - 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, ), ), ), - menuItemStyleData: const MenuItemStyleData( - padding: EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - ), ), - ), - const SizedBox(height: 12), - child, - ], - ), - child: MouseRegion( - cursor: SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - clipboard.setData(ClipboardData(text: address)); - showFloatingFlushBar( - type: FlushBarType.info, - message: "Copied to clipboard", - iconAsset: Assets.svg.copy, - context: context, - ); - }, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: - Theme.of( - context, - ).extension()!.backgroundAppBar, - width: 1, - ), - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), + const SizedBox(height: 12), + child, + ], ), - child: RoundedWhiteContainer( - child: Column( - children: [ - Row( - children: [ - Text( - "Your ${widget.contractAddress == null ? coin.ticker : ref.watch(pCurrentTokenWallet.select((value) => value!.tokenContract.symbol))} address", - style: STextStyles.itemSubtitle(context), - ), - const Spacer(), - Row( - children: [ - SvgPicture.asset( - Assets.svg.copy, - width: 15, - height: 15, - color: - Theme.of( - context, - ).extension()!.infoItemIcons, - ), - const SizedBox(width: 4), - Text("Copy", style: STextStyles.link2(context)), - ], - ), - ], - ), - const SizedBox(height: 8), - Row( - children: [ - Expanded( - child: Text( - address, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark, + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + onTap: () { + clipboard.setData(ClipboardData(text: address)); + showFloatingFlushBar( + type: FlushBarType.info, + message: "Copied to clipboard", + iconAsset: Assets.svg.copy, + context: context, + ); + }, + child: Container( + decoration: BoxDecoration( + border: Border.all( + color: + Theme.of( + context, + ).extension()!.backgroundAppBar, + width: 1, + ), + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + child: RoundedWhiteContainer( + child: Column( + children: [ + Row( + children: [ + Text( + "Your ${widget.contractAddress == null ? coin.ticker : ref.watch(pCurrentTokenWallet.select((value) => value!.tokenContract.symbol))} address", + style: STextStyles.itemSubtitle(context), + ), + const Spacer(), + Row( + children: [ + SvgPicture.asset( + Assets.svg.copy, + width: 15, + height: 15, + color: + Theme.of( + context, + ).extension()!.infoItemIcons, + ), + const SizedBox(width: 4), + Text("Copy", style: STextStyles.link2(context)), + ], + ), + ], + ), + const SizedBox(height: 8), + Row( + children: [ + Expanded( + child: Text( + address, + style: STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ).extension()!.textDark, + ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), ), ), ), - ), if (canGen) const SizedBox(height: 20), @@ -772,25 +876,7 @@ class _DesktopReceiveState extends ConsumerState { buttonHeight: ButtonHeight.l, label: "Receive Slatepack", enabled: _slateToggleFlag, - onPressed: - _slateToggleFlag - ? () async { - final wallet = ref.read(pWallets).getWallet(walletId); - await showDialog( - context: context, - builder: - (context) => SDialog( - child: SizedBox( - width: 700, - child: MwcSlatepackImportDialog( - wallet: wallet as MimblewimblecoinWallet, - clipboard: widget.clipboard, - ), - ), - ), - ); - } - : null, + onPressed: _slateToggleFlag ? _onReceiveSlatePressed : null, ), ) else From 382f6b50afece5d3df418d956a70e816a6974087 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 10:45:29 -0600 Subject: [PATCH 069/178] desktop finalize slatepack ui updates and garbage clean up --- .../sub_widgets/desktop_finalize.dart | 268 ++++++------------ 1 file changed, 83 insertions(+), 185 deletions(-) diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart index c425f79e7a..78de9654bd 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart @@ -13,29 +13,20 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; -import '../../../../models/isar/models/isar_models.dart'; -import '../../../../pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart'; +import '../../../../notifications/show_flush_bar.dart'; import '../../../../providers/providers.dart'; import '../../../../themes/stack_colors.dart'; -import '../../../../utilities/address_utils.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; -import '../../../../utilities/logger.dart'; +import '../../../../utilities/show_loading.dart'; import '../../../../utilities/text_styles.dart'; -import '../../../../wallets/crypto_currency/crypto_currency.dart'; -import '../../../../wallets/isar/providers/wallet_info_provider.dart'; -import '../../../../wallets/wallet/impl/bitcoin_wallet.dart'; +import '../../../../utilities/util.dart'; import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; -import '../../../../wallets/wallet/intermediate/bip39_hd_wallet.dart'; -import '../../../../wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart'; -import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; -import '../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; -import '../../../../widgets/desktop/desktop_dialog.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/icon_widgets/clipboard_icon.dart'; import '../../../../widgets/icon_widgets/x_icon.dart'; +import '../../../../widgets/stack_dialog.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; @@ -43,12 +34,10 @@ class DesktopFinalize extends ConsumerStatefulWidget { const DesktopFinalize({ super.key, required this.walletId, - this.contractAddress, this.clipboard = const ClipboardWrapper(), }); final String walletId; - final String? contractAddress; final ClipboardInterface clipboard; @override @@ -56,156 +45,94 @@ class DesktopFinalize extends ConsumerStatefulWidget { } class _DesktopFinalizeState extends ConsumerState { - late final CryptoCurrency coin; - late final String walletId; - late final ClipboardInterface clipboard; - late final bool supportsSpark; - late final bool showMultiType; - late final bool isMimblewimblecoin; - late TextEditingController receiveSlateController; - String? _address; - bool _addressToggleFlag = false; - final _addressFocusNode = FocusNode(); + late TextEditingController _slateController; + final _slateFocusNode = FocusNode(); + bool _slateToggleFlag = false; - int _currentIndex = 0; - String? _selectedMethodMwc; // Variable to store selected dropdown value - String? _note; - - final List _walletAddressTypes = []; - final Map _addressMap = {}; - final Map> _addressSubMap = {}; - - Future pasteAddress() async { - final ClipboardData? data = await clipboard.getData(Clipboard.kTextPlain); + Future _pasteSlatepack() async { + final ClipboardData? data = await widget.clipboard.getData( + Clipboard.kTextPlain, + ); if (data?.text != null && data!.text!.isNotEmpty) { - String content = data.text!.trim(); - if (content.contains("\n")) { - content = content.substring(0, content.indexOf("\n")); - } - - try { - final paymentData = AddressUtils.parsePaymentUri( - content, - logging: Logging.instance, - ); - if (paymentData != null && - paymentData.coin?.uriScheme == coin.uriScheme) { - _address = paymentData.address; - receiveSlateController.text = _address!; - setState(() { - _addressToggleFlag = receiveSlateController.text.isNotEmpty; - }); - } else { - content = content.split("\n").first.trim(); - if (coin is Mimblewimblecoin) { - content = AddressUtils().formatAddressMwc(content); - } - - receiveSlateController.text = content; - _address = content; - - //_setValidAddressProviders(_address); - setState(() { - _addressToggleFlag = receiveSlateController.text.isNotEmpty; - }); - } - } catch (e) { - if (coin is Mimblewimblecoin) { - // strip http:// and https:// if content contains @ - content = AddressUtils().formatAddressMwc(content); - } - receiveSlateController.text = content; - _address = content; - // Trigger validation after pasting. - //_setValidAddressProviders(_address); - setState(() { - _addressToggleFlag = receiveSlateController.text.isNotEmpty; - }); - } + _slateController.text = data.text!; + setState(() { + _slateToggleFlag = _slateController.text.isNotEmpty; + }); } } - @override - void initState() { - receiveSlateController = TextEditingController(); - walletId = widget.walletId; - coin = ref.read(pWalletInfo(walletId)).coin; - clipboard = widget.clipboard; - final wallet = ref.read(pWallets).getWallet(walletId); - supportsSpark = ref.read(pWallets).getWallet(walletId) is SparkInterface; + Future _finalize() async { + // add delay for showloading exception catching hack fix + await Future.delayed(const Duration(seconds: 1)); - isMimblewimblecoin = wallet is MimblewimblecoinWallet; - if (isMimblewimblecoin) { - _selectedMethodMwc = "Slatepack"; - } - debugPrint("Address generated: $isMimblewimblecoin"); + final wallet = + ref.read(pWallets).getWallet(widget.walletId) as MimblewimblecoinWallet; - if (wallet is ViewOnlyOptionInterface && wallet.isViewOnly) { - showMultiType = false; - } else { - showMultiType = - supportsSpark || - (wallet is! BCashInterface && - wallet is Bip39HDWallet && - wallet.supportedAddressTypes.length > 1); + final decoded = await wallet.decodeSlatepack(_slateController.text); + if (!decoded.success) { + throw Exception(decoded.error ?? "Failed to decode slatepack"); } - _walletAddressTypes.add(wallet.info.mainAddressType); - - if (showMultiType) { - if (supportsSpark) { - _walletAddressTypes.insert(0, AddressType.spark); - } else { - _walletAddressTypes.addAll( - (wallet as Bip39HDWallet).supportedAddressTypes.where( - (e) => e != wallet.info.mainAddressType, - ), - ); - } + final analysis = await wallet.analyzeSlatepack(_slateController.text); + if (analysis.status != "S2") { + throw Exception("Invalid slatepack type: ${analysis.status}"); } - if (_walletAddressTypes.length > 1 && wallet is BitcoinWallet) { - _walletAddressTypes.removeWhere((e) => e == AddressType.p2pkh); + final result = await wallet.finalizeSlatepack(_slateController.text); + + if (!result.success) { + throw Exception( + result.error ?? "Finalize failed without providing an error???", + ); } + } - _addressMap[_walletAddressTypes[_currentIndex]] = ref.read( - pWalletReceivingAddress(walletId), + Future _finalizePressed() async { + Exception? ex; + await showLoading( + whileFuture: _finalize(), + context: context, + message: "Finalizing slatepack...", + rootNavigator: Util.isDesktop, + onException: (e) => ex = e, ); - if (showMultiType) { - for (final type in _walletAddressTypes) { - _addressSubMap[type] = ref - .read(mainDBProvider) - .isar - .addresses - .where() - .walletIdEqualTo(walletId) - .filter() - .typeEqualTo(type) - .sortByDerivationIndexDesc() - .findFirst() - .asStream() - .listen((event) { - WidgetsBinding.instance.addPostFrameCallback((_) { - if (mounted) { - setState(() { - _addressMap[type] = - event?.value ?? _addressMap[type] ?? "[No address yet]"; - }); - } - }); - }); + if (mounted) { + if (ex != null) { + await showDialog( + context: context, + useRootNavigator: true, + builder: + (context) => StackOkDialog( + desktopPopRootNavigator: true, + title: "Slatepack finalize error", + message: + ex?.toString() ?? "Unexpected result without exception", + maxWidth: 400, + ), + ); + } else { + unawaited( + showFloatingFlushBar( + type: FlushBarType.success, + message: "Transaction finalized and broadcast successfully!", + context: context, + ), + ); } } + } + @override + void initState() { + _slateController = TextEditingController(); super.initState(); } @override void dispose() { - for (final subscription in _addressSubMap.values) { - subscription.cancel(); - } + _slateController.dispose(); + _slateFocusNode.dispose(); super.dispose(); } @@ -213,17 +140,6 @@ class _DesktopFinalizeState extends ConsumerState { Widget build(BuildContext context) { debugPrint("BUILD: $runtimeType"); - final String address; - if (showMultiType) { - address = _addressMap[_walletAddressTypes[_currentIndex]]!; - } else { - address = ref.watch(pWalletReceivingAddress(walletId)); - } - - final wallet = ref.watch( - pWallets.select((value) => value.getWallet(walletId)), - ); - return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ @@ -232,7 +148,6 @@ class _DesktopFinalizeState extends ConsumerState { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Label Text Text( "Finalize Slatepack", style: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -251,8 +166,8 @@ class _DesktopFinalizeState extends ConsumerState { child: TextField( minLines: 1, maxLines: 5, - key: const Key("sendViewAddressFieldKey"), - controller: receiveSlateController, + key: const Key("finalizeSlatepackFieldKey"), + controller: _slateController, readOnly: false, autocorrect: false, enableSuggestions: false, @@ -263,14 +178,11 @@ class _DesktopFinalizeState extends ConsumerState { selectAll: false, ), onChanged: (newValue) { - _address = newValue; - //_setValidAddressProviders(_address); - setState(() { - _addressToggleFlag = newValue.isNotEmpty; + _slateToggleFlag = newValue.isNotEmpty; }); }, - focusNode: _addressFocusNode, + focusNode: _slateFocusNode, style: STextStyles.desktopTextExtraSmall(context).copyWith( color: Theme.of( @@ -280,7 +192,7 @@ class _DesktopFinalizeState extends ConsumerState { ), decoration: standardInputDecoration( "Enter Final Slatepack Message", - _addressFocusNode, + _slateFocusNode, context, desktopMed: true, ).copyWith( @@ -291,34 +203,33 @@ class _DesktopFinalizeState extends ConsumerState { ), suffixIcon: Padding( padding: - receiveSlateController.text.isEmpty + _slateController.text.isEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), child: UnconstrainedBox( child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - _addressToggleFlag + _slateToggleFlag ? TextFieldIconButton( key: const Key( - "sendViewClearAddressFieldButtonKey", + "slateFinalizeClearFieldButtonKey", ), onTap: () { - receiveSlateController.text = ""; - _address = ""; + _slateController.text = ""; setState(() { - _addressToggleFlag = false; + _slateToggleFlag = false; }); }, child: const XIcon(), ) : TextFieldIconButton( key: const Key( - "sendViewPasteAddressFieldButtonKey", + "slateFinalizePasteFieldButtonKey", ), - onTap: pasteAddress, + onTap: _pasteSlatepack, child: - receiveSlateController.text.isEmpty + _slateController.text.isEmpty ? const ClipboardIcon() : const XIcon(), ), @@ -338,20 +249,7 @@ class _DesktopFinalizeState extends ConsumerState { buttonHeight: ButtonHeight.l, label: "Finalize Slatepack", enabled: true, - onPressed: () async { - final wallet = ref.read(pWallets).getWallet(walletId); - await showDialog( - context: context, - builder: - (context) => DesktopDialog( - maxHeight: MediaQuery.of(context).size.height - 64, - maxWidth: 700, - child: MwcSlatepackImportDialog( - wallet: wallet as MimblewimblecoinWallet, - ), - ), - ); - }, + onPressed: _finalizePressed, ), ), ], From faa7b70ecd7e7bce8d5024f831486aa09942a5fd Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 12:59:49 -0600 Subject: [PATCH 070/178] fix cancelling progress dialog width on desktop --- ...ancelling_transaction_progress_dialog.dart | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) 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 f1824d17e6..da9c45a68f 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 @@ -9,7 +9,10 @@ */ import 'package:flutter/material.dart'; + +import '../../../../utilities/util.dart'; import '../../../../widgets/animated_widgets/rotating_arrows.dart'; +import '../../../../widgets/conditional_parent.dart'; import '../../../../widgets/stack_dialog.dart'; class CancellingTransactionProgressDialog extends StatefulWidget { @@ -28,28 +31,33 @@ class _CancellingTransactionProgressDialogState onWillPop: () async { return false; }, - child: const StackDialog( - title: "Cancelling transaction", - message: "This may take a while. Please do not exit this screen.", - icon: RotatingArrows( - width: 24, - height: 24, + child: ConditionalParent( + condition: Util.isDesktop, + builder: + (child) => Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [SizedBox(width: 400, child: child)], + ), + child: const StackDialog( + title: "Cancelling transaction", + message: "This may take a while. Please do not exit this screen.", + icon: RotatingArrows(width: 24, height: 24), + // rightButton: TextButton( + // style: Theme.of(context).textButtonTheme.style?.copyWith( + // backgroundColor: MaterialStateProperty.all( + // CFColors.buttonGray, + // ), + // ), + // child: Text( + // "Cancel", + // style: STextStyles.itemSubtitle12(context), + // ), + // onPressed: () { + // Navigator.of(context).pop(); + // onCancel.call(); + // }, + // ), ), - // rightButton: TextButton( - // style: Theme.of(context).textButtonTheme.style?.copyWith( - // backgroundColor: MaterialStateProperty.all( - // CFColors.buttonGray, - // ), - // ), - // child: Text( - // "Cancel", - // style: STextStyles.itemSubtitle12(context), - // ), - // onPressed: () { - // Navigator.of(context).pop(); - // onCancel.call(); - // }, - // ), ), ); } From 8a9816adc87a8806f47c754e60b5b008412c7c68 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 13:40:36 -0600 Subject: [PATCH 071/178] add border styling for desktop --- .../sub_widgets/mwc_slatepack_import_dialog.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart index 161f46d8e4..6dd7289512 100644 --- a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -141,7 +141,17 @@ class _MwcSlatepackImportDialogState children: [ ConditionalParent( condition: isDesktop, - builder: (child) => RoundedWhiteContainer(child: child), + builder: + (child) => RoundedWhiteContainer( + borderColor: + isDesktop + ? Theme.of( + context, + ).extension()!.backgroundAppBar + : null, + padding: const EdgeInsets.all(0), + child: child, + ), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, From 23cbfb38500da46fbeb63c8630a75bb53b2feab1 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 13:40:56 -0600 Subject: [PATCH 072/178] selectable message text --- lib/widgets/stack_dialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/stack_dialog.dart b/lib/widgets/stack_dialog.dart index f601330b6f..2c56aa7c03 100644 --- a/lib/widgets/stack_dialog.dart +++ b/lib/widgets/stack_dialog.dart @@ -180,7 +180,7 @@ class StackOkDialog extends StatelessWidget { child: Row( children: [ Flexible( - child: Text( + child: SelectableText( message!, style: STextStyles.smallMed14(context), ), From 63509e62080960b5977ecfda589385b711c3f9a9 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 13:41:26 -0600 Subject: [PATCH 073/178] refactor desktop send slate creation --- .../wallet_view/sub_widgets/desktop_send.dart | 87 ++++++++++--------- 1 file changed, 46 insertions(+), 41 deletions(-) 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 aef8fa2e1a..6ae236aa19 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 @@ -20,6 +20,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import '../../../../models/isar/models/blockchain_data/address.dart'; import '../../../../models/isar/models/blockchain_data/utxo.dart'; import '../../../../models/isar/models/contact_entry.dart'; +import '../../../../models/mwc_slatepack_models.dart'; import '../../../../models/paynym/paynym_account_lite.dart'; import '../../../../models/send_view_auto_fill_data.dart'; import '../../../../pages/send_view/confirm_transaction_view.dart'; @@ -44,6 +45,7 @@ import '../../../../utilities/constants.dart'; import '../../../../utilities/enums/mwc_transaction_method.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/prefs.dart'; +import '../../../../utilities/show_loading.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; import '../../../../wallets/crypto_currency/crypto_currency.dart'; @@ -172,41 +174,46 @@ class _DesktopSendState extends ConsumerState { try { final amount = ref.read(pSendAmount)!; - // Show building dialog. - unawaited( - showDialog( - context: context, - barrierDismissible: false, - builder: - (context) => BuildingTransactionDialog( - coin: coin, - onCancel: () { - // Use maybePop so we never accidentally pop the base route - // if the dialog hasn't fully mounted yet. - Navigator.of(context, rootNavigator: true).maybePop(); - }, - isSpark: false, - ), - ), - ); + Future wrappedFutureWithDelay() async { + await Future.delayed(const Duration(seconds: 1)); + return wallet.createSlatepack( + amount: amount, + recipientAddress: null, // No specific recipient for manual slatepack. + message: _onChainNote?.isNotEmpty == true ? _onChainNote : null, + encrypt: false, // No encryption without recipient address. + ); + } // Create slatepack. - final slatepackResult = await wallet.createSlatepack( - amount: amount, - recipientAddress: null, // No specific recipient for manual slatepack. - message: _onChainNote?.isNotEmpty == true ? _onChainNote : null, - encrypt: false, // No encryption without recipient address. + Exception? ex; + final slatepackResult = await showLoading( + whileFuture: wrappedFutureWithDelay(), + context: context, + rootNavigator: true, + message: "Building slatepack...", + delay: const Duration(seconds: 2), + onException: (e) => ex = e, ); - // Close building dialog if present. Use maybePop to avoid popping the - // underlying page route in case the dialog hasn't mounted yet. - if (mounted) { - await Navigator.of(context, rootNavigator: true).maybePop(); + if (slatepackResult == null || + !slatepackResult.success || + slatepackResult.slatepack == null || + ex != null) { + String error = + ex?.toString() ?? + slatepackResult?.error ?? + 'Failed to create slatepack'; + if (error.startsWith("Exception:")) { + error = error.replaceFirst("Exception:", "").trim(); + } + throw Exception(error); } - if (!slatepackResult.success || slatepackResult.slatepack == null) { - throw Exception(slatepackResult.error ?? 'Failed to create slatepack'); - } + // refresh asap to show the pending slate tx in history + unawaited(() async { + await Future.delayed(Duration.zero); + await wallet.refresh(); + }()); // Show slatepack dialog. if (mounted) { @@ -215,7 +222,7 @@ class _DesktopSendState extends ConsumerState { barrierDismissible: false, builder: (context) => DesktopDialog( - maxHeight: MediaQuery.of(context).size.height - 64, + maxHeight: double.infinity, maxWidth: 700, child: MwcSlatepackDialog(slatepackResult: slatepackResult), ), @@ -225,13 +232,11 @@ class _DesktopSendState extends ConsumerState { clearSendForm(); } } catch (e, s) { - Logging.instance.e('Failed to create MWC slatepack on desktop: $e\n$s'); - - // Close building dialog if still open. maybePop prevents popping the - // page route if the dialog wasn't pushed yet. - if (mounted) { - await Navigator.of(context, rootNavigator: true).maybePop(); - } + Logging.instance.e( + 'Failed to create MWC slatepack on desktop', + error: e, + stackTrace: s, + ); if (mounted) { await showDialog( @@ -619,8 +624,8 @@ class _DesktopSendState extends ConsumerState { txData = txData.copyWith(noteOnChain: _onChainNote ?? ""); } } - // Close building dialog if present without risking popping the page. - await Navigator.of(context, rootNavigator: true).maybePop(); + // pop building dialog + Navigator.of(context, rootNavigator: true).pop(); unawaited( showDialog( @@ -643,8 +648,8 @@ class _DesktopSendState extends ConsumerState { } catch (e, s) { Logging.instance.e("Desktop send: ", error: e, stackTrace: s); if (mounted) { - // Close building dialog if present without risking popping the page. - await Navigator.of(context, rootNavigator: true).maybePop(); + // pop building dialog + Navigator.of(context, rootNavigator: true).pop(); unawaited( showDialog( From 16afdfcefa636042b6edfdd5a2b55f7d82e050a8 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 13:41:53 -0600 Subject: [PATCH 074/178] fix ok dialog width on desktop --- .../transaction_details_view.dart | 14 +++++++++++--- .../tx_v2/transaction_v2_details_view.dart | 12 ++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) 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 ca997e70b6..e1b2c89f0e 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -1587,6 +1587,10 @@ class _TransactionDetailsViewState "Could not open in block explorer", message: "Failed to open \"${uri.toString()}\"", + maxWidth: + Util.isDesktop + ? 400 + : null, ), ), ); @@ -1820,6 +1824,7 @@ class _TransactionDetailsViewState final result = await wallet .cancelPendingTransactionAndPost(id); + if (context.mounted) { // pop progress dialog Navigator.of(context).pop(); @@ -1830,8 +1835,8 @@ class _TransactionDetailsViewState builder: (_) => StackOkDialog( title: "Transaction cancelled", + maxWidth: Util.isDesktop ? 400 : null, onOkPressed: (_) { - wallet.refresh(); Navigator.of(context).popUntil( ModalRoute.withName( WalletView.routeName, @@ -1847,6 +1852,7 @@ class _TransactionDetailsViewState (_) => StackOkDialog( title: "Failed to cancel transaction", message: result, + maxWidth: Util.isDesktop ? 400 : null, ), ); } @@ -1876,7 +1882,8 @@ class _TransactionDetailsViewState final result = await wallet .cancelPendingTransactionAndPost(id); - if (mounted) { + + if (context.mounted) { // pop progress dialog Navigator.of(context).pop(); @@ -1886,8 +1893,8 @@ class _TransactionDetailsViewState builder: (_) => StackOkDialog( title: "Transaction cancelled", + maxWidth: Util.isDesktop ? 400 : null, onOkPressed: (_) { - wallet.refresh(); Navigator.of(context).popUntil( ModalRoute.withName( WalletView.routeName, @@ -1903,6 +1910,7 @@ class _TransactionDetailsViewState (_) => StackOkDialog( title: "Failed to cancel transaction", message: result, + maxWidth: Util.isDesktop ? 400 : null, ), ); } diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index c7ef4cacb6..c971e53438 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -2157,6 +2157,10 @@ class _TransactionV2DetailsViewState "Could not open in block explorer", message: "Failed to open \"${uri.toString()}\"", + maxWidth: + Util.isDesktop + ? 400 + : null, ), ), ); @@ -2414,15 +2418,16 @@ class _TransactionV2DetailsViewState (_) => StackOkDialog( title: "Transaction cancelled", onOkPressed: (_) { - wallet.refresh(); Navigator.of(context).popUntil( ModalRoute.withName( WalletView.routeName, ), ); }, + maxWidth: Util.isDesktop ? 400 : null, ), ); + unawaited(wallet.refresh()); } else { await showDialog( context: context, @@ -2430,6 +2435,7 @@ class _TransactionV2DetailsViewState (_) => StackOkDialog( title: "Failed to cancel transaction", message: result, + maxWidth: Util.isDesktop ? 400 : null, ), ); } @@ -2470,15 +2476,16 @@ class _TransactionV2DetailsViewState (_) => StackOkDialog( title: "Transaction cancelled", onOkPressed: (_) { - wallet.refresh(); Navigator.of(context).popUntil( ModalRoute.withName( WalletView.routeName, ), ); }, + maxWidth: Util.isDesktop ? 400 : null, ), ); + unawaited(wallet.refresh()); } else { await showDialog( context: context, @@ -2486,6 +2493,7 @@ class _TransactionV2DetailsViewState (_) => StackOkDialog( title: "Failed to cancel transaction", message: result, + maxWidth: Util.isDesktop ? 400 : null, ), ); } From 8ea3e6c541c73d6decba9a289478b567c8fc3caf Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 13:42:17 -0600 Subject: [PATCH 075/178] clean up slatepack dialog a bit --- .../sub_widgets/mwc_slatepack_dialog.dart | 396 +++++++----------- 1 file changed, 152 insertions(+), 244 deletions(-) diff --git a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart index 1941e7483c..1ae4f9d600 100644 --- a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart +++ b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart @@ -1,22 +1,17 @@ -import 'dart:io'; - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:qr_flutter/qr_flutter.dart'; -import '../../../notifications/show_flush_bar.dart'; import '../../../models/mwc_slatepack_models.dart'; +import '../../../notifications/show_flush_bar.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/assets.dart'; import '../../../utilities/clipboard_interface.dart'; import '../../../utilities/text_styles.dart'; -import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; -import '../../../widgets/desktop/primary_button.dart'; -import '../../../widgets/desktop/secondary_button.dart'; +import '../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../widgets/rounded_white_container.dart'; -import '../../../widgets/stack_dialog.dart'; class MwcSlatepackDialog extends ConsumerStatefulWidget { const MwcSlatepackDialog({ @@ -33,8 +28,6 @@ class MwcSlatepackDialog extends ConsumerStatefulWidget { } class _MwcSlatepackDialogState extends ConsumerState { - int _currentView = 0; // 0: Slatepack text, 1: QR Code. - void _copySlatepack() { widget.clipboard.setData( ClipboardData(text: widget.slatepackResult.slatepack!), @@ -58,266 +51,181 @@ class _MwcSlatepackDialogState extends ConsumerState { @override Widget build(BuildContext context) { - final isDesktop = - Platform.isLinux || Platform.isMacOS || Platform.isWindows; - - return StackDialogBase( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - // Header with title and close button. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text("Send Slatepack", style: STextStyles.pageTitleH2(context)), - AppBarIconButton( - size: 36, - color: Theme.of(context).extension()!.background, - shadows: const [], - icon: SvgPicture.asset( - Assets.svg.x, - color: - Theme.of( - context, - ).extension()!.topNavIconPrimary, - width: 24, - height: 24, - ), - onPressed: () => Navigator.of(context).pop(), + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Send Slatepack", + style: STextStyles.pageTitleH2(context), ), - ], - ), - const SizedBox(height: 16), - Padding( - padding: const EdgeInsets.all(24), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - // Info text. - Text( - "Share this slatepack with the recipient to complete the transaction.", - style: STextStyles.subtitle(context), - textAlign: TextAlign.center, + ), + const DesktopDialogCloseButton(), + ], + ), + Padding( + padding: const EdgeInsets.all(32), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Instructions. + Container( + padding: const EdgeInsets.all(12), + width: double.infinity, + decoration: BoxDecoration( + color: Theme.of( + context, + ).extension()!.infoItemIcons.withOpacity(0.05), + borderRadius: BorderRadius.circular(8), ), - const SizedBox(height: 16), - - // Encryption status. - if (widget.slatepackResult.wasEncrypted == true) - Container( - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 8, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Next Steps:", + style: STextStyles.label( + context, + ).copyWith(fontWeight: FontWeight.w600), ), - decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .infoItemIcons - .withOpacity(0.1), - borderRadius: BorderRadius.circular(8), + const SizedBox(height: 8), + Text( + "1. Share this slatepack with the recipient\n" + "2. Wait for them to return the response slatepack\n" + "3. Import their response to finalize the transaction", + style: STextStyles.w400_14(context), ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - Icons.lock, - size: 16, - color: - Theme.of( - context, - ).extension()!.infoItemIcons, - ), - const SizedBox(width: 8), - Text( - "Encrypted for recipient", - style: STextStyles.label(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemIcons, - ), - ), - ], - ), - ), - const SizedBox(height: 16), + ], + ), + ), - // View toggle buttons. - Row( + // Encryption status. + // we don't encrypt so ignore for now + // if (widget.slatepackResult.wasEncrypted == true) + // Container( + // padding: const EdgeInsets.symmetric( + // horizontal: 12, + // vertical: 8, + // ), + // decoration: BoxDecoration( + // color: Theme.of( + // context, + // ).extension()!.infoItemIcons.withOpacity(0.1), + // borderRadius: BorderRadius.circular(8), + // ), + // child: Row( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Icon( + // Icons.lock, + // size: 16, + // color: + // Theme.of( + // context, + // ).extension()!.infoItemIcons, + // ), + // const SizedBox(width: 8), + // Text( + // "Encrypted for recipient", + // style: STextStyles.label(context).copyWith( + // color: + // Theme.of( + // context, + // ).extension()!.infoItemIcons, + // ), + // ), + // ], + // ), + // ), + const SizedBox(height: 24), + + // QR Code view. + RoundedWhiteContainer( + child: Column( children: [ - Expanded( - child: SecondaryButton( - label: "Text", - buttonHeight: ButtonHeight.m, - onPressed: - _currentView == 0 - ? null - : () => setState(() => _currentView = 0), - ), + Text( + "Slatepack QR Code", + style: STextStyles.itemSubtitle(context), ), - const SizedBox(width: 12), - Expanded( - child: SecondaryButton( - label: "QR Code", - buttonHeight: ButtonHeight.m, - onPressed: - _currentView == 1 - ? null - : () => setState(() => _currentView = 1), + const SizedBox(height: 8), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: QrImageView( + data: widget.slatepackResult.slatepack!, + size: 200, + backgroundColor: Colors.white, + foregroundColor: Colors.black, + errorCorrectionLevel: QrErrorCorrectLevel.M, ), ), ], ), - const SizedBox(height: 16), + ), - // Content display. - if (_currentView == 0) ...[ - // Slatepack text view. - RoundedWhiteContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Row( - children: [ - Text( - "Slatepack", - style: STextStyles.itemSubtitle(context), - ), - const Spacer(), - GestureDetector( - onTap: _copySlatepack, - child: Row( - children: [ - SvgPicture.asset( - Assets.svg.copy, - width: 10, - height: 10, - color: - Theme.of(context) - .extension()! - .infoItemIcons, - ), - const SizedBox(width: 4), - Text( - "Copy", - style: STextStyles.link2(context), - ), - ], - ), - ), - ], - ), - const SizedBox(height: 8), - Container( - constraints: const BoxConstraints( - maxHeight: 200, - minHeight: 100, - ), - child: SingleChildScrollView( - child: SelectableText( - widget.slatepackResult.slatepack!, - style: STextStyles.w400_14( - context, - ).copyWith(fontFamily: 'monospace'), - ), - ), - ), - ], - ), - ), - ] else ...[ - // QR Code view. - RoundedWhiteContainer( - child: Column( + const SizedBox(height: 12), + + // Slatepack text view. + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( children: [ Text( - "Scan QR Code", + "Slatepack", style: STextStyles.itemSubtitle(context), ), - const SizedBox(height: 16), - Container( - padding: const EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), - child: QrImageView( - data: widget.slatepackResult.slatepack!, - size: 200, - backgroundColor: Colors.white, - foregroundColor: Colors.black, - errorCorrectionLevel: QrErrorCorrectLevel.M, + const Spacer(), + GestureDetector( + onTap: _copySlatepack, + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.copy, + width: 10, + height: 10, + color: + Theme.of( + context, + ).extension()!.infoItemIcons, + ), + const SizedBox(width: 4), + Text("Copy", style: STextStyles.link2(context)), + ], ), ), ], ), - ), - ], - - const SizedBox(height: 24), - - // Action buttons. - if (isDesktop) ...[ - Row( - children: [ - Expanded( - child: SecondaryButton( - label: "Share File", - onPressed: _shareSlatepack, - ), + const SizedBox(height: 8), + Container( + constraints: const BoxConstraints( + maxHeight: 200, + minHeight: 100, ), - const SizedBox(width: 12), - Expanded( - child: PrimaryButton( - label: "Copy Text", - onPressed: _copySlatepack, + child: SingleChildScrollView( + child: SelectableText( + widget.slatepackResult.slatepack!, + style: STextStyles.w400_14( + context, + ).copyWith(fontFamily: 'monospace'), ), ), - ], - ), - ] else ...[ - PrimaryButton( - label: "Copy Slatepack", - onPressed: _copySlatepack, - ), - const SizedBox(height: 12), - SecondaryButton(label: "Share", onPressed: _shareSlatepack), - ], - - const SizedBox(height: 16), - - // Instructions. - Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.infoItemIcons.withOpacity(0.05), - borderRadius: BorderRadius.circular(8), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Next Steps:", - style: STextStyles.label( - context, - ).copyWith(fontWeight: FontWeight.w600), - ), - const SizedBox(height: 8), - Text( - "1. Share this slatepack with the recipient\n" - "2. Wait for them to return the response slatepack\n" - "3. Import their response to finalize the transaction", - style: STextStyles.w400_14(context), - ), - ], - ), + ), + ], ), - ], - ), + ), + ], ), - ], - ), + ), + ], ); } } From 5efc4e95d200e18f9dda5ba0851c5cd98e494665 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 13:45:47 -0600 Subject: [PATCH 076/178] WIP starting mobile mwc... --- lib/pages/receive_view/receive_view.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index e461978e2b..9e476ad98d 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -52,7 +52,6 @@ import '../../widgets/qr.dart'; import '../../widgets/rounded_white_container.dart'; import 'addresses/wallet_addresses_view.dart'; import 'generate_receiving_uri_qr_code_view.dart'; -import 'sub_widgets/mwc_slatepack_import_dialog.dart'; class ReceiveView extends ConsumerStatefulWidget { const ReceiveView({ @@ -702,14 +701,14 @@ class _ReceiveViewState extends ConsumerState { onPressed: () async { final wallet = ref.read(pWallets).getWallet(walletId); if (wallet is MimblewimblecoinWallet) { - await showDialog( - context: context, - builder: - (context) => MwcSlatepackImportDialog( - wallet: wallet, - clipboard: clipboard, - ), - ); + // await showDialog( + // context: context, + // builder: + // (context) => MwcSlatepackImportDialog( + // wallet: wallet, + // clipboard: clipboard, + // ), + // ); } }, ), From 31184a2af4d95e5b73bdbda9fd6d94b8302b3705 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Sep 2025 15:39:59 -0600 Subject: [PATCH 077/178] fix my refactoring mistake --- .../sub_widgets/mwc_slatepack_import_dialog.dart | 6 +++--- .../wallet_view/sub_widgets/desktop_receive.dart | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart index 6dd7289512..90080feb5a 100644 --- a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -26,12 +26,14 @@ class MwcSlatepackImportDialog extends ConsumerStatefulWidget { const MwcSlatepackImportDialog({ super.key, required this.walletId, + required this.rawSlatepack, required this.decoded, required this.slatepackType, this.clipboard = const ClipboardWrapper(), }); final String walletId; + final String rawSlatepack; final SlatepackDecodeResult decoded; final String slatepackType; final ClipboardInterface clipboard; @@ -48,15 +50,13 @@ class _MwcSlatepackImportDialogState // add delay for showloading exception catching hack fix await Future.delayed(const Duration(seconds: 1)); - final slatepackText = widget.decoded.slateJson!; - final wallet = ref.read(pWallets).getWallet(widget.walletId) as MimblewimblecoinWallet; // Determine action based on slatepack type. if (widget.slatepackType.contains("S1")) { // This is an initial slatepack - receive it and create response. - final result = await wallet.receiveSlatepack(slatepackText); + final result = await wallet.receiveSlatepack(widget.rawSlatepack); if (result.success && result.responseSlatepack != null) { return ( 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 80b358206a..cd4f9c2ff0 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 @@ -111,7 +111,7 @@ class _DesktopReceiveState extends ConsumerState { } } - Future<({SlatepackDecodeResult result, String type})?> + Future<({SlatepackDecodeResult result, String type, String raw})?> _decodeSlatepack() async { // add delay for showloading exception catching hack fix await Future.delayed(const Duration(seconds: 1)); @@ -154,7 +154,7 @@ class _DesktopReceiveState extends ConsumerState { _ => _determineSlatepackType(decoded), // Fallback. }; - return (result: decoded, type: slatepackType); + return (result: decoded, type: slatepackType, raw: text); } else { throw Exception(decoded.error ?? "Failed to decode slatepack"); } @@ -198,6 +198,7 @@ class _DesktopReceiveState extends ConsumerState { child: MwcSlatepackImportDialog( walletId: widget.walletId, clipboard: widget.clipboard, + rawSlatepack: result.raw, decoded: result.result, slatepackType: result.type, ), From 0b80d51f294ff9801d6cd23bad6cad211c7f2648 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 09:02:00 -0600 Subject: [PATCH 078/178] fix missing android mwc build calls --- scripts/android/build_all.sh | 1 + scripts/android/build_all_campfire.sh | 1 + scripts/android/build_all_duo.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/android/build_all.sh b/scripts/android/build_all.sh index d791b933be..dc904e95dd 100755 --- a/scripts/android/build_all.sh +++ b/scripts/android/build_all.sh @@ -11,6 +11,7 @@ PLUGINS_DIR=../../crypto_plugins source ../rust_version.sh set_rust_version_for_libepiccash (cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh ) +(cd "${PLUGINS_DIR}"/flutter_libmwc/scripts/android && ./build_all.sh ) # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/android/build_all_campfire.sh b/scripts/android/build_all_campfire.sh index d791b933be..dc904e95dd 100755 --- a/scripts/android/build_all_campfire.sh +++ b/scripts/android/build_all_campfire.sh @@ -11,6 +11,7 @@ PLUGINS_DIR=../../crypto_plugins source ../rust_version.sh set_rust_version_for_libepiccash (cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh ) +(cd "${PLUGINS_DIR}"/flutter_libmwc/scripts/android && ./build_all.sh ) # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else diff --git a/scripts/android/build_all_duo.sh b/scripts/android/build_all_duo.sh index 39579d2381..1a0d6058f9 100755 --- a/scripts/android/build_all_duo.sh +++ b/scripts/android/build_all_duo.sh @@ -13,6 +13,7 @@ PLUGINS_DIR=../../crypto_plugins source ../rust_version.sh set_rust_version_for_libepiccash (cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh ) +(cd "${PLUGINS_DIR}"/flutter_libmwc/scripts/android && ./build_all.sh ) # set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else From 69ac018bd8f5c2bd22b6f3690ab022baf43bac88 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 09:51:08 -0600 Subject: [PATCH 079/178] mwc send view tweaks --- lib/pages/send_view/send_view.dart | 111 +++---- .../mwc_transaction_method_selector.dart | 272 ------------------ .../sub_widgets/desktop_receive.dart | 2 +- .../wallet_view/sub_widgets/desktop_send.dart | 4 +- .../desktop_mwc_txs_method_toggle.dart | 22 +- 5 files changed, 53 insertions(+), 358 deletions(-) delete mode 100644 lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart rename lib/{pages_desktop_specific/my_stack_view/wallet_view/sub_widgets => widgets}/desktop_mwc_txs_method_toggle.dart (70%) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 96a64f6550..7844162a7d 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -62,6 +62,7 @@ import '../../widgets/animated_text.dart'; import '../../widgets/background.dart'; import '../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../widgets/custom_buttons/blue_text_button.dart'; +import '../../widgets/desktop_mwc_txs_method_toggle.dart'; import '../../widgets/dialogs/firo_exchange_address_dialog.dart'; import '../../widgets/eth_fee_form.dart'; import '../../widgets/fee_slider.dart'; @@ -78,7 +79,6 @@ import '../coin_control/coin_control_view.dart'; import 'confirm_transaction_view.dart'; import 'sub_widgets/building_transaction_dialog.dart'; import 'sub_widgets/dual_balance_selection_sheet.dart'; -import 'sub_widgets/mwc_transaction_method_selector.dart'; import 'sub_widgets/transaction_fee_selection_sheet.dart'; class SendView extends ConsumerStatefulWidget { @@ -1135,12 +1135,6 @@ class _SendViewState extends ConsumerState { WidgetsBinding.instance.addPostFrameCallback((_) { ref.refresh(feeSheetSessionCacheProvider); ref.refresh(pIsExchangeAddress); - - // // Initialize MWC transaction method to default (non-slatepack). - // if (coin is Mimblewimblecoin) { - // ref.read(pSelectedMwcTransactionMethod.notifier).state = - // null; // No method selected initially. - // } }); isCustomFee.addListener(() { if (!isCustomFee.value) { @@ -1342,21 +1336,10 @@ class _SendViewState extends ConsumerState { ); } - // Probably not be needed. - // if (coin is Mimblewimblecoin) { - // sendToController.addListener(() { - // _address = sendToController.text.trim(); - // - // if (_address != null && _address!.isNotEmpty) { - // _address = _address!.trim(); - // if (_address!.contains("\n")) { - // _address = _address!.substring(0, _address!.indexOf("\n")); - // } - // - // sendToController.text = AddressUtils().formatAddressMwc(_address!); - // } - // }); - // } + final isMwcSlatepack = + coin is Mimblewimblecoin && + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack; return Background( child: Scaffold( @@ -1536,54 +1519,43 @@ class _SendViewState extends ConsumerState { // MWC Transaction Method Selector. if (coin is Mimblewimblecoin) ...[ - MwcTransactionMethodSelector( - onMethodSelected: (method) { - setState(() { - _selectedTransactionMethod = method; - }); - // Update the provider as well. - ref - .read( - pSelectedMwcTransactionMethod.notifier, - ) - .state = method; - }, - selectedMethod: _selectedTransactionMethod, - addressText: sendToController.text.trim(), + const SizedBox( + height: 40, + child: MwcTxsMethodToggle(), ), const SizedBox(height: 16), ], - // "Send to" field - optional for MWC slatepack transactions. - // Always show the field, but make it optional for slatepack. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - isPaynymSend - ? "Send to PayNym address" - : "Send to", - style: STextStyles.smallMed12(context), - textAlign: TextAlign.left, - ), - // if (coin is Monero) - // CustomTextButton( - // text: "Use OpenAlias", - // onTap: () async { - // await showModalBottomSheet( - // context: context, - // builder: (context) => - // OpenAliasBottomSheet( - // onSelected: (address) { - // sendToController.text = address; - // }, - // ), - // ); - // }, - // ), - ], - ), - const SizedBox(height: 8), + if (!isMwcSlatepack) + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + isPaynymSend + ? "Send to PayNym address" + : "Send to", + style: STextStyles.smallMed12(context), + textAlign: TextAlign.left, + ), + // if (coin is Monero) + // CustomTextButton( + // text: "Use OpenAlias", + // onTap: () async { + // await showModalBottomSheet( + // context: context, + // builder: (context) => + // OpenAliasBottomSheet( + // onSelected: (address) { + // sendToController.text = address; + // }, + // ), + // ); + // }, + // ), + ], + ), + if (!isMwcSlatepack) const SizedBox(height: 8), if (isPaynymSend) TextField( key: const Key("sendViewPaynymAddressFieldKey"), @@ -1592,7 +1564,7 @@ class _SendViewState extends ConsumerState { readOnly: true, style: STextStyles.fieldLabel(context), ), - if (!isPaynymSend) + if (!isPaynymSend && !isMwcSlatepack) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -2641,7 +2613,10 @@ class _SendViewState extends ConsumerState { context, ), child: Text( - "Preview", + ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack + ? "Create slatepack" + : "Preview", style: STextStyles.button(context), ), ), diff --git a/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart b/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart deleted file mode 100644 index 123656faf5..0000000000 --- a/lib/pages/send_view/sub_widgets/mwc_transaction_method_selector.dart +++ /dev/null @@ -1,272 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_svg/flutter_svg.dart'; - -import '../../../themes/stack_colors.dart'; -import '../../../utilities/assets.dart'; -import '../../../utilities/enums/mwc_transaction_method.dart'; -import '../../../utilities/text_styles.dart'; -import '../../../widgets/rounded_white_container.dart'; - -class MwcTransactionMethodSelector extends ConsumerStatefulWidget { - const MwcTransactionMethodSelector({ - super.key, - required this.onMethodSelected, - this.selectedMethod, - this.addressText, - }); - - final void Function(MwcTransactionMethod) onMethodSelected; - final MwcTransactionMethod? selectedMethod; - final String? addressText; - - @override - ConsumerState createState() => - _MwcTransactionMethodSelectorState(); -} - -class _MwcTransactionMethodSelectorState - extends ConsumerState { - MwcTransactionMethod? _selectedMethod; - - @override - void initState() { - super.initState(); - _selectedMethod = widget.selectedMethod; - } - - void _selectMethod(MwcTransactionMethod method) { - setState(() { - _selectedMethod = method; - }); - widget.onMethodSelected(method); - } - - Widget _buildMethodTile({ - required MwcTransactionMethod method, - required String title, - required String subtitle, - required IconData icon, - required bool available, - String? unavailableReason, - }) { - final isSelected = _selectedMethod == method; - final canSelect = available && widget.addressText?.isNotEmpty != true; - - return GestureDetector( - onTap: canSelect ? () => _selectMethod(method) : null, - child: AnimatedContainer( - duration: const Duration(milliseconds: 200), - decoration: BoxDecoration( - color: - isSelected - ? Theme.of(context) - .extension()! - .infoItemIcons - .withValues(alpha: 0.1) - : Theme.of(context).extension()!.popupBG, - borderRadius: BorderRadius.circular(12), - border: Border.all( - color: - isSelected - ? Theme.of(context).extension()!.infoItemIcons - : Theme.of(context).extension()!.background, - width: 2, - ), - ), - child: Padding( - padding: const EdgeInsets.all(16), - child: Row( - children: [ - Container( - padding: const EdgeInsets.all(8), - decoration: BoxDecoration( - color: - available - ? Theme.of(context) - .extension()! - .infoItemIcons - .withValues(alpha: 0.1) - : Theme.of( - context, - ).extension()!.textFieldDefaultBG, - borderRadius: BorderRadius.circular(8), - ), - child: Icon( - icon, - size: 20, - color: - available - ? Theme.of( - context, - ).extension()!.infoItemIcons - : Theme.of( - context, - ).extension()!.textSubtitle2, - ), - ), - const SizedBox(width: 12), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: STextStyles.w600_14(context).copyWith( - color: - available - ? Theme.of( - context, - ).extension()!.textDark - : Theme.of( - context, - ).extension()!.textSubtitle2, - ), - ), - const SizedBox(height: 2), - Text( - available ? subtitle : (unavailableReason ?? subtitle), - style: STextStyles.w400_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textSubtitle2, - ), - ), - ], - ), - ), - if (isSelected) - Container( - padding: const EdgeInsets.all(4), - decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.infoItemIcons, - shape: BoxShape.circle, - ), - child: Icon( - Icons.check, - size: 12, - color: Theme.of(context).extension()!.popupBG, - ), - ), - ], - ), - ), - ), - ); - } - - @override - Widget build(BuildContext context) { - final hasAddressInput = widget.addressText?.isNotEmpty == true; - - return RoundedWhiteContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - SvgPicture.asset( - Assets.svg.swap, - width: 16, - height: 16, - colorFilter: ColorFilter.mode( - Theme.of(context).extension()!.infoItemIcons, - BlendMode.srcIn, - ), - ), - const SizedBox(width: 8), - Text("Transaction Method", style: STextStyles.w600_14(context)), - ], - ), - const SizedBox(height: 4), - Text( - hasAddressInput - ? "Method detected from address format" - : "Choose how to send this transaction", - style: STextStyles.w400_14(context).copyWith( - color: Theme.of(context).extension()!.textSubtitle2, - ), - ), - const SizedBox(height: 16), - - Column( - children: [ - // Slatepack method. - _buildMethodTile( - method: MwcTransactionMethod.slatepack, - title: "Slatepack (Manual)", - subtitle: "Copy/paste, QR codes, or files", - icon: Icons.qr_code, - available: true, - ), - const SizedBox(height: 12), - - // MWCMQS method. - _buildMethodTile( - method: MwcTransactionMethod.mwcmqs, - title: "MWCMQS (Automatic)", - subtitle: "Direct messaging to recipient", - icon: Icons.message, - available: true, - unavailableReason: "Requires MWCMQS address", - ), - // const SizedBox(height: 12), - // - // // HTTP method. - // _buildMethodTile( - // method: MwcTransactionMethod.http, - // title: "HTTP (Direct)", - // subtitle: "Direct connection to wallet", - // icon: Icons.http, - // available: true, - // unavailableReason: "Requires HTTP address", - // ), - ], - ), - - if (hasAddressInput) ...[ - const SizedBox(height: 16), - Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .infoItemIcons - .withValues(alpha: 0.05), - borderRadius: BorderRadius.circular(8), - ), - child: Row( - children: [ - Icon( - Icons.info_outline, - size: 16, - color: - Theme.of( - context, - ).extension()!.infoItemIcons, - ), - const SizedBox(width: 8), - Expanded( - child: Text( - "Transaction method is automatically detected from the address format. Clear the address field to manually select a method.", - style: STextStyles.w400_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textSubtitle2, - ), - ), - ), - ], - ), - ), - ], - ], - ), - ); - } -} 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 cd4f9c2ff0..254c922488 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 @@ -55,6 +55,7 @@ import '../../../../widgets/custom_loading_overlay.dart'; import '../../../../widgets/desktop/desktop_dialog.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/desktop/secondary_button.dart'; +import '../../../../widgets/desktop_mwc_txs_method_toggle.dart'; import '../../../../widgets/dialogs/s_dialog.dart'; import '../../../../widgets/icon_widgets/clipboard_icon.dart'; import '../../../../widgets/icon_widgets/x_icon.dart'; @@ -63,7 +64,6 @@ import '../../../../widgets/rounded_white_container.dart'; import '../../../../widgets/stack_dialog.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; -import 'desktop_mwc_txs_method_toggle.dart'; class DesktopReceive extends ConsumerStatefulWidget { const DesktopReceive({ 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 6ae236aa19..32e602d0b8 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 @@ -64,6 +64,7 @@ import '../../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/desktop/qr_code_scanner_dialog.dart'; import '../../../../widgets/desktop/secondary_button.dart'; +import '../../../../widgets/desktop_mwc_txs_method_toggle.dart'; import '../../../../widgets/dialogs/firo_exchange_address_dialog.dart'; import '../../../../widgets/eth_fee_form.dart'; import '../../../../widgets/icon_widgets/addressbook_icon.dart'; @@ -76,7 +77,6 @@ import '../../../../widgets/textfield_icon_button.dart'; import '../../../coin_control/desktop_coin_control_use_dialog.dart'; import '../../../desktop_home_view.dart'; import 'address_book_address_chooser/address_book_address_chooser.dart'; -import 'desktop_mwc_txs_method_toggle.dart'; import 'desktop_send_fee_form.dart'; class DesktopSend extends ConsumerStatefulWidget { @@ -1948,7 +1948,7 @@ class _DesktopSendState extends ConsumerState { PrimaryButton( buttonHeight: ButtonHeight.l, label: - ref.read(pSelectedMwcTransactionMethod) == + ref.watch(pSelectedMwcTransactionMethod) == MwcTransactionMethod.slatepack ? "Create slatepack" : "Preview send", diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart b/lib/widgets/desktop_mwc_txs_method_toggle.dart similarity index 70% rename from lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart rename to lib/widgets/desktop_mwc_txs_method_toggle.dart index 1257d464cc..4381d6e236 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_mwc_txs_method_toggle.dart +++ b/lib/widgets/desktop_mwc_txs_method_toggle.dart @@ -11,13 +11,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import '../../../../providers/ui/preview_tx_button_state_provider.dart'; -import '../../../../themes/stack_colors.dart'; -import '../../../../utilities/assets.dart'; -import '../../../../utilities/constants.dart'; -import '../../../../utilities/enums/mwc_transaction_method.dart'; -import '../../../../utilities/util.dart'; -import '../../../../widgets/toggle.dart'; +import '../providers/ui/preview_tx_button_state_provider.dart'; +import '../themes/stack_colors.dart'; +import '../utilities/assets.dart'; +import '../utilities/constants.dart'; +import '../utilities/enums/mwc_transaction_method.dart'; +import '../utilities/util.dart'; +import 'toggle.dart'; class MwcTxsMethodToggle extends ConsumerWidget { const MwcTxsMethodToggle({super.key}); @@ -29,14 +29,6 @@ class MwcTxsMethodToggle extends ConsumerWidget { return Toggle( onValueChanged: (value) { - // Align visual labels with callback semantics: - // When the toggle shows "Slatepack" (on), emit slatepack. - // When it shows "Automatic" (off), emit automatic. - // if (value) { - // onChanged?.call(TxsMethodMwcType.slatepack); - // } else { - // onChanged?.call(TxsMethodMwcType.automatic); - // } ref.read(pSelectedMwcTransactionMethod.notifier).state = value ? MwcTransactionMethod.mwcmqs From c26fe0d018add156f1e73b0d1ed077c7af59085c Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 09:51:51 -0600 Subject: [PATCH 080/178] rename file appropriately --- lib/pages/send_view/send_view.dart | 2 +- .../my_stack_view/wallet_view/sub_widgets/desktop_receive.dart | 2 +- .../my_stack_view/wallet_view/sub_widgets/desktop_send.dart | 2 +- ...op_mwc_txs_method_toggle.dart => mwc_txs_method_toggle.dart} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename lib/widgets/{desktop_mwc_txs_method_toggle.dart => mwc_txs_method_toggle.dart} (100%) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 7844162a7d..084277a9c2 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -62,7 +62,6 @@ import '../../widgets/animated_text.dart'; import '../../widgets/background.dart'; import '../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../widgets/custom_buttons/blue_text_button.dart'; -import '../../widgets/desktop_mwc_txs_method_toggle.dart'; import '../../widgets/dialogs/firo_exchange_address_dialog.dart'; import '../../widgets/eth_fee_form.dart'; import '../../widgets/fee_slider.dart'; @@ -70,6 +69,7 @@ import '../../widgets/icon_widgets/addressbook_icon.dart'; import '../../widgets/icon_widgets/clipboard_icon.dart'; import '../../widgets/icon_widgets/qrcode_icon.dart'; import '../../widgets/icon_widgets/x_icon.dart'; +import '../../widgets/mwc_txs_method_toggle.dart'; import '../../widgets/rounded_white_container.dart'; import '../../widgets/stack_dialog.dart'; import '../../widgets/stack_text_field.dart'; 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 254c922488..3fe9f4ed53 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 @@ -55,10 +55,10 @@ import '../../../../widgets/custom_loading_overlay.dart'; import '../../../../widgets/desktop/desktop_dialog.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/desktop/secondary_button.dart'; -import '../../../../widgets/desktop_mwc_txs_method_toggle.dart'; import '../../../../widgets/dialogs/s_dialog.dart'; import '../../../../widgets/icon_widgets/clipboard_icon.dart'; import '../../../../widgets/icon_widgets/x_icon.dart'; +import '../../../../widgets/mwc_txs_method_toggle.dart'; import '../../../../widgets/qr.dart'; import '../../../../widgets/rounded_white_container.dart'; import '../../../../widgets/stack_dialog.dart'; 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 32e602d0b8..ac30df24ea 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 @@ -64,13 +64,13 @@ import '../../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/desktop/qr_code_scanner_dialog.dart'; import '../../../../widgets/desktop/secondary_button.dart'; -import '../../../../widgets/desktop_mwc_txs_method_toggle.dart'; import '../../../../widgets/dialogs/firo_exchange_address_dialog.dart'; import '../../../../widgets/eth_fee_form.dart'; import '../../../../widgets/icon_widgets/addressbook_icon.dart'; import '../../../../widgets/icon_widgets/clipboard_icon.dart'; import '../../../../widgets/icon_widgets/qrcode_icon.dart'; import '../../../../widgets/icon_widgets/x_icon.dart'; +import '../../../../widgets/mwc_txs_method_toggle.dart'; import '../../../../widgets/rounded_container.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; diff --git a/lib/widgets/desktop_mwc_txs_method_toggle.dart b/lib/widgets/mwc_txs_method_toggle.dart similarity index 100% rename from lib/widgets/desktop_mwc_txs_method_toggle.dart rename to lib/widgets/mwc_txs_method_toggle.dart From 480619c9493547b1f079cf5767a1cdd8afc309ee Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 10:06:09 -0600 Subject: [PATCH 081/178] remove unused functions --- .../coins/mimblewimblecoin.dart | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index c495d58f0f..552bcc24fa 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -105,52 +105,6 @@ class Mimblewimblecoin extends Bip39Currency { } } - /// Validate slatepack format. - bool validateSlatepack(String slatepack) { - try { - final trimmed = slatepack.trim(); - if (!isSlatepack(trimmed)) { - return false; - } - - // Basic structure validation. - final lines = trimmed.split('\n'); - if (lines.length < 3) { - return false; - } - - // Should have header, content, and footer. - return lines.first.startsWith('BEGINSLATEPACK.') && - lines.last.endsWith('.ENDSLATEPACK') && - lines.length > 2; - } catch (e) { - return false; - } - } - - /// Get expected slatepack type from content (S1, S2, S3). - String? getSlatepackType(String slatepack) { - if (!validateSlatepack(slatepack)) { - return null; - } - - try { - // This is a simplified approach - in reality you'd need to decode - // the slatepack content to determine the exact type. - final lines = slatepack.trim().split('\n'); - final header = lines.first; - - // Basic heuristic based on header format. - if (header.contains('BEGINSLATEPACK.')) { - return 'unknown'; // Would need proper decoding to determine S1/S2/S3. - } - - return null; - } catch (e) { - return null; - } - } - @override NodeModel defaultNode({required bool isPrimary}) { switch (network) { From 408fac30304ccf31fda7e2a9cbe5419d0065aecd Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 10:07:43 -0600 Subject: [PATCH 082/178] validateAddress is reserved for spending to. A slatepack cannot be spent to and is not a valid address. This commit will probably break things --- lib/wallets/crypto_currency/coins/mimblewimblecoin.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index 552bcc24fa..b7fe060432 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -53,11 +53,6 @@ class Mimblewimblecoin extends Bip39Currency { @override bool validateAddress(String address) { - // Check if it's a slatepack first. - if (isSlatepack(address)) { - return true; - } - // Check URI schemes (HTTP, HTTPS, MWCMQS). final Uri? uri = Uri.tryParse(address); if (uri != null && From 33961b6836d541a2ad36761824cd02b8a63bf034 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 10:11:11 -0600 Subject: [PATCH 083/178] MWC does not do http sends --- .../crypto_currency/coins/mimblewimblecoin.dart | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index b7fe060432..e2779e6ed4 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -55,15 +55,12 @@ class Mimblewimblecoin extends Bip39Currency { bool validateAddress(String address) { // Check URI schemes (HTTP, HTTPS, MWCMQS). final Uri? uri = Uri.tryParse(address); - if (uri != null && - (uri.scheme == "http" || - uri.scheme == "https" || - uri.scheme == "mwcmqs") && - uri.host.isNotEmpty) { - return true; + if (uri != null && uri.scheme == "mwcmqs" && uri.host.isNotEmpty) { + // Use libmwc for address validation. + return mimblewimblecoin.Libmwc.validateSendAddress(address: uri.host); } - // Use libmwc for other address validation. + // Use libmwc for address validation. return mimblewimblecoin.Libmwc.validateSendAddress(address: address); } @@ -81,11 +78,6 @@ class Mimblewimblecoin extends Bip39Currency { return address.startsWith('mwcmqs://'); } - /// Check if address is HTTP format. - bool isHttpAddress(String address) { - return address.startsWith('http://') || address.startsWith('https://'); - } - /// Detect transaction type based on address/data format. MwcTransactionMethod getTransactionMethod(String addressOrData) { if (isSlatepack(addressOrData)) { From ae89d1f0c8bf81e54cba5e20f30209ff493b355d Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 11:05:26 -0600 Subject: [PATCH 084/178] share finalize view base with desktop --- lib/pages/finalize_view/finalize_view.dart | 337 ++++++++++++++++++ lib/pages/wallet_view/wallet_view.dart | 18 + .../sub_widgets/desktop_finalize.dart | 258 -------------- .../wallet_view/sub_widgets/my_wallet.dart | 125 +++---- lib/route_generator.dart | 11 + .../components/icons/finalize_nav_icon.dart | 40 +++ 6 files changed, 459 insertions(+), 330 deletions(-) create mode 100644 lib/pages/finalize_view/finalize_view.dart delete mode 100644 lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart create mode 100644 lib/widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart diff --git a/lib/pages/finalize_view/finalize_view.dart b/lib/pages/finalize_view/finalize_view.dart new file mode 100644 index 0000000000..fa69aae52f --- /dev/null +++ b/lib/pages/finalize_view/finalize_view.dart @@ -0,0 +1,337 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * 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'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../notifications/show_flush_bar.dart'; +import '../../providers/global/barcode_scanner_provider.dart'; +import '../../providers/global/wallets_provider.dart'; +import '../../themes/stack_colors.dart'; +import '../../utilities/barcode_scanner_interface.dart'; +import '../../utilities/clipboard_interface.dart'; +import '../../utilities/constants.dart'; +import '../../utilities/logger.dart'; +import '../../utilities/show_loading.dart'; +import '../../utilities/text_styles.dart'; +import '../../utilities/util.dart'; +import '../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; +import '../../widgets/background.dart'; +import '../../widgets/conditional_parent.dart'; +import '../../widgets/custom_buttons/app_bar_icon_button.dart'; +import '../../widgets/desktop/primary_button.dart'; +import '../../widgets/icon_widgets/clipboard_icon.dart'; +import '../../widgets/icon_widgets/qrcode_icon.dart'; +import '../../widgets/icon_widgets/x_icon.dart'; +import '../../widgets/stack_dialog.dart'; +import '../../widgets/stack_text_field.dart'; +import '../../widgets/textfield_icon_button.dart'; + +class FinalizeView extends ConsumerStatefulWidget { + const FinalizeView({ + super.key, + required this.walletId, + this.clipboard = const ClipboardWrapper(), + }); + + static const String routeName = "/finalizeView"; + + final String walletId; + final ClipboardInterface clipboard; + + @override + ConsumerState createState() => _FinalizeViewState(); +} + +class _FinalizeViewState extends ConsumerState { + late final TextEditingController _slateController; + late final FocusNode _slateFocusNode; + + bool _slateToggleFlag = false; + + Future _pasteSlatepack() async { + final ClipboardData? data = await widget.clipboard.getData( + Clipboard.kTextPlain, + ); + if (data?.text != null && data!.text!.isNotEmpty) { + _slateController.text = data.text!; + setState(() { + _slateToggleFlag = _slateController.text.isNotEmpty; + }); + } + } + + Future _scanQr() async { + try { + if (!Util.isDesktop && _slateFocusNode.hasFocus) { + _slateFocusNode.unfocus(); + await Future.delayed(const Duration(milliseconds: 75)); + } + + if (mounted) { + final qrResult = await ref.read(pBarcodeScanner).scan(context: context); + if (qrResult.rawContent.isNotEmpty && qrResult.rawContent != "null") { + _slateController.text = qrResult.rawContent; + setState(() { + _slateToggleFlag = _slateController.text.isNotEmpty; + }); + } + } + } on PlatformException catch (e, s) { + if (mounted) { + try { + await checkCamPermDeniedMobileAndOpenAppSettings( + context, + logging: Logging.instance, + ); + } catch (e, s) { + Logging.instance.e( + "Failed to check cam permissions", + error: e, + stackTrace: s, + ); + } + } else { + Logging.instance.e( + "Failed to get camera permissions while trying to scan qr code in SendView: ", + error: e, + stackTrace: s, + ); + } + } + } + + Future _finalize() async { + // add delay for showloading exception catching hack fix + await Future.delayed(const Duration(seconds: 1)); + + final wallet = + ref.read(pWallets).getWallet(widget.walletId) as MimblewimblecoinWallet; + + final decoded = await wallet.decodeSlatepack(_slateController.text); + if (!decoded.success) { + throw Exception(decoded.error ?? "Failed to decode slatepack"); + } + + final analysis = await wallet.analyzeSlatepack(_slateController.text); + if (analysis.status != "S2") { + throw Exception("Invalid slatepack type: ${analysis.status}"); + } + + final result = await wallet.finalizeSlatepack(_slateController.text); + + if (!result.success) { + throw Exception( + result.error ?? "Finalize failed without providing an error???", + ); + } + } + + Future _finalizePressed() async { + if (!Util.isDesktop && _slateFocusNode.hasFocus) { + _slateFocusNode.unfocus(); + await Future.delayed(const Duration(milliseconds: 75)); + } + if (mounted) { + Exception? ex; + await showLoading( + whileFuture: _finalize(), + context: context, + message: "Finalizing slatepack...", + rootNavigator: Util.isDesktop, + onException: (e) => ex = e, + ); + + if (mounted) { + if (ex != null) { + await showDialog( + context: context, + builder: + (context) => StackOkDialog( + desktopPopRootNavigator: Util.isDesktop, + title: "Slatepack finalize error", + message: + ex?.toString() ?? "Unexpected result without exception", + maxWidth: Util.isDesktop ? 400 : null, + ), + ); + } else { + unawaited( + showFloatingFlushBar( + type: FlushBarType.success, + message: "Transaction finalized and broadcast successfully!", + context: context, + ), + ); + } + } + } + } + + @override + void initState() { + super.initState(); + _slateController = TextEditingController(); + _slateFocusNode = FocusNode(); + } + + @override + void dispose() { + _slateController.dispose(); + _slateFocusNode.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + debugPrint("BUILD: $runtimeType"); + + return 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( + "Finalize slatepack", + style: STextStyles.navBarTitle(context), + ), + ), + body: SafeArea( + child: LayoutBuilder( + builder: (context, constraints) { + return SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight, + ), + child: IntrinsicHeight( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: Constants.size.standardPadding, + ), + child: child, + ), + ), + ), + ); + }, + ), + ), + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + minLines: 1, + maxLines: 5, + key: const Key("finalizeSlatepackFieldKey"), + controller: _slateController, + readOnly: false, + autocorrect: false, + enableSuggestions: false, + toolbarOptions: const ToolbarOptions( + copy: false, + cut: false, + paste: true, + selectAll: false, + ), + onChanged: (newValue) { + setState(() { + _slateToggleFlag = newValue.isNotEmpty; + }); + }, + focusNode: _slateFocusNode, + style: STextStyles.field(context), + decoration: standardInputDecoration( + "Enter Final Slatepack Message", + _slateFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 12, // Adjust vertical padding for better alignment + ), + suffixIcon: Padding( + padding: + _slateController.text.isEmpty + ? const EdgeInsets.only(right: 8) + : const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _slateToggleFlag + ? TextFieldIconButton( + key: const Key( + "slateFinalizeClearFieldButtonKey", + ), + onTap: () { + _slateController.text = ""; + setState(() { + _slateToggleFlag = false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + key: const Key( + "slateFinalizePasteFieldButtonKey", + ), + onTap: _pasteSlatepack, + child: + _slateController.text.isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + if (_slateController.text.isEmpty) + TextFieldIconButton( + semanticsLabel: + "Scan QR Button. Opens Camera For Scanning QR Code.", + key: const Key("sendViewScanQrButtonKey"), + onTap: _scanQr, + child: const QrCodeIcon(), + ), + ], + ), + ), + ), + ), + ), + ), + Util.isDesktop ? const SizedBox(height: 24) : const Spacer(), + PrimaryButton( + label: "Finalize Slatepack", + enabled: _slateToggleFlag, + onPressed: _slateToggleFlag ? _finalizePressed : null, + ), + + if (!Util.isDesktop) SizedBox(height: Constants.size.standardPadding), + ], + ), + ); + } +} diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index a479ae4eb7..c61340a4b5 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -51,6 +51,7 @@ import '../../wallets/crypto_currency/intermediate/frost_currency.dart'; import '../../wallets/isar/providers/wallet_info_provider.dart'; import '../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; import '../../wallets/wallet/impl/firo_wallet.dart'; +import '../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../wallets/wallet/impl/namecoin_wallet.dart'; import '../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../wallets/wallet/intermediate/lib_salvium_wallet.dart'; @@ -75,6 +76,7 @@ import '../../widgets/wallet_navigation_bar/components/icons/buy_nav_icon.dart'; import '../../widgets/wallet_navigation_bar/components/icons/churn_nav_icon.dart'; import '../../widgets/wallet_navigation_bar/components/icons/coin_control_nav_icon.dart'; import '../../widgets/wallet_navigation_bar/components/icons/exchange_nav_icon.dart'; +import '../../widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart'; import '../../widgets/wallet_navigation_bar/components/icons/frost_sign_nav_icon.dart'; import '../../widgets/wallet_navigation_bar/components/icons/fusion_nav_icon.dart'; import '../../widgets/wallet_navigation_bar/components/icons/ordinals_nav_icon.dart'; @@ -88,6 +90,7 @@ import '../cashfusion/cashfusion_view.dart'; import '../churning/churning_view.dart'; import '../coin_control/coin_control_view.dart'; import '../exchange_view/wallet_initiated_exchange_view.dart'; +import '../finalize_view/finalize_view.dart'; import '../monkey/monkey_view.dart'; import '../namecoin_names/namecoin_names_home_view.dart'; import '../notification_views/notifications_view.dart'; @@ -1015,6 +1018,21 @@ class _WalletViewState extends ConsumerState { } }, ), + if (wallet is MimblewimblecoinWallet) + WalletNavigationBarItemData( + label: "Finalize", + icon: const FinalizeNavIcon(), + onTap: () { + if (mounted) { + unawaited( + Navigator.of(context).pushNamed( + FinalizeView.routeName, + arguments: walletId, + ), + ); + } + }, + ), if (ref.watch(pWalletCoin(walletId)) is FrostCurrency) WalletNavigationBarItemData( label: "Sign", diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart deleted file mode 100644 index 78de9654bd..0000000000 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_finalize.dart +++ /dev/null @@ -1,258 +0,0 @@ -/* - * This file is part of Stack Wallet. - * - * Copyright (c) 2023 Cypher Stack - * 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'; -import 'package:flutter/services.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; - -import '../../../../notifications/show_flush_bar.dart'; -import '../../../../providers/providers.dart'; -import '../../../../themes/stack_colors.dart'; -import '../../../../utilities/clipboard_interface.dart'; -import '../../../../utilities/constants.dart'; -import '../../../../utilities/show_loading.dart'; -import '../../../../utilities/text_styles.dart'; -import '../../../../utilities/util.dart'; -import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; -import '../../../../widgets/desktop/primary_button.dart'; -import '../../../../widgets/icon_widgets/clipboard_icon.dart'; -import '../../../../widgets/icon_widgets/x_icon.dart'; -import '../../../../widgets/stack_dialog.dart'; -import '../../../../widgets/stack_text_field.dart'; -import '../../../../widgets/textfield_icon_button.dart'; - -class DesktopFinalize extends ConsumerStatefulWidget { - const DesktopFinalize({ - super.key, - required this.walletId, - this.clipboard = const ClipboardWrapper(), - }); - - final String walletId; - final ClipboardInterface clipboard; - - @override - ConsumerState createState() => _DesktopFinalizeState(); -} - -class _DesktopFinalizeState extends ConsumerState { - late TextEditingController _slateController; - final _slateFocusNode = FocusNode(); - bool _slateToggleFlag = false; - - Future _pasteSlatepack() async { - final ClipboardData? data = await widget.clipboard.getData( - Clipboard.kTextPlain, - ); - if (data?.text != null && data!.text!.isNotEmpty) { - _slateController.text = data.text!; - setState(() { - _slateToggleFlag = _slateController.text.isNotEmpty; - }); - } - } - - Future _finalize() async { - // add delay for showloading exception catching hack fix - await Future.delayed(const Duration(seconds: 1)); - - final wallet = - ref.read(pWallets).getWallet(widget.walletId) as MimblewimblecoinWallet; - - final decoded = await wallet.decodeSlatepack(_slateController.text); - if (!decoded.success) { - throw Exception(decoded.error ?? "Failed to decode slatepack"); - } - - final analysis = await wallet.analyzeSlatepack(_slateController.text); - if (analysis.status != "S2") { - throw Exception("Invalid slatepack type: ${analysis.status}"); - } - - final result = await wallet.finalizeSlatepack(_slateController.text); - - if (!result.success) { - throw Exception( - result.error ?? "Finalize failed without providing an error???", - ); - } - } - - Future _finalizePressed() async { - Exception? ex; - await showLoading( - whileFuture: _finalize(), - context: context, - message: "Finalizing slatepack...", - rootNavigator: Util.isDesktop, - onException: (e) => ex = e, - ); - - if (mounted) { - if (ex != null) { - await showDialog( - context: context, - useRootNavigator: true, - builder: - (context) => StackOkDialog( - desktopPopRootNavigator: true, - title: "Slatepack finalize error", - message: - ex?.toString() ?? "Unexpected result without exception", - maxWidth: 400, - ), - ); - } else { - unawaited( - showFloatingFlushBar( - type: FlushBarType.success, - message: "Transaction finalized and broadcast successfully!", - context: context, - ), - ); - } - } - } - - @override - void initState() { - _slateController = TextEditingController(); - super.initState(); - } - - @override - void dispose() { - _slateController.dispose(); - _slateFocusNode.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - debugPrint("BUILD: $runtimeType"); - - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox(height: 4), - const SizedBox(height: 20), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Finalize Slatepack", - style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveSearchIconRight, - ), - textAlign: TextAlign.left, - ), - const SizedBox(height: 8), - ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - child: TextField( - minLines: 1, - maxLines: 5, - key: const Key("finalizeSlatepackFieldKey"), - controller: _slateController, - readOnly: false, - autocorrect: false, - enableSuggestions: false, - toolbarOptions: const ToolbarOptions( - copy: false, - cut: false, - paste: true, - selectAll: false, - ), - onChanged: (newValue) { - setState(() { - _slateToggleFlag = newValue.isNotEmpty; - }); - }, - focusNode: _slateFocusNode, - style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveText, - height: 1.8, - ), - decoration: standardInputDecoration( - "Enter Final Slatepack Message", - _slateFocusNode, - context, - desktopMed: true, - ).copyWith( - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: - 12, // Adjust vertical padding for better alignment - ), - suffixIcon: Padding( - padding: - _slateController.text.isEmpty - ? const EdgeInsets.only(right: 8) - : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - _slateToggleFlag - ? TextFieldIconButton( - key: const Key( - "slateFinalizeClearFieldButtonKey", - ), - onTap: () { - _slateController.text = ""; - setState(() { - _slateToggleFlag = false; - }); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - key: const Key( - "slateFinalizePasteFieldButtonKey", - ), - onTap: _pasteSlatepack, - child: - _slateController.text.isEmpty - ? const ClipboardIcon() - : const XIcon(), - ), - ], - ), - ), - ), - ), - ), - ), - ], - ), - const SizedBox(height: 32), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: PrimaryButton( - buttonHeight: ButtonHeight.l, - label: "Finalize Slatepack", - enabled: true, - onPressed: _finalizePressed, - ), - ), - ], - ); - } -} 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 a644a2175c..9a8d94da6f 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 @@ -12,29 +12,24 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../frost_route_generator.dart'; +import '../../../../pages/finalize_view/finalize_view.dart'; import '../../../../pages/send_view/frost_ms/frost_send_view.dart'; import '../../../../pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart'; import '../../../../providers/global/wallets_provider.dart'; import '../../../../wallets/crypto_currency/crypto_currency.dart'; import '../../../../wallets/wallet/impl/bitcoin_frost_wallet.dart'; -import '../../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; import '../../../../widgets/custom_tab_view.dart'; import '../../../../widgets/desktop/secondary_button.dart'; import '../../../../widgets/frost_scaffold.dart'; import '../../../../widgets/rounded_white_container.dart'; import '../../my_stack_view.dart'; -import 'desktop_finalize.dart'; import 'desktop_receive.dart'; import 'desktop_send.dart'; import 'desktop_token_send.dart'; class MyWallet extends ConsumerStatefulWidget { - const MyWallet({ - super.key, - required this.walletId, - this.contractAddress, - }); + const MyWallet({super.key, required this.walletId, this.contractAddress}); final String walletId; final String? contractAddress; @@ -44,10 +39,7 @@ class MyWallet extends ConsumerStatefulWidget { } class _MyWalletState extends ConsumerState { - final titles = [ - "Send", - "Receive", - ]; + final titles = ["Send", "Receive"]; late final bool isEth; late final CryptoCurrency coin; @@ -110,64 +102,57 @@ class _MyWalletState extends ConsumerState { widget.contractAddress == null ? isFrost ? Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: - const EdgeInsets.fromLTRB(0, 20, 0, 0), - child: SecondaryButton( - width: 200, - buttonHeight: ButtonHeight.l, - label: "Import sign config", - onPressed: () async { - final wallet = ref - .read(pWallets) - .getWallet(widget.walletId) - as BitcoinFrostWallet; - ref.read(pFrostScaffoldArgs.state).state = - ( - info: ( - walletName: wallet.info.name, - frostCurrency: wallet.cryptoCurrency, - ), - walletId: widget.walletId, - stepRoutes: FrostRouteGenerator - .signFrostTxStepRoutes, - parentNav: Navigator.of(context), - frostInterruptionDialogType: - FrostInterruptionDialogType - .transactionCreation, - callerRouteName: MyStackView.routeName, - ); - - await Navigator.of(context).pushNamed( - FrostStepScaffold.routeName, - ); - }, - ), + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(0, 20, 0, 0), + child: SecondaryButton( + width: 200, + buttonHeight: ButtonHeight.l, + label: "Import sign config", + onPressed: () async { + final wallet = + ref + .read(pWallets) + .getWallet(widget.walletId) + as BitcoinFrostWallet; + ref.read(pFrostScaffoldArgs.state).state = ( + info: ( + walletName: wallet.info.name, + frostCurrency: wallet.cryptoCurrency, + ), + walletId: widget.walletId, + stepRoutes: + FrostRouteGenerator + .signFrostTxStepRoutes, + parentNav: Navigator.of(context), + frostInterruptionDialogType: + FrostInterruptionDialogType + .transactionCreation, + callerRouteName: MyStackView.routeName, + ); + + await Navigator.of( + context, + ).pushNamed(FrostStepScaffold.routeName); + }, ), - ], - ), - FrostSendView( - walletId: widget.walletId, - coin: coin, - ), - ], - ) - : Padding( - padding: const EdgeInsets.all(20), - child: DesktopSend( - walletId: widget.walletId, + ), + ], ), - ) + FrostSendView(walletId: widget.walletId, coin: coin), + ], + ) + : Padding( + padding: const EdgeInsets.all(20), + child: DesktopSend(walletId: widget.walletId), + ) : Padding( - padding: const EdgeInsets.all(20), - child: DesktopTokenSend( - walletId: widget.walletId, - ), - ), + padding: const EdgeInsets.all(20), + child: DesktopTokenSend(walletId: widget.walletId), + ), Padding( padding: const EdgeInsets.all(20), child: DesktopReceive( @@ -178,9 +163,7 @@ class _MyWalletState extends ConsumerState { if (isMimblewimblecoin) Padding( padding: const EdgeInsets.all(20), - child: DesktopFinalize( - walletId: widget.walletId, - ), + child: FinalizeView(walletId: widget.walletId), ), if (isEth && widget.contractAddress == null) @@ -190,9 +173,7 @@ class _MyWalletState extends ConsumerState { constraints: BoxConstraints( maxHeight: MediaQuery.of(context).size.height - 362, ), - child: TransactionsV2List( - walletId: widget.walletId, - ), + child: TransactionsV2List(walletId: widget.walletId), ), ), ], diff --git a/lib/route_generator.dart b/lib/route_generator.dart index 4c5e16ccfd..064e54df9a 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -68,6 +68,7 @@ import 'pages/exchange_view/exchange_step_views/step_4_view.dart'; import 'pages/exchange_view/send_from_view.dart'; import 'pages/exchange_view/trade_details_view.dart'; import 'pages/exchange_view/wallet_initiated_exchange_view.dart'; +import 'pages/finalize_view/finalize_view.dart'; import 'pages/generic/single_field_edit_view.dart'; import 'pages/home_view/home_view.dart'; import 'pages/intro_view.dart'; @@ -1712,6 +1713,16 @@ class RouteGenerator { } return _routeError("${settings.name} invalid args: ${args.toString()}"); + case FinalizeView.routeName: + if (args is String) { + return getRoute( + shouldUseMaterialRoute: useMaterialPageRoute, + builder: (_) => FinalizeView(walletId: args), + settings: RouteSettings(name: settings.name), + ); + } + return _routeError("${settings.name} invalid args: ${args.toString()}"); + case WalletAddressesView.routeName: if (args is String) { return getRoute( diff --git a/lib/widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart new file mode 100644 index 0000000000..04b19d2135 --- /dev/null +++ b/lib/widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart @@ -0,0 +1,40 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2025 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2025-09-18 + * + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +import '../../../../themes/stack_colors.dart'; +import '../../../../utilities/assets.dart'; + +class FinalizeNavIcon extends StatelessWidget { + const FinalizeNavIcon({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Theme.of( + context, + ).extension()!.bottomNavIconIcon.withOpacity(0.4), + borderRadius: BorderRadius.circular(24), + ), + child: Padding( + padding: const EdgeInsets.all(6.0), + child: SvgPicture.asset( + Assets.svg.circleLock, + width: 12, + height: 12, + color: Theme.of(context).extension()!.bottomNavIconIcon, + ), + ), + ); + } +} From 2004da14ac9dc56d78c2eaf3a5f4c5c0eb2248f1 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 11:10:45 -0600 Subject: [PATCH 085/178] fix hidden slate id on tx details view when cancel button is visible --- .../transaction_views/tx_v2/transaction_v2_details_view.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index c971e53438..2f2bbf83b4 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -2352,6 +2352,10 @@ class _TransactionV2DetailsViewState ), ), ), + if ((coin is Epiccash || coin is Mimblewimblecoin) && + _transaction.getConfirmations(currentHeight) < 1 && + _transaction.isCancelled == false) + const SizedBox(height: 40), ], ), ), From cc581fc6cefa4ab4f5fb7aa5eb8523e72c30fac2 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 12:39:04 -0600 Subject: [PATCH 086/178] update mwc lib --- .gitmodules | 2 +- crypto_plugins/flutter_libmwc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0e00f52521..d0c1810aa1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,4 +6,4 @@ url = https://github.com/cypherstack/frostdart [submodule "crypto_plugins/flutter_libmwc"] path = crypto_plugins/flutter_libmwc - url = https://github.com/vekamo/flutter_libmwc + url = https://github.com/cypherstack/flutter_libmwc diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 29c7ea5267..d34d8fb244 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 29c7ea526772a170d1f9488c4661333c0b2564fd +Subproject commit d34d8fb2447dd3bf732bb07b68bd3254732ba7b6 From c3ed4494271178554b9da3bad8e50ee9ef6c77d1 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 12:50:07 -0600 Subject: [PATCH 087/178] fix address validation --- lib/wallets/crypto_currency/coins/mimblewimblecoin.dart | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index e2779e6ed4..6d670d5ff6 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -53,13 +53,6 @@ class Mimblewimblecoin extends Bip39Currency { @override bool validateAddress(String address) { - // Check URI schemes (HTTP, HTTPS, MWCMQS). - final Uri? uri = Uri.tryParse(address); - if (uri != null && uri.scheme == "mwcmqs" && uri.host.isNotEmpty) { - // Use libmwc for address validation. - return mimblewimblecoin.Libmwc.validateSendAddress(address: uri.host); - } - // Use libmwc for address validation. return mimblewimblecoin.Libmwc.validateSendAddress(address: address); } From fa45fcb9c7077ad93f05c8677fff1bc63212caea Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 18 Sep 2025 13:43:49 -0600 Subject: [PATCH 088/178] fix ref access issue --- lib/pages/home_view/home_view.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index 4beb066630..223c3d9c14 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -57,6 +57,9 @@ class HomeView extends ConsumerStatefulWidget { class _HomeViewState extends ConsumerState { final GlobalKey _key = GlobalKey(); + // keep reference to be able to remove listener in dispose without requiring the riverpod ref + late final Prefs _prefs; + late final PageController _pageController; late final RotateIconController _rotateIconController; @@ -209,6 +212,7 @@ class _HomeViewState extends ConsumerState { @override void initState() { + _prefs = ref.read(prefsChangeNotifierProvider); _autoLockInfo = ref.read(prefsChangeNotifierProvider).autoLockInfo; if (_autoLockInfo.enabled) { _idleMonitor = IdleMonitor( @@ -242,7 +246,7 @@ class _HomeViewState extends ConsumerState { @override dispose() { - ref.read(prefsChangeNotifierProvider).removeListener(_prefsTimeoutListener); + _prefs.removeListener(_prefsTimeoutListener); _idleMonitor?.detach(); _pageController.dispose(); _rotateIconController.forward = null; From 45e677f2bca0ff50c9b2dff152f5332fde254c98 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 19 Sep 2025 08:06:25 -0600 Subject: [PATCH 089/178] mobile slatepack creation --- lib/pages/send_view/send_view.dart | 141 +++++--- .../sub_widgets/mwc_slatepack_dialog.dart | 303 +++++++++--------- 2 files changed, 244 insertions(+), 200 deletions(-) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 084277a9c2..77cbee8b63 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -9,7 +9,6 @@ */ import 'dart:async'; -import 'dart:convert'; import 'dart:io'; import 'package:cs_monero/cs_monero.dart' as lib_monero; @@ -22,6 +21,7 @@ import 'package:tuple/tuple.dart'; import '../../models/input.dart'; import '../../models/isar/models/isar_models.dart'; +import '../../models/mwc_slatepack_models.dart'; import '../../models/paynym/paynym_account_lite.dart'; import '../../models/send_view_auto_fill_data.dart'; import '../../providers/providers.dart'; @@ -47,6 +47,7 @@ import '../../utilities/eth_commons.dart'; import '../../utilities/extensions/extensions.dart'; import '../../utilities/logger.dart'; import '../../utilities/prefs.dart'; +import '../../utilities/show_loading.dart'; import '../../utilities/text_styles.dart'; import '../../utilities/util.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; @@ -54,6 +55,7 @@ import '../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../wallets/isar/providers/wallet_info_provider.dart'; import '../../wallets/models/tx_data.dart'; import '../../wallets/wallet/impl/firo_wallet.dart'; +import '../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart'; import '../../wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart'; import '../../wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart'; @@ -79,6 +81,7 @@ import '../coin_control/coin_control_view.dart'; import 'confirm_transaction_view.dart'; import 'sub_widgets/building_transaction_dialog.dart'; import 'sub_widgets/dual_balance_selection_sheet.dart'; +import 'sub_widgets/mwc_slatepack_dialog.dart'; import 'sub_widgets/transaction_fee_selection_sheet.dart'; class SendView extends ConsumerStatefulWidget { @@ -611,6 +614,97 @@ class _SendViewState extends ConsumerState { } } + Future _createSlatepack() async { + // wait for keyboard to disappear + FocusScope.of(context).unfocus(); + await Future.delayed(const Duration(milliseconds: 100)); + + try { + if (mounted) { + final wallet = + ref.read(pWallets).getWallet(walletId) as MimblewimblecoinWallet; + + final amount = ref.read(pSendAmount)!; + + Future wrappedFutureWithDelay() async { + await Future.delayed(const Duration(seconds: 1)); + return wallet.createSlatepack( + amount: amount, + recipientAddress: null, + // No specific recipient for manual slatepack. + message: + onChainNoteController.text.isNotEmpty == true + ? onChainNoteController.text + : null, + encrypt: false, // No encryption without recipient address. + ); + } + + // Create slatepack. + Exception? ex; + final slatepackResult = await showLoading( + whileFuture: wrappedFutureWithDelay(), + context: context, + message: "Building slatepack...", + delay: const Duration(seconds: 2), + onException: (e) => ex = e, + ); + + if (slatepackResult == null || + !slatepackResult.success || + slatepackResult.slatepack == null || + ex != null) { + String error = + ex?.toString() ?? + slatepackResult?.error ?? + 'Failed to create slatepack'; + if (error.startsWith("Exception:")) { + error = error.replaceFirst("Exception:", "").trim(); + } + throw Exception(error); + } + + // refresh asap to show the pending slate tx in history + unawaited(() async { + await Future.delayed(Duration.zero); + await wallet.refresh(); + }()); + + // Show slatepack dialog. + if (mounted) { + await showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => StackDialogBase( + child: MwcSlatepackDialog(slatepackResult: slatepackResult), + ), + ); + + // Clear form after slatepack dialog is closed. + clearSendForm(); + } + } + } catch (e, s) { + Logging.instance.e( + 'Failed to create MWC slatepack on mobile', + error: e, + stackTrace: s, + ); + + if (mounted) { + await showDialog( + context: context, + builder: + (context) => StackOkDialog( + title: "Slatepack Creation Failed", + message: e.toString(), + ), + ); + } + } + } + Future _previewTransaction() async { // wait for keyboard to disappear FocusScope.of(context).unfocus(); @@ -852,40 +946,6 @@ class _SendViewState extends ConsumerState { ); } else { final memo = coin is Stellar ? memoController.text : null; - - // For MWC, determine transaction method and add it to otherData. - Map? otherData; - if (coin is Mimblewimblecoin) { - String transactionMethod = 'slatepack'; // Default to slatepack. - - if (_selectedTransactionMethod != null) { - switch (_selectedTransactionMethod!) { - case MwcTransactionMethod.slatepack: - transactionMethod = 'slatepack'; - break; - case MwcTransactionMethod.mwcmqs: - transactionMethod = 'mwcmqs'; - break; - // case MwcTransactionMethod.http: - // transactionMethod = 'http'; - // break; - // case MwcTransactionMethod.unknown: - // // Auto-detect from address format. - // final mwcCoin = coin as Mimblewimblecoin; - // final method = mwcCoin.getTransactionMethod(_address!); - // transactionMethod = method.toString().split('.').last; - // break; - } - } else { - // Auto-detect from address format if no method selected. - final mwcCoin = coin as Mimblewimblecoin; - final method = mwcCoin.getTransactionMethod(_address!); - transactionMethod = method.toString().split('.').last; - } - - otherData = {'transactionMethod': transactionMethod}; - } - txDataFuture = wallet.prepareSend( txData: TxData( recipients: [ @@ -900,10 +960,6 @@ class _SendViewState extends ConsumerState { feeRateType: ref.read(feeRateTypeMobileStateProvider), satsPerVByte: isCustomFee.value ? customFeeRate : null, ethEIP1559Fee: ethFee, - otherData: - otherData != null - ? jsonEncode(otherData) - : null, // Include MWC transaction method info. utxos: (wallet is CoinControlInterface && coinControlEnabled && @@ -2600,7 +2656,12 @@ class _SendViewState extends ConsumerState { TextButton( onPressed: ref.watch(pPreviewTxButtonEnabled(coin)) - ? _previewTransaction + ? ref.watch( + pSelectedMwcTransactionMethod, + ) == + MwcTransactionMethod.slatepack + ? _createSlatepack + : _previewTransaction : null, style: ref.watch(pPreviewTxButtonEnabled(coin)) diff --git a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart index 1ae4f9d600..ec57cf0a53 100644 --- a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart +++ b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:qr_flutter/qr_flutter.dart'; import '../../../models/mwc_slatepack_models.dart'; import '../../../notifications/show_flush_bar.dart'; @@ -10,7 +9,12 @@ import '../../../themes/stack_colors.dart'; import '../../../utilities/assets.dart'; import '../../../utilities/clipboard_interface.dart'; import '../../../utilities/text_styles.dart'; +import '../../../utilities/util.dart'; +import '../../../widgets/conditional_parent.dart'; import '../../../widgets/desktop/desktop_dialog_close_button.dart'; +import '../../../widgets/desktop/primary_button.dart'; +import '../../../widgets/qr.dart'; +import '../../../widgets/rounded_container.dart'; import '../../../widgets/rounded_white_container.dart'; class MwcSlatepackDialog extends ConsumerStatefulWidget { @@ -51,181 +55,160 @@ class _MwcSlatepackDialogState extends ConsumerState { @override Widget build(BuildContext context) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - // Header with title and close button. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only(left: 32), - child: Text( - "Send Slatepack", - style: STextStyles.pageTitleH2(context), - ), - ), - const DesktopDialogCloseButton(), - ], - ), - Padding( - padding: const EdgeInsets.all(32), - child: Column( + return ConditionalParent( + condition: Util.isDesktop, + builder: + (child) => Column( mainAxisSize: MainAxisSize.min, children: [ - // Instructions. - Container( - padding: const EdgeInsets.all(12), - width: double.infinity, - decoration: BoxDecoration( - color: Theme.of( + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Send Slatepack", + style: STextStyles.pageTitleH2(context), + ), + ), + const DesktopDialogCloseButton(), + ], + ), + Padding(padding: const EdgeInsets.all(32), child: child), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // Instructions. + RoundedContainer( + color: + Theme.of(context).extension()!.textFieldDefaultBG, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Next Steps:", + style: STextStyles.label( context, - ).extension()!.infoItemIcons.withOpacity(0.05), - borderRadius: BorderRadius.circular(8), + ).copyWith(fontWeight: FontWeight.w600), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Next Steps:", - style: STextStyles.label( - context, - ).copyWith(fontWeight: FontWeight.w600), - ), - const SizedBox(height: 8), - Text( - "1. Share this slatepack with the recipient\n" - "2. Wait for them to return the response slatepack\n" - "3. Import their response to finalize the transaction", - style: STextStyles.w400_14(context), - ), - ], + const SizedBox(height: 8), + Text( + "1. Share this slatepack with the recipient\n" + "2. Wait for them to return the response slatepack\n" + "3. Import their response to finalize the transaction", + style: STextStyles.w400_14(context), ), - ), + ], + ), + ), - // Encryption status. - // we don't encrypt so ignore for now - // if (widget.slatepackResult.wasEncrypted == true) - // Container( - // padding: const EdgeInsets.symmetric( - // horizontal: 12, - // vertical: 8, - // ), - // decoration: BoxDecoration( - // color: Theme.of( - // context, - // ).extension()!.infoItemIcons.withOpacity(0.1), - // borderRadius: BorderRadius.circular(8), - // ), - // child: Row( - // mainAxisSize: MainAxisSize.min, - // children: [ - // Icon( - // Icons.lock, - // size: 16, - // color: - // Theme.of( - // context, - // ).extension()!.infoItemIcons, - // ), - // const SizedBox(width: 8), - // Text( - // "Encrypted for recipient", - // style: STextStyles.label(context).copyWith( - // color: - // Theme.of( - // context, - // ).extension()!.infoItemIcons, - // ), - // ), - // ], - // ), - // ), - const SizedBox(height: 24), + // Encryption status. + // we don't encrypt so ignore for now + // if (widget.slatepackResult.wasEncrypted == true) + // Container( + // padding: const EdgeInsets.symmetric( + // horizontal: 12, + // vertical: 8, + // ), + // decoration: BoxDecoration( + // color: Theme.of( + // context, + // ).extension()!.infoItemIcons.withOpacity(0.1), + // borderRadius: BorderRadius.circular(8), + // ), + // child: Row( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Icon( + // Icons.lock, + // size: 16, + // color: + // Theme.of( + // context, + // ).extension()!.infoItemIcons, + // ), + // const SizedBox(width: 8), + // Text( + // "Encrypted for recipient", + // style: STextStyles.label(context).copyWith( + // color: + // Theme.of( + // context, + // ).extension()!.infoItemIcons, + // ), + // ), + // ], + // ), + // ), + const SizedBox(height: 12), - // QR Code view. - RoundedWhiteContainer( - child: Column( - children: [ - Text( - "Slatepack QR Code", - style: STextStyles.itemSubtitle(context), - ), - const SizedBox(height: 8), - Container( - padding: const EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), - child: QrImageView( - data: widget.slatepackResult.slatepack!, - size: 200, - backgroundColor: Colors.white, - foregroundColor: Colors.black, - errorCorrectionLevel: QrErrorCorrectLevel.M, - ), - ), - ], - ), - ), + // QR Code view. + Center( + child: QR( + data: widget.slatepackResult.slatepack!, + size: 220, + // errorCorrectionLevel: QrErrorCorrectLevel.M, + ), + ), - const SizedBox(height: 12), + const SizedBox(height: 12), - // Slatepack text view. - RoundedWhiteContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + // Slatepack text view. + RoundedWhiteContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( children: [ - Row( - children: [ - Text( - "Slatepack", - style: STextStyles.itemSubtitle(context), - ), - const Spacer(), - GestureDetector( - onTap: _copySlatepack, - child: Row( - children: [ - SvgPicture.asset( - Assets.svg.copy, - width: 10, - height: 10, - color: - Theme.of( - context, - ).extension()!.infoItemIcons, - ), - const SizedBox(width: 4), - Text("Copy", style: STextStyles.link2(context)), - ], + Text("Slatepack", style: STextStyles.itemSubtitle(context)), + const Spacer(), + GestureDetector( + onTap: _copySlatepack, + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.copy, + width: 10, + height: 10, + color: + Theme.of( + context, + ).extension()!.infoItemIcons, ), - ), - ], - ), - const SizedBox(height: 8), - Container( - constraints: const BoxConstraints( - maxHeight: 200, - minHeight: 100, - ), - child: SingleChildScrollView( - child: SelectableText( - widget.slatepackResult.slatepack!, - style: STextStyles.w400_14( - context, - ).copyWith(fontFamily: 'monospace'), - ), + const SizedBox(width: 4), + Text("Copy", style: STextStyles.link2(context)), + ], ), ), ], ), - ), - ], + const SizedBox(height: 8), + Container( + constraints: const BoxConstraints( + maxHeight: 200, + minHeight: 100, + ), + child: SingleChildScrollView( + child: SelectableText( + widget.slatepackResult.slatepack!, + style: STextStyles.w400_14( + context, + ).copyWith(fontFamily: 'monospace'), + ), + ), + ), + ], + ), ), - ), - ], + + if (!Util.isDesktop) + PrimaryButton(label: "Done", onPressed: Navigator.of(context).pop), + ], + ), ); } } From 084a622c32ef5d654f943176b52fcf7ac059e26b Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 19 Sep 2025 08:07:10 -0600 Subject: [PATCH 090/178] update libmwc --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index d34d8fb244..715ab35eb0 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit d34d8fb2447dd3bf732bb07b68bd3254732ba7b6 +Subproject commit 715ab35eb00af7c96600e1df897fc4e4dd711b14 From 88add78be4ef790f446c82103b0276a75c83edc1 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 19 Sep 2025 08:32:58 -0600 Subject: [PATCH 091/178] dart format --- .../wallet/impl/mimblewimblecoin_wallet.dart | 63 ++++++++++++------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 42e807fc2a..5566091c82 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -17,6 +17,7 @@ import '../../../models/isar/models/blockchain_data/transaction.dart'; import '../../../models/isar/models/blockchain_data/v2/input_v2.dart'; import '../../../models/isar/models/blockchain_data/v2/output_v2.dart'; import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; +import '../../../models/mwc_slatepack_models.dart'; import '../../../models/mwcmqs_config_model.dart'; import '../../../models/node_model.dart'; import '../../../models/paymint/fee_object_model.dart'; @@ -26,7 +27,6 @@ import '../../../services/event_bus/events/global/node_connection_status_changed import '../../../services/event_bus/events/global/refresh_percent_changed_event.dart'; import '../../../services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import '../../../services/event_bus/global_event_bus.dart'; -import '../../../models/mwc_slatepack_models.dart'; import '../../../utilities/amount/amount.dart'; import '../../../utilities/default_mwcmqs.dart'; import '../../../utilities/flutter_secure_storage_interface.dart'; @@ -76,26 +76,36 @@ class MimblewimblecoinWallet extends Bip39Wallet { key: '${walletId}_mwcmqsConfig', value: stringConfig, ); - + // Restart MWCMQS listener with new configuration if wallet has a handle. try { - final handle = await secureStorageInterface.read(key: '${walletId}_wallet'); + final handle = await secureStorageInterface.read( + key: '${walletId}_wallet', + ); if (handle != null && handle.isNotEmpty) { await stopSlatepackListener(); await startSlatepackListener(); - Logging.instance.i('Restarted MWCMQS listener with new config: $host:$port'); + Logging.instance.i( + 'Restarted MWCMQS listener with new config: $host:$port', + ); } } catch (e, s) { - Logging.instance.e('Failed to restart MWCMQS listener after config update: $e\n$s'); + Logging.instance.e( + 'Failed to restart MWCMQS listener after config update: $e\n$s', + ); } } Future _ensureWalletOpen() async { - final existing = await secureStorageInterface.read(key: '${walletId}_wallet'); + final existing = await secureStorageInterface.read( + key: '${walletId}_wallet', + ); if (existing != null && existing.isNotEmpty) return existing; final config = await _getRealConfig(); - final password = await secureStorageInterface.read(key: '${walletId}_password'); + final password = await secureStorageInterface.read( + key: '${walletId}_password', + ); if (password == null) { throw Exception('Wallet password not found'); } @@ -103,7 +113,10 @@ class MimblewimblecoinWallet extends Bip39Wallet { config: config, password: password, ); - await secureStorageInterface.write(key: '${walletId}_wallet', value: opened); + await secureStorageInterface.write( + key: '${walletId}_wallet', + value: opened, + ); return opened; } @@ -133,15 +146,13 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (customConfigJson != null) { try { - final customConfig = jsonDecode(customConfigJson) as Map; + final customConfig = + jsonDecode(customConfigJson) as Map; final host = customConfig['mwcmqs_domain'] as String?; final port = customConfig['mwcmqs_port'] as int?; - + if (host != null && port != null) { - return MwcMqsConfigModel( - host: host, - port: port, - ); + return MwcMqsConfigModel(host: host, port: port); } } catch (e) { Logging.instance.w('Failed to parse custom MWCMQS config: $e'); @@ -199,13 +210,18 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Decode a slatepack. Future decodeSlatepack(String slatepack) async { try { - final handle = await secureStorageInterface.read(key: '${walletId}_wallet'); - final result = handle != null - ? await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( - wallet: handle, - slatepack: slatepack, - ) - : await mimblewimblecoin.Libmwc.decodeSlatepack(slatepack: slatepack); + final handle = await secureStorageInterface.read( + key: '${walletId}_wallet', + ); + final result = + handle != null + ? await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( + wallet: handle, + slatepack: slatepack, + ) + : await mimblewimblecoin.Libmwc.decodeSlatepack( + slatepack: slatepack, + ); return SlatepackDecodeResult( success: true, @@ -292,7 +308,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { try { await _ensureWalletOpen(); final mwcmqsConfig = await getMwcMqsConfig(); - final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); + final wallet = await secureStorageInterface.read( + key: '${walletId}_wallet', + ); mimblewimblecoin.Libmwc.startMwcMqsListener( wallet: wallet!, mwcmqsConfig: mwcmqsConfig.toString(), @@ -798,7 +816,6 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future init({bool? isRestore}) async { - if (isRestore != true) { String? encodedWallet = await secureStorageInterface.read( key: "${walletId}_wallet", From cdcdafe35efbd79c4673599108329040a6afd5ba Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 19 Sep 2025 08:59:55 -0600 Subject: [PATCH 092/178] bare minimum but functional slatepack ui in both desktop and mobile UIs --- lib/pages/receive_view/receive_view.dart | 70 +++++- .../sub_widgets/slatepack_entry_dialog.dart | 223 ++++++++++++++++++ .../sub_widgets/desktop_receive.dart | 51 +--- .../wallet/impl/mimblewimblecoin_wallet.dart | 47 ++++ 4 files changed, 329 insertions(+), 62 deletions(-) create mode 100644 lib/pages/receive_view/sub_widgets/slatepack_entry_dialog.dart diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index 9e476ad98d..693bed3082 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -48,10 +48,14 @@ import '../../widgets/custom_buttons/blue_text_button.dart'; import '../../widgets/custom_loading_overlay.dart'; import '../../widgets/desktop/primary_button.dart'; import '../../widgets/desktop/secondary_button.dart'; +import '../../widgets/dialogs/s_dialog.dart'; import '../../widgets/qr.dart'; import '../../widgets/rounded_white_container.dart'; +import '../../widgets/stack_dialog.dart'; import 'addresses/wallet_addresses_view.dart'; import 'generate_receiving_uri_qr_code_view.dart'; +import 'sub_widgets/mwc_slatepack_import_dialog.dart'; +import 'sub_widgets/slatepack_entry_dialog.dart'; class ReceiveView extends ConsumerStatefulWidget { const ReceiveView({ @@ -85,6 +89,58 @@ class _ReceiveViewState extends ConsumerState { final Map _addressMap = {}; final Map> _addressSubMap = {}; + Future _importSlatepack() async { + final slatepackString = await showDialog( + context: context, + builder: (context) => const SlatepackEntryDialog(), + ); + + if (slatepackString == null) return; + if (mounted) { + final wallet = + ref.read(pWallets).getWallet(walletId) as MimblewimblecoinWallet; + + Exception? ex; + final result = await showLoading( + whileFuture: wallet.fullDecodeSlatepack(slatepackString), + context: context, + message: "Decoding slatepack...", + onException: (e) => ex = e, + ); + + if (result == null || ex != null) { + if (mounted) { + await showDialog( + context: context, + builder: + (context) => StackOkDialog( + title: "Slatepack receive error", + message: + ex?.toString() ?? "Unexpected result without exception", + ), + ); + } + return; + } + + if (mounted) { + await showDialog( + context: context, + builder: + (context) => SDialog( + child: MwcSlatepackImportDialog( + walletId: widget.walletId, + clipboard: widget.clipboard, + rawSlatepack: result.raw, + decoded: result.result, + slatepackType: result.type, + ), + ), + ); + } + } + } + Future generateNewAddress() async { final wallet = ref.read(pWallets).getWallet(walletId); @@ -698,19 +754,7 @@ class _ReceiveViewState extends ConsumerState { const SizedBox(height: 12), SecondaryButton( label: "Import Slatepack", - onPressed: () async { - final wallet = ref.read(pWallets).getWallet(walletId); - if (wallet is MimblewimblecoinWallet) { - // await showDialog( - // context: context, - // builder: - // (context) => MwcSlatepackImportDialog( - // wallet: wallet, - // clipboard: clipboard, - // ), - // ); - } - }, + onPressed: _importSlatepack, ), ], const SizedBox(height: 30), diff --git a/lib/pages/receive_view/sub_widgets/slatepack_entry_dialog.dart b/lib/pages/receive_view/sub_widgets/slatepack_entry_dialog.dart new file mode 100644 index 0000000000..ec9aee0c36 --- /dev/null +++ b/lib/pages/receive_view/sub_widgets/slatepack_entry_dialog.dart @@ -0,0 +1,223 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../../providers/global/barcode_scanner_provider.dart'; +import '../../../themes/stack_colors.dart'; +import '../../../utilities/barcode_scanner_interface.dart'; +import '../../../utilities/clipboard_interface.dart'; +import '../../../utilities/constants.dart'; +import '../../../utilities/logger.dart'; +import '../../../utilities/text_styles.dart'; +import '../../../widgets/desktop/primary_button.dart'; +import '../../../widgets/desktop/secondary_button.dart'; +import '../../../widgets/icon_widgets/clipboard_icon.dart'; +import '../../../widgets/icon_widgets/qrcode_icon.dart'; +import '../../../widgets/icon_widgets/x_icon.dart'; +import '../../../widgets/stack_dialog.dart'; +import '../../../widgets/stack_text_field.dart'; +import '../../../widgets/textfield_icon_button.dart'; + +class SlatepackEntryDialog extends ConsumerStatefulWidget { + const SlatepackEntryDialog({ + super.key, + this.clipboard = const ClipboardWrapper(), + }); + + final ClipboardInterface clipboard; + + @override + ConsumerState createState() => + _SlatepackEntryDialogState(); +} + +class _SlatepackEntryDialogState extends ConsumerState { + final _receiveSlateController = TextEditingController(); + final _slateFocusNode = FocusNode(); + + bool _slateToggleFlag = false; + + Future _pasteSlatepack() async { + final ClipboardData? data = await widget.clipboard.getData( + Clipboard.kTextPlain, + ); + if (data?.text != null && data!.text!.isNotEmpty) { + _receiveSlateController.text = data.text!; + setState(() { + _slateToggleFlag = _receiveSlateController.text.isNotEmpty; + }); + } + } + + Future _scanQr() async { + try { + if (_slateFocusNode.hasFocus) { + _slateFocusNode.unfocus(); + await Future.delayed(const Duration(milliseconds: 75)); + } + + if (mounted) { + final qrResult = await ref.read(pBarcodeScanner).scan(context: context); + if (qrResult.rawContent.isNotEmpty && qrResult.rawContent != "null") { + _receiveSlateController.text = qrResult.rawContent; + setState(() { + _slateToggleFlag = _receiveSlateController.text.isNotEmpty; + }); + } + } + } on PlatformException catch (e, s) { + if (mounted) { + try { + await checkCamPermDeniedMobileAndOpenAppSettings( + context, + logging: Logging.instance, + ); + } catch (e, s) { + Logging.instance.e( + "Failed to check cam permissions", + error: e, + stackTrace: s, + ); + } + } else { + Logging.instance.e( + "Failed to get camera permissions while trying to scan qr code in SendView: ", + error: e, + stackTrace: s, + ); + } + } + } + + @override + void dispose() { + _receiveSlateController.dispose(); + _slateFocusNode.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return StackDialogBase( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "Receive Slatepack", + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, + ), + textAlign: TextAlign.left, + ), + const SizedBox(height: 12), + ClipRRect( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + minLines: 1, + maxLines: 5, + key: const Key("receiveViewSlatepackFieldKey"), + controller: _receiveSlateController, + readOnly: false, + autocorrect: false, + enableSuggestions: false, + toolbarOptions: const ToolbarOptions( + copy: false, + cut: false, + paste: true, + selectAll: false, + ), + onChanged: (newValue) { + setState(() { + _slateToggleFlag = newValue.isNotEmpty; + }); + }, + focusNode: _slateFocusNode, + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textFieldActiveText, + height: 1.8, + ), + decoration: standardInputDecoration( + "Enter Slatepack Message", + _slateFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 12, // Adjust vertical padding for better alignment + ), + suffixIcon: Padding( + padding: + _receiveSlateController.text.isEmpty + ? const EdgeInsets.only(right: 8) + : const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _slateToggleFlag + ? TextFieldIconButton( + key: const Key( + "receiveViewClearSlatepackFieldButtonKey", + ), + onTap: () { + _receiveSlateController.text = ""; + setState(() { + _slateToggleFlag = false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + key: const Key( + "receiveViewPasteSlatepackFieldButtonKey", + ), + onTap: _pasteSlatepack, + child: + _receiveSlateController.text.isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + if (_receiveSlateController.text.isEmpty) + TextFieldIconButton( + semanticsLabel: + "Scan QR Button. Opens Camera For Scanning QR Code.", + key: const Key("sendViewScanQrButtonKey"), + onTap: _scanQr, + child: const QrCodeIcon(), + ), + ], + ), + ), + ), + ), + ), + ), + const SizedBox(height: 16), + PrimaryButton( + label: "Import", + enabled: _slateToggleFlag, + onPressed: + !_slateToggleFlag + ? null + : () => + Navigator.of(context).pop(_receiveSlateController.text), + ), + const SizedBox(height: 16), + SecondaryButton( + label: "Cancel", + onPressed: Navigator.of(context).pop, + ), + ], + ), + ); + } +} 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 3fe9f4ed53..3e30ff8ca8 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 @@ -20,7 +20,6 @@ import 'package:tuple/tuple.dart'; import '../../../../models/isar/models/isar_models.dart'; import '../../../../models/keys/view_only_wallet_data.dart'; -import '../../../../models/mwc_slatepack_models.dart'; import '../../../../notifications/show_flush_bar.dart'; import '../../../../pages/receive_view/generate_receiving_uri_qr_code_view.dart'; import '../../../../pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart'; @@ -111,59 +110,13 @@ class _DesktopReceiveState extends ConsumerState { } } - Future<({SlatepackDecodeResult result, String type, String raw})?> - _decodeSlatepack() async { - // add delay for showloading exception catching hack fix - await Future.delayed(const Duration(seconds: 1)); - + Future _onReceiveSlatePressed() async { final wallet = ref.read(pWallets).getWallet(walletId) as MimblewimblecoinWallet; - final text = _receiveSlateController.text.trim(); - - if (text.isEmpty) { - return null; - } - - // Basic format validation. - final coin = wallet.cryptoCurrency as Mimblewimblecoin; - if (!coin.isSlatepack(text)) { - throw Exception("Invalid slatepack format"); - } - - // Attempt to decode. - final decoded = await wallet.decodeSlatepack(text); - - if (decoded.success) { - final analysis = await wallet.analyzeSlatepack(text); - - String _determineSlatepackType(SlatepackDecodeResult decoded) { - // Fallback analysis based on sender/recipient addresses. - if (decoded.senderAddress != null && decoded.recipientAddress != null) { - return "S2 (Response)"; - } else if (decoded.senderAddress != null) { - return "S1 (Initial)"; - } else { - return "Unknown"; - } - } - final String slatepackType = switch (analysis.status) { - 'S1' => "S1 (Initial Send)", - 'S2' => "S2 (Response)", - 'S3' => "S3 (Finalized)", - _ => _determineSlatepackType(decoded), // Fallback. - }; - - return (result: decoded, type: slatepackType, raw: text); - } else { - throw Exception(decoded.error ?? "Failed to decode slatepack"); - } - } - - Future _onReceiveSlatePressed() async { Exception? ex; final result = await showLoading( - whileFuture: _decodeSlatepack(), + whileFuture: wallet.fullDecodeSlatepack(_receiveSlateController.text), context: context, message: "Decoding slatepack...", rootNavigator: Util.isDesktop, diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 5566091c82..567908275e 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -207,6 +207,53 @@ class MimblewimblecoinWallet extends Bip39Wallet { } } + // this isn't nearly the best way to handle this but better than copy pasting + // this function in two places (mobile and desktop widgets)... + Future<({SlatepackDecodeResult result, String type, String raw})?> + fullDecodeSlatepack(String slatepack) async { + // add delay for showloading exception catching hack fix + await Future.delayed(const Duration(seconds: 1)); + + if (slatepack.isEmpty) { + return null; + } + + // Basic format validation. + final coin = cryptoCurrency as Mimblewimblecoin; + if (!coin.isSlatepack(slatepack)) { + throw Exception("Invalid slatepack format"); + } + + // Attempt to decode. + final decoded = await decodeSlatepack(slatepack); + + if (decoded.success) { + final analysis = await analyzeSlatepack(slatepack); + + String _determineSlatepackType(SlatepackDecodeResult decoded) { + // Fallback analysis based on sender/recipient addresses. + if (decoded.senderAddress != null && decoded.recipientAddress != null) { + return "S2 (Response)"; + } else if (decoded.senderAddress != null) { + return "S1 (Initial)"; + } else { + return "Unknown"; + } + } + + final String slatepackType = switch (analysis.status) { + 'S1' => "S1 (Initial Send)", + 'S2' => "S2 (Response)", + 'S3' => "S3 (Finalized)", + _ => _determineSlatepackType(decoded), // Fallback. + }; + + return (result: decoded, type: slatepackType, raw: slatepack); + } else { + throw Exception(decoded.error ?? "Failed to decode slatepack"); + } + } + /// Decode a slatepack. Future decodeSlatepack(String slatepack) async { try { From f4e5e81947ee819bbd835d07b2bdbd6031a5d829 Mon Sep 17 00:00:00 2001 From: Julian Date: Fri, 19 Sep 2025 13:43:47 -0600 Subject: [PATCH 093/178] update libmwc --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 715ab35eb0..8dc699c35f 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 715ab35eb00af7c96600e1df897fc4e4dd711b14 +Subproject commit 8dc699c35f1bae8337548a74b84e2fe4b2d1f2ba From 71d937b1b7fd14e8d1f5f17b282d5a6ec4587479 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sun, 21 Sep 2025 21:06:03 -0500 Subject: [PATCH 094/178] fix(mwc): update flutter_libmwc macOS deployment target to 10.14 --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 8dc699c35f..7f721883d2 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 8dc699c35f1bae8337548a74b84e2fe4b2d1f2ba +Subproject commit 7f721883d22f892b49a1b58a162740aa425bc06f From 12a895ca9faf8b179412e9f11b4a2554651919c3 Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 22 Sep 2025 12:16:58 -0600 Subject: [PATCH 095/178] fix: textfield hint text --- lib/pages/send_view/send_view.dart | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 77cbee8b63..1577e568e8 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -151,9 +151,6 @@ class _SendViewState extends ConsumerState { Set selectedUTXOs = {}; - // MWC transaction method selection. - MwcTransactionMethod? _selectedTransactionMethod; - void _applyUri(PaymentUriData paymentData) { try { // auto fill address @@ -1676,11 +1673,7 @@ class _SendViewState extends ConsumerState { focusNode: _addressFocusNode, style: STextStyles.field(context), decoration: standardInputDecoration( - coin is Mimblewimblecoin && - _selectedTransactionMethod == - MwcTransactionMethod - .slatepack || - _selectedTransactionMethod == null + isMwcSlatepack ? "Enter ${coin.ticker} address (optional)" : "Enter ${coin.ticker} address", _addressFocusNode, From f10021dc2a21fba43fafa6c587bc9df9876b618a Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 22 Sep 2025 12:19:16 -0600 Subject: [PATCH 096/178] use minimal libmwc changes branch --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 7f721883d2..964c362e8e 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 7f721883d22f892b49a1b58a162740aa425bc06f +Subproject commit 964c362e8efdd5719ad4618c9c5c42b454a0f4d9 From eaf3af94d8ced39ce701fcef520b87e2ecedbe2c Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 22 Sep 2025 13:34:33 -0600 Subject: [PATCH 097/178] clean up import receive mwc slatepack info dialog --- .../mwc_slatepack_import_dialog.dart | 139 +++++++++++++----- 1 file changed, 102 insertions(+), 37 deletions(-) diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart index 90080feb5a..18b6af7bd4 100644 --- a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -7,11 +9,14 @@ import '../../../models/mwc_slatepack_models.dart'; import '../../../notifications/show_flush_bar.dart'; import '../../../providers/global/wallets_provider.dart'; import '../../../themes/stack_colors.dart'; +import '../../../utilities/amount/amount.dart'; +import '../../../utilities/amount/amount_formatter.dart'; import '../../../utilities/assets.dart'; import '../../../utilities/clipboard_interface.dart'; import '../../../utilities/show_loading.dart'; import '../../../utilities/text_styles.dart'; import '../../../utilities/util.dart'; +import '../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../widgets/conditional_parent.dart'; import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; @@ -112,6 +117,37 @@ class _MwcSlatepackImportDialogState } } + late final Amount? _amount; + + // late final Amount? _fee; + + @override + void initState() { + final map = jsonDecode(widget.decoded.slateJson!) as Map; + + final rawAmount = BigInt.tryParse(map["amount"].toString()); + _amount = + rawAmount == null + ? null + : Amount( + rawValue: rawAmount, + fractionDigits: + ref.read(pWalletCoin(widget.walletId)).fractionDigits, + ); + + // final rawFee = BigInt.tryParse(map["fee"].toString()); + // _fee = + // rawFee == null + // ? null + // : Amount( + // rawValue: rawFee, + // fractionDigits: + // ref.read(pWalletCoin(widget.walletId)).fractionDigits, + // ); + + super.initState(); + } + @override Widget build(BuildContext context) { final isDesktop = Util.isDesktop; @@ -119,22 +155,23 @@ class _MwcSlatepackImportDialogState return Column( mainAxisSize: MainAxisSize.min, children: [ - // Header with title and close button. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only(left: 32), - child: Text( - "Import Slatepack", - style: STextStyles.pageTitleH2(context), + if (isDesktop) + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Import Slatepack", + style: STextStyles.pageTitleH2(context), + ), ), - ), - const DesktopDialogCloseButton(), - ], - ), + const DesktopDialogCloseButton(), + ], + ), Padding( - padding: const EdgeInsets.symmetric(horizontal: 32), + padding: EdgeInsets.symmetric(horizontal: isDesktop ? 32 : 16), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, @@ -156,31 +193,59 @@ class _MwcSlatepackImportDialogState mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - DetailItem(title: "Type", detail: widget.slatepackType), - const DetailDivider(), - DetailItem( - title: "Encrypted", - detail: (widget.decoded.wasEncrypted ?? false).toString(), - ), - if (widget.decoded.senderAddress != null) - const DetailDivider(), - if (widget.decoded.senderAddress != null) - DetailItem( - title: "From", - detail: widget.decoded.senderAddress!, + if (!isDesktop) + Padding( + padding: const EdgeInsets.only(top: 16, bottom: 24), + child: Text( + "Import slatepack", + style: STextStyles.pageTitleH2(context), + ), ), - if (widget.decoded.recipientAddress != null) - const DetailDivider(), - if (widget.decoded.recipientAddress != null) + + // DetailItem(title: "Type", detail: widget.slatepackType), + // const DetailDivider(), + // DetailItem( + // title: "Encrypted", + // detail: (widget.decoded.wasEncrypted ?? false).toString(), + // ), + // if (widget.decoded.senderAddress != null) + // const DetailDivider(), + // if (widget.decoded.senderAddress != null) + // DetailItem( + // title: "From", + // detail: widget.decoded.senderAddress!, + // ), + // if (widget.decoded.recipientAddress != null) + // const DetailDivider(), + // if (widget.decoded.recipientAddress != null) + // DetailItem( + // title: "To", + // detail: widget.decoded.recipientAddress!, + // ), + // if (_amount != null) const DetailDivider(), + if (_amount != null) DetailItem( - title: "To", - detail: widget.decoded.recipientAddress!, + title: "Amount", + detail: ref + .watch( + pAmountFormatter( + ref.watch(pWalletCoin(widget.walletId)), + ), + ) + .format(_amount), ), - const DetailDivider(), - DetailItem( - title: "Slatepack", - detail: widget.decoded.slateJson!, - ), + // if (_fee != null) const DetailDivider(), + // if (_fee != null) + // DetailItem( + // title: "Fee", + // detail: ref + // .watch( + // pAmountFormatter( + // ref.watch(pWalletCoin(widget.walletId)), + // ), + // ) + // .format(_fee), + // ), ], ), ), @@ -209,7 +274,7 @@ class _MwcSlatepackImportDialogState ], ), ), - const SizedBox(height: 32), + isDesktop ? const SizedBox(height: 32) : const SizedBox(height: 16), ], ); } From 905031cc4e61997efdee365bfd680af7234fa3f3 Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 22 Sep 2025 13:34:33 -0600 Subject: [PATCH 098/178] clean up import receive mwc slatepack response dialog --- .../mwc_slatepack_import_dialog.dart | 321 +++++++++--------- 1 file changed, 157 insertions(+), 164 deletions(-) diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart index 90080feb5a..105c7e8504 100644 --- a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -1,24 +1,26 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import '../../../models/mwc_slatepack_models.dart'; -import '../../../notifications/show_flush_bar.dart'; import '../../../providers/global/wallets_provider.dart'; import '../../../themes/stack_colors.dart'; -import '../../../utilities/assets.dart'; +import '../../../utilities/amount/amount.dart'; +import '../../../utilities/amount/amount_formatter.dart'; import '../../../utilities/clipboard_interface.dart'; import '../../../utilities/show_loading.dart'; import '../../../utilities/text_styles.dart'; import '../../../utilities/util.dart'; +import '../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../widgets/conditional_parent.dart'; -import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; +import '../../../widgets/custom_buttons/simple_copy_button.dart'; import '../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../widgets/desktop/primary_button.dart'; import '../../../widgets/desktop/secondary_button.dart'; import '../../../widgets/detail_item.dart'; +import '../../../widgets/dialogs/s_dialog.dart'; import '../../../widgets/rounded_white_container.dart'; import '../../../widgets/stack_dialog.dart'; @@ -106,12 +108,42 @@ class _MwcSlatepackImportDialogState (context) => _SlatepackResponseDialog( responseSlatepack: result.responseSlatepack, wasEncrypted: result.wasEncrypted, - clipboard: widget.clipboard, ), ); } } + late final Amount? _amount; + + // late final Amount? _fee; + + @override + void initState() { + final map = jsonDecode(widget.decoded.slateJson!) as Map; + + final rawAmount = BigInt.tryParse(map["amount"].toString()); + _amount = + rawAmount == null + ? null + : Amount( + rawValue: rawAmount, + fractionDigits: + ref.read(pWalletCoin(widget.walletId)).fractionDigits, + ); + + // final rawFee = BigInt.tryParse(map["fee"].toString()); + // _fee = + // rawFee == null + // ? null + // : Amount( + // rawValue: rawFee, + // fractionDigits: + // ref.read(pWalletCoin(widget.walletId)).fractionDigits, + // ); + + super.initState(); + } + @override Widget build(BuildContext context) { final isDesktop = Util.isDesktop; @@ -119,22 +151,23 @@ class _MwcSlatepackImportDialogState return Column( mainAxisSize: MainAxisSize.min, children: [ - // Header with title and close button. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only(left: 32), - child: Text( - "Import Slatepack", - style: STextStyles.pageTitleH2(context), + if (isDesktop) + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Import Slatepack", + style: STextStyles.pageTitleH2(context), + ), ), - ), - const DesktopDialogCloseButton(), - ], - ), + const DesktopDialogCloseButton(), + ], + ), Padding( - padding: const EdgeInsets.symmetric(horizontal: 32), + padding: EdgeInsets.symmetric(horizontal: isDesktop ? 32 : 16), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, @@ -156,31 +189,59 @@ class _MwcSlatepackImportDialogState mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - DetailItem(title: "Type", detail: widget.slatepackType), - const DetailDivider(), - DetailItem( - title: "Encrypted", - detail: (widget.decoded.wasEncrypted ?? false).toString(), - ), - if (widget.decoded.senderAddress != null) - const DetailDivider(), - if (widget.decoded.senderAddress != null) - DetailItem( - title: "From", - detail: widget.decoded.senderAddress!, + if (!isDesktop) + Padding( + padding: const EdgeInsets.only(top: 16, bottom: 24), + child: Text( + "Import slatepack", + style: STextStyles.pageTitleH2(context), + ), ), - if (widget.decoded.recipientAddress != null) - const DetailDivider(), - if (widget.decoded.recipientAddress != null) + + // DetailItem(title: "Type", detail: widget.slatepackType), + // const DetailDivider(), + // DetailItem( + // title: "Encrypted", + // detail: (widget.decoded.wasEncrypted ?? false).toString(), + // ), + // if (widget.decoded.senderAddress != null) + // const DetailDivider(), + // if (widget.decoded.senderAddress != null) + // DetailItem( + // title: "From", + // detail: widget.decoded.senderAddress!, + // ), + // if (widget.decoded.recipientAddress != null) + // const DetailDivider(), + // if (widget.decoded.recipientAddress != null) + // DetailItem( + // title: "To", + // detail: widget.decoded.recipientAddress!, + // ), + // if (_amount != null) const DetailDivider(), + if (_amount != null) DetailItem( - title: "To", - detail: widget.decoded.recipientAddress!, + title: "Amount", + detail: ref + .watch( + pAmountFormatter( + ref.watch(pWalletCoin(widget.walletId)), + ), + ) + .format(_amount), ), - const DetailDivider(), - DetailItem( - title: "Slatepack", - detail: widget.decoded.slateJson!, - ), + // if (_fee != null) const DetailDivider(), + // if (_fee != null) + // DetailItem( + // title: "Fee", + // detail: ref + // .watch( + // pAmountFormatter( + // ref.watch(pWalletCoin(widget.walletId)), + // ), + // ) + // .format(_fee), + // ), ], ), ), @@ -209,7 +270,7 @@ class _MwcSlatepackImportDialogState ], ), ), - const SizedBox(height: 32), + isDesktop ? const SizedBox(height: 32) : const SizedBox(height: 16), ], ); } @@ -219,151 +280,83 @@ class _SlatepackResponseDialog extends StatelessWidget { const _SlatepackResponseDialog({ required this.responseSlatepack, required this.wasEncrypted, - required this.clipboard, }); final String responseSlatepack; final bool wasEncrypted; - final ClipboardInterface clipboard; - - void _copySlatepack(BuildContext context) { - clipboard.setData(ClipboardData(text: responseSlatepack)); - showFloatingFlushBar( - type: FlushBarType.info, - message: "Response slatepack copied to clipboard", - iconAsset: Assets.svg.copy, - context: context, - ); - } @override Widget build(BuildContext context) { - return StackDialogBase( + return SDialog( child: Column( mainAxisSize: MainAxisSize.min, children: [ // Header with title and close button. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Response Slatepack", - style: STextStyles.pageTitleH2(context), - ), - AppBarIconButton( - size: 36, - color: Theme.of(context).extension()!.background, - shadows: const [], - icon: SvgPicture.asset( - Assets.svg.x, - color: - Theme.of( - context, - ).extension()!.topNavIconPrimary, - width: 24, - height: 24, - ), - onPressed: () => Navigator.of(context).pop(), + if (Util.isDesktop) + Padding( + padding: const EdgeInsets.only(left: 32), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Response Slatepack", + style: STextStyles.pageTitleH2(context), + ), + const DesktopDialogCloseButton(), + ], ), - ], - ), - const SizedBox(height: 16), + ), Padding( - padding: const EdgeInsets.all(24), + padding: + Util.isDesktop + ? const EdgeInsets.only(left: 32, right: 32, bottom: 32) + : const EdgeInsets.only(left: 24, right: 24, bottom: 24), child: Column( mainAxisSize: MainAxisSize.min, children: [ + if (!Util.isDesktop) const SizedBox(height: 24), Text( "Return this slatepack to the sender to complete the transaction.", - style: STextStyles.subtitle(context), - textAlign: TextAlign.center, + style: STextStyles.pageTitleH2(context), ), - const SizedBox(height: 16), - - if (wasEncrypted) - Container( - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 8, - ), - decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .infoItemIcons - .withOpacity(0.1), - borderRadius: BorderRadius.circular(8), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - Icons.lock, - size: 16, - color: - Theme.of( - context, - ).extension()!.infoItemIcons, - ), - const SizedBox(width: 8), - Text( - "Encrypted Response", - style: STextStyles.label(context), - ), - ], + const SizedBox(height: 24), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Response slatepack", + style: STextStyles.itemSubtitle(context), ), - ), - const SizedBox(height: 16), - - RoundedWhiteContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Row( - children: [ - Text( - "Response Slatepack", - style: STextStyles.itemSubtitle(context), - ), - const Spacer(), - GestureDetector( - onTap: () => _copySlatepack(context), - child: Row( - children: [ - SvgPicture.asset( - Assets.svg.copy, - width: 10, - height: 10, - ), - const SizedBox(width: 4), - Text("Copy", style: STextStyles.link2(context)), - ], - ), - ), - ], - ), - const SizedBox(height: 8), - Container( - constraints: const BoxConstraints( - maxHeight: 200, - minHeight: 100, - ), - child: SingleChildScrollView( - child: SelectableText( - responseSlatepack, - style: STextStyles.w400_14( - context, - ).copyWith(fontFamily: 'monospace'), - ), - ), + SimpleCopyButton(data: responseSlatepack), + ], + ), + const SizedBox(height: 8), + ConditionalParent( + condition: !Util.isDesktop, + builder: + (child) => SizedBox( + height: 220, + child: SingleChildScrollView(child: child), ), - ], + child: SelectableText( + responseSlatepack, + style: STextStyles.w500_14(context), ), ), - const SizedBox(height: 24), - PrimaryButton( - label: "Copy Response", - onPressed: () => _copySlatepack(context), + ConditionalParent( + condition: Util.isDesktop, + builder: + (child) => Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [child], + ), + child: PrimaryButton( + label: "Done", + width: Util.isDesktop ? 220 : null, + buttonHeight: Util.isDesktop ? ButtonHeight.l : null, + onPressed: Navigator.of(context).pop, + ), ), ], ), From 072f6aeb70e7cc8d124ca8910121dcc3711c6ea7 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 22 Sep 2025 19:27:15 -0500 Subject: [PATCH 099/178] fix(mwc): post (broadcast) finalized tx --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 964c362e8e..da3248981f 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 964c362e8efdd5719ad4618c9c5c42b454a0f4d9 +Subproject commit da3248981f1540322660d85a1dbe8a3328fc3816 From 6bc47344cb47aec4dae48df0a29716fbf074664c Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 23 Sep 2025 14:01:23 -0600 Subject: [PATCH 100/178] disable mwc on macos --- lib/app_config.dart | 3 +++ scripts/app_config/configure_stack_wallet.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/app_config.dart b/lib/app_config.dart index 09eeae26f7..5f9b37ab77 100644 --- a/lib/app_config.dart +++ b/lib/app_config.dart @@ -1,3 +1,6 @@ +// ignore: unused_import +import 'dart:io'; + import 'wallets/crypto_currency/crypto_currency.dart'; import 'wallets/crypto_currency/intermediate/frost_currency.dart'; diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index 175d950388..b407b7d473 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -62,7 +62,7 @@ final List _supportedCoins = List.unmodifiable([ Dogecoin(CryptoCurrencyNetwork.main), Ecash(CryptoCurrencyNetwork.main), Epiccash(CryptoCurrencyNetwork.main), - Mimblewimblecoin(CryptoCurrencyNetwork.main), + if (!Platform.isMacOS) Mimblewimblecoin(CryptoCurrencyNetwork.main), Ethereum(CryptoCurrencyNetwork.main), Fact0rn(CryptoCurrencyNetwork.main), Firo(CryptoCurrencyNetwork.main), From 9dcb9cac22914c2305ba4552f3e57d4accc2cf37 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 08:10:42 -0600 Subject: [PATCH 101/178] update libmwc with openWallet error checking --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index da3248981f..0581d81b5a 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit da3248981f1540322660d85a1dbe8a3328fc3816 +Subproject commit 0581d81b5abb9dbdee81a95b4b74958d81c3ae9b From 62c28caf3bf38e1bdf2c359c39f1cd9901bb81a4 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 09:22:17 -0600 Subject: [PATCH 102/178] clear finalize field on success --- lib/pages/finalize_view/finalize_view.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/finalize_view/finalize_view.dart b/lib/pages/finalize_view/finalize_view.dart index fa69aae52f..b2538bb5c1 100644 --- a/lib/pages/finalize_view/finalize_view.dart +++ b/lib/pages/finalize_view/finalize_view.dart @@ -166,6 +166,7 @@ class _FinalizeViewState extends ConsumerState { ), ); } else { + _slateController.text = ""; unawaited( showFloatingFlushBar( type: FlushBarType.success, From 8930f3742228af4405b034382b2a76f8f7e311a1 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 24 Sep 2025 09:52:22 -0600 Subject: [PATCH 103/178] mwc ui tweaks --- lib/pages/finalize_view/finalize_view.dart | 4 +- lib/pages/receive_view/receive_view.dart | 37 +++++++++++------ .../mwc_slatepack_import_dialog.dart | 21 ++++------ .../sub_widgets/desktop_receive.dart | 41 ++++++++++++------- 4 files changed, 62 insertions(+), 41 deletions(-) diff --git a/lib/pages/finalize_view/finalize_view.dart b/lib/pages/finalize_view/finalize_view.dart index b2538bb5c1..e0a3415907 100644 --- a/lib/pages/finalize_view/finalize_view.dart +++ b/lib/pages/finalize_view/finalize_view.dart @@ -166,7 +166,9 @@ class _FinalizeViewState extends ConsumerState { ), ); } else { - _slateController.text = ""; + setState(() { + _slateController.text = ""; + }); unawaited( showFloatingFlushBar( type: FlushBarType.success, diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index 693bed3082..3cd473b489 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -124,19 +124,32 @@ class _ReceiveViewState extends ConsumerState { } if (mounted) { - await showDialog( - context: context, - builder: - (context) => SDialog( - child: MwcSlatepackImportDialog( - walletId: widget.walletId, - clipboard: widget.clipboard, - rawSlatepack: result.raw, - decoded: result.result, - slatepackType: result.type, + final response = + await showDialog<({String responseSlatepack, bool wasEncrypted})>( + context: context, + builder: + (context) => SDialog( + child: MwcSlatepackImportDialog( + walletId: widget.walletId, + clipboard: widget.clipboard, + rawSlatepack: result.raw, + decoded: result.result, + slatepackType: result.type, + ), + ), + ); + + if (mounted && response != null) { + await showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => SlatepackResponseDialog( + responseSlatepack: response.responseSlatepack, + wasEncrypted: response.wasEncrypted, ), - ), - ); + ); + } } } } diff --git a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart index 105c7e8504..6b1bc060d8 100644 --- a/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart +++ b/lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart @@ -101,15 +101,7 @@ class _MwcSlatepackImportDialogState } if (mounted) { - await showDialog( - context: context, - barrierDismissible: false, - builder: - (context) => _SlatepackResponseDialog( - responseSlatepack: result.responseSlatepack, - wasEncrypted: result.wasEncrypted, - ), - ); + Navigator.of(context).pop(result); } } @@ -167,7 +159,7 @@ class _MwcSlatepackImportDialogState ], ), Padding( - padding: EdgeInsets.symmetric(horizontal: isDesktop ? 32 : 16), + padding: EdgeInsets.symmetric(horizontal: isDesktop ? 32 : 24), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, @@ -191,7 +183,7 @@ class _MwcSlatepackImportDialogState children: [ if (!isDesktop) Padding( - padding: const EdgeInsets.only(top: 16, bottom: 24), + padding: const EdgeInsets.only(top: 24, bottom: 24), child: Text( "Import slatepack", style: STextStyles.pageTitleH2(context), @@ -270,14 +262,15 @@ class _MwcSlatepackImportDialogState ], ), ), - isDesktop ? const SizedBox(height: 32) : const SizedBox(height: 16), + isDesktop ? const SizedBox(height: 32) : const SizedBox(height: 24), ], ); } } -class _SlatepackResponseDialog extends StatelessWidget { - const _SlatepackResponseDialog({ +class SlatepackResponseDialog extends StatelessWidget { + const SlatepackResponseDialog({ + super.key, required this.responseSlatepack, required this.wasEncrypted, }); 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 3e30ff8ca8..f926cce6e8 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 @@ -142,22 +142,35 @@ class _DesktopReceiveState extends ConsumerState { } if (mounted) { - await showDialog( - context: context, - builder: - (context) => SDialog( - child: SizedBox( - width: 700, - child: MwcSlatepackImportDialog( - walletId: widget.walletId, - clipboard: widget.clipboard, - rawSlatepack: result.raw, - decoded: result.result, - slatepackType: result.type, + final response = + await showDialog<({String responseSlatepack, bool wasEncrypted})>( + context: context, + builder: + (context) => SDialog( + child: SizedBox( + width: 700, + child: MwcSlatepackImportDialog( + walletId: widget.walletId, + clipboard: widget.clipboard, + rawSlatepack: result.raw, + decoded: result.result, + slatepackType: result.type, + ), + ), ), + ); + + if (mounted && response != null) { + await showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => SlatepackResponseDialog( + responseSlatepack: response.responseSlatepack, + wasEncrypted: response.wasEncrypted, ), - ), - ); + ); + } } } From 515ca7c012eb048b544a3a7242cf74459276bb9f Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 24 Sep 2025 14:42:34 -0500 Subject: [PATCH 104/178] chore: silence print --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 0581d81b5a..162177f85b 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 0581d81b5abb9dbdee81a95b4b74958d81c3ae9b +Subproject commit 162177f85b2373877985cf853f420bdd2f1433e3 From ccbab5b99aaa2dd8b3e3e6ad5e83c169d4e75c75 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 25 Sep 2025 16:15:12 -0500 Subject: [PATCH 105/178] chore(mwc): ndk 27b->28 --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 162177f85b..5fb49ff075 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 162177f85b2373877985cf853f420bdd2f1433e3 +Subproject commit 5fb49ff075bf0111d4a238bbcd09256b632812aa From 1a7c8010663f85a78248e0eb458b5dfb68c85d2e Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 1 Oct 2025 10:42:21 -0500 Subject: [PATCH 106/178] fix(mwc): silence seed/mnemonic print --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 5fb49ff075..a692b7d685 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 5fb49ff075bf0111d4a238bbcd09256b632812aa +Subproject commit a692b7d6859445791f6ba4270e4cf7e897506d78 From 2896c7a341acb613269652a17faa08b65288287c Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 2 Oct 2025 09:59:33 -0600 Subject: [PATCH 107/178] update ios gitignore --- ios/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ios/.gitignore b/ios/.gitignore index cb9c21eb6e..c41f80eed8 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -1,3 +1,4 @@ +**/dgph *.mode1v3 *.mode2v3 *.moved-aside @@ -18,6 +19,7 @@ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig +Flutter/ephemeral/ Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ From d9cd719356be2ec956af5933b8fa4e934d50cdb2 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 10:57:32 -0600 Subject: [PATCH 108/178] update flutter and isar (and various other required deps) --- ios/.gitignore | 2 + lib/db/db_version_migration.dart | 2 +- lib/db/isar/main_db.dart | 2 +- lib/db/migrate_wallets_to_isar.dart | 2 +- lib/models/isar/exchange_cache/currency.dart | 2 +- lib/models/isar/exchange_cache/pair.dart | 16 +- lib/models/isar/models/address_label.dart | 2 +- lib/models/isar/models/block_explorer.dart | 16 +- .../isar/models/blockchain_data/address.dart | 2 +- .../isar/models/blockchain_data/input.dart | 2 +- .../isar/models/blockchain_data/output.dart | 2 +- .../models/blockchain_data/transaction.dart | 2 +- .../isar/models/blockchain_data/utxo.dart | 43 +- .../models/blockchain_data/v2/input_v2.dart | 2 +- .../models/blockchain_data/v2/output_v2.dart | 2 +- .../blockchain_data/v2/transaction_v2.dart | 2 +- lib/models/isar/models/contact_entry.dart | 2 +- .../isar/models/encrypted_string_value.dart | 2 +- .../isar/models/ethereum/eth_contract.dart | 2 +- lib/models/isar/models/log.dart | 3 +- lib/models/isar/models/sent_to_address.dart | 2 +- lib/models/isar/models/transaction_note.dart | 12 +- lib/models/isar/ordinal.dart | 13 +- lib/models/isar/stack_theme.dart | 2 +- .../edit_wallet_tokens_view.dart | 2 +- .../sub_widgets/add_token_list_element.dart | 2 +- .../add_wallet_view/add_wallet_view.dart | 2 +- .../sub_widgets/coin_select_item.dart | 2 +- .../name_your_wallet_view.dart | 2 +- .../subviews/contact_details_view.dart | 2 +- lib/pages/buy_view/buy_form.dart | 2 +- lib/pages/coin_control/coin_control_view.dart | 736 +++++++++--------- lib/pages/coin_control/utxo_details_view.dart | 2 +- .../exchange_currency_selection_view.dart | 2 +- lib/pages/exchange_view/exchange_view.dart | 158 ++-- .../manage_domains_option_widget.dart | 40 +- .../sub_widgets/name_details.dart | 2 +- lib/pages/ordinals/widgets/ordinals_list.dart | 89 +-- .../receive_view/addresses/address_card.dart | 153 ++-- .../addresses/address_details_view.dart | 2 +- .../addresses/edit_address_label_view.dart | 2 +- .../addresses/wallet_addresses_view.dart | 2 +- lib/pages/receive_view/receive_view.dart | 2 +- .../send_steps/frost_send_step_1b.dart | 2 +- .../sub_widgets/stack_theme_card.dart | 204 +++-- .../helpers/restore_create_backup.dart | 2 +- .../spark_names/buy_spark_name_view.dart | 2 +- .../sub_widgets/my_tokens_list.dart | 14 +- .../token_transaction_list_widget.dart | 2 +- .../token_contract_details_view.dart | 146 ++-- .../sub_widgets/transactions_list.dart | 265 +++---- .../all_transactions_view.dart | 2 +- .../tx_v2/all_transactions_v2_view.dart | 2 +- .../tx_v2/transaction_v2_details_view.dart | 2 +- .../tx_v2/transaction_v2_list.dart | 198 ++--- lib/pages/wallet_view/wallet_view.dart | 2 +- lib/pages/wallets_view/wallets_overview.dart | 2 +- .../subwidgets/desktop_contact_details.dart | 205 +++-- .../desktop_wallet_addresses_view.dart | 49 +- .../sub_widgets/desktop_address_list.dart | 140 ++-- .../desktop_coin_control_use_dialog.dart | 2 +- .../desktop_coin_control_view.dart | 371 +++++---- .../coin_control/freeze_button.dart | 25 +- .../coin_control/utxo_row.dart | 122 +-- .../desktop_all_trades_view.dart | 2 +- .../subwidgets/desktop_trade_history.dart | 261 ++++--- .../wallet_view/desktop_wallet_view.dart | 2 +- .../sub_widgets/desktop_receive.dart | 2 +- .../delete_password_warning_view.dart | 70 +- .../wallet/transaction_note_provider.dart | 60 +- lib/route_generator.dart | 2 +- .../ethereum/cached_eth_token_balance.dart | 11 +- .../exchange_data_loading_service.dart | 2 +- lib/services/price_service.dart | 2 +- lib/services/wallets.dart | 2 +- lib/themes/theme_service.dart | 2 +- .../flutter_secure_storage_interface.dart | 31 +- lib/utilities/wallet_tools.dart | 2 +- lib/wallets/isar/isar_id_interface.dart | 2 +- .../isar/models/frost_wallet_info.dart | 3 +- lib/wallets/isar/models/spark_coin.dart | 2 +- .../isar/models/token_wallet_info.dart | 41 +- lib/wallets/isar/models/wallet_info.dart | 2 +- lib/wallets/isar/models/wallet_info_meta.dart | 7 +- .../providers/all_wallets_info_provider.dart | 2 +- .../providers/eth/token_balance_provider.dart | 94 ++- .../providers/favourite_wallets_provider.dart | 2 +- lib/wallets/isar/providers/util/watcher.dart | 8 +- .../isar/providers/wallet_info_provider.dart | 177 +++-- .../wallet/impl/bitcoin_frost_wallet.dart | 2 +- lib/wallets/wallet/impl/bitcoin_wallet.dart | 32 +- .../wallet/impl/bitcoincash_wallet.dart | 2 +- lib/wallets/wallet/impl/cardano_wallet.dart | 2 +- lib/wallets/wallet/impl/dash_wallet.dart | 2 +- lib/wallets/wallet/impl/dogecoin_wallet.dart | 2 +- lib/wallets/wallet/impl/ecash_wallet.dart | 2 +- lib/wallets/wallet/impl/epiccash_wallet.dart | 2 +- lib/wallets/wallet/impl/ethereum_wallet.dart | 2 +- lib/wallets/wallet/impl/fact0rn_wallet.dart | 2 +- lib/wallets/wallet/impl/firo_wallet.dart | 2 +- lib/wallets/wallet/impl/litecoin_wallet.dart | 2 +- .../wallet/impl/mimblewimblecoin_wallet.dart | 2 +- lib/wallets/wallet/impl/namecoin_wallet.dart | 2 +- lib/wallets/wallet/impl/particl_wallet.dart | 2 +- lib/wallets/wallet/impl/peercoin_wallet.dart | 79 +- lib/wallets/wallet/impl/solana_wallet.dart | 2 +- lib/wallets/wallet/impl/stellar_wallet.dart | 2 +- .../impl/sub_wallets/eth_token_wallet.dart | 2 +- lib/wallets/wallet/impl/tezos_wallet.dart | 2 +- lib/wallets/wallet/impl/xelis_wallet.dart | 2 +- .../wallet/intermediate/bip39_hd_wallet.dart | 64 +- .../wallet/intermediate/bip39_wallet.dart | 33 +- .../intermediate/lib_monero_wallet.dart | 2 +- .../intermediate/lib_salvium_wallet.dart | 2 +- .../wallet/intermediate/lib_xelis_wallet.dart | 2 +- .../epiccash_wallet_info_extension.dart | 30 +- ...imblewimblecoin_wallet_info_extension.dart | 2 +- lib/wallets/wallet/wallet.dart | 4 +- .../bcash_interface.dart | 2 +- .../cash_fusion_interface.dart | 193 ++--- .../electrumx_interface.dart | 2 +- .../mweb_interface.dart | 2 +- .../nano_interface.dart | 2 +- .../ordinals_interface.dart | 36 +- .../paynym_interface.dart | 2 +- .../rbf_interface.dart | 2 +- .../spark_interface.dart | 2 +- lib/widgets/icon_widgets/eth_token_icon.dart | 2 +- lib/widgets/isar_collection_watcher_list.dart | 113 +-- .../wallet_info_row_coin_icon.dart | 2 +- linux/flutter/generated_plugin_registrant.cc | 6 +- linux/flutter/generated_plugins.cmake | 2 +- macos/Flutter/GeneratedPluginRegistrant.swift | 4 +- pubspec.lock | 343 ++++---- scripts/app_config/templates/pubspec.template | 36 +- .../flutter/generated_plugin_registrant.cc | 2 +- windows/flutter/generated_plugins.cmake | 2 +- 137 files changed, 2366 insertions(+), 2570 deletions(-) diff --git a/ios/.gitignore b/ios/.gitignore index c41f80eed8..c079131814 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -35,3 +35,5 @@ Runner/GeneratedPluginRegistrant.* # app specific, handled by scripts Runner/Assets.xcassets/LaunchImage.imageset/*.png +/Flutter/ephemeral/flutter_lldb_helper.py +/Flutter/ephemeral/flutter_lldbinit diff --git a/lib/db/db_version_migration.dart b/lib/db/db_version_migration.dart index 9c278ff197..ab2b8bcde1 100644 --- a/lib/db/db_version_migration.dart +++ b/lib/db/db_version_migration.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../app_config.dart'; diff --git a/lib/db/isar/main_db.dart b/lib/db/isar/main_db.dart index 0a02690255..d951a1a6b1 100644 --- a/lib/db/isar/main_db.dart +++ b/lib/db/isar/main_db.dart @@ -9,7 +9,7 @@ */ import 'package:decimal/decimal.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../exceptions/main_db/main_db_exception.dart'; diff --git a/lib/db/migrate_wallets_to_isar.dart b/lib/db/migrate_wallets_to_isar.dart index 6433799f29..de9cff6ddf 100644 --- a/lib/db/migrate_wallets_to_isar.dart +++ b/lib/db/migrate_wallets_to_isar.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../app_config.dart'; import '../models/isar/models/blockchain_data/v2/transaction_v2.dart'; diff --git a/lib/models/isar/exchange_cache/currency.dart b/lib/models/isar/exchange_cache/currency.dart index 67a7f40985..f450535cb7 100644 --- a/lib/models/isar/exchange_cache/currency.dart +++ b/lib/models/isar/exchange_cache/currency.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../app_config.dart'; import '../../../services/exchange/change_now/change_now_exchange.dart'; diff --git a/lib/models/isar/exchange_cache/pair.dart b/lib/models/isar/exchange_cache/pair.dart index 923aeb26eb..2e77ee7f77 100644 --- a/lib/models/isar/exchange_cache/pair.dart +++ b/lib/models/isar/exchange_cache/pair.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'pair.g.dart'; @@ -29,12 +29,7 @@ class Pair { @Index() final String exchangeName; - @Index( - composite: [ - CompositeIndex("exchangeName"), - CompositeIndex("to"), - ], - ) + @Index(composite: [CompositeIndex("exchangeName"), CompositeIndex("to")]) final String from; final String to; @@ -61,12 +56,7 @@ class Pair { rateType == other.rateType; @override - int get hashCode => Object.hash( - exchangeName, - from, - to, - rateType, - ); + int get hashCode => Object.hash(exchangeName, from, to, rateType); @override String toString() => "Pair: ${toMap()}"; diff --git a/lib/models/isar/models/address_label.dart b/lib/models/isar/models/address_label.dart index ebee663694..ae6e337d4e 100644 --- a/lib/models/isar/models/address_label.dart +++ b/lib/models/isar/models/address_label.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/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 6bde450011..ab0c1e8a14 100644 --- a/lib/models/isar/models/block_explorer.dart +++ b/lib/models/isar/models/block_explorer.dart @@ -8,7 +8,8 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; + import '../../../app_config.dart'; import '../../../wallets/crypto_currency/crypto_currency.dart'; @@ -16,10 +17,7 @@ part 'block_explorer.g.dart'; @collection class TransactionBlockExplorer { - TransactionBlockExplorer({ - required this.ticker, - required this.url, - }); + TransactionBlockExplorer({required this.ticker, required this.url}); Id id = Isar.autoIncrement; @@ -37,10 +35,6 @@ class TransactionBlockExplorer { } } - Uri? getUrlFor({required String txid}) => Uri.tryParse( - url.replaceFirst( - "%5BTXID%5D", - txid, - ), - ); + Uri? getUrlFor({required String txid}) => + Uri.tryParse(url.replaceFirst("%5BTXID%5D", txid)); } diff --git a/lib/models/isar/models/blockchain_data/address.dart b/lib/models/isar/models/blockchain_data/address.dart index c1dfb3a242..3366eb52cc 100644 --- a/lib/models/isar/models/blockchain_data/address.dart +++ b/lib/models/isar/models/blockchain_data/address.dart @@ -10,7 +10,7 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../exceptions/address/address_exception.dart'; import 'crypto_currency_address.dart'; diff --git a/lib/models/isar/models/blockchain_data/input.dart b/lib/models/isar/models/blockchain_data/input.dart index e816a55962..a8fbf8b156 100644 --- a/lib/models/isar/models/blockchain_data/input.dart +++ b/lib/models/isar/models/blockchain_data/input.dart @@ -10,7 +10,7 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'input.g.dart'; diff --git a/lib/models/isar/models/blockchain_data/output.dart b/lib/models/isar/models/blockchain_data/output.dart index f544e99117..f65f2687a0 100644 --- a/lib/models/isar/models/blockchain_data/output.dart +++ b/lib/models/isar/models/blockchain_data/output.dart @@ -10,7 +10,7 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'output.g.dart'; diff --git a/lib/models/isar/models/blockchain_data/transaction.dart b/lib/models/isar/models/blockchain_data/transaction.dart index 4178560794..3e43ffb219 100644 --- a/lib/models/isar/models/blockchain_data/transaction.dart +++ b/lib/models/isar/models/blockchain_data/transaction.dart @@ -11,7 +11,7 @@ import 'dart:convert'; import 'dart:math'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../../utilities/amount/amount.dart'; diff --git a/lib/models/isar/models/blockchain_data/utxo.dart b/lib/models/isar/models/blockchain_data/utxo.dart index 57f9ede643..f417b4cdf4 100644 --- a/lib/models/isar/models/blockchain_data/utxo.dart +++ b/lib/models/isar/models/blockchain_data/utxo.dart @@ -11,7 +11,7 @@ import 'dart:convert'; import 'dart:math'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'utxo.g.dart'; @@ -42,10 +42,7 @@ class UTXO { @Index( unique: true, replace: true, - composite: [ - CompositeIndex("walletId"), - CompositeIndex("vout"), - ], + composite: [CompositeIndex("walletId"), CompositeIndex("vout")], ) late final String txid; @@ -132,26 +129,26 @@ class UTXO { String? address, bool? used, String? otherData, - }) => - UTXO( - walletId: walletId ?? this.walletId, - txid: txid ?? this.txid, - vout: vout ?? this.vout, - value: value ?? this.value, - name: name ?? this.name, - isBlocked: isBlocked ?? this.isBlocked, - blockedReason: blockedReason ?? this.blockedReason, - isCoinbase: isCoinbase ?? this.isCoinbase, - blockHash: blockHash ?? this.blockHash, - blockHeight: blockHeight ?? this.blockHeight, - blockTime: blockTime ?? this.blockTime, - address: address ?? this.address, - used: used ?? this.used, - otherData: otherData ?? this.otherData, - )..id = id ?? this.id; + }) => UTXO( + walletId: walletId ?? this.walletId, + txid: txid ?? this.txid, + vout: vout ?? this.vout, + value: value ?? this.value, + name: name ?? this.name, + isBlocked: isBlocked ?? this.isBlocked, + blockedReason: blockedReason ?? this.blockedReason, + isCoinbase: isCoinbase ?? this.isCoinbase, + blockHash: blockHash ?? this.blockHash, + blockHeight: blockHeight ?? this.blockHeight, + blockTime: blockTime ?? this.blockTime, + address: address ?? this.address, + used: used ?? this.used, + otherData: otherData ?? this.otherData, + )..id = id ?? this.id; @override - String toString() => "{ " + String toString() => + "{ " "id: $id, " "walletId: $walletId, " "txid: $txid, " diff --git a/lib/models/isar/models/blockchain_data/v2/input_v2.dart b/lib/models/isar/models/blockchain_data/v2/input_v2.dart index 7442bd2d44..7e4ae14d9c 100644 --- a/lib/models/isar/models/blockchain_data/v2/input_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/input_v2.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'input_v2.g.dart'; diff --git a/lib/models/isar/models/blockchain_data/v2/output_v2.dart b/lib/models/isar/models/blockchain_data/v2/output_v2.dart index 01bfcfb0e7..44da1a1733 100644 --- a/lib/models/isar/models/blockchain_data/v2/output_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/output_v2.dart @@ -1,5 +1,5 @@ import 'package:decimal/decimal.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'output_v2.g.dart'; diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart index 06d9646638..44fbaf3f94 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'dart:math'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../../utilities/amount/amount.dart'; import '../../../../../utilities/extensions/extensions.dart'; diff --git a/lib/models/isar/models/contact_entry.dart b/lib/models/isar/models/contact_entry.dart index 66cd68dc16..af926e5fbc 100644 --- a/lib/models/isar/models/contact_entry.dart +++ b/lib/models/isar/models/contact_entry.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../app_config.dart'; import '../../../wallets/crypto_currency/crypto_currency.dart'; diff --git a/lib/models/isar/models/encrypted_string_value.dart b/lib/models/isar/models/encrypted_string_value.dart index 96b3d1799b..c2223584f4 100644 --- a/lib/models/isar/models/encrypted_string_value.dart +++ b/lib/models/isar/models/encrypted_string_value.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/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 df19d9d8d4..adaec31226 100644 --- a/lib/models/isar/models/ethereum/eth_contract.dart +++ b/lib/models/isar/models/ethereum/eth_contract.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../contract.dart'; part 'eth_contract.g.dart'; diff --git a/lib/models/isar/models/log.dart b/lib/models/isar/models/log.dart index 79f5808b20..8fa1f1efde 100644 --- a/lib/models/isar/models/log.dart +++ b/lib/models/isar/models/log.dart @@ -8,7 +8,8 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; + // import 'package:stackwallet/models/isar/type_converters/log_level_converter.dart'; import '../../../utilities/enums/log_level_enum.dart'; diff --git a/lib/models/isar/models/sent_to_address.dart b/lib/models/isar/models/sent_to_address.dart index f18b18a083..16ad55c4c5 100644 --- a/lib/models/isar/models/sent_to_address.dart +++ b/lib/models/isar/models/sent_to_address.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'sent_to_address.g.dart'; diff --git a/lib/models/isar/models/transaction_note.dart b/lib/models/isar/models/transaction_note.dart index 698d005e4a..f91c1ab300 100644 --- a/lib/models/isar/models/transaction_note.dart +++ b/lib/models/isar/models/transaction_note.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'transaction_note.g.dart'; @@ -25,18 +25,12 @@ class TransactionNote { @Index() late String walletId; - @Index( - unique: true, - replace: true, - composite: [CompositeIndex("walletId")], - ) + @Index(unique: true, replace: true, composite: [CompositeIndex("walletId")]) late String txid; late String value; - TransactionNote copyWith({ - String? value, - }) { + TransactionNote copyWith({String? value}) { return TransactionNote( walletId: walletId, txid: txid, diff --git a/lib/models/isar/ordinal.dart b/lib/models/isar/ordinal.dart index 6ac3a2dadd..99b4dcdae3 100644 --- a/lib/models/isar/ordinal.dart +++ b/lib/models/isar/ordinal.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../db/isar/main_db.dart'; import '../../dto/ordinals/inscription_data.dart'; @@ -15,10 +15,7 @@ class Ordinal { @Index( unique: true, replace: true, - composite: [ - CompositeIndex("utxoTXID"), - CompositeIndex("utxoVOUT"), - ], + composite: [CompositeIndex("utxoTXID"), CompositeIndex("utxoVOUT")], ) final String inscriptionId; @@ -45,8 +42,10 @@ class Ordinal { inscriptionId: data.inscriptionId, inscriptionNumber: data.inscriptionNumber, content: data.content, - utxoTXID: data.output.split(':')[ - 0], // "output": "062f32e21aa04246b8873b5d9a929576addd0339881e1ea478b406795d6b6c47:0" + utxoTXID: + data.output.split( + ':', + )[0], // "output": "062f32e21aa04246b8873b5d9a929576addd0339881e1ea478b406795d6b6c47:0" utxoVOUT: int.parse(data.output.split(':')[1]), ); } diff --git a/lib/models/isar/stack_theme.dart b/lib/models/isar/stack_theme.dart index 7c2f0b7ab0..476494d921 100644 --- a/lib/models/isar/stack_theme.dart +++ b/lib/models/isar/stack_theme.dart @@ -12,7 +12,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../app_config.dart'; import '../../utilities/extensions/impl/box_shadow.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 3294ce18ff..b1f07cec75 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 @@ -13,7 +13,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../db/isar/main_db.dart'; import '../../../models/isar/models/ethereum/eth_contract.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 9137e21f43..a477c57691 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 @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../models/isar/exchange_cache/currency.dart'; import '../../../../models/isar/models/ethereum/eth_contract.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 ef4248d0b3..4d289a4662 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 @@ -13,7 +13,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../app_config.dart'; import '../../../db/isar/main_db.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 2506b41956..72adf390bb 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 @@ -13,7 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../models/add_wallet_list_entity/add_wallet_list_entity.dart'; import '../../../../models/add_wallet_list_entity/sub_classes/eth_token_entity.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 ec7419d960..fa810756dc 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 @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../pages_desktop_specific/my_stack_view/exit_to_my_stack_button.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 0ee0e6b93b..2540c736cb 100644 --- a/lib/pages/address_book_views/subviews/contact_details_view.dart +++ b/lib/pages/address_book_views/subviews/contact_details_view.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../models/isar/models/isar_models.dart'; diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart index 64a7ba40f5..8f8a0c9b82 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -16,7 +16,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:intl/intl.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../app_config.dart'; import '../../models/buy/response_objects/crypto.dart'; diff --git a/lib/pages/coin_control/coin_control_view.dart b/lib/pages/coin_control/coin_control_view.dart index cb288f8456..7960733643 100644 --- a/lib/pages/coin_control/coin_control_view.dart +++ b/lib/pages/coin_control/coin_control_view.dart @@ -13,7 +13,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../db/isar/main_db.dart'; @@ -44,10 +44,7 @@ import '../../widgets/toggle.dart'; import 'utxo_card.dart'; import 'utxo_details_view.dart'; -enum CoinControlViewType { - manage, - use; -} +enum CoinControlViewType { manage, use } class CoinControlView extends ConsumerStatefulWidget { const CoinControlView({ @@ -126,11 +123,12 @@ class _CoinControlViewState extends ConsumerState { Widget build(BuildContext context) { debugPrint("BUILD: $runtimeType"); - final minConfirms = ref - .watch(pWallets) - .getWallet(widget.walletId) - .cryptoCurrency - .minConfirms; + final minConfirms = + ref + .watch(pWallets) + .getWallet(widget.walletId) + .cryptoCurrency + .minConfirms; final coin = ref.watch(pWalletCoin(widget.walletId)); final currentHeight = ref.watch(pWalletChainHeight(widget.walletId)); @@ -148,9 +146,10 @@ class _CoinControlViewState extends ConsumerState { _map = null; _list = MainDB.instance.queryUTXOsSync( walletId: widget.walletId, - filter: _isSearching - ? CCFilter.all - : _showBlocked + filter: + _isSearching + ? CCFilter.all + : _showBlocked ? CCFilter.frozen : CCFilter.available, sort: _sort, @@ -173,119 +172,121 @@ class _CoinControlViewState extends ConsumerState { Theme.of(context).extension()!.background, appBar: AppBar( automaticallyImplyLeading: false, - leading: _isSearching - ? null - : widget.type == CoinControlViewType.use && + leading: + _isSearching + ? null + : widget.type == CoinControlViewType.use && _selectedAvailable.isNotEmpty ? AppBarIconButton( - icon: XIcon( - width: 24, - height: 24, - color: Theme.of(context) - .extension()! - .topNavIconPrimary, - ), - onPressed: () { - setState(() { - _selectedAvailable.clear(); - }); - }, - ) - : AppBarBackButton( - onPressed: () { - unawaited(_refreshBalance()); - Navigator.of(context).pop( - widget.type == CoinControlViewType.use - ? _selectedAvailable - : null, - ); - }, - ), - title: _isSearching - ? AppBarSearchField( - controller: searchController, - focusNode: searchFocus, - ) - : Text( - "Coin control", - style: STextStyles.navBarTitle(context), - ), - titleSpacing: 0, - actions: _isSearching - ? [ - AspectRatio( - aspectRatio: 1, - child: AppBarIconButton( - size: 36, - icon: SvgPicture.asset( - Assets.svg.x, - width: 20, - height: 20, - color: Theme.of(context) - .extension()! - .topNavIconPrimary, - ), - onPressed: () { - // show search - setState(() { - _isSearching = false; - }); - }, + icon: XIcon( + width: 24, + height: 24, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, ), + onPressed: () { + setState(() { + _selectedAvailable.clear(); + }); + }, + ) + : AppBarBackButton( + onPressed: () { + unawaited(_refreshBalance()); + Navigator.of(context).pop( + widget.type == CoinControlViewType.use + ? _selectedAvailable + : null, + ); + }, ), - ] - : [ - AspectRatio( - aspectRatio: 1, - child: AppBarIconButton( - size: 36, - icon: SvgPicture.asset( - Assets.svg.search, - width: 20, - height: 20, - color: Theme.of(context) - .extension()! - .topNavIconPrimary, + title: + _isSearching + ? AppBarSearchField( + controller: searchController, + focusNode: searchFocus, + ) + : Text( + "Coin control", + style: STextStyles.navBarTitle(context), + ), + titleSpacing: 0, + actions: + _isSearching + ? [ + AspectRatio( + aspectRatio: 1, + child: AppBarIconButton( + size: 36, + icon: SvgPicture.asset( + Assets.svg.x, + width: 20, + height: 20, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, + ), + onPressed: () { + // show search + setState(() { + _isSearching = false; + }); + }, ), - onPressed: () { - // show search - setState(() { - _isSearching = true; - }); - }, ), - ), - AspectRatio( - aspectRatio: 1, - child: JDropdownIconButton( - mobileAppBar: true, - groupValue: _sort, - items: CCSortDescriptor.values.toSet(), - onSelectionChanged: (CCSortDescriptor? newValue) { - if (newValue != null && newValue != _sort) { + ] + : [ + AspectRatio( + aspectRatio: 1, + child: AppBarIconButton( + size: 36, + icon: SvgPicture.asset( + Assets.svg.search, + width: 20, + height: 20, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, + ), + onPressed: () { + // show search setState(() { - _sort = newValue; + _isSearching = true; }); - } - }, - displayPrefix: "Sort by", + }, + ), ), - ), - ], + AspectRatio( + aspectRatio: 1, + child: JDropdownIconButton( + mobileAppBar: true, + groupValue: _sort, + items: CCSortDescriptor.values.toSet(), + onSelectionChanged: (CCSortDescriptor? newValue) { + if (newValue != null && newValue != _sort) { + setState(() { + _sort = newValue; + }); + } + }, + displayPrefix: "Sort by", + ), + ), + ], ), body: SafeArea( child: Column( children: [ Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16, - ), + padding: const EdgeInsets.symmetric(horizontal: 16), child: Column( children: [ - const SizedBox( - height: 10, - ), + const SizedBox(height: 10), if (!_isSearching) RoundedWhiteContainer( child: Text( @@ -293,28 +294,28 @@ class _CoinControlViewState extends ConsumerState { "outputs at your discretion. Tap the output circle to " "select.", style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), ), ), - if (!_isSearching) - const SizedBox( - height: 10, - ), + if (!_isSearching) const SizedBox(height: 10), if (!(_isSearching || _map != null)) SizedBox( height: 48, child: Toggle( key: UniqueKey(), - onColor: Theme.of(context) - .extension()! - .popupBG, + onColor: + Theme.of( + context, + ).extension()!.popupBG, onText: "Available outputs", - offColor: Theme.of(context) - .extension()! - .textFieldDefaultBG, + offColor: + Theme.of(context) + .extension()! + .textFieldDefaultBG, offText: "Frozen outputs", isOn: _showBlocked, onValueChanged: (value) { @@ -330,26 +331,23 @@ class _CoinControlViewState extends ConsumerState { ), ), ), - if (!_isSearching) - const SizedBox( - height: 10, - ), + if (!_isSearching) const SizedBox(height: 10), if (_isSearching) Expanded( child: ListView.separated( itemCount: _list!.length, - separatorBuilder: (context, _) => const SizedBox( - height: 10, - ), + separatorBuilder: + (context, _) => const SizedBox(height: 10), itemBuilder: (context, index) { - final utxo = MainDB.instance.isar.utxos - .where() - .idEqualTo(_list![index]) - .findFirstSync()!; + final utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(_list![index]) + .findFirstSync()!; final isSelected = _selectedBlocked.contains(utxo) || - _selectedAvailable.contains(utxo); + _selectedAvailable.contains(utxo); return UtxoCard( key: Key( @@ -357,7 +355,8 @@ class _CoinControlViewState extends ConsumerState { ), walletId: widget.walletId, utxo: utxo, - canSelect: widget.type == + canSelect: + widget.type == CoinControlViewType.manage || (widget.type == CoinControlViewType.use && !utxo.isBlocked && @@ -366,8 +365,9 @@ class _CoinControlViewState extends ConsumerState { currentHeight, ref.watch( pWallets.select( - (s) => s - .getWallet(widget.walletId), + (s) => s.getWallet( + widget.walletId, + ), ), ), )), @@ -385,8 +385,9 @@ class _CoinControlViewState extends ConsumerState { setState(() {}); }, onPressed: () async { - final result = - await Navigator.of(context).pushNamed( + final result = await Navigator.of( + context, + ).pushNamed( UtxoDetailsView.routeName, arguments: Tuple2( utxo.id, @@ -404,170 +405,176 @@ class _CoinControlViewState extends ConsumerState { if (!_isSearching) _list != null ? Expanded( - child: ListView.separated( - itemCount: _list!.length, - separatorBuilder: (context, _) => - const SizedBox( - height: 10, - ), - itemBuilder: (context, index) { - final utxo = MainDB.instance.isar.utxos - .where() - .idEqualTo(_list![index]) - .findFirstSync()!; + child: ListView.separated( + itemCount: _list!.length, + separatorBuilder: + (context, _) => + const SizedBox(height: 10), + itemBuilder: (context, index) { + final utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(_list![index]) + .findFirstSync()!; - final isSelected = _showBlocked - ? _selectedBlocked.contains(utxo) - : _selectedAvailable.contains(utxo); + final isSelected = + _showBlocked + ? _selectedBlocked.contains(utxo) + : _selectedAvailable.contains(utxo); - return UtxoCard( - key: Key( - "${utxo.walletId}_${utxo.id}_$isSelected", - ), - walletId: widget.walletId, - utxo: utxo, - canSelect: widget.type == - CoinControlViewType.manage || - (widget.type == - CoinControlViewType.use && - !_showBlocked && - _isConfirmed( - utxo, - currentHeight, - ref.watch( - pWallets.select( - (s) => s.getWallet( - widget.walletId, - ), + return UtxoCard( + key: Key( + "${utxo.walletId}_${utxo.id}_$isSelected", + ), + walletId: widget.walletId, + utxo: utxo, + canSelect: + widget.type == + CoinControlViewType.manage || + (widget.type == + CoinControlViewType.use && + !_showBlocked && + _isConfirmed( + utxo, + currentHeight, + ref.watch( + pWallets.select( + (s) => s.getWallet( + widget.walletId, ), ), - )), - initialSelectedState: isSelected, - onSelectedChanged: (value) { - if (value) { - _showBlocked - ? _selectedBlocked.add(utxo) - : _selectedAvailable.add(utxo); - } else { - _showBlocked - ? _selectedBlocked.remove(utxo) - : _selectedAvailable - .remove(utxo); - } + ), + )), + initialSelectedState: isSelected, + onSelectedChanged: (value) { + if (value) { + _showBlocked + ? _selectedBlocked.add(utxo) + : _selectedAvailable.add(utxo); + } else { + _showBlocked + ? _selectedBlocked.remove(utxo) + : _selectedAvailable.remove(utxo); + } + setState(() {}); + }, + onPressed: () async { + final result = await Navigator.of( + context, + ).pushNamed( + UtxoDetailsView.routeName, + arguments: Tuple2( + utxo.id, + widget.walletId, + ), + ); + if (mounted && result == "refresh") { setState(() {}); - }, - onPressed: () async { - final result = - await Navigator.of(context) - .pushNamed( - UtxoDetailsView.routeName, - arguments: Tuple2( - utxo.id, - widget.walletId, - ), - ); - if (mounted && result == "refresh") { - setState(() {}); - } - }, - ); - }, - ), - ) + } + }, + ); + }, + ), + ) : Expanded( - child: ListView.separated( - itemCount: _map!.entries.length, - separatorBuilder: (context, _) => - const SizedBox( - height: 10, - ), - itemBuilder: (context, index) { - final entry = - _map!.entries.elementAt(index); - final _controller = - RotateIconController(); + child: ListView.separated( + itemCount: _map!.entries.length, + separatorBuilder: + (context, _) => + const SizedBox(height: 10), + itemBuilder: (context, index) { + final entry = _map!.entries.elementAt( + index, + ); + final _controller = RotateIconController(); - return Expandable2( - border: Theme.of(context) - .extension()! - .backgroundAppBar, - background: Theme.of(context) - .extension()! - .popupBG, - animationDurationMultiplier: - 0.2 * entry.value.length, - onExpandWillChange: (state) { - if (state == - Expandable2State.expanded) { - _controller.forward?.call(); - } else { - _controller.reverse?.call(); - } - }, - header: RoundedContainer( - padding: const EdgeInsets.all(14), - color: Colors.transparent, - child: Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - entry.key, - style: - STextStyles.w600_14( - context, - ), - ), - const SizedBox( - height: 2, + return Expandable2( + border: + Theme.of(context) + .extension()! + .backgroundAppBar, + background: + Theme.of( + context, + ).extension()!.popupBG, + animationDurationMultiplier: + 0.2 * entry.value.length, + onExpandWillChange: (state) { + if (state == + Expandable2State.expanded) { + _controller.forward?.call(); + } else { + _controller.reverse?.call(); + } + }, + header: RoundedContainer( + padding: const EdgeInsets.all(14), + color: Colors.transparent, + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + entry.key, + style: STextStyles.w600_14( + context, ), - Text( - "${entry.value.length} " - "output${entry.value.length > 1 ? "s" : ""}", - style: - STextStyles.w500_12( - context, - ).copyWith( - color: Theme.of(context) - .extension< - StackColors>()! - .textSubtitle1, - ), + ), + const SizedBox(height: 2), + Text( + "${entry.value.length} " + "output${entry.value.length > 1 ? "s" : ""}", + style: STextStyles.w500_12( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textSubtitle1, ), - ], - ), + ), + ], ), - RotateIcon( - animationDurationMultiplier: - 0.2 * entry.value.length, - icon: SvgPicture.asset( - Assets.svg.chevronDown, - width: 14, - color: Theme.of(context) - .extension()! - .textSubtitle1, - ), - curve: Curves.easeInOut, - controller: _controller, + ), + RotateIcon( + animationDurationMultiplier: + 0.2 * entry.value.length, + icon: SvgPicture.asset( + Assets.svg.chevronDown, + width: 14, + color: + Theme.of(context) + .extension< + StackColors + >()! + .textSubtitle1, ), - ], - ), + curve: Curves.easeInOut, + controller: _controller, + ), + ], ), - children: entry.value.map( - (id) { - final utxo = MainDB - .instance.isar.utxos - .where() - .idEqualTo(id) - .findFirstSync()!; + ), + children: + entry.value.map((id) { + final utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(id) + .findFirstSync()!; - final isSelected = _selectedBlocked - .contains(utxo) || - _selectedAvailable - .contains(utxo); + final isSelected = + _selectedBlocked.contains( + utxo, + ) || + _selectedAvailable.contains( + utxo, + ); return UtxoCard( key: Key( @@ -575,7 +582,8 @@ class _CoinControlViewState extends ConsumerState { ), walletId: widget.walletId, utxo: utxo, - canSelect: widget.type == + canSelect: + widget.type == CoinControlViewType .manage || (widget.type == @@ -597,14 +605,17 @@ class _CoinControlViewState extends ConsumerState { onSelectedChanged: (value) { if (value) { utxo.isBlocked - ? _selectedBlocked - .add(utxo) - : _selectedAvailable - .add(utxo); + ? _selectedBlocked.add( + utxo, + ) + : _selectedAvailable.add( + utxo, + ); } else { utxo.isBlocked - ? _selectedBlocked - .remove(utxo) + ? _selectedBlocked.remove( + utxo, + ) : _selectedAvailable .remove(utxo); } @@ -612,26 +623,26 @@ class _CoinControlViewState extends ConsumerState { }, onPressed: () async { final result = - await Navigator.of(context) - .pushNamed( - UtxoDetailsView.routeName, - arguments: Tuple2( - utxo.id, - widget.walletId, - ), - ); + await Navigator.of( + context, + ).pushNamed( + UtxoDetailsView.routeName, + arguments: Tuple2( + utxo.id, + widget.walletId, + ), + ); if (mounted && result == "refresh") { setState(() {}); } }, ); - }, - ).toList(), - ); - }, - ), + }).toList(), + ); + }, ), + ), ], ), ), @@ -641,13 +652,14 @@ class _CoinControlViewState extends ConsumerState { widget.type == CoinControlViewType.manage) Container( decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .backgroundAppBar, + color: + Theme.of( + context, + ).extension()!.backgroundAppBar, boxShadow: [ - Theme.of(context) - .extension()! - .standardBoxShadow, + Theme.of( + context, + ).extension()!.standardBoxShadow, ], ), child: Padding( @@ -658,22 +670,14 @@ class _CoinControlViewState extends ConsumerState { if (_showBlocked) { await MainDB.instance.putUTXOs( _selectedBlocked - .map( - (e) => e.copyWith( - isBlocked: false, - ), - ) + .map((e) => e.copyWith(isBlocked: false)) .toList(), ); _selectedBlocked.clear(); } else { await MainDB.instance.putUTXOs( _selectedAvailable - .map( - (e) => e.copyWith( - isBlocked: true, - ), - ) + .map((e) => e.copyWith(isBlocked: true)) .toList(), ); _selectedAvailable.clear(); @@ -686,13 +690,14 @@ class _CoinControlViewState extends ConsumerState { if (!_showBlocked && widget.type == CoinControlViewType.use) Container( decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .backgroundAppBar, + color: + Theme.of( + context, + ).extension()!.backgroundAppBar, boxShadow: [ - Theme.of(context) - .extension()! - .standardBoxShadow, + Theme.of( + context, + ).extension()!.standardBoxShadow, ], ), child: Padding( @@ -724,30 +729,42 @@ class _CoinControlViewState extends ConsumerState { (value, element) => value += element, ); - final selectedSum = - selectedSumInt.toAmountAsRaw( - fractionDigits: coin.fractionDigits, - ); + final selectedSum = selectedSumInt + .toAmountAsRaw( + fractionDigits: + coin.fractionDigits, + ); return SelectableText( ref .watch(pAmountFormatter(coin)) .format(selectedSum), - style: widget.requestedTotal == null - ? STextStyles.w600_14(context) - : STextStyles.w600_14(context) - .copyWith( - color: selectedSum >= - widget - .requestedTotal! - ? Theme.of(context) - .extension< - StackColors>()! - .accentColorGreen - : Theme.of(context) - .extension< - StackColors>()! - .accentColorRed, - ), + style: + widget.requestedTotal == null + ? STextStyles.w600_14( + context, + ) + : STextStyles.w600_14( + context, + ).copyWith( + color: + selectedSum >= + widget + .requestedTotal! + ? Theme.of( + context, + ) + .extension< + StackColors + >()! + .accentColorGreen + : Theme.of( + context, + ) + .extension< + StackColors + >()! + .accentColorRed, + ), ); }, ), @@ -758,9 +775,10 @@ class _CoinControlViewState extends ConsumerState { Container( width: double.infinity, height: 1.5, - color: Theme.of(context) - .extension()! - .backgroundAppBar, + color: + Theme.of(context) + .extension()! + .backgroundAppBar, ), if (widget.requestedTotal != null) Padding( @@ -785,9 +803,7 @@ class _CoinControlViewState extends ConsumerState { ], ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), PrimaryButton( label: "Use coins", enabled: _selectedAvailable.isNotEmpty, @@ -795,9 +811,7 @@ class _CoinControlViewState extends ConsumerState { if (searchFocus.hasFocus) { searchFocus.unfocus(); } - Navigator.of(context).pop( - _selectedAvailable, - ); + Navigator.of(context).pop(_selectedAvailable); }, ), ], diff --git a/lib/pages/coin_control/utxo_details_view.dart b/lib/pages/coin_control/utxo_details_view.dart index 3e4a93670a..b77b152bda 100644 --- a/lib/pages/coin_control/utxo_details_view.dart +++ b/lib/pages/coin_control/utxo_details_view.dart @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../db/isar/main_db.dart'; import '../../models/isar/models/isar_models.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 edfe6ba19d..4a539ec9d4 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 @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../app_config.dart'; diff --git a/lib/pages/exchange_view/exchange_view.dart b/lib/pages/exchange_view/exchange_view.dart index 1c70a64d06..276f7e73fa 100644 --- a/lib/pages/exchange_view/exchange_view.dart +++ b/lib/pages/exchange_view/exchange_view.dart @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../db/isar/main_db.dart'; @@ -94,10 +94,9 @@ class _ExchangeViewState extends ConsumerState { children: [ child, Material( - color: Theme.of(context) - .extension()! - .overlay - .withOpacity(0.6), + color: Theme.of( + context, + ).extension()!.overlay.withOpacity(0.6), child: const CustomLoadingOverlay( message: "Updating exchange data", subMessage: "This could take a few minutes", @@ -113,15 +112,12 @@ class _ExchangeViewState extends ConsumerState { headerSliverBuilder: (context, innerBoxIsScrolled) { return [ SliverOverlapAbsorber( - handle: - NestedScrollView.sliverOverlapAbsorberHandleFor(context), + handle: NestedScrollView.sliverOverlapAbsorberHandleFor( + context, + ), sliver: const SliverToBoxAdapter( child: Padding( - padding: EdgeInsets.only( - left: 16, - right: 16, - top: 16, - ), + padding: EdgeInsets.only(left: 16, right: 16, top: 16), child: ExchangeForm(), ), ), @@ -130,8 +126,9 @@ class _ExchangeViewState extends ConsumerState { }, body: Builder( builder: (buildContext) { - final trades = ref - .watch(tradesServiceProvider.select((value) => value.trades)); + final trades = ref.watch( + tradesServiceProvider.select((value) => value.trades), + ); final tradeCount = trades.length; final hasHistory = tradeCount > 0; @@ -150,98 +147,94 @@ class _ExchangeViewState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), Text( "Trades", style: STextStyles.itemSubtitle(context).copyWith( - color: Theme.of(context) - .extension()! - .textDark3, + color: + Theme.of( + context, + ).extension()!.textDark3, ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), ], ), ), ), if (hasHistory) SliverList( - delegate: SliverChildBuilderDelegate( - (context, index) { - return Padding( - padding: const EdgeInsets.all(4), - child: TradeCard( - key: Key("tradeCard_${trades[index].uuid}"), - trade: trades[index], - onTap: () async { - final String tradeId = trades[index].tradeId; + delegate: SliverChildBuilderDelegate((context, index) { + return Padding( + padding: const EdgeInsets.all(4), + child: TradeCard( + key: Key("tradeCard_${trades[index].uuid}"), + trade: trades[index], + onTap: () async { + final String tradeId = trades[index].tradeId; - final lookup = ref - .read(tradeSentFromStackLookupProvider) - .all; + final lookup = + ref + .read(tradeSentFromStackLookupProvider) + .all; - //todo: check if print needed - // debugPrint("ALL: $lookup"); + //todo: check if print needed + // debugPrint("ALL: $lookup"); - final String? txid = ref - .read(tradeSentFromStackLookupProvider) - .getTxidForTradeId(tradeId); - final List? walletIds = ref - .read(tradeSentFromStackLookupProvider) - .getWalletIdsForTradeId(tradeId); + final String? txid = ref + .read(tradeSentFromStackLookupProvider) + .getTxidForTradeId(tradeId); + final List? walletIds = ref + .read(tradeSentFromStackLookupProvider) + .getWalletIdsForTradeId(tradeId); - if (txid != null && - walletIds != null && - walletIds.isNotEmpty) { - final wallet = ref - .read(pWallets) - .getWallet(walletIds.first); + if (txid != null && + walletIds != null && + walletIds.isNotEmpty) { + final wallet = ref + .read(pWallets) + .getWallet(walletIds.first); - //todo: check if print needed - // debugPrint("name: ${manager.walletName}"); + //todo: check if print needed + // debugPrint("name: ${manager.walletName}"); - final tx = await MainDB.instance - .getTransactions(walletIds.first) - .filter() - .txidEqualTo(txid) - .findFirst(); + final tx = + await MainDB.instance + .getTransactions(walletIds.first) + .filter() + .txidEqualTo(txid) + .findFirst(); - if (mounted) { - unawaited( - Navigator.of(context).pushNamed( - TradeDetailsView.routeName, - arguments: Tuple4( - tradeId, - tx, - walletIds.first, - wallet.info.name, - ), - ), - ); - } - } else { + if (mounted) { unawaited( Navigator.of(context).pushNamed( TradeDetailsView.routeName, arguments: Tuple4( tradeId, - null, - walletIds?.first, - null, + tx, + walletIds.first, + wallet.info.name, ), ), ); } - }, - ), - ); - }, - childCount: tradeCount, - ), + } else { + unawaited( + Navigator.of(context).pushNamed( + TradeDetailsView.routeName, + arguments: Tuple4( + tradeId, + null, + walletIds?.first, + null, + ), + ), + ); + } + }, + ), + ); + }, childCount: tradeCount), ), if (!hasHistory) SliverToBoxAdapter( @@ -249,9 +242,10 @@ class _ExchangeViewState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 4), child: Container( decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .popupBG, + color: + Theme.of( + context, + ).extension()!.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/pages/namecoin_names/sub_widgets/manage_domains_option_widget.dart b/lib/pages/namecoin_names/sub_widgets/manage_domains_option_widget.dart index f4a7df875c..f7961c360b 100644 --- a/lib/pages/namecoin_names/sub_widgets/manage_domains_option_widget.dart +++ b/lib/pages/namecoin_names/sub_widgets/manage_domains_option_widget.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:namecoin/namecoin.dart'; import '../../../models/isar/models/blockchain_data/utxo.dart'; @@ -12,10 +12,7 @@ import '../../../wallets/isar/providers/wallet_info_provider.dart'; import 'owned_name_card.dart'; class ManageDomainsOptionWidget extends ConsumerStatefulWidget { - const ManageDomainsOptionWidget({ - super.key, - required this.walletId, - }); + const ManageDomainsOptionWidget({super.key, required this.walletId}); final String walletId; @@ -62,40 +59,37 @@ class _ManageDomainsWidgetState builder: (context, snapshot) { List<(UTXO, OpNameData)> list = []; if (snapshot.hasData) { - list = snapshot.data!.map((utxo) { - final data = jsonDecode(utxo.otherData!) as Map; + list = snapshot.data! + .map((utxo) { + final data = jsonDecode(utxo.otherData!) as Map; - final nameData = jsonDecode(data["nameOpData"] as String) as Map; + final nameData = + jsonDecode(data["nameOpData"] as String) as Map; - return ( - utxo, - OpNameData(nameData.cast(), utxo.blockHeight ?? height) - ); - }).toList(growable: false); + return ( + utxo, + OpNameData(nameData.cast(), utxo.blockHeight ?? height), + ); + }) + .toList(growable: false); } return Column( children: [ ...list.map( (e) => Padding( - padding: const EdgeInsets.only( - bottom: 10, - ), + padding: const EdgeInsets.only(bottom: 10), child: OwnedNameCard( key: ValueKey(e), utxo: e.$1, opNameData: e.$2, firstColWidth: _width, - calculatedFirstColWidth: (value) => _sillyHack( - value, - list.length, - ), + calculatedFirstColWidth: + (value) => _sillyHack(value, list.length), ), ), ), - SizedBox( - height: Util.isDesktop ? 14 : 6, - ), + SizedBox(height: Util.isDesktop ? 14 : 6), ], ); }, diff --git a/lib/pages/namecoin_names/sub_widgets/name_details.dart b/lib/pages/namecoin_names/sub_widgets/name_details.dart index d16ca0b1ac..560297af03 100644 --- a/lib/pages/namecoin_names/sub_widgets/name_details.dart +++ b/lib/pages/namecoin_names/sub_widgets/name_details.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:namecoin/namecoin.dart'; import '../../../models/isar/models/isar_models.dart'; diff --git a/lib/pages/ordinals/widgets/ordinals_list.dart b/lib/pages/ordinals/widgets/ordinals_list.dart index ec67d7ef87..ff69da8dac 100644 --- a/lib/pages/ordinals/widgets/ordinals_list.dart +++ b/lib/pages/ordinals/widgets/ordinals_list.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/ordinal.dart'; import '../../../providers/db/main_db_provider.dart'; @@ -13,10 +13,7 @@ import '../../../widgets/rounded_white_container.dart'; import 'ordinal_card.dart'; class OrdinalsList extends ConsumerStatefulWidget { - const OrdinalsList({ - super.key, - required this.walletId, - }); + const OrdinalsList({super.key, required this.walletId}); final String walletId; @@ -33,23 +30,25 @@ class _OrdinalsListState extends ConsumerState { @override void initState() { - _stream = ref - .read(mainDBProvider) - .isar - .ordinals - .where() - .filter() - .walletIdEqualTo(widget.walletId) - .watch(); + _stream = + ref + .read(mainDBProvider) + .isar + .ordinals + .where() + .filter() + .walletIdEqualTo(widget.walletId) + .watch(); - _data = ref - .read(mainDBProvider) - .isar - .ordinals - .where() - .filter() - .walletIdEqualTo(widget.walletId) - .findAllSync(); + _data = + ref + .read(mainDBProvider) + .isar + .ordinals + .where() + .filter() + .walletIdEqualTo(widget.walletId) + .findAllSync(); super.initState(); } @@ -71,13 +70,15 @@ class _OrdinalsListState extends ConsumerState { child: Center( child: Text( "Your ordinals will appear here", - style: Util.isDesktop - ? STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, - ) - : STextStyles.label(context), + style: + Util.isDesktop + ? STextStyles.w500_14(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textSubtitle1, + ) + : STextStyles.label(context), ), ), ), @@ -89,18 +90,19 @@ class _OrdinalsListState extends ConsumerState { return Wrap( spacing: _spacing, runSpacing: _spacing, - children: _data - .map( - (e) => SizedBox( - width: 220, - height: 270, - child: OrdinalCard( - walletId: widget.walletId, - ordinal: e, - ), - ), - ) - .toList(), + children: + _data + .map( + (e) => SizedBox( + width: 220, + height: 270, + child: OrdinalCard( + walletId: widget.walletId, + ordinal: e, + ), + ), + ) + .toList(), ); } else { return GridView.builder( @@ -112,10 +114,9 @@ class _OrdinalsListState extends ConsumerState { crossAxisCount: Util.isDesktop ? 4 : 2, childAspectRatio: 6 / 7, // was 3/4, less data displayed now ), - itemBuilder: (_, i) => OrdinalCard( - walletId: widget.walletId, - ordinal: _data[i], - ), + itemBuilder: + (_, i) => + OrdinalCard(walletId: widget.walletId, ordinal: _data[i]), ); } }, diff --git a/lib/pages/receive_view/addresses/address_card.dart b/lib/pages/receive_view/addresses/address_card.dart index 59074d979e..901cd578be 100644 --- a/lib/pages/receive_view/addresses/address_card.dart +++ b/lib/pages/receive_view/addresses/address_card.dart @@ -18,7 +18,7 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:path_provider/path_provider.dart'; import 'package:share_plus/share_plus.dart'; @@ -76,8 +76,9 @@ class _AddressCardState extends ConsumerState { final RenderRepaintBoundary boundary = _qrKey.currentContext?.findRenderObject() as RenderRepaintBoundary; final ui.Image image = await boundary.toImage(); - final ByteData? byteData = - await image.toByteData(format: ui.ImageByteFormat.png); + final ByteData? byteData = await image.toByteData( + format: ui.ImageByteFormat.png, + ); final Uint8List pngBytes = byteData!.buffer.asUint8List(); if (shouldSaveInsteadOfShare) { @@ -129,10 +130,9 @@ class _AddressCardState extends ConsumerState { final file = await File("${tempDir.path}/qrcode.png").create(); await file.writeAsBytes(pngBytes); - await Share.shareFiles( - ["${tempDir.path}/qrcode.png"], - text: "Receive URI QR Code", - ); + await Share.shareFiles([ + "${tempDir.path}/qrcode.png", + ], text: "Receive URI QR Code"); } } catch (e) { //todo: comeback to this @@ -142,10 +142,11 @@ class _AddressCardState extends ConsumerState { @override void initState() { - address = MainDB.instance.isar.addresses - .where() - .idEqualTo(widget.addressId) - .findFirstSync()!; + address = + MainDB.instance.isar.addresses + .where() + .idEqualTo(widget.addressId) + .findFirstSync()!; label = MainDB.instance.getAddressLabelSync(widget.walletId, address.value); Id? id = label?.id; @@ -154,9 +155,10 @@ class _AddressCardState extends ConsumerState { walletId: widget.walletId, addressString: address.value, value: "", - tags: address.subType == AddressSubType.receiving - ? ["receiving"] - : address.subType == AddressSubType.change + tags: + address.subType == AddressSubType.receiving + ? ["receiving"] + : address.subType == AddressSubType.change ? ["change"] : null, ); @@ -180,26 +182,19 @@ class _AddressCardState extends ConsumerState { return ConditionalParent( condition: isDesktop, - builder: (child) => Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SvgPicture.file( - File( - ref.watch( - coinIconProvider(widget.coin), + builder: + (child) => Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SvgPicture.file( + File(ref.watch(coinIconProvider(widget.coin))), + width: 32, + height: 32, ), - ), - width: 32, - height: 32, - ), - const SizedBox( - width: 12, - ), - Expanded( - child: child, + const SizedBox(width: 12), + Expanded(child: child), + ], ), - ], - ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -218,17 +213,13 @@ class _AddressCardState extends ConsumerState { disableIcon: true, onValueChanged: (value) { MainDB.instance.putAddressLabel( - label!.copyWith( - label: value, - ), + label!.copyWith(label: value), ); }, ), ], ), - SizedBox( - height: isDesktop ? 2 : 8, - ), + SizedBox(height: isDesktop ? 2 : 8), Row( children: [ Expanded( @@ -239,36 +230,28 @@ class _AddressCardState extends ConsumerState { ), ], ), - const SizedBox( - height: 10, - ), + const SizedBox(height: 10), Row( children: [ CustomTextButton( text: "Copy address", onTap: () { widget.clipboard - .setData( - ClipboardData( - text: address.value, - ), - ) + .setData(ClipboardData(text: address.value)) .then((value) { - if (context.mounted) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.info, - message: "Copied to clipboard", - context: context, - ), - ); - } - }); + if (context.mounted) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.info, + message: "Copied to clipboard", + context: context, + ), + ); + } + }); }, ), - const SizedBox( - width: 16, - ), + const SizedBox(width: 16), CustomTextButton( text: "Show QR code", onTap: () async { @@ -284,21 +267,19 @@ class _AddressCardState extends ConsumerState { style: STextStyles.w600_18(context), ), if (label!.value.isNotEmpty) - const SizedBox( - height: 8, - ), + const SizedBox(height: 8), Text( address.value, - style: - STextStyles.w500_16(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + style: STextStyles.w500_16( + context, + ).copyWith( + color: + Theme.of(context) + .extension()! + .textSubtitle1, ), ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), Center( child: RepaintBoundary( key: _qrKey, @@ -312,25 +293,25 @@ class _AddressCardState extends ConsumerState { ), ), ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), Row( children: [ if (!isDesktop) Expanded( child: SecondaryButton( label: "Share", - buttonHeight: isDesktop - ? ButtonHeight.l - : null, + buttonHeight: + isDesktop + ? ButtonHeight.l + : null, icon: SvgPicture.asset( Assets.svg.share, width: 14, height: 14, - color: Theme.of(context) - .extension()! - .buttonTextSecondary, + color: + Theme.of(context) + .extension()! + .buttonTextSecondary, ), onPressed: () async { await _capturePng(false); @@ -340,9 +321,10 @@ class _AddressCardState extends ConsumerState { if (isDesktop) Expanded( child: PrimaryButton( - buttonHeight: isDesktop - ? ButtonHeight.l - : null, + buttonHeight: + isDesktop + ? ButtonHeight.l + : null, onPressed: () async { // TODO: add save functionality instead of share // save works on linux at the moment @@ -353,9 +335,10 @@ class _AddressCardState extends ConsumerState { Assets.svg.arrowDown, width: 20, height: 20, - color: Theme.of(context) - .extension()! - .buttonTextPrimary, + color: + Theme.of(context) + .extension()! + .buttonTextPrimary, ), ), ), diff --git a/lib/pages/receive_view/addresses/address_details_view.dart b/lib/pages/receive_view/addresses/address_details_view.dart index 51dfd7e4ee..aa6fd9be37 100644 --- a/lib/pages/receive_view/addresses/address_details_view.dart +++ b/lib/pages/receive_view/addresses/address_details_view.dart @@ -11,7 +11,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../db/isar/main_db.dart'; import '../../../models/isar/models/blockchain_data/v2/transaction_v2.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 f0508f4a52..78a8ea9eac 100644 --- a/lib/pages/receive_view/addresses/edit_address_label_view.dart +++ b/lib/pages/receive_view/addresses/edit_address_label_view.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../db/isar/main_db.dart'; import '../../../models/isar/models/address_label.dart'; diff --git a/lib/pages/receive_view/addresses/wallet_addresses_view.dart b/lib/pages/receive_view/addresses/wallet_addresses_view.dart index 8b87fd074d..7dcf0ea840 100644 --- a/lib/pages/receive_view/addresses/wallet_addresses_view.dart +++ b/lib/pages/receive_view/addresses/wallet_addresses_view.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../db/isar/main_db.dart'; diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index 3cd473b489..5fa78b359a 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -15,7 +15,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../models/isar/models/isar_models.dart'; import '../../models/keys/view_only_wallet_data.dart'; diff --git a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_1b.dart b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_1b.dart index e5f6581a1b..f7e6d0b438 100644 --- a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_1b.dart +++ b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_1b.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../frost_route_generator.dart'; import '../../../../models/input.dart'; 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 06cbfe8527..b350fa527b 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 @@ -14,7 +14,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../../models/isar/stack_theme.dart'; import '../../../../../notifications/show_flush_bar.dart'; @@ -34,10 +34,7 @@ import '../../../../../widgets/rounded_white_container.dart'; import '../../../../../widgets/stack_dialog.dart'; class StackThemeCard extends ConsumerStatefulWidget { - const StackThemeCard({ - super.key, - required this.data, - }); + const StackThemeCard({super.key, required this.data}); final StackThemeMetaData data; @@ -57,29 +54,33 @@ class _StackThemeCardState extends ConsumerState { final service = ref.read(pThemeService); try { - final data = await service.fetchTheme( - themeMetaData: widget.data, - ); + final data = await service.fetchTheme(themeMetaData: widget.data); await service.install(themeArchiveData: data); return true; } catch (e, s) { - Logging.instance.w("Failed _downloadAndInstall of ${widget.data.id}: ", error: e, stackTrace: s); + Logging.instance.w( + "Failed _downloadAndInstall of ${widget.data.id}: ", + error: e, + stackTrace: s, + ); return false; } } Future _downloadPressed() async { - final result = (await showLoading( - whileFuture: _downloadAndInstall(), - context: context, - message: "Downloading and installing theme...", - ))!; + final result = + (await showLoading( + whileFuture: _downloadAndInstall(), + context: context, + message: "Downloading and installing theme...", + ))!; if (mounted) { - final message = result - ? "${widget.data.name} theme installed!" - : "Failed to install ${widget.data.name} theme"; + final message = + result + ? "${widget.data.name} theme installed!" + : "Failed to install ${widget.data.name} theme"; if (isDesktop) { await showFloatingFlushBar( type: result ? FlushBarType.success : FlushBarType.warning, @@ -89,15 +90,16 @@ class _StackThemeCardState extends ConsumerState { } else { await showDialog( context: context, - builder: (_) => StackOkDialog( - title: message, - onOkPressed: (_) { - setState(() { - _needsUpdate = !result; - _hasTheme = result; - }); - }, - ), + builder: + (_) => StackOkDialog( + title: message, + onOkPressed: (_) { + setState(() { + _needsUpdate = !result; + _hasTheme = result; + }); + }, + ), ); } } @@ -128,8 +130,9 @@ class _StackThemeCardState extends ConsumerState { final themeDir = Directory("${themesDir.path}/${widget.data.id}"); int bytes = 0; if (await themeDir.exists()) { - await for (final FileSystemEntity entity - in themeDir.list(recursive: true)) { + await for (final FileSystemEntity entity in themeDir.list( + recursive: true, + )) { if (entity is File) { bytes += await entity.length(); } @@ -152,13 +155,14 @@ class _StackThemeCardState extends ConsumerState { } } - StackTheme? getInstalled() => ref - .read(mainDBProvider) - .isar - .stackThemes - .where() - .themeIdEqualTo(widget.data.id) - .findFirstSync(); + StackTheme? getInstalled() => + ref + .read(mainDBProvider) + .isar + .stackThemes + .where() + .themeIdEqualTo(widget.data.id) + .findFirstSync(); @override void initState() { @@ -174,20 +178,20 @@ class _StackThemeCardState extends ConsumerState { .stackThemes .watchLazy() .listen((event) async { - final installedTheme = getInstalled(); - final hasTheme = installedTheme != null; - if (_hasTheme != hasTheme && mounted) { - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - setState(() { - _hasTheme = hasTheme; - if (hasTheme) { - _needsUpdate = - widget.data.version > (installedTheme.version ?? 0); - } - }); + final installedTheme = getInstalled(); + final hasTheme = installedTheme != null; + if (_hasTheme != hasTheme && mounted) { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + setState(() { + _hasTheme = hasTheme; + if (hasTheme) { + _needsUpdate = + widget.data.version > (installedTheme.version ?? 0); + } + }); + }); + } }); - } - }); _subscription.resume(); super.initState(); @@ -203,67 +207,46 @@ class _StackThemeCardState extends ConsumerState { Widget build(BuildContext context) { return RoundedWhiteContainer( radiusMultiplier: isDesktop ? 2.5 : 1, - borderColor: isDesktop - ? Theme.of(context).extension()!.textSubtitle6 - : null, + borderColor: + isDesktop + ? Theme.of(context).extension()!.textSubtitle6 + : null, child: Column( mainAxisSize: MainAxisSize.min, children: [ Padding( - padding: const EdgeInsets.symmetric( - horizontal: 18, - ), - child: widget.data.previewImageUrl.isNotEmpty - ? AspectRatio( - aspectRatio: 1, - child: ClipRRect( - borderRadius: BorderRadius.circular(100), - child: Image.network( - widget.data.previewImageUrl, + padding: const EdgeInsets.symmetric(horizontal: 18), + child: + widget.data.previewImageUrl.isNotEmpty + ? AspectRatio( + aspectRatio: 1, + child: ClipRRect( + borderRadius: BorderRadius.circular(100), + child: Image.network(widget.data.previewImageUrl), ), - ), - ) - : Builder( - builder: (context) { - final themePreview = ref - .watch(pThemeService) - .getTheme(themeId: widget.data.id) - ?.assets - .themePreview ?? - ""; + ) + : Builder( + builder: (context) { + final themePreview = + ref + .watch(pThemeService) + .getTheme(themeId: widget.data.id) + ?.assets + .themePreview ?? + ""; - return (themePreview.endsWith(".png")) - ? Image.file( - File( - themePreview, - ), - height: 100, - ) - : SvgPicture.file( - File( - themePreview, - ), - height: 100, - ); - }, - ), - ), - const SizedBox( - height: 12, - ), - Text( - widget.data.name, - style: STextStyles.itemSubtitle12(context), - ), - const SizedBox( - height: 6, + return (themePreview.endsWith(".png")) + ? Image.file(File(themePreview), height: 100) + : SvgPicture.file(File(themePreview), height: 100); + }, + ), ), + const SizedBox(height: 12), + Text(widget.data.name, style: STextStyles.itemSubtitle12(context)), + const SizedBox(height: 6), FutureBuilder( future: getThemeDirectorySize(), - builder: ( - context, - AsyncSnapshot snapshot, - ) { + builder: (context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { _cachedSize = snapshot.data; @@ -279,31 +262,24 @@ class _StackThemeCardState extends ConsumerState { style: STextStyles.label(context), ); } else { - return Text( - _cachedSize!, - style: STextStyles.label(context), - ); + return Text(_cachedSize!, style: STextStyles.label(context)); } }, ), - if (_hasTheme && _needsUpdate) - const SizedBox( - height: 12, - ), + if (_hasTheme && _needsUpdate) const SizedBox(height: 12), if (_hasTheme && _needsUpdate) PrimaryButton( label: "Update", buttonHeight: isDesktop ? ButtonHeight.s : ButtonHeight.l, onPressed: _downloadPressed, ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), AnimatedCrossFade( duration: const Duration(milliseconds: 300), - crossFadeState: _hasTheme - ? CrossFadeState.showSecond - : CrossFadeState.showFirst, + crossFadeState: + _hasTheme + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, firstChild: PrimaryButton( label: "Download", buttonHeight: isDesktop ? ButtonHeight.s : ButtonHeight.l, 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 a178dddab9..4069f06f6e 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 @@ -14,7 +14,7 @@ import 'dart:io'; import 'dart:typed_data'; import 'package:frostdart/frostdart.dart' as frost; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:stack_wallet_backup/stack_wallet_backup.dart'; import 'package:tuple/tuple.dart'; import 'package:uuid/uuid.dart'; diff --git a/lib/pages/spark_names/buy_spark_name_view.dart b/lib/pages/spark_names/buy_spark_name_view.dart index fa2cae828c..b05d6b2260 100644 --- a/lib/pages/spark_names/buy_spark_name_view.dart +++ b/lib/pages/spark_names/buy_spark_name_view.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../providers/providers.dart'; import '../../../utilities/amount/amount.dart'; 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 f6ef70c385..a25d34274d 100644 --- a/lib/pages/token_view/sub_widgets/my_tokens_list.dart +++ b/lib/pages/token_view/sub_widgets/my_tokens_list.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../db/isar/main_db.dart'; import '../../../models/isar/models/ethereum/eth_contract.dart'; @@ -79,13 +79,11 @@ class MyTokensList extends StatelessWidget { final token = tokens[index]; return Padding( key: Key(token.address), - padding: isDesktop - ? const EdgeInsets.symmetric(vertical: 5) - : const EdgeInsets.all(4), - child: MyTokenSelectItem( - walletId: walletId, - token: token, - ), + padding: + isDesktop + ? const EdgeInsets.symmetric(vertical: 5) + : const EdgeInsets.all(4), + child: MyTokenSelectItem(walletId: walletId, token: token), ); }, ); 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 657a5283a5..dc8255726e 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 @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; import '../../wallet_view/sub_widgets/no_transactions_found.dart'; import '../../wallet_view/transaction_views/tx_v2/transaction_v2_list_item.dart'; diff --git a/lib/pages/token_view/token_contract_details_view.dart b/lib/pages/token_view/token_contract_details_view.dart index 08e82e0aea..3f292054bb 100644 --- a/lib/pages/token_view/token_contract_details_view.dart +++ b/lib/pages/token_view/token_contract_details_view.dart @@ -10,7 +10,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; + import '../../db/isar/main_db.dart'; import '../../models/isar/models/isar_models.dart'; import '../../themes/stack_colors.dart'; @@ -47,10 +48,11 @@ class _TokenContractDetailsViewState @override void initState() { - contract = MainDB.instance.isar.ethContracts - .where() - .addressEqualTo(widget.contractAddress) - .findFirstSync()!; + contract = + MainDB.instance.isar.ethContracts + .where() + .addressEqualTo(widget.contractAddress) + .findFirstSync()!; super.initState(); } @@ -59,92 +61,77 @@ class _TokenContractDetailsViewState Widget build(BuildContext context) { return ConditionalParent( condition: !isDesktop, - builder: (child) => Background( - child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, - appBar: AppBar( - backgroundColor: - Theme.of(context).extension()!.backgroundAppBar, - leading: AppBarBackButton( - onPressed: () { - Navigator.of(context).pop(); - }, - ), - titleSpacing: 0, - title: Text( - "Contract details", - style: STextStyles.navBarTitle(context), - ), - ), - body: SafeArea( - child: LayoutBuilder( - builder: (builderContext, constraints) { - return SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: constraints.maxHeight, - ), - child: Padding( - padding: const EdgeInsets.all(16), - child: child, - ), - ), - ); - }, + builder: + (child) => Background( + child: Scaffold( + backgroundColor: + Theme.of(context).extension()!.background, + appBar: AppBar( + backgroundColor: + Theme.of( + context, + ).extension()!.backgroundAppBar, + leading: AppBarBackButton( + onPressed: () { + Navigator.of(context).pop(); + }, + ), + titleSpacing: 0, + title: Text( + "Contract details", + style: STextStyles.navBarTitle(context), + ), + ), + body: SafeArea( + child: LayoutBuilder( + builder: (builderContext, constraints) { + return SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight, + ), + child: Padding( + padding: const EdgeInsets.all(16), + child: child, + ), + ), + ); + }, + ), + ), ), ), - ), - ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ _Item( title: "Contract address", data: contract.address, - button: SimpleCopyButton( - data: contract.address, - ), - ), - const SizedBox( - height: 12, + button: SimpleCopyButton(data: contract.address), ), + const SizedBox(height: 12), _Item( title: "Name", data: contract.name, - button: SimpleCopyButton( - data: contract.name, - ), - ), - const SizedBox( - height: 12, + button: SimpleCopyButton(data: contract.name), ), + const SizedBox(height: 12), _Item( title: "Symbol", data: contract.symbol, - button: SimpleCopyButton( - data: contract.symbol, - ), - ), - const SizedBox( - height: 12, + button: SimpleCopyButton(data: contract.symbol), ), + const SizedBox(height: 12), _Item( title: "Type", data: contract.type.name, - button: SimpleCopyButton( - data: contract.type.name, - ), - ), - const SizedBox( - height: 12, + button: SimpleCopyButton(data: contract.type.name), ), + const SizedBox(height: 12), _Item( title: "Decimals", data: contract.decimals.toString(), - button: SimpleCopyButton( - data: contract.decimals.toString(), - ), + button: SimpleCopyButton(data: contract.decimals.toString()), ), ], ), @@ -173,29 +160,20 @@ class _Item extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - title, - style: STextStyles.itemSubtitle(context), - ), + Text(title, style: STextStyles.itemSubtitle(context)), button, ], ), - const SizedBox( - height: 5, - ), + const SizedBox(height: 5), data.isNotEmpty - ? SelectableText( - data, - style: STextStyles.w500_14(context), - ) + ? SelectableText(data, style: STextStyles.w500_14(context)) : Text( - "$title will appear here", - style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle3, - ), + "$title will appear here", + style: STextStyles.w500_14(context).copyWith( + color: + Theme.of(context).extension()!.textSubtitle3, ), + ), ], ), ); diff --git a/lib/pages/wallet_view/sub_widgets/transactions_list.dart b/lib/pages/wallet_view/sub_widgets/transactions_list.dart index 8e2fb5cb67..12c3d0a2cd 100644 --- a/lib/pages/wallet_view/sub_widgets/transactions_list.dart +++ b/lib/pages/wallet_view/sub_widgets/transactions_list.dart @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../models/isar/models/isar_models.dart'; @@ -36,10 +36,7 @@ import '../wallet_view.dart'; import 'no_transactions_found.dart'; class TransactionsList extends ConsumerStatefulWidget { - const TransactionsList({ - super.key, - required this.walletId, - }); + const TransactionsList({super.key, required this.walletId}); final String walletId; @@ -57,23 +54,15 @@ class _TransactionsListState extends ConsumerState { BorderRadius get _borderRadiusFirst { return BorderRadius.only( - topLeft: Radius.circular( - Constants.size.circularBorderRadius, - ), - topRight: Radius.circular( - Constants.size.circularBorderRadius, - ), + topLeft: Radius.circular(Constants.size.circularBorderRadius), + topRight: Radius.circular(Constants.size.circularBorderRadius), ); } BorderRadius get _borderRadiusLast { return BorderRadius.only( - bottomLeft: Radius.circular( - Constants.size.circularBorderRadius, - ), - bottomRight: Radius.circular( - Constants.size.circularBorderRadius, - ), + bottomLeft: Radius.circular(Constants.size.circularBorderRadius), + bottomRight: Radius.circular(Constants.size.circularBorderRadius), ); } @@ -120,58 +109,62 @@ class _TransactionsListState extends ConsumerState { if (Util.isDesktop) { await showDialog( context: context, - builder: (context) => Navigator( - initialRoute: TradeDetailsView.routeName, - onGenerateRoute: RouteGenerator.generateRoute, - onGenerateInitialRoutes: (_, __) { - return [ - FadePageRoute( - DesktopDialog( - maxHeight: null, - maxWidth: 580, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 32, - bottom: 16, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - "Trade details", - style: STextStyles.desktopH3(context), + builder: + (context) => Navigator( + initialRoute: TradeDetailsView.routeName, + onGenerateRoute: RouteGenerator.generateRoute, + onGenerateInitialRoutes: (_, __) { + return [ + FadePageRoute( + DesktopDialog( + maxHeight: null, + maxWidth: 580, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 32, + bottom: 16, ), - DesktopDialogCloseButton( - onPressedOverride: Navigator.of( - context, - rootNavigator: true, - ).pop, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + "Trade details", + style: STextStyles.desktopH3( + context, + ), + ), + DesktopDialogCloseButton( + onPressedOverride: + Navigator.of( + context, + rootNavigator: true, + ).pop, + ), + ], ), - ], - ), - ), - Flexible( - child: TradeDetailsView( - tradeId: trade.tradeId, - transactionIfSentFromStack: tx, - walletName: walletName, - walletId: widget.walletId, - ), + ), + Flexible( + child: TradeDetailsView( + tradeId: trade.tradeId, + transactionIfSentFromStack: tx, + walletName: walletName, + walletId: widget.walletId, + ), + ), + ], ), - ], + ), + const RouteSettings( + name: TradeDetailsView.routeName, + ), ), - ), - const RouteSettings( - name: TradeDetailsView.routeName, - ), - ), - ]; - }, - ), + ]; + }, + ), ); } else { unawaited( @@ -209,13 +202,14 @@ class _TransactionsListState extends ConsumerState { @override void initState() { - _query = ref - .read(mainDBProvider) - .isar - .transactions - .where() - .walletIdEqualTo(widget.walletId) - .sortByTimestampDesc(); + _query = + ref + .read(mainDBProvider) + .isar + .transactions + .where() + .walletIdEqualTo(widget.walletId) + .sortByTimestampDesc(); _subscription = _query.watch().listen((event) { WidgetsBinding.instance.addPostFrameCallback((_) { @@ -252,15 +246,8 @@ class _TransactionsListState extends ConsumerState { return const Column( children: [ Spacer(), - Center( - child: LoadingIndicator( - height: 50, - width: 50, - ), - ), - Spacer( - flex: 4, - ), + Center(child: LoadingIndicator(height: 50, width: 50)), + Spacer(flex: 4), ], ); } @@ -278,64 +265,66 @@ class _TransactionsListState extends ConsumerState { onRefresh: () async { await ref.read(pWallets).getWallet(widget.walletId).refresh(); }, - child: Util.isDesktop - ? ListView.separated( - shrinkWrap: true, - itemBuilder: (context, index) { - BorderRadius? radius; - if (_transactions2.length == 1) { - radius = BorderRadius.circular( - Constants.size.circularBorderRadius, - ); - } else if (index == _transactions2.length - 1) { - radius = _borderRadiusLast; - } else if (index == 0) { - radius = _borderRadiusFirst; - } - final tx = _transactions2[index]; - return itemBuilder(context, tx, radius, coin, height); - }, - separatorBuilder: (context, index) { - return Container( - width: double.infinity, - height: 2, - color: Theme.of(context) - .extension()! - .background, - ); - }, - itemCount: _transactions2.length, - ) - : ListView.builder( - itemCount: _transactions2.length, - itemBuilder: (context, index) { - BorderRadius? radius; - bool shouldWrap = false; - if (_transactions2.length == 1) { - radius = BorderRadius.circular( - Constants.size.circularBorderRadius, - ); - } else if (index == _transactions2.length - 1) { - radius = _borderRadiusLast; - shouldWrap = true; - } else if (index == 0) { - radius = _borderRadiusFirst; - } - final tx = _transactions2[index]; - if (shouldWrap) { - return Column( - children: [ - itemBuilder(context, tx, radius, coin, height), - const SizedBox( - height: WalletView.navBarHeight + 14, - ), - ], - ); - } else { + child: + Util.isDesktop + ? ListView.separated( + shrinkWrap: true, + itemBuilder: (context, index) { + BorderRadius? radius; + if (_transactions2.length == 1) { + radius = BorderRadius.circular( + Constants.size.circularBorderRadius, + ); + } else if (index == _transactions2.length - 1) { + radius = _borderRadiusLast; + } else if (index == 0) { + radius = _borderRadiusFirst; + } + final tx = _transactions2[index]; return itemBuilder(context, tx, radius, coin, height); - } - }, - ), + }, + separatorBuilder: (context, index) { + return Container( + width: double.infinity, + height: 2, + color: + Theme.of( + context, + ).extension()!.background, + ); + }, + itemCount: _transactions2.length, + ) + : ListView.builder( + itemCount: _transactions2.length, + itemBuilder: (context, index) { + BorderRadius? radius; + bool shouldWrap = false; + if (_transactions2.length == 1) { + radius = BorderRadius.circular( + Constants.size.circularBorderRadius, + ); + } else if (index == _transactions2.length - 1) { + radius = _borderRadiusLast; + shouldWrap = true; + } else if (index == 0) { + radius = _borderRadiusFirst; + } + final tx = _transactions2[index]; + if (shouldWrap) { + return Column( + children: [ + itemBuilder(context, tx, radius, coin, height), + const SizedBox( + height: WalletView.navBarHeight + 14, + ), + ], + ); + } else { + return itemBuilder(context, tx, radius, coin, height); + } + }, + ), ); } }, 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 397fd7d798..98996a7807 100644 --- a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart +++ b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart @@ -14,7 +14,7 @@ import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart index b4b95f1cb1..356d106f83 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/all_transactions_v2_view.dart @@ -15,7 +15,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; import '../../../../models/isar/models/contact_entry.dart'; diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index 2f2bbf83b4..13c0b1fc4d 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart index b805cd8199..9acb8b7051 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../models/isar/models/blockchain_data/transaction.dart'; import '../../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; @@ -29,10 +29,7 @@ import 'fusion_tx_group_card.dart'; import 'transaction_v2_list_item.dart'; class TransactionsV2List extends ConsumerStatefulWidget { - const TransactionsV2List({ - super.key, - required this.walletId, - }); + const TransactionsV2List({super.key, required this.walletId}); final String walletId; @@ -50,48 +47,39 @@ class _TransactionsV2ListState extends ConsumerState { BorderRadius get _borderRadiusFirst { return BorderRadius.only( - topLeft: Radius.circular( - Constants.size.circularBorderRadius, - ), - topRight: Radius.circular( - Constants.size.circularBorderRadius, - ), + topLeft: Radius.circular(Constants.size.circularBorderRadius), + topRight: Radius.circular(Constants.size.circularBorderRadius), ); } BorderRadius get _borderRadiusLast { return BorderRadius.only( - bottomLeft: Radius.circular( - Constants.size.circularBorderRadius, - ), - bottomRight: Radius.circular( - Constants.size.circularBorderRadius, - ), + bottomLeft: Radius.circular(Constants.size.circularBorderRadius), + bottomRight: Radius.circular(Constants.size.circularBorderRadius), ); } @override void initState() { coin = ref.read(pWallets).getWallet(widget.walletId).info.coin; - _query = - ref.read(mainDBProvider).isar.transactionV2s.buildQuery( - whereClauses: [ - IndexWhereClause.equalTo( - indexName: 'walletId', - value: [widget.walletId], - ), - ], - filter: ref + _query = ref + .read(mainDBProvider) + .isar + .transactionV2s + .buildQuery( + whereClauses: [ + IndexWhereClause.equalTo( + indexName: 'walletId', + value: [widget.walletId], + ), + ], + filter: + ref .read(pWallets) .getWallet(widget.walletId) .transactionFilterOperation, - sortBy: [ - const SortProperty( - property: "timestamp", - sort: Sort.desc, - ), - ], - ); + sortBy: [const SortProperty(property: "timestamp", sort: Sort.desc)], + ); _subscription = _query.watch().listen((event) { WidgetsBinding.instance.addPostFrameCallback((_) { @@ -124,15 +112,8 @@ class _TransactionsV2ListState extends ConsumerState { return const Column( children: [ Spacer(), - Center( - child: LoadingIndicator( - height: 50, - width: 50, - ), - ), - Spacer( - flex: 4, - ), + Center(child: LoadingIndicator(height: 50, width: 50)), + Spacer(flex: 4), ], ); } @@ -159,8 +140,9 @@ class _TransactionsV2ListState extends ConsumerState { final prevTime = DateTime.fromMillisecondsSinceEpoch( fusions.last.timestamp * 1000, ); - final thisTime = - DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000); + final thisTime = DateTime.fromMillisecondsSinceEpoch( + tx.timestamp * 1000, + ); if (prevTime.difference(thisTime).inMinutes > 30) { _txns.add(FusionTxGroup(fusions)); @@ -190,76 +172,66 @@ class _TransactionsV2ListState extends ConsumerState { onRefresh: () async { await ref.read(pWallets).getWallet(widget.walletId).refresh(); }, - child: Util.isDesktop - ? ListView.separated( - shrinkWrap: true, - itemBuilder: (context, index) { - BorderRadius? radius; - if (_txns.length == 1) { - radius = BorderRadius.circular( - Constants.size.circularBorderRadius, - ); - } else if (index == _txns.length - 1) { - radius = _borderRadiusLast; - } else if (index == 0) { - radius = _borderRadiusFirst; - } - final tx = _txns[index]; - return TxListItem( - tx: tx, - coin: coin, - radius: radius, - ); - }, - separatorBuilder: (context, index) { - return Container( - width: double.infinity, - height: 2, - color: Theme.of(context) - .extension()! - .background, - ); - }, - itemCount: _txns.length, - ) - : ListView.builder( - itemCount: _txns.length, - itemBuilder: (context, index) { - BorderRadius? radius; - bool shouldWrap = false; - if (_txns.length == 1) { - radius = BorderRadius.circular( - Constants.size.circularBorderRadius, - ); - } else if (index == _txns.length - 1) { - radius = _borderRadiusLast; - shouldWrap = true; - } else if (index == 0) { - radius = _borderRadiusFirst; - } - final tx = _txns[index]; - if (shouldWrap) { - return Column( - children: [ - TxListItem( - tx: tx, - coin: coin, - radius: radius, - ), - const SizedBox( - height: WalletView.navBarHeight + 14, - ), - ], - ); - } else { - return TxListItem( - tx: tx, - coin: coin, - radius: radius, + child: + Util.isDesktop + ? ListView.separated( + shrinkWrap: true, + itemBuilder: (context, index) { + BorderRadius? radius; + if (_txns.length == 1) { + radius = BorderRadius.circular( + Constants.size.circularBorderRadius, + ); + } else if (index == _txns.length - 1) { + radius = _borderRadiusLast; + } else if (index == 0) { + radius = _borderRadiusFirst; + } + final tx = _txns[index]; + return TxListItem(tx: tx, coin: coin, radius: radius); + }, + separatorBuilder: (context, index) { + return Container( + width: double.infinity, + height: 2, + color: + Theme.of( + context, + ).extension()!.background, ); - } - }, - ), + }, + itemCount: _txns.length, + ) + : ListView.builder( + itemCount: _txns.length, + itemBuilder: (context, index) { + BorderRadius? radius; + bool shouldWrap = false; + if (_txns.length == 1) { + radius = BorderRadius.circular( + Constants.size.circularBorderRadius, + ); + } else if (index == _txns.length - 1) { + radius = _borderRadiusLast; + shouldWrap = true; + } else if (index == 0) { + radius = _borderRadiusFirst; + } + final tx = _txns[index]; + if (shouldWrap) { + return Column( + children: [ + TxListItem(tx: tx, coin: coin, radius: radius), + const SizedBox( + height: WalletView.navBarHeight + 14, + ), + ], + ); + } else { + return TxListItem(tx: tx, coin: coin, radius: radius); + } + }, + ), ); } }, diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index c61340a4b5..32c565e3df 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -15,7 +15,7 @@ import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../app_config.dart'; diff --git a/lib/pages/wallets_view/wallets_overview.dart b/lib/pages/wallets_view/wallets_overview.dart index 7ba524713f..bd1dfe5be9 100644 --- a/lib/pages/wallets_view/wallets_overview.dart +++ b/lib/pages/wallets_view/wallets_overview.dart @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../app_config.dart'; import '../../models/add_wallet_list_entity/sub_classes/coin_entity.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 f3037f527b..5346532264 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 @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../models/isar/models/contact_entry.dart'; @@ -35,10 +35,7 @@ import 'desktop_address_card.dart'; import 'desktop_contact_options_menu_popup.dart'; class DesktopContactDetails extends ConsumerStatefulWidget { - const DesktopContactDetails({ - super.key, - required this.contactId, - }); + const DesktopContactDetails({super.key, required this.contactId}); final String contactId; @@ -51,24 +48,26 @@ class _DesktopContactDetailsState extends ConsumerState { List> _cachedTransactions = []; Future>> - _filteredTransactionsByContact() async { - final contact = - ref.read(addressBookServiceProvider).getContactById(widget.contactId); + _filteredTransactionsByContact() async { + final contact = ref + .read(addressBookServiceProvider) + .getContactById(widget.contactId); // TODO: optimise - final transactions = await ref - .read(mainDBProvider) - .isar - .transactions - .where() - .filter() - .anyOf( - contact.addresses.map((e) => e.address), - (q, String e) => q.address((q) => q.valueEqualTo(e)), - ) - .sortByTimestampDesc() - .findAll(); + final transactions = + await ref + .read(mainDBProvider) + .isar + .transactions + .where() + .filter() + .anyOf( + contact.addresses.map((e) => e.address), + (q, String e) => q.address((q) => q.valueEqualTo(e)), + ) + .sortByTimestampDesc() + .findAll(); final List> result = []; @@ -88,8 +87,9 @@ class _DesktopContactDetailsState extends ConsumerState { ContactEntry? _contact; try { _contact = ref.watch( - addressBookServiceProvider - .select((value) => value.getContactById(widget.contactId)), + addressBookServiceProvider.select( + (value) => value.getContactById(widget.contactId), + ), ); } catch (_) { return Container(); @@ -115,33 +115,27 @@ class _DesktopContactDetailsState extends ConsumerState { width: 32, height: 32, decoration: BoxDecoration( - color: contact.customId == "default" - ? Colors.transparent - : Theme.of(context) - .extension()! - .textFieldDefaultBG, + color: + contact.customId == "default" + ? Colors.transparent + : Theme.of(context) + .extension()! + .textFieldDefaultBG, borderRadius: BorderRadius.circular(32), ), - child: contact.customId == "default" - ? const Center( - child: AppIcon( - width: 32, - ), - ) - : contact.emojiChar != null - ? Center( - child: Text(contact.emojiChar!), - ) + child: + contact.customId == "default" + ? const Center(child: AppIcon(width: 32)) + : contact.emojiChar != null + ? Center(child: Text(contact.emojiChar!)) : Center( - child: SvgPicture.asset( - Assets.svg.user, - width: 18, - ), + child: SvgPicture.asset( + Assets.svg.user, + width: 18, ), + ), ), - const SizedBox( - width: 16, - ), + const SizedBox(width: 16), Text( contact.name, style: STextStyles.desktopTextSmall(context), @@ -167,9 +161,7 @@ class _DesktopContactDetailsState extends ConsumerState { ), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Flexible( child: ListView( primary: false, @@ -183,8 +175,9 @@ class _DesktopContactDetailsState extends ConsumerState { children: [ Text( "Addresses", - style: - STextStyles.desktopTextExtraExtraSmall(context), + style: STextStyles.desktopTextExtraExtraSmall( + context, + ), ), CustomTextButton( text: "Add new", @@ -195,69 +188,71 @@ class _DesktopContactDetailsState extends ConsumerState { await showDialog( context: context, - builder: (context) => DesktopDialog( - maxWidth: 580, - maxHeight: 566, - child: Column( - children: [ - Row( + builder: + (context) => DesktopDialog( + maxWidth: 580, + maxHeight: 566, + child: Column( children: [ - const SizedBox( - width: 8, - ), - const AppBarBackButton( - isCompact: true, + Row( + children: [ + const SizedBox(width: 8), + const AppBarBackButton( + isCompact: true, + ), + Text( + "Add new address", + style: STextStyles.desktopH3( + context, + ), + ), + ], ), - Text( - "Add new address", - style: - STextStyles.desktopH3(context), + Expanded( + child: Padding( + padding: const EdgeInsets.only( + top: 20, + left: 32, + right: 32, + bottom: 32, + ), + child: AddNewContactAddressView( + contactId: widget.contactId, + ), + ), ), ], ), - Expanded( - child: Padding( - padding: const EdgeInsets.only( - top: 20, - left: 32, - right: 32, - bottom: 32, - ), - child: AddNewContactAddressView( - contactId: widget.contactId, - ), - ), - ), - ], - ), - ), + ), ); }, ), ], ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), RoundedWhiteContainer( padding: const EdgeInsets.all(0), - borderColor: Theme.of(context) - .extension()! - .background, + borderColor: + Theme.of( + context, + ).extension()!.background, child: Column( mainAxisSize: MainAxisSize.min, children: [ - for (int i = 0; - i < contact.addressesSorted.length; - i++) + for ( + int i = 0; + i < contact.addressesSorted.length; + i++ + ) Column( mainAxisSize: MainAxisSize.min, children: [ if (i > 0) Container( - color: Theme.of(context) - .extension()! - .background, + color: + Theme.of(context) + .extension()! + .background, height: 1, ), Padding( @@ -273,14 +268,12 @@ class _DesktopContactDetailsState extends ConsumerState { ), ), Padding( - padding: const EdgeInsets.only( - top: 20, - bottom: 12, - ), + padding: const EdgeInsets.only(top: 20, bottom: 12), child: Text( "Transaction history", - style: - STextStyles.desktopTextExtraExtraSmall(context), + style: STextStyles.desktopTextExtraExtraSmall( + context, + ), ), ), FutureBuilder( @@ -288,7 +281,7 @@ class _DesktopContactDetailsState extends ConsumerState { builder: ( _, AsyncSnapshot>> - snapshot, + snapshot, ) { if (snapshot.connectionState == ConnectionState.done && @@ -298,9 +291,10 @@ class _DesktopContactDetailsState extends ConsumerState { if (_cachedTransactions.isNotEmpty) { return RoundedWhiteContainer( padding: const EdgeInsets.all(0), - borderColor: Theme.of(context) - .extension()! - .background, + borderColor: + Theme.of( + context, + ).extension()!.background, child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -333,9 +327,10 @@ class _DesktopContactDetailsState extends ConsumerState { } else { return RoundedWhiteContainer( padding: const EdgeInsets.all(0), - borderColor: Theme.of(context) - .extension()! - .background, + borderColor: + Theme.of( + context, + ).extension()!.background, child: Column( mainAxisSize: MainAxisSize.min, children: [ 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 9186b8f0b7..f3bdb2bc2f 100644 --- a/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart +++ b/lib/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../models/isar/models/isar_models.dart'; import '../../pages/receive_view/addresses/address_details_view.dart'; @@ -27,10 +27,7 @@ import 'sub_widgets/desktop_address_list.dart'; final desktopSelectedAddressId = StateProvider.autoDispose((ref) => null); class DesktopWalletAddressesView extends ConsumerStatefulWidget { - const DesktopWalletAddressesView({ - super.key, - required this.walletId, - }); + const DesktopWalletAddressesView({super.key, required this.walletId}); static const String routeName = "/desktopWalletAddressesView"; @@ -82,32 +79,27 @@ class _DesktopWalletAddressesViewState leading: Expanded( child: Row( children: [ - const SizedBox( - width: 32, - ), + const SizedBox(width: 32), AppBarIconButton( size: 32, - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, + color: + Theme.of( + context, + ).extension()!.textFieldDefaultBG, shadows: const [], icon: SvgPicture.asset( Assets.svg.arrowLeft, width: 18, height: 18, - color: Theme.of(context) - .extension()! - .topNavIconPrimary, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, ), onPressed: Navigator.of(context).pop, ), - const SizedBox( - width: 12, - ), - Text( - "Address list", - style: STextStyles.desktopH3(context), - ), + const SizedBox(width: 12), + Text("Address list", style: STextStyles.desktopH3(context)), const Spacer(), ], ), @@ -129,15 +121,11 @@ class _DesktopWalletAddressesViewState walletId: widget.walletId, ), ), - const SizedBox( - width: 16, - ), + const SizedBox(width: 16), Expanded( child: Column( children: [ - const SizedBox( - height: _headerHeight, - ), + const SizedBox(height: _headerHeight), if (ref.watch(desktopSelectedAddressId.state).state != null) Expanded( @@ -147,9 +135,10 @@ class _DesktopWalletAddressesViewState "currentDesktopAddressDetails_key_${ref.watch(desktopSelectedAddressId.state).state}", ), walletId: widget.walletId, - addressId: ref - .watch(desktopSelectedAddressId.state) - .state!, + addressId: + ref + .watch(desktopSelectedAddressId.state) + .state!, ), ), ), 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 a0a183afee..67a3155821 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 @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/isar_models.dart'; import '../../../pages/receive_view/addresses/address_card.dart'; @@ -87,24 +87,25 @@ class _DesktopAddressListState extends ConsumerState { .findAllSync(); } - final labels = ref - .read(mainDBProvider) - .getAddressLabels(widget.walletId) - .filter() - .group( - (q) => q - .valueContains(term, caseSensitive: false) - .or() - .addressStringContains(term, caseSensitive: false) - .or() - .group( - (q) => q - .tagsIsNotNull() - .and() - .tagsElementContains(term, caseSensitive: false), - ), - ) - .findAllSync(); + final labels = + ref + .read(mainDBProvider) + .getAddressLabels(widget.walletId) + .filter() + .group( + (q) => q + .valueContains(term, caseSensitive: false) + .or() + .addressStringContains(term, caseSensitive: false) + .or() + .group( + (q) => q.tagsIsNotNull().and().tagsElementContains( + term, + caseSensitive: false, + ), + ), + ) + .findAllSync(); if (labels.isEmpty) { return []; @@ -188,14 +189,16 @@ class _DesktopAddressListState extends ConsumerState { _searchString = value; }); }, - style: isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, - height: 1.8, - ) - : STextStyles.field(context), + style: + isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: + Theme.of( + context, + ).extension()!.textFieldActiveText, + height: 1.8, + ) + : STextStyles.field(context), decoration: standardInputDecoration( "Search...", searchFieldFocusNode, @@ -213,58 +216,61 @@ class _DesktopAddressListState extends ConsumerState { height: isDesktop ? 20 : 16, ), ), - suffixIcon: _searchController.text.isNotEmpty - ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - _searchController.text = ""; - _searchString = ""; - }); - }, - ), - ], + suffixIcon: + _searchController.text.isNotEmpty + ? Padding( + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + _searchController.text = ""; + _searchString = ""; + }); + }, + ), + ], + ), ), - ), - ) - : null, + ) + : null, ), ), ), ), ), - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), Expanded( child: RoundedWhiteContainer( padding: EdgeInsets.zero, child: ListView.separated( shrinkWrap: true, itemCount: ids.length, - separatorBuilder: (_, __) => Container( - height: 1, - color: Theme.of(context) - .extension()! - .backgroundAppBar, - ), - itemBuilder: (_, index) => Padding( - padding: const EdgeInsets.all(4), - child: AddressCard( - key: Key("addressCardDesktop_key_${ids[index]}"), - walletId: widget.walletId, - addressId: ids[index], - coin: coin, - onPressed: () { - ref.read(desktopSelectedAddressId.state).state = ids[index]; - }, - ), - ), + separatorBuilder: + (_, __) => Container( + height: 1, + color: + Theme.of( + context, + ).extension()!.backgroundAppBar, + ), + itemBuilder: + (_, index) => Padding( + padding: const EdgeInsets.all(4), + child: AddressCard( + key: Key("addressCardDesktop_key_${ids[index]}"), + walletId: widget.walletId, + addressId: ids[index], + coin: coin, + onPressed: () { + ref.read(desktopSelectedAddressId.state).state = + ids[index]; + }, + ), + ), ), ), ), 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 a5e0ba9242..d0959351ae 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 @@ -13,7 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../db/isar/main_db.dart'; import '../../models/input.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 653da8a682..3489f6cf8b 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 @@ -13,7 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../db/isar/main_db.dart'; import '../../models/isar/models/blockchain_data/utxo.dart'; @@ -39,10 +39,7 @@ import 'freeze_button.dart'; import 'utxo_row.dart'; class DesktopCoinControlView extends ConsumerStatefulWidget { - const DesktopCoinControlView({ - super.key, - required this.walletId, - }); + const DesktopCoinControlView({super.key, required this.walletId}); static const String routeName = "/desktopCoinControl"; @@ -114,28 +111,26 @@ class _DesktopCoinControlViewState child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - const SizedBox( - width: 32, - ), + const SizedBox(width: 32), AppBarIconButton( size: 32, - color: Theme.of(context) - .extension()! - .textFieldDefaultBG, + color: + Theme.of( + context, + ).extension()!.textFieldDefaultBG, shadows: const [], icon: SvgPicture.asset( Assets.svg.arrowLeft, width: 18, height: 18, - color: Theme.of(context) - .extension()! - .topNavIconPrimary, + color: + Theme.of( + context, + ).extension()!.topNavIconPrimary, ), onPressed: Navigator.of(context).pop, ), - const SizedBox( - width: 18, - ), + const SizedBox(width: 18), SvgPicture.asset( Assets.svg.coinControl.gamePad, width: 32, @@ -143,13 +138,8 @@ class _DesktopCoinControlViewState color: Theme.of(context).extension()!.textSubtitle1, ), - const SizedBox( - width: 12, - ), - Text( - "Coin control", - style: STextStyles.desktopH3(context), - ), + const SizedBox(width: 12), + Text("Coin control", style: STextStyles.desktopH3(context)), ], ), ), @@ -177,11 +167,13 @@ class _DesktopCoinControlViewState _searchString = value; }); }, - style: - STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, + style: STextStyles.desktopTextExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ).extension()!.textFieldActiveText, height: 1.8, ), decoration: standardInputDecoration( @@ -201,33 +193,32 @@ class _DesktopCoinControlViewState height: 20, ), ), - suffixIcon: _searchController.text.isNotEmpty - ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - _searchController.text = ""; - _searchString = ""; - }); - }, - ), - ], + suffixIcon: + _searchController.text.isNotEmpty + ? Padding( + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + _searchController.text = ""; + _searchString = ""; + }); + }, + ), + ], + ), ), - ), - ) - : null, + ) + : null, ), ), ), ), - const SizedBox( - width: 24, - ), + const SizedBox(width: 24), AnimatedCrossFade( firstChild: JDropdownButton( redrawOnScreenSizeChanged: true, @@ -247,16 +238,13 @@ class _DesktopCoinControlViewState key: Key("${_selectedUTXOs.length}"), selectedUTXOs: _selectedUTXOs, ), - crossFadeState: _selectedUTXOs.isEmpty - ? CrossFadeState.showFirst - : CrossFadeState.showSecond, - duration: const Duration( - milliseconds: 200, - ), - ), - const SizedBox( - width: 24, + crossFadeState: + _selectedUTXOs.isEmpty + ? CrossFadeState.showFirst + : CrossFadeState.showSecond, + duration: const Duration(milliseconds: 200), ), + const SizedBox(width: 24), AnimatedCrossFade( firstChild: JDropdownButton( redrawOnScreenSizeChanged: true, @@ -278,155 +266,152 @@ class _DesktopCoinControlViewState label: "Clear selection (${_selectedUTXOs.length})", onPressed: () => setState(() => _selectedUTXOs.clear()), ), - crossFadeState: _selectedUTXOs.isEmpty - ? CrossFadeState.showFirst - : CrossFadeState.showSecond, - duration: const Duration( - milliseconds: 200, - ), + crossFadeState: + _selectedUTXOs.isEmpty + ? CrossFadeState.showFirst + : CrossFadeState.showSecond, + duration: const Duration(milliseconds: 200), ), ], ), ), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 24, - ), - child: _list != null - ? ListView.separated( - itemCount: _list!.length, - separatorBuilder: (context, _) => const SizedBox( - height: 10, - ), - itemBuilder: (context, index) { - final utxo = MainDB.instance.isar.utxos - .where() - .idEqualTo(_list![index]) - .findFirstSync()!; - final data = UtxoRowData(utxo.id, false); - data.selected = _selectedUTXOs.contains(data); + padding: const EdgeInsets.symmetric(horizontal: 24), + child: + _list != null + ? ListView.separated( + itemCount: _list!.length, + separatorBuilder: + (context, _) => const SizedBox(height: 10), + itemBuilder: (context, index) { + final utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(_list![index]) + .findFirstSync()!; + final data = UtxoRowData(utxo.id, false); + data.selected = _selectedUTXOs.contains(data); - return UtxoRow( - key: Key( - "${utxo.walletId}_${utxo.id}_${utxo.isBlocked}", - ), - data: data, - walletId: widget.walletId, - onSelectionChanged: (value) { - setState(() { - if (data.selected) { - _selectedUTXOs.add(value); + return UtxoRow( + key: Key( + "${utxo.walletId}_${utxo.id}_${utxo.isBlocked}", + ), + data: data, + walletId: widget.walletId, + onSelectionChanged: (value) { + setState(() { + if (data.selected) { + _selectedUTXOs.add(value); + } else { + _selectedUTXOs.remove(value); + } + }); + }, + ); + }, + ) + : ListView.separated( + itemCount: _map!.entries.length, + separatorBuilder: + (context, _) => const SizedBox(height: 10), + itemBuilder: (context, index) { + final entry = _map!.entries.elementAt(index); + final _controller = RotateIconController(); + + return Expandable2( + border: + Theme.of( + context, + ).extension()!.backgroundAppBar, + background: + Theme.of( + context, + ).extension()!.popupBG, + animationDurationMultiplier: + 0.2 * entry.value.length, + onExpandWillChange: (state) { + if (state == Expandable2State.expanded) { + _controller.forward?.call(); } else { - _selectedUTXOs.remove(value); + _controller.reverse?.call(); } - }); - }, - ); - }, - ) - : ListView.separated( - itemCount: _map!.entries.length, - separatorBuilder: (context, _) => const SizedBox( - height: 10, - ), - itemBuilder: (context, index) { - final entry = _map!.entries.elementAt(index); - final _controller = RotateIconController(); - - return Expandable2( - border: Theme.of(context) - .extension()! - .backgroundAppBar, - background: Theme.of(context) - .extension()! - .popupBG, - animationDurationMultiplier: 0.2 * entry.value.length, - onExpandWillChange: (state) { - if (state == Expandable2State.expanded) { - _controller.forward?.call(); - } else { - _controller.reverse?.call(); - } - }, - header: RoundedContainer( - padding: const EdgeInsets.all(20), - color: Colors.transparent, - child: Row( - children: [ - SvgPicture.file( - File( - ref.watch(coinIconProvider(coin)), + }, + header: RoundedContainer( + padding: const EdgeInsets.all(20), + color: Colors.transparent, + child: Row( + children: [ + SvgPicture.file( + File(ref.watch(coinIconProvider(coin))), + width: 24, + height: 24, ), - width: 24, - height: 24, - ), - const SizedBox( - width: 12, - ), - Expanded( - child: Text( - entry.key, - style: STextStyles.w600_14(context), + const SizedBox(width: 12), + Expanded( + child: Text( + entry.key, + style: STextStyles.w600_14(context), + ), ), - ), - Expanded( - child: Text( - "${entry.value.length} " - "output${entry.value.length > 1 ? "s" : ""}", - style: - STextStyles.desktopTextExtraExtraSmall( - context, + Expanded( + child: Text( + "${entry.value.length} " + "output${entry.value.length > 1 ? "s" : ""}", + style: + STextStyles.desktopTextExtraExtraSmall( + context, + ), ), ), - ), - RotateIcon( - animationDurationMultiplier: - 0.2 * entry.value.length, - icon: SvgPicture.asset( - Assets.svg.chevronDown, - width: 14, - color: Theme.of(context) - .extension()! - .textSubtitle1, + RotateIcon( + animationDurationMultiplier: + 0.2 * entry.value.length, + icon: SvgPicture.asset( + Assets.svg.chevronDown, + width: 14, + color: + Theme.of(context) + .extension()! + .textSubtitle1, + ), + curve: Curves.easeInOut, + controller: _controller, ), - curve: Curves.easeInOut, - controller: _controller, - ), - ], + ], + ), ), - ), - children: entry.value.map( - (id) { - final utxo = MainDB.instance.isar.utxos - .where() - .idEqualTo(id) - .findFirstSync()!; - final data = UtxoRowData(utxo.id, false); - data.selected = _selectedUTXOs.contains(data); + children: + entry.value.map((id) { + final utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(id) + .findFirstSync()!; + final data = UtxoRowData(utxo.id, false); + data.selected = _selectedUTXOs.contains(data); - return UtxoRow( - key: Key( - "${utxo.walletId}_${utxo.id}_${utxo.isBlocked}", - ), - data: data, - walletId: widget.walletId, - raiseOnSelected: false, - onSelectionChanged: (value) { - setState(() { - if (data.selected) { - _selectedUTXOs.add(value); - } else { - _selectedUTXOs.remove(value); - } - }); - }, - ); - }, - ).toList(), - ); - }, - ), + return UtxoRow( + key: Key( + "${utxo.walletId}_${utxo.id}_${utxo.isBlocked}", + ), + data: data, + walletId: widget.walletId, + raiseOnSelected: false, + onSelectionChanged: (value) { + setState(() { + if (data.selected) { + _selectedUTXOs.add(value); + } else { + _selectedUTXOs.remove(value); + } + }); + }, + ); + }).toList(), + ); + }, + ), ), ), ], diff --git a/lib/pages_desktop_specific/coin_control/freeze_button.dart b/lib/pages_desktop_specific/coin_control/freeze_button.dart index b012b01ada..d78df68980 100644 --- a/lib/pages_desktop_specific/coin_control/freeze_button.dart +++ b/lib/pages_desktop_specific/coin_control/freeze_button.dart @@ -10,7 +10,7 @@ import 'package:async/async.dart'; import 'package:flutter/material.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../db/isar/main_db.dart'; import '../../models/isar/models/blockchain_data/utxo.dart'; @@ -19,10 +19,7 @@ import '../../widgets/desktop/primary_button.dart'; import 'utxo_row.dart'; class FreezeButton extends StatefulWidget { - const FreezeButton({ - super.key, - required this.selectedUTXOs, - }); + const FreezeButton({super.key, required this.selectedUTXOs}); final Set selectedUTXOs; @@ -56,10 +53,11 @@ class _FreezeButtonState extends State { switch (_freezeLabelCache) { case "Freeze": for (final e in widget.selectedUTXOs) { - final utxo = MainDB.instance.isar.utxos - .where() - .idEqualTo(e.utxoId) - .findFirstSync()!; + final utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(e.utxoId) + .findFirstSync()!; if (!utxo.isBlocked) { utxosToUpdate.add(utxo.copyWith(isBlocked: true)); } @@ -68,10 +66,11 @@ class _FreezeButtonState extends State { case "Unfreeze": for (final e in widget.selectedUTXOs) { - final utxo = MainDB.instance.isar.utxos - .where() - .idEqualTo(e.utxoId) - .findFirstSync()!; + final utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(e.utxoId) + .findFirstSync()!; if (utxo.isBlocked) { utxosToUpdate.add(utxo.copyWith(isBlocked: false)); } diff --git a/lib/pages_desktop_specific/coin_control/utxo_row.dart b/lib/pages_desktop_specific/coin_control/utxo_row.dart index 548e2c05ee..e27d970fc5 100644 --- a/lib/pages_desktop_specific/coin_control/utxo_row.dart +++ b/lib/pages_desktop_specific/coin_control/utxo_row.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../db/isar/main_db.dart'; import '../../models/isar/models/isar_models.dart'; @@ -78,19 +78,19 @@ class _UtxoRowState extends ConsumerState { void _details() async { await showDialog( context: context, - builder: (context) => UtxoDetailsView( - utxoId: utxo.id, - walletId: widget.walletId, - ), + builder: + (context) => + UtxoDetailsView(utxoId: utxo.id, walletId: widget.walletId), ); } @override void initState() { - utxo = MainDB.instance.isar.utxos - .where() - .idEqualTo(widget.data.utxoId) - .findFirstSync()!; + utxo = + MainDB.instance.isar.utxos + .where() + .idEqualTo(widget.data.utxoId) + .findFirstSync()!; stream = MainDB.instance.watchUTXO(id: utxo.id); super.initState(); @@ -110,15 +110,21 @@ class _UtxoRowState extends ConsumerState { } return RoundedContainer( - borderColor: widget.compact && widget.compactWithBorder - ? Theme.of(context).extension()!.textFieldDefaultBG - : null, + borderColor: + widget.compact && widget.compactWithBorder + ? Theme.of( + context, + ).extension()!.textFieldDefaultBG + : null, color: Theme.of(context).extension()!.popupBG, - boxShadow: widget.data.selected && widget.raiseOnSelected - ? [ - Theme.of(context).extension()!.standardBoxShadow, - ] - : null, + boxShadow: + widget.data.selected && widget.raiseOnSelected + ? [ + Theme.of( + context, + ).extension()!.standardBoxShadow, + ] + : null, child: Row( children: [ if (!(widget.compact && utxo.isBlocked)) @@ -132,36 +138,37 @@ class _UtxoRowState extends ConsumerState { }, ), if (!(widget.compact && utxo.isBlocked)) - const SizedBox( - width: 10, - ), + const SizedBox(width: 10), UTXOStatusIcon( blocked: utxo.isBlocked, - status: (coin is Namecoin - ? (ref.watch(pWallets).getWallet(widget.walletId) - as NamecoinWallet) - .checkUtxoConfirmed( - utxo, - ref.watch(pWalletChainHeight(widget.walletId)), - ) - : utxo.isConfirmed( - ref.watch(pWalletChainHeight(widget.walletId)), - coin.minConfirms, - coin.minCoinbaseConfirms, - )) - ? UTXOStatusIconStatus.confirmed - : UTXOStatusIconStatus.unconfirmed, + status: + (coin is Namecoin + ? (ref.watch(pWallets).getWallet(widget.walletId) + as NamecoinWallet) + .checkUtxoConfirmed( + utxo, + ref.watch( + pWalletChainHeight(widget.walletId), + ), + ) + : utxo.isConfirmed( + ref.watch(pWalletChainHeight(widget.walletId)), + coin.minConfirms, + coin.minCoinbaseConfirms, + )) + ? UTXOStatusIconStatus.confirmed + : UTXOStatusIconStatus.unconfirmed, background: Theme.of(context).extension()!.popupBG, selected: false, width: 32, height: 32, ), - const SizedBox( - width: 10, - ), + const SizedBox(width: 10), if (!widget.compact) Text( - ref.watch(pAmountFormatter(coin)).format( + ref + .watch(pAmountFormatter(coin)) + .format( Amount( rawValue: BigInt.from(utxo.value), fractionDigits: coin.fractionDigits, @@ -170,10 +177,7 @@ class _UtxoRowState extends ConsumerState { textAlign: TextAlign.right, style: STextStyles.w600_14(context), ), - if (!widget.compact) - const SizedBox( - width: 10, - ), + if (!widget.compact) const SizedBox(width: 10), Expanded( child: ConditionalParent( condition: widget.compact, @@ -183,7 +187,9 @@ class _UtxoRowState extends ConsumerState { mainAxisSize: MainAxisSize.min, children: [ Text( - ref.watch(pAmountFormatter(coin)).format( + ref + .watch(pAmountFormatter(coin)) + .format( Amount( rawValue: BigInt.from(utxo.value), fractionDigits: coin.fractionDigits, @@ -192,9 +198,7 @@ class _UtxoRowState extends ConsumerState { textAlign: TextAlign.right, style: STextStyles.w600_14(context), ), - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), child, ], ); @@ -206,27 +210,23 @@ class _UtxoRowState extends ConsumerState { textAlign: widget.compact ? TextAlign.left : TextAlign.center, style: STextStyles.w500_12(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: + Theme.of( + context, + ).extension()!.textSubtitle1, ), ), ), ), - const SizedBox( - width: 10, - ), + const SizedBox(width: 10), widget.compact - ? CustomTextButton( - text: "Details", - onTap: _details, - ) + ? CustomTextButton(text: "Details", onTap: _details) : SecondaryButton( - width: 120, - buttonHeight: ButtonHeight.xs, - label: "Details", - onPressed: _details, - ), + width: 120, + buttonHeight: ButtonHeight.xs, + label: "Details", + onPressed: _details, + ), ], ), ); 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 d2a053d744..61d763bf26 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 @@ -15,7 +15,7 @@ import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../db/isar/main_db.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 d589e2118f..0821d2477d 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 @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../db/isar/main_db.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; @@ -40,30 +40,23 @@ class DesktopTradeHistory extends ConsumerStatefulWidget { class _DesktopTradeHistoryState extends ConsumerState { BorderRadius get _borderRadiusFirst { return BorderRadius.only( - topLeft: Radius.circular( - Constants.size.circularBorderRadius, - ), - topRight: Radius.circular( - Constants.size.circularBorderRadius, - ), + topLeft: Radius.circular(Constants.size.circularBorderRadius), + topRight: Radius.circular(Constants.size.circularBorderRadius), ); } BorderRadius get _borderRadiusLast { return BorderRadius.only( - bottomLeft: Radius.circular( - Constants.size.circularBorderRadius, - ), - bottomRight: Radius.circular( - Constants.size.circularBorderRadius, - ), + bottomLeft: Radius.circular(Constants.size.circularBorderRadius), + bottomRight: Radius.circular(Constants.size.circularBorderRadius), ); } @override Widget build(BuildContext context) { - final trades = - ref.watch(tradesServiceProvider.select((value) => value.trades)); + final trades = ref.watch( + tradesServiceProvider.select((value) => value.trades), + ); final tradeCount = trades.length; final hasHistory = tradeCount > 0; @@ -120,144 +113,150 @@ class _DesktopTradeHistoryState extends ConsumerState { //todo: check if print needed // debugPrint("name: ${manager.walletName}"); - final tx = await MainDB.instance - .getTransactions(walletIds.first) - .filter() - .txidEqualTo(txid) - .findFirst(); + final tx = + await MainDB.instance + .getTransactions(walletIds.first) + .filter() + .txidEqualTo(txid) + .findFirst(); if (mounted) { await showDialog( context: context, - builder: (context) => Navigator( - initialRoute: TradeDetailsView.routeName, - onGenerateRoute: RouteGenerator.generateRoute, - onGenerateInitialRoutes: (_, __) { - return [ - FadePageRoute( - DesktopDialog( - maxHeight: null, - maxWidth: 580, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 32, - bottom: 16, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Text( - "Trade details", - style: STextStyles.desktopH3( - context, - ), + builder: + (context) => Navigator( + initialRoute: TradeDetailsView.routeName, + onGenerateRoute: RouteGenerator.generateRoute, + onGenerateInitialRoutes: (_, __) { + return [ + FadePageRoute( + DesktopDialog( + maxHeight: null, + maxWidth: 580, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 32, + bottom: 16, ), - DesktopDialogCloseButton( - onPressedOverride: - Navigator.of( - context, - rootNavigator: true, - ).pop, + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text( + "Trade details", + style: + STextStyles.desktopH3( + context, + ), + ), + DesktopDialogCloseButton( + onPressedOverride: + Navigator.of( + context, + rootNavigator: true, + ).pop, + ), + ], ), - ], - ), - ), - Flexible( - child: SingleChildScrollView( - primary: false, - child: TradeDetailsView( - tradeId: tradeId, - transactionIfSentFromStack: tx, - walletName: ref.read( - pWalletName( - walletIds.first, + ), + Flexible( + child: SingleChildScrollView( + primary: false, + child: TradeDetailsView( + tradeId: tradeId, + transactionIfSentFromStack: + tx, + walletName: ref.read( + pWalletName( + walletIds.first, + ), + ), + walletId: walletIds.first, ), ), - walletId: walletIds.first, ), - ), + ], ), - ], + ), + const RouteSettings( + name: TradeDetailsView.routeName, + ), ), - ), - const RouteSettings( - name: TradeDetailsView.routeName, - ), - ), - ]; - }, - ), + ]; + }, + ), ); } } else { unawaited( showDialog( context: context, - builder: (context) => Navigator( - initialRoute: TradeDetailsView.routeName, - onGenerateRoute: RouteGenerator.generateRoute, - onGenerateInitialRoutes: (_, __) { - return [ - FadePageRoute( - DesktopDialog( - maxHeight: null, - maxWidth: 580, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 32, - bottom: 16, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Text( - "Trade details", - style: STextStyles.desktopH3( - context, - ), + builder: + (context) => Navigator( + initialRoute: TradeDetailsView.routeName, + onGenerateRoute: RouteGenerator.generateRoute, + onGenerateInitialRoutes: (_, __) { + return [ + FadePageRoute( + DesktopDialog( + maxHeight: null, + maxWidth: 580, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 32, + bottom: 16, ), - DesktopDialogCloseButton( - onPressedOverride: - Navigator.of( - context, - rootNavigator: true, - ).pop, + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text( + "Trade details", + style: + STextStyles.desktopH3( + context, + ), + ), + DesktopDialogCloseButton( + onPressedOverride: + Navigator.of( + context, + rootNavigator: true, + ).pop, + ), + ], + ), + ), + Flexible( + child: SingleChildScrollView( + primary: false, + child: TradeDetailsView( + tradeId: tradeId, + transactionIfSentFromStack: + null, + walletName: null, + walletId: walletIds?.first, + ), ), - ], - ), - ), - Flexible( - child: SingleChildScrollView( - primary: false, - child: TradeDetailsView( - tradeId: tradeId, - transactionIfSentFromStack: - null, - walletName: null, - walletId: walletIds?.first, ), - ), + ], ), - ], + ), + const RouteSettings( + name: TradeDetailsView.routeName, + ), ), - ), - const RouteSettings( - name: TradeDetailsView.routeName, - ), - ), - ]; - }, - ), + ]; + }, + ), ), ); } 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 96363f1e22..39e4ad6c9d 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 @@ -16,7 +16,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../db/sqlite/firo_cache.dart'; import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; 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 f926cce6e8..27d9f75eee 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 @@ -15,7 +15,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../../../models/isar/models/isar_models.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 1699262fb7..984784fe35 100644 --- a/lib/pages_desktop_specific/password/delete_password_warning_view.dart +++ b/lib/pages_desktop_specific/password/delete_password_warning_view.dart @@ -13,7 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../app_config.dart'; import '../../db/hive/db.dart'; @@ -30,10 +30,7 @@ import '../../widgets/desktop/primary_button.dart'; import '../../widgets/desktop/secondary_button.dart'; class DeletePasswordWarningView extends ConsumerStatefulWidget { - const DeletePasswordWarningView({ - super.key, - required this.shouldCreateNew, - }); + const DeletePasswordWarningView({super.key, required this.shouldCreateNew}); static const String routeName = "/deletePasswordWarning"; @@ -63,16 +60,18 @@ class _ForgotPasswordDesktopViewState await epicDir.delete(recursive: true); } - final mimblewimblecoinDir = - Directory("${appRoot.path}/mimblewimblecoin"); + final mimblewimblecoinDir = Directory( + "${appRoot.path}/mimblewimblecoin", + ); if (mimblewimblecoinDir.existsSync()) { await mimblewimblecoinDir.delete(recursive: true); } await Isar.getInstance("desktopStore")?.close(deleteFromDisk: true); - await (await StackFileSystem.applicationHiveDirectory()) - .delete(recursive: true); + await (await StackFileSystem.applicationHiveDirectory()).delete( + recursive: true, + ); } else if (Platform.isLinux) { await appRoot.delete(recursive: true); } else { @@ -85,21 +84,24 @@ class _ForgotPasswordDesktopViewState if (epicDir.existsSync()) { await epicDir.delete(recursive: true); } - final mimblewimblecoinDir = - Directory("${appRoot.path}/mimblewimblecoin"); + final mimblewimblecoinDir = Directory( + "${appRoot.path}/mimblewimblecoin", + ); if (mimblewimblecoinDir.existsSync()) { await mimblewimblecoinDir.delete(recursive: true); } - await (await StackFileSystem.applicationHiveDirectory()) - .delete(recursive: true); - await (await StackFileSystem.applicationIsarDirectory()) - .delete(recursive: true); + await (await StackFileSystem.applicationHiveDirectory()).delete( + recursive: true, + ); + await (await StackFileSystem.applicationIsarDirectory()).delete( + recursive: true, + ); } await DB.instance.init(); } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); return false; } @@ -128,19 +130,10 @@ class _ForgotPasswordDesktopViewState child: Column( mainAxisSize: MainAxisSize.min, children: [ - const AppIcon( - width: 100, - ), - const SizedBox( - height: 42, - ), - Text( - "Warning!", - style: STextStyles.desktopH1(context), - ), - const SizedBox( - height: 24, - ), + const AppIcon(width: 100), + const SizedBox(height: 42), + Text("Warning!", style: STextStyles.desktopH1(context)), + const SizedBox(height: 24), SizedBox( width: 480, child: RichText( @@ -152,9 +145,10 @@ class _ForgotPasswordDesktopViewState style: STextStyles.desktopTextSmall(context), ), TextSpan( - text: widget.shouldCreateNew - ? "create a new ${AppConfig.prefix}" - : "restore from backup", + text: + widget.shouldCreateNew + ? "create a new ${AppConfig.prefix}" + : "restore from backup", style: STextStyles.desktopTextSmallBold(context), ), TextSpan( @@ -174,9 +168,7 @@ class _ForgotPasswordDesktopViewState ), ), ), - const SizedBox( - height: 48, - ), + const SizedBox(height: 48), PrimaryButton( label: "Delete and continue", enabled: !_deleteInProgress, @@ -223,9 +215,7 @@ class _ForgotPasswordDesktopViewState } }, ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), SecondaryButton( label: "Take me back!", enabled: !_deleteInProgress, @@ -233,9 +223,7 @@ class _ForgotPasswordDesktopViewState Navigator.of(context).pop(); }, ), - const SizedBox( - height: kDesktopAppBarHeight, - ), + const SizedBox(height: kDesktopAppBarHeight), ], ), ), diff --git a/lib/providers/wallet/transaction_note_provider.dart b/lib/providers/wallet/transaction_note_provider.dart index 050dfe841a..9069c69748 100644 --- a/lib/providers/wallet/transaction_note_provider.dart +++ b/lib/providers/wallet/transaction_note_provider.dart @@ -12,7 +12,8 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; + import '../../models/isar/models/transaction_note.dart'; import '../db/main_db_provider.dart'; @@ -30,13 +31,13 @@ class _TransactionNoteWatcher extends ChangeNotifier { .txidWalletIdEqualTo(key.txid, key.walletId) .watch(fireImmediately: true) .listen((event) { - if (event.isEmpty) { - _value = null; - } else { - _value = event.first; - } - notifyListeners(); - }); + if (event.isEmpty) { + _value = null; + } else { + _value = event.first; + } + notifyListeners(); + }); } @override @@ -46,29 +47,30 @@ class _TransactionNoteWatcher extends ChangeNotifier { } } -final _wiProvider = ChangeNotifierProvider.family<_TransactionNoteWatcher, - ({String walletId, String txid})>( - (ref, key) { - final isar = ref.watch(mainDBProvider).isar; +final _wiProvider = ChangeNotifierProvider.family< + _TransactionNoteWatcher, + ({String walletId, String txid}) +>((ref, key) { + final isar = ref.watch(mainDBProvider).isar; - final watcher = _TransactionNoteWatcher( - isar.transactionNotes - .where() - .txidWalletIdEqualTo(key.txid, key.walletId) - .findFirstSync(), - key, - isar, - ); + final watcher = _TransactionNoteWatcher( + isar.transactionNotes + .where() + .txidWalletIdEqualTo(key.txid, key.walletId) + .findFirstSync(), + key, + isar, + ); - ref.onDispose(() => watcher.dispose()); + ref.onDispose(() => watcher.dispose()); - return watcher; - }, -); + return watcher; +}); final pTransactionNote = - Provider.family( - (ref, key) { - return ref.watch(_wiProvider(key).select((value) => value.value)); - }, -); + Provider.family(( + ref, + key, + ) { + return ref.watch(_wiProvider(key).select((value) => value.value)); + }); diff --git a/lib/route_generator.dart b/lib/route_generator.dart index 064e54df9a..79c7ec4f5a 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -10,7 +10,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import 'db/drift/database.dart'; diff --git a/lib/services/ethereum/cached_eth_token_balance.dart b/lib/services/ethereum/cached_eth_token_balance.dart index ce6efe1b49..f21a0ee73d 100644 --- a/lib/services/ethereum/cached_eth_token_balance.dart +++ b/lib/services/ethereum/cached_eth_token_balance.dart @@ -8,7 +8,7 @@ * */ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../db/isar/main_db.dart'; import '../../models/balance.dart'; @@ -33,10 +33,11 @@ class CachedEthTokenBalance { contractAddress: token.address, ); - final info = await mainDB.isar.tokenWalletInfo - .where() - .walletIdTokenAddressEqualTo(walletId, token.address) - .findFirst(); + final info = + await mainDB.isar.tokenWalletInfo + .where() + .walletIdTokenAddressEqualTo(walletId, token.address) + .findFirst(); if (response.value != null && info != null) { await info.updateCachedBalance( diff --git a/lib/services/exchange/exchange_data_loading_service.dart b/lib/services/exchange/exchange_data_loading_service.dart index 35a1677951..1bf16504d3 100644 --- a/lib/services/exchange/exchange_data_loading_service.dart +++ b/lib/services/exchange/exchange_data_loading_service.dart @@ -11,7 +11,7 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; import '../../app_config.dart'; diff --git a/lib/services/price_service.dart b/lib/services/price_service.dart index 43eb68e320..51fa4fab43 100644 --- a/lib/services/price_service.dart +++ b/lib/services/price_service.dart @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:decimal/decimal.dart'; import 'package:flutter/foundation.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../db/isar/main_db.dart'; import '../models/isar/models/isar_models.dart'; diff --git a/lib/services/wallets.dart b/lib/services/wallets.dart index 0f478d6ddc..ffdfbdc0ae 100644 --- a/lib/services/wallets.dart +++ b/lib/services/wallets.dart @@ -12,7 +12,7 @@ import 'dart:async'; import 'dart:io'; import 'package:compat/compat.dart' as lib_monero_compat; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../app_config.dart'; import '../db/hive/db.dart'; diff --git a/lib/themes/theme_service.dart b/lib/themes/theme_service.dart index 3479f7ecfe..47d25a0227 100644 --- a/lib/themes/theme_service.dart +++ b/lib/themes/theme_service.dart @@ -15,7 +15,7 @@ import 'package:archive/archive_io.dart'; import 'package:crypto/crypto.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../app_config.dart'; import '../db/isar/main_db.dart'; diff --git a/lib/utilities/flutter_secure_storage_interface.dart b/lib/utilities/flutter_secure_storage_interface.dart index 1c81119ab0..10f5055a18 100644 --- a/lib/utilities/flutter_secure_storage_interface.dart +++ b/lib/utilities/flutter_secure_storage_interface.dart @@ -9,7 +9,7 @@ */ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:stack_wallet_backup/secure_storage.dart'; import '../models/isar/models/encrypted_string_value.dart'; @@ -81,9 +81,7 @@ class DesktopSecureStore { await isar.close(); } - Future read({ - required String key, - }) async { + Future read({required String key}) async { final value = await isar.encryptedStringValues.filter().keyEqualTo(key).findFirst(); @@ -95,10 +93,7 @@ class DesktopSecureStore { return await handler.decryptValue(key, value.value); } - Future write({ - required String key, - required String? value, - }) async { + Future write({required String key, required String? value}) async { if (value == null) { // here we assume that a value is to be deleted await isar.writeTxn(() async { @@ -117,9 +112,7 @@ class DesktopSecureStore { } } - Future delete({ - required String key, - }) async { + Future delete({required String key}) async { await isar.writeTxn(() async { await isar.encryptedStringValues.deleteByKey(key); }); @@ -138,16 +131,12 @@ class SecureStorageWrapper implements SecureStorageInterface { @override dynamic get store => _store; - const SecureStorageWrapper({ - required dynamic store, - required bool isDesktop, - }) : assert( - isDesktop - ? store is DesktopSecureStore - : store is FlutterSecureStorage, - ), - _store = store, - _isDesktop = isDesktop; + const SecureStorageWrapper({required dynamic store, required bool isDesktop}) + : assert( + isDesktop ? store is DesktopSecureStore : store is FlutterSecureStorage, + ), + _store = store, + _isDesktop = isDesktop; @override Future read({ diff --git a/lib/utilities/wallet_tools.dart b/lib/utilities/wallet_tools.dart index b385783709..6b122334a4 100644 --- a/lib/utilities/wallet_tools.dart +++ b/lib/utilities/wallet_tools.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../db/isar/main_db.dart'; import '../models/isar/models/blockchain_data/v2/transaction_v2.dart'; diff --git a/lib/wallets/isar/isar_id_interface.dart b/lib/wallets/isar/isar_id_interface.dart index c984552840..437139747f 100644 --- a/lib/wallets/isar/isar_id_interface.dart +++ b/lib/wallets/isar/isar_id_interface.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; abstract interface class IsarId { Id get id; diff --git a/lib/wallets/isar/models/frost_wallet_info.dart b/lib/wallets/isar/models/frost_wallet_info.dart index fd3d1a11ae..92d35fed17 100644 --- a/lib/wallets/isar/models/frost_wallet_info.dart +++ b/lib/wallets/isar/models/frost_wallet_info.dart @@ -1,4 +1,5 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; + import '../isar_id_interface.dart'; part 'frost_wallet_info.g.dart'; diff --git a/lib/wallets/isar/models/spark_coin.dart b/lib/wallets/isar/models/spark_coin.dart index c16cee2536..b770361c7a 100644 --- a/lib/wallets/isar/models/spark_coin.dart +++ b/lib/wallets/isar/models/spark_coin.dart @@ -1,6 +1,6 @@ import 'dart:math'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; part 'spark_coin.g.dart'; diff --git a/lib/wallets/isar/models/token_wallet_info.dart b/lib/wallets/isar/models/token_wallet_info.dart index f14491b329..842d04bf0d 100644 --- a/lib/wallets/isar/models/token_wallet_info.dart +++ b/lib/wallets/isar/models/token_wallet_info.dart @@ -1,4 +1,5 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; + import '../../../models/balance.dart'; import '../../../models/isar/models/isar_models.dart'; import '../../../utilities/amount/amount.dart'; @@ -14,9 +15,7 @@ class TokenWalletInfo implements IsarId { @Index( unique: true, replace: false, - composite: [ - CompositeIndex("tokenAddress"), - ], + composite: [CompositeIndex("tokenAddress")], ) final String walletId; @@ -40,24 +39,13 @@ class TokenWalletInfo implements IsarId { Balance getCachedBalance() { if (cachedBalanceJsonString == null) { return Balance( - total: Amount.zeroWith( - fractionDigits: tokenFractionDigits, - ), - spendable: Amount.zeroWith( - fractionDigits: tokenFractionDigits, - ), - blockedTotal: Amount.zeroWith( - fractionDigits: tokenFractionDigits, - ), - pendingSpendable: Amount.zeroWith( - fractionDigits: tokenFractionDigits, - ), + total: Amount.zeroWith(fractionDigits: tokenFractionDigits), + spendable: Amount.zeroWith(fractionDigits: tokenFractionDigits), + blockedTotal: Amount.zeroWith(fractionDigits: tokenFractionDigits), + pendingSpendable: Amount.zeroWith(fractionDigits: tokenFractionDigits), ); } - return Balance.fromJson( - cachedBalanceJsonString!, - tokenFractionDigits, - ); + return Balance.fromJson(cachedBalanceJsonString!, tokenFractionDigits); } Future updateCachedBalance( @@ -65,19 +53,18 @@ class TokenWalletInfo implements IsarId { required Isar isar, }) async { // // ensure we are updating using the latest entry of this in the db - final thisEntry = await isar.tokenWalletInfo - .where() - .walletIdTokenAddressEqualTo(walletId, tokenAddress) - .findFirst(); + final thisEntry = + await isar.tokenWalletInfo + .where() + .walletIdTokenAddressEqualTo(walletId, tokenAddress) + .findFirst(); if (thisEntry == null) { throw Exception( "Attempted to update cached token balance before object was saved in db", ); } else { await isar.writeTxn(() async { - await isar.tokenWalletInfo.delete( - thisEntry.id, - ); + await isar.tokenWalletInfo.delete(thisEntry.id); await isar.tokenWalletInfo.put( TokenWalletInfo( walletId: walletId, diff --git a/lib/wallets/isar/models/wallet_info.dart b/lib/wallets/isar/models/wallet_info.dart index 6b1a54919a..5b2d6569c8 100644 --- a/lib/wallets/isar/models/wallet_info.dart +++ b/lib/wallets/isar/models/wallet_info.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:uuid/uuid.dart'; import '../../../app_config.dart'; diff --git a/lib/wallets/isar/models/wallet_info_meta.dart b/lib/wallets/isar/models/wallet_info_meta.dart index ce0820a1a1..fa3766377a 100644 --- a/lib/wallets/isar/models/wallet_info_meta.dart +++ b/lib/wallets/isar/models/wallet_info_meta.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../isar_id_interface.dart'; @@ -16,8 +16,5 @@ class WalletInfoMeta implements IsarId { /// and should not be displayed in the ui. final bool isMnemonicVerified; - WalletInfoMeta({ - required this.walletId, - required this.isMnemonicVerified, - }); + WalletInfoMeta({required this.walletId, required this.isMnemonicVerified}); } diff --git a/lib/wallets/isar/providers/all_wallets_info_provider.dart b/lib/wallets/isar/providers/all_wallets_info_provider.dart index 2bdb932ca1..bfa407611a 100644 --- a/lib/wallets/isar/providers/all_wallets_info_provider.dart +++ b/lib/wallets/isar/providers/all_wallets_info_provider.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../app_config.dart'; import '../../../providers/db/main_db_provider.dart'; diff --git a/lib/wallets/isar/providers/eth/token_balance_provider.dart b/lib/wallets/isar/providers/eth/token_balance_provider.dart index 9a4f054a94..eb6a2a8e48 100644 --- a/lib/wallets/isar/providers/eth/token_balance_provider.dart +++ b/lib/wallets/isar/providers/eth/token_balance_provider.dart @@ -1,5 +1,5 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../../models/balance.dart'; import '../../../../models/isar/models/isar_models.dart'; @@ -7,57 +7,55 @@ import '../../../../providers/db/main_db_provider.dart'; import '../../models/token_wallet_info.dart'; import '../util/watcher.dart'; -final _twiProvider = ChangeNotifierProvider.family( - (ref, data) { - final isar = ref.watch(mainDBProvider).isar; - - final collection = isar.tokenWalletInfo; - - TokenWalletInfo? initial = collection - .where() - .walletIdTokenAddressEqualTo(data.walletId, data.contractAddress) - .findFirstSync(); - - if (initial == null) { - initial = TokenWalletInfo( - walletId: data.walletId, - tokenAddress: data.contractAddress, - tokenFractionDigits: isar.ethContracts - .getByAddressSync(data.contractAddress) - ?.decimals ?? - 2, - ); +final _twiProvider = ChangeNotifierProvider.family< + Watcher, + ({String walletId, String contractAddress}) +>((ref, data) { + final isar = ref.watch(mainDBProvider).isar; + + final collection = isar.tokenWalletInfo; + + TokenWalletInfo? initial = + collection + .where() + .walletIdTokenAddressEqualTo(data.walletId, data.contractAddress) + .findFirstSync(); + + if (initial == null) { + initial = TokenWalletInfo( + walletId: data.walletId, + tokenAddress: data.contractAddress, + tokenFractionDigits: + isar.ethContracts.getByAddressSync(data.contractAddress)?.decimals ?? + 2, + ); - isar.writeTxnSync(() => isar.tokenWalletInfo.putSync(initial!)); - } + isar.writeTxnSync(() => isar.tokenWalletInfo.putSync(initial!)); + } - final watcher = Watcher( - initial, - collection: collection, - ); + final watcher = Watcher(initial, collection: collection); - ref.onDispose(() => watcher.dispose()); + ref.onDispose(() => watcher.dispose()); - return watcher; - }, -); + return watcher; +}); -final pTokenWalletInfo = Provider.family( - (ref, data) { - return ref.watch(_twiProvider(data).select((value) => value.value)) - as TokenWalletInfo; - }, -); +final pTokenWalletInfo = Provider.family< + TokenWalletInfo, + ({String walletId, String contractAddress}) +>((ref, data) { + return ref.watch(_twiProvider(data).select((value) => value.value)) + as TokenWalletInfo; +}); final pTokenBalance = - Provider.family( - (ref, data) { - return ref.watch( - _twiProvider(data).select( - (value) => (value.value as TokenWalletInfo).getCachedBalance(), - ), - ); - }, -); + Provider.family(( + ref, + data, + ) { + return ref.watch( + _twiProvider(data).select( + (value) => (value.value as TokenWalletInfo).getCachedBalance(), + ), + ); + }); diff --git a/lib/wallets/isar/providers/favourite_wallets_provider.dart b/lib/wallets/isar/providers/favourite_wallets_provider.dart index 8a0b2c0ef2..78816a9185 100644 --- a/lib/wallets/isar/providers/favourite_wallets_provider.dart +++ b/lib/wallets/isar/providers/favourite_wallets_provider.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../app_config.dart'; import '../../../providers/db/main_db_provider.dart'; diff --git a/lib/wallets/isar/providers/util/watcher.dart b/lib/wallets/isar/providers/util/watcher.dart index 0208baca0d..43376a043e 100644 --- a/lib/wallets/isar/providers/util/watcher.dart +++ b/lib/wallets/isar/providers/util/watcher.dart @@ -1,7 +1,8 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; + import '../../isar_id_interface.dart'; class Watcher extends ChangeNotifier { @@ -11,10 +12,7 @@ class Watcher extends ChangeNotifier { T get value => _value; - Watcher( - this._value, { - required IsarCollection collection, - }) { + Watcher(this._value, {required IsarCollection collection}) { _streamSubscription = collection.watchObject(_value.id).listen((event) { if (event != null) { _value = event; diff --git a/lib/wallets/isar/providers/wallet_info_provider.dart b/lib/wallets/isar/providers/wallet_info_provider.dart index b4247dc6f7..d6469879e2 100644 --- a/lib/wallets/isar/providers/wallet_info_provider.dart +++ b/lib/wallets/isar/providers/wallet_info_provider.dart @@ -1,5 +1,5 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/balance.dart'; import '../../../providers/db/main_db_provider.dart'; @@ -7,105 +7,102 @@ import '../../crypto_currency/crypto_currency.dart'; import '../models/wallet_info.dart'; import 'util/watcher.dart'; -final _wiProvider = ChangeNotifierProvider.family( - (ref, walletId) { - final collection = ref.watch(mainDBProvider).isar.walletInfo; +final _wiProvider = ChangeNotifierProvider.family(( + ref, + walletId, +) { + final collection = ref.watch(mainDBProvider).isar.walletInfo; - final watcher = Watcher( - collection.where().walletIdEqualTo(walletId).findFirstSync()!, - collection: collection, - ); + final watcher = Watcher( + collection.where().walletIdEqualTo(walletId).findFirstSync()!, + collection: collection, + ); - ref.onDispose(() => watcher.dispose()); + ref.onDispose(() => watcher.dispose()); - return watcher; - }, -); + return watcher; +}); -final pWalletInfo = Provider.family( - (ref, walletId) { - return ref.watch(_wiProvider(walletId)).value as WalletInfo; - }, -); +final pWalletInfo = Provider.family((ref, walletId) { + return ref.watch(_wiProvider(walletId)).value as WalletInfo; +}); -final pWalletCoin = Provider.family( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId).select((value) => (value.value as WalletInfo).coin), - ); - }, -); +final pWalletCoin = Provider.family((ref, walletId) { + return ref.watch( + _wiProvider(walletId).select((value) => (value.value as WalletInfo).coin), + ); +}); -final pWalletBalance = Provider.family( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId) - .select((value) => (value.value as WalletInfo).cachedBalance), - ); - }, -); +final pWalletBalance = Provider.family((ref, walletId) { + return ref.watch( + _wiProvider( + walletId, + ).select((value) => (value.value as WalletInfo).cachedBalance), + ); +}); -final pWalletBalanceSecondary = Provider.family( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId).select( - (value) => (value.value as WalletInfo).cachedBalanceSecondary, - ), - ); - }, -); +final pWalletBalanceSecondary = Provider.family(( + ref, + walletId, +) { + return ref.watch( + _wiProvider( + walletId, + ).select((value) => (value.value as WalletInfo).cachedBalanceSecondary), + ); +}); -final pWalletBalanceTertiary = Provider.family( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId) - .select((value) => (value.value as WalletInfo).cachedBalanceTertiary), - ); - }, -); +final pWalletBalanceTertiary = Provider.family(( + ref, + walletId, +) { + return ref.watch( + _wiProvider( + walletId, + ).select((value) => (value.value as WalletInfo).cachedBalanceTertiary), + ); +}); -final pWalletChainHeight = Provider.family( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId) - .select((value) => (value.value as WalletInfo).cachedChainHeight), - ); - }, -); +final pWalletChainHeight = Provider.family((ref, walletId) { + return ref.watch( + _wiProvider( + walletId, + ).select((value) => (value.value as WalletInfo).cachedChainHeight), + ); +}); -final pWalletIsFavourite = Provider.family( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId) - .select((value) => (value.value as WalletInfo).isFavourite), - ); - }, -); +final pWalletIsFavourite = Provider.family((ref, walletId) { + return ref.watch( + _wiProvider( + walletId, + ).select((value) => (value.value as WalletInfo).isFavourite), + ); +}); -final pWalletName = Provider.family( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId).select((value) => (value.value as WalletInfo).name), - ); - }, -); +final pWalletName = Provider.family((ref, walletId) { + return ref.watch( + _wiProvider(walletId).select((value) => (value.value as WalletInfo).name), + ); +}); -final pWalletReceivingAddress = Provider.family( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId).select( - (value) => (value.value as WalletInfo).cachedReceivingAddress, - ), - ); - }, -); +final pWalletReceivingAddress = Provider.family(( + ref, + walletId, +) { + return ref.watch( + _wiProvider( + walletId, + ).select((value) => (value.value as WalletInfo).cachedReceivingAddress), + ); +}); -final pWalletTokenAddresses = Provider.family, String>( - (ref, walletId) { - return ref.watch( - _wiProvider(walletId).select( - (value) => (value.value as WalletInfo).tokenContractAddresses, - ), - ); - }, -); +final pWalletTokenAddresses = Provider.family, String>(( + ref, + walletId, +) { + return ref.watch( + _wiProvider( + walletId, + ).select((value) => (value.value as WalletInfo).tokenContractAddresses), + ); +}); diff --git a/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart b/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart index 95f015c013..dc0561429f 100644 --- a/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart +++ b/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart @@ -6,7 +6,7 @@ import 'package:flutter/foundation.dart'; import 'package:frostdart/frostdart.dart' as frost; import 'package:frostdart/frostdart_bindings_generated.dart'; import 'package:frostdart/util.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../electrumx_rpc/cached_electrumx_client.dart'; import '../../../electrumx_rpc/electrumx_client.dart'; diff --git a/lib/wallets/wallet/impl/bitcoin_wallet.dart b/lib/wallets/wallet/impl/bitcoin_wallet.dart index 2ce942673a..6361ec135d 100644 --- a/lib/wallets/wallet/impl/bitcoin_wallet.dart +++ b/lib/wallets/wallet/impl/bitcoin_wallet.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../utilities/amount/amount.dart'; @@ -37,24 +37,29 @@ class BitcoinWallet extends Bip39HDWallet @override Future> fetchAddressesForElectrumXScan() async { - final allAddresses = await mainDB - .getAddresses(walletId) - .filter() - .not() - .group( - (q) => q - .typeEqualTo(AddressType.nonWallet) - .or() - .subTypeEqualTo(AddressSubType.nonWallet), - ) - .findAll(); + final allAddresses = + await mainDB + .getAddresses(walletId) + .filter() + .not() + .group( + (q) => q + .typeEqualTo(AddressType.nonWallet) + .or() + .subTypeEqualTo(AddressSubType.nonWallet), + ) + .findAll(); return allAddresses; } // =========================================================================== @override - Amount roughFeeEstimate(int inputCount, int outputCount, BigInt feeRatePerKB) { + Amount roughFeeEstimate( + int inputCount, + int outputCount, + BigInt feeRatePerKB, + ) { return Amount( rawValue: BigInt.from( ((42 + (272 * inputCount) + (128 * outputCount)) / 4).ceil() * @@ -68,6 +73,7 @@ class BitcoinWallet extends Bip39HDWallet int estimateTxFee({required int vSize, required BigInt feeRatePerKB}) { return vSize * (feeRatePerKB.toInt() / 1000).ceil(); } + // // @override // Future coinSelection({required TxData txData}) async { diff --git a/lib/wallets/wallet/impl/bitcoincash_wallet.dart b/lib/wallets/wallet/impl/bitcoincash_wallet.dart index cee6902197..5edcbf9f75 100644 --- a/lib/wallets/wallet/impl/bitcoincash_wallet.dart +++ b/lib/wallets/wallet/impl/bitcoincash_wallet.dart @@ -1,5 +1,5 @@ import 'package:bitbox/bitbox.dart' as bitbox; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; diff --git a/lib/wallets/wallet/impl/cardano_wallet.dart b/lib/wallets/wallet/impl/cardano_wallet.dart index 5ae2d14a6c..93430b77bf 100644 --- a/lib/wallets/wallet/impl/cardano_wallet.dart +++ b/lib/wallets/wallet/impl/cardano_wallet.dart @@ -6,7 +6,7 @@ import 'package:blockchain_utils/bip/cardano/cip1852/cip1852.dart'; import 'package:blockchain_utils/bip/cardano/cip1852/conf/cip1852_coins.dart'; import 'package:blockchain_utils/bip/cardano/mnemonic/cardano_icarus_seed_generator.dart'; import 'package:blockchain_utils/bip/cardano/shelley/cardano_shelley.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:on_chain/ada/ada.dart'; import 'package:socks5_proxy/socks.dart'; import 'package:tuple/tuple.dart'; diff --git a/lib/wallets/wallet/impl/dash_wallet.dart b/lib/wallets/wallet/impl/dash_wallet.dart index f9a90d5b89..9d39bd26f7 100644 --- a/lib/wallets/wallet/impl/dash_wallet.dart +++ b/lib/wallets/wallet/impl/dash_wallet.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; diff --git a/lib/wallets/wallet/impl/dogecoin_wallet.dart b/lib/wallets/wallet/impl/dogecoin_wallet.dart index da24c5a9de..01a1eed402 100644 --- a/lib/wallets/wallet/impl/dogecoin_wallet.dart +++ b/lib/wallets/wallet/impl/dogecoin_wallet.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; diff --git a/lib/wallets/wallet/impl/ecash_wallet.dart b/lib/wallets/wallet/impl/ecash_wallet.dart index aacdc4f316..4a72b2b945 100644 --- a/lib/wallets/wallet/impl/ecash_wallet.dart +++ b/lib/wallets/wallet/impl/ecash_wallet.dart @@ -1,5 +1,5 @@ import 'package:bitbox/bitbox.dart' as bitbox; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; diff --git a/lib/wallets/wallet/impl/epiccash_wallet.dart b/lib/wallets/wallet/impl/epiccash_wallet.dart index ea6654b127..6f961e2983 100644 --- a/lib/wallets/wallet/impl/epiccash_wallet.dart +++ b/lib/wallets/wallet/impl/epiccash_wallet.dart @@ -5,7 +5,7 @@ import 'dart:io'; import 'package:decimal/decimal.dart'; import 'package:flutter_libepiccash/lib.dart' as epiccash; import 'package:flutter_libepiccash/models/transaction.dart' as epic_models; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; import 'package:web_socket_channel/web_socket_channel.dart'; diff --git a/lib/wallets/wallet/impl/ethereum_wallet.dart b/lib/wallets/wallet/impl/ethereum_wallet.dart index efb19bcbc9..743d380e16 100644 --- a/lib/wallets/wallet/impl/ethereum_wallet.dart +++ b/lib/wallets/wallet/impl/ethereum_wallet.dart @@ -4,7 +4,7 @@ import 'dart:convert'; import 'package:decimal/decimal.dart'; import 'package:ethereum_addresses/ethereum_addresses.dart'; import 'package:http/http.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:web3dart/json_rpc.dart' show RPCError; import 'package:web3dart/web3dart.dart' as web3; diff --git a/lib/wallets/wallet/impl/fact0rn_wallet.dart b/lib/wallets/wallet/impl/fact0rn_wallet.dart index 14a9d4be87..0f6a93d0d9 100644 --- a/lib/wallets/wallet/impl/fact0rn_wallet.dart +++ b/lib/wallets/wallet/impl/fact0rn_wallet.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; diff --git a/lib/wallets/wallet/impl/firo_wallet.dart b/lib/wallets/wallet/impl/firo_wallet.dart index 0bb1b1fedb..e55052e903 100644 --- a/lib/wallets/wallet/impl/firo_wallet.dart +++ b/lib/wallets/wallet/impl/firo_wallet.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'dart:math'; import 'package:decimal/decimal.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../db/sqlite/firo_cache.dart'; import '../../../models/isar/models/blockchain_data/v2/input_v2.dart'; diff --git a/lib/wallets/wallet/impl/litecoin_wallet.dart b/lib/wallets/wallet/impl/litecoin_wallet.dart index 740710d1dd..db497a9040 100644 --- a/lib/wallets/wallet/impl/litecoin_wallet.dart +++ b/lib/wallets/wallet/impl/litecoin_wallet.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../db/drift/database.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 567908275e..8eec728dbe 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -7,7 +7,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; import 'package:flutter_libmwc/models/transaction.dart' as mimblewimblecoin_models; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; diff --git a/lib/wallets/wallet/impl/namecoin_wallet.dart b/lib/wallets/wallet/impl/namecoin_wallet.dart index abf598c6fe..a6dd6f74b7 100644 --- a/lib/wallets/wallet/impl/namecoin_wallet.dart +++ b/lib/wallets/wallet/impl/namecoin_wallet.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:coinlib_flutter/coinlib_flutter.dart' as coinlib; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:namecoin/namecoin.dart'; import '../../../models/input.dart'; diff --git a/lib/wallets/wallet/impl/particl_wallet.dart b/lib/wallets/wallet/impl/particl_wallet.dart index 4725110afe..eb9fb60437 100644 --- a/lib/wallets/wallet/impl/particl_wallet.dart +++ b/lib/wallets/wallet/impl/particl_wallet.dart @@ -1,7 +1,7 @@ import 'dart:typed_data'; import 'package:bitcoindart/bitcoindart.dart' as bitcoindart; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/input.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; diff --git a/lib/wallets/wallet/impl/peercoin_wallet.dart b/lib/wallets/wallet/impl/peercoin_wallet.dart index 09c69e2cc3..8046f0d23c 100644 --- a/lib/wallets/wallet/impl/peercoin_wallet.dart +++ b/lib/wallets/wallet/impl/peercoin_wallet.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; @@ -37,24 +37,29 @@ class PeercoinWallet @override Future> fetchAddressesForElectrumXScan() async { - final allAddresses = await mainDB - .getAddresses(walletId) - .filter() - .not() - .group( - (q) => q - .typeEqualTo(AddressType.nonWallet) - .or() - .subTypeEqualTo(AddressSubType.nonWallet), - ) - .findAll(); + final allAddresses = + await mainDB + .getAddresses(walletId) + .filter() + .not() + .group( + (q) => q + .typeEqualTo(AddressType.nonWallet) + .or() + .subTypeEqualTo(AddressSubType.nonWallet), + ) + .findAll(); return allAddresses; } // =========================================================================== @override - Amount roughFeeEstimate(int inputCount, int outputCount, BigInt feeRatePerKB) { + Amount roughFeeEstimate( + int inputCount, + int outputCount, + BigInt feeRatePerKB, + ) { // TODO: actually do this properly for peercoin // this is probably wrong for peercoin return Amount( @@ -75,12 +80,8 @@ class PeercoinWallet // =========================================================================== @override - Future< - ({ - bool blocked, - String? blockedReason, - String? utxoLabel, - })> checkBlockUTXO( + Future<({bool blocked, String? blockedReason, String? utxoLabel})> + checkBlockUTXO( Map jsonUTXO, String? scriptPubKeyHex, Map jsonTX, @@ -97,30 +98,34 @@ class PeercoinWallet await fetchAddressesForElectrumXScan(); // Separate receiving and change addresses. - final Set receivingAddresses = allAddressesOld - .where((e) => e.subType == AddressSubType.receiving) - .map((e) => e.value) - .toSet(); - final Set changeAddresses = allAddressesOld - .where((e) => e.subType == AddressSubType.change) - .map((e) => e.value) - .toSet(); + final Set receivingAddresses = + allAddressesOld + .where((e) => e.subType == AddressSubType.receiving) + .map((e) => e.value) + .toSet(); + final Set changeAddresses = + allAddressesOld + .where((e) => e.subType == AddressSubType.change) + .map((e) => e.value) + .toSet(); // Remove duplicates. final allAddressesSet = {...receivingAddresses, ...changeAddresses}; // Fetch history from ElectrumX. - final List> allTxHashes = - await fetchHistory(allAddressesSet); + final List> allTxHashes = await fetchHistory( + allAddressesSet, + ); // Only parse new txs (not in db yet). final List> allTransactions = []; for (final txHash in allTxHashes) { // Check for duplicates by searching for tx by tx_hash in db. - final storedTx = await mainDB.isar.transactionV2s - .where() - .txidWalletIdEqualTo(txHash["tx_hash"] as String, walletId) - .findFirst(); + final storedTx = + await mainDB.isar.transactionV2s + .where() + .txidWalletIdEqualTo(txHash["tx_hash"] as String, walletId) + .findFirst(); if (storedTx == null || storedTx.height == null || @@ -133,8 +138,9 @@ class PeercoinWallet ); // Only tx to list once. - if (allTransactions - .indexWhere((e) => e["txid"] == tx["txid"] as String) == + if (allTransactions.indexWhere( + (e) => e["txid"] == tx["txid"] as String, + ) == -1) { tx["height"] = txHash["height"]; allTransactions.add(tx); @@ -284,7 +290,8 @@ class PeercoinWallet txid: txData["txid"] as String, height: txData["height"] as int?, version: txData["version"] as int, - timestamp: txData["blocktime"] as int? ?? + timestamp: + txData["blocktime"] as int? ?? DateTime.timestamp().millisecondsSinceEpoch ~/ 1000, inputs: List.unmodifiable(inputs), outputs: List.unmodifiable(outputs), diff --git a/lib/wallets/wallet/impl/solana_wallet.dart b/lib/wallets/wallet/impl/solana_wallet.dart index 5a5ef7c579..ad88d57b90 100644 --- a/lib/wallets/wallet/impl/solana_wallet.dart +++ b/lib/wallets/wallet/impl/solana_wallet.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'dart:math'; import 'package:decimal/decimal.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:socks5_proxy/socks_client.dart'; import 'package:solana/dto.dart'; import 'package:solana/solana.dart'; diff --git a/lib/wallets/wallet/impl/stellar_wallet.dart b/lib/wallets/wallet/impl/stellar_wallet.dart index 91af9758f3..dbfda5ee9e 100644 --- a/lib/wallets/wallet/impl/stellar_wallet.dart +++ b/lib/wallets/wallet/impl/stellar_wallet.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:socks5_proxy/socks.dart'; import 'package:stellar_flutter_sdk/stellar_flutter_sdk.dart' as stellar; diff --git a/lib/wallets/wallet/impl/sub_wallets/eth_token_wallet.dart b/lib/wallets/wallet/impl/sub_wallets/eth_token_wallet.dart index d32ae3db89..e45babf9f9 100644 --- a/lib/wallets/wallet/impl/sub_wallets/eth_token_wallet.dart +++ b/lib/wallets/wallet/impl/sub_wallets/eth_token_wallet.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'package:ethereum_addresses/ethereum_addresses.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:web3dart/web3dart.dart' as web3dart; import '../../../../dto/ethereum/eth_token_tx_dto.dart'; diff --git a/lib/wallets/wallet/impl/tezos_wallet.dart b/lib/wallets/wallet/impl/tezos_wallet.dart index 54302a0272..129ade324a 100644 --- a/lib/wallets/wallet/impl/tezos_wallet.dart +++ b/lib/wallets/wallet/impl/tezos_wallet.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:io'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:tezart/tezart.dart' as tezart; import 'package:tuple/tuple.dart'; diff --git a/lib/wallets/wallet/impl/xelis_wallet.dart b/lib/wallets/wallet/impl/xelis_wallet.dart index eea19dbdb6..71f5f38949 100644 --- a/lib/wallets/wallet/impl/xelis_wallet.dart +++ b/lib/wallets/wallet/impl/xelis_wallet.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:math'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; diff --git a/lib/wallets/wallet/intermediate/bip39_hd_wallet.dart b/lib/wallets/wallet/intermediate/bip39_hd_wallet.dart index 777dda0640..e6ad147d63 100644 --- a/lib/wallets/wallet/intermediate/bip39_hd_wallet.dart +++ b/lib/wallets/wallet/intermediate/bip39_hd_wallet.dart @@ -2,7 +2,7 @@ import 'dart:typed_data'; import 'package:bip39/bip39.dart' as bip39; import 'package:coinlib_flutter/coinlib_flutter.dart' as coinlib; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/balance.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; @@ -48,8 +48,9 @@ abstract class Bip39HDWallet extends Bip39Wallet ...privateKey.data, if (privateKey.compressed) 1, ]; - final checksum = - coinlib.sha256DoubleHash(Uint8List.fromList(data)).sublist(0, 4); + final checksum = coinlib + .sha256DoubleHash(Uint8List.fromList(data)) + .sublist(0, 4); data.addAll(checksum); return Uint8List.fromList(data).toBase58Encoded; @@ -64,13 +65,14 @@ abstract class Bip39HDWallet extends Bip39Wallet ); } - final current = await mainDB.isar.addresses - .where() - .walletIdEqualTo(walletId) - .filter() - .typeEqualTo(derivePathType.getAddressType()) - .sortByDerivationIndexDesc() - .findFirst(); + final current = + await mainDB.isar.addresses + .where() + .walletIdEqualTo(walletId) + .filter() + .typeEqualTo(derivePathType.getAddressType()) + .sortByDerivationIndexDesc() + .findFirst(); final index = current == null ? 0 : current.derivationIndex + 1; const chain = 0; // receiving address final address = await _generateAddress( @@ -84,31 +86,25 @@ abstract class Bip39HDWallet extends Bip39Wallet @override List get standardReceivingAddressFilters => [ - // view only only have a single derivation path currently - if (!isViewOnly) - FilterCondition.equalTo( - property: r"type", - value: info.mainAddressType, - ), - const FilterCondition.equalTo( - property: r"subType", - value: AddressSubType.receiving, - ), - ]; + // view only only have a single derivation path currently + if (!isViewOnly) + FilterCondition.equalTo(property: r"type", value: info.mainAddressType), + const FilterCondition.equalTo( + property: r"subType", + value: AddressSubType.receiving, + ), + ]; @override List get standardChangeAddressFilters => [ - // view only only have a single derivation path currently - if (!isViewOnly) - FilterCondition.equalTo( - property: r"type", - value: info.mainAddressType, - ), - const FilterCondition.equalTo( - property: r"subType", - value: AddressSubType.change, - ), - ]; + // view only only have a single derivation path currently + if (!isViewOnly) + FilterCondition.equalTo(property: r"type", value: info.mainAddressType), + const FilterCondition.equalTo( + property: r"subType", + value: AddressSubType.change, + ), + ]; /// Generates a receiving address. If none /// are in the current wallet db it will generate at index 0, otherwise the @@ -214,9 +210,7 @@ abstract class Bip39HDWallet extends Bip39Wallet } } - throw Exception( - "_viewOnlyPathHelper viewOnly failed to match paths", - ); + throw Exception("_viewOnlyPathHelper viewOnly failed to match paths"); } DerivePathType _fromAddressType(AddressType addressType) { diff --git a/lib/wallets/wallet/intermediate/bip39_wallet.dart b/lib/wallets/wallet/intermediate/bip39_wallet.dart index 0d302d0a90..05a7e40a29 100644 --- a/lib/wallets/wallet/intermediate/bip39_wallet.dart +++ b/lib/wallets/wallet/intermediate/bip39_wallet.dart @@ -1,4 +1,5 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; + import '../../../models/isar/models/blockchain_data/address.dart'; import '../../crypto_currency/intermediate/bip39_currency.dart'; import '../wallet.dart'; @@ -9,26 +10,20 @@ abstract class Bip39Wallet extends Wallet Bip39Wallet(super.currency); List get standardReceivingAddressFilters => [ - FilterCondition.equalTo( - property: r"type", - value: info.mainAddressType, - ), - const FilterCondition.equalTo( - property: r"subType", - value: AddressSubType.receiving, - ), - ]; + FilterCondition.equalTo(property: r"type", value: info.mainAddressType), + const FilterCondition.equalTo( + property: r"subType", + value: AddressSubType.receiving, + ), + ]; List get standardChangeAddressFilters => [ - FilterCondition.equalTo( - property: r"type", - value: info.mainAddressType, - ), - const FilterCondition.equalTo( - property: r"subType", - value: AddressSubType.change, - ), - ]; + FilterCondition.equalTo(property: r"type", value: info.mainAddressType), + const FilterCondition.equalTo( + property: r"subType", + value: AddressSubType.change, + ), + ]; // ========== Private ======================================================== diff --git a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart index d29e979764..a25b236a91 100644 --- a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart @@ -5,7 +5,7 @@ import 'dart:math'; import 'package:compat/compat.dart' as lib_monero_compat; import 'package:cs_monero/cs_monero.dart' as lib_monero; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; diff --git a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart index f18cba8d0c..afc15e547a 100644 --- a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'dart:math'; import 'package:cs_salvium/cs_salvium.dart' as lib_salvium; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; diff --git a/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart b/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart index 2415af7bd9..e9604eafd6 100644 --- a/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:flutter/foundation.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; import 'package:xelis_flutter/src/api/network.dart' as x_network; diff --git a/lib/wallets/wallet/supporting/epiccash_wallet_info_extension.dart b/lib/wallets/wallet/supporting/epiccash_wallet_info_extension.dart index c11eb2fbc0..b12e472d0b 100644 --- a/lib/wallets/wallet/supporting/epiccash_wallet_info_extension.dart +++ b/lib/wallets/wallet/supporting/epiccash_wallet_info_extension.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../utilities/logger.dart'; import '../../isar/models/wallet_info.dart'; @@ -13,12 +13,14 @@ extension EpiccashWalletInfoExtension on WalletInfo { } try { return ExtraEpiccashWalletInfo.fromMap( - Map.from( - jsonDecode(data) as Map, - ), + Map.from(jsonDecode(data) as Map), ); } catch (e, s) { - Logging.instance.e("ExtraEpiccashWalletInfo.fromMap failed: ", error: e, stackTrace: s); + Logging.instance.e( + "ExtraEpiccashWalletInfo.fromMap failed: ", + error: e, + stackTrace: s, + ); return null; } } @@ -28,9 +30,7 @@ extension EpiccashWalletInfoExtension on WalletInfo { required Isar isar, }) async { await updateOtherData( - newEntries: { - WalletInfoKeys.epiccashData: jsonEncode(epicData.toMap()), - }, + newEntries: {WalletInfoKeys.epiccashData: jsonEncode(epicData.toMap())}, isar: isar, ); } @@ -73,13 +73,13 @@ class ExtraEpiccashWalletInfo { } ExtraEpiccashWalletInfo.fromMap(Map json) - : receivingIndex = json['receivingIndex'] as int, - changeIndex = json['changeIndex'] as int, - slatesToAddresses = json['slatesToAddresses'] as Map, - slatesToCommits = json['slatesToCommits'] as Map, - lastScannedBlock = json['lastScannedBlock'] as int, - restoreHeight = json['restoreHeight'] as int, - creationHeight = json['creationHeight'] as int; + : receivingIndex = json['receivingIndex'] as int, + changeIndex = json['changeIndex'] as int, + slatesToAddresses = json['slatesToAddresses'] as Map, + slatesToCommits = json['slatesToCommits'] as Map, + lastScannedBlock = json['lastScannedBlock'] as int, + restoreHeight = json['restoreHeight'] as int, + creationHeight = json['creationHeight'] as int; ExtraEpiccashWalletInfo copyWith({ int? receivingIndex, diff --git a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart index f9de38fca5..ec820d0fbe 100644 --- a/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart +++ b/lib/wallets/wallet/supporting/mimblewimblecoin_wallet_info_extension.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../utilities/logger.dart'; import '../../isar/models/wallet_info.dart'; diff --git a/lib/wallets/wallet/wallet.dart b/lib/wallets/wallet/wallet.dart index 1d3a49b894..0fa72d6822 100644 --- a/lib/wallets/wallet/wallet.dart +++ b/lib/wallets/wallet/wallet.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:meta/meta.dart'; import 'package:mutex/mutex.dart'; @@ -34,11 +34,11 @@ import 'impl/dash_wallet.dart'; import 'impl/dogecoin_wallet.dart'; import 'impl/ecash_wallet.dart'; import 'impl/epiccash_wallet.dart'; -import 'impl/mimblewimblecoin_wallet.dart'; import 'impl/ethereum_wallet.dart'; import 'impl/fact0rn_wallet.dart'; import 'impl/firo_wallet.dart'; import 'impl/litecoin_wallet.dart'; +import 'impl/mimblewimblecoin_wallet.dart'; import 'impl/monero_wallet.dart'; import 'impl/namecoin_wallet.dart'; import 'impl/nano_wallet.dart'; diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart index 0f428ec896..07f4d4f932 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/bcash_interface.dart @@ -1,6 +1,6 @@ import 'package:bitbox/bitbox.dart' as bitbox; import 'package:bitbox/src/utils/network.dart' as bitbox_utils; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/input.dart'; import '../../../models/isar/models/blockchain_data/v2/input_v2.dart'; diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart index 5a24f32ca8..618c2b1c79 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'package:bitbox/bitbox.dart' as bitbox; import 'package:flutter/foundation.dart'; import 'package:fusiondart/fusiondart.dart' as fusion; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/fusion_progress_ui_state.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; @@ -357,23 +357,24 @@ mixin CashFusionInterface // can't directly query for equal lists in isar so we need to fetch // all addresses then search in dart try { - final derivationPath = (await mainDB - .getAddresses(walletId) - .filter() - .typeEqualTo(AddressType.p2pkh) - .and() - .derivationPathIsNotNull() - .and() - .group( - (q) => q - .subTypeEqualTo(AddressSubType.receiving) - .or() - .subTypeEqualTo(AddressSubType.change), - ) - .findAll()) - .firstWhere((e) => e.publicKey.toString() == pubKey.toString()) - .derivationPath! - .value; + final derivationPath = + (await mainDB + .getAddresses(walletId) + .filter() + .typeEqualTo(AddressType.p2pkh) + .and() + .derivationPathIsNotNull() + .and() + .group( + (q) => q + .subTypeEqualTo(AddressSubType.receiving) + .or() + .subTypeEqualTo(AddressSubType.change), + ) + .findAll()) + .firstWhere((e) => e.publicKey.toString() == pubKey.toString()) + .derivationPath! + .value; final root = await getRootHDNode(); @@ -390,9 +391,10 @@ mixin CashFusionInterface return []; } - final updatedAddresses = addresses - .map((e) => e.copyWith(otherData: kReservedFusionAddress)) - .toList(); + final updatedAddresses = + addresses + .map((e) => e.copyWith(otherData: kReservedFusionAddress)) + .toList(); await mainDB.isar.writeTxn(() async { for (final newAddress in updatedAddresses) { @@ -439,9 +441,10 @@ mixin CashFusionInterface ); // Initialize a list of unused reserved change addresses. - final List
unusedReservedAddresses = unusedChangeAddresses - .where((e) => e.otherData == kReservedFusionAddress) - .toList(); + final List
unusedReservedAddresses = + unusedChangeAddresses + .where((e) => e.otherData == kReservedFusionAddress) + .toList(); unusedReservedAddresses.addAll( await _reserveAddresses( @@ -456,9 +459,7 @@ mixin CashFusionInterface address: e.value, publicKey: e.publicKey, fusionReserved: true, - derivationPath: fusion.DerivationPath( - e.derivationPath!.value, - ), + derivationPath: fusion.DerivationPath(e.derivationPath!.value), ), ) .toList(); @@ -475,23 +476,24 @@ mixin CashFusionInterface ); } - final changeAddresses = await mainDB.isar.addresses - .buildQuery
( - whereClauses: [ - IndexWhereClause.equalTo( - indexName: r"walletId", - value: [walletId], - ), - ], - filter: changeAddressFilterOperation, - sortBy: [ - const SortProperty( - property: r"derivationIndex", - sort: Sort.desc, - ), - ], - ) - .findAll(); + final changeAddresses = + await mainDB.isar.addresses + .buildQuery
( + whereClauses: [ + IndexWhereClause.equalTo( + indexName: r"walletId", + value: [walletId], + ), + ], + filter: changeAddressFilterOperation, + sortBy: [ + const SortProperty( + property: r"derivationIndex", + sort: Sort.desc, + ), + ], + ) + .findAll(); final List
unused = []; @@ -525,11 +527,12 @@ mixin CashFusionInterface } Future _isUnused(String address) async { - final txCountInDB = await mainDB - .getTransactions(walletId) - .filter() - .address((q) => q.valueEqualTo(address)) - .count(); + final txCountInDB = + await mainDB + .getTransactions(walletId) + .filter() + .address((q) => q.valueEqualTo(address)) + .count(); if (txCountInDB == 0) { // double check via electrumx // _getTxCountForAddress can throw! @@ -597,9 +600,7 @@ mixin CashFusionInterface /// Fuse the wallet's UTXOs. /// /// This function is called when the user taps the "Fuse" button in the UI. - Future fuse({ - required FusionInfo fusionInfo, - }) async { + Future fuse({required FusionInfo fusionInfo}) async { // Initial attempt for CashFusion integration goes here. try { @@ -631,30 +632,29 @@ mixin CashFusionInterface getChainHeight: fetchChainHeight, updateStatusCallback: _updateStatus, checkUtxoExists: _checkUtxoExists, - getTransactionJson: (String txid) async => - await electrumXCachedClient.getTransaction( - cryptoCurrency: info.coin, - txHash: txid, - ), + getTransactionJson: + (String txid) async => await electrumXCachedClient.getTransaction( + cryptoCurrency: info.coin, + txHash: txid, + ), getPrivateKeyForPubKey: _getPrivateKeyForPubKey, - broadcastTransaction: (String txHex) => - electrumXClient.broadcastTransaction(rawTx: txHex), + broadcastTransaction: + (String txHex) => + electrumXClient.broadcastTransaction(rawTx: txHex), unReserveAddresses: (List addresses) async { final List> futures = []; for (final addr in addresses) { futures.add( - mainDB.getAddress(walletId, addr.address).then( - (address) async { - if (address == null) { - // matching address not found in db so cannot mark as unreserved - // just ignore I guess. Should never actually happen in practice. - // Might be useful check in debugging cases? - return; - } else { - await _unReserveAddress(address); - } - }, - ), + mainDB.getAddress(walletId, addr.address).then((address) async { + if (address == null) { + // matching address not found in db so cannot mark as unreserved + // just ignore I guess. Should never actually happen in practice. + // Might be useful check in debugging cases? + return; + } else { + await _unReserveAddress(address); + } + }), ); } await Future.wait(futures); @@ -692,13 +692,14 @@ mixin CashFusionInterface await updateUTXOs(); // Add unfrozen stack UTXOs. - final List walletUtxos = await mainDB - .getUTXOs(walletId) - .filter() - .isBlockedEqualTo(false) - .and() - .addressIsNotNull() - .findAll(); + final List walletUtxos = + await mainDB + .getUTXOs(walletId) + .filter() + .isBlockedEqualTo(false) + .and() + .addressIsNotNull() + .findAll(); final List coinList = []; // Loop through UTXOs, checking and adding valid ones. @@ -718,24 +719,24 @@ mixin CashFusionInterface } // Fetch address to get pubkey - final addr = await mainDB - .getAddresses(walletId) - .filter() - .anyOf>( - possibleAddresses, - (q, e) => q.valueEqualTo(e), - ) - .and() - .group( - (q) => q - .subTypeEqualTo(AddressSubType.change) - .or() - .subTypeEqualTo(AddressSubType.receiving), - ) - .and() - .typeEqualTo(AddressType.p2pkh) - .findFirst(); + final addr = + await mainDB + .getAddresses(walletId) + .filter() + .anyOf< + String, + QueryBuilder + >(possibleAddresses, (q, e) => q.valueEqualTo(e)) + .and() + .group( + (q) => q + .subTypeEqualTo(AddressSubType.change) + .or() + .subTypeEqualTo(AddressSubType.receiving), + ) + .and() + .typeEqualTo(AddressType.p2pkh) + .findFirst(); // depending on the address type in the query above this can be null if (addr == null) { diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart index dbfc8d45f5..17120df8de 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart @@ -3,7 +3,7 @@ import 'dart:math'; import 'dart:typed_data'; import 'package:coinlib_flutter/coinlib_flutter.dart' as coinlib; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:meta/meta.dart'; import '../../../db/drift/database.dart'; diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart index 1f7babc79f..82f45ff347 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart @@ -5,7 +5,7 @@ import 'dart:math' as math; import 'package:coinlib_flutter/coinlib_flutter.dart' as cl; import 'package:drift/drift.dart'; import 'package:fixnum/fixnum.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:mweb_client/mweb_client.dart'; import '../../../db/drift/database.dart'; diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart index f9efe7975f..f5215ed95a 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:nanodart/nanodart.dart'; import 'package:tuple/tuple.dart'; diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/ordinals_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/ordinals_interface.dart index 430c46c454..686d1f90a9 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/ordinals_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/ordinals_interface.dart @@ -1,4 +1,4 @@ -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../dto/ordinals/inscription_data.dart'; import '../../../models/isar/models/blockchain_data/utxo.dart'; @@ -10,14 +10,16 @@ import 'electrumx_interface.dart'; mixin OrdinalsInterface on ElectrumXInterface { - final LitescribeAPI _litescribeAPI = - LitescribeAPI(baseUrl: 'https://litescribe.io/api'); + final LitescribeAPI _litescribeAPI = LitescribeAPI( + baseUrl: 'https://litescribe.io/api', + ); // check if an inscription is in a given output Future _inscriptionInAddress(String address) async { try { - return (await _litescribeAPI.getInscriptionsByAddress(address)) - .isNotEmpty; + return (await _litescribeAPI.getInscriptionsByAddress( + address, + )).isNotEmpty; } catch (e, s) { Logging.instance.e("Litescribe api failure!", error: e, stackTrace: s); @@ -29,7 +31,8 @@ mixin OrdinalsInterface List? overrideAddressesToCheck, }) async { try { - final uniqueAddresses = overrideAddressesToCheck ?? + final uniqueAddresses = + overrideAddressesToCheck ?? await mainDB .getUTXOs(walletId) .filter() @@ -41,9 +44,10 @@ mixin OrdinalsInterface uniqueAddresses.cast(), ); - final ords = inscriptions - .map((e) => Ordinal.fromInscriptionData(e, walletId)) - .toList(); + final ords = + inscriptions + .map((e) => Ordinal.fromInscriptionData(e, walletId)) + .toList(); await mainDB.isar.writeTxn(() async { await mainDB.isar.ordinals @@ -54,15 +58,18 @@ mixin OrdinalsInterface await mainDB.isar.ordinals.putAll(ords); }); } catch (e, s) { - Logging.instance.w("$runtimeType failed refreshInscriptions(): ", - error: e, stackTrace: s); + Logging.instance.w( + "$runtimeType failed refreshInscriptions(): ", + error: e, + stackTrace: s, + ); } } // =================== Overrides ============================================= @override Future<({bool blocked, String? blockedReason, String? utxoLabel})> - checkBlockUTXO( + checkBlockUTXO( Map jsonUTXO, String? scriptPubKeyHex, Map jsonTX, @@ -116,8 +123,9 @@ mixin OrdinalsInterface final List allInscriptions = []; for (final String address in addresses) { try { - final inscriptions = - await _litescribeAPI.getInscriptionsByAddress(address); + final inscriptions = await _litescribeAPI.getInscriptionsByAddress( + address, + ); allInscriptions.addAll(inscriptions); } catch (e) { throw Exception("Error fetching inscriptions for address $address: $e"); diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart index 3ad0425d5c..0d993036d3 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart @@ -8,7 +8,7 @@ import 'package:bitcoindart/bitcoindart.dart' as btc_dart; import 'package:bitcoindart/src/utils/constants/op.dart' as op; import 'package:bitcoindart/src/utils/script.dart' as bscript; import 'package:coinlib_flutter/coinlib_flutter.dart' as coinlib; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:pointycastle/digests/sha256.dart'; import 'package:tuple/tuple.dart'; diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart index 03a8b6dd60..f21293f956 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/input.dart'; import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart index c3aff94fd8..a008d1b24a 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart @@ -9,7 +9,7 @@ import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart' as spark show Log; import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import 'package:logger/logger.dart'; import '../../../db/drift/database.dart' show Drift; diff --git a/lib/widgets/icon_widgets/eth_token_icon.dart b/lib/widgets/icon_widgets/eth_token_icon.dart index b837eeeb70..0b0104fbf9 100644 --- a/lib/widgets/icon_widgets/eth_token_icon.dart +++ b/lib/widgets/icon_widgets/eth_token_icon.dart @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../models/isar/exchange_cache/currency.dart'; import '../../services/exchange/change_now/change_now_exchange.dart'; diff --git a/lib/widgets/isar_collection_watcher_list.dart b/lib/widgets/isar_collection_watcher_list.dart index bd4c2596ef..10d7d1b247 100644 --- a/lib/widgets/isar_collection_watcher_list.dart +++ b/lib/widgets/isar_collection_watcher_list.dart @@ -11,7 +11,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../themes/stack_colors.dart'; import '../../utilities/text_styles.dart'; @@ -58,10 +58,12 @@ class _IsarCollectionWatcherListState void initState() { super.initState(); - sparkCoinsCollectionWatcher = - widget.queryBuilder().watch(fireImmediately: true); - _streamSubscription = sparkCoinsCollectionWatcher! - .listen((data) => _onSparkCoinsCollectionWatcherEvent(data)); + sparkCoinsCollectionWatcher = widget.queryBuilder().watch( + fireImmediately: true, + ); + _streamSubscription = sparkCoinsCollectionWatcher!.listen( + (data) => _onSparkCoinsCollectionWatcherEvent(data), + ); } @override @@ -94,7 +96,9 @@ class _IsarCollectionWatcherListState child: RoundedWhiteContainer( child: Row( children: [ - ...widget.itemBuilder(null).map( + ...widget + .itemBuilder(null) + .map( (e) => Expanded( flex: e.$3, child: Text( @@ -112,32 +116,37 @@ class _IsarCollectionWatcherListState child: ListView.separated( shrinkWrap: true, itemCount: _items.length, - separatorBuilder: (_, __) => Container( - height: 1, - color: Theme.of(context) - .extension()! - .backgroundAppBar, - ), - itemBuilder: (_, index) => Padding( - padding: const EdgeInsets.all(4), - child: RoundedWhiteContainer( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ...widget.itemBuilder(_items[index]).map( - (e) => Expanded( - flex: e.$3, - child: SelectableText( - e.$2, - style: STextStyles.itemSubtitle12(context), - textAlign: TextAlign.left, + separatorBuilder: + (_, __) => Container( + height: 1, + color: + Theme.of( + context, + ).extension()!.backgroundAppBar, + ), + itemBuilder: + (_, index) => Padding( + padding: const EdgeInsets.all(4), + child: RoundedWhiteContainer( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ...widget + .itemBuilder(_items[index]) + .map( + (e) => Expanded( + flex: e.$3, + child: SelectableText( + e.$2, + style: STextStyles.itemSubtitle12(context), + textAlign: TextAlign.left, + ), + ), ), - ), - ), - ], + ], + ), + ), ), - ), - ), ), ), ], @@ -147,32 +156,28 @@ class _IsarCollectionWatcherListState itemCount: _items.length + 1, itemBuilder: (ctx, index) { return Padding( - padding: const EdgeInsets.only( - bottom: 16, - left: 16, - right: 16, - ), + padding: const EdgeInsets.only(bottom: 16, left: 16, right: 16), child: RoundedWhiteContainer( - child: index == 0 - ? Row( - children: [ - Text( - "Total ${widget.itemName}: ${_items.length}", - style: STextStyles.itemSubtitle(context), - ), - ], - ) - : Column( - mainAxisSize: MainAxisSize.min, - children: [ - ...widget.itemBuilder(_items[index - 1]).map( - (e) => DetailItem( - title: e.$1, - detail: e.$2, + child: + index == 0 + ? Row( + children: [ + Text( + "Total ${widget.itemName}: ${_items.length}", + style: STextStyles.itemSubtitle(context), + ), + ], + ) + : Column( + mainAxisSize: MainAxisSize.min, + children: [ + ...widget + .itemBuilder(_items[index - 1]) + .map( + (e) => DetailItem(title: e.$1, detail: e.$2), ), - ), - ], - ), + ], + ), ), ); }, 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 14783eb141..e5450c39ad 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 @@ -13,7 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:isar/isar.dart'; +import 'package:isar_community/isar.dart'; import '../../../models/isar/exchange_cache/currency.dart'; import '../../../services/exchange/change_now/change_now_exchange.dart'; diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 2fe5bba128..6203e1d8ff 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -41,9 +41,9 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); - g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar = + g_autoptr(FlPluginRegistrar) isar_community_flutter_libs_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin"); - isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar); + isar_flutter_libs_plugin_register_with_registrar(isar_community_flutter_libs_registrar); g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 0ce0471161..cb793bf5b0 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -10,7 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_libepiccash flutter_libmwc flutter_secure_storage_linux - isar_flutter_libs + isar_community_flutter_libs sqlite3_flutter_libs stack_wallet_backup url_launcher_linux diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index b916c95c86..bee29fdb75 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -17,7 +17,7 @@ import flutter_libepiccash import flutter_libmwc import flutter_local_notifications import flutter_secure_storage_macos -import isar_flutter_libs +import isar_community_flutter_libs import local_auth_darwin import mobile_scanner import package_info_plus @@ -43,7 +43,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) - FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin")) + LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin")) MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 866a1e3310..ec9605110c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,39 +5,26 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + sha256: dd3d2ad434b9510001d089e8de7556d50c834481b9abc2891a0184a8493a19dc url: "https://pub.dev" source: hosted - version: "76.0.0" - _macros: - dependency: transitive - description: dart - source: sdk - version: "0.3.3" + version: "89.0.0" analyzer: dependency: "direct dev" description: name: analyzer - sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" - url: "https://pub.dev" - source: hosted - version: "6.11.0" - analyzer_plugin: - dependency: transitive - description: - name: analyzer_plugin - sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" + sha256: c22b6e7726d1f9e5db58c7251606076a71ca0dbcf76116675edfadbec0c9e875 url: "https://pub.dev" source: hosted - version: "0.11.3" + version: "8.2.0" another_flushbar: dependency: "direct main" description: name: another_flushbar - sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" + sha256: "2b99671c010a7d5770acf5cb24c9f508b919c3a7948b6af9646e773e7da7b757" url: "https://pub.dev" source: hosted - version: "1.12.30" + version: "1.12.32" ansicolor: dependency: transitive description: @@ -167,10 +154,10 @@ packages: dependency: transitive description: name: borsh_annotation - sha256: "4a226cf8b7a165ecf8020c0c8d366b2728167fd102ef9b9e89d94d86f89ac57b" + sha256: dc73a7fdc6fe4505535657daf8ab3cebe382311fae63a0faaf9315ea1bc30bff url: "https://pub.dev" source: hosted - version: "0.3.1+5" + version: "0.3.2" bs58check: dependency: "direct main" description: @@ -183,10 +170,10 @@ packages: dependency: transitive description: name: build - sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 + sha256: "7d95cbbb1526ab5ae977df9b4cc660963b9b27f6d1075c0b34653868911385e4" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "3.0.0" build_cli_annotations: dependency: transitive description: @@ -215,26 +202,26 @@ packages: dependency: transitive description: name: build_resolvers - sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 + sha256: "38c9c339333a09b090a638849a4c56e70a404c6bdd3b511493addfbc113b60c2" url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "3.0.0" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99" + sha256: b971d4a1c789eba7be3e6fe6ce5e5b50fd3719e3cb485b3fad6d04358304351d url: "https://pub.dev" source: hosted - version: "2.4.15" + version: "2.6.0" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" + sha256: c04e612ca801cd0928ccdb891c263a2b1391cb27940a5ea5afcf9ba894de5d62 url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "9.2.0" built_collection: dependency: transitive description: @@ -247,18 +234,18 @@ packages: dependency: transitive description: name: built_value - sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4 + sha256: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d url: "https://pub.dev" source: hosted - version: "8.9.5" + version: "8.12.0" calendar_date_picker2: dependency: "direct main" description: name: calendar_date_picker2 - sha256: "986955aea43081c8cf70fe01735ccdfe9a7041218b2be53ed92d5d4e639e8a1a" + sha256: "7b5f20f2a02768df70b3d1fb181c217ab9f8992f39fd6c3fc2ff95b0885820a2" url: "https://pub.dev" source: hosted - version: "1.1.7" + version: "1.1.9" camera_linux: dependency: "direct main" description: @@ -280,10 +267,10 @@ packages: dependency: "direct main" description: name: camera_platform_interface - sha256: b3ede1f171532e0d83111fe0980b46d17f1aa9788a07a2fbed07366bbdbb9061 + sha256: ea1ef6ba79cdbed93df2d3eeef11542a90dec24dbcd9cde574926b86d7a09a10 url: "https://pub.dev" source: hosted - version: "2.8.0" + version: "2.11.0" camera_windows: dependency: "direct main" description: @@ -297,10 +284,10 @@ packages: dependency: "direct main" description: name: cbor - sha256: "69b1fe99f4632acc597034d73a5eb440f82667b58e2489223bb798e31b6c90db" + sha256: f5239dd6b6ad24df67d1449e87d7180727d6f43b87b3c9402e6398c7a2d9609b url: "https://pub.dev" source: hosted - version: "6.3.3" + version: "6.3.7" characters: dependency: transitive description: @@ -313,10 +300,10 @@ packages: dependency: transitive description: name: charcode - sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.4.0" checked_yaml: dependency: transitive description: @@ -325,6 +312,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" cli_util: dependency: transitive description: @@ -345,10 +340,10 @@ packages: dependency: transitive description: name: code_builder - sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + sha256: "11654819532ba94c34de52ff5feb52bd81cba1de00ef2ed622fd50295f9d4243" url: "https://pub.dev" source: hosted - version: "4.10.1" + version: "4.11.0" coinlib: dependency: "direct overridden" description: @@ -412,10 +407,10 @@ packages: dependency: transitive description: name: coverage - sha256: e3493833ea012784c740e341952298f1cc77f1f01b1bbc3eb4eecf6984fb7f43 + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.15.0" cross_file: dependency: transitive description: @@ -660,10 +655,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820" + sha256: c87dfe3d56f183ffe9106a18aebc6db431fc7c98c31a54b952a77f3d54a85697 url: "https://pub.dev" source: hosted - version: "2.3.8" + version: "3.1.2" dartx: dependency: transitive description: @@ -692,10 +687,10 @@ packages: dependency: "direct dev" description: name: dependency_validator - sha256: f727a5627aa405965fab4aef4f468e50a9b632ba0737fd2f98c932fec6d712b9 + sha256: "3a243f5b9def5f902887a66fbea7e72e612eee956af6c8c34d382fe6d5484145" url: "https://pub.dev" source: hosted - version: "3.2.3" + version: "5.0.2" desktop_drop: dependency: "direct main" description: @@ -716,10 +711,10 @@ packages: dependency: transitive description: name: device_info_plus_platform_interface - sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2" + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f url: "https://pub.dev" source: hosted - version: "7.0.2" + version: "7.0.3" devicelocale: dependency: "direct main" description: @@ -741,10 +736,10 @@ packages: dependency: transitive description: name: dio - sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9" + sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9 url: "https://pub.dev" source: hosted - version: "5.8.0+1" + version: "5.9.0" dio_web_adapter: dependency: transitive description: @@ -757,26 +752,26 @@ packages: dependency: "direct main" description: name: drift - sha256: c2d073d35ad441730812f4ea05b5dd031fb81c5f9786a4f5fb77ecd6307b6f74 + sha256: "540cf382a3bfa99b76e51514db5b0ebcd81ce3679b7c1c9cb9478ff3735e47a1" url: "https://pub.dev" source: hosted - version: "2.22.1" + version: "2.28.2" drift_dev: dependency: "direct dev" description: name: drift_dev - sha256: f4ab5d6976b1e31551ceb82ff597a505bda7818ff4f7be08a1da9d55eb6e730c + sha256: "4db0eeedc7e8bed117a9f22d867ab7a3a294300fed5c269aac90d0b3545967ca" url: "https://pub.dev" source: hosted - version: "2.22.1" + version: "2.28.3" drift_flutter: dependency: "direct main" description: name: drift_flutter - sha256: "9fd9b479c6187d6b3bbdfd2703df98010470a6c65c2a8c8c5a1034c620bd0a0e" + sha256: b7534bf320aac5213259aac120670ba67b63a1fd010505babc436ff86083818f url: "https://pub.dev" source: hosted - version: "0.2.3" + version: "0.2.7" dropdown_button2: dependency: "direct main" description: @@ -854,10 +849,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" ffi: dependency: "direct main" description: @@ -1008,10 +1003,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e" + sha256: b0694b7fb1689b0e6cc193b3f1fcac6423c4f93c74fb20b806c6b6f196db0c31 url: "https://pub.dev" source: hosted - version: "2.0.24" + version: "2.0.30" flutter_riverpod: dependency: "direct main" description: @@ -1040,18 +1035,18 @@ packages: dependency: transitive description: name: flutter_secure_storage_linux - sha256: "4d91bfc23047422cbcd73ac684bc169859ee766482517c22172c86596bf1464b" + sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.3" flutter_secure_storage_macos: dependency: transitive description: name: flutter_secure_storage_macos - sha256: "1693ab11121a5f925bbea0be725abfcfbbcf36c1e29e571f84a0c0f436147a81" + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" flutter_secure_storage_platform_interface: dependency: transitive description: @@ -1080,10 +1075,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b + sha256: b9c2ad5872518a27507ab432d1fb97e8813b05f0fc693f9d40fad06d073e0678 url: "https://pub.dev" source: hosted - version: "2.0.17" + version: "2.2.1" flutter_test: dependency: "direct dev" description: flutter @@ -1175,10 +1170,10 @@ packages: dependency: transitive description: name: grpc - sha256: "30e1edae6846b163a64f6d8716e3443980fe1f7d2d1f086f011d24ea186f2582" + sha256: "2dde469ddd8bbd7a33a0765da417abe1ad2142813efce3a86c512041294e2b26" url: "https://pub.dev" source: hosted - version: "4.0.4" + version: "4.1.0" hex: dependency: "direct main" description: @@ -1203,14 +1198,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - hive_generator: - dependency: "direct dev" - description: - name: hive_generator - sha256: "06cb8f58ace74de61f63500564931f9505368f45f98958bd7a6c35ba24159db4" - url: "https://pub.dev" - source: hosted - version: "2.0.1" hive_test: dependency: "direct dev" description: @@ -1223,10 +1210,10 @@ packages: dependency: transitive description: name: html - sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" url: "https://pub.dev" source: hosted - version: "0.15.5" + version: "0.15.6" http: dependency: "direct main" description: @@ -1304,30 +1291,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" - isar: + isar_community: dependency: "direct main" description: - name: isar - sha256: e17a9555bc7f22ff26568b8c64d019b4ffa2dc6bd4cb1c8d9b269aefd32e53ad - url: "https://pub.isar-community.dev" + name: isar_community + sha256: eae4a7e659bec0f92fc953afb8738512062df6a2ff99fe838cb53f9ed4fa6e97 + url: "https://pub.dev" source: hosted - version: "3.1.8" - isar_flutter_libs: + version: "3.3.0-dev.2" + isar_community_flutter_libs: dependency: "direct main" description: - name: isar_flutter_libs - sha256: "78710781e658ce4bff59b3f38c5b2735e899e627f4e926e1221934e77b95231a" - url: "https://pub.isar-community.dev" + name: isar_community_flutter_libs + sha256: e8e6668d2c20ed61af9422bddc0bc3d1f6db91e3a5dae4406379a1426c06fbff + url: "https://pub.dev" source: hosted - version: "3.1.8" - isar_generator: + version: "3.3.0-dev.2" + isar_community_generator: dependency: "direct dev" description: - name: isar_generator - sha256: "484e73d3b7e81dbd816852fe0b9497333118a9aeb646fd2d349a62cc8980ffe1" - url: "https://pub.isar-community.dev" + name: isar_community_generator + sha256: "9da90eafaecf2ec482f50854373e37f3d9e33387830dbc0265bcdb74d9036e74" + url: "https://pub.dev" source: hosted - version: "3.1.8" + version: "3.3.0-dev.2" js: dependency: transitive description: @@ -1356,10 +1343,10 @@ packages: dependency: transitive description: name: json_serializable - sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c + sha256: "33a040668b31b320aafa4822b7b1e177e163fc3c1e835c6750319d4ab23aa6fe" url: "https://pub.dev" source: hosted - version: "6.9.0" + version: "6.11.1" jsontool: dependency: transitive description: @@ -1380,26 +1367,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -1420,18 +1407,18 @@ packages: dependency: transitive description: name: local_auth_android - sha256: "0abe4e72f55c785b28900de52a2522c86baba0988838b5dc22241b072ecccd74" + sha256: "48924f4a8b3cc45994ad5993e2e232d3b00788a305c1bf1c7db32cef281ce9a3" url: "https://pub.dev" source: hosted - version: "1.0.48" + version: "1.0.52" local_auth_darwin: dependency: transitive description: name: local_auth_darwin - sha256: "6d2950da311d26d492a89aeb247c72b4653ddc93601ea36a84924a396806d49c" + sha256: "0e9706a8543a4a2eee60346294d6a633dd7c3ee60fae6b752570457c4ff32055" url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.6.0" local_auth_platform_interface: dependency: transitive description: @@ -1473,14 +1460,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.7.0" - macros: - dependency: transitive - description: - name: macros - sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" - url: "https://pub.dev" - source: hosted - version: "0.1.3-main.0" matcher: dependency: transitive description: @@ -1525,10 +1504,10 @@ packages: dependency: "direct main" description: name: mobile_scanner - sha256: "54005bdea7052d792d35b4fef0f84ec5ddc3a844b250ecd48dc192fb9b4ebc95" + sha256: "5e7e09d904dc01de071b79b3f3789b302b0ed3c9c963109cd3f83ad90de62ecf" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "7.1.2" mockingjay: dependency: "direct dev" description: @@ -1541,10 +1520,10 @@ packages: dependency: "direct dev" description: name: mockito - sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" + sha256: "4feb43bc4eb6c03e832f5fcd637d1abb44b98f9cfa245c58e27382f58859f8f6" url: "https://pub.dev" source: hosted - version: "5.4.4" + version: "5.5.1" mocktail: dependency: transitive description: @@ -1614,10 +1593,10 @@ packages: dependency: "direct main" description: name: on_chain - sha256: "54d8117ff007b1f4a71ce8076c2a0bbfb592e5ce61ae397c68a67d70c9246a5d" + sha256: "6b6792f7da9ea23003cd6f0fc8c2930c049f50bb61499333c0492893b7608072" url: "https://pub.dev" source: hosted - version: "4.3.0" + version: "4.5.0" package_config: dependency: transitive description: @@ -1630,18 +1609,18 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" + sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968" url: "https://pub.dev" source: hosted - version: "8.3.0" + version: "8.3.1" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" + sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.1" path: dependency: "direct main" description: @@ -1670,18 +1649,18 @@ packages: dependency: transitive description: name: path_provider_android - sha256: "0ca7359dad67fd7063cb2892ab0c0737b2daafd807cf1acecd62374c8fae6c12" + sha256: "993381400e94d18469750e5b9dcb8206f15bc09f9da86b9e44a9b0092a0066db" url: "https://pub.dev" source: hosted - version: "2.2.16" + version: "2.2.18" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" + sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" path_provider_linux: dependency: transitive description: @@ -1710,10 +1689,10 @@ packages: dependency: "direct main" description: name: permission_handler - sha256: "2d070d8684b68efb580a5997eb62f675e8a885ef0be6e754fb9ef489c177470f" + sha256: bc917da36261b00137bbc8896bf1482169cd76f866282368948f032c8c1caae1 url: "https://pub.dev" source: hosted - version: "12.0.0+1" + version: "12.0.1" permission_handler_android: dependency: transitive description: @@ -1798,10 +1777,10 @@ packages: dependency: transitive description: name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" url: "https://pub.dev" source: hosted - version: "1.5.1" + version: "1.5.2" pretty_dio_logger: dependency: transitive description: @@ -1822,10 +1801,10 @@ packages: dependency: transitive description: name: protobuf - sha256: "579fe5557eae58e3adca2e999e38f02441d8aa908703854a9e0a0f47fa857731" + sha256: de9c9eb2c33f8e933a42932fe1dc504800ca45ebc3d673e6ed7f39754ee4053e url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.2.0" pub_semver: dependency: transitive description: @@ -1988,18 +1967,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "3.1.0" source_helper: dependency: transitive description: name: source_helper - sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + sha256: a447acb083d3a5ef17f983dd36201aeea33fedadb3228fa831f2f0c92f0f3aca url: "https://pub.dev" source: hosted - version: "1.3.5" + version: "1.3.7" source_map_stack_trace: dependency: transitive description: @@ -2028,26 +2007,26 @@ packages: dependency: "direct main" description: name: sqlite3 - sha256: fde692580bee3379374af1f624eb3e113ab2865ecb161dbe2d8ac2de9735dbdb + sha256: f393d92c71bdcc118d6203d07c991b9be0f84b1a6f89dd4f7eed348131329924 url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "2.9.0" sqlite3_flutter_libs: dependency: "direct main" description: name: sqlite3_flutter_libs - sha256: "62bbb4073edbcdf53f40c80775f33eea01d301b7b81417e5b3fb7395416258c1" + sha256: ccd29dd6cf6fb9351fa07cd6f92895809adbf0779c1d986acf5e3d53b3250e33 url: "https://pub.dev" source: hosted - version: "0.5.24" + version: "0.5.25" sqlparser: dependency: transitive description: name: sqlparser - sha256: "4cad4b2c5f63dc9ea1a8dcffb58cf762322bea5dd8836870164a65e913bdae41" + sha256: "57090342af1ce32bb499aa641f4ecdd2d6231b9403cea537ac059e803cc20d67" url: "https://pub.dev" source: hosted - version: "0.40.0" + version: "0.41.2" stack_trace: dependency: transitive description: @@ -2133,26 +2112,26 @@ packages: dependency: transitive description: name: test - sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e" + sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb" url: "https://pub.dev" source: hosted - version: "1.25.15" + version: "1.26.2" test_api: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" test_core: dependency: transitive description: name: test_core - sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa" + sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a" url: "https://pub.dev" source: hosted - version: "0.6.8" + version: "0.6.11" tezart: dependency: "direct main" description: @@ -2166,10 +2145,10 @@ packages: dependency: transitive description: name: time - sha256: ad8e018a6c9db36cb917a031853a1aae49467a93e0d464683e029537d848c221 + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" timezone: dependency: transitive description: @@ -2247,26 +2226,26 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" + sha256: "81777b08c498a292d93ff2feead633174c386291e35612f8da438d6e92c4447e" url: "https://pub.dev" source: hosted - version: "6.3.14" + version: "6.3.20" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb" + sha256: d80b3f567a617cb923546034cc94bfe44eb15f989fe670b37f26abdb9d939cb7 url: "https://pub.dev" source: hosted - version: "6.3.3" + version: "6.3.4" url_launcher_linux: dependency: transitive description: @@ -2279,10 +2258,10 @@ packages: dependency: transitive description: name: url_launcher_macos - sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" + sha256: c043a77d6600ac9c38300567f33ef12b0ef4f4783a2c1f00231d2b1941fea13f url: "https://pub.dev" source: hosted - version: "3.2.2" + version: "3.2.3" url_launcher_platform_interface: dependency: transitive description: @@ -2295,10 +2274,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" url_launcher_windows: dependency: transitive description: @@ -2319,10 +2298,10 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 url: "https://pub.dev" source: hosted - version: "1.1.18" + version: "1.1.19" vector_graphics_codec: dependency: transitive description: @@ -2335,18 +2314,18 @@ packages: dependency: transitive description: name: vector_graphics_compiler - sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" + sha256: d354a7ec6931e6047785f4db12a1f61ec3d43b207fc0790f863818543f8ff0dc url: "https://pub.dev" source: hosted - version: "1.1.16" + version: "1.1.19" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" very_good_analysis: dependency: transitive description: @@ -2375,18 +2354,18 @@ packages: dependency: "direct main" description: name: wakelock_plus - sha256: b90fbcc8d7bdf3b883ea9706d9d76b9978cb1dfa4351fcc8014d6ec31a493354 + sha256: "61713aa82b7f85c21c9f4cd0a148abd75f38a74ec645fcb1e446f882c82fd09b" url: "https://pub.dev" source: hosted - version: "1.2.11" + version: "1.3.3" wakelock_plus_platform_interface: dependency: transitive description: name: wakelock_plus_platform_interface - sha256: "70e780bc99796e1db82fe764b1e7dcb89a86f1e5b3afb1db354de50f2e41eb7a" + sha256: "036deb14cd62f558ca3b73006d52ce049fabcdcb2eddfe0bf0fe4e8a943b5cf2" url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.3.0" wakelock_windows: dependency: "direct overridden" description: @@ -2416,10 +2395,10 @@ packages: dependency: transitive description: name: watcher - sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + sha256: "5bf046f41320ac97a469d506261797f35254fa61c641741ef32dacda98b7d39c" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.3" web: dependency: "direct overridden" description: @@ -2472,10 +2451,10 @@ packages: dependency: "direct overridden" description: name: win32 - sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e + sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" url: "https://pub.dev" source: hosted - version: "5.10.1" + version: "5.14.0" win32_registry: dependency: transitive description: @@ -2530,10 +2509,10 @@ packages: dependency: transitive description: name: xxh3 - sha256: cbeb0e1d10f4c6bf67b650f395eac0cc689425b5efc2ba0cc3d3e069a0beaeec + sha256: "399a0438f5d426785723c99da6b16e136f4953fb1e9db0bf270bd41dd4619916" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" yaml: dependency: transitive description: @@ -2554,10 +2533,10 @@ packages: dependency: "direct main" description: name: zxing2 - sha256: "6cf995abd3c86f01ba882968dedffa7bc130185e382f2300239d2e857fc7912c" + sha256: "2677c49a3b9ca9457cb1d294fd4bd5041cac6aab8cdb07b216ba4e98945c684f" url: "https://pub.dev" source: hosted - version: "0.2.3" + version: "0.2.4" sdks: - dart: ">=3.7.2 <4.0.0" - flutter: ">=3.29.0" + dart: ">=3.9.0 <4.0.0" + flutter: ">=3.29.0 <4.0.0" diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index e73ecadf87..b95424d49e 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -14,7 +14,7 @@ description: PLACEHOLDER version: PLACEHOLDER_V+PLACEHOLDER_B environment: - sdk: ">=3.7.0 <4.0.0" + sdk: ">=3.9.0 <4.0.0" flutter: ^3.29.0 dependencies: @@ -148,12 +148,8 @@ dependencies: url: https://github.com/cypherstack/flutter_file_picker.git ref: b2849e63e1d418ad8d943c886cd3f4ed20d0ff23 connectivity_plus: ^4.0.1 - isar: - version: 3.1.8 - hosted: https://pub.isar-community.dev/ - isar_flutter_libs: # contains Isar Core - version: 3.1.8 - hosted: https://pub.isar-community.dev/ + isar_community: 3.3.0-dev.2 + isar_community_flutter_libs: 3.3.0-dev.2 dropdown_button2: ^2.1.3 string_validator: ^0.3.0 equatable: ^2.0.5 @@ -192,8 +188,8 @@ dependencies: ref: dea799c20bc917f72b18c916ca96bc99fb1bd1c5 path: packages/solana calendar_date_picker2: ^1.0.2 - sqlite3: 2.4.5 - sqlite3_flutter_libs: 0.5.24 + sqlite3: 2.9.0 + sqlite3_flutter_libs: 0.5.25 # camera_linux: ^0.0.8 camera_linux: git: @@ -222,8 +218,8 @@ dependencies: git: url: https://github.com/Cyrix126/namecoin_dart ref: 819b21164ef93cc0889049d4a8a1be2d0cc36a1b - drift: ^2.22.1 - drift_flutter: ^0.2.3 + drift: ^2.28.2 + drift_flutter: ^0.2.7 path: ^1.9.1 cs_salvium: ^1.2.1 cs_salvium_flutter_libs: ^1.0.4 @@ -236,21 +232,19 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - build_runner: ^2.1.7 + build_runner: ^2.5.4 flutter_launcher_icons: ^0.13.1 - hive_generator: ^2.0.0 - dependency_validator: ^3.1.2 +# hive_generator: ^2.0.0 + dependency_validator: ^5.0.2 hive_test: ^1.0.1 - mockito: ^5.4.1 + mockito: ^5.4.6 mockingjay: ^0.2.0 # lint: ^1.10.0 - analyzer: ^6.7.0 + analyzer: ^8.2.2 import_sorter: ^4.6.0 flutter_lints: ^3.0.1 - isar_generator: - version: 3.1.8 - hosted: https://pub.isar-community.dev/ - drift_dev: ^2.22.1 + isar_community_generator: 3.3.0-dev.2 + drift_dev: ^2.28.3 flutter_native_splash: image: assets/icon/splash.png @@ -301,7 +295,7 @@ dependency_overrides: ref: 0cd6d54e2860bea68fc50c801cb9db2a760192fb crypto: 3.0.2 - analyzer: ^6.7.0 + analyzer: ^8.2.0 pinenacl: ^0.6.0 http: ^0.13.0 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 91b5f9fd30..9a0db709f5 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 3a7e8ad5ca..1f19a41f02 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -11,7 +11,7 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_libepiccash flutter_libmwc flutter_secure_storage_windows - isar_flutter_libs + isar_community_flutter_libs local_auth_windows permission_handler_windows share_plus From 27547a29e073f1ea5db92f0a08f8c3a034fd41ae Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 12:14:40 -0600 Subject: [PATCH 109/178] update hive => hive_ce --- lib/db/hive/db.dart | 4 +- lib/db/special_migrations.dart | 10 +- lib/models/epicbox_config_model.dart | 2 +- lib/models/epicbox_server_model.dart | 2 +- .../change_now/exchange_transaction.dart | 13 +- .../exchange_transaction_status.dart | 28 +- .../exchange/response_objects/trade.dart | 9 +- lib/models/lelantus_coin.dart | 2 +- lib/models/mwcmqs_config_model.dart | 30 +- lib/models/mwcmqs_server_model.dart | 2 +- lib/models/node_model.dart | 2 +- lib/models/notification_model.dart | 2 +- lib/models/paymint/transactions_model.dart | 5 +- lib/models/paymint/utxo_model.dart | 2 +- lib/models/trade_wallet_lookup.dart | 2 +- lib/utilities/desktop_password_service.dart | 31 +- pubspec.lock | 42 +- scripts/app_config/templates/pubspec.template | 6 +- .../lelantus_coin_adapter_test.dart | 2 +- .../lelantus_coin_adapter_test.mocks.dart | 459 ++++++---------- .../transactions_model_adapter_test.dart | 12 +- ...transactions_model_adapter_test.mocks.dart | 459 ++++++---------- .../utxo_model_adapter_test.dart | 2 +- .../utxo_model_adapter_test.mocks.dart | 459 ++++++---------- test/price_test.dart | 500 ++++++++++-------- .../services/coins/firo/firo_wallet_test.dart | 2 +- .../coins/monero/monero_wallet_test.dart | 2 +- .../coins/wownero/wownero_wallet_test.dart | 2 +- test/services/node_service_test.dart | 7 +- 29 files changed, 856 insertions(+), 1244 deletions(-) diff --git a/lib/db/hive/db.dart b/lib/db/hive/db.dart index be431aba78..3eac4b805a 100644 --- a/lib/db/hive/db.dart +++ b/lib/db/hive/db.dart @@ -11,8 +11,8 @@ import 'dart:isolate'; import 'package:compat/compat.dart' as lib_monero_compat; -import 'package:hive/hive.dart' show Box; -import 'package:hive/src/hive_impl.dart'; +import 'package:hive_ce/src/hive_impl.dart'; +import 'package:hive_ce/hive.dart' show Box; import 'package:mutex/mutex.dart'; import '../../app_config.dart'; diff --git a/lib/db/special_migrations.dart b/lib/db/special_migrations.dart index 1092cfc1bf..84b17518cd 100644 --- a/lib/db/special_migrations.dart +++ b/lib/db/special_migrations.dart @@ -1,8 +1,8 @@ import 'dart:io'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:hive/hive.dart' show Box; -import 'package:hive/src/hive_impl.dart'; +import 'package:hive_ce/hive.dart' show Box; +import 'package:hive_ce/src/hive_impl.dart'; import 'package:path_provider/path_provider.dart'; import '../app_config.dart'; @@ -13,10 +13,8 @@ abstract class CampfireMigration { static const _didRunKey = "campfire_one_time_migration_done_key"; static bool get didRun => - DB.instance.get( - boxName: DB.boxNameDBInfo, - key: _didRunKey, - ) as bool? ?? + DB.instance.get(boxName: DB.boxNameDBInfo, key: _didRunKey) + as bool? ?? false; static Future setDidRun() async { diff --git a/lib/models/epicbox_config_model.dart b/lib/models/epicbox_config_model.dart index 4d22dadd7a..71fe82281b 100644 --- a/lib/models/epicbox_config_model.dart +++ b/lib/models/epicbox_config_model.dart @@ -10,7 +10,7 @@ import 'dart:convert'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'epicbox_server_model.dart'; diff --git a/lib/models/epicbox_server_model.dart b/lib/models/epicbox_server_model.dart index 8101689436..c0d5816733 100644 --- a/lib/models/epicbox_server_model.dart +++ b/lib/models/epicbox_server_model.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; part 'type_adaptors/epicbox_server_model.g.dart'; diff --git a/lib/models/exchange/change_now/exchange_transaction.dart b/lib/models/exchange/change_now/exchange_transaction.dart index 1de49bfd00..b5b43ddce9 100644 --- a/lib/models/exchange/change_now/exchange_transaction.dart +++ b/lib/models/exchange/change_now/exchange_transaction.dart @@ -9,7 +9,7 @@ */ import 'package:decimal/decimal.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'package:uuid/uuid.dart'; import 'exchange_transaction_status.dart'; @@ -117,12 +117,11 @@ class ExchangeTransaction { DateTime.tryParse(json["date"] as String? ?? "") ?? DateTime.fromMillisecondsSinceEpoch(0), statusString: json["statusString"] as String? ?? "", - statusObject: - json["statusObject"] is Map - ? ExchangeTransactionStatus.fromJson( - json["statusObject"] as Map, - ) - : null, + statusObject: json["statusObject"] is Map + ? ExchangeTransactionStatus.fromJson( + json["statusObject"] as Map, + ) + : null, ); } catch (e) { rethrow; diff --git a/lib/models/exchange/change_now/exchange_transaction_status.dart b/lib/models/exchange/change_now/exchange_transaction_status.dart index 5a904690f7..def02d5fe6 100644 --- a/lib/models/exchange/change_now/exchange_transaction_status.dart +++ b/lib/models/exchange/change_now/exchange_transaction_status.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import '../../../utilities/logger.dart'; import 'cn_exchange_transaction_status.dart' @@ -177,14 +177,12 @@ class ExchangeTransactionStatus { toCurrency: json["toCurrency"] as String? ?? "", id: json["id"] as String, updatedAt: json["updatedAt"] as String? ?? "", - expectedSendAmountDecimal: - json["expectedSendAmount"] == null - ? "" - : json["expectedSendAmount"].toString(), - expectedReceiveAmountDecimal: - json["expectedReceiveAmount"] == null - ? "" - : json["expectedReceiveAmount"].toString(), + expectedSendAmountDecimal: json["expectedSendAmount"] == null + ? "" + : json["expectedSendAmount"].toString(), + expectedReceiveAmountDecimal: json["expectedReceiveAmount"] == null + ? "" + : json["expectedReceiveAmount"].toString(), createdAt: json["createdAt"] as String? ?? "", isPartner: json["isPartner"] as bool, depositReceivedAt: json["depositReceivedAt"] as String? ?? "", @@ -194,12 +192,12 @@ class ExchangeTransactionStatus { payoutHash: json["payoutHash"] as String? ?? "", payinExtraId: json["payinExtraId"] as String? ?? "", payoutExtraId: json["payoutExtraId"] as String? ?? "", - amountSendDecimal: - json["amountSend"] == null ? "" : json["amountSend"].toString(), - amountReceiveDecimal: - json["amountReceive"] == null - ? "" - : json["amountReceive"].toString(), + amountSendDecimal: json["amountSend"] == null + ? "" + : json["amountSend"].toString(), + amountReceiveDecimal: json["amountReceive"] == null + ? "" + : json["amountReceive"].toString(), tokensDestination: json["tokensDestination"] as String? ?? "", refundAddress: json["refundAddress"] as String? ?? "", refundExtraId: json["refundExtraId"] as String? ?? "", diff --git a/lib/models/exchange/response_objects/trade.dart b/lib/models/exchange/response_objects/trade.dart index e6f996f9bf..1669b94c5e 100644 --- a/lib/models/exchange/response_objects/trade.dart +++ b/lib/models/exchange/response_objects/trade.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import '../../../services/exchange/change_now/change_now_exchange.dart'; import '../change_now/cn_exchange_transaction.dart'; @@ -226,10 +226,9 @@ class Trade { timestamp: exTx.date, updatedAt: DateTime.tryParse(exTx.statusObject!.updatedAt) ?? exTx.date, payInCurrency: exTx.fromCurrency, - payInAmount: - exTx.statusObject!.amountSendDecimal.isEmpty - ? exTx.statusObject!.expectedSendAmountDecimal - : exTx.statusObject!.amountSendDecimal, + payInAmount: exTx.statusObject!.amountSendDecimal.isEmpty + ? exTx.statusObject!.expectedSendAmountDecimal + : exTx.statusObject!.amountSendDecimal, payInAddress: exTx.payinAddress, payInNetwork: "", payInExtraId: exTx.payinExtraId, diff --git a/lib/models/lelantus_coin.dart b/lib/models/lelantus_coin.dart index 6dbce0b4a2..a009b28922 100644 --- a/lib/models/lelantus_coin.dart +++ b/lib/models/lelantus_coin.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; part 'type_adaptors/lelantus_coin.g.dart'; diff --git a/lib/models/mwcmqs_config_model.dart b/lib/models/mwcmqs_config_model.dart index 067d1a8ee5..eb37702f5d 100644 --- a/lib/models/mwcmqs_config_model.dart +++ b/lib/models/mwcmqs_config_model.dart @@ -10,7 +10,7 @@ import 'dart:convert'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'mwcmqs_server_model.dart'; @@ -23,19 +23,10 @@ class MwcMqsConfigModel { @HiveField(2) final int? port; - MwcMqsConfigModel({ - required this.host, - this.port - }); + MwcMqsConfigModel({required this.host, this.port}); - MwcMqsConfigModel copyWith({ - int? port, - bool? protocolInsecure, - }) { - return MwcMqsConfigModel( - host: host, - port: this.port ?? 443, - ); + MwcMqsConfigModel copyWith({int? port, bool? protocolInsecure}) { + return MwcMqsConfigModel(host: host, port: this.port ?? 443); } Map toMap() { @@ -46,10 +37,7 @@ class MwcMqsConfigModel { } Map toJson() { - return { - 'mwcmqs_domain': host, - 'mwcmqs_port': port, - }; + return {'mwcmqs_domain': host, 'mwcmqs_port': port}; } @override @@ -69,10 +57,9 @@ class MwcMqsConfigModel { _mwcmqs['mwcmqs_port'] = _mwcmqs['port']; } - return MwcMqsConfigModel( host: _mwcmqs['mwcmqs_domain'] as String, - port: _mwcmqs['mwcmqs_port'] as int + port: _mwcmqs['mwcmqs_port'] as int, ); } @@ -81,9 +68,6 @@ class MwcMqsConfigModel { bool? protocolInsecure, int? addressIndex, }) { - return MwcMqsConfigModel( - host: server.host, - port: server.port ?? 443 - ); + return MwcMqsConfigModel(host: server.host, port: server.port ?? 443); } } diff --git a/lib/models/mwcmqs_server_model.dart b/lib/models/mwcmqs_server_model.dart index c6ffd757f9..9b5bd5d27c 100644 --- a/lib/models/mwcmqs_server_model.dart +++ b/lib/models/mwcmqs_server_model.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; part 'type_adaptors/mwcmqs_server_model.g.dart'; diff --git a/lib/models/node_model.dart b/lib/models/node_model.dart index 1224d7e5bb..5d43d84dba 100644 --- a/lib/models/node_model.dart +++ b/lib/models/node_model.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import '../utilities/default_nodes.dart'; import '../utilities/flutter_secure_storage_interface.dart'; diff --git a/lib/models/notification_model.dart b/lib/models/notification_model.dart index 54a7a6787d..aa56f24c04 100644 --- a/lib/models/notification_model.dart +++ b/lib/models/notification_model.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; part 'type_adaptors/notification_model.g.dart'; diff --git a/lib/models/paymint/transactions_model.dart b/lib/models/paymint/transactions_model.dart index 6cea6f1cec..e9bbcffdfc 100644 --- a/lib/models/paymint/transactions_model.dart +++ b/lib/models/paymint/transactions_model.dart @@ -10,7 +10,7 @@ import 'package:dart_numerics/dart_numerics.dart'; import 'package:decimal/decimal.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; part '../type_adaptors/transactions_model.g.dart'; @@ -236,7 +236,8 @@ class Transaction { return Transaction( txid: json['txid'] as String, confirmedStatus: json['confirmed_status'] as bool? ?? false, - timestamp: json['timestamp'] as int? ?? + timestamp: + json['timestamp'] as int? ?? (DateTime.now().millisecondsSinceEpoch ~/ 1000), txType: json['txType'] as String, amount: _parse(json["amount"].toString()), diff --git a/lib/models/paymint/utxo_model.dart b/lib/models/paymint/utxo_model.dart index 5a8ccffaae..0d12d3a5d5 100644 --- a/lib/models/paymint/utxo_model.dart +++ b/lib/models/paymint/utxo_model.dart @@ -9,7 +9,7 @@ */ import 'package:dart_numerics/dart_numerics.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; part '../type_adaptors/utxo_model.g.dart'; diff --git a/lib/models/trade_wallet_lookup.dart b/lib/models/trade_wallet_lookup.dart index c4bc8252b8..c2a12c9c24 100644 --- a/lib/models/trade_wallet_lookup.dart +++ b/lib/models/trade_wallet_lookup.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; part 'type_adaptors/trade_wallet_lookup.g.dart'; diff --git a/lib/utilities/desktop_password_service.dart b/lib/utilities/desktop_password_service.dart index 39243962bf..1649a5d3bf 100644 --- a/lib/utilities/desktop_password_service.dart +++ b/lib/utilities/desktop_password_service.dart @@ -8,7 +8,7 @@ * */ -import 'package:hive/hive.dart' show Box; +import 'package:hive_ce/hive.dart' show Box; import 'package:stack_wallet_backup/secure_storage.dart'; import '../db/hive/db.dart'; @@ -68,7 +68,11 @@ class DPS { await _put(key: _kKeyBlobKey, value: await _handler!.getKeyBlob()); await _updateStoredKeyBlobVersion(kLatestBlobVersion); } catch (e, s) { - Logging.instance.e("${_getMessageFromException(e)}\n$s", error: e, stackTrace: s); + Logging.instance.e( + "${_getMessageFromException(e)}\n$s", + error: e, + stackTrace: s, + ); rethrow; } } @@ -101,7 +105,11 @@ class DPS { await _updateStoredKeyBlobVersion(kLatestBlobVersion); } } catch (e, s) { - Logging.instance.e("${_getMessageFromException(e)}\n$s", error: e, stackTrace: s); + Logging.instance.e( + "${_getMessageFromException(e)}\n$s", + error: e, + stackTrace: s, + ); throw Exception(_getMessageFromException(e)); } } @@ -119,7 +127,11 @@ class DPS { // existing passphrase matches key blob return true; } catch (e, s) { - Logging.instance.w("${_getMessageFromException(e)}\n$s", error: e, stackTrace: s,); + Logging.instance.w( + "${_getMessageFromException(e)}\n$s", + error: e, + stackTrace: s, + ); // password is wrong or some other error return false; } @@ -143,16 +155,17 @@ class DPS { final blobVersion = await _getStoredKeyBlobVersion(); await _handler!.resetPassphrase(passphraseNew, blobVersion); - await _put( - key: _kKeyBlobKey, - value: await _handler!.getKeyBlob(), - ); + await _put(key: _kKeyBlobKey, value: await _handler!.getKeyBlob()); await _updateStoredKeyBlobVersion(blobVersion); // successfully updated passphrase return true; } catch (e, s) { - Logging.instance.w("${_getMessageFromException(e)}\n$s", error: e, stackTrace: s,); + Logging.instance.w( + "${_getMessageFromException(e)}\n$s", + error: e, + stackTrace: s, + ); return false; } } diff --git a/pubspec.lock b/pubspec.lock index ec9605110c..9af81c8945 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1183,21 +1183,37 @@ packages: source: hosted version: "0.2.0" hive: - dependency: "direct main" + dependency: transitive description: name: hive sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" url: "https://pub.dev" source: hosted version: "2.2.3" - hive_flutter: + hive_ce: dependency: "direct main" description: - name: hive_flutter - sha256: dca1da446b1d808a51689fb5d0c6c9510c0a2ba01e22805d492c73b68e33eecc + name: hive_ce + sha256: "89746b555109029a30780e0a601978460b8065643592667f6e43a238faccb8a4" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "2.13.2" + hive_ce_flutter: + dependency: "direct main" + description: + name: hive_ce_flutter + sha256: f5bd57fda84402bca7557fedb8c629c96c8ea10fab4a542968d7b60864ca02cc + url: "https://pub.dev" + source: hosted + version: "2.3.2" + hive_ce_generator: + dependency: "direct dev" + description: + name: hive_ce_generator + sha256: a169feeff2da9cc2c417ce5ae9bcebf7c8a95d7a700492b276909016ad70a786 + url: "https://pub.dev" + source: hosted + version: "1.9.3" hive_test: dependency: "direct dev" description: @@ -1315,6 +1331,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.3.0-dev.2" + isolate_channel: + dependency: transitive + description: + name: isolate_channel + sha256: f3d36f783b301e6b312c3450eeb2656b0e7d1db81331af2a151d9083a3f6b18d + url: "https://pub.dev" + source: hosted + version: "0.2.2+1" js: dependency: transitive description: @@ -2521,6 +2545,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.3" + yaml_writer: + dependency: transitive + description: + name: yaml_writer + sha256: "69651cd7238411179ac32079937d4aa9a2970150d6b2ae2c6fe6de09402a5dc5" + url: "https://pub.dev" + source: hosted + version: "2.1.0" zxcvbn: dependency: "direct main" description: diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index b95424d49e..c084b0723d 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -110,8 +110,8 @@ dependencies: # Storage plugins flutter_secure_storage: ^8.0.0 - hive: ^2.0.5 - hive_flutter: ^1.1.0 + hive_ce: ^2.13.2 + hive_ce_flutter: ^2.3.2 path_provider: ^2.1.5 # UI/Component plugins @@ -234,7 +234,7 @@ dev_dependencies: sdk: flutter build_runner: ^2.5.4 flutter_launcher_icons: ^0.13.1 -# hive_generator: ^2.0.0 + hive_ce_generator: ^1.9.3 dependency_validator: ^5.0.2 hive_test: ^1.0.1 mockito: ^5.4.6 diff --git a/test/models/type_adapter_tests/lelantus_coin_adapter_test.dart b/test/models/type_adapter_tests/lelantus_coin_adapter_test.dart index cae7ca876a..1def12c490 100644 --- a/test/models/type_adapter_tests/lelantus_coin_adapter_test.dart +++ b/test/models/type_adapter_tests/lelantus_coin_adapter_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:stackwallet/models/lelantus_coin.dart'; 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 140c686d52..e458938d0c 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 @@ -6,8 +6,8 @@ import 'dart:convert' as _i5; import 'dart:typed_data' as _i4; -import 'package:hive/hive.dart' as _i3; -import 'package:hive/src/object/hive_object.dart' as _i1; +import 'package:hive_ce/hive.dart' as _i3; +import 'package:hive_ce/src/object/hive_object.dart' as _i1; import 'package:mockito/mockito.dart' as _i2; import 'package:mockito/src/dummies.dart' as _i6; @@ -26,13 +26,8 @@ import 'package:mockito/src/dummies.dart' as _i6; class _FakeHiveList_0 extends _i2.SmartFake implements _i3.HiveList { - _FakeHiveList_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHiveList_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [BinaryReader]. @@ -44,106 +39,71 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { } @override - int get availableBytes => (super.noSuchMethod( - Invocation.getter(#availableBytes), - returnValue: 0, - ) as int); + int get availableBytes => + (super.noSuchMethod(Invocation.getter(#availableBytes), returnValue: 0) + as int); @override - int get usedBytes => (super.noSuchMethod( - Invocation.getter(#usedBytes), - returnValue: 0, - ) as int); + int get usedBytes => + (super.noSuchMethod(Invocation.getter(#usedBytes), returnValue: 0) + as int); @override void skip(int? bytes) => super.noSuchMethod( - Invocation.method( - #skip, - [bytes], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#skip, [bytes]), + returnValueForMissingStub: null, + ); @override - int readByte() => (super.noSuchMethod( - Invocation.method( - #readByte, - [], - ), - returnValue: 0, - ) as int); + int readByte() => + (super.noSuchMethod(Invocation.method(#readByte, []), returnValue: 0) + as int); @override - _i4.Uint8List viewBytes(int? bytes) => (super.noSuchMethod( - Invocation.method( - #viewBytes, - [bytes], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List viewBytes(int? bytes) => + (super.noSuchMethod( + Invocation.method(#viewBytes, [bytes]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - _i4.Uint8List peekBytes(int? bytes) => (super.noSuchMethod( - Invocation.method( - #peekBytes, - [bytes], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List peekBytes(int? bytes) => + (super.noSuchMethod( + Invocation.method(#peekBytes, [bytes]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - int readWord() => (super.noSuchMethod( - Invocation.method( - #readWord, - [], - ), - returnValue: 0, - ) as int); + int readWord() => + (super.noSuchMethod(Invocation.method(#readWord, []), returnValue: 0) + as int); @override - int readInt32() => (super.noSuchMethod( - Invocation.method( - #readInt32, - [], - ), - returnValue: 0, - ) as int); + int readInt32() => + (super.noSuchMethod(Invocation.method(#readInt32, []), returnValue: 0) + as int); @override - int readUint32() => (super.noSuchMethod( - Invocation.method( - #readUint32, - [], - ), - returnValue: 0, - ) as int); + int readUint32() => + (super.noSuchMethod(Invocation.method(#readUint32, []), returnValue: 0) + as int); @override - int readInt() => (super.noSuchMethod( - Invocation.method( - #readInt, - [], - ), - returnValue: 0, - ) as int); + int readInt() => + (super.noSuchMethod(Invocation.method(#readInt, []), returnValue: 0) + as int); @override - double readDouble() => (super.noSuchMethod( - Invocation.method( - #readDouble, - [], - ), - returnValue: 0.0, - ) as double); + double readDouble() => + (super.noSuchMethod(Invocation.method(#readDouble, []), returnValue: 0.0) + as double); @override - bool readBool() => (super.noSuchMethod( - Invocation.method( - #readBool, - [], - ), - returnValue: false, - ) as bool); + bool readBool() => + (super.noSuchMethod(Invocation.method(#readBool, []), returnValue: false) + as bool); @override String readString([ @@ -151,60 +111,45 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), ]) => (super.noSuchMethod( - Invocation.method( - #readString, - [ - byteCount, - decoder, - ], - ), - returnValue: _i6.dummyValue( - this, - Invocation.method( - #readString, - [ - byteCount, - decoder, - ], - ), - ), - ) as String); + Invocation.method(#readString, [byteCount, decoder]), + returnValue: _i6.dummyValue( + this, + Invocation.method(#readString, [byteCount, decoder]), + ), + ) + as String); @override - _i4.Uint8List readByteList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readByteList, - [length], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List readByteList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readByteList, [length]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - List readIntList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readIntList, - [length], - ), - returnValue: [], - ) as List); + List readIntList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readIntList, [length]), + returnValue: [], + ) + as List); @override - List readDoubleList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readDoubleList, - [length], - ), - returnValue: [], - ) as List); + List readDoubleList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readDoubleList, [length]), + returnValue: [], + ) + as List); @override - List readBoolList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readBoolList, - [length], - ), - returnValue: [], - ) as List); + List readBoolList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readBoolList, [length]), + returnValue: [], + ) + as List); @override List readStringList([ @@ -212,49 +157,37 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), ]) => (super.noSuchMethod( - Invocation.method( - #readStringList, - [ - length, - decoder, - ], - ), - returnValue: [], - ) as List); + Invocation.method(#readStringList, [length, decoder]), + returnValue: [], + ) + as List); @override - List readList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readList, - [length], - ), - returnValue: [], - ) as List); + List readList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readList, [length]), + returnValue: [], + ) + as List); @override - Map readMap([int? length]) => (super.noSuchMethod( - Invocation.method( - #readMap, - [length], - ), - returnValue: {}, - ) as Map); + Map readMap([int? length]) => + (super.noSuchMethod( + Invocation.method(#readMap, [length]), + returnValue: {}, + ) + as Map); @override _i3.HiveList<_i1.HiveObjectMixin> readHiveList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readHiveList, - [length], - ), - returnValue: _FakeHiveList_0<_i1.HiveObjectMixin>( - this, - Invocation.method( - #readHiveList, - [length], - ), - ), - ) as _i3.HiveList<_i1.HiveObjectMixin>); + Invocation.method(#readHiveList, [length]), + returnValue: _FakeHiveList_0<_i1.HiveObjectMixin>( + this, + Invocation.method(#readHiveList, [length]), + ), + ) + as _i3.HiveList<_i1.HiveObjectMixin>); } /// A class which mocks [BinaryWriter]. @@ -267,118 +200,76 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { @override void writeByte(int? byte) => super.noSuchMethod( - Invocation.method( - #writeByte, - [byte], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeByte, [byte]), + returnValueForMissingStub: null, + ); @override void writeWord(int? value) => super.noSuchMethod( - Invocation.method( - #writeWord, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeWord, [value]), + returnValueForMissingStub: null, + ); @override void writeInt32(int? value) => super.noSuchMethod( - Invocation.method( - #writeInt32, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeInt32, [value]), + returnValueForMissingStub: null, + ); @override void writeUint32(int? value) => super.noSuchMethod( - Invocation.method( - #writeUint32, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeUint32, [value]), + returnValueForMissingStub: null, + ); @override void writeInt(int? value) => super.noSuchMethod( - Invocation.method( - #writeInt, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeInt, [value]), + returnValueForMissingStub: null, + ); @override void writeDouble(double? value) => super.noSuchMethod( - Invocation.method( - #writeDouble, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeDouble, [value]), + returnValueForMissingStub: null, + ); @override void writeBool(bool? value) => super.noSuchMethod( - Invocation.method( - #writeBool, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeBool, [value]), + returnValueForMissingStub: null, + ); @override void writeString( String? value, { bool? writeByteCount = true, _i5.Converter>? encoder = const _i5.Utf8Encoder(), - }) => - super.noSuchMethod( - Invocation.method( - #writeString, - [value], - { - #writeByteCount: writeByteCount, - #encoder: encoder, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method( + #writeString, + [value], + {#writeByteCount: writeByteCount, #encoder: encoder}, + ), + returnValueForMissingStub: null, + ); @override - void writeByteList( - List? bytes, { - bool? writeLength = true, - }) => + void writeByteList(List? bytes, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeByteList, - [bytes], - {#writeLength: writeLength}, - ), + Invocation.method(#writeByteList, [bytes], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeIntList( - List? list, { - bool? writeLength = true, - }) => + void writeIntList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeIntList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeIntList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeDoubleList( - List? list, { - bool? writeLength = true, - }) => + void writeDoubleList(List? list, {bool? writeLength = true}) => super.noSuchMethod( Invocation.method( #writeDoubleList, @@ -389,16 +280,9 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { ); @override - void writeBoolList( - List? list, { - bool? writeLength = true, - }) => + void writeBoolList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeBoolList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeBoolList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @@ -407,44 +291,26 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { List? list, { bool? writeLength = true, _i5.Converter>? encoder = const _i5.Utf8Encoder(), - }) => - super.noSuchMethod( - Invocation.method( - #writeStringList, - [list], - { - #writeLength: writeLength, - #encoder: encoder, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method( + #writeStringList, + [list], + {#writeLength: writeLength, #encoder: encoder}, + ), + returnValueForMissingStub: null, + ); @override - void writeList( - List? list, { - bool? writeLength = true, - }) => + void writeList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeMap( - Map? map, { - bool? writeLength = true, - }) => + void writeMap(Map? map, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeMap, - [map], - {#writeLength: writeLength}, - ), + Invocation.method(#writeMap, [map], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @@ -452,27 +318,14 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeHiveList( _i3.HiveList<_i1.HiveObjectMixin>? list, { bool? writeLength = true, - }) => - super.noSuchMethod( - Invocation.method( - #writeHiveList, - [list], - {#writeLength: writeLength}, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#writeHiveList, [list], {#writeLength: writeLength}), + returnValueForMissingStub: null, + ); @override - void write( - T? value, { - bool? writeTypeId = true, - }) => - super.noSuchMethod( - Invocation.method( - #write, - [value], - {#writeTypeId: writeTypeId}, - ), - returnValueForMissingStub: null, - ); + void write(T? value, {bool? writeTypeId = true}) => super.noSuchMethod( + Invocation.method(#write, [value], {#writeTypeId: writeTypeId}), + returnValueForMissingStub: null, + ); } diff --git a/test/models/type_adapter_tests/transactions_model_adapter_test.dart b/test/models/type_adapter_tests/transactions_model_adapter_test.dart index 265cdc1598..e057b610ca 100644 --- a/test/models/type_adapter_tests/transactions_model_adapter_test.dart +++ b/test/models/type_adapter_tests/transactions_model_adapter_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:stackwallet/models/lelantus_coin.dart'; @@ -104,10 +104,7 @@ void main() { when(reader.readByte()).thenAnswer((_) => readByteResponses.removeAt(0)); - final List readResponses = [ - 3426523234, - [], - ]; + final List readResponses = [3426523234, []]; when(reader.read()).thenAnswer((_) => readResponses.removeAt(0)); @@ -214,10 +211,7 @@ void main() { 3794, 3794, 4, - [ - Input(txid: "abc", vout: 1), - Input(txid: "abc", vout: 1), - ], + [Input(txid: "abc", vout: 1), Input(txid: "abc", vout: 1)], [ Output(scriptpubkeyAddress: "adr", value: 1), Output(scriptpubkeyAddress: "adr", value: 1), 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 ad9f995db9..d68fd1eb78 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 @@ -6,8 +6,8 @@ import 'dart:convert' as _i5; import 'dart:typed_data' as _i4; -import 'package:hive/hive.dart' as _i3; -import 'package:hive/src/object/hive_object.dart' as _i1; +import 'package:hive_ce/hive.dart' as _i3; +import 'package:hive_ce/src/object/hive_object.dart' as _i1; import 'package:mockito/mockito.dart' as _i2; import 'package:mockito/src/dummies.dart' as _i6; @@ -26,13 +26,8 @@ import 'package:mockito/src/dummies.dart' as _i6; class _FakeHiveList_0 extends _i2.SmartFake implements _i3.HiveList { - _FakeHiveList_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHiveList_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [BinaryReader]. @@ -44,106 +39,71 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { } @override - int get availableBytes => (super.noSuchMethod( - Invocation.getter(#availableBytes), - returnValue: 0, - ) as int); + int get availableBytes => + (super.noSuchMethod(Invocation.getter(#availableBytes), returnValue: 0) + as int); @override - int get usedBytes => (super.noSuchMethod( - Invocation.getter(#usedBytes), - returnValue: 0, - ) as int); + int get usedBytes => + (super.noSuchMethod(Invocation.getter(#usedBytes), returnValue: 0) + as int); @override void skip(int? bytes) => super.noSuchMethod( - Invocation.method( - #skip, - [bytes], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#skip, [bytes]), + returnValueForMissingStub: null, + ); @override - int readByte() => (super.noSuchMethod( - Invocation.method( - #readByte, - [], - ), - returnValue: 0, - ) as int); + int readByte() => + (super.noSuchMethod(Invocation.method(#readByte, []), returnValue: 0) + as int); @override - _i4.Uint8List viewBytes(int? bytes) => (super.noSuchMethod( - Invocation.method( - #viewBytes, - [bytes], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List viewBytes(int? bytes) => + (super.noSuchMethod( + Invocation.method(#viewBytes, [bytes]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - _i4.Uint8List peekBytes(int? bytes) => (super.noSuchMethod( - Invocation.method( - #peekBytes, - [bytes], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List peekBytes(int? bytes) => + (super.noSuchMethod( + Invocation.method(#peekBytes, [bytes]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - int readWord() => (super.noSuchMethod( - Invocation.method( - #readWord, - [], - ), - returnValue: 0, - ) as int); + int readWord() => + (super.noSuchMethod(Invocation.method(#readWord, []), returnValue: 0) + as int); @override - int readInt32() => (super.noSuchMethod( - Invocation.method( - #readInt32, - [], - ), - returnValue: 0, - ) as int); + int readInt32() => + (super.noSuchMethod(Invocation.method(#readInt32, []), returnValue: 0) + as int); @override - int readUint32() => (super.noSuchMethod( - Invocation.method( - #readUint32, - [], - ), - returnValue: 0, - ) as int); + int readUint32() => + (super.noSuchMethod(Invocation.method(#readUint32, []), returnValue: 0) + as int); @override - int readInt() => (super.noSuchMethod( - Invocation.method( - #readInt, - [], - ), - returnValue: 0, - ) as int); + int readInt() => + (super.noSuchMethod(Invocation.method(#readInt, []), returnValue: 0) + as int); @override - double readDouble() => (super.noSuchMethod( - Invocation.method( - #readDouble, - [], - ), - returnValue: 0.0, - ) as double); + double readDouble() => + (super.noSuchMethod(Invocation.method(#readDouble, []), returnValue: 0.0) + as double); @override - bool readBool() => (super.noSuchMethod( - Invocation.method( - #readBool, - [], - ), - returnValue: false, - ) as bool); + bool readBool() => + (super.noSuchMethod(Invocation.method(#readBool, []), returnValue: false) + as bool); @override String readString([ @@ -151,60 +111,45 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), ]) => (super.noSuchMethod( - Invocation.method( - #readString, - [ - byteCount, - decoder, - ], - ), - returnValue: _i6.dummyValue( - this, - Invocation.method( - #readString, - [ - byteCount, - decoder, - ], - ), - ), - ) as String); + Invocation.method(#readString, [byteCount, decoder]), + returnValue: _i6.dummyValue( + this, + Invocation.method(#readString, [byteCount, decoder]), + ), + ) + as String); @override - _i4.Uint8List readByteList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readByteList, - [length], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List readByteList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readByteList, [length]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - List readIntList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readIntList, - [length], - ), - returnValue: [], - ) as List); + List readIntList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readIntList, [length]), + returnValue: [], + ) + as List); @override - List readDoubleList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readDoubleList, - [length], - ), - returnValue: [], - ) as List); + List readDoubleList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readDoubleList, [length]), + returnValue: [], + ) + as List); @override - List readBoolList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readBoolList, - [length], - ), - returnValue: [], - ) as List); + List readBoolList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readBoolList, [length]), + returnValue: [], + ) + as List); @override List readStringList([ @@ -212,49 +157,37 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), ]) => (super.noSuchMethod( - Invocation.method( - #readStringList, - [ - length, - decoder, - ], - ), - returnValue: [], - ) as List); + Invocation.method(#readStringList, [length, decoder]), + returnValue: [], + ) + as List); @override - List readList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readList, - [length], - ), - returnValue: [], - ) as List); + List readList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readList, [length]), + returnValue: [], + ) + as List); @override - Map readMap([int? length]) => (super.noSuchMethod( - Invocation.method( - #readMap, - [length], - ), - returnValue: {}, - ) as Map); + Map readMap([int? length]) => + (super.noSuchMethod( + Invocation.method(#readMap, [length]), + returnValue: {}, + ) + as Map); @override _i3.HiveList<_i1.HiveObjectMixin> readHiveList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readHiveList, - [length], - ), - returnValue: _FakeHiveList_0<_i1.HiveObjectMixin>( - this, - Invocation.method( - #readHiveList, - [length], - ), - ), - ) as _i3.HiveList<_i1.HiveObjectMixin>); + Invocation.method(#readHiveList, [length]), + returnValue: _FakeHiveList_0<_i1.HiveObjectMixin>( + this, + Invocation.method(#readHiveList, [length]), + ), + ) + as _i3.HiveList<_i1.HiveObjectMixin>); } /// A class which mocks [BinaryWriter]. @@ -267,118 +200,76 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { @override void writeByte(int? byte) => super.noSuchMethod( - Invocation.method( - #writeByte, - [byte], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeByte, [byte]), + returnValueForMissingStub: null, + ); @override void writeWord(int? value) => super.noSuchMethod( - Invocation.method( - #writeWord, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeWord, [value]), + returnValueForMissingStub: null, + ); @override void writeInt32(int? value) => super.noSuchMethod( - Invocation.method( - #writeInt32, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeInt32, [value]), + returnValueForMissingStub: null, + ); @override void writeUint32(int? value) => super.noSuchMethod( - Invocation.method( - #writeUint32, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeUint32, [value]), + returnValueForMissingStub: null, + ); @override void writeInt(int? value) => super.noSuchMethod( - Invocation.method( - #writeInt, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeInt, [value]), + returnValueForMissingStub: null, + ); @override void writeDouble(double? value) => super.noSuchMethod( - Invocation.method( - #writeDouble, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeDouble, [value]), + returnValueForMissingStub: null, + ); @override void writeBool(bool? value) => super.noSuchMethod( - Invocation.method( - #writeBool, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeBool, [value]), + returnValueForMissingStub: null, + ); @override void writeString( String? value, { bool? writeByteCount = true, _i5.Converter>? encoder = const _i5.Utf8Encoder(), - }) => - super.noSuchMethod( - Invocation.method( - #writeString, - [value], - { - #writeByteCount: writeByteCount, - #encoder: encoder, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method( + #writeString, + [value], + {#writeByteCount: writeByteCount, #encoder: encoder}, + ), + returnValueForMissingStub: null, + ); @override - void writeByteList( - List? bytes, { - bool? writeLength = true, - }) => + void writeByteList(List? bytes, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeByteList, - [bytes], - {#writeLength: writeLength}, - ), + Invocation.method(#writeByteList, [bytes], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeIntList( - List? list, { - bool? writeLength = true, - }) => + void writeIntList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeIntList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeIntList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeDoubleList( - List? list, { - bool? writeLength = true, - }) => + void writeDoubleList(List? list, {bool? writeLength = true}) => super.noSuchMethod( Invocation.method( #writeDoubleList, @@ -389,16 +280,9 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { ); @override - void writeBoolList( - List? list, { - bool? writeLength = true, - }) => + void writeBoolList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeBoolList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeBoolList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @@ -407,44 +291,26 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { List? list, { bool? writeLength = true, _i5.Converter>? encoder = const _i5.Utf8Encoder(), - }) => - super.noSuchMethod( - Invocation.method( - #writeStringList, - [list], - { - #writeLength: writeLength, - #encoder: encoder, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method( + #writeStringList, + [list], + {#writeLength: writeLength, #encoder: encoder}, + ), + returnValueForMissingStub: null, + ); @override - void writeList( - List? list, { - bool? writeLength = true, - }) => + void writeList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeMap( - Map? map, { - bool? writeLength = true, - }) => + void writeMap(Map? map, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeMap, - [map], - {#writeLength: writeLength}, - ), + Invocation.method(#writeMap, [map], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @@ -452,27 +318,14 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeHiveList( _i3.HiveList<_i1.HiveObjectMixin>? list, { bool? writeLength = true, - }) => - super.noSuchMethod( - Invocation.method( - #writeHiveList, - [list], - {#writeLength: writeLength}, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#writeHiveList, [list], {#writeLength: writeLength}), + returnValueForMissingStub: null, + ); @override - void write( - T? value, { - bool? writeTypeId = true, - }) => - super.noSuchMethod( - Invocation.method( - #write, - [value], - {#writeTypeId: writeTypeId}, - ), - returnValueForMissingStub: null, - ); + void write(T? value, {bool? writeTypeId = true}) => super.noSuchMethod( + Invocation.method(#write, [value], {#writeTypeId: writeTypeId}), + returnValueForMissingStub: null, + ); } diff --git a/test/models/type_adapter_tests/utxo_model_adapter_test.dart b/test/models/type_adapter_tests/utxo_model_adapter_test.dart index 5849c61bde..a7789e1cf3 100644 --- a/test/models/type_adapter_tests/utxo_model_adapter_test.dart +++ b/test/models/type_adapter_tests/utxo_model_adapter_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:stackwallet/models/paymint/transactions_model.dart'; 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 983ffb1367..fc00678f29 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 @@ -6,8 +6,8 @@ import 'dart:convert' as _i5; import 'dart:typed_data' as _i4; -import 'package:hive/hive.dart' as _i3; -import 'package:hive/src/object/hive_object.dart' as _i1; +import 'package:hive_ce/hive.dart' as _i3; +import 'package:hive_ce/src/object/hive_object.dart' as _i1; import 'package:mockito/mockito.dart' as _i2; import 'package:mockito/src/dummies.dart' as _i6; @@ -26,13 +26,8 @@ import 'package:mockito/src/dummies.dart' as _i6; class _FakeHiveList_0 extends _i2.SmartFake implements _i3.HiveList { - _FakeHiveList_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHiveList_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [BinaryReader]. @@ -44,106 +39,71 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { } @override - int get availableBytes => (super.noSuchMethod( - Invocation.getter(#availableBytes), - returnValue: 0, - ) as int); + int get availableBytes => + (super.noSuchMethod(Invocation.getter(#availableBytes), returnValue: 0) + as int); @override - int get usedBytes => (super.noSuchMethod( - Invocation.getter(#usedBytes), - returnValue: 0, - ) as int); + int get usedBytes => + (super.noSuchMethod(Invocation.getter(#usedBytes), returnValue: 0) + as int); @override void skip(int? bytes) => super.noSuchMethod( - Invocation.method( - #skip, - [bytes], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#skip, [bytes]), + returnValueForMissingStub: null, + ); @override - int readByte() => (super.noSuchMethod( - Invocation.method( - #readByte, - [], - ), - returnValue: 0, - ) as int); + int readByte() => + (super.noSuchMethod(Invocation.method(#readByte, []), returnValue: 0) + as int); @override - _i4.Uint8List viewBytes(int? bytes) => (super.noSuchMethod( - Invocation.method( - #viewBytes, - [bytes], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List viewBytes(int? bytes) => + (super.noSuchMethod( + Invocation.method(#viewBytes, [bytes]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - _i4.Uint8List peekBytes(int? bytes) => (super.noSuchMethod( - Invocation.method( - #peekBytes, - [bytes], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List peekBytes(int? bytes) => + (super.noSuchMethod( + Invocation.method(#peekBytes, [bytes]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - int readWord() => (super.noSuchMethod( - Invocation.method( - #readWord, - [], - ), - returnValue: 0, - ) as int); + int readWord() => + (super.noSuchMethod(Invocation.method(#readWord, []), returnValue: 0) + as int); @override - int readInt32() => (super.noSuchMethod( - Invocation.method( - #readInt32, - [], - ), - returnValue: 0, - ) as int); + int readInt32() => + (super.noSuchMethod(Invocation.method(#readInt32, []), returnValue: 0) + as int); @override - int readUint32() => (super.noSuchMethod( - Invocation.method( - #readUint32, - [], - ), - returnValue: 0, - ) as int); + int readUint32() => + (super.noSuchMethod(Invocation.method(#readUint32, []), returnValue: 0) + as int); @override - int readInt() => (super.noSuchMethod( - Invocation.method( - #readInt, - [], - ), - returnValue: 0, - ) as int); + int readInt() => + (super.noSuchMethod(Invocation.method(#readInt, []), returnValue: 0) + as int); @override - double readDouble() => (super.noSuchMethod( - Invocation.method( - #readDouble, - [], - ), - returnValue: 0.0, - ) as double); + double readDouble() => + (super.noSuchMethod(Invocation.method(#readDouble, []), returnValue: 0.0) + as double); @override - bool readBool() => (super.noSuchMethod( - Invocation.method( - #readBool, - [], - ), - returnValue: false, - ) as bool); + bool readBool() => + (super.noSuchMethod(Invocation.method(#readBool, []), returnValue: false) + as bool); @override String readString([ @@ -151,60 +111,45 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), ]) => (super.noSuchMethod( - Invocation.method( - #readString, - [ - byteCount, - decoder, - ], - ), - returnValue: _i6.dummyValue( - this, - Invocation.method( - #readString, - [ - byteCount, - decoder, - ], - ), - ), - ) as String); + Invocation.method(#readString, [byteCount, decoder]), + returnValue: _i6.dummyValue( + this, + Invocation.method(#readString, [byteCount, decoder]), + ), + ) + as String); @override - _i4.Uint8List readByteList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readByteList, - [length], - ), - returnValue: _i4.Uint8List(0), - ) as _i4.Uint8List); + _i4.Uint8List readByteList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readByteList, [length]), + returnValue: _i4.Uint8List(0), + ) + as _i4.Uint8List); @override - List readIntList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readIntList, - [length], - ), - returnValue: [], - ) as List); + List readIntList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readIntList, [length]), + returnValue: [], + ) + as List); @override - List readDoubleList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readDoubleList, - [length], - ), - returnValue: [], - ) as List); + List readDoubleList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readDoubleList, [length]), + returnValue: [], + ) + as List); @override - List readBoolList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readBoolList, - [length], - ), - returnValue: [], - ) as List); + List readBoolList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readBoolList, [length]), + returnValue: [], + ) + as List); @override List readStringList([ @@ -212,49 +157,37 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), ]) => (super.noSuchMethod( - Invocation.method( - #readStringList, - [ - length, - decoder, - ], - ), - returnValue: [], - ) as List); + Invocation.method(#readStringList, [length, decoder]), + returnValue: [], + ) + as List); @override - List readList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readList, - [length], - ), - returnValue: [], - ) as List); + List readList([int? length]) => + (super.noSuchMethod( + Invocation.method(#readList, [length]), + returnValue: [], + ) + as List); @override - Map readMap([int? length]) => (super.noSuchMethod( - Invocation.method( - #readMap, - [length], - ), - returnValue: {}, - ) as Map); + Map readMap([int? length]) => + (super.noSuchMethod( + Invocation.method(#readMap, [length]), + returnValue: {}, + ) + as Map); @override _i3.HiveList<_i1.HiveObjectMixin> readHiveList([int? length]) => (super.noSuchMethod( - Invocation.method( - #readHiveList, - [length], - ), - returnValue: _FakeHiveList_0<_i1.HiveObjectMixin>( - this, - Invocation.method( - #readHiveList, - [length], - ), - ), - ) as _i3.HiveList<_i1.HiveObjectMixin>); + Invocation.method(#readHiveList, [length]), + returnValue: _FakeHiveList_0<_i1.HiveObjectMixin>( + this, + Invocation.method(#readHiveList, [length]), + ), + ) + as _i3.HiveList<_i1.HiveObjectMixin>); } /// A class which mocks [BinaryWriter]. @@ -267,118 +200,76 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { @override void writeByte(int? byte) => super.noSuchMethod( - Invocation.method( - #writeByte, - [byte], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeByte, [byte]), + returnValueForMissingStub: null, + ); @override void writeWord(int? value) => super.noSuchMethod( - Invocation.method( - #writeWord, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeWord, [value]), + returnValueForMissingStub: null, + ); @override void writeInt32(int? value) => super.noSuchMethod( - Invocation.method( - #writeInt32, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeInt32, [value]), + returnValueForMissingStub: null, + ); @override void writeUint32(int? value) => super.noSuchMethod( - Invocation.method( - #writeUint32, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeUint32, [value]), + returnValueForMissingStub: null, + ); @override void writeInt(int? value) => super.noSuchMethod( - Invocation.method( - #writeInt, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeInt, [value]), + returnValueForMissingStub: null, + ); @override void writeDouble(double? value) => super.noSuchMethod( - Invocation.method( - #writeDouble, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeDouble, [value]), + returnValueForMissingStub: null, + ); @override void writeBool(bool? value) => super.noSuchMethod( - Invocation.method( - #writeBool, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#writeBool, [value]), + returnValueForMissingStub: null, + ); @override void writeString( String? value, { bool? writeByteCount = true, _i5.Converter>? encoder = const _i5.Utf8Encoder(), - }) => - super.noSuchMethod( - Invocation.method( - #writeString, - [value], - { - #writeByteCount: writeByteCount, - #encoder: encoder, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method( + #writeString, + [value], + {#writeByteCount: writeByteCount, #encoder: encoder}, + ), + returnValueForMissingStub: null, + ); @override - void writeByteList( - List? bytes, { - bool? writeLength = true, - }) => + void writeByteList(List? bytes, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeByteList, - [bytes], - {#writeLength: writeLength}, - ), + Invocation.method(#writeByteList, [bytes], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeIntList( - List? list, { - bool? writeLength = true, - }) => + void writeIntList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeIntList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeIntList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeDoubleList( - List? list, { - bool? writeLength = true, - }) => + void writeDoubleList(List? list, {bool? writeLength = true}) => super.noSuchMethod( Invocation.method( #writeDoubleList, @@ -389,16 +280,9 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { ); @override - void writeBoolList( - List? list, { - bool? writeLength = true, - }) => + void writeBoolList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeBoolList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeBoolList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @@ -407,44 +291,26 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { List? list, { bool? writeLength = true, _i5.Converter>? encoder = const _i5.Utf8Encoder(), - }) => - super.noSuchMethod( - Invocation.method( - #writeStringList, - [list], - { - #writeLength: writeLength, - #encoder: encoder, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method( + #writeStringList, + [list], + {#writeLength: writeLength, #encoder: encoder}, + ), + returnValueForMissingStub: null, + ); @override - void writeList( - List? list, { - bool? writeLength = true, - }) => + void writeList(List? list, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeList, - [list], - {#writeLength: writeLength}, - ), + Invocation.method(#writeList, [list], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @override - void writeMap( - Map? map, { - bool? writeLength = true, - }) => + void writeMap(Map? map, {bool? writeLength = true}) => super.noSuchMethod( - Invocation.method( - #writeMap, - [map], - {#writeLength: writeLength}, - ), + Invocation.method(#writeMap, [map], {#writeLength: writeLength}), returnValueForMissingStub: null, ); @@ -452,27 +318,14 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeHiveList( _i3.HiveList<_i1.HiveObjectMixin>? list, { bool? writeLength = true, - }) => - super.noSuchMethod( - Invocation.method( - #writeHiveList, - [list], - {#writeLength: writeLength}, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#writeHiveList, [list], {#writeLength: writeLength}), + returnValueForMissingStub: null, + ); @override - void write( - T? value, { - bool? writeTypeId = true, - }) => - super.noSuchMethod( - Invocation.method( - #write, - [value], - {#writeTypeId: writeTypeId}, - ), - returnValueForMissingStub: null, - ); + void write(T? value, {bool? writeTypeId = true}) => super.noSuchMethod( + Invocation.method(#write, [value], {#writeTypeId: writeTypeId}), + returnValueForMissingStub: null, + ); } diff --git a/test/price_test.dart b/test/price_test.dart index e44e6b3a63..e7a8b401a4 100644 --- a/test/price_test.dart +++ b/test/price_test.dart @@ -4,7 +4,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'package:hive_test/hive_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; @@ -21,85 +21,94 @@ void main() { await Hive.openBox(DB.boxNamePriceCache); await Hive.openBox(DB.boxNamePrefs); await DB.instance.put( - boxName: DB.boxNamePrefs, key: "externalCalls", value: true); + boxName: DB.boxNamePrefs, + key: "externalCalls", + value: true, + ); }); test("getPricesAnd24hChange fetch", () async { final client = MockHTTP(); - when(client.get( + when( + client.get( proxyInfo: null, url: 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,nano,banano,stellar,tezos,xelis" - "&order=market_cap_desc&per_page=50" - "&page=1&sparkline=false"), - headers: { - 'Content-Type': 'application/json' - })).thenAnswer((_) async => Response( + "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,nano,banano,stellar,tezos,xelis" + "&order=market_cap_desc&per_page=50" + "&page=1&sparkline=false", + ), + headers: {'Content-Type': 'application/json'}, + ), + ).thenAnswer( + (_) async => Response( utf8.encode( - '[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://asse' - 'ts.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","curr' - 'ent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_dil' - 'uted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"low' - '_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0.0,' - '"market_cap_change_24h":950.0,"market_cap_change_percentage_24h":0.0' - '0497,"circulating_supply":19128800.0,"total_supply":21000000.0,"max' - '_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32896' - ',"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_change_' - 'percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi":nul' - 'l,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","symb' - 'ol":"doge","name":"Dogecoin","image":"https://assets.coingecko.com/' - 'coins/images/5/large/dogecoin.png?1547792256","current_price":3.15e' - '-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_valuati' - 'on":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.13e-0' - '6,"price_change_24h":-8.6889947714e-08,"price_change_percentage_24h' - '":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_cap_c' - 'hange_percentage_24h":-2.64879,"circulating_supply":132670764299.89' - '4,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_change' - '_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","atl":' - '1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"2020-12-' - '17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:15.11' - '3Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"https:/' - '/assets.coingecko.com/coins/images/69/large/monero_logo.png?1547033' - '729","current_price":0.00717236,"market_cap":130002,"market_cap_ran' - 'k":29,"fully_diluted_valuation":null,"total_volume":4901,"high_24h":' - '0.00731999,"low_24h":0.00707511,"price_change_24h":-5.6133543212467' - 'e-05,"price_change_percentage_24h":-0.77656,"market_cap_change_24h"' - ':-1007.8447677436197,"market_cap_change_percentage_24h":-0.76929,"c' - 'irculating_supply":18147820.3764146,"total_supply":null,"max_supply' - '":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"ath_date' - '":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_percentag' - 'e":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":null,"las' - 't_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo' - '","name":"Firo","image":"https://assets.coingecko.com/coins/images/' - '479/large/firocoingecko.png?1636537544","current_price":0.0001096,"' - 'market_cap":1252,"market_cap_rank":604,"fully_diluted_valuation":234' - '9,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,' - '"price_change_24h":-9.87561775002e-07,"price_change_percentage_24h' - '":-0.89304,"market_cap_change_24h":-10.046635178462793,"market_cap_' - 'change_percentage_24h":-0.79578,"circulating_supply":11411043.83546' - '97,"total_supply":21400000.0,"max_supply":21400000.0,"ath":0.016162' - '72,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.' - '408Z","atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"' - '2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16' - ':38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",' - '"image":"https://assets.coingecko.com/coins/images/9520/large/Epic_C' - 'oin_NO_drop_shadow.png?1620122642","current_price":2.803e-05,"marke' - 't_cap":415.109,"market_cap_rank":953,"fully_diluted_valuation":null' - ',"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":2.581e-05' - ',"price_change_24h":1.9e-06,"price_change_percentage_24h":7.27524,"' - 'market_cap_change_24h":28.26753,"market_cap_change_percentage_24h":' - '7.30726,"circulating_supply":14808052.0,"total_supply":21000000.0,"' - 'max_supply":null,"ath":0.00013848,"ath_change_percentage":-79.75864' - ',"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-07,"atl_chang' - 'e_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01.177Z","roi' - '":null,"last_updated":"2022-08-22T16:38:32.826Z"},{"id":"xelis","sy' - 'mbol":"xel","name":"Xelis","image":"https://assets.coingecko.com/co' - 'ins/images/37615/large/green_background_black_logo.png","current_pr' - 'ice":0.00001234,"price_change_percentage_24h":5.67}]'), - 200)); + '[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://asse' + 'ts.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","curr' + 'ent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_dil' + 'uted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"low' + '_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0.0,' + '"market_cap_change_24h":950.0,"market_cap_change_percentage_24h":0.0' + '0497,"circulating_supply":19128800.0,"total_supply":21000000.0,"max' + '_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32896' + ',"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_change_' + 'percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi":nul' + 'l,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","symb' + 'ol":"doge","name":"Dogecoin","image":"https://assets.coingecko.com/' + 'coins/images/5/large/dogecoin.png?1547792256","current_price":3.15e' + '-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_valuati' + 'on":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.13e-0' + '6,"price_change_24h":-8.6889947714e-08,"price_change_percentage_24h' + '":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_cap_c' + 'hange_percentage_24h":-2.64879,"circulating_supply":132670764299.89' + '4,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_change' + '_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","atl":' + '1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"2020-12-' + '17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:15.11' + '3Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"https:/' + '/assets.coingecko.com/coins/images/69/large/monero_logo.png?1547033' + '729","current_price":0.00717236,"market_cap":130002,"market_cap_ran' + 'k":29,"fully_diluted_valuation":null,"total_volume":4901,"high_24h":' + '0.00731999,"low_24h":0.00707511,"price_change_24h":-5.6133543212467' + 'e-05,"price_change_percentage_24h":-0.77656,"market_cap_change_24h"' + ':-1007.8447677436197,"market_cap_change_percentage_24h":-0.76929,"c' + 'irculating_supply":18147820.3764146,"total_supply":null,"max_supply' + '":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"ath_date' + '":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_percentag' + 'e":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":null,"las' + 't_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo' + '","name":"Firo","image":"https://assets.coingecko.com/coins/images/' + '479/large/firocoingecko.png?1636537544","current_price":0.0001096,"' + 'market_cap":1252,"market_cap_rank":604,"fully_diluted_valuation":234' + '9,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,' + '"price_change_24h":-9.87561775002e-07,"price_change_percentage_24h' + '":-0.89304,"market_cap_change_24h":-10.046635178462793,"market_cap_' + 'change_percentage_24h":-0.79578,"circulating_supply":11411043.83546' + '97,"total_supply":21400000.0,"max_supply":21400000.0,"ath":0.016162' + '72,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.' + '408Z","atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"' + '2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16' + ':38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",' + '"image":"https://assets.coingecko.com/coins/images/9520/large/Epic_C' + 'oin_NO_drop_shadow.png?1620122642","current_price":2.803e-05,"marke' + 't_cap":415.109,"market_cap_rank":953,"fully_diluted_valuation":null' + ',"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":2.581e-05' + ',"price_change_24h":1.9e-06,"price_change_percentage_24h":7.27524,"' + 'market_cap_change_24h":28.26753,"market_cap_change_percentage_24h":' + '7.30726,"circulating_supply":14808052.0,"total_supply":21000000.0,"' + 'max_supply":null,"ath":0.00013848,"ath_change_percentage":-79.75864' + ',"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-07,"atl_chang' + 'e_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01.177Z","roi' + '":null,"last_updated":"2022-08-22T16:38:32.826Z"},{"id":"xelis","sy' + 'mbol":"xel","name":"Xelis","image":"https://assets.coingecko.com/co' + 'ins/images/37615/large/green_background_black_logo.png","current_pr' + 'ice":0.00001234,"price_change_percentage_24h":5.67}]', + ), + 200, + ), + ); final priceAPI = PriceAPI(client); priceAPI.resetLastCalledToForceNextCallToUpdateCache(); @@ -134,7 +143,8 @@ void main() { 'Coin.xelis: [0.00001234, 5.67]' '}', ); - verify(client.get( + verify( + client.get( proxyInfo: null, url: Uri.parse( "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc" @@ -143,7 +153,9 @@ void main() { ",tezos,xelis" "&order=market_cap_desc&per_page=50&page=1&sparkline=false", ), - headers: {'Content-Type': 'application/json'})).called(1); + headers: {'Content-Type': 'application/json'}, + ), + ).called(1); verifyNoMoreInteractions(client); }); @@ -151,79 +163,85 @@ void main() { test("cached price fetch", () async { final client = MockHTTP(); - when(client.get( + when( + client.get( proxyInfo: null, url: 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,nano,banano,stellar" - ",tezos,xelis" - "&order=market_cap_desc&per_page=50&page=1&sparkline=false"), - headers: { - 'Content-Type': 'application/json' - })).thenAnswer((_) async => Response( + "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,nano,banano,stellar" + ",tezos,xelis" + "&order=market_cap_desc&per_page=50&page=1&sparkline=false", + ), + headers: {'Content-Type': 'application/json'}, + ), + ).thenAnswer( + (_) async => Response( utf8.encode( - '[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://a' - 'ssets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","c' - 'urrent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_' - 'diluted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"' - 'low_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0' - '.0,"market_cap_change_24h":950.0,"market_cap_change_percentage_24h"' - ':0.00497,"circulating_supply":19128800.0,"total_supply":21000000.0,"' - 'max_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32' - '896,"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_cha' - 'nge_percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi"' - ':null,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","' - 'symbol":"doge","name":"Dogecoin","image":"https://assets.coingecko.' - 'com/coins/images/5/large/dogecoin.png?1547792256","current_price":3' - '.15e-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_val' - 'uation":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.1' - '3e-06,"price_change_24h":-8.6889947714e-08,"price_change_percentage' - '_24h":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_' - 'cap_change_percentage_24h":-2.64879,"circulating_supply":1326707642' - '99.894,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_c' - 'hange_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","' - 'atl":1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"202' - '0-12-17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:' - '15.113Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"ht' - 'tps://assets.coingecko.com/coins/images/69/large/monero_logo.png?15' - '47033729","current_price":0.00717236,"market_cap":130002,"market_cap' - '_rank":29,"fully_diluted_valuation":null,"total_volume":4901,"high' - '_24h":0.00731999,"low_24h":0.00707511,"price_change_24h":-5.613354' - '3212467e-05,"price_change_percentage_24h":-0.77656,"market_cap_chan' - 'ge_24h":-1007.8447677436197,"market_cap_change_percentage_24h":-0.7' - '6929,"circulating_supply":18147820.3764146,"total_supply":null,"ma' - 'x_supply":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"' - 'ath_date":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_' - 'percentage":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":n' - 'ull,"last_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbo' - 'l":"firo","name":"Firo","image":"https://assets.coingecko.com/coins' - '/images/479/large/firocoingecko.png?1636537544","current_price":0.0' - '001096,"market_cap":1252,"market_cap_rank":604,"fully_diluted_valu' - 'ation":2349,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0' - '.00010834,"price_change_24h":-9.87561775002e-07,"price_change_perce' - 'ntage_24h":-0.89304,"market_cap_change_24h":-10.046635178462793,"ma' - 'rket_cap_change_percentage_24h":-0.79578,"circulating_supply":11411' - '043.8354697,"total_supply":21400000.0,"max_supply":21400000.0,"ath"' - ':0.01616272,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04' - 'T16:04:48.408Z","atl":4.268e-05,"atl_change_percentage":157.22799,' - '"atl_date":"2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2' - '022-08-22T16:38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"' - 'Epic Cash","image":"https://assets.coingecko.com/coins/images/9520/' - 'large/Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.80' - '3e-05,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_val' - 'uation":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h' - '":2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24' - 'h":7.27524,"market_cap_change_24h":28.26753,"market_cap_change_perc' - 'entage_24h":7.30726,"circulating_supply":14808052.0,"total_supply":' - '21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_percentag' - 'e":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-0' - '7,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01' - '.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"},{"id":' - '"xelis","symbol":"xel","name":"Xelis","image":"https://assets.coing' - 'ecko.com/coins/images/37615/large/green_background_black_logo.png",' - '"current_price":0.00001234,"price_change_percentage_24h":5.67}]'), - 200)); + '[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://a' + 'ssets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","c' + 'urrent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_' + 'diluted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"' + 'low_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0' + '.0,"market_cap_change_24h":950.0,"market_cap_change_percentage_24h"' + ':0.00497,"circulating_supply":19128800.0,"total_supply":21000000.0,"' + 'max_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32' + '896,"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_cha' + 'nge_percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi"' + ':null,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","' + 'symbol":"doge","name":"Dogecoin","image":"https://assets.coingecko.' + 'com/coins/images/5/large/dogecoin.png?1547792256","current_price":3' + '.15e-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_val' + 'uation":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.1' + '3e-06,"price_change_24h":-8.6889947714e-08,"price_change_percentage' + '_24h":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_' + 'cap_change_percentage_24h":-2.64879,"circulating_supply":1326707642' + '99.894,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_c' + 'hange_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","' + 'atl":1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"202' + '0-12-17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:' + '15.113Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"ht' + 'tps://assets.coingecko.com/coins/images/69/large/monero_logo.png?15' + '47033729","current_price":0.00717236,"market_cap":130002,"market_cap' + '_rank":29,"fully_diluted_valuation":null,"total_volume":4901,"high' + '_24h":0.00731999,"low_24h":0.00707511,"price_change_24h":-5.613354' + '3212467e-05,"price_change_percentage_24h":-0.77656,"market_cap_chan' + 'ge_24h":-1007.8447677436197,"market_cap_change_percentage_24h":-0.7' + '6929,"circulating_supply":18147820.3764146,"total_supply":null,"ma' + 'x_supply":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"' + 'ath_date":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_' + 'percentage":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":n' + 'ull,"last_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbo' + 'l":"firo","name":"Firo","image":"https://assets.coingecko.com/coins' + '/images/479/large/firocoingecko.png?1636537544","current_price":0.0' + '001096,"market_cap":1252,"market_cap_rank":604,"fully_diluted_valu' + 'ation":2349,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0' + '.00010834,"price_change_24h":-9.87561775002e-07,"price_change_perce' + 'ntage_24h":-0.89304,"market_cap_change_24h":-10.046635178462793,"ma' + 'rket_cap_change_percentage_24h":-0.79578,"circulating_supply":11411' + '043.8354697,"total_supply":21400000.0,"max_supply":21400000.0,"ath"' + ':0.01616272,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04' + 'T16:04:48.408Z","atl":4.268e-05,"atl_change_percentage":157.22799,' + '"atl_date":"2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2' + '022-08-22T16:38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"' + 'Epic Cash","image":"https://assets.coingecko.com/coins/images/9520/' + 'large/Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.80' + '3e-05,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_val' + 'uation":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h' + '":2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24' + 'h":7.27524,"market_cap_change_24h":28.26753,"market_cap_change_perc' + 'entage_24h":7.30726,"circulating_supply":14808052.0,"total_supply":' + '21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_percentag' + 'e":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-0' + '7,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01' + '.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"},{"id":' + '"xelis","symbol":"xel","name":"Xelis","image":"https://assets.coing' + 'ecko.com/coins/images/37615/large/green_background_black_logo.png",' + '"current_price":0.00001234,"price_change_percentage_24h":5.67}]', + ), + 200, + ), + ); final priceAPI = PriceAPI(client); priceAPI.resetLastCalledToForceNextCallToUpdateCache(); @@ -232,8 +250,9 @@ void main() { await priceAPI.getPricesAnd24hChange(baseCurrency: "btc"); // now this time it should grab from cache instead of http.get - final cachedPrice = - await priceAPI.getPricesAnd24hChange(baseCurrency: "btc"); + final cachedPrice = await priceAPI.getPricesAnd24hChange( + baseCurrency: "btc", + ); expect( cachedPrice.toString(), @@ -262,15 +281,19 @@ void main() { ); // verify only called once during filling of cache - verify(client.get( + verify( + client.get( proxyInfo: null, url: 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,nano,banano,stellar" - ",tezos,xelis" - "&order=market_cap_desc&per_page=50&page=1&sparkline=false"), - headers: {'Content-Type': 'application/json'})).called(1); + "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,nano,banano,stellar" + ",tezos,xelis" + "&order=market_cap_desc&per_page=50&page=1&sparkline=false", + ), + headers: {'Content-Type': 'application/json'}, + ), + ).called(1); verifyNoMoreInteractions(client); }); @@ -278,79 +301,85 @@ void main() { test("response parse failure", () async { final client = MockHTTP(); - when(client.get( + when( + client.get( proxyInfo: null, url: 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,nano,banano,stellar" - ",tezos,xelis" - "&order=market_cap_desc&per_page=50&page=1&sparkline=false"), - headers: { - 'Content-Type': 'application/json' - })).thenAnswer((_) async => Response( + "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,nano,banano,stellar" + ",tezos,xelis" + "&order=market_cap_desc&per_page=50&page=1&sparkline=false", + ), + headers: {'Content-Type': 'application/json'}, + ), + ).thenAnswer( + (_) async => Response( utf8.encode( - '[{"id":"bitcoin","symbol":"btc","name":com/coins/images/1/large/' - 'bitcoin.png?1547033579","current_price":1.0,"market_cap":19128800' - ',"market_cap_rank":1,"fully_diluted_valuation":21000000,"total_volum' - 'e":1272132,"high_24h":1.0,"low_24h":1.0,"price_change_24h":0.0,"pri' - 'ce_change_percentage_24h":0.0,"market_cap_change_24h":950.0,"market_' - 'cap_change_percentage_24h":0.00497,"circulating_supply":19128800.0,"t' - 'otal_supply":21000000.0,"max_supply":21000000.0,"ath":1.003301,"ath' - '_change_percentage":-0.32896,"ath_date":"2019-10-15T16:00:56.136Z",' - '"atl":0.99895134,"atl_change_percentage":0.10498,"atl_date":' - '"2019-10-21T00:00:00.000Z","roi":null,' - '"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin"' - ',"symbol":"doge","name":"Dogecoin","image":' - '"https://assets.coingecko.com/coins/images/5/large/dogecoin.png?1547792256",' - '"current_price":3.15e-06,"market_cap":417916,"market_cap_rank":10' - ',"fully_diluted_valuation":null,"total_volume":27498,"high_24h":3' - '.26e-06,"low_24h":3.13e-06,"price_change_24h":-8.6889947714e-08,"' - 'price_change_percentage_24h":-2.68533,"market_cap_change_24h":-11' - '370.894861206936,"market_cap_change_percentage_24h":-2.64879,"cir' - 'culating_supply":132670764299.894,"total_supply":null,"max_supply' - '":null,"ath":1.264e-05,"ath_change_percentage":-75.05046,"ath_date' - '":"2021-05-07T23:04:53.026Z","atl":1.50936e-07,"atl_change_percen' - 'tage":1989.69346,"atl_date":"2020-12-17T09:18:05.654Z","roi":null,' - '"last_updated":"2022-08-22T16:38:15.113Z"},{"id":"monero","symbol"' - ':"xmr","name":"Monero","image":"https://assets.coingecko.com/coins' - '/images/69/large/monero_logo.png?1547033729","current_price":0.007' - '17236,"market_cap":130002,"market_cap_rank":29,"fully_diluted_valu' - 'ation":null,"total_volume":4901,"high_24h":0.00731999,"low_24h":0.' - '00707511,"price_change_24h":-5.6133543212467e-05,"price_change_per' - 'centage_24h":-0.77656,"market_cap_change_24h":-1007.8447677436197' - ',"market_cap_change_percentage_24h":-0.76929,"circulating_supply":' - '18147820.3764146,"total_supply":null,"max_supply":null,"ath":0.034' - '75393,"ath_change_percentage":-79.32037,"ath_date":"2018-01-09T00:' - '00:00.000Z","atl":0.00101492,"atl_change_percentage":608.13327,"at' - 'l_date":"2014-12-18T00:00:00.000Z","roi":null,"last_updated":"2022' - '-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo","name":"Firo"' - ',"image":"https://assets.coingecko.com/coins/images/479/large/firo' - 'coingecko.png?1636537544","current_price":0.0001096,"market_cap":1' - '252,"market_cap_rank":604,"fully_diluted_valuation":2349,"total_vo' - 'lume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,"price_chang' - 'e_24h":-9.87561775002e-07,"price_change_percentage_24h":-0.89304,' - '"market_cap_change_24h":-10.046635178462793,"market_cap_change_per' - 'centage_24h":-0.79578,"circulating_supply":11411043.8354697,"tota' - 'l_supply":21400000.0,"max_supply":21400000.0,"ath":0.01616272,"ath' - '_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.408Z"' - ',"atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"202' - '2-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16:3' - '8:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",' - '"image":"https://assets.coingecko.com/coins/images/9520/large/' - 'Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.803e-0' - '5,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_valuat' - 'ion":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":' - '2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24h"' - ':7.27524,"market_cap_change_24h":28.26753,"market_cap_change_per' - 'centage_24h":7.30726,"circulating_supply":14808052.0,"total_suppl' - 'y":21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_perce' - 'ntage":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74' - '028e-07,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T' - '16:55:01.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"' - '},{"id":"xelis","symbol":xel,"name":com/coins/images/37615/large/g' - 'reen_background_black_logo.png,"image":"https://assets.coingecko'), - 200)); + '[{"id":"bitcoin","symbol":"btc","name":com/coins/images/1/large/' + 'bitcoin.png?1547033579","current_price":1.0,"market_cap":19128800' + ',"market_cap_rank":1,"fully_diluted_valuation":21000000,"total_volum' + 'e":1272132,"high_24h":1.0,"low_24h":1.0,"price_change_24h":0.0,"pri' + 'ce_change_percentage_24h":0.0,"market_cap_change_24h":950.0,"market_' + 'cap_change_percentage_24h":0.00497,"circulating_supply":19128800.0,"t' + 'otal_supply":21000000.0,"max_supply":21000000.0,"ath":1.003301,"ath' + '_change_percentage":-0.32896,"ath_date":"2019-10-15T16:00:56.136Z",' + '"atl":0.99895134,"atl_change_percentage":0.10498,"atl_date":' + '"2019-10-21T00:00:00.000Z","roi":null,' + '"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin"' + ',"symbol":"doge","name":"Dogecoin","image":' + '"https://assets.coingecko.com/coins/images/5/large/dogecoin.png?1547792256",' + '"current_price":3.15e-06,"market_cap":417916,"market_cap_rank":10' + ',"fully_diluted_valuation":null,"total_volume":27498,"high_24h":3' + '.26e-06,"low_24h":3.13e-06,"price_change_24h":-8.6889947714e-08,"' + 'price_change_percentage_24h":-2.68533,"market_cap_change_24h":-11' + '370.894861206936,"market_cap_change_percentage_24h":-2.64879,"cir' + 'culating_supply":132670764299.894,"total_supply":null,"max_supply' + '":null,"ath":1.264e-05,"ath_change_percentage":-75.05046,"ath_date' + '":"2021-05-07T23:04:53.026Z","atl":1.50936e-07,"atl_change_percen' + 'tage":1989.69346,"atl_date":"2020-12-17T09:18:05.654Z","roi":null,' + '"last_updated":"2022-08-22T16:38:15.113Z"},{"id":"monero","symbol"' + ':"xmr","name":"Monero","image":"https://assets.coingecko.com/coins' + '/images/69/large/monero_logo.png?1547033729","current_price":0.007' + '17236,"market_cap":130002,"market_cap_rank":29,"fully_diluted_valu' + 'ation":null,"total_volume":4901,"high_24h":0.00731999,"low_24h":0.' + '00707511,"price_change_24h":-5.6133543212467e-05,"price_change_per' + 'centage_24h":-0.77656,"market_cap_change_24h":-1007.8447677436197' + ',"market_cap_change_percentage_24h":-0.76929,"circulating_supply":' + '18147820.3764146,"total_supply":null,"max_supply":null,"ath":0.034' + '75393,"ath_change_percentage":-79.32037,"ath_date":"2018-01-09T00:' + '00:00.000Z","atl":0.00101492,"atl_change_percentage":608.13327,"at' + 'l_date":"2014-12-18T00:00:00.000Z","roi":null,"last_updated":"2022' + '-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo","name":"Firo"' + ',"image":"https://assets.coingecko.com/coins/images/479/large/firo' + 'coingecko.png?1636537544","current_price":0.0001096,"market_cap":1' + '252,"market_cap_rank":604,"fully_diluted_valuation":2349,"total_vo' + 'lume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,"price_chang' + 'e_24h":-9.87561775002e-07,"price_change_percentage_24h":-0.89304,' + '"market_cap_change_24h":-10.046635178462793,"market_cap_change_per' + 'centage_24h":-0.79578,"circulating_supply":11411043.8354697,"tota' + 'l_supply":21400000.0,"max_supply":21400000.0,"ath":0.01616272,"ath' + '_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.408Z"' + ',"atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"202' + '2-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16:3' + '8:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",' + '"image":"https://assets.coingecko.com/coins/images/9520/large/' + 'Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.803e-0' + '5,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_valuat' + 'ion":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":' + '2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24h"' + ':7.27524,"market_cap_change_24h":28.26753,"market_cap_change_per' + 'centage_24h":7.30726,"circulating_supply":14808052.0,"total_suppl' + 'y":21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_perce' + 'ntage":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74' + '028e-07,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T' + '16:55:01.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"' + '},{"id":"xelis","symbol":xel,"name":com/coins/images/37615/large/g' + 'reen_background_black_logo.png,"image":"https://assets.coingecko', + ), + 200, + ), + ); final priceAPI = PriceAPI(client); priceAPI.resetLastCalledToForceNextCallToUpdateCache(); @@ -389,18 +418,23 @@ void main() { test("no internet available", () async { final client = MockHTTP(); - when(client.get( + when( + client.get( proxyInfo: null, url: 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,nano,banano,stellar" - ",tezos,xelis" - "&order=market_cap_desc&per_page=50&page=1&sparkline=false"), - headers: { - 'Content-Type': 'application/json' - })).thenThrow(const SocketException( - "Failed host lookup: 'api.com' (OS Error: Temporary failure in name resolution, errno = -3)")); + "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,nano,banano,stellar" + ",tezos,xelis" + "&order=market_cap_desc&per_page=50&page=1&sparkline=false", + ), + headers: {'Content-Type': 'application/json'}, + ), + ).thenThrow( + const SocketException( + "Failed host lookup: 'api.com' (OS Error: Temporary failure in name resolution, errno = -3)", + ), + ); final priceAPI = PriceAPI(client); priceAPI.resetLastCalledToForceNextCallToUpdateCache(); diff --git a/test/services/coins/firo/firo_wallet_test.dart b/test/services/coins/firo/firo_wallet_test.dart index ec2f5bd14e..3edbd52f11 100644 --- a/test/services/coins/firo/firo_wallet_test.dart +++ b/test/services/coins/firo/firo_wallet_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'package:hive_test/hive_test.dart'; import 'package:mockito/annotations.dart'; diff --git a/test/services/coins/monero/monero_wallet_test.dart b/test/services/coins/monero/monero_wallet_test.dart index d33c1b4604..400c35a468 100644 --- a/test/services/coins/monero/monero_wallet_test.dart +++ b/test/services/coins/monero/monero_wallet_test.dart @@ -17,7 +17,7 @@ import 'dart:core'; // import 'package:flutter_libmonero/core/wallet_creation_service.dart'; // import 'package:flutter_libmonero/monero/monero.dart'; // import 'package:flutter_test/flutter_test.dart'; -// import 'package:hive/hive.dart'; +// import 'package:hive_ce/hive.dart'; // import 'package:hive_test/hive_test.dart'; // import 'package:path_provider/path_provider.dart'; // import 'package:stackwallet/services/wallets.dart'; diff --git a/test/services/coins/wownero/wownero_wallet_test.dart b/test/services/coins/wownero/wownero_wallet_test.dart index a14fbf3ad4..ca9b978bad 100644 --- a/test/services/coins/wownero/wownero_wallet_test.dart +++ b/test/services/coins/wownero/wownero_wallet_test.dart @@ -17,7 +17,7 @@ import 'dart:core'; // import 'package:flutter_libmonero/core/wallet_creation_service.dart'; // import 'package:flutter_libmonero/wownero/wownero.dart'; // import 'package:flutter_test/flutter_test.dart'; -// import 'package:hive/hive.dart'; +// import 'package:hive_ce/hive.dart'; // import 'package:hive_test/hive_test.dart'; // import 'package:path_provider/path_provider.dart'; // import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; diff --git a/test/services/node_service_test.dart b/test/services/node_service_test.dart index 9a80477bf0..8d4d664a43 100644 --- a/test/services/node_service_test.dart +++ b/test/services/node_service_test.dart @@ -1,7 +1,7 @@ // TODO MWC import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_ce/hive.dart'; import 'package:hive_test/hive_test.dart'; import 'package:stackwallet/app_config.dart'; import 'package:stackwallet/db/hive/db.dart'; @@ -242,8 +242,9 @@ void main() { final fakeStore = FakeSecureStorage(); final service = NodeService(secureStorageInterface: fakeStore); final nodes = service.nodes; - final defaults = - AppConfig.coins.map((e) => e.defaultNode(isPrimary: true)).toList(); + final defaults = AppConfig.coins + .map((e) => e.defaultNode(isPrimary: true)) + .toList(); nodes.sort((a, b) => a.id.compareTo(b.id)); defaults.sort((a, b) => a.id.compareTo(b.id)); From 2107198f01c70ada0e47d00aa88df22c3854018d Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 12:23:40 -0600 Subject: [PATCH 110/178] update generations --- lib/db/drift/database.g.dart | 885 +- .../exchange/response_objects/trade.g.dart | 2 +- .../isar/exchange_cache/currency.g.dart | 1614 +- lib/models/isar/exchange_cache/pair.g.dart | 930 +- lib/models/isar/models/address_label.g.dart | 1097 +- lib/models/isar/models/block_explorer.g.dart | 806 +- .../models/blockchain_data/address.g.dart | 1413 +- .../isar/models/blockchain_data/input.g.dart | 878 +- .../isar/models/blockchain_data/output.g.dart | 651 +- .../models/blockchain_data/transaction.g.dart | 2010 +- .../isar/models/blockchain_data/utxo.g.dart | 1853 +- .../models/blockchain_data/v2/input_v2.g.dart | 1470 +- .../blockchain_data/v2/output_v2.g.dart | 681 +- .../blockchain_data/v2/transaction_v2.g.dart | 2619 +- lib/models/isar/models/contact_entry.g.dart | 1456 +- .../isar/models/encrypted_string_value.g.dart | 707 +- .../isar/models/ethereum/eth_contract.g.dart | 912 +- lib/models/isar/models/log.g.dart | 544 +- lib/models/isar/models/sent_to_address.g.dart | 992 +- .../isar/models/transaction_note.g.dart | 849 +- lib/models/isar/ordinal.g.dart | 1196 +- lib/models/isar/stack_theme.g.dart | 28895 ++++++++-------- .../isar/models/frost_wallet_info.g.dart | 1047 +- lib/wallets/isar/models/spark_coin.g.dart | 2539 +- .../isar/models/token_wallet_info.g.dart | 919 +- lib/wallets/isar/models/wallet_info.g.dart | 1999 +- .../isar/models/wallet_info_meta.g.dart | 376 +- test/cached_electrumx_test.mocks.dart | 1756 +- ...r_secure_storage_interface_test.mocks.dart | 319 +- .../lelantus_coin_adapter_test.mocks.dart | 50 +- ...transactions_model_adapter_test.mocks.dart | 50 +- .../utxo_model_adapter_test.mocks.dart | 50 +- .../notification_card_test.mocks.dart | 184 +- .../pages/send_view/send_view_test.mocks.dart | 1582 +- test/price_test.mocks.dart | 83 +- .../address_book_view_screen_test.mocks.dart | 157 +- ...d_address_book_view_screen_test.mocks.dart | 189 +- ..._entry_details_view_screen_test.mocks.dart | 240 +- ...ess_book_entry_view_screen_test.mocks.dart | 157 +- .../exchange/exchange_view_test.mocks.dart | 1556 +- .../lockscreen_view_screen_test.mocks.dart | 298 +- .../main_view_screen_testA_test.mocks.dart | 132 +- .../main_view_screen_testB_test.mocks.dart | 132 +- .../main_view_screen_testC_test.mocks.dart | 132 +- ...up_key_warning_view_screen_test.mocks.dart | 57 +- .../create_pin_view_screen_test.mocks.dart | 298 +- ...me_your_wallet_view_screen_test.mocks.dart | 57 +- ...restore_wallet_view_screen_test.mocks.dart | 326 +- ...dd_custom_node_view_screen_test.mocks.dart | 249 +- .../node_details_view_screen_test.mocks.dart | 249 +- ...twork_settings_view_screen_test.mocks.dart | 249 +- .../change_pin_view_screen_test.mocks.dart | 57 +- .../rename_wallet_view_screen_test.mocks.dart | 57 +- ...elete_mnemonic_view_screen_test.mocks.dart | 57 +- ...allet_settings_view_screen_test.mocks.dart | 259 +- .../settings_view_screen_test.mocks.dart | 57 +- ...action_details_view_screen_test.mocks.dart | 240 +- ...search_results_view_screen_test.mocks.dart | 79 +- ...saction_search_view_screen_test.mocks.dart | 157 +- .../send_view_screen_test.mocks.dart | 36 +- .../wallet_view_screen_test.mocks.dart | 79 +- .../change_now/change_now_test.mocks.dart | 83 +- .../bitcoin/bitcoin_wallet_test.mocks.dart | 1084 +- .../bitcoincash_wallet_test.mocks.dart | 1084 +- .../dogecoin/dogecoin_wallet_test.mocks.dart | 1084 +- .../namecoin/namecoin_wallet_test.mocks.dart | 1084 +- .../particl/particl_wallet_test.mocks.dart | 1084 +- .../address_book_card_test.mocks.dart | 157 +- .../favorite_toggle_test.mocks.dart | 184 +- .../custom_loading_overlay_test.mocks.dart | 184 +- .../desktop/desktop_scaffold_test.mocks.dart | 184 +- .../managed_favorite_test.mocks.dart | 1582 +- test/widget_tests/node_card_test.mocks.dart | 249 +- .../node_options_sheet_test.mocks.dart | 1441 +- .../table_view/table_view_row_test.mocks.dart | 329 +- test/widget_tests/trade_card_test.mocks.dart | 466 +- .../transaction_card_test.mocks.dart | 2608 +- test/widget_tests/wallet_card_test.mocks.dart | 404 +- ...et_info_row_balance_future_test.mocks.dart | 408 +- .../wallet_info_row_test.mocks.dart | 582 +- 80 files changed, 41660 insertions(+), 41591 deletions(-) diff --git a/lib/db/drift/database.g.dart b/lib/db/drift/database.g.dart index 67660d3a63..dad27aa63c 100644 --- a/lib/db/drift/database.g.dart +++ b/lib/db/drift/database.g.dart @@ -12,66 +12,97 @@ class $SparkNamesTable extends SparkNames static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( - 'name', aliasedName, false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'UNIQUE NOT NULL COLLATE NOCASE'); - static const VerificationMeta _addressMeta = - const VerificationMeta('address'); + 'name', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'UNIQUE NOT NULL COLLATE NOCASE', + ); + static const VerificationMeta _addressMeta = const VerificationMeta( + 'address', + ); @override late final GeneratedColumn address = GeneratedColumn( - 'address', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true); - static const VerificationMeta _validUntilMeta = - const VerificationMeta('validUntil'); + 'address', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + static const VerificationMeta _validUntilMeta = const VerificationMeta( + 'validUntil', + ); @override late final GeneratedColumn validUntil = GeneratedColumn( - 'valid_until', aliasedName, false, - type: DriftSqlType.int, requiredDuringInsert: true); - static const VerificationMeta _additionalInfoMeta = - const VerificationMeta('additionalInfo'); + 'valid_until', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + ); + static const VerificationMeta _additionalInfoMeta = const VerificationMeta( + 'additionalInfo', + ); @override late final GeneratedColumn additionalInfo = GeneratedColumn( - 'additional_info', aliasedName, true, - type: DriftSqlType.string, requiredDuringInsert: false); + 'additional_info', + aliasedName, + true, + type: DriftSqlType.string, + requiredDuringInsert: false, + ); @override - List get $columns => - [name, address, validUntil, additionalInfo]; + List get $columns => [ + name, + address, + validUntil, + additionalInfo, + ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'spark_names'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('name')) { context.handle( - _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); + _nameMeta, + name.isAcceptableOrUnknown(data['name']!, _nameMeta), + ); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('address')) { - context.handle(_addressMeta, - address.isAcceptableOrUnknown(data['address']!, _addressMeta)); + context.handle( + _addressMeta, + address.isAcceptableOrUnknown(data['address']!, _addressMeta), + ); } else if (isInserting) { context.missing(_addressMeta); } if (data.containsKey('valid_until')) { context.handle( - _validUntilMeta, - validUntil.isAcceptableOrUnknown( - data['valid_until']!, _validUntilMeta)); + _validUntilMeta, + validUntil.isAcceptableOrUnknown(data['valid_until']!, _validUntilMeta), + ); } else if (isInserting) { context.missing(_validUntilMeta); } if (data.containsKey('additional_info')) { context.handle( + _additionalInfoMeta, + additionalInfo.isAcceptableOrUnknown( + data['additional_info']!, _additionalInfoMeta, - additionalInfo.isAcceptableOrUnknown( - data['additional_info']!, _additionalInfoMeta)); + ), + ); } return context; } @@ -82,14 +113,22 @@ class $SparkNamesTable extends SparkNames SparkName map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return SparkName( - name: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}name'])!, - address: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}address'])!, - validUntil: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}valid_until'])!, - additionalInfo: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}additional_info']), + name: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}name'], + )!, + address: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}address'], + )!, + validUntil: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}valid_until'], + )!, + additionalInfo: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}additional_info'], + ), ); } @@ -104,11 +143,12 @@ class SparkName extends DataClass implements Insertable { final String address; final int validUntil; final String? additionalInfo; - const SparkName( - {required this.name, - required this.address, - required this.validUntil, - this.additionalInfo}); + const SparkName({ + required this.name, + required this.address, + required this.validUntil, + this.additionalInfo, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; @@ -132,8 +172,10 @@ class SparkName extends DataClass implements Insertable { ); } - factory SparkName.fromJson(Map json, - {ValueSerializer? serializer}) { + factory SparkName.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return SparkName( name: serializer.fromJson(json['name']), @@ -153,24 +195,26 @@ class SparkName extends DataClass implements Insertable { }; } - SparkName copyWith( - {String? name, - String? address, - int? validUntil, - Value additionalInfo = const Value.absent()}) => - SparkName( - name: name ?? this.name, - address: address ?? this.address, - validUntil: validUntil ?? this.validUntil, - additionalInfo: - additionalInfo.present ? additionalInfo.value : this.additionalInfo, - ); + SparkName copyWith({ + String? name, + String? address, + int? validUntil, + Value additionalInfo = const Value.absent(), + }) => SparkName( + name: name ?? this.name, + address: address ?? this.address, + validUntil: validUntil ?? this.validUntil, + additionalInfo: additionalInfo.present + ? additionalInfo.value + : this.additionalInfo, + ); SparkName copyWithCompanion(SparkNamesCompanion data) { return SparkName( name: data.name.present ? data.name.value : this.name, address: data.address.present ? data.address.value : this.address, - validUntil: - data.validUntil.present ? data.validUntil.value : this.validUntil, + validUntil: data.validUntil.present + ? data.validUntil.value + : this.validUntil, additionalInfo: data.additionalInfo.present ? data.additionalInfo.value : this.additionalInfo, @@ -219,9 +263,9 @@ class SparkNamesCompanion extends UpdateCompanion { required int validUntil, this.additionalInfo = const Value.absent(), this.rowid = const Value.absent(), - }) : name = Value(name), - address = Value(address), - validUntil = Value(validUntil); + }) : name = Value(name), + address = Value(address), + validUntil = Value(validUntil); static Insertable custom({ Expression? name, Expression? address, @@ -238,12 +282,13 @@ class SparkNamesCompanion extends UpdateCompanion { }); } - SparkNamesCompanion copyWith( - {Value? name, - Value? address, - Value? validUntil, - Value? additionalInfo, - Value? rowid}) { + SparkNamesCompanion copyWith({ + Value? name, + Value? address, + Value? validUntil, + Value? additionalInfo, + Value? rowid, + }) { return SparkNamesCompanion( name: name ?? this.name, address: address ?? this.address, @@ -293,103 +338,158 @@ class $MwebUtxosTable extends MwebUtxos final GeneratedDatabase attachedDatabase; final String? _alias; $MwebUtxosTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _outputIdMeta = - const VerificationMeta('outputId'); + static const VerificationMeta _outputIdMeta = const VerificationMeta( + 'outputId', + ); @override late final GeneratedColumn outputId = GeneratedColumn( - 'output_id', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true); - static const VerificationMeta _addressMeta = - const VerificationMeta('address'); + 'output_id', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + static const VerificationMeta _addressMeta = const VerificationMeta( + 'address', + ); @override late final GeneratedColumn address = GeneratedColumn( - 'address', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true); + 'address', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); static const VerificationMeta _valueMeta = const VerificationMeta('value'); @override late final GeneratedColumn value = GeneratedColumn( - 'value', aliasedName, false, - type: DriftSqlType.int, requiredDuringInsert: true); + 'value', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + ); static const VerificationMeta _heightMeta = const VerificationMeta('height'); @override late final GeneratedColumn height = GeneratedColumn( - 'height', aliasedName, false, - type: DriftSqlType.int, requiredDuringInsert: true); - static const VerificationMeta _blockTimeMeta = - const VerificationMeta('blockTime'); + 'height', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + ); + static const VerificationMeta _blockTimeMeta = const VerificationMeta( + 'blockTime', + ); @override late final GeneratedColumn blockTime = GeneratedColumn( - 'block_time', aliasedName, false, - type: DriftSqlType.int, requiredDuringInsert: true); - static const VerificationMeta _blockedMeta = - const VerificationMeta('blocked'); + 'block_time', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + ); + static const VerificationMeta _blockedMeta = const VerificationMeta( + 'blocked', + ); @override late final GeneratedColumn blocked = GeneratedColumn( - 'blocked', aliasedName, false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('CHECK ("blocked" IN (0, 1))')); + 'blocked', + aliasedName, + false, + type: DriftSqlType.bool, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("blocked" IN (0, 1))', + ), + ); static const VerificationMeta _usedMeta = const VerificationMeta('used'); @override late final GeneratedColumn used = GeneratedColumn( - 'used', aliasedName, false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('CHECK ("used" IN (0, 1))')); + 'used', + aliasedName, + false, + type: DriftSqlType.bool, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("used" IN (0, 1))', + ), + ); @override - List get $columns => - [outputId, address, value, height, blockTime, blocked, used]; + List get $columns => [ + outputId, + address, + value, + height, + blockTime, + blocked, + used, + ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'mweb_utxos'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('output_id')) { - context.handle(_outputIdMeta, - outputId.isAcceptableOrUnknown(data['output_id']!, _outputIdMeta)); + context.handle( + _outputIdMeta, + outputId.isAcceptableOrUnknown(data['output_id']!, _outputIdMeta), + ); } else if (isInserting) { context.missing(_outputIdMeta); } if (data.containsKey('address')) { - context.handle(_addressMeta, - address.isAcceptableOrUnknown(data['address']!, _addressMeta)); + context.handle( + _addressMeta, + address.isAcceptableOrUnknown(data['address']!, _addressMeta), + ); } else if (isInserting) { context.missing(_addressMeta); } if (data.containsKey('value')) { context.handle( - _valueMeta, value.isAcceptableOrUnknown(data['value']!, _valueMeta)); + _valueMeta, + value.isAcceptableOrUnknown(data['value']!, _valueMeta), + ); } else if (isInserting) { context.missing(_valueMeta); } if (data.containsKey('height')) { - context.handle(_heightMeta, - height.isAcceptableOrUnknown(data['height']!, _heightMeta)); + context.handle( + _heightMeta, + height.isAcceptableOrUnknown(data['height']!, _heightMeta), + ); } else if (isInserting) { context.missing(_heightMeta); } if (data.containsKey('block_time')) { - context.handle(_blockTimeMeta, - blockTime.isAcceptableOrUnknown(data['block_time']!, _blockTimeMeta)); + context.handle( + _blockTimeMeta, + blockTime.isAcceptableOrUnknown(data['block_time']!, _blockTimeMeta), + ); } else if (isInserting) { context.missing(_blockTimeMeta); } if (data.containsKey('blocked')) { - context.handle(_blockedMeta, - blocked.isAcceptableOrUnknown(data['blocked']!, _blockedMeta)); + context.handle( + _blockedMeta, + blocked.isAcceptableOrUnknown(data['blocked']!, _blockedMeta), + ); } else if (isInserting) { context.missing(_blockedMeta); } if (data.containsKey('used')) { context.handle( - _usedMeta, used.isAcceptableOrUnknown(data['used']!, _usedMeta)); + _usedMeta, + used.isAcceptableOrUnknown(data['used']!, _usedMeta), + ); } else if (isInserting) { context.missing(_usedMeta); } @@ -402,20 +502,34 @@ class $MwebUtxosTable extends MwebUtxos MwebUtxo map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return MwebUtxo( - outputId: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}output_id'])!, - address: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}address'])!, - value: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}value'])!, - height: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}height'])!, - blockTime: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}block_time'])!, - blocked: attachedDatabase.typeMapping - .read(DriftSqlType.bool, data['${effectivePrefix}blocked'])!, - used: attachedDatabase.typeMapping - .read(DriftSqlType.bool, data['${effectivePrefix}used'])!, + outputId: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}output_id'], + )!, + address: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}address'], + )!, + value: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}value'], + )!, + height: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}height'], + )!, + blockTime: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}block_time'], + )!, + blocked: attachedDatabase.typeMapping.read( + DriftSqlType.bool, + data['${effectivePrefix}blocked'], + )!, + used: attachedDatabase.typeMapping.read( + DriftSqlType.bool, + data['${effectivePrefix}used'], + )!, ); } @@ -433,14 +547,15 @@ class MwebUtxo extends DataClass implements Insertable { final int blockTime; final bool blocked; final bool used; - const MwebUtxo( - {required this.outputId, - required this.address, - required this.value, - required this.height, - required this.blockTime, - required this.blocked, - required this.used}); + const MwebUtxo({ + required this.outputId, + required this.address, + required this.value, + required this.height, + required this.blockTime, + required this.blocked, + required this.used, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; @@ -466,8 +581,10 @@ class MwebUtxo extends DataClass implements Insertable { ); } - factory MwebUtxo.fromJson(Map json, - {ValueSerializer? serializer}) { + factory MwebUtxo.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return MwebUtxo( outputId: serializer.fromJson(json['outputId']), @@ -493,23 +610,23 @@ class MwebUtxo extends DataClass implements Insertable { }; } - MwebUtxo copyWith( - {String? outputId, - String? address, - int? value, - int? height, - int? blockTime, - bool? blocked, - bool? used}) => - MwebUtxo( - outputId: outputId ?? this.outputId, - address: address ?? this.address, - value: value ?? this.value, - height: height ?? this.height, - blockTime: blockTime ?? this.blockTime, - blocked: blocked ?? this.blocked, - used: used ?? this.used, - ); + MwebUtxo copyWith({ + String? outputId, + String? address, + int? value, + int? height, + int? blockTime, + bool? blocked, + bool? used, + }) => MwebUtxo( + outputId: outputId ?? this.outputId, + address: address ?? this.address, + value: value ?? this.value, + height: height ?? this.height, + blockTime: blockTime ?? this.blockTime, + blocked: blocked ?? this.blocked, + used: used ?? this.used, + ); MwebUtxo copyWithCompanion(MwebUtxosCompanion data) { return MwebUtxo( outputId: data.outputId.present ? data.outputId.value : this.outputId, @@ -580,13 +697,13 @@ class MwebUtxosCompanion extends UpdateCompanion { required bool blocked, required bool used, this.rowid = const Value.absent(), - }) : outputId = Value(outputId), - address = Value(address), - value = Value(value), - height = Value(height), - blockTime = Value(blockTime), - blocked = Value(blocked), - used = Value(used); + }) : outputId = Value(outputId), + address = Value(address), + value = Value(value), + height = Value(height), + blockTime = Value(blockTime), + blocked = Value(blocked), + used = Value(used); static Insertable custom({ Expression? outputId, Expression? address, @@ -609,15 +726,16 @@ class MwebUtxosCompanion extends UpdateCompanion { }); } - MwebUtxosCompanion copyWith( - {Value? outputId, - Value? address, - Value? value, - Value? height, - Value? blockTime, - Value? blocked, - Value? used, - Value? rowid}) { + MwebUtxosCompanion copyWith({ + Value? outputId, + Value? address, + Value? value, + Value? height, + Value? blockTime, + Value? blocked, + Value? used, + Value? rowid, + }) { return MwebUtxosCompanion( outputId: outputId ?? this.outputId, address: address ?? this.address, @@ -688,20 +806,22 @@ abstract class _$WalletDatabase extends GeneratedDatabase { List get allSchemaEntities => [sparkNames, mwebUtxos]; } -typedef $$SparkNamesTableCreateCompanionBuilder = SparkNamesCompanion Function({ - required String name, - required String address, - required int validUntil, - Value additionalInfo, - Value rowid, -}); -typedef $$SparkNamesTableUpdateCompanionBuilder = SparkNamesCompanion Function({ - Value name, - Value address, - Value validUntil, - Value additionalInfo, - Value rowid, -}); +typedef $$SparkNamesTableCreateCompanionBuilder = + SparkNamesCompanion Function({ + required String name, + required String address, + required int validUntil, + Value additionalInfo, + Value rowid, + }); +typedef $$SparkNamesTableUpdateCompanionBuilder = + SparkNamesCompanion Function({ + Value name, + Value address, + Value validUntil, + Value additionalInfo, + Value rowid, + }); class $$SparkNamesTableFilterComposer extends Composer<_$WalletDatabase, $SparkNamesTable> { @@ -713,17 +833,24 @@ class $$SparkNamesTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnFilters(column)); + column: $table.name, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get address => $composableBuilder( - column: $table.address, builder: (column) => ColumnFilters(column)); + column: $table.address, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get validUntil => $composableBuilder( - column: $table.validUntil, builder: (column) => ColumnFilters(column)); + column: $table.validUntil, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get additionalInfo => $composableBuilder( - column: $table.additionalInfo, - builder: (column) => ColumnFilters(column)); + column: $table.additionalInfo, + builder: (column) => ColumnFilters(column), + ); } class $$SparkNamesTableOrderingComposer @@ -736,17 +863,24 @@ class $$SparkNamesTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnOrderings(column)); + column: $table.name, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get address => $composableBuilder( - column: $table.address, builder: (column) => ColumnOrderings(column)); + column: $table.address, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get validUntil => $composableBuilder( - column: $table.validUntil, builder: (column) => ColumnOrderings(column)); + column: $table.validUntil, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get additionalInfo => $composableBuilder( - column: $table.additionalInfo, - builder: (column) => ColumnOrderings(column)); + column: $table.additionalInfo, + builder: (column) => ColumnOrderings(column), + ); } class $$SparkNamesTableAnnotationComposer @@ -765,26 +899,37 @@ class $$SparkNamesTableAnnotationComposer $composableBuilder(column: $table.address, builder: (column) => column); GeneratedColumn get validUntil => $composableBuilder( - column: $table.validUntil, builder: (column) => column); + column: $table.validUntil, + builder: (column) => column, + ); GeneratedColumn get additionalInfo => $composableBuilder( - column: $table.additionalInfo, builder: (column) => column); + column: $table.additionalInfo, + builder: (column) => column, + ); } -class $$SparkNamesTableTableManager extends RootTableManager< - _$WalletDatabase, - $SparkNamesTable, - SparkName, - $$SparkNamesTableFilterComposer, - $$SparkNamesTableOrderingComposer, - $$SparkNamesTableAnnotationComposer, - $$SparkNamesTableCreateCompanionBuilder, - $$SparkNamesTableUpdateCompanionBuilder, - (SparkName, BaseReferences<_$WalletDatabase, $SparkNamesTable, SparkName>), - SparkName, - PrefetchHooks Function()> { +class $$SparkNamesTableTableManager + extends + RootTableManager< + _$WalletDatabase, + $SparkNamesTable, + SparkName, + $$SparkNamesTableFilterComposer, + $$SparkNamesTableOrderingComposer, + $$SparkNamesTableAnnotationComposer, + $$SparkNamesTableCreateCompanionBuilder, + $$SparkNamesTableUpdateCompanionBuilder, + ( + SparkName, + BaseReferences<_$WalletDatabase, $SparkNamesTable, SparkName>, + ), + SparkName, + PrefetchHooks Function() + > { $$SparkNamesTableTableManager(_$WalletDatabase db, $SparkNamesTable table) - : super(TableManagerState( + : super( + TableManagerState( db: db, table: table, createFilteringComposer: () => @@ -793,73 +938,81 @@ class $$SparkNamesTableTableManager extends RootTableManager< $$SparkNamesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$SparkNamesTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value name = const Value.absent(), - Value address = const Value.absent(), - Value validUntil = const Value.absent(), - Value additionalInfo = const Value.absent(), - Value rowid = const Value.absent(), - }) => - SparkNamesCompanion( - name: name, - address: address, - validUntil: validUntil, - additionalInfo: additionalInfo, - rowid: rowid, - ), - createCompanionCallback: ({ - required String name, - required String address, - required int validUntil, - Value additionalInfo = const Value.absent(), - Value rowid = const Value.absent(), - }) => - SparkNamesCompanion.insert( - name: name, - address: address, - validUntil: validUntil, - additionalInfo: additionalInfo, - rowid: rowid, - ), + updateCompanionCallback: + ({ + Value name = const Value.absent(), + Value address = const Value.absent(), + Value validUntil = const Value.absent(), + Value additionalInfo = const Value.absent(), + Value rowid = const Value.absent(), + }) => SparkNamesCompanion( + name: name, + address: address, + validUntil: validUntil, + additionalInfo: additionalInfo, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String name, + required String address, + required int validUntil, + Value additionalInfo = const Value.absent(), + Value rowid = const Value.absent(), + }) => SparkNamesCompanion.insert( + name: name, + address: address, + validUntil: validUntil, + additionalInfo: additionalInfo, + rowid: rowid, + ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, - )); + ), + ); } -typedef $$SparkNamesTableProcessedTableManager = ProcessedTableManager< - _$WalletDatabase, - $SparkNamesTable, - SparkName, - $$SparkNamesTableFilterComposer, - $$SparkNamesTableOrderingComposer, - $$SparkNamesTableAnnotationComposer, - $$SparkNamesTableCreateCompanionBuilder, - $$SparkNamesTableUpdateCompanionBuilder, - (SparkName, BaseReferences<_$WalletDatabase, $SparkNamesTable, SparkName>), - SparkName, - PrefetchHooks Function()>; -typedef $$MwebUtxosTableCreateCompanionBuilder = MwebUtxosCompanion Function({ - required String outputId, - required String address, - required int value, - required int height, - required int blockTime, - required bool blocked, - required bool used, - Value rowid, -}); -typedef $$MwebUtxosTableUpdateCompanionBuilder = MwebUtxosCompanion Function({ - Value outputId, - Value address, - Value value, - Value height, - Value blockTime, - Value blocked, - Value used, - Value rowid, -}); +typedef $$SparkNamesTableProcessedTableManager = + ProcessedTableManager< + _$WalletDatabase, + $SparkNamesTable, + SparkName, + $$SparkNamesTableFilterComposer, + $$SparkNamesTableOrderingComposer, + $$SparkNamesTableAnnotationComposer, + $$SparkNamesTableCreateCompanionBuilder, + $$SparkNamesTableUpdateCompanionBuilder, + ( + SparkName, + BaseReferences<_$WalletDatabase, $SparkNamesTable, SparkName>, + ), + SparkName, + PrefetchHooks Function() + >; +typedef $$MwebUtxosTableCreateCompanionBuilder = + MwebUtxosCompanion Function({ + required String outputId, + required String address, + required int value, + required int height, + required int blockTime, + required bool blocked, + required bool used, + Value rowid, + }); +typedef $$MwebUtxosTableUpdateCompanionBuilder = + MwebUtxosCompanion Function({ + Value outputId, + Value address, + Value value, + Value height, + Value blockTime, + Value blocked, + Value used, + Value rowid, + }); class $$MwebUtxosTableFilterComposer extends Composer<_$WalletDatabase, $MwebUtxosTable> { @@ -871,25 +1024,39 @@ class $$MwebUtxosTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get outputId => $composableBuilder( - column: $table.outputId, builder: (column) => ColumnFilters(column)); + column: $table.outputId, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get address => $composableBuilder( - column: $table.address, builder: (column) => ColumnFilters(column)); + column: $table.address, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get value => $composableBuilder( - column: $table.value, builder: (column) => ColumnFilters(column)); + column: $table.value, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get height => $composableBuilder( - column: $table.height, builder: (column) => ColumnFilters(column)); + column: $table.height, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get blockTime => $composableBuilder( - column: $table.blockTime, builder: (column) => ColumnFilters(column)); + column: $table.blockTime, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get blocked => $composableBuilder( - column: $table.blocked, builder: (column) => ColumnFilters(column)); + column: $table.blocked, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get used => $composableBuilder( - column: $table.used, builder: (column) => ColumnFilters(column)); + column: $table.used, + builder: (column) => ColumnFilters(column), + ); } class $$MwebUtxosTableOrderingComposer @@ -902,25 +1069,39 @@ class $$MwebUtxosTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get outputId => $composableBuilder( - column: $table.outputId, builder: (column) => ColumnOrderings(column)); + column: $table.outputId, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get address => $composableBuilder( - column: $table.address, builder: (column) => ColumnOrderings(column)); + column: $table.address, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get value => $composableBuilder( - column: $table.value, builder: (column) => ColumnOrderings(column)); + column: $table.value, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get height => $composableBuilder( - column: $table.height, builder: (column) => ColumnOrderings(column)); + column: $table.height, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get blockTime => $composableBuilder( - column: $table.blockTime, builder: (column) => ColumnOrderings(column)); + column: $table.blockTime, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get blocked => $composableBuilder( - column: $table.blocked, builder: (column) => ColumnOrderings(column)); + column: $table.blocked, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get used => $composableBuilder( - column: $table.used, builder: (column) => ColumnOrderings(column)); + column: $table.used, + builder: (column) => ColumnOrderings(column), + ); } class $$MwebUtxosTableAnnotationComposer @@ -954,20 +1135,27 @@ class $$MwebUtxosTableAnnotationComposer $composableBuilder(column: $table.used, builder: (column) => column); } -class $$MwebUtxosTableTableManager extends RootTableManager< - _$WalletDatabase, - $MwebUtxosTable, - MwebUtxo, - $$MwebUtxosTableFilterComposer, - $$MwebUtxosTableOrderingComposer, - $$MwebUtxosTableAnnotationComposer, - $$MwebUtxosTableCreateCompanionBuilder, - $$MwebUtxosTableUpdateCompanionBuilder, - (MwebUtxo, BaseReferences<_$WalletDatabase, $MwebUtxosTable, MwebUtxo>), - MwebUtxo, - PrefetchHooks Function()> { +class $$MwebUtxosTableTableManager + extends + RootTableManager< + _$WalletDatabase, + $MwebUtxosTable, + MwebUtxo, + $$MwebUtxosTableFilterComposer, + $$MwebUtxosTableOrderingComposer, + $$MwebUtxosTableAnnotationComposer, + $$MwebUtxosTableCreateCompanionBuilder, + $$MwebUtxosTableUpdateCompanionBuilder, + ( + MwebUtxo, + BaseReferences<_$WalletDatabase, $MwebUtxosTable, MwebUtxo>, + ), + MwebUtxo, + PrefetchHooks Function() + > { $$MwebUtxosTableTableManager(_$WalletDatabase db, $MwebUtxosTable table) - : super(TableManagerState( + : super( + TableManagerState( db: db, table: table, createFilteringComposer: () => @@ -976,65 +1164,68 @@ class $$MwebUtxosTableTableManager extends RootTableManager< $$MwebUtxosTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$MwebUtxosTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value outputId = const Value.absent(), - Value address = const Value.absent(), - Value value = const Value.absent(), - Value height = const Value.absent(), - Value blockTime = const Value.absent(), - Value blocked = const Value.absent(), - Value used = const Value.absent(), - Value rowid = const Value.absent(), - }) => - MwebUtxosCompanion( - outputId: outputId, - address: address, - value: value, - height: height, - blockTime: blockTime, - blocked: blocked, - used: used, - rowid: rowid, - ), - createCompanionCallback: ({ - required String outputId, - required String address, - required int value, - required int height, - required int blockTime, - required bool blocked, - required bool used, - Value rowid = const Value.absent(), - }) => - MwebUtxosCompanion.insert( - outputId: outputId, - address: address, - value: value, - height: height, - blockTime: blockTime, - blocked: blocked, - used: used, - rowid: rowid, - ), + updateCompanionCallback: + ({ + Value outputId = const Value.absent(), + Value address = const Value.absent(), + Value value = const Value.absent(), + Value height = const Value.absent(), + Value blockTime = const Value.absent(), + Value blocked = const Value.absent(), + Value used = const Value.absent(), + Value rowid = const Value.absent(), + }) => MwebUtxosCompanion( + outputId: outputId, + address: address, + value: value, + height: height, + blockTime: blockTime, + blocked: blocked, + used: used, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String outputId, + required String address, + required int value, + required int height, + required int blockTime, + required bool blocked, + required bool used, + Value rowid = const Value.absent(), + }) => MwebUtxosCompanion.insert( + outputId: outputId, + address: address, + value: value, + height: height, + blockTime: blockTime, + blocked: blocked, + used: used, + rowid: rowid, + ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, - )); + ), + ); } -typedef $$MwebUtxosTableProcessedTableManager = ProcessedTableManager< - _$WalletDatabase, - $MwebUtxosTable, - MwebUtxo, - $$MwebUtxosTableFilterComposer, - $$MwebUtxosTableOrderingComposer, - $$MwebUtxosTableAnnotationComposer, - $$MwebUtxosTableCreateCompanionBuilder, - $$MwebUtxosTableUpdateCompanionBuilder, - (MwebUtxo, BaseReferences<_$WalletDatabase, $MwebUtxosTable, MwebUtxo>), - MwebUtxo, - PrefetchHooks Function()>; +typedef $$MwebUtxosTableProcessedTableManager = + ProcessedTableManager< + _$WalletDatabase, + $MwebUtxosTable, + MwebUtxo, + $$MwebUtxosTableFilterComposer, + $$MwebUtxosTableOrderingComposer, + $$MwebUtxosTableAnnotationComposer, + $$MwebUtxosTableCreateCompanionBuilder, + $$MwebUtxosTableUpdateCompanionBuilder, + (MwebUtxo, BaseReferences<_$WalletDatabase, $MwebUtxosTable, MwebUtxo>), + MwebUtxo, + PrefetchHooks Function() + >; class $WalletDatabaseManager { final _$WalletDatabase _db; diff --git a/lib/models/exchange/response_objects/trade.g.dart b/lib/models/exchange/response_objects/trade.g.dart index 12d77bd836..c0c54c4875 100644 --- a/lib/models/exchange/response_objects/trade.g.dart +++ b/lib/models/exchange/response_objects/trade.g.dart @@ -8,7 +8,7 @@ part of 'trade.dart'; class TradeAdapter extends TypeAdapter { @override - final int typeId = 22; + final typeId = 22; @override Trade read(BinaryReader reader) { diff --git a/lib/models/isar/exchange_cache/currency.g.dart b/lib/models/isar/exchange_cache/currency.g.dart index 89d93a11df..20865c68c6 100644 --- a/lib/models/isar/exchange_cache/currency.g.dart +++ b/lib/models/isar/exchange_cache/currency.g.dart @@ -27,53 +27,34 @@ const CurrencySchema = CollectionSchema( name: r'externalId', type: IsarType.string, ), - r'image': PropertySchema( - id: 2, - name: r'image', - type: IsarType.string, - ), + r'image': PropertySchema(id: 2, name: r'image', type: IsarType.string), r'isAvailable': PropertySchema( id: 3, name: r'isAvailable', type: IsarType.bool, ), - r'isFiat': PropertySchema( - id: 4, - name: r'isFiat', - type: IsarType.bool, - ), + r'isFiat': PropertySchema(id: 4, name: r'isFiat', type: IsarType.bool), r'isStackCoin': PropertySchema( id: 5, name: r'isStackCoin', type: IsarType.bool, ), - r'name': PropertySchema( - id: 6, - name: r'name', - type: IsarType.string, - ), - r'network': PropertySchema( - id: 7, - name: r'network', - type: IsarType.string, - ), + r'name': PropertySchema(id: 6, name: r'name', type: IsarType.string), + r'network': PropertySchema(id: 7, name: r'network', type: IsarType.string), r'rateType': PropertySchema( id: 8, name: r'rateType', type: IsarType.byte, enumMap: _CurrencyrateTypeEnumValueMap, ), - r'ticker': PropertySchema( - id: 9, - name: r'ticker', - type: IsarType.string, - ), + r'ticker': PropertySchema(id: 9, name: r'ticker', type: IsarType.string), r'tokenContract': PropertySchema( id: 10, name: r'tokenContract', type: IsarType.string, - ) + ), }, + estimateSize: _currencyEstimateSize, serialize: _currencySerialize, deserialize: _currencyDeserialize, @@ -90,7 +71,7 @@ const CurrencySchema = CollectionSchema( name: r'exchangeName', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'ticker_exchangeName_name': IndexSchema( @@ -113,7 +94,7 @@ const CurrencySchema = CollectionSchema( name: r'name', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'isStackCoin': IndexSchema( @@ -126,16 +107,17 @@ const CurrencySchema = CollectionSchema( name: r'isStackCoin', type: IndexType.value, caseSensitive: false, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _currencyGetId, getLinks: _currencyGetLinks, attach: _currencyAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _currencyEstimateSize( @@ -200,7 +182,7 @@ Currency _currencyDeserialize( network: reader.readString(offsets[7]), rateType: _CurrencyrateTypeValueEnumMap[reader.readByteOrNull(offsets[8])] ?? - SupportedRateType.fixed, + SupportedRateType.fixed, ticker: reader.readString(offsets[9]), tokenContract: reader.readStringOrNull(offsets[10]), ); @@ -233,7 +215,8 @@ P _currencyDeserializeProp

( return (reader.readString(offset)) as P; case 8: return (_CurrencyrateTypeValueEnumMap[reader.readByteOrNull(offset)] ?? - SupportedRateType.fixed) as P; + SupportedRateType.fixed) + as P; case 9: return (reader.readString(offset)) as P; case 10: @@ -243,11 +226,7 @@ P _currencyDeserializeProp

( } } -const _CurrencyrateTypeEnumValueMap = { - 'fixed': 0, - 'estimated': 1, - 'both': 2, -}; +const _CurrencyrateTypeEnumValueMap = {'fixed': 0, 'estimated': 1, 'both': 2}; const _CurrencyrateTypeValueEnumMap = { 0: SupportedRateType.fixed, 1: SupportedRateType.estimated, @@ -285,10 +264,7 @@ extension CurrencyQueryWhereSort on QueryBuilder { extension CurrencyQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -314,8 +290,10 @@ extension CurrencyQueryWhere on QueryBuilder { }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -323,8 +301,10 @@ extension CurrencyQueryWhere on QueryBuilder { }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -339,239 +319,303 @@ extension CurrencyQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder exchangeNameEqualTo( - String exchangeName) { + String exchangeName, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'exchangeName', - value: [exchangeName], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'exchangeName', + value: [exchangeName], + ), + ); }); } QueryBuilder exchangeNameNotEqualTo( - String exchangeName) { + String exchangeName, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'exchangeName', - lower: [], - upper: [exchangeName], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'exchangeName', - lower: [exchangeName], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'exchangeName', + lower: [], + upper: [exchangeName], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'exchangeName', + lower: [exchangeName], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'exchangeName', - lower: [exchangeName], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'exchangeName', - lower: [], - upper: [exchangeName], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'exchangeName', + lower: [exchangeName], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'exchangeName', + lower: [], + upper: [exchangeName], + includeUpper: false, + ), + ); } }); } QueryBuilder - tickerEqualToAnyExchangeNameName(String ticker) { + tickerEqualToAnyExchangeNameName(String ticker) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'ticker_exchangeName_name', - value: [ticker], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'ticker_exchangeName_name', + value: [ticker], + ), + ); }); } QueryBuilder - tickerNotEqualToAnyExchangeNameName(String ticker) { + tickerNotEqualToAnyExchangeNameName(String ticker) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [], - upper: [ticker], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [], + upper: [ticker], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [], - upper: [ticker], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [], + upper: [ticker], + includeUpper: false, + ), + ); } }); } QueryBuilder - tickerExchangeNameEqualToAnyName(String ticker, String exchangeName) { + tickerExchangeNameEqualToAnyName(String ticker, String exchangeName) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'ticker_exchangeName_name', - value: [ticker, exchangeName], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'ticker_exchangeName_name', + value: [ticker, exchangeName], + ), + ); }); } QueryBuilder - tickerEqualToExchangeNameNotEqualToAnyName( - String ticker, String exchangeName) { + tickerEqualToExchangeNameNotEqualToAnyName( + String ticker, + String exchangeName, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker], - upper: [ticker, exchangeName], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker, exchangeName], - includeLower: false, - upper: [ticker], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker], + upper: [ticker, exchangeName], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker, exchangeName], + includeLower: false, + upper: [ticker], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker, exchangeName], - includeLower: false, - upper: [ticker], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker], - upper: [ticker, exchangeName], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker, exchangeName], + includeLower: false, + upper: [ticker], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker], + upper: [ticker, exchangeName], + includeUpper: false, + ), + ); } }); } QueryBuilder - tickerExchangeNameNameEqualTo( - String ticker, String exchangeName, String name) { + tickerExchangeNameNameEqualTo( + String ticker, + String exchangeName, + String name, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'ticker_exchangeName_name', - value: [ticker, exchangeName, name], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'ticker_exchangeName_name', + value: [ticker, exchangeName, name], + ), + ); }); } QueryBuilder - tickerExchangeNameEqualToNameNotEqualTo( - String ticker, String exchangeName, String name) { + tickerExchangeNameEqualToNameNotEqualTo( + String ticker, + String exchangeName, + String name, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker, exchangeName], - upper: [ticker, exchangeName, name], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker, exchangeName, name], - includeLower: false, - upper: [ticker, exchangeName], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker, exchangeName], + upper: [ticker, exchangeName, name], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker, exchangeName, name], + includeLower: false, + upper: [ticker, exchangeName], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker, exchangeName, name], - includeLower: false, - upper: [ticker, exchangeName], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker_exchangeName_name', - lower: [ticker, exchangeName], - upper: [ticker, exchangeName, name], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker, exchangeName, name], + includeLower: false, + upper: [ticker, exchangeName], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker_exchangeName_name', + lower: [ticker, exchangeName], + upper: [ticker, exchangeName, name], + includeUpper: false, + ), + ); } }); } QueryBuilder isStackCoinEqualTo( - bool isStackCoin) { + bool isStackCoin, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'isStackCoin', - value: [isStackCoin], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'isStackCoin', + value: [isStackCoin], + ), + ); }); } QueryBuilder isStackCoinNotEqualTo( - bool isStackCoin) { + bool isStackCoin, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'isStackCoin', - lower: [], - upper: [isStackCoin], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'isStackCoin', - lower: [isStackCoin], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'isStackCoin', + lower: [], + upper: [isStackCoin], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'isStackCoin', + lower: [isStackCoin], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'isStackCoin', - lower: [isStackCoin], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'isStackCoin', - lower: [], - upper: [isStackCoin], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'isStackCoin', + lower: [isStackCoin], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'isStackCoin', + lower: [], + upper: [isStackCoin], + includeUpper: false, + ), + ); } }); } @@ -584,27 +628,31 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeNameGreaterThan( + exchangeNameGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -614,12 +662,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -631,28 +681,29 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'exchangeName', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'exchangeName', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeNameStartsWith( - String value, { - bool caseSensitive = true, - }) { + exchangeNameStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -661,72 +712,78 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder exchangeNameContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder exchangeNameMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'exchangeName', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'exchangeName', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeNameIsEmpty() { + exchangeNameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchangeName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'exchangeName', value: ''), + ); }); } QueryBuilder - exchangeNameIsNotEmpty() { + exchangeNameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'exchangeName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'exchangeName', value: ''), + ); }); } QueryBuilder externalIdIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'externalId', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'externalId'), + ); }); } QueryBuilder - externalIdIsNotNull() { + externalIdIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'externalId', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'externalId'), + ); }); } @@ -735,11 +792,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'externalId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'externalId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -749,12 +808,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'externalId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'externalId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -764,12 +825,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'externalId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'externalId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -781,14 +844,16 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'externalId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'externalId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -797,11 +862,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'externalId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'externalId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -810,79 +877,84 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'externalId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'externalId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder externalIdContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'externalId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'externalId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder externalIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'externalId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'externalId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder externalIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'externalId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'externalId', value: ''), + ); }); } QueryBuilder - externalIdIsNotEmpty() { + externalIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'externalId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'externalId', value: ''), + ); }); } QueryBuilder idIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'id', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'id'), + ); }); } QueryBuilder idIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'id', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'id'), + ); }); } QueryBuilder idEqualTo(Id? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -891,11 +963,13 @@ extension CurrencyQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -904,11 +978,13 @@ extension CurrencyQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -919,13 +995,15 @@ extension CurrencyQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -934,11 +1012,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'image', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'image', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -948,12 +1028,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'image', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'image', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -963,12 +1045,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'image', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'image', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -980,14 +1064,16 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'image', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'image', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -996,11 +1082,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'image', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'image', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1009,100 +1097,106 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'image', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'image', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder imageContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'image', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'image', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder imageMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'image', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'image', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder imageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'image', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'image', value: ''), + ); }); } QueryBuilder imageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'image', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'image', value: ''), + ); }); } QueryBuilder isAvailableIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'isAvailable', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'isAvailable'), + ); }); } QueryBuilder - isAvailableIsNotNull() { + isAvailableIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'isAvailable', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'isAvailable'), + ); }); } QueryBuilder isAvailableEqualTo( - bool? value) { + bool? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isAvailable', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isAvailable', value: value), + ); }); } QueryBuilder isFiatEqualTo( - bool value) { + bool value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isFiat', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isFiat', value: value), + ); }); } QueryBuilder isStackCoinEqualTo( - bool value) { + bool value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isStackCoin', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isStackCoin', value: value), + ); }); } @@ -1111,11 +1205,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1125,12 +1221,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1140,12 +1238,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1157,14 +1257,16 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'name', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1173,11 +1275,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1186,53 +1290,59 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'name', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'name', value: ''), + ); }); } QueryBuilder nameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'name', value: ''), + ); }); } @@ -1241,11 +1351,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'network', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'network', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1255,12 +1367,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'network', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'network', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1270,12 +1384,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'network', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'network', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1287,14 +1403,16 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'network', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'network', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1303,11 +1421,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'network', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'network', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1316,63 +1436,69 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'network', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'network', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder networkContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'network', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'network', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder networkMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'network', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'network', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder networkIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'network', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'network', value: ''), + ); }); } QueryBuilder networkIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'network', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'network', value: ''), + ); }); } QueryBuilder rateTypeEqualTo( - SupportedRateType value) { + SupportedRateType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'rateType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'rateType', value: value), + ); }); } @@ -1381,11 +1507,13 @@ extension CurrencyQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'rateType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'rateType', + value: value, + ), + ); }); } @@ -1394,11 +1522,13 @@ extension CurrencyQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'rateType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'rateType', + value: value, + ), + ); }); } @@ -1409,13 +1539,15 @@ extension CurrencyQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'rateType', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'rateType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -1424,11 +1556,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1438,12 +1572,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1453,12 +1589,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1470,14 +1608,16 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ticker', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ticker', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1486,11 +1626,13 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1499,71 +1641,77 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder tickerContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder tickerMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'ticker', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'ticker', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder tickerIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ticker', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ticker', value: ''), + ); }); } QueryBuilder tickerIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'ticker', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'ticker', value: ''), + ); }); } QueryBuilder - tokenContractIsNull() { + tokenContractIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'tokenContract', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'tokenContract'), + ); }); } QueryBuilder - tokenContractIsNotNull() { + tokenContractIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'tokenContract', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'tokenContract'), + ); }); } @@ -1572,27 +1720,31 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenContract', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractGreaterThan( + tokenContractGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenContract', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1602,12 +1754,14 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenContract', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1619,28 +1773,29 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenContract', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenContract', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractStartsWith( - String value, { - bool caseSensitive = true, - }) { + tokenContractStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'tokenContract', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1649,55 +1804,61 @@ extension CurrencyQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'tokenContract', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder tokenContractContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'tokenContract', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder tokenContractMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'tokenContract', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'tokenContract', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractIsEmpty() { + tokenContractIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenContract', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'tokenContract', value: ''), + ); }); } QueryBuilder - tokenContractIsNotEmpty() { + tokenContractIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'tokenContract', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'tokenContract', value: ''), + ); }); } } @@ -1991,22 +2152,25 @@ extension CurrencyQuerySortThenBy extension CurrencyQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByExchangeName( - {bool caseSensitive = true}) { + QueryBuilder distinctByExchangeName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'exchangeName', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByExternalId( - {bool caseSensitive = true}) { + QueryBuilder distinctByExternalId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'externalId', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByImage( - {bool caseSensitive = true}) { + QueryBuilder distinctByImage({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'image', caseSensitive: caseSensitive); }); @@ -2030,15 +2194,17 @@ extension CurrencyQueryWhereDistinct }); } - QueryBuilder distinctByName( - {bool caseSensitive = true}) { + QueryBuilder distinctByName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'name', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByNetwork( - {bool caseSensitive = true}) { + QueryBuilder distinctByNetwork({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'network', caseSensitive: caseSensitive); }); @@ -2050,18 +2216,22 @@ extension CurrencyQueryWhereDistinct }); } - QueryBuilder distinctByTicker( - {bool caseSensitive = true}) { + QueryBuilder distinctByTicker({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'ticker', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByTokenContract( - {bool caseSensitive = true}) { + QueryBuilder distinctByTokenContract({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'tokenContract', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'tokenContract', + caseSensitive: caseSensitive, + ); }); } } @@ -2123,7 +2293,7 @@ extension CurrencyQueryProperty } QueryBuilder - rateTypeProperty() { + rateTypeProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'rateType'); }); diff --git a/lib/models/isar/exchange_cache/pair.g.dart b/lib/models/isar/exchange_cache/pair.g.dart index 0f9b6435db..81479ec618 100644 --- a/lib/models/isar/exchange_cache/pair.g.dart +++ b/lib/models/isar/exchange_cache/pair.g.dart @@ -22,28 +22,17 @@ const PairSchema = CollectionSchema( name: r'exchangeName', type: IsarType.string, ), - r'from': PropertySchema( - id: 1, - name: r'from', - type: IsarType.string, - ), - r'hashCode': PropertySchema( - id: 2, - name: r'hashCode', - type: IsarType.long, - ), + r'from': PropertySchema(id: 1, name: r'from', type: IsarType.string), + r'hashCode': PropertySchema(id: 2, name: r'hashCode', type: IsarType.long), r'rateType': PropertySchema( id: 3, name: r'rateType', type: IsarType.byte, enumMap: _PairrateTypeEnumValueMap, ), - r'to': PropertySchema( - id: 4, - name: r'to', - type: IsarType.string, - ) + r'to': PropertySchema(id: 4, name: r'to', type: IsarType.string), }, + estimateSize: _pairEstimateSize, serialize: _pairSerialize, deserialize: _pairDeserialize, @@ -60,7 +49,7 @@ const PairSchema = CollectionSchema( name: r'exchangeName', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'from_exchangeName_to': IndexSchema( @@ -83,16 +72,17 @@ const PairSchema = CollectionSchema( name: r'to', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _pairGetId, getLinks: _pairGetLinks, attach: _pairAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _pairEstimateSize( @@ -129,7 +119,8 @@ Pair _pairDeserialize( final object = Pair( exchangeName: reader.readString(offsets[0]), from: reader.readString(offsets[1]), - rateType: _PairrateTypeValueEnumMap[reader.readByteOrNull(offsets[3])] ?? + rateType: + _PairrateTypeValueEnumMap[reader.readByteOrNull(offsets[3])] ?? SupportedRateType.fixed, to: reader.readString(offsets[4]), ); @@ -152,7 +143,8 @@ P _pairDeserializeProp

( return (reader.readLong(offset)) as P; case 3: return (_PairrateTypeValueEnumMap[reader.readByteOrNull(offset)] ?? - SupportedRateType.fixed) as P; + SupportedRateType.fixed) + as P; case 4: return (reader.readString(offset)) as P; default: @@ -160,11 +152,7 @@ P _pairDeserializeProp

( } } -const _PairrateTypeEnumValueMap = { - 'fixed': 0, - 'estimated': 1, - 'both': 2, -}; +const _PairrateTypeEnumValueMap = {'fixed': 0, 'estimated': 1, 'both': 2}; const _PairrateTypeValueEnumMap = { 0: SupportedRateType.fixed, 1: SupportedRateType.estimated, @@ -194,10 +182,7 @@ extension PairQueryWhereSort on QueryBuilder { extension PairQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -223,8 +208,10 @@ extension PairQueryWhere on QueryBuilder { }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -232,8 +219,10 @@ extension PairQueryWhere on QueryBuilder { }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -248,192 +237,246 @@ extension PairQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder exchangeNameEqualTo( - String exchangeName) { + String exchangeName, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'exchangeName', - value: [exchangeName], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'exchangeName', + value: [exchangeName], + ), + ); }); } QueryBuilder exchangeNameNotEqualTo( - String exchangeName) { + String exchangeName, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'exchangeName', - lower: [], - upper: [exchangeName], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'exchangeName', - lower: [exchangeName], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'exchangeName', + lower: [], + upper: [exchangeName], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'exchangeName', + lower: [exchangeName], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'exchangeName', - lower: [exchangeName], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'exchangeName', - lower: [], - upper: [exchangeName], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'exchangeName', + lower: [exchangeName], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'exchangeName', + lower: [], + upper: [exchangeName], + includeUpper: false, + ), + ); } }); } QueryBuilder fromEqualToAnyExchangeNameTo( - String from) { + String from, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'from_exchangeName_to', - value: [from], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'from_exchangeName_to', + value: [from], + ), + ); }); } QueryBuilder fromNotEqualToAnyExchangeNameTo( - String from) { + String from, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [], - upper: [from], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [], + upper: [from], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [], - upper: [from], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [], + upper: [from], + includeUpper: false, + ), + ); } }); } QueryBuilder fromExchangeNameEqualToAnyTo( - String from, String exchangeName) { + String from, + String exchangeName, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'from_exchangeName_to', - value: [from, exchangeName], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'from_exchangeName_to', + value: [from, exchangeName], + ), + ); }); } QueryBuilder - fromEqualToExchangeNameNotEqualToAnyTo(String from, String exchangeName) { + fromEqualToExchangeNameNotEqualToAnyTo(String from, String exchangeName) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from], - upper: [from, exchangeName], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from, exchangeName], - includeLower: false, - upper: [from], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from], + upper: [from, exchangeName], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from, exchangeName], + includeLower: false, + upper: [from], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from, exchangeName], - includeLower: false, - upper: [from], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from], - upper: [from, exchangeName], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from, exchangeName], + includeLower: false, + upper: [from], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from], + upper: [from, exchangeName], + includeUpper: false, + ), + ); } }); } QueryBuilder fromExchangeNameToEqualTo( - String from, String exchangeName, String to) { + String from, + String exchangeName, + String to, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'from_exchangeName_to', - value: [from, exchangeName, to], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'from_exchangeName_to', + value: [from, exchangeName, to], + ), + ); }); } QueryBuilder - fromExchangeNameEqualToToNotEqualTo( - String from, String exchangeName, String to) { + fromExchangeNameEqualToToNotEqualTo( + String from, + String exchangeName, + String to, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from, exchangeName], - upper: [from, exchangeName, to], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from, exchangeName, to], - includeLower: false, - upper: [from, exchangeName], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from, exchangeName], + upper: [from, exchangeName, to], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from, exchangeName, to], + includeLower: false, + upper: [from, exchangeName], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from, exchangeName, to], - includeLower: false, - upper: [from, exchangeName], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'from_exchangeName_to', - lower: [from, exchangeName], - upper: [from, exchangeName, to], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from, exchangeName, to], + includeLower: false, + upper: [from, exchangeName], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'from_exchangeName_to', + lower: [from, exchangeName], + upper: [from, exchangeName, to], + includeUpper: false, + ), + ); } }); } @@ -445,11 +488,13 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -459,12 +504,14 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -474,12 +521,14 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -491,14 +540,16 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'exchangeName', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'exchangeName', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -507,11 +558,13 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -520,53 +573,59 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder exchangeNameContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'exchangeName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'exchangeName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder exchangeNameMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'exchangeName', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'exchangeName', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder exchangeNameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchangeName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'exchangeName', value: ''), + ); }); } QueryBuilder exchangeNameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'exchangeName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'exchangeName', value: ''), + ); }); } @@ -575,11 +634,13 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'from', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'from', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -589,12 +650,14 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'from', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'from', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -604,12 +667,14 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'from', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'from', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -621,14 +686,16 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'from', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'from', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -637,11 +704,13 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'from', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'from', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -650,60 +719,67 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'from', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'from', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder fromContains(String value, - {bool caseSensitive = true}) { + QueryBuilder fromContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'from', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'from', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder fromMatches(String pattern, - {bool caseSensitive = true}) { + QueryBuilder fromMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'from', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'from', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder fromIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'from', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'from', value: ''), + ); }); } QueryBuilder fromIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'from', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'from', value: ''), + ); }); } QueryBuilder hashCodeEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'hashCode', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'hashCode', value: value), + ); }); } @@ -712,11 +788,13 @@ extension PairQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'hashCode', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'hashCode', + value: value, + ), + ); }); } @@ -725,11 +803,13 @@ extension PairQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'hashCode', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'hashCode', + value: value, + ), + ); }); } @@ -740,38 +820,39 @@ extension PairQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'hashCode', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'hashCode', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder idIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'id', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'id'), + ); }); } QueryBuilder idIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'id', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'id'), + ); }); } QueryBuilder idEqualTo(Id? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -780,11 +861,13 @@ extension PairQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -793,11 +876,13 @@ extension PairQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -808,23 +893,25 @@ extension PairQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder rateTypeEqualTo( - SupportedRateType value) { + SupportedRateType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'rateType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'rateType', value: value), + ); }); } @@ -833,11 +920,13 @@ extension PairQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'rateType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'rateType', + value: value, + ), + ); }); } @@ -846,11 +935,13 @@ extension PairQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'rateType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'rateType', + value: value, + ), + ); }); } @@ -861,13 +952,15 @@ extension PairQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'rateType', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'rateType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -876,11 +969,13 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'to', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'to', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -890,12 +985,14 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'to', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'to', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -905,12 +1002,14 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'to', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'to', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -922,14 +1021,16 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'to', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'to', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -938,11 +1039,13 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'to', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'to', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -951,51 +1054,59 @@ extension PairQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'to', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'to', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder toContains(String value, - {bool caseSensitive = true}) { + QueryBuilder toContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'to', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'to', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder toMatches(String pattern, - {bool caseSensitive = true}) { + QueryBuilder toMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'to', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'to', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder toIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'to', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'to', value: ''), + ); }); } QueryBuilder toIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'to', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'to', value: ''), + ); }); } } @@ -1141,15 +1252,17 @@ extension PairQuerySortThenBy on QueryBuilder { } extension PairQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByExchangeName( - {bool caseSensitive = true}) { + QueryBuilder distinctByExchangeName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'exchangeName', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByFrom( - {bool caseSensitive = true}) { + QueryBuilder distinctByFrom({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'from', caseSensitive: caseSensitive); }); @@ -1167,8 +1280,9 @@ extension PairQueryWhereDistinct on QueryBuilder { }); } - QueryBuilder distinctByTo( - {bool caseSensitive = true}) { + QueryBuilder distinctByTo({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'to', caseSensitive: caseSensitive); }); diff --git a/lib/models/isar/models/address_label.g.dart b/lib/models/isar/models/address_label.g.dart index a87af5963d..077359ac8c 100644 --- a/lib/models/isar/models/address_label.g.dart +++ b/lib/models/isar/models/address_label.g.dart @@ -22,22 +22,15 @@ const AddressLabelSchema = CollectionSchema( name: r'addressString', type: IsarType.string, ), - r'tags': PropertySchema( - id: 1, - name: r'tags', - type: IsarType.stringList, - ), - r'value': PropertySchema( - id: 2, - name: r'value', - type: IsarType.string, - ), + r'tags': PropertySchema(id: 1, name: r'tags', type: IsarType.stringList), + r'value': PropertySchema(id: 2, name: r'value', type: IsarType.string), r'walletId': PropertySchema( id: 3, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _addressLabelEstimateSize, serialize: _addressLabelSerialize, deserialize: _addressLabelDeserialize, @@ -54,7 +47,7 @@ const AddressLabelSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'addressString_walletId': IndexSchema( @@ -72,16 +65,17 @@ const AddressLabelSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _addressLabelGetId, getLinks: _addressLabelGetLinks, attach: _addressLabelAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _addressLabelEstimateSize( @@ -165,37 +159,54 @@ List> _addressLabelGetLinks(AddressLabel object) { } void _addressLabelAttach( - IsarCollection col, Id id, AddressLabel object) { + IsarCollection col, + Id id, + AddressLabel object, +) { object.id = id; } extension AddressLabelByIndex on IsarCollection { Future getByAddressStringWalletId( - String addressString, String walletId) { + String addressString, + String walletId, + ) { return getByIndex(r'addressString_walletId', [addressString, walletId]); } AddressLabel? getByAddressStringWalletIdSync( - String addressString, String walletId) { + String addressString, + String walletId, + ) { return getByIndexSync(r'addressString_walletId', [addressString, walletId]); } Future deleteByAddressStringWalletId( - String addressString, String walletId) { + String addressString, + String walletId, + ) { return deleteByIndex(r'addressString_walletId', [addressString, walletId]); } bool deleteByAddressStringWalletIdSync( - String addressString, String walletId) { - return deleteByIndexSync( - r'addressString_walletId', [addressString, walletId]); + String addressString, + String walletId, + ) { + return deleteByIndexSync(r'addressString_walletId', [ + addressString, + walletId, + ]); } Future> getAllByAddressStringWalletId( - List addressStringValues, List walletIdValues) { + List addressStringValues, + List walletIdValues, + ) { final len = addressStringValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([addressStringValues[i], walletIdValues[i]]); @@ -205,10 +216,14 @@ extension AddressLabelByIndex on IsarCollection { } List getAllByAddressStringWalletIdSync( - List addressStringValues, List walletIdValues) { + List addressStringValues, + List walletIdValues, + ) { final len = addressStringValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([addressStringValues[i], walletIdValues[i]]); @@ -218,10 +233,14 @@ extension AddressLabelByIndex on IsarCollection { } Future deleteAllByAddressStringWalletId( - List addressStringValues, List walletIdValues) { + List addressStringValues, + List walletIdValues, + ) { final len = addressStringValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([addressStringValues[i], walletIdValues[i]]); @@ -231,10 +250,14 @@ extension AddressLabelByIndex on IsarCollection { } int deleteAllByAddressStringWalletIdSync( - List addressStringValues, List walletIdValues) { + List addressStringValues, + List walletIdValues, + ) { final len = addressStringValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([addressStringValues[i], walletIdValues[i]]); @@ -247,20 +270,30 @@ extension AddressLabelByIndex on IsarCollection { return putByIndex(r'addressString_walletId', object); } - Id putByAddressStringWalletIdSync(AddressLabel object, - {bool saveLinks = true}) { - return putByIndexSync(r'addressString_walletId', object, - saveLinks: saveLinks); + Id putByAddressStringWalletIdSync( + AddressLabel object, { + bool saveLinks = true, + }) { + return putByIndexSync( + r'addressString_walletId', + object, + saveLinks: saveLinks, + ); } Future> putAllByAddressStringWalletId(List objects) { return putAllByIndex(r'addressString_walletId', objects); } - List putAllByAddressStringWalletIdSync(List objects, - {bool saveLinks = true}) { - return putAllByIndexSync(r'addressString_walletId', objects, - saveLinks: saveLinks); + List putAllByAddressStringWalletIdSync( + List objects, { + bool saveLinks = true, + }) { + return putAllByIndexSync( + r'addressString_walletId', + objects, + saveLinks: saveLinks, + ); } } @@ -277,15 +310,13 @@ extension AddressLabelQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder idNotEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -308,8 +339,9 @@ extension AddressLabelQueryWhere } QueryBuilder idGreaterThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -317,8 +349,10 @@ extension AddressLabelQueryWhere }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -333,147 +367,179 @@ extension AddressLabelQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder walletIdEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder - walletIdNotEqualTo(String walletId) { + walletIdNotEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder - addressStringEqualToAnyWalletId(String addressString) { + addressStringEqualToAnyWalletId(String addressString) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'addressString_walletId', - value: [addressString], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'addressString_walletId', + value: [addressString], + ), + ); }); } QueryBuilder - addressStringNotEqualToAnyWalletId(String addressString) { + addressStringNotEqualToAnyWalletId(String addressString) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'addressString_walletId', - lower: [], - upper: [addressString], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'addressString_walletId', - lower: [addressString], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'addressString_walletId', + lower: [], + upper: [addressString], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'addressString_walletId', + lower: [addressString], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'addressString_walletId', - lower: [addressString], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'addressString_walletId', - lower: [], - upper: [addressString], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'addressString_walletId', + lower: [addressString], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'addressString_walletId', + lower: [], + upper: [addressString], + includeUpper: false, + ), + ); } }); } QueryBuilder - addressStringWalletIdEqualTo(String addressString, String walletId) { + addressStringWalletIdEqualTo(String addressString, String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'addressString_walletId', - value: [addressString, walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'addressString_walletId', + value: [addressString, walletId], + ), + ); }); } QueryBuilder - addressStringEqualToWalletIdNotEqualTo( - String addressString, String walletId) { + addressStringEqualToWalletIdNotEqualTo( + String addressString, + String walletId, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'addressString_walletId', - lower: [addressString], - upper: [addressString, walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'addressString_walletId', - lower: [addressString, walletId], - includeLower: false, - upper: [addressString], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'addressString_walletId', + lower: [addressString], + upper: [addressString, walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'addressString_walletId', + lower: [addressString, walletId], + includeLower: false, + upper: [addressString], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'addressString_walletId', - lower: [addressString, walletId], - includeLower: false, - upper: [addressString], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'addressString_walletId', - lower: [addressString], - upper: [addressString, walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'addressString_walletId', + lower: [addressString, walletId], + includeLower: false, + upper: [addressString], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'addressString_walletId', + lower: [addressString], + upper: [addressString, walletId], + includeUpper: false, + ), + ); } }); } @@ -482,53 +548,56 @@ extension AddressLabelQueryWhere extension AddressLabelQueryFilter on QueryBuilder { QueryBuilder - addressStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + addressStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'addressString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'addressString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStringGreaterThan( + addressStringGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'addressString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'addressString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStringLessThan( + addressStringLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'addressString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'addressString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStringBetween( + addressStringBetween( String lower, String upper, { bool includeLower = true, @@ -536,94 +605,96 @@ extension AddressLabelQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'addressString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'addressString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + addressStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'addressString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'addressString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + addressStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'addressString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'addressString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStringContains(String value, {bool caseSensitive = true}) { + addressStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'addressString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'addressString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStringMatches(String pattern, {bool caseSensitive = true}) { + addressStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'addressString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'addressString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStringIsEmpty() { + addressStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'addressString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'addressString', value: ''), + ); }); } QueryBuilder - addressStringIsNotEmpty() { + addressStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'addressString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'addressString', value: ''), + ); }); } QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -632,11 +703,13 @@ extension AddressLabelQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -645,11 +718,13 @@ extension AddressLabelQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -660,81 +735,86 @@ extension AddressLabelQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder tagsIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'tags', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'tags'), + ); }); } QueryBuilder - tagsIsNotNull() { + tagsIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'tags', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'tags'), + ); }); } QueryBuilder - tagsElementEqualTo( - String value, { - bool caseSensitive = true, - }) { + tagsElementEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tags', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'tags', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tagsElementGreaterThan( + tagsElementGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tags', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tags', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tagsElementLessThan( + tagsElementLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tags', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tags', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tagsElementBetween( + tagsElementBetween( String lower, String upper, { bool includeLower = true, @@ -742,160 +822,126 @@ extension AddressLabelQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tags', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tags', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tagsElementStartsWith( - String value, { - bool caseSensitive = true, - }) { + tagsElementStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'tags', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'tags', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tagsElementEndsWith( - String value, { - bool caseSensitive = true, - }) { + tagsElementEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'tags', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'tags', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tagsElementContains(String value, {bool caseSensitive = true}) { + tagsElementContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'tags', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'tags', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tagsElementMatches(String pattern, {bool caseSensitive = true}) { + tagsElementMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'tags', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'tags', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tagsElementIsEmpty() { + tagsElementIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tags', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'tags', value: ''), + ); }); } QueryBuilder - tagsElementIsNotEmpty() { + tagsElementIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'tags', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'tags', value: ''), + ); }); } QueryBuilder - tagsLengthEqualTo(int length) { + tagsLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tags', - length, - true, - length, - true, - ); + return query.listLength(r'tags', length, true, length, true); }); } QueryBuilder - tagsIsEmpty() { + tagsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tags', - 0, - true, - 0, - true, - ); + return query.listLength(r'tags', 0, true, 0, true); }); } QueryBuilder - tagsIsNotEmpty() { + tagsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tags', - 0, - false, - 999999, - true, - ); + return query.listLength(r'tags', 0, false, 999999, true); }); } QueryBuilder - tagsLengthLessThan( - int length, { - bool include = false, - }) { + tagsLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tags', - 0, - true, - length, - include, - ); + return query.listLength(r'tags', 0, true, length, include); }); } QueryBuilder - tagsLengthGreaterThan( - int length, { - bool include = false, - }) { + tagsLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tags', - length, - include, - 999999, - true, - ); + return query.listLength(r'tags', length, include, 999999, true); }); } QueryBuilder - tagsLengthBetween( + tagsLengthBetween( int lower, int upper, { bool includeLower = true, @@ -917,27 +963,31 @@ extension AddressLabelQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueGreaterThan( + valueGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -947,12 +997,14 @@ extension AddressLabelQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -964,28 +1016,29 @@ extension AddressLabelQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'value', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStartsWith( - String value, { - bool caseSensitive = true, - }) { + valueStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -994,106 +1047,115 @@ extension AddressLabelQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder valueContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder valueMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'value', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'value', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIsEmpty() { + valueIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'value', value: ''), + ); }); } QueryBuilder - valueIsNotEmpty() { + valueIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'value', value: ''), + ); }); } QueryBuilder - walletIdEqualTo( - String value, { - bool caseSensitive = true, - }) { + walletIdEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdLessThan( + walletIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdBetween( + walletIdBetween( String lower, String upper, { bool includeLower = true, @@ -1101,84 +1163,86 @@ extension AddressLabelQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdEndsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdContains(String value, {bool caseSensitive = true}) { + walletIdContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdMatches(String pattern, {bool caseSensitive = true}) { + walletIdMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -1198,7 +1262,7 @@ extension AddressLabelQuerySortBy } QueryBuilder - sortByAddressStringDesc() { + sortByAddressStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'addressString', Sort.desc); }); @@ -1238,7 +1302,7 @@ extension AddressLabelQuerySortThenBy } QueryBuilder - thenByAddressStringDesc() { + thenByAddressStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'addressString', Sort.desc); }); @@ -1283,11 +1347,14 @@ extension AddressLabelQuerySortThenBy extension AddressLabelQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByAddressString( - {bool caseSensitive = true}) { + QueryBuilder distinctByAddressString({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'addressString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'addressString', + caseSensitive: caseSensitive, + ); }); } @@ -1297,15 +1364,17 @@ extension AddressLabelQueryWhereDistinct }); } - QueryBuilder distinctByValue( - {bool caseSensitive = true}) { + QueryBuilder distinctByValue({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'value', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); diff --git a/lib/models/isar/models/block_explorer.g.dart b/lib/models/isar/models/block_explorer.g.dart index 0c4be65bca..4265524c41 100644 --- a/lib/models/isar/models/block_explorer.g.dart +++ b/lib/models/isar/models/block_explorer.g.dart @@ -18,17 +18,10 @@ const TransactionBlockExplorerSchema = CollectionSchema( name: r'TransactionBlockExplorer', id: 4209077296238413906, properties: { - r'ticker': PropertySchema( - id: 0, - name: r'ticker', - type: IsarType.string, - ), - r'url': PropertySchema( - id: 1, - name: r'url', - type: IsarType.string, - ) + r'ticker': PropertySchema(id: 0, name: r'ticker', type: IsarType.string), + r'url': PropertySchema(id: 1, name: r'url', type: IsarType.string), }, + estimateSize: _transactionBlockExplorerEstimateSize, serialize: _transactionBlockExplorerSerialize, deserialize: _transactionBlockExplorerDeserialize, @@ -45,16 +38,17 @@ const TransactionBlockExplorerSchema = CollectionSchema( name: r'ticker', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _transactionBlockExplorerGetId, getLinks: _transactionBlockExplorerGetLinks, attach: _transactionBlockExplorerAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _transactionBlockExplorerEstimateSize( @@ -113,12 +107,16 @@ Id _transactionBlockExplorerGetId(TransactionBlockExplorer object) { } List> _transactionBlockExplorerGetLinks( - TransactionBlockExplorer object) { + TransactionBlockExplorer object, +) { return []; } void _transactionBlockExplorerAttach( - IsarCollection col, Id id, TransactionBlockExplorer object) { + IsarCollection col, + Id id, + TransactionBlockExplorer object, +) { object.id = id; } @@ -141,13 +139,15 @@ extension TransactionBlockExplorerByIndex } Future> getAllByTicker( - List tickerValues) { + List tickerValues, + ) { final values = tickerValues.map((e) => [e]).toList(); return getAllByIndex(r'ticker', values); } List getAllByTickerSync( - List tickerValues) { + List tickerValues, + ) { final values = tickerValues.map((e) => [e]).toList(); return getAllByIndexSync(r'ticker', values); } @@ -174,36 +174,53 @@ extension TransactionBlockExplorerByIndex return putAllByIndex(r'ticker', objects); } - List putAllByTickerSync(List objects, - {bool saveLinks = true}) { + List putAllByTickerSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'ticker', objects, saveLinks: saveLinks); } } -extension TransactionBlockExplorerQueryWhereSort on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QWhere> { +extension TransactionBlockExplorerQueryWhereSort + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QWhere + > { QueryBuilder - anyId() { + anyId() { return QueryBuilder.apply(this, (query) { return query.addWhereClause(const IdWhereClause.any()); }); } } -extension TransactionBlockExplorerQueryWhere on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QWhereClause> { - QueryBuilder idEqualTo(Id id) { +extension TransactionBlockExplorerQueryWhere + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QWhereClause + > { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterWhereClause + > + idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } - QueryBuilder idNotEqualTo(Id id) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterWhereClause + > + idNotEqualTo(Id id) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -225,8 +242,12 @@ extension TransactionBlockExplorerQueryWhere on QueryBuilder< }); } - QueryBuilder idGreaterThan(Id id, {bool include = false}) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterWhereClause + > + idGreaterThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -234,8 +255,12 @@ extension TransactionBlockExplorerQueryWhere on QueryBuilder< }); } - QueryBuilder idLessThan(Id id, {bool include = false}) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterWhereClause + > + idLessThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -243,175 +268,235 @@ extension TransactionBlockExplorerQueryWhere on QueryBuilder< }); } - QueryBuilder idBetween( + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterWhereClause + > + idBetween( Id lowerId, Id upperId, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } - QueryBuilder tickerEqualTo(String ticker) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterWhereClause + > + tickerEqualTo(String ticker) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'ticker', - value: [ticker], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'ticker', value: [ticker]), + ); }); } - QueryBuilder tickerNotEqualTo(String ticker) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterWhereClause + > + tickerNotEqualTo(String ticker) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker', - lower: [], - upper: [ticker], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker', - lower: [ticker], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker', + lower: [], + upper: [ticker], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker', + lower: [ticker], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker', - lower: [ticker], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'ticker', - lower: [], - upper: [ticker], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker', + lower: [ticker], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'ticker', + lower: [], + upper: [ticker], + includeUpper: false, + ), + ); } }); } } -extension TransactionBlockExplorerQueryFilter on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QFilterCondition> { - QueryBuilder idEqualTo(Id value) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); +extension TransactionBlockExplorerQueryFilter + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QFilterCondition + > { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } - QueryBuilder idGreaterThan( - Id value, { - bool include = false, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + idGreaterThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } - QueryBuilder idLessThan( - Id value, { - bool include = false, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + idLessThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } - QueryBuilder idBetween( + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + idBetween( Id lower, Id upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } - QueryBuilder tickerEqualTo( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder tickerGreaterThan( + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder tickerLessThan( + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder tickerBetween( + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerBetween( String lower, String upper, { bool includeLower = true, @@ -419,137 +504,176 @@ extension TransactionBlockExplorerQueryFilter on QueryBuilder< bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ticker', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ticker', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder tickerStartsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder tickerEndsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - tickerContains(String value, {bool caseSensitive = true}) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'ticker', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'ticker', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - tickerMatches(String pattern, {bool caseSensitive = true}) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'ticker', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'ticker', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder tickerIsEmpty() { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ticker', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ticker', value: ''), + ); }); } - QueryBuilder tickerIsNotEmpty() { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + tickerIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'ticker', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'ticker', value: ''), + ); }); } - QueryBuilder urlEqualTo( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'url', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'url', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder urlGreaterThan( + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'url', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'url', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder urlLessThan( - String value, { - bool include = false, - bool caseSensitive = true, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlLessThan(String value, {bool include = false, bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'url', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'url', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder urlBetween( + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlBetween( String lower, String upper, { bool includeLower = true, @@ -557,191 +681,245 @@ extension TransactionBlockExplorerQueryFilter on QueryBuilder< bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'url', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'url', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder urlStartsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'url', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'url', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder urlEndsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'url', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'url', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - urlContains(String value, {bool caseSensitive = true}) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'url', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'url', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - urlMatches(String pattern, {bool caseSensitive = true}) { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'url', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'url', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder urlIsEmpty() { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'url', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'url', value: ''), + ); }); } - QueryBuilder urlIsNotEmpty() { + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QAfterFilterCondition + > + urlIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'url', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'url', value: ''), + ); }); } } -extension TransactionBlockExplorerQueryObject on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QFilterCondition> {} - -extension TransactionBlockExplorerQueryLinks on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QFilterCondition> {} - -extension TransactionBlockExplorerQuerySortBy on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QSortBy> { +extension TransactionBlockExplorerQueryObject + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QFilterCondition + > {} + +extension TransactionBlockExplorerQueryLinks + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QFilterCondition + > {} + +extension TransactionBlockExplorerQuerySortBy + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QSortBy + > { QueryBuilder - sortByTicker() { + sortByTicker() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ticker', Sort.asc); }); } QueryBuilder - sortByTickerDesc() { + sortByTickerDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ticker', Sort.desc); }); } QueryBuilder - sortByUrl() { + sortByUrl() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'url', Sort.asc); }); } QueryBuilder - sortByUrlDesc() { + sortByUrlDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'url', Sort.desc); }); } } -extension TransactionBlockExplorerQuerySortThenBy on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QSortThenBy> { +extension TransactionBlockExplorerQuerySortThenBy + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QSortThenBy + > { QueryBuilder - thenById() { + thenById() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'id', Sort.asc); }); } QueryBuilder - thenByIdDesc() { + thenByIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'id', Sort.desc); }); } QueryBuilder - thenByTicker() { + thenByTicker() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ticker', Sort.asc); }); } QueryBuilder - thenByTickerDesc() { + thenByTickerDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ticker', Sort.desc); }); } QueryBuilder - thenByUrl() { + thenByUrl() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'url', Sort.asc); }); } QueryBuilder - thenByUrlDesc() { + thenByUrlDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'url', Sort.desc); }); } } -extension TransactionBlockExplorerQueryWhereDistinct on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QDistinct> { +extension TransactionBlockExplorerQueryWhereDistinct + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QDistinct + > { QueryBuilder - distinctByTicker({bool caseSensitive = true}) { + distinctByTicker({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'ticker', caseSensitive: caseSensitive); }); } QueryBuilder - distinctByUrl({bool caseSensitive = true}) { + distinctByUrl({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'url', caseSensitive: caseSensitive); }); } } -extension TransactionBlockExplorerQueryProperty on QueryBuilder< - TransactionBlockExplorer, TransactionBlockExplorer, QQueryProperty> { +extension TransactionBlockExplorerQueryProperty + on + QueryBuilder< + TransactionBlockExplorer, + TransactionBlockExplorer, + QQueryProperty + > { QueryBuilder idProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'id'); @@ -749,14 +927,14 @@ extension TransactionBlockExplorerQueryProperty on QueryBuilder< } QueryBuilder - tickerProperty() { + tickerProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'ticker'); }); } QueryBuilder - urlProperty() { + urlProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'url'); }); diff --git a/lib/models/isar/models/blockchain_data/address.g.dart b/lib/models/isar/models/blockchain_data/address.g.dart index e3df46a6be..2878d16402 100644 --- a/lib/models/isar/models/blockchain_data/address.g.dart +++ b/lib/models/isar/models/blockchain_data/address.g.dart @@ -26,6 +26,7 @@ const AddressSchema = CollectionSchema( id: 1, name: r'derivationPath', type: IsarType.object, + target: r'DerivationPath', ), r'otherData': PropertySchema( @@ -50,11 +51,7 @@ const AddressSchema = CollectionSchema( type: IsarType.byte, enumMap: _AddresstypeEnumValueMap, ), - r'value': PropertySchema( - id: 6, - name: r'value', - type: IsarType.string, - ), + r'value': PropertySchema(id: 6, name: r'value', type: IsarType.string), r'walletId': PropertySchema( id: 7, name: r'walletId', @@ -64,8 +61,9 @@ const AddressSchema = CollectionSchema( id: 8, name: r'zSafeFrost', type: IsarType.bool, - ) + ), }, + estimateSize: _addressEstimateSize, serialize: _addressSerialize, deserialize: _addressDeserialize, @@ -82,7 +80,7 @@ const AddressSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'value_walletId': IndexSchema( @@ -100,7 +98,7 @@ const AddressSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'derivationIndex': IndexSchema( @@ -113,9 +111,9 @@ const AddressSchema = CollectionSchema( name: r'derivationIndex', type: IndexType.value, caseSensitive: false, - ) + ), ], - ) + ), }, links: { r'transactions': LinkSchema( @@ -123,13 +121,14 @@ const AddressSchema = CollectionSchema( name: r'transactions', target: r'Transaction', single: false, - ) + ), }, embeddedSchemas: {r'DerivationPath': DerivationPathSchema}, + getId: _addressGetId, getLinks: _addressGetLinks, attach: _addressAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _addressEstimateSize( @@ -141,9 +140,13 @@ int _addressEstimateSize( { final value = object.derivationPath; if (value != null) { - bytesCount += 3 + + bytesCount += + 3 + DerivationPathSchema.estimateSize( - value, allOffsets[DerivationPath]!, allOffsets); + value, + allOffsets[DerivationPath]!, + allOffsets, + ); } } { @@ -195,9 +198,11 @@ Address _addressDeserialize( ), otherData: reader.readStringOrNull(offsets[2]), publicKey: reader.readByteList(offsets[3]) ?? [], - subType: _AddresssubTypeValueEnumMap[reader.readByteOrNull(offsets[4])] ?? + subType: + _AddresssubTypeValueEnumMap[reader.readByteOrNull(offsets[4])] ?? AddressSubType.receiving, - type: _AddresstypeValueEnumMap[reader.readByteOrNull(offsets[5])] ?? + type: + _AddresstypeValueEnumMap[reader.readByteOrNull(offsets[5])] ?? AddressType.p2pkh, value: reader.readString(offsets[6]), walletId: reader.readString(offsets[7]), @@ -218,20 +223,23 @@ P _addressDeserializeProp

( return (reader.readLong(offset)) as P; case 1: return (reader.readObjectOrNull( - offset, - DerivationPathSchema.deserialize, - allOffsets, - )) as P; + offset, + DerivationPathSchema.deserialize, + allOffsets, + )) + as P; case 2: return (reader.readStringOrNull(offset)) as P; case 3: return (reader.readByteList(offset) ?? []) as P; case 4: return (_AddresssubTypeValueEnumMap[reader.readByteOrNull(offset)] ?? - AddressSubType.receiving) as P; + AddressSubType.receiving) + as P; case 5: return (_AddresstypeValueEnumMap[reader.readByteOrNull(offset)] ?? - AddressType.p2pkh) as P; + AddressType.p2pkh) + as P; case 6: return (reader.readString(offset)) as P; case 7: @@ -316,8 +324,12 @@ List> _addressGetLinks(Address object) { void _addressAttach(IsarCollection col, Id id, Address object) { object.id = id; - object.transactions - .attach(col, col.isar.collection(), r'transactions', id); + object.transactions.attach( + col, + col.isar.collection(), + r'transactions', + id, + ); } extension AddressByIndex on IsarCollection

{ @@ -338,10 +350,14 @@ extension AddressByIndex on IsarCollection
{ } Future> getAllByValueWalletId( - List valueValues, List walletIdValues) { + List valueValues, + List walletIdValues, + ) { final len = valueValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([valueValues[i], walletIdValues[i]]); @@ -351,10 +367,14 @@ extension AddressByIndex on IsarCollection
{ } List getAllByValueWalletIdSync( - List valueValues, List walletIdValues) { + List valueValues, + List walletIdValues, + ) { final len = valueValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([valueValues[i], walletIdValues[i]]); @@ -364,10 +384,14 @@ extension AddressByIndex on IsarCollection
{ } Future deleteAllByValueWalletId( - List valueValues, List walletIdValues) { + List valueValues, + List walletIdValues, + ) { final len = valueValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([valueValues[i], walletIdValues[i]]); @@ -377,10 +401,14 @@ extension AddressByIndex on IsarCollection
{ } int deleteAllByValueWalletIdSync( - List valueValues, List walletIdValues) { + List valueValues, + List walletIdValues, + ) { final len = valueValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([valueValues[i], walletIdValues[i]]); @@ -401,8 +429,10 @@ extension AddressByIndex on IsarCollection
{ return putAllByIndex(r'value_walletId', objects); } - List putAllByValueWalletIdSync(List
objects, - {bool saveLinks = true}) { + List putAllByValueWalletIdSync( + List
objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'value_walletId', objects, saveLinks: saveLinks); } } @@ -426,10 +456,7 @@ extension AddressQueryWhereSort on QueryBuilder { extension AddressQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -455,8 +482,10 @@ extension AddressQueryWhere on QueryBuilder { }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -464,8 +493,10 @@ extension AddressQueryWhere on QueryBuilder { }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -480,191 +511,235 @@ extension AddressQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder walletIdEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder walletIdNotEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder valueEqualToAnyWalletId( - String value) { + String value, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'value_walletId', - value: [value], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'value_walletId', value: [value]), + ); }); } QueryBuilder valueNotEqualToAnyWalletId( - String value) { + String value, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'value_walletId', - lower: [], - upper: [value], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'value_walletId', - lower: [value], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'value_walletId', + lower: [], + upper: [value], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'value_walletId', + lower: [value], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'value_walletId', - lower: [value], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'value_walletId', - lower: [], - upper: [value], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'value_walletId', + lower: [value], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'value_walletId', + lower: [], + upper: [value], + includeUpper: false, + ), + ); } }); } QueryBuilder valueWalletIdEqualTo( - String value, String walletId) { + String value, + String walletId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'value_walletId', - value: [value, walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'value_walletId', + value: [value, walletId], + ), + ); }); } QueryBuilder - valueEqualToWalletIdNotEqualTo(String value, String walletId) { + valueEqualToWalletIdNotEqualTo(String value, String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'value_walletId', - lower: [value], - upper: [value, walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'value_walletId', - lower: [value, walletId], - includeLower: false, - upper: [value], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'value_walletId', + lower: [value], + upper: [value, walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'value_walletId', + lower: [value, walletId], + includeLower: false, + upper: [value], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'value_walletId', - lower: [value, walletId], - includeLower: false, - upper: [value], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'value_walletId', - lower: [value], - upper: [value, walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'value_walletId', + lower: [value, walletId], + includeLower: false, + upper: [value], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'value_walletId', + lower: [value], + upper: [value, walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder derivationIndexEqualTo( - int derivationIndex) { + int derivationIndex, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'derivationIndex', - value: [derivationIndex], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'derivationIndex', + value: [derivationIndex], + ), + ); }); } QueryBuilder derivationIndexNotEqualTo( - int derivationIndex) { + int derivationIndex, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'derivationIndex', - lower: [], - upper: [derivationIndex], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'derivationIndex', - lower: [derivationIndex], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'derivationIndex', + lower: [], + upper: [derivationIndex], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'derivationIndex', + lower: [derivationIndex], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'derivationIndex', - lower: [derivationIndex], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'derivationIndex', - lower: [], - upper: [derivationIndex], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'derivationIndex', + lower: [derivationIndex], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'derivationIndex', + lower: [], + upper: [derivationIndex], + includeUpper: false, + ), + ); } }); } @@ -674,12 +749,14 @@ extension AddressQueryWhere on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'derivationIndex', - lower: [derivationIndex], - includeLower: include, - upper: [], - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'derivationIndex', + lower: [derivationIndex], + includeLower: include, + upper: [], + ), + ); }); } @@ -688,12 +765,14 @@ extension AddressQueryWhere on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'derivationIndex', - lower: [], - upper: [derivationIndex], - includeUpper: include, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'derivationIndex', + lower: [], + upper: [derivationIndex], + includeUpper: include, + ), + ); }); } @@ -704,13 +783,15 @@ extension AddressQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'derivationIndex', - lower: [lowerDerivationIndex], - includeLower: includeLower, - upper: [upperDerivationIndex], - includeUpper: includeUpper, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'derivationIndex', + lower: [lowerDerivationIndex], + includeLower: includeLower, + upper: [upperDerivationIndex], + includeUpper: includeUpper, + ), + ); }); } } @@ -718,26 +799,25 @@ extension AddressQueryWhere on QueryBuilder { extension AddressQueryFilter on QueryBuilder { QueryBuilder derivationIndexEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'derivationIndex', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'derivationIndex', value: value), + ); }); } QueryBuilder - derivationIndexGreaterThan( - int value, { - bool include = false, - }) { + derivationIndexGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'derivationIndex', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'derivationIndex', + value: value, + ), + ); }); } @@ -746,11 +826,13 @@ extension AddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'derivationIndex', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'derivationIndex', + value: value, + ), + ); }); } @@ -761,39 +843,40 @@ extension AddressQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'derivationIndex', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'derivationIndex', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder derivationPathIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'derivationPath', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'derivationPath'), + ); }); } QueryBuilder - derivationPathIsNotNull() { + derivationPathIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'derivationPath', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'derivationPath'), + ); }); } QueryBuilder idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -802,11 +885,13 @@ extension AddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -815,11 +900,13 @@ extension AddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -830,29 +917,31 @@ extension AddressQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder otherDataIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'otherData', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'otherData'), + ); }); } QueryBuilder otherDataIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'otherData', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'otherData'), + ); }); } @@ -861,11 +950,13 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -875,12 +966,14 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -890,12 +983,14 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -907,14 +1002,16 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'otherData', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'otherData', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -923,11 +1020,13 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -936,91 +1035,95 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder otherDataContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder otherDataMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'otherData', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'otherData', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder otherDataIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherData', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'otherData', value: ''), + ); }); } QueryBuilder otherDataIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'otherData', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'otherData', value: ''), + ); }); } QueryBuilder publicKeyElementEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'publicKey', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'publicKey', value: value), + ); }); } QueryBuilder - publicKeyElementGreaterThan( - int value, { - bool include = false, - }) { + publicKeyElementGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'publicKey', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'publicKey', + value: value, + ), + ); }); } QueryBuilder - publicKeyElementLessThan( - int value, { - bool include = false, - }) { + publicKeyElementLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'publicKey', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'publicKey', + value: value, + ), + ); }); } @@ -1031,50 +1134,35 @@ extension AddressQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'publicKey', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'publicKey', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder publicKeyLengthEqualTo( - int length) { + int length, + ) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'publicKey', - length, - true, - length, - true, - ); + return query.listLength(r'publicKey', length, true, length, true); }); } QueryBuilder publicKeyIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'publicKey', - 0, - true, - 0, - true, - ); + return query.listLength(r'publicKey', 0, true, 0, true); }); } QueryBuilder publicKeyIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'publicKey', - 0, - false, - 999999, - true, - ); + return query.listLength(r'publicKey', 0, false, 999999, true); }); } @@ -1083,29 +1171,14 @@ extension AddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'publicKey', - 0, - true, - length, - include, - ); + return query.listLength(r'publicKey', 0, true, length, include); }); } QueryBuilder - publicKeyLengthGreaterThan( - int length, { - bool include = false, - }) { + publicKeyLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'publicKey', - length, - include, - 999999, - true, - ); + return query.listLength(r'publicKey', length, include, 999999, true); }); } @@ -1127,12 +1200,12 @@ extension AddressQueryFilter } QueryBuilder subTypeEqualTo( - AddressSubType value) { + AddressSubType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'subType', value: value), + ); }); } @@ -1141,11 +1214,13 @@ extension AddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'subType', + value: value, + ), + ); }); } @@ -1154,11 +1229,13 @@ extension AddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'subType', + value: value, + ), + ); }); } @@ -1169,23 +1246,25 @@ extension AddressQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'subType', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'subType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder typeEqualTo( - AddressType value) { + AddressType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'type', value: value), + ); }); } @@ -1194,11 +1273,13 @@ extension AddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -1207,11 +1288,13 @@ extension AddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -1222,13 +1305,15 @@ extension AddressQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'type', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'type', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -1237,11 +1322,13 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1251,12 +1338,14 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1266,12 +1355,14 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1283,14 +1374,16 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'value', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1299,11 +1392,13 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1312,53 +1407,59 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder valueContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder valueMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'value', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'value', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder valueIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'value', value: ''), + ); }); } QueryBuilder valueIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'value', value: ''), + ); }); } @@ -1367,11 +1468,13 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1381,12 +1484,14 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1396,12 +1501,14 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1413,14 +1520,16 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1429,11 +1538,13 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1442,79 +1553,85 @@ extension AddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } QueryBuilder zSafeFrostIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'zSafeFrost', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'zSafeFrost'), + ); }); } QueryBuilder zSafeFrostIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'zSafeFrost', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'zSafeFrost'), + ); }); } QueryBuilder zSafeFrostEqualTo( - bool? value) { + bool? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'zSafeFrost', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'zSafeFrost', value: value), + ); }); } } @@ -1522,7 +1639,8 @@ extension AddressQueryFilter extension AddressQueryObject on QueryBuilder { QueryBuilder derivationPath( - FilterQuery q) { + FilterQuery q, + ) { return QueryBuilder.apply(this, (query) { return query.object(q, r'derivationPath'); }); @@ -1532,14 +1650,15 @@ extension AddressQueryObject extension AddressQueryLinks on QueryBuilder { QueryBuilder transactions( - FilterQuery q) { + FilterQuery q, + ) { return QueryBuilder.apply(this, (query) { return query.link(q, r'transactions'); }); } QueryBuilder - transactionsLengthEqualTo(int length) { + transactionsLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { return query.linkLength(r'transactions', length, true, length, true); }); @@ -1552,34 +1671,28 @@ extension AddressQueryLinks } QueryBuilder - transactionsIsNotEmpty() { + transactionsIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.linkLength(r'transactions', 0, false, 999999, true); }); } QueryBuilder - transactionsLengthLessThan( - int length, { - bool include = false, - }) { + transactionsLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.linkLength(r'transactions', 0, true, length, include); }); } QueryBuilder - transactionsLengthGreaterThan( - int length, { - bool include = false, - }) { + transactionsLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.linkLength(r'transactions', length, include, 999999, true); }); } QueryBuilder - transactionsLengthBetween( + transactionsLengthBetween( int lower, int upper, { bool includeLower = true, @@ -1587,7 +1700,12 @@ extension AddressQueryLinks }) { return QueryBuilder.apply(this, (query) { return query.linkLength( - r'transactions', lower, includeLower, upper, includeUpper); + r'transactions', + lower, + includeLower, + upper, + includeUpper, + ); }); } } @@ -1785,8 +1903,9 @@ extension AddressQueryWhereDistinct }); } - QueryBuilder distinctByOtherData( - {bool caseSensitive = true}) { + QueryBuilder distinctByOtherData({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'otherData', caseSensitive: caseSensitive); }); @@ -1810,15 +1929,17 @@ extension AddressQueryWhereDistinct }); } - QueryBuilder distinctByValue( - {bool caseSensitive = true}) { + QueryBuilder distinctByValue({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'value', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); @@ -1846,7 +1967,7 @@ extension AddressQueryProperty } QueryBuilder - derivationPathProperty() { + derivationPathProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'derivationPath'); }); @@ -1906,12 +2027,9 @@ const DerivationPathSchema = Schema( name: r'DerivationPath', id: -7377061614393881103, properties: { - r'value': PropertySchema( - id: 0, - name: r'value', - type: IsarType.string, - ) + r'value': PropertySchema(id: 0, name: r'value', type: IsarType.string), }, + estimateSize: _derivationPathEstimateSize, serialize: _derivationPathSerialize, deserialize: _derivationPathDeserialize, @@ -1965,53 +2083,56 @@ P _derivationPathDeserializeProp

( extension DerivationPathQueryFilter on QueryBuilder { QueryBuilder - valueEqualTo( - String value, { - bool caseSensitive = true, - }) { + valueEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueGreaterThan( + valueGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueLessThan( + valueLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueBetween( + valueBetween( String lower, String upper, { bool includeLower = true, @@ -2019,84 +2140,86 @@ extension DerivationPathQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'value', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStartsWith( - String value, { - bool caseSensitive = true, - }) { + valueStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueEndsWith( - String value, { - bool caseSensitive = true, - }) { + valueEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueContains(String value, {bool caseSensitive = true}) { + valueContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueMatches(String pattern, {bool caseSensitive = true}) { + valueMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'value', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'value', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIsEmpty() { + valueIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'value', value: ''), + ); }); } QueryBuilder - valueIsNotEmpty() { + valueIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'value', value: ''), + ); }); } } diff --git a/lib/models/isar/models/blockchain_data/input.g.dart b/lib/models/isar/models/blockchain_data/input.g.dart index a08dc7637c..01f1e93576 100644 --- a/lib/models/isar/models/blockchain_data/input.g.dart +++ b/lib/models/isar/models/blockchain_data/input.g.dart @@ -33,27 +33,12 @@ const InputSchema = Schema( name: r'scriptSigAsm', type: IsarType.string, ), - r'sequence': PropertySchema( - id: 4, - name: r'sequence', - type: IsarType.long, - ), - r'txid': PropertySchema( - id: 5, - name: r'txid', - type: IsarType.string, - ), - r'vout': PropertySchema( - id: 6, - name: r'vout', - type: IsarType.long, - ), - r'witness': PropertySchema( - id: 7, - name: r'witness', - type: IsarType.string, - ) + r'sequence': PropertySchema(id: 4, name: r'sequence', type: IsarType.long), + r'txid': PropertySchema(id: 5, name: r'txid', type: IsarType.string), + r'vout': PropertySchema(id: 6, name: r'vout', type: IsarType.long), + r'witness': PropertySchema(id: 7, name: r'witness', type: IsarType.string), }, + estimateSize: _inputEstimateSize, serialize: _inputSerialize, deserialize: _inputDeserialize, @@ -159,20 +144,20 @@ P _inputDeserializeProp

( extension InputQueryFilter on QueryBuilder { QueryBuilder - innerRedeemScriptAsmIsNull() { + innerRedeemScriptAsmIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'innerRedeemScriptAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'innerRedeemScriptAsm'), + ); }); } QueryBuilder - innerRedeemScriptAsmIsNotNull() { + innerRedeemScriptAsmIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'innerRedeemScriptAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'innerRedeemScriptAsm'), + ); }); } @@ -181,43 +166,49 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmGreaterThan( + innerRedeemScriptAsmGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmLessThan( + innerRedeemScriptAsmLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -229,127 +220,133 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'innerRedeemScriptAsm', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'innerRedeemScriptAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmStartsWith( - String value, { - bool caseSensitive = true, - }) { + innerRedeemScriptAsmStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmEndsWith( - String value, { - bool caseSensitive = true, - }) { + innerRedeemScriptAsmEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmContains(String value, {bool caseSensitive = true}) { + innerRedeemScriptAsmContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder innerRedeemScriptAsmMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'innerRedeemScriptAsm', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'innerRedeemScriptAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmIsEmpty() { + innerRedeemScriptAsmIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'innerRedeemScriptAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'innerRedeemScriptAsm', value: ''), + ); }); } QueryBuilder - innerRedeemScriptAsmIsNotEmpty() { + innerRedeemScriptAsmIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'innerRedeemScriptAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'innerRedeemScriptAsm', + value: '', + ), + ); }); } QueryBuilder isCoinbaseIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'isCoinbase', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'isCoinbase'), + ); }); } QueryBuilder isCoinbaseIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'isCoinbase', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'isCoinbase'), + ); }); } QueryBuilder isCoinbaseEqualTo( - bool? value) { + bool? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isCoinbase', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isCoinbase', value: value), + ); }); } QueryBuilder scriptSigIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'scriptSig', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'scriptSig'), + ); }); } QueryBuilder scriptSigIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'scriptSig', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'scriptSig'), + ); }); } @@ -358,11 +355,13 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptSig', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -372,12 +371,14 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptSig', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -387,12 +388,14 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptSig', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -404,14 +407,16 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptSig', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptSig', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -420,11 +425,13 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptSig', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -433,69 +440,75 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptSig', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptSig', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptSig', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptSig', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptSig', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptSig', value: ''), + ); }); } QueryBuilder scriptSigIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptSig', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptSig', value: ''), + ); }); } QueryBuilder scriptSigAsmIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'scriptSigAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'scriptSigAsm'), + ); }); } QueryBuilder scriptSigAsmIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'scriptSigAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'scriptSigAsm'), + ); }); } @@ -504,11 +517,13 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -518,12 +533,14 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -533,12 +550,14 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -550,14 +569,16 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptSigAsm', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptSigAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -566,11 +587,13 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -579,79 +602,85 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigAsmContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigAsmMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptSigAsm', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptSigAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigAsmIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptSigAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptSigAsm', value: ''), + ); }); } QueryBuilder scriptSigAsmIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptSigAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptSigAsm', value: ''), + ); }); } QueryBuilder sequenceIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'sequence', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'sequence'), + ); }); } QueryBuilder sequenceIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'sequence', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'sequence'), + ); }); } QueryBuilder sequenceEqualTo( - int? value) { + int? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sequence', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'sequence', value: value), + ); }); } @@ -660,11 +689,13 @@ extension InputQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'sequence', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'sequence', + value: value, + ), + ); }); } @@ -673,11 +704,13 @@ extension InputQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'sequence', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'sequence', + value: value, + ), + ); }); } @@ -688,13 +721,15 @@ extension InputQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'sequence', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'sequence', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -703,11 +738,13 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -717,12 +754,14 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -732,12 +771,14 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -749,14 +790,16 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'txid', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -765,11 +808,13 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -778,60 +823,67 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder txidContains(String value, - {bool caseSensitive = true}) { + QueryBuilder txidContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder txidMatches(String pattern, - {bool caseSensitive = true}) { + QueryBuilder txidMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txid', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txid', value: ''), + ); }); } QueryBuilder txidIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txid', value: ''), + ); }); } QueryBuilder voutEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'vout', value: value), + ); }); } @@ -840,11 +892,13 @@ extension InputQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'vout', + value: value, + ), + ); }); } @@ -853,11 +907,13 @@ extension InputQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'vout', + value: value, + ), + ); }); } @@ -868,29 +924,31 @@ extension InputQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'vout', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'vout', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder witnessIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'witness', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'witness'), + ); }); } QueryBuilder witnessIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'witness', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'witness'), + ); }); } @@ -899,11 +957,13 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -913,12 +973,14 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -928,12 +990,14 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -945,14 +1009,16 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'witness', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'witness', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -961,11 +1027,13 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -974,53 +1042,59 @@ extension InputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder witnessContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder witnessMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'witness', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'witness', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder witnessIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'witness', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'witness', value: ''), + ); }); } QueryBuilder witnessIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'witness', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'witness', value: ''), + ); }); } } diff --git a/lib/models/isar/models/blockchain_data/output.g.dart b/lib/models/isar/models/blockchain_data/output.g.dart index 6a58123736..e269631178 100644 --- a/lib/models/isar/models/blockchain_data/output.g.dart +++ b/lib/models/isar/models/blockchain_data/output.g.dart @@ -33,12 +33,9 @@ const OutputSchema = Schema( name: r'scriptPubKeyType', type: IsarType.string, ), - r'value': PropertySchema( - id: 4, - name: r'value', - type: IsarType.long, - ) + r'value': PropertySchema(id: 4, name: r'value', type: IsarType.long), }, + estimateSize: _outputEstimateSize, serialize: _outputSerialize, deserialize: _outputDeserialize, @@ -127,17 +124,17 @@ P _outputDeserializeProp

( extension OutputQueryFilter on QueryBuilder { QueryBuilder scriptPubKeyIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'scriptPubKey', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'scriptPubKey'), + ); }); } QueryBuilder scriptPubKeyIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'scriptPubKey', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'scriptPubKey'), + ); }); } @@ -146,11 +143,13 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKey', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -160,12 +159,14 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptPubKey', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -175,12 +176,14 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptPubKey', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -192,14 +195,16 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptPubKey', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptPubKey', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -208,11 +213,13 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptPubKey', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -221,104 +228,113 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptPubKey', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptPubKeyContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptPubKey', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptPubKeyMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptPubKey', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptPubKey', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptPubKeyIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKey', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptPubKey', value: ''), + ); }); } QueryBuilder scriptPubKeyIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptPubKey', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptPubKey', value: ''), + ); }); } QueryBuilder - scriptPubKeyAddressEqualTo( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyAddressEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAddressGreaterThan( + scriptPubKeyAddressGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptPubKeyAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAddressLessThan( + scriptPubKeyAddressLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptPubKeyAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAddressBetween( + scriptPubKeyAddressBetween( String lower, String upper, { bool includeLower = true, @@ -326,101 +342,106 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptPubKeyAddress', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptPubKeyAddress', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAddressStartsWith( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyAddressStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptPubKeyAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAddressEndsWith( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyAddressEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptPubKeyAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAddressContains(String value, {bool caseSensitive = true}) { + scriptPubKeyAddressContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptPubKeyAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAddressMatches(String pattern, {bool caseSensitive = true}) { + scriptPubKeyAddressMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptPubKeyAddress', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptPubKeyAddress', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAddressIsEmpty() { + scriptPubKeyAddressIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyAddress', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptPubKeyAddress', value: ''), + ); }); } QueryBuilder - scriptPubKeyAddressIsNotEmpty() { + scriptPubKeyAddressIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptPubKeyAddress', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'scriptPubKeyAddress', + value: '', + ), + ); }); } QueryBuilder scriptPubKeyAsmIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'scriptPubKeyAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'scriptPubKeyAsm'), + ); }); } QueryBuilder - scriptPubKeyAsmIsNotNull() { + scriptPubKeyAsmIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'scriptPubKeyAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'scriptPubKeyAsm'), + ); }); } @@ -429,27 +450,31 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmGreaterThan( + scriptPubKeyAsmGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -459,12 +484,14 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -476,14 +503,16 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptPubKeyAsm', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptPubKeyAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -492,11 +521,13 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -505,71 +536,77 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptPubKeyAsmContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptPubKeyAsmMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptPubKeyAsm', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptPubKeyAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptPubKeyAsmIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptPubKeyAsm', value: ''), + ); }); } QueryBuilder - scriptPubKeyAsmIsNotEmpty() { + scriptPubKeyAsmIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptPubKeyAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptPubKeyAsm', value: ''), + ); }); } QueryBuilder scriptPubKeyTypeIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'scriptPubKeyType', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'scriptPubKeyType'), + ); }); } QueryBuilder - scriptPubKeyTypeIsNotNull() { + scriptPubKeyTypeIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'scriptPubKeyType', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'scriptPubKeyType'), + ); }); } @@ -578,27 +615,31 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyType', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyTypeGreaterThan( + scriptPubKeyTypeGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptPubKeyType', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -608,12 +649,14 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptPubKeyType', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -625,28 +668,29 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptPubKeyType', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptPubKeyType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyTypeStartsWith( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyTypeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptPubKeyType', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -655,64 +699,69 @@ extension OutputQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptPubKeyType', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptPubKeyTypeContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptPubKeyType', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptPubKeyTypeMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptPubKeyType', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptPubKeyType', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyTypeIsEmpty() { + scriptPubKeyTypeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyType', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptPubKeyType', value: ''), + ); }); } QueryBuilder - scriptPubKeyTypeIsNotEmpty() { + scriptPubKeyTypeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptPubKeyType', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptPubKeyType', value: ''), + ); }); } QueryBuilder valueEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'value', value: value), + ); }); } @@ -721,11 +770,13 @@ extension OutputQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'value', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + ), + ); }); } @@ -734,11 +785,13 @@ extension OutputQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'value', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + ), + ); }); } @@ -749,13 +802,15 @@ extension OutputQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'value', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } } diff --git a/lib/models/isar/models/blockchain_data/transaction.g.dart b/lib/models/isar/models/blockchain_data/transaction.g.dart index 3d9a3d4094..aa41d834b7 100644 --- a/lib/models/isar/models/blockchain_data/transaction.g.dart +++ b/lib/models/isar/models/blockchain_data/transaction.g.dart @@ -17,30 +17,19 @@ const TransactionSchema = CollectionSchema( name: r'Transaction', id: 5320225499417954855, properties: { - r'amount': PropertySchema( - id: 0, - name: r'amount', - type: IsarType.long, - ), + r'amount': PropertySchema(id: 0, name: r'amount', type: IsarType.long), r'amountString': PropertySchema( id: 1, name: r'amountString', type: IsarType.string, ), - r'fee': PropertySchema( - id: 2, - name: r'fee', - type: IsarType.long, - ), - r'height': PropertySchema( - id: 3, - name: r'height', - type: IsarType.long, - ), + r'fee': PropertySchema(id: 2, name: r'fee', type: IsarType.long), + r'height': PropertySchema(id: 3, name: r'height', type: IsarType.long), r'inputs': PropertySchema( id: 4, name: r'inputs', type: IsarType.objectList, + target: r'Input', ), r'isCancelled': PropertySchema( @@ -53,11 +42,7 @@ const TransactionSchema = CollectionSchema( name: r'isLelantus', type: IsarType.bool, ), - r'nonce': PropertySchema( - id: 7, - name: r'nonce', - type: IsarType.long, - ), + r'nonce': PropertySchema(id: 7, name: r'nonce', type: IsarType.long), r'numberOfMessages': PropertySchema( id: 8, name: r'numberOfMessages', @@ -72,13 +57,10 @@ const TransactionSchema = CollectionSchema( id: 10, name: r'outputs', type: IsarType.objectList, + target: r'Output', ), - r'slateId': PropertySchema( - id: 11, - name: r'slateId', - type: IsarType.string, - ), + r'slateId': PropertySchema(id: 11, name: r'slateId', type: IsarType.string), r'subType': PropertySchema( id: 12, name: r'subType', @@ -90,11 +72,7 @@ const TransactionSchema = CollectionSchema( name: r'timestamp', type: IsarType.long, ), - r'txid': PropertySchema( - id: 14, - name: r'txid', - type: IsarType.string, - ), + r'txid': PropertySchema(id: 14, name: r'txid', type: IsarType.string), r'type': PropertySchema( id: 15, name: r'type', @@ -105,8 +83,9 @@ const TransactionSchema = CollectionSchema( id: 16, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _transactionEstimateSize, serialize: _transactionSerialize, deserialize: _transactionDeserialize, @@ -123,7 +102,7 @@ const TransactionSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'txid_walletId': IndexSchema( @@ -141,7 +120,7 @@ const TransactionSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'timestamp': IndexSchema( @@ -154,9 +133,9 @@ const TransactionSchema = CollectionSchema( name: r'timestamp', type: IndexType.value, caseSensitive: false, - ) + ), ], - ) + ), }, links: { r'address': LinkSchema( @@ -165,13 +144,14 @@ const TransactionSchema = CollectionSchema( target: r'Address', single: true, linkName: r'transactions', - ) + ), }, embeddedSchemas: {r'Input': InputSchema, r'Output': OutputSchema}, + getId: _transactionGetId, getLinks: _transactionGetLinks, attach: _transactionAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _transactionEstimateSize( @@ -265,7 +245,8 @@ Transaction _transactionDeserialize( amountString: reader.readStringOrNull(offsets[1]), fee: reader.readLong(offsets[2]), height: reader.readLongOrNull(offsets[3]), - inputs: reader.readObjectList( + inputs: + reader.readObjectList( offsets[4], InputSchema.deserialize, allOffsets, @@ -277,7 +258,8 @@ Transaction _transactionDeserialize( nonce: reader.readLongOrNull(offsets[7]), numberOfMessages: reader.readLongOrNull(offsets[8]), otherData: reader.readStringOrNull(offsets[9]), - outputs: reader.readObjectList( + outputs: + reader.readObjectList( offsets[10], OutputSchema.deserialize, allOffsets, @@ -287,10 +269,11 @@ Transaction _transactionDeserialize( slateId: reader.readStringOrNull(offsets[11]), subType: _TransactionsubTypeValueEnumMap[reader.readByteOrNull(offsets[12])] ?? - TransactionSubType.none, + TransactionSubType.none, timestamp: reader.readLong(offsets[13]), txid: reader.readString(offsets[14]), - type: _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[15])] ?? + type: + _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[15])] ?? TransactionType.outgoing, walletId: reader.readString(offsets[16]), ); @@ -315,12 +298,13 @@ P _transactionDeserializeProp

( return (reader.readLongOrNull(offset)) as P; case 4: return (reader.readObjectList( - offset, - InputSchema.deserialize, - allOffsets, - Input(), - ) ?? - []) as P; + offset, + InputSchema.deserialize, + allOffsets, + Input(), + ) ?? + []) + as P; case 5: return (reader.readBool(offset)) as P; case 6: @@ -333,24 +317,27 @@ P _transactionDeserializeProp

( return (reader.readStringOrNull(offset)) as P; case 10: return (reader.readObjectList( - offset, - OutputSchema.deserialize, - allOffsets, - Output(), - ) ?? - []) as P; + offset, + OutputSchema.deserialize, + allOffsets, + Output(), + ) ?? + []) + as P; case 11: return (reader.readStringOrNull(offset)) as P; case 12: return (_TransactionsubTypeValueEnumMap[reader.readByteOrNull(offset)] ?? - TransactionSubType.none) as P; + TransactionSubType.none) + as P; case 13: 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; + TransactionType.outgoing) + as P; case 16: return (reader.readString(offset)) as P; default: @@ -404,7 +391,10 @@ List> _transactionGetLinks(Transaction object) { } void _transactionAttach( - IsarCollection col, Id id, Transaction object) { + IsarCollection col, + Id id, + Transaction object, +) { object.id = id; object.address.attach(col, col.isar.collection

(), r'address', id); } @@ -427,10 +417,14 @@ extension TransactionByIndex on IsarCollection { } Future> getAllByTxidWalletId( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -440,10 +434,14 @@ extension TransactionByIndex on IsarCollection { } List getAllByTxidWalletIdSync( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -453,10 +451,14 @@ extension TransactionByIndex on IsarCollection { } Future deleteAllByTxidWalletId( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -466,10 +468,14 @@ extension TransactionByIndex on IsarCollection { } int deleteAllByTxidWalletIdSync( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -490,8 +496,10 @@ extension TransactionByIndex on IsarCollection { return putAllByIndex(r'txid_walletId', objects); } - List putAllByTxidWalletIdSync(List objects, - {bool saveLinks = true}) { + List putAllByTxidWalletIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'txid_walletId', objects, saveLinks: saveLinks); } } @@ -517,15 +525,13 @@ extension TransactionQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder idNotEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -547,8 +553,10 @@ extension TransactionQueryWhere }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -556,8 +564,10 @@ extension TransactionQueryWhere }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -572,207 +582,245 @@ extension TransactionQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder walletIdEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder walletIdNotEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder - txidEqualToAnyWalletId(String txid) { + txidEqualToAnyWalletId(String txid) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId', - value: [txid], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'txid_walletId', value: [txid]), + ); }); } QueryBuilder - txidNotEqualToAnyWalletId(String txid) { + txidNotEqualToAnyWalletId(String txid) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [], - upper: [txid], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [], + upper: [txid], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [], - upper: [txid], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [], + upper: [txid], + includeUpper: false, + ), + ); } }); } QueryBuilder txidWalletIdEqualTo( - String txid, String walletId) { + String txid, + String walletId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId', - value: [txid, walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'txid_walletId', + value: [txid, walletId], + ), + ); }); } QueryBuilder - txidEqualToWalletIdNotEqualTo(String txid, String walletId) { + txidEqualToWalletIdNotEqualTo(String txid, String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder timestampEqualTo( - int timestamp) { + int timestamp, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'timestamp', - value: [timestamp], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'timestamp', value: [timestamp]), + ); }); } QueryBuilder timestampNotEqualTo( - int timestamp) { + int timestamp, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [], - upper: [timestamp], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [timestamp], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [], + upper: [timestamp], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [timestamp], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [timestamp], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [], - upper: [timestamp], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [timestamp], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [], + upper: [timestamp], + includeUpper: false, + ), + ); } }); } QueryBuilder - timestampGreaterThan( - int timestamp, { - bool include = false, - }) { + timestampGreaterThan(int timestamp, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [timestamp], - includeLower: include, - upper: [], - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [timestamp], + includeLower: include, + upper: [], + ), + ); }); } @@ -781,12 +829,14 @@ extension TransactionQueryWhere bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [], - upper: [timestamp], - includeUpper: include, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [], + upper: [timestamp], + includeUpper: include, + ), + ); }); } @@ -797,13 +847,15 @@ extension TransactionQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [lowerTimestamp], - includeLower: includeLower, - upper: [upperTimestamp], - includeUpper: includeUpper, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [lowerTimestamp], + includeLower: includeLower, + upper: [upperTimestamp], + includeUpper: includeUpper, + ), + ); }); } } @@ -811,26 +863,25 @@ extension TransactionQueryWhere extension TransactionQueryFilter on QueryBuilder { QueryBuilder amountEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'amount', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'amount', value: value), + ); }); } QueryBuilder - amountGreaterThan( - int value, { - bool include = false, - }) { + amountGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'amount', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'amount', + value: value, + ), + ); }); } @@ -839,11 +890,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'amount', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'amount', + value: value, + ), + ); }); } @@ -854,82 +907,87 @@ extension TransactionQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'amount', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'amount', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - amountStringIsNull() { + amountStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'amountString', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'amountString'), + ); }); } QueryBuilder - amountStringIsNotNull() { + amountStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'amountString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'amountString'), + ); }); } QueryBuilder - amountStringEqualTo( - String? value, { - bool caseSensitive = true, - }) { + amountStringEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'amountString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'amountString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - amountStringGreaterThan( + amountStringGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'amountString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'amountString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - amountStringLessThan( + amountStringLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'amountString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'amountString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - amountStringBetween( + amountStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -937,94 +995,96 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'amountString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'amountString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - amountStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + amountStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'amountString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'amountString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - amountStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + amountStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'amountString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'amountString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - amountStringContains(String value, {bool caseSensitive = true}) { + amountStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'amountString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'amountString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - amountStringMatches(String pattern, {bool caseSensitive = true}) { + amountStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'amountString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'amountString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - amountStringIsEmpty() { + amountStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'amountString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'amountString', value: ''), + ); }); } QueryBuilder - amountStringIsNotEmpty() { + amountStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'amountString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'amountString', value: ''), + ); }); } QueryBuilder feeEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'fee', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'fee', value: value), + ); }); } @@ -1033,11 +1093,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'fee', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'fee', + value: value, + ), + ); }); } @@ -1046,11 +1108,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'fee', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'fee', + value: value, + ), + ); }); } @@ -1061,54 +1125,55 @@ extension TransactionQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'fee', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'fee', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder heightIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'height', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'height'), + ); }); } QueryBuilder - heightIsNotNull() { + heightIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'height', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'height'), + ); }); } QueryBuilder heightEqualTo( - int? value) { + int? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'height', value: value), + ); }); } QueryBuilder - heightGreaterThan( - int? value, { - bool include = false, - }) { + heightGreaterThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'height', + value: value, + ), + ); }); } @@ -1117,11 +1182,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'height', + value: value, + ), + ); }); } @@ -1132,23 +1199,25 @@ extension TransactionQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'height', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'height', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -1157,11 +1226,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1170,11 +1241,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1185,89 +1258,55 @@ extension TransactionQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - inputsLengthEqualTo(int length) { + inputsLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - length, - true, - length, - true, - ); + return query.listLength(r'inputs', length, true, length, true); }); } QueryBuilder - inputsIsEmpty() { + inputsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - 0, - true, - 0, - true, - ); + return query.listLength(r'inputs', 0, true, 0, true); }); } QueryBuilder - inputsIsNotEmpty() { + inputsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - 0, - false, - 999999, - true, - ); + return query.listLength(r'inputs', 0, false, 999999, true); }); } QueryBuilder - inputsLengthLessThan( - int length, { - bool include = false, - }) { + inputsLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - 0, - true, - length, - include, - ); + return query.listLength(r'inputs', 0, true, length, include); }); } QueryBuilder - inputsLengthGreaterThan( - int length, { - bool include = false, - }) { + inputsLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - length, - include, - 999999, - true, - ); + return query.listLength(r'inputs', length, include, 999999, true); }); } QueryBuilder - inputsLengthBetween( + inputsLengthBetween( int lower, int upper, { bool includeLower = true, @@ -1285,81 +1324,78 @@ extension TransactionQueryFilter } QueryBuilder - isCancelledEqualTo(bool value) { + isCancelledEqualTo(bool value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isCancelled', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isCancelled', value: value), + ); }); } QueryBuilder - isLelantusIsNull() { + isLelantusIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'isLelantus', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'isLelantus'), + ); }); } QueryBuilder - isLelantusIsNotNull() { + isLelantusIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'isLelantus', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'isLelantus'), + ); }); } QueryBuilder - isLelantusEqualTo(bool? value) { + isLelantusEqualTo(bool? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isLelantus', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isLelantus', value: value), + ); }); } QueryBuilder nonceIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'nonce', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'nonce'), + ); }); } QueryBuilder - nonceIsNotNull() { + nonceIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'nonce', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'nonce'), + ); }); } QueryBuilder nonceEqualTo( - int? value) { + int? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'nonce', value: value), + ); }); } QueryBuilder - nonceGreaterThan( - int? value, { - bool include = false, - }) { + nonceGreaterThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'nonce', + value: value, + ), + ); }); } @@ -1368,11 +1404,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'nonce', + value: value, + ), + ); }); } @@ -1383,156 +1421,160 @@ extension TransactionQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'nonce', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'nonce', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - numberOfMessagesIsNull() { + numberOfMessagesIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'numberOfMessages', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'numberOfMessages'), + ); }); } QueryBuilder - numberOfMessagesIsNotNull() { + numberOfMessagesIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'numberOfMessages', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'numberOfMessages'), + ); }); } QueryBuilder - numberOfMessagesEqualTo(int? value) { + numberOfMessagesEqualTo(int? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'numberOfMessages', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'numberOfMessages', value: value), + ); }); } QueryBuilder - numberOfMessagesGreaterThan( - int? value, { - bool include = false, - }) { + numberOfMessagesGreaterThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'numberOfMessages', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'numberOfMessages', + value: value, + ), + ); }); } QueryBuilder - numberOfMessagesLessThan( - int? value, { - bool include = false, - }) { + numberOfMessagesLessThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'numberOfMessages', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'numberOfMessages', + value: value, + ), + ); }); } QueryBuilder - numberOfMessagesBetween( + 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'numberOfMessages', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - otherDataIsNull() { + otherDataIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'otherData', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'otherData'), + ); }); } QueryBuilder - otherDataIsNotNull() { + otherDataIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'otherData', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'otherData'), + ); }); } QueryBuilder - otherDataEqualTo( - String? value, { - bool caseSensitive = true, - }) { + otherDataEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataGreaterThan( + otherDataGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataLessThan( + otherDataLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataBetween( + otherDataBetween( String? lower, String? upper, { bool includeLower = true, @@ -1540,160 +1582,126 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'otherData', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'otherData', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataStartsWith( - String value, { - bool caseSensitive = true, - }) { + otherDataStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataEndsWith( - String value, { - bool caseSensitive = true, - }) { + otherDataEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataContains(String value, {bool caseSensitive = true}) { + otherDataContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataMatches(String pattern, {bool caseSensitive = true}) { + otherDataMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'otherData', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'otherData', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataIsEmpty() { + otherDataIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherData', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'otherData', value: ''), + ); }); } QueryBuilder - otherDataIsNotEmpty() { + otherDataIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'otherData', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'otherData', value: ''), + ); }); } QueryBuilder - outputsLengthEqualTo(int length) { + outputsLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - length, - true, - length, - true, - ); + return query.listLength(r'outputs', length, true, length, true); }); } QueryBuilder - outputsIsEmpty() { + outputsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - 0, - true, - 0, - true, - ); + return query.listLength(r'outputs', 0, true, 0, true); }); } QueryBuilder - outputsIsNotEmpty() { + outputsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - 0, - false, - 999999, - true, - ); + return query.listLength(r'outputs', 0, false, 999999, true); }); } QueryBuilder - outputsLengthLessThan( - int length, { - bool include = false, - }) { + outputsLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - 0, - true, - length, - include, - ); + return query.listLength(r'outputs', 0, true, length, include); }); } QueryBuilder - outputsLengthGreaterThan( - int length, { - bool include = false, - }) { + outputsLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - length, - include, - 999999, - true, - ); + return query.listLength(r'outputs', length, include, 999999, true); }); } QueryBuilder - outputsLengthBetween( + outputsLengthBetween( int lower, int upper, { bool includeLower = true, @@ -1711,20 +1719,20 @@ extension TransactionQueryFilter } QueryBuilder - slateIdIsNull() { + slateIdIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'slateId', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'slateId'), + ); }); } QueryBuilder - slateIdIsNotNull() { + slateIdIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'slateId', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'slateId'), + ); }); } @@ -1733,27 +1741,31 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdGreaterThan( + slateIdGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1763,12 +1775,14 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1780,28 +1794,29 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'slateId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'slateId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + slateIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1810,79 +1825,84 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder slateIdContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder slateIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'slateId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'slateId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdIsEmpty() { + slateIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'slateId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'slateId', value: ''), + ); }); } QueryBuilder - slateIdIsNotEmpty() { + slateIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'slateId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'slateId', value: ''), + ); }); } QueryBuilder subTypeEqualTo( - TransactionSubType value) { + TransactionSubType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'subType', value: value), + ); }); } QueryBuilder - subTypeGreaterThan( - TransactionSubType value, { - bool include = false, - }) { + subTypeGreaterThan(TransactionSubType value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'subType', + value: value, + ), + ); }); } @@ -1891,11 +1911,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'subType', + value: value, + ), + ); }); } @@ -1906,69 +1928,70 @@ extension TransactionQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'subType', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'subType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - timestampEqualTo(int value) { + timestampEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'timestamp', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'timestamp', value: value), + ); }); } QueryBuilder - timestampGreaterThan( - int value, { - bool include = false, - }) { + timestampGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'timestamp', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'timestamp', + value: value, + ), + ); }); } QueryBuilder - timestampLessThan( - int value, { - bool include = false, - }) { + timestampLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'timestamp', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'timestamp', + value: value, + ), + ); }); } QueryBuilder - timestampBetween( + timestampBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'timestamp', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'timestamp', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -1977,11 +2000,13 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1991,12 +2016,14 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2006,12 +2033,14 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2023,14 +2052,16 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'txid', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2039,11 +2070,13 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2052,64 +2085,70 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txid', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txid', value: ''), + ); }); } QueryBuilder - txidIsNotEmpty() { + txidIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txid', value: ''), + ); }); } QueryBuilder typeEqualTo( - TransactionType value) { + TransactionType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'type', value: value), + ); }); } @@ -2118,11 +2157,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -2131,11 +2172,13 @@ extension TransactionQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -2146,13 +2189,15 @@ extension TransactionQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'type', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'type', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -2161,43 +2206,49 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdLessThan( + walletIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2209,85 +2260,88 @@ extension TransactionQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdEndsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdContains(String value, {bool caseSensitive = true}) { + walletIdContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -2295,14 +2349,16 @@ extension TransactionQueryFilter extension TransactionQueryObject on QueryBuilder { QueryBuilder inputsElement( - FilterQuery q) { + FilterQuery q, + ) { return QueryBuilder.apply(this, (query) { return query.object(q, r'inputs'); }); } QueryBuilder outputsElement( - FilterQuery q) { + FilterQuery q, + ) { return QueryBuilder.apply(this, (query) { return query.object(q, r'outputs'); }); @@ -2312,14 +2368,15 @@ extension TransactionQueryObject extension TransactionQueryLinks on QueryBuilder { QueryBuilder address( - FilterQuery
q) { + FilterQuery
q, + ) { return QueryBuilder.apply(this, (query) { return query.link(q, r'address'); }); } QueryBuilder - addressIsNull() { + addressIsNull() { return QueryBuilder.apply(this, (query) { return query.linkLength(r'address', 0, true, 0, true); }); @@ -2347,7 +2404,7 @@ extension TransactionQuerySortBy } QueryBuilder - sortByAmountStringDesc() { + sortByAmountStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'amountString', Sort.desc); }); @@ -2414,14 +2471,14 @@ extension TransactionQuerySortBy } QueryBuilder - sortByNumberOfMessages() { + sortByNumberOfMessages() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberOfMessages', Sort.asc); }); } QueryBuilder - sortByNumberOfMessagesDesc() { + sortByNumberOfMessagesDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberOfMessages', Sort.desc); }); @@ -2533,7 +2590,7 @@ extension TransactionQuerySortThenBy } QueryBuilder - thenByAmountStringDesc() { + thenByAmountStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'amountString', Sort.desc); }); @@ -2612,14 +2669,14 @@ extension TransactionQuerySortThenBy } QueryBuilder - thenByNumberOfMessages() { + thenByNumberOfMessages() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberOfMessages', Sort.asc); }); } QueryBuilder - thenByNumberOfMessagesDesc() { + thenByNumberOfMessagesDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberOfMessages', Sort.desc); }); @@ -2718,8 +2775,9 @@ extension TransactionQueryWhereDistinct }); } - QueryBuilder distinctByAmountString( - {bool caseSensitive = true}) { + QueryBuilder distinctByAmountString({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'amountString', caseSensitive: caseSensitive); }); @@ -2756,21 +2814,23 @@ extension TransactionQueryWhereDistinct } QueryBuilder - distinctByNumberOfMessages() { + distinctByNumberOfMessages() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'numberOfMessages'); }); } - QueryBuilder distinctByOtherData( - {bool caseSensitive = true}) { + QueryBuilder distinctByOtherData({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'otherData', caseSensitive: caseSensitive); }); } - QueryBuilder distinctBySlateId( - {bool caseSensitive = true}) { + QueryBuilder distinctBySlateId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'slateId', caseSensitive: caseSensitive); }); @@ -2788,8 +2848,9 @@ extension TransactionQueryWhereDistinct }); } - QueryBuilder distinctByTxid( - {bool caseSensitive = true}) { + QueryBuilder distinctByTxid({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'txid', caseSensitive: caseSensitive); }); @@ -2801,8 +2862,9 @@ extension TransactionQueryWhereDistinct }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); @@ -2890,7 +2952,7 @@ extension TransactionQueryProperty } QueryBuilder - subTypeProperty() { + subTypeProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'subType'); }); diff --git a/lib/models/isar/models/blockchain_data/utxo.g.dart b/lib/models/isar/models/blockchain_data/utxo.g.dart index 0d2a0fcd73..b338040982 100644 --- a/lib/models/isar/models/blockchain_data/utxo.g.dart +++ b/lib/models/isar/models/blockchain_data/utxo.g.dart @@ -17,11 +17,7 @@ const UTXOSchema = CollectionSchema( name: r'UTXO', id: 5934032492047519621, properties: { - r'address': PropertySchema( - id: 0, - name: r'address', - type: IsarType.string, - ), + r'address': PropertySchema(id: 0, name: r'address', type: IsarType.string), r'blockHash': PropertySchema( id: 1, name: r'blockHash', @@ -52,42 +48,23 @@ const UTXOSchema = CollectionSchema( name: r'isCoinbase', type: IsarType.bool, ), - r'name': PropertySchema( - id: 7, - name: r'name', - type: IsarType.string, - ), + r'name': PropertySchema(id: 7, name: r'name', type: IsarType.string), r'otherData': PropertySchema( id: 8, name: r'otherData', type: IsarType.string, ), - r'txid': PropertySchema( - id: 9, - name: r'txid', - type: IsarType.string, - ), - r'used': PropertySchema( - id: 10, - name: r'used', - type: IsarType.bool, - ), - r'value': PropertySchema( - id: 11, - name: r'value', - type: IsarType.long, - ), - r'vout': PropertySchema( - id: 12, - name: r'vout', - type: IsarType.long, - ), + r'txid': PropertySchema(id: 9, name: r'txid', type: IsarType.string), + r'used': PropertySchema(id: 10, name: r'used', type: IsarType.bool), + r'value': PropertySchema(id: 11, name: r'value', type: IsarType.long), + r'vout': PropertySchema(id: 12, name: r'vout', type: IsarType.long), r'walletId': PropertySchema( id: 13, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _uTXOEstimateSize, serialize: _uTXOSerialize, deserialize: _uTXODeserialize, @@ -104,7 +81,7 @@ const UTXOSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'txid_walletId_vout': IndexSchema( @@ -127,7 +104,7 @@ const UTXOSchema = CollectionSchema( name: r'vout', type: IndexType.value, caseSensitive: false, - ) + ), ], ), r'isBlocked': IndexSchema( @@ -140,16 +117,17 @@ const UTXOSchema = CollectionSchema( name: r'isBlocked', type: IndexType.value, caseSensitive: false, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _uTXOGetId, getLinks: _uTXOGetLinks, attach: _uTXOAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _uTXOEstimateSize( @@ -298,7 +276,10 @@ extension UTXOByIndex on IsarCollection { } Future deleteByTxidWalletIdVout( - String txid, String walletId, int vout) { + String txid, + String walletId, + int vout, + ) { return deleteByIndex(r'txid_walletId_vout', [txid, walletId, vout]); } @@ -306,11 +287,16 @@ extension UTXOByIndex on IsarCollection { return deleteByIndexSync(r'txid_walletId_vout', [txid, walletId, vout]); } - Future> getAllByTxidWalletIdVout(List txidValues, - List walletIdValues, List voutValues) { + Future> getAllByTxidWalletIdVout( + List txidValues, + List walletIdValues, + List voutValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len && voutValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len && voutValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i], voutValues[i]]); @@ -319,11 +305,16 @@ extension UTXOByIndex on IsarCollection { return getAllByIndex(r'txid_walletId_vout', values); } - List getAllByTxidWalletIdVoutSync(List txidValues, - List walletIdValues, List voutValues) { + List getAllByTxidWalletIdVoutSync( + List txidValues, + List walletIdValues, + List voutValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len && voutValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len && voutValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i], voutValues[i]]); @@ -332,11 +323,16 @@ extension UTXOByIndex on IsarCollection { return getAllByIndexSync(r'txid_walletId_vout', values); } - Future deleteAllByTxidWalletIdVout(List txidValues, - List walletIdValues, List voutValues) { + Future deleteAllByTxidWalletIdVout( + List txidValues, + List walletIdValues, + List voutValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len && voutValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len && voutValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i], voutValues[i]]); @@ -345,11 +341,16 @@ extension UTXOByIndex on IsarCollection { return deleteAllByIndex(r'txid_walletId_vout', values); } - int deleteAllByTxidWalletIdVoutSync(List txidValues, - List walletIdValues, List voutValues) { + int deleteAllByTxidWalletIdVoutSync( + List txidValues, + List walletIdValues, + List voutValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len && voutValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len && voutValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i], voutValues[i]]); @@ -370,10 +371,15 @@ extension UTXOByIndex on IsarCollection { return putAllByIndex(r'txid_walletId_vout', objects); } - List putAllByTxidWalletIdVoutSync(List objects, - {bool saveLinks = true}) { - return putAllByIndexSync(r'txid_walletId_vout', objects, - saveLinks: saveLinks); + List putAllByTxidWalletIdVoutSync( + List objects, { + bool saveLinks = true, + }) { + return putAllByIndexSync( + r'txid_walletId_vout', + objects, + saveLinks: saveLinks, + ); } } @@ -396,10 +402,7 @@ extension UTXOQueryWhereSort on QueryBuilder { extension UTXOQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -425,8 +428,10 @@ extension UTXOQueryWhere on QueryBuilder { }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -434,8 +439,10 @@ extension UTXOQueryWhere on QueryBuilder { }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -450,208 +457,260 @@ extension UTXOQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder walletIdEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder walletIdNotEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder txidEqualToAnyWalletIdVout( - String txid) { + String txid, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId_vout', - value: [txid], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'txid_walletId_vout', + value: [txid], + ), + ); }); } QueryBuilder txidNotEqualToAnyWalletIdVout( - String txid) { + String txid, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [], - upper: [txid], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [], + upper: [txid], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [], - upper: [txid], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [], + upper: [txid], + includeUpper: false, + ), + ); } }); } QueryBuilder txidWalletIdEqualToAnyVout( - String txid, String walletId) { + String txid, + String walletId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId_vout', - value: [txid, walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'txid_walletId_vout', + value: [txid, walletId], + ), + ); }); } QueryBuilder - txidEqualToWalletIdNotEqualToAnyVout(String txid, String walletId) { + txidEqualToWalletIdNotEqualToAnyVout(String txid, String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder txidWalletIdVoutEqualTo( - String txid, String walletId, int vout) { + String txid, + String walletId, + int vout, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId_vout', - value: [txid, walletId, vout], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'txid_walletId_vout', + value: [txid, walletId, vout], + ), + ); }); } QueryBuilder txidWalletIdEqualToVoutNotEqualTo( - String txid, String walletId, int vout) { + String txid, + String walletId, + int vout, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId], - upper: [txid, walletId, vout], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId, vout], - includeLower: false, - upper: [txid, walletId], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId], + upper: [txid, walletId, vout], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId, vout], + includeLower: false, + upper: [txid, walletId], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId, vout], - includeLower: false, - upper: [txid, walletId], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId], - upper: [txid, walletId, vout], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId, vout], + includeLower: false, + upper: [txid, walletId], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId], + upper: [txid, walletId, vout], + includeUpper: false, + ), + ); } }); } QueryBuilder - txidWalletIdEqualToVoutGreaterThan( + txidWalletIdEqualToVoutGreaterThan( String txid, String walletId, int vout, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId, vout], - includeLower: include, - upper: [txid, walletId], - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId, vout], + includeLower: include, + upper: [txid, walletId], + ), + ); }); } @@ -662,12 +721,14 @@ extension UTXOQueryWhere on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId], - upper: [txid, walletId, vout], - includeUpper: include, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId], + upper: [txid, walletId, vout], + includeUpper: include, + ), + ); }); } @@ -680,56 +741,66 @@ extension UTXOQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId_vout', - lower: [txid, walletId, lowerVout], - includeLower: includeLower, - upper: [txid, walletId, upperVout], - includeUpper: includeUpper, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId_vout', + lower: [txid, walletId, lowerVout], + includeLower: includeLower, + upper: [txid, walletId, upperVout], + includeUpper: includeUpper, + ), + ); }); } QueryBuilder isBlockedEqualTo(bool isBlocked) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'isBlocked', - value: [isBlocked], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'isBlocked', value: [isBlocked]), + ); }); } QueryBuilder isBlockedNotEqualTo( - bool isBlocked) { + bool isBlocked, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'isBlocked', - lower: [], - upper: [isBlocked], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'isBlocked', - lower: [isBlocked], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'isBlocked', + lower: [], + upper: [isBlocked], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'isBlocked', + lower: [isBlocked], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'isBlocked', - lower: [isBlocked], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'isBlocked', - lower: [], - upper: [isBlocked], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'isBlocked', + lower: [isBlocked], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'isBlocked', + lower: [], + upper: [isBlocked], + includeUpper: false, + ), + ); } }); } @@ -738,17 +809,17 @@ extension UTXOQueryWhere on QueryBuilder { extension UTXOQueryFilter on QueryBuilder { QueryBuilder addressIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'address', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'address'), + ); }); } QueryBuilder addressIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'address', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'address'), + ); }); } @@ -757,11 +828,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -771,12 +844,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -786,12 +861,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -803,14 +880,16 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'address', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'address', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -819,11 +898,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -832,67 +913,75 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder addressContains(String value, - {bool caseSensitive = true}) { + QueryBuilder addressContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder addressMatches(String pattern, - {bool caseSensitive = true}) { + QueryBuilder addressMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'address', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'address', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder addressIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'address', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'address', value: ''), + ); }); } QueryBuilder addressIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'address', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'address', value: ''), + ); }); } QueryBuilder blockHashIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'blockHash', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'blockHash'), + ); }); } QueryBuilder blockHashIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'blockHash', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'blockHash'), + ); }); } @@ -901,11 +990,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -915,12 +1006,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -930,12 +1023,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -947,14 +1042,16 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'blockHash', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'blockHash', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -963,11 +1060,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -976,79 +1075,85 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder blockHashContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder blockHashMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'blockHash', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'blockHash', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder blockHashIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'blockHash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'blockHash', value: ''), + ); }); } QueryBuilder blockHashIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'blockHash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'blockHash', value: ''), + ); }); } QueryBuilder blockHeightIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'blockHeight', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'blockHeight'), + ); }); } QueryBuilder blockHeightIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'blockHeight', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'blockHeight'), + ); }); } QueryBuilder blockHeightEqualTo( - int? value) { + int? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'blockHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'blockHeight', value: value), + ); }); } @@ -1057,11 +1162,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'blockHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'blockHeight', + value: value, + ), + ); }); } @@ -1070,11 +1177,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'blockHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'blockHeight', + value: value, + ), + ); }); } @@ -1085,38 +1194,39 @@ extension UTXOQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'blockHeight', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'blockHeight', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder blockTimeIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'blockTime', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'blockTime'), + ); }); } QueryBuilder blockTimeIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'blockTime', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'blockTime'), + ); }); } QueryBuilder blockTimeEqualTo(int? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'blockTime', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'blockTime', value: value), + ); }); } @@ -1125,11 +1235,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'blockTime', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'blockTime', + value: value, + ), + ); }); } @@ -1138,11 +1250,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'blockTime', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'blockTime', + value: value, + ), + ); }); } @@ -1153,29 +1267,31 @@ extension UTXOQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'blockTime', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'blockTime', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder blockedReasonIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'blockedReason', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'blockedReason'), + ); }); } QueryBuilder blockedReasonIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'blockedReason', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'blockedReason'), + ); }); } @@ -1184,11 +1300,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'blockedReason', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'blockedReason', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1198,12 +1316,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'blockedReason', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'blockedReason', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1213,12 +1333,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'blockedReason', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'blockedReason', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1230,14 +1352,16 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'blockedReason', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'blockedReason', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1246,11 +1370,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'blockedReason', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'blockedReason', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1259,62 +1385,67 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'blockedReason', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'blockedReason', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder blockedReasonContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'blockedReason', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'blockedReason', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder blockedReasonMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'blockedReason', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'blockedReason', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder blockedReasonIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'blockedReason', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'blockedReason', value: ''), + ); }); } QueryBuilder blockedReasonIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'blockedReason', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'blockedReason', value: ''), + ); }); } QueryBuilder idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -1323,11 +1454,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1336,11 +1469,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1351,32 +1486,33 @@ extension UTXOQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder isBlockedEqualTo(bool value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isBlocked', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isBlocked', value: value), + ); }); } QueryBuilder isCoinbaseEqualTo( - bool value) { + bool value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isCoinbase', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isCoinbase', value: value), + ); }); } @@ -1385,11 +1521,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1399,12 +1537,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1414,12 +1554,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1431,14 +1573,16 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'name', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1447,11 +1591,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1460,67 +1606,75 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder nameContains(String value, - {bool caseSensitive = true}) { + QueryBuilder nameContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder nameMatches(String pattern, - {bool caseSensitive = true}) { + QueryBuilder nameMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'name', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'name', value: ''), + ); }); } QueryBuilder nameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'name', value: ''), + ); }); } QueryBuilder otherDataIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'otherData', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'otherData'), + ); }); } QueryBuilder otherDataIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'otherData', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'otherData'), + ); }); } @@ -1529,11 +1683,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1543,12 +1699,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1558,12 +1716,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1575,14 +1735,16 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'otherData', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'otherData', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1591,11 +1753,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1604,53 +1768,59 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder otherDataContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder otherDataMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'otherData', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'otherData', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder otherDataIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherData', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'otherData', value: ''), + ); }); } QueryBuilder otherDataIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'otherData', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'otherData', value: ''), + ); }); } @@ -1659,11 +1829,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1673,12 +1845,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1688,12 +1862,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1705,14 +1881,16 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'txid', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1721,11 +1899,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1734,85 +1914,91 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder txidContains(String value, - {bool caseSensitive = true}) { + QueryBuilder txidContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder txidMatches(String pattern, - {bool caseSensitive = true}) { + QueryBuilder txidMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txid', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txid', value: ''), + ); }); } QueryBuilder txidIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txid', value: ''), + ); }); } QueryBuilder usedIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'used', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'used'), + ); }); } QueryBuilder usedIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'used', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'used'), + ); }); } QueryBuilder usedEqualTo(bool? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'used', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'used', value: value), + ); }); } QueryBuilder valueEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'value', value: value), + ); }); } @@ -1821,11 +2007,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'value', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + ), + ); }); } @@ -1834,11 +2022,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'value', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + ), + ); }); } @@ -1849,22 +2039,23 @@ extension UTXOQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'value', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder voutEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'vout', value: value), + ); }); } @@ -1873,11 +2064,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'vout', + value: value, + ), + ); }); } @@ -1886,11 +2079,13 @@ extension UTXOQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'vout', + value: value, + ), + ); }); } @@ -1901,13 +2096,15 @@ extension UTXOQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'vout', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'vout', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -1916,11 +2113,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1930,12 +2129,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1945,12 +2146,14 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1962,14 +2165,16 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1978,11 +2183,13 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1991,52 +2198,59 @@ extension UTXOQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder walletIdContains(String value, - {bool caseSensitive = true}) { + QueryBuilder walletIdContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -2398,15 +2612,17 @@ extension UTXOQuerySortThenBy on QueryBuilder { } extension UTXOQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByAddress( - {bool caseSensitive = true}) { + QueryBuilder distinctByAddress({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'address', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByBlockHash( - {bool caseSensitive = true}) { + QueryBuilder distinctByBlockHash({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'blockHash', caseSensitive: caseSensitive); }); @@ -2424,11 +2640,14 @@ extension UTXOQueryWhereDistinct on QueryBuilder { }); } - QueryBuilder distinctByBlockedReason( - {bool caseSensitive = true}) { + QueryBuilder distinctByBlockedReason({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'blockedReason', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'blockedReason', + caseSensitive: caseSensitive, + ); }); } @@ -2444,22 +2663,25 @@ extension UTXOQueryWhereDistinct on QueryBuilder { }); } - QueryBuilder distinctByName( - {bool caseSensitive = true}) { + QueryBuilder distinctByName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'name', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByOtherData( - {bool caseSensitive = true}) { + QueryBuilder distinctByOtherData({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'otherData', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByTxid( - {bool caseSensitive = true}) { + QueryBuilder distinctByTxid({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'txid', caseSensitive: caseSensitive); }); @@ -2483,8 +2705,9 @@ extension UTXOQueryWhereDistinct on QueryBuilder { }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); diff --git a/lib/models/isar/models/blockchain_data/v2/input_v2.g.dart b/lib/models/isar/models/blockchain_data/v2/input_v2.g.dart index fb0e9dd614..39778b704e 100644 --- a/lib/models/isar/models/blockchain_data/v2/input_v2.g.dart +++ b/lib/models/isar/models/blockchain_data/v2/input_v2.g.dart @@ -13,22 +13,11 @@ const OutpointV2Schema = Schema( name: r'OutpointV2', id: 5327663686922028778, properties: { - r'hashCode': PropertySchema( - id: 0, - name: r'hashCode', - type: IsarType.long, - ), - r'txid': PropertySchema( - id: 1, - name: r'txid', - type: IsarType.string, - ), - r'vout': PropertySchema( - id: 2, - name: r'vout', - type: IsarType.long, - ) + r'hashCode': PropertySchema(id: 0, name: r'hashCode', type: IsarType.long), + r'txid': PropertySchema(id: 1, name: r'txid', type: IsarType.string), + r'vout': PropertySchema(id: 2, name: r'vout', type: IsarType.long), }, + estimateSize: _outpointV2EstimateSize, serialize: _outpointV2Serialize, deserialize: _outpointV2Deserialize, @@ -89,26 +78,25 @@ P _outpointV2DeserializeProp

( extension OutpointV2QueryFilter on QueryBuilder { QueryBuilder hashCodeEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'hashCode', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'hashCode', value: value), + ); }); } QueryBuilder - hashCodeGreaterThan( - int value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'hashCode', - value: value, - )); + hashCodeGreaterThan(int value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'hashCode', + value: value, + ), + ); }); } @@ -117,11 +105,13 @@ extension OutpointV2QueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'hashCode', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'hashCode', + value: value, + ), + ); }); } @@ -132,13 +122,15 @@ extension OutpointV2QueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'hashCode', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'hashCode', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -147,11 +139,13 @@ extension OutpointV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -161,12 +155,14 @@ extension OutpointV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -176,12 +172,14 @@ extension OutpointV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -193,14 +191,16 @@ extension OutpointV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'txid', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -209,11 +209,13 @@ extension OutpointV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -222,63 +224,69 @@ extension OutpointV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txid', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txid', value: ''), + ); }); } QueryBuilder txidIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txid', value: ''), + ); }); } QueryBuilder voutEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'vout', value: value), + ); }); } @@ -287,11 +295,13 @@ extension OutpointV2QueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'vout', + value: value, + ), + ); }); } @@ -300,11 +310,13 @@ extension OutpointV2QueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'vout', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'vout', + value: value, + ), + ); }); } @@ -315,13 +327,15 @@ extension OutpointV2QueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'vout', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'vout', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } } @@ -355,6 +369,7 @@ const InputV2Schema = Schema( id: 3, name: r'outpoint', type: IsarType.object, + target: r'OutpointV2', ), r'scriptSigAsm': PropertySchema( @@ -367,11 +382,7 @@ const InputV2Schema = Schema( name: r'scriptSigHex', type: IsarType.string, ), - r'sequence': PropertySchema( - id: 6, - name: r'sequence', - type: IsarType.long, - ), + r'sequence': PropertySchema(id: 6, name: r'sequence', type: IsarType.long), r'valueStringSats': PropertySchema( id: 7, name: r'valueStringSats', @@ -382,12 +393,9 @@ const InputV2Schema = Schema( name: r'walletOwns', type: IsarType.bool, ), - r'witness': PropertySchema( - id: 9, - name: r'witness', - type: IsarType.string, - ) + r'witness': PropertySchema(id: 9, name: r'witness', type: IsarType.string), }, + estimateSize: _inputV2EstimateSize, serialize: _inputV2Serialize, deserialize: _inputV2Deserialize, @@ -422,9 +430,13 @@ int _inputV2EstimateSize( { final value = object.outpoint; if (value != null) { - bytesCount += 3 + + bytesCount += + 3 + OutpointV2Schema.estimateSize( - value, allOffsets[OutpointV2]!, allOffsets); + value, + allOffsets[OutpointV2]!, + allOffsets, + ); } } { @@ -511,10 +523,11 @@ P _inputV2DeserializeProp

( return (reader.readStringOrNull(offset)) as P; case 3: return (reader.readObjectOrNull( - offset, - OutpointV2Schema.deserialize, - allOffsets, - )) as P; + offset, + OutpointV2Schema.deserialize, + allOffsets, + )) + as P; case 4: return (reader.readStringOrNull(offset)) as P; case 5: @@ -539,43 +552,49 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementGreaterThan( + addressesElementGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementLessThan( + addressesElementLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -587,122 +606,108 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'addresses', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'addresses', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + addressesElementStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + addressesElementEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + addressesElementContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder addressesElementMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'addresses', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'addresses', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementIsEmpty() { + addressesElementIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'addresses', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'addresses', value: ''), + ); }); } QueryBuilder - addressesElementIsNotEmpty() { + addressesElementIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'addresses', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'addresses', value: ''), + ); }); } QueryBuilder addressesLengthEqualTo( - int length) { + int length, + ) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - length, - true, - length, - true, - ); + return query.listLength(r'addresses', length, true, length, true); }); } QueryBuilder addressesIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - true, - 0, - true, - ); + return query.listLength(r'addresses', 0, true, 0, true); }); } QueryBuilder addressesIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - false, - 999999, - true, - ); + return query.listLength(r'addresses', 0, false, 999999, true); }); } @@ -711,29 +716,14 @@ extension InputV2QueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - true, - length, - include, - ); + return query.listLength(r'addresses', 0, true, length, include); }); } QueryBuilder - addressesLengthGreaterThan( - int length, { - bool include = false, - }) { + addressesLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - length, - include, - 999999, - true, - ); + return query.listLength(r'addresses', length, include, 999999, true); }); } @@ -756,17 +746,17 @@ extension InputV2QueryFilter QueryBuilder coinbaseIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'coinbase', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'coinbase'), + ); }); } QueryBuilder coinbaseIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'coinbase', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'coinbase'), + ); }); } @@ -775,11 +765,13 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinbase', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinbase', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -789,12 +781,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'coinbase', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinbase', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -804,12 +798,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'coinbase', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinbase', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -821,14 +817,16 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'coinbase', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'coinbase', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -837,11 +835,13 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinbase', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinbase', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -850,122 +850,131 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinbase', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinbase', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder coinbaseContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinbase', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinbase', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder coinbaseMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinbase', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinbase', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder coinbaseIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinbase', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinbase', value: ''), + ); }); } QueryBuilder coinbaseIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinbase', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'coinbase', value: ''), + ); }); } QueryBuilder - innerRedeemScriptAsmIsNull() { + innerRedeemScriptAsmIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'innerRedeemScriptAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'innerRedeemScriptAsm'), + ); }); } QueryBuilder - innerRedeemScriptAsmIsNotNull() { + innerRedeemScriptAsmIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'innerRedeemScriptAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'innerRedeemScriptAsm'), + ); }); } QueryBuilder - innerRedeemScriptAsmEqualTo( - String? value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + innerRedeemScriptAsmEqualTo(String? value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmGreaterThan( + innerRedeemScriptAsmGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmLessThan( + innerRedeemScriptAsmLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmBetween( + innerRedeemScriptAsmBetween( String? lower, String? upper, { bool includeLower = true, @@ -973,117 +982,122 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'innerRedeemScriptAsm', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'innerRedeemScriptAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + innerRedeemScriptAsmStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + innerRedeemScriptAsmEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'innerRedeemScriptAsm', - value: value, - caseSensitive: caseSensitive, - )); + innerRedeemScriptAsmContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'innerRedeemScriptAsm', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + innerRedeemScriptAsmMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'innerRedeemScriptAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - innerRedeemScriptAsmIsEmpty() { + innerRedeemScriptAsmIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'innerRedeemScriptAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'innerRedeemScriptAsm', value: ''), + ); }); } QueryBuilder - innerRedeemScriptAsmIsNotEmpty() { + innerRedeemScriptAsmIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'innerRedeemScriptAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'innerRedeemScriptAsm', + value: '', + ), + ); }); } QueryBuilder outpointIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'outpoint', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'outpoint'), + ); }); } QueryBuilder outpointIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'outpoint', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'outpoint'), + ); }); } QueryBuilder scriptSigAsmIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'scriptSigAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'scriptSigAsm'), + ); }); } QueryBuilder - scriptSigAsmIsNotNull() { + scriptSigAsmIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'scriptSigAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'scriptSigAsm'), + ); }); } @@ -1092,11 +1106,13 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1106,12 +1122,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1121,12 +1139,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1138,14 +1158,16 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptSigAsm', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptSigAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1154,11 +1176,13 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1167,71 +1191,77 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigAsmContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptSigAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigAsmMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptSigAsm', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptSigAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigAsmIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptSigAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptSigAsm', value: ''), + ); }); } QueryBuilder - scriptSigAsmIsNotEmpty() { + scriptSigAsmIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptSigAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptSigAsm', value: ''), + ); }); } QueryBuilder scriptSigHexIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'scriptSigHex', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'scriptSigHex'), + ); }); } QueryBuilder - scriptSigHexIsNotNull() { + scriptSigHexIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'scriptSigHex', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'scriptSigHex'), + ); }); } @@ -1240,11 +1270,13 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptSigHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptSigHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1254,12 +1286,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptSigHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptSigHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1269,12 +1303,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptSigHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptSigHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1286,14 +1322,16 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptSigHex', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptSigHex', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1302,11 +1340,13 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptSigHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptSigHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1315,80 +1355,86 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptSigHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptSigHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigHexContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptSigHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptSigHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigHexMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptSigHex', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptSigHex', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder scriptSigHexIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptSigHex', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptSigHex', value: ''), + ); }); } QueryBuilder - scriptSigHexIsNotEmpty() { + scriptSigHexIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptSigHex', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptSigHex', value: ''), + ); }); } QueryBuilder sequenceIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'sequence', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'sequence'), + ); }); } QueryBuilder sequenceIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'sequence', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'sequence'), + ); }); } QueryBuilder sequenceEqualTo( - int? value) { + int? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sequence', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'sequence', value: value), + ); }); } @@ -1397,11 +1443,13 @@ extension InputV2QueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'sequence', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'sequence', + value: value, + ), + ); }); } @@ -1410,11 +1458,13 @@ extension InputV2QueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'sequence', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'sequence', + value: value, + ), + ); }); } @@ -1425,13 +1475,15 @@ extension InputV2QueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'sequence', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'sequence', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -1440,27 +1492,31 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsGreaterThan( + valueStringSatsGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1470,12 +1526,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1487,28 +1545,29 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'valueStringSats', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'valueStringSats', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + valueStringSatsStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1517,81 +1576,87 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder valueStringSatsContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder valueStringSatsMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'valueStringSats', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'valueStringSats', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsIsEmpty() { + valueStringSatsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'valueStringSats', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'valueStringSats', value: ''), + ); }); } QueryBuilder - valueStringSatsIsNotEmpty() { + valueStringSatsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'valueStringSats', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'valueStringSats', value: ''), + ); }); } QueryBuilder walletOwnsEqualTo( - bool value) { + bool value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletOwns', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletOwns', value: value), + ); }); } QueryBuilder witnessIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'witness', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'witness'), + ); }); } QueryBuilder witnessIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'witness', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'witness'), + ); }); } @@ -1600,11 +1665,13 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1614,12 +1681,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1629,12 +1698,14 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1646,14 +1717,16 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'witness', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'witness', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1662,11 +1735,13 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1675,53 +1750,59 @@ extension InputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder witnessContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'witness', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'witness', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder witnessMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'witness', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'witness', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder witnessIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'witness', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'witness', value: ''), + ); }); } QueryBuilder witnessIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'witness', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'witness', value: ''), + ); }); } } @@ -1729,7 +1810,8 @@ extension InputV2QueryFilter extension InputV2QueryObject on QueryBuilder { QueryBuilder outpoint( - FilterQuery q) { + FilterQuery q, + ) { return QueryBuilder.apply(this, (query) { return query.object(q, r'outpoint'); }); diff --git a/lib/models/isar/models/blockchain_data/v2/output_v2.g.dart b/lib/models/isar/models/blockchain_data/v2/output_v2.g.dart index 539ad6dbd2..0f7f3127a1 100644 --- a/lib/models/isar/models/blockchain_data/v2/output_v2.g.dart +++ b/lib/models/isar/models/blockchain_data/v2/output_v2.g.dart @@ -37,8 +37,9 @@ const OutputV2Schema = Schema( id: 4, name: r'walletOwns', type: IsarType.bool, - ) + ), }, + estimateSize: _outputV2EstimateSize, serialize: _outputV2Serialize, deserialize: _outputV2Deserialize, @@ -122,53 +123,56 @@ P _outputV2DeserializeProp

( extension OutputV2QueryFilter on QueryBuilder { QueryBuilder - addressesElementEqualTo( - String value, { - bool caseSensitive = true, - }) { + addressesElementEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementGreaterThan( + addressesElementGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementLessThan( + addressesElementLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementBetween( + addressesElementBetween( String lower, String upper, { bool includeLower = true, @@ -176,159 +180,125 @@ extension OutputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'addresses', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'addresses', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementStartsWith( - String value, { - bool caseSensitive = true, - }) { + addressesElementStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementEndsWith( - String value, { - bool caseSensitive = true, - }) { + addressesElementEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementContains(String value, {bool caseSensitive = true}) { + addressesElementContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'addresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'addresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementMatches(String pattern, {bool caseSensitive = true}) { + addressesElementMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'addresses', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'addresses', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressesElementIsEmpty() { + addressesElementIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'addresses', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'addresses', value: ''), + ); }); } QueryBuilder - addressesElementIsNotEmpty() { + addressesElementIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'addresses', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'addresses', value: ''), + ); }); } QueryBuilder - addressesLengthEqualTo(int length) { + addressesLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - length, - true, - length, - true, - ); + return query.listLength(r'addresses', length, true, length, true); }); } QueryBuilder addressesIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - true, - 0, - true, - ); + return query.listLength(r'addresses', 0, true, 0, true); }); } QueryBuilder - addressesIsNotEmpty() { + addressesIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - false, - 999999, - true, - ); + return query.listLength(r'addresses', 0, false, 999999, true); }); } QueryBuilder - addressesLengthLessThan( - int length, { - bool include = false, - }) { + addressesLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - true, - length, - include, - ); + return query.listLength(r'addresses', 0, true, length, include); }); } QueryBuilder - addressesLengthGreaterThan( - int length, { - bool include = false, - }) { + addressesLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - length, - include, - 999999, - true, - ); + return query.listLength(r'addresses', length, include, 999999, true); }); } QueryBuilder - addressesLengthBetween( + addressesLengthBetween( int lower, int upper, { bool includeLower = true, @@ -346,71 +316,74 @@ extension OutputV2QueryFilter } QueryBuilder - scriptPubKeyAsmIsNull() { + scriptPubKeyAsmIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'scriptPubKeyAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'scriptPubKeyAsm'), + ); }); } QueryBuilder - scriptPubKeyAsmIsNotNull() { + scriptPubKeyAsmIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'scriptPubKeyAsm', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'scriptPubKeyAsm'), + ); }); } QueryBuilder - scriptPubKeyAsmEqualTo( - String? value, { - bool caseSensitive = true, - }) { + scriptPubKeyAsmEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmGreaterThan( + scriptPubKeyAsmGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmLessThan( + scriptPubKeyAsmLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmBetween( + scriptPubKeyAsmBetween( String? lower, String? upper, { bool includeLower = true, @@ -418,135 +391,140 @@ extension OutputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptPubKeyAsm', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptPubKeyAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmStartsWith( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyAsmStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmEndsWith( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyAsmEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmContains(String value, {bool caseSensitive = true}) { + scriptPubKeyAsmContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptPubKeyAsm', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmMatches(String pattern, {bool caseSensitive = true}) { + scriptPubKeyAsmMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptPubKeyAsm', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptPubKeyAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyAsmIsEmpty() { + scriptPubKeyAsmIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptPubKeyAsm', value: ''), + ); }); } QueryBuilder - scriptPubKeyAsmIsNotEmpty() { + scriptPubKeyAsmIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptPubKeyAsm', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptPubKeyAsm', value: ''), + ); }); } QueryBuilder - scriptPubKeyHexEqualTo( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyHexEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'scriptPubKeyHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyHexGreaterThan( + scriptPubKeyHexGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'scriptPubKeyHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'scriptPubKeyHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyHexLessThan( + scriptPubKeyHexLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'scriptPubKeyHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'scriptPubKeyHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyHexBetween( + scriptPubKeyHexBetween( String lower, String upper, { bool includeLower = true, @@ -554,135 +532,140 @@ extension OutputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'scriptPubKeyHex', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'scriptPubKeyHex', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyHexStartsWith( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyHexStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'scriptPubKeyHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'scriptPubKeyHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyHexEndsWith( - String value, { - bool caseSensitive = true, - }) { + scriptPubKeyHexEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'scriptPubKeyHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'scriptPubKeyHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyHexContains(String value, {bool caseSensitive = true}) { + scriptPubKeyHexContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'scriptPubKeyHex', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'scriptPubKeyHex', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyHexMatches(String pattern, {bool caseSensitive = true}) { + scriptPubKeyHexMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'scriptPubKeyHex', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'scriptPubKeyHex', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - scriptPubKeyHexIsEmpty() { + scriptPubKeyHexIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'scriptPubKeyHex', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'scriptPubKeyHex', value: ''), + ); }); } QueryBuilder - scriptPubKeyHexIsNotEmpty() { + scriptPubKeyHexIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'scriptPubKeyHex', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'scriptPubKeyHex', value: ''), + ); }); } QueryBuilder - valueStringSatsEqualTo( - String value, { - bool caseSensitive = true, - }) { + valueStringSatsEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsGreaterThan( + valueStringSatsGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsLessThan( + valueStringSatsLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsBetween( + valueStringSatsBetween( String lower, String upper, { bool includeLower = true, @@ -690,94 +673,96 @@ extension OutputV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'valueStringSats', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'valueStringSats', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsStartsWith( - String value, { - bool caseSensitive = true, - }) { + valueStringSatsStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsEndsWith( - String value, { - bool caseSensitive = true, - }) { + valueStringSatsEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsContains(String value, {bool caseSensitive = true}) { + valueStringSatsContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'valueStringSats', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'valueStringSats', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsMatches(String pattern, {bool caseSensitive = true}) { + valueStringSatsMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'valueStringSats', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'valueStringSats', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStringSatsIsEmpty() { + valueStringSatsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'valueStringSats', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'valueStringSats', value: ''), + ); }); } QueryBuilder - valueStringSatsIsNotEmpty() { + valueStringSatsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'valueStringSats', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'valueStringSats', value: ''), + ); }); } QueryBuilder walletOwnsEqualTo( - bool value) { + bool value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletOwns', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletOwns', value: value), + ); }); } } diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart index 6c2ffde6d2..1335d783a2 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.g.dart @@ -27,20 +27,13 @@ const TransactionV2Schema = CollectionSchema( name: r'contractAddress', type: IsarType.string, ), - r'hash': PropertySchema( - id: 2, - name: r'hash', - type: IsarType.string, - ), - r'height': PropertySchema( - id: 3, - name: r'height', - type: IsarType.long, - ), + r'hash': PropertySchema(id: 2, name: r'hash', type: IsarType.string), + r'height': PropertySchema(id: 3, name: r'height', type: IsarType.long), r'inputs': PropertySchema( id: 4, name: r'inputs', type: IsarType.objectList, + target: r'InputV2', ), r'isCancelled': PropertySchema( @@ -53,11 +46,7 @@ const TransactionV2Schema = CollectionSchema( name: r'isEpiccashTransaction', type: IsarType.bool, ), - r'nonce': PropertySchema( - id: 7, - name: r'nonce', - type: IsarType.long, - ), + r'nonce': PropertySchema(id: 7, name: r'nonce', type: IsarType.long), r'numberOfMessages': PropertySchema( id: 8, name: r'numberOfMessages', @@ -77,13 +66,10 @@ const TransactionV2Schema = CollectionSchema( id: 11, name: r'outputs', type: IsarType.objectList, + target: r'OutputV2', ), - r'slateId': PropertySchema( - id: 12, - name: r'slateId', - type: IsarType.string, - ), + r'slateId': PropertySchema(id: 12, name: r'slateId', type: IsarType.string), r'subType': PropertySchema( id: 13, name: r'subType', @@ -95,34 +81,40 @@ const TransactionV2Schema = CollectionSchema( name: r'timestamp', type: IsarType.long, ), - r'txid': PropertySchema( - id: 15, - name: r'txid', - type: IsarType.string, - ), + r'txid': PropertySchema(id: 15, name: r'txid', type: IsarType.string), r'type': PropertySchema( id: 16, name: r'type', type: IsarType.byte, enumMap: _TransactionV2typeEnumValueMap, ), - r'version': PropertySchema( - id: 17, - name: r'version', - type: IsarType.long, - ), + r'version': PropertySchema(id: 17, name: r'version', type: IsarType.long), r'walletId': PropertySchema( id: 18, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _transactionV2EstimateSize, serialize: _transactionV2Serialize, deserialize: _transactionV2Deserialize, deserializeProp: _transactionV2DeserializeProp, idName: r'id', indexes: { + r'timestamp': IndexSchema( + id: 1852253767416892198, + name: r'timestamp', + unique: false, + replace: false, + properties: [ + IndexPropertySchema( + name: r'timestamp', + type: IndexType.value, + caseSensitive: false, + ), + ], + ), r'walletId': IndexSchema( id: -1783113319798776304, name: r'walletId', @@ -133,7 +125,7 @@ const TransactionV2Schema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'txid_walletId': IndexSchema( @@ -151,33 +143,21 @@ const TransactionV2Schema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), - r'timestamp': IndexSchema( - id: 1852253767416892198, - name: r'timestamp', - unique: false, - replace: false, - properties: [ - IndexPropertySchema( - name: r'timestamp', - type: IndexType.value, - caseSensitive: false, - ) - ], - ) }, links: {}, embeddedSchemas: { r'InputV2': InputV2Schema, r'OutpointV2': OutpointV2Schema, - r'OutputV2': OutputV2Schema + r'OutputV2': OutputV2Schema, }, + getId: _transactionV2GetId, getLinks: _transactionV2GetLinks, attach: _transactionV2Attach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _transactionV2EstimateSize( @@ -285,7 +265,8 @@ TransactionV2 _transactionV2Deserialize( blockHash: reader.readStringOrNull(offsets[0]), hash: reader.readString(offsets[2]), height: reader.readLongOrNull(offsets[3]), - inputs: reader.readObjectList( + inputs: + reader.readObjectList( offsets[4], InputV2Schema.deserialize, allOffsets, @@ -293,7 +274,8 @@ TransactionV2 _transactionV2Deserialize( ) ?? [], otherData: reader.readStringOrNull(offsets[10]), - outputs: reader.readObjectList( + outputs: + reader.readObjectList( offsets[11], OutputV2Schema.deserialize, allOffsets, @@ -302,10 +284,11 @@ TransactionV2 _transactionV2Deserialize( [], subType: _TransactionV2subTypeValueEnumMap[reader.readByteOrNull(offsets[13])] ?? - TransactionSubType.none, + TransactionSubType.none, timestamp: reader.readLong(offsets[14]), txid: reader.readString(offsets[15]), - type: _TransactionV2typeValueEnumMap[reader.readByteOrNull(offsets[16])] ?? + type: + _TransactionV2typeValueEnumMap[reader.readByteOrNull(offsets[16])] ?? TransactionType.outgoing, version: reader.readLong(offsets[17]), walletId: reader.readString(offsets[18]), @@ -331,12 +314,13 @@ P _transactionV2DeserializeProp

( return (reader.readLongOrNull(offset)) as P; case 4: return (reader.readObjectList( - offset, - InputV2Schema.deserialize, - allOffsets, - InputV2(), - ) ?? - []) as P; + offset, + InputV2Schema.deserialize, + allOffsets, + InputV2(), + ) ?? + []) + as P; case 5: return (reader.readBool(offset)) as P; case 6: @@ -351,25 +335,29 @@ P _transactionV2DeserializeProp

( return (reader.readStringOrNull(offset)) as P; case 11: return (reader.readObjectList( - offset, - OutputV2Schema.deserialize, - allOffsets, - OutputV2(), - ) ?? - []) as P; + offset, + OutputV2Schema.deserialize, + allOffsets, + OutputV2(), + ) ?? + []) + as P; case 12: return (reader.readStringOrNull(offset)) as P; case 13: - return (_TransactionV2subTypeValueEnumMap[ - reader.readByteOrNull(offset)] ?? - TransactionSubType.none) as P; + return (_TransactionV2subTypeValueEnumMap[reader.readByteOrNull( + offset, + )] ?? + TransactionSubType.none) + as P; case 14: return (reader.readLong(offset)) as P; case 15: return (reader.readString(offset)) as P; case 16: return (_TransactionV2typeValueEnumMap[reader.readByteOrNull(offset)] ?? - TransactionType.outgoing) as P; + TransactionType.outgoing) + as P; case 17: return (reader.readLong(offset)) as P; case 18: @@ -425,7 +413,10 @@ List> _transactionV2GetLinks(TransactionV2 object) { } void _transactionV2Attach( - IsarCollection col, Id id, TransactionV2 object) { + IsarCollection col, + Id id, + TransactionV2 object, +) { object.id = id; } @@ -447,10 +438,14 @@ extension TransactionV2ByIndex on IsarCollection { } Future> getAllByTxidWalletId( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -460,10 +455,14 @@ extension TransactionV2ByIndex on IsarCollection { } List getAllByTxidWalletIdSync( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -473,10 +472,14 @@ extension TransactionV2ByIndex on IsarCollection { } Future deleteAllByTxidWalletId( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -486,10 +489,14 @@ extension TransactionV2ByIndex on IsarCollection { } int deleteAllByTxidWalletIdSync( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -510,8 +517,10 @@ extension TransactionV2ByIndex on IsarCollection { return putAllByIndex(r'txid_walletId', objects); } - List putAllByTxidWalletIdSync(List objects, - {bool saveLinks = true}) { + List putAllByTxidWalletIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'txid_walletId', objects, saveLinks: saveLinks); } } @@ -536,17 +545,16 @@ extension TransactionV2QueryWhereSort extension TransactionV2QueryWhere on QueryBuilder { QueryBuilder idEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder idNotEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -569,8 +577,9 @@ extension TransactionV2QueryWhere } QueryBuilder idGreaterThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -579,8 +588,9 @@ extension TransactionV2QueryWhere } QueryBuilder idLessThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -595,240 +605,274 @@ extension TransactionV2QueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } - QueryBuilder walletIdEqualTo( - String walletId) { + QueryBuilder + timestampEqualTo(int timestamp) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'timestamp', value: [timestamp]), + ); }); } QueryBuilder - walletIdNotEqualTo(String walletId) { + timestampNotEqualTo(int timestamp) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [], + upper: [timestamp], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [timestamp], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [timestamp], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [], + upper: [timestamp], + includeUpper: false, + ), + ); } }); } QueryBuilder - txidEqualToAnyWalletId(String txid) { + timestampGreaterThan(int timestamp, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId', - value: [txid], - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [timestamp], + includeLower: include, + upper: [], + ), + ); }); } QueryBuilder - txidNotEqualToAnyWalletId(String txid) { + timestampLessThan(int timestamp, {bool include = false}) { return QueryBuilder.apply(this, (query) { - if (query.whereSort == Sort.asc) { - return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [], - upper: [txid], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - includeLower: false, - upper: [], - )); - } else { - return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [], - upper: [txid], - includeUpper: false, - )); - } + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [], + upper: [timestamp], + includeUpper: include, + ), + ); }); } QueryBuilder - txidWalletIdEqualTo(String txid, String walletId) { + timestampBetween( + int lowerTimestamp, + int upperTimestamp, { + bool includeLower = true, + bool includeUpper = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId', - value: [txid, walletId], - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestamp', + lower: [lowerTimestamp], + includeLower: includeLower, + upper: [upperTimestamp], + includeUpper: includeUpper, + ), + ); + }); + } + + QueryBuilder walletIdEqualTo( + String walletId, + ) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder - txidEqualToWalletIdNotEqualTo(String txid, String walletId) { + walletIdNotEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder - timestampEqualTo(int timestamp) { + txidEqualToAnyWalletId(String txid) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'timestamp', - value: [timestamp], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'txid_walletId', value: [txid]), + ); }); } QueryBuilder - timestampNotEqualTo(int timestamp) { + txidNotEqualToAnyWalletId(String txid) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [], - upper: [timestamp], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [timestamp], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [], + upper: [txid], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [timestamp], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [], - upper: [timestamp], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [], + upper: [txid], + includeUpper: false, + ), + ); } }); } QueryBuilder - timestampGreaterThan( - int timestamp, { - bool include = false, - }) { + txidWalletIdEqualTo(String txid, String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [timestamp], - includeLower: include, - upper: [], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'txid_walletId', + value: [txid, walletId], + ), + ); }); } QueryBuilder - timestampLessThan( - int timestamp, { - bool include = false, - }) { + txidEqualToWalletIdNotEqualTo(String txid, String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [], - upper: [timestamp], - includeUpper: include, - )); - }); - } - - QueryBuilder - timestampBetween( - int lowerTimestamp, - int upperTimestamp, { - bool includeLower = true, - bool includeUpper = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestamp', - lower: [lowerTimestamp], - includeLower: includeLower, - upper: [upperTimestamp], - includeUpper: includeUpper, - )); + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ); + } else { + return query + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ); + } }); } } @@ -836,71 +880,74 @@ extension TransactionV2QueryWhere extension TransactionV2QueryFilter on QueryBuilder { QueryBuilder - blockHashIsNull() { + blockHashIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'blockHash', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'blockHash'), + ); }); } QueryBuilder - blockHashIsNotNull() { + blockHashIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'blockHash', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'blockHash'), + ); }); } QueryBuilder - blockHashEqualTo( - String? value, { - bool caseSensitive = true, - }) { + blockHashEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - blockHashGreaterThan( + blockHashGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - blockHashLessThan( + blockHashLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - blockHashBetween( + blockHashBetween( String? lower, String? upper, { bool includeLower = true, @@ -908,153 +955,158 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'blockHash', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'blockHash', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - blockHashStartsWith( - String value, { - bool caseSensitive = true, - }) { + blockHashStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - blockHashEndsWith( - String value, { - bool caseSensitive = true, - }) { + blockHashEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - blockHashContains(String value, {bool caseSensitive = true}) { + blockHashContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'blockHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - blockHashMatches(String pattern, {bool caseSensitive = true}) { + blockHashMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'blockHash', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'blockHash', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - blockHashIsEmpty() { + blockHashIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'blockHash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'blockHash', value: ''), + ); }); } QueryBuilder - blockHashIsNotEmpty() { + blockHashIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'blockHash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'blockHash', value: ''), + ); }); } QueryBuilder - contractAddressIsNull() { + contractAddressIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'contractAddress', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'contractAddress'), + ); }); } QueryBuilder - contractAddressIsNotNull() { + contractAddressIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'contractAddress', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'contractAddress'), + ); }); } QueryBuilder - contractAddressEqualTo( - String? value, { - bool caseSensitive = true, - }) { + contractAddressEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'contractAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'contractAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contractAddressGreaterThan( + contractAddressGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'contractAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'contractAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contractAddressLessThan( + contractAddressLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'contractAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'contractAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contractAddressBetween( + contractAddressBetween( String? lower, String? upper, { bool includeLower = true, @@ -1062,84 +1114,86 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'contractAddress', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'contractAddress', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contractAddressStartsWith( - String value, { - bool caseSensitive = true, - }) { + contractAddressStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'contractAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'contractAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contractAddressEndsWith( - String value, { - bool caseSensitive = true, - }) { + contractAddressEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'contractAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'contractAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contractAddressContains(String value, {bool caseSensitive = true}) { + contractAddressContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'contractAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'contractAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contractAddressMatches(String pattern, {bool caseSensitive = true}) { + contractAddressMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'contractAddress', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'contractAddress', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contractAddressIsEmpty() { + contractAddressIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'contractAddress', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'contractAddress', value: ''), + ); }); } QueryBuilder - contractAddressIsNotEmpty() { + contractAddressIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'contractAddress', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'contractAddress', value: ''), + ); }); } @@ -1148,43 +1202,49 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'hash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'hash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - hashGreaterThan( + hashGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'hash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'hash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - hashLessThan( + hashLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'hash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'hash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1196,183 +1256,184 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'hash', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'hash', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - hashStartsWith( - String value, { - bool caseSensitive = true, - }) { + hashStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'hash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'hash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - hashEndsWith( - String value, { - bool caseSensitive = true, - }) { + hashEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'hash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'hash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - hashContains(String value, {bool caseSensitive = true}) { + hashContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'hash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'hash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder hashMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'hash', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'hash', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - hashIsEmpty() { + hashIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'hash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'hash', value: ''), + ); }); } QueryBuilder - hashIsNotEmpty() { + hashIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'hash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'hash', value: ''), + ); }); } QueryBuilder - heightIsNull() { + heightIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'height', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'height'), + ); }); } QueryBuilder - heightIsNotNull() { + heightIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'height', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'height'), + ); }); } QueryBuilder - heightEqualTo(int? value) { + heightEqualTo(int? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'height', value: value), + ); }); } QueryBuilder - heightGreaterThan( - int? value, { - bool include = false, - }) { + heightGreaterThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'height', + value: value, + ), + ); }); } QueryBuilder - heightLessThan( - int? value, { - bool include = false, - }) { + heightLessThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'height', + value: value, + ), + ); }); } QueryBuilder - heightBetween( + heightBetween( int? lower, int? upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'height', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'height', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } QueryBuilder - idGreaterThan( - Id value, { - bool include = false, - }) { + idGreaterThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1381,11 +1442,13 @@ extension TransactionV2QueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1396,89 +1459,55 @@ extension TransactionV2QueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - inputsLengthEqualTo(int length) { + inputsLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - length, - true, - length, - true, - ); + return query.listLength(r'inputs', length, true, length, true); }); } QueryBuilder - inputsIsEmpty() { + inputsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - 0, - true, - 0, - true, - ); + return query.listLength(r'inputs', 0, true, 0, true); }); } QueryBuilder - inputsIsNotEmpty() { + inputsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - 0, - false, - 999999, - true, - ); + return query.listLength(r'inputs', 0, false, 999999, true); }); } QueryBuilder - inputsLengthLessThan( - int length, { - bool include = false, - }) { + inputsLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - 0, - true, - length, - include, - ); + return query.listLength(r'inputs', 0, true, length, include); }); } QueryBuilder - inputsLengthGreaterThan( - int length, { - bool include = false, - }) { + inputsLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'inputs', - length, - include, - 999999, - true, - ); + return query.listLength(r'inputs', length, include, 999999, true); }); } QueryBuilder - inputsLengthBetween( + inputsLengthBetween( int lower, int upper, { bool includeLower = true, @@ -1496,239 +1525,241 @@ extension TransactionV2QueryFilter } QueryBuilder - isCancelledEqualTo(bool value) { + isCancelledEqualTo(bool value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isCancelled', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isCancelled', value: value), + ); }); } QueryBuilder - isEpiccashTransactionEqualTo(bool value) { + isEpiccashTransactionEqualTo(bool value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isEpiccashTransaction', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'isEpiccashTransaction', + value: value, + ), + ); }); } QueryBuilder - nonceIsNull() { + nonceIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'nonce', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'nonce'), + ); }); } QueryBuilder - nonceIsNotNull() { + nonceIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'nonce', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'nonce'), + ); }); } QueryBuilder - nonceEqualTo(int? value) { + nonceEqualTo(int? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'nonce', value: value), + ); }); } QueryBuilder - nonceGreaterThan( - int? value, { - bool include = false, - }) { + nonceGreaterThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'nonce', + value: value, + ), + ); }); } QueryBuilder - nonceLessThan( - int? value, { - bool include = false, - }) { + nonceLessThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'nonce', + value: value, + ), + ); }); } QueryBuilder - nonceBetween( + nonceBetween( int? lower, int? upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'nonce', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'nonce', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - numberOfMessagesIsNull() { + numberOfMessagesIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'numberOfMessages', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'numberOfMessages'), + ); }); } QueryBuilder - numberOfMessagesIsNotNull() { + numberOfMessagesIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'numberOfMessages', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'numberOfMessages'), + ); }); } QueryBuilder - numberOfMessagesEqualTo(int? value) { + numberOfMessagesEqualTo(int? value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'numberOfMessages', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'numberOfMessages', value: value), + ); }); } QueryBuilder - numberOfMessagesGreaterThan( - int? value, { - bool include = false, - }) { + numberOfMessagesGreaterThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'numberOfMessages', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'numberOfMessages', + value: value, + ), + ); }); } QueryBuilder - numberOfMessagesLessThan( - int? value, { - bool include = false, - }) { + numberOfMessagesLessThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'numberOfMessages', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'numberOfMessages', + value: value, + ), + ); }); } QueryBuilder - numberOfMessagesBetween( + 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'numberOfMessages', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - onChainNoteIsNull() { + onChainNoteIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'onChainNote', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'onChainNote'), + ); }); } QueryBuilder - onChainNoteIsNotNull() { + onChainNoteIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'onChainNote', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'onChainNote'), + ); }); } - - QueryBuilder - onChainNoteEqualTo( - String? value, { - bool caseSensitive = true, - }) { + + QueryBuilder + onChainNoteEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'onChainNote', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'onChainNote', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - onChainNoteGreaterThan( + onChainNoteGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'onChainNote', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'onChainNote', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - onChainNoteLessThan( + onChainNoteLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'onChainNote', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'onChainNote', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - onChainNoteBetween( + onChainNoteBetween( String? lower, String? upper, { bool includeLower = true, @@ -1736,153 +1767,158 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'onChainNote', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'onChainNote', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - onChainNoteStartsWith( - String value, { - bool caseSensitive = true, - }) { + onChainNoteStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'onChainNote', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'onChainNote', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - onChainNoteEndsWith( - String value, { - bool caseSensitive = true, - }) { + onChainNoteEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'onChainNote', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'onChainNote', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - onChainNoteContains(String value, {bool caseSensitive = true}) { + onChainNoteContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'onChainNote', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'onChainNote', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - onChainNoteMatches(String pattern, {bool caseSensitive = true}) { + onChainNoteMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'onChainNote', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'onChainNote', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - onChainNoteIsEmpty() { + onChainNoteIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'onChainNote', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'onChainNote', value: ''), + ); }); } QueryBuilder - onChainNoteIsNotEmpty() { + onChainNoteIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'onChainNote', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'onChainNote', value: ''), + ); }); } QueryBuilder - otherDataIsNull() { + otherDataIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'otherData', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'otherData'), + ); }); } QueryBuilder - otherDataIsNotNull() { + otherDataIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'otherData', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'otherData'), + ); }); } QueryBuilder - otherDataEqualTo( - String? value, { - bool caseSensitive = true, - }) { + otherDataEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataGreaterThan( + otherDataGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataLessThan( + otherDataLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataBetween( + otherDataBetween( String? lower, String? upper, { bool includeLower = true, @@ -1890,160 +1926,126 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'otherData', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'otherData', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataStartsWith( - String value, { - bool caseSensitive = true, - }) { + otherDataStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataEndsWith( - String value, { - bool caseSensitive = true, - }) { + otherDataEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataContains(String value, {bool caseSensitive = true}) { + otherDataContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'otherData', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataMatches(String pattern, {bool caseSensitive = true}) { + otherDataMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'otherData', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'otherData', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataIsEmpty() { + otherDataIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherData', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'otherData', value: ''), + ); }); } QueryBuilder - otherDataIsNotEmpty() { + otherDataIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'otherData', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'otherData', value: ''), + ); }); } QueryBuilder - outputsLengthEqualTo(int length) { + outputsLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - length, - true, - length, - true, - ); + return query.listLength(r'outputs', length, true, length, true); }); } QueryBuilder - outputsIsEmpty() { + outputsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - 0, - true, - 0, - true, - ); + return query.listLength(r'outputs', 0, true, 0, true); }); } QueryBuilder - outputsIsNotEmpty() { + outputsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - 0, - false, - 999999, - true, - ); + return query.listLength(r'outputs', 0, false, 999999, true); }); } QueryBuilder - outputsLengthLessThan( - int length, { - bool include = false, - }) { + outputsLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - 0, - true, - length, - include, - ); + return query.listLength(r'outputs', 0, true, length, include); }); } QueryBuilder - outputsLengthGreaterThan( - int length, { - bool include = false, - }) { + outputsLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'outputs', - length, - include, - 999999, - true, - ); + return query.listLength(r'outputs', length, include, 999999, true); }); } QueryBuilder - outputsLengthBetween( + outputsLengthBetween( int lower, int upper, { bool includeLower = true, @@ -2061,71 +2063,74 @@ extension TransactionV2QueryFilter } QueryBuilder - slateIdIsNull() { + slateIdIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'slateId', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'slateId'), + ); }); } QueryBuilder - slateIdIsNotNull() { + slateIdIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'slateId', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'slateId'), + ); }); } QueryBuilder - slateIdEqualTo( - String? value, { - bool caseSensitive = true, - }) { + slateIdEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdGreaterThan( + slateIdGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdLessThan( + slateIdLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdBetween( + slateIdBetween( String? lower, String? upper, { bool includeLower = true, @@ -2133,196 +2138,196 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'slateId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'slateId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + slateIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdEndsWith( - String value, { - bool caseSensitive = true, - }) { + slateIdEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdContains(String value, {bool caseSensitive = true}) { + slateIdContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'slateId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdMatches(String pattern, {bool caseSensitive = true}) { + slateIdMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'slateId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'slateId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - slateIdIsEmpty() { + slateIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'slateId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'slateId', value: ''), + ); }); } QueryBuilder - slateIdIsNotEmpty() { + slateIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'slateId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'slateId', value: ''), + ); }); } QueryBuilder - subTypeEqualTo(TransactionSubType value) { + subTypeEqualTo(TransactionSubType value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'subType', value: value), + ); }); } QueryBuilder - subTypeGreaterThan( - TransactionSubType value, { - bool include = false, - }) { + subTypeGreaterThan(TransactionSubType value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'subType', + value: value, + ), + ); }); } QueryBuilder - subTypeLessThan( - TransactionSubType value, { - bool include = false, - }) { + subTypeLessThan(TransactionSubType value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'subType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'subType', + value: value, + ), + ); }); } QueryBuilder - subTypeBetween( + subTypeBetween( TransactionSubType lower, TransactionSubType upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'subType', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'subType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - timestampEqualTo(int value) { + timestampEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'timestamp', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'timestamp', value: value), + ); }); } QueryBuilder - timestampGreaterThan( - int value, { - bool include = false, - }) { + timestampGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'timestamp', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'timestamp', + value: value, + ), + ); }); } QueryBuilder - timestampLessThan( - int value, { - bool include = false, - }) { + timestampLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'timestamp', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'timestamp', + value: value, + ), + ); }); } QueryBuilder - timestampBetween( + timestampBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'timestamp', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'timestamp', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -2331,43 +2336,49 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidGreaterThan( + txidGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidLessThan( + txidLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2379,123 +2390,124 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'txid', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidStartsWith( - String value, { - bool caseSensitive = true, - }) { + txidStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidEndsWith( - String value, { - bool caseSensitive = true, - }) { + txidEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidContains(String value, {bool caseSensitive = true}) { + txidContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txid', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidIsEmpty() { + txidIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txid', value: ''), + ); }); } QueryBuilder - txidIsNotEmpty() { + txidIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txid', value: ''), + ); }); } QueryBuilder typeEqualTo( - TransactionType value) { + TransactionType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'type', value: value), + ); }); } QueryBuilder - typeGreaterThan( - TransactionType value, { - bool include = false, - }) { + typeGreaterThan(TransactionType value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'type', + value: value, + ), + ); }); } QueryBuilder - typeLessThan( - TransactionType value, { - bool include = false, - }) { + typeLessThan(TransactionType value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -2506,120 +2518,124 @@ extension TransactionV2QueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'type', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'type', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - versionEqualTo(int value) { + versionEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'version', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'version', value: value), + ); }); } QueryBuilder - versionGreaterThan( - int value, { - bool include = false, - }) { + versionGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'version', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'version', + value: value, + ), + ); }); } QueryBuilder - versionLessThan( - int value, { - bool include = false, - }) { + versionLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'version', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'version', + value: value, + ), + ); }); } QueryBuilder - versionBetween( + versionBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'version', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'version', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - walletIdEqualTo( - String value, { - bool caseSensitive = true, - }) { + walletIdEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdLessThan( + walletIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdBetween( + walletIdBetween( String lower, String upper, { bool includeLower = true, @@ -2627,84 +2643,86 @@ extension TransactionV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdEndsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdContains(String value, {bool caseSensitive = true}) { + walletIdContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdMatches(String pattern, {bool caseSensitive = true}) { + walletIdMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -2712,14 +2730,14 @@ extension TransactionV2QueryFilter extension TransactionV2QueryObject on QueryBuilder { QueryBuilder - inputsElement(FilterQuery q) { + inputsElement(FilterQuery q) { return QueryBuilder.apply(this, (query) { return query.object(q, r'inputs'); }); } QueryBuilder - outputsElement(FilterQuery q) { + outputsElement(FilterQuery q) { return QueryBuilder.apply(this, (query) { return query.object(q, r'outputs'); }); @@ -2738,21 +2756,21 @@ extension TransactionV2QuerySortBy } QueryBuilder - sortByBlockHashDesc() { + sortByBlockHashDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'blockHash', Sort.desc); }); } QueryBuilder - sortByContractAddress() { + sortByContractAddress() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'contractAddress', Sort.asc); }); } QueryBuilder - sortByContractAddressDesc() { + sortByContractAddressDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'contractAddress', Sort.desc); }); @@ -2789,21 +2807,21 @@ extension TransactionV2QuerySortBy } QueryBuilder - sortByIsCancelledDesc() { + sortByIsCancelledDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isCancelled', Sort.desc); }); } QueryBuilder - sortByIsEpiccashTransaction() { + sortByIsEpiccashTransaction() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isEpiccashTransaction', Sort.asc); }); } QueryBuilder - sortByIsEpiccashTransactionDesc() { + sortByIsEpiccashTransactionDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isEpiccashTransaction', Sort.desc); }); @@ -2822,14 +2840,14 @@ extension TransactionV2QuerySortBy } QueryBuilder - sortByNumberOfMessages() { + sortByNumberOfMessages() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberOfMessages', Sort.asc); }); } QueryBuilder - sortByNumberOfMessagesDesc() { + sortByNumberOfMessagesDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberOfMessages', Sort.desc); }); @@ -2842,7 +2860,7 @@ extension TransactionV2QuerySortBy } QueryBuilder - sortByOnChainNoteDesc() { + sortByOnChainNoteDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'onChainNote', Sort.desc); }); @@ -2855,7 +2873,7 @@ extension TransactionV2QuerySortBy } QueryBuilder - sortByOtherDataDesc() { + sortByOtherDataDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.desc); }); @@ -2892,7 +2910,7 @@ extension TransactionV2QuerySortBy } QueryBuilder - sortByTimestampDesc() { + sortByTimestampDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'timestamp', Sort.desc); }); @@ -2941,7 +2959,7 @@ extension TransactionV2QuerySortBy } QueryBuilder - sortByWalletIdDesc() { + sortByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -2957,21 +2975,21 @@ extension TransactionV2QuerySortThenBy } QueryBuilder - thenByBlockHashDesc() { + thenByBlockHashDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'blockHash', Sort.desc); }); } QueryBuilder - thenByContractAddress() { + thenByContractAddress() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'contractAddress', Sort.asc); }); } QueryBuilder - thenByContractAddressDesc() { + thenByContractAddressDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'contractAddress', Sort.desc); }); @@ -3020,21 +3038,21 @@ extension TransactionV2QuerySortThenBy } QueryBuilder - thenByIsCancelledDesc() { + thenByIsCancelledDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isCancelled', Sort.desc); }); } QueryBuilder - thenByIsEpiccashTransaction() { + thenByIsEpiccashTransaction() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isEpiccashTransaction', Sort.asc); }); } QueryBuilder - thenByIsEpiccashTransactionDesc() { + thenByIsEpiccashTransactionDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isEpiccashTransaction', Sort.desc); }); @@ -3053,14 +3071,14 @@ extension TransactionV2QuerySortThenBy } QueryBuilder - thenByNumberOfMessages() { + thenByNumberOfMessages() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberOfMessages', Sort.asc); }); } QueryBuilder - thenByNumberOfMessagesDesc() { + thenByNumberOfMessagesDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberOfMessages', Sort.desc); }); @@ -3073,7 +3091,7 @@ extension TransactionV2QuerySortThenBy } QueryBuilder - thenByOnChainNoteDesc() { + thenByOnChainNoteDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'onChainNote', Sort.desc); }); @@ -3086,7 +3104,7 @@ extension TransactionV2QuerySortThenBy } QueryBuilder - thenByOtherDataDesc() { + thenByOtherDataDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.desc); }); @@ -3123,7 +3141,7 @@ extension TransactionV2QuerySortThenBy } QueryBuilder - thenByTimestampDesc() { + thenByTimestampDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'timestamp', Sort.desc); }); @@ -3172,7 +3190,7 @@ extension TransactionV2QuerySortThenBy } QueryBuilder - thenByWalletIdDesc() { + thenByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -3181,23 +3199,27 @@ extension TransactionV2QuerySortThenBy extension TransactionV2QueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByBlockHash( - {bool caseSensitive = true}) { + QueryBuilder distinctByBlockHash({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'blockHash', caseSensitive: caseSensitive); }); } QueryBuilder - distinctByContractAddress({bool caseSensitive = true}) { + distinctByContractAddress({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'contractAddress', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'contractAddress', + caseSensitive: caseSensitive, + ); }); } - QueryBuilder distinctByHash( - {bool caseSensitive = true}) { + QueryBuilder distinctByHash({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'hash', caseSensitive: caseSensitive); }); @@ -3210,14 +3232,14 @@ extension TransactionV2QueryWhereDistinct } QueryBuilder - distinctByIsCancelled() { + distinctByIsCancelled() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'isCancelled'); }); } QueryBuilder - distinctByIsEpiccashTransaction() { + distinctByIsEpiccashTransaction() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'isEpiccashTransaction'); }); @@ -3230,28 +3252,31 @@ extension TransactionV2QueryWhereDistinct } QueryBuilder - distinctByNumberOfMessages() { + distinctByNumberOfMessages() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'numberOfMessages'); }); } - QueryBuilder distinctByOnChainNote( - {bool caseSensitive = true}) { + QueryBuilder distinctByOnChainNote({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'onChainNote', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByOtherData( - {bool caseSensitive = true}) { + QueryBuilder distinctByOtherData({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'otherData', caseSensitive: caseSensitive); }); } - QueryBuilder distinctBySlateId( - {bool caseSensitive = true}) { + QueryBuilder distinctBySlateId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'slateId', caseSensitive: caseSensitive); }); @@ -3269,8 +3294,9 @@ extension TransactionV2QueryWhereDistinct }); } - QueryBuilder distinctByTxid( - {bool caseSensitive = true}) { + QueryBuilder distinctByTxid({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'txid', caseSensitive: caseSensitive); }); @@ -3288,8 +3314,9 @@ extension TransactionV2QueryWhereDistinct }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); @@ -3311,7 +3338,7 @@ extension TransactionV2QueryProperty } QueryBuilder - contractAddressProperty() { + contractAddressProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'contractAddress'); }); @@ -3330,7 +3357,7 @@ extension TransactionV2QueryProperty } QueryBuilder, QQueryOperations> - inputsProperty() { + inputsProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'inputs'); }); @@ -3343,7 +3370,7 @@ extension TransactionV2QueryProperty } QueryBuilder - isEpiccashTransactionProperty() { + isEpiccashTransactionProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'isEpiccashTransaction'); }); @@ -3356,7 +3383,7 @@ extension TransactionV2QueryProperty } QueryBuilder - numberOfMessagesProperty() { + numberOfMessagesProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'numberOfMessages'); }); @@ -3375,7 +3402,7 @@ extension TransactionV2QueryProperty } QueryBuilder, QQueryOperations> - outputsProperty() { + outputsProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'outputs'); }); @@ -3388,7 +3415,7 @@ extension TransactionV2QueryProperty } QueryBuilder - subTypeProperty() { + subTypeProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'subType'); }); @@ -3407,7 +3434,7 @@ extension TransactionV2QueryProperty } QueryBuilder - typeProperty() { + typeProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'type'); }); diff --git a/lib/models/isar/models/contact_entry.g.dart b/lib/models/isar/models/contact_entry.g.dart index 282112f559..99b745c3a7 100644 --- a/lib/models/isar/models/contact_entry.g.dart +++ b/lib/models/isar/models/contact_entry.g.dart @@ -21,6 +21,7 @@ const ContactEntrySchema = CollectionSchema( id: 0, name: r'addresses', type: IsarType.objectList, + target: r'ContactAddressEntry', ), r'customId': PropertySchema( @@ -38,12 +39,9 @@ const ContactEntrySchema = CollectionSchema( name: r'isFavorite', type: IsarType.bool, ), - r'name': PropertySchema( - id: 4, - name: r'name', - type: IsarType.string, - ) + r'name': PropertySchema(id: 4, name: r'name', type: IsarType.string), }, + estimateSize: _contactEntryEstimateSize, serialize: _contactEntrySerialize, deserialize: _contactEntryDeserialize, @@ -60,16 +58,17 @@ const ContactEntrySchema = CollectionSchema( name: r'customId', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {r'ContactAddressEntry': ContactAddressEntrySchema}, + getId: _contactEntryGetId, getLinks: _contactEntryGetLinks, attach: _contactEntryAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _contactEntryEstimateSize( @@ -83,8 +82,11 @@ int _contactEntryEstimateSize( final offsets = allOffsets[ContactAddressEntry]!; for (var i = 0; i < object.addresses.length; i++) { final value = object.addresses[i]; - bytesCount += - ContactAddressEntrySchema.estimateSize(value, offsets, allOffsets); + bytesCount += ContactAddressEntrySchema.estimateSize( + value, + offsets, + allOffsets, + ); } } bytesCount += 3 + object.customId.length * 3; @@ -123,7 +125,8 @@ ContactEntry _contactEntryDeserialize( Map> allOffsets, ) { final object = ContactEntry( - addresses: reader.readObjectList( + addresses: + reader.readObjectList( offsets[0], ContactAddressEntrySchema.deserialize, allOffsets, @@ -148,12 +151,13 @@ P _contactEntryDeserializeProp

( switch (propertyId) { case 0: return (reader.readObjectList( - offset, - ContactAddressEntrySchema.deserialize, - allOffsets, - ContactAddressEntry(), - ) ?? - []) as P; + offset, + ContactAddressEntrySchema.deserialize, + allOffsets, + ContactAddressEntry(), + ) ?? + []) + as P; case 1: return (reader.readString(offset)) as P; case 2: @@ -176,7 +180,10 @@ List> _contactEntryGetLinks(ContactEntry object) { } void _contactEntryAttach( - IsarCollection col, Id id, ContactEntry object) { + IsarCollection col, + Id id, + ContactEntry object, +) { object.id = id; } @@ -229,8 +236,10 @@ extension ContactEntryByIndex on IsarCollection { return putAllByIndex(r'customId', objects); } - List putAllByCustomIdSync(List objects, - {bool saveLinks = true}) { + List putAllByCustomIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'customId', objects, saveLinks: saveLinks); } } @@ -248,15 +257,13 @@ extension ContactEntryQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder idNotEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -279,8 +286,9 @@ extension ContactEntryQueryWhere } QueryBuilder idGreaterThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -288,8 +296,10 @@ extension ContactEntryQueryWhere }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -304,56 +314,66 @@ extension ContactEntryQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder customIdEqualTo( - String customId) { + String customId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'customId', - value: [customId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'customId', value: [customId]), + ); }); } QueryBuilder - customIdNotEqualTo(String customId) { + customIdNotEqualTo(String customId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'customId', - lower: [], - upper: [customId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'customId', - lower: [customId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'customId', + lower: [], + upper: [customId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'customId', + lower: [customId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'customId', - lower: [customId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'customId', - lower: [], - upper: [customId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'customId', + lower: [customId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'customId', + lower: [], + upper: [customId], + includeUpper: false, + ), + ); } }); } @@ -362,78 +382,42 @@ extension ContactEntryQueryWhere extension ContactEntryQueryFilter on QueryBuilder { QueryBuilder - addressesLengthEqualTo(int length) { + addressesLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - length, - true, - length, - true, - ); + return query.listLength(r'addresses', length, true, length, true); }); } QueryBuilder - addressesIsEmpty() { + addressesIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - true, - 0, - true, - ); + return query.listLength(r'addresses', 0, true, 0, true); }); } QueryBuilder - addressesIsNotEmpty() { + addressesIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - false, - 999999, - true, - ); + return query.listLength(r'addresses', 0, false, 999999, true); }); } QueryBuilder - addressesLengthLessThan( - int length, { - bool include = false, - }) { + addressesLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - 0, - true, - length, - include, - ); + return query.listLength(r'addresses', 0, true, length, include); }); } QueryBuilder - addressesLengthGreaterThan( - int length, { - bool include = false, - }) { + addressesLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'addresses', - length, - include, - 999999, - true, - ); + return query.listLength(r'addresses', length, include, 999999, true); }); } QueryBuilder - addressesLengthBetween( + addressesLengthBetween( int lower, int upper, { bool includeLower = true, @@ -451,53 +435,56 @@ extension ContactEntryQueryFilter } QueryBuilder - customIdEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'customId', - value: value, - caseSensitive: caseSensitive, - )); + customIdEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'customId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - customIdGreaterThan( + customIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'customId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'customId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - customIdLessThan( + customIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'customId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'customId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - customIdBetween( + customIdBetween( String lower, String upper, { bool includeLower = true, @@ -505,153 +492,158 @@ extension ContactEntryQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'customId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'customId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - customIdStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'customId', - value: value, - caseSensitive: caseSensitive, - )); + customIdStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'customId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - customIdEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'customId', - value: value, - caseSensitive: caseSensitive, - )); + customIdEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'customId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - customIdContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'customId', - value: value, - caseSensitive: caseSensitive, - )); + customIdContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'customId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - customIdMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'customId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + customIdMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'customId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - customIdIsEmpty() { + customIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'customId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'customId', value: ''), + ); }); } QueryBuilder - customIdIsNotEmpty() { + customIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'customId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'customId', value: ''), + ); }); } QueryBuilder - emojiCharIsNull() { + emojiCharIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'emojiChar', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'emojiChar'), + ); }); } QueryBuilder - emojiCharIsNotNull() { + emojiCharIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'emojiChar', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'emojiChar'), + ); }); } QueryBuilder - emojiCharEqualTo( - String? value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'emojiChar', - value: value, - caseSensitive: caseSensitive, - )); + emojiCharEqualTo(String? value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'emojiChar', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - emojiCharGreaterThan( + emojiCharGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'emojiChar', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'emojiChar', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - emojiCharLessThan( + emojiCharLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'emojiChar', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'emojiChar', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - emojiCharBetween( + emojiCharBetween( String? lower, String? upper, { bool includeLower = true, @@ -659,94 +651,96 @@ extension ContactEntryQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'emojiChar', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'emojiChar', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - emojiCharStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'emojiChar', - value: value, - caseSensitive: caseSensitive, - )); + emojiCharStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'emojiChar', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - emojiCharEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'emojiChar', - value: value, - caseSensitive: caseSensitive, - )); + emojiCharEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'emojiChar', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - emojiCharContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'emojiChar', - value: value, - caseSensitive: caseSensitive, - )); + emojiCharContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'emojiChar', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - emojiCharMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'emojiChar', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + emojiCharMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'emojiChar', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - emojiCharIsEmpty() { + emojiCharIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'emojiChar', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'emojiChar', value: ''), + ); }); } QueryBuilder - emojiCharIsNotEmpty() { + emojiCharIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'emojiChar', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'emojiChar', value: ''), + ); }); } QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -755,11 +749,13 @@ extension ContactEntryQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -768,11 +764,13 @@ extension ContactEntryQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -783,23 +781,24 @@ extension ContactEntryQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - isFavoriteEqualTo(bool value) { + isFavoriteEqualTo(bool value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isFavorite', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isFavorite', value: value), + ); }); } @@ -808,27 +807,31 @@ extension ContactEntryQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - nameGreaterThan( + nameGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -838,12 +841,14 @@ extension ContactEntryQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -855,28 +860,29 @@ extension ContactEntryQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'name', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - nameStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + nameStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -885,55 +891,61 @@ extension ContactEntryQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'name', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - nameIsEmpty() { + nameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'name', value: ''), + ); }); } QueryBuilder - nameIsNotEmpty() { + nameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'name', value: ''), + ); }); } } @@ -941,7 +953,7 @@ extension ContactEntryQueryFilter extension ContactEntryQueryObject on QueryBuilder { QueryBuilder - addressesElement(FilterQuery q) { + addressesElement(FilterQuery q) { return QueryBuilder.apply(this, (query) { return query.object(q, r'addresses'); }); @@ -984,7 +996,7 @@ extension ContactEntryQuerySortBy } QueryBuilder - sortByIsFavoriteDesc() { + sortByIsFavoriteDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isFavorite', Sort.desc); }); @@ -1048,7 +1060,7 @@ extension ContactEntryQuerySortThenBy } QueryBuilder - thenByIsFavoriteDesc() { + thenByIsFavoriteDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isFavorite', Sort.desc); }); @@ -1069,15 +1081,17 @@ extension ContactEntryQuerySortThenBy extension ContactEntryQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByCustomId( - {bool caseSensitive = true}) { + QueryBuilder distinctByCustomId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'customId', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByEmojiChar( - {bool caseSensitive = true}) { + QueryBuilder distinctByEmojiChar({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'emojiChar', caseSensitive: caseSensitive); }); @@ -1089,8 +1103,9 @@ extension ContactEntryQueryWhereDistinct }); } - QueryBuilder distinctByName( - {bool caseSensitive = true}) { + QueryBuilder distinctByName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'name', caseSensitive: caseSensitive); }); @@ -1106,7 +1121,7 @@ extension ContactEntryQueryProperty } QueryBuilder, QQueryOperations> - addressesProperty() { + addressesProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'addresses'); }); @@ -1148,27 +1163,16 @@ const ContactAddressEntrySchema = Schema( name: r'ContactAddressEntry', id: 2556413586404997281, properties: { - r'address': PropertySchema( - id: 0, - name: r'address', - type: IsarType.string, - ), + r'address': PropertySchema(id: 0, name: r'address', type: IsarType.string), r'coinName': PropertySchema( id: 1, name: r'coinName', type: IsarType.string, ), - r'label': PropertySchema( - id: 2, - name: r'label', - type: IsarType.string, - ), - r'other': PropertySchema( - id: 3, - name: r'other', - type: IsarType.string, - ) + r'label': PropertySchema(id: 2, name: r'label', type: IsarType.string), + r'other': PropertySchema(id: 3, name: r'other', type: IsarType.string), }, + estimateSize: _contactAddressEntryEstimateSize, serialize: _contactAddressEntrySerialize, deserialize: _contactAddressEntryDeserialize, @@ -1239,56 +1243,64 @@ P _contactAddressEntryDeserializeProp

( } } -extension ContactAddressEntryQueryFilter on QueryBuilder { +extension ContactAddressEntryQueryFilter + on + QueryBuilder< + ContactAddressEntry, + ContactAddressEntry, + QFilterCondition + > { QueryBuilder - addressEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + addressEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressGreaterThan( + addressGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressLessThan( + addressLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressBetween( + addressBetween( String lower, String upper, { bool includeLower = true, @@ -1296,135 +1308,140 @@ extension ContactAddressEntryQueryFilter on QueryBuilder - addressStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + addressStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + addressEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + addressContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'address', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + addressMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'address', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressIsEmpty() { + addressIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'address', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'address', value: ''), + ); }); } QueryBuilder - addressIsNotEmpty() { + addressIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'address', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'address', value: ''), + ); }); } QueryBuilder - coinNameEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + coinNameEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameGreaterThan( + coinNameGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameLessThan( + coinNameLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameBetween( + coinNameBetween( String lower, String upper, { bool includeLower = true, @@ -1432,135 +1449,140 @@ extension ContactAddressEntryQueryFilter on QueryBuilder - coinNameStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + coinNameStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + coinNameEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + coinNameContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinName', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + coinNameMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinName', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameIsEmpty() { + coinNameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinName', value: ''), + ); }); } QueryBuilder - coinNameIsNotEmpty() { + coinNameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'coinName', value: ''), + ); }); } QueryBuilder - labelEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + labelEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelGreaterThan( + labelGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelLessThan( + labelLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelBetween( + labelBetween( String lower, String upper, { bool includeLower = true, @@ -1568,153 +1590,158 @@ extension ContactAddressEntryQueryFilter on QueryBuilder - labelStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + labelStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + labelEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + labelContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'label', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + labelMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'label', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelIsEmpty() { + labelIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'label', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'label', value: ''), + ); }); } QueryBuilder - labelIsNotEmpty() { + labelIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'label', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'label', value: ''), + ); }); } QueryBuilder - otherIsNull() { + otherIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'other', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'other'), + ); }); } QueryBuilder - otherIsNotNull() { + otherIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'other', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'other'), + ); }); } QueryBuilder - otherEqualTo( - String? value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'other', - value: value, - caseSensitive: caseSensitive, - )); + otherEqualTo(String? value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'other', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherGreaterThan( + otherGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'other', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'other', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherLessThan( + otherLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'other', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'other', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherBetween( + otherBetween( String? lower, String? upper, { bool includeLower = true, @@ -1722,87 +1749,94 @@ extension ContactAddressEntryQueryFilter on QueryBuilder - otherStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'other', - value: value, - caseSensitive: caseSensitive, - )); + otherStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'other', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'other', - value: value, - caseSensitive: caseSensitive, - )); + otherEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'other', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'other', - value: value, - caseSensitive: caseSensitive, - )); + otherContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'other', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'other', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + otherMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'other', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherIsEmpty() { + otherIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'other', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'other', value: ''), + ); }); } QueryBuilder - otherIsNotEmpty() { + otherIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'other', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'other', value: ''), + ); }); } } -extension ContactAddressEntryQueryObject on QueryBuilder {} +extension ContactAddressEntryQueryObject + on + QueryBuilder< + ContactAddressEntry, + ContactAddressEntry, + QFilterCondition + > {} diff --git a/lib/models/isar/models/encrypted_string_value.g.dart b/lib/models/isar/models/encrypted_string_value.g.dart index 5b3490dcc0..2b99600117 100644 --- a/lib/models/isar/models/encrypted_string_value.g.dart +++ b/lib/models/isar/models/encrypted_string_value.g.dart @@ -18,17 +18,10 @@ const EncryptedStringValueSchema = CollectionSchema( name: r'EncryptedStringValue', id: 4826543019451092626, properties: { - r'key': PropertySchema( - id: 0, - name: r'key', - type: IsarType.string, - ), - r'value': PropertySchema( - id: 1, - name: r'value', - type: IsarType.string, - ) + r'key': PropertySchema(id: 0, name: r'key', type: IsarType.string), + r'value': PropertySchema(id: 1, name: r'value', type: IsarType.string), }, + estimateSize: _encryptedStringValueEstimateSize, serialize: _encryptedStringValueSerialize, deserialize: _encryptedStringValueDeserialize, @@ -45,16 +38,17 @@ const EncryptedStringValueSchema = CollectionSchema( name: r'key', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _encryptedStringValueGetId, getLinks: _encryptedStringValueGetLinks, attach: _encryptedStringValueAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _encryptedStringValueEstimateSize( @@ -112,12 +106,16 @@ Id _encryptedStringValueGetId(EncryptedStringValue object) { } List> _encryptedStringValueGetLinks( - EncryptedStringValue object) { + EncryptedStringValue object, +) { return []; } void _encryptedStringValueAttach( - IsarCollection col, Id id, EncryptedStringValue object) { + IsarCollection col, + Id id, + EncryptedStringValue object, +) { object.id = id; } @@ -170,8 +168,10 @@ extension EncryptedStringValueByIndex on IsarCollection { return putAllByIndex(r'key', objects); } - List putAllByKeySync(List objects, - {bool saveLinks = true}) { + List putAllByKeySync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'key', objects, saveLinks: saveLinks); } } @@ -179,7 +179,7 @@ extension EncryptedStringValueByIndex on IsarCollection { extension EncryptedStringValueQueryWhereSort on QueryBuilder { QueryBuilder - anyId() { + anyId() { return QueryBuilder.apply(this, (query) { return query.addWhereClause(const IdWhereClause.any()); }); @@ -189,17 +189,14 @@ extension EncryptedStringValueQueryWhereSort extension EncryptedStringValueQueryWhere on QueryBuilder { QueryBuilder - idEqualTo(Id id) { + idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder - idNotEqualTo(Id id) { + idNotEqualTo(Id id) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -222,7 +219,7 @@ extension EncryptedStringValueQueryWhere } QueryBuilder - idGreaterThan(Id id, {bool include = false}) { + idGreaterThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -231,7 +228,7 @@ extension EncryptedStringValueQueryWhere } QueryBuilder - idLessThan(Id id, {bool include = false}) { + idLessThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -240,174 +237,218 @@ extension EncryptedStringValueQueryWhere } QueryBuilder - idBetween( + idBetween( Id lowerId, Id upperId, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - keyEqualTo(String key) { + keyEqualTo(String key) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'key', - value: [key], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'key', value: [key]), + ); }); } QueryBuilder - keyNotEqualTo(String key) { + keyNotEqualTo(String key) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'key', - lower: [], - upper: [key], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'key', - lower: [key], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'key', + lower: [], + upper: [key], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'key', + lower: [key], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'key', - lower: [key], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'key', - lower: [], - upper: [key], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'key', + lower: [key], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'key', + lower: [], + upper: [key], + includeUpper: false, + ), + ); } }); } } -extension EncryptedStringValueQueryFilter on QueryBuilder { - QueryBuilder idEqualTo(Id value) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); +extension EncryptedStringValueQueryFilter + on + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QFilterCondition + > { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } - QueryBuilder idGreaterThan( - Id value, { - bool include = false, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + idGreaterThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } - QueryBuilder idLessThan( - Id value, { - bool include = false, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + idLessThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } - QueryBuilder idBetween( + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + idBetween( Id lower, Id upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } - QueryBuilder keyEqualTo( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'key', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'key', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder keyGreaterThan( + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'key', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'key', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder keyLessThan( - String value, { - bool include = false, - bool caseSensitive = true, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyLessThan(String value, {bool include = false, bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'key', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'key', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder keyBetween( + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyBetween( String lower, String upper, { bool includeLower = true, @@ -415,137 +456,180 @@ extension EncryptedStringValueQueryFilter on QueryBuilder keyStartsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'key', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'key', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder keyEndsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'key', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'key', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - keyContains(String value, {bool caseSensitive = true}) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'key', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'key', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - keyMatches(String pattern, {bool caseSensitive = true}) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'key', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'key', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder keyIsEmpty() { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'key', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'key', value: ''), + ); }); } - QueryBuilder keyIsNotEmpty() { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + keyIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'key', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'key', value: ''), + ); }); } - QueryBuilder valueEqualTo( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder valueGreaterThan( + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder valueLessThan( + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder valueBetween( + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueBetween( String lower, String upper, { bool includeLower = true, @@ -553,121 +637,155 @@ extension EncryptedStringValueQueryFilter on QueryBuilder valueStartsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder valueEndsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - valueContains(String value, {bool caseSensitive = true}) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - valueMatches(String pattern, {bool caseSensitive = true}) { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'value', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'value', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder valueIsEmpty() { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'value', value: ''), + ); }); } - QueryBuilder valueIsNotEmpty() { + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QAfterFilterCondition + > + valueIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'value', value: ''), + ); }); } } -extension EncryptedStringValueQueryObject on QueryBuilder {} - -extension EncryptedStringValueQueryLinks on QueryBuilder {} +extension EncryptedStringValueQueryObject + on + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QFilterCondition + > {} + +extension EncryptedStringValueQueryLinks + on + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QFilterCondition + > {} extension EncryptedStringValueQuerySortBy on QueryBuilder { QueryBuilder - sortByKey() { + sortByKey() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'key', Sort.asc); }); } QueryBuilder - sortByKeyDesc() { + sortByKeyDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'key', Sort.desc); }); } QueryBuilder - sortByValue() { + sortByValue() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'value', Sort.asc); }); } QueryBuilder - sortByValueDesc() { + sortByValueDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'value', Sort.desc); }); @@ -677,42 +795,42 @@ extension EncryptedStringValueQuerySortBy extension EncryptedStringValueQuerySortThenBy on QueryBuilder { QueryBuilder - thenById() { + thenById() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'id', Sort.asc); }); } QueryBuilder - thenByIdDesc() { + thenByIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'id', Sort.desc); }); } QueryBuilder - thenByKey() { + thenByKey() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'key', Sort.asc); }); } QueryBuilder - thenByKeyDesc() { + thenByKeyDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'key', Sort.desc); }); } QueryBuilder - thenByValue() { + thenByValue() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'value', Sort.asc); }); } QueryBuilder - thenByValueDesc() { + thenByValueDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'value', Sort.desc); }); @@ -722,22 +840,27 @@ extension EncryptedStringValueQuerySortThenBy extension EncryptedStringValueQueryWhereDistinct on QueryBuilder { QueryBuilder - distinctByKey({bool caseSensitive = true}) { + distinctByKey({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'key', caseSensitive: caseSensitive); }); } QueryBuilder - distinctByValue({bool caseSensitive = true}) { + distinctByValue({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'value', caseSensitive: caseSensitive); }); } } -extension EncryptedStringValueQueryProperty on QueryBuilder< - EncryptedStringValue, EncryptedStringValue, QQueryProperty> { +extension EncryptedStringValueQueryProperty + on + QueryBuilder< + EncryptedStringValue, + EncryptedStringValue, + QQueryProperty + > { QueryBuilder idProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'id'); diff --git a/lib/models/isar/models/ethereum/eth_contract.g.dart b/lib/models/isar/models/ethereum/eth_contract.g.dart index fcb1af11d9..b5b3aadbc2 100644 --- a/lib/models/isar/models/ethereum/eth_contract.g.dart +++ b/lib/models/isar/models/ethereum/eth_contract.g.dart @@ -17,38 +17,19 @@ const EthContractSchema = CollectionSchema( name: r'EthContract', id: 3784021410994159165, properties: { - r'abi': PropertySchema( - id: 0, - name: r'abi', - type: IsarType.string, - ), - r'address': PropertySchema( - id: 1, - name: r'address', - type: IsarType.string, - ), - r'decimals': PropertySchema( - id: 2, - name: r'decimals', - type: IsarType.long, - ), - r'name': PropertySchema( - id: 3, - name: r'name', - type: IsarType.string, - ), - r'symbol': PropertySchema( - id: 4, - name: r'symbol', - type: IsarType.string, - ), + r'abi': PropertySchema(id: 0, name: r'abi', type: IsarType.string), + r'address': PropertySchema(id: 1, name: r'address', type: IsarType.string), + r'decimals': PropertySchema(id: 2, name: r'decimals', type: IsarType.long), + r'name': PropertySchema(id: 3, name: r'name', type: IsarType.string), + r'symbol': PropertySchema(id: 4, name: r'symbol', type: IsarType.string), r'type': PropertySchema( id: 5, name: r'type', type: IsarType.byte, enumMap: _EthContracttypeEnumValueMap, - ) + ), }, + estimateSize: _ethContractEstimateSize, serialize: _ethContractSerialize, deserialize: _ethContractDeserialize, @@ -65,16 +46,17 @@ const EthContractSchema = CollectionSchema( name: r'address', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _ethContractGetId, getLinks: _ethContractGetLinks, attach: _ethContractAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _ethContractEstimateSize( @@ -121,7 +103,8 @@ EthContract _ethContractDeserialize( decimals: reader.readLong(offsets[2]), name: reader.readString(offsets[3]), symbol: reader.readString(offsets[4]), - type: _EthContracttypeValueEnumMap[reader.readByteOrNull(offsets[5])] ?? + type: + _EthContracttypeValueEnumMap[reader.readByteOrNull(offsets[5])] ?? EthContractType.unknown, ); object.id = id; @@ -147,17 +130,14 @@ P _ethContractDeserializeProp

( return (reader.readString(offset)) as P; case 5: return (_EthContracttypeValueEnumMap[reader.readByteOrNull(offset)] ?? - EthContractType.unknown) as P; + EthContractType.unknown) + as P; default: throw IsarError('Unknown property with id $propertyId'); } } -const _EthContracttypeEnumValueMap = { - 'unknown': 0, - 'erc20': 1, - 'erc721': 2, -}; +const _EthContracttypeEnumValueMap = {'unknown': 0, 'erc20': 1, 'erc721': 2}; const _EthContracttypeValueEnumMap = { 0: EthContractType.unknown, 1: EthContractType.erc20, @@ -173,7 +153,10 @@ List> _ethContractGetLinks(EthContract object) { } void _ethContractAttach( - IsarCollection col, Id id, EthContract object) { + IsarCollection col, + Id id, + EthContract object, +) { object.id = id; } @@ -226,8 +209,10 @@ extension EthContractByIndex on IsarCollection { return putAllByIndex(r'address', objects); } - List putAllByAddressSync(List objects, - {bool saveLinks = true}) { + List putAllByAddressSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'address', objects, saveLinks: saveLinks); } } @@ -245,15 +230,13 @@ extension EthContractQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder idNotEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -275,8 +258,10 @@ extension EthContractQueryWhere }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -284,8 +269,10 @@ extension EthContractQueryWhere }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -300,56 +287,67 @@ extension EthContractQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder addressEqualTo( - String address) { + String address, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'address', - value: [address], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'address', value: [address]), + ); }); } QueryBuilder addressNotEqualTo( - String address) { + String address, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'address', - lower: [], - upper: [address], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'address', - lower: [address], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'address', + lower: [], + upper: [address], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'address', + lower: [address], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'address', - lower: [address], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'address', - lower: [], - upper: [address], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'address', + lower: [address], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'address', + lower: [], + upper: [address], + includeUpper: false, + ), + ); } }); } @@ -359,17 +357,17 @@ extension EthContractQueryFilter on QueryBuilder { QueryBuilder abiIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'abi', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'abi'), + ); }); } QueryBuilder abiIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'abi', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'abi'), + ); }); } @@ -378,11 +376,13 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'abi', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'abi', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -392,12 +392,14 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'abi', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'abi', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -407,12 +409,14 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'abi', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'abi', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -424,14 +428,16 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'abi', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'abi', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -440,11 +446,13 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'abi', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'abi', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -453,54 +461,60 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'abi', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'abi', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder abiContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'abi', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'abi', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder abiMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'abi', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'abi', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder abiIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'abi', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'abi', value: ''), + ); }); } QueryBuilder - abiIsNotEmpty() { + abiIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'abi', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'abi', value: ''), + ); }); } @@ -509,27 +523,31 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressGreaterThan( + addressGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -539,12 +557,14 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -556,28 +576,29 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'address', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'address', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + addressStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -586,93 +607,97 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder addressContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder addressMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'address', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'address', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - addressIsEmpty() { + addressIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'address', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'address', value: ''), + ); }); } QueryBuilder - addressIsNotEmpty() { + addressIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'address', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'address', value: ''), + ); }); } QueryBuilder decimalsEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'decimals', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'decimals', value: value), + ); }); } QueryBuilder - decimalsGreaterThan( - int value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'decimals', - value: value, - )); + decimalsGreaterThan(int value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'decimals', + value: value, + ), + ); }); } QueryBuilder - decimalsLessThan( - int value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'decimals', - value: value, - )); + decimalsLessThan(int value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'decimals', + value: value, + ), + ); }); } @@ -683,23 +708,25 @@ extension EthContractQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'decimals', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'decimals', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -708,11 +735,13 @@ extension EthContractQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -721,11 +750,13 @@ extension EthContractQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -736,13 +767,15 @@ extension EthContractQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -751,11 +784,13 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -765,12 +800,14 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -780,12 +817,14 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -797,14 +836,16 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'name', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -813,11 +854,13 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -826,54 +869,60 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'name', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'name', value: ''), + ); }); } QueryBuilder - nameIsNotEmpty() { + nameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'name', value: ''), + ); }); } @@ -882,27 +931,31 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'symbol', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'symbol', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - symbolGreaterThan( + symbolGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'symbol', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'symbol', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -912,12 +965,14 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'symbol', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'symbol', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -929,28 +984,29 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'symbol', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'symbol', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - symbolStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'symbol', - value: value, - caseSensitive: caseSensitive, - )); + symbolStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'symbol', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -959,65 +1015,71 @@ extension EthContractQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'symbol', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'symbol', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder symbolContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'symbol', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'symbol', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder symbolMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'symbol', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'symbol', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - symbolIsEmpty() { + symbolIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'symbol', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'symbol', value: ''), + ); }); } QueryBuilder - symbolIsNotEmpty() { + symbolIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'symbol', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'symbol', value: ''), + ); }); } QueryBuilder typeEqualTo( - EthContractType value) { + EthContractType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'type', value: value), + ); }); } @@ -1026,11 +1088,13 @@ extension EthContractQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -1039,11 +1103,13 @@ extension EthContractQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -1054,13 +1120,15 @@ extension EthContractQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'type', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'type', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } } @@ -1235,15 +1303,17 @@ extension EthContractQuerySortThenBy extension EthContractQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByAbi( - {bool caseSensitive = true}) { + QueryBuilder distinctByAbi({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'abi', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByAddress( - {bool caseSensitive = true}) { + QueryBuilder distinctByAddress({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'address', caseSensitive: caseSensitive); }); @@ -1255,15 +1325,17 @@ extension EthContractQueryWhereDistinct }); } - QueryBuilder distinctByName( - {bool caseSensitive = true}) { + QueryBuilder distinctByName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'name', caseSensitive: caseSensitive); }); } - QueryBuilder distinctBySymbol( - {bool caseSensitive = true}) { + QueryBuilder distinctBySymbol({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'symbol', caseSensitive: caseSensitive); }); diff --git a/lib/models/isar/models/log.g.dart b/lib/models/isar/models/log.g.dart index ebad873f2b..358c9c6b15 100644 --- a/lib/models/isar/models/log.g.dart +++ b/lib/models/isar/models/log.g.dart @@ -23,17 +23,14 @@ const LogSchema = CollectionSchema( type: IsarType.string, enumMap: _LoglogLevelEnumValueMap, ), - r'message': PropertySchema( - id: 1, - name: r'message', - type: IsarType.string, - ), + r'message': PropertySchema(id: 1, name: r'message', type: IsarType.string), r'timestampInMillisUTC': PropertySchema( id: 2, name: r'timestampInMillisUTC', type: IsarType.long, - ) + ), }, + estimateSize: _logEstimateSize, serialize: _logSerialize, deserialize: _logDeserialize, @@ -50,16 +47,17 @@ const LogSchema = CollectionSchema( name: r'timestampInMillisUTC', type: IndexType.value, caseSensitive: false, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _logGetId, getLinks: _logGetLinks, attach: _logAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _logEstimateSize( @@ -94,7 +92,7 @@ Log _logDeserialize( object.id = id; object.logLevel = _LoglogLevelValueEnumMap[reader.readStringOrNull(offsets[0])] ?? - LogLevel.Info; + LogLevel.Info; object.message = reader.readString(offsets[1]); object.timestampInMillisUTC = reader.readLong(offsets[2]); return object; @@ -109,7 +107,8 @@ P _logDeserializeProp

( switch (propertyId) { case 0: return (_LoglogLevelValueEnumMap[reader.readStringOrNull(offset)] ?? - LogLevel.Info) as P; + LogLevel.Info) + as P; case 1: return (reader.readString(offset)) as P; case 2: @@ -165,10 +164,7 @@ extension LogQueryWhereSort on QueryBuilder { extension LogQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -194,8 +190,10 @@ extension LogQueryWhere on QueryBuilder { }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -203,8 +201,10 @@ extension LogQueryWhere on QueryBuilder { }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -219,56 +219,70 @@ extension LogQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder timestampInMillisUTCEqualTo( - int timestampInMillisUTC) { + int timestampInMillisUTC, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'timestampInMillisUTC', - value: [timestampInMillisUTC], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'timestampInMillisUTC', + value: [timestampInMillisUTC], + ), + ); }); } QueryBuilder timestampInMillisUTCNotEqualTo( - int timestampInMillisUTC) { + int timestampInMillisUTC, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'timestampInMillisUTC', - lower: [], - upper: [timestampInMillisUTC], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'timestampInMillisUTC', - lower: [timestampInMillisUTC], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestampInMillisUTC', + lower: [], + upper: [timestampInMillisUTC], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestampInMillisUTC', + lower: [timestampInMillisUTC], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'timestampInMillisUTC', - lower: [timestampInMillisUTC], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'timestampInMillisUTC', - lower: [], - upper: [timestampInMillisUTC], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestampInMillisUTC', + lower: [timestampInMillisUTC], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'timestampInMillisUTC', + lower: [], + upper: [timestampInMillisUTC], + includeUpper: false, + ), + ); } }); } @@ -278,12 +292,14 @@ extension LogQueryWhere on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestampInMillisUTC', - lower: [timestampInMillisUTC], - includeLower: include, - upper: [], - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestampInMillisUTC', + lower: [timestampInMillisUTC], + includeLower: include, + upper: [], + ), + ); }); } @@ -292,12 +308,14 @@ extension LogQueryWhere on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestampInMillisUTC', - lower: [], - upper: [timestampInMillisUTC], - includeUpper: include, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestampInMillisUTC', + lower: [], + upper: [timestampInMillisUTC], + includeUpper: include, + ), + ); }); } @@ -308,13 +326,15 @@ extension LogQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'timestampInMillisUTC', - lower: [lowerTimestampInMillisUTC], - includeLower: includeLower, - upper: [upperTimestampInMillisUTC], - includeUpper: includeUpper, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'timestampInMillisUTC', + lower: [lowerTimestampInMillisUTC], + includeLower: includeLower, + upper: [upperTimestampInMillisUTC], + includeUpper: includeUpper, + ), + ); }); } } @@ -322,10 +342,9 @@ extension LogQueryWhere on QueryBuilder { extension LogQueryFilter on QueryBuilder { QueryBuilder idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -334,11 +353,13 @@ extension LogQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -347,11 +368,13 @@ extension LogQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -362,13 +385,15 @@ extension LogQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -377,11 +402,13 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'logLevel', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'logLevel', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -391,12 +418,14 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'logLevel', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'logLevel', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -406,12 +435,14 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'logLevel', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'logLevel', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -423,14 +454,16 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'logLevel', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'logLevel', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -439,11 +472,13 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'logLevel', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'logLevel', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -452,51 +487,59 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'logLevel', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'logLevel', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder logLevelContains(String value, - {bool caseSensitive = true}) { + QueryBuilder logLevelContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'logLevel', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'logLevel', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder logLevelMatches(String pattern, - {bool caseSensitive = true}) { + QueryBuilder logLevelMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'logLevel', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'logLevel', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder logLevelIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'logLevel', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'logLevel', value: ''), + ); }); } QueryBuilder logLevelIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'logLevel', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'logLevel', value: ''), + ); }); } @@ -505,11 +548,13 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'message', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'message', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -519,12 +564,14 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'message', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'message', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -534,12 +581,14 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'message', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'message', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -551,14 +600,16 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'message', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'message', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -567,11 +618,13 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'message', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'message', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -580,61 +633,72 @@ extension LogQueryFilter on QueryBuilder { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'message', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'message', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder messageContains(String value, - {bool caseSensitive = true}) { + QueryBuilder messageContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'message', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'message', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder messageMatches(String pattern, - {bool caseSensitive = true}) { + QueryBuilder messageMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'message', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'message', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder messageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'message', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'message', value: ''), + ); }); } QueryBuilder messageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'message', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'message', value: ''), + ); }); } QueryBuilder timestampInMillisUTCEqualTo( - int value) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'timestampInMillisUTC', - value: value, - )); + int value, + ) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'timestampInMillisUTC', + value: value, + ), + ); }); } @@ -643,11 +707,13 @@ extension LogQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'timestampInMillisUTC', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'timestampInMillisUTC', + value: value, + ), + ); }); } @@ -656,11 +722,13 @@ extension LogQueryFilter on QueryBuilder { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'timestampInMillisUTC', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'timestampInMillisUTC', + value: value, + ), + ); }); } @@ -671,13 +739,15 @@ extension LogQueryFilter on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'timestampInMillisUTC', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'timestampInMillisUTC', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } } @@ -775,15 +845,17 @@ extension LogQuerySortThenBy on QueryBuilder { } extension LogQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByLogLevel( - {bool caseSensitive = true}) { + QueryBuilder distinctByLogLevel({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'logLevel', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByMessage( - {bool caseSensitive = true}) { + QueryBuilder distinctByMessage({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'message', caseSensitive: caseSensitive); }); diff --git a/lib/models/isar/models/sent_to_address.g.dart b/lib/models/isar/models/sent_to_address.g.dart index 88153da9d7..354b03038e 100644 --- a/lib/models/isar/models/sent_to_address.g.dart +++ b/lib/models/isar/models/sent_to_address.g.dart @@ -17,27 +17,16 @@ const SentToAddressSchema = CollectionSchema( name: r'SentToAddress', id: 4845779153260162867, properties: { - r'label': PropertySchema( - id: 0, - name: r'label', - type: IsarType.string, - ), - r'txid': PropertySchema( - id: 1, - name: r'txid', - type: IsarType.string, - ), - r'value': PropertySchema( - id: 2, - name: r'value', - type: IsarType.string, - ), + r'label': PropertySchema(id: 0, name: r'label', type: IsarType.string), + r'txid': PropertySchema(id: 1, name: r'txid', type: IsarType.string), + r'value': PropertySchema(id: 2, name: r'value', type: IsarType.string), r'walletId': PropertySchema( id: 3, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _sentToAddressEstimateSize, serialize: _sentToAddressSerialize, deserialize: _sentToAddressDeserialize, @@ -54,7 +43,7 @@ const SentToAddressSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'txid_walletId': IndexSchema( @@ -72,16 +61,17 @@ const SentToAddressSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _sentToAddressGetId, getLinks: _sentToAddressGetLinks, attach: _sentToAddressAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _sentToAddressEstimateSize( @@ -154,7 +144,10 @@ List> _sentToAddressGetLinks(SentToAddress object) { } void _sentToAddressAttach( - IsarCollection col, Id id, SentToAddress object) { + IsarCollection col, + Id id, + SentToAddress object, +) { object.id = id; } @@ -176,10 +169,14 @@ extension SentToAddressByIndex on IsarCollection { } Future> getAllByTxidWalletId( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -189,10 +186,14 @@ extension SentToAddressByIndex on IsarCollection { } List getAllByTxidWalletIdSync( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -202,10 +203,14 @@ extension SentToAddressByIndex on IsarCollection { } Future deleteAllByTxidWalletId( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -215,10 +220,14 @@ extension SentToAddressByIndex on IsarCollection { } int deleteAllByTxidWalletIdSync( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -239,8 +248,10 @@ extension SentToAddressByIndex on IsarCollection { return putAllByIndex(r'txid_walletId', objects); } - List putAllByTxidWalletIdSync(List objects, - {bool saveLinks = true}) { + List putAllByTxidWalletIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'txid_walletId', objects, saveLinks: saveLinks); } } @@ -257,17 +268,16 @@ extension SentToAddressQueryWhereSort extension SentToAddressQueryWhere on QueryBuilder { QueryBuilder idEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder idNotEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -290,8 +300,9 @@ extension SentToAddressQueryWhere } QueryBuilder idGreaterThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -300,8 +311,9 @@ extension SentToAddressQueryWhere } QueryBuilder idLessThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -316,146 +328,173 @@ extension SentToAddressQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder walletIdEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder - walletIdNotEqualTo(String walletId) { + walletIdNotEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder - txidEqualToAnyWalletId(String txid) { + txidEqualToAnyWalletId(String txid) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId', - value: [txid], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'txid_walletId', value: [txid]), + ); }); } QueryBuilder - txidNotEqualToAnyWalletId(String txid) { + txidNotEqualToAnyWalletId(String txid) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [], - upper: [txid], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [], + upper: [txid], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [], - upper: [txid], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [], + upper: [txid], + includeUpper: false, + ), + ); } }); } QueryBuilder - txidWalletIdEqualTo(String txid, String walletId) { + txidWalletIdEqualTo(String txid, String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId', - value: [txid, walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'txid_walletId', + value: [txid, walletId], + ), + ); }); } QueryBuilder - txidEqualToWalletIdNotEqualTo(String txid, String walletId) { + txidEqualToWalletIdNotEqualTo(String txid, String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ); } }); } @@ -464,26 +503,25 @@ extension SentToAddressQueryWhere extension SentToAddressQueryFilter on QueryBuilder { QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } QueryBuilder - idGreaterThan( - Id value, { - bool include = false, - }) { + idGreaterThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -492,11 +530,13 @@ extension SentToAddressQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -507,64 +547,69 @@ extension SentToAddressQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - labelEqualTo( - String value, { - bool caseSensitive = true, - }) { + labelEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelGreaterThan( + labelGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelLessThan( + labelLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelBetween( + labelBetween( String lower, String upper, { bool includeLower = true, @@ -572,84 +617,86 @@ extension SentToAddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'label', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'label', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelStartsWith( - String value, { - bool caseSensitive = true, - }) { + labelStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelEndsWith( - String value, { - bool caseSensitive = true, - }) { + labelEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelContains(String value, {bool caseSensitive = true}) { + labelContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'label', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'label', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelMatches(String pattern, {bool caseSensitive = true}) { + labelMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'label', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'label', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - labelIsEmpty() { + labelIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'label', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'label', value: ''), + ); }); } QueryBuilder - labelIsNotEmpty() { + labelIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'label', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'label', value: ''), + ); }); } @@ -658,43 +705,49 @@ extension SentToAddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidGreaterThan( + txidGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidLessThan( + txidLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -706,136 +759,142 @@ extension SentToAddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'txid', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidStartsWith( - String value, { - bool caseSensitive = true, - }) { + txidStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidEndsWith( - String value, { - bool caseSensitive = true, - }) { + txidEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidContains(String value, {bool caseSensitive = true}) { + txidContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txidMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txid', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidIsEmpty() { + txidIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txid', value: ''), + ); }); } QueryBuilder - txidIsNotEmpty() { + txidIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txid', value: ''), + ); }); } QueryBuilder - valueEqualTo( - String value, { - bool caseSensitive = true, - }) { + valueEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueGreaterThan( + valueGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueLessThan( + valueLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueBetween( + valueBetween( String lower, String upper, { bool includeLower = true, @@ -843,135 +902,140 @@ extension SentToAddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'value', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStartsWith( - String value, { - bool caseSensitive = true, - }) { + valueStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueEndsWith( - String value, { - bool caseSensitive = true, - }) { + valueEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueContains(String value, {bool caseSensitive = true}) { + valueContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueMatches(String pattern, {bool caseSensitive = true}) { + valueMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'value', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'value', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIsEmpty() { + valueIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'value', value: ''), + ); }); } QueryBuilder - valueIsNotEmpty() { + valueIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'value', value: ''), + ); }); } QueryBuilder - walletIdEqualTo( - String value, { - bool caseSensitive = true, - }) { + walletIdEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdLessThan( + walletIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdBetween( + walletIdBetween( String lower, String upper, { bool includeLower = true, @@ -979,84 +1043,86 @@ extension SentToAddressQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdEndsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdContains(String value, {bool caseSensitive = true}) { + walletIdContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdMatches(String pattern, {bool caseSensitive = true}) { + walletIdMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -1112,7 +1178,7 @@ extension SentToAddressQuerySortBy } QueryBuilder - sortByWalletIdDesc() { + sortByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -1176,7 +1242,7 @@ extension SentToAddressQuerySortThenBy } QueryBuilder - thenByWalletIdDesc() { + thenByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -1185,29 +1251,33 @@ extension SentToAddressQuerySortThenBy extension SentToAddressQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByLabel( - {bool caseSensitive = true}) { + QueryBuilder distinctByLabel({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'label', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByTxid( - {bool caseSensitive = true}) { + QueryBuilder distinctByTxid({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'txid', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByValue( - {bool caseSensitive = true}) { + QueryBuilder distinctByValue({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'value', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); diff --git a/lib/models/isar/models/transaction_note.g.dart b/lib/models/isar/models/transaction_note.g.dart index 67af8cdca7..9a16ae190c 100644 --- a/lib/models/isar/models/transaction_note.g.dart +++ b/lib/models/isar/models/transaction_note.g.dart @@ -17,22 +17,15 @@ const TransactionNoteSchema = CollectionSchema( name: r'TransactionNote', id: 5128348263878806765, properties: { - r'txid': PropertySchema( - id: 0, - name: r'txid', - type: IsarType.string, - ), - r'value': PropertySchema( - id: 1, - name: r'value', - type: IsarType.string, - ), + r'txid': PropertySchema(id: 0, name: r'txid', type: IsarType.string), + r'value': PropertySchema(id: 1, name: r'value', type: IsarType.string), r'walletId': PropertySchema( id: 2, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _transactionNoteEstimateSize, serialize: _transactionNoteSerialize, deserialize: _transactionNoteDeserialize, @@ -49,7 +42,7 @@ const TransactionNoteSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], ), r'txid_walletId': IndexSchema( @@ -67,16 +60,17 @@ const TransactionNoteSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _transactionNoteGetId, getLinks: _transactionNoteGetLinks, attach: _transactionNoteAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _transactionNoteEstimateSize( @@ -144,7 +138,10 @@ List> _transactionNoteGetLinks(TransactionNote object) { } void _transactionNoteAttach( - IsarCollection col, Id id, TransactionNote object) { + IsarCollection col, + Id id, + TransactionNote object, +) { object.id = id; } @@ -166,10 +163,14 @@ extension TransactionNoteByIndex on IsarCollection { } Future> getAllByTxidWalletId( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -179,10 +180,14 @@ extension TransactionNoteByIndex on IsarCollection { } List getAllByTxidWalletIdSync( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -192,10 +197,14 @@ extension TransactionNoteByIndex on IsarCollection { } Future deleteAllByTxidWalletId( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -205,10 +214,14 @@ extension TransactionNoteByIndex on IsarCollection { } int deleteAllByTxidWalletIdSync( - List txidValues, List walletIdValues) { + List txidValues, + List walletIdValues, + ) { final len = txidValues.length; - assert(walletIdValues.length == len, - 'All index values must have the same length'); + assert( + walletIdValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([txidValues[i], walletIdValues[i]]); @@ -229,8 +242,10 @@ extension TransactionNoteByIndex on IsarCollection { return putAllByIndex(r'txid_walletId', objects); } - List putAllByTxidWalletIdSync(List objects, - {bool saveLinks = true}) { + List putAllByTxidWalletIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'txid_walletId', objects, saveLinks: saveLinks); } } @@ -247,17 +262,15 @@ extension TransactionNoteQueryWhereSort extension TransactionNoteQueryWhere on QueryBuilder { QueryBuilder idEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder - idNotEqualTo(Id id) { + idNotEqualTo(Id id) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -280,7 +293,7 @@ extension TransactionNoteQueryWhere } QueryBuilder - idGreaterThan(Id id, {bool include = false}) { + idGreaterThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -289,8 +302,9 @@ extension TransactionNoteQueryWhere } QueryBuilder idLessThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -305,146 +319,172 @@ extension TransactionNoteQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - walletIdEqualTo(String walletId) { + walletIdEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder - walletIdNotEqualTo(String walletId) { + walletIdNotEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder - txidEqualToAnyWalletId(String txid) { + txidEqualToAnyWalletId(String txid) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId', - value: [txid], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'txid_walletId', value: [txid]), + ); }); } QueryBuilder - txidNotEqualToAnyWalletId(String txid) { + txidNotEqualToAnyWalletId(String txid) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [], - upper: [txid], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [], + upper: [txid], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [], - upper: [txid], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [], + upper: [txid], + includeUpper: false, + ), + ); } }); } QueryBuilder - txidWalletIdEqualTo(String txid, String walletId) { + txidWalletIdEqualTo(String txid, String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'txid_walletId', - value: [txid, walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'txid_walletId', + value: [txid, walletId], + ), + ); }); } QueryBuilder - txidEqualToWalletIdNotEqualTo(String txid, String walletId) { + txidEqualToWalletIdNotEqualTo(String txid, String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid, walletId], - includeLower: false, - upper: [txid], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'txid_walletId', - lower: [txid], - upper: [txid, walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid, walletId], + includeLower: false, + upper: [txid], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'txid_walletId', + lower: [txid], + upper: [txid, walletId], + includeUpper: false, + ), + ); } }); } @@ -453,109 +493,111 @@ extension TransactionNoteQueryWhere extension TransactionNoteQueryFilter on QueryBuilder { QueryBuilder - idEqualTo(Id value) { + idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } QueryBuilder - idGreaterThan( - Id value, { - bool include = false, - }) { + idGreaterThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } QueryBuilder - idLessThan( - Id value, { - bool include = false, - }) { + idLessThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } QueryBuilder - idBetween( + idBetween( Id lower, Id upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - txidEqualTo( - String value, { - bool caseSensitive = true, - }) { + txidEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidGreaterThan( + txidGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidLessThan( + txidLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidBetween( + txidBetween( String lower, String upper, { bool includeLower = true, @@ -563,135 +605,140 @@ extension TransactionNoteQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'txid', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidStartsWith( - String value, { - bool caseSensitive = true, - }) { + txidStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidEndsWith( - String value, { - bool caseSensitive = true, - }) { + txidEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidContains(String value, {bool caseSensitive = true}) { + txidContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txid', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidMatches(String pattern, {bool caseSensitive = true}) { + txidMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txid', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txidIsEmpty() { + txidIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txid', value: ''), + ); }); } QueryBuilder - txidIsNotEmpty() { + txidIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txid', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txid', value: ''), + ); }); } QueryBuilder - valueEqualTo( - String value, { - bool caseSensitive = true, - }) { + valueEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueGreaterThan( + valueGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueLessThan( + valueLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueBetween( + valueBetween( String lower, String upper, { bool includeLower = true, @@ -699,135 +746,140 @@ extension TransactionNoteQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'value', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueStartsWith( - String value, { - bool caseSensitive = true, - }) { + valueStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueEndsWith( - String value, { - bool caseSensitive = true, - }) { + valueEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueContains(String value, {bool caseSensitive = true}) { + valueContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'value', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'value', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueMatches(String pattern, {bool caseSensitive = true}) { + valueMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'value', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'value', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIsEmpty() { + valueIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'value', value: ''), + ); }); } QueryBuilder - valueIsNotEmpty() { + valueIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'value', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'value', value: ''), + ); }); } QueryBuilder - walletIdEqualTo( - String value, { - bool caseSensitive = true, - }) { + walletIdEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdLessThan( + walletIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdBetween( + walletIdBetween( String lower, String upper, { bool includeLower = true, @@ -835,84 +887,86 @@ extension TransactionNoteQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdEndsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdContains(String value, {bool caseSensitive = true}) { + walletIdContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdMatches(String pattern, {bool caseSensitive = true}) { + walletIdMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -932,7 +986,7 @@ extension TransactionNoteQuerySortBy } QueryBuilder - sortByTxidDesc() { + sortByTxidDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'txid', Sort.desc); }); @@ -945,21 +999,21 @@ extension TransactionNoteQuerySortBy } QueryBuilder - sortByValueDesc() { + sortByValueDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'value', Sort.desc); }); } QueryBuilder - sortByWalletId() { + sortByWalletId() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.asc); }); } QueryBuilder - sortByWalletIdDesc() { + sortByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -987,7 +1041,7 @@ extension TransactionNoteQuerySortThenBy } QueryBuilder - thenByTxidDesc() { + thenByTxidDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'txid', Sort.desc); }); @@ -1000,21 +1054,21 @@ extension TransactionNoteQuerySortThenBy } QueryBuilder - thenByValueDesc() { + thenByValueDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'value', Sort.desc); }); } QueryBuilder - thenByWalletId() { + thenByWalletId() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.asc); }); } QueryBuilder - thenByWalletIdDesc() { + thenByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -1023,22 +1077,25 @@ extension TransactionNoteQuerySortThenBy extension TransactionNoteQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByTxid( - {bool caseSensitive = true}) { + QueryBuilder distinctByTxid({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'txid', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByValue( - {bool caseSensitive = true}) { + QueryBuilder distinctByValue({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'value', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); diff --git a/lib/models/isar/ordinal.g.dart b/lib/models/isar/ordinal.g.dart index 5c23e11bb9..09ba404340 100644 --- a/lib/models/isar/ordinal.g.dart +++ b/lib/models/isar/ordinal.g.dart @@ -17,11 +17,7 @@ const OrdinalSchema = CollectionSchema( name: r'Ordinal', id: -7772149326141951436, properties: { - r'content': PropertySchema( - id: 0, - name: r'content', - type: IsarType.string, - ), + r'content': PropertySchema(id: 0, name: r'content', type: IsarType.string), r'inscriptionId': PropertySchema( id: 1, name: r'inscriptionId', @@ -37,17 +33,14 @@ const OrdinalSchema = CollectionSchema( name: r'utxoTXID', type: IsarType.string, ), - r'utxoVOUT': PropertySchema( - id: 4, - name: r'utxoVOUT', - type: IsarType.long, - ), + r'utxoVOUT': PropertySchema(id: 4, name: r'utxoVOUT', type: IsarType.long), r'walletId': PropertySchema( id: 5, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _ordinalEstimateSize, serialize: _ordinalSerialize, deserialize: _ordinalDeserialize, @@ -74,16 +67,17 @@ const OrdinalSchema = CollectionSchema( name: r'utxoVOUT', type: IndexType.value, caseSensitive: false, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _ordinalGetId, getLinks: _ordinalGetLinks, attach: _ordinalAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _ordinalEstimateSize( @@ -169,88 +163,136 @@ void _ordinalAttach(IsarCollection col, Id id, Ordinal object) { extension OrdinalByIndex on IsarCollection { Future getByInscriptionIdUtxoTXIDUtxoVOUT( - String inscriptionId, String utxoTXID, int utxoVOUT) { - return getByIndex(r'inscriptionId_utxoTXID_utxoVOUT', - [inscriptionId, utxoTXID, utxoVOUT]); + String inscriptionId, + String utxoTXID, + int utxoVOUT, + ) { + return getByIndex(r'inscriptionId_utxoTXID_utxoVOUT', [ + inscriptionId, + utxoTXID, + utxoVOUT, + ]); } Ordinal? getByInscriptionIdUtxoTXIDUtxoVOUTSync( - String inscriptionId, String utxoTXID, int utxoVOUT) { - return getByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', - [inscriptionId, utxoTXID, utxoVOUT]); + String inscriptionId, + String utxoTXID, + int utxoVOUT, + ) { + return getByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', [ + inscriptionId, + utxoTXID, + utxoVOUT, + ]); } Future deleteByInscriptionIdUtxoTXIDUtxoVOUT( - String inscriptionId, String utxoTXID, int utxoVOUT) { - return deleteByIndex(r'inscriptionId_utxoTXID_utxoVOUT', - [inscriptionId, utxoTXID, utxoVOUT]); + String inscriptionId, + String utxoTXID, + int utxoVOUT, + ) { + return deleteByIndex(r'inscriptionId_utxoTXID_utxoVOUT', [ + inscriptionId, + utxoTXID, + utxoVOUT, + ]); } bool deleteByInscriptionIdUtxoTXIDUtxoVOUTSync( - String inscriptionId, String utxoTXID, int utxoVOUT) { - return deleteByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', - [inscriptionId, utxoTXID, utxoVOUT]); + String inscriptionId, + String utxoTXID, + int utxoVOUT, + ) { + return deleteByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', [ + inscriptionId, + utxoTXID, + utxoVOUT, + ]); } Future> getAllByInscriptionIdUtxoTXIDUtxoVOUT( - List inscriptionIdValues, - List utxoTXIDValues, - List utxoVOUTValues) { + List inscriptionIdValues, + List utxoTXIDValues, + List utxoVOUTValues, + ) { final len = inscriptionIdValues.length; - assert(utxoTXIDValues.length == len && utxoVOUTValues.length == len, - 'All index values must have the same length'); + assert( + utxoTXIDValues.length == len && utxoVOUTValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { - values - .add([inscriptionIdValues[i], utxoTXIDValues[i], utxoVOUTValues[i]]); + values.add([ + inscriptionIdValues[i], + utxoTXIDValues[i], + utxoVOUTValues[i], + ]); } return getAllByIndex(r'inscriptionId_utxoTXID_utxoVOUT', values); } List getAllByInscriptionIdUtxoTXIDUtxoVOUTSync( - List inscriptionIdValues, - List utxoTXIDValues, - List utxoVOUTValues) { + List inscriptionIdValues, + List utxoTXIDValues, + List utxoVOUTValues, + ) { final len = inscriptionIdValues.length; - assert(utxoTXIDValues.length == len && utxoVOUTValues.length == len, - 'All index values must have the same length'); + assert( + utxoTXIDValues.length == len && utxoVOUTValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { - values - .add([inscriptionIdValues[i], utxoTXIDValues[i], utxoVOUTValues[i]]); + values.add([ + inscriptionIdValues[i], + utxoTXIDValues[i], + utxoVOUTValues[i], + ]); } return getAllByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', values); } Future deleteAllByInscriptionIdUtxoTXIDUtxoVOUT( - List inscriptionIdValues, - List utxoTXIDValues, - List utxoVOUTValues) { + List inscriptionIdValues, + List utxoTXIDValues, + List utxoVOUTValues, + ) { final len = inscriptionIdValues.length; - assert(utxoTXIDValues.length == len && utxoVOUTValues.length == len, - 'All index values must have the same length'); + assert( + utxoTXIDValues.length == len && utxoVOUTValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { - values - .add([inscriptionIdValues[i], utxoTXIDValues[i], utxoVOUTValues[i]]); + values.add([ + inscriptionIdValues[i], + utxoTXIDValues[i], + utxoVOUTValues[i], + ]); } return deleteAllByIndex(r'inscriptionId_utxoTXID_utxoVOUT', values); } int deleteAllByInscriptionIdUtxoTXIDUtxoVOUTSync( - List inscriptionIdValues, - List utxoTXIDValues, - List utxoVOUTValues) { + List inscriptionIdValues, + List utxoTXIDValues, + List utxoVOUTValues, + ) { final len = inscriptionIdValues.length; - assert(utxoTXIDValues.length == len && utxoVOUTValues.length == len, - 'All index values must have the same length'); + assert( + utxoTXIDValues.length == len && utxoVOUTValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { - values - .add([inscriptionIdValues[i], utxoTXIDValues[i], utxoVOUTValues[i]]); + values.add([ + inscriptionIdValues[i], + utxoTXIDValues[i], + utxoVOUTValues[i], + ]); } return deleteAllByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', values); @@ -260,21 +302,32 @@ extension OrdinalByIndex on IsarCollection { return putByIndex(r'inscriptionId_utxoTXID_utxoVOUT', object); } - Id putByInscriptionIdUtxoTXIDUtxoVOUTSync(Ordinal object, - {bool saveLinks = true}) { - return putByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', object, - saveLinks: saveLinks); + Id putByInscriptionIdUtxoTXIDUtxoVOUTSync( + Ordinal object, { + bool saveLinks = true, + }) { + return putByIndexSync( + r'inscriptionId_utxoTXID_utxoVOUT', + object, + saveLinks: saveLinks, + ); } Future> putAllByInscriptionIdUtxoTXIDUtxoVOUT( - List objects) { + List objects, + ) { return putAllByIndex(r'inscriptionId_utxoTXID_utxoVOUT', objects); } - List putAllByInscriptionIdUtxoTXIDUtxoVOUTSync(List objects, - {bool saveLinks = true}) { - return putAllByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', objects, - saveLinks: saveLinks); + List putAllByInscriptionIdUtxoTXIDUtxoVOUTSync( + List objects, { + bool saveLinks = true, + }) { + return putAllByIndexSync( + r'inscriptionId_utxoTXID_utxoVOUT', + objects, + saveLinks: saveLinks, + ); } } @@ -289,10 +342,7 @@ extension OrdinalQueryWhereSort on QueryBuilder { extension OrdinalQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -318,8 +368,10 @@ extension OrdinalQueryWhere on QueryBuilder { }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -327,8 +379,10 @@ extension OrdinalQueryWhere on QueryBuilder { }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -343,190 +397,236 @@ extension OrdinalQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - inscriptionIdEqualToAnyUtxoTXIDUtxoVOUT(String inscriptionId) { + inscriptionIdEqualToAnyUtxoTXIDUtxoVOUT(String inscriptionId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - value: [inscriptionId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + value: [inscriptionId], + ), + ); }); } QueryBuilder - inscriptionIdNotEqualToAnyUtxoTXIDUtxoVOUT(String inscriptionId) { + inscriptionIdNotEqualToAnyUtxoTXIDUtxoVOUT(String inscriptionId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [], - upper: [inscriptionId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [], + upper: [inscriptionId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [], - upper: [inscriptionId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [], + upper: [inscriptionId], + includeUpper: false, + ), + ); } }); } QueryBuilder - inscriptionIdUtxoTXIDEqualToAnyUtxoVOUT( - String inscriptionId, String utxoTXID) { + inscriptionIdUtxoTXIDEqualToAnyUtxoVOUT( + String inscriptionId, + String utxoTXID, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - value: [inscriptionId, utxoTXID], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + value: [inscriptionId, utxoTXID], + ), + ); }); } QueryBuilder - inscriptionIdEqualToUtxoTXIDNotEqualToAnyUtxoVOUT( - String inscriptionId, String utxoTXID) { + inscriptionIdEqualToUtxoTXIDNotEqualToAnyUtxoVOUT( + String inscriptionId, + String utxoTXID, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId], - upper: [inscriptionId, utxoTXID], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID], - includeLower: false, - upper: [inscriptionId], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId], + upper: [inscriptionId, utxoTXID], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID], + includeLower: false, + upper: [inscriptionId], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID], - includeLower: false, - upper: [inscriptionId], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId], - upper: [inscriptionId, utxoTXID], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID], + includeLower: false, + upper: [inscriptionId], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId], + upper: [inscriptionId, utxoTXID], + includeUpper: false, + ), + ); } }); } QueryBuilder - inscriptionIdUtxoTXIDUtxoVOUTEqualTo( - String inscriptionId, String utxoTXID, int utxoVOUT) { + inscriptionIdUtxoTXIDUtxoVOUTEqualTo( + String inscriptionId, + String utxoTXID, + int utxoVOUT, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - value: [inscriptionId, utxoTXID, utxoVOUT], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + value: [inscriptionId, utxoTXID, utxoVOUT], + ), + ); }); } QueryBuilder - inscriptionIdUtxoTXIDEqualToUtxoVOUTNotEqualTo( - String inscriptionId, String utxoTXID, int utxoVOUT) { + inscriptionIdUtxoTXIDEqualToUtxoVOUTNotEqualTo( + String inscriptionId, + String utxoTXID, + int utxoVOUT, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID], - upper: [inscriptionId, utxoTXID, utxoVOUT], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID, utxoVOUT], - includeLower: false, - upper: [inscriptionId, utxoTXID], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID], + upper: [inscriptionId, utxoTXID, utxoVOUT], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID, utxoVOUT], + includeLower: false, + upper: [inscriptionId, utxoTXID], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID, utxoVOUT], - includeLower: false, - upper: [inscriptionId, utxoTXID], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID], - upper: [inscriptionId, utxoTXID, utxoVOUT], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID, utxoVOUT], + includeLower: false, + upper: [inscriptionId, utxoTXID], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID], + upper: [inscriptionId, utxoTXID, utxoVOUT], + includeUpper: false, + ), + ); } }); } QueryBuilder - inscriptionIdUtxoTXIDEqualToUtxoVOUTGreaterThan( + inscriptionIdUtxoTXIDEqualToUtxoVOUTGreaterThan( String inscriptionId, String utxoTXID, int utxoVOUT, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID, utxoVOUT], - includeLower: include, - upper: [inscriptionId, utxoTXID], - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID, utxoVOUT], + includeLower: include, + upper: [inscriptionId, utxoTXID], + ), + ); }); } QueryBuilder - inscriptionIdUtxoTXIDEqualToUtxoVOUTLessThan( + inscriptionIdUtxoTXIDEqualToUtxoVOUTLessThan( String inscriptionId, String utxoTXID, int utxoVOUT, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID], - upper: [inscriptionId, utxoTXID, utxoVOUT], - includeUpper: include, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID], + upper: [inscriptionId, utxoTXID, utxoVOUT], + includeUpper: include, + ), + ); }); } QueryBuilder - inscriptionIdUtxoTXIDEqualToUtxoVOUTBetween( + inscriptionIdUtxoTXIDEqualToUtxoVOUTBetween( String inscriptionId, String utxoTXID, int lowerUtxoVOUT, @@ -535,13 +635,15 @@ extension OrdinalQueryWhere on QueryBuilder { bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.between( - indexName: r'inscriptionId_utxoTXID_utxoVOUT', - lower: [inscriptionId, utxoTXID, lowerUtxoVOUT], - includeLower: includeLower, - upper: [inscriptionId, utxoTXID, upperUtxoVOUT], - includeUpper: includeUpper, - )); + return query.addWhereClause( + IndexWhereClause.between( + indexName: r'inscriptionId_utxoTXID_utxoVOUT', + lower: [inscriptionId, utxoTXID, lowerUtxoVOUT], + includeLower: includeLower, + upper: [inscriptionId, utxoTXID, upperUtxoVOUT], + includeUpper: includeUpper, + ), + ); }); } } @@ -553,11 +655,13 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'content', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'content', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -567,12 +671,14 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'content', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'content', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -582,12 +688,14 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'content', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'content', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -599,14 +707,16 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'content', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'content', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -615,11 +725,13 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'content', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'content', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -628,62 +740,67 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'content', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'content', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder contentContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'content', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'content', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder contentMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'content', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'content', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder contentIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'content', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'content', value: ''), + ); }); } QueryBuilder contentIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'content', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'content', value: ''), + ); }); } QueryBuilder idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -692,11 +809,13 @@ extension OrdinalQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -705,11 +824,13 @@ extension OrdinalQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -720,13 +841,15 @@ extension OrdinalQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -735,27 +858,31 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'inscriptionId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'inscriptionId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - inscriptionIdGreaterThan( + inscriptionIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'inscriptionId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'inscriptionId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -765,12 +892,14 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'inscriptionId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'inscriptionId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -782,14 +911,16 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'inscriptionId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'inscriptionId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -798,11 +929,13 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'inscriptionId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'inscriptionId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -811,110 +944,115 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'inscriptionId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'inscriptionId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder inscriptionIdContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'inscriptionId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'inscriptionId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder inscriptionIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'inscriptionId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'inscriptionId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder inscriptionIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'inscriptionId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'inscriptionId', value: ''), + ); }); } QueryBuilder - inscriptionIdIsNotEmpty() { + inscriptionIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'inscriptionId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'inscriptionId', value: ''), + ); }); } QueryBuilder - inscriptionNumberEqualTo(int value) { + inscriptionNumberEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'inscriptionNumber', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'inscriptionNumber', value: value), + ); }); } QueryBuilder - inscriptionNumberGreaterThan( - int value, { - bool include = false, - }) { + inscriptionNumberGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'inscriptionNumber', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'inscriptionNumber', + value: value, + ), + ); }); } QueryBuilder - inscriptionNumberLessThan( - int value, { - bool include = false, - }) { + inscriptionNumberLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'inscriptionNumber', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'inscriptionNumber', + value: value, + ), + ); }); } QueryBuilder - inscriptionNumberBetween( + inscriptionNumberBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'inscriptionNumber', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'inscriptionNumber', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -923,11 +1061,13 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'utxoTXID', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'utxoTXID', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -937,12 +1077,14 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'utxoTXID', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'utxoTXID', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -952,12 +1094,14 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'utxoTXID', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'utxoTXID', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -969,14 +1113,16 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'utxoTXID', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'utxoTXID', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -985,11 +1131,13 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'utxoTXID', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'utxoTXID', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -998,63 +1146,69 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'utxoTXID', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'utxoTXID', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder utxoTXIDContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'utxoTXID', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'utxoTXID', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder utxoTXIDMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'utxoTXID', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'utxoTXID', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder utxoTXIDIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'utxoTXID', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'utxoTXID', value: ''), + ); }); } QueryBuilder utxoTXIDIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'utxoTXID', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'utxoTXID', value: ''), + ); }); } QueryBuilder utxoVOUTEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'utxoVOUT', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'utxoVOUT', value: value), + ); }); } @@ -1063,11 +1217,13 @@ extension OrdinalQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'utxoVOUT', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'utxoVOUT', + value: value, + ), + ); }); } @@ -1076,11 +1232,13 @@ extension OrdinalQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'utxoVOUT', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'utxoVOUT', + value: value, + ), + ); }); } @@ -1091,13 +1249,15 @@ extension OrdinalQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'utxoVOUT', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'utxoVOUT', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -1106,11 +1266,13 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1120,12 +1282,14 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1135,12 +1299,14 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1152,14 +1318,16 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1168,11 +1336,13 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1181,53 +1351,59 @@ extension OrdinalQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -1401,18 +1577,22 @@ extension OrdinalQuerySortThenBy extension OrdinalQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByContent( - {bool caseSensitive = true}) { + QueryBuilder distinctByContent({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'content', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByInscriptionId( - {bool caseSensitive = true}) { + QueryBuilder distinctByInscriptionId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'inscriptionId', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'inscriptionId', + caseSensitive: caseSensitive, + ); }); } @@ -1422,8 +1602,9 @@ extension OrdinalQueryWhereDistinct }); } - QueryBuilder distinctByUtxoTXID( - {bool caseSensitive = true}) { + QueryBuilder distinctByUtxoTXID({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'utxoTXID', caseSensitive: caseSensitive); }); @@ -1435,8 +1616,9 @@ extension OrdinalQueryWhereDistinct }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); diff --git a/lib/models/isar/stack_theme.g.dart b/lib/models/isar/stack_theme.g.dart index c77d979f54..71f51800fa 100644 --- a/lib/models/isar/stack_theme.g.dart +++ b/lib/models/isar/stack_theme.g.dart @@ -51,12 +51,14 @@ const StackThemeSchema = CollectionSchema( id: 6, name: r'assets', type: IsarType.object, + target: r'ThemeAssets', ), r'assetsV2': PropertySchema( id: 7, name: r'assetsV2', type: IsarType.object, + target: r'ThemeAssetsV2', ), r'backgroundAppBarInt': PropertySchema( @@ -309,11 +311,7 @@ const StackThemeSchema = CollectionSchema( name: r'myStackContactIconBGInt', type: IsarType.long, ), - r'name': PropertySchema( - id: 58, - name: r'name', - type: IsarType.string, - ), + r'name': PropertySchema(id: 58, name: r'name', type: IsarType.string), r'numberBackDefaultInt': PropertySchema( id: 59, name: r'numberBackDefaultInt', @@ -809,11 +807,7 @@ const StackThemeSchema = CollectionSchema( name: r'topNavIconYellowInt', type: IsarType.long, ), - r'version': PropertySchema( - id: 158, - name: r'version', - type: IsarType.long, - ), + r'version': PropertySchema(id: 158, name: r'version', type: IsarType.long), r'warningBackgroundInt': PropertySchema( id: 159, name: r'warningBackgroundInt', @@ -828,9 +822,11 @@ const StackThemeSchema = CollectionSchema( id: 161, name: r'zAssetsV3', type: IsarType.object, + target: r'ThemeAssetsV3', - ) + ), }, + estimateSize: _stackThemeEstimateSize, serialize: _stackThemeSerialize, deserialize: _stackThemeDeserialize, @@ -847,20 +843,21 @@ const StackThemeSchema = CollectionSchema( name: r'themeId', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: { r'ThemeAssets': ThemeAssetsSchema, r'ThemeAssetsV2': ThemeAssetsV2Schema, - r'ThemeAssetsV3': ThemeAssetsV3Schema + r'ThemeAssetsV3': ThemeAssetsV3Schema, }, + getId: _stackThemeGetId, getLinks: _stackThemeGetLinks, attach: _stackThemeAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _stackThemeEstimateSize( @@ -872,17 +869,25 @@ int _stackThemeEstimateSize( { final value = object.assetsV1; if (value != null) { - bytesCount += 3 + + bytesCount += + 3 + ThemeAssetsSchema.estimateSize( - value, allOffsets[ThemeAssets]!, allOffsets); + value, + allOffsets[ThemeAssets]!, + allOffsets, + ); } } { final value = object.assetsV2; if (value != null) { - bytesCount += 3 + + bytesCount += + 3 + ThemeAssetsV2Schema.estimateSize( - value, allOffsets[ThemeAssetsV2]!, allOffsets); + value, + allOffsets[ThemeAssetsV2]!, + allOffsets, + ); } } bytesCount += 3 + object.brightnessString.length * 3; @@ -905,9 +910,13 @@ int _stackThemeEstimateSize( { final value = object.assetsV3; if (value != null) { - bytesCount += 3 + + bytesCount += + 3 + ThemeAssetsV3Schema.estimateSize( - value, allOffsets[ThemeAssetsV3]!, allOffsets); + value, + allOffsets[ThemeAssetsV3]!, + allOffsets, + ); } } return bytesCount; @@ -1164,8 +1173,9 @@ StackTheme _stackThemeDeserialize( object.favoriteStarInactiveInt = reader.readLong(offsets[48]); object.gradientBackgroundString = reader.readStringOrNull(offsets[49]); object.highlightInt = reader.readLong(offsets[50]); - object.homeViewButtonBarBoxShadowString = - reader.readStringOrNull(offsets[51]); + object.homeViewButtonBarBoxShadowString = reader.readStringOrNull( + offsets[51], + ); object.id = id; object.infoItemBGInt = reader.readLong(offsets[52]); object.infoItemIconsInt = reader.readLong(offsets[53]); @@ -1305,16 +1315,18 @@ P _stackThemeDeserializeProp

( return (reader.readLong(offset)) as P; case 6: return (reader.readObjectOrNull( - offset, - ThemeAssetsSchema.deserialize, - allOffsets, - )) as P; + offset, + ThemeAssetsSchema.deserialize, + allOffsets, + )) + as P; case 7: return (reader.readObjectOrNull( - offset, - ThemeAssetsV2Schema.deserialize, - allOffsets, - )) as P; + offset, + ThemeAssetsV2Schema.deserialize, + allOffsets, + )) + as P; case 8: return (reader.readLong(offset)) as P; case 9: @@ -1623,10 +1635,11 @@ P _stackThemeDeserializeProp

( return (reader.readLong(offset)) as P; case 161: return (reader.readObjectOrNull( - offset, - ThemeAssetsV3Schema.deserialize, - allOffsets, - )) as P; + offset, + ThemeAssetsV3Schema.deserialize, + allOffsets, + )) + as P; default: throw IsarError('Unknown property with id $propertyId'); } @@ -1693,8 +1706,10 @@ extension StackThemeByIndex on IsarCollection { return putAllByIndex(r'themeId', objects); } - List putAllByThemeIdSync(List objects, - {bool saveLinks = true}) { + List putAllByThemeIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'themeId', objects, saveLinks: saveLinks); } } @@ -1712,10 +1727,7 @@ extension StackThemeQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -1741,8 +1753,10 @@ extension StackThemeQueryWhere }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -1750,8 +1764,10 @@ extension StackThemeQueryWhere }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -1766,56 +1782,67 @@ extension StackThemeQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder themeIdEqualTo( - String themeId) { + String themeId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'themeId', - value: [themeId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'themeId', value: [themeId]), + ); }); } QueryBuilder themeIdNotEqualTo( - String themeId) { + String themeId, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'themeId', - lower: [], - upper: [themeId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'themeId', - lower: [themeId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'themeId', + lower: [], + upper: [themeId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'themeId', + lower: [themeId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'themeId', - lower: [themeId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'themeId', - lower: [], - upper: [themeId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'themeId', + lower: [themeId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'themeId', + lower: [], + upper: [themeId], + includeUpper: false, + ), + ); } }); } @@ -1824,871 +1851,878 @@ extension StackThemeQueryWhere extension StackThemeQueryFilter on QueryBuilder { QueryBuilder - accentColorBlueIntEqualTo(int value) { + accentColorBlueIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'accentColorBlueInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'accentColorBlueInt', value: value), + ); }); } QueryBuilder - accentColorBlueIntGreaterThan( - int value, { - bool include = false, - }) { + accentColorBlueIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'accentColorBlueInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'accentColorBlueInt', + value: value, + ), + ); }); } QueryBuilder - accentColorBlueIntLessThan( - int value, { - bool include = false, - }) { + accentColorBlueIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'accentColorBlueInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'accentColorBlueInt', + value: value, + ), + ); }); } QueryBuilder - accentColorBlueIntBetween( + accentColorBlueIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'accentColorBlueInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'accentColorBlueInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - accentColorDarkIntEqualTo(int value) { + accentColorDarkIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'accentColorDarkInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'accentColorDarkInt', value: value), + ); }); } QueryBuilder - accentColorDarkIntGreaterThan( - int value, { - bool include = false, - }) { + accentColorDarkIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'accentColorDarkInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'accentColorDarkInt', + value: value, + ), + ); }); } QueryBuilder - accentColorDarkIntLessThan( - int value, { - bool include = false, - }) { + accentColorDarkIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'accentColorDarkInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'accentColorDarkInt', + value: value, + ), + ); }); } QueryBuilder - accentColorDarkIntBetween( + accentColorDarkIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'accentColorDarkInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'accentColorDarkInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - accentColorGreenIntEqualTo(int value) { + accentColorGreenIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'accentColorGreenInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'accentColorGreenInt', value: value), + ); }); } QueryBuilder - accentColorGreenIntGreaterThan( - int value, { - bool include = false, - }) { + accentColorGreenIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'accentColorGreenInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'accentColorGreenInt', + value: value, + ), + ); }); } QueryBuilder - accentColorGreenIntLessThan( - int value, { - bool include = false, - }) { + accentColorGreenIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'accentColorGreenInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'accentColorGreenInt', + value: value, + ), + ); }); } QueryBuilder - accentColorGreenIntBetween( + accentColorGreenIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'accentColorGreenInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'accentColorGreenInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - accentColorOrangeIntEqualTo(int value) { + accentColorOrangeIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'accentColorOrangeInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'accentColorOrangeInt', + value: value, + ), + ); }); } QueryBuilder - accentColorOrangeIntGreaterThan( - int value, { - bool include = false, - }) { + accentColorOrangeIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'accentColorOrangeInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'accentColorOrangeInt', + value: value, + ), + ); }); } QueryBuilder - accentColorOrangeIntLessThan( - int value, { - bool include = false, - }) { + accentColorOrangeIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'accentColorOrangeInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'accentColorOrangeInt', + value: value, + ), + ); }); } QueryBuilder - accentColorOrangeIntBetween( + accentColorOrangeIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'accentColorOrangeInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'accentColorOrangeInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - accentColorRedIntEqualTo(int value) { + accentColorRedIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'accentColorRedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'accentColorRedInt', value: value), + ); }); } QueryBuilder - accentColorRedIntGreaterThan( - int value, { - bool include = false, - }) { + accentColorRedIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'accentColorRedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'accentColorRedInt', + value: value, + ), + ); }); } QueryBuilder - accentColorRedIntLessThan( - int value, { - bool include = false, - }) { + accentColorRedIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'accentColorRedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'accentColorRedInt', + value: value, + ), + ); }); } QueryBuilder - accentColorRedIntBetween( + accentColorRedIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'accentColorRedInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'accentColorRedInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - accentColorYellowIntEqualTo(int value) { + accentColorYellowIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'accentColorYellowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'accentColorYellowInt', + value: value, + ), + ); }); } QueryBuilder - accentColorYellowIntGreaterThan( - int value, { - bool include = false, - }) { + accentColorYellowIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'accentColorYellowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'accentColorYellowInt', + value: value, + ), + ); }); } QueryBuilder - accentColorYellowIntLessThan( - int value, { - bool include = false, - }) { + accentColorYellowIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'accentColorYellowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'accentColorYellowInt', + value: value, + ), + ); }); } QueryBuilder - accentColorYellowIntBetween( + accentColorYellowIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'accentColorYellowInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'accentColorYellowInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder assetsV1IsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'assets', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'assets'), + ); }); } QueryBuilder - assetsV1IsNotNull() { + assetsV1IsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'assets', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'assets'), + ); }); } QueryBuilder assetsV2IsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'assetsV2', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'assetsV2'), + ); }); } QueryBuilder - assetsV2IsNotNull() { + assetsV2IsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'assetsV2', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'assetsV2'), + ); }); } QueryBuilder - backgroundAppBarIntEqualTo(int value) { + backgroundAppBarIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'backgroundAppBarInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'backgroundAppBarInt', value: value), + ); }); } QueryBuilder - backgroundAppBarIntGreaterThan( - int value, { - bool include = false, - }) { + backgroundAppBarIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'backgroundAppBarInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'backgroundAppBarInt', + value: value, + ), + ); }); } QueryBuilder - backgroundAppBarIntLessThan( - int value, { - bool include = false, - }) { + backgroundAppBarIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'backgroundAppBarInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'backgroundAppBarInt', + value: value, + ), + ); }); } QueryBuilder - backgroundAppBarIntBetween( + backgroundAppBarIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'backgroundAppBarInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'backgroundAppBarInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - backgroundIntEqualTo(int value) { + backgroundIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'backgroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'backgroundInt', value: value), + ); }); } QueryBuilder - backgroundIntGreaterThan( - int value, { - bool include = false, - }) { + backgroundIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'backgroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'backgroundInt', + value: value, + ), + ); }); } QueryBuilder - backgroundIntLessThan( - int value, { - bool include = false, - }) { + backgroundIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'backgroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'backgroundInt', + value: value, + ), + ); }); } QueryBuilder - backgroundIntBetween( + backgroundIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'backgroundInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'backgroundInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - bottomNavBackIntEqualTo(int value) { + bottomNavBackIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bottomNavBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bottomNavBackInt', value: value), + ); }); } QueryBuilder - bottomNavBackIntGreaterThan( - int value, { - bool include = false, - }) { + bottomNavBackIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bottomNavBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bottomNavBackInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavBackIntLessThan( - int value, { - bool include = false, - }) { + bottomNavBackIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bottomNavBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bottomNavBackInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavBackIntBetween( + bottomNavBackIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bottomNavBackInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bottomNavBackInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - bottomNavIconBackIntEqualTo(int value) { + bottomNavIconBackIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bottomNavIconBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bottomNavIconBackInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconBackIntGreaterThan( - int value, { - bool include = false, - }) { + bottomNavIconBackIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bottomNavIconBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bottomNavIconBackInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconBackIntLessThan( - int value, { - bool include = false, - }) { + bottomNavIconBackIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bottomNavIconBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bottomNavIconBackInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconBackIntBetween( + bottomNavIconBackIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bottomNavIconBackInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bottomNavIconBackInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - bottomNavIconIconHighlightedIntEqualTo(int value) { + bottomNavIconIconHighlightedIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bottomNavIconIconHighlightedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bottomNavIconIconHighlightedInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconIconHighlightedIntGreaterThan( + bottomNavIconIconHighlightedIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bottomNavIconIconHighlightedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bottomNavIconIconHighlightedInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconIconHighlightedIntLessThan( - int value, { - bool include = false, - }) { + bottomNavIconIconHighlightedIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bottomNavIconIconHighlightedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bottomNavIconIconHighlightedInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconIconHighlightedIntBetween( + bottomNavIconIconHighlightedIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bottomNavIconIconHighlightedInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bottomNavIconIconHighlightedInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - bottomNavIconIconIntEqualTo(int value) { + bottomNavIconIconIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bottomNavIconIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bottomNavIconIconInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconIconIntGreaterThan( - int value, { - bool include = false, - }) { + bottomNavIconIconIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bottomNavIconIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bottomNavIconIconInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconIconIntLessThan( - int value, { - bool include = false, - }) { + bottomNavIconIconIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bottomNavIconIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bottomNavIconIconInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavIconIconIntBetween( + bottomNavIconIconIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bottomNavIconIconInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bottomNavIconIconInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - bottomNavShadowIntEqualTo(int value) { + bottomNavShadowIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bottomNavShadowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bottomNavShadowInt', value: value), + ); }); } QueryBuilder - bottomNavShadowIntGreaterThan( - int value, { - bool include = false, - }) { + bottomNavShadowIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bottomNavShadowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bottomNavShadowInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavShadowIntLessThan( - int value, { - bool include = false, - }) { + bottomNavShadowIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bottomNavShadowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bottomNavShadowInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavShadowIntBetween( + bottomNavShadowIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bottomNavShadowInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bottomNavShadowInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - bottomNavTextIntEqualTo(int value) { + bottomNavTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bottomNavTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bottomNavTextInt', value: value), + ); }); } QueryBuilder - bottomNavTextIntGreaterThan( - int value, { - bool include = false, - }) { + bottomNavTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bottomNavTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bottomNavTextInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavTextIntLessThan( - int value, { - bool include = false, - }) { + bottomNavTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bottomNavTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bottomNavTextInt', + value: value, + ), + ); }); } QueryBuilder - bottomNavTextIntBetween( + bottomNavTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bottomNavTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bottomNavTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - brightnessStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + brightnessStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'brightnessString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'brightnessString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - brightnessStringGreaterThan( + brightnessStringGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'brightnessString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'brightnessString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - brightnessStringLessThan( + brightnessStringLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'brightnessString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'brightnessString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - brightnessStringBetween( + brightnessStringBetween( String lower, String upper, { bool includeLower = true, @@ -2696,1367 +2730,1419 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'brightnessString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'brightnessString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - brightnessStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + brightnessStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'brightnessString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'brightnessString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - brightnessStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + brightnessStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'brightnessString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'brightnessString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - brightnessStringContains(String value, {bool caseSensitive = true}) { + brightnessStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'brightnessString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'brightnessString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - brightnessStringMatches(String pattern, {bool caseSensitive = true}) { + brightnessStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'brightnessString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'brightnessString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - brightnessStringIsEmpty() { + brightnessStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'brightnessString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'brightnessString', value: ''), + ); }); } QueryBuilder - brightnessStringIsNotEmpty() { + brightnessStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'brightnessString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'brightnessString', value: ''), + ); }); } QueryBuilder - buttonBackBorderDisabledIntEqualTo(int value) { + buttonBackBorderDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonBackBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonBackBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + buttonBackBorderDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonBackBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonBackBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderDisabledIntLessThan( - int value, { - bool include = false, - }) { + buttonBackBorderDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonBackBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonBackBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderDisabledIntBetween( + buttonBackBorderDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonBackBorderDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonBackBorderDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonBackBorderIntEqualTo(int value) { + buttonBackBorderIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonBackBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'buttonBackBorderInt', value: value), + ); }); } QueryBuilder - buttonBackBorderIntGreaterThan( - int value, { - bool include = false, - }) { + buttonBackBorderIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonBackBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonBackBorderInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderIntLessThan( - int value, { - bool include = false, - }) { + buttonBackBorderIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonBackBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonBackBorderInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderIntBetween( + buttonBackBorderIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonBackBorderInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonBackBorderInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonBackBorderSecondaryDisabledIntEqualTo(int value) { + buttonBackBorderSecondaryDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonBackBorderSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonBackBorderSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderSecondaryDisabledIntGreaterThan( + buttonBackBorderSecondaryDisabledIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonBackBorderSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonBackBorderSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderSecondaryDisabledIntLessThan( + buttonBackBorderSecondaryDisabledIntLessThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonBackBorderSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonBackBorderSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderSecondaryDisabledIntBetween( + buttonBackBorderSecondaryDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonBackBorderSecondaryDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonBackBorderSecondaryDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonBackBorderSecondaryIntEqualTo(int value) { + buttonBackBorderSecondaryIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonBackBorderSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonBackBorderSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderSecondaryIntGreaterThan( - int value, { - bool include = false, - }) { + buttonBackBorderSecondaryIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonBackBorderSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonBackBorderSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderSecondaryIntLessThan( - int value, { - bool include = false, - }) { + buttonBackBorderSecondaryIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonBackBorderSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonBackBorderSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackBorderSecondaryIntBetween( + buttonBackBorderSecondaryIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonBackBorderSecondaryInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonBackBorderSecondaryInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonBackPrimaryDisabledIntEqualTo(int value) { + buttonBackPrimaryDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonBackPrimaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonBackPrimaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackPrimaryDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + buttonBackPrimaryDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonBackPrimaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonBackPrimaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackPrimaryDisabledIntLessThan( - int value, { - bool include = false, - }) { + buttonBackPrimaryDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonBackPrimaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonBackPrimaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackPrimaryDisabledIntBetween( + buttonBackPrimaryDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonBackPrimaryDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonBackPrimaryDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonBackPrimaryIntEqualTo(int value) { + buttonBackPrimaryIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonBackPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonBackPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackPrimaryIntGreaterThan( - int value, { - bool include = false, - }) { + buttonBackPrimaryIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonBackPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonBackPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackPrimaryIntLessThan( - int value, { - bool include = false, - }) { + buttonBackPrimaryIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonBackPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonBackPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackPrimaryIntBetween( + buttonBackPrimaryIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonBackPrimaryInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonBackPrimaryInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonBackSecondaryDisabledIntEqualTo(int value) { + buttonBackSecondaryDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonBackSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonBackSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackSecondaryDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + buttonBackSecondaryDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonBackSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonBackSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackSecondaryDisabledIntLessThan( - int value, { - bool include = false, - }) { + buttonBackSecondaryDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonBackSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonBackSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackSecondaryDisabledIntBetween( + buttonBackSecondaryDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonBackSecondaryDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonBackSecondaryDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonBackSecondaryIntEqualTo(int value) { + buttonBackSecondaryIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonBackSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonBackSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackSecondaryIntGreaterThan( - int value, { - bool include = false, - }) { + buttonBackSecondaryIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonBackSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonBackSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackSecondaryIntLessThan( - int value, { - bool include = false, - }) { + buttonBackSecondaryIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonBackSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonBackSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonBackSecondaryIntBetween( + buttonBackSecondaryIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonBackSecondaryInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonBackSecondaryInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonTextBorderIntEqualTo(int value) { + buttonTextBorderIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonTextBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'buttonTextBorderInt', value: value), + ); }); } QueryBuilder - buttonTextBorderIntGreaterThan( - int value, { - bool include = false, - }) { + buttonTextBorderIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonTextBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonTextBorderInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextBorderIntLessThan( - int value, { - bool include = false, - }) { + buttonTextBorderIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonTextBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonTextBorderInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextBorderIntBetween( + buttonTextBorderIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonTextBorderInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonTextBorderInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonTextBorderlessDisabledIntEqualTo(int value) { + buttonTextBorderlessDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonTextBorderlessDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonTextBorderlessDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextBorderlessDisabledIntGreaterThan( + buttonTextBorderlessDisabledIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonTextBorderlessDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonTextBorderlessDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextBorderlessDisabledIntLessThan( - int value, { - bool include = false, - }) { + buttonTextBorderlessDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonTextBorderlessDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonTextBorderlessDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextBorderlessDisabledIntBetween( + buttonTextBorderlessDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonTextBorderlessDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonTextBorderlessDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonTextBorderlessIntEqualTo(int value) { + buttonTextBorderlessIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonTextBorderlessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonTextBorderlessInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextBorderlessIntGreaterThan( - int value, { - bool include = false, - }) { + buttonTextBorderlessIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonTextBorderlessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonTextBorderlessInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextBorderlessIntLessThan( - int value, { - bool include = false, - }) { + buttonTextBorderlessIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonTextBorderlessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonTextBorderlessInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextBorderlessIntBetween( + buttonTextBorderlessIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonTextBorderlessInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonTextBorderlessInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonTextDisabledIntEqualTo(int value) { + buttonTextDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonTextDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonTextDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + buttonTextDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonTextDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonTextDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextDisabledIntLessThan( - int value, { - bool include = false, - }) { + buttonTextDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonTextDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonTextDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextDisabledIntBetween( + buttonTextDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonTextDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonTextDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonTextPrimaryDisabledIntEqualTo(int value) { + buttonTextPrimaryDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonTextPrimaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonTextPrimaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextPrimaryDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + buttonTextPrimaryDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonTextPrimaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonTextPrimaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextPrimaryDisabledIntLessThan( - int value, { - bool include = false, - }) { + buttonTextPrimaryDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonTextPrimaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonTextPrimaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextPrimaryDisabledIntBetween( + buttonTextPrimaryDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonTextPrimaryDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonTextPrimaryDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonTextPrimaryIntEqualTo(int value) { + buttonTextPrimaryIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonTextPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonTextPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextPrimaryIntGreaterThan( - int value, { - bool include = false, - }) { + buttonTextPrimaryIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonTextPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonTextPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextPrimaryIntLessThan( - int value, { - bool include = false, - }) { + buttonTextPrimaryIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonTextPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonTextPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextPrimaryIntBetween( + buttonTextPrimaryIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonTextPrimaryInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonTextPrimaryInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonTextSecondaryDisabledIntEqualTo(int value) { + buttonTextSecondaryDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonTextSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonTextSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextSecondaryDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + buttonTextSecondaryDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonTextSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonTextSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextSecondaryDisabledIntLessThan( - int value, { - bool include = false, - }) { + buttonTextSecondaryDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonTextSecondaryDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonTextSecondaryDisabledInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextSecondaryDisabledIntBetween( + buttonTextSecondaryDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonTextSecondaryDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonTextSecondaryDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - buttonTextSecondaryIntEqualTo(int value) { + buttonTextSecondaryIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buttonTextSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buttonTextSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextSecondaryIntGreaterThan( - int value, { - bool include = false, - }) { + buttonTextSecondaryIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buttonTextSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buttonTextSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextSecondaryIntLessThan( - int value, { - bool include = false, - }) { + buttonTextSecondaryIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buttonTextSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buttonTextSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - buttonTextSecondaryIntBetween( + buttonTextSecondaryIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'buttonTextSecondaryInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buttonTextSecondaryInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - checkboxBGCheckedIntEqualTo(int value) { + checkboxBGCheckedIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'checkboxBGCheckedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'checkboxBGCheckedInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBGCheckedIntGreaterThan( - int value, { - bool include = false, - }) { + checkboxBGCheckedIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'checkboxBGCheckedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'checkboxBGCheckedInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBGCheckedIntLessThan( - int value, { - bool include = false, - }) { + checkboxBGCheckedIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'checkboxBGCheckedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'checkboxBGCheckedInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBGCheckedIntBetween( + checkboxBGCheckedIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'checkboxBGCheckedInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'checkboxBGCheckedInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - checkboxBGDisabledIntEqualTo(int value) { + checkboxBGDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'checkboxBGDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'checkboxBGDisabledInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBGDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + checkboxBGDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'checkboxBGDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'checkboxBGDisabledInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBGDisabledIntLessThan( - int value, { - bool include = false, - }) { + checkboxBGDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'checkboxBGDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'checkboxBGDisabledInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBGDisabledIntBetween( + checkboxBGDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'checkboxBGDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'checkboxBGDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - checkboxBorderEmptyIntEqualTo(int value) { + checkboxBorderEmptyIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'checkboxBorderEmptyInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'checkboxBorderEmptyInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBorderEmptyIntGreaterThan( - int value, { - bool include = false, - }) { + checkboxBorderEmptyIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'checkboxBorderEmptyInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'checkboxBorderEmptyInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBorderEmptyIntLessThan( - int value, { - bool include = false, - }) { + checkboxBorderEmptyIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'checkboxBorderEmptyInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'checkboxBorderEmptyInt', + value: value, + ), + ); }); } QueryBuilder - checkboxBorderEmptyIntBetween( + checkboxBorderEmptyIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'checkboxBorderEmptyInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'checkboxBorderEmptyInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - checkboxIconCheckedIntEqualTo(int value) { + checkboxIconCheckedIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'checkboxIconCheckedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'checkboxIconCheckedInt', + value: value, + ), + ); }); } QueryBuilder - checkboxIconCheckedIntGreaterThan( - int value, { - bool include = false, - }) { + checkboxIconCheckedIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'checkboxIconCheckedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'checkboxIconCheckedInt', + value: value, + ), + ); }); } QueryBuilder - checkboxIconCheckedIntLessThan( - int value, { - bool include = false, - }) { + checkboxIconCheckedIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'checkboxIconCheckedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'checkboxIconCheckedInt', + value: value, + ), + ); }); } QueryBuilder - checkboxIconCheckedIntBetween( + checkboxIconCheckedIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'checkboxIconCheckedInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'checkboxIconCheckedInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - checkboxIconDisabledIntEqualTo(int value) { + checkboxIconDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'checkboxIconDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'checkboxIconDisabledInt', + value: value, + ), + ); }); } QueryBuilder - checkboxIconDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + checkboxIconDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'checkboxIconDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'checkboxIconDisabledInt', + value: value, + ), + ); }); } QueryBuilder - checkboxIconDisabledIntLessThan( - int value, { - bool include = false, - }) { + checkboxIconDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'checkboxIconDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'checkboxIconDisabledInt', + value: value, + ), + ); }); } QueryBuilder - checkboxIconDisabledIntBetween( + checkboxIconDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'checkboxIconDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'checkboxIconDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - checkboxTextLabelIntEqualTo(int value) { + checkboxTextLabelIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'checkboxTextLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'checkboxTextLabelInt', + value: value, + ), + ); }); } QueryBuilder - checkboxTextLabelIntGreaterThan( - int value, { - bool include = false, - }) { + checkboxTextLabelIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'checkboxTextLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'checkboxTextLabelInt', + value: value, + ), + ); }); } QueryBuilder - checkboxTextLabelIntLessThan( - int value, { - bool include = false, - }) { + checkboxTextLabelIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'checkboxTextLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'checkboxTextLabelInt', + value: value, + ), + ); }); } QueryBuilder - checkboxTextLabelIntBetween( + checkboxTextLabelIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'checkboxTextLabelInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'checkboxTextLabelInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - coinColorsJsonStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + coinColorsJsonStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinColorsJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinColorsJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinColorsJsonStringGreaterThan( + coinColorsJsonStringGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'coinColorsJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinColorsJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinColorsJsonStringLessThan( + coinColorsJsonStringLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'coinColorsJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinColorsJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinColorsJsonStringBetween( + coinColorsJsonStringBetween( String lower, String upper, { bool includeLower = true, @@ -4064,657 +4150,674 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'coinColorsJsonString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'coinColorsJsonString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinColorsJsonStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + coinColorsJsonStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinColorsJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinColorsJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinColorsJsonStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + coinColorsJsonStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinColorsJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinColorsJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinColorsJsonStringContains(String value, {bool caseSensitive = true}) { + coinColorsJsonStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinColorsJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinColorsJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinColorsJsonStringMatches(String pattern, {bool caseSensitive = true}) { + coinColorsJsonStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinColorsJsonString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinColorsJsonString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinColorsJsonStringIsEmpty() { + coinColorsJsonStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinColorsJsonString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinColorsJsonString', value: ''), + ); }); } QueryBuilder - coinColorsJsonStringIsNotEmpty() { + coinColorsJsonStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinColorsJsonString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'coinColorsJsonString', + value: '', + ), + ); }); } QueryBuilder - currencyListItemBGIntEqualTo(int value) { + currencyListItemBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'currencyListItemBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'currencyListItemBGInt', + value: value, + ), + ); }); } QueryBuilder - currencyListItemBGIntGreaterThan( - int value, { - bool include = false, - }) { + currencyListItemBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'currencyListItemBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'currencyListItemBGInt', + value: value, + ), + ); }); } QueryBuilder - currencyListItemBGIntLessThan( - int value, { - bool include = false, - }) { + currencyListItemBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'currencyListItemBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'currencyListItemBGInt', + value: value, + ), + ); }); } QueryBuilder - currencyListItemBGIntBetween( + currencyListItemBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'currencyListItemBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'currencyListItemBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - customTextButtonDisabledTextIntEqualTo(int value) { + customTextButtonDisabledTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'customTextButtonDisabledTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'customTextButtonDisabledTextInt', + value: value, + ), + ); }); } QueryBuilder - customTextButtonDisabledTextIntGreaterThan( + customTextButtonDisabledTextIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'customTextButtonDisabledTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'customTextButtonDisabledTextInt', + value: value, + ), + ); }); } QueryBuilder - customTextButtonDisabledTextIntLessThan( - int value, { - bool include = false, - }) { + customTextButtonDisabledTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'customTextButtonDisabledTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'customTextButtonDisabledTextInt', + value: value, + ), + ); }); } QueryBuilder - customTextButtonDisabledTextIntBetween( + customTextButtonDisabledTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'customTextButtonDisabledTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'customTextButtonDisabledTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - customTextButtonEnabledTextIntEqualTo(int value) { + customTextButtonEnabledTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'customTextButtonEnabledTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'customTextButtonEnabledTextInt', + value: value, + ), + ); }); } QueryBuilder - customTextButtonEnabledTextIntGreaterThan( - int value, { - bool include = false, - }) { + customTextButtonEnabledTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'customTextButtonEnabledTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'customTextButtonEnabledTextInt', + value: value, + ), + ); }); } QueryBuilder - customTextButtonEnabledTextIntLessThan( - int value, { - bool include = false, - }) { + customTextButtonEnabledTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'customTextButtonEnabledTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'customTextButtonEnabledTextInt', + value: value, + ), + ); }); } QueryBuilder - customTextButtonEnabledTextIntBetween( + customTextButtonEnabledTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'customTextButtonEnabledTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'customTextButtonEnabledTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - ethTagBGIntEqualTo(int value) { + ethTagBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethTagBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ethTagBGInt', value: value), + ); }); } QueryBuilder - ethTagBGIntGreaterThan( - int value, { - bool include = false, - }) { + ethTagBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ethTagBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ethTagBGInt', + value: value, + ), + ); }); } QueryBuilder - ethTagBGIntLessThan( - int value, { - bool include = false, - }) { + ethTagBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ethTagBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ethTagBGInt', + value: value, + ), + ); }); } QueryBuilder - ethTagBGIntBetween( + ethTagBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ethTagBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ethTagBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - ethTagTextIntEqualTo(int value) { + ethTagTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethTagTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ethTagTextInt', value: value), + ); }); } QueryBuilder - ethTagTextIntGreaterThan( - int value, { - bool include = false, - }) { + ethTagTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ethTagTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ethTagTextInt', + value: value, + ), + ); }); } QueryBuilder - ethTagTextIntLessThan( - int value, { - bool include = false, - }) { + ethTagTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ethTagTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ethTagTextInt', + value: value, + ), + ); }); } QueryBuilder - ethTagTextIntBetween( + ethTagTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ethTagTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ethTagTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - ethWalletTagBGIntEqualTo(int value) { + ethWalletTagBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethWalletTagBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ethWalletTagBGInt', value: value), + ); }); } QueryBuilder - ethWalletTagBGIntGreaterThan( - int value, { - bool include = false, - }) { + ethWalletTagBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ethWalletTagBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ethWalletTagBGInt', + value: value, + ), + ); }); } QueryBuilder - ethWalletTagBGIntLessThan( - int value, { - bool include = false, - }) { + ethWalletTagBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ethWalletTagBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ethWalletTagBGInt', + value: value, + ), + ); }); } QueryBuilder - ethWalletTagBGIntBetween( + ethWalletTagBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ethWalletTagBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ethWalletTagBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - ethWalletTagTextIntEqualTo(int value) { + ethWalletTagTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethWalletTagTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ethWalletTagTextInt', value: value), + ); }); } QueryBuilder - ethWalletTagTextIntGreaterThan( - int value, { - bool include = false, - }) { + ethWalletTagTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ethWalletTagTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ethWalletTagTextInt', + value: value, + ), + ); }); } QueryBuilder - ethWalletTagTextIntLessThan( - int value, { - bool include = false, - }) { + ethWalletTagTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ethWalletTagTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ethWalletTagTextInt', + value: value, + ), + ); }); } QueryBuilder - ethWalletTagTextIntBetween( + ethWalletTagTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ethWalletTagTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ethWalletTagTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - favoriteStarActiveIntEqualTo(int value) { + favoriteStarActiveIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'favoriteStarActiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'favoriteStarActiveInt', + value: value, + ), + ); }); } QueryBuilder - favoriteStarActiveIntGreaterThan( - int value, { - bool include = false, - }) { + favoriteStarActiveIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'favoriteStarActiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'favoriteStarActiveInt', + value: value, + ), + ); }); } QueryBuilder - favoriteStarActiveIntLessThan( - int value, { - bool include = false, - }) { + favoriteStarActiveIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'favoriteStarActiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'favoriteStarActiveInt', + value: value, + ), + ); }); } QueryBuilder - favoriteStarActiveIntBetween( + favoriteStarActiveIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'favoriteStarActiveInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'favoriteStarActiveInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - favoriteStarInactiveIntEqualTo(int value) { + favoriteStarInactiveIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'favoriteStarInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'favoriteStarInactiveInt', + value: value, + ), + ); }); } QueryBuilder - favoriteStarInactiveIntGreaterThan( - int value, { - bool include = false, - }) { + favoriteStarInactiveIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'favoriteStarInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'favoriteStarInactiveInt', + value: value, + ), + ); }); } QueryBuilder - favoriteStarInactiveIntLessThan( - int value, { - bool include = false, - }) { + favoriteStarInactiveIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'favoriteStarInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'favoriteStarInactiveInt', + value: value, + ), + ); }); } QueryBuilder - favoriteStarInactiveIntBetween( + favoriteStarInactiveIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'favoriteStarInactiveInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'favoriteStarInactiveInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - gradientBackgroundStringIsNull() { + gradientBackgroundStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'gradientBackgroundString', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'gradientBackgroundString'), + ); }); } QueryBuilder - gradientBackgroundStringIsNotNull() { + gradientBackgroundStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'gradientBackgroundString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'gradientBackgroundString'), + ); }); } QueryBuilder - gradientBackgroundStringEqualTo( - String? value, { - bool caseSensitive = true, - }) { + gradientBackgroundStringEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'gradientBackgroundString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'gradientBackgroundString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - gradientBackgroundStringGreaterThan( + gradientBackgroundStringGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'gradientBackgroundString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'gradientBackgroundString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - gradientBackgroundStringLessThan( + gradientBackgroundStringLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'gradientBackgroundString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'gradientBackgroundString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - gradientBackgroundStringBetween( + gradientBackgroundStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -4722,211 +4825,229 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'gradientBackgroundString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'gradientBackgroundString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - gradientBackgroundStringStartsWith( + gradientBackgroundStringStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'gradientBackgroundString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'gradientBackgroundString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - gradientBackgroundStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + gradientBackgroundStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'gradientBackgroundString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'gradientBackgroundString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - gradientBackgroundStringContains(String value, - {bool caseSensitive = true}) { + gradientBackgroundStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'gradientBackgroundString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'gradientBackgroundString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - gradientBackgroundStringMatches(String pattern, - {bool caseSensitive = true}) { + gradientBackgroundStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'gradientBackgroundString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'gradientBackgroundString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - gradientBackgroundStringIsEmpty() { + gradientBackgroundStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'gradientBackgroundString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'gradientBackgroundString', + value: '', + ), + ); }); } QueryBuilder - gradientBackgroundStringIsNotEmpty() { + gradientBackgroundStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'gradientBackgroundString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'gradientBackgroundString', + value: '', + ), + ); }); } QueryBuilder - highlightIntEqualTo(int value) { + highlightIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'highlightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'highlightInt', value: value), + ); }); } QueryBuilder - highlightIntGreaterThan( - int value, { - bool include = false, - }) { + highlightIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'highlightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'highlightInt', + value: value, + ), + ); }); } QueryBuilder - highlightIntLessThan( - int value, { - bool include = false, - }) { + highlightIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'highlightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'highlightInt', + value: value, + ), + ); }); } QueryBuilder - highlightIntBetween( + highlightIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'highlightInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'highlightInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringIsNull() { + homeViewButtonBarBoxShadowStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'homeViewButtonBarBoxShadowString', - )); + return query.addFilterCondition( + const FilterCondition.isNull( + property: r'homeViewButtonBarBoxShadowString', + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringIsNotNull() { + homeViewButtonBarBoxShadowStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'homeViewButtonBarBoxShadowString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull( + property: r'homeViewButtonBarBoxShadowString', + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringEqualTo( + homeViewButtonBarBoxShadowStringEqualTo( String? value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'homeViewButtonBarBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'homeViewButtonBarBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringGreaterThan( + homeViewButtonBarBoxShadowStringGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'homeViewButtonBarBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'homeViewButtonBarBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringLessThan( + homeViewButtonBarBoxShadowStringLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'homeViewButtonBarBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'homeViewButtonBarBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringBetween( + homeViewButtonBarBoxShadowStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -4934,96 +5055,114 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'homeViewButtonBarBoxShadowString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'homeViewButtonBarBoxShadowString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringStartsWith( + homeViewButtonBarBoxShadowStringStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'homeViewButtonBarBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'homeViewButtonBarBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringEndsWith( + homeViewButtonBarBoxShadowStringEndsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'homeViewButtonBarBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'homeViewButtonBarBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringContains(String value, - {bool caseSensitive = true}) { + homeViewButtonBarBoxShadowStringContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'homeViewButtonBarBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'homeViewButtonBarBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringMatches(String pattern, - {bool caseSensitive = true}) { + homeViewButtonBarBoxShadowStringMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'homeViewButtonBarBoxShadowString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'homeViewButtonBarBoxShadowString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringIsEmpty() { + homeViewButtonBarBoxShadowStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'homeViewButtonBarBoxShadowString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'homeViewButtonBarBoxShadowString', + value: '', + ), + ); }); } QueryBuilder - homeViewButtonBarBoxShadowStringIsNotEmpty() { + homeViewButtonBarBoxShadowStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'homeViewButtonBarBoxShadowString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'homeViewButtonBarBoxShadowString', + value: '', + ), + ); }); } QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -5032,11 +5171,13 @@ extension StackThemeQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -5045,11 +5186,13 @@ extension StackThemeQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -5060,349 +5203,351 @@ extension StackThemeQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - infoItemBGIntEqualTo(int value) { + infoItemBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'infoItemBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'infoItemBGInt', value: value), + ); }); } QueryBuilder - infoItemBGIntGreaterThan( - int value, { - bool include = false, - }) { + infoItemBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'infoItemBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'infoItemBGInt', + value: value, + ), + ); }); } QueryBuilder - infoItemBGIntLessThan( - int value, { - bool include = false, - }) { + infoItemBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'infoItemBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'infoItemBGInt', + value: value, + ), + ); }); } QueryBuilder - infoItemBGIntBetween( + infoItemBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'infoItemBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'infoItemBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - infoItemIconsIntEqualTo(int value) { + infoItemIconsIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'infoItemIconsInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'infoItemIconsInt', value: value), + ); }); } QueryBuilder - infoItemIconsIntGreaterThan( - int value, { - bool include = false, - }) { + infoItemIconsIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'infoItemIconsInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'infoItemIconsInt', + value: value, + ), + ); }); } QueryBuilder - infoItemIconsIntLessThan( - int value, { - bool include = false, - }) { + infoItemIconsIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'infoItemIconsInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'infoItemIconsInt', + value: value, + ), + ); }); } QueryBuilder - infoItemIconsIntBetween( + infoItemIconsIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'infoItemIconsInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'infoItemIconsInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - infoItemLabelIntEqualTo(int value) { + infoItemLabelIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'infoItemLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'infoItemLabelInt', value: value), + ); }); } QueryBuilder - infoItemLabelIntGreaterThan( - int value, { - bool include = false, - }) { + infoItemLabelIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'infoItemLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'infoItemLabelInt', + value: value, + ), + ); }); } QueryBuilder - infoItemLabelIntLessThan( - int value, { - bool include = false, - }) { + infoItemLabelIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'infoItemLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'infoItemLabelInt', + value: value, + ), + ); }); } QueryBuilder - infoItemLabelIntBetween( + infoItemLabelIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'infoItemLabelInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'infoItemLabelInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - infoItemTextIntEqualTo(int value) { + infoItemTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'infoItemTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'infoItemTextInt', value: value), + ); }); } QueryBuilder - infoItemTextIntGreaterThan( - int value, { - bool include = false, - }) { + infoItemTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'infoItemTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'infoItemTextInt', + value: value, + ), + ); }); } QueryBuilder - infoItemTextIntLessThan( - int value, { - bool include = false, - }) { + infoItemTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'infoItemTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'infoItemTextInt', + value: value, + ), + ); }); } QueryBuilder - infoItemTextIntBetween( + infoItemTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'infoItemTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'infoItemTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - loadingOverlayTextColorIntEqualTo(int value) { + loadingOverlayTextColorIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'loadingOverlayTextColorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'loadingOverlayTextColorInt', + value: value, + ), + ); }); } QueryBuilder - loadingOverlayTextColorIntGreaterThan( - int value, { - bool include = false, - }) { + loadingOverlayTextColorIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'loadingOverlayTextColorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'loadingOverlayTextColorInt', + value: value, + ), + ); }); } QueryBuilder - loadingOverlayTextColorIntLessThan( - int value, { - bool include = false, - }) { + loadingOverlayTextColorIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'loadingOverlayTextColorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'loadingOverlayTextColorInt', + value: value, + ), + ); }); } QueryBuilder - loadingOverlayTextColorIntBetween( + loadingOverlayTextColorIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'loadingOverlayTextColorInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'loadingOverlayTextColorInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - myStackContactIconBGIntEqualTo(int value) { + myStackContactIconBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'myStackContactIconBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'myStackContactIconBGInt', + value: value, + ), + ); }); } QueryBuilder - myStackContactIconBGIntGreaterThan( - int value, { - bool include = false, - }) { + myStackContactIconBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'myStackContactIconBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'myStackContactIconBGInt', + value: value, + ), + ); }); } QueryBuilder - myStackContactIconBGIntLessThan( - int value, { - bool include = false, - }) { + myStackContactIconBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'myStackContactIconBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'myStackContactIconBGInt', + value: value, + ), + ); }); } QueryBuilder - myStackContactIconBGIntBetween( + myStackContactIconBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'myStackContactIconBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'myStackContactIconBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -5411,11 +5556,13 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -5425,12 +5572,14 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -5440,12 +5589,14 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -5457,14 +5608,16 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'name', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -5473,11 +5626,13 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -5486,315 +5641,327 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'name', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'name', value: ''), + ); }); } QueryBuilder nameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'name', value: ''), + ); }); } QueryBuilder - numberBackDefaultIntEqualTo(int value) { + numberBackDefaultIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'numberBackDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'numberBackDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numberBackDefaultIntGreaterThan( - int value, { - bool include = false, - }) { + numberBackDefaultIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'numberBackDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'numberBackDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numberBackDefaultIntLessThan( - int value, { - bool include = false, - }) { + numberBackDefaultIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'numberBackDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'numberBackDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numberBackDefaultIntBetween( + numberBackDefaultIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'numberBackDefaultInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'numberBackDefaultInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - numberTextDefaultIntEqualTo(int value) { + numberTextDefaultIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'numberTextDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'numberTextDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numberTextDefaultIntGreaterThan( - int value, { - bool include = false, - }) { + numberTextDefaultIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'numberTextDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'numberTextDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numberTextDefaultIntLessThan( - int value, { - bool include = false, - }) { + numberTextDefaultIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'numberTextDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'numberTextDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numberTextDefaultIntBetween( + numberTextDefaultIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'numberTextDefaultInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'numberTextDefaultInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - numpadBackDefaultIntEqualTo(int value) { + numpadBackDefaultIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'numpadBackDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'numpadBackDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numpadBackDefaultIntGreaterThan( - int value, { - bool include = false, - }) { + numpadBackDefaultIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'numpadBackDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'numpadBackDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numpadBackDefaultIntLessThan( - int value, { - bool include = false, - }) { + numpadBackDefaultIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'numpadBackDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'numpadBackDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numpadBackDefaultIntBetween( + numpadBackDefaultIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'numpadBackDefaultInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'numpadBackDefaultInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - numpadTextDefaultIntEqualTo(int value) { + numpadTextDefaultIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'numpadTextDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'numpadTextDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numpadTextDefaultIntGreaterThan( - int value, { - bool include = false, - }) { + numpadTextDefaultIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'numpadTextDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'numpadTextDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numpadTextDefaultIntLessThan( - int value, { - bool include = false, - }) { + numpadTextDefaultIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'numpadTextDefaultInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'numpadTextDefaultInt', + value: value, + ), + ); }); } QueryBuilder - numpadTextDefaultIntBetween( + numpadTextDefaultIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'numpadTextDefaultInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'numpadTextDefaultInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder overlayIntEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'overlayInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'overlayInt', value: value), + ); }); } QueryBuilder - overlayIntGreaterThan( - int value, { - bool include = false, - }) { + overlayIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'overlayInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'overlayInt', + value: value, + ), + ); }); } QueryBuilder - overlayIntLessThan( - int value, { - bool include = false, - }) { + overlayIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'overlayInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'overlayInt', + value: value, + ), + ); }); } @@ -5805,51 +5972,51 @@ extension StackThemeQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'overlayInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'overlayInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder popupBGIntEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'popupBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'popupBGInt', value: value), + ); }); } QueryBuilder - popupBGIntGreaterThan( - int value, { - bool include = false, - }) { + popupBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'popupBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'popupBGInt', + value: value, + ), + ); }); } QueryBuilder - popupBGIntLessThan( - int value, { - bool include = false, - }) { + popupBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'popupBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'popupBGInt', + value: value, + ), + ); }); } @@ -5860,1213 +6027,1259 @@ extension StackThemeQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'popupBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'popupBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonBorderDisabledIntEqualTo(int value) { + radioButtonBorderDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonBorderDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonBorderDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonBorderDisabledIntLessThan( - int value, { - bool include = false, - }) { + radioButtonBorderDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonBorderDisabledIntBetween( + radioButtonBorderDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonBorderDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonBorderDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonBorderEnabledIntEqualTo(int value) { + radioButtonBorderEnabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonBorderEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonBorderEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonBorderEnabledIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonBorderEnabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonBorderEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonBorderEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonBorderEnabledIntLessThan( - int value, { - bool include = false, - }) { + radioButtonBorderEnabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonBorderEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonBorderEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonBorderEnabledIntBetween( + radioButtonBorderEnabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonBorderEnabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonBorderEnabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonIconBorderDisabledIntEqualTo(int value) { + radioButtonIconBorderDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonIconBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonIconBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconBorderDisabledIntGreaterThan( + radioButtonIconBorderDisabledIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonIconBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonIconBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconBorderDisabledIntLessThan( - int value, { - bool include = false, - }) { + radioButtonIconBorderDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonIconBorderDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonIconBorderDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconBorderDisabledIntBetween( + radioButtonIconBorderDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonIconBorderDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonIconBorderDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonIconBorderIntEqualTo(int value) { + radioButtonIconBorderIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonIconBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonIconBorderInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconBorderIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonIconBorderIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonIconBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonIconBorderInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconBorderIntLessThan( - int value, { - bool include = false, - }) { + radioButtonIconBorderIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonIconBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonIconBorderInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconBorderIntBetween( + radioButtonIconBorderIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonIconBorderInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonIconBorderInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonIconCircleIntEqualTo(int value) { + radioButtonIconCircleIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonIconCircleInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonIconCircleInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconCircleIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonIconCircleIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonIconCircleInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonIconCircleInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconCircleIntLessThan( - int value, { - bool include = false, - }) { + radioButtonIconCircleIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonIconCircleInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonIconCircleInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconCircleIntBetween( + radioButtonIconCircleIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonIconCircleInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonIconCircleInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonIconEnabledIntEqualTo(int value) { + radioButtonIconEnabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonIconEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonIconEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconEnabledIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonIconEnabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonIconEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonIconEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconEnabledIntLessThan( - int value, { - bool include = false, - }) { + radioButtonIconEnabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonIconEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonIconEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonIconEnabledIntBetween( + radioButtonIconEnabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonIconEnabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonIconEnabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonLabelDisabledIntEqualTo(int value) { + radioButtonLabelDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonLabelDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonLabelDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonLabelDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonLabelDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonLabelDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonLabelDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonLabelDisabledIntLessThan( - int value, { - bool include = false, - }) { + radioButtonLabelDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonLabelDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonLabelDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonLabelDisabledIntBetween( + radioButtonLabelDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonLabelDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonLabelDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonLabelEnabledIntEqualTo(int value) { + radioButtonLabelEnabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonLabelEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonLabelEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonLabelEnabledIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonLabelEnabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonLabelEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonLabelEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonLabelEnabledIntLessThan( - int value, { - bool include = false, - }) { + radioButtonLabelEnabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonLabelEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonLabelEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonLabelEnabledIntBetween( + radioButtonLabelEnabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonLabelEnabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonLabelEnabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonTextDisabledIntEqualTo(int value) { + radioButtonTextDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonTextDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonTextDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonTextDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonTextDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonTextDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonTextDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonTextDisabledIntLessThan( - int value, { - bool include = false, - }) { + radioButtonTextDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonTextDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonTextDisabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonTextDisabledIntBetween( + radioButtonTextDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonTextDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonTextDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - radioButtonTextEnabledIntEqualTo(int value) { + radioButtonTextEnabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'radioButtonTextEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'radioButtonTextEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonTextEnabledIntGreaterThan( - int value, { - bool include = false, - }) { + radioButtonTextEnabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'radioButtonTextEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'radioButtonTextEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonTextEnabledIntLessThan( - int value, { - bool include = false, - }) { + radioButtonTextEnabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'radioButtonTextEnabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'radioButtonTextEnabledInt', + value: value, + ), + ); }); } QueryBuilder - radioButtonTextEnabledIntBetween( + radioButtonTextEnabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'radioButtonTextEnabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'radioButtonTextEnabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - rateTypeToggleColorOffIntEqualTo(int value) { + rateTypeToggleColorOffIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'rateTypeToggleColorOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'rateTypeToggleColorOffInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleColorOffIntGreaterThan( - int value, { - bool include = false, - }) { + rateTypeToggleColorOffIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'rateTypeToggleColorOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'rateTypeToggleColorOffInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleColorOffIntLessThan( - int value, { - bool include = false, - }) { + rateTypeToggleColorOffIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'rateTypeToggleColorOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'rateTypeToggleColorOffInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleColorOffIntBetween( + rateTypeToggleColorOffIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'rateTypeToggleColorOffInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'rateTypeToggleColorOffInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - rateTypeToggleColorOnIntEqualTo(int value) { + rateTypeToggleColorOnIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'rateTypeToggleColorOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'rateTypeToggleColorOnInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleColorOnIntGreaterThan( - int value, { - bool include = false, - }) { + rateTypeToggleColorOnIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'rateTypeToggleColorOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'rateTypeToggleColorOnInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleColorOnIntLessThan( - int value, { - bool include = false, - }) { + rateTypeToggleColorOnIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'rateTypeToggleColorOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'rateTypeToggleColorOnInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleColorOnIntBetween( + rateTypeToggleColorOnIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'rateTypeToggleColorOnInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'rateTypeToggleColorOnInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - rateTypeToggleDesktopColorOffIntEqualTo(int value) { + rateTypeToggleDesktopColorOffIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'rateTypeToggleDesktopColorOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'rateTypeToggleDesktopColorOffInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleDesktopColorOffIntGreaterThan( + rateTypeToggleDesktopColorOffIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'rateTypeToggleDesktopColorOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'rateTypeToggleDesktopColorOffInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleDesktopColorOffIntLessThan( - int value, { - bool include = false, - }) { + rateTypeToggleDesktopColorOffIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'rateTypeToggleDesktopColorOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'rateTypeToggleDesktopColorOffInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleDesktopColorOffIntBetween( + rateTypeToggleDesktopColorOffIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'rateTypeToggleDesktopColorOffInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'rateTypeToggleDesktopColorOffInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - rateTypeToggleDesktopColorOnIntEqualTo(int value) { + rateTypeToggleDesktopColorOnIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'rateTypeToggleDesktopColorOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'rateTypeToggleDesktopColorOnInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleDesktopColorOnIntGreaterThan( + rateTypeToggleDesktopColorOnIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'rateTypeToggleDesktopColorOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'rateTypeToggleDesktopColorOnInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleDesktopColorOnIntLessThan( - int value, { - bool include = false, - }) { + rateTypeToggleDesktopColorOnIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'rateTypeToggleDesktopColorOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'rateTypeToggleDesktopColorOnInt', + value: value, + ), + ); }); } QueryBuilder - rateTypeToggleDesktopColorOnIntBetween( + rateTypeToggleDesktopColorOnIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'rateTypeToggleDesktopColorOnInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'rateTypeToggleDesktopColorOnInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - settingsIconBack2IntEqualTo(int value) { + settingsIconBack2IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'settingsIconBack2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'settingsIconBack2Int', + value: value, + ), + ); }); } QueryBuilder - settingsIconBack2IntGreaterThan( - int value, { - bool include = false, - }) { + settingsIconBack2IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'settingsIconBack2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'settingsIconBack2Int', + value: value, + ), + ); }); } QueryBuilder - settingsIconBack2IntLessThan( - int value, { - bool include = false, - }) { + settingsIconBack2IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'settingsIconBack2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'settingsIconBack2Int', + value: value, + ), + ); }); } QueryBuilder - settingsIconBack2IntBetween( + settingsIconBack2IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'settingsIconBack2Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'settingsIconBack2Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - settingsIconBackIntEqualTo(int value) { + settingsIconBackIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'settingsIconBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'settingsIconBackInt', value: value), + ); }); } QueryBuilder - settingsIconBackIntGreaterThan( - int value, { - bool include = false, - }) { + settingsIconBackIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'settingsIconBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'settingsIconBackInt', + value: value, + ), + ); }); } QueryBuilder - settingsIconBackIntLessThan( - int value, { - bool include = false, - }) { + settingsIconBackIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'settingsIconBackInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'settingsIconBackInt', + value: value, + ), + ); }); } QueryBuilder - settingsIconBackIntBetween( + settingsIconBackIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'settingsIconBackInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'settingsIconBackInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - settingsIconElementIntEqualTo(int value) { + settingsIconElementIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'settingsIconElementInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'settingsIconElementInt', + value: value, + ), + ); }); } QueryBuilder - settingsIconElementIntGreaterThan( - int value, { - bool include = false, - }) { + settingsIconElementIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'settingsIconElementInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'settingsIconElementInt', + value: value, + ), + ); }); } QueryBuilder - settingsIconElementIntLessThan( - int value, { - bool include = false, - }) { + settingsIconElementIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'settingsIconElementInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'settingsIconElementInt', + value: value, + ), + ); }); } QueryBuilder - settingsIconElementIntBetween( + settingsIconElementIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'settingsIconElementInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'settingsIconElementInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - settingsIconIconIntEqualTo(int value) { + settingsIconIconIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'settingsIconIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'settingsIconIconInt', value: value), + ); }); } QueryBuilder - settingsIconIconIntGreaterThan( - int value, { - bool include = false, - }) { + settingsIconIconIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'settingsIconIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'settingsIconIconInt', + value: value, + ), + ); }); } QueryBuilder - settingsIconIconIntLessThan( - int value, { - bool include = false, - }) { + settingsIconIconIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'settingsIconIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'settingsIconIconInt', + value: value, + ), + ); }); } QueryBuilder - settingsIconIconIntBetween( + settingsIconIconIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'settingsIconIconInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'settingsIconIconInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - settingsItem2ActiveBGIntEqualTo(int value) { + settingsItem2ActiveBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'settingsItem2ActiveBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'settingsItem2ActiveBGInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveBGIntGreaterThan( - int value, { - bool include = false, - }) { + settingsItem2ActiveBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'settingsItem2ActiveBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'settingsItem2ActiveBGInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveBGIntLessThan( - int value, { - bool include = false, - }) { + settingsItem2ActiveBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'settingsItem2ActiveBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'settingsItem2ActiveBGInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveBGIntBetween( + settingsItem2ActiveBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'settingsItem2ActiveBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'settingsItem2ActiveBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - settingsItem2ActiveSubIntEqualTo(int value) { + settingsItem2ActiveSubIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'settingsItem2ActiveSubInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'settingsItem2ActiveSubInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveSubIntGreaterThan( - int value, { - bool include = false, - }) { + settingsItem2ActiveSubIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'settingsItem2ActiveSubInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'settingsItem2ActiveSubInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveSubIntLessThan( - int value, { - bool include = false, - }) { + settingsItem2ActiveSubIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'settingsItem2ActiveSubInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'settingsItem2ActiveSubInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveSubIntBetween( + settingsItem2ActiveSubIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'settingsItem2ActiveSubInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'settingsItem2ActiveSubInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - settingsItem2ActiveTextIntEqualTo(int value) { + settingsItem2ActiveTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'settingsItem2ActiveTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'settingsItem2ActiveTextInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveTextIntGreaterThan( - int value, { - bool include = false, - }) { + settingsItem2ActiveTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'settingsItem2ActiveTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'settingsItem2ActiveTextInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveTextIntLessThan( - int value, { - bool include = false, - }) { + settingsItem2ActiveTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'settingsItem2ActiveTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'settingsItem2ActiveTextInt', + value: value, + ), + ); }); } QueryBuilder - settingsItem2ActiveTextIntBetween( + settingsItem2ActiveTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'settingsItem2ActiveTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'settingsItem2ActiveTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder shadowIntEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'shadowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'shadowInt', value: value), + ); }); } QueryBuilder - shadowIntGreaterThan( - int value, { - bool include = false, - }) { + shadowIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'shadowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'shadowInt', + value: value, + ), + ); }); } @@ -7075,11 +7288,13 @@ extension StackThemeQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'shadowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'shadowInt', + value: value, + ), + ); }); } @@ -7090,373 +7305,380 @@ extension StackThemeQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'shadowInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'shadowInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - snackBarBackErrorIntEqualTo(int value) { + snackBarBackErrorIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'snackBarBackErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'snackBarBackErrorInt', + value: value, + ), + ); }); } QueryBuilder - snackBarBackErrorIntGreaterThan( - int value, { - bool include = false, - }) { + snackBarBackErrorIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'snackBarBackErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'snackBarBackErrorInt', + value: value, + ), + ); }); } QueryBuilder - snackBarBackErrorIntLessThan( - int value, { - bool include = false, - }) { + snackBarBackErrorIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'snackBarBackErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'snackBarBackErrorInt', + value: value, + ), + ); }); } QueryBuilder - snackBarBackErrorIntBetween( + snackBarBackErrorIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'snackBarBackErrorInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'snackBarBackErrorInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - snackBarBackInfoIntEqualTo(int value) { + snackBarBackInfoIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'snackBarBackInfoInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'snackBarBackInfoInt', value: value), + ); }); } QueryBuilder - snackBarBackInfoIntGreaterThan( - int value, { - bool include = false, - }) { + snackBarBackInfoIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'snackBarBackInfoInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'snackBarBackInfoInt', + value: value, + ), + ); }); } QueryBuilder - snackBarBackInfoIntLessThan( - int value, { - bool include = false, - }) { + snackBarBackInfoIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'snackBarBackInfoInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'snackBarBackInfoInt', + value: value, + ), + ); }); } QueryBuilder - snackBarBackInfoIntBetween( + snackBarBackInfoIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'snackBarBackInfoInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'snackBarBackInfoInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - snackBarBackSuccessIntEqualTo(int value) { + snackBarBackSuccessIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'snackBarBackSuccessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'snackBarBackSuccessInt', + value: value, + ), + ); }); } QueryBuilder - snackBarBackSuccessIntGreaterThan( - int value, { - bool include = false, - }) { + snackBarBackSuccessIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'snackBarBackSuccessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'snackBarBackSuccessInt', + value: value, + ), + ); }); } QueryBuilder - snackBarBackSuccessIntLessThan( - int value, { - bool include = false, - }) { + snackBarBackSuccessIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'snackBarBackSuccessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'snackBarBackSuccessInt', + value: value, + ), + ); }); } QueryBuilder - snackBarBackSuccessIntBetween( + snackBarBackSuccessIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'snackBarBackSuccessInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'snackBarBackSuccessInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - snackBarTextErrorIntEqualTo(int value) { + snackBarTextErrorIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'snackBarTextErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'snackBarTextErrorInt', + value: value, + ), + ); }); } QueryBuilder - snackBarTextErrorIntGreaterThan( - int value, { - bool include = false, - }) { + snackBarTextErrorIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'snackBarTextErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'snackBarTextErrorInt', + value: value, + ), + ); }); } QueryBuilder - snackBarTextErrorIntLessThan( - int value, { - bool include = false, - }) { + snackBarTextErrorIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'snackBarTextErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'snackBarTextErrorInt', + value: value, + ), + ); }); } QueryBuilder - snackBarTextErrorIntBetween( + snackBarTextErrorIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'snackBarTextErrorInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'snackBarTextErrorInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - snackBarTextInfoIntEqualTo(int value) { + snackBarTextInfoIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'snackBarTextInfoInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'snackBarTextInfoInt', value: value), + ); }); } QueryBuilder - snackBarTextInfoIntGreaterThan( - int value, { - bool include = false, - }) { + snackBarTextInfoIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'snackBarTextInfoInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'snackBarTextInfoInt', + value: value, + ), + ); }); } QueryBuilder - snackBarTextInfoIntLessThan( - int value, { - bool include = false, - }) { + snackBarTextInfoIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'snackBarTextInfoInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'snackBarTextInfoInt', + value: value, + ), + ); }); } QueryBuilder - snackBarTextInfoIntBetween( + snackBarTextInfoIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'snackBarTextInfoInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'snackBarTextInfoInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - snackBarTextSuccessIntEqualTo(int value) { + snackBarTextSuccessIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'snackBarTextSuccessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'snackBarTextSuccessInt', + value: value, + ), + ); }); } QueryBuilder - snackBarTextSuccessIntGreaterThan( - int value, { - bool include = false, - }) { + snackBarTextSuccessIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'snackBarTextSuccessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'snackBarTextSuccessInt', + value: value, + ), + ); }); } QueryBuilder - snackBarTextSuccessIntLessThan( - int value, { - bool include = false, - }) { + snackBarTextSuccessIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'snackBarTextSuccessInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'snackBarTextSuccessInt', + value: value, + ), + ); }); } QueryBuilder - snackBarTextSuccessIntBetween( + snackBarTextSuccessIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'snackBarTextSuccessInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'snackBarTextSuccessInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder splashIntEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'splashInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'splashInt', value: value), + ); }); } QueryBuilder - splashIntGreaterThan( - int value, { - bool include = false, - }) { + splashIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'splashInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'splashInt', + value: value, + ), + ); }); } @@ -7465,11 +7687,13 @@ extension StackThemeQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'splashInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'splashInt', + value: value, + ), + ); }); } @@ -7480,232 +7704,237 @@ extension StackThemeQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'splashInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'splashInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stackWalletBGIntEqualTo(int value) { + stackWalletBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stackWalletBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'stackWalletBGInt', value: value), + ); }); } QueryBuilder - stackWalletBGIntGreaterThan( - int value, { - bool include = false, - }) { + stackWalletBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stackWalletBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stackWalletBGInt', + value: value, + ), + ); }); } QueryBuilder - stackWalletBGIntLessThan( - int value, { - bool include = false, - }) { + stackWalletBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stackWalletBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stackWalletBGInt', + value: value, + ), + ); }); } QueryBuilder - stackWalletBGIntBetween( + stackWalletBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stackWalletBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stackWalletBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stackWalletBottomIntEqualTo(int value) { + stackWalletBottomIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stackWalletBottomInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stackWalletBottomInt', + value: value, + ), + ); }); } QueryBuilder - stackWalletBottomIntGreaterThan( - int value, { - bool include = false, - }) { + stackWalletBottomIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stackWalletBottomInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stackWalletBottomInt', + value: value, + ), + ); }); } QueryBuilder - stackWalletBottomIntLessThan( - int value, { - bool include = false, - }) { + stackWalletBottomIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stackWalletBottomInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stackWalletBottomInt', + value: value, + ), + ); }); } QueryBuilder - stackWalletBottomIntBetween( + stackWalletBottomIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stackWalletBottomInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stackWalletBottomInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stackWalletMidIntEqualTo(int value) { + stackWalletMidIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stackWalletMidInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'stackWalletMidInt', value: value), + ); }); } QueryBuilder - stackWalletMidIntGreaterThan( - int value, { - bool include = false, - }) { + stackWalletMidIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stackWalletMidInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stackWalletMidInt', + value: value, + ), + ); }); } QueryBuilder - stackWalletMidIntLessThan( - int value, { - bool include = false, - }) { + stackWalletMidIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stackWalletMidInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stackWalletMidInt', + value: value, + ), + ); }); } QueryBuilder - stackWalletMidIntBetween( + stackWalletMidIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stackWalletMidInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stackWalletMidInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - standardBoxShadowStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + standardBoxShadowStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'standardBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'standardBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - standardBoxShadowStringGreaterThan( + standardBoxShadowStringGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'standardBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'standardBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - standardBoxShadowStringLessThan( + standardBoxShadowStringLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'standardBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'standardBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - standardBoxShadowStringBetween( + standardBoxShadowStringBetween( String lower, String upper, { bool includeLower = true, @@ -7713,2886 +7942,2968 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'standardBoxShadowString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'standardBoxShadowString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - standardBoxShadowStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + standardBoxShadowStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'standardBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'standardBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - standardBoxShadowStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + standardBoxShadowStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'standardBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'standardBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - standardBoxShadowStringContains(String value, - {bool caseSensitive = true}) { + standardBoxShadowStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'standardBoxShadowString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'standardBoxShadowString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - standardBoxShadowStringMatches(String pattern, - {bool caseSensitive = true}) { + standardBoxShadowStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'standardBoxShadowString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'standardBoxShadowString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - standardBoxShadowStringIsEmpty() { + standardBoxShadowStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'standardBoxShadowString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'standardBoxShadowString', + value: '', + ), + ); }); } QueryBuilder - standardBoxShadowStringIsNotEmpty() { + standardBoxShadowStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'standardBoxShadowString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'standardBoxShadowString', + value: '', + ), + ); }); } QueryBuilder - stepIndicatorBGCheckIntEqualTo(int value) { + stepIndicatorBGCheckIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stepIndicatorBGCheckInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stepIndicatorBGCheckInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGCheckIntGreaterThan( - int value, { - bool include = false, - }) { + stepIndicatorBGCheckIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stepIndicatorBGCheckInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stepIndicatorBGCheckInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGCheckIntLessThan( - int value, { - bool include = false, - }) { + stepIndicatorBGCheckIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stepIndicatorBGCheckInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stepIndicatorBGCheckInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGCheckIntBetween( + stepIndicatorBGCheckIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stepIndicatorBGCheckInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stepIndicatorBGCheckInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stepIndicatorBGInactiveIntEqualTo(int value) { + stepIndicatorBGInactiveIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stepIndicatorBGInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stepIndicatorBGInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGInactiveIntGreaterThan( - int value, { - bool include = false, - }) { + stepIndicatorBGInactiveIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stepIndicatorBGInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stepIndicatorBGInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGInactiveIntLessThan( - int value, { - bool include = false, - }) { + stepIndicatorBGInactiveIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stepIndicatorBGInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stepIndicatorBGInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGInactiveIntBetween( + stepIndicatorBGInactiveIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stepIndicatorBGInactiveInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stepIndicatorBGInactiveInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stepIndicatorBGLinesInactiveIntEqualTo(int value) { + stepIndicatorBGLinesInactiveIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stepIndicatorBGLinesInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stepIndicatorBGLinesInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGLinesInactiveIntGreaterThan( + stepIndicatorBGLinesInactiveIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stepIndicatorBGLinesInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stepIndicatorBGLinesInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGLinesInactiveIntLessThan( - int value, { - bool include = false, - }) { + stepIndicatorBGLinesInactiveIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stepIndicatorBGLinesInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stepIndicatorBGLinesInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGLinesInactiveIntBetween( + stepIndicatorBGLinesInactiveIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stepIndicatorBGLinesInactiveInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stepIndicatorBGLinesInactiveInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stepIndicatorBGLinesIntEqualTo(int value) { + stepIndicatorBGLinesIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stepIndicatorBGLinesInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stepIndicatorBGLinesInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGLinesIntGreaterThan( - int value, { - bool include = false, - }) { + stepIndicatorBGLinesIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stepIndicatorBGLinesInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stepIndicatorBGLinesInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGLinesIntLessThan( - int value, { - bool include = false, - }) { + stepIndicatorBGLinesIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stepIndicatorBGLinesInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stepIndicatorBGLinesInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGLinesIntBetween( + stepIndicatorBGLinesIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stepIndicatorBGLinesInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stepIndicatorBGLinesInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stepIndicatorBGNumberIntEqualTo(int value) { + stepIndicatorBGNumberIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stepIndicatorBGNumberInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stepIndicatorBGNumberInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGNumberIntGreaterThan( - int value, { - bool include = false, - }) { + stepIndicatorBGNumberIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stepIndicatorBGNumberInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stepIndicatorBGNumberInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGNumberIntLessThan( - int value, { - bool include = false, - }) { + stepIndicatorBGNumberIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stepIndicatorBGNumberInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stepIndicatorBGNumberInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorBGNumberIntBetween( + stepIndicatorBGNumberIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stepIndicatorBGNumberInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stepIndicatorBGNumberInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stepIndicatorIconInactiveIntEqualTo(int value) { + stepIndicatorIconInactiveIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stepIndicatorIconInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stepIndicatorIconInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconInactiveIntGreaterThan( - int value, { - bool include = false, - }) { + stepIndicatorIconInactiveIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stepIndicatorIconInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stepIndicatorIconInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconInactiveIntLessThan( - int value, { - bool include = false, - }) { + stepIndicatorIconInactiveIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stepIndicatorIconInactiveInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stepIndicatorIconInactiveInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconInactiveIntBetween( + stepIndicatorIconInactiveIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stepIndicatorIconInactiveInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stepIndicatorIconInactiveInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stepIndicatorIconNumberIntEqualTo(int value) { + stepIndicatorIconNumberIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stepIndicatorIconNumberInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stepIndicatorIconNumberInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconNumberIntGreaterThan( - int value, { - bool include = false, - }) { + stepIndicatorIconNumberIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stepIndicatorIconNumberInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stepIndicatorIconNumberInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconNumberIntLessThan( - int value, { - bool include = false, - }) { + stepIndicatorIconNumberIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stepIndicatorIconNumberInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stepIndicatorIconNumberInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconNumberIntBetween( + stepIndicatorIconNumberIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stepIndicatorIconNumberInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stepIndicatorIconNumberInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - stepIndicatorIconTextIntEqualTo(int value) { + stepIndicatorIconTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stepIndicatorIconTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stepIndicatorIconTextInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconTextIntGreaterThan( - int value, { - bool include = false, - }) { + stepIndicatorIconTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'stepIndicatorIconTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stepIndicatorIconTextInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconTextIntLessThan( - int value, { - bool include = false, - }) { + stepIndicatorIconTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stepIndicatorIconTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stepIndicatorIconTextInt', + value: value, + ), + ); }); } QueryBuilder - stepIndicatorIconTextIntBetween( + stepIndicatorIconTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'stepIndicatorIconTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stepIndicatorIconTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - switchBGDisabledIntEqualTo(int value) { + switchBGDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'switchBGDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'switchBGDisabledInt', value: value), + ); }); } QueryBuilder - switchBGDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + switchBGDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'switchBGDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'switchBGDisabledInt', + value: value, + ), + ); }); } QueryBuilder - switchBGDisabledIntLessThan( - int value, { - bool include = false, - }) { + switchBGDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'switchBGDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'switchBGDisabledInt', + value: value, + ), + ); }); } QueryBuilder - switchBGDisabledIntBetween( + switchBGDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'switchBGDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'switchBGDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - switchBGOffIntEqualTo(int value) { + switchBGOffIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'switchBGOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'switchBGOffInt', value: value), + ); }); } QueryBuilder - switchBGOffIntGreaterThan( - int value, { - bool include = false, - }) { + switchBGOffIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'switchBGOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'switchBGOffInt', + value: value, + ), + ); }); } QueryBuilder - switchBGOffIntLessThan( - int value, { - bool include = false, - }) { + switchBGOffIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'switchBGOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'switchBGOffInt', + value: value, + ), + ); }); } QueryBuilder - switchBGOffIntBetween( + switchBGOffIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'switchBGOffInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'switchBGOffInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - switchBGOnIntEqualTo(int value) { + switchBGOnIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'switchBGOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'switchBGOnInt', value: value), + ); }); } QueryBuilder - switchBGOnIntGreaterThan( - int value, { - bool include = false, - }) { + switchBGOnIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'switchBGOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'switchBGOnInt', + value: value, + ), + ); }); } QueryBuilder - switchBGOnIntLessThan( - int value, { - bool include = false, - }) { + switchBGOnIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'switchBGOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'switchBGOnInt', + value: value, + ), + ); }); } QueryBuilder - switchBGOnIntBetween( + switchBGOnIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'switchBGOnInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'switchBGOnInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - switchCircleDisabledIntEqualTo(int value) { + switchCircleDisabledIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'switchCircleDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'switchCircleDisabledInt', + value: value, + ), + ); }); } QueryBuilder - switchCircleDisabledIntGreaterThan( - int value, { - bool include = false, - }) { + switchCircleDisabledIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'switchCircleDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'switchCircleDisabledInt', + value: value, + ), + ); }); } QueryBuilder - switchCircleDisabledIntLessThan( - int value, { - bool include = false, - }) { + switchCircleDisabledIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'switchCircleDisabledInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'switchCircleDisabledInt', + value: value, + ), + ); }); } QueryBuilder - switchCircleDisabledIntBetween( + switchCircleDisabledIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'switchCircleDisabledInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'switchCircleDisabledInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - switchCircleOffIntEqualTo(int value) { + switchCircleOffIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'switchCircleOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'switchCircleOffInt', value: value), + ); }); } QueryBuilder - switchCircleOffIntGreaterThan( - int value, { - bool include = false, - }) { + switchCircleOffIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'switchCircleOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'switchCircleOffInt', + value: value, + ), + ); }); } QueryBuilder - switchCircleOffIntLessThan( - int value, { - bool include = false, - }) { + switchCircleOffIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'switchCircleOffInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'switchCircleOffInt', + value: value, + ), + ); }); } QueryBuilder - switchCircleOffIntBetween( + switchCircleOffIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'switchCircleOffInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'switchCircleOffInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - switchCircleOnIntEqualTo(int value) { + switchCircleOnIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'switchCircleOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'switchCircleOnInt', value: value), + ); }); } QueryBuilder - switchCircleOnIntGreaterThan( - int value, { - bool include = false, - }) { + switchCircleOnIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'switchCircleOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'switchCircleOnInt', + value: value, + ), + ); }); } QueryBuilder - switchCircleOnIntLessThan( - int value, { - bool include = false, - }) { + switchCircleOnIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'switchCircleOnInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'switchCircleOnInt', + value: value, + ), + ); }); } QueryBuilder - switchCircleOnIntBetween( + switchCircleOnIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'switchCircleOnInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'switchCircleOnInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textConfirmTotalAmountIntEqualTo(int value) { + textConfirmTotalAmountIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textConfirmTotalAmountInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textConfirmTotalAmountInt', + value: value, + ), + ); }); } QueryBuilder - textConfirmTotalAmountIntGreaterThan( - int value, { - bool include = false, - }) { + textConfirmTotalAmountIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textConfirmTotalAmountInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textConfirmTotalAmountInt', + value: value, + ), + ); }); } QueryBuilder - textConfirmTotalAmountIntLessThan( - int value, { - bool include = false, - }) { + textConfirmTotalAmountIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textConfirmTotalAmountInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textConfirmTotalAmountInt', + value: value, + ), + ); }); } QueryBuilder - textConfirmTotalAmountIntBetween( + textConfirmTotalAmountIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textConfirmTotalAmountInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textConfirmTotalAmountInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textDark2IntEqualTo(int value) { + textDark2IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textDark2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textDark2Int', value: value), + ); }); } QueryBuilder - textDark2IntGreaterThan( - int value, { - bool include = false, - }) { + textDark2IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textDark2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textDark2Int', + value: value, + ), + ); }); } QueryBuilder - textDark2IntLessThan( - int value, { - bool include = false, - }) { + textDark2IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textDark2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textDark2Int', + value: value, + ), + ); }); } QueryBuilder - textDark2IntBetween( + textDark2IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textDark2Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textDark2Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textDark3IntEqualTo(int value) { + textDark3IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textDark3Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textDark3Int', value: value), + ); }); } QueryBuilder - textDark3IntGreaterThan( - int value, { - bool include = false, - }) { + textDark3IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textDark3Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textDark3Int', + value: value, + ), + ); }); } QueryBuilder - textDark3IntLessThan( - int value, { - bool include = false, - }) { + textDark3IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textDark3Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textDark3Int', + value: value, + ), + ); }); } QueryBuilder - textDark3IntBetween( + textDark3IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textDark3Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textDark3Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textDarkIntEqualTo(int value) { + textDarkIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textDarkInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textDarkInt', value: value), + ); }); } QueryBuilder - textDarkIntGreaterThan( - int value, { - bool include = false, - }) { + textDarkIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textDarkInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textDarkInt', + value: value, + ), + ); }); } QueryBuilder - textDarkIntLessThan( - int value, { - bool include = false, - }) { + textDarkIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textDarkInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textDarkInt', + value: value, + ), + ); }); } QueryBuilder - textDarkIntBetween( + textDarkIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textDarkInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textDarkInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textErrorIntEqualTo(int value) { + textErrorIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textErrorInt', value: value), + ); }); } QueryBuilder - textErrorIntGreaterThan( - int value, { - bool include = false, - }) { + textErrorIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textErrorInt', + value: value, + ), + ); }); } QueryBuilder - textErrorIntLessThan( - int value, { - bool include = false, - }) { + textErrorIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textErrorInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textErrorInt', + value: value, + ), + ); }); } QueryBuilder - textErrorIntBetween( + textErrorIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textErrorInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textErrorInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFavoriteCardIntEqualTo(int value) { + textFavoriteCardIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFavoriteCardInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textFavoriteCardInt', value: value), + ); }); } QueryBuilder - textFavoriteCardIntGreaterThan( - int value, { - bool include = false, - }) { + textFavoriteCardIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFavoriteCardInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFavoriteCardInt', + value: value, + ), + ); }); } QueryBuilder - textFavoriteCardIntLessThan( - int value, { - bool include = false, - }) { + textFavoriteCardIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFavoriteCardInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFavoriteCardInt', + value: value, + ), + ); }); } QueryBuilder - textFavoriteCardIntBetween( + textFavoriteCardIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFavoriteCardInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFavoriteCardInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldActiveBGIntEqualTo(int value) { + textFieldActiveBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldActiveBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldActiveBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveBGIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldActiveBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldActiveBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldActiveBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveBGIntLessThan( - int value, { - bool include = false, - }) { + textFieldActiveBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldActiveBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldActiveBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveBGIntBetween( + textFieldActiveBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldActiveBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldActiveBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldActiveLabelIntEqualTo(int value) { + textFieldActiveLabelIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldActiveLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldActiveLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveLabelIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldActiveLabelIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldActiveLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldActiveLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveLabelIntLessThan( - int value, { - bool include = false, - }) { + textFieldActiveLabelIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldActiveLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldActiveLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveLabelIntBetween( + textFieldActiveLabelIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldActiveLabelInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldActiveLabelInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldActiveSearchIconLeftIntEqualTo(int value) { + textFieldActiveSearchIconLeftIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldActiveSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldActiveSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveSearchIconLeftIntGreaterThan( + textFieldActiveSearchIconLeftIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldActiveSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldActiveSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveSearchIconLeftIntLessThan( - int value, { - bool include = false, - }) { + textFieldActiveSearchIconLeftIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldActiveSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldActiveSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveSearchIconLeftIntBetween( + textFieldActiveSearchIconLeftIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldActiveSearchIconLeftInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldActiveSearchIconLeftInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldActiveSearchIconRightIntEqualTo(int value) { + textFieldActiveSearchIconRightIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldActiveSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldActiveSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveSearchIconRightIntGreaterThan( + textFieldActiveSearchIconRightIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldActiveSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldActiveSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveSearchIconRightIntLessThan( - int value, { - bool include = false, - }) { + textFieldActiveSearchIconRightIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldActiveSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldActiveSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveSearchIconRightIntBetween( + textFieldActiveSearchIconRightIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldActiveSearchIconRightInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldActiveSearchIconRightInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldActiveTextIntEqualTo(int value) { + textFieldActiveTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldActiveTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldActiveTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveTextIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldActiveTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldActiveTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldActiveTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveTextIntLessThan( - int value, { - bool include = false, - }) { + textFieldActiveTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldActiveTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldActiveTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldActiveTextIntBetween( + textFieldActiveTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldActiveTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldActiveTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldDefaultBGIntEqualTo(int value) { + textFieldDefaultBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldDefaultBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldDefaultBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultBGIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldDefaultBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldDefaultBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldDefaultBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultBGIntLessThan( - int value, { - bool include = false, - }) { + textFieldDefaultBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldDefaultBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldDefaultBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultBGIntBetween( + textFieldDefaultBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldDefaultBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldDefaultBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldDefaultSearchIconLeftIntEqualTo(int value) { + textFieldDefaultSearchIconLeftIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldDefaultSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldDefaultSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultSearchIconLeftIntGreaterThan( + textFieldDefaultSearchIconLeftIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldDefaultSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldDefaultSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultSearchIconLeftIntLessThan( - int value, { - bool include = false, - }) { + textFieldDefaultSearchIconLeftIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldDefaultSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldDefaultSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultSearchIconLeftIntBetween( + textFieldDefaultSearchIconLeftIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldDefaultSearchIconLeftInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldDefaultSearchIconLeftInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldDefaultSearchIconRightIntEqualTo(int value) { + textFieldDefaultSearchIconRightIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldDefaultSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldDefaultSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultSearchIconRightIntGreaterThan( + textFieldDefaultSearchIconRightIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldDefaultSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldDefaultSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultSearchIconRightIntLessThan( + textFieldDefaultSearchIconRightIntLessThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldDefaultSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldDefaultSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultSearchIconRightIntBetween( + textFieldDefaultSearchIconRightIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldDefaultSearchIconRightInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldDefaultSearchIconRightInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldDefaultTextIntEqualTo(int value) { + textFieldDefaultTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldDefaultTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldDefaultTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultTextIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldDefaultTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldDefaultTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldDefaultTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultTextIntLessThan( - int value, { - bool include = false, - }) { + textFieldDefaultTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldDefaultTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldDefaultTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldDefaultTextIntBetween( + textFieldDefaultTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldDefaultTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldDefaultTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldErrorBGIntEqualTo(int value) { + textFieldErrorBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldErrorBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textFieldErrorBGInt', value: value), + ); }); } QueryBuilder - textFieldErrorBGIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldErrorBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldErrorBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldErrorBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorBGIntLessThan( - int value, { - bool include = false, - }) { + textFieldErrorBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldErrorBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldErrorBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorBGIntBetween( + textFieldErrorBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldErrorBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldErrorBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldErrorBorderIntEqualTo(int value) { + textFieldErrorBorderIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldErrorBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldErrorBorderInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorBorderIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldErrorBorderIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldErrorBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldErrorBorderInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorBorderIntLessThan( - int value, { - bool include = false, - }) { + textFieldErrorBorderIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldErrorBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldErrorBorderInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorBorderIntBetween( + textFieldErrorBorderIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldErrorBorderInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldErrorBorderInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldErrorLabelIntEqualTo(int value) { + textFieldErrorLabelIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldErrorLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldErrorLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorLabelIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldErrorLabelIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldErrorLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldErrorLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorLabelIntLessThan( - int value, { - bool include = false, - }) { + textFieldErrorLabelIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldErrorLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldErrorLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorLabelIntBetween( + textFieldErrorLabelIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldErrorLabelInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldErrorLabelInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldErrorSearchIconLeftIntEqualTo(int value) { + textFieldErrorSearchIconLeftIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldErrorSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldErrorSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorSearchIconLeftIntGreaterThan( + textFieldErrorSearchIconLeftIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldErrorSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldErrorSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorSearchIconLeftIntLessThan( - int value, { - bool include = false, - }) { + textFieldErrorSearchIconLeftIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldErrorSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldErrorSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorSearchIconLeftIntBetween( + textFieldErrorSearchIconLeftIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldErrorSearchIconLeftInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldErrorSearchIconLeftInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldErrorSearchIconRightIntEqualTo(int value) { + textFieldErrorSearchIconRightIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldErrorSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldErrorSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorSearchIconRightIntGreaterThan( + textFieldErrorSearchIconRightIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldErrorSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldErrorSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorSearchIconRightIntLessThan( - int value, { - bool include = false, - }) { + textFieldErrorSearchIconRightIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldErrorSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldErrorSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorSearchIconRightIntBetween( + textFieldErrorSearchIconRightIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldErrorSearchIconRightInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldErrorSearchIconRightInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldErrorTextIntEqualTo(int value) { + textFieldErrorTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldErrorTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldErrorTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorTextIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldErrorTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldErrorTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldErrorTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorTextIntLessThan( - int value, { - bool include = false, - }) { + textFieldErrorTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldErrorTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldErrorTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldErrorTextIntBetween( + textFieldErrorTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldErrorTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldErrorTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldSuccessBGIntEqualTo(int value) { + textFieldSuccessBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldSuccessBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldSuccessBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessBGIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldSuccessBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldSuccessBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldSuccessBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessBGIntLessThan( - int value, { - bool include = false, - }) { + textFieldSuccessBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldSuccessBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldSuccessBGInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessBGIntBetween( + textFieldSuccessBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldSuccessBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldSuccessBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldSuccessBorderIntEqualTo(int value) { + textFieldSuccessBorderIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldSuccessBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldSuccessBorderInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessBorderIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldSuccessBorderIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldSuccessBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldSuccessBorderInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessBorderIntLessThan( - int value, { - bool include = false, - }) { + textFieldSuccessBorderIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldSuccessBorderInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldSuccessBorderInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessBorderIntBetween( + textFieldSuccessBorderIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldSuccessBorderInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldSuccessBorderInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldSuccessLabelIntEqualTo(int value) { + textFieldSuccessLabelIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldSuccessLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldSuccessLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessLabelIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldSuccessLabelIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldSuccessLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldSuccessLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessLabelIntLessThan( - int value, { - bool include = false, - }) { + textFieldSuccessLabelIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldSuccessLabelInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldSuccessLabelInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessLabelIntBetween( + textFieldSuccessLabelIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldSuccessLabelInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldSuccessLabelInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldSuccessSearchIconLeftIntEqualTo(int value) { + textFieldSuccessSearchIconLeftIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldSuccessSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldSuccessSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessSearchIconLeftIntGreaterThan( + textFieldSuccessSearchIconLeftIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldSuccessSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldSuccessSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessSearchIconLeftIntLessThan( - int value, { - bool include = false, - }) { + textFieldSuccessSearchIconLeftIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldSuccessSearchIconLeftInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldSuccessSearchIconLeftInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessSearchIconLeftIntBetween( + textFieldSuccessSearchIconLeftIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldSuccessSearchIconLeftInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldSuccessSearchIconLeftInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldSuccessSearchIconRightIntEqualTo(int value) { + textFieldSuccessSearchIconRightIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldSuccessSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldSuccessSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessSearchIconRightIntGreaterThan( + textFieldSuccessSearchIconRightIntGreaterThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldSuccessSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldSuccessSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessSearchIconRightIntLessThan( + textFieldSuccessSearchIconRightIntLessThan( int value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldSuccessSearchIconRightInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldSuccessSearchIconRightInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessSearchIconRightIntBetween( + textFieldSuccessSearchIconRightIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldSuccessSearchIconRightInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldSuccessSearchIconRightInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textFieldSuccessTextIntEqualTo(int value) { + textFieldSuccessTextIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textFieldSuccessTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textFieldSuccessTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessTextIntGreaterThan( - int value, { - bool include = false, - }) { + textFieldSuccessTextIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textFieldSuccessTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textFieldSuccessTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessTextIntLessThan( - int value, { - bool include = false, - }) { + textFieldSuccessTextIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textFieldSuccessTextInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textFieldSuccessTextInt', + value: value, + ), + ); }); } QueryBuilder - textFieldSuccessTextIntBetween( + textFieldSuccessTextIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textFieldSuccessTextInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textFieldSuccessTextInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textRestoreIntEqualTo(int value) { + textRestoreIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textRestoreInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textRestoreInt', value: value), + ); }); } QueryBuilder - textRestoreIntGreaterThan( - int value, { - bool include = false, - }) { + textRestoreIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textRestoreInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textRestoreInt', + value: value, + ), + ); }); } QueryBuilder - textRestoreIntLessThan( - int value, { - bool include = false, - }) { + textRestoreIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textRestoreInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textRestoreInt', + value: value, + ), + ); }); } QueryBuilder - textRestoreIntBetween( + textRestoreIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textRestoreInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textRestoreInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textSelectedWordTableItemIntEqualTo(int value) { + textSelectedWordTableItemIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textSelectedWordTableItemInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'textSelectedWordTableItemInt', + value: value, + ), + ); }); } QueryBuilder - textSelectedWordTableItemIntGreaterThan( - int value, { - bool include = false, - }) { + textSelectedWordTableItemIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textSelectedWordTableItemInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textSelectedWordTableItemInt', + value: value, + ), + ); }); } QueryBuilder - textSelectedWordTableItemIntLessThan( - int value, { - bool include = false, - }) { + textSelectedWordTableItemIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textSelectedWordTableItemInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textSelectedWordTableItemInt', + value: value, + ), + ); }); } QueryBuilder - textSelectedWordTableItemIntBetween( + textSelectedWordTableItemIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textSelectedWordTableItemInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textSelectedWordTableItemInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textSubtitle1IntEqualTo(int value) { + textSubtitle1IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textSubtitle1Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textSubtitle1Int', value: value), + ); }); } QueryBuilder - textSubtitle1IntGreaterThan( - int value, { - bool include = false, - }) { + textSubtitle1IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textSubtitle1Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textSubtitle1Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle1IntLessThan( - int value, { - bool include = false, - }) { + textSubtitle1IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textSubtitle1Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textSubtitle1Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle1IntBetween( + textSubtitle1IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textSubtitle1Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textSubtitle1Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textSubtitle2IntEqualTo(int value) { + textSubtitle2IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textSubtitle2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textSubtitle2Int', value: value), + ); }); } QueryBuilder - textSubtitle2IntGreaterThan( - int value, { - bool include = false, - }) { + textSubtitle2IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textSubtitle2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textSubtitle2Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle2IntLessThan( - int value, { - bool include = false, - }) { + textSubtitle2IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textSubtitle2Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textSubtitle2Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle2IntBetween( + textSubtitle2IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textSubtitle2Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textSubtitle2Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textSubtitle3IntEqualTo(int value) { + textSubtitle3IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textSubtitle3Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textSubtitle3Int', value: value), + ); }); } QueryBuilder - textSubtitle3IntGreaterThan( - int value, { - bool include = false, - }) { + textSubtitle3IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textSubtitle3Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textSubtitle3Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle3IntLessThan( - int value, { - bool include = false, - }) { + textSubtitle3IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textSubtitle3Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textSubtitle3Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle3IntBetween( + textSubtitle3IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textSubtitle3Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textSubtitle3Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textSubtitle4IntEqualTo(int value) { + textSubtitle4IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textSubtitle4Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textSubtitle4Int', value: value), + ); }); } QueryBuilder - textSubtitle4IntGreaterThan( - int value, { - bool include = false, - }) { + textSubtitle4IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textSubtitle4Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textSubtitle4Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle4IntLessThan( - int value, { - bool include = false, - }) { + textSubtitle4IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textSubtitle4Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textSubtitle4Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle4IntBetween( + textSubtitle4IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textSubtitle4Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textSubtitle4Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textSubtitle5IntEqualTo(int value) { + textSubtitle5IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textSubtitle5Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textSubtitle5Int', value: value), + ); }); } QueryBuilder - textSubtitle5IntGreaterThan( - int value, { - bool include = false, - }) { + textSubtitle5IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textSubtitle5Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textSubtitle5Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle5IntLessThan( - int value, { - bool include = false, - }) { + textSubtitle5IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textSubtitle5Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textSubtitle5Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle5IntBetween( + textSubtitle5IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textSubtitle5Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textSubtitle5Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textSubtitle6IntEqualTo(int value) { + textSubtitle6IntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textSubtitle6Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textSubtitle6Int', value: value), + ); }); } QueryBuilder - textSubtitle6IntGreaterThan( - int value, { - bool include = false, - }) { + textSubtitle6IntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textSubtitle6Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textSubtitle6Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle6IntLessThan( - int value, { - bool include = false, - }) { + textSubtitle6IntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textSubtitle6Int', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textSubtitle6Int', + value: value, + ), + ); }); } QueryBuilder - textSubtitle6IntBetween( + textSubtitle6IntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textSubtitle6Int', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textSubtitle6Int', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - textWhiteIntEqualTo(int value) { + textWhiteIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'textWhiteInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'textWhiteInt', value: value), + ); }); } QueryBuilder - textWhiteIntGreaterThan( - int value, { - bool include = false, - }) { + textWhiteIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'textWhiteInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'textWhiteInt', + value: value, + ), + ); }); } QueryBuilder - textWhiteIntLessThan( - int value, { - bool include = false, - }) { + textWhiteIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'textWhiteInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'textWhiteInt', + value: value, + ), + ); }); } QueryBuilder - textWhiteIntBetween( + textWhiteIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'textWhiteInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'textWhiteInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -10601,27 +10912,31 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themeId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'themeId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeIdGreaterThan( + themeIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'themeId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'themeId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -10631,12 +10946,14 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'themeId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'themeId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -10648,14 +10965,16 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'themeId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'themeId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -10664,11 +10983,13 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'themeId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'themeId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -10677,599 +10998,607 @@ extension StackThemeQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'themeId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'themeId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder themeIdContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'themeId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'themeId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder themeIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'themeId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'themeId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder themeIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themeId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'themeId', value: ''), + ); }); } QueryBuilder - themeIdIsNotEmpty() { + themeIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'themeId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'themeId', value: ''), + ); }); } QueryBuilder - tokenSummaryBGIntEqualTo(int value) { + tokenSummaryBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenSummaryBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'tokenSummaryBGInt', value: value), + ); }); } QueryBuilder - tokenSummaryBGIntGreaterThan( - int value, { - bool include = false, - }) { + tokenSummaryBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenSummaryBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenSummaryBGInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryBGIntLessThan( - int value, { - bool include = false, - }) { + tokenSummaryBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenSummaryBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenSummaryBGInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryBGIntBetween( + tokenSummaryBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenSummaryBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenSummaryBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - tokenSummaryButtonBGIntEqualTo(int value) { + tokenSummaryButtonBGIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenSummaryButtonBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'tokenSummaryButtonBGInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryButtonBGIntGreaterThan( - int value, { - bool include = false, - }) { + tokenSummaryButtonBGIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenSummaryButtonBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenSummaryButtonBGInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryButtonBGIntLessThan( - int value, { - bool include = false, - }) { + tokenSummaryButtonBGIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenSummaryButtonBGInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenSummaryButtonBGInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryButtonBGIntBetween( + tokenSummaryButtonBGIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenSummaryButtonBGInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenSummaryButtonBGInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - tokenSummaryIconIntEqualTo(int value) { + tokenSummaryIconIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenSummaryIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'tokenSummaryIconInt', value: value), + ); }); } QueryBuilder - tokenSummaryIconIntGreaterThan( - int value, { - bool include = false, - }) { + tokenSummaryIconIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenSummaryIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenSummaryIconInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryIconIntLessThan( - int value, { - bool include = false, - }) { + tokenSummaryIconIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenSummaryIconInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenSummaryIconInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryIconIntBetween( + tokenSummaryIconIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenSummaryIconInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenSummaryIconInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - tokenSummaryTextPrimaryIntEqualTo(int value) { + tokenSummaryTextPrimaryIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenSummaryTextPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'tokenSummaryTextPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryTextPrimaryIntGreaterThan( - int value, { - bool include = false, - }) { + tokenSummaryTextPrimaryIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenSummaryTextPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenSummaryTextPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryTextPrimaryIntLessThan( - int value, { - bool include = false, - }) { + tokenSummaryTextPrimaryIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenSummaryTextPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenSummaryTextPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryTextPrimaryIntBetween( + tokenSummaryTextPrimaryIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenSummaryTextPrimaryInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenSummaryTextPrimaryInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - tokenSummaryTextSecondaryIntEqualTo(int value) { + tokenSummaryTextSecondaryIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenSummaryTextSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'tokenSummaryTextSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryTextSecondaryIntGreaterThan( - int value, { - bool include = false, - }) { + tokenSummaryTextSecondaryIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenSummaryTextSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenSummaryTextSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryTextSecondaryIntLessThan( - int value, { - bool include = false, - }) { + tokenSummaryTextSecondaryIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenSummaryTextSecondaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenSummaryTextSecondaryInt', + value: value, + ), + ); }); } QueryBuilder - tokenSummaryTextSecondaryIntBetween( + tokenSummaryTextSecondaryIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenSummaryTextSecondaryInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenSummaryTextSecondaryInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - topNavIconGreenIntEqualTo(int value) { + topNavIconGreenIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'topNavIconGreenInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'topNavIconGreenInt', value: value), + ); }); } QueryBuilder - topNavIconGreenIntGreaterThan( - int value, { - bool include = false, - }) { + topNavIconGreenIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'topNavIconGreenInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'topNavIconGreenInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconGreenIntLessThan( - int value, { - bool include = false, - }) { + topNavIconGreenIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'topNavIconGreenInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'topNavIconGreenInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconGreenIntBetween( + topNavIconGreenIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'topNavIconGreenInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'topNavIconGreenInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - topNavIconPrimaryIntEqualTo(int value) { + topNavIconPrimaryIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'topNavIconPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'topNavIconPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconPrimaryIntGreaterThan( - int value, { - bool include = false, - }) { + topNavIconPrimaryIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'topNavIconPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'topNavIconPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconPrimaryIntLessThan( - int value, { - bool include = false, - }) { + topNavIconPrimaryIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'topNavIconPrimaryInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'topNavIconPrimaryInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconPrimaryIntBetween( + topNavIconPrimaryIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'topNavIconPrimaryInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'topNavIconPrimaryInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - topNavIconRedIntEqualTo(int value) { + topNavIconRedIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'topNavIconRedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'topNavIconRedInt', value: value), + ); }); } QueryBuilder - topNavIconRedIntGreaterThan( - int value, { - bool include = false, - }) { + topNavIconRedIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'topNavIconRedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'topNavIconRedInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconRedIntLessThan( - int value, { - bool include = false, - }) { + topNavIconRedIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'topNavIconRedInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'topNavIconRedInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconRedIntBetween( + topNavIconRedIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'topNavIconRedInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'topNavIconRedInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - topNavIconYellowIntEqualTo(int value) { + topNavIconYellowIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'topNavIconYellowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'topNavIconYellowInt', value: value), + ); }); } QueryBuilder - topNavIconYellowIntGreaterThan( - int value, { - bool include = false, - }) { + topNavIconYellowIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'topNavIconYellowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'topNavIconYellowInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconYellowIntLessThan( - int value, { - bool include = false, - }) { + topNavIconYellowIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'topNavIconYellowInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'topNavIconYellowInt', + value: value, + ), + ); }); } QueryBuilder - topNavIconYellowIntBetween( + topNavIconYellowIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'topNavIconYellowInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'topNavIconYellowInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder versionIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'version', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'version'), + ); }); } QueryBuilder - versionIsNotNull() { + versionIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'version', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'version'), + ); }); } QueryBuilder versionEqualTo( - int? value) { + int? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'version', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'version', value: value), + ); }); } QueryBuilder - versionGreaterThan( - int? value, { - bool include = false, - }) { + versionGreaterThan(int? value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'version', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'version', + value: value, + ), + ); }); } @@ -11278,11 +11607,13 @@ extension StackThemeQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'version', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'version', + value: value, + ), + ); }); } @@ -11293,142 +11624,148 @@ extension StackThemeQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'version', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'version', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - warningBackgroundIntEqualTo(int value) { + warningBackgroundIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'warningBackgroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'warningBackgroundInt', + value: value, + ), + ); }); } QueryBuilder - warningBackgroundIntGreaterThan( - int value, { - bool include = false, - }) { + warningBackgroundIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'warningBackgroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'warningBackgroundInt', + value: value, + ), + ); }); } QueryBuilder - warningBackgroundIntLessThan( - int value, { - bool include = false, - }) { + warningBackgroundIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'warningBackgroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'warningBackgroundInt', + value: value, + ), + ); }); } QueryBuilder - warningBackgroundIntBetween( + warningBackgroundIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'warningBackgroundInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'warningBackgroundInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - warningForegroundIntEqualTo(int value) { + warningForegroundIntEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'warningForegroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'warningForegroundInt', + value: value, + ), + ); }); } QueryBuilder - warningForegroundIntGreaterThan( - int value, { - bool include = false, - }) { + warningForegroundIntGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'warningForegroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'warningForegroundInt', + value: value, + ), + ); }); } QueryBuilder - warningForegroundIntLessThan( - int value, { - bool include = false, - }) { + warningForegroundIntLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'warningForegroundInt', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'warningForegroundInt', + value: value, + ), + ); }); } QueryBuilder - warningForegroundIntBetween( + warningForegroundIntBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'warningForegroundInt', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'warningForegroundInt', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder assetsV3IsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'zAssetsV3', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'zAssetsV3'), + ); }); } QueryBuilder - assetsV3IsNotNull() { + assetsV3IsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'zAssetsV3', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'zAssetsV3'), + ); }); } } @@ -11436,21 +11773,24 @@ extension StackThemeQueryFilter extension StackThemeQueryObject on QueryBuilder { QueryBuilder assetsV1( - FilterQuery q) { + FilterQuery q, + ) { return QueryBuilder.apply(this, (query) { return query.object(q, r'assets'); }); } QueryBuilder assetsV2( - FilterQuery q) { + FilterQuery q, + ) { return QueryBuilder.apply(this, (query) { return query.object(q, r'assetsV2'); }); } QueryBuilder assetsV3( - FilterQuery q) { + FilterQuery q, + ) { return QueryBuilder.apply(this, (query) { return query.object(q, r'zAssetsV3'); }); @@ -11463,56 +11803,56 @@ extension StackThemeQueryLinks extension StackThemeQuerySortBy on QueryBuilder { QueryBuilder - sortByAccentColorBlueInt() { + sortByAccentColorBlueInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorBlueInt', Sort.asc); }); } QueryBuilder - sortByAccentColorBlueIntDesc() { + sortByAccentColorBlueIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorBlueInt', Sort.desc); }); } QueryBuilder - sortByAccentColorDarkInt() { + sortByAccentColorDarkInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorDarkInt', Sort.asc); }); } QueryBuilder - sortByAccentColorDarkIntDesc() { + sortByAccentColorDarkIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorDarkInt', Sort.desc); }); } QueryBuilder - sortByAccentColorGreenInt() { + sortByAccentColorGreenInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorGreenInt', Sort.asc); }); } QueryBuilder - sortByAccentColorGreenIntDesc() { + sortByAccentColorGreenIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorGreenInt', Sort.desc); }); } QueryBuilder - sortByAccentColorOrangeInt() { + sortByAccentColorOrangeInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorOrangeInt', Sort.asc); }); } QueryBuilder - sortByAccentColorOrangeIntDesc() { + sortByAccentColorOrangeIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorOrangeInt', Sort.desc); }); @@ -11525,35 +11865,35 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByAccentColorRedIntDesc() { + sortByAccentColorRedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorRedInt', Sort.desc); }); } QueryBuilder - sortByAccentColorYellowInt() { + sortByAccentColorYellowInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorYellowInt', Sort.asc); }); } QueryBuilder - sortByAccentColorYellowIntDesc() { + sortByAccentColorYellowIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorYellowInt', Sort.desc); }); } QueryBuilder - sortByBackgroundAppBarInt() { + sortByBackgroundAppBarInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'backgroundAppBarInt', Sort.asc); }); } QueryBuilder - sortByBackgroundAppBarIntDesc() { + sortByBackgroundAppBarIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'backgroundAppBarInt', Sort.desc); }); @@ -11578,63 +11918,63 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByBottomNavBackIntDesc() { + sortByBottomNavBackIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavBackInt', Sort.desc); }); } QueryBuilder - sortByBottomNavIconBackInt() { + sortByBottomNavIconBackInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconBackInt', Sort.asc); }); } QueryBuilder - sortByBottomNavIconBackIntDesc() { + sortByBottomNavIconBackIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconBackInt', Sort.desc); }); } QueryBuilder - sortByBottomNavIconIconHighlightedInt() { + sortByBottomNavIconIconHighlightedInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconIconHighlightedInt', Sort.asc); }); } QueryBuilder - sortByBottomNavIconIconHighlightedIntDesc() { + sortByBottomNavIconIconHighlightedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconIconHighlightedInt', Sort.desc); }); } QueryBuilder - sortByBottomNavIconIconInt() { + sortByBottomNavIconIconInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconIconInt', Sort.asc); }); } QueryBuilder - sortByBottomNavIconIconIntDesc() { + sortByBottomNavIconIconIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconIconInt', Sort.desc); }); } QueryBuilder - sortByBottomNavShadowInt() { + sortByBottomNavShadowInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavShadowInt', Sort.asc); }); } QueryBuilder - sortByBottomNavShadowIntDesc() { + sortByBottomNavShadowIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavShadowInt', Sort.desc); }); @@ -11647,7 +11987,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByBottomNavTextIntDesc() { + sortByBottomNavTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavTextInt', Sort.desc); }); @@ -11660,372 +12000,374 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByBrightnessStringDesc() { + sortByBrightnessStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'brightnessString', Sort.desc); }); } QueryBuilder - sortByButtonBackBorderDisabledInt() { + sortByButtonBackBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderDisabledInt', Sort.asc); }); } QueryBuilder - sortByButtonBackBorderDisabledIntDesc() { + sortByButtonBackBorderDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderDisabledInt', Sort.desc); }); } QueryBuilder - sortByButtonBackBorderInt() { + sortByButtonBackBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderInt', Sort.asc); }); } QueryBuilder - sortByButtonBackBorderIntDesc() { + sortByButtonBackBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderInt', Sort.desc); }); } QueryBuilder - sortByButtonBackBorderSecondaryDisabledInt() { + sortByButtonBackBorderSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderSecondaryDisabledInt', Sort.asc); }); } QueryBuilder - sortByButtonBackBorderSecondaryDisabledIntDesc() { + sortByButtonBackBorderSecondaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy( - r'buttonBackBorderSecondaryDisabledInt', Sort.desc); + r'buttonBackBorderSecondaryDisabledInt', + Sort.desc, + ); }); } QueryBuilder - sortByButtonBackBorderSecondaryInt() { + sortByButtonBackBorderSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderSecondaryInt', Sort.asc); }); } QueryBuilder - sortByButtonBackBorderSecondaryIntDesc() { + sortByButtonBackBorderSecondaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderSecondaryInt', Sort.desc); }); } QueryBuilder - sortByButtonBackPrimaryDisabledInt() { + sortByButtonBackPrimaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackPrimaryDisabledInt', Sort.asc); }); } QueryBuilder - sortByButtonBackPrimaryDisabledIntDesc() { + sortByButtonBackPrimaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackPrimaryDisabledInt', Sort.desc); }); } QueryBuilder - sortByButtonBackPrimaryInt() { + sortByButtonBackPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackPrimaryInt', Sort.asc); }); } QueryBuilder - sortByButtonBackPrimaryIntDesc() { + sortByButtonBackPrimaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackPrimaryInt', Sort.desc); }); } QueryBuilder - sortByButtonBackSecondaryDisabledInt() { + sortByButtonBackSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackSecondaryDisabledInt', Sort.asc); }); } QueryBuilder - sortByButtonBackSecondaryDisabledIntDesc() { + sortByButtonBackSecondaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackSecondaryDisabledInt', Sort.desc); }); } QueryBuilder - sortByButtonBackSecondaryInt() { + sortByButtonBackSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackSecondaryInt', Sort.asc); }); } QueryBuilder - sortByButtonBackSecondaryIntDesc() { + sortByButtonBackSecondaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackSecondaryInt', Sort.desc); }); } QueryBuilder - sortByButtonTextBorderInt() { + sortByButtonTextBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderInt', Sort.asc); }); } QueryBuilder - sortByButtonTextBorderIntDesc() { + sortByButtonTextBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderInt', Sort.desc); }); } QueryBuilder - sortByButtonTextBorderlessDisabledInt() { + sortByButtonTextBorderlessDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderlessDisabledInt', Sort.asc); }); } QueryBuilder - sortByButtonTextBorderlessDisabledIntDesc() { + sortByButtonTextBorderlessDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderlessDisabledInt', Sort.desc); }); } QueryBuilder - sortByButtonTextBorderlessInt() { + sortByButtonTextBorderlessInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderlessInt', Sort.asc); }); } QueryBuilder - sortByButtonTextBorderlessIntDesc() { + sortByButtonTextBorderlessIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderlessInt', Sort.desc); }); } QueryBuilder - sortByButtonTextDisabledInt() { + sortByButtonTextDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextDisabledInt', Sort.asc); }); } QueryBuilder - sortByButtonTextDisabledIntDesc() { + sortByButtonTextDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextDisabledInt', Sort.desc); }); } QueryBuilder - sortByButtonTextPrimaryDisabledInt() { + sortByButtonTextPrimaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextPrimaryDisabledInt', Sort.asc); }); } QueryBuilder - sortByButtonTextPrimaryDisabledIntDesc() { + sortByButtonTextPrimaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextPrimaryDisabledInt', Sort.desc); }); } QueryBuilder - sortByButtonTextPrimaryInt() { + sortByButtonTextPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextPrimaryInt', Sort.asc); }); } QueryBuilder - sortByButtonTextPrimaryIntDesc() { + sortByButtonTextPrimaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextPrimaryInt', Sort.desc); }); } QueryBuilder - sortByButtonTextSecondaryDisabledInt() { + sortByButtonTextSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextSecondaryDisabledInt', Sort.asc); }); } QueryBuilder - sortByButtonTextSecondaryDisabledIntDesc() { + sortByButtonTextSecondaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextSecondaryDisabledInt', Sort.desc); }); } QueryBuilder - sortByButtonTextSecondaryInt() { + sortByButtonTextSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextSecondaryInt', Sort.asc); }); } QueryBuilder - sortByButtonTextSecondaryIntDesc() { + sortByButtonTextSecondaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextSecondaryInt', Sort.desc); }); } QueryBuilder - sortByCheckboxBGCheckedInt() { + sortByCheckboxBGCheckedInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBGCheckedInt', Sort.asc); }); } QueryBuilder - sortByCheckboxBGCheckedIntDesc() { + sortByCheckboxBGCheckedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBGCheckedInt', Sort.desc); }); } QueryBuilder - sortByCheckboxBGDisabledInt() { + sortByCheckboxBGDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBGDisabledInt', Sort.asc); }); } QueryBuilder - sortByCheckboxBGDisabledIntDesc() { + sortByCheckboxBGDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBGDisabledInt', Sort.desc); }); } QueryBuilder - sortByCheckboxBorderEmptyInt() { + sortByCheckboxBorderEmptyInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBorderEmptyInt', Sort.asc); }); } QueryBuilder - sortByCheckboxBorderEmptyIntDesc() { + sortByCheckboxBorderEmptyIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBorderEmptyInt', Sort.desc); }); } QueryBuilder - sortByCheckboxIconCheckedInt() { + sortByCheckboxIconCheckedInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxIconCheckedInt', Sort.asc); }); } QueryBuilder - sortByCheckboxIconCheckedIntDesc() { + sortByCheckboxIconCheckedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxIconCheckedInt', Sort.desc); }); } QueryBuilder - sortByCheckboxIconDisabledInt() { + sortByCheckboxIconDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxIconDisabledInt', Sort.asc); }); } QueryBuilder - sortByCheckboxIconDisabledIntDesc() { + sortByCheckboxIconDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxIconDisabledInt', Sort.desc); }); } QueryBuilder - sortByCheckboxTextLabelInt() { + sortByCheckboxTextLabelInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxTextLabelInt', Sort.asc); }); } QueryBuilder - sortByCheckboxTextLabelIntDesc() { + sortByCheckboxTextLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxTextLabelInt', Sort.desc); }); } QueryBuilder - sortByCoinColorsJsonString() { + sortByCoinColorsJsonString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'coinColorsJsonString', Sort.asc); }); } QueryBuilder - sortByCoinColorsJsonStringDesc() { + sortByCoinColorsJsonStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'coinColorsJsonString', Sort.desc); }); } QueryBuilder - sortByCurrencyListItemBGInt() { + sortByCurrencyListItemBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'currencyListItemBGInt', Sort.asc); }); } QueryBuilder - sortByCurrencyListItemBGIntDesc() { + sortByCurrencyListItemBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'currencyListItemBGInt', Sort.desc); }); } QueryBuilder - sortByCustomTextButtonDisabledTextInt() { + sortByCustomTextButtonDisabledTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'customTextButtonDisabledTextInt', Sort.asc); }); } QueryBuilder - sortByCustomTextButtonDisabledTextIntDesc() { + sortByCustomTextButtonDisabledTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'customTextButtonDisabledTextInt', Sort.desc); }); } QueryBuilder - sortByCustomTextButtonEnabledTextInt() { + sortByCustomTextButtonEnabledTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'customTextButtonEnabledTextInt', Sort.asc); }); } QueryBuilder - sortByCustomTextButtonEnabledTextIntDesc() { + sortByCustomTextButtonEnabledTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'customTextButtonEnabledTextInt', Sort.desc); }); @@ -12062,63 +12404,63 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByEthWalletTagBGIntDesc() { + sortByEthWalletTagBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ethWalletTagBGInt', Sort.desc); }); } QueryBuilder - sortByEthWalletTagTextInt() { + sortByEthWalletTagTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ethWalletTagTextInt', Sort.asc); }); } QueryBuilder - sortByEthWalletTagTextIntDesc() { + sortByEthWalletTagTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ethWalletTagTextInt', Sort.desc); }); } QueryBuilder - sortByFavoriteStarActiveInt() { + sortByFavoriteStarActiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favoriteStarActiveInt', Sort.asc); }); } QueryBuilder - sortByFavoriteStarActiveIntDesc() { + sortByFavoriteStarActiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favoriteStarActiveInt', Sort.desc); }); } QueryBuilder - sortByFavoriteStarInactiveInt() { + sortByFavoriteStarInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favoriteStarInactiveInt', Sort.asc); }); } QueryBuilder - sortByFavoriteStarInactiveIntDesc() { + sortByFavoriteStarInactiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favoriteStarInactiveInt', Sort.desc); }); } QueryBuilder - sortByGradientBackgroundString() { + sortByGradientBackgroundString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'gradientBackgroundString', Sort.asc); }); } QueryBuilder - sortByGradientBackgroundStringDesc() { + sortByGradientBackgroundStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'gradientBackgroundString', Sort.desc); }); @@ -12137,14 +12479,14 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByHomeViewButtonBarBoxShadowString() { + sortByHomeViewButtonBarBoxShadowString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'homeViewButtonBarBoxShadowString', Sort.asc); }); } QueryBuilder - sortByHomeViewButtonBarBoxShadowStringDesc() { + sortByHomeViewButtonBarBoxShadowStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'homeViewButtonBarBoxShadowString', Sort.desc); }); @@ -12169,7 +12511,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByInfoItemIconsIntDesc() { + sortByInfoItemIconsIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'infoItemIconsInt', Sort.desc); }); @@ -12182,7 +12524,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByInfoItemLabelIntDesc() { + sortByInfoItemLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'infoItemLabelInt', Sort.desc); }); @@ -12195,35 +12537,35 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByInfoItemTextIntDesc() { + sortByInfoItemTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'infoItemTextInt', Sort.desc); }); } QueryBuilder - sortByLoadingOverlayTextColorInt() { + sortByLoadingOverlayTextColorInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'loadingOverlayTextColorInt', Sort.asc); }); } QueryBuilder - sortByLoadingOverlayTextColorIntDesc() { + sortByLoadingOverlayTextColorIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'loadingOverlayTextColorInt', Sort.desc); }); } QueryBuilder - sortByMyStackContactIconBGInt() { + sortByMyStackContactIconBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'myStackContactIconBGInt', Sort.asc); }); } QueryBuilder - sortByMyStackContactIconBGIntDesc() { + sortByMyStackContactIconBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'myStackContactIconBGInt', Sort.desc); }); @@ -12242,56 +12584,56 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByNumberBackDefaultInt() { + sortByNumberBackDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberBackDefaultInt', Sort.asc); }); } QueryBuilder - sortByNumberBackDefaultIntDesc() { + sortByNumberBackDefaultIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberBackDefaultInt', Sort.desc); }); } QueryBuilder - sortByNumberTextDefaultInt() { + sortByNumberTextDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberTextDefaultInt', Sort.asc); }); } QueryBuilder - sortByNumberTextDefaultIntDesc() { + sortByNumberTextDefaultIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberTextDefaultInt', Sort.desc); }); } QueryBuilder - sortByNumpadBackDefaultInt() { + sortByNumpadBackDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numpadBackDefaultInt', Sort.asc); }); } QueryBuilder - sortByNumpadBackDefaultIntDesc() { + sortByNumpadBackDefaultIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numpadBackDefaultInt', Sort.desc); }); } QueryBuilder - sortByNumpadTextDefaultInt() { + sortByNumpadTextDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numpadTextDefaultInt', Sort.asc); }); } QueryBuilder - sortByNumpadTextDefaultIntDesc() { + sortByNumpadTextDefaultIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numpadTextDefaultInt', Sort.desc); }); @@ -12322,294 +12664,294 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByRadioButtonBorderDisabledInt() { + sortByRadioButtonBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonBorderDisabledInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonBorderDisabledIntDesc() { + sortByRadioButtonBorderDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonBorderDisabledInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonBorderEnabledInt() { + sortByRadioButtonBorderEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonBorderEnabledInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonBorderEnabledIntDesc() { + sortByRadioButtonBorderEnabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonBorderEnabledInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonIconBorderDisabledInt() { + sortByRadioButtonIconBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconBorderDisabledInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonIconBorderDisabledIntDesc() { + sortByRadioButtonIconBorderDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconBorderDisabledInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonIconBorderInt() { + sortByRadioButtonIconBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconBorderInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonIconBorderIntDesc() { + sortByRadioButtonIconBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconBorderInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonIconCircleInt() { + sortByRadioButtonIconCircleInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconCircleInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonIconCircleIntDesc() { + sortByRadioButtonIconCircleIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconCircleInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonIconEnabledInt() { + sortByRadioButtonIconEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconEnabledInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonIconEnabledIntDesc() { + sortByRadioButtonIconEnabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconEnabledInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonLabelDisabledInt() { + sortByRadioButtonLabelDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonLabelDisabledInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonLabelDisabledIntDesc() { + sortByRadioButtonLabelDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonLabelDisabledInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonLabelEnabledInt() { + sortByRadioButtonLabelEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonLabelEnabledInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonLabelEnabledIntDesc() { + sortByRadioButtonLabelEnabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonLabelEnabledInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonTextDisabledInt() { + sortByRadioButtonTextDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonTextDisabledInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonTextDisabledIntDesc() { + sortByRadioButtonTextDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonTextDisabledInt', Sort.desc); }); } QueryBuilder - sortByRadioButtonTextEnabledInt() { + sortByRadioButtonTextEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonTextEnabledInt', Sort.asc); }); } QueryBuilder - sortByRadioButtonTextEnabledIntDesc() { + sortByRadioButtonTextEnabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonTextEnabledInt', Sort.desc); }); } QueryBuilder - sortByRateTypeToggleColorOffInt() { + sortByRateTypeToggleColorOffInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleColorOffInt', Sort.asc); }); } QueryBuilder - sortByRateTypeToggleColorOffIntDesc() { + sortByRateTypeToggleColorOffIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleColorOffInt', Sort.desc); }); } QueryBuilder - sortByRateTypeToggleColorOnInt() { + sortByRateTypeToggleColorOnInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleColorOnInt', Sort.asc); }); } QueryBuilder - sortByRateTypeToggleColorOnIntDesc() { + sortByRateTypeToggleColorOnIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleColorOnInt', Sort.desc); }); } QueryBuilder - sortByRateTypeToggleDesktopColorOffInt() { + sortByRateTypeToggleDesktopColorOffInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleDesktopColorOffInt', Sort.asc); }); } QueryBuilder - sortByRateTypeToggleDesktopColorOffIntDesc() { + sortByRateTypeToggleDesktopColorOffIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleDesktopColorOffInt', Sort.desc); }); } QueryBuilder - sortByRateTypeToggleDesktopColorOnInt() { + sortByRateTypeToggleDesktopColorOnInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleDesktopColorOnInt', Sort.asc); }); } QueryBuilder - sortByRateTypeToggleDesktopColorOnIntDesc() { + sortByRateTypeToggleDesktopColorOnIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleDesktopColorOnInt', Sort.desc); }); } QueryBuilder - sortBySettingsIconBack2Int() { + sortBySettingsIconBack2Int() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconBack2Int', Sort.asc); }); } QueryBuilder - sortBySettingsIconBack2IntDesc() { + sortBySettingsIconBack2IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconBack2Int', Sort.desc); }); } QueryBuilder - sortBySettingsIconBackInt() { + sortBySettingsIconBackInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconBackInt', Sort.asc); }); } QueryBuilder - sortBySettingsIconBackIntDesc() { + sortBySettingsIconBackIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconBackInt', Sort.desc); }); } QueryBuilder - sortBySettingsIconElementInt() { + sortBySettingsIconElementInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconElementInt', Sort.asc); }); } QueryBuilder - sortBySettingsIconElementIntDesc() { + sortBySettingsIconElementIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconElementInt', Sort.desc); }); } QueryBuilder - sortBySettingsIconIconInt() { + sortBySettingsIconIconInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconIconInt', Sort.asc); }); } QueryBuilder - sortBySettingsIconIconIntDesc() { + sortBySettingsIconIconIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconIconInt', Sort.desc); }); } QueryBuilder - sortBySettingsItem2ActiveBGInt() { + sortBySettingsItem2ActiveBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveBGInt', Sort.asc); }); } QueryBuilder - sortBySettingsItem2ActiveBGIntDesc() { + sortBySettingsItem2ActiveBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveBGInt', Sort.desc); }); } QueryBuilder - sortBySettingsItem2ActiveSubInt() { + sortBySettingsItem2ActiveSubInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveSubInt', Sort.asc); }); } QueryBuilder - sortBySettingsItem2ActiveSubIntDesc() { + sortBySettingsItem2ActiveSubIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveSubInt', Sort.desc); }); } QueryBuilder - sortBySettingsItem2ActiveTextInt() { + sortBySettingsItem2ActiveTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveTextInt', Sort.asc); }); } QueryBuilder - sortBySettingsItem2ActiveTextIntDesc() { + sortBySettingsItem2ActiveTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveTextInt', Sort.desc); }); @@ -12628,84 +12970,84 @@ extension StackThemeQuerySortBy } QueryBuilder - sortBySnackBarBackErrorInt() { + sortBySnackBarBackErrorInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackErrorInt', Sort.asc); }); } QueryBuilder - sortBySnackBarBackErrorIntDesc() { + sortBySnackBarBackErrorIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackErrorInt', Sort.desc); }); } QueryBuilder - sortBySnackBarBackInfoInt() { + sortBySnackBarBackInfoInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackInfoInt', Sort.asc); }); } QueryBuilder - sortBySnackBarBackInfoIntDesc() { + sortBySnackBarBackInfoIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackInfoInt', Sort.desc); }); } QueryBuilder - sortBySnackBarBackSuccessInt() { + sortBySnackBarBackSuccessInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackSuccessInt', Sort.asc); }); } QueryBuilder - sortBySnackBarBackSuccessIntDesc() { + sortBySnackBarBackSuccessIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackSuccessInt', Sort.desc); }); } QueryBuilder - sortBySnackBarTextErrorInt() { + sortBySnackBarTextErrorInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextErrorInt', Sort.asc); }); } QueryBuilder - sortBySnackBarTextErrorIntDesc() { + sortBySnackBarTextErrorIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextErrorInt', Sort.desc); }); } QueryBuilder - sortBySnackBarTextInfoInt() { + sortBySnackBarTextInfoInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextInfoInt', Sort.asc); }); } QueryBuilder - sortBySnackBarTextInfoIntDesc() { + sortBySnackBarTextInfoIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextInfoInt', Sort.desc); }); } QueryBuilder - sortBySnackBarTextSuccessInt() { + sortBySnackBarTextSuccessInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextSuccessInt', Sort.asc); }); } QueryBuilder - sortBySnackBarTextSuccessIntDesc() { + sortBySnackBarTextSuccessIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextSuccessInt', Sort.desc); }); @@ -12730,21 +13072,21 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByStackWalletBGIntDesc() { + sortByStackWalletBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stackWalletBGInt', Sort.desc); }); } QueryBuilder - sortByStackWalletBottomInt() { + sortByStackWalletBottomInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stackWalletBottomInt', Sort.asc); }); } QueryBuilder - sortByStackWalletBottomIntDesc() { + sortByStackWalletBottomIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stackWalletBottomInt', Sort.desc); }); @@ -12757,147 +13099,147 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByStackWalletMidIntDesc() { + sortByStackWalletMidIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stackWalletMidInt', Sort.desc); }); } QueryBuilder - sortByStandardBoxShadowString() { + sortByStandardBoxShadowString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'standardBoxShadowString', Sort.asc); }); } QueryBuilder - sortByStandardBoxShadowStringDesc() { + sortByStandardBoxShadowStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'standardBoxShadowString', Sort.desc); }); } QueryBuilder - sortByStepIndicatorBGCheckInt() { + sortByStepIndicatorBGCheckInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGCheckInt', Sort.asc); }); } QueryBuilder - sortByStepIndicatorBGCheckIntDesc() { + sortByStepIndicatorBGCheckIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGCheckInt', Sort.desc); }); } QueryBuilder - sortByStepIndicatorBGInactiveInt() { + sortByStepIndicatorBGInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGInactiveInt', Sort.asc); }); } QueryBuilder - sortByStepIndicatorBGInactiveIntDesc() { + sortByStepIndicatorBGInactiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGInactiveInt', Sort.desc); }); } QueryBuilder - sortByStepIndicatorBGLinesInactiveInt() { + sortByStepIndicatorBGLinesInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGLinesInactiveInt', Sort.asc); }); } QueryBuilder - sortByStepIndicatorBGLinesInactiveIntDesc() { + sortByStepIndicatorBGLinesInactiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGLinesInactiveInt', Sort.desc); }); } QueryBuilder - sortByStepIndicatorBGLinesInt() { + sortByStepIndicatorBGLinesInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGLinesInt', Sort.asc); }); } QueryBuilder - sortByStepIndicatorBGLinesIntDesc() { + sortByStepIndicatorBGLinesIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGLinesInt', Sort.desc); }); } QueryBuilder - sortByStepIndicatorBGNumberInt() { + sortByStepIndicatorBGNumberInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGNumberInt', Sort.asc); }); } QueryBuilder - sortByStepIndicatorBGNumberIntDesc() { + sortByStepIndicatorBGNumberIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGNumberInt', Sort.desc); }); } QueryBuilder - sortByStepIndicatorIconInactiveInt() { + sortByStepIndicatorIconInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconInactiveInt', Sort.asc); }); } QueryBuilder - sortByStepIndicatorIconInactiveIntDesc() { + sortByStepIndicatorIconInactiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconInactiveInt', Sort.desc); }); } QueryBuilder - sortByStepIndicatorIconNumberInt() { + sortByStepIndicatorIconNumberInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconNumberInt', Sort.asc); }); } QueryBuilder - sortByStepIndicatorIconNumberIntDesc() { + sortByStepIndicatorIconNumberIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconNumberInt', Sort.desc); }); } QueryBuilder - sortByStepIndicatorIconTextInt() { + sortByStepIndicatorIconTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconTextInt', Sort.asc); }); } QueryBuilder - sortByStepIndicatorIconTextIntDesc() { + sortByStepIndicatorIconTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconTextInt', Sort.desc); }); } QueryBuilder - sortBySwitchBGDisabledInt() { + sortBySwitchBGDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchBGDisabledInt', Sort.asc); }); } QueryBuilder - sortBySwitchBGDisabledIntDesc() { + sortBySwitchBGDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchBGDisabledInt', Sort.desc); }); @@ -12910,7 +13252,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortBySwitchBGOffIntDesc() { + sortBySwitchBGOffIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchBGOffInt', Sort.desc); }); @@ -12929,28 +13271,28 @@ extension StackThemeQuerySortBy } QueryBuilder - sortBySwitchCircleDisabledInt() { + sortBySwitchCircleDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleDisabledInt', Sort.asc); }); } QueryBuilder - sortBySwitchCircleDisabledIntDesc() { + sortBySwitchCircleDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleDisabledInt', Sort.desc); }); } QueryBuilder - sortBySwitchCircleOffInt() { + sortBySwitchCircleOffInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleOffInt', Sort.asc); }); } QueryBuilder - sortBySwitchCircleOffIntDesc() { + sortBySwitchCircleOffIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleOffInt', Sort.desc); }); @@ -12963,21 +13305,21 @@ extension StackThemeQuerySortBy } QueryBuilder - sortBySwitchCircleOnIntDesc() { + sortBySwitchCircleOnIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleOnInt', Sort.desc); }); } QueryBuilder - sortByTextConfirmTotalAmountInt() { + sortByTextConfirmTotalAmountInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textConfirmTotalAmountInt', Sort.asc); }); } QueryBuilder - sortByTextConfirmTotalAmountIntDesc() { + sortByTextConfirmTotalAmountIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textConfirmTotalAmountInt', Sort.desc); }); @@ -13032,308 +13374,308 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTextFavoriteCardInt() { + sortByTextFavoriteCardInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFavoriteCardInt', Sort.asc); }); } QueryBuilder - sortByTextFavoriteCardIntDesc() { + sortByTextFavoriteCardIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFavoriteCardInt', Sort.desc); }); } QueryBuilder - sortByTextFieldActiveBGInt() { + sortByTextFieldActiveBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveBGInt', Sort.asc); }); } QueryBuilder - sortByTextFieldActiveBGIntDesc() { + sortByTextFieldActiveBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveBGInt', Sort.desc); }); } QueryBuilder - sortByTextFieldActiveLabelInt() { + sortByTextFieldActiveLabelInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveLabelInt', Sort.asc); }); } QueryBuilder - sortByTextFieldActiveLabelIntDesc() { + sortByTextFieldActiveLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveLabelInt', Sort.desc); }); } QueryBuilder - sortByTextFieldActiveSearchIconLeftInt() { + sortByTextFieldActiveSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveSearchIconLeftInt', Sort.asc); }); } QueryBuilder - sortByTextFieldActiveSearchIconLeftIntDesc() { + sortByTextFieldActiveSearchIconLeftIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveSearchIconLeftInt', Sort.desc); }); } QueryBuilder - sortByTextFieldActiveSearchIconRightInt() { + sortByTextFieldActiveSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveSearchIconRightInt', Sort.asc); }); } QueryBuilder - sortByTextFieldActiveSearchIconRightIntDesc() { + sortByTextFieldActiveSearchIconRightIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveSearchIconRightInt', Sort.desc); }); } QueryBuilder - sortByTextFieldActiveTextInt() { + sortByTextFieldActiveTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveTextInt', Sort.asc); }); } QueryBuilder - sortByTextFieldActiveTextIntDesc() { + sortByTextFieldActiveTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveTextInt', Sort.desc); }); } QueryBuilder - sortByTextFieldDefaultBGInt() { + sortByTextFieldDefaultBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultBGInt', Sort.asc); }); } QueryBuilder - sortByTextFieldDefaultBGIntDesc() { + sortByTextFieldDefaultBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultBGInt', Sort.desc); }); } QueryBuilder - sortByTextFieldDefaultSearchIconLeftInt() { + sortByTextFieldDefaultSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultSearchIconLeftInt', Sort.asc); }); } QueryBuilder - sortByTextFieldDefaultSearchIconLeftIntDesc() { + sortByTextFieldDefaultSearchIconLeftIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultSearchIconLeftInt', Sort.desc); }); } QueryBuilder - sortByTextFieldDefaultSearchIconRightInt() { + sortByTextFieldDefaultSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultSearchIconRightInt', Sort.asc); }); } QueryBuilder - sortByTextFieldDefaultSearchIconRightIntDesc() { + sortByTextFieldDefaultSearchIconRightIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultSearchIconRightInt', Sort.desc); }); } QueryBuilder - sortByTextFieldDefaultTextInt() { + sortByTextFieldDefaultTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultTextInt', Sort.asc); }); } QueryBuilder - sortByTextFieldDefaultTextIntDesc() { + sortByTextFieldDefaultTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultTextInt', Sort.desc); }); } QueryBuilder - sortByTextFieldErrorBGInt() { + sortByTextFieldErrorBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorBGInt', Sort.asc); }); } QueryBuilder - sortByTextFieldErrorBGIntDesc() { + sortByTextFieldErrorBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorBGInt', Sort.desc); }); } QueryBuilder - sortByTextFieldErrorBorderInt() { + sortByTextFieldErrorBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorBorderInt', Sort.asc); }); } QueryBuilder - sortByTextFieldErrorBorderIntDesc() { + sortByTextFieldErrorBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorBorderInt', Sort.desc); }); } QueryBuilder - sortByTextFieldErrorLabelInt() { + sortByTextFieldErrorLabelInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorLabelInt', Sort.asc); }); } QueryBuilder - sortByTextFieldErrorLabelIntDesc() { + sortByTextFieldErrorLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorLabelInt', Sort.desc); }); } QueryBuilder - sortByTextFieldErrorSearchIconLeftInt() { + sortByTextFieldErrorSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorSearchIconLeftInt', Sort.asc); }); } QueryBuilder - sortByTextFieldErrorSearchIconLeftIntDesc() { + sortByTextFieldErrorSearchIconLeftIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorSearchIconLeftInt', Sort.desc); }); } QueryBuilder - sortByTextFieldErrorSearchIconRightInt() { + sortByTextFieldErrorSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorSearchIconRightInt', Sort.asc); }); } QueryBuilder - sortByTextFieldErrorSearchIconRightIntDesc() { + sortByTextFieldErrorSearchIconRightIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorSearchIconRightInt', Sort.desc); }); } QueryBuilder - sortByTextFieldErrorTextInt() { + sortByTextFieldErrorTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorTextInt', Sort.asc); }); } QueryBuilder - sortByTextFieldErrorTextIntDesc() { + sortByTextFieldErrorTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorTextInt', Sort.desc); }); } QueryBuilder - sortByTextFieldSuccessBGInt() { + sortByTextFieldSuccessBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessBGInt', Sort.asc); }); } QueryBuilder - sortByTextFieldSuccessBGIntDesc() { + sortByTextFieldSuccessBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessBGInt', Sort.desc); }); } QueryBuilder - sortByTextFieldSuccessBorderInt() { + sortByTextFieldSuccessBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessBorderInt', Sort.asc); }); } QueryBuilder - sortByTextFieldSuccessBorderIntDesc() { + sortByTextFieldSuccessBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessBorderInt', Sort.desc); }); } QueryBuilder - sortByTextFieldSuccessLabelInt() { + sortByTextFieldSuccessLabelInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessLabelInt', Sort.asc); }); } QueryBuilder - sortByTextFieldSuccessLabelIntDesc() { + sortByTextFieldSuccessLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessLabelInt', Sort.desc); }); } QueryBuilder - sortByTextFieldSuccessSearchIconLeftInt() { + sortByTextFieldSuccessSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessSearchIconLeftInt', Sort.asc); }); } QueryBuilder - sortByTextFieldSuccessSearchIconLeftIntDesc() { + sortByTextFieldSuccessSearchIconLeftIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessSearchIconLeftInt', Sort.desc); }); } QueryBuilder - sortByTextFieldSuccessSearchIconRightInt() { + sortByTextFieldSuccessSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessSearchIconRightInt', Sort.asc); }); } QueryBuilder - sortByTextFieldSuccessSearchIconRightIntDesc() { + sortByTextFieldSuccessSearchIconRightIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessSearchIconRightInt', Sort.desc); }); } QueryBuilder - sortByTextFieldSuccessTextInt() { + sortByTextFieldSuccessTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessTextInt', Sort.asc); }); } QueryBuilder - sortByTextFieldSuccessTextIntDesc() { + sortByTextFieldSuccessTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessTextInt', Sort.desc); }); @@ -13346,21 +13688,21 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTextRestoreIntDesc() { + sortByTextRestoreIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textRestoreInt', Sort.desc); }); } QueryBuilder - sortByTextSelectedWordTableItemInt() { + sortByTextSelectedWordTableItemInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSelectedWordTableItemInt', Sort.asc); }); } QueryBuilder - sortByTextSelectedWordTableItemIntDesc() { + sortByTextSelectedWordTableItemIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSelectedWordTableItemInt', Sort.desc); }); @@ -13373,7 +13715,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTextSubtitle1IntDesc() { + sortByTextSubtitle1IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle1Int', Sort.desc); }); @@ -13386,7 +13728,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTextSubtitle2IntDesc() { + sortByTextSubtitle2IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle2Int', Sort.desc); }); @@ -13399,7 +13741,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTextSubtitle3IntDesc() { + sortByTextSubtitle3IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle3Int', Sort.desc); }); @@ -13412,7 +13754,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTextSubtitle4IntDesc() { + sortByTextSubtitle4IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle4Int', Sort.desc); }); @@ -13425,7 +13767,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTextSubtitle5IntDesc() { + sortByTextSubtitle5IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle5Int', Sort.desc); }); @@ -13438,7 +13780,7 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTextSubtitle6IntDesc() { + sortByTextSubtitle6IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle6Int', Sort.desc); }); @@ -13475,91 +13817,91 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTokenSummaryBGIntDesc() { + sortByTokenSummaryBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryBGInt', Sort.desc); }); } QueryBuilder - sortByTokenSummaryButtonBGInt() { + sortByTokenSummaryButtonBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryButtonBGInt', Sort.asc); }); } QueryBuilder - sortByTokenSummaryButtonBGIntDesc() { + sortByTokenSummaryButtonBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryButtonBGInt', Sort.desc); }); } QueryBuilder - sortByTokenSummaryIconInt() { + sortByTokenSummaryIconInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryIconInt', Sort.asc); }); } QueryBuilder - sortByTokenSummaryIconIntDesc() { + sortByTokenSummaryIconIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryIconInt', Sort.desc); }); } QueryBuilder - sortByTokenSummaryTextPrimaryInt() { + sortByTokenSummaryTextPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryTextPrimaryInt', Sort.asc); }); } QueryBuilder - sortByTokenSummaryTextPrimaryIntDesc() { + sortByTokenSummaryTextPrimaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryTextPrimaryInt', Sort.desc); }); } QueryBuilder - sortByTokenSummaryTextSecondaryInt() { + sortByTokenSummaryTextSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryTextSecondaryInt', Sort.asc); }); } QueryBuilder - sortByTokenSummaryTextSecondaryIntDesc() { + sortByTokenSummaryTextSecondaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryTextSecondaryInt', Sort.desc); }); } QueryBuilder - sortByTopNavIconGreenInt() { + sortByTopNavIconGreenInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconGreenInt', Sort.asc); }); } QueryBuilder - sortByTopNavIconGreenIntDesc() { + sortByTopNavIconGreenIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconGreenInt', Sort.desc); }); } QueryBuilder - sortByTopNavIconPrimaryInt() { + sortByTopNavIconPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconPrimaryInt', Sort.asc); }); } QueryBuilder - sortByTopNavIconPrimaryIntDesc() { + sortByTopNavIconPrimaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconPrimaryInt', Sort.desc); }); @@ -13572,21 +13914,21 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByTopNavIconRedIntDesc() { + sortByTopNavIconRedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconRedInt', Sort.desc); }); } QueryBuilder - sortByTopNavIconYellowInt() { + sortByTopNavIconYellowInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconYellowInt', Sort.asc); }); } QueryBuilder - sortByTopNavIconYellowIntDesc() { + sortByTopNavIconYellowIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconYellowInt', Sort.desc); }); @@ -13605,28 +13947,28 @@ extension StackThemeQuerySortBy } QueryBuilder - sortByWarningBackgroundInt() { + sortByWarningBackgroundInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'warningBackgroundInt', Sort.asc); }); } QueryBuilder - sortByWarningBackgroundIntDesc() { + sortByWarningBackgroundIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'warningBackgroundInt', Sort.desc); }); } QueryBuilder - sortByWarningForegroundInt() { + sortByWarningForegroundInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'warningForegroundInt', Sort.asc); }); } QueryBuilder - sortByWarningForegroundIntDesc() { + sortByWarningForegroundIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'warningForegroundInt', Sort.desc); }); @@ -13636,56 +13978,56 @@ extension StackThemeQuerySortBy extension StackThemeQuerySortThenBy on QueryBuilder { QueryBuilder - thenByAccentColorBlueInt() { + thenByAccentColorBlueInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorBlueInt', Sort.asc); }); } QueryBuilder - thenByAccentColorBlueIntDesc() { + thenByAccentColorBlueIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorBlueInt', Sort.desc); }); } QueryBuilder - thenByAccentColorDarkInt() { + thenByAccentColorDarkInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorDarkInt', Sort.asc); }); } QueryBuilder - thenByAccentColorDarkIntDesc() { + thenByAccentColorDarkIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorDarkInt', Sort.desc); }); } QueryBuilder - thenByAccentColorGreenInt() { + thenByAccentColorGreenInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorGreenInt', Sort.asc); }); } QueryBuilder - thenByAccentColorGreenIntDesc() { + thenByAccentColorGreenIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorGreenInt', Sort.desc); }); } QueryBuilder - thenByAccentColorOrangeInt() { + thenByAccentColorOrangeInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorOrangeInt', Sort.asc); }); } QueryBuilder - thenByAccentColorOrangeIntDesc() { + thenByAccentColorOrangeIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorOrangeInt', Sort.desc); }); @@ -13698,35 +14040,35 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByAccentColorRedIntDesc() { + thenByAccentColorRedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorRedInt', Sort.desc); }); } QueryBuilder - thenByAccentColorYellowInt() { + thenByAccentColorYellowInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorYellowInt', Sort.asc); }); } QueryBuilder - thenByAccentColorYellowIntDesc() { + thenByAccentColorYellowIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'accentColorYellowInt', Sort.desc); }); } QueryBuilder - thenByBackgroundAppBarInt() { + thenByBackgroundAppBarInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'backgroundAppBarInt', Sort.asc); }); } QueryBuilder - thenByBackgroundAppBarIntDesc() { + thenByBackgroundAppBarIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'backgroundAppBarInt', Sort.desc); }); @@ -13751,63 +14093,63 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByBottomNavBackIntDesc() { + thenByBottomNavBackIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavBackInt', Sort.desc); }); } QueryBuilder - thenByBottomNavIconBackInt() { + thenByBottomNavIconBackInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconBackInt', Sort.asc); }); } QueryBuilder - thenByBottomNavIconBackIntDesc() { + thenByBottomNavIconBackIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconBackInt', Sort.desc); }); } QueryBuilder - thenByBottomNavIconIconHighlightedInt() { + thenByBottomNavIconIconHighlightedInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconIconHighlightedInt', Sort.asc); }); } QueryBuilder - thenByBottomNavIconIconHighlightedIntDesc() { + thenByBottomNavIconIconHighlightedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconIconHighlightedInt', Sort.desc); }); } QueryBuilder - thenByBottomNavIconIconInt() { + thenByBottomNavIconIconInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconIconInt', Sort.asc); }); } QueryBuilder - thenByBottomNavIconIconIntDesc() { + thenByBottomNavIconIconIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavIconIconInt', Sort.desc); }); } QueryBuilder - thenByBottomNavShadowInt() { + thenByBottomNavShadowInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavShadowInt', Sort.asc); }); } QueryBuilder - thenByBottomNavShadowIntDesc() { + thenByBottomNavShadowIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavShadowInt', Sort.desc); }); @@ -13820,7 +14162,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByBottomNavTextIntDesc() { + thenByBottomNavTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'bottomNavTextInt', Sort.desc); }); @@ -13833,372 +14175,374 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByBrightnessStringDesc() { + thenByBrightnessStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'brightnessString', Sort.desc); }); } QueryBuilder - thenByButtonBackBorderDisabledInt() { + thenByButtonBackBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderDisabledInt', Sort.asc); }); } QueryBuilder - thenByButtonBackBorderDisabledIntDesc() { + thenByButtonBackBorderDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderDisabledInt', Sort.desc); }); } QueryBuilder - thenByButtonBackBorderInt() { + thenByButtonBackBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderInt', Sort.asc); }); } QueryBuilder - thenByButtonBackBorderIntDesc() { + thenByButtonBackBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderInt', Sort.desc); }); } QueryBuilder - thenByButtonBackBorderSecondaryDisabledInt() { + thenByButtonBackBorderSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderSecondaryDisabledInt', Sort.asc); }); } QueryBuilder - thenByButtonBackBorderSecondaryDisabledIntDesc() { + thenByButtonBackBorderSecondaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy( - r'buttonBackBorderSecondaryDisabledInt', Sort.desc); + r'buttonBackBorderSecondaryDisabledInt', + Sort.desc, + ); }); } QueryBuilder - thenByButtonBackBorderSecondaryInt() { + thenByButtonBackBorderSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderSecondaryInt', Sort.asc); }); } QueryBuilder - thenByButtonBackBorderSecondaryIntDesc() { + thenByButtonBackBorderSecondaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackBorderSecondaryInt', Sort.desc); }); } QueryBuilder - thenByButtonBackPrimaryDisabledInt() { + thenByButtonBackPrimaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackPrimaryDisabledInt', Sort.asc); }); } QueryBuilder - thenByButtonBackPrimaryDisabledIntDesc() { + thenByButtonBackPrimaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackPrimaryDisabledInt', Sort.desc); }); } QueryBuilder - thenByButtonBackPrimaryInt() { + thenByButtonBackPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackPrimaryInt', Sort.asc); }); } QueryBuilder - thenByButtonBackPrimaryIntDesc() { + thenByButtonBackPrimaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackPrimaryInt', Sort.desc); }); } QueryBuilder - thenByButtonBackSecondaryDisabledInt() { + thenByButtonBackSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackSecondaryDisabledInt', Sort.asc); }); } QueryBuilder - thenByButtonBackSecondaryDisabledIntDesc() { + thenByButtonBackSecondaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackSecondaryDisabledInt', Sort.desc); }); } QueryBuilder - thenByButtonBackSecondaryInt() { + thenByButtonBackSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackSecondaryInt', Sort.asc); }); } QueryBuilder - thenByButtonBackSecondaryIntDesc() { + thenByButtonBackSecondaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonBackSecondaryInt', Sort.desc); }); } QueryBuilder - thenByButtonTextBorderInt() { + thenByButtonTextBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderInt', Sort.asc); }); } QueryBuilder - thenByButtonTextBorderIntDesc() { + thenByButtonTextBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderInt', Sort.desc); }); } QueryBuilder - thenByButtonTextBorderlessDisabledInt() { + thenByButtonTextBorderlessDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderlessDisabledInt', Sort.asc); }); } QueryBuilder - thenByButtonTextBorderlessDisabledIntDesc() { + thenByButtonTextBorderlessDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderlessDisabledInt', Sort.desc); }); } QueryBuilder - thenByButtonTextBorderlessInt() { + thenByButtonTextBorderlessInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderlessInt', Sort.asc); }); } QueryBuilder - thenByButtonTextBorderlessIntDesc() { + thenByButtonTextBorderlessIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextBorderlessInt', Sort.desc); }); } QueryBuilder - thenByButtonTextDisabledInt() { + thenByButtonTextDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextDisabledInt', Sort.asc); }); } QueryBuilder - thenByButtonTextDisabledIntDesc() { + thenByButtonTextDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextDisabledInt', Sort.desc); }); } QueryBuilder - thenByButtonTextPrimaryDisabledInt() { + thenByButtonTextPrimaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextPrimaryDisabledInt', Sort.asc); }); } QueryBuilder - thenByButtonTextPrimaryDisabledIntDesc() { + thenByButtonTextPrimaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextPrimaryDisabledInt', Sort.desc); }); } QueryBuilder - thenByButtonTextPrimaryInt() { + thenByButtonTextPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextPrimaryInt', Sort.asc); }); } QueryBuilder - thenByButtonTextPrimaryIntDesc() { + thenByButtonTextPrimaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextPrimaryInt', Sort.desc); }); } QueryBuilder - thenByButtonTextSecondaryDisabledInt() { + thenByButtonTextSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextSecondaryDisabledInt', Sort.asc); }); } QueryBuilder - thenByButtonTextSecondaryDisabledIntDesc() { + thenByButtonTextSecondaryDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextSecondaryDisabledInt', Sort.desc); }); } QueryBuilder - thenByButtonTextSecondaryInt() { + thenByButtonTextSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextSecondaryInt', Sort.asc); }); } QueryBuilder - thenByButtonTextSecondaryIntDesc() { + thenByButtonTextSecondaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'buttonTextSecondaryInt', Sort.desc); }); } QueryBuilder - thenByCheckboxBGCheckedInt() { + thenByCheckboxBGCheckedInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBGCheckedInt', Sort.asc); }); } QueryBuilder - thenByCheckboxBGCheckedIntDesc() { + thenByCheckboxBGCheckedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBGCheckedInt', Sort.desc); }); } QueryBuilder - thenByCheckboxBGDisabledInt() { + thenByCheckboxBGDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBGDisabledInt', Sort.asc); }); } QueryBuilder - thenByCheckboxBGDisabledIntDesc() { + thenByCheckboxBGDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBGDisabledInt', Sort.desc); }); } QueryBuilder - thenByCheckboxBorderEmptyInt() { + thenByCheckboxBorderEmptyInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBorderEmptyInt', Sort.asc); }); } QueryBuilder - thenByCheckboxBorderEmptyIntDesc() { + thenByCheckboxBorderEmptyIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxBorderEmptyInt', Sort.desc); }); } QueryBuilder - thenByCheckboxIconCheckedInt() { + thenByCheckboxIconCheckedInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxIconCheckedInt', Sort.asc); }); } QueryBuilder - thenByCheckboxIconCheckedIntDesc() { + thenByCheckboxIconCheckedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxIconCheckedInt', Sort.desc); }); } QueryBuilder - thenByCheckboxIconDisabledInt() { + thenByCheckboxIconDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxIconDisabledInt', Sort.asc); }); } QueryBuilder - thenByCheckboxIconDisabledIntDesc() { + thenByCheckboxIconDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxIconDisabledInt', Sort.desc); }); } QueryBuilder - thenByCheckboxTextLabelInt() { + thenByCheckboxTextLabelInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxTextLabelInt', Sort.asc); }); } QueryBuilder - thenByCheckboxTextLabelIntDesc() { + thenByCheckboxTextLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'checkboxTextLabelInt', Sort.desc); }); } QueryBuilder - thenByCoinColorsJsonString() { + thenByCoinColorsJsonString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'coinColorsJsonString', Sort.asc); }); } QueryBuilder - thenByCoinColorsJsonStringDesc() { + thenByCoinColorsJsonStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'coinColorsJsonString', Sort.desc); }); } QueryBuilder - thenByCurrencyListItemBGInt() { + thenByCurrencyListItemBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'currencyListItemBGInt', Sort.asc); }); } QueryBuilder - thenByCurrencyListItemBGIntDesc() { + thenByCurrencyListItemBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'currencyListItemBGInt', Sort.desc); }); } QueryBuilder - thenByCustomTextButtonDisabledTextInt() { + thenByCustomTextButtonDisabledTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'customTextButtonDisabledTextInt', Sort.asc); }); } QueryBuilder - thenByCustomTextButtonDisabledTextIntDesc() { + thenByCustomTextButtonDisabledTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'customTextButtonDisabledTextInt', Sort.desc); }); } QueryBuilder - thenByCustomTextButtonEnabledTextInt() { + thenByCustomTextButtonEnabledTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'customTextButtonEnabledTextInt', Sort.asc); }); } QueryBuilder - thenByCustomTextButtonEnabledTextIntDesc() { + thenByCustomTextButtonEnabledTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'customTextButtonEnabledTextInt', Sort.desc); }); @@ -14235,63 +14579,63 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByEthWalletTagBGIntDesc() { + thenByEthWalletTagBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ethWalletTagBGInt', Sort.desc); }); } QueryBuilder - thenByEthWalletTagTextInt() { + thenByEthWalletTagTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ethWalletTagTextInt', Sort.asc); }); } QueryBuilder - thenByEthWalletTagTextIntDesc() { + thenByEthWalletTagTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'ethWalletTagTextInt', Sort.desc); }); } QueryBuilder - thenByFavoriteStarActiveInt() { + thenByFavoriteStarActiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favoriteStarActiveInt', Sort.asc); }); } QueryBuilder - thenByFavoriteStarActiveIntDesc() { + thenByFavoriteStarActiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favoriteStarActiveInt', Sort.desc); }); } QueryBuilder - thenByFavoriteStarInactiveInt() { + thenByFavoriteStarInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favoriteStarInactiveInt', Sort.asc); }); } QueryBuilder - thenByFavoriteStarInactiveIntDesc() { + thenByFavoriteStarInactiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favoriteStarInactiveInt', Sort.desc); }); } QueryBuilder - thenByGradientBackgroundString() { + thenByGradientBackgroundString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'gradientBackgroundString', Sort.asc); }); } QueryBuilder - thenByGradientBackgroundStringDesc() { + thenByGradientBackgroundStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'gradientBackgroundString', Sort.desc); }); @@ -14310,14 +14654,14 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByHomeViewButtonBarBoxShadowString() { + thenByHomeViewButtonBarBoxShadowString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'homeViewButtonBarBoxShadowString', Sort.asc); }); } QueryBuilder - thenByHomeViewButtonBarBoxShadowStringDesc() { + thenByHomeViewButtonBarBoxShadowStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'homeViewButtonBarBoxShadowString', Sort.desc); }); @@ -14354,7 +14698,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByInfoItemIconsIntDesc() { + thenByInfoItemIconsIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'infoItemIconsInt', Sort.desc); }); @@ -14367,7 +14711,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByInfoItemLabelIntDesc() { + thenByInfoItemLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'infoItemLabelInt', Sort.desc); }); @@ -14380,35 +14724,35 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByInfoItemTextIntDesc() { + thenByInfoItemTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'infoItemTextInt', Sort.desc); }); } QueryBuilder - thenByLoadingOverlayTextColorInt() { + thenByLoadingOverlayTextColorInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'loadingOverlayTextColorInt', Sort.asc); }); } QueryBuilder - thenByLoadingOverlayTextColorIntDesc() { + thenByLoadingOverlayTextColorIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'loadingOverlayTextColorInt', Sort.desc); }); } QueryBuilder - thenByMyStackContactIconBGInt() { + thenByMyStackContactIconBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'myStackContactIconBGInt', Sort.asc); }); } QueryBuilder - thenByMyStackContactIconBGIntDesc() { + thenByMyStackContactIconBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'myStackContactIconBGInt', Sort.desc); }); @@ -14427,56 +14771,56 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByNumberBackDefaultInt() { + thenByNumberBackDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberBackDefaultInt', Sort.asc); }); } QueryBuilder - thenByNumberBackDefaultIntDesc() { + thenByNumberBackDefaultIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberBackDefaultInt', Sort.desc); }); } QueryBuilder - thenByNumberTextDefaultInt() { + thenByNumberTextDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberTextDefaultInt', Sort.asc); }); } QueryBuilder - thenByNumberTextDefaultIntDesc() { + thenByNumberTextDefaultIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numberTextDefaultInt', Sort.desc); }); } QueryBuilder - thenByNumpadBackDefaultInt() { + thenByNumpadBackDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numpadBackDefaultInt', Sort.asc); }); } QueryBuilder - thenByNumpadBackDefaultIntDesc() { + thenByNumpadBackDefaultIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numpadBackDefaultInt', Sort.desc); }); } QueryBuilder - thenByNumpadTextDefaultInt() { + thenByNumpadTextDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numpadTextDefaultInt', Sort.asc); }); } QueryBuilder - thenByNumpadTextDefaultIntDesc() { + thenByNumpadTextDefaultIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'numpadTextDefaultInt', Sort.desc); }); @@ -14507,294 +14851,294 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByRadioButtonBorderDisabledInt() { + thenByRadioButtonBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonBorderDisabledInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonBorderDisabledIntDesc() { + thenByRadioButtonBorderDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonBorderDisabledInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonBorderEnabledInt() { + thenByRadioButtonBorderEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonBorderEnabledInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonBorderEnabledIntDesc() { + thenByRadioButtonBorderEnabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonBorderEnabledInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonIconBorderDisabledInt() { + thenByRadioButtonIconBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconBorderDisabledInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonIconBorderDisabledIntDesc() { + thenByRadioButtonIconBorderDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconBorderDisabledInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonIconBorderInt() { + thenByRadioButtonIconBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconBorderInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonIconBorderIntDesc() { + thenByRadioButtonIconBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconBorderInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonIconCircleInt() { + thenByRadioButtonIconCircleInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconCircleInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonIconCircleIntDesc() { + thenByRadioButtonIconCircleIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconCircleInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonIconEnabledInt() { + thenByRadioButtonIconEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconEnabledInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonIconEnabledIntDesc() { + thenByRadioButtonIconEnabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonIconEnabledInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonLabelDisabledInt() { + thenByRadioButtonLabelDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonLabelDisabledInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonLabelDisabledIntDesc() { + thenByRadioButtonLabelDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonLabelDisabledInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonLabelEnabledInt() { + thenByRadioButtonLabelEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonLabelEnabledInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonLabelEnabledIntDesc() { + thenByRadioButtonLabelEnabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonLabelEnabledInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonTextDisabledInt() { + thenByRadioButtonTextDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonTextDisabledInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonTextDisabledIntDesc() { + thenByRadioButtonTextDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonTextDisabledInt', Sort.desc); }); } QueryBuilder - thenByRadioButtonTextEnabledInt() { + thenByRadioButtonTextEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonTextEnabledInt', Sort.asc); }); } QueryBuilder - thenByRadioButtonTextEnabledIntDesc() { + thenByRadioButtonTextEnabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'radioButtonTextEnabledInt', Sort.desc); }); } QueryBuilder - thenByRateTypeToggleColorOffInt() { + thenByRateTypeToggleColorOffInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleColorOffInt', Sort.asc); }); } QueryBuilder - thenByRateTypeToggleColorOffIntDesc() { + thenByRateTypeToggleColorOffIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleColorOffInt', Sort.desc); }); } QueryBuilder - thenByRateTypeToggleColorOnInt() { + thenByRateTypeToggleColorOnInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleColorOnInt', Sort.asc); }); } QueryBuilder - thenByRateTypeToggleColorOnIntDesc() { + thenByRateTypeToggleColorOnIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleColorOnInt', Sort.desc); }); } QueryBuilder - thenByRateTypeToggleDesktopColorOffInt() { + thenByRateTypeToggleDesktopColorOffInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleDesktopColorOffInt', Sort.asc); }); } QueryBuilder - thenByRateTypeToggleDesktopColorOffIntDesc() { + thenByRateTypeToggleDesktopColorOffIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleDesktopColorOffInt', Sort.desc); }); } QueryBuilder - thenByRateTypeToggleDesktopColorOnInt() { + thenByRateTypeToggleDesktopColorOnInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleDesktopColorOnInt', Sort.asc); }); } QueryBuilder - thenByRateTypeToggleDesktopColorOnIntDesc() { + thenByRateTypeToggleDesktopColorOnIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'rateTypeToggleDesktopColorOnInt', Sort.desc); }); } QueryBuilder - thenBySettingsIconBack2Int() { + thenBySettingsIconBack2Int() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconBack2Int', Sort.asc); }); } QueryBuilder - thenBySettingsIconBack2IntDesc() { + thenBySettingsIconBack2IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconBack2Int', Sort.desc); }); } QueryBuilder - thenBySettingsIconBackInt() { + thenBySettingsIconBackInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconBackInt', Sort.asc); }); } QueryBuilder - thenBySettingsIconBackIntDesc() { + thenBySettingsIconBackIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconBackInt', Sort.desc); }); } QueryBuilder - thenBySettingsIconElementInt() { + thenBySettingsIconElementInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconElementInt', Sort.asc); }); } QueryBuilder - thenBySettingsIconElementIntDesc() { + thenBySettingsIconElementIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconElementInt', Sort.desc); }); } QueryBuilder - thenBySettingsIconIconInt() { + thenBySettingsIconIconInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconIconInt', Sort.asc); }); } QueryBuilder - thenBySettingsIconIconIntDesc() { + thenBySettingsIconIconIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsIconIconInt', Sort.desc); }); } QueryBuilder - thenBySettingsItem2ActiveBGInt() { + thenBySettingsItem2ActiveBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveBGInt', Sort.asc); }); } QueryBuilder - thenBySettingsItem2ActiveBGIntDesc() { + thenBySettingsItem2ActiveBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveBGInt', Sort.desc); }); } QueryBuilder - thenBySettingsItem2ActiveSubInt() { + thenBySettingsItem2ActiveSubInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveSubInt', Sort.asc); }); } QueryBuilder - thenBySettingsItem2ActiveSubIntDesc() { + thenBySettingsItem2ActiveSubIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveSubInt', Sort.desc); }); } QueryBuilder - thenBySettingsItem2ActiveTextInt() { + thenBySettingsItem2ActiveTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveTextInt', Sort.asc); }); } QueryBuilder - thenBySettingsItem2ActiveTextIntDesc() { + thenBySettingsItem2ActiveTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'settingsItem2ActiveTextInt', Sort.desc); }); @@ -14813,84 +15157,84 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenBySnackBarBackErrorInt() { + thenBySnackBarBackErrorInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackErrorInt', Sort.asc); }); } QueryBuilder - thenBySnackBarBackErrorIntDesc() { + thenBySnackBarBackErrorIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackErrorInt', Sort.desc); }); } QueryBuilder - thenBySnackBarBackInfoInt() { + thenBySnackBarBackInfoInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackInfoInt', Sort.asc); }); } QueryBuilder - thenBySnackBarBackInfoIntDesc() { + thenBySnackBarBackInfoIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackInfoInt', Sort.desc); }); } QueryBuilder - thenBySnackBarBackSuccessInt() { + thenBySnackBarBackSuccessInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackSuccessInt', Sort.asc); }); } QueryBuilder - thenBySnackBarBackSuccessIntDesc() { + thenBySnackBarBackSuccessIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarBackSuccessInt', Sort.desc); }); } QueryBuilder - thenBySnackBarTextErrorInt() { + thenBySnackBarTextErrorInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextErrorInt', Sort.asc); }); } QueryBuilder - thenBySnackBarTextErrorIntDesc() { + thenBySnackBarTextErrorIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextErrorInt', Sort.desc); }); } QueryBuilder - thenBySnackBarTextInfoInt() { + thenBySnackBarTextInfoInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextInfoInt', Sort.asc); }); } QueryBuilder - thenBySnackBarTextInfoIntDesc() { + thenBySnackBarTextInfoIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextInfoInt', Sort.desc); }); } QueryBuilder - thenBySnackBarTextSuccessInt() { + thenBySnackBarTextSuccessInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextSuccessInt', Sort.asc); }); } QueryBuilder - thenBySnackBarTextSuccessIntDesc() { + thenBySnackBarTextSuccessIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'snackBarTextSuccessInt', Sort.desc); }); @@ -14915,21 +15259,21 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByStackWalletBGIntDesc() { + thenByStackWalletBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stackWalletBGInt', Sort.desc); }); } QueryBuilder - thenByStackWalletBottomInt() { + thenByStackWalletBottomInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stackWalletBottomInt', Sort.asc); }); } QueryBuilder - thenByStackWalletBottomIntDesc() { + thenByStackWalletBottomIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stackWalletBottomInt', Sort.desc); }); @@ -14942,147 +15286,147 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByStackWalletMidIntDesc() { + thenByStackWalletMidIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stackWalletMidInt', Sort.desc); }); } QueryBuilder - thenByStandardBoxShadowString() { + thenByStandardBoxShadowString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'standardBoxShadowString', Sort.asc); }); } QueryBuilder - thenByStandardBoxShadowStringDesc() { + thenByStandardBoxShadowStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'standardBoxShadowString', Sort.desc); }); } QueryBuilder - thenByStepIndicatorBGCheckInt() { + thenByStepIndicatorBGCheckInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGCheckInt', Sort.asc); }); } QueryBuilder - thenByStepIndicatorBGCheckIntDesc() { + thenByStepIndicatorBGCheckIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGCheckInt', Sort.desc); }); } QueryBuilder - thenByStepIndicatorBGInactiveInt() { + thenByStepIndicatorBGInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGInactiveInt', Sort.asc); }); } QueryBuilder - thenByStepIndicatorBGInactiveIntDesc() { + thenByStepIndicatorBGInactiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGInactiveInt', Sort.desc); }); } QueryBuilder - thenByStepIndicatorBGLinesInactiveInt() { + thenByStepIndicatorBGLinesInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGLinesInactiveInt', Sort.asc); }); } QueryBuilder - thenByStepIndicatorBGLinesInactiveIntDesc() { + thenByStepIndicatorBGLinesInactiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGLinesInactiveInt', Sort.desc); }); } QueryBuilder - thenByStepIndicatorBGLinesInt() { + thenByStepIndicatorBGLinesInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGLinesInt', Sort.asc); }); } QueryBuilder - thenByStepIndicatorBGLinesIntDesc() { + thenByStepIndicatorBGLinesIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGLinesInt', Sort.desc); }); } QueryBuilder - thenByStepIndicatorBGNumberInt() { + thenByStepIndicatorBGNumberInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGNumberInt', Sort.asc); }); } QueryBuilder - thenByStepIndicatorBGNumberIntDesc() { + thenByStepIndicatorBGNumberIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorBGNumberInt', Sort.desc); }); } QueryBuilder - thenByStepIndicatorIconInactiveInt() { + thenByStepIndicatorIconInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconInactiveInt', Sort.asc); }); } QueryBuilder - thenByStepIndicatorIconInactiveIntDesc() { + thenByStepIndicatorIconInactiveIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconInactiveInt', Sort.desc); }); } QueryBuilder - thenByStepIndicatorIconNumberInt() { + thenByStepIndicatorIconNumberInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconNumberInt', Sort.asc); }); } QueryBuilder - thenByStepIndicatorIconNumberIntDesc() { + thenByStepIndicatorIconNumberIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconNumberInt', Sort.desc); }); } QueryBuilder - thenByStepIndicatorIconTextInt() { + thenByStepIndicatorIconTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconTextInt', Sort.asc); }); } QueryBuilder - thenByStepIndicatorIconTextIntDesc() { + thenByStepIndicatorIconTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'stepIndicatorIconTextInt', Sort.desc); }); } QueryBuilder - thenBySwitchBGDisabledInt() { + thenBySwitchBGDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchBGDisabledInt', Sort.asc); }); } QueryBuilder - thenBySwitchBGDisabledIntDesc() { + thenBySwitchBGDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchBGDisabledInt', Sort.desc); }); @@ -15095,7 +15439,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenBySwitchBGOffIntDesc() { + thenBySwitchBGOffIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchBGOffInt', Sort.desc); }); @@ -15114,28 +15458,28 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenBySwitchCircleDisabledInt() { + thenBySwitchCircleDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleDisabledInt', Sort.asc); }); } QueryBuilder - thenBySwitchCircleDisabledIntDesc() { + thenBySwitchCircleDisabledIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleDisabledInt', Sort.desc); }); } QueryBuilder - thenBySwitchCircleOffInt() { + thenBySwitchCircleOffInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleOffInt', Sort.asc); }); } QueryBuilder - thenBySwitchCircleOffIntDesc() { + thenBySwitchCircleOffIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleOffInt', Sort.desc); }); @@ -15148,21 +15492,21 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenBySwitchCircleOnIntDesc() { + thenBySwitchCircleOnIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'switchCircleOnInt', Sort.desc); }); } QueryBuilder - thenByTextConfirmTotalAmountInt() { + thenByTextConfirmTotalAmountInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textConfirmTotalAmountInt', Sort.asc); }); } QueryBuilder - thenByTextConfirmTotalAmountIntDesc() { + thenByTextConfirmTotalAmountIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textConfirmTotalAmountInt', Sort.desc); }); @@ -15217,308 +15561,308 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTextFavoriteCardInt() { + thenByTextFavoriteCardInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFavoriteCardInt', Sort.asc); }); } QueryBuilder - thenByTextFavoriteCardIntDesc() { + thenByTextFavoriteCardIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFavoriteCardInt', Sort.desc); }); } QueryBuilder - thenByTextFieldActiveBGInt() { + thenByTextFieldActiveBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveBGInt', Sort.asc); }); } QueryBuilder - thenByTextFieldActiveBGIntDesc() { + thenByTextFieldActiveBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveBGInt', Sort.desc); }); } QueryBuilder - thenByTextFieldActiveLabelInt() { + thenByTextFieldActiveLabelInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveLabelInt', Sort.asc); }); } QueryBuilder - thenByTextFieldActiveLabelIntDesc() { + thenByTextFieldActiveLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveLabelInt', Sort.desc); }); } QueryBuilder - thenByTextFieldActiveSearchIconLeftInt() { + thenByTextFieldActiveSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveSearchIconLeftInt', Sort.asc); }); } QueryBuilder - thenByTextFieldActiveSearchIconLeftIntDesc() { + thenByTextFieldActiveSearchIconLeftIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveSearchIconLeftInt', Sort.desc); }); } QueryBuilder - thenByTextFieldActiveSearchIconRightInt() { + thenByTextFieldActiveSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveSearchIconRightInt', Sort.asc); }); } QueryBuilder - thenByTextFieldActiveSearchIconRightIntDesc() { + thenByTextFieldActiveSearchIconRightIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveSearchIconRightInt', Sort.desc); }); } QueryBuilder - thenByTextFieldActiveTextInt() { + thenByTextFieldActiveTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveTextInt', Sort.asc); }); } QueryBuilder - thenByTextFieldActiveTextIntDesc() { + thenByTextFieldActiveTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldActiveTextInt', Sort.desc); }); } QueryBuilder - thenByTextFieldDefaultBGInt() { + thenByTextFieldDefaultBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultBGInt', Sort.asc); }); } QueryBuilder - thenByTextFieldDefaultBGIntDesc() { + thenByTextFieldDefaultBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultBGInt', Sort.desc); }); } QueryBuilder - thenByTextFieldDefaultSearchIconLeftInt() { + thenByTextFieldDefaultSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultSearchIconLeftInt', Sort.asc); }); } QueryBuilder - thenByTextFieldDefaultSearchIconLeftIntDesc() { + thenByTextFieldDefaultSearchIconLeftIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultSearchIconLeftInt', Sort.desc); }); } QueryBuilder - thenByTextFieldDefaultSearchIconRightInt() { + thenByTextFieldDefaultSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultSearchIconRightInt', Sort.asc); }); } QueryBuilder - thenByTextFieldDefaultSearchIconRightIntDesc() { + thenByTextFieldDefaultSearchIconRightIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultSearchIconRightInt', Sort.desc); }); } QueryBuilder - thenByTextFieldDefaultTextInt() { + thenByTextFieldDefaultTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultTextInt', Sort.asc); }); } QueryBuilder - thenByTextFieldDefaultTextIntDesc() { + thenByTextFieldDefaultTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldDefaultTextInt', Sort.desc); }); } QueryBuilder - thenByTextFieldErrorBGInt() { + thenByTextFieldErrorBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorBGInt', Sort.asc); }); } QueryBuilder - thenByTextFieldErrorBGIntDesc() { + thenByTextFieldErrorBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorBGInt', Sort.desc); }); } QueryBuilder - thenByTextFieldErrorBorderInt() { + thenByTextFieldErrorBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorBorderInt', Sort.asc); }); } QueryBuilder - thenByTextFieldErrorBorderIntDesc() { + thenByTextFieldErrorBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorBorderInt', Sort.desc); }); } QueryBuilder - thenByTextFieldErrorLabelInt() { + thenByTextFieldErrorLabelInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorLabelInt', Sort.asc); }); } QueryBuilder - thenByTextFieldErrorLabelIntDesc() { + thenByTextFieldErrorLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorLabelInt', Sort.desc); }); } QueryBuilder - thenByTextFieldErrorSearchIconLeftInt() { + thenByTextFieldErrorSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorSearchIconLeftInt', Sort.asc); }); } QueryBuilder - thenByTextFieldErrorSearchIconLeftIntDesc() { + thenByTextFieldErrorSearchIconLeftIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorSearchIconLeftInt', Sort.desc); }); } QueryBuilder - thenByTextFieldErrorSearchIconRightInt() { + thenByTextFieldErrorSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorSearchIconRightInt', Sort.asc); }); } QueryBuilder - thenByTextFieldErrorSearchIconRightIntDesc() { + thenByTextFieldErrorSearchIconRightIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorSearchIconRightInt', Sort.desc); }); } QueryBuilder - thenByTextFieldErrorTextInt() { + thenByTextFieldErrorTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorTextInt', Sort.asc); }); } QueryBuilder - thenByTextFieldErrorTextIntDesc() { + thenByTextFieldErrorTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldErrorTextInt', Sort.desc); }); } QueryBuilder - thenByTextFieldSuccessBGInt() { + thenByTextFieldSuccessBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessBGInt', Sort.asc); }); } QueryBuilder - thenByTextFieldSuccessBGIntDesc() { + thenByTextFieldSuccessBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessBGInt', Sort.desc); }); } QueryBuilder - thenByTextFieldSuccessBorderInt() { + thenByTextFieldSuccessBorderInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessBorderInt', Sort.asc); }); } QueryBuilder - thenByTextFieldSuccessBorderIntDesc() { + thenByTextFieldSuccessBorderIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessBorderInt', Sort.desc); }); } QueryBuilder - thenByTextFieldSuccessLabelInt() { + thenByTextFieldSuccessLabelInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessLabelInt', Sort.asc); }); } QueryBuilder - thenByTextFieldSuccessLabelIntDesc() { + thenByTextFieldSuccessLabelIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessLabelInt', Sort.desc); }); } QueryBuilder - thenByTextFieldSuccessSearchIconLeftInt() { + thenByTextFieldSuccessSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessSearchIconLeftInt', Sort.asc); }); } QueryBuilder - thenByTextFieldSuccessSearchIconLeftIntDesc() { + thenByTextFieldSuccessSearchIconLeftIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessSearchIconLeftInt', Sort.desc); }); } QueryBuilder - thenByTextFieldSuccessSearchIconRightInt() { + thenByTextFieldSuccessSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessSearchIconRightInt', Sort.asc); }); } QueryBuilder - thenByTextFieldSuccessSearchIconRightIntDesc() { + thenByTextFieldSuccessSearchIconRightIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessSearchIconRightInt', Sort.desc); }); } QueryBuilder - thenByTextFieldSuccessTextInt() { + thenByTextFieldSuccessTextInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessTextInt', Sort.asc); }); } QueryBuilder - thenByTextFieldSuccessTextIntDesc() { + thenByTextFieldSuccessTextIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textFieldSuccessTextInt', Sort.desc); }); @@ -15531,21 +15875,21 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTextRestoreIntDesc() { + thenByTextRestoreIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textRestoreInt', Sort.desc); }); } QueryBuilder - thenByTextSelectedWordTableItemInt() { + thenByTextSelectedWordTableItemInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSelectedWordTableItemInt', Sort.asc); }); } QueryBuilder - thenByTextSelectedWordTableItemIntDesc() { + thenByTextSelectedWordTableItemIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSelectedWordTableItemInt', Sort.desc); }); @@ -15558,7 +15902,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTextSubtitle1IntDesc() { + thenByTextSubtitle1IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle1Int', Sort.desc); }); @@ -15571,7 +15915,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTextSubtitle2IntDesc() { + thenByTextSubtitle2IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle2Int', Sort.desc); }); @@ -15584,7 +15928,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTextSubtitle3IntDesc() { + thenByTextSubtitle3IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle3Int', Sort.desc); }); @@ -15597,7 +15941,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTextSubtitle4IntDesc() { + thenByTextSubtitle4IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle4Int', Sort.desc); }); @@ -15610,7 +15954,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTextSubtitle5IntDesc() { + thenByTextSubtitle5IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle5Int', Sort.desc); }); @@ -15623,7 +15967,7 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTextSubtitle6IntDesc() { + thenByTextSubtitle6IntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'textSubtitle6Int', Sort.desc); }); @@ -15660,91 +16004,91 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTokenSummaryBGIntDesc() { + thenByTokenSummaryBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryBGInt', Sort.desc); }); } QueryBuilder - thenByTokenSummaryButtonBGInt() { + thenByTokenSummaryButtonBGInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryButtonBGInt', Sort.asc); }); } QueryBuilder - thenByTokenSummaryButtonBGIntDesc() { + thenByTokenSummaryButtonBGIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryButtonBGInt', Sort.desc); }); } QueryBuilder - thenByTokenSummaryIconInt() { + thenByTokenSummaryIconInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryIconInt', Sort.asc); }); } QueryBuilder - thenByTokenSummaryIconIntDesc() { + thenByTokenSummaryIconIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryIconInt', Sort.desc); }); } QueryBuilder - thenByTokenSummaryTextPrimaryInt() { + thenByTokenSummaryTextPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryTextPrimaryInt', Sort.asc); }); } QueryBuilder - thenByTokenSummaryTextPrimaryIntDesc() { + thenByTokenSummaryTextPrimaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryTextPrimaryInt', Sort.desc); }); } QueryBuilder - thenByTokenSummaryTextSecondaryInt() { + thenByTokenSummaryTextSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryTextSecondaryInt', Sort.asc); }); } QueryBuilder - thenByTokenSummaryTextSecondaryIntDesc() { + thenByTokenSummaryTextSecondaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenSummaryTextSecondaryInt', Sort.desc); }); } QueryBuilder - thenByTopNavIconGreenInt() { + thenByTopNavIconGreenInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconGreenInt', Sort.asc); }); } QueryBuilder - thenByTopNavIconGreenIntDesc() { + thenByTopNavIconGreenIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconGreenInt', Sort.desc); }); } QueryBuilder - thenByTopNavIconPrimaryInt() { + thenByTopNavIconPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconPrimaryInt', Sort.asc); }); } QueryBuilder - thenByTopNavIconPrimaryIntDesc() { + thenByTopNavIconPrimaryIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconPrimaryInt', Sort.desc); }); @@ -15757,21 +16101,21 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByTopNavIconRedIntDesc() { + thenByTopNavIconRedIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconRedInt', Sort.desc); }); } QueryBuilder - thenByTopNavIconYellowInt() { + thenByTopNavIconYellowInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconYellowInt', Sort.asc); }); } QueryBuilder - thenByTopNavIconYellowIntDesc() { + thenByTopNavIconYellowIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'topNavIconYellowInt', Sort.desc); }); @@ -15790,28 +16134,28 @@ extension StackThemeQuerySortThenBy } QueryBuilder - thenByWarningBackgroundInt() { + thenByWarningBackgroundInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'warningBackgroundInt', Sort.asc); }); } QueryBuilder - thenByWarningBackgroundIntDesc() { + thenByWarningBackgroundIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'warningBackgroundInt', Sort.desc); }); } QueryBuilder - thenByWarningForegroundInt() { + thenByWarningForegroundInt() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'warningForegroundInt', Sort.asc); }); } QueryBuilder - thenByWarningForegroundIntDesc() { + thenByWarningForegroundIntDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'warningForegroundInt', Sort.desc); }); @@ -15821,49 +16165,49 @@ extension StackThemeQuerySortThenBy extension StackThemeQueryWhereDistinct on QueryBuilder { QueryBuilder - distinctByAccentColorBlueInt() { + distinctByAccentColorBlueInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'accentColorBlueInt'); }); } QueryBuilder - distinctByAccentColorDarkInt() { + distinctByAccentColorDarkInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'accentColorDarkInt'); }); } QueryBuilder - distinctByAccentColorGreenInt() { + distinctByAccentColorGreenInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'accentColorGreenInt'); }); } QueryBuilder - distinctByAccentColorOrangeInt() { + distinctByAccentColorOrangeInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'accentColorOrangeInt'); }); } QueryBuilder - distinctByAccentColorRedInt() { + distinctByAccentColorRedInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'accentColorRedInt'); }); } QueryBuilder - distinctByAccentColorYellowInt() { + distinctByAccentColorYellowInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'accentColorYellowInt'); }); } QueryBuilder - distinctByBackgroundAppBarInt() { + distinctByBackgroundAppBarInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'backgroundAppBarInt'); }); @@ -15882,28 +16226,28 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByBottomNavIconBackInt() { + distinctByBottomNavIconBackInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'bottomNavIconBackInt'); }); } QueryBuilder - distinctByBottomNavIconIconHighlightedInt() { + distinctByBottomNavIconIconHighlightedInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'bottomNavIconIconHighlightedInt'); }); } QueryBuilder - distinctByBottomNavIconIconInt() { + distinctByBottomNavIconIconInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'bottomNavIconIconInt'); }); } QueryBuilder - distinctByBottomNavShadowInt() { + distinctByBottomNavShadowInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'bottomNavShadowInt'); }); @@ -15915,192 +16259,197 @@ extension StackThemeQueryWhereDistinct }); } - QueryBuilder distinctByBrightnessString( - {bool caseSensitive = true}) { + QueryBuilder distinctByBrightnessString({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'brightnessString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'brightnessString', + caseSensitive: caseSensitive, + ); }); } QueryBuilder - distinctByButtonBackBorderDisabledInt() { + distinctByButtonBackBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonBackBorderDisabledInt'); }); } QueryBuilder - distinctByButtonBackBorderInt() { + distinctByButtonBackBorderInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonBackBorderInt'); }); } QueryBuilder - distinctByButtonBackBorderSecondaryDisabledInt() { + distinctByButtonBackBorderSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonBackBorderSecondaryDisabledInt'); }); } QueryBuilder - distinctByButtonBackBorderSecondaryInt() { + distinctByButtonBackBorderSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonBackBorderSecondaryInt'); }); } QueryBuilder - distinctByButtonBackPrimaryDisabledInt() { + distinctByButtonBackPrimaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonBackPrimaryDisabledInt'); }); } QueryBuilder - distinctByButtonBackPrimaryInt() { + distinctByButtonBackPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonBackPrimaryInt'); }); } QueryBuilder - distinctByButtonBackSecondaryDisabledInt() { + distinctByButtonBackSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonBackSecondaryDisabledInt'); }); } QueryBuilder - distinctByButtonBackSecondaryInt() { + distinctByButtonBackSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonBackSecondaryInt'); }); } QueryBuilder - distinctByButtonTextBorderInt() { + distinctByButtonTextBorderInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonTextBorderInt'); }); } QueryBuilder - distinctByButtonTextBorderlessDisabledInt() { + distinctByButtonTextBorderlessDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonTextBorderlessDisabledInt'); }); } QueryBuilder - distinctByButtonTextBorderlessInt() { + distinctByButtonTextBorderlessInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonTextBorderlessInt'); }); } QueryBuilder - distinctByButtonTextDisabledInt() { + distinctByButtonTextDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonTextDisabledInt'); }); } QueryBuilder - distinctByButtonTextPrimaryDisabledInt() { + distinctByButtonTextPrimaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonTextPrimaryDisabledInt'); }); } QueryBuilder - distinctByButtonTextPrimaryInt() { + distinctByButtonTextPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonTextPrimaryInt'); }); } QueryBuilder - distinctByButtonTextSecondaryDisabledInt() { + distinctByButtonTextSecondaryDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonTextSecondaryDisabledInt'); }); } QueryBuilder - distinctByButtonTextSecondaryInt() { + distinctByButtonTextSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'buttonTextSecondaryInt'); }); } QueryBuilder - distinctByCheckboxBGCheckedInt() { + distinctByCheckboxBGCheckedInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'checkboxBGCheckedInt'); }); } QueryBuilder - distinctByCheckboxBGDisabledInt() { + distinctByCheckboxBGDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'checkboxBGDisabledInt'); }); } QueryBuilder - distinctByCheckboxBorderEmptyInt() { + distinctByCheckboxBorderEmptyInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'checkboxBorderEmptyInt'); }); } QueryBuilder - distinctByCheckboxIconCheckedInt() { + distinctByCheckboxIconCheckedInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'checkboxIconCheckedInt'); }); } QueryBuilder - distinctByCheckboxIconDisabledInt() { + distinctByCheckboxIconDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'checkboxIconDisabledInt'); }); } QueryBuilder - distinctByCheckboxTextLabelInt() { + distinctByCheckboxTextLabelInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'checkboxTextLabelInt'); }); } QueryBuilder - distinctByCoinColorsJsonString({bool caseSensitive = true}) { + distinctByCoinColorsJsonString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'coinColorsJsonString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'coinColorsJsonString', + caseSensitive: caseSensitive, + ); }); } QueryBuilder - distinctByCurrencyListItemBGInt() { + distinctByCurrencyListItemBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'currencyListItemBGInt'); }); } QueryBuilder - distinctByCustomTextButtonDisabledTextInt() { + distinctByCustomTextButtonDisabledTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'customTextButtonDisabledTextInt'); }); } QueryBuilder - distinctByCustomTextButtonEnabledTextInt() { + distinctByCustomTextButtonEnabledTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'customTextButtonEnabledTextInt'); }); @@ -16119,38 +16468,40 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByEthWalletTagBGInt() { + distinctByEthWalletTagBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'ethWalletTagBGInt'); }); } QueryBuilder - distinctByEthWalletTagTextInt() { + distinctByEthWalletTagTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'ethWalletTagTextInt'); }); } QueryBuilder - distinctByFavoriteStarActiveInt() { + distinctByFavoriteStarActiveInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'favoriteStarActiveInt'); }); } QueryBuilder - distinctByFavoriteStarInactiveInt() { + distinctByFavoriteStarInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'favoriteStarInactiveInt'); }); } QueryBuilder - distinctByGradientBackgroundString({bool caseSensitive = true}) { + distinctByGradientBackgroundString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'gradientBackgroundString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'gradientBackgroundString', + caseSensitive: caseSensitive, + ); }); } @@ -16161,10 +16512,12 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByHomeViewButtonBarBoxShadowString({bool caseSensitive = true}) { + distinctByHomeViewButtonBarBoxShadowString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'homeViewButtonBarBoxShadowString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'homeViewButtonBarBoxShadowString', + caseSensitive: caseSensitive, + ); }); } @@ -16193,49 +16546,50 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByLoadingOverlayTextColorInt() { + distinctByLoadingOverlayTextColorInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'loadingOverlayTextColorInt'); }); } QueryBuilder - distinctByMyStackContactIconBGInt() { + distinctByMyStackContactIconBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'myStackContactIconBGInt'); }); } - QueryBuilder distinctByName( - {bool caseSensitive = true}) { + QueryBuilder distinctByName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'name', caseSensitive: caseSensitive); }); } QueryBuilder - distinctByNumberBackDefaultInt() { + distinctByNumberBackDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'numberBackDefaultInt'); }); } QueryBuilder - distinctByNumberTextDefaultInt() { + distinctByNumberTextDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'numberTextDefaultInt'); }); } QueryBuilder - distinctByNumpadBackDefaultInt() { + distinctByNumpadBackDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'numpadBackDefaultInt'); }); } QueryBuilder - distinctByNumpadTextDefaultInt() { + distinctByNumpadTextDefaultInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'numpadTextDefaultInt'); }); @@ -16254,147 +16608,147 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByRadioButtonBorderDisabledInt() { + distinctByRadioButtonBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonBorderDisabledInt'); }); } QueryBuilder - distinctByRadioButtonBorderEnabledInt() { + distinctByRadioButtonBorderEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonBorderEnabledInt'); }); } QueryBuilder - distinctByRadioButtonIconBorderDisabledInt() { + distinctByRadioButtonIconBorderDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonIconBorderDisabledInt'); }); } QueryBuilder - distinctByRadioButtonIconBorderInt() { + distinctByRadioButtonIconBorderInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonIconBorderInt'); }); } QueryBuilder - distinctByRadioButtonIconCircleInt() { + distinctByRadioButtonIconCircleInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonIconCircleInt'); }); } QueryBuilder - distinctByRadioButtonIconEnabledInt() { + distinctByRadioButtonIconEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonIconEnabledInt'); }); } QueryBuilder - distinctByRadioButtonLabelDisabledInt() { + distinctByRadioButtonLabelDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonLabelDisabledInt'); }); } QueryBuilder - distinctByRadioButtonLabelEnabledInt() { + distinctByRadioButtonLabelEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonLabelEnabledInt'); }); } QueryBuilder - distinctByRadioButtonTextDisabledInt() { + distinctByRadioButtonTextDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonTextDisabledInt'); }); } QueryBuilder - distinctByRadioButtonTextEnabledInt() { + distinctByRadioButtonTextEnabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'radioButtonTextEnabledInt'); }); } QueryBuilder - distinctByRateTypeToggleColorOffInt() { + distinctByRateTypeToggleColorOffInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'rateTypeToggleColorOffInt'); }); } QueryBuilder - distinctByRateTypeToggleColorOnInt() { + distinctByRateTypeToggleColorOnInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'rateTypeToggleColorOnInt'); }); } QueryBuilder - distinctByRateTypeToggleDesktopColorOffInt() { + distinctByRateTypeToggleDesktopColorOffInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'rateTypeToggleDesktopColorOffInt'); }); } QueryBuilder - distinctByRateTypeToggleDesktopColorOnInt() { + distinctByRateTypeToggleDesktopColorOnInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'rateTypeToggleDesktopColorOnInt'); }); } QueryBuilder - distinctBySettingsIconBack2Int() { + distinctBySettingsIconBack2Int() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'settingsIconBack2Int'); }); } QueryBuilder - distinctBySettingsIconBackInt() { + distinctBySettingsIconBackInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'settingsIconBackInt'); }); } QueryBuilder - distinctBySettingsIconElementInt() { + distinctBySettingsIconElementInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'settingsIconElementInt'); }); } QueryBuilder - distinctBySettingsIconIconInt() { + distinctBySettingsIconIconInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'settingsIconIconInt'); }); } QueryBuilder - distinctBySettingsItem2ActiveBGInt() { + distinctBySettingsItem2ActiveBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'settingsItem2ActiveBGInt'); }); } QueryBuilder - distinctBySettingsItem2ActiveSubInt() { + distinctBySettingsItem2ActiveSubInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'settingsItem2ActiveSubInt'); }); } QueryBuilder - distinctBySettingsItem2ActiveTextInt() { + distinctBySettingsItem2ActiveTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'settingsItem2ActiveTextInt'); }); @@ -16407,42 +16761,42 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctBySnackBarBackErrorInt() { + distinctBySnackBarBackErrorInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'snackBarBackErrorInt'); }); } QueryBuilder - distinctBySnackBarBackInfoInt() { + distinctBySnackBarBackInfoInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'snackBarBackInfoInt'); }); } QueryBuilder - distinctBySnackBarBackSuccessInt() { + distinctBySnackBarBackSuccessInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'snackBarBackSuccessInt'); }); } QueryBuilder - distinctBySnackBarTextErrorInt() { + distinctBySnackBarTextErrorInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'snackBarTextErrorInt'); }); } QueryBuilder - distinctBySnackBarTextInfoInt() { + distinctBySnackBarTextInfoInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'snackBarTextInfoInt'); }); } QueryBuilder - distinctBySnackBarTextSuccessInt() { + distinctBySnackBarTextSuccessInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'snackBarTextSuccessInt'); }); @@ -16461,85 +16815,87 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByStackWalletBottomInt() { + distinctByStackWalletBottomInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stackWalletBottomInt'); }); } QueryBuilder - distinctByStackWalletMidInt() { + distinctByStackWalletMidInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stackWalletMidInt'); }); } QueryBuilder - distinctByStandardBoxShadowString({bool caseSensitive = true}) { + distinctByStandardBoxShadowString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'standardBoxShadowString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'standardBoxShadowString', + caseSensitive: caseSensitive, + ); }); } QueryBuilder - distinctByStepIndicatorBGCheckInt() { + distinctByStepIndicatorBGCheckInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stepIndicatorBGCheckInt'); }); } QueryBuilder - distinctByStepIndicatorBGInactiveInt() { + distinctByStepIndicatorBGInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stepIndicatorBGInactiveInt'); }); } QueryBuilder - distinctByStepIndicatorBGLinesInactiveInt() { + distinctByStepIndicatorBGLinesInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stepIndicatorBGLinesInactiveInt'); }); } QueryBuilder - distinctByStepIndicatorBGLinesInt() { + distinctByStepIndicatorBGLinesInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stepIndicatorBGLinesInt'); }); } QueryBuilder - distinctByStepIndicatorBGNumberInt() { + distinctByStepIndicatorBGNumberInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stepIndicatorBGNumberInt'); }); } QueryBuilder - distinctByStepIndicatorIconInactiveInt() { + distinctByStepIndicatorIconInactiveInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stepIndicatorIconInactiveInt'); }); } QueryBuilder - distinctByStepIndicatorIconNumberInt() { + distinctByStepIndicatorIconNumberInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stepIndicatorIconNumberInt'); }); } QueryBuilder - distinctByStepIndicatorIconTextInt() { + distinctByStepIndicatorIconTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'stepIndicatorIconTextInt'); }); } QueryBuilder - distinctBySwitchBGDisabledInt() { + distinctBySwitchBGDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'switchBGDisabledInt'); }); @@ -16558,28 +16914,28 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctBySwitchCircleDisabledInt() { + distinctBySwitchCircleDisabledInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'switchCircleDisabledInt'); }); } QueryBuilder - distinctBySwitchCircleOffInt() { + distinctBySwitchCircleOffInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'switchCircleOffInt'); }); } QueryBuilder - distinctBySwitchCircleOnInt() { + distinctBySwitchCircleOnInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'switchCircleOnInt'); }); } QueryBuilder - distinctByTextConfirmTotalAmountInt() { + distinctByTextConfirmTotalAmountInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textConfirmTotalAmountInt'); }); @@ -16610,154 +16966,154 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByTextFavoriteCardInt() { + distinctByTextFavoriteCardInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFavoriteCardInt'); }); } QueryBuilder - distinctByTextFieldActiveBGInt() { + distinctByTextFieldActiveBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldActiveBGInt'); }); } QueryBuilder - distinctByTextFieldActiveLabelInt() { + distinctByTextFieldActiveLabelInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldActiveLabelInt'); }); } QueryBuilder - distinctByTextFieldActiveSearchIconLeftInt() { + distinctByTextFieldActiveSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldActiveSearchIconLeftInt'); }); } QueryBuilder - distinctByTextFieldActiveSearchIconRightInt() { + distinctByTextFieldActiveSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldActiveSearchIconRightInt'); }); } QueryBuilder - distinctByTextFieldActiveTextInt() { + distinctByTextFieldActiveTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldActiveTextInt'); }); } QueryBuilder - distinctByTextFieldDefaultBGInt() { + distinctByTextFieldDefaultBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldDefaultBGInt'); }); } QueryBuilder - distinctByTextFieldDefaultSearchIconLeftInt() { + distinctByTextFieldDefaultSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldDefaultSearchIconLeftInt'); }); } QueryBuilder - distinctByTextFieldDefaultSearchIconRightInt() { + distinctByTextFieldDefaultSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldDefaultSearchIconRightInt'); }); } QueryBuilder - distinctByTextFieldDefaultTextInt() { + distinctByTextFieldDefaultTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldDefaultTextInt'); }); } QueryBuilder - distinctByTextFieldErrorBGInt() { + distinctByTextFieldErrorBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldErrorBGInt'); }); } QueryBuilder - distinctByTextFieldErrorBorderInt() { + distinctByTextFieldErrorBorderInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldErrorBorderInt'); }); } QueryBuilder - distinctByTextFieldErrorLabelInt() { + distinctByTextFieldErrorLabelInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldErrorLabelInt'); }); } QueryBuilder - distinctByTextFieldErrorSearchIconLeftInt() { + distinctByTextFieldErrorSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldErrorSearchIconLeftInt'); }); } QueryBuilder - distinctByTextFieldErrorSearchIconRightInt() { + distinctByTextFieldErrorSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldErrorSearchIconRightInt'); }); } QueryBuilder - distinctByTextFieldErrorTextInt() { + distinctByTextFieldErrorTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldErrorTextInt'); }); } QueryBuilder - distinctByTextFieldSuccessBGInt() { + distinctByTextFieldSuccessBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldSuccessBGInt'); }); } QueryBuilder - distinctByTextFieldSuccessBorderInt() { + distinctByTextFieldSuccessBorderInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldSuccessBorderInt'); }); } QueryBuilder - distinctByTextFieldSuccessLabelInt() { + distinctByTextFieldSuccessLabelInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldSuccessLabelInt'); }); } QueryBuilder - distinctByTextFieldSuccessSearchIconLeftInt() { + distinctByTextFieldSuccessSearchIconLeftInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldSuccessSearchIconLeftInt'); }); } QueryBuilder - distinctByTextFieldSuccessSearchIconRightInt() { + distinctByTextFieldSuccessSearchIconRightInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldSuccessSearchIconRightInt'); }); } QueryBuilder - distinctByTextFieldSuccessTextInt() { + distinctByTextFieldSuccessTextInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textFieldSuccessTextInt'); }); @@ -16770,7 +17126,7 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByTextSelectedWordTableItemInt() { + distinctByTextSelectedWordTableItemInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'textSelectedWordTableItemInt'); }); @@ -16818,57 +17174,58 @@ extension StackThemeQueryWhereDistinct }); } - QueryBuilder distinctByThemeId( - {bool caseSensitive = true}) { + QueryBuilder distinctByThemeId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'themeId', caseSensitive: caseSensitive); }); } QueryBuilder - distinctByTokenSummaryBGInt() { + distinctByTokenSummaryBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'tokenSummaryBGInt'); }); } QueryBuilder - distinctByTokenSummaryButtonBGInt() { + distinctByTokenSummaryButtonBGInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'tokenSummaryButtonBGInt'); }); } QueryBuilder - distinctByTokenSummaryIconInt() { + distinctByTokenSummaryIconInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'tokenSummaryIconInt'); }); } QueryBuilder - distinctByTokenSummaryTextPrimaryInt() { + distinctByTokenSummaryTextPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'tokenSummaryTextPrimaryInt'); }); } QueryBuilder - distinctByTokenSummaryTextSecondaryInt() { + distinctByTokenSummaryTextSecondaryInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'tokenSummaryTextSecondaryInt'); }); } QueryBuilder - distinctByTopNavIconGreenInt() { + distinctByTopNavIconGreenInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'topNavIconGreenInt'); }); } QueryBuilder - distinctByTopNavIconPrimaryInt() { + distinctByTopNavIconPrimaryInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'topNavIconPrimaryInt'); }); @@ -16881,7 +17238,7 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByTopNavIconYellowInt() { + distinctByTopNavIconYellowInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'topNavIconYellowInt'); }); @@ -16894,14 +17251,14 @@ extension StackThemeQueryWhereDistinct } QueryBuilder - distinctByWarningBackgroundInt() { + distinctByWarningBackgroundInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'warningBackgroundInt'); }); } QueryBuilder - distinctByWarningForegroundInt() { + distinctByWarningForegroundInt() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'warningForegroundInt'); }); @@ -16929,14 +17286,14 @@ extension StackThemeQueryProperty } QueryBuilder - accentColorGreenIntProperty() { + accentColorGreenIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'accentColorGreenInt'); }); } QueryBuilder - accentColorOrangeIntProperty() { + accentColorOrangeIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'accentColorOrangeInt'); }); @@ -16949,7 +17306,7 @@ extension StackThemeQueryProperty } QueryBuilder - accentColorYellowIntProperty() { + accentColorYellowIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'accentColorYellowInt'); }); @@ -16962,14 +17319,14 @@ extension StackThemeQueryProperty } QueryBuilder - assetsV2Property() { + assetsV2Property() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'assetsV2'); }); } QueryBuilder - backgroundAppBarIntProperty() { + backgroundAppBarIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'backgroundAppBarInt'); }); @@ -16988,21 +17345,21 @@ extension StackThemeQueryProperty } QueryBuilder - bottomNavIconBackIntProperty() { + bottomNavIconBackIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'bottomNavIconBackInt'); }); } QueryBuilder - bottomNavIconIconHighlightedIntProperty() { + bottomNavIconIconHighlightedIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'bottomNavIconIconHighlightedInt'); }); } QueryBuilder - bottomNavIconIconIntProperty() { + bottomNavIconIconIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'bottomNavIconIconInt'); }); @@ -17021,189 +17378,189 @@ extension StackThemeQueryProperty } QueryBuilder - brightnessStringProperty() { + brightnessStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'brightnessString'); }); } QueryBuilder - buttonBackBorderDisabledIntProperty() { + buttonBackBorderDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonBackBorderDisabledInt'); }); } QueryBuilder - buttonBackBorderIntProperty() { + buttonBackBorderIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonBackBorderInt'); }); } QueryBuilder - buttonBackBorderSecondaryDisabledIntProperty() { + buttonBackBorderSecondaryDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonBackBorderSecondaryDisabledInt'); }); } QueryBuilder - buttonBackBorderSecondaryIntProperty() { + buttonBackBorderSecondaryIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonBackBorderSecondaryInt'); }); } QueryBuilder - buttonBackPrimaryDisabledIntProperty() { + buttonBackPrimaryDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonBackPrimaryDisabledInt'); }); } QueryBuilder - buttonBackPrimaryIntProperty() { + buttonBackPrimaryIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonBackPrimaryInt'); }); } QueryBuilder - buttonBackSecondaryDisabledIntProperty() { + buttonBackSecondaryDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonBackSecondaryDisabledInt'); }); } QueryBuilder - buttonBackSecondaryIntProperty() { + buttonBackSecondaryIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonBackSecondaryInt'); }); } QueryBuilder - buttonTextBorderIntProperty() { + buttonTextBorderIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonTextBorderInt'); }); } QueryBuilder - buttonTextBorderlessDisabledIntProperty() { + buttonTextBorderlessDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonTextBorderlessDisabledInt'); }); } QueryBuilder - buttonTextBorderlessIntProperty() { + buttonTextBorderlessIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonTextBorderlessInt'); }); } QueryBuilder - buttonTextDisabledIntProperty() { + buttonTextDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonTextDisabledInt'); }); } QueryBuilder - buttonTextPrimaryDisabledIntProperty() { + buttonTextPrimaryDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonTextPrimaryDisabledInt'); }); } QueryBuilder - buttonTextPrimaryIntProperty() { + buttonTextPrimaryIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonTextPrimaryInt'); }); } QueryBuilder - buttonTextSecondaryDisabledIntProperty() { + buttonTextSecondaryDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonTextSecondaryDisabledInt'); }); } QueryBuilder - buttonTextSecondaryIntProperty() { + buttonTextSecondaryIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'buttonTextSecondaryInt'); }); } QueryBuilder - checkboxBGCheckedIntProperty() { + checkboxBGCheckedIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'checkboxBGCheckedInt'); }); } QueryBuilder - checkboxBGDisabledIntProperty() { + checkboxBGDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'checkboxBGDisabledInt'); }); } QueryBuilder - checkboxBorderEmptyIntProperty() { + checkboxBorderEmptyIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'checkboxBorderEmptyInt'); }); } QueryBuilder - checkboxIconCheckedIntProperty() { + checkboxIconCheckedIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'checkboxIconCheckedInt'); }); } QueryBuilder - checkboxIconDisabledIntProperty() { + checkboxIconDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'checkboxIconDisabledInt'); }); } QueryBuilder - checkboxTextLabelIntProperty() { + checkboxTextLabelIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'checkboxTextLabelInt'); }); } QueryBuilder - coinColorsJsonStringProperty() { + coinColorsJsonStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'coinColorsJsonString'); }); } QueryBuilder - currencyListItemBGIntProperty() { + currencyListItemBGIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'currencyListItemBGInt'); }); } QueryBuilder - customTextButtonDisabledTextIntProperty() { + customTextButtonDisabledTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'customTextButtonDisabledTextInt'); }); } QueryBuilder - customTextButtonEnabledTextIntProperty() { + customTextButtonEnabledTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'customTextButtonEnabledTextInt'); }); @@ -17228,28 +17585,28 @@ extension StackThemeQueryProperty } QueryBuilder - ethWalletTagTextIntProperty() { + ethWalletTagTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'ethWalletTagTextInt'); }); } QueryBuilder - favoriteStarActiveIntProperty() { + favoriteStarActiveIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'favoriteStarActiveInt'); }); } QueryBuilder - favoriteStarInactiveIntProperty() { + favoriteStarInactiveIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'favoriteStarInactiveInt'); }); } QueryBuilder - gradientBackgroundStringProperty() { + gradientBackgroundStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'gradientBackgroundString'); }); @@ -17262,7 +17619,7 @@ extension StackThemeQueryProperty } QueryBuilder - homeViewButtonBarBoxShadowStringProperty() { + homeViewButtonBarBoxShadowStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'homeViewButtonBarBoxShadowString'); }); @@ -17293,14 +17650,14 @@ extension StackThemeQueryProperty } QueryBuilder - loadingOverlayTextColorIntProperty() { + loadingOverlayTextColorIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'loadingOverlayTextColorInt'); }); } QueryBuilder - myStackContactIconBGIntProperty() { + myStackContactIconBGIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'myStackContactIconBGInt'); }); @@ -17313,28 +17670,28 @@ extension StackThemeQueryProperty } QueryBuilder - numberBackDefaultIntProperty() { + numberBackDefaultIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'numberBackDefaultInt'); }); } QueryBuilder - numberTextDefaultIntProperty() { + numberTextDefaultIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'numberTextDefaultInt'); }); } QueryBuilder - numpadBackDefaultIntProperty() { + numpadBackDefaultIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'numpadBackDefaultInt'); }); } QueryBuilder - numpadTextDefaultIntProperty() { + numpadTextDefaultIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'numpadTextDefaultInt'); }); @@ -17353,147 +17710,147 @@ extension StackThemeQueryProperty } QueryBuilder - radioButtonBorderDisabledIntProperty() { + radioButtonBorderDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonBorderDisabledInt'); }); } QueryBuilder - radioButtonBorderEnabledIntProperty() { + radioButtonBorderEnabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonBorderEnabledInt'); }); } QueryBuilder - radioButtonIconBorderDisabledIntProperty() { + radioButtonIconBorderDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonIconBorderDisabledInt'); }); } QueryBuilder - radioButtonIconBorderIntProperty() { + radioButtonIconBorderIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonIconBorderInt'); }); } QueryBuilder - radioButtonIconCircleIntProperty() { + radioButtonIconCircleIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonIconCircleInt'); }); } QueryBuilder - radioButtonIconEnabledIntProperty() { + radioButtonIconEnabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonIconEnabledInt'); }); } QueryBuilder - radioButtonLabelDisabledIntProperty() { + radioButtonLabelDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonLabelDisabledInt'); }); } QueryBuilder - radioButtonLabelEnabledIntProperty() { + radioButtonLabelEnabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonLabelEnabledInt'); }); } QueryBuilder - radioButtonTextDisabledIntProperty() { + radioButtonTextDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonTextDisabledInt'); }); } QueryBuilder - radioButtonTextEnabledIntProperty() { + radioButtonTextEnabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'radioButtonTextEnabledInt'); }); } QueryBuilder - rateTypeToggleColorOffIntProperty() { + rateTypeToggleColorOffIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'rateTypeToggleColorOffInt'); }); } QueryBuilder - rateTypeToggleColorOnIntProperty() { + rateTypeToggleColorOnIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'rateTypeToggleColorOnInt'); }); } QueryBuilder - rateTypeToggleDesktopColorOffIntProperty() { + rateTypeToggleDesktopColorOffIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'rateTypeToggleDesktopColorOffInt'); }); } QueryBuilder - rateTypeToggleDesktopColorOnIntProperty() { + rateTypeToggleDesktopColorOnIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'rateTypeToggleDesktopColorOnInt'); }); } QueryBuilder - settingsIconBack2IntProperty() { + settingsIconBack2IntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'settingsIconBack2Int'); }); } QueryBuilder - settingsIconBackIntProperty() { + settingsIconBackIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'settingsIconBackInt'); }); } QueryBuilder - settingsIconElementIntProperty() { + settingsIconElementIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'settingsIconElementInt'); }); } QueryBuilder - settingsIconIconIntProperty() { + settingsIconIconIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'settingsIconIconInt'); }); } QueryBuilder - settingsItem2ActiveBGIntProperty() { + settingsItem2ActiveBGIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'settingsItem2ActiveBGInt'); }); } QueryBuilder - settingsItem2ActiveSubIntProperty() { + settingsItem2ActiveSubIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'settingsItem2ActiveSubInt'); }); } QueryBuilder - settingsItem2ActiveTextIntProperty() { + settingsItem2ActiveTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'settingsItem2ActiveTextInt'); }); @@ -17506,42 +17863,42 @@ extension StackThemeQueryProperty } QueryBuilder - snackBarBackErrorIntProperty() { + snackBarBackErrorIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'snackBarBackErrorInt'); }); } QueryBuilder - snackBarBackInfoIntProperty() { + snackBarBackInfoIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'snackBarBackInfoInt'); }); } QueryBuilder - snackBarBackSuccessIntProperty() { + snackBarBackSuccessIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'snackBarBackSuccessInt'); }); } QueryBuilder - snackBarTextErrorIntProperty() { + snackBarTextErrorIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'snackBarTextErrorInt'); }); } QueryBuilder - snackBarTextInfoIntProperty() { + snackBarTextInfoIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'snackBarTextInfoInt'); }); } QueryBuilder - snackBarTextSuccessIntProperty() { + snackBarTextSuccessIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'snackBarTextSuccessInt'); }); @@ -17560,7 +17917,7 @@ extension StackThemeQueryProperty } QueryBuilder - stackWalletBottomIntProperty() { + stackWalletBottomIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stackWalletBottomInt'); }); @@ -17573,70 +17930,70 @@ extension StackThemeQueryProperty } QueryBuilder - standardBoxShadowStringProperty() { + standardBoxShadowStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'standardBoxShadowString'); }); } QueryBuilder - stepIndicatorBGCheckIntProperty() { + stepIndicatorBGCheckIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stepIndicatorBGCheckInt'); }); } QueryBuilder - stepIndicatorBGInactiveIntProperty() { + stepIndicatorBGInactiveIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stepIndicatorBGInactiveInt'); }); } QueryBuilder - stepIndicatorBGLinesInactiveIntProperty() { + stepIndicatorBGLinesInactiveIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stepIndicatorBGLinesInactiveInt'); }); } QueryBuilder - stepIndicatorBGLinesIntProperty() { + stepIndicatorBGLinesIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stepIndicatorBGLinesInt'); }); } QueryBuilder - stepIndicatorBGNumberIntProperty() { + stepIndicatorBGNumberIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stepIndicatorBGNumberInt'); }); } QueryBuilder - stepIndicatorIconInactiveIntProperty() { + stepIndicatorIconInactiveIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stepIndicatorIconInactiveInt'); }); } QueryBuilder - stepIndicatorIconNumberIntProperty() { + stepIndicatorIconNumberIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stepIndicatorIconNumberInt'); }); } QueryBuilder - stepIndicatorIconTextIntProperty() { + stepIndicatorIconTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'stepIndicatorIconTextInt'); }); } QueryBuilder - switchBGDisabledIntProperty() { + switchBGDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'switchBGDisabledInt'); }); @@ -17655,7 +18012,7 @@ extension StackThemeQueryProperty } QueryBuilder - switchCircleDisabledIntProperty() { + switchCircleDisabledIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'switchCircleDisabledInt'); }); @@ -17674,7 +18031,7 @@ extension StackThemeQueryProperty } QueryBuilder - textConfirmTotalAmountIntProperty() { + textConfirmTotalAmountIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textConfirmTotalAmountInt'); }); @@ -17705,154 +18062,154 @@ extension StackThemeQueryProperty } QueryBuilder - textFavoriteCardIntProperty() { + textFavoriteCardIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFavoriteCardInt'); }); } QueryBuilder - textFieldActiveBGIntProperty() { + textFieldActiveBGIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldActiveBGInt'); }); } QueryBuilder - textFieldActiveLabelIntProperty() { + textFieldActiveLabelIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldActiveLabelInt'); }); } QueryBuilder - textFieldActiveSearchIconLeftIntProperty() { + textFieldActiveSearchIconLeftIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldActiveSearchIconLeftInt'); }); } QueryBuilder - textFieldActiveSearchIconRightIntProperty() { + textFieldActiveSearchIconRightIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldActiveSearchIconRightInt'); }); } QueryBuilder - textFieldActiveTextIntProperty() { + textFieldActiveTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldActiveTextInt'); }); } QueryBuilder - textFieldDefaultBGIntProperty() { + textFieldDefaultBGIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldDefaultBGInt'); }); } QueryBuilder - textFieldDefaultSearchIconLeftIntProperty() { + textFieldDefaultSearchIconLeftIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldDefaultSearchIconLeftInt'); }); } QueryBuilder - textFieldDefaultSearchIconRightIntProperty() { + textFieldDefaultSearchIconRightIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldDefaultSearchIconRightInt'); }); } QueryBuilder - textFieldDefaultTextIntProperty() { + textFieldDefaultTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldDefaultTextInt'); }); } QueryBuilder - textFieldErrorBGIntProperty() { + textFieldErrorBGIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldErrorBGInt'); }); } QueryBuilder - textFieldErrorBorderIntProperty() { + textFieldErrorBorderIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldErrorBorderInt'); }); } QueryBuilder - textFieldErrorLabelIntProperty() { + textFieldErrorLabelIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldErrorLabelInt'); }); } QueryBuilder - textFieldErrorSearchIconLeftIntProperty() { + textFieldErrorSearchIconLeftIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldErrorSearchIconLeftInt'); }); } QueryBuilder - textFieldErrorSearchIconRightIntProperty() { + textFieldErrorSearchIconRightIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldErrorSearchIconRightInt'); }); } QueryBuilder - textFieldErrorTextIntProperty() { + textFieldErrorTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldErrorTextInt'); }); } QueryBuilder - textFieldSuccessBGIntProperty() { + textFieldSuccessBGIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldSuccessBGInt'); }); } QueryBuilder - textFieldSuccessBorderIntProperty() { + textFieldSuccessBorderIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldSuccessBorderInt'); }); } QueryBuilder - textFieldSuccessLabelIntProperty() { + textFieldSuccessLabelIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldSuccessLabelInt'); }); } QueryBuilder - textFieldSuccessSearchIconLeftIntProperty() { + textFieldSuccessSearchIconLeftIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldSuccessSearchIconLeftInt'); }); } QueryBuilder - textFieldSuccessSearchIconRightIntProperty() { + textFieldSuccessSearchIconRightIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldSuccessSearchIconRightInt'); }); } QueryBuilder - textFieldSuccessTextIntProperty() { + textFieldSuccessTextIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textFieldSuccessTextInt'); }); @@ -17865,7 +18222,7 @@ extension StackThemeQueryProperty } QueryBuilder - textSelectedWordTableItemIntProperty() { + textSelectedWordTableItemIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'textSelectedWordTableItemInt'); }); @@ -17926,28 +18283,28 @@ extension StackThemeQueryProperty } QueryBuilder - tokenSummaryButtonBGIntProperty() { + tokenSummaryButtonBGIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'tokenSummaryButtonBGInt'); }); } QueryBuilder - tokenSummaryIconIntProperty() { + tokenSummaryIconIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'tokenSummaryIconInt'); }); } QueryBuilder - tokenSummaryTextPrimaryIntProperty() { + tokenSummaryTextPrimaryIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'tokenSummaryTextPrimaryInt'); }); } QueryBuilder - tokenSummaryTextSecondaryIntProperty() { + tokenSummaryTextSecondaryIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'tokenSummaryTextSecondaryInt'); }); @@ -17960,7 +18317,7 @@ extension StackThemeQueryProperty } QueryBuilder - topNavIconPrimaryIntProperty() { + topNavIconPrimaryIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'topNavIconPrimaryInt'); }); @@ -17973,7 +18330,7 @@ extension StackThemeQueryProperty } QueryBuilder - topNavIconYellowIntProperty() { + topNavIconYellowIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'topNavIconYellowInt'); }); @@ -17986,21 +18343,21 @@ extension StackThemeQueryProperty } QueryBuilder - warningBackgroundIntProperty() { + warningBackgroundIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'warningBackgroundInt'); }); } QueryBuilder - warningForegroundIntProperty() { + warningForegroundIntProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'warningForegroundInt'); }); } QueryBuilder - assetsV3Property() { + assetsV3Property() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'zAssetsV3'); }); @@ -18023,16 +18380,8 @@ const ThemeAssetsSchema = Schema( name: r'background', type: IsarType.string, ), - r'bellNew': PropertySchema( - id: 1, - name: r'bellNew', - type: IsarType.string, - ), - r'bitcoin': PropertySchema( - id: 2, - name: r'bitcoin', - type: IsarType.string, - ), + r'bellNew': PropertySchema(id: 1, name: r'bellNew', type: IsarType.string), + r'bitcoin': PropertySchema(id: 2, name: r'bitcoin', type: IsarType.string), r'bitcoinImage': PropertySchema( id: 3, name: r'bitcoinImage', @@ -18058,11 +18407,7 @@ const ThemeAssetsSchema = Schema( name: r'bitcoincashImageSecondary', type: IsarType.string, ), - r'buy': PropertySchema( - id: 8, - name: r'buy', - type: IsarType.string, - ), + r'buy': PropertySchema(id: 8, name: r'buy', type: IsarType.string), r'dogecoin': PropertySchema( id: 9, name: r'dogecoin', @@ -18113,11 +18458,7 @@ const ThemeAssetsSchema = Schema( name: r'exchange', type: IsarType.string, ), - r'firo': PropertySchema( - id: 19, - name: r'firo', - type: IsarType.string, - ), + r'firo': PropertySchema(id: 19, name: r'firo', type: IsarType.string), r'firoImage': PropertySchema( id: 20, name: r'firoImage', @@ -18148,142 +18489,124 @@ const ThemeAssetsSchema = Schema( name: r'loadingGif', type: IsarType.string, ), - r'monero': PropertySchema( + r'mimblewimblecoin': PropertySchema( id: 26, - name: r'monero', + name: r'mimblewimblecoin', type: IsarType.string, ), + r'monero': PropertySchema(id: 27, name: r'monero', type: IsarType.string), r'moneroImage': PropertySchema( - id: 27, + id: 28, name: r'moneroImage', type: IsarType.string, ), r'moneroImageSecondary': PropertySchema( - id: 28, + id: 29, name: r'moneroImageSecondary', type: IsarType.string, ), r'namecoin': PropertySchema( - id: 29, + id: 30, name: r'namecoin', type: IsarType.string, ), r'namecoinImage': PropertySchema( - id: 30, + id: 31, name: r'namecoinImage', type: IsarType.string, ), r'namecoinImageSecondary': PropertySchema( - id: 31, - name: r'namecoinImageSecondary', - type: IsarType.string, - ), - r'particl': PropertySchema( id: 32, - name: r'particl', + name: r'namecoinImageSecondary', type: IsarType.string, ), + r'particl': PropertySchema(id: 33, name: r'particl', type: IsarType.string), r'particlImage': PropertySchema( - id: 33, + id: 34, name: r'particlImage', type: IsarType.string, ), r'particlImageSecondary': PropertySchema( - id: 34, + id: 35, name: r'particlImageSecondary', type: IsarType.string, ), r'personaEasy': PropertySchema( - id: 35, + id: 36, name: r'personaEasy', type: IsarType.string, ), r'personaIncognito': PropertySchema( - id: 36, - name: r'personaIncognito', - type: IsarType.string, - ), - r'receive': PropertySchema( id: 37, - name: r'receive', + name: r'personaIncognito', type: IsarType.string, ), + r'receive': PropertySchema(id: 38, name: r'receive', type: IsarType.string), r'receiveCancelled': PropertySchema( - id: 38, + id: 39, name: r'receiveCancelled', type: IsarType.string, ), r'receivePending': PropertySchema( - id: 39, - name: r'receivePending', - type: IsarType.string, - ), - r'send': PropertySchema( id: 40, - name: r'send', + name: r'receivePending', type: IsarType.string, ), + r'send': PropertySchema(id: 41, name: r'send', type: IsarType.string), r'sendCancelled': PropertySchema( - id: 41, + id: 42, name: r'sendCancelled', type: IsarType.string, ), r'sendPending': PropertySchema( - id: 42, - name: r'sendPending', - type: IsarType.string, - ), - r'stack': PropertySchema( id: 43, - name: r'stack', + name: r'sendPending', type: IsarType.string, ), + r'stack': PropertySchema(id: 44, name: r'stack', type: IsarType.string), r'stackIcon': PropertySchema( - id: 44, + id: 45, name: r'stackIcon', type: IsarType.string, ), r'themePreview': PropertySchema( - id: 45, + id: 46, name: r'themePreview', type: IsarType.string, ), r'themeSelector': PropertySchema( - id: 46, + id: 47, name: r'themeSelector', type: IsarType.string, ), r'txExchange': PropertySchema( - id: 47, + id: 48, name: r'txExchange', type: IsarType.string, ), r'txExchangeFailed': PropertySchema( - id: 48, + id: 49, name: r'txExchangeFailed', type: IsarType.string, ), r'txExchangePending': PropertySchema( - id: 49, - name: r'txExchangePending', - type: IsarType.string, - ), - r'wownero': PropertySchema( id: 50, - name: r'wownero', + name: r'txExchangePending', type: IsarType.string, ), + r'wownero': PropertySchema(id: 51, name: r'wownero', type: IsarType.string), r'wowneroImage': PropertySchema( - id: 51, + id: 52, name: r'wowneroImage', type: IsarType.string, ), r'wowneroImageSecondary': PropertySchema( - id: 52, + id: 53, name: r'wowneroImageSecondary', type: IsarType.string, - ) + ), }, + estimateSize: _themeAssetsEstimateSize, serialize: _themeAssetsSerialize, deserialize: _themeAssetsDeserialize, @@ -18332,6 +18655,7 @@ int _themeAssetsEstimateSize( bytesCount += 3 + value.length * 3; } } + bytesCount += 3 + object.mimblewimblecoin.length * 3; bytesCount += 3 + object.monero.length * 3; bytesCount += 3 + object.moneroImage.length * 3; bytesCount += 3 + object.moneroImageSecondary.length * 3; @@ -18394,33 +18718,34 @@ void _themeAssetsSerialize( writer.writeString(offsets[23], object.litecoinImage); writer.writeString(offsets[24], object.litecoinImageSecondary); writer.writeString(offsets[25], object.loadingGif); - writer.writeString(offsets[26], object.monero); - writer.writeString(offsets[27], object.moneroImage); - writer.writeString(offsets[28], object.moneroImageSecondary); - writer.writeString(offsets[29], object.namecoin); - writer.writeString(offsets[30], object.namecoinImage); - writer.writeString(offsets[31], object.namecoinImageSecondary); - writer.writeString(offsets[32], object.particl); - writer.writeString(offsets[33], object.particlImage); - writer.writeString(offsets[34], object.particlImageSecondary); - writer.writeString(offsets[35], object.personaEasy); - writer.writeString(offsets[36], object.personaIncognito); - writer.writeString(offsets[37], object.receive); - writer.writeString(offsets[38], object.receiveCancelled); - writer.writeString(offsets[39], object.receivePending); - writer.writeString(offsets[40], object.send); - writer.writeString(offsets[41], object.sendCancelled); - writer.writeString(offsets[42], object.sendPending); - writer.writeString(offsets[43], object.stack); - writer.writeString(offsets[44], object.stackIcon); - writer.writeString(offsets[45], object.themePreview); - writer.writeString(offsets[46], object.themeSelector); - writer.writeString(offsets[47], object.txExchange); - writer.writeString(offsets[48], object.txExchangeFailed); - writer.writeString(offsets[49], object.txExchangePending); - writer.writeString(offsets[50], object.wownero); - writer.writeString(offsets[51], object.wowneroImage); - writer.writeString(offsets[52], object.wowneroImageSecondary); + writer.writeString(offsets[26], object.mimblewimblecoin); + writer.writeString(offsets[27], object.monero); + writer.writeString(offsets[28], object.moneroImage); + writer.writeString(offsets[29], object.moneroImageSecondary); + writer.writeString(offsets[30], object.namecoin); + writer.writeString(offsets[31], object.namecoinImage); + writer.writeString(offsets[32], object.namecoinImageSecondary); + writer.writeString(offsets[33], object.particl); + writer.writeString(offsets[34], object.particlImage); + writer.writeString(offsets[35], object.particlImageSecondary); + writer.writeString(offsets[36], object.personaEasy); + writer.writeString(offsets[37], object.personaIncognito); + writer.writeString(offsets[38], object.receive); + writer.writeString(offsets[39], object.receiveCancelled); + writer.writeString(offsets[40], object.receivePending); + writer.writeString(offsets[41], object.send); + writer.writeString(offsets[42], object.sendCancelled); + writer.writeString(offsets[43], object.sendPending); + writer.writeString(offsets[44], object.stack); + writer.writeString(offsets[45], object.stackIcon); + writer.writeString(offsets[46], object.themePreview); + writer.writeString(offsets[47], object.themeSelector); + writer.writeString(offsets[48], object.txExchange); + writer.writeString(offsets[49], object.txExchangeFailed); + writer.writeString(offsets[50], object.txExchangePending); + writer.writeString(offsets[51], object.wownero); + writer.writeString(offsets[52], object.wowneroImage); + writer.writeString(offsets[53], object.wowneroImageSecondary); } ThemeAssets _themeAssetsDeserialize( @@ -18456,33 +18781,34 @@ ThemeAssets _themeAssetsDeserialize( object.litecoinImage = reader.readString(offsets[23]); object.litecoinImageSecondary = reader.readString(offsets[24]); object.loadingGif = reader.readStringOrNull(offsets[25]); - object.monero = reader.readString(offsets[26]); - object.moneroImage = reader.readString(offsets[27]); - object.moneroImageSecondary = reader.readString(offsets[28]); - object.namecoin = reader.readString(offsets[29]); - object.namecoinImage = reader.readString(offsets[30]); - object.namecoinImageSecondary = reader.readString(offsets[31]); - object.particl = reader.readString(offsets[32]); - object.particlImage = reader.readString(offsets[33]); - object.particlImageSecondary = reader.readString(offsets[34]); - object.personaEasy = reader.readString(offsets[35]); - object.personaIncognito = reader.readString(offsets[36]); - object.receive = reader.readString(offsets[37]); - object.receiveCancelled = reader.readString(offsets[38]); - object.receivePending = reader.readString(offsets[39]); - object.send = reader.readString(offsets[40]); - object.sendCancelled = reader.readString(offsets[41]); - object.sendPending = reader.readString(offsets[42]); - object.stack = reader.readString(offsets[43]); - object.stackIcon = reader.readString(offsets[44]); - object.themePreview = reader.readString(offsets[45]); - object.themeSelector = reader.readString(offsets[46]); - object.txExchange = reader.readString(offsets[47]); - object.txExchangeFailed = reader.readString(offsets[48]); - object.txExchangePending = reader.readString(offsets[49]); - object.wownero = reader.readString(offsets[50]); - object.wowneroImage = reader.readString(offsets[51]); - object.wowneroImageSecondary = reader.readString(offsets[52]); + object.mimblewimblecoin = reader.readString(offsets[26]); + object.monero = reader.readString(offsets[27]); + object.moneroImage = reader.readString(offsets[28]); + object.moneroImageSecondary = reader.readString(offsets[29]); + object.namecoin = reader.readString(offsets[30]); + object.namecoinImage = reader.readString(offsets[31]); + object.namecoinImageSecondary = reader.readString(offsets[32]); + object.particl = reader.readString(offsets[33]); + object.particlImage = reader.readString(offsets[34]); + object.particlImageSecondary = reader.readString(offsets[35]); + object.personaEasy = reader.readString(offsets[36]); + object.personaIncognito = reader.readString(offsets[37]); + object.receive = reader.readString(offsets[38]); + object.receiveCancelled = reader.readString(offsets[39]); + object.receivePending = reader.readString(offsets[40]); + object.send = reader.readString(offsets[41]); + object.sendCancelled = reader.readString(offsets[42]); + object.sendPending = reader.readString(offsets[43]); + object.stack = reader.readString(offsets[44]); + object.stackIcon = reader.readString(offsets[45]); + object.themePreview = reader.readString(offsets[46]); + object.themeSelector = reader.readString(offsets[47]); + object.txExchange = reader.readString(offsets[48]); + object.txExchangeFailed = reader.readString(offsets[49]); + object.txExchangePending = reader.readString(offsets[50]); + object.wownero = reader.readString(offsets[51]); + object.wowneroImage = reader.readString(offsets[52]); + object.wowneroImageSecondary = reader.readString(offsets[53]); return object; } @@ -18599,6 +18925,8 @@ P _themeAssetsDeserializeProp

( return (reader.readString(offset)) as P; case 52: return (reader.readString(offset)) as P; + case 53: + return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); } @@ -18607,71 +18935,74 @@ P _themeAssetsDeserializeProp

( extension ThemeAssetsQueryFilter on QueryBuilder { QueryBuilder - backgroundIsNull() { + backgroundIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'background', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'background'), + ); }); } QueryBuilder - backgroundIsNotNull() { + backgroundIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'background', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'background'), + ); }); } QueryBuilder - backgroundEqualTo( - String? value, { - bool caseSensitive = true, - }) { + backgroundEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundBetween( + backgroundBetween( String? lower, String? upper, { bool includeLower = true, @@ -18679,84 +19010,86 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + backgroundStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundEndsWith( - String value, { - bool caseSensitive = true, - }) { + backgroundEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundContains(String value, {bool caseSensitive = true}) { + backgroundContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundMatches(String pattern, {bool caseSensitive = true}) { + backgroundMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'background', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'background', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundIsEmpty() { + backgroundIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'background', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'background', value: ''), + ); }); } QueryBuilder - backgroundIsNotEmpty() { + backgroundIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'background', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'background', value: ''), + ); }); } @@ -18765,27 +19098,31 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -18795,12 +19132,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -18812,28 +19151,29 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + bellNewStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -18842,55 +19182,61 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder bellNewContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder bellNewMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'bellNew', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'bellNew', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewIsEmpty() { + bellNewIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bellNew', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bellNew', value: ''), + ); }); } QueryBuilder - bellNewIsNotEmpty() { + bellNewIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bellNew', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'bellNew', value: ''), + ); }); } @@ -18899,27 +19245,31 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bitcoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinGreaterThan( + bitcoinGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bitcoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bitcoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -18929,12 +19279,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bitcoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bitcoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -18946,28 +19298,29 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bitcoin', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bitcoin', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinStartsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoinStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'bitcoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'bitcoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -18976,106 +19329,115 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'bitcoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'bitcoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder bitcoinContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'bitcoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'bitcoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder bitcoinMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'bitcoin', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'bitcoin', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinIsEmpty() { + bitcoinIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoin', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bitcoin', value: ''), + ); }); } QueryBuilder - bitcoinIsNotEmpty() { + bitcoinIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bitcoin', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'bitcoin', value: ''), + ); }); } QueryBuilder - bitcoinImageEqualTo( - String value, { - bool caseSensitive = true, - }) { + bitcoinImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bitcoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageGreaterThan( + bitcoinImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bitcoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bitcoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageLessThan( + bitcoinImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bitcoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bitcoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageBetween( + bitcoinImageBetween( String lower, String upper, { bool includeLower = true, @@ -19083,135 +19445,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bitcoinImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bitcoinImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoinImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'bitcoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'bitcoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoinImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'bitcoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'bitcoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageContains(String value, {bool caseSensitive = true}) { + bitcoinImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'bitcoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'bitcoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageMatches(String pattern, {bool caseSensitive = true}) { + bitcoinImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'bitcoinImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'bitcoinImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageIsEmpty() { + bitcoinImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoinImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bitcoinImage', value: ''), + ); }); } QueryBuilder - bitcoinImageIsNotEmpty() { + bitcoinImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bitcoinImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'bitcoinImage', value: ''), + ); }); } QueryBuilder - bitcoinImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + bitcoinImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bitcoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageSecondaryGreaterThan( + bitcoinImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bitcoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bitcoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageSecondaryLessThan( + bitcoinImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bitcoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bitcoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageSecondaryBetween( + bitcoinImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -19219,136 +19586,143 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bitcoinImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bitcoinImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoinImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'bitcoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'bitcoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoinImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'bitcoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'bitcoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageSecondaryContains(String value, {bool caseSensitive = true}) { + bitcoinImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'bitcoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'bitcoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + bitcoinImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'bitcoinImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'bitcoinImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoinImageSecondaryIsEmpty() { + bitcoinImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoinImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bitcoinImageSecondary', value: ''), + ); }); } QueryBuilder - bitcoinImageSecondaryIsNotEmpty() { + bitcoinImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bitcoinImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'bitcoinImageSecondary', + value: '', + ), + ); }); } QueryBuilder - bitcoincashEqualTo( - String value, { - bool caseSensitive = true, - }) { + bitcoincashEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoincash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bitcoincash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashGreaterThan( + bitcoincashGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bitcoincash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bitcoincash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashLessThan( + bitcoincashLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bitcoincash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bitcoincash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashBetween( + bitcoincashBetween( String lower, String upper, { bool includeLower = true, @@ -19356,135 +19730,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bitcoincash', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bitcoincash', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashStartsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoincashStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'bitcoincash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'bitcoincash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashEndsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoincashEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'bitcoincash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'bitcoincash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashContains(String value, {bool caseSensitive = true}) { + bitcoincashContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'bitcoincash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'bitcoincash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashMatches(String pattern, {bool caseSensitive = true}) { + bitcoincashMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'bitcoincash', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'bitcoincash', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashIsEmpty() { + bitcoincashIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoincash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bitcoincash', value: ''), + ); }); } QueryBuilder - bitcoincashIsNotEmpty() { + bitcoincashIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bitcoincash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'bitcoincash', value: ''), + ); }); } QueryBuilder - bitcoincashImageEqualTo( - String value, { - bool caseSensitive = true, - }) { + bitcoincashImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoincashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bitcoincashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageGreaterThan( + bitcoincashImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bitcoincashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bitcoincashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageLessThan( + bitcoincashImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bitcoincashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bitcoincashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageBetween( + bitcoincashImageBetween( String lower, String upper, { bool includeLower = true, @@ -19492,135 +19871,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bitcoincashImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bitcoincashImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoincashImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'bitcoincashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'bitcoincashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoincashImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'bitcoincashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'bitcoincashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageContains(String value, {bool caseSensitive = true}) { + bitcoincashImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'bitcoincashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'bitcoincashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageMatches(String pattern, {bool caseSensitive = true}) { + bitcoincashImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'bitcoincashImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'bitcoincashImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageIsEmpty() { + bitcoincashImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoincashImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bitcoincashImage', value: ''), + ); }); } QueryBuilder - bitcoincashImageIsNotEmpty() { + bitcoincashImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bitcoincashImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'bitcoincashImage', value: ''), + ); }); } QueryBuilder - bitcoincashImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + bitcoincashImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoincashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bitcoincashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryGreaterThan( + bitcoincashImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'bitcoincashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bitcoincashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryLessThan( + bitcoincashImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'bitcoincashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bitcoincashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryBetween( + bitcoincashImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -19628,86 +20012,98 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'bitcoincashImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bitcoincashImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryStartsWith( + bitcoincashImageSecondaryStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'bitcoincashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'bitcoincashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + bitcoincashImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'bitcoincashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'bitcoincashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryContains(String value, - {bool caseSensitive = true}) { + bitcoincashImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'bitcoincashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'bitcoincashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + bitcoincashImageSecondaryMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'bitcoincashImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'bitcoincashImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryIsEmpty() { + bitcoincashImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bitcoincashImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bitcoincashImageSecondary', + value: '', + ), + ); }); } QueryBuilder - bitcoincashImageSecondaryIsNotEmpty() { + bitcoincashImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bitcoincashImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'bitcoincashImageSecondary', + value: '', + ), + ); }); } @@ -19716,11 +20112,13 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -19730,12 +20128,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -19745,12 +20145,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -19762,14 +20164,16 @@ extension ThemeAssetsQueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buy', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -19778,11 +20182,13 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -19791,54 +20197,60 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder buyContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder buyMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'buy', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + 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: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'buy', value: ''), + ); }); } QueryBuilder - buyIsNotEmpty() { + buyIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'buy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'buy', value: ''), + ); }); } @@ -19847,43 +20259,49 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'dogecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'dogecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinGreaterThan( + dogecoinGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'dogecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'dogecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinLessThan( + dogecoinLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'dogecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'dogecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -19895,136 +20313,142 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'dogecoin', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'dogecoin', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinStartsWith( - String value, { - bool caseSensitive = true, - }) { + dogecoinStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'dogecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'dogecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinEndsWith( - String value, { - bool caseSensitive = true, - }) { + dogecoinEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'dogecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'dogecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinContains(String value, {bool caseSensitive = true}) { + dogecoinContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'dogecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'dogecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder dogecoinMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'dogecoin', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'dogecoin', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinIsEmpty() { + dogecoinIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'dogecoin', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'dogecoin', value: ''), + ); }); } QueryBuilder - dogecoinIsNotEmpty() { + dogecoinIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'dogecoin', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'dogecoin', value: ''), + ); }); } QueryBuilder - dogecoinImageEqualTo( - String value, { - bool caseSensitive = true, - }) { + dogecoinImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'dogecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'dogecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageGreaterThan( + dogecoinImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'dogecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'dogecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageLessThan( + dogecoinImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'dogecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'dogecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageBetween( + dogecoinImageBetween( String lower, String upper, { bool includeLower = true, @@ -20032,135 +20456,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'dogecoinImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'dogecoinImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + dogecoinImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'dogecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'dogecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + dogecoinImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'dogecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'dogecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageContains(String value, {bool caseSensitive = true}) { + dogecoinImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'dogecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'dogecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageMatches(String pattern, {bool caseSensitive = true}) { + dogecoinImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'dogecoinImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'dogecoinImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageIsEmpty() { + dogecoinImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'dogecoinImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'dogecoinImage', value: ''), + ); }); } QueryBuilder - dogecoinImageIsNotEmpty() { + dogecoinImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'dogecoinImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'dogecoinImage', value: ''), + ); }); } QueryBuilder - dogecoinImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + dogecoinImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'dogecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'dogecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageSecondaryGreaterThan( + dogecoinImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'dogecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'dogecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageSecondaryLessThan( + dogecoinImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'dogecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'dogecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageSecondaryBetween( + dogecoinImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -20168,86 +20597,89 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'dogecoinImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'dogecoinImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + dogecoinImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'dogecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'dogecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + dogecoinImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'dogecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'dogecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageSecondaryContains(String value, - {bool caseSensitive = true}) { + dogecoinImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'dogecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'dogecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + dogecoinImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'dogecoinImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'dogecoinImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dogecoinImageSecondaryIsEmpty() { + dogecoinImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'dogecoinImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'dogecoinImageSecondary', value: ''), + ); }); } QueryBuilder - dogecoinImageSecondaryIsNotEmpty() { + dogecoinImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'dogecoinImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'dogecoinImageSecondary', + value: '', + ), + ); }); } @@ -20256,43 +20688,49 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'epicCash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'epicCash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashGreaterThan( + epicCashGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'epicCash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'epicCash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashLessThan( + epicCashLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'epicCash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'epicCash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -20304,136 +20742,142 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'epicCash', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'epicCash', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashStartsWith( - String value, { - bool caseSensitive = true, - }) { + epicCashStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'epicCash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'epicCash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashEndsWith( - String value, { - bool caseSensitive = true, - }) { + epicCashEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'epicCash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'epicCash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashContains(String value, {bool caseSensitive = true}) { + epicCashContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'epicCash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'epicCash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder epicCashMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'epicCash', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'epicCash', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashIsEmpty() { + epicCashIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'epicCash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'epicCash', value: ''), + ); }); } QueryBuilder - epicCashIsNotEmpty() { + epicCashIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'epicCash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'epicCash', value: ''), + ); }); } QueryBuilder - epicCashImageEqualTo( - String value, { - bool caseSensitive = true, - }) { + epicCashImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'epicCashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'epicCashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageGreaterThan( + epicCashImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'epicCashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'epicCashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageLessThan( + epicCashImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'epicCashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'epicCashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageBetween( + epicCashImageBetween( String lower, String upper, { bool includeLower = true, @@ -20441,135 +20885,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'epicCashImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'epicCashImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + epicCashImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'epicCashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'epicCashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + epicCashImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'epicCashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'epicCashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageContains(String value, {bool caseSensitive = true}) { + epicCashImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'epicCashImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'epicCashImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageMatches(String pattern, {bool caseSensitive = true}) { + epicCashImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'epicCashImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'epicCashImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageIsEmpty() { + epicCashImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'epicCashImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'epicCashImage', value: ''), + ); }); } QueryBuilder - epicCashImageIsNotEmpty() { + epicCashImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'epicCashImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'epicCashImage', value: ''), + ); }); } QueryBuilder - epicCashImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + epicCashImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'epicCashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'epicCashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageSecondaryGreaterThan( + epicCashImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'epicCashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'epicCashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageSecondaryLessThan( + epicCashImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'epicCashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'epicCashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageSecondaryBetween( + epicCashImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -20577,86 +21026,89 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'epicCashImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'epicCashImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + epicCashImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'epicCashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'epicCashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + epicCashImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'epicCashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'epicCashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageSecondaryContains(String value, - {bool caseSensitive = true}) { + epicCashImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'epicCashImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'epicCashImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + epicCashImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'epicCashImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'epicCashImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - epicCashImageSecondaryIsEmpty() { + epicCashImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'epicCashImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'epicCashImageSecondary', value: ''), + ); }); } QueryBuilder - epicCashImageSecondaryIsNotEmpty() { + epicCashImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'epicCashImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'epicCashImageSecondary', + value: '', + ), + ); }); } @@ -20665,43 +21117,49 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethereum', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'ethereum', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumGreaterThan( + ethereumGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ethereum', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ethereum', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumLessThan( + ethereumLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ethereum', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ethereum', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -20713,136 +21171,142 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ethereum', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ethereum', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumStartsWith( - String value, { - bool caseSensitive = true, - }) { + ethereumStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'ethereum', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'ethereum', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumEndsWith( - String value, { - bool caseSensitive = true, - }) { + ethereumEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'ethereum', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'ethereum', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumContains(String value, {bool caseSensitive = true}) { + ethereumContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'ethereum', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'ethereum', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder ethereumMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'ethereum', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'ethereum', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumIsEmpty() { + ethereumIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethereum', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ethereum', value: ''), + ); }); } QueryBuilder - ethereumIsNotEmpty() { + ethereumIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'ethereum', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'ethereum', value: ''), + ); }); } QueryBuilder - ethereumImageEqualTo( - String value, { - bool caseSensitive = true, - }) { + ethereumImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethereumImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'ethereumImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageGreaterThan( + ethereumImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ethereumImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ethereumImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageLessThan( + ethereumImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ethereumImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ethereumImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageBetween( + ethereumImageBetween( String lower, String upper, { bool includeLower = true, @@ -20850,135 +21314,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ethereumImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ethereumImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + ethereumImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'ethereumImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'ethereumImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + ethereumImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'ethereumImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'ethereumImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageContains(String value, {bool caseSensitive = true}) { + ethereumImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'ethereumImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'ethereumImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageMatches(String pattern, {bool caseSensitive = true}) { + ethereumImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'ethereumImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'ethereumImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageIsEmpty() { + ethereumImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethereumImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ethereumImage', value: ''), + ); }); } QueryBuilder - ethereumImageIsNotEmpty() { + ethereumImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'ethereumImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'ethereumImage', value: ''), + ); }); } QueryBuilder - ethereumImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + ethereumImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethereumImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'ethereumImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageSecondaryGreaterThan( + ethereumImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'ethereumImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'ethereumImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageSecondaryLessThan( + ethereumImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'ethereumImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'ethereumImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageSecondaryBetween( + ethereumImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -20986,86 +21455,89 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'ethereumImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'ethereumImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + ethereumImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'ethereumImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'ethereumImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + ethereumImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'ethereumImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'ethereumImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageSecondaryContains(String value, - {bool caseSensitive = true}) { + ethereumImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'ethereumImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'ethereumImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + ethereumImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'ethereumImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'ethereumImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - ethereumImageSecondaryIsEmpty() { + ethereumImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'ethereumImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'ethereumImageSecondary', value: ''), + ); }); } QueryBuilder - ethereumImageSecondaryIsNotEmpty() { + ethereumImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'ethereumImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'ethereumImageSecondary', + value: '', + ), + ); }); } @@ -21074,43 +21546,49 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -21122,85 +21600,88 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + exchangeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'exchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeEndsWith( - String value, { - bool caseSensitive = true, - }) { + exchangeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'exchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeContains(String value, {bool caseSensitive = true}) { + exchangeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'exchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder exchangeMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'exchange', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'exchange', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeIsEmpty() { + exchangeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'exchange', value: ''), + ); }); } QueryBuilder - exchangeIsNotEmpty() { + exchangeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'exchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'exchange', value: ''), + ); }); } @@ -21209,11 +21690,13 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'firo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'firo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -21223,12 +21706,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'firo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'firo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -21238,12 +21723,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'firo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'firo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -21255,14 +21742,16 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'firo', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'firo', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -21271,11 +21760,13 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'firo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'firo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -21284,105 +21775,114 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'firo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'firo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder firoContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'firo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'firo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder firoMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'firo', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'firo', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder firoIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'firo', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'firo', value: ''), + ); }); } QueryBuilder - firoIsNotEmpty() { + firoIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'firo', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'firo', value: ''), + ); }); } QueryBuilder - firoImageEqualTo( - String value, { - bool caseSensitive = true, - }) { + firoImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'firoImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'firoImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageGreaterThan( + firoImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'firoImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'firoImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageLessThan( + firoImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'firoImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'firoImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageBetween( + firoImageBetween( String lower, String upper, { bool includeLower = true, @@ -21390,135 +21890,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'firoImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'firoImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + firoImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'firoImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'firoImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + firoImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'firoImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'firoImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageContains(String value, {bool caseSensitive = true}) { + firoImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'firoImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'firoImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageMatches(String pattern, {bool caseSensitive = true}) { + firoImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'firoImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'firoImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageIsEmpty() { + firoImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'firoImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'firoImage', value: ''), + ); }); } QueryBuilder - firoImageIsNotEmpty() { + firoImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'firoImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'firoImage', value: ''), + ); }); } QueryBuilder - firoImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + firoImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'firoImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'firoImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageSecondaryGreaterThan( + firoImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'firoImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'firoImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageSecondaryLessThan( + firoImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'firoImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'firoImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageSecondaryBetween( + firoImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -21526,84 +22031,86 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'firoImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'firoImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + firoImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'firoImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'firoImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + firoImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'firoImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'firoImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageSecondaryContains(String value, {bool caseSensitive = true}) { + firoImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'firoImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'firoImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { + firoImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'firoImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'firoImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - firoImageSecondaryIsEmpty() { + firoImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'firoImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'firoImageSecondary', value: ''), + ); }); } QueryBuilder - firoImageSecondaryIsNotEmpty() { + firoImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'firoImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'firoImageSecondary', value: ''), + ); }); } @@ -21612,43 +22119,49 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'litecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'litecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinGreaterThan( + litecoinGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'litecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'litecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinLessThan( + litecoinLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'litecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'litecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -21660,136 +22173,142 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'litecoin', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'litecoin', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinStartsWith( - String value, { - bool caseSensitive = true, - }) { + litecoinStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'litecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'litecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinEndsWith( - String value, { - bool caseSensitive = true, - }) { + litecoinEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'litecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'litecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinContains(String value, {bool caseSensitive = true}) { + litecoinContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'litecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'litecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder litecoinMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'litecoin', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'litecoin', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinIsEmpty() { + litecoinIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'litecoin', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'litecoin', value: ''), + ); }); } QueryBuilder - litecoinIsNotEmpty() { + litecoinIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'litecoin', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'litecoin', value: ''), + ); }); } QueryBuilder - litecoinImageEqualTo( - String value, { - bool caseSensitive = true, - }) { + litecoinImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'litecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'litecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageGreaterThan( + litecoinImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'litecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'litecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageLessThan( + litecoinImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'litecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'litecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageBetween( + litecoinImageBetween( String lower, String upper, { bool includeLower = true, @@ -21797,135 +22316,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'litecoinImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'litecoinImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + litecoinImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'litecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'litecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + litecoinImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'litecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'litecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageContains(String value, {bool caseSensitive = true}) { + litecoinImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'litecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'litecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageMatches(String pattern, {bool caseSensitive = true}) { + litecoinImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'litecoinImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'litecoinImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageIsEmpty() { + litecoinImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'litecoinImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'litecoinImage', value: ''), + ); }); } QueryBuilder - litecoinImageIsNotEmpty() { + litecoinImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'litecoinImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'litecoinImage', value: ''), + ); }); } QueryBuilder - litecoinImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + litecoinImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'litecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'litecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageSecondaryGreaterThan( + litecoinImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'litecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'litecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageSecondaryLessThan( + litecoinImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'litecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'litecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageSecondaryBetween( + litecoinImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -21933,155 +22457,161 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'litecoinImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'litecoinImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + litecoinImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'litecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'litecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + litecoinImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'litecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'litecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageSecondaryContains(String value, - {bool caseSensitive = true}) { + litecoinImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'litecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'litecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + litecoinImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'litecoinImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'litecoinImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - litecoinImageSecondaryIsEmpty() { + litecoinImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'litecoinImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'litecoinImageSecondary', value: ''), + ); }); } QueryBuilder - litecoinImageSecondaryIsNotEmpty() { + litecoinImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'litecoinImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'litecoinImageSecondary', + value: '', + ), + ); }); } QueryBuilder - loadingGifIsNull() { + loadingGifIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'loadingGif', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'loadingGif'), + ); }); } QueryBuilder - loadingGifIsNotNull() { + loadingGifIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'loadingGif', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'loadingGif'), + ); }); } QueryBuilder - loadingGifEqualTo( - String? value, { - bool caseSensitive = true, - }) { + loadingGifEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'loadingGif', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifBetween( + loadingGifBetween( String? lower, String? upper, { bool includeLower = true, @@ -22089,132 +22619,140 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + loadingGifStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'loadingGif', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifEndsWith( - String value, { - bool caseSensitive = true, - }) { + loadingGifEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'loadingGif', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifContains(String value, {bool caseSensitive = true}) { + loadingGifContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'loadingGif', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifMatches(String pattern, {bool caseSensitive = true}) { + loadingGifMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'loadingGif', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'loadingGif', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifIsEmpty() { + loadingGifIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'loadingGif', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'loadingGif', value: ''), + ); }); } QueryBuilder - loadingGifIsNotEmpty() { + loadingGifIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'loadingGif', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'loadingGif', value: ''), + ); }); } - QueryBuilder moneroEqualTo( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder + mimblewimblecoinEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'monero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroGreaterThan( + mimblewimblecoinGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'monero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder moneroLessThan( + QueryBuilder + mimblewimblecoinLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'monero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder moneroBetween( + QueryBuilder + mimblewimblecoinBetween( String lower, String upper, { bool includeLower = true, @@ -22222,136 +22760,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'monero', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'mimblewimblecoin', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroStartsWith( - String value, { - bool caseSensitive = true, - }) { + mimblewimblecoinStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'monero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder moneroEndsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder + mimblewimblecoinEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'monero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder moneroContains( - String value, - {bool caseSensitive = true}) { + QueryBuilder + mimblewimblecoinContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'monero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'mimblewimblecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder moneroMatches( - String pattern, - {bool caseSensitive = true}) { + QueryBuilder + mimblewimblecoinMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'monero', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'mimblewimblecoin', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroIsEmpty() { + mimblewimblecoinIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'monero', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'mimblewimblecoin', value: ''), + ); }); } QueryBuilder - moneroIsNotEmpty() { + mimblewimblecoinIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'monero', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'mimblewimblecoin', value: ''), + ); }); } - QueryBuilder - moneroImageEqualTo( + QueryBuilder moneroEqualTo( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'moneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'monero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageGreaterThan( + moneroGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'moneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'monero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - moneroImageLessThan( + QueryBuilder moneroLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'moneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'monero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - moneroImageBetween( + QueryBuilder moneroBetween( String lower, String upper, { bool includeLower = true, @@ -22359,135 +22901,146 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'moneroImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'monero', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + moneroStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'moneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'monero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - moneroImageEndsWith( + QueryBuilder moneroEndsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'moneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'monero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - moneroImageContains(String value, {bool caseSensitive = true}) { + QueryBuilder moneroContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'moneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'monero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - moneroImageMatches(String pattern, {bool caseSensitive = true}) { + QueryBuilder moneroMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'moneroImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'monero', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageIsEmpty() { + moneroIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'moneroImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'monero', value: ''), + ); }); } QueryBuilder - moneroImageIsNotEmpty() { + moneroIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'moneroImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'monero', value: ''), + ); }); } QueryBuilder - moneroImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + moneroImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'moneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'moneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageSecondaryGreaterThan( + moneroImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'moneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'moneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageSecondaryLessThan( + moneroImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'moneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'moneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageSecondaryBetween( + moneroImageBetween( String lower, String upper, { bool includeLower = true, @@ -22495,133 +23048,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'moneroImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'moneroImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + moneroImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'moneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'moneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + moneroImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'moneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'moneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageSecondaryContains(String value, {bool caseSensitive = true}) { + moneroImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'moneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'moneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { + moneroImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'moneroImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'moneroImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - moneroImageSecondaryIsEmpty() { + moneroImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'moneroImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'moneroImage', value: ''), + ); }); } QueryBuilder - moneroImageSecondaryIsNotEmpty() { + moneroImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'moneroImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'moneroImage', value: ''), + ); }); } - QueryBuilder namecoinEqualTo( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder + moneroImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'namecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'moneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinGreaterThan( + moneroImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'namecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'moneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinLessThan( + moneroImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'namecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'moneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder namecoinBetween( + QueryBuilder + moneroImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -22629,136 +23189,144 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'namecoin', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'moneroImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinStartsWith( - String value, { - bool caseSensitive = true, - }) { + moneroImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'namecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'moneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinEndsWith( - String value, { - bool caseSensitive = true, - }) { + moneroImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'namecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'moneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinContains(String value, {bool caseSensitive = true}) { + moneroImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'namecoin', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'moneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder namecoinMatches( - String pattern, - {bool caseSensitive = true}) { + QueryBuilder + moneroImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'namecoin', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'moneroImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinIsEmpty() { + moneroImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'namecoin', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'moneroImageSecondary', value: ''), + ); }); } QueryBuilder - namecoinIsNotEmpty() { + moneroImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'namecoin', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'moneroImageSecondary', + value: '', + ), + ); }); } - QueryBuilder - namecoinImageEqualTo( + QueryBuilder namecoinEqualTo( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'namecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'namecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageGreaterThan( + namecoinGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'namecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'namecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageLessThan( + namecoinLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'namecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'namecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - namecoinImageBetween( + QueryBuilder namecoinBetween( String lower, String upper, { bool includeLower = true, @@ -22766,135 +23334,142 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'namecoinImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'namecoin', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + namecoinStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'namecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'namecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + namecoinEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'namecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'namecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageContains(String value, {bool caseSensitive = true}) { + namecoinContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'namecoinImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'namecoin', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - namecoinImageMatches(String pattern, {bool caseSensitive = true}) { + QueryBuilder namecoinMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'namecoinImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'namecoin', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageIsEmpty() { + namecoinIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'namecoinImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'namecoin', value: ''), + ); }); } QueryBuilder - namecoinImageIsNotEmpty() { + namecoinIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'namecoinImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'namecoin', value: ''), + ); }); } QueryBuilder - namecoinImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + namecoinImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'namecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'namecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageSecondaryGreaterThan( + namecoinImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'namecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'namecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageSecondaryLessThan( + namecoinImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'namecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'namecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageSecondaryBetween( + namecoinImageBetween( String lower, String upper, { bool includeLower = true, @@ -22902,134 +23477,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'namecoinImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'namecoinImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + namecoinImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'namecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'namecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + namecoinImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'namecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'namecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageSecondaryContains(String value, - {bool caseSensitive = true}) { + namecoinImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'namecoinImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'namecoinImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + namecoinImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'namecoinImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'namecoinImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - namecoinImageSecondaryIsEmpty() { + namecoinImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'namecoinImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'namecoinImage', value: ''), + ); }); } QueryBuilder - namecoinImageSecondaryIsNotEmpty() { + namecoinImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'namecoinImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'namecoinImage', value: ''), + ); }); } - QueryBuilder particlEqualTo( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder + namecoinImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'particl', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'namecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlGreaterThan( + namecoinImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'particl', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'namecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder particlLessThan( + QueryBuilder + namecoinImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'particl', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'namecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder particlBetween( + QueryBuilder + namecoinImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -23037,136 +23618,143 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'particl', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'namecoinImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlStartsWith( - String value, { - bool caseSensitive = true, - }) { + namecoinImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'particl', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'namecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder particlEndsWith( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder + namecoinImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'particl', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'namecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder particlContains( - String value, - {bool caseSensitive = true}) { + QueryBuilder + namecoinImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'particl', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'namecoinImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder particlMatches( - String pattern, - {bool caseSensitive = true}) { + QueryBuilder + namecoinImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'particl', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'namecoinImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlIsEmpty() { + namecoinImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'particl', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'namecoinImageSecondary', value: ''), + ); }); } QueryBuilder - particlIsNotEmpty() { + namecoinImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'particl', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'namecoinImageSecondary', + value: '', + ), + ); }); } - QueryBuilder - particlImageEqualTo( + QueryBuilder particlEqualTo( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'particlImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'particl', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageGreaterThan( + particlGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'particlImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'particl', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - particlImageLessThan( + QueryBuilder particlLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'particlImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'particl', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - particlImageBetween( + QueryBuilder particlBetween( String lower, String upper, { bool includeLower = true, @@ -23174,135 +23762,146 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'particlImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'particl', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + particlStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'particlImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'particl', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - particlImageEndsWith( + QueryBuilder particlEndsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'particlImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'particl', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - particlImageContains(String value, {bool caseSensitive = true}) { + QueryBuilder particlContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'particlImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'particl', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder - particlImageMatches(String pattern, {bool caseSensitive = true}) { + QueryBuilder particlMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'particlImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'particl', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageIsEmpty() { + particlIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'particlImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'particl', value: ''), + ); }); } QueryBuilder - particlImageIsNotEmpty() { + particlIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'particlImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'particl', value: ''), + ); }); } QueryBuilder - particlImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + particlImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'particlImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'particlImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageSecondaryGreaterThan( + particlImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'particlImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'particlImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageSecondaryLessThan( + particlImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'particlImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'particlImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageSecondaryBetween( + particlImageBetween( String lower, String upper, { bool includeLower = true, @@ -23310,136 +23909,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'particlImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'particlImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + particlImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'particlImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'particlImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + particlImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'particlImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'particlImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageSecondaryContains(String value, {bool caseSensitive = true}) { + particlImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'particlImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'particlImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + particlImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'particlImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'particlImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - particlImageSecondaryIsEmpty() { + particlImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'particlImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'particlImage', value: ''), + ); }); } QueryBuilder - particlImageSecondaryIsNotEmpty() { + particlImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'particlImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'particlImage', value: ''), + ); }); } QueryBuilder - personaEasyEqualTo( - String value, { - bool caseSensitive = true, - }) { + particlImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaEasy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'particlImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyGreaterThan( + particlImageSecondaryGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'particlImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyLessThan( + particlImageSecondaryLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'particlImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyBetween( + particlImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -23447,135 +24050,143 @@ extension ThemeAssetsQueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'particlImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyStartsWith( - String value, { - bool caseSensitive = true, - }) { + particlImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'personaEasy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'particlImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyEndsWith( - String value, { - bool caseSensitive = true, - }) { + particlImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'personaEasy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'particlImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyContains(String value, {bool caseSensitive = true}) { + particlImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'personaEasy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'particlImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyMatches(String pattern, {bool caseSensitive = true}) { + particlImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'personaEasy', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'particlImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyIsEmpty() { + particlImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaEasy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'particlImageSecondary', value: ''), + ); }); } QueryBuilder - personaEasyIsNotEmpty() { + particlImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'personaEasy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'particlImageSecondary', + value: '', + ), + ); }); } QueryBuilder - personaIncognitoEqualTo( - String value, { - bool caseSensitive = true, - }) { + personaEasyEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaIncognito', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoGreaterThan( + personaEasyGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoLessThan( + personaEasyLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoBetween( + personaEasyBetween( String lower, String upper, { bool includeLower = true, @@ -23583,132 +24194,140 @@ extension ThemeAssetsQueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'personaEasy', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoStartsWith( - String value, { - bool caseSensitive = true, - }) { + personaEasyStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'personaIncognito', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoEndsWith( - String value, { - bool caseSensitive = true, - }) { + personaEasyEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'personaIncognito', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoContains(String value, {bool caseSensitive = true}) { + personaEasyContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'personaIncognito', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoMatches(String pattern, {bool caseSensitive = true}) { + personaEasyMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'personaIncognito', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'personaEasy', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoIsEmpty() { + personaEasyIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaIncognito', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'personaEasy', value: ''), + ); }); } QueryBuilder - personaIncognitoIsNotEmpty() { + personaEasyIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'personaIncognito', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'personaEasy', value: ''), + ); }); } - QueryBuilder receiveEqualTo( - String value, { - bool caseSensitive = true, - }) { + QueryBuilder + personaIncognitoEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receive', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveGreaterThan( + personaIncognitoGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder receiveLessThan( + QueryBuilder + personaIncognitoLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } - QueryBuilder receiveBetween( + QueryBuilder + personaIncognitoBetween( String lower, String upper, { bool includeLower = true, @@ -23716,28 +24335,170 @@ extension ThemeAssetsQueryFilter 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, - )); + 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 - receiveStartsWith( + 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.startsWith( - property: r'receive', - value: value, - caseSensitive: caseSensitive, - )); + 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, + ), + ); }); } @@ -23746,106 +24507,115 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'receive', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder receiveContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'receive', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder receiveMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'receive', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'receive', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveIsEmpty() { + receiveIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receive', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receive', value: ''), + ); }); } QueryBuilder - receiveIsNotEmpty() { + receiveIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receive', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'receive', value: ''), + ); }); } QueryBuilder - receiveCancelledEqualTo( - String value, { - bool caseSensitive = true, - }) { + receiveCancelledEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receiveCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledBetween( + receiveCancelledBetween( String lower, String upper, { bool includeLower = true, @@ -23853,135 +24623,140 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + receiveCancelledStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'receiveCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledEndsWith( - String value, { - bool caseSensitive = true, - }) { + receiveCancelledEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'receiveCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledContains(String value, {bool caseSensitive = true}) { + receiveCancelledContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'receiveCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledMatches(String pattern, {bool caseSensitive = true}) { + receiveCancelledMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'receiveCancelled', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'receiveCancelled', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledIsEmpty() { + receiveCancelledIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receiveCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receiveCancelled', value: ''), + ); }); } QueryBuilder - receiveCancelledIsNotEmpty() { + receiveCancelledIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receiveCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'receiveCancelled', value: ''), + ); }); } QueryBuilder - receivePendingEqualTo( - String value, { - bool caseSensitive = true, - }) { + receivePendingEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receivePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingBetween( + receivePendingBetween( String lower, String upper, { bool includeLower = true, @@ -23989,84 +24764,86 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + receivePendingStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'receivePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingEndsWith( - String value, { - bool caseSensitive = true, - }) { + receivePendingEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'receivePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingContains(String value, {bool caseSensitive = true}) { + receivePendingContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'receivePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingMatches(String pattern, {bool caseSensitive = true}) { + receivePendingMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'receivePending', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'receivePending', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingIsEmpty() { + receivePendingIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receivePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receivePending', value: ''), + ); }); } QueryBuilder - receivePendingIsNotEmpty() { + receivePendingIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receivePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'receivePending', value: ''), + ); }); } @@ -24075,11 +24852,13 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24089,12 +24868,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24104,12 +24885,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24121,14 +24904,16 @@ extension ThemeAssetsQueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'send', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24137,11 +24922,13 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24150,105 +24937,114 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder sendContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder sendMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'send', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + 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: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'send', value: ''), + ); }); } QueryBuilder - sendIsNotEmpty() { + sendIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'send', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'send', value: ''), + ); }); } QueryBuilder - sendCancelledEqualTo( - String value, { - bool caseSensitive = true, - }) { + sendCancelledEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledBetween( + sendCancelledBetween( String lower, String upper, { bool includeLower = true, @@ -24256,135 +25052,140 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + sendCancelledStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'sendCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledEndsWith( - String value, { - bool caseSensitive = true, - }) { + sendCancelledEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'sendCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledContains(String value, {bool caseSensitive = true}) { + sendCancelledContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'sendCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledMatches(String pattern, {bool caseSensitive = true}) { + sendCancelledMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'sendCancelled', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'sendCancelled', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledIsEmpty() { + sendCancelledIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'sendCancelled', value: ''), + ); }); } QueryBuilder - sendCancelledIsNotEmpty() { + sendCancelledIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'sendCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'sendCancelled', value: ''), + ); }); } QueryBuilder - sendPendingEqualTo( - String value, { - bool caseSensitive = true, - }) { + sendPendingEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendPending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingBetween( + sendPendingBetween( String lower, String upper, { bool includeLower = true, @@ -24392,84 +25193,86 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + sendPendingStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'sendPending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingEndsWith( - String value, { - bool caseSensitive = true, - }) { + sendPendingEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'sendPending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingContains(String value, {bool caseSensitive = true}) { + sendPendingContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'sendPending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingMatches(String pattern, {bool caseSensitive = true}) { + sendPendingMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'sendPending', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'sendPending', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingIsEmpty() { + sendPendingIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendPending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'sendPending', value: ''), + ); }); } QueryBuilder - sendPendingIsNotEmpty() { + sendPendingIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'sendPending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'sendPending', value: ''), + ); }); } @@ -24478,27 +25281,31 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24508,12 +25315,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24525,14 +25334,16 @@ extension ThemeAssetsQueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stack', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24541,11 +25352,13 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -24554,105 +25367,114 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder stackContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder stackMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'stack', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + 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: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'stack', value: ''), + ); }); } QueryBuilder - stackIsNotEmpty() { + stackIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'stack', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'stack', value: ''), + ); }); } QueryBuilder - stackIconEqualTo( - String value, { - bool caseSensitive = true, - }) { + stackIconEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stackIcon', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconBetween( + stackIconBetween( String lower, String upper, { bool includeLower = true, @@ -24660,135 +25482,140 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + stackIconStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'stackIcon', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconEndsWith( - String value, { - bool caseSensitive = true, - }) { + stackIconEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'stackIcon', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconContains(String value, {bool caseSensitive = true}) { + stackIconContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'stackIcon', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconMatches(String pattern, {bool caseSensitive = true}) { + stackIconMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'stackIcon', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'stackIcon', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconIsEmpty() { + stackIconIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stackIcon', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'stackIcon', value: ''), + ); }); } QueryBuilder - stackIconIsNotEmpty() { + stackIconIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'stackIcon', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'stackIcon', value: ''), + ); }); } QueryBuilder - themePreviewEqualTo( - String value, { - bool caseSensitive = true, - }) { + themePreviewEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themePreview', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewBetween( + themePreviewBetween( String lower, String upper, { bool includeLower = true, @@ -24796,135 +25623,140 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + themePreviewStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'themePreview', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewEndsWith( - String value, { - bool caseSensitive = true, - }) { + themePreviewEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'themePreview', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewContains(String value, {bool caseSensitive = true}) { + themePreviewContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'themePreview', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewMatches(String pattern, {bool caseSensitive = true}) { + themePreviewMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'themePreview', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'themePreview', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewIsEmpty() { + themePreviewIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themePreview', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'themePreview', value: ''), + ); }); } QueryBuilder - themePreviewIsNotEmpty() { + themePreviewIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'themePreview', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'themePreview', value: ''), + ); }); } QueryBuilder - themeSelectorEqualTo( - String value, { - bool caseSensitive = true, - }) { + themeSelectorEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themeSelector', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorBetween( + themeSelectorBetween( String lower, String upper, { bool includeLower = true, @@ -24932,135 +25764,140 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + themeSelectorStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'themeSelector', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorEndsWith( - String value, { - bool caseSensitive = true, - }) { + themeSelectorEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'themeSelector', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorContains(String value, {bool caseSensitive = true}) { + themeSelectorContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'themeSelector', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorMatches(String pattern, {bool caseSensitive = true}) { + themeSelectorMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'themeSelector', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'themeSelector', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorIsEmpty() { + themeSelectorIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themeSelector', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'themeSelector', value: ''), + ); }); } QueryBuilder - themeSelectorIsNotEmpty() { + themeSelectorIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'themeSelector', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'themeSelector', value: ''), + ); }); } QueryBuilder - txExchangeEqualTo( - String value, { - bool caseSensitive = true, - }) { + txExchangeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeBetween( + txExchangeBetween( String lower, String upper, { bool includeLower = true, @@ -25068,135 +25905,140 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + txExchangeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txExchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeEndsWith( - String value, { - bool caseSensitive = true, - }) { + txExchangeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txExchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeContains(String value, {bool caseSensitive = true}) { + txExchangeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txExchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeMatches(String pattern, {bool caseSensitive = true}) { + txExchangeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txExchange', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txExchange', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeIsEmpty() { + txExchangeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchange', value: ''), + ); }); } QueryBuilder - txExchangeIsNotEmpty() { + txExchangeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txExchange', value: ''), + ); }); } QueryBuilder - txExchangeFailedEqualTo( - String value, { - bool caseSensitive = true, - }) { + txExchangeFailedEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangeFailed', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedBetween( + txExchangeFailedBetween( String lower, String upper, { bool includeLower = true, @@ -25204,135 +26046,140 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + txExchangeFailedStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txExchangeFailed', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedEndsWith( - String value, { - bool caseSensitive = true, - }) { + txExchangeFailedEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txExchangeFailed', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedContains(String value, {bool caseSensitive = true}) { + txExchangeFailedContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txExchangeFailed', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedMatches(String pattern, {bool caseSensitive = true}) { + txExchangeFailedMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txExchangeFailed', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txExchangeFailed', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedIsEmpty() { + txExchangeFailedIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangeFailed', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchangeFailed', value: ''), + ); }); } QueryBuilder - txExchangeFailedIsNotEmpty() { + txExchangeFailedIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchangeFailed', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txExchangeFailed', value: ''), + ); }); } QueryBuilder - txExchangePendingEqualTo( - String value, { - bool caseSensitive = true, - }) { + txExchangePendingEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingBetween( + txExchangePendingBetween( String lower, String upper, { bool includeLower = true, @@ -25340,84 +26187,86 @@ extension ThemeAssetsQueryFilter 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, - )); + 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, - }) { + txExchangePendingStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txExchangePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingEndsWith( - String value, { - bool caseSensitive = true, - }) { + txExchangePendingEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txExchangePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingContains(String value, {bool caseSensitive = true}) { + txExchangePendingContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txExchangePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingMatches(String pattern, {bool caseSensitive = true}) { + txExchangePendingMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txExchangePending', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txExchangePending', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingIsEmpty() { + txExchangePendingIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchangePending', value: ''), + ); }); } QueryBuilder - txExchangePendingIsNotEmpty() { + txExchangePendingIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchangePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txExchangePending', value: ''), + ); }); } @@ -25426,27 +26275,31 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'wownero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'wownero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroGreaterThan( + wowneroGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'wownero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'wownero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -25456,12 +26309,14 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'wownero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'wownero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -25473,28 +26328,29 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'wownero', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'wownero', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroStartsWith( - String value, { - bool caseSensitive = true, - }) { + wowneroStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'wownero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'wownero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -25503,106 +26359,115 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'wownero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'wownero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder wowneroContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'wownero', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'wownero', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder wowneroMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'wownero', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'wownero', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroIsEmpty() { + wowneroIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'wownero', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'wownero', value: ''), + ); }); } QueryBuilder - wowneroIsNotEmpty() { + wowneroIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'wownero', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'wownero', value: ''), + ); }); } QueryBuilder - wowneroImageEqualTo( - String value, { - bool caseSensitive = true, - }) { + wowneroImageEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'wowneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'wowneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageGreaterThan( + wowneroImageGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'wowneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'wowneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageLessThan( + wowneroImageLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'wowneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'wowneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageBetween( + wowneroImageBetween( String lower, String upper, { bool includeLower = true, @@ -25610,135 +26475,140 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'wowneroImage', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'wowneroImage', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageStartsWith( - String value, { - bool caseSensitive = true, - }) { + wowneroImageStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'wowneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'wowneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageEndsWith( - String value, { - bool caseSensitive = true, - }) { + wowneroImageEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'wowneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'wowneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageContains(String value, {bool caseSensitive = true}) { + wowneroImageContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'wowneroImage', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'wowneroImage', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageMatches(String pattern, {bool caseSensitive = true}) { + wowneroImageMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'wowneroImage', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'wowneroImage', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageIsEmpty() { + wowneroImageIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'wowneroImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'wowneroImage', value: ''), + ); }); } QueryBuilder - wowneroImageIsNotEmpty() { + wowneroImageIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'wowneroImage', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'wowneroImage', value: ''), + ); }); } QueryBuilder - wowneroImageSecondaryEqualTo( - String value, { - bool caseSensitive = true, - }) { + wowneroImageSecondaryEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'wowneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'wowneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageSecondaryGreaterThan( + wowneroImageSecondaryGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'wowneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'wowneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageSecondaryLessThan( + wowneroImageSecondaryLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'wowneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'wowneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageSecondaryBetween( + wowneroImageSecondaryBetween( String lower, String upper, { bool includeLower = true, @@ -25746,85 +26616,89 @@ extension ThemeAssetsQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'wowneroImageSecondary', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'wowneroImageSecondary', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageSecondaryStartsWith( - String value, { - bool caseSensitive = true, - }) { + wowneroImageSecondaryStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'wowneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'wowneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageSecondaryEndsWith( - String value, { - bool caseSensitive = true, - }) { + wowneroImageSecondaryEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'wowneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'wowneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageSecondaryContains(String value, {bool caseSensitive = true}) { + wowneroImageSecondaryContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'wowneroImageSecondary', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'wowneroImageSecondary', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageSecondaryMatches(String pattern, - {bool caseSensitive = true}) { + wowneroImageSecondaryMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'wowneroImageSecondary', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'wowneroImageSecondary', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - wowneroImageSecondaryIsEmpty() { + wowneroImageSecondaryIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'wowneroImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'wowneroImageSecondary', value: ''), + ); }); } QueryBuilder - wowneroImageSecondaryIsNotEmpty() { + wowneroImageSecondaryIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'wowneroImageSecondary', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'wowneroImageSecondary', + value: '', + ), + ); }); } } @@ -25844,16 +26718,8 @@ const ThemeAssetsV2Schema = Schema( 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'bellNew': PropertySchema(id: 1, name: r'bellNew', type: IsarType.string), + r'buy': PropertySchema(id: 2, name: r'buy', type: IsarType.string), r'coinIconsString': PropertySchema( id: 3, name: r'coinIconsString', @@ -25894,11 +26760,7 @@ const ThemeAssetsV2Schema = Schema( name: r'personaIncognito', type: IsarType.string, ), - r'receive': PropertySchema( - id: 11, - name: r'receive', - type: IsarType.string, - ), + r'receive': PropertySchema(id: 11, name: r'receive', type: IsarType.string), r'receiveCancelled': PropertySchema( id: 12, name: r'receiveCancelled', @@ -25909,11 +26771,7 @@ const ThemeAssetsV2Schema = Schema( name: r'receivePending', type: IsarType.string, ), - r'send': PropertySchema( - id: 14, - name: r'send', - type: IsarType.string, - ), + r'send': PropertySchema(id: 14, name: r'send', type: IsarType.string), r'sendCancelled': PropertySchema( id: 15, name: r'sendCancelled', @@ -25924,11 +26782,7 @@ const ThemeAssetsV2Schema = Schema( name: r'sendPending', type: IsarType.string, ), - r'stack': PropertySchema( - id: 17, - name: r'stack', - type: IsarType.string, - ), + r'stack': PropertySchema(id: 17, name: r'stack', type: IsarType.string), r'stackIcon': PropertySchema( id: 18, name: r'stackIcon', @@ -25958,8 +26812,9 @@ const ThemeAssetsV2Schema = Schema( id: 23, name: r'txExchangePending', type: IsarType.string, - ) + ), }, + estimateSize: _themeAssetsV2EstimateSize, serialize: _themeAssetsV2Serialize, deserialize: _themeAssetsV2Deserialize, @@ -26138,71 +26993,74 @@ P _themeAssetsV2DeserializeProp

( extension ThemeAssetsV2QueryFilter on QueryBuilder { QueryBuilder - backgroundIsNull() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'background', - )); - }); - } - - QueryBuilder - backgroundIsNotNull() { + backgroundIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'background', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'background'), + ); }); } QueryBuilder - backgroundEqualTo( - String? value, { - bool caseSensitive = true, - }) { + backgroundIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'background'), + ); }); } QueryBuilder - backgroundGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundBetween( + backgroundBetween( String? lower, String? upper, { bool includeLower = true, @@ -26210,135 +27068,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + backgroundIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'background', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'background', value: ''), + ); }); } QueryBuilder - backgroundIsNotEmpty() { + backgroundIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'background', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewBetween( + bellNewBetween( String lower, String upper, { bool includeLower = true, @@ -26346,84 +27209,86 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + bellNewIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bellNew', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bellNew', value: ''), + ); }); } QueryBuilder - bellNewIsNotEmpty() { + bellNewIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bellNew', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'bellNew', value: ''), + ); }); } @@ -26432,27 +27297,31 @@ extension ThemeAssetsV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -26462,12 +27331,14 @@ extension ThemeAssetsV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -26479,28 +27350,29 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + buyStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -26509,106 +27381,115 @@ extension ThemeAssetsV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder buyContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder buyMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'buy', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'buy', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyIsEmpty() { + buyIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'buy', value: ''), + ); }); } QueryBuilder - buyIsNotEmpty() { + buyIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'buy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'buy', 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringBetween( + coinIconsStringBetween( String lower, String upper, { bool includeLower = true, @@ -26616,135 +27497,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + coinIconsStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinIconsString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinIconsString', value: ''), + ); }); } QueryBuilder - coinIconsStringIsNotEmpty() { + coinIconsStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinIconsString', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringBetween( + coinImagesStringBetween( String lower, String upper, { bool includeLower = true, @@ -26752,135 +27638,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + coinImagesStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinImagesString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinImagesString', value: ''), + ); }); } QueryBuilder - coinImagesStringIsNotEmpty() { + coinImagesStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinImagesString', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderBetween( + coinPlaceholderBetween( String lower, String upper, { bool includeLower = true, @@ -26888,135 +27779,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + coinPlaceholderIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinPlaceholder', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinPlaceholder', value: ''), + ); }); } QueryBuilder - coinPlaceholderIsNotEmpty() { + coinPlaceholderIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinPlaceholder', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringBetween( + coinSecondaryImagesStringBetween( String lower, String upper, { bool includeLower = true, @@ -27024,137 +27920,152 @@ extension ThemeAssetsV2QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'coinSecondaryImagesString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringStartsWith( + coinSecondaryImagesStringStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinSecondaryImagesString', - value: value, - caseSensitive: caseSensitive, - )); + 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, - )); + 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, - )); + 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}) { + coinSecondaryImagesStringMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinSecondaryImagesString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinSecondaryImagesString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringIsEmpty() { + coinSecondaryImagesStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinSecondaryImagesString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinSecondaryImagesString', + value: '', + ), + ); }); } QueryBuilder - coinSecondaryImagesStringIsNotEmpty() { + coinSecondaryImagesStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinSecondaryImagesString', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeBetween( + exchangeBetween( String lower, String upper, { bool includeLower = true, @@ -27162,153 +28073,158 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + exchangeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'exchange', value: ''), + ); }); } QueryBuilder - exchangeIsNotEmpty() { + exchangeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'exchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'exchange', value: ''), + ); }); } QueryBuilder - loadingGifIsNull() { + loadingGifIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'loadingGif', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'loadingGif'), + ); }); } QueryBuilder - loadingGifIsNotNull() { + loadingGifIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'loadingGif', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifBetween( + loadingGifBetween( String? lower, String? upper, { bool includeLower = true, @@ -27316,135 +28232,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + loadingGifIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'loadingGif', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'loadingGif', value: ''), + ); }); } QueryBuilder - loadingGifIsNotEmpty() { + loadingGifIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'loadingGif', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'loadingGif', 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyBetween( + personaEasyBetween( String lower, String upper, { bool includeLower = true, @@ -27452,135 +28373,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + personaEasyIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaEasy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'personaEasy', value: ''), + ); }); } QueryBuilder - personaEasyIsNotEmpty() { + personaEasyIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'personaEasy', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoBetween( + personaIncognitoBetween( String lower, String upper, { bool includeLower = true, @@ -27588,135 +28514,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + personaIncognitoIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaIncognito', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'personaIncognito', value: ''), + ); }); } QueryBuilder - personaIncognitoIsNotEmpty() { + personaIncognitoIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'personaIncognito', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveBetween( + receiveBetween( String lower, String upper, { bool includeLower = true, @@ -27724,135 +28655,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + receiveIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receive', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receive', value: ''), + ); }); } QueryBuilder - receiveIsNotEmpty() { + receiveIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receive', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledBetween( + receiveCancelledBetween( String lower, String upper, { bool includeLower = true, @@ -27860,135 +28796,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + receiveCancelledIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receiveCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receiveCancelled', value: ''), + ); }); } QueryBuilder - receiveCancelledIsNotEmpty() { + receiveCancelledIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receiveCancelled', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingBetween( + receivePendingBetween( String lower, String upper, { bool includeLower = true, @@ -27996,84 +28937,86 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + receivePendingIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receivePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receivePending', value: ''), + ); }); } QueryBuilder - receivePendingIsNotEmpty() { + receivePendingIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receivePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'receivePending', value: ''), + ); }); } @@ -28082,43 +29025,49 @@ extension ThemeAssetsV2QueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -28130,136 +29079,142 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'send', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'send', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendIsEmpty() { + sendIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'send', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'send', value: ''), + ); }); } QueryBuilder - sendIsNotEmpty() { + sendIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'send', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledBetween( + sendCancelledBetween( String lower, String upper, { bool includeLower = true, @@ -28267,135 +29222,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + sendCancelledIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'sendCancelled', value: ''), + ); }); } QueryBuilder - sendCancelledIsNotEmpty() { + sendCancelledIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'sendCancelled', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingBetween( + sendPendingBetween( String lower, String upper, { bool includeLower = true, @@ -28403,135 +29363,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + sendPendingIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendPending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'sendPending', value: ''), + ); }); } QueryBuilder - sendPendingIsNotEmpty() { + sendPendingIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'sendPending', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackBetween( + stackBetween( String lower, String upper, { bool includeLower = true, @@ -28539,135 +29504,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + stackIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stack', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'stack', value: ''), + ); }); } QueryBuilder - stackIsNotEmpty() { + stackIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'stack', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconBetween( + stackIconBetween( String lower, String upper, { bool includeLower = true, @@ -28675,135 +29645,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + stackIconIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stackIcon', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'stackIcon', value: ''), + ); }); } QueryBuilder - stackIconIsNotEmpty() { + stackIconIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'stackIcon', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewBetween( + themePreviewBetween( String lower, String upper, { bool includeLower = true, @@ -28811,135 +29786,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + themePreviewIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themePreview', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'themePreview', value: ''), + ); }); } QueryBuilder - themePreviewIsNotEmpty() { + themePreviewIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'themePreview', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorBetween( + themeSelectorBetween( String lower, String upper, { bool includeLower = true, @@ -28947,135 +29927,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + themeSelectorIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themeSelector', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'themeSelector', value: ''), + ); }); } QueryBuilder - themeSelectorIsNotEmpty() { + themeSelectorIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'themeSelector', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeBetween( + txExchangeBetween( String lower, String upper, { bool includeLower = true, @@ -29083,135 +30068,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + txExchangeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchange', value: ''), + ); }); } QueryBuilder - txExchangeIsNotEmpty() { + txExchangeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchange', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedBetween( + txExchangeFailedBetween( String lower, String upper, { bool includeLower = true, @@ -29219,135 +30209,140 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + txExchangeFailedIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangeFailed', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchangeFailed', value: ''), + ); }); } QueryBuilder - txExchangeFailedIsNotEmpty() { + txExchangeFailedIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchangeFailed', - value: '', - )); + 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, - )); + 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( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingBetween( + txExchangePendingBetween( String lower, String upper, { bool includeLower = true, @@ -29355,84 +30350,86 @@ extension ThemeAssetsV2QueryFilter 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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, - )); + 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() { + txExchangePendingIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchangePending', value: ''), + ); }); } QueryBuilder - txExchangePendingIsNotEmpty() { + txExchangePendingIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchangePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txExchangePending', value: ''), + ); }); } } @@ -29446,22 +30443,14 @@ extension ThemeAssetsV2QueryObject 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', + 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', @@ -29522,11 +30511,7 @@ const ThemeAssetsV3Schema = Schema( name: r'personaIncognito', type: IsarType.string, ), - r'receive': PropertySchema( - id: 15, - name: r'receive', - type: IsarType.string, - ), + r'receive': PropertySchema(id: 15, name: r'receive', type: IsarType.string), r'receiveCancelled': PropertySchema( id: 16, name: r'receiveCancelled', @@ -29537,11 +30522,7 @@ const ThemeAssetsV3Schema = Schema( name: r'receivePending', type: IsarType.string, ), - r'send': PropertySchema( - id: 18, - name: r'send', - type: IsarType.string, - ), + r'send': PropertySchema(id: 18, name: r'send', type: IsarType.string), r'sendCancelled': PropertySchema( id: 19, name: r'sendCancelled', @@ -29552,11 +30533,7 @@ const ThemeAssetsV3Schema = Schema( name: r'sendPending', type: IsarType.string, ), - r'stack': PropertySchema( - id: 21, - name: r'stack', - type: IsarType.string, - ), + r'stack': PropertySchema(id: 21, name: r'stack', type: IsarType.string), r'stackIcon': PropertySchema( id: 22, name: r'stackIcon', @@ -29586,8 +30563,9 @@ const ThemeAssetsV3Schema = Schema( id: 27, name: r'txExchangePending', type: IsarType.string, - ) + ), }, + estimateSize: _themeAssetsV3EstimateSize, serialize: _themeAssetsV3Serialize, deserialize: _themeAssetsV3Deserialize, @@ -29806,71 +30784,74 @@ P _themeAssetsV3DeserializeProp

( extension ThemeAssetsV3QueryFilter on QueryBuilder { QueryBuilder - backgroundRelativeIsNull() { + backgroundRelativeIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'background', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'background'), + ); }); } QueryBuilder - backgroundRelativeIsNotNull() { + backgroundRelativeIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'background', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'background'), + ); }); } QueryBuilder - backgroundRelativeEqualTo( - String? value, { - bool caseSensitive = true, - }) { + backgroundRelativeEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundRelativeGreaterThan( + backgroundRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundRelativeLessThan( + backgroundRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundRelativeBetween( + backgroundRelativeBetween( String? lower, String? upper, { bool includeLower = true, @@ -29878,135 +30859,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'background', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + backgroundRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + backgroundRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundRelativeContains(String value, {bool caseSensitive = true}) { + backgroundRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'background', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'background', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundRelativeMatches(String pattern, {bool caseSensitive = true}) { + backgroundRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'background', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'background', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - backgroundRelativeIsEmpty() { + backgroundRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'background', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'background', value: ''), + ); }); } QueryBuilder - backgroundRelativeIsNotEmpty() { + backgroundRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'background', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'background', value: ''), + ); }); } QueryBuilder - bellNewRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + bellNewRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewRelativeGreaterThan( + bellNewRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewRelativeLessThan( + bellNewRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewRelativeBetween( + bellNewRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -30014,135 +31000,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'bellNew', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + bellNewRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + bellNewRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewRelativeContains(String value, {bool caseSensitive = true}) { + bellNewRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'bellNew', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'bellNew', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewRelativeMatches(String pattern, {bool caseSensitive = true}) { + bellNewRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'bellNew', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'bellNew', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - bellNewRelativeIsEmpty() { + bellNewRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'bellNew', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'bellNew', value: ''), + ); }); } QueryBuilder - bellNewRelativeIsNotEmpty() { + bellNewRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'bellNew', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'bellNew', value: ''), + ); }); } QueryBuilder - buyRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + buyRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyRelativeGreaterThan( + buyRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyRelativeLessThan( + buyRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyRelativeBetween( + buyRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -30150,153 +31141,158 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'buy', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + buyRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + buyRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyRelativeContains(String value, {bool caseSensitive = true}) { + buyRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'buy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'buy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyRelativeMatches(String pattern, {bool caseSensitive = true}) { + buyRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'buy', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'buy', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - buyRelativeIsEmpty() { + buyRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'buy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'buy', value: ''), + ); }); } QueryBuilder - buyRelativeIsNotEmpty() { + buyRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'buy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'buy', value: ''), + ); }); } QueryBuilder - coinCardImagesStringIsNull() { + coinCardImagesStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'coinCardImagesString', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'coinCardImagesString'), + ); }); } QueryBuilder - coinCardImagesStringIsNotNull() { + coinCardImagesStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'coinCardImagesString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'coinCardImagesString'), + ); }); } QueryBuilder - coinCardImagesStringEqualTo( - String? value, { - bool caseSensitive = true, - }) { + coinCardImagesStringEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinCardImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardImagesStringGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardImagesStringLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardImagesStringBetween( + coinCardImagesStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -30304,135 +31300,143 @@ extension ThemeAssetsV3QueryFilter 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, - )); + 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, - }) { + coinCardImagesStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinCardImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardImagesStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + coinCardImagesStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinCardImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardImagesStringContains(String value, {bool caseSensitive = true}) { + coinCardImagesStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinCardImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinCardImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardImagesStringMatches(String pattern, {bool caseSensitive = true}) { + coinCardImagesStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinCardImagesString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinCardImagesString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardImagesStringIsEmpty() { + coinCardImagesStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinCardImagesString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinCardImagesString', value: ''), + ); }); } QueryBuilder - coinCardImagesStringIsNotEmpty() { + coinCardImagesStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinCardImagesString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'coinCardImagesString', + value: '', + ), + ); }); } QueryBuilder - coinIconsStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + coinIconsStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinIconsString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringBetween( + coinIconsStringBetween( String lower, String upper, { bool includeLower = true, @@ -30440,135 +31444,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + 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, - }) { + coinIconsStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinIconsString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + coinIconsStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinIconsString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringContains(String value, {bool caseSensitive = true}) { + coinIconsStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinIconsString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinIconsString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringMatches(String pattern, {bool caseSensitive = true}) { + coinIconsStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinIconsString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinIconsString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinIconsStringIsEmpty() { + coinIconsStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinIconsString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinIconsString', value: ''), + ); }); } QueryBuilder - coinIconsStringIsNotEmpty() { + coinIconsStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinIconsString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'coinIconsString', value: ''), + ); }); } QueryBuilder - coinImagesStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + coinImagesStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringBetween( + coinImagesStringBetween( String lower, String upper, { bool includeLower = true, @@ -30576,135 +31585,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + 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, - }) { + coinImagesStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + coinImagesStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringContains(String value, {bool caseSensitive = true}) { + coinImagesStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringMatches(String pattern, {bool caseSensitive = true}) { + coinImagesStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinImagesString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinImagesString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinImagesStringIsEmpty() { + coinImagesStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinImagesString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinImagesString', value: ''), + ); }); } QueryBuilder - coinImagesStringIsNotEmpty() { + coinImagesStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinImagesString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'coinImagesString', value: ''), + ); }); } QueryBuilder - coinPlaceholderRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + coinPlaceholderRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinPlaceholder', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderRelativeGreaterThan( + coinPlaceholderRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderRelativeLessThan( + coinPlaceholderRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderRelativeBetween( + coinPlaceholderRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -30712,137 +31726,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'coinPlaceholder', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + coinPlaceholderRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinPlaceholder', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + coinPlaceholderRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinPlaceholder', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderRelativeContains(String value, - {bool caseSensitive = true}) { + coinPlaceholderRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinPlaceholder', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinPlaceholder', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderRelativeMatches(String pattern, - {bool caseSensitive = true}) { + coinPlaceholderRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinPlaceholder', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinPlaceholder', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinPlaceholderRelativeIsEmpty() { + coinPlaceholderRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinPlaceholder', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinPlaceholder', value: ''), + ); }); } QueryBuilder - coinPlaceholderRelativeIsNotEmpty() { + coinPlaceholderRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinPlaceholder', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'coinPlaceholder', value: ''), + ); }); } QueryBuilder - coinSecondaryImagesStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + coinSecondaryImagesStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinSecondaryImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringGreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringLessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringBetween( + coinSecondaryImagesStringBetween( String lower, String upper, { bool includeLower = true, @@ -30850,137 +31867,152 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'coinSecondaryImagesString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringStartsWith( + coinSecondaryImagesStringStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinSecondaryImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + coinSecondaryImagesStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinSecondaryImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringContains(String value, - {bool caseSensitive = true}) { + coinSecondaryImagesStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinSecondaryImagesString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinSecondaryImagesString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringMatches(String pattern, - {bool caseSensitive = true}) { + coinSecondaryImagesStringMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinSecondaryImagesString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinSecondaryImagesString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinSecondaryImagesStringIsEmpty() { + coinSecondaryImagesStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinSecondaryImagesString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinSecondaryImagesString', + value: '', + ), + ); }); } QueryBuilder - coinSecondaryImagesStringIsNotEmpty() { + coinSecondaryImagesStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinSecondaryImagesString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'coinSecondaryImagesString', + value: '', + ), + ); }); } QueryBuilder - exchangeRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + exchangeRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeRelativeGreaterThan( + exchangeRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeRelativeLessThan( + exchangeRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeRelativeBetween( + exchangeRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -30988,153 +32020,158 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'exchange', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + exchangeRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'exchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + exchangeRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'exchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeRelativeContains(String value, {bool caseSensitive = true}) { + exchangeRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'exchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'exchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeRelativeMatches(String pattern, {bool caseSensitive = true}) { + exchangeRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'exchange', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'exchange', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - exchangeRelativeIsEmpty() { + exchangeRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'exchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'exchange', value: ''), + ); }); } QueryBuilder - exchangeRelativeIsNotEmpty() { + exchangeRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'exchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'exchange', value: ''), + ); }); } QueryBuilder - loadingGifRelativeIsNull() { + loadingGifRelativeIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'loadingGif', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'loadingGif'), + ); }); } QueryBuilder - loadingGifRelativeIsNotNull() { + loadingGifRelativeIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'loadingGif', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'loadingGif'), + ); }); } QueryBuilder - loadingGifRelativeEqualTo( - String? value, { - bool caseSensitive = true, - }) { + loadingGifRelativeEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'loadingGif', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifRelativeGreaterThan( + loadingGifRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifRelativeLessThan( + loadingGifRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifRelativeBetween( + loadingGifRelativeBetween( String? lower, String? upper, { bool includeLower = true, @@ -31142,153 +32179,161 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'loadingGif', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + loadingGifRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'loadingGif', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + loadingGifRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'loadingGif', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifRelativeContains(String value, {bool caseSensitive = true}) { + loadingGifRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'loadingGif', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'loadingGif', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifRelativeMatches(String pattern, {bool caseSensitive = true}) { + loadingGifRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'loadingGif', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'loadingGif', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - loadingGifRelativeIsEmpty() { + loadingGifRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'loadingGif', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'loadingGif', value: ''), + ); }); } QueryBuilder - loadingGifRelativeIsNotEmpty() { + loadingGifRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'loadingGif', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'loadingGif', value: ''), + ); }); } QueryBuilder - coinCardFavoritesImagesStringIsNull() { + coinCardFavoritesImagesStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'otherStringParam1', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'otherStringParam1'), + ); }); } QueryBuilder - coinCardFavoritesImagesStringIsNotNull() { + coinCardFavoritesImagesStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'otherStringParam1', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'otherStringParam1'), + ); }); } QueryBuilder - coinCardFavoritesImagesStringEqualTo( + coinCardFavoritesImagesStringEqualTo( String? value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherStringParam1', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardFavoritesImagesStringGreaterThan( + coinCardFavoritesImagesStringGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardFavoritesImagesStringLessThan( + coinCardFavoritesImagesStringLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardFavoritesImagesStringBetween( + coinCardFavoritesImagesStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -31296,155 +32341,170 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'otherStringParam1', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardFavoritesImagesStringStartsWith( + coinCardFavoritesImagesStringStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'otherStringParam1', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardFavoritesImagesStringEndsWith( + coinCardFavoritesImagesStringEndsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'otherStringParam1', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardFavoritesImagesStringContains(String value, - {bool caseSensitive = true}) { + coinCardFavoritesImagesStringContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'otherStringParam1', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'otherStringParam1', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardFavoritesImagesStringMatches(String pattern, - {bool caseSensitive = true}) { + coinCardFavoritesImagesStringMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'otherStringParam1', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'otherStringParam1', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinCardFavoritesImagesStringIsEmpty() { + coinCardFavoritesImagesStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherStringParam1', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'otherStringParam1', value: ''), + ); }); } QueryBuilder - coinCardFavoritesImagesStringIsNotEmpty() { + coinCardFavoritesImagesStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'otherStringParam1', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'otherStringParam1', value: ''), + ); }); } QueryBuilder - dummy2IsNull() { + dummy2IsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'otherStringParam2', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'otherStringParam2'), + ); }); } QueryBuilder - dummy2IsNotNull() { + dummy2IsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'otherStringParam2', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'otherStringParam2'), + ); }); } QueryBuilder - dummy2EqualTo( - String? value, { - bool caseSensitive = true, - }) { + dummy2EqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherStringParam2', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy2GreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy2LessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy2Between( + dummy2Between( String? lower, String? upper, { bool includeLower = true, @@ -31452,153 +32512,158 @@ extension ThemeAssetsV3QueryFilter 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, - )); + 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, - }) { + dummy2StartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'otherStringParam2', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy2EndsWith( - String value, { - bool caseSensitive = true, - }) { + dummy2EndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'otherStringParam2', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy2Contains(String value, {bool caseSensitive = true}) { + dummy2Contains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'otherStringParam2', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'otherStringParam2', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy2Matches(String pattern, {bool caseSensitive = true}) { + dummy2Matches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'otherStringParam2', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'otherStringParam2', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy2IsEmpty() { + dummy2IsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherStringParam2', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'otherStringParam2', value: ''), + ); }); } QueryBuilder - dummy2IsNotEmpty() { + dummy2IsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'otherStringParam2', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'otherStringParam2', value: ''), + ); }); } QueryBuilder - dummy3IsNull() { + dummy3IsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'otherStringParam3', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'otherStringParam3'), + ); }); } QueryBuilder - dummy3IsNotNull() { + dummy3IsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'otherStringParam3', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'otherStringParam3'), + ); }); } QueryBuilder - dummy3EqualTo( - String? value, { - bool caseSensitive = true, - }) { + dummy3EqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherStringParam3', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy3GreaterThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy3LessThan( + 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy3Between( + dummy3Between( String? lower, String? upper, { bool includeLower = true, @@ -31606,135 +32671,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + 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, - }) { + dummy3StartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'otherStringParam3', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy3EndsWith( - String value, { - bool caseSensitive = true, - }) { + dummy3EndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'otherStringParam3', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy3Contains(String value, {bool caseSensitive = true}) { + dummy3Contains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'otherStringParam3', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'otherStringParam3', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy3Matches(String pattern, {bool caseSensitive = true}) { + dummy3Matches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'otherStringParam3', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'otherStringParam3', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - dummy3IsEmpty() { + dummy3IsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherStringParam3', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'otherStringParam3', value: ''), + ); }); } QueryBuilder - dummy3IsNotEmpty() { + dummy3IsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'otherStringParam3', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'otherStringParam3', value: ''), + ); }); } QueryBuilder - personaEasyRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + personaEasyRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaEasy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyRelativeGreaterThan( + personaEasyRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyRelativeLessThan( + personaEasyRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyRelativeBetween( + personaEasyRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -31742,135 +32812,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'personaEasy', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + personaEasyRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'personaEasy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + personaEasyRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'personaEasy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyRelativeContains(String value, {bool caseSensitive = true}) { + personaEasyRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'personaEasy', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'personaEasy', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyRelativeMatches(String pattern, {bool caseSensitive = true}) { + personaEasyRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'personaEasy', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'personaEasy', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaEasyRelativeIsEmpty() { + personaEasyRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaEasy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'personaEasy', value: ''), + ); }); } QueryBuilder - personaEasyRelativeIsNotEmpty() { + personaEasyRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'personaEasy', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'personaEasy', value: ''), + ); }); } QueryBuilder - personaIncognitoRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + personaIncognitoRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaIncognito', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoRelativeGreaterThan( + personaIncognitoRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoRelativeLessThan( + personaIncognitoRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoRelativeBetween( + personaIncognitoRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -31878,137 +32953,143 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'personaIncognito', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoRelativeStartsWith( + personaIncognitoRelativeStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'personaIncognito', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + personaIncognitoRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'personaIncognito', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoRelativeContains(String value, - {bool caseSensitive = true}) { + personaIncognitoRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'personaIncognito', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'personaIncognito', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoRelativeMatches(String pattern, - {bool caseSensitive = true}) { + personaIncognitoRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'personaIncognito', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'personaIncognito', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - personaIncognitoRelativeIsEmpty() { + personaIncognitoRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'personaIncognito', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'personaIncognito', value: ''), + ); }); } QueryBuilder - personaIncognitoRelativeIsNotEmpty() { + personaIncognitoRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'personaIncognito', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'personaIncognito', value: ''), + ); }); } QueryBuilder - receiveRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + receiveRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receive', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveRelativeGreaterThan( + receiveRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveRelativeLessThan( + receiveRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveRelativeBetween( + receiveRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32016,135 +33097,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'receive', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + receiveRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'receive', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + receiveRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'receive', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveRelativeContains(String value, {bool caseSensitive = true}) { + receiveRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'receive', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'receive', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveRelativeMatches(String pattern, {bool caseSensitive = true}) { + receiveRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'receive', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'receive', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveRelativeIsEmpty() { + receiveRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receive', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receive', value: ''), + ); }); } QueryBuilder - receiveRelativeIsNotEmpty() { + receiveRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receive', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'receive', value: ''), + ); }); } QueryBuilder - receiveCancelledRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + receiveCancelledRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receiveCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledRelativeGreaterThan( + receiveCancelledRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledRelativeLessThan( + receiveCancelledRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledRelativeBetween( + receiveCancelledRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32152,137 +33238,143 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'receiveCancelled', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledRelativeStartsWith( + receiveCancelledRelativeStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'receiveCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + receiveCancelledRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'receiveCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledRelativeContains(String value, - {bool caseSensitive = true}) { + receiveCancelledRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'receiveCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'receiveCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledRelativeMatches(String pattern, - {bool caseSensitive = true}) { + receiveCancelledRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'receiveCancelled', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'receiveCancelled', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receiveCancelledRelativeIsEmpty() { + receiveCancelledRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receiveCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receiveCancelled', value: ''), + ); }); } QueryBuilder - receiveCancelledRelativeIsNotEmpty() { + receiveCancelledRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receiveCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'receiveCancelled', value: ''), + ); }); } QueryBuilder - receivePendingRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + receivePendingRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receivePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingRelativeGreaterThan( + receivePendingRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingRelativeLessThan( + receivePendingRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingRelativeBetween( + receivePendingRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32290,137 +33382,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'receivePending', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + receivePendingRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'receivePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + receivePendingRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'receivePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingRelativeContains(String value, - {bool caseSensitive = true}) { + receivePendingRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'receivePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'receivePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingRelativeMatches(String pattern, - {bool caseSensitive = true}) { + receivePendingRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'receivePending', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'receivePending', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - receivePendingRelativeIsEmpty() { + receivePendingRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'receivePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'receivePending', value: ''), + ); }); } QueryBuilder - receivePendingRelativeIsNotEmpty() { + receivePendingRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'receivePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'receivePending', value: ''), + ); }); } QueryBuilder - sendRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + sendRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendRelativeGreaterThan( + sendRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendRelativeLessThan( + sendRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendRelativeBetween( + sendRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32428,135 +33523,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'send', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + sendRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + sendRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendRelativeContains(String value, {bool caseSensitive = true}) { + sendRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'send', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'send', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendRelativeMatches(String pattern, {bool caseSensitive = true}) { + sendRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'send', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'send', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendRelativeIsEmpty() { + sendRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'send', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'send', value: ''), + ); }); } QueryBuilder - sendRelativeIsNotEmpty() { + sendRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'send', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'send', value: ''), + ); }); } QueryBuilder - sendCancelledRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + sendCancelledRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledRelativeGreaterThan( + sendCancelledRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledRelativeLessThan( + sendCancelledRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledRelativeBetween( + sendCancelledRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32564,136 +33664,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'sendCancelled', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + sendCancelledRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'sendCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + sendCancelledRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'sendCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledRelativeContains(String value, {bool caseSensitive = true}) { + sendCancelledRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'sendCancelled', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'sendCancelled', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledRelativeMatches(String pattern, - {bool caseSensitive = true}) { + sendCancelledRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'sendCancelled', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'sendCancelled', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendCancelledRelativeIsEmpty() { + sendCancelledRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'sendCancelled', value: ''), + ); }); } QueryBuilder - sendCancelledRelativeIsNotEmpty() { + sendCancelledRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'sendCancelled', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'sendCancelled', value: ''), + ); }); } QueryBuilder - sendPendingRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + sendPendingRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendPending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingRelativeGreaterThan( + sendPendingRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingRelativeLessThan( + sendPendingRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingRelativeBetween( + sendPendingRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32701,135 +33805,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'sendPending', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + sendPendingRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'sendPending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + sendPendingRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'sendPending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingRelativeContains(String value, {bool caseSensitive = true}) { + sendPendingRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'sendPending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'sendPending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingRelativeMatches(String pattern, {bool caseSensitive = true}) { + sendPendingRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'sendPending', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'sendPending', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - sendPendingRelativeIsEmpty() { + sendPendingRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'sendPending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'sendPending', value: ''), + ); }); } QueryBuilder - sendPendingRelativeIsNotEmpty() { + sendPendingRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'sendPending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'sendPending', value: ''), + ); }); } QueryBuilder - stackRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + stackRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackRelativeGreaterThan( + stackRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackRelativeLessThan( + stackRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackRelativeBetween( + stackRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32837,135 +33946,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stack', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + stackRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + stackRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackRelativeContains(String value, {bool caseSensitive = true}) { + stackRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'stack', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'stack', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackRelativeMatches(String pattern, {bool caseSensitive = true}) { + stackRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'stack', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'stack', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackRelativeIsEmpty() { + stackRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stack', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'stack', value: ''), + ); }); } QueryBuilder - stackRelativeIsNotEmpty() { + stackRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'stack', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'stack', value: ''), + ); }); } QueryBuilder - stackIconRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + stackIconRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stackIcon', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconRelativeGreaterThan( + stackIconRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconRelativeLessThan( + stackIconRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconRelativeBetween( + stackIconRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -32973,135 +34087,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'stackIcon', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + stackIconRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'stackIcon', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + stackIconRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'stackIcon', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconRelativeContains(String value, {bool caseSensitive = true}) { + stackIconRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'stackIcon', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'stackIcon', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconRelativeMatches(String pattern, {bool caseSensitive = true}) { + stackIconRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'stackIcon', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'stackIcon', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - stackIconRelativeIsEmpty() { + stackIconRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'stackIcon', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'stackIcon', value: ''), + ); }); } QueryBuilder - stackIconRelativeIsNotEmpty() { + stackIconRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'stackIcon', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'stackIcon', value: ''), + ); }); } QueryBuilder - themePreviewRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + themePreviewRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themePreview', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewRelativeGreaterThan( + themePreviewRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewRelativeLessThan( + themePreviewRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewRelativeBetween( + themePreviewRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33109,135 +34228,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'themePreview', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + themePreviewRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'themePreview', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + themePreviewRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'themePreview', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewRelativeContains(String value, {bool caseSensitive = true}) { + themePreviewRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'themePreview', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'themePreview', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewRelativeMatches(String pattern, {bool caseSensitive = true}) { + themePreviewRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'themePreview', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'themePreview', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themePreviewRelativeIsEmpty() { + themePreviewRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themePreview', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'themePreview', value: ''), + ); }); } QueryBuilder - themePreviewRelativeIsNotEmpty() { + themePreviewRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'themePreview', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'themePreview', value: ''), + ); }); } QueryBuilder - themeSelectorRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + themeSelectorRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themeSelector', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorRelativeGreaterThan( + themeSelectorRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorRelativeLessThan( + themeSelectorRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorRelativeBetween( + themeSelectorRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33245,136 +34369,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'themeSelector', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + themeSelectorRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'themeSelector', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + themeSelectorRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'themeSelector', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorRelativeContains(String value, {bool caseSensitive = true}) { + themeSelectorRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'themeSelector', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'themeSelector', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorRelativeMatches(String pattern, - {bool caseSensitive = true}) { + themeSelectorRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'themeSelector', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'themeSelector', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - themeSelectorRelativeIsEmpty() { + themeSelectorRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'themeSelector', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'themeSelector', value: ''), + ); }); } QueryBuilder - themeSelectorRelativeIsNotEmpty() { + themeSelectorRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'themeSelector', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'themeSelector', value: ''), + ); }); } QueryBuilder - txExchangeRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + txExchangeRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeRelativeGreaterThan( + txExchangeRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeRelativeLessThan( + txExchangeRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeRelativeBetween( + txExchangeRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33382,135 +34510,140 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txExchange', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeRelativeStartsWith( - String value, { - bool caseSensitive = true, - }) { + txExchangeRelativeStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txExchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + txExchangeRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txExchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeRelativeContains(String value, {bool caseSensitive = true}) { + txExchangeRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txExchange', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txExchange', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeRelativeMatches(String pattern, {bool caseSensitive = true}) { + txExchangeRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txExchange', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txExchange', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeRelativeIsEmpty() { + txExchangeRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchange', value: ''), + ); }); } QueryBuilder - txExchangeRelativeIsNotEmpty() { + txExchangeRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchange', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txExchange', value: ''), + ); }); } QueryBuilder - txExchangeFailedRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + txExchangeFailedRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangeFailed', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedRelativeGreaterThan( + txExchangeFailedRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedRelativeLessThan( + txExchangeFailedRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedRelativeBetween( + txExchangeFailedRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33518,137 +34651,143 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txExchangeFailed', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedRelativeStartsWith( + txExchangeFailedRelativeStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txExchangeFailed', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + txExchangeFailedRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txExchangeFailed', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedRelativeContains(String value, - {bool caseSensitive = true}) { + txExchangeFailedRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txExchangeFailed', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txExchangeFailed', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedRelativeMatches(String pattern, - {bool caseSensitive = true}) { + txExchangeFailedRelativeMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txExchangeFailed', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txExchangeFailed', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangeFailedRelativeIsEmpty() { + txExchangeFailedRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangeFailed', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchangeFailed', value: ''), + ); }); } QueryBuilder - txExchangeFailedRelativeIsNotEmpty() { + txExchangeFailedRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchangeFailed', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txExchangeFailed', value: ''), + ); }); } QueryBuilder - txExchangePendingRelativeEqualTo( - String value, { - bool caseSensitive = true, - }) { + txExchangePendingRelativeEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingRelativeGreaterThan( + txExchangePendingRelativeGreaterThan( 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, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingRelativeLessThan( + txExchangePendingRelativeLessThan( 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, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingRelativeBetween( + txExchangePendingRelativeBetween( String lower, String upper, { bool includeLower = true, @@ -33656,86 +34795,92 @@ extension ThemeAssetsV3QueryFilter 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, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txExchangePending', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingRelativeStartsWith( + txExchangePendingRelativeStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txExchangePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingRelativeEndsWith( - String value, { - bool caseSensitive = true, - }) { + txExchangePendingRelativeEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txExchangePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingRelativeContains(String value, - {bool caseSensitive = true}) { + txExchangePendingRelativeContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txExchangePending', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txExchangePending', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingRelativeMatches(String pattern, - {bool caseSensitive = true}) { + txExchangePendingRelativeMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txExchangePending', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txExchangePending', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - txExchangePendingRelativeIsEmpty() { + txExchangePendingRelativeIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txExchangePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txExchangePending', value: ''), + ); }); } QueryBuilder - txExchangePendingRelativeIsNotEmpty() { + txExchangePendingRelativeIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txExchangePending', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txExchangePending', value: ''), + ); }); } } diff --git a/lib/wallets/isar/models/frost_wallet_info.g.dart b/lib/wallets/isar/models/frost_wallet_info.g.dart index a2c7534d09..459bff7e17 100644 --- a/lib/wallets/isar/models/frost_wallet_info.g.dart +++ b/lib/wallets/isar/models/frost_wallet_info.g.dart @@ -22,11 +22,7 @@ const FrostWalletInfoSchema = CollectionSchema( name: r'knownSalts', type: IsarType.stringList, ), - r'myName': PropertySchema( - id: 1, - name: r'myName', - type: IsarType.string, - ), + r'myName': PropertySchema(id: 1, name: r'myName', type: IsarType.string), r'participants': PropertySchema( id: 2, name: r'participants', @@ -41,8 +37,9 @@ const FrostWalletInfoSchema = CollectionSchema( id: 4, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _frostWalletInfoEstimateSize, serialize: _frostWalletInfoSerialize, deserialize: _frostWalletInfoDeserialize, @@ -59,16 +56,17 @@ const FrostWalletInfoSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _frostWalletInfoGetId, getLinks: _frostWalletInfoGetLinks, attach: _frostWalletInfoAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _frostWalletInfoEstimateSize( @@ -157,7 +155,10 @@ List> _frostWalletInfoGetLinks(FrostWalletInfo object) { } void _frostWalletInfoAttach( - IsarCollection col, Id id, FrostWalletInfo object) { + IsarCollection col, + Id id, + FrostWalletInfo object, +) { object.id = id; } @@ -210,8 +211,10 @@ extension FrostWalletInfoByIndex on IsarCollection { return putAllByIndex(r'walletId', objects); } - List putAllByWalletIdSync(List objects, - {bool saveLinks = true}) { + List putAllByWalletIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'walletId', objects, saveLinks: saveLinks); } } @@ -228,17 +231,15 @@ extension FrostWalletInfoQueryWhereSort extension FrostWalletInfoQueryWhere on QueryBuilder { QueryBuilder idEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder - idNotEqualTo(Id id) { + idNotEqualTo(Id id) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -261,7 +262,7 @@ extension FrostWalletInfoQueryWhere } QueryBuilder - idGreaterThan(Id id, {bool include = false}) { + idGreaterThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -270,8 +271,9 @@ extension FrostWalletInfoQueryWhere } QueryBuilder idLessThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -286,56 +288,65 @@ extension FrostWalletInfoQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - walletIdEqualTo(String walletId) { + walletIdEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder - walletIdNotEqualTo(String walletId) { + walletIdNotEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } @@ -344,109 +355,111 @@ extension FrostWalletInfoQueryWhere extension FrostWalletInfoQueryFilter on QueryBuilder { QueryBuilder - idEqualTo(Id value) { + idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } QueryBuilder - idGreaterThan( - Id value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + idGreaterThan(Id value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } QueryBuilder - idLessThan( - Id value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + idLessThan(Id value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } QueryBuilder - idBetween( + idBetween( Id lower, Id upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - knownSaltsElementEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'knownSalts', - value: value, - caseSensitive: caseSensitive, - )); + knownSaltsElementEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'knownSalts', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - knownSaltsElementGreaterThan( + knownSaltsElementGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'knownSalts', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'knownSalts', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - knownSaltsElementLessThan( + knownSaltsElementLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'knownSalts', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'knownSalts', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - knownSaltsElementBetween( + knownSaltsElementBetween( String lower, String upper, { bool includeLower = true, @@ -454,160 +467,126 @@ extension FrostWalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'knownSalts', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'knownSalts', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - knownSaltsElementStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'knownSalts', - value: value, - caseSensitive: caseSensitive, - )); + knownSaltsElementStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'knownSalts', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - knownSaltsElementEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'knownSalts', - value: value, - caseSensitive: caseSensitive, - )); + knownSaltsElementEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'knownSalts', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - knownSaltsElementContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'knownSalts', - value: value, - caseSensitive: caseSensitive, - )); + knownSaltsElementContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'knownSalts', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - knownSaltsElementMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'knownSalts', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + knownSaltsElementMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'knownSalts', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - knownSaltsElementIsEmpty() { + knownSaltsElementIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'knownSalts', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'knownSalts', value: ''), + ); }); } QueryBuilder - knownSaltsElementIsNotEmpty() { + knownSaltsElementIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'knownSalts', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'knownSalts', value: ''), + ); }); } QueryBuilder - knownSaltsLengthEqualTo(int length) { + knownSaltsLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'knownSalts', - length, - true, - length, - true, - ); + return query.listLength(r'knownSalts', length, true, length, true); }); } QueryBuilder - knownSaltsIsEmpty() { + knownSaltsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'knownSalts', - 0, - true, - 0, - true, - ); + return query.listLength(r'knownSalts', 0, true, 0, true); }); } QueryBuilder - knownSaltsIsNotEmpty() { + knownSaltsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'knownSalts', - 0, - false, - 999999, - true, - ); + return query.listLength(r'knownSalts', 0, false, 999999, true); }); } QueryBuilder - knownSaltsLengthLessThan( - int length, { - bool include = false, - }) { + knownSaltsLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'knownSalts', - 0, - true, - length, - include, - ); + return query.listLength(r'knownSalts', 0, true, length, include); }); } QueryBuilder - knownSaltsLengthGreaterThan( - int length, { - bool include = false, - }) { + knownSaltsLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'knownSalts', - length, - include, - 999999, - true, - ); + return query.listLength(r'knownSalts', length, include, 999999, true); }); } QueryBuilder - knownSaltsLengthBetween( + knownSaltsLengthBetween( int lower, int upper, { bool includeLower = true, @@ -625,53 +604,56 @@ extension FrostWalletInfoQueryFilter } QueryBuilder - myNameEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'myName', - value: value, - caseSensitive: caseSensitive, - )); + myNameEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'myName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - myNameGreaterThan( + myNameGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'myName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'myName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - myNameLessThan( + myNameLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'myName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'myName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - myNameBetween( + myNameBetween( String lower, String upper, { bool includeLower = true, @@ -679,135 +661,140 @@ extension FrostWalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'myName', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'myName', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - myNameStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'myName', - value: value, - caseSensitive: caseSensitive, - )); + myNameStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'myName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - myNameEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'myName', - value: value, - caseSensitive: caseSensitive, - )); + myNameEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'myName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - myNameContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'myName', - value: value, - caseSensitive: caseSensitive, - )); + myNameContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'myName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - myNameMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'myName', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + myNameMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'myName', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - myNameIsEmpty() { + myNameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'myName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'myName', value: ''), + ); }); } QueryBuilder - myNameIsNotEmpty() { + myNameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'myName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'myName', value: ''), + ); }); } QueryBuilder - participantsElementEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'participants', - value: value, - caseSensitive: caseSensitive, - )); + participantsElementEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'participants', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - participantsElementGreaterThan( + participantsElementGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'participants', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'participants', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - participantsElementLessThan( + participantsElementLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'participants', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'participants', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - participantsElementBetween( + participantsElementBetween( String lower, String upper, { bool includeLower = true, @@ -815,160 +802,126 @@ extension FrostWalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'participants', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'participants', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - participantsElementStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'participants', - value: value, - caseSensitive: caseSensitive, - )); + participantsElementStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'participants', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - participantsElementEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'participants', - value: value, - caseSensitive: caseSensitive, - )); + participantsElementEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'participants', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - participantsElementContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'participants', - value: value, - caseSensitive: caseSensitive, - )); + participantsElementContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'participants', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - participantsElementMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'participants', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + participantsElementMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'participants', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - participantsElementIsEmpty() { + participantsElementIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'participants', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'participants', value: ''), + ); }); } QueryBuilder - participantsElementIsNotEmpty() { + participantsElementIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'participants', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'participants', value: ''), + ); }); } QueryBuilder - participantsLengthEqualTo(int length) { + participantsLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'participants', - length, - true, - length, - true, - ); + return query.listLength(r'participants', length, true, length, true); }); } QueryBuilder - participantsIsEmpty() { + participantsIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'participants', - 0, - true, - 0, - true, - ); + return query.listLength(r'participants', 0, true, 0, true); }); } QueryBuilder - participantsIsNotEmpty() { + participantsIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'participants', - 0, - false, - 999999, - true, - ); + return query.listLength(r'participants', 0, false, 999999, true); }); } QueryBuilder - participantsLengthLessThan( - int length, { - bool include = false, - }) { + participantsLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'participants', - 0, - true, - length, - include, - ); + return query.listLength(r'participants', 0, true, length, include); }); } QueryBuilder - participantsLengthGreaterThan( - int length, { - bool include = false, - }) { + participantsLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'participants', - length, - include, - 999999, - true, - ); + return query.listLength(r'participants', length, include, 999999, true); }); } QueryBuilder - participantsLengthBetween( + participantsLengthBetween( int lower, int upper, { bool includeLower = true, @@ -986,109 +939,111 @@ extension FrostWalletInfoQueryFilter } QueryBuilder - thresholdEqualTo(int value) { + thresholdEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'threshold', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'threshold', value: value), + ); }); } QueryBuilder - thresholdGreaterThan( - int value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'threshold', - value: value, - )); + thresholdGreaterThan(int value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'threshold', + value: value, + ), + ); }); } QueryBuilder - thresholdLessThan( - int value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'threshold', - value: value, - )); + thresholdLessThan(int value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'threshold', + value: value, + ), + ); }); } QueryBuilder - thresholdBetween( + thresholdBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'threshold', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'threshold', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - walletIdEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + walletIdEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdLessThan( + walletIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdBetween( + walletIdBetween( String lower, String upper, { bool includeLower = true, @@ -1096,84 +1051,86 @@ extension FrostWalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + walletIdStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + walletIdEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + walletIdContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + walletIdMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -1193,35 +1150,35 @@ extension FrostWalletInfoQuerySortBy } QueryBuilder - sortByMyNameDesc() { + sortByMyNameDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'myName', Sort.desc); }); } QueryBuilder - sortByThreshold() { + sortByThreshold() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'threshold', Sort.asc); }); } QueryBuilder - sortByThresholdDesc() { + sortByThresholdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'threshold', Sort.desc); }); } QueryBuilder - sortByWalletId() { + sortByWalletId() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.asc); }); } QueryBuilder - sortByWalletIdDesc() { + sortByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -1249,35 +1206,35 @@ extension FrostWalletInfoQuerySortThenBy } QueryBuilder - thenByMyNameDesc() { + thenByMyNameDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'myName', Sort.desc); }); } QueryBuilder - thenByThreshold() { + thenByThreshold() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'threshold', Sort.asc); }); } QueryBuilder - thenByThresholdDesc() { + thenByThresholdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'threshold', Sort.desc); }); } QueryBuilder - thenByWalletId() { + thenByWalletId() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.asc); }); } QueryBuilder - thenByWalletIdDesc() { + thenByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -1287,35 +1244,37 @@ extension FrostWalletInfoQuerySortThenBy extension FrostWalletInfoQueryWhereDistinct on QueryBuilder { QueryBuilder - distinctByKnownSalts() { + distinctByKnownSalts() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'knownSalts'); }); } - QueryBuilder distinctByMyName( - {bool caseSensitive = true}) { + QueryBuilder distinctByMyName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'myName', caseSensitive: caseSensitive); }); } QueryBuilder - distinctByParticipants() { + distinctByParticipants() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'participants'); }); } QueryBuilder - distinctByThreshold() { + distinctByThreshold() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'threshold'); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); @@ -1331,7 +1290,7 @@ extension FrostWalletInfoQueryProperty } QueryBuilder, QQueryOperations> - knownSaltsProperty() { + knownSaltsProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'knownSalts'); }); @@ -1344,7 +1303,7 @@ extension FrostWalletInfoQueryProperty } QueryBuilder, QQueryOperations> - participantsProperty() { + participantsProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'participants'); }); diff --git a/lib/wallets/isar/models/spark_coin.g.dart b/lib/wallets/isar/models/spark_coin.g.dart index c84e0db40e..adbb522c6b 100644 --- a/lib/wallets/isar/models/spark_coin.g.dart +++ b/lib/wallets/isar/models/spark_coin.g.dart @@ -17,11 +17,7 @@ const SparkCoinSchema = CollectionSchema( name: r'SparkCoin', id: -187103855721793545, properties: { - r'address': PropertySchema( - id: 0, - name: r'address', - type: IsarType.string, - ), + r'address': PropertySchema(id: 0, name: r'address', type: IsarType.string), r'contextB64': PropertySchema( id: 1, name: r'contextB64', @@ -37,41 +33,17 @@ const SparkCoinSchema = CollectionSchema( name: r'encryptedDiversifier', type: IsarType.longList, ), - r'groupId': PropertySchema( - id: 4, - name: r'groupId', - type: IsarType.long, - ), - r'height': PropertySchema( - id: 5, - name: r'height', - type: IsarType.long, - ), - r'isUsed': PropertySchema( - id: 6, - name: r'isUsed', - type: IsarType.bool, - ), + r'groupId': PropertySchema(id: 4, name: r'groupId', type: IsarType.long), + r'height': PropertySchema(id: 5, name: r'height', type: IsarType.long), + r'isUsed': PropertySchema(id: 6, name: r'isUsed', type: IsarType.bool), r'lTagHash': PropertySchema( id: 7, name: r'lTagHash', type: IsarType.string, ), - r'memo': PropertySchema( - id: 8, - name: r'memo', - type: IsarType.string, - ), - r'nonce': PropertySchema( - id: 9, - name: r'nonce', - type: IsarType.longList, - ), - r'serial': PropertySchema( - id: 10, - name: r'serial', - type: IsarType.longList, - ), + r'memo': PropertySchema(id: 8, name: r'memo', type: IsarType.string), + r'nonce': PropertySchema(id: 9, name: r'nonce', type: IsarType.longList), + r'serial': PropertySchema(id: 10, name: r'serial', type: IsarType.longList), r'serialContext': PropertySchema( id: 11, name: r'serialContext', @@ -82,16 +54,8 @@ const SparkCoinSchema = CollectionSchema( name: r'serializedCoinB64', type: IsarType.string, ), - r'tag': PropertySchema( - id: 13, - name: r'tag', - type: IsarType.longList, - ), - r'txHash': PropertySchema( - id: 14, - name: r'txHash', - type: IsarType.string, - ), + r'tag': PropertySchema(id: 13, name: r'tag', type: IsarType.longList), + r'txHash': PropertySchema(id: 14, name: r'txHash', type: IsarType.string), r'type': PropertySchema( id: 15, name: r'type', @@ -112,8 +76,9 @@ const SparkCoinSchema = CollectionSchema( id: 18, name: r'zzzIsLocked', type: IsarType.bool, - ) + ), }, + estimateSize: _sparkCoinEstimateSize, serialize: _sparkCoinSerialize, deserialize: _sparkCoinDeserialize, @@ -135,16 +100,17 @@ const SparkCoinSchema = CollectionSchema( name: r'lTagHash', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _sparkCoinGetId, getLinks: _sparkCoinGetLinks, attach: _sparkCoinAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _sparkCoinEstimateSize( @@ -259,7 +225,8 @@ SparkCoin _sparkCoinDeserialize( serializedCoinB64: reader.readStringOrNull(offsets[12]), tag: reader.readLongList(offsets[13]), txHash: reader.readString(offsets[14]), - type: _SparkCointypeValueEnumMap[reader.readByteOrNull(offsets[15])] ?? + type: + _SparkCointypeValueEnumMap[reader.readByteOrNull(offsets[15])] ?? SparkCoinType.mint, valueIntString: reader.readString(offsets[16]), walletId: reader.readString(offsets[17]), @@ -308,7 +275,8 @@ P _sparkCoinDeserializeProp

( return (reader.readString(offset)) as P; case 15: return (_SparkCointypeValueEnumMap[reader.readByteOrNull(offset)] ?? - SparkCoinType.mint) as P; + SparkCoinType.mint) + as P; case 16: return (reader.readString(offset)) as P; case 17: @@ -320,10 +288,7 @@ P _sparkCoinDeserializeProp

( } } -const _SparkCointypeEnumValueMap = { - 'mint': 0, - 'spend': 1, -}; +const _SparkCointypeEnumValueMap = {'mint': 0, 'spend': 1}; const _SparkCointypeValueEnumMap = { 0: SparkCoinType.mint, 1: SparkCoinType.spend, @@ -359,10 +324,14 @@ extension SparkCoinByIndex on IsarCollection { } Future> getAllByWalletIdLTagHash( - List walletIdValues, List lTagHashValues) { + List walletIdValues, + List lTagHashValues, + ) { final len = walletIdValues.length; - assert(lTagHashValues.length == len, - 'All index values must have the same length'); + assert( + lTagHashValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([walletIdValues[i], lTagHashValues[i]]); @@ -372,10 +341,14 @@ extension SparkCoinByIndex on IsarCollection { } List getAllByWalletIdLTagHashSync( - List walletIdValues, List lTagHashValues) { + List walletIdValues, + List lTagHashValues, + ) { final len = walletIdValues.length; - assert(lTagHashValues.length == len, - 'All index values must have the same length'); + assert( + lTagHashValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([walletIdValues[i], lTagHashValues[i]]); @@ -385,10 +358,14 @@ extension SparkCoinByIndex on IsarCollection { } Future deleteAllByWalletIdLTagHash( - List walletIdValues, List lTagHashValues) { + List walletIdValues, + List lTagHashValues, + ) { final len = walletIdValues.length; - assert(lTagHashValues.length == len, - 'All index values must have the same length'); + assert( + lTagHashValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([walletIdValues[i], lTagHashValues[i]]); @@ -398,10 +375,14 @@ extension SparkCoinByIndex on IsarCollection { } int deleteAllByWalletIdLTagHashSync( - List walletIdValues, List lTagHashValues) { + List walletIdValues, + List lTagHashValues, + ) { final len = walletIdValues.length; - assert(lTagHashValues.length == len, - 'All index values must have the same length'); + assert( + lTagHashValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([walletIdValues[i], lTagHashValues[i]]); @@ -422,10 +403,15 @@ extension SparkCoinByIndex on IsarCollection { return putAllByIndex(r'walletId_lTagHash', objects); } - List putAllByWalletIdLTagHashSync(List objects, - {bool saveLinks = true}) { - return putAllByIndexSync(r'walletId_lTagHash', objects, - saveLinks: saveLinks); + List putAllByWalletIdLTagHashSync( + List objects, { + bool saveLinks = true, + }) { + return putAllByIndexSync( + r'walletId_lTagHash', + objects, + saveLinks: saveLinks, + ); } } @@ -442,10 +428,7 @@ extension SparkCoinQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -471,8 +454,10 @@ extension SparkCoinQueryWhere }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -480,8 +465,10 @@ extension SparkCoinQueryWhere }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -496,101 +483,125 @@ extension SparkCoinQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - walletIdEqualToAnyLTagHash(String walletId) { + walletIdEqualToAnyLTagHash(String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId_lTagHash', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'walletId_lTagHash', + value: [walletId], + ), + ); }); } QueryBuilder - walletIdNotEqualToAnyLTagHash(String walletId) { + walletIdNotEqualToAnyLTagHash(String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_lTagHash', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_lTagHash', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_lTagHash', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_lTagHash', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_lTagHash', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_lTagHash', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_lTagHash', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_lTagHash', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder walletIdLTagHashEqualTo( - String walletId, String lTagHash) { + String walletId, + String lTagHash, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId_lTagHash', - value: [walletId, lTagHash], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'walletId_lTagHash', + value: [walletId, lTagHash], + ), + ); }); } QueryBuilder - walletIdEqualToLTagHashNotEqualTo(String walletId, String lTagHash) { + walletIdEqualToLTagHashNotEqualTo(String walletId, String lTagHash) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_lTagHash', - lower: [walletId], - upper: [walletId, lTagHash], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_lTagHash', - lower: [walletId, lTagHash], - includeLower: false, - upper: [walletId], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_lTagHash', + lower: [walletId], + upper: [walletId, lTagHash], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_lTagHash', + lower: [walletId, lTagHash], + includeLower: false, + upper: [walletId], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_lTagHash', - lower: [walletId, lTagHash], - includeLower: false, - upper: [walletId], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_lTagHash', - lower: [walletId], - upper: [walletId, lTagHash], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_lTagHash', + lower: [walletId, lTagHash], + includeLower: false, + upper: [walletId], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_lTagHash', + lower: [walletId], + upper: [walletId, lTagHash], + includeUpper: false, + ), + ); } }); } @@ -603,11 +614,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -617,12 +630,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -632,12 +647,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -649,14 +666,16 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'address', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'address', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -665,11 +684,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -678,71 +699,77 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder addressContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'address', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'address', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder addressMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'address', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'address', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder addressIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'address', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'address', value: ''), + ); }); } QueryBuilder - addressIsNotEmpty() { + addressIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'address', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'address', value: ''), + ); }); } QueryBuilder contextB64IsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'contextB64', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'contextB64'), + ); }); } QueryBuilder - contextB64IsNotNull() { + contextB64IsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'contextB64', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'contextB64'), + ); }); } @@ -751,27 +778,31 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'contextB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'contextB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contextB64GreaterThan( + contextB64GreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'contextB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'contextB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -781,12 +812,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'contextB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'contextB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -798,28 +831,29 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'contextB64', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'contextB64', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contextB64StartsWith( - String value, { - bool caseSensitive = true, - }) { + contextB64StartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'contextB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'contextB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -828,106 +862,115 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'contextB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'contextB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder contextB64Contains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'contextB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'contextB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder contextB64Matches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'contextB64', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'contextB64', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - contextB64IsEmpty() { + contextB64IsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'contextB64', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'contextB64', value: ''), + ); }); } QueryBuilder - contextB64IsNotEmpty() { + contextB64IsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'contextB64', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'contextB64', value: ''), + ); }); } QueryBuilder - diversifierIntStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + diversifierIntStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'diversifierIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'diversifierIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - diversifierIntStringGreaterThan( + diversifierIntStringGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'diversifierIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'diversifierIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - diversifierIntStringLessThan( + diversifierIntStringLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'diversifierIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'diversifierIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - diversifierIntStringBetween( + diversifierIntStringBetween( String lower, String upper, { bool includeLower = true, @@ -935,163 +978,170 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'diversifierIntString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'diversifierIntString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - diversifierIntStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + diversifierIntStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'diversifierIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'diversifierIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - diversifierIntStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + diversifierIntStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'diversifierIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'diversifierIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - diversifierIntStringContains(String value, {bool caseSensitive = true}) { + diversifierIntStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'diversifierIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'diversifierIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - diversifierIntStringMatches(String pattern, {bool caseSensitive = true}) { + diversifierIntStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'diversifierIntString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'diversifierIntString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - diversifierIntStringIsEmpty() { + diversifierIntStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'diversifierIntString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'diversifierIntString', value: ''), + ); }); } QueryBuilder - diversifierIntStringIsNotEmpty() { + diversifierIntStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'diversifierIntString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'diversifierIntString', + value: '', + ), + ); }); } QueryBuilder - encryptedDiversifierIsNull() { + encryptedDiversifierIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'encryptedDiversifier', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'encryptedDiversifier'), + ); }); } QueryBuilder - encryptedDiversifierIsNotNull() { + encryptedDiversifierIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'encryptedDiversifier', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'encryptedDiversifier'), + ); }); } QueryBuilder - encryptedDiversifierElementEqualTo(int value) { + encryptedDiversifierElementEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'encryptedDiversifier', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'encryptedDiversifier', + value: value, + ), + ); }); } QueryBuilder - encryptedDiversifierElementGreaterThan( - int value, { - bool include = false, - }) { + encryptedDiversifierElementGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'encryptedDiversifier', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'encryptedDiversifier', + value: value, + ), + ); }); } QueryBuilder - encryptedDiversifierElementLessThan( - int value, { - bool include = false, - }) { + encryptedDiversifierElementLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'encryptedDiversifier', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'encryptedDiversifier', + value: value, + ), + ); }); } QueryBuilder - encryptedDiversifierElementBetween( + encryptedDiversifierElementBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'encryptedDiversifier', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'encryptedDiversifier', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - encryptedDiversifierLengthEqualTo(int length) { + encryptedDiversifierLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { return query.listLength( r'encryptedDiversifier', @@ -1104,36 +1154,21 @@ extension SparkCoinQueryFilter } QueryBuilder - encryptedDiversifierIsEmpty() { + encryptedDiversifierIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'encryptedDiversifier', - 0, - true, - 0, - true, - ); + return query.listLength(r'encryptedDiversifier', 0, true, 0, true); }); } QueryBuilder - encryptedDiversifierIsNotEmpty() { + encryptedDiversifierIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'encryptedDiversifier', - 0, - false, - 999999, - true, - ); + return query.listLength(r'encryptedDiversifier', 0, false, 999999, true); }); } QueryBuilder - encryptedDiversifierLengthLessThan( - int length, { - bool include = false, - }) { + encryptedDiversifierLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.listLength( r'encryptedDiversifier', @@ -1146,10 +1181,7 @@ extension SparkCoinQueryFilter } QueryBuilder - encryptedDiversifierLengthGreaterThan( - int length, { - bool include = false, - }) { + encryptedDiversifierLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.listLength( r'encryptedDiversifier', @@ -1162,7 +1194,7 @@ extension SparkCoinQueryFilter } QueryBuilder - encryptedDiversifierLengthBetween( + encryptedDiversifierLengthBetween( int lower, int upper, { bool includeLower = true, @@ -1180,12 +1212,12 @@ extension SparkCoinQueryFilter } QueryBuilder groupIdEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'groupId', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'groupId', value: value), + ); }); } @@ -1194,11 +1226,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'groupId', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'groupId', + value: value, + ), + ); }); } @@ -1207,11 +1241,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'groupId', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'groupId', + value: value, + ), + ); }); } @@ -1222,39 +1258,41 @@ extension SparkCoinQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'groupId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'groupId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder heightIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'height', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'height'), + ); }); } QueryBuilder heightIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'height', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'height'), + ); }); } QueryBuilder heightEqualTo( - int? value) { + int? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'height', value: value), + ); }); } @@ -1263,11 +1301,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'height', + value: value, + ), + ); }); } @@ -1276,11 +1316,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'height', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'height', + value: value, + ), + ); }); } @@ -1291,23 +1333,25 @@ extension SparkCoinQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'height', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'height', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -1316,11 +1360,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1329,11 +1375,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1344,23 +1392,25 @@ extension SparkCoinQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder isUsedEqualTo( - bool value) { + bool value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isUsed', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isUsed', value: value), + ); }); } @@ -1369,11 +1419,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'lTagHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'lTagHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1383,12 +1435,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'lTagHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'lTagHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1398,12 +1452,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'lTagHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'lTagHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1415,14 +1471,16 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'lTagHash', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'lTagHash', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1431,11 +1489,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'lTagHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'lTagHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1444,70 +1504,76 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'lTagHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'lTagHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder lTagHashContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'lTagHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'lTagHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder lTagHashMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'lTagHash', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'lTagHash', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder lTagHashIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'lTagHash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'lTagHash', value: ''), + ); }); } QueryBuilder - lTagHashIsNotEmpty() { + lTagHashIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'lTagHash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'lTagHash', value: ''), + ); }); } QueryBuilder memoIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'memo', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'memo'), + ); }); } QueryBuilder memoIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'memo', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'memo'), + ); }); } @@ -1516,11 +1582,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'memo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'memo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1530,12 +1598,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'memo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'memo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1545,12 +1615,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'memo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'memo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1562,14 +1634,16 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'memo', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'memo', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1578,11 +1652,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'memo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'memo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1591,107 +1667,111 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'memo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'memo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder memoContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'memo', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'memo', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder memoMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'memo', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'memo', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder memoIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'memo', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'memo', value: ''), + ); }); } QueryBuilder memoIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'memo', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'memo', value: ''), + ); }); } QueryBuilder nonceIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'nonce', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'nonce'), + ); }); } QueryBuilder nonceIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'nonce', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'nonce'), + ); }); } QueryBuilder nonceElementEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'nonce', value: value), + ); }); } QueryBuilder - nonceElementGreaterThan( - int value, { - bool include = false, - }) { + nonceElementGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'nonce', + value: value, + ), + ); }); } QueryBuilder - nonceElementLessThan( - int value, { - bool include = false, - }) { + nonceElementLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'nonce', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'nonce', + value: value, + ), + ); }); } @@ -1702,50 +1782,35 @@ extension SparkCoinQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'nonce', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'nonce', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder nonceLengthEqualTo( - int length) { + int length, + ) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'nonce', - length, - true, - length, - true, - ); + return query.listLength(r'nonce', length, true, length, true); }); } QueryBuilder nonceIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'nonce', - 0, - true, - 0, - true, - ); + return query.listLength(r'nonce', 0, true, 0, true); }); } QueryBuilder nonceIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'nonce', - 0, - false, - 999999, - true, - ); + return query.listLength(r'nonce', 0, false, 999999, true); }); } @@ -1754,29 +1819,14 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'nonce', - 0, - true, - length, - include, - ); + return query.listLength(r'nonce', 0, true, length, include); }); } QueryBuilder - nonceLengthGreaterThan( - int length, { - bool include = false, - }) { + nonceLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'nonce', - length, - include, - 999999, - true, - ); + return query.listLength(r'nonce', length, include, 999999, true); }); } @@ -1799,142 +1849,106 @@ extension SparkCoinQueryFilter QueryBuilder serialIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'serial', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'serial'), + ); }); } QueryBuilder serialIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'serial', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'serial'), + ); }); } QueryBuilder - serialElementEqualTo(int value) { + serialElementEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'serial', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'serial', value: value), + ); }); } QueryBuilder - serialElementGreaterThan( - int value, { - bool include = false, - }) { + serialElementGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'serial', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'serial', + value: value, + ), + ); }); } QueryBuilder - serialElementLessThan( - int value, { - bool include = false, - }) { + serialElementLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'serial', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'serial', + value: value, + ), + ); }); } QueryBuilder - serialElementBetween( + serialElementBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'serial', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'serial', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder serialLengthEqualTo( - int length) { + int length, + ) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serial', - length, - true, - length, - true, - ); + return query.listLength(r'serial', length, true, length, true); }); } QueryBuilder serialIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serial', - 0, - true, - 0, - true, - ); + return query.listLength(r'serial', 0, true, 0, true); }); } QueryBuilder serialIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serial', - 0, - false, - 999999, - true, - ); + return query.listLength(r'serial', 0, false, 999999, true); }); } QueryBuilder - serialLengthLessThan( - int length, { - bool include = false, - }) { + serialLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serial', - 0, - true, - length, - include, - ); + return query.listLength(r'serial', 0, true, length, include); }); } QueryBuilder - serialLengthGreaterThan( - int length, { - bool include = false, - }) { + serialLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serial', - length, - include, - 999999, - true, - ); + return query.listLength(r'serial', length, include, 999999, true); }); } @@ -1956,152 +1970,115 @@ extension SparkCoinQueryFilter } QueryBuilder - serialContextIsNull() { + serialContextIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'serialContext', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'serialContext'), + ); }); } QueryBuilder - serialContextIsNotNull() { + serialContextIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'serialContext', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'serialContext'), + ); }); } QueryBuilder - serialContextElementEqualTo(int value) { + serialContextElementEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'serialContext', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'serialContext', value: value), + ); }); } QueryBuilder - serialContextElementGreaterThan( - int value, { - bool include = false, - }) { + serialContextElementGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'serialContext', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'serialContext', + value: value, + ), + ); }); } QueryBuilder - serialContextElementLessThan( - int value, { - bool include = false, - }) { + serialContextElementLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'serialContext', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'serialContext', + value: value, + ), + ); }); } QueryBuilder - serialContextElementBetween( + serialContextElementBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'serialContext', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'serialContext', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - serialContextLengthEqualTo(int length) { + serialContextLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serialContext', - length, - true, - length, - true, - ); + return query.listLength(r'serialContext', length, true, length, true); }); } QueryBuilder - serialContextIsEmpty() { + serialContextIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serialContext', - 0, - true, - 0, - true, - ); + return query.listLength(r'serialContext', 0, true, 0, true); }); } QueryBuilder - serialContextIsNotEmpty() { + serialContextIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serialContext', - 0, - false, - 999999, - true, - ); + return query.listLength(r'serialContext', 0, false, 999999, true); }); } QueryBuilder - serialContextLengthLessThan( - int length, { - bool include = false, - }) { + serialContextLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serialContext', - 0, - true, - length, - include, - ); + return query.listLength(r'serialContext', 0, true, length, include); }); } QueryBuilder - serialContextLengthGreaterThan( - int length, { - bool include = false, - }) { + serialContextLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'serialContext', - length, - include, - 999999, - true, - ); + return query.listLength(r'serialContext', length, include, 999999, true); }); } QueryBuilder - serialContextLengthBetween( + serialContextLengthBetween( int lower, int upper, { bool includeLower = true, @@ -2119,71 +2096,74 @@ extension SparkCoinQueryFilter } QueryBuilder - serializedCoinB64IsNull() { + serializedCoinB64IsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'serializedCoinB64', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'serializedCoinB64'), + ); }); } QueryBuilder - serializedCoinB64IsNotNull() { + serializedCoinB64IsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'serializedCoinB64', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'serializedCoinB64'), + ); }); } QueryBuilder - serializedCoinB64EqualTo( - String? value, { - bool caseSensitive = true, - }) { + serializedCoinB64EqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'serializedCoinB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'serializedCoinB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - serializedCoinB64GreaterThan( + serializedCoinB64GreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'serializedCoinB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'serializedCoinB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - serializedCoinB64LessThan( + serializedCoinB64LessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'serializedCoinB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'serializedCoinB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - serializedCoinB64Between( + serializedCoinB64Between( String? lower, String? upper, { bool includeLower = true, @@ -2191,124 +2171,125 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'serializedCoinB64', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'serializedCoinB64', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - serializedCoinB64StartsWith( - String value, { - bool caseSensitive = true, - }) { + serializedCoinB64StartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'serializedCoinB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'serializedCoinB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - serializedCoinB64EndsWith( - String value, { - bool caseSensitive = true, - }) { + serializedCoinB64EndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'serializedCoinB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'serializedCoinB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - serializedCoinB64Contains(String value, {bool caseSensitive = true}) { + serializedCoinB64Contains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'serializedCoinB64', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'serializedCoinB64', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - serializedCoinB64Matches(String pattern, {bool caseSensitive = true}) { + serializedCoinB64Matches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'serializedCoinB64', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'serializedCoinB64', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - serializedCoinB64IsEmpty() { + serializedCoinB64IsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'serializedCoinB64', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'serializedCoinB64', value: ''), + ); }); } QueryBuilder - serializedCoinB64IsNotEmpty() { + serializedCoinB64IsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'serializedCoinB64', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'serializedCoinB64', value: ''), + ); }); } QueryBuilder tagIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'tag', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'tag'), + ); }); } QueryBuilder tagIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'tag', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'tag'), + ); }); } QueryBuilder tagElementEqualTo( - int value) { + int value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tag', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'tag', value: value), + ); }); } QueryBuilder - tagElementGreaterThan( - int value, { - bool include = false, - }) { + tagElementGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tag', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tag', + value: value, + ), + ); }); } @@ -2317,11 +2298,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tag', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tag', + value: value, + ), + ); }); } @@ -2332,50 +2315,35 @@ extension SparkCoinQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tag', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tag', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder tagLengthEqualTo( - int length) { + int length, + ) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tag', - length, - true, - length, - true, - ); + return query.listLength(r'tag', length, true, length, true); }); } QueryBuilder tagIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tag', - 0, - true, - 0, - true, - ); + return query.listLength(r'tag', 0, true, 0, true); }); } QueryBuilder tagIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tag', - 0, - false, - 999999, - true, - ); + return query.listLength(r'tag', 0, false, 999999, true); }); } @@ -2384,29 +2352,14 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tag', - 0, - true, - length, - include, - ); + return query.listLength(r'tag', 0, true, length, include); }); } QueryBuilder - tagLengthGreaterThan( - int length, { - bool include = false, - }) { + tagLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tag', - length, - include, - 999999, - true, - ); + return query.listLength(r'tag', length, include, 999999, true); }); } @@ -2417,13 +2370,7 @@ extension SparkCoinQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tag', - lower, - includeLower, - upper, - includeUpper, - ); + return query.listLength(r'tag', lower, includeLower, upper, includeUpper); }); } @@ -2432,11 +2379,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'txHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2446,12 +2395,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'txHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'txHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2461,12 +2412,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'txHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'txHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2478,14 +2431,16 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'txHash', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'txHash', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2494,11 +2449,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'txHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'txHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2507,63 +2464,69 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'txHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'txHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txHashContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'txHash', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'txHash', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txHashMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'txHash', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'txHash', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder txHashIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'txHash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'txHash', value: ''), + ); }); } QueryBuilder txHashIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'txHash', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'txHash', value: ''), + ); }); } QueryBuilder typeEqualTo( - SparkCoinType value) { + SparkCoinType value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'type', value: value), + ); }); } @@ -2572,11 +2535,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -2585,11 +2550,13 @@ extension SparkCoinQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'type', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'type', + value: value, + ), + ); }); } @@ -2600,64 +2567,69 @@ extension SparkCoinQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'type', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'type', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - valueIntStringEqualTo( - String value, { - bool caseSensitive = true, - }) { + valueIntStringEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'valueIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'valueIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIntStringGreaterThan( + valueIntStringGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'valueIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'valueIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIntStringLessThan( + valueIntStringLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'valueIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'valueIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIntStringBetween( + valueIntStringBetween( String lower, String upper, { bool includeLower = true, @@ -2665,84 +2637,86 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'valueIntString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'valueIntString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIntStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + valueIntStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'valueIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'valueIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIntStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + valueIntStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'valueIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'valueIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIntStringContains(String value, {bool caseSensitive = true}) { + valueIntStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'valueIntString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'valueIntString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIntStringMatches(String pattern, {bool caseSensitive = true}) { + valueIntStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'valueIntString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'valueIntString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - valueIntStringIsEmpty() { + valueIntStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'valueIntString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'valueIntString', value: ''), + ); }); } QueryBuilder - valueIntStringIsNotEmpty() { + valueIntStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'valueIntString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'valueIntString', value: ''), + ); }); } @@ -2751,11 +2725,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2765,12 +2741,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2780,12 +2758,14 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2797,14 +2777,16 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2813,11 +2795,13 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2826,81 +2810,87 @@ extension SparkCoinQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } QueryBuilder isLockedIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'zzzIsLocked', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'zzzIsLocked'), + ); }); } QueryBuilder - isLockedIsNotNull() { + isLockedIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'zzzIsLocked', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'zzzIsLocked'), + ); }); } QueryBuilder isLockedEqualTo( - bool? value) { + bool? value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'zzzIsLocked', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'zzzIsLocked', value: value), + ); }); } } @@ -2937,14 +2927,14 @@ extension SparkCoinQuerySortBy on QueryBuilder { } QueryBuilder - sortByDiversifierIntString() { + sortByDiversifierIntString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'diversifierIntString', Sort.asc); }); } QueryBuilder - sortByDiversifierIntStringDesc() { + sortByDiversifierIntStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'diversifierIntString', Sort.desc); }); @@ -3017,7 +3007,7 @@ extension SparkCoinQuerySortBy on QueryBuilder { } QueryBuilder - sortBySerializedCoinB64Desc() { + sortBySerializedCoinB64Desc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'serializedCoinB64', Sort.desc); }); @@ -3111,14 +3101,14 @@ extension SparkCoinQuerySortThenBy } QueryBuilder - thenByDiversifierIntString() { + thenByDiversifierIntString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'diversifierIntString', Sort.asc); }); } QueryBuilder - thenByDiversifierIntStringDesc() { + thenByDiversifierIntStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'diversifierIntString', Sort.desc); }); @@ -3203,7 +3193,7 @@ extension SparkCoinQuerySortThenBy } QueryBuilder - thenBySerializedCoinB64Desc() { + thenBySerializedCoinB64Desc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'serializedCoinB64', Sort.desc); }); @@ -3272,30 +3262,35 @@ extension SparkCoinQuerySortThenBy extension SparkCoinQueryWhereDistinct on QueryBuilder { - QueryBuilder distinctByAddress( - {bool caseSensitive = true}) { + QueryBuilder distinctByAddress({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'address', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByContextB64( - {bool caseSensitive = true}) { + QueryBuilder distinctByContextB64({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'contextB64', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByDiversifierIntString( - {bool caseSensitive = true}) { + QueryBuilder distinctByDiversifierIntString({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'diversifierIntString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'diversifierIntString', + caseSensitive: caseSensitive, + ); }); } QueryBuilder - distinctByEncryptedDiversifier() { + distinctByEncryptedDiversifier() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'encryptedDiversifier'); }); @@ -3319,15 +3314,17 @@ extension SparkCoinQueryWhereDistinct }); } - QueryBuilder distinctByLTagHash( - {bool caseSensitive = true}) { + QueryBuilder distinctByLTagHash({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'lTagHash', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByMemo( - {bool caseSensitive = true}) { + QueryBuilder distinctByMemo({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'memo', caseSensitive: caseSensitive); }); @@ -3351,11 +3348,14 @@ extension SparkCoinQueryWhereDistinct }); } - QueryBuilder distinctBySerializedCoinB64( - {bool caseSensitive = true}) { + QueryBuilder distinctBySerializedCoinB64({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'serializedCoinB64', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'serializedCoinB64', + caseSensitive: caseSensitive, + ); }); } @@ -3365,8 +3365,9 @@ extension SparkCoinQueryWhereDistinct }); } - QueryBuilder distinctByTxHash( - {bool caseSensitive = true}) { + QueryBuilder distinctByTxHash({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'txHash', caseSensitive: caseSensitive); }); @@ -3378,16 +3379,20 @@ extension SparkCoinQueryWhereDistinct }); } - QueryBuilder distinctByValueIntString( - {bool caseSensitive = true}) { + QueryBuilder distinctByValueIntString({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'valueIntString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'valueIntString', + caseSensitive: caseSensitive, + ); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); @@ -3421,14 +3426,14 @@ extension SparkCoinQueryProperty } QueryBuilder - diversifierIntStringProperty() { + diversifierIntStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'diversifierIntString'); }); } QueryBuilder?, QQueryOperations> - encryptedDiversifierProperty() { + encryptedDiversifierProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'encryptedDiversifier'); }); @@ -3477,14 +3482,14 @@ extension SparkCoinQueryProperty } QueryBuilder?, QQueryOperations> - serialContextProperty() { + serialContextProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'serialContext'); }); } QueryBuilder - serializedCoinB64Property() { + serializedCoinB64Property() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'serializedCoinB64'); }); diff --git a/lib/wallets/isar/models/token_wallet_info.g.dart b/lib/wallets/isar/models/token_wallet_info.g.dart index f5d8555ab1..7e07112243 100644 --- a/lib/wallets/isar/models/token_wallet_info.g.dart +++ b/lib/wallets/isar/models/token_wallet_info.g.dart @@ -36,8 +36,9 @@ const TokenWalletInfoSchema = CollectionSchema( id: 3, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _tokenWalletInfoEstimateSize, serialize: _tokenWalletInfoSerialize, deserialize: _tokenWalletInfoDeserialize, @@ -59,16 +60,17 @@ const TokenWalletInfoSchema = CollectionSchema( name: r'tokenAddress', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _tokenWalletInfoGetId, getLinks: _tokenWalletInfoGetLinks, attach: _tokenWalletInfoAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _tokenWalletInfoEstimateSize( @@ -145,36 +147,51 @@ List> _tokenWalletInfoGetLinks(TokenWalletInfo object) { } void _tokenWalletInfoAttach( - IsarCollection col, Id id, TokenWalletInfo object) { + IsarCollection col, + Id id, + TokenWalletInfo object, +) { object.id = id; } extension TokenWalletInfoByIndex on IsarCollection { Future getByWalletIdTokenAddress( - String walletId, String tokenAddress) { + String walletId, + String tokenAddress, + ) { return getByIndex(r'walletId_tokenAddress', [walletId, tokenAddress]); } TokenWalletInfo? getByWalletIdTokenAddressSync( - String walletId, String tokenAddress) { + String walletId, + String tokenAddress, + ) { return getByIndexSync(r'walletId_tokenAddress', [walletId, tokenAddress]); } Future deleteByWalletIdTokenAddress( - String walletId, String tokenAddress) { + String walletId, + String tokenAddress, + ) { return deleteByIndex(r'walletId_tokenAddress', [walletId, tokenAddress]); } bool deleteByWalletIdTokenAddressSync(String walletId, String tokenAddress) { - return deleteByIndexSync( - r'walletId_tokenAddress', [walletId, tokenAddress]); + return deleteByIndexSync(r'walletId_tokenAddress', [ + walletId, + tokenAddress, + ]); } Future> getAllByWalletIdTokenAddress( - List walletIdValues, List tokenAddressValues) { + List walletIdValues, + List tokenAddressValues, + ) { final len = walletIdValues.length; - assert(tokenAddressValues.length == len, - 'All index values must have the same length'); + assert( + tokenAddressValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([walletIdValues[i], tokenAddressValues[i]]); @@ -184,10 +201,14 @@ extension TokenWalletInfoByIndex on IsarCollection { } List getAllByWalletIdTokenAddressSync( - List walletIdValues, List tokenAddressValues) { + List walletIdValues, + List tokenAddressValues, + ) { final len = walletIdValues.length; - assert(tokenAddressValues.length == len, - 'All index values must have the same length'); + assert( + tokenAddressValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([walletIdValues[i], tokenAddressValues[i]]); @@ -197,10 +218,14 @@ extension TokenWalletInfoByIndex on IsarCollection { } Future deleteAllByWalletIdTokenAddress( - List walletIdValues, List tokenAddressValues) { + List walletIdValues, + List tokenAddressValues, + ) { final len = walletIdValues.length; - assert(tokenAddressValues.length == len, - 'All index values must have the same length'); + assert( + tokenAddressValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([walletIdValues[i], tokenAddressValues[i]]); @@ -210,10 +235,14 @@ extension TokenWalletInfoByIndex on IsarCollection { } int deleteAllByWalletIdTokenAddressSync( - List walletIdValues, List tokenAddressValues) { + List walletIdValues, + List tokenAddressValues, + ) { final len = walletIdValues.length; - assert(tokenAddressValues.length == len, - 'All index values must have the same length'); + assert( + tokenAddressValues.length == len, + 'All index values must have the same length', + ); final values = >[]; for (var i = 0; i < len; i++) { values.add([walletIdValues[i], tokenAddressValues[i]]); @@ -226,20 +255,30 @@ extension TokenWalletInfoByIndex on IsarCollection { return putByIndex(r'walletId_tokenAddress', object); } - Id putByWalletIdTokenAddressSync(TokenWalletInfo object, - {bool saveLinks = true}) { - return putByIndexSync(r'walletId_tokenAddress', object, - saveLinks: saveLinks); + Id putByWalletIdTokenAddressSync( + TokenWalletInfo object, { + bool saveLinks = true, + }) { + return putByIndexSync( + r'walletId_tokenAddress', + object, + saveLinks: saveLinks, + ); } Future> putAllByWalletIdTokenAddress(List objects) { return putAllByIndex(r'walletId_tokenAddress', objects); } - List putAllByWalletIdTokenAddressSync(List objects, - {bool saveLinks = true}) { - return putAllByIndexSync(r'walletId_tokenAddress', objects, - saveLinks: saveLinks); + List putAllByWalletIdTokenAddressSync( + List objects, { + bool saveLinks = true, + }) { + return putAllByIndexSync( + r'walletId_tokenAddress', + objects, + saveLinks: saveLinks, + ); } } @@ -255,17 +294,15 @@ extension TokenWalletInfoQueryWhereSort extension TokenWalletInfoQueryWhere on QueryBuilder { QueryBuilder idEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder - idNotEqualTo(Id id) { + idNotEqualTo(Id id) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -288,7 +325,7 @@ extension TokenWalletInfoQueryWhere } QueryBuilder - idGreaterThan(Id id, {bool include = false}) { + idGreaterThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -297,8 +334,9 @@ extension TokenWalletInfoQueryWhere } QueryBuilder idLessThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -313,102 +351,123 @@ extension TokenWalletInfoQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - walletIdEqualToAnyTokenAddress(String walletId) { + walletIdEqualToAnyTokenAddress(String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId_tokenAddress', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'walletId_tokenAddress', + value: [walletId], + ), + ); }); } QueryBuilder - walletIdNotEqualToAnyTokenAddress(String walletId) { + walletIdNotEqualToAnyTokenAddress(String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_tokenAddress', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_tokenAddress', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_tokenAddress', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_tokenAddress', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_tokenAddress', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_tokenAddress', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_tokenAddress', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_tokenAddress', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } QueryBuilder - walletIdTokenAddressEqualTo(String walletId, String tokenAddress) { + walletIdTokenAddressEqualTo(String walletId, String tokenAddress) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId_tokenAddress', - value: [walletId, tokenAddress], - )); + return query.addWhereClause( + IndexWhereClause.equalTo( + indexName: r'walletId_tokenAddress', + value: [walletId, tokenAddress], + ), + ); }); } QueryBuilder - walletIdEqualToTokenAddressNotEqualTo( - String walletId, String tokenAddress) { + walletIdEqualToTokenAddressNotEqualTo(String walletId, String tokenAddress) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_tokenAddress', - lower: [walletId], - upper: [walletId, tokenAddress], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_tokenAddress', - lower: [walletId, tokenAddress], - includeLower: false, - upper: [walletId], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_tokenAddress', + lower: [walletId], + upper: [walletId, tokenAddress], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_tokenAddress', + lower: [walletId, tokenAddress], + includeLower: false, + upper: [walletId], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_tokenAddress', - lower: [walletId, tokenAddress], - includeLower: false, - upper: [walletId], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId_tokenAddress', - lower: [walletId], - upper: [walletId, tokenAddress], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_tokenAddress', + lower: [walletId, tokenAddress], + includeLower: false, + upper: [walletId], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId_tokenAddress', + lower: [walletId], + upper: [walletId, tokenAddress], + includeUpper: false, + ), + ); } }); } @@ -417,71 +476,74 @@ extension TokenWalletInfoQueryWhere extension TokenWalletInfoQueryFilter on QueryBuilder { QueryBuilder - cachedBalanceJsonStringIsNull() { + cachedBalanceJsonStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'cachedBalanceJsonString', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'cachedBalanceJsonString'), + ); }); } QueryBuilder - cachedBalanceJsonStringIsNotNull() { + cachedBalanceJsonStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'cachedBalanceJsonString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'cachedBalanceJsonString'), + ); }); } QueryBuilder - cachedBalanceJsonStringEqualTo( - String? value, { - bool caseSensitive = true, - }) { + cachedBalanceJsonStringEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedBalanceJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'cachedBalanceJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceJsonStringGreaterThan( + cachedBalanceJsonStringGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'cachedBalanceJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'cachedBalanceJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceJsonStringLessThan( + cachedBalanceJsonStringLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'cachedBalanceJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'cachedBalanceJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceJsonStringBetween( + cachedBalanceJsonStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -489,193 +551,201 @@ extension TokenWalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'cachedBalanceJsonString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'cachedBalanceJsonString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceJsonStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + cachedBalanceJsonStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'cachedBalanceJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'cachedBalanceJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceJsonStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + cachedBalanceJsonStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'cachedBalanceJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'cachedBalanceJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceJsonStringContains(String value, - {bool caseSensitive = true}) { + cachedBalanceJsonStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'cachedBalanceJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'cachedBalanceJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceJsonStringMatches(String pattern, - {bool caseSensitive = true}) { + cachedBalanceJsonStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'cachedBalanceJsonString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'cachedBalanceJsonString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceJsonStringIsEmpty() { + cachedBalanceJsonStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedBalanceJsonString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'cachedBalanceJsonString', + value: '', + ), + ); }); } QueryBuilder - cachedBalanceJsonStringIsNotEmpty() { + cachedBalanceJsonStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'cachedBalanceJsonString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'cachedBalanceJsonString', + value: '', + ), + ); }); } QueryBuilder - idEqualTo(Id value) { + idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } QueryBuilder - idGreaterThan( - Id value, { - bool include = false, - }) { + idGreaterThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } QueryBuilder - idLessThan( - Id value, { - bool include = false, - }) { + idLessThan(Id value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } QueryBuilder - idBetween( + idBetween( Id lower, Id upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - tokenAddressEqualTo( - String value, { - bool caseSensitive = true, - }) { + tokenAddressEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'tokenAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenAddressGreaterThan( + tokenAddressGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenAddressLessThan( + tokenAddressLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenAddressBetween( + tokenAddressBetween( String lower, String upper, { bool includeLower = true, @@ -683,191 +753,195 @@ extension TokenWalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenAddress', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenAddress', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenAddressStartsWith( - String value, { - bool caseSensitive = true, - }) { + tokenAddressStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'tokenAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'tokenAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenAddressEndsWith( - String value, { - bool caseSensitive = true, - }) { + tokenAddressEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'tokenAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'tokenAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenAddressContains(String value, {bool caseSensitive = true}) { + tokenAddressContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'tokenAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'tokenAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenAddressMatches(String pattern, {bool caseSensitive = true}) { + tokenAddressMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'tokenAddress', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'tokenAddress', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenAddressIsEmpty() { + tokenAddressIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenAddress', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'tokenAddress', value: ''), + ); }); } QueryBuilder - tokenAddressIsNotEmpty() { + tokenAddressIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'tokenAddress', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'tokenAddress', value: ''), + ); }); } QueryBuilder - tokenFractionDigitsEqualTo(int value) { + tokenFractionDigitsEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenFractionDigits', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'tokenFractionDigits', value: value), + ); }); } QueryBuilder - tokenFractionDigitsGreaterThan( - int value, { - bool include = false, - }) { + tokenFractionDigitsGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenFractionDigits', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenFractionDigits', + value: value, + ), + ); }); } QueryBuilder - tokenFractionDigitsLessThan( - int value, { - bool include = false, - }) { + tokenFractionDigitsLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenFractionDigits', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenFractionDigits', + value: value, + ), + ); }); } QueryBuilder - tokenFractionDigitsBetween( + tokenFractionDigitsBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenFractionDigits', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenFractionDigits', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - walletIdEqualTo( - String value, { - bool caseSensitive = true, - }) { + walletIdEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdLessThan( + walletIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdBetween( + walletIdBetween( String lower, String upper, { bool includeLower = true, @@ -875,84 +949,86 @@ extension TokenWalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdEndsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdContains(String value, {bool caseSensitive = true}) { + walletIdContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdMatches(String pattern, {bool caseSensitive = true}) { + walletIdMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -966,56 +1042,56 @@ extension TokenWalletInfoQueryLinks extension TokenWalletInfoQuerySortBy on QueryBuilder { QueryBuilder - sortByCachedBalanceJsonString() { + sortByCachedBalanceJsonString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceJsonString', Sort.asc); }); } QueryBuilder - sortByCachedBalanceJsonStringDesc() { + sortByCachedBalanceJsonStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceJsonString', Sort.desc); }); } QueryBuilder - sortByTokenAddress() { + sortByTokenAddress() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenAddress', Sort.asc); }); } QueryBuilder - sortByTokenAddressDesc() { + sortByTokenAddressDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenAddress', Sort.desc); }); } QueryBuilder - sortByTokenFractionDigits() { + sortByTokenFractionDigits() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenFractionDigits', Sort.asc); }); } QueryBuilder - sortByTokenFractionDigitsDesc() { + sortByTokenFractionDigitsDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenFractionDigits', Sort.desc); }); } QueryBuilder - sortByWalletId() { + sortByWalletId() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.asc); }); } QueryBuilder - sortByWalletIdDesc() { + sortByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -1025,14 +1101,14 @@ extension TokenWalletInfoQuerySortBy extension TokenWalletInfoQuerySortThenBy on QueryBuilder { QueryBuilder - thenByCachedBalanceJsonString() { + thenByCachedBalanceJsonString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceJsonString', Sort.asc); }); } QueryBuilder - thenByCachedBalanceJsonStringDesc() { + thenByCachedBalanceJsonStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceJsonString', Sort.desc); }); @@ -1051,42 +1127,42 @@ extension TokenWalletInfoQuerySortThenBy } QueryBuilder - thenByTokenAddress() { + thenByTokenAddress() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenAddress', Sort.asc); }); } QueryBuilder - thenByTokenAddressDesc() { + thenByTokenAddressDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenAddress', Sort.desc); }); } QueryBuilder - thenByTokenFractionDigits() { + thenByTokenFractionDigits() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenFractionDigits', Sort.asc); }); } QueryBuilder - thenByTokenFractionDigitsDesc() { + thenByTokenFractionDigitsDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'tokenFractionDigits', Sort.desc); }); } QueryBuilder - thenByWalletId() { + thenByWalletId() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.asc); }); } QueryBuilder - thenByWalletIdDesc() { + thenByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -1096,29 +1172,32 @@ extension TokenWalletInfoQuerySortThenBy extension TokenWalletInfoQueryWhereDistinct on QueryBuilder { QueryBuilder - distinctByCachedBalanceJsonString({bool caseSensitive = true}) { + distinctByCachedBalanceJsonString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'cachedBalanceJsonString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'cachedBalanceJsonString', + caseSensitive: caseSensitive, + ); }); } QueryBuilder - distinctByTokenAddress({bool caseSensitive = true}) { + distinctByTokenAddress({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'tokenAddress', caseSensitive: caseSensitive); }); } QueryBuilder - distinctByTokenFractionDigits() { + distinctByTokenFractionDigits() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'tokenFractionDigits'); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); @@ -1134,21 +1213,21 @@ extension TokenWalletInfoQueryProperty } QueryBuilder - cachedBalanceJsonStringProperty() { + cachedBalanceJsonStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'cachedBalanceJsonString'); }); } QueryBuilder - tokenAddressProperty() { + tokenAddressProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'tokenAddress'); }); } QueryBuilder - tokenFractionDigitsProperty() { + tokenFractionDigitsProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'tokenFractionDigits'); }); diff --git a/lib/wallets/isar/models/wallet_info.g.dart b/lib/wallets/isar/models/wallet_info.g.dart index 3dda37c779..1db7d04fcf 100644 --- a/lib/wallets/isar/models/wallet_info.g.dart +++ b/lib/wallets/isar/models/wallet_info.g.dart @@ -63,11 +63,7 @@ const WalletInfoSchema = CollectionSchema( type: IsarType.byte, enumMap: _WalletInfomainAddressTypeEnumValueMap, ), - r'name': PropertySchema( - id: 9, - name: r'name', - type: IsarType.string, - ), + r'name': PropertySchema(id: 9, name: r'name', type: IsarType.string), r'otherDataJsonString': PropertySchema( id: 10, name: r'otherDataJsonString', @@ -87,8 +83,9 @@ const WalletInfoSchema = CollectionSchema( id: 13, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _walletInfoEstimateSize, serialize: _walletInfoSerialize, deserialize: _walletInfoDeserialize, @@ -105,16 +102,17 @@ const WalletInfoSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _walletInfoGetId, getLinks: _walletInfoGetLinks, attach: _walletInfoAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _walletInfoEstimateSize( @@ -197,8 +195,10 @@ WalletInfo _walletInfoDeserialize( cachedReceivingAddress: reader.readStringOrNull(offsets[4]) ?? "", coinName: reader.readString(offsets[5]), favouriteOrderIndex: reader.readLongOrNull(offsets[6]) ?? -1, - mainAddressType: _WalletInfomainAddressTypeValueEnumMap[ - reader.readByteOrNull(offsets[8])] ?? + mainAddressType: + _WalletInfomainAddressTypeValueEnumMap[reader.readByteOrNull( + offsets[8], + )] ?? AddressType.p2pkh, name: reader.readString(offsets[9]), otherDataJsonString: reader.readStringOrNull(offsets[10]), @@ -233,9 +233,11 @@ P _walletInfoDeserializeProp

( case 7: return (reader.readBool(offset)) as P; case 8: - return (_WalletInfomainAddressTypeValueEnumMap[ - reader.readByteOrNull(offset)] ?? - AddressType.p2pkh) as P; + return (_WalletInfomainAddressTypeValueEnumMap[reader.readByteOrNull( + offset, + )] ?? + AddressType.p2pkh) + as P; case 9: return (reader.readString(offset)) as P; case 10: @@ -357,8 +359,10 @@ extension WalletInfoByIndex on IsarCollection { return putAllByIndex(r'walletId', objects); } - List putAllByWalletIdSync(List objects, - {bool saveLinks = true}) { + List putAllByWalletIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'walletId', objects, saveLinks: saveLinks); } } @@ -376,10 +380,7 @@ extension WalletInfoQueryWhere on QueryBuilder { QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } @@ -405,8 +406,10 @@ extension WalletInfoQueryWhere }); } - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { + QueryBuilder idGreaterThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -414,8 +417,10 @@ extension WalletInfoQueryWhere }); } - QueryBuilder idLessThan(Id id, - {bool include = false}) { + QueryBuilder idLessThan( + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -430,56 +435,67 @@ extension WalletInfoQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder walletIdEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder walletIdNotEqualTo( - String walletId) { + String walletId, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } @@ -488,71 +504,79 @@ extension WalletInfoQueryWhere extension WalletInfoQueryFilter on QueryBuilder { QueryBuilder - cachedBalanceSecondaryStringIsNull() { + cachedBalanceSecondaryStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'cachedBalanceSecondaryString', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'cachedBalanceSecondaryString'), + ); }); } QueryBuilder - cachedBalanceSecondaryStringIsNotNull() { + cachedBalanceSecondaryStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'cachedBalanceSecondaryString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull( + property: r'cachedBalanceSecondaryString', + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringEqualTo( + cachedBalanceSecondaryStringEqualTo( String? value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedBalanceSecondaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'cachedBalanceSecondaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringGreaterThan( + cachedBalanceSecondaryStringGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'cachedBalanceSecondaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'cachedBalanceSecondaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringLessThan( + cachedBalanceSecondaryStringLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'cachedBalanceSecondaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'cachedBalanceSecondaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringBetween( + cachedBalanceSecondaryStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -560,155 +584,176 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'cachedBalanceSecondaryString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'cachedBalanceSecondaryString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringStartsWith( + cachedBalanceSecondaryStringStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'cachedBalanceSecondaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'cachedBalanceSecondaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringEndsWith( + cachedBalanceSecondaryStringEndsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'cachedBalanceSecondaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'cachedBalanceSecondaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringContains(String value, - {bool caseSensitive = true}) { + cachedBalanceSecondaryStringContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'cachedBalanceSecondaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'cachedBalanceSecondaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringMatches(String pattern, - {bool caseSensitive = true}) { + cachedBalanceSecondaryStringMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'cachedBalanceSecondaryString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'cachedBalanceSecondaryString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringIsEmpty() { + cachedBalanceSecondaryStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedBalanceSecondaryString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'cachedBalanceSecondaryString', + value: '', + ), + ); }); } QueryBuilder - cachedBalanceSecondaryStringIsNotEmpty() { + cachedBalanceSecondaryStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'cachedBalanceSecondaryString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'cachedBalanceSecondaryString', + value: '', + ), + ); }); } QueryBuilder - cachedBalanceStringIsNull() { + cachedBalanceStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'cachedBalanceString', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'cachedBalanceString'), + ); }); } QueryBuilder - cachedBalanceStringIsNotNull() { + cachedBalanceStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'cachedBalanceString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'cachedBalanceString'), + ); }); } QueryBuilder - cachedBalanceStringEqualTo( - String? value, { - bool caseSensitive = true, - }) { + cachedBalanceStringEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedBalanceString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'cachedBalanceString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceStringGreaterThan( + cachedBalanceStringGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'cachedBalanceString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'cachedBalanceString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceStringLessThan( + cachedBalanceStringLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'cachedBalanceString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'cachedBalanceString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceStringBetween( + cachedBalanceStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -716,153 +761,166 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'cachedBalanceString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'cachedBalanceString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + cachedBalanceStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'cachedBalanceString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'cachedBalanceString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + cachedBalanceStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'cachedBalanceString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'cachedBalanceString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceStringContains(String value, {bool caseSensitive = true}) { + cachedBalanceStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'cachedBalanceString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'cachedBalanceString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceStringMatches(String pattern, {bool caseSensitive = true}) { + cachedBalanceStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'cachedBalanceString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'cachedBalanceString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceStringIsEmpty() { + cachedBalanceStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedBalanceString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'cachedBalanceString', value: ''), + ); }); } QueryBuilder - cachedBalanceStringIsNotEmpty() { + cachedBalanceStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'cachedBalanceString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'cachedBalanceString', + value: '', + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringIsNull() { + cachedBalanceTertiaryStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'cachedBalanceTertiaryString', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'cachedBalanceTertiaryString'), + ); }); } QueryBuilder - cachedBalanceTertiaryStringIsNotNull() { + cachedBalanceTertiaryStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'cachedBalanceTertiaryString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull( + property: r'cachedBalanceTertiaryString', + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringEqualTo( + cachedBalanceTertiaryStringEqualTo( String? value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedBalanceTertiaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'cachedBalanceTertiaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringGreaterThan( + cachedBalanceTertiaryStringGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'cachedBalanceTertiaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'cachedBalanceTertiaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringLessThan( + cachedBalanceTertiaryStringLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'cachedBalanceTertiaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'cachedBalanceTertiaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringBetween( + cachedBalanceTertiaryStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -870,193 +928,213 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'cachedBalanceTertiaryString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'cachedBalanceTertiaryString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringStartsWith( + cachedBalanceTertiaryStringStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'cachedBalanceTertiaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'cachedBalanceTertiaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringEndsWith( + cachedBalanceTertiaryStringEndsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'cachedBalanceTertiaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'cachedBalanceTertiaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringContains(String value, - {bool caseSensitive = true}) { + cachedBalanceTertiaryStringContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'cachedBalanceTertiaryString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'cachedBalanceTertiaryString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringMatches(String pattern, - {bool caseSensitive = true}) { + cachedBalanceTertiaryStringMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'cachedBalanceTertiaryString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'cachedBalanceTertiaryString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringIsEmpty() { + cachedBalanceTertiaryStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedBalanceTertiaryString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'cachedBalanceTertiaryString', + value: '', + ), + ); }); } QueryBuilder - cachedBalanceTertiaryStringIsNotEmpty() { + cachedBalanceTertiaryStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'cachedBalanceTertiaryString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'cachedBalanceTertiaryString', + value: '', + ), + ); }); } QueryBuilder - cachedChainHeightEqualTo(int value) { + cachedChainHeightEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedChainHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'cachedChainHeight', value: value), + ); }); } QueryBuilder - cachedChainHeightGreaterThan( - int value, { - bool include = false, - }) { + cachedChainHeightGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'cachedChainHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'cachedChainHeight', + value: value, + ), + ); }); } QueryBuilder - cachedChainHeightLessThan( - int value, { - bool include = false, - }) { + cachedChainHeightLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'cachedChainHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'cachedChainHeight', + value: value, + ), + ); }); } QueryBuilder - cachedChainHeightBetween( + cachedChainHeightBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'cachedChainHeight', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'cachedChainHeight', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - cachedReceivingAddressEqualTo( - String value, { - bool caseSensitive = true, - }) { + cachedReceivingAddressEqualTo(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedReceivingAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'cachedReceivingAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedReceivingAddressGreaterThan( + cachedReceivingAddressGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'cachedReceivingAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'cachedReceivingAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedReceivingAddressLessThan( + cachedReceivingAddressLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'cachedReceivingAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'cachedReceivingAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedReceivingAddressBetween( + cachedReceivingAddressBetween( String lower, String upper, { bool includeLower = true, @@ -1064,86 +1142,89 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'cachedReceivingAddress', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'cachedReceivingAddress', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedReceivingAddressStartsWith( - String value, { - bool caseSensitive = true, - }) { + cachedReceivingAddressStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'cachedReceivingAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'cachedReceivingAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedReceivingAddressEndsWith( - String value, { - bool caseSensitive = true, - }) { + cachedReceivingAddressEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'cachedReceivingAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'cachedReceivingAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedReceivingAddressContains(String value, - {bool caseSensitive = true}) { + cachedReceivingAddressContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'cachedReceivingAddress', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'cachedReceivingAddress', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedReceivingAddressMatches(String pattern, - {bool caseSensitive = true}) { + cachedReceivingAddressMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'cachedReceivingAddress', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'cachedReceivingAddress', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - cachedReceivingAddressIsEmpty() { + cachedReceivingAddressIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cachedReceivingAddress', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'cachedReceivingAddress', value: ''), + ); }); } QueryBuilder - cachedReceivingAddressIsNotEmpty() { + cachedReceivingAddressIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'cachedReceivingAddress', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'cachedReceivingAddress', + value: '', + ), + ); }); } @@ -1152,27 +1233,31 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameGreaterThan( + coinNameGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1182,12 +1267,14 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1199,28 +1286,29 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'coinName', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'coinName', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameStartsWith( - String value, { - bool caseSensitive = true, - }) { + coinNameStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1229,121 +1317,126 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder coinNameContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'coinName', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'coinName', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder coinNameMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'coinName', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'coinName', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - coinNameIsEmpty() { + coinNameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'coinName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'coinName', value: ''), + ); }); } QueryBuilder - coinNameIsNotEmpty() { + coinNameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'coinName', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'coinName', value: ''), + ); }); } QueryBuilder - favouriteOrderIndexEqualTo(int value) { + favouriteOrderIndexEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'favouriteOrderIndex', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'favouriteOrderIndex', value: value), + ); }); } QueryBuilder - favouriteOrderIndexGreaterThan( - int value, { - bool include = false, - }) { + favouriteOrderIndexGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'favouriteOrderIndex', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'favouriteOrderIndex', + value: value, + ), + ); }); } QueryBuilder - favouriteOrderIndexLessThan( - int value, { - bool include = false, - }) { + favouriteOrderIndexLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'favouriteOrderIndex', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'favouriteOrderIndex', + value: value, + ), + ); }); } QueryBuilder - favouriteOrderIndexBetween( + favouriteOrderIndexBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'favouriteOrderIndex', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'favouriteOrderIndex', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } @@ -1352,11 +1445,13 @@ extension WalletInfoQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1365,11 +1460,13 @@ extension WalletInfoQueryFilter bool include = false, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -1380,79 +1477,79 @@ extension WalletInfoQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - isFavouriteEqualTo(bool value) { + isFavouriteEqualTo(bool value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isFavourite', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isFavourite', value: value), + ); }); } QueryBuilder - mainAddressTypeEqualTo(AddressType value) { + mainAddressTypeEqualTo(AddressType value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'mainAddressType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'mainAddressType', value: value), + ); }); } QueryBuilder - mainAddressTypeGreaterThan( - AddressType value, { - bool include = false, - }) { + mainAddressTypeGreaterThan(AddressType value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'mainAddressType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'mainAddressType', + value: value, + ), + ); }); } QueryBuilder - mainAddressTypeLessThan( - AddressType value, { - bool include = false, - }) { + mainAddressTypeLessThan(AddressType value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'mainAddressType', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'mainAddressType', + value: value, + ), + ); }); } QueryBuilder - mainAddressTypeBetween( + mainAddressTypeBetween( AddressType lower, AddressType upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'mainAddressType', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'mainAddressType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } @@ -1461,11 +1558,13 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1475,12 +1574,14 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1490,12 +1591,14 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1507,14 +1610,16 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'name', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1523,11 +1628,13 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -1536,122 +1643,131 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'name', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'name', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder nameIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'name', value: ''), + ); }); } QueryBuilder nameIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'name', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'name', value: ''), + ); }); } QueryBuilder - otherDataJsonStringIsNull() { + otherDataJsonStringIsNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'otherDataJsonString', - )); + return query.addFilterCondition( + const FilterCondition.isNull(property: r'otherDataJsonString'), + ); }); } QueryBuilder - otherDataJsonStringIsNotNull() { + otherDataJsonStringIsNotNull() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'otherDataJsonString', - )); + return query.addFilterCondition( + const FilterCondition.isNotNull(property: r'otherDataJsonString'), + ); }); } QueryBuilder - otherDataJsonStringEqualTo( - String? value, { - bool caseSensitive = true, - }) { + otherDataJsonStringEqualTo(String? value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherDataJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'otherDataJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataJsonStringGreaterThan( + otherDataJsonStringGreaterThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'otherDataJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'otherDataJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataJsonStringLessThan( + otherDataJsonStringLessThan( String? value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'otherDataJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'otherDataJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataJsonStringBetween( + otherDataJsonStringBetween( String? lower, String? upper, { bool includeLower = true, @@ -1659,191 +1775,201 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'otherDataJsonString', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'otherDataJsonString', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataJsonStringStartsWith( - String value, { - bool caseSensitive = true, - }) { + otherDataJsonStringStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'otherDataJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'otherDataJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataJsonStringEndsWith( - String value, { - bool caseSensitive = true, - }) { + otherDataJsonStringEndsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'otherDataJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'otherDataJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataJsonStringContains(String value, {bool caseSensitive = true}) { + otherDataJsonStringContains(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'otherDataJsonString', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'otherDataJsonString', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataJsonStringMatches(String pattern, {bool caseSensitive = true}) { + otherDataJsonStringMatches(String pattern, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'otherDataJsonString', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'otherDataJsonString', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - otherDataJsonStringIsEmpty() { + otherDataJsonStringIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'otherDataJsonString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'otherDataJsonString', value: ''), + ); }); } QueryBuilder - otherDataJsonStringIsNotEmpty() { + otherDataJsonStringIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'otherDataJsonString', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'otherDataJsonString', + value: '', + ), + ); }); } QueryBuilder - restoreHeightEqualTo(int value) { + restoreHeightEqualTo(int value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'restoreHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'restoreHeight', value: value), + ); }); } QueryBuilder - restoreHeightGreaterThan( - int value, { - bool include = false, - }) { + restoreHeightGreaterThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'restoreHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'restoreHeight', + value: value, + ), + ); }); } QueryBuilder - restoreHeightLessThan( - int value, { - bool include = false, - }) { + restoreHeightLessThan(int value, {bool include = false}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'restoreHeight', - value: value, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'restoreHeight', + value: value, + ), + ); }); } QueryBuilder - restoreHeightBetween( + restoreHeightBetween( int lower, int upper, { bool includeLower = true, bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'restoreHeight', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'restoreHeight', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - tokenContractAddressesElementEqualTo( + tokenContractAddressesElementEqualTo( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenContractAddresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'tokenContractAddresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractAddressesElementGreaterThan( + tokenContractAddressesElementGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'tokenContractAddresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'tokenContractAddresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractAddressesElementLessThan( + tokenContractAddressesElementLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'tokenContractAddresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'tokenContractAddresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractAddressesElementBetween( + tokenContractAddressesElementBetween( String lower, String upper, { bool includeLower = true, @@ -1851,91 +1977,106 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'tokenContractAddresses', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'tokenContractAddresses', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractAddressesElementStartsWith( + tokenContractAddressesElementStartsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'tokenContractAddresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'tokenContractAddresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractAddressesElementEndsWith( + tokenContractAddressesElementEndsWith( String value, { bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'tokenContractAddresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'tokenContractAddresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractAddressesElementContains(String value, - {bool caseSensitive = true}) { + tokenContractAddressesElementContains( + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'tokenContractAddresses', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'tokenContractAddresses', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractAddressesElementMatches(String pattern, - {bool caseSensitive = true}) { + tokenContractAddressesElementMatches( + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'tokenContractAddresses', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'tokenContractAddresses', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - tokenContractAddressesElementIsEmpty() { + tokenContractAddressesElementIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'tokenContractAddresses', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'tokenContractAddresses', value: ''), + ); }); } QueryBuilder - tokenContractAddressesElementIsNotEmpty() { + tokenContractAddressesElementIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'tokenContractAddresses', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + property: r'tokenContractAddresses', + value: '', + ), + ); }); } QueryBuilder - tokenContractAddressesLengthEqualTo(int length) { + tokenContractAddressesLengthEqualTo(int length) { return QueryBuilder.apply(this, (query) { return query.listLength( r'tokenContractAddresses', @@ -1948,20 +2089,14 @@ extension WalletInfoQueryFilter } QueryBuilder - tokenContractAddressesIsEmpty() { + tokenContractAddressesIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.listLength( - r'tokenContractAddresses', - 0, - true, - 0, - true, - ); + return query.listLength(r'tokenContractAddresses', 0, true, 0, true); }); } QueryBuilder - tokenContractAddressesIsNotEmpty() { + tokenContractAddressesIsNotEmpty() { return QueryBuilder.apply(this, (query) { return query.listLength( r'tokenContractAddresses', @@ -1974,10 +2109,7 @@ extension WalletInfoQueryFilter } QueryBuilder - tokenContractAddressesLengthLessThan( - int length, { - bool include = false, - }) { + tokenContractAddressesLengthLessThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.listLength( r'tokenContractAddresses', @@ -1990,10 +2122,7 @@ extension WalletInfoQueryFilter } QueryBuilder - tokenContractAddressesLengthGreaterThan( - int length, { - bool include = false, - }) { + tokenContractAddressesLengthGreaterThan(int length, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.listLength( r'tokenContractAddresses', @@ -2006,7 +2135,7 @@ extension WalletInfoQueryFilter } QueryBuilder - tokenContractAddressesLengthBetween( + tokenContractAddressesLengthBetween( int lower, int upper, { bool includeLower = true, @@ -2028,27 +2157,31 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2058,12 +2191,14 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2075,28 +2210,29 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { + walletIdStartsWith(String value, {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } @@ -2105,55 +2241,61 @@ extension WalletInfoQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdContains( - String value, - {bool caseSensitive = true}) { + String value, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder walletIdMatches( - String pattern, - {bool caseSensitive = true}) { + String pattern, { + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -2167,42 +2309,42 @@ extension WalletInfoQueryLinks extension WalletInfoQuerySortBy on QueryBuilder { QueryBuilder - sortByCachedBalanceSecondaryString() { + sortByCachedBalanceSecondaryString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceSecondaryString', Sort.asc); }); } QueryBuilder - sortByCachedBalanceSecondaryStringDesc() { + sortByCachedBalanceSecondaryStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceSecondaryString', Sort.desc); }); } QueryBuilder - sortByCachedBalanceString() { + sortByCachedBalanceString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceString', Sort.asc); }); } QueryBuilder - sortByCachedBalanceStringDesc() { + sortByCachedBalanceStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceString', Sort.desc); }); } QueryBuilder - sortByCachedBalanceTertiaryString() { + sortByCachedBalanceTertiaryString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceTertiaryString', Sort.asc); }); } QueryBuilder - sortByCachedBalanceTertiaryStringDesc() { + sortByCachedBalanceTertiaryStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceTertiaryString', Sort.desc); }); @@ -2215,21 +2357,21 @@ extension WalletInfoQuerySortBy } QueryBuilder - sortByCachedChainHeightDesc() { + sortByCachedChainHeightDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedChainHeight', Sort.desc); }); } QueryBuilder - sortByCachedReceivingAddress() { + sortByCachedReceivingAddress() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedReceivingAddress', Sort.asc); }); } QueryBuilder - sortByCachedReceivingAddressDesc() { + sortByCachedReceivingAddressDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedReceivingAddress', Sort.desc); }); @@ -2248,14 +2390,14 @@ extension WalletInfoQuerySortBy } QueryBuilder - sortByFavouriteOrderIndex() { + sortByFavouriteOrderIndex() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favouriteOrderIndex', Sort.asc); }); } QueryBuilder - sortByFavouriteOrderIndexDesc() { + sortByFavouriteOrderIndexDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favouriteOrderIndex', Sort.desc); }); @@ -2280,7 +2422,7 @@ extension WalletInfoQuerySortBy } QueryBuilder - sortByMainAddressTypeDesc() { + sortByMainAddressTypeDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'mainAddressType', Sort.desc); }); @@ -2299,14 +2441,14 @@ extension WalletInfoQuerySortBy } QueryBuilder - sortByOtherDataJsonString() { + sortByOtherDataJsonString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherDataJsonString', Sort.asc); }); } QueryBuilder - sortByOtherDataJsonStringDesc() { + sortByOtherDataJsonStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherDataJsonString', Sort.desc); }); @@ -2340,42 +2482,42 @@ extension WalletInfoQuerySortBy extension WalletInfoQuerySortThenBy on QueryBuilder { QueryBuilder - thenByCachedBalanceSecondaryString() { + thenByCachedBalanceSecondaryString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceSecondaryString', Sort.asc); }); } QueryBuilder - thenByCachedBalanceSecondaryStringDesc() { + thenByCachedBalanceSecondaryStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceSecondaryString', Sort.desc); }); } QueryBuilder - thenByCachedBalanceString() { + thenByCachedBalanceString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceString', Sort.asc); }); } QueryBuilder - thenByCachedBalanceStringDesc() { + thenByCachedBalanceStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceString', Sort.desc); }); } QueryBuilder - thenByCachedBalanceTertiaryString() { + thenByCachedBalanceTertiaryString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceTertiaryString', Sort.asc); }); } QueryBuilder - thenByCachedBalanceTertiaryStringDesc() { + thenByCachedBalanceTertiaryStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedBalanceTertiaryString', Sort.desc); }); @@ -2388,21 +2530,21 @@ extension WalletInfoQuerySortThenBy } QueryBuilder - thenByCachedChainHeightDesc() { + thenByCachedChainHeightDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedChainHeight', Sort.desc); }); } QueryBuilder - thenByCachedReceivingAddress() { + thenByCachedReceivingAddress() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedReceivingAddress', Sort.asc); }); } QueryBuilder - thenByCachedReceivingAddressDesc() { + thenByCachedReceivingAddressDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'cachedReceivingAddress', Sort.desc); }); @@ -2421,14 +2563,14 @@ extension WalletInfoQuerySortThenBy } QueryBuilder - thenByFavouriteOrderIndex() { + thenByFavouriteOrderIndex() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favouriteOrderIndex', Sort.asc); }); } QueryBuilder - thenByFavouriteOrderIndexDesc() { + thenByFavouriteOrderIndexDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'favouriteOrderIndex', Sort.desc); }); @@ -2465,7 +2607,7 @@ extension WalletInfoQuerySortThenBy } QueryBuilder - thenByMainAddressTypeDesc() { + thenByMainAddressTypeDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'mainAddressType', Sort.desc); }); @@ -2484,14 +2626,14 @@ extension WalletInfoQuerySortThenBy } QueryBuilder - thenByOtherDataJsonString() { + thenByOtherDataJsonString() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherDataJsonString', Sort.asc); }); } QueryBuilder - thenByOtherDataJsonStringDesc() { + thenByOtherDataJsonStringDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherDataJsonString', Sort.desc); }); @@ -2525,53 +2667,62 @@ extension WalletInfoQuerySortThenBy extension WalletInfoQueryWhereDistinct on QueryBuilder { QueryBuilder - distinctByCachedBalanceSecondaryString({bool caseSensitive = true}) { + distinctByCachedBalanceSecondaryString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'cachedBalanceSecondaryString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'cachedBalanceSecondaryString', + caseSensitive: caseSensitive, + ); }); } - QueryBuilder distinctByCachedBalanceString( - {bool caseSensitive = true}) { + QueryBuilder + distinctByCachedBalanceString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'cachedBalanceString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'cachedBalanceString', + caseSensitive: caseSensitive, + ); }); } QueryBuilder - distinctByCachedBalanceTertiaryString({bool caseSensitive = true}) { + distinctByCachedBalanceTertiaryString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'cachedBalanceTertiaryString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'cachedBalanceTertiaryString', + caseSensitive: caseSensitive, + ); }); } QueryBuilder - distinctByCachedChainHeight() { + distinctByCachedChainHeight() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'cachedChainHeight'); }); } QueryBuilder - distinctByCachedReceivingAddress({bool caseSensitive = true}) { + distinctByCachedReceivingAddress({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'cachedReceivingAddress', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'cachedReceivingAddress', + caseSensitive: caseSensitive, + ); }); } - QueryBuilder distinctByCoinName( - {bool caseSensitive = true}) { + QueryBuilder distinctByCoinName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'coinName', caseSensitive: caseSensitive); }); } QueryBuilder - distinctByFavouriteOrderIndex() { + distinctByFavouriteOrderIndex() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'favouriteOrderIndex'); }); @@ -2589,18 +2740,21 @@ extension WalletInfoQueryWhereDistinct }); } - QueryBuilder distinctByName( - {bool caseSensitive = true}) { + QueryBuilder distinctByName({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'name', caseSensitive: caseSensitive); }); } - QueryBuilder distinctByOtherDataJsonString( - {bool caseSensitive = true}) { + QueryBuilder + distinctByOtherDataJsonString({bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'otherDataJsonString', - caseSensitive: caseSensitive); + return query.addDistinctBy( + r'otherDataJsonString', + caseSensitive: caseSensitive, + ); }); } @@ -2611,14 +2765,15 @@ extension WalletInfoQueryWhereDistinct } QueryBuilder - distinctByTokenContractAddresses() { + distinctByTokenContractAddresses() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'tokenContractAddresses'); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); @@ -2634,21 +2789,21 @@ extension WalletInfoQueryProperty } QueryBuilder - cachedBalanceSecondaryStringProperty() { + cachedBalanceSecondaryStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'cachedBalanceSecondaryString'); }); } QueryBuilder - cachedBalanceStringProperty() { + cachedBalanceStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'cachedBalanceString'); }); } QueryBuilder - cachedBalanceTertiaryStringProperty() { + cachedBalanceTertiaryStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'cachedBalanceTertiaryString'); }); @@ -2661,7 +2816,7 @@ extension WalletInfoQueryProperty } QueryBuilder - cachedReceivingAddressProperty() { + cachedReceivingAddressProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'cachedReceivingAddress'); }); @@ -2674,7 +2829,7 @@ extension WalletInfoQueryProperty } QueryBuilder - favouriteOrderIndexProperty() { + favouriteOrderIndexProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'favouriteOrderIndex'); }); @@ -2687,7 +2842,7 @@ extension WalletInfoQueryProperty } QueryBuilder - mainAddressTypeProperty() { + mainAddressTypeProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'mainAddressType'); }); @@ -2700,7 +2855,7 @@ extension WalletInfoQueryProperty } QueryBuilder - otherDataJsonStringProperty() { + otherDataJsonStringProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'otherDataJsonString'); }); @@ -2713,7 +2868,7 @@ extension WalletInfoQueryProperty } QueryBuilder, QQueryOperations> - tokenContractAddressesProperty() { + tokenContractAddressesProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'tokenContractAddresses'); }); diff --git a/lib/wallets/isar/models/wallet_info_meta.g.dart b/lib/wallets/isar/models/wallet_info_meta.g.dart index d8f578929b..4ec63249e3 100644 --- a/lib/wallets/isar/models/wallet_info_meta.g.dart +++ b/lib/wallets/isar/models/wallet_info_meta.g.dart @@ -26,8 +26,9 @@ const WalletInfoMetaSchema = CollectionSchema( id: 1, name: r'walletId', type: IsarType.string, - ) + ), }, + estimateSize: _walletInfoMetaEstimateSize, serialize: _walletInfoMetaSerialize, deserialize: _walletInfoMetaDeserialize, @@ -44,16 +45,17 @@ const WalletInfoMetaSchema = CollectionSchema( name: r'walletId', type: IndexType.hash, caseSensitive: true, - ) + ), ], - ) + ), }, links: {}, embeddedSchemas: {}, + getId: _walletInfoMetaGetId, getLinks: _walletInfoMetaGetLinks, attach: _walletInfoMetaAttach, - version: '3.1.8', + version: '3.3.0-dev.2', ); int _walletInfoMetaEstimateSize( @@ -115,7 +117,10 @@ List> _walletInfoMetaGetLinks(WalletInfoMeta object) { } void _walletInfoMetaAttach( - IsarCollection col, Id id, WalletInfoMeta object) { + IsarCollection col, + Id id, + WalletInfoMeta object, +) { object.id = id; } @@ -168,8 +173,10 @@ extension WalletInfoMetaByIndex on IsarCollection { return putAllByIndex(r'walletId', objects); } - List putAllByWalletIdSync(List objects, - {bool saveLinks = true}) { + List putAllByWalletIdSync( + List objects, { + bool saveLinks = true, + }) { return putAllByIndexSync(r'walletId', objects, saveLinks: saveLinks); } } @@ -186,17 +193,16 @@ extension WalletInfoMetaQueryWhereSort extension WalletInfoMetaQueryWhere on QueryBuilder { QueryBuilder idEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); + return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); }); } QueryBuilder idNotEqualTo( - Id id) { + Id id, + ) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -219,8 +225,9 @@ extension WalletInfoMetaQueryWhere } QueryBuilder idGreaterThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -229,8 +236,9 @@ extension WalletInfoMetaQueryWhere } QueryBuilder idLessThan( - Id id, - {bool include = false}) { + Id id, { + bool include = false, + }) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -245,56 +253,65 @@ extension WalletInfoMetaQueryWhere bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); + return query.addWhereClause( + IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - walletIdEqualTo(String walletId) { + walletIdEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IndexWhereClause.equalTo( - indexName: r'walletId', - value: [walletId], - )); + return query.addWhereClause( + IndexWhereClause.equalTo(indexName: r'walletId', value: [walletId]), + ); }); } QueryBuilder - walletIdNotEqualTo(String walletId) { + walletIdNotEqualTo(String walletId) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ); } else { return query - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [walletId], - includeLower: false, - upper: [], - )) - .addWhereClause(IndexWhereClause.between( - indexName: r'walletId', - lower: [], - upper: [walletId], - includeUpper: false, - )); + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [walletId], + includeLower: false, + upper: [], + ), + ) + .addWhereClause( + IndexWhereClause.between( + indexName: r'walletId', + lower: [], + upper: [walletId], + includeUpper: false, + ), + ); } }); } @@ -303,40 +320,38 @@ extension WalletInfoMetaQueryWhere extension WalletInfoMetaQueryFilter on QueryBuilder { QueryBuilder idEqualTo( - Id value) { + Id value, + ) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'id', value: value), + ); }); } QueryBuilder - idGreaterThan( - Id value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); + idGreaterThan(Id value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + ), + ); }); } QueryBuilder - idLessThan( - Id value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); + idLessThan(Id value, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + ), + ); }); } @@ -347,74 +362,78 @@ extension WalletInfoMetaQueryFilter bool includeUpper = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + ), + ); }); } QueryBuilder - isMnemonicVerifiedEqualTo(bool value) { + isMnemonicVerifiedEqualTo(bool value) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'isMnemonicVerified', - value: value, - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'isMnemonicVerified', value: value), + ); }); } QueryBuilder - walletIdEqualTo( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + walletIdEqualTo(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.equalTo( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdGreaterThan( + walletIdGreaterThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.greaterThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdLessThan( + walletIdLessThan( String value, { bool include = false, bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.lessThan( + include: include, + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdBetween( + walletIdBetween( String lower, String upper, { bool includeLower = true, @@ -422,84 +441,86 @@ extension WalletInfoMetaQueryFilter bool caseSensitive = true, }) { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'walletId', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); + return query.addFilterCondition( + FilterCondition.between( + property: r'walletId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + walletIdStartsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.startsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + walletIdEndsWith(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.endsWith( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdContains(String value, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'walletId', - value: value, - caseSensitive: caseSensitive, - )); + walletIdContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.contains( + property: r'walletId', + value: value, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdMatches(String pattern, {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'walletId', - wildcard: pattern, - caseSensitive: caseSensitive, - )); + walletIdMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + FilterCondition.matches( + property: r'walletId', + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); }); } QueryBuilder - walletIdIsEmpty() { + walletIdIsEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.equalTo(property: r'walletId', value: ''), + ); }); } QueryBuilder - walletIdIsNotEmpty() { + walletIdIsNotEmpty() { return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'walletId', - value: '', - )); + return query.addFilterCondition( + FilterCondition.greaterThan(property: r'walletId', value: ''), + ); }); } } @@ -513,14 +534,14 @@ extension WalletInfoMetaQueryLinks extension WalletInfoMetaQuerySortBy on QueryBuilder { QueryBuilder - sortByIsMnemonicVerified() { + sortByIsMnemonicVerified() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isMnemonicVerified', Sort.asc); }); } QueryBuilder - sortByIsMnemonicVerifiedDesc() { + sortByIsMnemonicVerifiedDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isMnemonicVerified', Sort.desc); }); @@ -533,7 +554,7 @@ extension WalletInfoMetaQuerySortBy } QueryBuilder - sortByWalletIdDesc() { + sortByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -555,14 +576,14 @@ extension WalletInfoMetaQuerySortThenBy } QueryBuilder - thenByIsMnemonicVerified() { + thenByIsMnemonicVerified() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isMnemonicVerified', Sort.asc); }); } QueryBuilder - thenByIsMnemonicVerifiedDesc() { + thenByIsMnemonicVerifiedDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'isMnemonicVerified', Sort.desc); }); @@ -575,7 +596,7 @@ extension WalletInfoMetaQuerySortThenBy } QueryBuilder - thenByWalletIdDesc() { + thenByWalletIdDesc() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'walletId', Sort.desc); }); @@ -585,14 +606,15 @@ extension WalletInfoMetaQuerySortThenBy extension WalletInfoMetaQueryWhereDistinct on QueryBuilder { QueryBuilder - distinctByIsMnemonicVerified() { + distinctByIsMnemonicVerified() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'isMnemonicVerified'); }); } - QueryBuilder distinctByWalletId( - {bool caseSensitive = true}) { + QueryBuilder distinctByWalletId({ + bool caseSensitive = true, + }) { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive); }); @@ -608,7 +630,7 @@ extension WalletInfoMetaQueryProperty } QueryBuilder - isMnemonicVerifiedProperty() { + isMnemonicVerifiedProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'isMnemonicVerified'); }); diff --git a/test/cached_electrumx_test.mocks.dart b/test/cached_electrumx_test.mocks.dart index 498fb7da55..1da0fa70b8 100644 --- a/test/cached_electrumx_test.mocks.dart +++ b/test/cached_electrumx_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/cached_electrumx_test.dart. // Do not manually edit this file. @@ -30,61 +30,38 @@ import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_i // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeCryptoCurrency_0 extends _i1.SmartFake implements _i2.CryptoCurrency { - _FakeCryptoCurrency_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCryptoCurrency_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDuration_1 extends _i1.SmartFake implements Duration { - _FakeDuration_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDuration_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake implements _i3.SparkAnonymitySetMeta { - _FakeSparkAnonymitySetMeta_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSparkAnonymitySetMeta_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { - _FakeDecimal_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDecimal_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFusionInfo_4 extends _i1.SmartFake implements _i5.FusionInfo { - _FakeFusionInfo_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFusionInfo_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ElectrumXClient]. @@ -96,85 +73,83 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { } @override - _i2.CryptoCurrency get cryptoCurrency => (super.noSuchMethod( - Invocation.getter(#cryptoCurrency), - returnValue: _FakeCryptoCurrency_0( - this, - Invocation.getter(#cryptoCurrency), - ), - ) as _i2.CryptoCurrency); + _i2.CryptoCurrency get cryptoCurrency => + (super.noSuchMethod( + Invocation.getter(#cryptoCurrency), + returnValue: _FakeCryptoCurrency_0( + this, + Invocation.getter(#cryptoCurrency), + ), + ) + as _i2.CryptoCurrency); @override - _i7.TorPlainNetworkOption get netType => (super.noSuchMethod( - Invocation.getter(#netType), - returnValue: _i7.TorPlainNetworkOption.tor, - ) as _i7.TorPlainNetworkOption); + _i7.TorPlainNetworkOption get netType => + (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i7.TorPlainNetworkOption.tor, + ) + as _i7.TorPlainNetworkOption); @override - int get currentFailoverIndex => (super.noSuchMethod( - Invocation.getter(#currentFailoverIndex), - returnValue: 0, - ) as int); + String get host => + (super.noSuchMethod( + Invocation.getter(#host), + returnValue: _i8.dummyValue(this, Invocation.getter(#host)), + ) + as String); @override - set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( - Invocation.setter( - #currentFailoverIndex, - _currentFailoverIndex, - ), - returnValueForMissingStub: null, - ); + int get port => + (super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int); @override - Duration get connectionTimeoutForSpecialCaseJsonRPCClients => - (super.noSuchMethod( - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - returnValue: _FakeDuration_1( - this, - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - ), - ) as Duration); + bool get useSSL => + (super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false) + as bool); @override - String get host => (super.noSuchMethod( - Invocation.getter(#host), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#host), - ), - ) as String); + int get currentFailoverIndex => + (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) + as int); @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); + Duration get connectionTimeoutForSpecialCaseJsonRPCClients => + (super.noSuchMethod( + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + returnValue: _FakeDuration_1( + this, + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + ), + ) + as Duration); @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); + set currentFailoverIndex(int? value) => super.noSuchMethod( + Invocation.setter(#currentFailoverIndex, value), + returnValueForMissingStub: null, + ); @override - _i9.Future closeAdapter() => (super.noSuchMethod( - Invocation.method( - #closeAdapter, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future closeAdapter() => + (super.noSuchMethod( + Invocation.method(#closeAdapter, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future checkElectrumAdapter() => (super.noSuchMethod( - Invocation.method( - #checkElectrumAdapter, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future checkElectrumAdapter() => + (super.noSuchMethod( + Invocation.method(#checkElectrumAdapter, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future request({ @@ -185,19 +160,16 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { Duration? requestTimeout = const Duration(seconds: 60), }) => (super.noSuchMethod( - Invocation.method( - #request, - [], - { - #command: command, - #args: args, - #requestID: requestID, - #retries: retries, - #requestTimeout: requestTimeout, - }, - ), - returnValue: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#request, [], { + #command: command, + #args: args, + #requestID: requestID, + #retries: retries, + #requestTimeout: requestTimeout, + }), + returnValue: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future> batchRequest({ @@ -207,59 +179,46 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { int? retries = 2, }) => (super.noSuchMethod( - Invocation.method( - #batchRequest, - [], - { - #command: command, - #args: args, - #requestTimeout: requestTimeout, - #retries: retries, - }, - ), - returnValue: _i9.Future>.value([]), - ) as _i9.Future>); - - @override - _i9.Future ping({ - String? requestID, - int? retryCount = 1, - }) => + Invocation.method(#batchRequest, [], { + #command: command, + #args: args, + #requestTimeout: requestTimeout, + #retries: retries, + }), + returnValue: _i9.Future>.value([]), + ) + as _i9.Future>); + + @override + _i9.Future ping({String? requestID, int? retryCount = 1}) => (super.noSuchMethod( - Invocation.method( - #ping, - [], - { - #requestID: requestID, - #retryCount: retryCount, - }, - ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + Invocation.method(#ping, [], { + #requestID: requestID, + #retryCount: retryCount, + }), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); @override _i9.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getBlockHeadTip, - [], - {#requestID: requestID}, - ), - returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}), + returnValue: _i9.Future>.value( + {}, + ), + ) + as _i9.Future>); @override _i9.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getServerFeatures, - [], - {#requestID: requestID}, - ), - returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getServerFeatures, [], {#requestID: requestID}), + returnValue: _i9.Future>.value( + {}, + ), + ) + as _i9.Future>); @override _i9.Future broadcastTransaction({ @@ -267,26 +226,21 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #broadcastTransaction, - [], - { - #rawTx: rawTx, - #requestID: requestID, - }, - ), - returnValue: _i9.Future.value(_i8.dummyValue( - this, - Invocation.method( - #broadcastTransaction, - [], - { + Invocation.method(#broadcastTransaction, [], { #rawTx: rawTx, #requestID: requestID, - }, - ), - )), - ) as _i9.Future); + }), + returnValue: _i9.Future.value( + _i8.dummyValue( + this, + Invocation.method(#broadcastTransaction, [], { + #rawTx: rawTx, + #requestID: requestID, + }), + ), + ), + ) + as _i9.Future); @override _i9.Future> getBalance({ @@ -294,17 +248,15 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getBalance, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getBalance, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i9.Future>.value( + {}, + ), + ) + as _i9.Future>); @override _i9.Future>> getHistory({ @@ -312,30 +264,27 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getHistory, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i9.Future>>.value( - >[]), - ) as _i9.Future>>); + Invocation.method(#getHistory, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i9.Future>>.value( + >[], + ), + ) + as _i9.Future>>); @override - _i9.Future>>> getBatchHistory( - {required List? args}) => + _i9.Future>>> getBatchHistory({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchHistory, - [], - {#args: args}, - ), - returnValue: _i9.Future>>>.value( - >>[]), - ) as _i9.Future>>>); + Invocation.method(#getBatchHistory, [], {#args: args}), + returnValue: _i9.Future>>>.value( + >>[], + ), + ) + as _i9.Future>>>); @override _i9.Future>> getUTXOs({ @@ -343,30 +292,27 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getUTXOs, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i9.Future>>.value( - >[]), - ) as _i9.Future>>); + Invocation.method(#getUTXOs, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i9.Future>>.value( + >[], + ), + ) + as _i9.Future>>); @override - _i9.Future>>> getBatchUTXOs( - {required List? args}) => + _i9.Future>>> getBatchUTXOs({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchUTXOs, - [], - {#args: args}, - ), - returnValue: _i9.Future>>>.value( - >>[]), - ) as _i9.Future>>>); + Invocation.method(#getBatchUTXOs, [], {#args: args}), + returnValue: _i9.Future>>>.value( + >>[], + ), + ) + as _i9.Future>>>); @override _i9.Future> getTransaction({ @@ -375,55 +321,45 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #verbose: verbose, - #requestID: requestID, - }, - ), - returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }), + returnValue: _i9.Future>.value( + {}, + ), + ) + as _i9.Future>); @override _i9.Future> getLelantusAnonymitySet({ - String? groupId = r'1', - String? blockhash = r'', + String? groupId = '1', + String? blockhash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #requestID: requestID, - }, - ), - returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getLelantusAnonymitySet, [], { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }), + returnValue: _i9.Future>.value( + {}, + ), + ) + as _i9.Future>); @override - _i9.Future getLelantusMintData({ - dynamic mints, - String? requestID, - }) => + _i9.Future getLelantusMintData({dynamic mints, String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusMintData, - [], - { - #mints: mints, - #requestID: requestID, - }, - ), - returnValue: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#getLelantusMintData, [], { + #mints: mints, + #requestID: requestID, + }), + returnValue: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future> getLelantusUsedCoinSerials({ @@ -431,70 +367,61 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusUsedCoinSerials, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getLelantusUsedCoinSerials, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i9.Future>.value( + {}, + ), + ) + as _i9.Future>); @override _i9.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + Invocation.method(#getLelantusLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i9.Future.value(0), + ) + as _i9.Future); @override _i9.Future> getSparkAnonymitySet({ - String? coinGroupId = r'1', - String? startBlockHash = r'', + String? coinGroupId = '1', + String? startBlockHash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #coinGroupId: coinGroupId, - #startBlockHash: startBlockHash, - #requestID: requestID, - }, - ), - returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getSparkAnonymitySet, [], { + #coinGroupId: coinGroupId, + #startBlockHash: startBlockHash, + #requestID: requestID, + }), + returnValue: _i9.Future>.value( + {}, + ), + ) + as _i9.Future>); @override _i9.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getSparkLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + Invocation.method(#getSparkLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i9.Future.value(0), + ) + as _i9.Future); @override _i9.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getMempoolTxids, - [], - {#requestID: requestID}, - ), - returnValue: _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getMempoolTxids, [], {#requestID: requestID}), + returnValue: _i9.Future>.value({}), + ) + as _i9.Future>); @override _i9.Future> getMempoolSparkData({ @@ -502,17 +429,15 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { required List? txids, }) => (super.noSuchMethod( - Invocation.method( - #getMempoolSparkData, - [], - { - #requestID: requestID, - #txids: txids, - }, - ), - returnValue: _i9.Future>.value( - <_i3.SparkMempoolData>[]), - ) as _i9.Future>); + Invocation.method(#getMempoolSparkData, [], { + #requestID: requestID, + #txids: txids, + }), + returnValue: _i9.Future>.value( + <_i3.SparkMempoolData>[], + ), + ) + as _i9.Future>); @override _i9.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ @@ -520,77 +445,61 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getSparkUnhashedUsedCoinsTagsWithTxHashes, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: _i9.Future>>.value(>[]), - ) as _i9.Future>>); + Invocation.method(#getSparkUnhashedUsedCoinsTagsWithTxHashes, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i9.Future>>.value( + >[], + ), + ) + as _i9.Future>>); @override - _i9.Future> getSparkNames( - {String? requestID}) => + _i9.Future> getSparkNames({ + String? requestID, + }) => (super.noSuchMethod( - Invocation.method( - #getSparkNames, - [], - {#requestID: requestID}, - ), - returnValue: _i9.Future>.value( - <({String address, String name})>[]), - ) as _i9.Future>); + Invocation.method(#getSparkNames, [], {#requestID: requestID}), + returnValue: + _i9.Future>.value( + <({String address, String name})>[], + ), + ) + as _i9.Future>); @override _i9.Future<({String additionalInfo, String address, int validUntil})> - getSparkNameData({ - required String? sparkName, - String? requestID, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - returnValue: _i9.Future< - ({ - String additionalInfo, - String address, - int validUntil - })>.value(( - additionalInfo: _i8.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - address: _i8.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - validUntil: 0 - )), - ) as _i9.Future< - ({String additionalInfo, String address, int validUntil})>); + getSparkNameData({required String? sparkName, String? requestID}) => + (super.noSuchMethod( + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + returnValue: + _i9.Future< + ({String additionalInfo, String address, int validUntil}) + >.value(( + additionalInfo: _i8.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + address: _i8.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + validUntil: 0, + )), + ) + as _i9.Future< + ({String additionalInfo, String address, int validUntil}) + >); @override _i9.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ @@ -598,27 +507,21 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { required int? coinGroupId, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - }, - ), - returnValue: _i9.Future<_i3.SparkAnonymitySetMeta>.value( - _FakeSparkAnonymitySetMeta_2( - this, - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { + Invocation.method(#getSparkAnonymitySetMeta, [], { #requestID: requestID, #coinGroupId: coinGroupId, - }, - ), - )), - ) as _i9.Future<_i3.SparkAnonymitySetMeta>); + }), + returnValue: _i9.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method(#getSparkAnonymitySetMeta, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + }), + ), + ), + ) + as _i9.Future<_i3.SparkAnonymitySetMeta>); @override _i9.Future> getSparkAnonymitySetBySector({ @@ -629,19 +532,16 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { required int? endIndex, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetBySector, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - #latestBlock: latestBlock, - #startIndex: startIndex, - #endIndex: endIndex, - }, - ), - returnValue: _i9.Future>.value([]), - ) as _i9.Future>); + Invocation.method(#getSparkAnonymitySetBySector, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }), + returnValue: _i9.Future>.value([]), + ) + as _i9.Future>); @override _i9.Future isMasterNodeCollateral({ @@ -650,29 +550,24 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { required int? index, }) => (super.noSuchMethod( - Invocation.method( - #isMasterNodeCollateral, - [], - { - #requestID: requestID, - #txid: txid, - #index: index, - }, - ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + Invocation.method(#isMasterNodeCollateral, [], { + #requestID: requestID, + #txid: txid, + #index: index, + }), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); @override _i9.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getFeeRate, - [], - {#requestID: requestID}, - ), - returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + Invocation.method(#getFeeRate, [], {#requestID: requestID}), + returnValue: _i9.Future>.value( + {}, + ), + ) + as _i9.Future>); @override _i9.Future<_i4.Decimal> estimateFee({ @@ -680,43 +575,34 @@ class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { required int? blocks, }) => (super.noSuchMethod( - Invocation.method( - #estimateFee, - [], - { - #requestID: requestID, - #blocks: blocks, - }, - ), - returnValue: _i9.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #estimateFee, - [], - { + Invocation.method(#estimateFee, [], { #requestID: requestID, #blocks: blocks, - }, - ), - )), - ) as _i9.Future<_i4.Decimal>); + }), + returnValue: _i9.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#estimateFee, [], { + #requestID: requestID, + #blocks: blocks, + }), + ), + ), + ) + as _i9.Future<_i4.Decimal>); @override - _i9.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - returnValue: _i9.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - )), - ) as _i9.Future<_i4.Decimal>); + _i9.Future<_i4.Decimal> relayFee({String? requestID}) => + (super.noSuchMethod( + Invocation.method(#relayFee, [], {#requestID: requestID}), + returnValue: _i9.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#relayFee, [], {#requestID: requestID}), + ), + ), + ) + as _i9.Future<_i4.Decimal>); } /// A class which mocks [Prefs]. @@ -728,425 +614,421 @@ class MockPrefs extends _i1.Mock implements _i10.Prefs { } @override - bool get isInitialized => (super.noSuchMethod( - Invocation.getter(#isInitialized), - returnValue: false, - ) as bool); + 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); + 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, - ); + int get lastUnlocked => + (super.noSuchMethod(Invocation.getter(#lastUnlocked), returnValue: 0) + as int); @override - int get lastUnlocked => (super.noSuchMethod( - Invocation.getter(#lastUnlocked), - returnValue: 0, - ) as int); + int get currentNotificationId => + (super.noSuchMethod( + Invocation.getter(#currentNotificationId), + returnValue: 0, + ) + as int); @override - set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( - Invocation.setter( - #lastUnlocked, - lastUnlocked, - ), - returnValueForMissingStub: null, - ); + List get walletIdsSyncOnStartup => + (super.noSuchMethod( + Invocation.getter(#walletIdsSyncOnStartup), + returnValue: [], + ) + as List); @override - int get currentNotificationId => (super.noSuchMethod( - Invocation.getter(#currentNotificationId), - returnValue: 0, - ) as int); + _i11.SyncingType get syncType => + (super.noSuchMethod( + Invocation.getter(#syncType), + returnValue: _i11.SyncingType.currentWalletOnly, + ) + as _i11.SyncingType); @override - List get walletIdsSyncOnStartup => (super.noSuchMethod( - Invocation.getter(#walletIdsSyncOnStartup), - returnValue: [], - ) as List); + bool get wifiOnly => + (super.noSuchMethod(Invocation.getter(#wifiOnly), returnValue: false) + as bool); @override - set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => - super.noSuchMethod( - Invocation.setter( - #walletIdsSyncOnStartup, - walletIdsSyncOnStartup, - ), - returnValueForMissingStub: null, - ); + bool get showFavoriteWallets => + (super.noSuchMethod( + Invocation.getter(#showFavoriteWallets), + returnValue: false, + ) + as bool); @override - _i11.SyncingType get syncType => (super.noSuchMethod( - Invocation.getter(#syncType), - returnValue: _i11.SyncingType.currentWalletOnly, - ) as _i11.SyncingType); + String get language => + (super.noSuchMethod( + Invocation.getter(#language), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#language), + ), + ) + as String); @override - set syncType(_i11.SyncingType? syncType) => super.noSuchMethod( - Invocation.setter( - #syncType, - syncType, - ), - returnValueForMissingStub: null, - ); + String get currency => + (super.noSuchMethod( + Invocation.getter(#currency), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#currency), + ), + ) + as String); @override - bool get wifiOnly => (super.noSuchMethod( - Invocation.getter(#wifiOnly), - returnValue: false, - ) as bool); + bool get randomizePIN => + (super.noSuchMethod(Invocation.getter(#randomizePIN), returnValue: false) + as bool); @override - set wifiOnly(bool? wifiOnly) => super.noSuchMethod( - Invocation.setter( - #wifiOnly, - wifiOnly, - ), - returnValueForMissingStub: null, - ); + bool get useBiometrics => + (super.noSuchMethod(Invocation.getter(#useBiometrics), returnValue: false) + as bool); @override - bool get showFavoriteWallets => (super.noSuchMethod( - Invocation.getter(#showFavoriteWallets), - returnValue: false, - ) as bool); + bool get hasPin => + (super.noSuchMethod(Invocation.getter(#hasPin), returnValue: false) + as bool); @override - set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( - Invocation.setter( - #showFavoriteWallets, - showFavoriteWallets, - ), - returnValueForMissingStub: null, - ); + bool get hasDuressPin => + (super.noSuchMethod(Invocation.getter(#hasDuressPin), returnValue: false) + as bool); @override - String get language => (super.noSuchMethod( - Invocation.getter(#language), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#language), - ), - ) as String); + bool get biometricsDuress => + (super.noSuchMethod( + Invocation.getter(#biometricsDuress), + returnValue: false, + ) + as bool); @override - set language(String? newLanguage) => super.noSuchMethod( - Invocation.setter( - #language, - newLanguage, - ), - returnValueForMissingStub: null, - ); + int get familiarity => + (super.noSuchMethod(Invocation.getter(#familiarity), returnValue: 0) + as int); @override - String get currency => (super.noSuchMethod( - Invocation.getter(#currency), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#currency), - ), - ) as String); + bool get torKillSwitch => + (super.noSuchMethod(Invocation.getter(#torKillSwitch), returnValue: false) + as bool); @override - set currency(String? newCurrency) => super.noSuchMethod( - Invocation.setter( - #currency, - newCurrency, - ), - returnValueForMissingStub: null, - ); + bool get showTestNetCoins => + (super.noSuchMethod( + Invocation.getter(#showTestNetCoins), + returnValue: false, + ) + as bool); @override - bool get randomizePIN => (super.noSuchMethod( - Invocation.getter(#randomizePIN), - returnValue: false, - ) as bool); + bool get isAutoBackupEnabled => + (super.noSuchMethod( + Invocation.getter(#isAutoBackupEnabled), + returnValue: false, + ) + as bool); @override - set randomizePIN(bool? randomizePIN) => super.noSuchMethod( - Invocation.setter( - #randomizePIN, - randomizePIN, - ), - returnValueForMissingStub: null, - ); + _i12.BackupFrequencyType get backupFrequencyType => + (super.noSuchMethod( + Invocation.getter(#backupFrequencyType), + returnValue: _i12.BackupFrequencyType.everyTenMinutes, + ) + as _i12.BackupFrequencyType); @override - bool get useBiometrics => (super.noSuchMethod( - Invocation.getter(#useBiometrics), - returnValue: false, - ) as bool); + bool get hideBlockExplorerWarning => + (super.noSuchMethod( + Invocation.getter(#hideBlockExplorerWarning), + returnValue: false, + ) + as bool); @override - set useBiometrics(bool? useBiometrics) => super.noSuchMethod( - Invocation.setter( - #useBiometrics, - useBiometrics, - ), - returnValueForMissingStub: null, - ); + bool get gotoWalletOnStartup => + (super.noSuchMethod( + Invocation.getter(#gotoWalletOnStartup), + returnValue: false, + ) + as bool); @override - bool get hasPin => (super.noSuchMethod( - Invocation.getter(#hasPin), - returnValue: false, - ) as bool); + bool get externalCalls => + (super.noSuchMethod(Invocation.getter(#externalCalls), returnValue: false) + as bool); @override - set hasPin(bool? hasPin) => super.noSuchMethod( - Invocation.setter( - #hasPin, - hasPin, - ), - returnValueForMissingStub: null, - ); + bool get enableCoinControl => + (super.noSuchMethod( + Invocation.getter(#enableCoinControl), + returnValue: false, + ) + as bool); @override - bool get hasDuressPin => (super.noSuchMethod( - Invocation.getter(#hasDuressPin), - returnValue: false, - ) as bool); + bool get enableSystemBrightness => + (super.noSuchMethod( + Invocation.getter(#enableSystemBrightness), + returnValue: false, + ) + as bool); @override - set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( - Invocation.setter( - #hasDuressPin, - hasDuressPin, - ), - returnValueForMissingStub: null, - ); + String get themeId => + (super.noSuchMethod( + Invocation.getter(#themeId), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#themeId), + ), + ) + as String); @override - bool get biometricsDuress => (super.noSuchMethod( - Invocation.getter(#biometricsDuress), - returnValue: false, - ) as bool); + String get systemBrightnessLightThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessLightThemeId), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#systemBrightnessLightThemeId), + ), + ) + as String); @override - set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( - Invocation.setter( - #biometricsDuress, - biometricsDuress, - ), - returnValueForMissingStub: null, - ); + String get systemBrightnessDarkThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessDarkThemeId), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#systemBrightnessDarkThemeId), + ), + ) + as String); @override - int get familiarity => (super.noSuchMethod( - Invocation.getter(#familiarity), - returnValue: 0, - ) as int); + bool get useTor => + (super.noSuchMethod(Invocation.getter(#useTor), returnValue: false) + as bool); @override - set familiarity(int? familiarity) => super.noSuchMethod( - Invocation.setter( - #familiarity, - familiarity, - ), - returnValueForMissingStub: null, - ); + bool get autoPin => + (super.noSuchMethod(Invocation.getter(#autoPin), returnValue: false) + as bool); @override - bool get torKillSwitch => (super.noSuchMethod( - Invocation.getter(#torKillSwitch), - returnValue: false, - ) as bool); + bool get enableExchange => + (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) + as bool); @override - set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( - Invocation.setter( - #torKillSwitch, - torKillswitch, - ), - returnValueForMissingStub: null, - ); + bool get advancedFiroFeatures => + (super.noSuchMethod( + Invocation.getter(#advancedFiroFeatures), + returnValue: false, + ) + as bool); @override - bool get showTestNetCoins => (super.noSuchMethod( - Invocation.getter(#showTestNetCoins), - returnValue: false, - ) as bool); + _i13.Level get logLevel => + (super.noSuchMethod( + Invocation.getter(#logLevel), + returnValue: _i13.Level.all, + ) + as _i13.Level); @override - set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( - Invocation.setter( - #showTestNetCoins, - showTestNetCoins, - ), - returnValueForMissingStub: null, - ); + ({bool enabled, int minutes}) get autoLockInfo => + (super.noSuchMethod( + Invocation.getter(#autoLockInfo), + returnValue: (enabled: false, minutes: 0), + ) + as ({bool enabled, int minutes})); @override - bool get isAutoBackupEnabled => (super.noSuchMethod( - Invocation.getter(#isAutoBackupEnabled), - returnValue: false, - ) as bool); + set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + Invocation.setter(#lastUnlockedTimeout, lastUnlockedTimeout), + returnValueForMissingStub: null, + ); @override - set isAutoBackupEnabled(bool? isAutoBackupEnabled) => super.noSuchMethod( - Invocation.setter( - #isAutoBackupEnabled, - isAutoBackupEnabled, - ), - returnValueForMissingStub: null, - ); + set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + Invocation.setter(#lastUnlocked, lastUnlocked), + returnValueForMissingStub: null, + ); @override - set autoBackupLocation(String? autoBackupLocation) => super.noSuchMethod( - Invocation.setter( - #autoBackupLocation, - autoBackupLocation, - ), + set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => + super.noSuchMethod( + Invocation.setter(#walletIdsSyncOnStartup, walletIdsSyncOnStartup), returnValueForMissingStub: null, ); @override - _i12.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( - Invocation.getter(#backupFrequencyType), - returnValue: _i12.BackupFrequencyType.everyTenMinutes, - ) as _i12.BackupFrequencyType); + set syncType(_i11.SyncingType? syncType) => super.noSuchMethod( + Invocation.setter(#syncType, syncType), + returnValueForMissingStub: null, + ); @override - set backupFrequencyType(_i12.BackupFrequencyType? backupFrequencyType) => - super.noSuchMethod( - Invocation.setter( - #backupFrequencyType, - backupFrequencyType, - ), - returnValueForMissingStub: null, - ); + set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + Invocation.setter(#wifiOnly, wifiOnly), + returnValueForMissingStub: null, + ); @override - set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( - Invocation.setter( - #lastAutoBackup, - lastAutoBackup, - ), - returnValueForMissingStub: null, - ); + set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( + Invocation.setter(#showFavoriteWallets, showFavoriteWallets), + returnValueForMissingStub: null, + ); @override - bool get hideBlockExplorerWarning => (super.noSuchMethod( - Invocation.getter(#hideBlockExplorerWarning), - returnValue: false, - ) as bool); + set language(String? newLanguage) => super.noSuchMethod( + Invocation.setter(#language, newLanguage), + returnValueForMissingStub: null, + ); @override - set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => - super.noSuchMethod( - Invocation.setter( - #hideBlockExplorerWarning, - hideBlockExplorerWarning, - ), - returnValueForMissingStub: null, - ); + set currency(String? newCurrency) => super.noSuchMethod( + Invocation.setter(#currency, newCurrency), + returnValueForMissingStub: null, + ); @override - bool get gotoWalletOnStartup => (super.noSuchMethod( - Invocation.getter(#gotoWalletOnStartup), - returnValue: false, - ) as bool); + set randomizePIN(bool? randomizePIN) => super.noSuchMethod( + Invocation.setter(#randomizePIN, randomizePIN), + returnValueForMissingStub: null, + ); @override - set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( - Invocation.setter( - #gotoWalletOnStartup, - gotoWalletOnStartup, - ), - returnValueForMissingStub: null, - ); + set useBiometrics(bool? useBiometrics) => super.noSuchMethod( + Invocation.setter(#useBiometrics, useBiometrics), + returnValueForMissingStub: null, + ); @override - set startupWalletId(String? startupWalletId) => super.noSuchMethod( - Invocation.setter( - #startupWalletId, - startupWalletId, - ), - returnValueForMissingStub: null, - ); + set hasPin(bool? hasPin) => super.noSuchMethod( + Invocation.setter(#hasPin, hasPin), + returnValueForMissingStub: null, + ); @override - bool get externalCalls => (super.noSuchMethod( - Invocation.getter(#externalCalls), - returnValue: false, - ) as bool); + set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( + Invocation.setter(#hasDuressPin, hasDuressPin), + returnValueForMissingStub: null, + ); @override - set externalCalls(bool? externalCalls) => super.noSuchMethod( - Invocation.setter( - #externalCalls, - externalCalls, - ), - returnValueForMissingStub: null, - ); + set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( + Invocation.setter(#biometricsDuress, biometricsDuress), + returnValueForMissingStub: null, + ); @override - bool get enableCoinControl => (super.noSuchMethod( - Invocation.getter(#enableCoinControl), - returnValue: false, - ) as bool); + set familiarity(int? familiarity) => super.noSuchMethod( + Invocation.setter(#familiarity, familiarity), + returnValueForMissingStub: null, + ); @override - set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( - Invocation.setter( - #enableCoinControl, - enableCoinControl, - ), + set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( + Invocation.setter(#torKillSwitch, torKillswitch), + returnValueForMissingStub: null, + ); + + @override + set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( + Invocation.setter(#showTestNetCoins, showTestNetCoins), + returnValueForMissingStub: null, + ); + + @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 + set backupFrequencyType(_i12.BackupFrequencyType? backupFrequencyType) => + super.noSuchMethod( + Invocation.setter(#backupFrequencyType, backupFrequencyType), returnValueForMissingStub: null, ); @override - bool get enableSystemBrightness => (super.noSuchMethod( - Invocation.getter(#enableSystemBrightness), - returnValue: false, - ) as bool); + set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( + Invocation.setter(#lastAutoBackup, lastAutoBackup), + returnValueForMissingStub: null, + ); @override - set enableSystemBrightness(bool? enableSystemBrightness) => + set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => super.noSuchMethod( - Invocation.setter( - #enableSystemBrightness, - enableSystemBrightness, - ), + Invocation.setter(#hideBlockExplorerWarning, hideBlockExplorerWarning), returnValueForMissingStub: null, ); @override - String get themeId => (super.noSuchMethod( - Invocation.getter(#themeId), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#themeId), - ), - ) as String); + set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( + Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup), + returnValueForMissingStub: null, + ); @override - set themeId(String? themeId) => super.noSuchMethod( - Invocation.setter( - #themeId, - themeId, - ), + set startupWalletId(String? startupWalletId) => super.noSuchMethod( + Invocation.setter(#startupWalletId, startupWalletId), + returnValueForMissingStub: null, + ); + + @override + set externalCalls(bool? externalCalls) => super.noSuchMethod( + Invocation.setter(#externalCalls, externalCalls), + returnValueForMissingStub: null, + ); + + @override + set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( + Invocation.setter(#enableCoinControl, enableCoinControl), + returnValueForMissingStub: null, + ); + + @override + set enableSystemBrightness(bool? enableSystemBrightness) => + super.noSuchMethod( + Invocation.setter(#enableSystemBrightness, enableSystemBrightness), returnValueForMissingStub: null, ); @override - String get systemBrightnessLightThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessLightThemeId), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#systemBrightnessLightThemeId), - ), - ) as String); + set themeId(String? themeId) => super.noSuchMethod( + Invocation.setter(#themeId, themeId), + returnValueForMissingStub: null, + ); @override set systemBrightnessLightThemeId(String? systemBrightnessLightThemeId) => @@ -1158,15 +1040,6 @@ class MockPrefs extends _i1.Mock implements _i10.Prefs { returnValueForMissingStub: null, ); - @override - String get systemBrightnessDarkThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessDarkThemeId), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#systemBrightnessDarkThemeId), - ), - ) as String); - @override set systemBrightnessDarkThemeId(String? systemBrightnessDarkThemeId) => super.noSuchMethod( @@ -1177,278 +1050,179 @@ class MockPrefs extends _i1.Mock implements _i10.Prefs { returnValueForMissingStub: null, ); - @override - bool get useTor => (super.noSuchMethod( - Invocation.getter(#useTor), - returnValue: false, - ) as bool); - @override set useTor(bool? useTor) => super.noSuchMethod( - Invocation.setter( - #useTor, - useTor, - ), - returnValueForMissingStub: null, - ); - - @override - bool get autoPin => (super.noSuchMethod( - Invocation.getter(#autoPin), - returnValue: false, - ) as bool); + Invocation.setter(#useTor, useTor), + returnValueForMissingStub: null, + ); @override set autoPin(bool? autoPin) => super.noSuchMethod( - Invocation.setter( - #autoPin, - autoPin, - ), - returnValueForMissingStub: null, - ); - - @override - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); + Invocation.setter(#autoPin, autoPin), + returnValueForMissingStub: null, + ); @override set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), - returnValueForMissingStub: null, - ); - - @override -<<<<<<< - bool get advancedFiroFeatures => (super.noSuchMethod( - Invocation.getter(#advancedFiroFeatures), - returnValue: false, - ) as bool); + Invocation.setter(#enableExchange, showExchange), + returnValueForMissingStub: null, + ); @override set advancedFiroFeatures(bool? advancedFiroFeatures) => super.noSuchMethod( - Invocation.setter( - #advancedFiroFeatures, - advancedFiroFeatures, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#advancedFiroFeatures, advancedFiroFeatures), + returnValueForMissingStub: null, + ); @override set logsPath(String? logsPath) => super.noSuchMethod( - Invocation.setter( - #logsPath, - logsPath, - ), - returnValueForMissingStub: null, - ); - - @override - _i13.Level get logLevel => (super.noSuchMethod( - Invocation.getter(#logLevel), - returnValue: _i13.Level.all, - ) as _i13.Level); + Invocation.setter(#logsPath, logsPath), + returnValueForMissingStub: null, + ); @override set logLevel(_i13.Level? logLevel) => super.noSuchMethod( - Invocation.setter( - #logLevel, - logLevel, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#logLevel, logLevel), + returnValueForMissingStub: null, + ); @override -======= - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); - @override - set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), + set autoLockInfo(({bool enabled, int minutes})? autoLockInfo) => + super.noSuchMethod( + Invocation.setter(#autoLockInfo, autoLockInfo), returnValueForMissingStub: null, ); + @override ->>>>>>> - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i9.Future init() => (super.noSuchMethod( - Invocation.method( - #init, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future init() => + (super.noSuchMethod( + Invocation.method(#init, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( - Invocation.method( - #incrementCurrentNotificationIndex, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future incrementCurrentNotificationIndex() => + (super.noSuchMethod( + Invocation.method(#incrementCurrentNotificationIndex, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future isExternalCallsSet() => (super.noSuchMethod( - Invocation.method( - #isExternalCallsSet, - [], - ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + _i9.Future isExternalCallsSet() => + (super.noSuchMethod( + Invocation.method(#isExternalCallsSet, []), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); @override - _i9.Future saveUserID(String? userId) => (super.noSuchMethod( - Invocation.method( - #saveUserID, - [userId], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future saveUserID(String? userId) => + (super.noSuchMethod( + Invocation.method(#saveUserID, [userId]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( - Invocation.method( - #saveSignupEpoch, - [signupEpoch], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future saveSignupEpoch(int? signupEpoch) => + (super.noSuchMethod( + Invocation.method(#saveSignupEpoch, [signupEpoch]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i14.AmountUnit amountUnit(_i2.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #amountUnit, - [coin], - ), - returnValue: _i14.AmountUnit.normal, - ) as _i14.AmountUnit); + _i14.AmountUnit amountUnit(_i2.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#amountUnit, [coin]), + returnValue: _i14.AmountUnit.normal, + ) + as _i14.AmountUnit); @override void updateAmountUnit({ required _i2.CryptoCurrency? coin, required _i14.AmountUnit? amountUnit, - }) => - super.noSuchMethod( - Invocation.method( - #updateAmountUnit, - [], - { - #coin: coin, - #amountUnit: amountUnit, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateAmountUnit, [], { + #coin: coin, + #amountUnit: amountUnit, + }), + returnValueForMissingStub: null, + ); @override - int maxDecimals(_i2.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #maxDecimals, - [coin], - ), - returnValue: 0, - ) as int); + int maxDecimals(_i2.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#maxDecimals, [coin]), + returnValue: 0, + ) + as int); @override void updateMaxDecimals({ required _i2.CryptoCurrency? coin, required int? maxDecimals, - }) => - super.noSuchMethod( - Invocation.method( - #updateMaxDecimals, - [], - { - #coin: coin, - #maxDecimals: maxDecimals, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateMaxDecimals, [], { + #coin: coin, + #maxDecimals: maxDecimals, + }), + returnValueForMissingStub: null, + ); @override _i5.FusionInfo getFusionServerInfo(_i2.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getFusionServerInfo, - [coin], - ), - returnValue: _FakeFusionInfo_4( - this, - Invocation.method( - #getFusionServerInfo, - [coin], - ), - ), - ) as _i5.FusionInfo); + Invocation.method(#getFusionServerInfo, [coin]), + returnValue: _FakeFusionInfo_4( + this, + Invocation.method(#getFusionServerInfo, [coin]), + ), + ) + as _i5.FusionInfo); @override void setFusionServerInfo( _i2.CryptoCurrency? coin, _i5.FusionInfo? fusionServerInfo, - ) => - super.noSuchMethod( - Invocation.method( - #setFusionServerInfo, - [ - coin, - fusionServerInfo, - ], - ), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#setFusionServerInfo, [coin, fusionServerInfo]), + returnValueForMissingStub: null, + ); @override void addListener(_i15.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } diff --git a/test/flutter_secure_storage_interface_test.mocks.dart b/test/flutter_secure_storage_interface_test.mocks.dart index e99c6b1a7f..5d16aaa3e7 100644 --- a/test/flutter_secure_storage_interface_test.mocks.dart +++ b/test/flutter_secure_storage_interface_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/flutter_secure_storage_interface_test.dart. // Do not manually edit this file. @@ -16,71 +16,43 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeIOSOptions_0 extends _i1.SmartFake implements _i2.IOSOptions { - _FakeIOSOptions_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeIOSOptions_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeAndroidOptions_1 extends _i1.SmartFake implements _i2.AndroidOptions { - _FakeAndroidOptions_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeAndroidOptions_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeLinuxOptions_2 extends _i1.SmartFake implements _i2.LinuxOptions { - _FakeLinuxOptions_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeLinuxOptions_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWindowsOptions_3 extends _i1.SmartFake implements _i2.WindowsOptions { - _FakeWindowsOptions_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWindowsOptions_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebOptions_4 extends _i1.SmartFake implements _i2.WebOptions { - _FakeWebOptions_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebOptions_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMacOsOptions_5 extends _i1.SmartFake implements _i2.MacOsOptions { - _FakeMacOsOptions_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMacOsOptions_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [FlutterSecureStorage]. @@ -93,58 +65,67 @@ class MockFlutterSecureStorage extends _i1.Mock } @override - _i2.IOSOptions get iOptions => (super.noSuchMethod( - Invocation.getter(#iOptions), - returnValue: _FakeIOSOptions_0( - this, - Invocation.getter(#iOptions), - ), - ) as _i2.IOSOptions); + _i2.IOSOptions get iOptions => + (super.noSuchMethod( + Invocation.getter(#iOptions), + returnValue: _FakeIOSOptions_0(this, Invocation.getter(#iOptions)), + ) + as _i2.IOSOptions); @override - _i2.AndroidOptions get aOptions => (super.noSuchMethod( - Invocation.getter(#aOptions), - returnValue: _FakeAndroidOptions_1( - this, - Invocation.getter(#aOptions), - ), - ) as _i2.AndroidOptions); + _i2.AndroidOptions get aOptions => + (super.noSuchMethod( + Invocation.getter(#aOptions), + returnValue: _FakeAndroidOptions_1( + this, + Invocation.getter(#aOptions), + ), + ) + as _i2.AndroidOptions); @override - _i2.LinuxOptions get lOptions => (super.noSuchMethod( - Invocation.getter(#lOptions), - returnValue: _FakeLinuxOptions_2( - this, - Invocation.getter(#lOptions), - ), - ) as _i2.LinuxOptions); + _i2.LinuxOptions get lOptions => + (super.noSuchMethod( + Invocation.getter(#lOptions), + returnValue: _FakeLinuxOptions_2( + this, + Invocation.getter(#lOptions), + ), + ) + as _i2.LinuxOptions); @override - _i2.WindowsOptions get wOptions => (super.noSuchMethod( - Invocation.getter(#wOptions), - returnValue: _FakeWindowsOptions_3( - this, - Invocation.getter(#wOptions), - ), - ) as _i2.WindowsOptions); + _i2.WindowsOptions get wOptions => + (super.noSuchMethod( + Invocation.getter(#wOptions), + returnValue: _FakeWindowsOptions_3( + this, + Invocation.getter(#wOptions), + ), + ) + as _i2.WindowsOptions); @override - _i2.WebOptions get webOptions => (super.noSuchMethod( - Invocation.getter(#webOptions), - returnValue: _FakeWebOptions_4( - this, - Invocation.getter(#webOptions), - ), - ) as _i2.WebOptions); + _i2.WebOptions get webOptions => + (super.noSuchMethod( + Invocation.getter(#webOptions), + returnValue: _FakeWebOptions_4( + this, + Invocation.getter(#webOptions), + ), + ) + as _i2.WebOptions); @override - _i2.MacOsOptions get mOptions => (super.noSuchMethod( - Invocation.getter(#mOptions), - returnValue: _FakeMacOsOptions_5( - this, - Invocation.getter(#mOptions), - ), - ) as _i2.MacOsOptions); + _i2.MacOsOptions get mOptions => + (super.noSuchMethod( + Invocation.getter(#mOptions), + returnValue: _FakeMacOsOptions_5( + this, + Invocation.getter(#mOptions), + ), + ) + as _i2.MacOsOptions); @override _i3.Future write({ @@ -158,23 +139,20 @@ class MockFlutterSecureStorage extends _i1.Mock _i2.WindowsOptions? wOptions, }) => (super.noSuchMethod( - Invocation.method( - #write, - [], - { - #key: key, - #value: value, - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#write, [], { + #key: key, + #value: value, + #iOptions: iOptions, + #aOptions: aOptions, + #lOptions: lOptions, + #webOptions: webOptions, + #mOptions: mOptions, + #wOptions: wOptions, + }), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future read({ @@ -187,21 +165,18 @@ class MockFlutterSecureStorage extends _i1.Mock _i2.WindowsOptions? wOptions, }) => (super.noSuchMethod( - Invocation.method( - #read, - [], - { - #key: key, - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#read, [], { + #key: key, + #iOptions: iOptions, + #aOptions: aOptions, + #lOptions: lOptions, + #webOptions: webOptions, + #mOptions: mOptions, + #wOptions: wOptions, + }), + returnValue: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future containsKey({ @@ -214,21 +189,18 @@ class MockFlutterSecureStorage extends _i1.Mock _i2.WindowsOptions? wOptions, }) => (super.noSuchMethod( - Invocation.method( - #containsKey, - [], - { - #key: key, - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + Invocation.method(#containsKey, [], { + #key: key, + #iOptions: iOptions, + #aOptions: aOptions, + #lOptions: lOptions, + #webOptions: webOptions, + #mOptions: mOptions, + #wOptions: wOptions, + }), + returnValue: _i3.Future.value(false), + ) + as _i3.Future); @override _i3.Future delete({ @@ -241,22 +213,19 @@ class MockFlutterSecureStorage extends _i1.Mock _i2.WindowsOptions? wOptions, }) => (super.noSuchMethod( - Invocation.method( - #delete, - [], - { - #key: key, - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#delete, [], { + #key: key, + #iOptions: iOptions, + #aOptions: aOptions, + #lOptions: lOptions, + #webOptions: webOptions, + #mOptions: mOptions, + #wOptions: wOptions, + }), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future> readAll({ @@ -268,20 +237,19 @@ class MockFlutterSecureStorage extends _i1.Mock _i2.WindowsOptions? wOptions, }) => (super.noSuchMethod( - Invocation.method( - #readAll, - [], - { - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future>.value({}), - ) as _i3.Future>); + Invocation.method(#readAll, [], { + #iOptions: iOptions, + #aOptions: aOptions, + #lOptions: lOptions, + #webOptions: webOptions, + #mOptions: mOptions, + #wOptions: wOptions, + }), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override _i3.Future deleteAll({ @@ -293,19 +261,16 @@ class MockFlutterSecureStorage extends _i1.Mock _i2.WindowsOptions? wOptions, }) => (super.noSuchMethod( - Invocation.method( - #deleteAll, - [], - { - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#deleteAll, [], { + #iOptions: iOptions, + #aOptions: aOptions, + #lOptions: lOptions, + #webOptions: webOptions, + #mOptions: mOptions, + #wOptions: wOptions, + }), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } 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 e458938d0c..c6e9fd5c79 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,15 +1,17 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/models/type_adapter_tests/lelantus_coin_adapter_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:convert' as _i5; -import 'dart:typed_data' as _i4; +import 'dart:convert' as _i6; +import 'dart:typed_data' as _i5; -import 'package:hive_ce/hive.dart' as _i3; +import 'package:hive_ce/src/binary/binary_reader.dart' as _i4; +import 'package:hive_ce/src/binary/binary_writer.dart' as _i8; +import 'package:hive_ce/src/object/hive_list.dart' as _i3; import 'package:hive_ce/src/object/hive_object.dart' as _i1; import 'package:mockito/mockito.dart' as _i2; -import 'package:mockito/src/dummies.dart' as _i6; +import 'package:mockito/src/dummies.dart' as _i7; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -19,10 +21,12 @@ import 'package:mockito/src/dummies.dart' as _i6; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeHiveList_0 extends _i2.SmartFake implements _i3.HiveList { @@ -33,7 +37,7 @@ class _FakeHiveList_0 extends _i2.SmartFake /// A class which mocks [BinaryReader]. /// /// See the documentation for Mockito's code generation for more information. -class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { +class MockBinaryReader extends _i2.Mock implements _i4.BinaryReader { MockBinaryReader() { _i2.throwOnMissingStub(this); } @@ -60,20 +64,20 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { as int); @override - _i4.Uint8List viewBytes(int? bytes) => + _i5.Uint8List viewBytes(int? bytes) => (super.noSuchMethod( Invocation.method(#viewBytes, [bytes]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override - _i4.Uint8List peekBytes(int? bytes) => + _i5.Uint8List peekBytes(int? bytes) => (super.noSuchMethod( Invocation.method(#peekBytes, [bytes]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override int readWord() => @@ -108,11 +112,11 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { @override String readString([ int? byteCount, - _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), + _i6.Converter, String>? decoder = const _i6.Utf8Decoder(), ]) => (super.noSuchMethod( Invocation.method(#readString, [byteCount, decoder]), - returnValue: _i6.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method(#readString, [byteCount, decoder]), ), @@ -120,12 +124,12 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { as String); @override - _i4.Uint8List readByteList([int? length]) => + _i5.Uint8List readByteList([int? length]) => (super.noSuchMethod( Invocation.method(#readByteList, [length]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override List readIntList([int? length]) => @@ -154,7 +158,7 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { @override List readStringList([ int? length, - _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), + _i6.Converter, String>? decoder = const _i6.Utf8Decoder(), ]) => (super.noSuchMethod( Invocation.method(#readStringList, [length, decoder]), @@ -193,7 +197,7 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { /// A class which mocks [BinaryWriter]. /// /// See the documentation for Mockito's code generation for more information. -class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { +class MockBinaryWriter extends _i2.Mock implements _i8.BinaryWriter { MockBinaryWriter() { _i2.throwOnMissingStub(this); } @@ -244,7 +248,7 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeString( String? value, { bool? writeByteCount = true, - _i5.Converter>? encoder = const _i5.Utf8Encoder(), + _i6.Converter>? encoder = const _i6.Utf8Encoder(), }) => super.noSuchMethod( Invocation.method( #writeString, @@ -290,7 +294,7 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeStringList( List? list, { bool? writeLength = true, - _i5.Converter>? encoder = const _i5.Utf8Encoder(), + _i6.Converter>? encoder = const _i6.Utf8Encoder(), }) => super.noSuchMethod( Invocation.method( #writeStringList, @@ -324,8 +328,8 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { ); @override - void write(T? value, {bool? writeTypeId = true}) => super.noSuchMethod( - Invocation.method(#write, [value], {#writeTypeId: writeTypeId}), + void write(T? value, {bool? withTypeId = true}) => super.noSuchMethod( + Invocation.method(#write, [value], {#withTypeId: withTypeId}), returnValueForMissingStub: null, ); } 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 d68fd1eb78..ec2772a7a6 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,15 +1,17 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/models/type_adapter_tests/transactions_model_adapter_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:convert' as _i5; -import 'dart:typed_data' as _i4; +import 'dart:convert' as _i6; +import 'dart:typed_data' as _i5; -import 'package:hive_ce/hive.dart' as _i3; +import 'package:hive_ce/src/binary/binary_reader.dart' as _i4; +import 'package:hive_ce/src/binary/binary_writer.dart' as _i8; +import 'package:hive_ce/src/object/hive_list.dart' as _i3; import 'package:hive_ce/src/object/hive_object.dart' as _i1; import 'package:mockito/mockito.dart' as _i2; -import 'package:mockito/src/dummies.dart' as _i6; +import 'package:mockito/src/dummies.dart' as _i7; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -19,10 +21,12 @@ import 'package:mockito/src/dummies.dart' as _i6; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeHiveList_0 extends _i2.SmartFake implements _i3.HiveList { @@ -33,7 +37,7 @@ class _FakeHiveList_0 extends _i2.SmartFake /// A class which mocks [BinaryReader]. /// /// See the documentation for Mockito's code generation for more information. -class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { +class MockBinaryReader extends _i2.Mock implements _i4.BinaryReader { MockBinaryReader() { _i2.throwOnMissingStub(this); } @@ -60,20 +64,20 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { as int); @override - _i4.Uint8List viewBytes(int? bytes) => + _i5.Uint8List viewBytes(int? bytes) => (super.noSuchMethod( Invocation.method(#viewBytes, [bytes]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override - _i4.Uint8List peekBytes(int? bytes) => + _i5.Uint8List peekBytes(int? bytes) => (super.noSuchMethod( Invocation.method(#peekBytes, [bytes]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override int readWord() => @@ -108,11 +112,11 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { @override String readString([ int? byteCount, - _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), + _i6.Converter, String>? decoder = const _i6.Utf8Decoder(), ]) => (super.noSuchMethod( Invocation.method(#readString, [byteCount, decoder]), - returnValue: _i6.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method(#readString, [byteCount, decoder]), ), @@ -120,12 +124,12 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { as String); @override - _i4.Uint8List readByteList([int? length]) => + _i5.Uint8List readByteList([int? length]) => (super.noSuchMethod( Invocation.method(#readByteList, [length]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override List readIntList([int? length]) => @@ -154,7 +158,7 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { @override List readStringList([ int? length, - _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), + _i6.Converter, String>? decoder = const _i6.Utf8Decoder(), ]) => (super.noSuchMethod( Invocation.method(#readStringList, [length, decoder]), @@ -193,7 +197,7 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { /// A class which mocks [BinaryWriter]. /// /// See the documentation for Mockito's code generation for more information. -class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { +class MockBinaryWriter extends _i2.Mock implements _i8.BinaryWriter { MockBinaryWriter() { _i2.throwOnMissingStub(this); } @@ -244,7 +248,7 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeString( String? value, { bool? writeByteCount = true, - _i5.Converter>? encoder = const _i5.Utf8Encoder(), + _i6.Converter>? encoder = const _i6.Utf8Encoder(), }) => super.noSuchMethod( Invocation.method( #writeString, @@ -290,7 +294,7 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeStringList( List? list, { bool? writeLength = true, - _i5.Converter>? encoder = const _i5.Utf8Encoder(), + _i6.Converter>? encoder = const _i6.Utf8Encoder(), }) => super.noSuchMethod( Invocation.method( #writeStringList, @@ -324,8 +328,8 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { ); @override - void write(T? value, {bool? writeTypeId = true}) => super.noSuchMethod( - Invocation.method(#write, [value], {#writeTypeId: writeTypeId}), + void write(T? value, {bool? withTypeId = true}) => super.noSuchMethod( + Invocation.method(#write, [value], {#withTypeId: withTypeId}), returnValueForMissingStub: null, ); } 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 fc00678f29..294ae2d9fd 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,15 +1,17 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/models/type_adapter_tests/utxo_model_adapter_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:convert' as _i5; -import 'dart:typed_data' as _i4; +import 'dart:convert' as _i6; +import 'dart:typed_data' as _i5; -import 'package:hive_ce/hive.dart' as _i3; +import 'package:hive_ce/src/binary/binary_reader.dart' as _i4; +import 'package:hive_ce/src/binary/binary_writer.dart' as _i8; +import 'package:hive_ce/src/object/hive_list.dart' as _i3; import 'package:hive_ce/src/object/hive_object.dart' as _i1; import 'package:mockito/mockito.dart' as _i2; -import 'package:mockito/src/dummies.dart' as _i6; +import 'package:mockito/src/dummies.dart' as _i7; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -19,10 +21,12 @@ import 'package:mockito/src/dummies.dart' as _i6; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeHiveList_0 extends _i2.SmartFake implements _i3.HiveList { @@ -33,7 +37,7 @@ class _FakeHiveList_0 extends _i2.SmartFake /// A class which mocks [BinaryReader]. /// /// See the documentation for Mockito's code generation for more information. -class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { +class MockBinaryReader extends _i2.Mock implements _i4.BinaryReader { MockBinaryReader() { _i2.throwOnMissingStub(this); } @@ -60,20 +64,20 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { as int); @override - _i4.Uint8List viewBytes(int? bytes) => + _i5.Uint8List viewBytes(int? bytes) => (super.noSuchMethod( Invocation.method(#viewBytes, [bytes]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override - _i4.Uint8List peekBytes(int? bytes) => + _i5.Uint8List peekBytes(int? bytes) => (super.noSuchMethod( Invocation.method(#peekBytes, [bytes]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override int readWord() => @@ -108,11 +112,11 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { @override String readString([ int? byteCount, - _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), + _i6.Converter, String>? decoder = const _i6.Utf8Decoder(), ]) => (super.noSuchMethod( Invocation.method(#readString, [byteCount, decoder]), - returnValue: _i6.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method(#readString, [byteCount, decoder]), ), @@ -120,12 +124,12 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { as String); @override - _i4.Uint8List readByteList([int? length]) => + _i5.Uint8List readByteList([int? length]) => (super.noSuchMethod( Invocation.method(#readByteList, [length]), - returnValue: _i4.Uint8List(0), + returnValue: _i5.Uint8List(0), ) - as _i4.Uint8List); + as _i5.Uint8List); @override List readIntList([int? length]) => @@ -154,7 +158,7 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { @override List readStringList([ int? length, - _i5.Converter, String>? decoder = const _i5.Utf8Decoder(), + _i6.Converter, String>? decoder = const _i6.Utf8Decoder(), ]) => (super.noSuchMethod( Invocation.method(#readStringList, [length, decoder]), @@ -193,7 +197,7 @@ class MockBinaryReader extends _i2.Mock implements _i3.BinaryReader { /// A class which mocks [BinaryWriter]. /// /// See the documentation for Mockito's code generation for more information. -class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { +class MockBinaryWriter extends _i2.Mock implements _i8.BinaryWriter { MockBinaryWriter() { _i2.throwOnMissingStub(this); } @@ -244,7 +248,7 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeString( String? value, { bool? writeByteCount = true, - _i5.Converter>? encoder = const _i5.Utf8Encoder(), + _i6.Converter>? encoder = const _i6.Utf8Encoder(), }) => super.noSuchMethod( Invocation.method( #writeString, @@ -290,7 +294,7 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { void writeStringList( List? list, { bool? writeLength = true, - _i5.Converter>? encoder = const _i5.Utf8Encoder(), + _i6.Converter>? encoder = const _i6.Utf8Encoder(), }) => super.noSuchMethod( Invocation.method( #writeStringList, @@ -324,8 +328,8 @@ class MockBinaryWriter extends _i2.Mock implements _i3.BinaryWriter { ); @override - void write(T? value, {bool? writeTypeId = true}) => super.noSuchMethod( - Invocation.method(#write, [value], {#writeTypeId: writeTypeId}), + void write(T? value, {bool? withTypeId = true}) => super.noSuchMethod( + Invocation.method(#write, [value], {#withTypeId: withTypeId}), returnValueForMissingStub: null, ); } diff --git a/test/notifications/notification_card_test.mocks.dart b/test/notifications/notification_card_test.mocks.dart index edff5e5f4b..de2851e57e 100644 --- a/test/notifications/notification_card_test.mocks.dart +++ b/test/notifications/notification_card_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/notifications/notification_card_test.dart. // Do not manually edit this file. @@ -7,9 +7,9 @@ import 'dart:async' as _i6; import 'dart:typed_data' as _i7; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/db/isar/main_db.dart' as _i3; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; import 'package:stackwallet/models/isar/stack_theme.dart' as _i5; -import 'package:stackwallet/networking/http.dart' as _i2; +import 'package:stackwallet/networking/http.dart' as _i3; import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: type=lint @@ -20,29 +20,21 @@ import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member -class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP { - _FakeHTTP_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeHTTP_1 extends _i1.SmartFake implements _i3.HTTP { + _FakeHTTP_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ThemeService]. @@ -54,118 +46,100 @@ class MockThemeService extends _i1.Mock implements _i4.ThemeService { } @override - _i2.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_0( - this, - Invocation.getter(#client), - ), - ) as _i2.HTTP); + _i2.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0(this, Invocation.getter(#db)), + ) + as _i2.MainDB); @override - set client(_i2.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i3.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_1(this, Invocation.getter(#client)), + ) + as _i3.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i5.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i5.StackTheme>[], + ) + as List<_i5.StackTheme>); @override - List<_i5.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i5.StackTheme>[], - ) as List<_i5.StackTheme>); + set client(_i3.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override - void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i6.Future install({required _i7.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override _i6.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i6.Future.value(false), + ) + as _i6.Future); @override - _i6.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i6.Future>.value( - <_i4.StackThemeMetaData>[]), - ) as _i6.Future>); + _i6.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method(#fetchThemes, []), + returnValue: _i6.Future>.value( + <_i4.StackThemeMetaData>[], + ), + ) + as _i6.Future>); @override - _i6.Future<_i7.Uint8List> fetchTheme( - {required _i4.StackThemeMetaData? themeMetaData}) => + _i6.Future<_i7.Uint8List> fetchTheme({ + required _i4.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), - ) as _i6.Future<_i7.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), + ) + as _i6.Future<_i7.Uint8List>); @override _i5.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i5.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i5.StackTheme?); } diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index 35c4f4ba06..91fa2a84e8 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/pages/send_view/send_view_test.dart. // Do not manually edit this file. @@ -39,71 +39,43 @@ import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_i // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeNodeService_0 extends _i1.SmartFake implements _i2.NodeService { - _FakeNodeService_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeNodeService_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMainDB_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWallet_2 extends _i1.SmartFake implements _i5.Wallet { - _FakeWallet_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWallet_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSecureStorageInterface_3 extends _i1.SmartFake implements _i6.SecureStorageInterface { - _FakeSecureStorageInterface_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeHTTP_4 extends _i1.SmartFake implements _i7.HTTP { - _FakeHTTP_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHTTP_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFusionInfo_5 extends _i1.SmartFake implements _i8.FusionInfo { - _FakeFusionInfo_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFusionInfo_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Wallets]. @@ -115,71 +87,60 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { } @override - _i2.NodeService get nodeService => (super.noSuchMethod( - Invocation.getter(#nodeService), - returnValue: _FakeNodeService_0( - this, - Invocation.getter(#nodeService), - ), - ) as _i2.NodeService); + _i2.NodeService get nodeService => + (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_0( + this, + Invocation.getter(#nodeService), + ), + ) + as _i2.NodeService); @override - set nodeService(_i2.NodeService? _nodeService) => super.noSuchMethod( - Invocation.setter( - #nodeService, - _nodeService, - ), - returnValueForMissingStub: null, - ); + _i3.MainDB get mainDB => + (super.noSuchMethod( + Invocation.getter(#mainDB), + returnValue: _FakeMainDB_1(this, Invocation.getter(#mainDB)), + ) + as _i3.MainDB); @override - _i3.MainDB get mainDB => (super.noSuchMethod( - Invocation.getter(#mainDB), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#mainDB), - ), - ) as _i3.MainDB); + List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => + (super.noSuchMethod( + Invocation.getter(#wallets), + returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], + ) + as List<_i5.Wallet<_i4.CryptoCurrency>>); @override - set mainDB(_i3.MainDB? _mainDB) => super.noSuchMethod( - Invocation.setter( - #mainDB, - _mainDB, - ), - returnValueForMissingStub: null, - ); + set nodeService(_i2.NodeService? value) => super.noSuchMethod( + Invocation.setter(#nodeService, value), + returnValueForMissingStub: null, + ); @override - List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => (super.noSuchMethod( - Invocation.getter(#wallets), - returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], - ) as List<_i5.Wallet<_i4.CryptoCurrency>>); + set mainDB(_i3.MainDB? value) => super.noSuchMethod( + Invocation.setter(#mainDB, value), + returnValueForMissingStub: null, + ); @override _i5.Wallet<_i4.CryptoCurrency> getWallet(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getWallet, - [walletId], - ), - returnValue: _FakeWallet_2<_i4.CryptoCurrency>( - this, - Invocation.method( - #getWallet, - [walletId], - ), - ), - ) as _i5.Wallet<_i4.CryptoCurrency>); + Invocation.method(#getWallet, [walletId]), + returnValue: _FakeWallet_2<_i4.CryptoCurrency>( + this, + Invocation.method(#getWallet, [walletId]), + ), + ) + as _i5.Wallet<_i4.CryptoCurrency>); @override void addWallet(_i5.Wallet<_i4.CryptoCurrency>? wallet) => super.noSuchMethod( - Invocation.method( - #addWallet, - [wallet], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addWallet, [wallet]), + returnValueForMissingStub: null, + ); @override _i10.Future deleteWallet( @@ -187,16 +148,11 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { _i6.SecureStorageInterface? secureStorage, ) => (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - info, - secureStorage, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#deleteWallet, [info, secureStorage]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future load( @@ -205,17 +161,11 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { bool? isDuress, ) => (super.noSuchMethod( - Invocation.method( - #load, - [ - prefs, - mainDB, - isDuress, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#load, [prefs, mainDB, isDuress]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future loadAfterStackRestore( @@ -224,17 +174,15 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { bool? isDesktop, ) => (super.noSuchMethod( - Invocation.method( - #loadAfterStackRestore, - [ - prefs, - wallets, - isDesktop, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#loadAfterStackRestore, [ + prefs, + wallets, + isDesktop, + ]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); } /// A class which mocks [NodeService]. @@ -246,41 +194,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { } @override - _i6.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_3( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i6.SecureStorageInterface); + _i6.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_3( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i6.SecureStorageInterface); @override - List<_i13.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i13.NodeModel>[], - ) as List<_i13.NodeModel>); + List<_i13.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i13.NodeModel>[], + ) + as List<_i13.NodeModel>); @override - List<_i13.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i13.NodeModel>[], - ) as List<_i13.NodeModel>); + List<_i13.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i13.NodeModel>[], + ) + as List<_i13.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future setPrimaryNodeFor({ @@ -289,56 +241,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i13.NodeModel? getPrimaryNodeFor({required _i4.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i13.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i13.NodeModel?); @override List<_i13.NodeModel> getNodesFor(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i13.NodeModel>[], - ) as List<_i13.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i13.NodeModel>[], + ) + as List<_i13.NodeModel>); @override _i13.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i13.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i13.NodeModel?); @override - List<_i13.NodeModel> failoverNodesFor( - {required _i4.CryptoCurrency? currency}) => + List<_i13.NodeModel> failoverNodesFor({ + required _i4.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i13.NodeModel>[], - ) as List<_i13.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i13.NodeModel>[], + ) + as List<_i13.NodeModel>); @override _i10.Future save( @@ -347,34 +288,20 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + _i10.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future setEnabledState( @@ -383,63 +310,48 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); - - @override - _i10.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); + + @override + _i10.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [LocaleService]. @@ -451,66 +363,53 @@ class MockLocaleService extends _i1.Mock implements _i15.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i16.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i16.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [ThemeService]. @@ -522,121 +421,102 @@ class MockThemeService extends _i1.Mock implements _i17.ThemeService { } @override - _i7.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_4( - this, - Invocation.getter(#client), - ), - ) as _i7.HTTP); + _i3.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_1(this, Invocation.getter(#db)), + ) + as _i3.MainDB); @override - set client(_i7.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i7.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_4(this, Invocation.getter(#client)), + ) + as _i7.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i18.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i18.StackTheme>[], + ) + as List<_i18.StackTheme>); @override - List<_i18.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i18.StackTheme>[], - ) as List<_i18.StackTheme>); + set client(_i7.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i10.Future install({required _i19.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override _i10.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i10.Future>.value( - <_i17.StackThemeMetaData>[]), - ) as _i10.Future>); + Invocation.method(#fetchThemes, []), + returnValue: _i10.Future>.value( + <_i17.StackThemeMetaData>[], + ), + ) + as _i10.Future>); @override - _i10.Future<_i19.Uint8List> fetchTheme( - {required _i17.StackThemeMetaData? themeMetaData}) => + _i10.Future<_i19.Uint8List> fetchTheme({ + required _i17.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i10.Future<_i19.Uint8List>.value(_i19.Uint8List(0)), - ) as _i10.Future<_i19.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i10.Future<_i19.Uint8List>.value(_i19.Uint8List(0)), + ) + as _i10.Future<_i19.Uint8List>); @override _i18.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i18.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i18.StackTheme?); } /// A class which mocks [Prefs]. @@ -648,425 +528,421 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { } @override - bool get isInitialized => (super.noSuchMethod( - Invocation.getter(#isInitialized), - returnValue: false, - ) as bool); + 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); + 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, - ); + int get lastUnlocked => + (super.noSuchMethod(Invocation.getter(#lastUnlocked), returnValue: 0) + as int); @override - int get lastUnlocked => (super.noSuchMethod( - Invocation.getter(#lastUnlocked), - returnValue: 0, - ) as int); + int get currentNotificationId => + (super.noSuchMethod( + Invocation.getter(#currentNotificationId), + returnValue: 0, + ) + as int); @override - set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( - Invocation.setter( - #lastUnlocked, - lastUnlocked, - ), - returnValueForMissingStub: null, - ); + List get walletIdsSyncOnStartup => + (super.noSuchMethod( + Invocation.getter(#walletIdsSyncOnStartup), + returnValue: [], + ) + as List); @override - int get currentNotificationId => (super.noSuchMethod( - Invocation.getter(#currentNotificationId), - returnValue: 0, - ) as int); + _i20.SyncingType get syncType => + (super.noSuchMethod( + Invocation.getter(#syncType), + returnValue: _i20.SyncingType.currentWalletOnly, + ) + as _i20.SyncingType); @override - List get walletIdsSyncOnStartup => (super.noSuchMethod( - Invocation.getter(#walletIdsSyncOnStartup), - returnValue: [], - ) as List); + bool get wifiOnly => + (super.noSuchMethod(Invocation.getter(#wifiOnly), returnValue: false) + as bool); @override - set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => - super.noSuchMethod( - Invocation.setter( - #walletIdsSyncOnStartup, - walletIdsSyncOnStartup, - ), - returnValueForMissingStub: null, - ); + bool get showFavoriteWallets => + (super.noSuchMethod( + Invocation.getter(#showFavoriteWallets), + returnValue: false, + ) + as bool); @override - _i20.SyncingType get syncType => (super.noSuchMethod( - Invocation.getter(#syncType), - returnValue: _i20.SyncingType.currentWalletOnly, - ) as _i20.SyncingType); + String get language => + (super.noSuchMethod( + Invocation.getter(#language), + returnValue: _i16.dummyValue( + this, + Invocation.getter(#language), + ), + ) + as String); @override - set syncType(_i20.SyncingType? syncType) => super.noSuchMethod( - Invocation.setter( - #syncType, - syncType, - ), - returnValueForMissingStub: null, - ); + String get currency => + (super.noSuchMethod( + Invocation.getter(#currency), + returnValue: _i16.dummyValue( + this, + Invocation.getter(#currency), + ), + ) + as String); @override - bool get wifiOnly => (super.noSuchMethod( - Invocation.getter(#wifiOnly), - returnValue: false, - ) as bool); + bool get randomizePIN => + (super.noSuchMethod(Invocation.getter(#randomizePIN), returnValue: false) + as bool); @override - set wifiOnly(bool? wifiOnly) => super.noSuchMethod( - Invocation.setter( - #wifiOnly, - wifiOnly, - ), - returnValueForMissingStub: null, - ); + bool get useBiometrics => + (super.noSuchMethod(Invocation.getter(#useBiometrics), returnValue: false) + as bool); @override - bool get showFavoriteWallets => (super.noSuchMethod( - Invocation.getter(#showFavoriteWallets), - returnValue: false, - ) as bool); + bool get hasPin => + (super.noSuchMethod(Invocation.getter(#hasPin), returnValue: false) + as bool); @override - set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( - Invocation.setter( - #showFavoriteWallets, - showFavoriteWallets, - ), - returnValueForMissingStub: null, - ); + bool get hasDuressPin => + (super.noSuchMethod(Invocation.getter(#hasDuressPin), returnValue: false) + as bool); @override - String get language => (super.noSuchMethod( - Invocation.getter(#language), - returnValue: _i16.dummyValue( - this, - Invocation.getter(#language), - ), - ) as String); + bool get biometricsDuress => + (super.noSuchMethod( + Invocation.getter(#biometricsDuress), + returnValue: false, + ) + as bool); @override - set language(String? newLanguage) => super.noSuchMethod( - Invocation.setter( - #language, - newLanguage, - ), - returnValueForMissingStub: null, - ); + int get familiarity => + (super.noSuchMethod(Invocation.getter(#familiarity), returnValue: 0) + as int); @override - String get currency => (super.noSuchMethod( - Invocation.getter(#currency), - returnValue: _i16.dummyValue( - this, - Invocation.getter(#currency), - ), - ) as String); + bool get torKillSwitch => + (super.noSuchMethod(Invocation.getter(#torKillSwitch), returnValue: false) + as bool); @override - set currency(String? newCurrency) => super.noSuchMethod( - Invocation.setter( - #currency, - newCurrency, - ), - returnValueForMissingStub: null, - ); + bool get showTestNetCoins => + (super.noSuchMethod( + Invocation.getter(#showTestNetCoins), + returnValue: false, + ) + as bool); @override - bool get randomizePIN => (super.noSuchMethod( - Invocation.getter(#randomizePIN), - returnValue: false, - ) as bool); + bool get isAutoBackupEnabled => + (super.noSuchMethod( + Invocation.getter(#isAutoBackupEnabled), + returnValue: false, + ) + as bool); @override - set randomizePIN(bool? randomizePIN) => super.noSuchMethod( - Invocation.setter( - #randomizePIN, - randomizePIN, - ), - returnValueForMissingStub: null, - ); + _i21.BackupFrequencyType get backupFrequencyType => + (super.noSuchMethod( + Invocation.getter(#backupFrequencyType), + returnValue: _i21.BackupFrequencyType.everyTenMinutes, + ) + as _i21.BackupFrequencyType); @override - bool get useBiometrics => (super.noSuchMethod( - Invocation.getter(#useBiometrics), - returnValue: false, - ) as bool); + bool get hideBlockExplorerWarning => + (super.noSuchMethod( + Invocation.getter(#hideBlockExplorerWarning), + returnValue: false, + ) + as bool); @override - set useBiometrics(bool? useBiometrics) => super.noSuchMethod( - Invocation.setter( - #useBiometrics, - useBiometrics, - ), - returnValueForMissingStub: null, - ); + bool get gotoWalletOnStartup => + (super.noSuchMethod( + Invocation.getter(#gotoWalletOnStartup), + returnValue: false, + ) + as bool); @override - bool get hasPin => (super.noSuchMethod( - Invocation.getter(#hasPin), - returnValue: false, - ) as bool); + bool get externalCalls => + (super.noSuchMethod(Invocation.getter(#externalCalls), returnValue: false) + as bool); @override - set hasPin(bool? hasPin) => super.noSuchMethod( - Invocation.setter( - #hasPin, - hasPin, - ), - returnValueForMissingStub: null, - ); + bool get enableCoinControl => + (super.noSuchMethod( + Invocation.getter(#enableCoinControl), + returnValue: false, + ) + as bool); @override - bool get hasDuressPin => (super.noSuchMethod( - Invocation.getter(#hasDuressPin), - returnValue: false, - ) as bool); + bool get enableSystemBrightness => + (super.noSuchMethod( + Invocation.getter(#enableSystemBrightness), + returnValue: false, + ) + as bool); @override - set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( - Invocation.setter( - #hasDuressPin, - hasDuressPin, - ), - returnValueForMissingStub: null, - ); + String get themeId => + (super.noSuchMethod( + Invocation.getter(#themeId), + returnValue: _i16.dummyValue( + this, + Invocation.getter(#themeId), + ), + ) + as String); @override - bool get biometricsDuress => (super.noSuchMethod( - Invocation.getter(#biometricsDuress), - returnValue: false, - ) as bool); + String get systemBrightnessLightThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessLightThemeId), + returnValue: _i16.dummyValue( + this, + Invocation.getter(#systemBrightnessLightThemeId), + ), + ) + as String); @override - set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( - Invocation.setter( - #biometricsDuress, - biometricsDuress, - ), - returnValueForMissingStub: null, - ); + String get systemBrightnessDarkThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessDarkThemeId), + returnValue: _i16.dummyValue( + this, + Invocation.getter(#systemBrightnessDarkThemeId), + ), + ) + as String); @override - int get familiarity => (super.noSuchMethod( - Invocation.getter(#familiarity), - returnValue: 0, - ) as int); + bool get useTor => + (super.noSuchMethod(Invocation.getter(#useTor), returnValue: false) + as bool); @override - set familiarity(int? familiarity) => super.noSuchMethod( - Invocation.setter( - #familiarity, - familiarity, - ), - returnValueForMissingStub: null, - ); + bool get autoPin => + (super.noSuchMethod(Invocation.getter(#autoPin), returnValue: false) + as bool); @override - bool get torKillSwitch => (super.noSuchMethod( - Invocation.getter(#torKillSwitch), - returnValue: false, - ) as bool); + bool get enableExchange => + (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) + as bool); @override - set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( - Invocation.setter( - #torKillSwitch, - torKillswitch, - ), - returnValueForMissingStub: null, - ); + bool get advancedFiroFeatures => + (super.noSuchMethod( + Invocation.getter(#advancedFiroFeatures), + returnValue: false, + ) + as bool); @override - bool get showTestNetCoins => (super.noSuchMethod( - Invocation.getter(#showTestNetCoins), - returnValue: false, - ) as bool); + _i22.Level get logLevel => + (super.noSuchMethod( + Invocation.getter(#logLevel), + returnValue: _i22.Level.all, + ) + as _i22.Level); @override - set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( - Invocation.setter( - #showTestNetCoins, - showTestNetCoins, - ), - returnValueForMissingStub: null, - ); + ({bool enabled, int minutes}) get autoLockInfo => + (super.noSuchMethod( + Invocation.getter(#autoLockInfo), + returnValue: (enabled: false, minutes: 0), + ) + as ({bool enabled, int minutes})); @override - bool get isAutoBackupEnabled => (super.noSuchMethod( - Invocation.getter(#isAutoBackupEnabled), - returnValue: false, - ) as bool); + set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + Invocation.setter(#lastUnlockedTimeout, lastUnlockedTimeout), + returnValueForMissingStub: null, + ); @override - set isAutoBackupEnabled(bool? isAutoBackupEnabled) => super.noSuchMethod( - Invocation.setter( - #isAutoBackupEnabled, - isAutoBackupEnabled, - ), - returnValueForMissingStub: null, - ); + set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + Invocation.setter(#lastUnlocked, lastUnlocked), + returnValueForMissingStub: null, + ); @override - set autoBackupLocation(String? autoBackupLocation) => super.noSuchMethod( - Invocation.setter( - #autoBackupLocation, - autoBackupLocation, - ), + set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => + super.noSuchMethod( + Invocation.setter(#walletIdsSyncOnStartup, walletIdsSyncOnStartup), returnValueForMissingStub: null, ); @override - _i21.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( - Invocation.getter(#backupFrequencyType), - returnValue: _i21.BackupFrequencyType.everyTenMinutes, - ) as _i21.BackupFrequencyType); + set syncType(_i20.SyncingType? syncType) => super.noSuchMethod( + Invocation.setter(#syncType, syncType), + returnValueForMissingStub: null, + ); @override - set backupFrequencyType(_i21.BackupFrequencyType? backupFrequencyType) => - super.noSuchMethod( - Invocation.setter( - #backupFrequencyType, - backupFrequencyType, - ), - returnValueForMissingStub: null, - ); + set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + Invocation.setter(#wifiOnly, wifiOnly), + returnValueForMissingStub: null, + ); @override - set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( - Invocation.setter( - #lastAutoBackup, - lastAutoBackup, - ), - returnValueForMissingStub: null, - ); + set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( + Invocation.setter(#showFavoriteWallets, showFavoriteWallets), + returnValueForMissingStub: null, + ); @override - bool get hideBlockExplorerWarning => (super.noSuchMethod( - Invocation.getter(#hideBlockExplorerWarning), - returnValue: false, - ) as bool); + set language(String? newLanguage) => super.noSuchMethod( + Invocation.setter(#language, newLanguage), + returnValueForMissingStub: null, + ); @override - set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => - super.noSuchMethod( - Invocation.setter( - #hideBlockExplorerWarning, - hideBlockExplorerWarning, - ), - returnValueForMissingStub: null, - ); + set currency(String? newCurrency) => super.noSuchMethod( + Invocation.setter(#currency, newCurrency), + returnValueForMissingStub: null, + ); @override - bool get gotoWalletOnStartup => (super.noSuchMethod( - Invocation.getter(#gotoWalletOnStartup), - returnValue: false, - ) as bool); + set randomizePIN(bool? randomizePIN) => super.noSuchMethod( + Invocation.setter(#randomizePIN, randomizePIN), + returnValueForMissingStub: null, + ); @override - set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( - Invocation.setter( - #gotoWalletOnStartup, - gotoWalletOnStartup, - ), - returnValueForMissingStub: null, - ); + set useBiometrics(bool? useBiometrics) => super.noSuchMethod( + Invocation.setter(#useBiometrics, useBiometrics), + returnValueForMissingStub: null, + ); @override - set startupWalletId(String? startupWalletId) => super.noSuchMethod( - Invocation.setter( - #startupWalletId, - startupWalletId, - ), - returnValueForMissingStub: null, - ); + set hasPin(bool? hasPin) => super.noSuchMethod( + Invocation.setter(#hasPin, hasPin), + returnValueForMissingStub: null, + ); @override - bool get externalCalls => (super.noSuchMethod( - Invocation.getter(#externalCalls), - returnValue: false, - ) as bool); + set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( + Invocation.setter(#hasDuressPin, hasDuressPin), + returnValueForMissingStub: null, + ); @override - set externalCalls(bool? externalCalls) => super.noSuchMethod( - Invocation.setter( - #externalCalls, - externalCalls, - ), - returnValueForMissingStub: null, - ); + set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( + Invocation.setter(#biometricsDuress, biometricsDuress), + returnValueForMissingStub: null, + ); @override - bool get enableCoinControl => (super.noSuchMethod( - Invocation.getter(#enableCoinControl), - returnValue: false, - ) as bool); + set familiarity(int? familiarity) => super.noSuchMethod( + Invocation.setter(#familiarity, familiarity), + returnValueForMissingStub: null, + ); @override - set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( - Invocation.setter( - #enableCoinControl, - enableCoinControl, - ), + set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( + Invocation.setter(#torKillSwitch, torKillswitch), + returnValueForMissingStub: null, + ); + + @override + set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( + Invocation.setter(#showTestNetCoins, showTestNetCoins), + returnValueForMissingStub: null, + ); + + @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 + set backupFrequencyType(_i21.BackupFrequencyType? backupFrequencyType) => + super.noSuchMethod( + Invocation.setter(#backupFrequencyType, backupFrequencyType), returnValueForMissingStub: null, ); @override - bool get enableSystemBrightness => (super.noSuchMethod( - Invocation.getter(#enableSystemBrightness), - returnValue: false, - ) as bool); + set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( + Invocation.setter(#lastAutoBackup, lastAutoBackup), + returnValueForMissingStub: null, + ); @override - set enableSystemBrightness(bool? enableSystemBrightness) => + set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => super.noSuchMethod( - Invocation.setter( - #enableSystemBrightness, - enableSystemBrightness, - ), + Invocation.setter(#hideBlockExplorerWarning, hideBlockExplorerWarning), returnValueForMissingStub: null, ); @override - String get themeId => (super.noSuchMethod( - Invocation.getter(#themeId), - returnValue: _i16.dummyValue( - this, - Invocation.getter(#themeId), - ), - ) as String); + set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( + Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup), + returnValueForMissingStub: null, + ); @override - set themeId(String? themeId) => super.noSuchMethod( - Invocation.setter( - #themeId, - themeId, - ), + set startupWalletId(String? startupWalletId) => super.noSuchMethod( + Invocation.setter(#startupWalletId, startupWalletId), + returnValueForMissingStub: null, + ); + + @override + set externalCalls(bool? externalCalls) => super.noSuchMethod( + Invocation.setter(#externalCalls, externalCalls), + returnValueForMissingStub: null, + ); + + @override + set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( + Invocation.setter(#enableCoinControl, enableCoinControl), + returnValueForMissingStub: null, + ); + + @override + set enableSystemBrightness(bool? enableSystemBrightness) => + super.noSuchMethod( + Invocation.setter(#enableSystemBrightness, enableSystemBrightness), returnValueForMissingStub: null, ); @override - String get systemBrightnessLightThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessLightThemeId), - returnValue: _i16.dummyValue( - this, - Invocation.getter(#systemBrightnessLightThemeId), - ), - ) as String); + set themeId(String? themeId) => super.noSuchMethod( + Invocation.setter(#themeId, themeId), + returnValueForMissingStub: null, + ); @override set systemBrightnessLightThemeId(String? systemBrightnessLightThemeId) => @@ -1078,15 +954,6 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { returnValueForMissingStub: null, ); - @override - String get systemBrightnessDarkThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessDarkThemeId), - returnValue: _i16.dummyValue( - this, - Invocation.getter(#systemBrightnessDarkThemeId), - ), - ) as String); - @override set systemBrightnessDarkThemeId(String? systemBrightnessDarkThemeId) => super.noSuchMethod( @@ -1097,278 +964,179 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { returnValueForMissingStub: null, ); - @override - bool get useTor => (super.noSuchMethod( - Invocation.getter(#useTor), - returnValue: false, - ) as bool); - @override set useTor(bool? useTor) => super.noSuchMethod( - Invocation.setter( - #useTor, - useTor, - ), - returnValueForMissingStub: null, - ); - - @override - bool get autoPin => (super.noSuchMethod( - Invocation.getter(#autoPin), - returnValue: false, - ) as bool); + Invocation.setter(#useTor, useTor), + returnValueForMissingStub: null, + ); @override set autoPin(bool? autoPin) => super.noSuchMethod( - Invocation.setter( - #autoPin, - autoPin, - ), - returnValueForMissingStub: null, - ); - - @override - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); + Invocation.setter(#autoPin, autoPin), + returnValueForMissingStub: null, + ); @override set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), - returnValueForMissingStub: null, - ); - - @override -<<<<<<< - bool get advancedFiroFeatures => (super.noSuchMethod( - Invocation.getter(#advancedFiroFeatures), - returnValue: false, - ) as bool); + Invocation.setter(#enableExchange, showExchange), + returnValueForMissingStub: null, + ); @override set advancedFiroFeatures(bool? advancedFiroFeatures) => super.noSuchMethod( - Invocation.setter( - #advancedFiroFeatures, - advancedFiroFeatures, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#advancedFiroFeatures, advancedFiroFeatures), + returnValueForMissingStub: null, + ); @override set logsPath(String? logsPath) => super.noSuchMethod( - Invocation.setter( - #logsPath, - logsPath, - ), - returnValueForMissingStub: null, - ); - - @override - _i22.Level get logLevel => (super.noSuchMethod( - Invocation.getter(#logLevel), - returnValue: _i22.Level.all, - ) as _i22.Level); + Invocation.setter(#logsPath, logsPath), + returnValueForMissingStub: null, + ); @override set logLevel(_i22.Level? logLevel) => super.noSuchMethod( - Invocation.setter( - #logLevel, - logLevel, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#logLevel, logLevel), + returnValueForMissingStub: null, + ); @override -======= - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); - @override - set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), + set autoLockInfo(({bool enabled, int minutes})? autoLockInfo) => + super.noSuchMethod( + Invocation.setter(#autoLockInfo, autoLockInfo), returnValueForMissingStub: null, ); + @override ->>>>>>> - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future init() => (super.noSuchMethod( - Invocation.method( - #init, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future init() => + (super.noSuchMethod( + Invocation.method(#init, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( - Invocation.method( - #incrementCurrentNotificationIndex, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future incrementCurrentNotificationIndex() => + (super.noSuchMethod( + Invocation.method(#incrementCurrentNotificationIndex, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future isExternalCallsSet() => (super.noSuchMethod( - Invocation.method( - #isExternalCallsSet, - [], - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + _i10.Future isExternalCallsSet() => + (super.noSuchMethod( + Invocation.method(#isExternalCallsSet, []), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override - _i10.Future saveUserID(String? userId) => (super.noSuchMethod( - Invocation.method( - #saveUserID, - [userId], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveUserID(String? userId) => + (super.noSuchMethod( + Invocation.method(#saveUserID, [userId]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( - Invocation.method( - #saveSignupEpoch, - [signupEpoch], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveSignupEpoch(int? signupEpoch) => + (super.noSuchMethod( + Invocation.method(#saveSignupEpoch, [signupEpoch]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i23.AmountUnit amountUnit(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #amountUnit, - [coin], - ), - returnValue: _i23.AmountUnit.normal, - ) as _i23.AmountUnit); + _i23.AmountUnit amountUnit(_i4.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#amountUnit, [coin]), + returnValue: _i23.AmountUnit.normal, + ) + as _i23.AmountUnit); @override void updateAmountUnit({ required _i4.CryptoCurrency? coin, required _i23.AmountUnit? amountUnit, - }) => - super.noSuchMethod( - Invocation.method( - #updateAmountUnit, - [], - { - #coin: coin, - #amountUnit: amountUnit, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateAmountUnit, [], { + #coin: coin, + #amountUnit: amountUnit, + }), + returnValueForMissingStub: null, + ); @override - int maxDecimals(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #maxDecimals, - [coin], - ), - returnValue: 0, - ) as int); + int maxDecimals(_i4.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#maxDecimals, [coin]), + returnValue: 0, + ) + as int); @override void updateMaxDecimals({ required _i4.CryptoCurrency? coin, required int? maxDecimals, - }) => - super.noSuchMethod( - Invocation.method( - #updateMaxDecimals, - [], - { - #coin: coin, - #maxDecimals: maxDecimals, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateMaxDecimals, [], { + #coin: coin, + #maxDecimals: maxDecimals, + }), + returnValueForMissingStub: null, + ); @override _i8.FusionInfo getFusionServerInfo(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getFusionServerInfo, - [coin], - ), - returnValue: _FakeFusionInfo_5( - this, - Invocation.method( - #getFusionServerInfo, - [coin], - ), - ), - ) as _i8.FusionInfo); + Invocation.method(#getFusionServerInfo, [coin]), + returnValue: _FakeFusionInfo_5( + this, + Invocation.method(#getFusionServerInfo, [coin]), + ), + ) + as _i8.FusionInfo); @override void setFusionServerInfo( _i4.CryptoCurrency? coin, _i8.FusionInfo? fusionServerInfo, - ) => - super.noSuchMethod( - Invocation.method( - #setFusionServerInfo, - [ - coin, - fusionServerInfo, - ], - ), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#setFusionServerInfo, [coin, fusionServerInfo]), + returnValueForMissingStub: null, + ); @override void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } diff --git a/test/price_test.mocks.dart b/test/price_test.mocks.dart index 3689ebb891..36619fe9c1 100644 --- a/test/price_test.mocks.dart +++ b/test/price_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/price_test.dart. // Do not manually edit this file. @@ -18,19 +18,16 @@ import 'package:stackwallet/networking/http.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response { - _FakeResponse_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeResponse_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [HTTP]. @@ -48,28 +45,23 @@ class MockHTTP extends _i1.Mock implements _i2.HTTP { required ({_i4.InternetAddress host, int port})? proxyInfo, }) => (super.noSuchMethod( - Invocation.method( - #get, - [], - { - #url: url, - #headers: headers, - #proxyInfo: proxyInfo, - }, - ), - returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( - this, - Invocation.method( - #get, - [], - { + Invocation.method(#get, [], { #url: url, #headers: headers, #proxyInfo: proxyInfo, - }, - ), - )), - ) as _i3.Future<_i2.Response>); + }), + returnValue: _i3.Future<_i2.Response>.value( + _FakeResponse_0( + this, + Invocation.method(#get, [], { + #url: url, + #headers: headers, + #proxyInfo: proxyInfo, + }), + ), + ), + ) + as _i3.Future<_i2.Response>); @override _i3.Future<_i2.Response> post({ @@ -80,30 +72,25 @@ class MockHTTP extends _i1.Mock implements _i2.HTTP { required ({_i4.InternetAddress host, int port})? proxyInfo, }) => (super.noSuchMethod( - Invocation.method( - #post, - [], - { - #url: url, - #headers: headers, - #body: body, - #encoding: encoding, - #proxyInfo: proxyInfo, - }, - ), - returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( - this, - Invocation.method( - #post, - [], - { + Invocation.method(#post, [], { #url: url, #headers: headers, #body: body, #encoding: encoding, #proxyInfo: proxyInfo, - }, - ), - )), - ) as _i3.Future<_i2.Response>); + }), + returnValue: _i3.Future<_i2.Response>.value( + _FakeResponse_0( + this, + Invocation.method(#post, [], { + #url: url, + #headers: headers, + #body: body, + #encoding: encoding, + #proxyInfo: proxyInfo, + }), + ), + ), + ) + as _i3.Future<_i2.Response>); } 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 dbbc394979..b2bc328864 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/address_book_view/address_book_view_screen_test.dart. // Do not manually edit this file. @@ -18,19 +18,16 @@ import 'package:stackwallet/services/address_book_service.dart' as _i3; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeContactEntry_0 extends _i1.SmartFake implements _i2.ContactEntry { - _FakeContactEntry_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeContactEntry_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [AddressBookService]. @@ -43,121 +40,93 @@ class MockAddressBookService extends _i1.Mock } @override - List<_i2.ContactEntry> get contacts => (super.noSuchMethod( - Invocation.getter(#contacts), - returnValue: <_i2.ContactEntry>[], - ) as List<_i2.ContactEntry>); + List<_i2.ContactEntry> get contacts => + (super.noSuchMethod( + Invocation.getter(#contacts), + returnValue: <_i2.ContactEntry>[], + ) + as List<_i2.ContactEntry>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i2.ContactEntry getContactById(String? id) => (super.noSuchMethod( - Invocation.method( - #getContactById, - [id], - ), - returnValue: _FakeContactEntry_0( - this, - Invocation.method( - #getContactById, - [id], - ), - ), - ) as _i2.ContactEntry); + _i2.ContactEntry getContactById(String? id) => + (super.noSuchMethod( + Invocation.method(#getContactById, [id]), + returnValue: _FakeContactEntry_0( + this, + Invocation.method(#getContactById, [id]), + ), + ) + as _i2.ContactEntry); @override _i4.Future> search(String? text) => (super.noSuchMethod( - Invocation.method( - #search, - [text], - ), - returnValue: - _i4.Future>.value(<_i2.ContactEntry>[]), - ) as _i4.Future>); + Invocation.method(#search, [text]), + returnValue: _i4.Future>.value( + <_i2.ContactEntry>[], + ), + ) + as _i4.Future>); @override - bool matches( - String? term, - _i2.ContactEntry? contact, - ) => + bool matches(String? term, _i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #matches, - [ - term, - contact, - ], - ), - returnValue: false, - ) as bool); + Invocation.method(#matches, [term, contact]), + returnValue: false, + ) + as bool); @override - _i4.Future addContact(_i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #addContact, - [contact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + _i4.Future addContact(_i2.ContactEntry? contact) => + (super.noSuchMethod( + Invocation.method(#addContact, [contact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override _i4.Future editContact(_i2.ContactEntry? editedContact) => (super.noSuchMethod( - Invocation.method( - #editContact, - [editedContact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#editContact, [editedContact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future removeContact(String? id) => (super.noSuchMethod( - Invocation.method( - #removeContact, - [id], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeContact(String? id) => + (super.noSuchMethod( + Invocation.method(#removeContact, [id]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 192ce703aa..95bb1f4418 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/address_book_view/subviews/add_address_book_view_screen_test.dart. // Do not manually edit this file. @@ -20,29 +20,21 @@ import 'package:stackwallet/utilities/barcode_scanner_interface.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeScanResult_0 extends _i1.SmartFake implements _i2.ScanResult { - _FakeScanResult_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeScanResult_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeContactEntry_1 extends _i1.SmartFake implements _i3.ContactEntry { - _FakeContactEntry_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeContactEntry_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [BarcodeScannerWrapper]. @@ -57,20 +49,15 @@ class MockBarcodeScannerWrapper extends _i1.Mock @override _i4.Future<_i2.ScanResult> scan({required _i5.BuildContext? context}) => (super.noSuchMethod( - Invocation.method( - #scan, - [], - {#context: context}, - ), - returnValue: _i4.Future<_i2.ScanResult>.value(_FakeScanResult_0( - this, - Invocation.method( - #scan, - [], - {#context: context}, - ), - )), - ) as _i4.Future<_i2.ScanResult>); + Invocation.method(#scan, [], {#context: context}), + returnValue: _i4.Future<_i2.ScanResult>.value( + _FakeScanResult_0( + this, + Invocation.method(#scan, [], {#context: context}), + ), + ), + ) + as _i4.Future<_i2.ScanResult>); } /// A class which mocks [AddressBookService]. @@ -83,121 +70,93 @@ class MockAddressBookService extends _i1.Mock } @override - List<_i3.ContactEntry> get contacts => (super.noSuchMethod( - Invocation.getter(#contacts), - returnValue: <_i3.ContactEntry>[], - ) as List<_i3.ContactEntry>); + List<_i3.ContactEntry> get contacts => + (super.noSuchMethod( + Invocation.getter(#contacts), + returnValue: <_i3.ContactEntry>[], + ) + as List<_i3.ContactEntry>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i3.ContactEntry getContactById(String? id) => (super.noSuchMethod( - Invocation.method( - #getContactById, - [id], - ), - returnValue: _FakeContactEntry_1( - this, - Invocation.method( - #getContactById, - [id], - ), - ), - ) as _i3.ContactEntry); + _i3.ContactEntry getContactById(String? id) => + (super.noSuchMethod( + Invocation.method(#getContactById, [id]), + returnValue: _FakeContactEntry_1( + this, + Invocation.method(#getContactById, [id]), + ), + ) + as _i3.ContactEntry); @override _i4.Future> search(String? text) => (super.noSuchMethod( - Invocation.method( - #search, - [text], - ), - returnValue: - _i4.Future>.value(<_i3.ContactEntry>[]), - ) as _i4.Future>); + Invocation.method(#search, [text]), + returnValue: _i4.Future>.value( + <_i3.ContactEntry>[], + ), + ) + as _i4.Future>); @override - bool matches( - String? term, - _i3.ContactEntry? contact, - ) => + bool matches(String? term, _i3.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #matches, - [ - term, - contact, - ], - ), - returnValue: false, - ) as bool); + Invocation.method(#matches, [term, contact]), + returnValue: false, + ) + as bool); @override - _i4.Future addContact(_i3.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #addContact, - [contact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + _i4.Future addContact(_i3.ContactEntry? contact) => + (super.noSuchMethod( + Invocation.method(#addContact, [contact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override _i4.Future editContact(_i3.ContactEntry? editedContact) => (super.noSuchMethod( - Invocation.method( - #editContact, - [editedContact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#editContact, [editedContact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future removeContact(String? id) => (super.noSuchMethod( - Invocation.method( - #removeContact, - [id], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeContact(String? id) => + (super.noSuchMethod( + Invocation.method(#removeContact, [id]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 b2f02c854d..1e299205bf 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 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. @@ -20,19 +20,16 @@ import 'package:stackwallet/services/locale_service.dart' as _i6; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeContactEntry_0 extends _i1.SmartFake implements _i2.ContactEntry { - _FakeContactEntry_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeContactEntry_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [AddressBookService]. @@ -45,123 +42,95 @@ class MockAddressBookService extends _i1.Mock } @override - List<_i2.ContactEntry> get contacts => (super.noSuchMethod( - Invocation.getter(#contacts), - returnValue: <_i2.ContactEntry>[], - ) as List<_i2.ContactEntry>); + List<_i2.ContactEntry> get contacts => + (super.noSuchMethod( + Invocation.getter(#contacts), + returnValue: <_i2.ContactEntry>[], + ) + as List<_i2.ContactEntry>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i2.ContactEntry getContactById(String? id) => (super.noSuchMethod( - Invocation.method( - #getContactById, - [id], - ), - returnValue: _FakeContactEntry_0( - this, - Invocation.method( - #getContactById, - [id], - ), - ), - ) as _i2.ContactEntry); + _i2.ContactEntry getContactById(String? id) => + (super.noSuchMethod( + Invocation.method(#getContactById, [id]), + returnValue: _FakeContactEntry_0( + this, + Invocation.method(#getContactById, [id]), + ), + ) + as _i2.ContactEntry); @override _i4.Future> search(String? text) => (super.noSuchMethod( - Invocation.method( - #search, - [text], - ), - returnValue: - _i4.Future>.value(<_i2.ContactEntry>[]), - ) as _i4.Future>); - - @override - bool matches( - String? term, - _i2.ContactEntry? contact, - ) => + Invocation.method(#search, [text]), + returnValue: _i4.Future>.value( + <_i2.ContactEntry>[], + ), + ) + as _i4.Future>); + + @override + bool matches(String? term, _i2.ContactEntry? contact) => + (super.noSuchMethod( + Invocation.method(#matches, [term, contact]), + returnValue: false, + ) + as bool); + + @override + _i4.Future addContact(_i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #matches, - [ - term, - contact, - ], - ), - returnValue: false, - ) as bool); - - @override - _i4.Future addContact(_i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #addContact, - [contact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#addContact, [contact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override _i4.Future editContact(_i2.ContactEntry? editedContact) => (super.noSuchMethod( - Invocation.method( - #editContact, - [editedContact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#editContact, [editedContact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future removeContact(String? id) => (super.noSuchMethod( - Invocation.method( - #removeContact, - [id], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeContact(String? id) => + (super.noSuchMethod( + Invocation.method(#removeContact, [id]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [LocaleService]. @@ -173,64 +142,51 @@ class MockLocaleService extends _i1.Mock implements _i6.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i4.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 2c93e063c0..bab7cfe2c3 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 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. @@ -18,19 +18,16 @@ import 'package:stackwallet/services/address_book_service.dart' as _i3; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeContactEntry_0 extends _i1.SmartFake implements _i2.ContactEntry { - _FakeContactEntry_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeContactEntry_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [AddressBookService]. @@ -43,121 +40,93 @@ class MockAddressBookService extends _i1.Mock } @override - List<_i2.ContactEntry> get contacts => (super.noSuchMethod( - Invocation.getter(#contacts), - returnValue: <_i2.ContactEntry>[], - ) as List<_i2.ContactEntry>); + List<_i2.ContactEntry> get contacts => + (super.noSuchMethod( + Invocation.getter(#contacts), + returnValue: <_i2.ContactEntry>[], + ) + as List<_i2.ContactEntry>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i2.ContactEntry getContactById(String? id) => (super.noSuchMethod( - Invocation.method( - #getContactById, - [id], - ), - returnValue: _FakeContactEntry_0( - this, - Invocation.method( - #getContactById, - [id], - ), - ), - ) as _i2.ContactEntry); + _i2.ContactEntry getContactById(String? id) => + (super.noSuchMethod( + Invocation.method(#getContactById, [id]), + returnValue: _FakeContactEntry_0( + this, + Invocation.method(#getContactById, [id]), + ), + ) + as _i2.ContactEntry); @override _i4.Future> search(String? text) => (super.noSuchMethod( - Invocation.method( - #search, - [text], - ), - returnValue: - _i4.Future>.value(<_i2.ContactEntry>[]), - ) as _i4.Future>); + Invocation.method(#search, [text]), + returnValue: _i4.Future>.value( + <_i2.ContactEntry>[], + ), + ) + as _i4.Future>); @override - bool matches( - String? term, - _i2.ContactEntry? contact, - ) => + bool matches(String? term, _i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #matches, - [ - term, - contact, - ], - ), - returnValue: false, - ) as bool); + Invocation.method(#matches, [term, contact]), + returnValue: false, + ) + as bool); @override - _i4.Future addContact(_i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #addContact, - [contact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + _i4.Future addContact(_i2.ContactEntry? contact) => + (super.noSuchMethod( + Invocation.method(#addContact, [contact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override _i4.Future editContact(_i2.ContactEntry? editedContact) => (super.noSuchMethod( - Invocation.method( - #editContact, - [editedContact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#editContact, [editedContact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future removeContact(String? id) => (super.noSuchMethod( - Invocation.method( - #removeContact, - [id], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeContact(String? id) => + (super.noSuchMethod( + Invocation.method(#removeContact, [id]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } diff --git a/test/screen_tests/exchange/exchange_view_test.mocks.dart b/test/screen_tests/exchange/exchange_view_test.mocks.dart index 4e9c72fe13..f27f332742 100644 --- a/test/screen_tests/exchange/exchange_view_test.mocks.dart +++ b/test/screen_tests/exchange/exchange_view_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/exchange/exchange_view_test.dart. // Do not manually edit this file. @@ -44,40 +44,27 @@ import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_i // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeFusionInfo_0 extends _i1.SmartFake implements _i2.FusionInfo { - _FakeFusionInfo_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFusionInfo_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeHTTP_1 extends _i1.SmartFake implements _i3.HTTP { - _FakeHTTP_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHTTP_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeExchangeResponse_2 extends _i1.SmartFake implements _i4.ExchangeResponse { - _FakeExchangeResponse_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeExchangeResponse_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Prefs]. @@ -89,425 +76,421 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs { } @override - bool get isInitialized => (super.noSuchMethod( - Invocation.getter(#isInitialized), - returnValue: false, - ) as bool); + 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); + 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, - ); + int get lastUnlocked => + (super.noSuchMethod(Invocation.getter(#lastUnlocked), returnValue: 0) + as int); @override - int get lastUnlocked => (super.noSuchMethod( - Invocation.getter(#lastUnlocked), - returnValue: 0, - ) as int); + int get currentNotificationId => + (super.noSuchMethod( + Invocation.getter(#currentNotificationId), + returnValue: 0, + ) + as int); @override - set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( - Invocation.setter( - #lastUnlocked, - lastUnlocked, - ), - returnValueForMissingStub: null, - ); + List get walletIdsSyncOnStartup => + (super.noSuchMethod( + Invocation.getter(#walletIdsSyncOnStartup), + returnValue: [], + ) + as List); @override - int get currentNotificationId => (super.noSuchMethod( - Invocation.getter(#currentNotificationId), - returnValue: 0, - ) as int); + _i6.SyncingType get syncType => + (super.noSuchMethod( + Invocation.getter(#syncType), + returnValue: _i6.SyncingType.currentWalletOnly, + ) + as _i6.SyncingType); @override - List get walletIdsSyncOnStartup => (super.noSuchMethod( - Invocation.getter(#walletIdsSyncOnStartup), - returnValue: [], - ) as List); + bool get wifiOnly => + (super.noSuchMethod(Invocation.getter(#wifiOnly), returnValue: false) + as bool); @override - set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => - super.noSuchMethod( - Invocation.setter( - #walletIdsSyncOnStartup, - walletIdsSyncOnStartup, - ), - returnValueForMissingStub: null, - ); + bool get showFavoriteWallets => + (super.noSuchMethod( + Invocation.getter(#showFavoriteWallets), + returnValue: false, + ) + as bool); @override - _i6.SyncingType get syncType => (super.noSuchMethod( - Invocation.getter(#syncType), - returnValue: _i6.SyncingType.currentWalletOnly, - ) as _i6.SyncingType); + String get language => + (super.noSuchMethod( + Invocation.getter(#language), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#language), + ), + ) + as String); @override - set syncType(_i6.SyncingType? syncType) => super.noSuchMethod( - Invocation.setter( - #syncType, - syncType, - ), - returnValueForMissingStub: null, - ); + String get currency => + (super.noSuchMethod( + Invocation.getter(#currency), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#currency), + ), + ) + as String); @override - bool get wifiOnly => (super.noSuchMethod( - Invocation.getter(#wifiOnly), - returnValue: false, - ) as bool); + bool get randomizePIN => + (super.noSuchMethod(Invocation.getter(#randomizePIN), returnValue: false) + as bool); @override - set wifiOnly(bool? wifiOnly) => super.noSuchMethod( - Invocation.setter( - #wifiOnly, - wifiOnly, - ), - returnValueForMissingStub: null, - ); + bool get useBiometrics => + (super.noSuchMethod(Invocation.getter(#useBiometrics), returnValue: false) + as bool); @override - bool get showFavoriteWallets => (super.noSuchMethod( - Invocation.getter(#showFavoriteWallets), - returnValue: false, - ) as bool); + bool get hasPin => + (super.noSuchMethod(Invocation.getter(#hasPin), returnValue: false) + as bool); @override - set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( - Invocation.setter( - #showFavoriteWallets, - showFavoriteWallets, - ), - returnValueForMissingStub: null, - ); + bool get hasDuressPin => + (super.noSuchMethod(Invocation.getter(#hasDuressPin), returnValue: false) + as bool); @override - String get language => (super.noSuchMethod( - Invocation.getter(#language), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#language), - ), - ) as String); + bool get biometricsDuress => + (super.noSuchMethod( + Invocation.getter(#biometricsDuress), + returnValue: false, + ) + as bool); @override - set language(String? newLanguage) => super.noSuchMethod( - Invocation.setter( - #language, - newLanguage, - ), - returnValueForMissingStub: null, - ); + int get familiarity => + (super.noSuchMethod(Invocation.getter(#familiarity), returnValue: 0) + as int); @override - String get currency => (super.noSuchMethod( - Invocation.getter(#currency), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#currency), - ), - ) as String); + bool get torKillSwitch => + (super.noSuchMethod(Invocation.getter(#torKillSwitch), returnValue: false) + as bool); @override - set currency(String? newCurrency) => super.noSuchMethod( - Invocation.setter( - #currency, - newCurrency, - ), - returnValueForMissingStub: null, - ); + bool get showTestNetCoins => + (super.noSuchMethod( + Invocation.getter(#showTestNetCoins), + returnValue: false, + ) + as bool); @override - bool get randomizePIN => (super.noSuchMethod( - Invocation.getter(#randomizePIN), - returnValue: false, - ) as bool); + bool get isAutoBackupEnabled => + (super.noSuchMethod( + Invocation.getter(#isAutoBackupEnabled), + returnValue: false, + ) + as bool); @override - set randomizePIN(bool? randomizePIN) => super.noSuchMethod( - Invocation.setter( - #randomizePIN, - randomizePIN, - ), - returnValueForMissingStub: null, - ); + _i8.BackupFrequencyType get backupFrequencyType => + (super.noSuchMethod( + Invocation.getter(#backupFrequencyType), + returnValue: _i8.BackupFrequencyType.everyTenMinutes, + ) + as _i8.BackupFrequencyType); @override - bool get useBiometrics => (super.noSuchMethod( - Invocation.getter(#useBiometrics), - returnValue: false, - ) as bool); + bool get hideBlockExplorerWarning => + (super.noSuchMethod( + Invocation.getter(#hideBlockExplorerWarning), + returnValue: false, + ) + as bool); @override - set useBiometrics(bool? useBiometrics) => super.noSuchMethod( - Invocation.setter( - #useBiometrics, - useBiometrics, - ), - returnValueForMissingStub: null, - ); + bool get gotoWalletOnStartup => + (super.noSuchMethod( + Invocation.getter(#gotoWalletOnStartup), + returnValue: false, + ) + as bool); @override - bool get hasPin => (super.noSuchMethod( - Invocation.getter(#hasPin), - returnValue: false, - ) as bool); + bool get externalCalls => + (super.noSuchMethod(Invocation.getter(#externalCalls), returnValue: false) + as bool); @override - set hasPin(bool? hasPin) => super.noSuchMethod( - Invocation.setter( - #hasPin, - hasPin, - ), - returnValueForMissingStub: null, - ); + bool get enableCoinControl => + (super.noSuchMethod( + Invocation.getter(#enableCoinControl), + returnValue: false, + ) + as bool); @override - bool get hasDuressPin => (super.noSuchMethod( - Invocation.getter(#hasDuressPin), - returnValue: false, - ) as bool); + bool get enableSystemBrightness => + (super.noSuchMethod( + Invocation.getter(#enableSystemBrightness), + returnValue: false, + ) + as bool); @override - set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( - Invocation.setter( - #hasDuressPin, - hasDuressPin, - ), - returnValueForMissingStub: null, - ); + String get themeId => + (super.noSuchMethod( + Invocation.getter(#themeId), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#themeId), + ), + ) + as String); @override - bool get biometricsDuress => (super.noSuchMethod( - Invocation.getter(#biometricsDuress), - returnValue: false, - ) as bool); + String get systemBrightnessLightThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessLightThemeId), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#systemBrightnessLightThemeId), + ), + ) + as String); @override - set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( - Invocation.setter( - #biometricsDuress, - biometricsDuress, - ), - returnValueForMissingStub: null, - ); + String get systemBrightnessDarkThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessDarkThemeId), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#systemBrightnessDarkThemeId), + ), + ) + as String); @override - int get familiarity => (super.noSuchMethod( - Invocation.getter(#familiarity), - returnValue: 0, - ) as int); + bool get useTor => + (super.noSuchMethod(Invocation.getter(#useTor), returnValue: false) + as bool); @override - set familiarity(int? familiarity) => super.noSuchMethod( - Invocation.setter( - #familiarity, - familiarity, - ), - returnValueForMissingStub: null, - ); + bool get autoPin => + (super.noSuchMethod(Invocation.getter(#autoPin), returnValue: false) + as bool); + + @override + bool get enableExchange => + (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) + as bool); @override - bool get torKillSwitch => (super.noSuchMethod( - Invocation.getter(#torKillSwitch), - returnValue: false, - ) as bool); + bool get advancedFiroFeatures => + (super.noSuchMethod( + Invocation.getter(#advancedFiroFeatures), + returnValue: false, + ) + as bool); @override - set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( - Invocation.setter( - #torKillSwitch, - torKillswitch, - ), - returnValueForMissingStub: null, - ); + _i9.Level get logLevel => + (super.noSuchMethod( + Invocation.getter(#logLevel), + returnValue: _i9.Level.all, + ) + as _i9.Level); @override - bool get showTestNetCoins => (super.noSuchMethod( - Invocation.getter(#showTestNetCoins), - returnValue: false, - ) as bool); + ({bool enabled, int minutes}) get autoLockInfo => + (super.noSuchMethod( + Invocation.getter(#autoLockInfo), + returnValue: (enabled: false, minutes: 0), + ) + as ({bool enabled, int minutes})); @override - set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( - Invocation.setter( - #showTestNetCoins, - showTestNetCoins, - ), - returnValueForMissingStub: null, - ); + set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + Invocation.setter(#lastUnlockedTimeout, lastUnlockedTimeout), + returnValueForMissingStub: null, + ); @override - bool get isAutoBackupEnabled => (super.noSuchMethod( - Invocation.getter(#isAutoBackupEnabled), - returnValue: false, - ) as bool); + set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + Invocation.setter(#lastUnlocked, lastUnlocked), + returnValueForMissingStub: null, + ); @override - set isAutoBackupEnabled(bool? isAutoBackupEnabled) => super.noSuchMethod( - Invocation.setter( - #isAutoBackupEnabled, - isAutoBackupEnabled, - ), + set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => + super.noSuchMethod( + Invocation.setter(#walletIdsSyncOnStartup, walletIdsSyncOnStartup), returnValueForMissingStub: null, ); @override - set autoBackupLocation(String? autoBackupLocation) => super.noSuchMethod( - Invocation.setter( - #autoBackupLocation, - autoBackupLocation, - ), - returnValueForMissingStub: null, - ); + set syncType(_i6.SyncingType? syncType) => super.noSuchMethod( + Invocation.setter(#syncType, syncType), + returnValueForMissingStub: null, + ); @override - _i8.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( - Invocation.getter(#backupFrequencyType), - returnValue: _i8.BackupFrequencyType.everyTenMinutes, - ) as _i8.BackupFrequencyType); + set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + Invocation.setter(#wifiOnly, wifiOnly), + returnValueForMissingStub: null, + ); @override - set backupFrequencyType(_i8.BackupFrequencyType? backupFrequencyType) => - super.noSuchMethod( - Invocation.setter( - #backupFrequencyType, - backupFrequencyType, - ), - returnValueForMissingStub: null, - ); + set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( + Invocation.setter(#showFavoriteWallets, showFavoriteWallets), + returnValueForMissingStub: null, + ); @override - set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( - Invocation.setter( - #lastAutoBackup, - lastAutoBackup, - ), - returnValueForMissingStub: null, - ); + set language(String? newLanguage) => super.noSuchMethod( + Invocation.setter(#language, newLanguage), + returnValueForMissingStub: null, + ); @override - bool get hideBlockExplorerWarning => (super.noSuchMethod( - Invocation.getter(#hideBlockExplorerWarning), - returnValue: false, - ) as bool); + set currency(String? newCurrency) => super.noSuchMethod( + Invocation.setter(#currency, newCurrency), + returnValueForMissingStub: null, + ); @override - set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => - super.noSuchMethod( - Invocation.setter( - #hideBlockExplorerWarning, - hideBlockExplorerWarning, - ), - returnValueForMissingStub: null, - ); + set randomizePIN(bool? randomizePIN) => super.noSuchMethod( + Invocation.setter(#randomizePIN, randomizePIN), + returnValueForMissingStub: null, + ); + + @override + set useBiometrics(bool? useBiometrics) => super.noSuchMethod( + Invocation.setter(#useBiometrics, useBiometrics), + returnValueForMissingStub: null, + ); @override - bool get gotoWalletOnStartup => (super.noSuchMethod( - Invocation.getter(#gotoWalletOnStartup), - returnValue: false, - ) as bool); + set hasPin(bool? hasPin) => super.noSuchMethod( + Invocation.setter(#hasPin, hasPin), + returnValueForMissingStub: null, + ); @override - set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( - Invocation.setter( - #gotoWalletOnStartup, - gotoWalletOnStartup, - ), - returnValueForMissingStub: null, - ); + set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( + Invocation.setter(#hasDuressPin, hasDuressPin), + returnValueForMissingStub: null, + ); @override - set startupWalletId(String? startupWalletId) => super.noSuchMethod( - Invocation.setter( - #startupWalletId, - startupWalletId, - ), - returnValueForMissingStub: null, - ); + set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( + Invocation.setter(#biometricsDuress, biometricsDuress), + returnValueForMissingStub: null, + ); @override - bool get externalCalls => (super.noSuchMethod( - Invocation.getter(#externalCalls), - returnValue: false, - ) as bool); + set familiarity(int? familiarity) => super.noSuchMethod( + Invocation.setter(#familiarity, familiarity), + returnValueForMissingStub: null, + ); @override - set externalCalls(bool? externalCalls) => super.noSuchMethod( - Invocation.setter( - #externalCalls, - externalCalls, - ), - returnValueForMissingStub: null, - ); + set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( + Invocation.setter(#torKillSwitch, torKillswitch), + returnValueForMissingStub: null, + ); @override - bool get enableCoinControl => (super.noSuchMethod( - Invocation.getter(#enableCoinControl), - returnValue: false, - ) as bool); + set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( + Invocation.setter(#showTestNetCoins, showTestNetCoins), + returnValueForMissingStub: null, + ); @override - set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( - Invocation.setter( - #enableCoinControl, - enableCoinControl, - ), + 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 + set backupFrequencyType(_i8.BackupFrequencyType? backupFrequencyType) => + super.noSuchMethod( + Invocation.setter(#backupFrequencyType, backupFrequencyType), returnValueForMissingStub: null, ); @override - bool get enableSystemBrightness => (super.noSuchMethod( - Invocation.getter(#enableSystemBrightness), - returnValue: false, - ) as bool); + set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( + Invocation.setter(#lastAutoBackup, lastAutoBackup), + returnValueForMissingStub: null, + ); @override - set enableSystemBrightness(bool? enableSystemBrightness) => + set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => super.noSuchMethod( - Invocation.setter( - #enableSystemBrightness, - enableSystemBrightness, - ), + Invocation.setter(#hideBlockExplorerWarning, hideBlockExplorerWarning), returnValueForMissingStub: null, ); @override - String get themeId => (super.noSuchMethod( - Invocation.getter(#themeId), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#themeId), - ), - ) as String); + set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( + Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup), + returnValueForMissingStub: null, + ); @override - set themeId(String? themeId) => super.noSuchMethod( - Invocation.setter( - #themeId, - themeId, - ), + set startupWalletId(String? startupWalletId) => super.noSuchMethod( + Invocation.setter(#startupWalletId, startupWalletId), + returnValueForMissingStub: null, + ); + + @override + set externalCalls(bool? externalCalls) => super.noSuchMethod( + Invocation.setter(#externalCalls, externalCalls), + returnValueForMissingStub: null, + ); + + @override + set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( + Invocation.setter(#enableCoinControl, enableCoinControl), + returnValueForMissingStub: null, + ); + + @override + set enableSystemBrightness(bool? enableSystemBrightness) => + super.noSuchMethod( + Invocation.setter(#enableSystemBrightness, enableSystemBrightness), returnValueForMissingStub: null, ); @override - String get systemBrightnessLightThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessLightThemeId), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#systemBrightnessLightThemeId), - ), - ) as String); + set themeId(String? themeId) => super.noSuchMethod( + Invocation.setter(#themeId, themeId), + returnValueForMissingStub: null, + ); @override set systemBrightnessLightThemeId(String? systemBrightnessLightThemeId) => @@ -519,15 +502,6 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs { returnValueForMissingStub: null, ); - @override - String get systemBrightnessDarkThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessDarkThemeId), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#systemBrightnessDarkThemeId), - ), - ) as String); - @override set systemBrightnessDarkThemeId(String? systemBrightnessDarkThemeId) => super.noSuchMethod( @@ -538,280 +512,181 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs { returnValueForMissingStub: null, ); - @override - bool get useTor => (super.noSuchMethod( - Invocation.getter(#useTor), - returnValue: false, - ) as bool); - @override set useTor(bool? useTor) => super.noSuchMethod( - Invocation.setter( - #useTor, - useTor, - ), - returnValueForMissingStub: null, - ); - - @override - bool get autoPin => (super.noSuchMethod( - Invocation.getter(#autoPin), - returnValue: false, - ) as bool); + Invocation.setter(#useTor, useTor), + returnValueForMissingStub: null, + ); @override set autoPin(bool? autoPin) => super.noSuchMethod( - Invocation.setter( - #autoPin, - autoPin, - ), - returnValueForMissingStub: null, - ); - - @override - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); + Invocation.setter(#autoPin, autoPin), + returnValueForMissingStub: null, + ); @override set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), - returnValueForMissingStub: null, - ); - - @override -<<<<<<< - bool get advancedFiroFeatures => (super.noSuchMethod( - Invocation.getter(#advancedFiroFeatures), - returnValue: false, - ) as bool); + Invocation.setter(#enableExchange, showExchange), + returnValueForMissingStub: null, + ); @override set advancedFiroFeatures(bool? advancedFiroFeatures) => super.noSuchMethod( - Invocation.setter( - #advancedFiroFeatures, - advancedFiroFeatures, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#advancedFiroFeatures, advancedFiroFeatures), + returnValueForMissingStub: null, + ); @override set logsPath(String? logsPath) => super.noSuchMethod( - Invocation.setter( - #logsPath, - logsPath, - ), - returnValueForMissingStub: null, - ); - - @override - _i9.Level get logLevel => (super.noSuchMethod( - Invocation.getter(#logLevel), - returnValue: _i9.Level.all, - ) as _i9.Level); + Invocation.setter(#logsPath, logsPath), + returnValueForMissingStub: null, + ); @override set logLevel(_i9.Level? logLevel) => super.noSuchMethod( - Invocation.setter( - #logLevel, - logLevel, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#logLevel, logLevel), + returnValueForMissingStub: null, + ); @override -======= - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); - @override - set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), + set autoLockInfo(({bool enabled, int minutes})? autoLockInfo) => + super.noSuchMethod( + Invocation.setter(#autoLockInfo, autoLockInfo), returnValueForMissingStub: null, ); + @override ->>>>>>> - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future init() => (super.noSuchMethod( - Invocation.method( - #init, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future init() => + (super.noSuchMethod( + Invocation.method(#init, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( - Invocation.method( - #incrementCurrentNotificationIndex, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future incrementCurrentNotificationIndex() => + (super.noSuchMethod( + Invocation.method(#incrementCurrentNotificationIndex, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future isExternalCallsSet() => (super.noSuchMethod( - Invocation.method( - #isExternalCallsSet, - [], - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + _i10.Future isExternalCallsSet() => + (super.noSuchMethod( + Invocation.method(#isExternalCallsSet, []), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override - _i10.Future saveUserID(String? userId) => (super.noSuchMethod( - Invocation.method( - #saveUserID, - [userId], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveUserID(String? userId) => + (super.noSuchMethod( + Invocation.method(#saveUserID, [userId]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( - Invocation.method( - #saveSignupEpoch, - [signupEpoch], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveSignupEpoch(int? signupEpoch) => + (super.noSuchMethod( + Invocation.method(#saveSignupEpoch, [signupEpoch]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i11.AmountUnit amountUnit(_i12.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #amountUnit, - [coin], - ), - returnValue: _i11.AmountUnit.normal, - ) as _i11.AmountUnit); + _i11.AmountUnit amountUnit(_i12.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#amountUnit, [coin]), + returnValue: _i11.AmountUnit.normal, + ) + as _i11.AmountUnit); @override void updateAmountUnit({ required _i12.CryptoCurrency? coin, required _i11.AmountUnit? amountUnit, - }) => - super.noSuchMethod( - Invocation.method( - #updateAmountUnit, - [], - { - #coin: coin, - #amountUnit: amountUnit, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateAmountUnit, [], { + #coin: coin, + #amountUnit: amountUnit, + }), + returnValueForMissingStub: null, + ); @override - int maxDecimals(_i12.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #maxDecimals, - [coin], - ), - returnValue: 0, - ) as int); + int maxDecimals(_i12.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#maxDecimals, [coin]), + returnValue: 0, + ) + as int); @override void updateMaxDecimals({ required _i12.CryptoCurrency? coin, required int? maxDecimals, - }) => - super.noSuchMethod( - Invocation.method( - #updateMaxDecimals, - [], - { - #coin: coin, - #maxDecimals: maxDecimals, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateMaxDecimals, [], { + #coin: coin, + #maxDecimals: maxDecimals, + }), + returnValueForMissingStub: null, + ); @override _i2.FusionInfo getFusionServerInfo(_i12.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getFusionServerInfo, - [coin], - ), - returnValue: _FakeFusionInfo_0( - this, - Invocation.method( - #getFusionServerInfo, - [coin], - ), - ), - ) as _i2.FusionInfo); + Invocation.method(#getFusionServerInfo, [coin]), + returnValue: _FakeFusionInfo_0( + this, + Invocation.method(#getFusionServerInfo, [coin]), + ), + ) + as _i2.FusionInfo); @override void setFusionServerInfo( _i12.CryptoCurrency? coin, _i2.FusionInfo? fusionServerInfo, - ) => - super.noSuchMethod( - Invocation.method( - #setFusionServerInfo, - [ - coin, - fusionServerInfo, - ], - ), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#setFusionServerInfo, [coin, fusionServerInfo]), + returnValueForMissingStub: null, + ); @override void addListener(_i13.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i13.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [TradesService]. @@ -823,22 +698,21 @@ class MockTradesService extends _i1.Mock implements _i14.TradesService { } @override - List<_i15.Trade> get trades => (super.noSuchMethod( - Invocation.getter(#trades), - returnValue: <_i15.Trade>[], - ) as List<_i15.Trade>); + List<_i15.Trade> get trades => + (super.noSuchMethod( + Invocation.getter(#trades), + returnValue: <_i15.Trade>[], + ) + as List<_i15.Trade>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i15.Trade? get(String? tradeId) => (super.noSuchMethod(Invocation.method( - #get, - [tradeId], - )) as _i15.Trade?); + _i15.Trade? get(String? tradeId) => + (super.noSuchMethod(Invocation.method(#get, [tradeId])) as _i15.Trade?); @override _i10.Future add({ @@ -846,17 +720,14 @@ class MockTradesService extends _i1.Mock implements _i14.TradesService { required bool? shouldNotifyListeners, }) => (super.noSuchMethod( - Invocation.method( - #add, - [], - { - #trade: trade, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#add, [], { + #trade: trade, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future edit({ @@ -864,17 +735,14 @@ class MockTradesService extends _i1.Mock implements _i14.TradesService { required bool? shouldNotifyListeners, }) => (super.noSuchMethod( - Invocation.method( - #edit, - [], - { - #trade: trade, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#edit, [], { + #trade: trade, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future delete({ @@ -882,17 +750,14 @@ class MockTradesService extends _i1.Mock implements _i14.TradesService { required bool? shouldNotifyListeners, }) => (super.noSuchMethod( - Invocation.method( - #delete, - [], - { - #trade: trade, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#delete, [], { + #trade: trade, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future deleteByUuid({ @@ -900,53 +765,38 @@ class MockTradesService extends _i1.Mock implements _i14.TradesService { required bool? shouldNotifyListeners, }) => (super.noSuchMethod( - Invocation.method( - #deleteByUuid, - [], - { - #uuid: uuid, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#deleteByUuid, [], { + #uuid: uuid, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void addListener(_i13.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i13.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [TradeNotesService]. @@ -958,98 +808,70 @@ class MockTradeNotesService extends _i1.Mock implements _i16.TradeNotesService { } @override - Map get all => (super.noSuchMethod( - Invocation.getter(#all), - returnValue: {}, - ) as Map); + Map get all => + (super.noSuchMethod( + Invocation.getter(#all), + returnValue: {}, + ) + as Map); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - String getNote({required String? tradeId}) => (super.noSuchMethod( - Invocation.method( - #getNote, - [], - {#tradeId: tradeId}, - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #getNote, - [], - {#tradeId: tradeId}, - ), - ), - ) as String); + String getNote({required String? tradeId}) => + (super.noSuchMethod( + Invocation.method(#getNote, [], {#tradeId: tradeId}), + returnValue: _i7.dummyValue( + this, + Invocation.method(#getNote, [], {#tradeId: tradeId}), + ), + ) + as String); @override - _i10.Future set({ - required String? tradeId, - required String? note, - }) => + _i10.Future set({required String? tradeId, required String? note}) => (super.noSuchMethod( - Invocation.method( - #set, - [], - { - #tradeId: tradeId, - #note: note, - }, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#set, [], {#tradeId: tradeId, #note: note}), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future delete({required String? tradeId}) => (super.noSuchMethod( - Invocation.method( - #delete, - [], - {#tradeId: tradeId}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future delete({required String? tradeId}) => + (super.noSuchMethod( + Invocation.method(#delete, [], {#tradeId: tradeId}), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void addListener(_i13.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i13.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [ChangeNowAPI]. @@ -1061,52 +883,45 @@ class MockChangeNowAPI extends _i1.Mock implements _i17.ChangeNowAPI { } @override - _i3.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_1( - this, - Invocation.getter(#client), - ), - ) as _i3.HTTP); + _i3.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_1(this, Invocation.getter(#client)), + ) + as _i3.HTTP); @override _i10.Future<_i4.ExchangeResponse>> - getAvailableCurrencies({ + getAvailableCurrencies({ bool? active, bool? buy, bool? sell, _i17.CNFlow? flow = _i17.CNFlow.standard, String? apiKey, }) => - (super.noSuchMethod( - Invocation.method( - #getAvailableCurrencies, - [], - { - #active: active, - #buy: buy, - #sell: sell, - #flow: flow, - #apiKey: apiKey, - }, - ), + (super.noSuchMethod( + Invocation.method(#getAvailableCurrencies, [], { + #active: active, + #buy: buy, + #sell: sell, + #flow: flow, + #apiKey: apiKey, + }), returnValue: _i10.Future<_i4.ExchangeResponse>>.value( - _FakeExchangeResponse_2>( - this, - Invocation.method( - #getAvailableCurrencies, - [], - { - #active: active, - #buy: buy, - #sell: sell, - #flow: flow, - #apiKey: apiKey, - }, - ), - )), - ) as _i10.Future<_i4.ExchangeResponse>>); + _FakeExchangeResponse_2>( + this, + Invocation.method(#getAvailableCurrencies, [], { + #active: active, + #buy: buy, + #sell: sell, + #flow: flow, + #apiKey: apiKey, + }), + ), + ), + ) + as _i10.Future<_i4.ExchangeResponse>>); @override _i10.Future<_i4.ExchangeResponse<_i19.Decimal>> getMinimalExchangeAmount({ @@ -1118,35 +933,29 @@ class MockChangeNowAPI extends _i1.Mock implements _i17.ChangeNowAPI { String? apiKey, }) => (super.noSuchMethod( - Invocation.method( - #getMinimalExchangeAmount, - [], - { - #fromCurrency: fromCurrency, - #toCurrency: toCurrency, - #fromNetwork: fromNetwork, - #toNetwork: toNetwork, - #flow: flow, - #apiKey: apiKey, - }, - ), - returnValue: _i10.Future<_i4.ExchangeResponse<_i19.Decimal>>.value( - _FakeExchangeResponse_2<_i19.Decimal>( - this, - Invocation.method( - #getMinimalExchangeAmount, - [], - { + Invocation.method(#getMinimalExchangeAmount, [], { #fromCurrency: fromCurrency, #toCurrency: toCurrency, #fromNetwork: fromNetwork, #toNetwork: toNetwork, #flow: flow, #apiKey: apiKey, - }, - ), - )), - ) as _i10.Future<_i4.ExchangeResponse<_i19.Decimal>>); + }), + returnValue: _i10.Future<_i4.ExchangeResponse<_i19.Decimal>>.value( + _FakeExchangeResponse_2<_i19.Decimal>( + this, + Invocation.method(#getMinimalExchangeAmount, [], { + #fromCurrency: fromCurrency, + #toCurrency: toCurrency, + #fromNetwork: fromNetwork, + #toNetwork: toNetwork, + #flow: flow, + #apiKey: apiKey, + }), + ), + ), + ) + as _i10.Future<_i4.ExchangeResponse<_i19.Decimal>>); @override _i10.Future<_i4.ExchangeResponse<_i20.Range>> getRange({ @@ -1158,35 +967,29 @@ class MockChangeNowAPI extends _i1.Mock implements _i17.ChangeNowAPI { String? apiKey, }) => (super.noSuchMethod( - Invocation.method( - #getRange, - [], - { - #fromCurrency: fromCurrency, - #toCurrency: toCurrency, - #fromNetwork: fromNetwork, - #toNetwork: toNetwork, - #flow: flow, - #apiKey: apiKey, - }, - ), - returnValue: _i10.Future<_i4.ExchangeResponse<_i20.Range>>.value( - _FakeExchangeResponse_2<_i20.Range>( - this, - Invocation.method( - #getRange, - [], - { + Invocation.method(#getRange, [], { #fromCurrency: fromCurrency, #toCurrency: toCurrency, #fromNetwork: fromNetwork, #toNetwork: toNetwork, #flow: flow, #apiKey: apiKey, - }, - ), - )), - ) as _i10.Future<_i4.ExchangeResponse<_i20.Range>>); + }), + returnValue: _i10.Future<_i4.ExchangeResponse<_i20.Range>>.value( + _FakeExchangeResponse_2<_i20.Range>( + this, + Invocation.method(#getRange, [], { + #fromCurrency: fromCurrency, + #toCurrency: toCurrency, + #fromNetwork: fromNetwork, + #toNetwork: toNetwork, + #flow: flow, + #apiKey: apiKey, + }), + ), + ), + ) + as _i10.Future<_i4.ExchangeResponse<_i20.Range>>); @override _i10.Future<_i4.ExchangeResponse<_i21.Estimate>> getEstimatedExchangeAmount({ @@ -1203,30 +1006,7 @@ class MockChangeNowAPI extends _i1.Mock implements _i17.ChangeNowAPI { String? apiKey, }) => (super.noSuchMethod( - Invocation.method( - #getEstimatedExchangeAmount, - [], - { - #fromCurrency: fromCurrency, - #toCurrency: toCurrency, - #fromAmount: fromAmount, - #toAmount: toAmount, - #fromNetwork: fromNetwork, - #toNetwork: toNetwork, - #flow: flow, - #type: type, - #useRateId: useRateId, - #isTopUp: isTopUp, - #apiKey: apiKey, - }, - ), - returnValue: _i10.Future<_i4.ExchangeResponse<_i21.Estimate>>.value( - _FakeExchangeResponse_2<_i21.Estimate>( - this, - Invocation.method( - #getEstimatedExchangeAmount, - [], - { + Invocation.method(#getEstimatedExchangeAmount, [], { #fromCurrency: fromCurrency, #toCurrency: toCurrency, #fromAmount: fromAmount, @@ -1238,14 +1018,31 @@ class MockChangeNowAPI extends _i1.Mock implements _i17.ChangeNowAPI { #useRateId: useRateId, #isTopUp: isTopUp, #apiKey: apiKey, - }, - ), - )), - ) as _i10.Future<_i4.ExchangeResponse<_i21.Estimate>>); + }), + returnValue: _i10.Future<_i4.ExchangeResponse<_i21.Estimate>>.value( + _FakeExchangeResponse_2<_i21.Estimate>( + this, + Invocation.method(#getEstimatedExchangeAmount, [], { + #fromCurrency: fromCurrency, + #toCurrency: toCurrency, + #fromAmount: fromAmount, + #toAmount: toAmount, + #fromNetwork: fromNetwork, + #toNetwork: toNetwork, + #flow: flow, + #type: type, + #useRateId: useRateId, + #isTopUp: isTopUp, + #apiKey: apiKey, + }), + ), + ), + ) + as _i10.Future<_i4.ExchangeResponse<_i21.Estimate>>); @override _i10.Future<_i4.ExchangeResponse<_i22.CNExchangeTransaction>> - createExchangeTransaction({ + createExchangeTransaction({ required String? fromCurrency, required String? fromNetwork, required String? toCurrency, @@ -1264,89 +1061,78 @@ class MockChangeNowAPI extends _i1.Mock implements _i17.ChangeNowAPI { required String? rateId, String? apiKey, }) => - (super.noSuchMethod( - Invocation.method( - #createExchangeTransaction, - [], - { - #fromCurrency: fromCurrency, - #fromNetwork: fromNetwork, - #toCurrency: toCurrency, - #toNetwork: toNetwork, - #fromAmount: fromAmount, - #toAmount: toAmount, - #flow: flow, - #type: type, - #address: address, - #extraId: extraId, - #refundAddress: refundAddress, - #refundExtraId: refundExtraId, - #userId: userId, - #payload: payload, - #contactEmail: contactEmail, - #rateId: rateId, - #apiKey: apiKey, - }, - ), - returnValue: _i10 - .Future<_i4.ExchangeResponse<_i22.CNExchangeTransaction>>.value( - _FakeExchangeResponse_2<_i22.CNExchangeTransaction>( - this, - Invocation.method( - #createExchangeTransaction, - [], - { - #fromCurrency: fromCurrency, - #fromNetwork: fromNetwork, - #toCurrency: toCurrency, - #toNetwork: toNetwork, - #fromAmount: fromAmount, - #toAmount: toAmount, - #flow: flow, - #type: type, - #address: address, - #extraId: extraId, - #refundAddress: refundAddress, - #refundExtraId: refundExtraId, - #userId: userId, - #payload: payload, - #contactEmail: contactEmail, - #rateId: rateId, - #apiKey: apiKey, - }, - ), - )), - ) as _i10.Future<_i4.ExchangeResponse<_i22.CNExchangeTransaction>>); + (super.noSuchMethod( + Invocation.method(#createExchangeTransaction, [], { + #fromCurrency: fromCurrency, + #fromNetwork: fromNetwork, + #toCurrency: toCurrency, + #toNetwork: toNetwork, + #fromAmount: fromAmount, + #toAmount: toAmount, + #flow: flow, + #type: type, + #address: address, + #extraId: extraId, + #refundAddress: refundAddress, + #refundExtraId: refundExtraId, + #userId: userId, + #payload: payload, + #contactEmail: contactEmail, + #rateId: rateId, + #apiKey: apiKey, + }), + returnValue: + _i10.Future< + _i4.ExchangeResponse<_i22.CNExchangeTransaction> + >.value( + _FakeExchangeResponse_2<_i22.CNExchangeTransaction>( + this, + Invocation.method(#createExchangeTransaction, [], { + #fromCurrency: fromCurrency, + #fromNetwork: fromNetwork, + #toCurrency: toCurrency, + #toNetwork: toNetwork, + #fromAmount: fromAmount, + #toAmount: toAmount, + #flow: flow, + #type: type, + #address: address, + #extraId: extraId, + #refundAddress: refundAddress, + #refundExtraId: refundExtraId, + #userId: userId, + #payload: payload, + #contactEmail: contactEmail, + #rateId: rateId, + #apiKey: apiKey, + }), + ), + ), + ) + as _i10.Future<_i4.ExchangeResponse<_i22.CNExchangeTransaction>>); @override _i10.Future<_i4.ExchangeResponse<_i23.CNExchangeTransactionStatus>> - getTransactionStatus({ - required String? id, - String? apiKey, - }) => - (super.noSuchMethod( - Invocation.method( - #getTransactionStatus, - [], - { - #id: id, - #apiKey: apiKey, - }, - ), - returnValue: _i10.Future< - _i4 - .ExchangeResponse<_i23.CNExchangeTransactionStatus>>.value( - _FakeExchangeResponse_2<_i23.CNExchangeTransactionStatus>( - this, - Invocation.method( - #getTransactionStatus, - [], - { - #id: id, - #apiKey: apiKey, - }, - ), - )), - ) as _i10 - .Future<_i4.ExchangeResponse<_i23.CNExchangeTransactionStatus>>); + getTransactionStatus({required String? id, String? apiKey}) => + (super.noSuchMethod( + Invocation.method(#getTransactionStatus, [], { + #id: id, + #apiKey: apiKey, + }), + returnValue: + _i10.Future< + _i4.ExchangeResponse<_i23.CNExchangeTransactionStatus> + >.value( + _FakeExchangeResponse_2<_i23.CNExchangeTransactionStatus>( + this, + Invocation.method(#getTransactionStatus, [], { + #id: id, + #apiKey: apiKey, + }), + ), + ), + ) + as _i10.Future< + _i4.ExchangeResponse<_i23.CNExchangeTransactionStatus> + >); } diff --git a/test/screen_tests/lockscreen_view_screen_test.mocks.dart b/test/screen_tests/lockscreen_view_screen_test.mocks.dart index 804721d4c1..c54cd49630 100644 --- a/test/screen_tests/lockscreen_view_screen_test.mocks.dart +++ b/test/screen_tests/lockscreen_view_screen_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/lockscreen_view_screen_test.dart. // Do not manually edit this file. @@ -23,20 +23,17 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeSecureStorageInterface_0 extends _i1.SmartFake implements _i2.SecureStorageInterface { - _FakeSecureStorageInterface_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WalletsService]. @@ -50,52 +47,41 @@ class MockWalletsService extends _i1.Mock implements _i3.WalletsService { @override _i4.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i4.Future>.value( - {}), - ) as _i4.Future>); + Invocation.getter(#walletNames), + returnValue: _i4.Future>.value( + {}, + ), + ) + as _i4.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [NodeService]. @@ -107,41 +93,45 @@ class MockNodeService extends _i1.Mock implements _i6.NodeService { } @override - _i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_0( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i2.SecureStorageInterface); + _i2.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_0( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i2.SecureStorageInterface); @override - List<_i7.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i7.NodeModel>[], - ) as List<_i7.NodeModel>); + List<_i7.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i7.NodeModel>[], + ) + as List<_i7.NodeModel>); @override - List<_i7.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i7.NodeModel>[], - ) as List<_i7.NodeModel>); + List<_i7.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i7.NodeModel>[], + ) + as List<_i7.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i4.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setPrimaryNodeFor({ @@ -150,56 +140,45 @@ class MockNodeService extends _i1.Mock implements _i6.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i7.NodeModel? getPrimaryNodeFor({required _i8.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i7.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i7.NodeModel?); @override List<_i7.NodeModel> getNodesFor(_i8.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i7.NodeModel>[], - ) as List<_i7.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i7.NodeModel>[], + ) + as List<_i7.NodeModel>); @override _i7.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i7.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i7.NodeModel?); @override - List<_i7.NodeModel> failoverNodesFor( - {required _i8.CryptoCurrency? currency}) => + List<_i7.NodeModel> failoverNodesFor({ + required _i8.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i7.NodeModel>[], - ) as List<_i7.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i7.NodeModel>[], + ) + as List<_i7.NodeModel>); @override _i4.Future save( @@ -208,34 +187,20 @@ class MockNodeService extends _i1.Mock implements _i6.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + _i4.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setEnabledState( @@ -244,61 +209,46 @@ class MockNodeService extends _i1.Mock implements _i6.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 3d96a2dcfd..4c101202c4 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testA_test.dart. // Do not manually edit this file. @@ -19,10 +19,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -35,52 +37,41 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [LocaleService]. @@ -92,64 +83,51 @@ class MockLocaleService extends _i1.Mock implements _i5.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i6.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i3.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 7cccdb73e5..7d3849b3a8 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testB_test.dart. // Do not manually edit this file. @@ -19,10 +19,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -35,52 +37,41 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [LocaleService]. @@ -92,64 +83,51 @@ class MockLocaleService extends _i1.Mock implements _i5.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i6.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i3.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 9362ee7782..fe4f57a311 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/main_view_tests/main_view_screen_testC_test.dart. // Do not manually edit this file. @@ -19,10 +19,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -35,52 +37,41 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [LocaleService]. @@ -92,64 +83,51 @@ class MockLocaleService extends _i1.Mock implements _i5.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i6.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i3.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 951e5306d1..6ff65a3fa3 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/onboarding/backup_key_warning_view_screen_test.dart. // Do not manually edit this file. @@ -17,10 +17,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -33,50 +35,39 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 9218bd83e3..de530dad1f 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/onboarding/create_pin_view_screen_test.dart. // Do not manually edit this file. @@ -23,20 +23,17 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeSecureStorageInterface_0 extends _i1.SmartFake implements _i2.SecureStorageInterface { - _FakeSecureStorageInterface_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WalletsService]. @@ -50,52 +47,41 @@ class MockWalletsService extends _i1.Mock implements _i3.WalletsService { @override _i4.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i4.Future>.value( - {}), - ) as _i4.Future>); + Invocation.getter(#walletNames), + returnValue: _i4.Future>.value( + {}, + ), + ) + as _i4.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [NodeService]. @@ -107,41 +93,45 @@ class MockNodeService extends _i1.Mock implements _i6.NodeService { } @override - _i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_0( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i2.SecureStorageInterface); + _i2.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_0( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i2.SecureStorageInterface); @override - List<_i7.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i7.NodeModel>[], - ) as List<_i7.NodeModel>); + List<_i7.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i7.NodeModel>[], + ) + as List<_i7.NodeModel>); @override - List<_i7.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i7.NodeModel>[], - ) as List<_i7.NodeModel>); + List<_i7.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i7.NodeModel>[], + ) + as List<_i7.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i4.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setPrimaryNodeFor({ @@ -150,56 +140,45 @@ class MockNodeService extends _i1.Mock implements _i6.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i7.NodeModel? getPrimaryNodeFor({required _i8.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i7.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i7.NodeModel?); @override List<_i7.NodeModel> getNodesFor(_i8.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i7.NodeModel>[], - ) as List<_i7.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i7.NodeModel>[], + ) + as List<_i7.NodeModel>); @override _i7.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i7.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i7.NodeModel?); @override - List<_i7.NodeModel> failoverNodesFor( - {required _i8.CryptoCurrency? currency}) => + List<_i7.NodeModel> failoverNodesFor({ + required _i8.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i7.NodeModel>[], - ) as List<_i7.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i7.NodeModel>[], + ) + as List<_i7.NodeModel>); @override _i4.Future save( @@ -208,34 +187,20 @@ class MockNodeService extends _i1.Mock implements _i6.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + _i4.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setEnabledState( @@ -244,61 +209,46 @@ class MockNodeService extends _i1.Mock implements _i6.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 5983f2f416..98e0c08566 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/onboarding/name_your_wallet_view_screen_test.dart. // Do not manually edit this file. @@ -17,10 +17,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -33,50 +35,39 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 68ac1be3e3..1b9698d161 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/onboarding/restore_wallet_view_screen_test.dart. // Do not manually edit this file. @@ -25,30 +25,22 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeScanResult_0 extends _i1.SmartFake implements _i2.ScanResult { - _FakeScanResult_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeScanResult_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSecureStorageInterface_1 extends _i1.SmartFake implements _i3.SecureStorageInterface { - _FakeSecureStorageInterface_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [BarcodeScannerWrapper]. @@ -63,20 +55,15 @@ class MockBarcodeScannerWrapper extends _i1.Mock @override _i4.Future<_i2.ScanResult> scan({required _i5.BuildContext? context}) => (super.noSuchMethod( - Invocation.method( - #scan, - [], - {#context: context}, - ), - returnValue: _i4.Future<_i2.ScanResult>.value(_FakeScanResult_0( - this, - Invocation.method( - #scan, - [], - {#context: context}, - ), - )), - ) as _i4.Future<_i2.ScanResult>); + Invocation.method(#scan, [], {#context: context}), + returnValue: _i4.Future<_i2.ScanResult>.value( + _FakeScanResult_0( + this, + Invocation.method(#scan, [], {#context: context}), + ), + ), + ) + as _i4.Future<_i2.ScanResult>); } /// A class which mocks [WalletsService]. @@ -90,52 +77,41 @@ class MockWalletsService extends _i1.Mock implements _i6.WalletsService { @override _i4.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i4.Future>.value( - {}), - ) as _i4.Future>); + Invocation.getter(#walletNames), + returnValue: _i4.Future>.value( + {}, + ), + ) + as _i4.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [NodeService]. @@ -147,41 +123,45 @@ class MockNodeService extends _i1.Mock implements _i8.NodeService { } @override - _i3.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_1( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i3.SecureStorageInterface); + _i3.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_1( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i3.SecureStorageInterface); @override - List<_i9.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i9.NodeModel>[], - ) as List<_i9.NodeModel>); + List<_i9.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i9.NodeModel>[], + ) + as List<_i9.NodeModel>); @override - List<_i9.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i9.NodeModel>[], - ) as List<_i9.NodeModel>); + List<_i9.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i9.NodeModel>[], + ) + as List<_i9.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i4.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setPrimaryNodeFor({ @@ -190,56 +170,45 @@ class MockNodeService extends _i1.Mock implements _i8.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i9.NodeModel? getPrimaryNodeFor({required _i10.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i9.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i9.NodeModel?); @override List<_i9.NodeModel> getNodesFor(_i10.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i9.NodeModel>[], - ) as List<_i9.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i9.NodeModel>[], + ) + as List<_i9.NodeModel>); @override _i9.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i9.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i9.NodeModel?); @override - List<_i9.NodeModel> failoverNodesFor( - {required _i10.CryptoCurrency? currency}) => + List<_i9.NodeModel> failoverNodesFor({ + required _i10.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i9.NodeModel>[], - ) as List<_i9.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i9.NodeModel>[], + ) + as List<_i9.NodeModel>); @override _i4.Future save( @@ -248,34 +217,20 @@ class MockNodeService extends _i1.Mock implements _i8.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + _i4.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setEnabledState( @@ -284,61 +239,46 @@ class MockNodeService extends _i1.Mock implements _i8.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 b4eb992139..7448120ce1 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 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. @@ -22,20 +22,17 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeSecureStorageInterface_0 extends _i1.SmartFake implements _i2.SecureStorageInterface { - _FakeSecureStorageInterface_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [NodeService]. @@ -47,41 +44,45 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { } @override - _i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_0( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i2.SecureStorageInterface); + _i2.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_0( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i2.SecureStorageInterface); @override - List<_i4.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + List<_i4.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override - List<_i4.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + List<_i4.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i5.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setPrimaryNodeFor({ @@ -90,56 +91,45 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i4.NodeModel? getPrimaryNodeFor({required _i6.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i4.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i4.NodeModel?); @override List<_i4.NodeModel> getNodesFor(_i6.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override _i4.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i4.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i4.NodeModel?); @override - List<_i4.NodeModel> failoverNodesFor( - {required _i6.CryptoCurrency? currency}) => + List<_i4.NodeModel> failoverNodesFor({ + required _i6.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override _i5.Future save( @@ -148,34 +138,20 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setEnabledState( @@ -184,61 +160,46 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 787f1f801a..da7af34723 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 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. @@ -22,20 +22,17 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeSecureStorageInterface_0 extends _i1.SmartFake implements _i2.SecureStorageInterface { - _FakeSecureStorageInterface_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [NodeService]. @@ -47,41 +44,45 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { } @override - _i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_0( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i2.SecureStorageInterface); + _i2.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_0( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i2.SecureStorageInterface); @override - List<_i4.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + List<_i4.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override - List<_i4.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + List<_i4.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i5.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setPrimaryNodeFor({ @@ -90,56 +91,45 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i4.NodeModel? getPrimaryNodeFor({required _i6.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i4.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i4.NodeModel?); @override List<_i4.NodeModel> getNodesFor(_i6.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override _i4.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i4.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i4.NodeModel?); @override - List<_i4.NodeModel> failoverNodesFor( - {required _i6.CryptoCurrency? currency}) => + List<_i4.NodeModel> failoverNodesFor({ + required _i6.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override _i5.Future save( @@ -148,34 +138,20 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setEnabledState( @@ -184,61 +160,46 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 6a2a923e09..241eb0d584 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/network_settings_view_screen_test.dart. // Do not manually edit this file. @@ -22,20 +22,17 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeSecureStorageInterface_0 extends _i1.SmartFake implements _i2.SecureStorageInterface { - _FakeSecureStorageInterface_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [NodeService]. @@ -47,41 +44,45 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { } @override - _i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_0( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i2.SecureStorageInterface); + _i2.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_0( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i2.SecureStorageInterface); @override - List<_i4.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + List<_i4.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override - List<_i4.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + List<_i4.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i5.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setPrimaryNodeFor({ @@ -90,56 +91,45 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i4.NodeModel? getPrimaryNodeFor({required _i6.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i4.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i4.NodeModel?); @override List<_i4.NodeModel> getNodesFor(_i6.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override _i4.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i4.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i4.NodeModel?); @override - List<_i4.NodeModel> failoverNodesFor( - {required _i6.CryptoCurrency? currency}) => + List<_i4.NodeModel> failoverNodesFor({ + required _i6.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override _i5.Future save( @@ -148,34 +138,20 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setEnabledState( @@ -184,61 +160,46 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 93c8ef6ec8..47dab3ddd2 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 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. @@ -17,10 +17,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -33,50 +35,39 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 2803819b68..9a5f6d79d8 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 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. @@ -17,10 +17,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -33,50 +35,39 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 63ddd796c5..07a1ea8f30 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 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. @@ -17,10 +17,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -33,50 +35,39 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 d3a16fd4f6..6105ab2b81 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.dart. // Do not manually edit this file. @@ -27,20 +27,17 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeElectrumXClient_0 extends _i1.SmartFake implements _i2.ElectrumXClient { - _FakeElectrumXClient_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeElectrumXClient_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [CachedElectrumXClient]. @@ -53,43 +50,37 @@ class MockCachedElectrumXClient extends _i1.Mock } @override - _i2.ElectrumXClient get electrumXClient => (super.noSuchMethod( - Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_0( - this, - Invocation.getter(#electrumXClient), - ), - ) as _i2.ElectrumXClient); + _i2.ElectrumXClient get electrumXClient => + (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumXClient_0( + this, + Invocation.getter(#electrumXClient), + ), + ) + as _i2.ElectrumXClient); @override - String base64ToHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToHex, - [source], - ), - returnValue: _i4.dummyValue( - this, - Invocation.method( - #base64ToHex, - [source], - ), - ), - ) as String); + String base64ToHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToHex, [source]), + returnValue: _i4.dummyValue( + this, + Invocation.method(#base64ToHex, [source]), + ), + ) + as String); @override - String base64ToReverseHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToReverseHex, - [source], - ), - returnValue: _i4.dummyValue( - this, - Invocation.method( - #base64ToReverseHex, - [source], - ), - ), - ) as String); + String base64ToReverseHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToReverseHex, [source]), + returnValue: _i4.dummyValue( + this, + Invocation.method(#base64ToReverseHex, [source]), + ), + ) + as String); @override _i5.Future> getTransaction({ @@ -98,31 +89,29 @@ class MockCachedElectrumXClient extends _i1.Mock bool? verbose = true, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #cryptoCurrency: cryptoCurrency, - #verbose: verbose, - }, - ), - returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); - - @override - _i5.Future clearSharedTransactionCache( - {required _i6.CryptoCurrency? cryptoCurrency}) => + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #cryptoCurrency: cryptoCurrency, + #verbose: verbose, + }), + returnValue: _i5.Future>.value( + {}, + ), + ) + as _i5.Future>); + + @override + _i5.Future clearSharedTransactionCache({ + required _i6.CryptoCurrency? cryptoCurrency, + }) => (super.noSuchMethod( - Invocation.method( - #clearSharedTransactionCache, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#clearSharedTransactionCache, [], { + #cryptoCurrency: cryptoCurrency, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); } /// A class which mocks [LocalAuthentication]. @@ -135,10 +124,12 @@ class MockLocalAuthentication extends _i1.Mock } @override - _i5.Future get canCheckBiometrics => (super.noSuchMethod( - Invocation.getter(#canCheckBiometrics), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future get canCheckBiometrics => + (super.noSuchMethod( + Invocation.getter(#canCheckBiometrics), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override _i5.Future authenticate({ @@ -151,46 +142,40 @@ class MockLocalAuthentication extends _i1.Mock _i8.AuthenticationOptions? options = const _i8.AuthenticationOptions(), }) => (super.noSuchMethod( - Invocation.method( - #authenticate, - [], - { - #localizedReason: localizedReason, - #authMessages: authMessages, - #options: options, - }, - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + Invocation.method(#authenticate, [], { + #localizedReason: localizedReason, + #authMessages: authMessages, + #options: options, + }), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override - _i5.Future stopAuthentication() => (super.noSuchMethod( - Invocation.method( - #stopAuthentication, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future stopAuthentication() => + (super.noSuchMethod( + Invocation.method(#stopAuthentication, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override - _i5.Future isDeviceSupported() => (super.noSuchMethod( - Invocation.method( - #isDeviceSupported, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future isDeviceSupported() => + (super.noSuchMethod( + Invocation.method(#isDeviceSupported, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override _i5.Future> getAvailableBiometrics() => (super.noSuchMethod( - Invocation.method( - #getAvailableBiometrics, - [], - ), - returnValue: - _i5.Future>.value(<_i8.BiometricType>[]), - ) as _i5.Future>); + Invocation.method(#getAvailableBiometrics, []), + returnValue: _i5.Future>.value( + <_i8.BiometricType>[], + ), + ) + as _i5.Future>); } /// A class which mocks [Biometrics]. @@ -208,17 +193,14 @@ class MockBiometrics extends _i1.Mock implements _i11.Biometrics { required String? title, }) => (super.noSuchMethod( - Invocation.method( - #authenticate, - [], - { - #cancelButtonText: cancelButtonText, - #localizedReason: localizedReason, - #title: title, - }, - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + Invocation.method(#authenticate, [], { + #cancelButtonText: cancelButtonText, + #localizedReason: localizedReason, + #title: title, + }), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); } /// A class which mocks [WalletsService]. @@ -232,50 +214,39 @@ class MockWalletsService extends _i1.Mock implements _i12.WalletsService { @override _i5.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i5.Future>.value( - {}), - ) as _i5.Future>); + Invocation.getter(#walletNames), + returnValue: _i5.Future>.value( + {}, + ), + ) + as _i5.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i13.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i13.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 2f8346004c..aa5e4c41af 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/settings_view/settings_view_screen_test.dart. // Do not manually edit this file. @@ -17,10 +17,12 @@ import 'package:stackwallet/services/wallets_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [WalletsService]. /// @@ -33,50 +35,39 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { @override _i3.Future> get walletNames => (super.noSuchMethod( - Invocation.getter(#walletNames), - returnValue: _i3.Future>.value( - {}), - ) as _i3.Future>); + Invocation.getter(#walletNames), + returnValue: _i3.Future>.value( + {}, + ), + ) + as _i3.Future>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 531417e9d4..e35771508e 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/transaction_subviews/transaction_details_view_screen_test.dart. // Do not manually edit this file. @@ -20,19 +20,16 @@ import 'package:stackwallet/services/locale_service.dart' as _i6; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeContactEntry_0 extends _i1.SmartFake implements _i2.ContactEntry { - _FakeContactEntry_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeContactEntry_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [AddressBookService]. @@ -45,123 +42,95 @@ class MockAddressBookService extends _i1.Mock } @override - List<_i2.ContactEntry> get contacts => (super.noSuchMethod( - Invocation.getter(#contacts), - returnValue: <_i2.ContactEntry>[], - ) as List<_i2.ContactEntry>); + List<_i2.ContactEntry> get contacts => + (super.noSuchMethod( + Invocation.getter(#contacts), + returnValue: <_i2.ContactEntry>[], + ) + as List<_i2.ContactEntry>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i2.ContactEntry getContactById(String? id) => (super.noSuchMethod( - Invocation.method( - #getContactById, - [id], - ), - returnValue: _FakeContactEntry_0( - this, - Invocation.method( - #getContactById, - [id], - ), - ), - ) as _i2.ContactEntry); + _i2.ContactEntry getContactById(String? id) => + (super.noSuchMethod( + Invocation.method(#getContactById, [id]), + returnValue: _FakeContactEntry_0( + this, + Invocation.method(#getContactById, [id]), + ), + ) + as _i2.ContactEntry); @override _i4.Future> search(String? text) => (super.noSuchMethod( - Invocation.method( - #search, - [text], - ), - returnValue: - _i4.Future>.value(<_i2.ContactEntry>[]), - ) as _i4.Future>); - - @override - bool matches( - String? term, - _i2.ContactEntry? contact, - ) => + Invocation.method(#search, [text]), + returnValue: _i4.Future>.value( + <_i2.ContactEntry>[], + ), + ) + as _i4.Future>); + + @override + bool matches(String? term, _i2.ContactEntry? contact) => + (super.noSuchMethod( + Invocation.method(#matches, [term, contact]), + returnValue: false, + ) + as bool); + + @override + _i4.Future addContact(_i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #matches, - [ - term, - contact, - ], - ), - returnValue: false, - ) as bool); - - @override - _i4.Future addContact(_i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #addContact, - [contact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#addContact, [contact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override _i4.Future editContact(_i2.ContactEntry? editedContact) => (super.noSuchMethod( - Invocation.method( - #editContact, - [editedContact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#editContact, [editedContact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future removeContact(String? id) => (super.noSuchMethod( - Invocation.method( - #removeContact, - [id], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeContact(String? id) => + (super.noSuchMethod( + Invocation.method(#removeContact, [id]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [LocaleService]. @@ -173,64 +142,51 @@ class MockLocaleService extends _i1.Mock implements _i6.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i4.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 ff15574349..ff3ff128be 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/transaction_subviews/transaction_search_results_view_screen_test.dart. // Do not manually edit this file. @@ -18,10 +18,12 @@ import 'package:stackwallet/services/locale_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [LocaleService]. /// @@ -32,64 +34,51 @@ class MockLocaleService extends _i1.Mock implements _i2.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i4.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 a236a0b418..e61edd6c93 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/transaction_subviews/transaction_search_view_screen_test.dart. // Do not manually edit this file. @@ -18,19 +18,16 @@ import 'package:stackwallet/services/address_book_service.dart' as _i3; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeContactEntry_0 extends _i1.SmartFake implements _i2.ContactEntry { - _FakeContactEntry_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeContactEntry_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [AddressBookService]. @@ -43,121 +40,93 @@ class MockAddressBookService extends _i1.Mock } @override - List<_i2.ContactEntry> get contacts => (super.noSuchMethod( - Invocation.getter(#contacts), - returnValue: <_i2.ContactEntry>[], - ) as List<_i2.ContactEntry>); + List<_i2.ContactEntry> get contacts => + (super.noSuchMethod( + Invocation.getter(#contacts), + returnValue: <_i2.ContactEntry>[], + ) + as List<_i2.ContactEntry>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i2.ContactEntry getContactById(String? id) => (super.noSuchMethod( - Invocation.method( - #getContactById, - [id], - ), - returnValue: _FakeContactEntry_0( - this, - Invocation.method( - #getContactById, - [id], - ), - ), - ) as _i2.ContactEntry); + _i2.ContactEntry getContactById(String? id) => + (super.noSuchMethod( + Invocation.method(#getContactById, [id]), + returnValue: _FakeContactEntry_0( + this, + Invocation.method(#getContactById, [id]), + ), + ) + as _i2.ContactEntry); @override _i4.Future> search(String? text) => (super.noSuchMethod( - Invocation.method( - #search, - [text], - ), - returnValue: - _i4.Future>.value(<_i2.ContactEntry>[]), - ) as _i4.Future>); + Invocation.method(#search, [text]), + returnValue: _i4.Future>.value( + <_i2.ContactEntry>[], + ), + ) + as _i4.Future>); @override - bool matches( - String? term, - _i2.ContactEntry? contact, - ) => + bool matches(String? term, _i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #matches, - [ - term, - contact, - ], - ), - returnValue: false, - ) as bool); + Invocation.method(#matches, [term, contact]), + returnValue: false, + ) + as bool); @override - _i4.Future addContact(_i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #addContact, - [contact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + _i4.Future addContact(_i2.ContactEntry? contact) => + (super.noSuchMethod( + Invocation.method(#addContact, [contact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override _i4.Future editContact(_i2.ContactEntry? editedContact) => (super.noSuchMethod( - Invocation.method( - #editContact, - [editedContact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#editContact, [editedContact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future removeContact(String? id) => (super.noSuchMethod( - Invocation.method( - #removeContact, - [id], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeContact(String? id) => + (super.noSuchMethod( + Invocation.method(#removeContact, [id]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 cd4db95585..cbce366658 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/wallet_view/send_view_screen_test.dart. // Do not manually edit this file. @@ -17,19 +17,16 @@ import 'package:stackwallet/utilities/barcode_scanner_interface.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeScanResult_0 extends _i1.SmartFake implements _i2.ScanResult { - _FakeScanResult_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeScanResult_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [BarcodeScannerWrapper]. @@ -44,18 +41,13 @@ class MockBarcodeScannerWrapper extends _i1.Mock @override _i3.Future<_i2.ScanResult> scan({required _i4.BuildContext? context}) => (super.noSuchMethod( - Invocation.method( - #scan, - [], - {#context: context}, - ), - returnValue: _i3.Future<_i2.ScanResult>.value(_FakeScanResult_0( - this, - Invocation.method( - #scan, - [], - {#context: context}, - ), - )), - ) as _i3.Future<_i2.ScanResult>); + Invocation.method(#scan, [], {#context: context}), + returnValue: _i3.Future<_i2.ScanResult>.value( + _FakeScanResult_0( + this, + Invocation.method(#scan, [], {#context: context}), + ), + ), + ) + as _i3.Future<_i2.ScanResult>); } 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 cf011b7c6c..3b567cdfed 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/screen_tests/wallet_view/wallet_view_screen_test.dart. // Do not manually edit this file. @@ -18,10 +18,12 @@ import 'package:stackwallet/services/locale_service.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member /// A class which mocks [LocaleService]. /// @@ -32,64 +34,51 @@ class MockLocaleService extends _i1.Mock implements _i2.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i4.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } diff --git a/test/services/change_now/change_now_test.mocks.dart b/test/services/change_now/change_now_test.mocks.dart index 8134b64490..4b92e7841a 100644 --- a/test/services/change_now/change_now_test.mocks.dart +++ b/test/services/change_now/change_now_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/services/change_now/change_now_test.dart. // Do not manually edit this file. @@ -18,19 +18,16 @@ import 'package:stackwallet/networking/http.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response { - _FakeResponse_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeResponse_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [HTTP]. @@ -48,28 +45,23 @@ class MockHTTP extends _i1.Mock implements _i2.HTTP { required ({_i4.InternetAddress host, int port})? proxyInfo, }) => (super.noSuchMethod( - Invocation.method( - #get, - [], - { - #url: url, - #headers: headers, - #proxyInfo: proxyInfo, - }, - ), - returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( - this, - Invocation.method( - #get, - [], - { + Invocation.method(#get, [], { #url: url, #headers: headers, #proxyInfo: proxyInfo, - }, - ), - )), - ) as _i3.Future<_i2.Response>); + }), + returnValue: _i3.Future<_i2.Response>.value( + _FakeResponse_0( + this, + Invocation.method(#get, [], { + #url: url, + #headers: headers, + #proxyInfo: proxyInfo, + }), + ), + ), + ) + as _i3.Future<_i2.Response>); @override _i3.Future<_i2.Response> post({ @@ -80,30 +72,25 @@ class MockHTTP extends _i1.Mock implements _i2.HTTP { required ({_i4.InternetAddress host, int port})? proxyInfo, }) => (super.noSuchMethod( - Invocation.method( - #post, - [], - { - #url: url, - #headers: headers, - #body: body, - #encoding: encoding, - #proxyInfo: proxyInfo, - }, - ), - returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( - this, - Invocation.method( - #post, - [], - { + Invocation.method(#post, [], { #url: url, #headers: headers, #body: body, #encoding: encoding, #proxyInfo: proxyInfo, - }, - ), - )), - ) as _i3.Future<_i2.Response>); + }), + returnValue: _i3.Future<_i2.Response>.value( + _FakeResponse_0( + this, + Invocation.method(#post, [], { + #url: url, + #headers: headers, + #body: body, + #encoding: encoding, + #proxyInfo: proxyInfo, + }), + ), + ), + ) + as _i3.Future<_i2.Response>); } diff --git a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart index 35fbc67a17..7d1f9507c8 100644 --- a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart +++ b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/services/coins/bitcoin/bitcoin_wallet_test.dart. // Do not manually edit this file. @@ -25,62 +25,39 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeCryptoCurrency_0 extends _i1.SmartFake implements _i2.CryptoCurrency { - _FakeCryptoCurrency_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCryptoCurrency_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDuration_1 extends _i1.SmartFake implements Duration { - _FakeDuration_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDuration_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake implements _i3.SparkAnonymitySetMeta { - _FakeSparkAnonymitySetMeta_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSparkAnonymitySetMeta_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { - _FakeDecimal_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDecimal_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeElectrumXClient_4 extends _i1.SmartFake implements _i5.ElectrumXClient { - _FakeElectrumXClient_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeElectrumXClient_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ElectrumXClient]. @@ -92,85 +69,83 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { } @override - _i2.CryptoCurrency get cryptoCurrency => (super.noSuchMethod( - Invocation.getter(#cryptoCurrency), - returnValue: _FakeCryptoCurrency_0( - this, - Invocation.getter(#cryptoCurrency), - ), - ) as _i2.CryptoCurrency); + _i2.CryptoCurrency get cryptoCurrency => + (super.noSuchMethod( + Invocation.getter(#cryptoCurrency), + returnValue: _FakeCryptoCurrency_0( + this, + Invocation.getter(#cryptoCurrency), + ), + ) + as _i2.CryptoCurrency); @override - _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( - Invocation.getter(#netType), - returnValue: _i6.TorPlainNetworkOption.tor, - ) as _i6.TorPlainNetworkOption); + _i6.TorPlainNetworkOption get netType => + (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) + as _i6.TorPlainNetworkOption); @override - int get currentFailoverIndex => (super.noSuchMethod( - Invocation.getter(#currentFailoverIndex), - returnValue: 0, - ) as int); + String get host => + (super.noSuchMethod( + Invocation.getter(#host), + returnValue: _i7.dummyValue(this, Invocation.getter(#host)), + ) + as String); @override - set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( - Invocation.setter( - #currentFailoverIndex, - _currentFailoverIndex, - ), - returnValueForMissingStub: null, - ); + int get port => + (super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int); @override - Duration get connectionTimeoutForSpecialCaseJsonRPCClients => - (super.noSuchMethod( - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - returnValue: _FakeDuration_1( - this, - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - ), - ) as Duration); + bool get useSSL => + (super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false) + as bool); @override - String get host => (super.noSuchMethod( - Invocation.getter(#host), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#host), - ), - ) as String); + int get currentFailoverIndex => + (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) + as int); @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); + Duration get connectionTimeoutForSpecialCaseJsonRPCClients => + (super.noSuchMethod( + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + returnValue: _FakeDuration_1( + this, + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + ), + ) + as Duration); @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); + set currentFailoverIndex(int? value) => super.noSuchMethod( + Invocation.setter(#currentFailoverIndex, value), + returnValueForMissingStub: null, + ); @override - _i8.Future closeAdapter() => (super.noSuchMethod( - Invocation.method( - #closeAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future closeAdapter() => + (super.noSuchMethod( + Invocation.method(#closeAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future checkElectrumAdapter() => (super.noSuchMethod( - Invocation.method( - #checkElectrumAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future checkElectrumAdapter() => + (super.noSuchMethod( + Invocation.method(#checkElectrumAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future request({ @@ -181,19 +156,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { Duration? requestTimeout = const Duration(seconds: 60), }) => (super.noSuchMethod( - Invocation.method( - #request, - [], - { - #command: command, - #args: args, - #requestID: requestID, - #retries: retries, - #requestTimeout: requestTimeout, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#request, [], { + #command: command, + #args: args, + #requestID: requestID, + #retries: retries, + #requestTimeout: requestTimeout, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> batchRequest({ @@ -203,59 +175,46 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { int? retries = 2, }) => (super.noSuchMethod( - Invocation.method( - #batchRequest, - [], - { - #command: command, - #args: args, - #requestTimeout: requestTimeout, - #retries: retries, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); - - @override - _i8.Future ping({ - String? requestID, - int? retryCount = 1, - }) => + Invocation.method(#batchRequest, [], { + #command: command, + #args: args, + #requestTimeout: requestTimeout, + #retries: retries, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); + + @override + _i8.Future ping({String? requestID, int? retryCount = 1}) => (super.noSuchMethod( - Invocation.method( - #ping, - [], - { - #requestID: requestID, - #retryCount: retryCount, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#ping, [], { + #requestID: requestID, + #retryCount: retryCount, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getBlockHeadTip, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getServerFeatures, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getServerFeatures, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future broadcastTransaction({ @@ -263,26 +222,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #broadcastTransaction, - [], - { - #rawTx: rawTx, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(_i7.dummyValue( - this, - Invocation.method( - #broadcastTransaction, - [], - { + Invocation.method(#broadcastTransaction, [], { #rawTx: rawTx, #requestID: requestID, - }, - ), - )), - ) as _i8.Future); + }), + returnValue: _i8.Future.value( + _i7.dummyValue( + this, + Invocation.method(#broadcastTransaction, [], { + #rawTx: rawTx, + #requestID: requestID, + }), + ), + ), + ) + as _i8.Future); @override _i8.Future> getBalance({ @@ -290,17 +244,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getBalance, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBalance, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future>> getHistory({ @@ -308,30 +260,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getHistory, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getHistory, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchHistory( - {required List? args}) => + _i8.Future>>> getBatchHistory({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchHistory, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchHistory, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future>> getUTXOs({ @@ -339,30 +288,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getUTXOs, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getUTXOs, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchUTXOs( - {required List? args}) => + _i8.Future>>> getBatchUTXOs({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchUTXOs, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchUTXOs, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future> getTransaction({ @@ -371,55 +317,45 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #verbose: verbose, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getLelantusAnonymitySet({ - String? groupId = r'1', - String? blockhash = r'', + String? groupId = '1', + String? blockhash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future getLelantusMintData({ - dynamic mints, - String? requestID, - }) => + Invocation.method(#getLelantusAnonymitySet, [], { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future getLelantusMintData({dynamic mints, String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusMintData, - [], - { - #mints: mints, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getLelantusMintData, [], { + #mints: mints, + #requestID: requestID, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> getLelantusUsedCoinSerials({ @@ -427,70 +363,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusUsedCoinSerials, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getLelantusUsedCoinSerials, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getLelantusLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getSparkAnonymitySet({ - String? coinGroupId = r'1', - String? startBlockHash = r'', + String? coinGroupId = '1', + String? startBlockHash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #coinGroupId: coinGroupId, - #startBlockHash: startBlockHash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySet, [], { + #coinGroupId: coinGroupId, + #startBlockHash: startBlockHash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getSparkLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getSparkLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getMempoolTxids, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getMempoolTxids, [], {#requestID: requestID}), + returnValue: _i8.Future>.value({}), + ) + as _i8.Future>); @override _i8.Future> getMempoolSparkData({ @@ -498,17 +425,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required List? txids, }) => (super.noSuchMethod( - Invocation.method( - #getMempoolSparkData, - [], - { - #requestID: requestID, - #txids: txids, - }, - ), - returnValue: _i8.Future>.value( - <_i3.SparkMempoolData>[]), - ) as _i8.Future>); + Invocation.method(#getMempoolSparkData, [], { + #requestID: requestID, + #txids: txids, + }), + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[], + ), + ) + as _i8.Future>); @override _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ @@ -516,77 +441,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getSparkUnhashedUsedCoinsTagsWithTxHashes, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: _i8.Future>>.value(>[]), - ) as _i8.Future>>); + Invocation.method(#getSparkUnhashedUsedCoinsTagsWithTxHashes, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future> getSparkNames( - {String? requestID}) => + _i8.Future> getSparkNames({ + String? requestID, + }) => (super.noSuchMethod( - Invocation.method( - #getSparkNames, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value( - <({String address, String name})>[]), - ) as _i8.Future>); + Invocation.method(#getSparkNames, [], {#requestID: requestID}), + returnValue: + _i8.Future>.value( + <({String address, String name})>[], + ), + ) + as _i8.Future>); @override _i8.Future<({String additionalInfo, String address, int validUntil})> - getSparkNameData({ - required String? sparkName, - String? requestID, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - returnValue: _i8.Future< - ({ - String additionalInfo, - String address, - int validUntil - })>.value(( - additionalInfo: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - address: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - validUntil: 0 - )), - ) as _i8.Future< - ({String additionalInfo, String address, int validUntil})>); + getSparkNameData({required String? sparkName, String? requestID}) => + (super.noSuchMethod( + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + returnValue: + _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >.value(( + additionalInfo: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + address: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + validUntil: 0, + )), + ) + as _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >); @override _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ @@ -594,27 +503,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? coinGroupId, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - }, - ), - returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( - _FakeSparkAnonymitySetMeta_2( - this, - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { + Invocation.method(#getSparkAnonymitySetMeta, [], { #requestID: requestID, #coinGroupId: coinGroupId, - }, - ), - )), - ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + }), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method(#getSparkAnonymitySetMeta, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + }), + ), + ), + ) + as _i8.Future<_i3.SparkAnonymitySetMeta>); @override _i8.Future> getSparkAnonymitySetBySector({ @@ -625,19 +528,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? endIndex, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetBySector, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - #latestBlock: latestBlock, - #startIndex: startIndex, - #endIndex: endIndex, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySetBySector, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); @override _i8.Future isMasterNodeCollateral({ @@ -646,29 +546,24 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? index, }) => (super.noSuchMethod( - Invocation.method( - #isMasterNodeCollateral, - [], - { - #requestID: requestID, - #txid: txid, - #index: index, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#isMasterNodeCollateral, [], { + #requestID: requestID, + #txid: txid, + #index: index, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getFeeRate, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getFeeRate, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future<_i4.Decimal> estimateFee({ @@ -676,43 +571,34 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? blocks, }) => (super.noSuchMethod( - Invocation.method( - #estimateFee, - [], - { - #requestID: requestID, - #blocks: blocks, - }, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #estimateFee, - [], - { + Invocation.method(#estimateFee, [], { #requestID: requestID, #blocks: blocks, - }, - ), - )), - ) as _i8.Future<_i4.Decimal>); - - @override - _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - )), - ) as _i8.Future<_i4.Decimal>); + }), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#estimateFee, [], { + #requestID: requestID, + #blocks: blocks, + }), + ), + ), + ) + as _i8.Future<_i4.Decimal>); + + @override + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => + (super.noSuchMethod( + Invocation.method(#relayFee, [], {#requestID: requestID}), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#relayFee, [], {#requestID: requestID}), + ), + ), + ) + as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. @@ -725,43 +611,37 @@ class MockCachedElectrumXClient extends _i1.Mock } @override - _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( - Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_4( - this, - Invocation.getter(#electrumXClient), - ), - ) as _i5.ElectrumXClient); - - @override - String base64ToHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToHex, - [source], - ), - ), - ) as String); - - @override - String base64ToReverseHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToReverseHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToReverseHex, - [source], - ), - ), - ) as String); + _i5.ElectrumXClient get electrumXClient => + (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumXClient_4( + this, + Invocation.getter(#electrumXClient), + ), + ) + as _i5.ElectrumXClient); + + @override + String base64ToHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToHex, [source]), + ), + ) + as String); + + @override + String base64ToReverseHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToReverseHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToReverseHex, [source]), + ), + ) + as String); @override _i8.Future> getTransaction({ @@ -770,31 +650,29 @@ class MockCachedElectrumXClient extends _i1.Mock bool? verbose = true, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #cryptoCurrency: cryptoCurrency, - #verbose: verbose, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future clearSharedTransactionCache( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #clearSharedTransactionCache, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #cryptoCurrency: cryptoCurrency, + #verbose: verbose, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future clearSharedTransactionCache({ + required _i2.CryptoCurrency? cryptoCurrency, + }) => + (super.noSuchMethod( + Invocation.method(#clearSharedTransactionCache, [], { + #cryptoCurrency: cryptoCurrency, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [TransactionNotificationTracker]. @@ -807,71 +685,69 @@ class MockTransactionNotificationTracker extends _i1.Mock } @override - String get walletId => (super.noSuchMethod( - Invocation.getter(#walletId), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#walletId), - ), - ) as String); - - @override - List get pendings => (super.noSuchMethod( - Invocation.getter(#pendings), - returnValue: [], - ) as List); - - @override - List get confirmeds => (super.noSuchMethod( - Invocation.getter(#confirmeds), - returnValue: [], - ) as List); - - @override - bool wasNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedPending, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedPending, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedConfirmed, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedConfirmed, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( - Invocation.method( - #deleteTransaction, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + String get walletId => + (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#walletId), + ), + ) + as String); + + @override + List get pendings => + (super.noSuchMethod(Invocation.getter(#pendings), returnValue: []) + as List); + + @override + List get confirmeds => + (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) + as List); + + @override + bool wasNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedPending, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedPending, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + bool wasNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedConfirmed, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedConfirmed, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future deleteTransaction(String? txid) => + (super.noSuchMethod( + Invocation.method(#deleteTransaction, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } diff --git a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart index 7c455f73df..a4e641ec33 100644 --- a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart +++ b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/services/coins/bitcoincash/bitcoincash_wallet_test.dart. // Do not manually edit this file. @@ -25,62 +25,39 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeCryptoCurrency_0 extends _i1.SmartFake implements _i2.CryptoCurrency { - _FakeCryptoCurrency_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCryptoCurrency_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDuration_1 extends _i1.SmartFake implements Duration { - _FakeDuration_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDuration_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake implements _i3.SparkAnonymitySetMeta { - _FakeSparkAnonymitySetMeta_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSparkAnonymitySetMeta_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { - _FakeDecimal_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDecimal_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeElectrumXClient_4 extends _i1.SmartFake implements _i5.ElectrumXClient { - _FakeElectrumXClient_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeElectrumXClient_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ElectrumXClient]. @@ -92,85 +69,83 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { } @override - _i2.CryptoCurrency get cryptoCurrency => (super.noSuchMethod( - Invocation.getter(#cryptoCurrency), - returnValue: _FakeCryptoCurrency_0( - this, - Invocation.getter(#cryptoCurrency), - ), - ) as _i2.CryptoCurrency); + _i2.CryptoCurrency get cryptoCurrency => + (super.noSuchMethod( + Invocation.getter(#cryptoCurrency), + returnValue: _FakeCryptoCurrency_0( + this, + Invocation.getter(#cryptoCurrency), + ), + ) + as _i2.CryptoCurrency); @override - _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( - Invocation.getter(#netType), - returnValue: _i6.TorPlainNetworkOption.tor, - ) as _i6.TorPlainNetworkOption); + _i6.TorPlainNetworkOption get netType => + (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) + as _i6.TorPlainNetworkOption); @override - int get currentFailoverIndex => (super.noSuchMethod( - Invocation.getter(#currentFailoverIndex), - returnValue: 0, - ) as int); + String get host => + (super.noSuchMethod( + Invocation.getter(#host), + returnValue: _i7.dummyValue(this, Invocation.getter(#host)), + ) + as String); @override - set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( - Invocation.setter( - #currentFailoverIndex, - _currentFailoverIndex, - ), - returnValueForMissingStub: null, - ); + int get port => + (super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int); @override - Duration get connectionTimeoutForSpecialCaseJsonRPCClients => - (super.noSuchMethod( - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - returnValue: _FakeDuration_1( - this, - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - ), - ) as Duration); + bool get useSSL => + (super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false) + as bool); @override - String get host => (super.noSuchMethod( - Invocation.getter(#host), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#host), - ), - ) as String); + int get currentFailoverIndex => + (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) + as int); @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); + Duration get connectionTimeoutForSpecialCaseJsonRPCClients => + (super.noSuchMethod( + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + returnValue: _FakeDuration_1( + this, + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + ), + ) + as Duration); @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); + set currentFailoverIndex(int? value) => super.noSuchMethod( + Invocation.setter(#currentFailoverIndex, value), + returnValueForMissingStub: null, + ); @override - _i8.Future closeAdapter() => (super.noSuchMethod( - Invocation.method( - #closeAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future closeAdapter() => + (super.noSuchMethod( + Invocation.method(#closeAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future checkElectrumAdapter() => (super.noSuchMethod( - Invocation.method( - #checkElectrumAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future checkElectrumAdapter() => + (super.noSuchMethod( + Invocation.method(#checkElectrumAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future request({ @@ -181,19 +156,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { Duration? requestTimeout = const Duration(seconds: 60), }) => (super.noSuchMethod( - Invocation.method( - #request, - [], - { - #command: command, - #args: args, - #requestID: requestID, - #retries: retries, - #requestTimeout: requestTimeout, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#request, [], { + #command: command, + #args: args, + #requestID: requestID, + #retries: retries, + #requestTimeout: requestTimeout, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> batchRequest({ @@ -203,59 +175,46 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { int? retries = 2, }) => (super.noSuchMethod( - Invocation.method( - #batchRequest, - [], - { - #command: command, - #args: args, - #requestTimeout: requestTimeout, - #retries: retries, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); - - @override - _i8.Future ping({ - String? requestID, - int? retryCount = 1, - }) => + Invocation.method(#batchRequest, [], { + #command: command, + #args: args, + #requestTimeout: requestTimeout, + #retries: retries, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); + + @override + _i8.Future ping({String? requestID, int? retryCount = 1}) => (super.noSuchMethod( - Invocation.method( - #ping, - [], - { - #requestID: requestID, - #retryCount: retryCount, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#ping, [], { + #requestID: requestID, + #retryCount: retryCount, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getBlockHeadTip, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getServerFeatures, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getServerFeatures, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future broadcastTransaction({ @@ -263,26 +222,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #broadcastTransaction, - [], - { - #rawTx: rawTx, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(_i7.dummyValue( - this, - Invocation.method( - #broadcastTransaction, - [], - { + Invocation.method(#broadcastTransaction, [], { #rawTx: rawTx, #requestID: requestID, - }, - ), - )), - ) as _i8.Future); + }), + returnValue: _i8.Future.value( + _i7.dummyValue( + this, + Invocation.method(#broadcastTransaction, [], { + #rawTx: rawTx, + #requestID: requestID, + }), + ), + ), + ) + as _i8.Future); @override _i8.Future> getBalance({ @@ -290,17 +244,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getBalance, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBalance, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future>> getHistory({ @@ -308,30 +260,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getHistory, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getHistory, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchHistory( - {required List? args}) => + _i8.Future>>> getBatchHistory({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchHistory, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchHistory, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future>> getUTXOs({ @@ -339,30 +288,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getUTXOs, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getUTXOs, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchUTXOs( - {required List? args}) => + _i8.Future>>> getBatchUTXOs({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchUTXOs, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchUTXOs, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future> getTransaction({ @@ -371,55 +317,45 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #verbose: verbose, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getLelantusAnonymitySet({ - String? groupId = r'1', - String? blockhash = r'', + String? groupId = '1', + String? blockhash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future getLelantusMintData({ - dynamic mints, - String? requestID, - }) => + Invocation.method(#getLelantusAnonymitySet, [], { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future getLelantusMintData({dynamic mints, String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusMintData, - [], - { - #mints: mints, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getLelantusMintData, [], { + #mints: mints, + #requestID: requestID, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> getLelantusUsedCoinSerials({ @@ -427,70 +363,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusUsedCoinSerials, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getLelantusUsedCoinSerials, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getLelantusLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getSparkAnonymitySet({ - String? coinGroupId = r'1', - String? startBlockHash = r'', + String? coinGroupId = '1', + String? startBlockHash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #coinGroupId: coinGroupId, - #startBlockHash: startBlockHash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySet, [], { + #coinGroupId: coinGroupId, + #startBlockHash: startBlockHash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getSparkLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getSparkLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getMempoolTxids, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getMempoolTxids, [], {#requestID: requestID}), + returnValue: _i8.Future>.value({}), + ) + as _i8.Future>); @override _i8.Future> getMempoolSparkData({ @@ -498,17 +425,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required List? txids, }) => (super.noSuchMethod( - Invocation.method( - #getMempoolSparkData, - [], - { - #requestID: requestID, - #txids: txids, - }, - ), - returnValue: _i8.Future>.value( - <_i3.SparkMempoolData>[]), - ) as _i8.Future>); + Invocation.method(#getMempoolSparkData, [], { + #requestID: requestID, + #txids: txids, + }), + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[], + ), + ) + as _i8.Future>); @override _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ @@ -516,77 +441,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getSparkUnhashedUsedCoinsTagsWithTxHashes, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: _i8.Future>>.value(>[]), - ) as _i8.Future>>); + Invocation.method(#getSparkUnhashedUsedCoinsTagsWithTxHashes, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future> getSparkNames( - {String? requestID}) => + _i8.Future> getSparkNames({ + String? requestID, + }) => (super.noSuchMethod( - Invocation.method( - #getSparkNames, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value( - <({String address, String name})>[]), - ) as _i8.Future>); + Invocation.method(#getSparkNames, [], {#requestID: requestID}), + returnValue: + _i8.Future>.value( + <({String address, String name})>[], + ), + ) + as _i8.Future>); @override _i8.Future<({String additionalInfo, String address, int validUntil})> - getSparkNameData({ - required String? sparkName, - String? requestID, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - returnValue: _i8.Future< - ({ - String additionalInfo, - String address, - int validUntil - })>.value(( - additionalInfo: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - address: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - validUntil: 0 - )), - ) as _i8.Future< - ({String additionalInfo, String address, int validUntil})>); + getSparkNameData({required String? sparkName, String? requestID}) => + (super.noSuchMethod( + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + returnValue: + _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >.value(( + additionalInfo: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + address: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + validUntil: 0, + )), + ) + as _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >); @override _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ @@ -594,27 +503,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? coinGroupId, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - }, - ), - returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( - _FakeSparkAnonymitySetMeta_2( - this, - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { + Invocation.method(#getSparkAnonymitySetMeta, [], { #requestID: requestID, #coinGroupId: coinGroupId, - }, - ), - )), - ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + }), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method(#getSparkAnonymitySetMeta, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + }), + ), + ), + ) + as _i8.Future<_i3.SparkAnonymitySetMeta>); @override _i8.Future> getSparkAnonymitySetBySector({ @@ -625,19 +528,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? endIndex, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetBySector, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - #latestBlock: latestBlock, - #startIndex: startIndex, - #endIndex: endIndex, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySetBySector, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); @override _i8.Future isMasterNodeCollateral({ @@ -646,29 +546,24 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? index, }) => (super.noSuchMethod( - Invocation.method( - #isMasterNodeCollateral, - [], - { - #requestID: requestID, - #txid: txid, - #index: index, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#isMasterNodeCollateral, [], { + #requestID: requestID, + #txid: txid, + #index: index, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getFeeRate, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getFeeRate, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future<_i4.Decimal> estimateFee({ @@ -676,43 +571,34 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? blocks, }) => (super.noSuchMethod( - Invocation.method( - #estimateFee, - [], - { - #requestID: requestID, - #blocks: blocks, - }, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #estimateFee, - [], - { + Invocation.method(#estimateFee, [], { #requestID: requestID, #blocks: blocks, - }, - ), - )), - ) as _i8.Future<_i4.Decimal>); - - @override - _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - )), - ) as _i8.Future<_i4.Decimal>); + }), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#estimateFee, [], { + #requestID: requestID, + #blocks: blocks, + }), + ), + ), + ) + as _i8.Future<_i4.Decimal>); + + @override + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => + (super.noSuchMethod( + Invocation.method(#relayFee, [], {#requestID: requestID}), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#relayFee, [], {#requestID: requestID}), + ), + ), + ) + as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. @@ -725,43 +611,37 @@ class MockCachedElectrumXClient extends _i1.Mock } @override - _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( - Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_4( - this, - Invocation.getter(#electrumXClient), - ), - ) as _i5.ElectrumXClient); - - @override - String base64ToHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToHex, - [source], - ), - ), - ) as String); - - @override - String base64ToReverseHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToReverseHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToReverseHex, - [source], - ), - ), - ) as String); + _i5.ElectrumXClient get electrumXClient => + (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumXClient_4( + this, + Invocation.getter(#electrumXClient), + ), + ) + as _i5.ElectrumXClient); + + @override + String base64ToHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToHex, [source]), + ), + ) + as String); + + @override + String base64ToReverseHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToReverseHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToReverseHex, [source]), + ), + ) + as String); @override _i8.Future> getTransaction({ @@ -770,31 +650,29 @@ class MockCachedElectrumXClient extends _i1.Mock bool? verbose = true, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #cryptoCurrency: cryptoCurrency, - #verbose: verbose, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future clearSharedTransactionCache( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #clearSharedTransactionCache, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #cryptoCurrency: cryptoCurrency, + #verbose: verbose, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future clearSharedTransactionCache({ + required _i2.CryptoCurrency? cryptoCurrency, + }) => + (super.noSuchMethod( + Invocation.method(#clearSharedTransactionCache, [], { + #cryptoCurrency: cryptoCurrency, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [TransactionNotificationTracker]. @@ -807,71 +685,69 @@ class MockTransactionNotificationTracker extends _i1.Mock } @override - String get walletId => (super.noSuchMethod( - Invocation.getter(#walletId), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#walletId), - ), - ) as String); - - @override - List get pendings => (super.noSuchMethod( - Invocation.getter(#pendings), - returnValue: [], - ) as List); - - @override - List get confirmeds => (super.noSuchMethod( - Invocation.getter(#confirmeds), - returnValue: [], - ) as List); - - @override - bool wasNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedPending, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedPending, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedConfirmed, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedConfirmed, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( - Invocation.method( - #deleteTransaction, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + String get walletId => + (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#walletId), + ), + ) + as String); + + @override + List get pendings => + (super.noSuchMethod(Invocation.getter(#pendings), returnValue: []) + as List); + + @override + List get confirmeds => + (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) + as List); + + @override + bool wasNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedPending, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedPending, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + bool wasNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedConfirmed, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedConfirmed, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future deleteTransaction(String? txid) => + (super.noSuchMethod( + Invocation.method(#deleteTransaction, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } diff --git a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart index 86090d418a..cf2da0eb7f 100644 --- a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart +++ b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/services/coins/dogecoin/dogecoin_wallet_test.dart. // Do not manually edit this file. @@ -25,62 +25,39 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeCryptoCurrency_0 extends _i1.SmartFake implements _i2.CryptoCurrency { - _FakeCryptoCurrency_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCryptoCurrency_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDuration_1 extends _i1.SmartFake implements Duration { - _FakeDuration_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDuration_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake implements _i3.SparkAnonymitySetMeta { - _FakeSparkAnonymitySetMeta_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSparkAnonymitySetMeta_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { - _FakeDecimal_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDecimal_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeElectrumXClient_4 extends _i1.SmartFake implements _i5.ElectrumXClient { - _FakeElectrumXClient_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeElectrumXClient_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ElectrumXClient]. @@ -92,85 +69,83 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { } @override - _i2.CryptoCurrency get cryptoCurrency => (super.noSuchMethod( - Invocation.getter(#cryptoCurrency), - returnValue: _FakeCryptoCurrency_0( - this, - Invocation.getter(#cryptoCurrency), - ), - ) as _i2.CryptoCurrency); + _i2.CryptoCurrency get cryptoCurrency => + (super.noSuchMethod( + Invocation.getter(#cryptoCurrency), + returnValue: _FakeCryptoCurrency_0( + this, + Invocation.getter(#cryptoCurrency), + ), + ) + as _i2.CryptoCurrency); @override - _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( - Invocation.getter(#netType), - returnValue: _i6.TorPlainNetworkOption.tor, - ) as _i6.TorPlainNetworkOption); + _i6.TorPlainNetworkOption get netType => + (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) + as _i6.TorPlainNetworkOption); @override - int get currentFailoverIndex => (super.noSuchMethod( - Invocation.getter(#currentFailoverIndex), - returnValue: 0, - ) as int); + String get host => + (super.noSuchMethod( + Invocation.getter(#host), + returnValue: _i7.dummyValue(this, Invocation.getter(#host)), + ) + as String); @override - set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( - Invocation.setter( - #currentFailoverIndex, - _currentFailoverIndex, - ), - returnValueForMissingStub: null, - ); + int get port => + (super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int); @override - Duration get connectionTimeoutForSpecialCaseJsonRPCClients => - (super.noSuchMethod( - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - returnValue: _FakeDuration_1( - this, - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - ), - ) as Duration); + bool get useSSL => + (super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false) + as bool); @override - String get host => (super.noSuchMethod( - Invocation.getter(#host), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#host), - ), - ) as String); + int get currentFailoverIndex => + (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) + as int); @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); + Duration get connectionTimeoutForSpecialCaseJsonRPCClients => + (super.noSuchMethod( + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + returnValue: _FakeDuration_1( + this, + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + ), + ) + as Duration); @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); + set currentFailoverIndex(int? value) => super.noSuchMethod( + Invocation.setter(#currentFailoverIndex, value), + returnValueForMissingStub: null, + ); @override - _i8.Future closeAdapter() => (super.noSuchMethod( - Invocation.method( - #closeAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future closeAdapter() => + (super.noSuchMethod( + Invocation.method(#closeAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future checkElectrumAdapter() => (super.noSuchMethod( - Invocation.method( - #checkElectrumAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future checkElectrumAdapter() => + (super.noSuchMethod( + Invocation.method(#checkElectrumAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future request({ @@ -181,19 +156,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { Duration? requestTimeout = const Duration(seconds: 60), }) => (super.noSuchMethod( - Invocation.method( - #request, - [], - { - #command: command, - #args: args, - #requestID: requestID, - #retries: retries, - #requestTimeout: requestTimeout, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#request, [], { + #command: command, + #args: args, + #requestID: requestID, + #retries: retries, + #requestTimeout: requestTimeout, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> batchRequest({ @@ -203,59 +175,46 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { int? retries = 2, }) => (super.noSuchMethod( - Invocation.method( - #batchRequest, - [], - { - #command: command, - #args: args, - #requestTimeout: requestTimeout, - #retries: retries, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); - - @override - _i8.Future ping({ - String? requestID, - int? retryCount = 1, - }) => + Invocation.method(#batchRequest, [], { + #command: command, + #args: args, + #requestTimeout: requestTimeout, + #retries: retries, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); + + @override + _i8.Future ping({String? requestID, int? retryCount = 1}) => (super.noSuchMethod( - Invocation.method( - #ping, - [], - { - #requestID: requestID, - #retryCount: retryCount, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#ping, [], { + #requestID: requestID, + #retryCount: retryCount, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getBlockHeadTip, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getServerFeatures, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getServerFeatures, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future broadcastTransaction({ @@ -263,26 +222,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #broadcastTransaction, - [], - { - #rawTx: rawTx, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(_i7.dummyValue( - this, - Invocation.method( - #broadcastTransaction, - [], - { + Invocation.method(#broadcastTransaction, [], { #rawTx: rawTx, #requestID: requestID, - }, - ), - )), - ) as _i8.Future); + }), + returnValue: _i8.Future.value( + _i7.dummyValue( + this, + Invocation.method(#broadcastTransaction, [], { + #rawTx: rawTx, + #requestID: requestID, + }), + ), + ), + ) + as _i8.Future); @override _i8.Future> getBalance({ @@ -290,17 +244,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getBalance, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBalance, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future>> getHistory({ @@ -308,30 +260,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getHistory, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getHistory, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchHistory( - {required List? args}) => + _i8.Future>>> getBatchHistory({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchHistory, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchHistory, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future>> getUTXOs({ @@ -339,30 +288,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getUTXOs, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getUTXOs, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchUTXOs( - {required List? args}) => + _i8.Future>>> getBatchUTXOs({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchUTXOs, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchUTXOs, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future> getTransaction({ @@ -371,55 +317,45 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #verbose: verbose, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getLelantusAnonymitySet({ - String? groupId = r'1', - String? blockhash = r'', + String? groupId = '1', + String? blockhash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future getLelantusMintData({ - dynamic mints, - String? requestID, - }) => + Invocation.method(#getLelantusAnonymitySet, [], { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future getLelantusMintData({dynamic mints, String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusMintData, - [], - { - #mints: mints, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getLelantusMintData, [], { + #mints: mints, + #requestID: requestID, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> getLelantusUsedCoinSerials({ @@ -427,70 +363,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusUsedCoinSerials, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getLelantusUsedCoinSerials, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getLelantusLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getSparkAnonymitySet({ - String? coinGroupId = r'1', - String? startBlockHash = r'', + String? coinGroupId = '1', + String? startBlockHash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #coinGroupId: coinGroupId, - #startBlockHash: startBlockHash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySet, [], { + #coinGroupId: coinGroupId, + #startBlockHash: startBlockHash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getSparkLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getSparkLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getMempoolTxids, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getMempoolTxids, [], {#requestID: requestID}), + returnValue: _i8.Future>.value({}), + ) + as _i8.Future>); @override _i8.Future> getMempoolSparkData({ @@ -498,17 +425,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required List? txids, }) => (super.noSuchMethod( - Invocation.method( - #getMempoolSparkData, - [], - { - #requestID: requestID, - #txids: txids, - }, - ), - returnValue: _i8.Future>.value( - <_i3.SparkMempoolData>[]), - ) as _i8.Future>); + Invocation.method(#getMempoolSparkData, [], { + #requestID: requestID, + #txids: txids, + }), + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[], + ), + ) + as _i8.Future>); @override _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ @@ -516,77 +441,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getSparkUnhashedUsedCoinsTagsWithTxHashes, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: _i8.Future>>.value(>[]), - ) as _i8.Future>>); + Invocation.method(#getSparkUnhashedUsedCoinsTagsWithTxHashes, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future> getSparkNames( - {String? requestID}) => + _i8.Future> getSparkNames({ + String? requestID, + }) => (super.noSuchMethod( - Invocation.method( - #getSparkNames, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value( - <({String address, String name})>[]), - ) as _i8.Future>); + Invocation.method(#getSparkNames, [], {#requestID: requestID}), + returnValue: + _i8.Future>.value( + <({String address, String name})>[], + ), + ) + as _i8.Future>); @override _i8.Future<({String additionalInfo, String address, int validUntil})> - getSparkNameData({ - required String? sparkName, - String? requestID, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - returnValue: _i8.Future< - ({ - String additionalInfo, - String address, - int validUntil - })>.value(( - additionalInfo: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - address: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - validUntil: 0 - )), - ) as _i8.Future< - ({String additionalInfo, String address, int validUntil})>); + getSparkNameData({required String? sparkName, String? requestID}) => + (super.noSuchMethod( + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + returnValue: + _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >.value(( + additionalInfo: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + address: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + validUntil: 0, + )), + ) + as _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >); @override _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ @@ -594,27 +503,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? coinGroupId, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - }, - ), - returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( - _FakeSparkAnonymitySetMeta_2( - this, - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { + Invocation.method(#getSparkAnonymitySetMeta, [], { #requestID: requestID, #coinGroupId: coinGroupId, - }, - ), - )), - ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + }), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method(#getSparkAnonymitySetMeta, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + }), + ), + ), + ) + as _i8.Future<_i3.SparkAnonymitySetMeta>); @override _i8.Future> getSparkAnonymitySetBySector({ @@ -625,19 +528,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? endIndex, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetBySector, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - #latestBlock: latestBlock, - #startIndex: startIndex, - #endIndex: endIndex, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySetBySector, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); @override _i8.Future isMasterNodeCollateral({ @@ -646,29 +546,24 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? index, }) => (super.noSuchMethod( - Invocation.method( - #isMasterNodeCollateral, - [], - { - #requestID: requestID, - #txid: txid, - #index: index, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#isMasterNodeCollateral, [], { + #requestID: requestID, + #txid: txid, + #index: index, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getFeeRate, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getFeeRate, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future<_i4.Decimal> estimateFee({ @@ -676,43 +571,34 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? blocks, }) => (super.noSuchMethod( - Invocation.method( - #estimateFee, - [], - { - #requestID: requestID, - #blocks: blocks, - }, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #estimateFee, - [], - { + Invocation.method(#estimateFee, [], { #requestID: requestID, #blocks: blocks, - }, - ), - )), - ) as _i8.Future<_i4.Decimal>); - - @override - _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - )), - ) as _i8.Future<_i4.Decimal>); + }), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#estimateFee, [], { + #requestID: requestID, + #blocks: blocks, + }), + ), + ), + ) + as _i8.Future<_i4.Decimal>); + + @override + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => + (super.noSuchMethod( + Invocation.method(#relayFee, [], {#requestID: requestID}), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#relayFee, [], {#requestID: requestID}), + ), + ), + ) + as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. @@ -725,43 +611,37 @@ class MockCachedElectrumXClient extends _i1.Mock } @override - _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( - Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_4( - this, - Invocation.getter(#electrumXClient), - ), - ) as _i5.ElectrumXClient); - - @override - String base64ToHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToHex, - [source], - ), - ), - ) as String); - - @override - String base64ToReverseHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToReverseHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToReverseHex, - [source], - ), - ), - ) as String); + _i5.ElectrumXClient get electrumXClient => + (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumXClient_4( + this, + Invocation.getter(#electrumXClient), + ), + ) + as _i5.ElectrumXClient); + + @override + String base64ToHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToHex, [source]), + ), + ) + as String); + + @override + String base64ToReverseHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToReverseHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToReverseHex, [source]), + ), + ) + as String); @override _i8.Future> getTransaction({ @@ -770,31 +650,29 @@ class MockCachedElectrumXClient extends _i1.Mock bool? verbose = true, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #cryptoCurrency: cryptoCurrency, - #verbose: verbose, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future clearSharedTransactionCache( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #clearSharedTransactionCache, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #cryptoCurrency: cryptoCurrency, + #verbose: verbose, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future clearSharedTransactionCache({ + required _i2.CryptoCurrency? cryptoCurrency, + }) => + (super.noSuchMethod( + Invocation.method(#clearSharedTransactionCache, [], { + #cryptoCurrency: cryptoCurrency, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [TransactionNotificationTracker]. @@ -807,71 +685,69 @@ class MockTransactionNotificationTracker extends _i1.Mock } @override - String get walletId => (super.noSuchMethod( - Invocation.getter(#walletId), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#walletId), - ), - ) as String); - - @override - List get pendings => (super.noSuchMethod( - Invocation.getter(#pendings), - returnValue: [], - ) as List); - - @override - List get confirmeds => (super.noSuchMethod( - Invocation.getter(#confirmeds), - returnValue: [], - ) as List); - - @override - bool wasNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedPending, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedPending, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedConfirmed, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedConfirmed, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( - Invocation.method( - #deleteTransaction, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + String get walletId => + (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#walletId), + ), + ) + as String); + + @override + List get pendings => + (super.noSuchMethod(Invocation.getter(#pendings), returnValue: []) + as List); + + @override + List get confirmeds => + (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) + as List); + + @override + bool wasNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedPending, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedPending, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + bool wasNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedConfirmed, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedConfirmed, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future deleteTransaction(String? txid) => + (super.noSuchMethod( + Invocation.method(#deleteTransaction, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } diff --git a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart index a397b611a2..103ca6b1d4 100644 --- a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart +++ b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/services/coins/namecoin/namecoin_wallet_test.dart. // Do not manually edit this file. @@ -25,62 +25,39 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeCryptoCurrency_0 extends _i1.SmartFake implements _i2.CryptoCurrency { - _FakeCryptoCurrency_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCryptoCurrency_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDuration_1 extends _i1.SmartFake implements Duration { - _FakeDuration_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDuration_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake implements _i3.SparkAnonymitySetMeta { - _FakeSparkAnonymitySetMeta_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSparkAnonymitySetMeta_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { - _FakeDecimal_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDecimal_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeElectrumXClient_4 extends _i1.SmartFake implements _i5.ElectrumXClient { - _FakeElectrumXClient_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeElectrumXClient_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ElectrumXClient]. @@ -92,85 +69,83 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { } @override - _i2.CryptoCurrency get cryptoCurrency => (super.noSuchMethod( - Invocation.getter(#cryptoCurrency), - returnValue: _FakeCryptoCurrency_0( - this, - Invocation.getter(#cryptoCurrency), - ), - ) as _i2.CryptoCurrency); + _i2.CryptoCurrency get cryptoCurrency => + (super.noSuchMethod( + Invocation.getter(#cryptoCurrency), + returnValue: _FakeCryptoCurrency_0( + this, + Invocation.getter(#cryptoCurrency), + ), + ) + as _i2.CryptoCurrency); @override - _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( - Invocation.getter(#netType), - returnValue: _i6.TorPlainNetworkOption.tor, - ) as _i6.TorPlainNetworkOption); + _i6.TorPlainNetworkOption get netType => + (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) + as _i6.TorPlainNetworkOption); @override - int get currentFailoverIndex => (super.noSuchMethod( - Invocation.getter(#currentFailoverIndex), - returnValue: 0, - ) as int); + String get host => + (super.noSuchMethod( + Invocation.getter(#host), + returnValue: _i7.dummyValue(this, Invocation.getter(#host)), + ) + as String); @override - set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( - Invocation.setter( - #currentFailoverIndex, - _currentFailoverIndex, - ), - returnValueForMissingStub: null, - ); + int get port => + (super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int); @override - Duration get connectionTimeoutForSpecialCaseJsonRPCClients => - (super.noSuchMethod( - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - returnValue: _FakeDuration_1( - this, - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - ), - ) as Duration); + bool get useSSL => + (super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false) + as bool); @override - String get host => (super.noSuchMethod( - Invocation.getter(#host), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#host), - ), - ) as String); + int get currentFailoverIndex => + (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) + as int); @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); + Duration get connectionTimeoutForSpecialCaseJsonRPCClients => + (super.noSuchMethod( + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + returnValue: _FakeDuration_1( + this, + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + ), + ) + as Duration); @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); + set currentFailoverIndex(int? value) => super.noSuchMethod( + Invocation.setter(#currentFailoverIndex, value), + returnValueForMissingStub: null, + ); @override - _i8.Future closeAdapter() => (super.noSuchMethod( - Invocation.method( - #closeAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future closeAdapter() => + (super.noSuchMethod( + Invocation.method(#closeAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future checkElectrumAdapter() => (super.noSuchMethod( - Invocation.method( - #checkElectrumAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future checkElectrumAdapter() => + (super.noSuchMethod( + Invocation.method(#checkElectrumAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future request({ @@ -181,19 +156,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { Duration? requestTimeout = const Duration(seconds: 60), }) => (super.noSuchMethod( - Invocation.method( - #request, - [], - { - #command: command, - #args: args, - #requestID: requestID, - #retries: retries, - #requestTimeout: requestTimeout, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#request, [], { + #command: command, + #args: args, + #requestID: requestID, + #retries: retries, + #requestTimeout: requestTimeout, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> batchRequest({ @@ -203,59 +175,46 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { int? retries = 2, }) => (super.noSuchMethod( - Invocation.method( - #batchRequest, - [], - { - #command: command, - #args: args, - #requestTimeout: requestTimeout, - #retries: retries, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); - - @override - _i8.Future ping({ - String? requestID, - int? retryCount = 1, - }) => + Invocation.method(#batchRequest, [], { + #command: command, + #args: args, + #requestTimeout: requestTimeout, + #retries: retries, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); + + @override + _i8.Future ping({String? requestID, int? retryCount = 1}) => (super.noSuchMethod( - Invocation.method( - #ping, - [], - { - #requestID: requestID, - #retryCount: retryCount, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#ping, [], { + #requestID: requestID, + #retryCount: retryCount, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getBlockHeadTip, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getServerFeatures, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getServerFeatures, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future broadcastTransaction({ @@ -263,26 +222,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #broadcastTransaction, - [], - { - #rawTx: rawTx, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(_i7.dummyValue( - this, - Invocation.method( - #broadcastTransaction, - [], - { + Invocation.method(#broadcastTransaction, [], { #rawTx: rawTx, #requestID: requestID, - }, - ), - )), - ) as _i8.Future); + }), + returnValue: _i8.Future.value( + _i7.dummyValue( + this, + Invocation.method(#broadcastTransaction, [], { + #rawTx: rawTx, + #requestID: requestID, + }), + ), + ), + ) + as _i8.Future); @override _i8.Future> getBalance({ @@ -290,17 +244,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getBalance, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBalance, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future>> getHistory({ @@ -308,30 +260,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getHistory, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getHistory, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchHistory( - {required List? args}) => + _i8.Future>>> getBatchHistory({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchHistory, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchHistory, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future>> getUTXOs({ @@ -339,30 +288,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getUTXOs, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getUTXOs, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchUTXOs( - {required List? args}) => + _i8.Future>>> getBatchUTXOs({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchUTXOs, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchUTXOs, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future> getTransaction({ @@ -371,55 +317,45 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #verbose: verbose, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getLelantusAnonymitySet({ - String? groupId = r'1', - String? blockhash = r'', + String? groupId = '1', + String? blockhash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future getLelantusMintData({ - dynamic mints, - String? requestID, - }) => + Invocation.method(#getLelantusAnonymitySet, [], { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future getLelantusMintData({dynamic mints, String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusMintData, - [], - { - #mints: mints, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getLelantusMintData, [], { + #mints: mints, + #requestID: requestID, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> getLelantusUsedCoinSerials({ @@ -427,70 +363,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusUsedCoinSerials, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getLelantusUsedCoinSerials, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getLelantusLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getSparkAnonymitySet({ - String? coinGroupId = r'1', - String? startBlockHash = r'', + String? coinGroupId = '1', + String? startBlockHash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #coinGroupId: coinGroupId, - #startBlockHash: startBlockHash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySet, [], { + #coinGroupId: coinGroupId, + #startBlockHash: startBlockHash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getSparkLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getSparkLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getMempoolTxids, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getMempoolTxids, [], {#requestID: requestID}), + returnValue: _i8.Future>.value({}), + ) + as _i8.Future>); @override _i8.Future> getMempoolSparkData({ @@ -498,17 +425,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required List? txids, }) => (super.noSuchMethod( - Invocation.method( - #getMempoolSparkData, - [], - { - #requestID: requestID, - #txids: txids, - }, - ), - returnValue: _i8.Future>.value( - <_i3.SparkMempoolData>[]), - ) as _i8.Future>); + Invocation.method(#getMempoolSparkData, [], { + #requestID: requestID, + #txids: txids, + }), + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[], + ), + ) + as _i8.Future>); @override _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ @@ -516,77 +441,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getSparkUnhashedUsedCoinsTagsWithTxHashes, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: _i8.Future>>.value(>[]), - ) as _i8.Future>>); + Invocation.method(#getSparkUnhashedUsedCoinsTagsWithTxHashes, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future> getSparkNames( - {String? requestID}) => + _i8.Future> getSparkNames({ + String? requestID, + }) => (super.noSuchMethod( - Invocation.method( - #getSparkNames, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value( - <({String address, String name})>[]), - ) as _i8.Future>); + Invocation.method(#getSparkNames, [], {#requestID: requestID}), + returnValue: + _i8.Future>.value( + <({String address, String name})>[], + ), + ) + as _i8.Future>); @override _i8.Future<({String additionalInfo, String address, int validUntil})> - getSparkNameData({ - required String? sparkName, - String? requestID, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - returnValue: _i8.Future< - ({ - String additionalInfo, - String address, - int validUntil - })>.value(( - additionalInfo: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - address: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - validUntil: 0 - )), - ) as _i8.Future< - ({String additionalInfo, String address, int validUntil})>); + getSparkNameData({required String? sparkName, String? requestID}) => + (super.noSuchMethod( + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + returnValue: + _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >.value(( + additionalInfo: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + address: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + validUntil: 0, + )), + ) + as _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >); @override _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ @@ -594,27 +503,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? coinGroupId, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - }, - ), - returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( - _FakeSparkAnonymitySetMeta_2( - this, - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { + Invocation.method(#getSparkAnonymitySetMeta, [], { #requestID: requestID, #coinGroupId: coinGroupId, - }, - ), - )), - ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + }), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method(#getSparkAnonymitySetMeta, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + }), + ), + ), + ) + as _i8.Future<_i3.SparkAnonymitySetMeta>); @override _i8.Future> getSparkAnonymitySetBySector({ @@ -625,19 +528,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? endIndex, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetBySector, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - #latestBlock: latestBlock, - #startIndex: startIndex, - #endIndex: endIndex, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySetBySector, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); @override _i8.Future isMasterNodeCollateral({ @@ -646,29 +546,24 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? index, }) => (super.noSuchMethod( - Invocation.method( - #isMasterNodeCollateral, - [], - { - #requestID: requestID, - #txid: txid, - #index: index, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#isMasterNodeCollateral, [], { + #requestID: requestID, + #txid: txid, + #index: index, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getFeeRate, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getFeeRate, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future<_i4.Decimal> estimateFee({ @@ -676,43 +571,34 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? blocks, }) => (super.noSuchMethod( - Invocation.method( - #estimateFee, - [], - { - #requestID: requestID, - #blocks: blocks, - }, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #estimateFee, - [], - { + Invocation.method(#estimateFee, [], { #requestID: requestID, #blocks: blocks, - }, - ), - )), - ) as _i8.Future<_i4.Decimal>); - - @override - _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - )), - ) as _i8.Future<_i4.Decimal>); + }), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#estimateFee, [], { + #requestID: requestID, + #blocks: blocks, + }), + ), + ), + ) + as _i8.Future<_i4.Decimal>); + + @override + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => + (super.noSuchMethod( + Invocation.method(#relayFee, [], {#requestID: requestID}), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#relayFee, [], {#requestID: requestID}), + ), + ), + ) + as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. @@ -725,43 +611,37 @@ class MockCachedElectrumXClient extends _i1.Mock } @override - _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( - Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_4( - this, - Invocation.getter(#electrumXClient), - ), - ) as _i5.ElectrumXClient); - - @override - String base64ToHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToHex, - [source], - ), - ), - ) as String); - - @override - String base64ToReverseHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToReverseHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToReverseHex, - [source], - ), - ), - ) as String); + _i5.ElectrumXClient get electrumXClient => + (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumXClient_4( + this, + Invocation.getter(#electrumXClient), + ), + ) + as _i5.ElectrumXClient); + + @override + String base64ToHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToHex, [source]), + ), + ) + as String); + + @override + String base64ToReverseHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToReverseHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToReverseHex, [source]), + ), + ) + as String); @override _i8.Future> getTransaction({ @@ -770,31 +650,29 @@ class MockCachedElectrumXClient extends _i1.Mock bool? verbose = true, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #cryptoCurrency: cryptoCurrency, - #verbose: verbose, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future clearSharedTransactionCache( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #clearSharedTransactionCache, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #cryptoCurrency: cryptoCurrency, + #verbose: verbose, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future clearSharedTransactionCache({ + required _i2.CryptoCurrency? cryptoCurrency, + }) => + (super.noSuchMethod( + Invocation.method(#clearSharedTransactionCache, [], { + #cryptoCurrency: cryptoCurrency, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [TransactionNotificationTracker]. @@ -807,71 +685,69 @@ class MockTransactionNotificationTracker extends _i1.Mock } @override - String get walletId => (super.noSuchMethod( - Invocation.getter(#walletId), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#walletId), - ), - ) as String); - - @override - List get pendings => (super.noSuchMethod( - Invocation.getter(#pendings), - returnValue: [], - ) as List); - - @override - List get confirmeds => (super.noSuchMethod( - Invocation.getter(#confirmeds), - returnValue: [], - ) as List); - - @override - bool wasNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedPending, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedPending, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedConfirmed, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedConfirmed, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( - Invocation.method( - #deleteTransaction, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + String get walletId => + (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#walletId), + ), + ) + as String); + + @override + List get pendings => + (super.noSuchMethod(Invocation.getter(#pendings), returnValue: []) + as List); + + @override + List get confirmeds => + (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) + as List); + + @override + bool wasNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedPending, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedPending, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + bool wasNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedConfirmed, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedConfirmed, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future deleteTransaction(String? txid) => + (super.noSuchMethod( + Invocation.method(#deleteTransaction, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } diff --git a/test/services/coins/particl/particl_wallet_test.mocks.dart b/test/services/coins/particl/particl_wallet_test.mocks.dart index 861fa4327e..8c10019e4a 100644 --- a/test/services/coins/particl/particl_wallet_test.mocks.dart +++ b/test/services/coins/particl/particl_wallet_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/services/coins/particl/particl_wallet_test.dart. // Do not manually edit this file. @@ -25,62 +25,39 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeCryptoCurrency_0 extends _i1.SmartFake implements _i2.CryptoCurrency { - _FakeCryptoCurrency_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCryptoCurrency_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDuration_1 extends _i1.SmartFake implements Duration { - _FakeDuration_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDuration_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake implements _i3.SparkAnonymitySetMeta { - _FakeSparkAnonymitySetMeta_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSparkAnonymitySetMeta_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { - _FakeDecimal_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDecimal_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeElectrumXClient_4 extends _i1.SmartFake implements _i5.ElectrumXClient { - _FakeElectrumXClient_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeElectrumXClient_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ElectrumXClient]. @@ -92,85 +69,83 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { } @override - _i2.CryptoCurrency get cryptoCurrency => (super.noSuchMethod( - Invocation.getter(#cryptoCurrency), - returnValue: _FakeCryptoCurrency_0( - this, - Invocation.getter(#cryptoCurrency), - ), - ) as _i2.CryptoCurrency); + _i2.CryptoCurrency get cryptoCurrency => + (super.noSuchMethod( + Invocation.getter(#cryptoCurrency), + returnValue: _FakeCryptoCurrency_0( + this, + Invocation.getter(#cryptoCurrency), + ), + ) + as _i2.CryptoCurrency); @override - _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( - Invocation.getter(#netType), - returnValue: _i6.TorPlainNetworkOption.tor, - ) as _i6.TorPlainNetworkOption); + _i6.TorPlainNetworkOption get netType => + (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) + as _i6.TorPlainNetworkOption); @override - int get currentFailoverIndex => (super.noSuchMethod( - Invocation.getter(#currentFailoverIndex), - returnValue: 0, - ) as int); + String get host => + (super.noSuchMethod( + Invocation.getter(#host), + returnValue: _i7.dummyValue(this, Invocation.getter(#host)), + ) + as String); @override - set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( - Invocation.setter( - #currentFailoverIndex, - _currentFailoverIndex, - ), - returnValueForMissingStub: null, - ); + int get port => + (super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int); @override - Duration get connectionTimeoutForSpecialCaseJsonRPCClients => - (super.noSuchMethod( - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - returnValue: _FakeDuration_1( - this, - Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), - ), - ) as Duration); + bool get useSSL => + (super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false) + as bool); @override - String get host => (super.noSuchMethod( - Invocation.getter(#host), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#host), - ), - ) as String); + int get currentFailoverIndex => + (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) + as int); @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); + Duration get connectionTimeoutForSpecialCaseJsonRPCClients => + (super.noSuchMethod( + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + returnValue: _FakeDuration_1( + this, + Invocation.getter(#connectionTimeoutForSpecialCaseJsonRPCClients), + ), + ) + as Duration); @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); + set currentFailoverIndex(int? value) => super.noSuchMethod( + Invocation.setter(#currentFailoverIndex, value), + returnValueForMissingStub: null, + ); @override - _i8.Future closeAdapter() => (super.noSuchMethod( - Invocation.method( - #closeAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future closeAdapter() => + (super.noSuchMethod( + Invocation.method(#closeAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future checkElectrumAdapter() => (super.noSuchMethod( - Invocation.method( - #checkElectrumAdapter, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future checkElectrumAdapter() => + (super.noSuchMethod( + Invocation.method(#checkElectrumAdapter, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future request({ @@ -181,19 +156,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { Duration? requestTimeout = const Duration(seconds: 60), }) => (super.noSuchMethod( - Invocation.method( - #request, - [], - { - #command: command, - #args: args, - #requestID: requestID, - #retries: retries, - #requestTimeout: requestTimeout, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#request, [], { + #command: command, + #args: args, + #requestID: requestID, + #retries: retries, + #requestTimeout: requestTimeout, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> batchRequest({ @@ -203,59 +175,46 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { int? retries = 2, }) => (super.noSuchMethod( - Invocation.method( - #batchRequest, - [], - { - #command: command, - #args: args, - #requestTimeout: requestTimeout, - #retries: retries, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); - - @override - _i8.Future ping({ - String? requestID, - int? retryCount = 1, - }) => + Invocation.method(#batchRequest, [], { + #command: command, + #args: args, + #requestTimeout: requestTimeout, + #retries: retries, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); + + @override + _i8.Future ping({String? requestID, int? retryCount = 1}) => (super.noSuchMethod( - Invocation.method( - #ping, - [], - { - #requestID: requestID, - #retryCount: retryCount, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#ping, [], { + #requestID: requestID, + #retryCount: retryCount, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getBlockHeadTip, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getServerFeatures, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getServerFeatures, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future broadcastTransaction({ @@ -263,26 +222,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #broadcastTransaction, - [], - { - #rawTx: rawTx, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(_i7.dummyValue( - this, - Invocation.method( - #broadcastTransaction, - [], - { + Invocation.method(#broadcastTransaction, [], { #rawTx: rawTx, #requestID: requestID, - }, - ), - )), - ) as _i8.Future); + }), + returnValue: _i8.Future.value( + _i7.dummyValue( + this, + Invocation.method(#broadcastTransaction, [], { + #rawTx: rawTx, + #requestID: requestID, + }), + ), + ), + ) + as _i8.Future); @override _i8.Future> getBalance({ @@ -290,17 +244,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getBalance, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getBalance, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future>> getHistory({ @@ -308,30 +260,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getHistory, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getHistory, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchHistory( - {required List? args}) => + _i8.Future>>> getBatchHistory({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchHistory, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchHistory, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future>> getUTXOs({ @@ -339,30 +288,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getUTXOs, - [], - { - #scripthash: scripthash, - #requestID: requestID, - }, - ), - returnValue: _i8.Future>>.value( - >[]), - ) as _i8.Future>>); + Invocation.method(#getUTXOs, [], { + #scripthash: scripthash, + #requestID: requestID, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future>>> getBatchUTXOs( - {required List? args}) => + _i8.Future>>> getBatchUTXOs({ + required List? args, + }) => (super.noSuchMethod( - Invocation.method( - #getBatchUTXOs, - [], - {#args: args}, - ), - returnValue: _i8.Future>>>.value( - >>[]), - ) as _i8.Future>>>); + Invocation.method(#getBatchUTXOs, [], {#args: args}), + returnValue: _i8.Future>>>.value( + >>[], + ), + ) + as _i8.Future>>>); @override _i8.Future> getTransaction({ @@ -371,55 +317,45 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #verbose: verbose, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future> getLelantusAnonymitySet({ - String? groupId = r'1', - String? blockhash = r'', + String? groupId = '1', + String? blockhash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future getLelantusMintData({ - dynamic mints, - String? requestID, - }) => + Invocation.method(#getLelantusAnonymitySet, [], { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future getLelantusMintData({dynamic mints, String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusMintData, - [], - { - #mints: mints, - #requestID: requestID, - }, - ), - returnValue: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getLelantusMintData, [], { + #mints: mints, + #requestID: requestID, + }), + returnValue: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future> getLelantusUsedCoinSerials({ @@ -427,70 +363,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getLelantusUsedCoinSerials, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getLelantusUsedCoinSerials, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getLelantusLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getLelantusLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getSparkAnonymitySet({ - String? coinGroupId = r'1', - String? startBlockHash = r'', + String? coinGroupId = '1', + String? startBlockHash = '', String? requestID, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #coinGroupId: coinGroupId, - #startBlockHash: startBlockHash, - #requestID: requestID, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySet, [], { + #coinGroupId: coinGroupId, + #startBlockHash: startBlockHash, + #requestID: requestID, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getSparkLatestCoinId, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future.value(0), - ) as _i8.Future); + Invocation.method(#getSparkLatestCoinId, [], { + #requestID: requestID, + }), + returnValue: _i8.Future.value(0), + ) + as _i8.Future); @override _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getMempoolTxids, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getMempoolTxids, [], {#requestID: requestID}), + returnValue: _i8.Future>.value({}), + ) + as _i8.Future>); @override _i8.Future> getMempoolSparkData({ @@ -498,17 +425,15 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required List? txids, }) => (super.noSuchMethod( - Invocation.method( - #getMempoolSparkData, - [], - { - #requestID: requestID, - #txids: txids, - }, - ), - returnValue: _i8.Future>.value( - <_i3.SparkMempoolData>[]), - ) as _i8.Future>); + Invocation.method(#getMempoolSparkData, [], { + #requestID: requestID, + #txids: txids, + }), + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[], + ), + ) + as _i8.Future>); @override _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ @@ -516,77 +441,61 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? startNumber, }) => (super.noSuchMethod( - Invocation.method( - #getSparkUnhashedUsedCoinsTagsWithTxHashes, - [], - { - #requestID: requestID, - #startNumber: startNumber, - }, - ), - returnValue: _i8.Future>>.value(>[]), - ) as _i8.Future>>); + Invocation.method(#getSparkUnhashedUsedCoinsTagsWithTxHashes, [], { + #requestID: requestID, + #startNumber: startNumber, + }), + returnValue: _i8.Future>>.value( + >[], + ), + ) + as _i8.Future>>); @override - _i8.Future> getSparkNames( - {String? requestID}) => + _i8.Future> getSparkNames({ + String? requestID, + }) => (super.noSuchMethod( - Invocation.method( - #getSparkNames, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future>.value( - <({String address, String name})>[]), - ) as _i8.Future>); + Invocation.method(#getSparkNames, [], {#requestID: requestID}), + returnValue: + _i8.Future>.value( + <({String address, String name})>[], + ), + ) + as _i8.Future>); @override _i8.Future<({String additionalInfo, String address, int validUntil})> - getSparkNameData({ - required String? sparkName, - String? requestID, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - returnValue: _i8.Future< - ({ - String additionalInfo, - String address, - int validUntil - })>.value(( - additionalInfo: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - address: _i7.dummyValue( - this, - Invocation.method( - #getSparkNameData, - [], - { - #sparkName: sparkName, - #requestID: requestID, - }, - ), - ), - validUntil: 0 - )), - ) as _i8.Future< - ({String additionalInfo, String address, int validUntil})>); + getSparkNameData({required String? sparkName, String? requestID}) => + (super.noSuchMethod( + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + returnValue: + _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >.value(( + additionalInfo: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + address: _i7.dummyValue( + this, + Invocation.method(#getSparkNameData, [], { + #sparkName: sparkName, + #requestID: requestID, + }), + ), + validUntil: 0, + )), + ) + as _i8.Future< + ({String additionalInfo, String address, int validUntil}) + >); @override _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ @@ -594,27 +503,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? coinGroupId, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - }, - ), - returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( - _FakeSparkAnonymitySetMeta_2( - this, - Invocation.method( - #getSparkAnonymitySetMeta, - [], - { + Invocation.method(#getSparkAnonymitySetMeta, [], { #requestID: requestID, #coinGroupId: coinGroupId, - }, - ), - )), - ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + }), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method(#getSparkAnonymitySetMeta, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + }), + ), + ), + ) + as _i8.Future<_i3.SparkAnonymitySetMeta>); @override _i8.Future> getSparkAnonymitySetBySector({ @@ -625,19 +528,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? endIndex, }) => (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySetBySector, - [], - { - #requestID: requestID, - #coinGroupId: coinGroupId, - #latestBlock: latestBlock, - #startIndex: startIndex, - #endIndex: endIndex, - }, - ), - returnValue: _i8.Future>.value([]), - ) as _i8.Future>); + Invocation.method(#getSparkAnonymitySetBySector, [], { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }), + returnValue: _i8.Future>.value([]), + ) + as _i8.Future>); @override _i8.Future isMasterNodeCollateral({ @@ -646,29 +546,24 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? index, }) => (super.noSuchMethod( - Invocation.method( - #isMasterNodeCollateral, - [], - { - #requestID: requestID, - #txid: txid, - #index: index, - }, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#isMasterNodeCollateral, [], { + #requestID: requestID, + #txid: txid, + #index: index, + }), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #getFeeRate, - [], - {#requestID: requestID}, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); + Invocation.method(#getFeeRate, [], {#requestID: requestID}), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); @override _i8.Future<_i4.Decimal> estimateFee({ @@ -676,43 +571,34 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { required int? blocks, }) => (super.noSuchMethod( - Invocation.method( - #estimateFee, - [], - { - #requestID: requestID, - #blocks: blocks, - }, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #estimateFee, - [], - { + Invocation.method(#estimateFee, [], { #requestID: requestID, #blocks: blocks, - }, - ), - )), - ) as _i8.Future<_i4.Decimal>); - - @override - _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( - this, - Invocation.method( - #relayFee, - [], - {#requestID: requestID}, - ), - )), - ) as _i8.Future<_i4.Decimal>); + }), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#estimateFee, [], { + #requestID: requestID, + #blocks: blocks, + }), + ), + ), + ) + as _i8.Future<_i4.Decimal>); + + @override + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => + (super.noSuchMethod( + Invocation.method(#relayFee, [], {#requestID: requestID}), + returnValue: _i8.Future<_i4.Decimal>.value( + _FakeDecimal_3( + this, + Invocation.method(#relayFee, [], {#requestID: requestID}), + ), + ), + ) + as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. @@ -725,43 +611,37 @@ class MockCachedElectrumXClient extends _i1.Mock } @override - _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( - Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_4( - this, - Invocation.getter(#electrumXClient), - ), - ) as _i5.ElectrumXClient); - - @override - String base64ToHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToHex, - [source], - ), - ), - ) as String); - - @override - String base64ToReverseHex(String? source) => (super.noSuchMethod( - Invocation.method( - #base64ToReverseHex, - [source], - ), - returnValue: _i7.dummyValue( - this, - Invocation.method( - #base64ToReverseHex, - [source], - ), - ), - ) as String); + _i5.ElectrumXClient get electrumXClient => + (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumXClient_4( + this, + Invocation.getter(#electrumXClient), + ), + ) + as _i5.ElectrumXClient); + + @override + String base64ToHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToHex, [source]), + ), + ) + as String); + + @override + String base64ToReverseHex(String? source) => + (super.noSuchMethod( + Invocation.method(#base64ToReverseHex, [source]), + returnValue: _i7.dummyValue( + this, + Invocation.method(#base64ToReverseHex, [source]), + ), + ) + as String); @override _i8.Future> getTransaction({ @@ -770,31 +650,29 @@ class MockCachedElectrumXClient extends _i1.Mock bool? verbose = true, }) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [], - { - #txHash: txHash, - #cryptoCurrency: cryptoCurrency, - #verbose: verbose, - }, - ), - returnValue: - _i8.Future>.value({}), - ) as _i8.Future>); - - @override - _i8.Future clearSharedTransactionCache( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #clearSharedTransactionCache, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#getTransaction, [], { + #txHash: txHash, + #cryptoCurrency: cryptoCurrency, + #verbose: verbose, + }), + returnValue: _i8.Future>.value( + {}, + ), + ) + as _i8.Future>); + + @override + _i8.Future clearSharedTransactionCache({ + required _i2.CryptoCurrency? cryptoCurrency, + }) => + (super.noSuchMethod( + Invocation.method(#clearSharedTransactionCache, [], { + #cryptoCurrency: cryptoCurrency, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [TransactionNotificationTracker]. @@ -807,71 +685,69 @@ class MockTransactionNotificationTracker extends _i1.Mock } @override - String get walletId => (super.noSuchMethod( - Invocation.getter(#walletId), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#walletId), - ), - ) as String); - - @override - List get pendings => (super.noSuchMethod( - Invocation.getter(#pendings), - returnValue: [], - ) as List); - - @override - List get confirmeds => (super.noSuchMethod( - Invocation.getter(#confirmeds), - returnValue: [], - ) as List); - - @override - bool wasNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedPending, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedPending, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #wasNotifiedConfirmed, - [txid], - ), - returnValue: false, - ) as bool); - - @override - _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( - Invocation.method( - #addNotifiedConfirmed, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( - Invocation.method( - #deleteTransaction, - [txid], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + String get walletId => + (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: _i7.dummyValue( + this, + Invocation.getter(#walletId), + ), + ) + as String); + + @override + List get pendings => + (super.noSuchMethod(Invocation.getter(#pendings), returnValue: []) + as List); + + @override + List get confirmeds => + (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) + as List); + + @override + bool wasNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedPending, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedPending(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedPending, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + bool wasNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#wasNotifiedConfirmed, [txid]), + returnValue: false, + ) + as bool); + + @override + _i8.Future addNotifiedConfirmed(String? txid) => + (super.noSuchMethod( + Invocation.method(#addNotifiedConfirmed, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future deleteTransaction(String? txid) => + (super.noSuchMethod( + Invocation.method(#deleteTransaction, [txid]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } diff --git a/test/widget_tests/address_book_card_test.mocks.dart b/test/widget_tests/address_book_card_test.mocks.dart index 220d5cd665..69a4da3a6b 100644 --- a/test/widget_tests/address_book_card_test.mocks.dart +++ b/test/widget_tests/address_book_card_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/address_book_card_test.dart. // Do not manually edit this file. @@ -18,19 +18,16 @@ import 'package:stackwallet/services/address_book_service.dart' as _i3; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeContactEntry_0 extends _i1.SmartFake implements _i2.ContactEntry { - _FakeContactEntry_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeContactEntry_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [AddressBookService]. @@ -43,121 +40,93 @@ class MockAddressBookService extends _i1.Mock } @override - List<_i2.ContactEntry> get contacts => (super.noSuchMethod( - Invocation.getter(#contacts), - returnValue: <_i2.ContactEntry>[], - ) as List<_i2.ContactEntry>); + List<_i2.ContactEntry> get contacts => + (super.noSuchMethod( + Invocation.getter(#contacts), + returnValue: <_i2.ContactEntry>[], + ) + as List<_i2.ContactEntry>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i2.ContactEntry getContactById(String? id) => (super.noSuchMethod( - Invocation.method( - #getContactById, - [id], - ), - returnValue: _FakeContactEntry_0( - this, - Invocation.method( - #getContactById, - [id], - ), - ), - ) as _i2.ContactEntry); + _i2.ContactEntry getContactById(String? id) => + (super.noSuchMethod( + Invocation.method(#getContactById, [id]), + returnValue: _FakeContactEntry_0( + this, + Invocation.method(#getContactById, [id]), + ), + ) + as _i2.ContactEntry); @override _i4.Future> search(String? text) => (super.noSuchMethod( - Invocation.method( - #search, - [text], - ), - returnValue: - _i4.Future>.value(<_i2.ContactEntry>[]), - ) as _i4.Future>); + Invocation.method(#search, [text]), + returnValue: _i4.Future>.value( + <_i2.ContactEntry>[], + ), + ) + as _i4.Future>); @override - bool matches( - String? term, - _i2.ContactEntry? contact, - ) => + bool matches(String? term, _i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #matches, - [ - term, - contact, - ], - ), - returnValue: false, - ) as bool); + Invocation.method(#matches, [term, contact]), + returnValue: false, + ) + as bool); @override - _i4.Future addContact(_i2.ContactEntry? contact) => (super.noSuchMethod( - Invocation.method( - #addContact, - [contact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + _i4.Future addContact(_i2.ContactEntry? contact) => + (super.noSuchMethod( + Invocation.method(#addContact, [contact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override _i4.Future editContact(_i2.ContactEntry? editedContact) => (super.noSuchMethod( - Invocation.method( - #editContact, - [editedContact], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + Invocation.method(#editContact, [editedContact]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future removeContact(String? id) => (super.noSuchMethod( - Invocation.method( - #removeContact, - [id], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeContact(String? id) => + (super.noSuchMethod( + Invocation.method(#removeContact, [id]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 a7d3027095..4ca9aa9fcb 100644 --- a/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart +++ b/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/custom_buttons/favorite_toggle_test.dart. // Do not manually edit this file. @@ -7,9 +7,9 @@ import 'dart:async' as _i6; import 'dart:typed_data' as _i7; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/db/isar/main_db.dart' as _i3; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; import 'package:stackwallet/models/isar/stack_theme.dart' as _i5; -import 'package:stackwallet/networking/http.dart' as _i2; +import 'package:stackwallet/networking/http.dart' as _i3; import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: type=lint @@ -20,29 +20,21 @@ import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member -class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP { - _FakeHTTP_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeHTTP_1 extends _i1.SmartFake implements _i3.HTTP { + _FakeHTTP_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ThemeService]. @@ -54,118 +46,100 @@ class MockThemeService extends _i1.Mock implements _i4.ThemeService { } @override - _i2.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_0( - this, - Invocation.getter(#client), - ), - ) as _i2.HTTP); + _i2.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0(this, Invocation.getter(#db)), + ) + as _i2.MainDB); @override - set client(_i2.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i3.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_1(this, Invocation.getter(#client)), + ) + as _i3.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i5.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i5.StackTheme>[], + ) + as List<_i5.StackTheme>); @override - List<_i5.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i5.StackTheme>[], - ) as List<_i5.StackTheme>); + set client(_i3.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override - void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i6.Future install({required _i7.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override _i6.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i6.Future.value(false), + ) + as _i6.Future); @override - _i6.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i6.Future>.value( - <_i4.StackThemeMetaData>[]), - ) as _i6.Future>); + _i6.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method(#fetchThemes, []), + returnValue: _i6.Future>.value( + <_i4.StackThemeMetaData>[], + ), + ) + as _i6.Future>); @override - _i6.Future<_i7.Uint8List> fetchTheme( - {required _i4.StackThemeMetaData? themeMetaData}) => + _i6.Future<_i7.Uint8List> fetchTheme({ + required _i4.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), - ) as _i6.Future<_i7.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), + ) + as _i6.Future<_i7.Uint8List>); @override _i5.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i5.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i5.StackTheme?); } diff --git a/test/widget_tests/custom_loading_overlay_test.mocks.dart b/test/widget_tests/custom_loading_overlay_test.mocks.dart index 996bcf94ce..f2c9a9f81b 100644 --- a/test/widget_tests/custom_loading_overlay_test.mocks.dart +++ b/test/widget_tests/custom_loading_overlay_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/custom_loading_overlay_test.dart. // Do not manually edit this file. @@ -7,9 +7,9 @@ import 'dart:async' as _i6; import 'dart:typed_data' as _i7; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/db/isar/main_db.dart' as _i3; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; import 'package:stackwallet/models/isar/stack_theme.dart' as _i5; -import 'package:stackwallet/networking/http.dart' as _i2; +import 'package:stackwallet/networking/http.dart' as _i3; import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: type=lint @@ -20,29 +20,21 @@ import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member -class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP { - _FakeHTTP_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeHTTP_1 extends _i1.SmartFake implements _i3.HTTP { + _FakeHTTP_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ThemeService]. @@ -54,118 +46,100 @@ class MockThemeService extends _i1.Mock implements _i4.ThemeService { } @override - _i2.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_0( - this, - Invocation.getter(#client), - ), - ) as _i2.HTTP); + _i2.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0(this, Invocation.getter(#db)), + ) + as _i2.MainDB); @override - set client(_i2.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i3.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_1(this, Invocation.getter(#client)), + ) + as _i3.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i5.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i5.StackTheme>[], + ) + as List<_i5.StackTheme>); @override - List<_i5.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i5.StackTheme>[], - ) as List<_i5.StackTheme>); + set client(_i3.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override - void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i6.Future install({required _i7.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override _i6.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i6.Future.value(false), + ) + as _i6.Future); @override - _i6.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i6.Future>.value( - <_i4.StackThemeMetaData>[]), - ) as _i6.Future>); + _i6.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method(#fetchThemes, []), + returnValue: _i6.Future>.value( + <_i4.StackThemeMetaData>[], + ), + ) + as _i6.Future>); @override - _i6.Future<_i7.Uint8List> fetchTheme( - {required _i4.StackThemeMetaData? themeMetaData}) => + _i6.Future<_i7.Uint8List> fetchTheme({ + required _i4.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), - ) as _i6.Future<_i7.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), + ) + as _i6.Future<_i7.Uint8List>); @override _i5.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i5.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i5.StackTheme?); } diff --git a/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart b/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart index 8027316709..96909d1a09 100644 --- a/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart +++ b/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/desktop/desktop_scaffold_test.dart. // Do not manually edit this file. @@ -7,9 +7,9 @@ import 'dart:async' as _i6; import 'dart:typed_data' as _i7; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/db/isar/main_db.dart' as _i3; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; import 'package:stackwallet/models/isar/stack_theme.dart' as _i5; -import 'package:stackwallet/networking/http.dart' as _i2; +import 'package:stackwallet/networking/http.dart' as _i3; import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: type=lint @@ -20,29 +20,21 @@ import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member -class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP { - _FakeHTTP_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeHTTP_1 extends _i1.SmartFake implements _i3.HTTP { + _FakeHTTP_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ThemeService]. @@ -54,118 +46,100 @@ class MockThemeService extends _i1.Mock implements _i4.ThemeService { } @override - _i2.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_0( - this, - Invocation.getter(#client), - ), - ) as _i2.HTTP); + _i2.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0(this, Invocation.getter(#db)), + ) + as _i2.MainDB); @override - set client(_i2.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i3.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_1(this, Invocation.getter(#client)), + ) + as _i3.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i5.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i5.StackTheme>[], + ) + as List<_i5.StackTheme>); @override - List<_i5.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i5.StackTheme>[], - ) as List<_i5.StackTheme>); + set client(_i3.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override - void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i6.Future install({required _i7.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override _i6.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i6.Future.value(false), + ) + as _i6.Future); @override - _i6.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i6.Future>.value( - <_i4.StackThemeMetaData>[]), - ) as _i6.Future>); + _i6.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method(#fetchThemes, []), + returnValue: _i6.Future>.value( + <_i4.StackThemeMetaData>[], + ), + ) + as _i6.Future>); @override - _i6.Future<_i7.Uint8List> fetchTheme( - {required _i4.StackThemeMetaData? themeMetaData}) => + _i6.Future<_i7.Uint8List> fetchTheme({ + required _i4.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), - ) as _i6.Future<_i7.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), + ) + as _i6.Future<_i7.Uint8List>); @override _i5.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i5.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i5.StackTheme?); } diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index d19fa2405f..4cbe4bf179 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/managed_favorite_test.dart. // Do not manually edit this file. @@ -39,71 +39,43 @@ import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_i // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeNodeService_0 extends _i1.SmartFake implements _i2.NodeService { - _FakeNodeService_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeNodeService_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMainDB_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWallet_2 extends _i1.SmartFake implements _i5.Wallet { - _FakeWallet_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWallet_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeHTTP_3 extends _i1.SmartFake implements _i6.HTTP { - _FakeHTTP_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHTTP_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFusionInfo_4 extends _i1.SmartFake implements _i7.FusionInfo { - _FakeFusionInfo_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFusionInfo_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSecureStorageInterface_5 extends _i1.SmartFake implements _i8.SecureStorageInterface { - _FakeSecureStorageInterface_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Wallets]. @@ -115,71 +87,60 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { } @override - _i2.NodeService get nodeService => (super.noSuchMethod( - Invocation.getter(#nodeService), - returnValue: _FakeNodeService_0( - this, - Invocation.getter(#nodeService), - ), - ) as _i2.NodeService); + _i2.NodeService get nodeService => + (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_0( + this, + Invocation.getter(#nodeService), + ), + ) + as _i2.NodeService); @override - set nodeService(_i2.NodeService? _nodeService) => super.noSuchMethod( - Invocation.setter( - #nodeService, - _nodeService, - ), - returnValueForMissingStub: null, - ); + _i3.MainDB get mainDB => + (super.noSuchMethod( + Invocation.getter(#mainDB), + returnValue: _FakeMainDB_1(this, Invocation.getter(#mainDB)), + ) + as _i3.MainDB); @override - _i3.MainDB get mainDB => (super.noSuchMethod( - Invocation.getter(#mainDB), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#mainDB), - ), - ) as _i3.MainDB); + List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => + (super.noSuchMethod( + Invocation.getter(#wallets), + returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], + ) + as List<_i5.Wallet<_i4.CryptoCurrency>>); @override - set mainDB(_i3.MainDB? _mainDB) => super.noSuchMethod( - Invocation.setter( - #mainDB, - _mainDB, - ), - returnValueForMissingStub: null, - ); + set nodeService(_i2.NodeService? value) => super.noSuchMethod( + Invocation.setter(#nodeService, value), + returnValueForMissingStub: null, + ); @override - List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => (super.noSuchMethod( - Invocation.getter(#wallets), - returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], - ) as List<_i5.Wallet<_i4.CryptoCurrency>>); + set mainDB(_i3.MainDB? value) => super.noSuchMethod( + Invocation.setter(#mainDB, value), + returnValueForMissingStub: null, + ); @override _i5.Wallet<_i4.CryptoCurrency> getWallet(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getWallet, - [walletId], - ), - returnValue: _FakeWallet_2<_i4.CryptoCurrency>( - this, - Invocation.method( - #getWallet, - [walletId], - ), - ), - ) as _i5.Wallet<_i4.CryptoCurrency>); + Invocation.method(#getWallet, [walletId]), + returnValue: _FakeWallet_2<_i4.CryptoCurrency>( + this, + Invocation.method(#getWallet, [walletId]), + ), + ) + as _i5.Wallet<_i4.CryptoCurrency>); @override void addWallet(_i5.Wallet<_i4.CryptoCurrency>? wallet) => super.noSuchMethod( - Invocation.method( - #addWallet, - [wallet], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addWallet, [wallet]), + returnValueForMissingStub: null, + ); @override _i10.Future deleteWallet( @@ -187,16 +148,11 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { _i8.SecureStorageInterface? secureStorage, ) => (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - info, - secureStorage, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#deleteWallet, [info, secureStorage]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future load( @@ -205,17 +161,11 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { bool? isDuress, ) => (super.noSuchMethod( - Invocation.method( - #load, - [ - prefs, - mainDB, - isDuress, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#load, [prefs, mainDB, isDuress]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future loadAfterStackRestore( @@ -224,17 +174,15 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { bool? isDesktop, ) => (super.noSuchMethod( - Invocation.method( - #loadAfterStackRestore, - [ - prefs, - wallets, - isDesktop, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#loadAfterStackRestore, [ + prefs, + wallets, + isDesktop, + ]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); } /// A class which mocks [ThemeService]. @@ -246,121 +194,102 @@ class MockThemeService extends _i1.Mock implements _i13.ThemeService { } @override - _i6.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_3( - this, - Invocation.getter(#client), - ), - ) as _i6.HTTP); + _i3.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_1(this, Invocation.getter(#db)), + ) + as _i3.MainDB); @override - set client(_i6.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i6.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_3(this, Invocation.getter(#client)), + ) + as _i6.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i14.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i14.StackTheme>[], + ) + as List<_i14.StackTheme>); @override - List<_i14.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i14.StackTheme>[], - ) as List<_i14.StackTheme>); + set client(_i6.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i10.Future install({required _i15.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override _i10.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i10.Future>.value( - <_i13.StackThemeMetaData>[]), - ) as _i10.Future>); + Invocation.method(#fetchThemes, []), + returnValue: _i10.Future>.value( + <_i13.StackThemeMetaData>[], + ), + ) + as _i10.Future>); @override - _i10.Future<_i15.Uint8List> fetchTheme( - {required _i13.StackThemeMetaData? themeMetaData}) => + _i10.Future<_i15.Uint8List> fetchTheme({ + required _i13.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i10.Future<_i15.Uint8List>.value(_i15.Uint8List(0)), - ) as _i10.Future<_i15.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i10.Future<_i15.Uint8List>.value(_i15.Uint8List(0)), + ) + as _i10.Future<_i15.Uint8List>); @override _i14.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i14.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i14.StackTheme?); } /// A class which mocks [Prefs]. @@ -372,425 +301,421 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { } @override - bool get isInitialized => (super.noSuchMethod( - Invocation.getter(#isInitialized), - returnValue: false, - ) as bool); + 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); + 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, - ); + int get lastUnlocked => + (super.noSuchMethod(Invocation.getter(#lastUnlocked), returnValue: 0) + as int); @override - int get lastUnlocked => (super.noSuchMethod( - Invocation.getter(#lastUnlocked), - returnValue: 0, - ) as int); + int get currentNotificationId => + (super.noSuchMethod( + Invocation.getter(#currentNotificationId), + returnValue: 0, + ) + as int); @override - set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( - Invocation.setter( - #lastUnlocked, - lastUnlocked, - ), - returnValueForMissingStub: null, - ); + List get walletIdsSyncOnStartup => + (super.noSuchMethod( + Invocation.getter(#walletIdsSyncOnStartup), + returnValue: [], + ) + as List); @override - int get currentNotificationId => (super.noSuchMethod( - Invocation.getter(#currentNotificationId), - returnValue: 0, - ) as int); + _i16.SyncingType get syncType => + (super.noSuchMethod( + Invocation.getter(#syncType), + returnValue: _i16.SyncingType.currentWalletOnly, + ) + as _i16.SyncingType); @override - List get walletIdsSyncOnStartup => (super.noSuchMethod( - Invocation.getter(#walletIdsSyncOnStartup), - returnValue: [], - ) as List); + bool get wifiOnly => + (super.noSuchMethod(Invocation.getter(#wifiOnly), returnValue: false) + as bool); @override - set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => - super.noSuchMethod( - Invocation.setter( - #walletIdsSyncOnStartup, - walletIdsSyncOnStartup, - ), - returnValueForMissingStub: null, - ); + bool get showFavoriteWallets => + (super.noSuchMethod( + Invocation.getter(#showFavoriteWallets), + returnValue: false, + ) + as bool); @override - _i16.SyncingType get syncType => (super.noSuchMethod( - Invocation.getter(#syncType), - returnValue: _i16.SyncingType.currentWalletOnly, - ) as _i16.SyncingType); + String get language => + (super.noSuchMethod( + Invocation.getter(#language), + returnValue: _i17.dummyValue( + this, + Invocation.getter(#language), + ), + ) + as String); @override - set syncType(_i16.SyncingType? syncType) => super.noSuchMethod( - Invocation.setter( - #syncType, - syncType, - ), - returnValueForMissingStub: null, - ); + String get currency => + (super.noSuchMethod( + Invocation.getter(#currency), + returnValue: _i17.dummyValue( + this, + Invocation.getter(#currency), + ), + ) + as String); @override - bool get wifiOnly => (super.noSuchMethod( - Invocation.getter(#wifiOnly), - returnValue: false, - ) as bool); + bool get randomizePIN => + (super.noSuchMethod(Invocation.getter(#randomizePIN), returnValue: false) + as bool); @override - set wifiOnly(bool? wifiOnly) => super.noSuchMethod( - Invocation.setter( - #wifiOnly, - wifiOnly, - ), - returnValueForMissingStub: null, - ); + bool get useBiometrics => + (super.noSuchMethod(Invocation.getter(#useBiometrics), returnValue: false) + as bool); @override - bool get showFavoriteWallets => (super.noSuchMethod( - Invocation.getter(#showFavoriteWallets), - returnValue: false, - ) as bool); + bool get hasPin => + (super.noSuchMethod(Invocation.getter(#hasPin), returnValue: false) + as bool); @override - set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( - Invocation.setter( - #showFavoriteWallets, - showFavoriteWallets, - ), - returnValueForMissingStub: null, - ); + bool get hasDuressPin => + (super.noSuchMethod(Invocation.getter(#hasDuressPin), returnValue: false) + as bool); @override - String get language => (super.noSuchMethod( - Invocation.getter(#language), - returnValue: _i17.dummyValue( - this, - Invocation.getter(#language), - ), - ) as String); + bool get biometricsDuress => + (super.noSuchMethod( + Invocation.getter(#biometricsDuress), + returnValue: false, + ) + as bool); @override - set language(String? newLanguage) => super.noSuchMethod( - Invocation.setter( - #language, - newLanguage, - ), - returnValueForMissingStub: null, - ); + int get familiarity => + (super.noSuchMethod(Invocation.getter(#familiarity), returnValue: 0) + as int); @override - String get currency => (super.noSuchMethod( - Invocation.getter(#currency), - returnValue: _i17.dummyValue( - this, - Invocation.getter(#currency), - ), - ) as String); + bool get torKillSwitch => + (super.noSuchMethod(Invocation.getter(#torKillSwitch), returnValue: false) + as bool); @override - set currency(String? newCurrency) => super.noSuchMethod( - Invocation.setter( - #currency, - newCurrency, - ), - returnValueForMissingStub: null, - ); + bool get showTestNetCoins => + (super.noSuchMethod( + Invocation.getter(#showTestNetCoins), + returnValue: false, + ) + as bool); @override - bool get randomizePIN => (super.noSuchMethod( - Invocation.getter(#randomizePIN), - returnValue: false, - ) as bool); + bool get isAutoBackupEnabled => + (super.noSuchMethod( + Invocation.getter(#isAutoBackupEnabled), + returnValue: false, + ) + as bool); @override - set randomizePIN(bool? randomizePIN) => super.noSuchMethod( - Invocation.setter( - #randomizePIN, - randomizePIN, - ), - returnValueForMissingStub: null, - ); + _i18.BackupFrequencyType get backupFrequencyType => + (super.noSuchMethod( + Invocation.getter(#backupFrequencyType), + returnValue: _i18.BackupFrequencyType.everyTenMinutes, + ) + as _i18.BackupFrequencyType); @override - bool get useBiometrics => (super.noSuchMethod( - Invocation.getter(#useBiometrics), - returnValue: false, - ) as bool); + bool get hideBlockExplorerWarning => + (super.noSuchMethod( + Invocation.getter(#hideBlockExplorerWarning), + returnValue: false, + ) + as bool); @override - set useBiometrics(bool? useBiometrics) => super.noSuchMethod( - Invocation.setter( - #useBiometrics, - useBiometrics, - ), - returnValueForMissingStub: null, - ); + bool get gotoWalletOnStartup => + (super.noSuchMethod( + Invocation.getter(#gotoWalletOnStartup), + returnValue: false, + ) + as bool); @override - bool get hasPin => (super.noSuchMethod( - Invocation.getter(#hasPin), - returnValue: false, - ) as bool); + bool get externalCalls => + (super.noSuchMethod(Invocation.getter(#externalCalls), returnValue: false) + as bool); @override - set hasPin(bool? hasPin) => super.noSuchMethod( - Invocation.setter( - #hasPin, - hasPin, - ), - returnValueForMissingStub: null, - ); + bool get enableCoinControl => + (super.noSuchMethod( + Invocation.getter(#enableCoinControl), + returnValue: false, + ) + as bool); @override - bool get hasDuressPin => (super.noSuchMethod( - Invocation.getter(#hasDuressPin), - returnValue: false, - ) as bool); + bool get enableSystemBrightness => + (super.noSuchMethod( + Invocation.getter(#enableSystemBrightness), + returnValue: false, + ) + as bool); @override - set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( - Invocation.setter( - #hasDuressPin, - hasDuressPin, - ), - returnValueForMissingStub: null, - ); + String get themeId => + (super.noSuchMethod( + Invocation.getter(#themeId), + returnValue: _i17.dummyValue( + this, + Invocation.getter(#themeId), + ), + ) + as String); @override - bool get biometricsDuress => (super.noSuchMethod( - Invocation.getter(#biometricsDuress), - returnValue: false, - ) as bool); + String get systemBrightnessLightThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessLightThemeId), + returnValue: _i17.dummyValue( + this, + Invocation.getter(#systemBrightnessLightThemeId), + ), + ) + as String); @override - set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( - Invocation.setter( - #biometricsDuress, - biometricsDuress, - ), - returnValueForMissingStub: null, - ); + String get systemBrightnessDarkThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessDarkThemeId), + returnValue: _i17.dummyValue( + this, + Invocation.getter(#systemBrightnessDarkThemeId), + ), + ) + as String); @override - int get familiarity => (super.noSuchMethod( - Invocation.getter(#familiarity), - returnValue: 0, - ) as int); + bool get useTor => + (super.noSuchMethod(Invocation.getter(#useTor), returnValue: false) + as bool); @override - set familiarity(int? familiarity) => super.noSuchMethod( - Invocation.setter( - #familiarity, - familiarity, - ), - returnValueForMissingStub: null, - ); + bool get autoPin => + (super.noSuchMethod(Invocation.getter(#autoPin), returnValue: false) + as bool); @override - bool get torKillSwitch => (super.noSuchMethod( - Invocation.getter(#torKillSwitch), - returnValue: false, - ) as bool); + bool get enableExchange => + (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) + as bool); @override - set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( - Invocation.setter( - #torKillSwitch, - torKillswitch, - ), - returnValueForMissingStub: null, - ); + bool get advancedFiroFeatures => + (super.noSuchMethod( + Invocation.getter(#advancedFiroFeatures), + returnValue: false, + ) + as bool); @override - bool get showTestNetCoins => (super.noSuchMethod( - Invocation.getter(#showTestNetCoins), - returnValue: false, - ) as bool); + _i19.Level get logLevel => + (super.noSuchMethod( + Invocation.getter(#logLevel), + returnValue: _i19.Level.all, + ) + as _i19.Level); @override - set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( - Invocation.setter( - #showTestNetCoins, - showTestNetCoins, - ), - returnValueForMissingStub: null, - ); + ({bool enabled, int minutes}) get autoLockInfo => + (super.noSuchMethod( + Invocation.getter(#autoLockInfo), + returnValue: (enabled: false, minutes: 0), + ) + as ({bool enabled, int minutes})); @override - bool get isAutoBackupEnabled => (super.noSuchMethod( - Invocation.getter(#isAutoBackupEnabled), - returnValue: false, - ) as bool); + set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + Invocation.setter(#lastUnlockedTimeout, lastUnlockedTimeout), + returnValueForMissingStub: null, + ); @override - set isAutoBackupEnabled(bool? isAutoBackupEnabled) => super.noSuchMethod( - Invocation.setter( - #isAutoBackupEnabled, - isAutoBackupEnabled, - ), - returnValueForMissingStub: null, - ); + set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + Invocation.setter(#lastUnlocked, lastUnlocked), + returnValueForMissingStub: null, + ); @override - set autoBackupLocation(String? autoBackupLocation) => super.noSuchMethod( - Invocation.setter( - #autoBackupLocation, - autoBackupLocation, - ), + set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => + super.noSuchMethod( + Invocation.setter(#walletIdsSyncOnStartup, walletIdsSyncOnStartup), returnValueForMissingStub: null, ); @override - _i18.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( - Invocation.getter(#backupFrequencyType), - returnValue: _i18.BackupFrequencyType.everyTenMinutes, - ) as _i18.BackupFrequencyType); + set syncType(_i16.SyncingType? syncType) => super.noSuchMethod( + Invocation.setter(#syncType, syncType), + returnValueForMissingStub: null, + ); @override - set backupFrequencyType(_i18.BackupFrequencyType? backupFrequencyType) => - super.noSuchMethod( - Invocation.setter( - #backupFrequencyType, - backupFrequencyType, - ), - returnValueForMissingStub: null, - ); + set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + Invocation.setter(#wifiOnly, wifiOnly), + returnValueForMissingStub: null, + ); @override - set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( - Invocation.setter( - #lastAutoBackup, - lastAutoBackup, - ), - returnValueForMissingStub: null, - ); + set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( + Invocation.setter(#showFavoriteWallets, showFavoriteWallets), + returnValueForMissingStub: null, + ); @override - bool get hideBlockExplorerWarning => (super.noSuchMethod( - Invocation.getter(#hideBlockExplorerWarning), - returnValue: false, - ) as bool); + set language(String? newLanguage) => super.noSuchMethod( + Invocation.setter(#language, newLanguage), + returnValueForMissingStub: null, + ); @override - set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => - super.noSuchMethod( - Invocation.setter( - #hideBlockExplorerWarning, - hideBlockExplorerWarning, - ), - returnValueForMissingStub: null, - ); + set currency(String? newCurrency) => super.noSuchMethod( + Invocation.setter(#currency, newCurrency), + returnValueForMissingStub: null, + ); @override - bool get gotoWalletOnStartup => (super.noSuchMethod( - Invocation.getter(#gotoWalletOnStartup), - returnValue: false, - ) as bool); + set randomizePIN(bool? randomizePIN) => super.noSuchMethod( + Invocation.setter(#randomizePIN, randomizePIN), + returnValueForMissingStub: null, + ); @override - set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( - Invocation.setter( - #gotoWalletOnStartup, - gotoWalletOnStartup, - ), - returnValueForMissingStub: null, - ); + set useBiometrics(bool? useBiometrics) => super.noSuchMethod( + Invocation.setter(#useBiometrics, useBiometrics), + returnValueForMissingStub: null, + ); @override - set startupWalletId(String? startupWalletId) => super.noSuchMethod( - Invocation.setter( - #startupWalletId, - startupWalletId, - ), - returnValueForMissingStub: null, - ); + set hasPin(bool? hasPin) => super.noSuchMethod( + Invocation.setter(#hasPin, hasPin), + returnValueForMissingStub: null, + ); @override - bool get externalCalls => (super.noSuchMethod( - Invocation.getter(#externalCalls), - returnValue: false, - ) as bool); + set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( + Invocation.setter(#hasDuressPin, hasDuressPin), + returnValueForMissingStub: null, + ); @override - set externalCalls(bool? externalCalls) => super.noSuchMethod( - Invocation.setter( - #externalCalls, - externalCalls, - ), - returnValueForMissingStub: null, - ); + set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( + Invocation.setter(#biometricsDuress, biometricsDuress), + returnValueForMissingStub: null, + ); @override - bool get enableCoinControl => (super.noSuchMethod( - Invocation.getter(#enableCoinControl), - returnValue: false, - ) as bool); + set familiarity(int? familiarity) => super.noSuchMethod( + Invocation.setter(#familiarity, familiarity), + returnValueForMissingStub: null, + ); @override - set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( - Invocation.setter( - #enableCoinControl, - enableCoinControl, - ), + set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( + Invocation.setter(#torKillSwitch, torKillswitch), + returnValueForMissingStub: null, + ); + + @override + set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( + Invocation.setter(#showTestNetCoins, showTestNetCoins), + returnValueForMissingStub: null, + ); + + @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 + set backupFrequencyType(_i18.BackupFrequencyType? backupFrequencyType) => + super.noSuchMethod( + Invocation.setter(#backupFrequencyType, backupFrequencyType), returnValueForMissingStub: null, ); @override - bool get enableSystemBrightness => (super.noSuchMethod( - Invocation.getter(#enableSystemBrightness), - returnValue: false, - ) as bool); + set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( + Invocation.setter(#lastAutoBackup, lastAutoBackup), + returnValueForMissingStub: null, + ); @override - set enableSystemBrightness(bool? enableSystemBrightness) => + set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => super.noSuchMethod( - Invocation.setter( - #enableSystemBrightness, - enableSystemBrightness, - ), + Invocation.setter(#hideBlockExplorerWarning, hideBlockExplorerWarning), returnValueForMissingStub: null, ); @override - String get themeId => (super.noSuchMethod( - Invocation.getter(#themeId), - returnValue: _i17.dummyValue( - this, - Invocation.getter(#themeId), - ), - ) as String); + set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( + Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup), + returnValueForMissingStub: null, + ); @override - set themeId(String? themeId) => super.noSuchMethod( - Invocation.setter( - #themeId, - themeId, - ), + set startupWalletId(String? startupWalletId) => super.noSuchMethod( + Invocation.setter(#startupWalletId, startupWalletId), + returnValueForMissingStub: null, + ); + + @override + set externalCalls(bool? externalCalls) => super.noSuchMethod( + Invocation.setter(#externalCalls, externalCalls), + returnValueForMissingStub: null, + ); + + @override + set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( + Invocation.setter(#enableCoinControl, enableCoinControl), + returnValueForMissingStub: null, + ); + + @override + set enableSystemBrightness(bool? enableSystemBrightness) => + super.noSuchMethod( + Invocation.setter(#enableSystemBrightness, enableSystemBrightness), returnValueForMissingStub: null, ); @override - String get systemBrightnessLightThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessLightThemeId), - returnValue: _i17.dummyValue( - this, - Invocation.getter(#systemBrightnessLightThemeId), - ), - ) as String); + set themeId(String? themeId) => super.noSuchMethod( + Invocation.setter(#themeId, themeId), + returnValueForMissingStub: null, + ); @override set systemBrightnessLightThemeId(String? systemBrightnessLightThemeId) => @@ -802,15 +727,6 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { returnValueForMissingStub: null, ); - @override - String get systemBrightnessDarkThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessDarkThemeId), - returnValue: _i17.dummyValue( - this, - Invocation.getter(#systemBrightnessDarkThemeId), - ), - ) as String); - @override set systemBrightnessDarkThemeId(String? systemBrightnessDarkThemeId) => super.noSuchMethod( @@ -821,280 +737,181 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { returnValueForMissingStub: null, ); - @override - bool get useTor => (super.noSuchMethod( - Invocation.getter(#useTor), - returnValue: false, - ) as bool); - @override set useTor(bool? useTor) => super.noSuchMethod( - Invocation.setter( - #useTor, - useTor, - ), - returnValueForMissingStub: null, - ); - - @override - bool get autoPin => (super.noSuchMethod( - Invocation.getter(#autoPin), - returnValue: false, - ) as bool); + Invocation.setter(#useTor, useTor), + returnValueForMissingStub: null, + ); @override set autoPin(bool? autoPin) => super.noSuchMethod( - Invocation.setter( - #autoPin, - autoPin, - ), - returnValueForMissingStub: null, - ); - - @override - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); + Invocation.setter(#autoPin, autoPin), + returnValueForMissingStub: null, + ); @override set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), - returnValueForMissingStub: null, - ); - - @override -<<<<<<< - bool get advancedFiroFeatures => (super.noSuchMethod( - Invocation.getter(#advancedFiroFeatures), - returnValue: false, - ) as bool); + Invocation.setter(#enableExchange, showExchange), + returnValueForMissingStub: null, + ); @override set advancedFiroFeatures(bool? advancedFiroFeatures) => super.noSuchMethod( - Invocation.setter( - #advancedFiroFeatures, - advancedFiroFeatures, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#advancedFiroFeatures, advancedFiroFeatures), + returnValueForMissingStub: null, + ); @override set logsPath(String? logsPath) => super.noSuchMethod( - Invocation.setter( - #logsPath, - logsPath, - ), - returnValueForMissingStub: null, - ); - - @override - _i19.Level get logLevel => (super.noSuchMethod( - Invocation.getter(#logLevel), - returnValue: _i19.Level.all, - ) as _i19.Level); + Invocation.setter(#logsPath, logsPath), + returnValueForMissingStub: null, + ); @override set logLevel(_i19.Level? logLevel) => super.noSuchMethod( - Invocation.setter( - #logLevel, - logLevel, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#logLevel, logLevel), + returnValueForMissingStub: null, + ); @override -======= - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); - @override - set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), + set autoLockInfo(({bool enabled, int minutes})? autoLockInfo) => + super.noSuchMethod( + Invocation.setter(#autoLockInfo, autoLockInfo), returnValueForMissingStub: null, ); + @override ->>>>>>> - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future init() => (super.noSuchMethod( - Invocation.method( - #init, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future init() => + (super.noSuchMethod( + Invocation.method(#init, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( - Invocation.method( - #incrementCurrentNotificationIndex, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future incrementCurrentNotificationIndex() => + (super.noSuchMethod( + Invocation.method(#incrementCurrentNotificationIndex, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future isExternalCallsSet() => (super.noSuchMethod( - Invocation.method( - #isExternalCallsSet, - [], - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + _i10.Future isExternalCallsSet() => + (super.noSuchMethod( + Invocation.method(#isExternalCallsSet, []), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override - _i10.Future saveUserID(String? userId) => (super.noSuchMethod( - Invocation.method( - #saveUserID, - [userId], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveUserID(String? userId) => + (super.noSuchMethod( + Invocation.method(#saveUserID, [userId]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( - Invocation.method( - #saveSignupEpoch, - [signupEpoch], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveSignupEpoch(int? signupEpoch) => + (super.noSuchMethod( + Invocation.method(#saveSignupEpoch, [signupEpoch]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i20.AmountUnit amountUnit(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #amountUnit, - [coin], - ), - returnValue: _i20.AmountUnit.normal, - ) as _i20.AmountUnit); + _i20.AmountUnit amountUnit(_i4.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#amountUnit, [coin]), + returnValue: _i20.AmountUnit.normal, + ) + as _i20.AmountUnit); @override void updateAmountUnit({ required _i4.CryptoCurrency? coin, required _i20.AmountUnit? amountUnit, - }) => - super.noSuchMethod( - Invocation.method( - #updateAmountUnit, - [], - { - #coin: coin, - #amountUnit: amountUnit, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateAmountUnit, [], { + #coin: coin, + #amountUnit: amountUnit, + }), + returnValueForMissingStub: null, + ); @override - int maxDecimals(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #maxDecimals, - [coin], - ), - returnValue: 0, - ) as int); + int maxDecimals(_i4.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#maxDecimals, [coin]), + returnValue: 0, + ) + as int); @override void updateMaxDecimals({ required _i4.CryptoCurrency? coin, required int? maxDecimals, - }) => - super.noSuchMethod( - Invocation.method( - #updateMaxDecimals, - [], - { - #coin: coin, - #maxDecimals: maxDecimals, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateMaxDecimals, [], { + #coin: coin, + #maxDecimals: maxDecimals, + }), + returnValueForMissingStub: null, + ); @override _i7.FusionInfo getFusionServerInfo(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getFusionServerInfo, - [coin], - ), - returnValue: _FakeFusionInfo_4( - this, - Invocation.method( - #getFusionServerInfo, - [coin], - ), - ), - ) as _i7.FusionInfo); + Invocation.method(#getFusionServerInfo, [coin]), + returnValue: _FakeFusionInfo_4( + this, + Invocation.method(#getFusionServerInfo, [coin]), + ), + ) + as _i7.FusionInfo); @override void setFusionServerInfo( _i4.CryptoCurrency? coin, _i7.FusionInfo? fusionServerInfo, - ) => - super.noSuchMethod( - Invocation.method( - #setFusionServerInfo, - [ - coin, - fusionServerInfo, - ], - ), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#setFusionServerInfo, [coin, fusionServerInfo]), + returnValueForMissingStub: null, + ); @override void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [LocaleService]. @@ -1106,66 +923,53 @@ class MockLocaleService extends _i1.Mock implements _i22.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i17.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i17.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [NodeService]. @@ -1177,41 +981,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { } @override - _i8.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_5( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i8.SecureStorageInterface); + _i8.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_5( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i8.SecureStorageInterface); @override - List<_i23.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i23.NodeModel>[], - ) as List<_i23.NodeModel>); + List<_i23.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i23.NodeModel>[], + ) + as List<_i23.NodeModel>); @override - List<_i23.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i23.NodeModel>[], - ) as List<_i23.NodeModel>); + List<_i23.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i23.NodeModel>[], + ) + as List<_i23.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future setPrimaryNodeFor({ @@ -1220,56 +1028,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i23.NodeModel? getPrimaryNodeFor({required _i4.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i23.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i23.NodeModel?); @override List<_i23.NodeModel> getNodesFor(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i23.NodeModel>[], - ) as List<_i23.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i23.NodeModel>[], + ) + as List<_i23.NodeModel>); @override _i23.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i23.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i23.NodeModel?); @override - List<_i23.NodeModel> failoverNodesFor( - {required _i4.CryptoCurrency? currency}) => + List<_i23.NodeModel> failoverNodesFor({ + required _i4.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i23.NodeModel>[], - ) as List<_i23.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i23.NodeModel>[], + ) + as List<_i23.NodeModel>); @override _i10.Future save( @@ -1278,34 +1075,20 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + _i10.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future setEnabledState( @@ -1314,61 +1097,46 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); - - @override - _i10.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); + + @override + _i10.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } diff --git a/test/widget_tests/node_card_test.mocks.dart b/test/widget_tests/node_card_test.mocks.dart index 19c8c5166a..a279b9bd3d 100644 --- a/test/widget_tests/node_card_test.mocks.dart +++ b/test/widget_tests/node_card_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/node_card_test.dart. // Do not manually edit this file. @@ -22,20 +22,17 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeSecureStorageInterface_0 extends _i1.SmartFake implements _i2.SecureStorageInterface { - _FakeSecureStorageInterface_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [NodeService]. @@ -47,41 +44,45 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { } @override - _i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_0( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i2.SecureStorageInterface); + _i2.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_0( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i2.SecureStorageInterface); @override - List<_i4.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + List<_i4.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override - List<_i4.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + List<_i4.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i5.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setPrimaryNodeFor({ @@ -90,56 +91,45 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i4.NodeModel? getPrimaryNodeFor({required _i6.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i4.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i4.NodeModel?); @override List<_i4.NodeModel> getNodesFor(_i6.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override _i4.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i4.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i4.NodeModel?); @override - List<_i4.NodeModel> failoverNodesFor( - {required _i6.CryptoCurrency? currency}) => + List<_i4.NodeModel> failoverNodesFor({ + required _i6.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i4.NodeModel>[], - ) as List<_i4.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i4.NodeModel>[], + ) + as List<_i4.NodeModel>); @override _i5.Future save( @@ -148,34 +138,20 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setEnabledState( @@ -184,61 +160,46 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } diff --git a/test/widget_tests/node_options_sheet_test.mocks.dart b/test/widget_tests/node_options_sheet_test.mocks.dart index 5d31195e2b..23b04ffd95 100644 --- a/test/widget_tests/node_options_sheet_test.mocks.dart +++ b/test/widget_tests/node_options_sheet_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/node_options_sheet_test.dart. // Do not manually edit this file. @@ -39,72 +39,44 @@ import 'package:tor_ffi_plugin/tor_ffi_plugin.dart' as _i22; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeNodeService_0 extends _i1.SmartFake implements _i2.NodeService { - _FakeNodeService_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeNodeService_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMainDB_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWallet_2 extends _i1.SmartFake implements _i5.Wallet { - _FakeWallet_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWallet_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFusionInfo_3 extends _i1.SmartFake implements _i6.FusionInfo { - _FakeFusionInfo_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFusionInfo_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSecureStorageInterface_4 extends _i1.SmartFake implements _i7.SecureStorageInterface { - _FakeSecureStorageInterface_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeInternetAddress_5 extends _i1.SmartFake implements _i8.InternetAddress { - _FakeInternetAddress_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeInternetAddress_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Wallets]. @@ -116,71 +88,60 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { } @override - _i2.NodeService get nodeService => (super.noSuchMethod( - Invocation.getter(#nodeService), - returnValue: _FakeNodeService_0( - this, - Invocation.getter(#nodeService), - ), - ) as _i2.NodeService); + _i2.NodeService get nodeService => + (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_0( + this, + Invocation.getter(#nodeService), + ), + ) + as _i2.NodeService); @override - set nodeService(_i2.NodeService? _nodeService) => super.noSuchMethod( - Invocation.setter( - #nodeService, - _nodeService, - ), - returnValueForMissingStub: null, - ); + _i3.MainDB get mainDB => + (super.noSuchMethod( + Invocation.getter(#mainDB), + returnValue: _FakeMainDB_1(this, Invocation.getter(#mainDB)), + ) + as _i3.MainDB); @override - _i3.MainDB get mainDB => (super.noSuchMethod( - Invocation.getter(#mainDB), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#mainDB), - ), - ) as _i3.MainDB); + List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => + (super.noSuchMethod( + Invocation.getter(#wallets), + returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], + ) + as List<_i5.Wallet<_i4.CryptoCurrency>>); @override - set mainDB(_i3.MainDB? _mainDB) => super.noSuchMethod( - Invocation.setter( - #mainDB, - _mainDB, - ), - returnValueForMissingStub: null, - ); + set nodeService(_i2.NodeService? value) => super.noSuchMethod( + Invocation.setter(#nodeService, value), + returnValueForMissingStub: null, + ); @override - List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => (super.noSuchMethod( - Invocation.getter(#wallets), - returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], - ) as List<_i5.Wallet<_i4.CryptoCurrency>>); + set mainDB(_i3.MainDB? value) => super.noSuchMethod( + Invocation.setter(#mainDB, value), + returnValueForMissingStub: null, + ); @override _i5.Wallet<_i4.CryptoCurrency> getWallet(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getWallet, - [walletId], - ), - returnValue: _FakeWallet_2<_i4.CryptoCurrency>( - this, - Invocation.method( - #getWallet, - [walletId], - ), - ), - ) as _i5.Wallet<_i4.CryptoCurrency>); + Invocation.method(#getWallet, [walletId]), + returnValue: _FakeWallet_2<_i4.CryptoCurrency>( + this, + Invocation.method(#getWallet, [walletId]), + ), + ) + as _i5.Wallet<_i4.CryptoCurrency>); @override void addWallet(_i5.Wallet<_i4.CryptoCurrency>? wallet) => super.noSuchMethod( - Invocation.method( - #addWallet, - [wallet], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addWallet, [wallet]), + returnValueForMissingStub: null, + ); @override _i10.Future deleteWallet( @@ -188,16 +149,11 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { _i7.SecureStorageInterface? secureStorage, ) => (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - info, - secureStorage, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#deleteWallet, [info, secureStorage]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future load( @@ -206,17 +162,11 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { bool? isDuress, ) => (super.noSuchMethod( - Invocation.method( - #load, - [ - prefs, - mainDB, - isDuress, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#load, [prefs, mainDB, isDuress]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future loadAfterStackRestore( @@ -225,17 +175,15 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { bool? isDesktop, ) => (super.noSuchMethod( - Invocation.method( - #loadAfterStackRestore, - [ - prefs, - wallets, - isDesktop, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#loadAfterStackRestore, [ + prefs, + wallets, + isDesktop, + ]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); } /// A class which mocks [Prefs]. @@ -247,425 +195,421 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { } @override - bool get isInitialized => (super.noSuchMethod( - Invocation.getter(#isInitialized), - returnValue: false, - ) as bool); + 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); + 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, - ); + int get lastUnlocked => + (super.noSuchMethod(Invocation.getter(#lastUnlocked), returnValue: 0) + as int); @override - int get lastUnlocked => (super.noSuchMethod( - Invocation.getter(#lastUnlocked), - returnValue: 0, - ) as int); + int get currentNotificationId => + (super.noSuchMethod( + Invocation.getter(#currentNotificationId), + returnValue: 0, + ) + as int); @override - set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( - Invocation.setter( - #lastUnlocked, - lastUnlocked, - ), - returnValueForMissingStub: null, - ); + List get walletIdsSyncOnStartup => + (super.noSuchMethod( + Invocation.getter(#walletIdsSyncOnStartup), + returnValue: [], + ) + as List); @override - int get currentNotificationId => (super.noSuchMethod( - Invocation.getter(#currentNotificationId), - returnValue: 0, - ) as int); + _i13.SyncingType get syncType => + (super.noSuchMethod( + Invocation.getter(#syncType), + returnValue: _i13.SyncingType.currentWalletOnly, + ) + as _i13.SyncingType); @override - List get walletIdsSyncOnStartup => (super.noSuchMethod( - Invocation.getter(#walletIdsSyncOnStartup), - returnValue: [], - ) as List); + bool get wifiOnly => + (super.noSuchMethod(Invocation.getter(#wifiOnly), returnValue: false) + as bool); @override - set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => - super.noSuchMethod( - Invocation.setter( - #walletIdsSyncOnStartup, - walletIdsSyncOnStartup, - ), - returnValueForMissingStub: null, - ); + bool get showFavoriteWallets => + (super.noSuchMethod( + Invocation.getter(#showFavoriteWallets), + returnValue: false, + ) + as bool); @override - _i13.SyncingType get syncType => (super.noSuchMethod( - Invocation.getter(#syncType), - returnValue: _i13.SyncingType.currentWalletOnly, - ) as _i13.SyncingType); + String get language => + (super.noSuchMethod( + Invocation.getter(#language), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#language), + ), + ) + as String); @override - set syncType(_i13.SyncingType? syncType) => super.noSuchMethod( - Invocation.setter( - #syncType, - syncType, - ), - returnValueForMissingStub: null, - ); + String get currency => + (super.noSuchMethod( + Invocation.getter(#currency), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#currency), + ), + ) + as String); @override - bool get wifiOnly => (super.noSuchMethod( - Invocation.getter(#wifiOnly), - returnValue: false, - ) as bool); + bool get randomizePIN => + (super.noSuchMethod(Invocation.getter(#randomizePIN), returnValue: false) + as bool); @override - set wifiOnly(bool? wifiOnly) => super.noSuchMethod( - Invocation.setter( - #wifiOnly, - wifiOnly, - ), - returnValueForMissingStub: null, - ); + bool get useBiometrics => + (super.noSuchMethod(Invocation.getter(#useBiometrics), returnValue: false) + as bool); @override - bool get showFavoriteWallets => (super.noSuchMethod( - Invocation.getter(#showFavoriteWallets), - returnValue: false, - ) as bool); + bool get hasPin => + (super.noSuchMethod(Invocation.getter(#hasPin), returnValue: false) + as bool); @override - set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( - Invocation.setter( - #showFavoriteWallets, - showFavoriteWallets, - ), - returnValueForMissingStub: null, - ); + bool get hasDuressPin => + (super.noSuchMethod(Invocation.getter(#hasDuressPin), returnValue: false) + as bool); @override - String get language => (super.noSuchMethod( - Invocation.getter(#language), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#language), - ), - ) as String); + bool get biometricsDuress => + (super.noSuchMethod( + Invocation.getter(#biometricsDuress), + returnValue: false, + ) + as bool); @override - set language(String? newLanguage) => super.noSuchMethod( - Invocation.setter( - #language, - newLanguage, - ), - returnValueForMissingStub: null, - ); + int get familiarity => + (super.noSuchMethod(Invocation.getter(#familiarity), returnValue: 0) + as int); @override - String get currency => (super.noSuchMethod( - Invocation.getter(#currency), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#currency), - ), - ) as String); + bool get torKillSwitch => + (super.noSuchMethod(Invocation.getter(#torKillSwitch), returnValue: false) + as bool); @override - set currency(String? newCurrency) => super.noSuchMethod( - Invocation.setter( - #currency, - newCurrency, - ), - returnValueForMissingStub: null, - ); + bool get showTestNetCoins => + (super.noSuchMethod( + Invocation.getter(#showTestNetCoins), + returnValue: false, + ) + as bool); @override - bool get randomizePIN => (super.noSuchMethod( - Invocation.getter(#randomizePIN), - returnValue: false, - ) as bool); + bool get isAutoBackupEnabled => + (super.noSuchMethod( + Invocation.getter(#isAutoBackupEnabled), + returnValue: false, + ) + as bool); @override - set randomizePIN(bool? randomizePIN) => super.noSuchMethod( - Invocation.setter( - #randomizePIN, - randomizePIN, - ), - returnValueForMissingStub: null, - ); + _i15.BackupFrequencyType get backupFrequencyType => + (super.noSuchMethod( + Invocation.getter(#backupFrequencyType), + returnValue: _i15.BackupFrequencyType.everyTenMinutes, + ) + as _i15.BackupFrequencyType); @override - bool get useBiometrics => (super.noSuchMethod( - Invocation.getter(#useBiometrics), - returnValue: false, - ) as bool); + bool get hideBlockExplorerWarning => + (super.noSuchMethod( + Invocation.getter(#hideBlockExplorerWarning), + returnValue: false, + ) + as bool); @override - set useBiometrics(bool? useBiometrics) => super.noSuchMethod( - Invocation.setter( - #useBiometrics, - useBiometrics, - ), - returnValueForMissingStub: null, - ); + bool get gotoWalletOnStartup => + (super.noSuchMethod( + Invocation.getter(#gotoWalletOnStartup), + returnValue: false, + ) + as bool); @override - bool get hasPin => (super.noSuchMethod( - Invocation.getter(#hasPin), - returnValue: false, - ) as bool); + bool get externalCalls => + (super.noSuchMethod(Invocation.getter(#externalCalls), returnValue: false) + as bool); @override - set hasPin(bool? hasPin) => super.noSuchMethod( - Invocation.setter( - #hasPin, - hasPin, - ), - returnValueForMissingStub: null, - ); + bool get enableCoinControl => + (super.noSuchMethod( + Invocation.getter(#enableCoinControl), + returnValue: false, + ) + as bool); @override - bool get hasDuressPin => (super.noSuchMethod( - Invocation.getter(#hasDuressPin), - returnValue: false, - ) as bool); + bool get enableSystemBrightness => + (super.noSuchMethod( + Invocation.getter(#enableSystemBrightness), + returnValue: false, + ) + as bool); @override - set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( - Invocation.setter( - #hasDuressPin, - hasDuressPin, - ), - returnValueForMissingStub: null, - ); + String get themeId => + (super.noSuchMethod( + Invocation.getter(#themeId), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#themeId), + ), + ) + as String); @override - bool get biometricsDuress => (super.noSuchMethod( - Invocation.getter(#biometricsDuress), - returnValue: false, - ) as bool); + String get systemBrightnessLightThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessLightThemeId), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#systemBrightnessLightThemeId), + ), + ) + as String); @override - set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( - Invocation.setter( - #biometricsDuress, - biometricsDuress, - ), - returnValueForMissingStub: null, - ); + String get systemBrightnessDarkThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessDarkThemeId), + returnValue: _i14.dummyValue( + this, + Invocation.getter(#systemBrightnessDarkThemeId), + ), + ) + as String); @override - int get familiarity => (super.noSuchMethod( - Invocation.getter(#familiarity), - returnValue: 0, - ) as int); + bool get useTor => + (super.noSuchMethod(Invocation.getter(#useTor), returnValue: false) + as bool); @override - set familiarity(int? familiarity) => super.noSuchMethod( - Invocation.setter( - #familiarity, - familiarity, - ), - returnValueForMissingStub: null, - ); + bool get autoPin => + (super.noSuchMethod(Invocation.getter(#autoPin), returnValue: false) + as bool); @override - bool get torKillSwitch => (super.noSuchMethod( - Invocation.getter(#torKillSwitch), - returnValue: false, - ) as bool); + bool get enableExchange => + (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) + as bool); @override - set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( - Invocation.setter( - #torKillSwitch, - torKillswitch, - ), - returnValueForMissingStub: null, - ); + bool get advancedFiroFeatures => + (super.noSuchMethod( + Invocation.getter(#advancedFiroFeatures), + returnValue: false, + ) + as bool); @override - bool get showTestNetCoins => (super.noSuchMethod( - Invocation.getter(#showTestNetCoins), - returnValue: false, - ) as bool); + _i16.Level get logLevel => + (super.noSuchMethod( + Invocation.getter(#logLevel), + returnValue: _i16.Level.all, + ) + as _i16.Level); @override - set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( - Invocation.setter( - #showTestNetCoins, - showTestNetCoins, - ), - returnValueForMissingStub: null, - ); + ({bool enabled, int minutes}) get autoLockInfo => + (super.noSuchMethod( + Invocation.getter(#autoLockInfo), + returnValue: (enabled: false, minutes: 0), + ) + as ({bool enabled, int minutes})); @override - bool get isAutoBackupEnabled => (super.noSuchMethod( - Invocation.getter(#isAutoBackupEnabled), - returnValue: false, - ) as bool); + set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + Invocation.setter(#lastUnlockedTimeout, lastUnlockedTimeout), + returnValueForMissingStub: null, + ); @override - set isAutoBackupEnabled(bool? isAutoBackupEnabled) => super.noSuchMethod( - Invocation.setter( - #isAutoBackupEnabled, - isAutoBackupEnabled, - ), - returnValueForMissingStub: null, - ); + set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + Invocation.setter(#lastUnlocked, lastUnlocked), + returnValueForMissingStub: null, + ); @override - set autoBackupLocation(String? autoBackupLocation) => super.noSuchMethod( - Invocation.setter( - #autoBackupLocation, - autoBackupLocation, - ), + set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => + super.noSuchMethod( + Invocation.setter(#walletIdsSyncOnStartup, walletIdsSyncOnStartup), returnValueForMissingStub: null, ); @override - _i15.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( - Invocation.getter(#backupFrequencyType), - returnValue: _i15.BackupFrequencyType.everyTenMinutes, - ) as _i15.BackupFrequencyType); + set syncType(_i13.SyncingType? syncType) => super.noSuchMethod( + Invocation.setter(#syncType, syncType), + returnValueForMissingStub: null, + ); @override - set backupFrequencyType(_i15.BackupFrequencyType? backupFrequencyType) => - super.noSuchMethod( - Invocation.setter( - #backupFrequencyType, - backupFrequencyType, - ), - returnValueForMissingStub: null, - ); + set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + Invocation.setter(#wifiOnly, wifiOnly), + returnValueForMissingStub: null, + ); @override - set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( - Invocation.setter( - #lastAutoBackup, - lastAutoBackup, - ), - returnValueForMissingStub: null, - ); + set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( + Invocation.setter(#showFavoriteWallets, showFavoriteWallets), + returnValueForMissingStub: null, + ); @override - bool get hideBlockExplorerWarning => (super.noSuchMethod( - Invocation.getter(#hideBlockExplorerWarning), - returnValue: false, - ) as bool); + set language(String? newLanguage) => super.noSuchMethod( + Invocation.setter(#language, newLanguage), + returnValueForMissingStub: null, + ); @override - set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => - super.noSuchMethod( - Invocation.setter( - #hideBlockExplorerWarning, - hideBlockExplorerWarning, - ), - returnValueForMissingStub: null, - ); + set currency(String? newCurrency) => super.noSuchMethod( + Invocation.setter(#currency, newCurrency), + returnValueForMissingStub: null, + ); @override - bool get gotoWalletOnStartup => (super.noSuchMethod( - Invocation.getter(#gotoWalletOnStartup), - returnValue: false, - ) as bool); + set randomizePIN(bool? randomizePIN) => super.noSuchMethod( + Invocation.setter(#randomizePIN, randomizePIN), + returnValueForMissingStub: null, + ); @override - set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( - Invocation.setter( - #gotoWalletOnStartup, - gotoWalletOnStartup, - ), - returnValueForMissingStub: null, - ); + set useBiometrics(bool? useBiometrics) => super.noSuchMethod( + Invocation.setter(#useBiometrics, useBiometrics), + returnValueForMissingStub: null, + ); @override - set startupWalletId(String? startupWalletId) => super.noSuchMethod( - Invocation.setter( - #startupWalletId, - startupWalletId, - ), - returnValueForMissingStub: null, - ); + set hasPin(bool? hasPin) => super.noSuchMethod( + Invocation.setter(#hasPin, hasPin), + returnValueForMissingStub: null, + ); @override - bool get externalCalls => (super.noSuchMethod( - Invocation.getter(#externalCalls), - returnValue: false, - ) as bool); + set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( + Invocation.setter(#hasDuressPin, hasDuressPin), + returnValueForMissingStub: null, + ); @override - set externalCalls(bool? externalCalls) => super.noSuchMethod( - Invocation.setter( - #externalCalls, - externalCalls, - ), - returnValueForMissingStub: null, - ); + set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( + Invocation.setter(#biometricsDuress, biometricsDuress), + returnValueForMissingStub: null, + ); @override - bool get enableCoinControl => (super.noSuchMethod( - Invocation.getter(#enableCoinControl), - returnValue: false, - ) as bool); + set familiarity(int? familiarity) => super.noSuchMethod( + Invocation.setter(#familiarity, familiarity), + returnValueForMissingStub: null, + ); @override - set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( - Invocation.setter( - #enableCoinControl, - enableCoinControl, - ), + set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( + Invocation.setter(#torKillSwitch, torKillswitch), + returnValueForMissingStub: null, + ); + + @override + set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( + Invocation.setter(#showTestNetCoins, showTestNetCoins), + returnValueForMissingStub: null, + ); + + @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 + set backupFrequencyType(_i15.BackupFrequencyType? backupFrequencyType) => + super.noSuchMethod( + Invocation.setter(#backupFrequencyType, backupFrequencyType), returnValueForMissingStub: null, ); @override - bool get enableSystemBrightness => (super.noSuchMethod( - Invocation.getter(#enableSystemBrightness), - returnValue: false, - ) as bool); + set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( + Invocation.setter(#lastAutoBackup, lastAutoBackup), + returnValueForMissingStub: null, + ); @override - set enableSystemBrightness(bool? enableSystemBrightness) => + set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => super.noSuchMethod( - Invocation.setter( - #enableSystemBrightness, - enableSystemBrightness, - ), + Invocation.setter(#hideBlockExplorerWarning, hideBlockExplorerWarning), returnValueForMissingStub: null, ); @override - String get themeId => (super.noSuchMethod( - Invocation.getter(#themeId), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#themeId), - ), - ) as String); + set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( + Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup), + returnValueForMissingStub: null, + ); @override - set themeId(String? themeId) => super.noSuchMethod( - Invocation.setter( - #themeId, - themeId, - ), + set startupWalletId(String? startupWalletId) => super.noSuchMethod( + Invocation.setter(#startupWalletId, startupWalletId), + returnValueForMissingStub: null, + ); + + @override + set externalCalls(bool? externalCalls) => super.noSuchMethod( + Invocation.setter(#externalCalls, externalCalls), + returnValueForMissingStub: null, + ); + + @override + set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( + Invocation.setter(#enableCoinControl, enableCoinControl), + returnValueForMissingStub: null, + ); + + @override + set enableSystemBrightness(bool? enableSystemBrightness) => + super.noSuchMethod( + Invocation.setter(#enableSystemBrightness, enableSystemBrightness), returnValueForMissingStub: null, ); @override - String get systemBrightnessLightThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessLightThemeId), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#systemBrightnessLightThemeId), - ), - ) as String); + set themeId(String? themeId) => super.noSuchMethod( + Invocation.setter(#themeId, themeId), + returnValueForMissingStub: null, + ); @override set systemBrightnessLightThemeId(String? systemBrightnessLightThemeId) => @@ -677,15 +621,6 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { returnValueForMissingStub: null, ); - @override - String get systemBrightnessDarkThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessDarkThemeId), - returnValue: _i14.dummyValue( - this, - Invocation.getter(#systemBrightnessDarkThemeId), - ), - ) as String); - @override set systemBrightnessDarkThemeId(String? systemBrightnessDarkThemeId) => super.noSuchMethod( @@ -696,280 +631,181 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs { returnValueForMissingStub: null, ); - @override - bool get useTor => (super.noSuchMethod( - Invocation.getter(#useTor), - returnValue: false, - ) as bool); - @override set useTor(bool? useTor) => super.noSuchMethod( - Invocation.setter( - #useTor, - useTor, - ), - returnValueForMissingStub: null, - ); - - @override - bool get autoPin => (super.noSuchMethod( - Invocation.getter(#autoPin), - returnValue: false, - ) as bool); + Invocation.setter(#useTor, useTor), + returnValueForMissingStub: null, + ); @override set autoPin(bool? autoPin) => super.noSuchMethod( - Invocation.setter( - #autoPin, - autoPin, - ), - returnValueForMissingStub: null, - ); - - @override - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); + Invocation.setter(#autoPin, autoPin), + returnValueForMissingStub: null, + ); @override set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), - returnValueForMissingStub: null, - ); - - @override -<<<<<<< - bool get advancedFiroFeatures => (super.noSuchMethod( - Invocation.getter(#advancedFiroFeatures), - returnValue: false, - ) as bool); + Invocation.setter(#enableExchange, showExchange), + returnValueForMissingStub: null, + ); @override set advancedFiroFeatures(bool? advancedFiroFeatures) => super.noSuchMethod( - Invocation.setter( - #advancedFiroFeatures, - advancedFiroFeatures, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#advancedFiroFeatures, advancedFiroFeatures), + returnValueForMissingStub: null, + ); @override set logsPath(String? logsPath) => super.noSuchMethod( - Invocation.setter( - #logsPath, - logsPath, - ), - returnValueForMissingStub: null, - ); - - @override - _i16.Level get logLevel => (super.noSuchMethod( - Invocation.getter(#logLevel), - returnValue: _i16.Level.all, - ) as _i16.Level); + Invocation.setter(#logsPath, logsPath), + returnValueForMissingStub: null, + ); @override set logLevel(_i16.Level? logLevel) => super.noSuchMethod( - Invocation.setter( - #logLevel, - logLevel, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#logLevel, logLevel), + returnValueForMissingStub: null, + ); @override -======= - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); - @override - set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), + set autoLockInfo(({bool enabled, int minutes})? autoLockInfo) => + super.noSuchMethod( + Invocation.setter(#autoLockInfo, autoLockInfo), returnValueForMissingStub: null, ); + @override ->>>>>>> - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future init() => (super.noSuchMethod( - Invocation.method( - #init, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future init() => + (super.noSuchMethod( + Invocation.method(#init, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( - Invocation.method( - #incrementCurrentNotificationIndex, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future incrementCurrentNotificationIndex() => + (super.noSuchMethod( + Invocation.method(#incrementCurrentNotificationIndex, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future isExternalCallsSet() => (super.noSuchMethod( - Invocation.method( - #isExternalCallsSet, - [], - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + _i10.Future isExternalCallsSet() => + (super.noSuchMethod( + Invocation.method(#isExternalCallsSet, []), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override - _i10.Future saveUserID(String? userId) => (super.noSuchMethod( - Invocation.method( - #saveUserID, - [userId], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveUserID(String? userId) => + (super.noSuchMethod( + Invocation.method(#saveUserID, [userId]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( - Invocation.method( - #saveSignupEpoch, - [signupEpoch], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveSignupEpoch(int? signupEpoch) => + (super.noSuchMethod( + Invocation.method(#saveSignupEpoch, [signupEpoch]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i17.AmountUnit amountUnit(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #amountUnit, - [coin], - ), - returnValue: _i17.AmountUnit.normal, - ) as _i17.AmountUnit); + _i17.AmountUnit amountUnit(_i4.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#amountUnit, [coin]), + returnValue: _i17.AmountUnit.normal, + ) + as _i17.AmountUnit); @override void updateAmountUnit({ required _i4.CryptoCurrency? coin, required _i17.AmountUnit? amountUnit, - }) => - super.noSuchMethod( - Invocation.method( - #updateAmountUnit, - [], - { - #coin: coin, - #amountUnit: amountUnit, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateAmountUnit, [], { + #coin: coin, + #amountUnit: amountUnit, + }), + returnValueForMissingStub: null, + ); @override - int maxDecimals(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #maxDecimals, - [coin], - ), - returnValue: 0, - ) as int); + int maxDecimals(_i4.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#maxDecimals, [coin]), + returnValue: 0, + ) + as int); @override void updateMaxDecimals({ required _i4.CryptoCurrency? coin, required int? maxDecimals, - }) => - super.noSuchMethod( - Invocation.method( - #updateMaxDecimals, - [], - { - #coin: coin, - #maxDecimals: maxDecimals, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateMaxDecimals, [], { + #coin: coin, + #maxDecimals: maxDecimals, + }), + returnValueForMissingStub: null, + ); @override _i6.FusionInfo getFusionServerInfo(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getFusionServerInfo, - [coin], - ), - returnValue: _FakeFusionInfo_3( - this, - Invocation.method( - #getFusionServerInfo, - [coin], - ), - ), - ) as _i6.FusionInfo); + Invocation.method(#getFusionServerInfo, [coin]), + returnValue: _FakeFusionInfo_3( + this, + Invocation.method(#getFusionServerInfo, [coin]), + ), + ) + as _i6.FusionInfo); @override void setFusionServerInfo( _i4.CryptoCurrency? coin, _i6.FusionInfo? fusionServerInfo, - ) => - super.noSuchMethod( - Invocation.method( - #setFusionServerInfo, - [ - coin, - fusionServerInfo, - ], - ), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#setFusionServerInfo, [coin, fusionServerInfo]), + returnValueForMissingStub: null, + ); @override void addListener(_i18.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i18.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [NodeService]. @@ -981,41 +817,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { } @override - _i7.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_4( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i7.SecureStorageInterface); + _i7.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_4( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i7.SecureStorageInterface); @override - List<_i19.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i19.NodeModel>[], - ) as List<_i19.NodeModel>); + List<_i19.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i19.NodeModel>[], + ) + as List<_i19.NodeModel>); @override - List<_i19.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i19.NodeModel>[], - ) as List<_i19.NodeModel>); + List<_i19.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i19.NodeModel>[], + ) + as List<_i19.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future setPrimaryNodeFor({ @@ -1024,56 +864,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i19.NodeModel? getPrimaryNodeFor({required _i4.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i19.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i19.NodeModel?); @override List<_i19.NodeModel> getNodesFor(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i19.NodeModel>[], - ) as List<_i19.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i19.NodeModel>[], + ) + as List<_i19.NodeModel>); @override _i19.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i19.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i19.NodeModel?); @override - List<_i19.NodeModel> failoverNodesFor( - {required _i4.CryptoCurrency? currency}) => + List<_i19.NodeModel> failoverNodesFor({ + required _i4.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i19.NodeModel>[], - ) as List<_i19.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i19.NodeModel>[], + ) + as List<_i19.NodeModel>); @override _i10.Future save( @@ -1082,34 +911,20 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + _i10.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future setEnabledState( @@ -1118,63 +933,48 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); - - @override - _i10.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); + + @override + _i10.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void addListener(_i18.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i18.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [TorService]. @@ -1186,63 +986,52 @@ class MockTorService extends _i1.Mock implements _i20.TorService { } @override - _i21.TorConnectionStatus get status => (super.noSuchMethod( - Invocation.getter(#status), - returnValue: _i21.TorConnectionStatus.disconnected, - ) as _i21.TorConnectionStatus); + _i21.TorConnectionStatus get status => + (super.noSuchMethod( + Invocation.getter(#status), + returnValue: _i21.TorConnectionStatus.disconnected, + ) + as _i21.TorConnectionStatus); @override - ({_i8.InternetAddress host, int port}) getProxyInfo() => (super.noSuchMethod( - Invocation.method( - #getProxyInfo, - [], - ), - returnValue: ( - host: _FakeInternetAddress_5( - this, - Invocation.method( - #getProxyInfo, - [], + ({_i8.InternetAddress host, int port}) getProxyInfo() => + (super.noSuchMethod( + Invocation.method(#getProxyInfo, []), + returnValue: ( + host: _FakeInternetAddress_5( + this, + Invocation.method(#getProxyInfo, []), + ), + port: 0, ), - ), - port: 0 - ), - ) as ({_i8.InternetAddress host, int port})); + ) + as ({_i8.InternetAddress host, int port})); @override - void init({ - required String? torDataDirPath, - _i22.Tor? mockableOverride, - }) => + void init({required String? torDataDirPath, _i22.Tor? mockableOverride}) => super.noSuchMethod( - Invocation.method( - #init, - [], - { - #torDataDirPath: torDataDirPath, - #mockableOverride: mockableOverride, - }, - ), + Invocation.method(#init, [], { + #torDataDirPath: torDataDirPath, + #mockableOverride: mockableOverride, + }), returnValueForMissingStub: null, ); @override - _i10.Future start() => (super.noSuchMethod( - Invocation.method( - #start, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future start() => + (super.noSuchMethod( + Invocation.method(#start, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future disable() => (super.noSuchMethod( - Invocation.method( - #disable, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future disable() => + (super.noSuchMethod( + Invocation.method(#disable, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); } 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 4d7adcad3f..68ede03296 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/table_view/table_view_row_test.dart. // Do not manually edit this file. @@ -29,50 +29,32 @@ import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeNodeService_0 extends _i1.SmartFake implements _i2.NodeService { - _FakeNodeService_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeNodeService_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMainDB_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWallet_2 extends _i1.SmartFake implements _i5.Wallet { - _FakeWallet_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWallet_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeHTTP_3 extends _i1.SmartFake implements _i6.HTTP { - _FakeHTTP_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHTTP_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Wallets]. @@ -84,71 +66,60 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { } @override - _i2.NodeService get nodeService => (super.noSuchMethod( - Invocation.getter(#nodeService), - returnValue: _FakeNodeService_0( - this, - Invocation.getter(#nodeService), - ), - ) as _i2.NodeService); + _i2.NodeService get nodeService => + (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_0( + this, + Invocation.getter(#nodeService), + ), + ) + as _i2.NodeService); @override - set nodeService(_i2.NodeService? _nodeService) => super.noSuchMethod( - Invocation.setter( - #nodeService, - _nodeService, - ), - returnValueForMissingStub: null, - ); + _i3.MainDB get mainDB => + (super.noSuchMethod( + Invocation.getter(#mainDB), + returnValue: _FakeMainDB_1(this, Invocation.getter(#mainDB)), + ) + as _i3.MainDB); @override - _i3.MainDB get mainDB => (super.noSuchMethod( - Invocation.getter(#mainDB), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#mainDB), - ), - ) as _i3.MainDB); + List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => + (super.noSuchMethod( + Invocation.getter(#wallets), + returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], + ) + as List<_i5.Wallet<_i4.CryptoCurrency>>); @override - set mainDB(_i3.MainDB? _mainDB) => super.noSuchMethod( - Invocation.setter( - #mainDB, - _mainDB, - ), - returnValueForMissingStub: null, - ); + set nodeService(_i2.NodeService? value) => super.noSuchMethod( + Invocation.setter(#nodeService, value), + returnValueForMissingStub: null, + ); @override - List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => (super.noSuchMethod( - Invocation.getter(#wallets), - returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], - ) as List<_i5.Wallet<_i4.CryptoCurrency>>); + set mainDB(_i3.MainDB? value) => super.noSuchMethod( + Invocation.setter(#mainDB, value), + returnValueForMissingStub: null, + ); @override _i5.Wallet<_i4.CryptoCurrency> getWallet(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getWallet, - [walletId], - ), - returnValue: _FakeWallet_2<_i4.CryptoCurrency>( - this, - Invocation.method( - #getWallet, - [walletId], - ), - ), - ) as _i5.Wallet<_i4.CryptoCurrency>); + Invocation.method(#getWallet, [walletId]), + returnValue: _FakeWallet_2<_i4.CryptoCurrency>( + this, + Invocation.method(#getWallet, [walletId]), + ), + ) + as _i5.Wallet<_i4.CryptoCurrency>); @override void addWallet(_i5.Wallet<_i4.CryptoCurrency>? wallet) => super.noSuchMethod( - Invocation.method( - #addWallet, - [wallet], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addWallet, [wallet]), + returnValueForMissingStub: null, + ); @override _i8.Future deleteWallet( @@ -156,16 +127,11 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { _i10.SecureStorageInterface? secureStorage, ) => (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - info, - secureStorage, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#deleteWallet, [info, secureStorage]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future load( @@ -174,17 +140,11 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { bool? isDuress, ) => (super.noSuchMethod( - Invocation.method( - #load, - [ - prefs, - mainDB, - isDuress, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#load, [prefs, mainDB, isDuress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadAfterStackRestore( @@ -193,17 +153,15 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { bool? isDesktop, ) => (super.noSuchMethod( - Invocation.method( - #loadAfterStackRestore, - [ - prefs, - wallets, - isDesktop, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadAfterStackRestore, [ + prefs, + wallets, + isDesktop, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [ThemeService]. @@ -215,119 +173,100 @@ class MockThemeService extends _i1.Mock implements _i12.ThemeService { } @override - _i6.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_3( - this, - Invocation.getter(#client), - ), - ) as _i6.HTTP); + _i3.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_1(this, Invocation.getter(#db)), + ) + as _i3.MainDB); @override - set client(_i6.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i6.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_3(this, Invocation.getter(#client)), + ) + as _i6.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i13.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i13.StackTheme>[], + ) + as List<_i13.StackTheme>); @override - List<_i13.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i13.StackTheme>[], - ) as List<_i13.StackTheme>); + set client(_i6.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i8.Future install({required _i14.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i8.Future>.value( - <_i12.StackThemeMetaData>[]), - ) as _i8.Future>); + Invocation.method(#fetchThemes, []), + returnValue: _i8.Future>.value( + <_i12.StackThemeMetaData>[], + ), + ) + as _i8.Future>); @override - _i8.Future<_i14.Uint8List> fetchTheme( - {required _i12.StackThemeMetaData? themeMetaData}) => + _i8.Future<_i14.Uint8List> fetchTheme({ + required _i12.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i8.Future<_i14.Uint8List>.value(_i14.Uint8List(0)), - ) as _i8.Future<_i14.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i8.Future<_i14.Uint8List>.value(_i14.Uint8List(0)), + ) + as _i8.Future<_i14.Uint8List>); @override _i13.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i13.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i13.StackTheme?); } diff --git a/test/widget_tests/trade_card_test.mocks.dart b/test/widget_tests/trade_card_test.mocks.dart index a8080d9901..a00409c0cd 100644 --- a/test/widget_tests/trade_card_test.mocks.dart +++ b/test/widget_tests/trade_card_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/trade_card_test.dart. // Do not manually edit this file. @@ -8,9 +8,9 @@ import 'dart:typed_data' as _i7; import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/src/dummies.dart' as _i8; -import 'package:stackwallet/db/isar/main_db.dart' as _i3; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; import 'package:stackwallet/models/isar/stack_theme.dart' as _i5; -import 'package:stackwallet/networking/http.dart' as _i2; +import 'package:stackwallet/networking/http.dart' as _i3; import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: type=lint @@ -21,29 +21,21 @@ import 'package:stackwallet/themes/theme_service.dart' as _i4; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member -class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP { - _FakeHTTP_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeHTTP_1 extends _i1.SmartFake implements _i3.HTTP { + _FakeHTTP_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [ThemeService]. @@ -55,120 +47,102 @@ class MockThemeService extends _i1.Mock implements _i4.ThemeService { } @override - _i2.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_0( - this, - Invocation.getter(#client), - ), - ) as _i2.HTTP); + _i2.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0(this, Invocation.getter(#db)), + ) + as _i2.MainDB); @override - set client(_i2.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i3.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_1(this, Invocation.getter(#client)), + ) + as _i3.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i5.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i5.StackTheme>[], + ) + as List<_i5.StackTheme>); @override - List<_i5.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i5.StackTheme>[], - ) as List<_i5.StackTheme>); + set client(_i3.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override - void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i6.Future install({required _i7.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override - _i6.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) + as _i6.Future); @override _i6.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i6.Future.value(false), + ) + as _i6.Future); @override - _i6.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i6.Future>.value( - <_i4.StackThemeMetaData>[]), - ) as _i6.Future>); + _i6.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method(#fetchThemes, []), + returnValue: _i6.Future>.value( + <_i4.StackThemeMetaData>[], + ), + ) + as _i6.Future>); @override - _i6.Future<_i7.Uint8List> fetchTheme( - {required _i4.StackThemeMetaData? themeMetaData}) => + _i6.Future<_i7.Uint8List> fetchTheme({ + required _i4.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), - ) as _i6.Future<_i7.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), + ) + as _i6.Future<_i7.Uint8List>); @override _i5.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i5.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i5.StackTheme?); } /// A class which mocks [IThemeAssets]. @@ -180,164 +154,194 @@ class MockIThemeAssets extends _i1.Mock implements _i5.IThemeAssets { } @override - String get bellNew => (super.noSuchMethod( - Invocation.getter(#bellNew), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#bellNew), - ), - ) as String); + String get bellNew => + (super.noSuchMethod( + Invocation.getter(#bellNew), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#bellNew), + ), + ) + as String); @override - String get buy => (super.noSuchMethod( - Invocation.getter(#buy), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#buy), - ), - ) as String); + String get buy => + (super.noSuchMethod( + Invocation.getter(#buy), + returnValue: _i8.dummyValue(this, Invocation.getter(#buy)), + ) + as String); @override - String get exchange => (super.noSuchMethod( - Invocation.getter(#exchange), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#exchange), - ), - ) as String); + String get exchange => + (super.noSuchMethod( + Invocation.getter(#exchange), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#exchange), + ), + ) + as String); @override - String get personaIncognito => (super.noSuchMethod( - Invocation.getter(#personaIncognito), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#personaIncognito), - ), - ) as String); + String get personaIncognito => + (super.noSuchMethod( + Invocation.getter(#personaIncognito), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#personaIncognito), + ), + ) + as String); @override - String get personaEasy => (super.noSuchMethod( - Invocation.getter(#personaEasy), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#personaEasy), - ), - ) as String); + String get personaEasy => + (super.noSuchMethod( + Invocation.getter(#personaEasy), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#personaEasy), + ), + ) + as String); @override - String get stack => (super.noSuchMethod( - Invocation.getter(#stack), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#stack), - ), - ) as String); + String get stack => + (super.noSuchMethod( + Invocation.getter(#stack), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#stack), + ), + ) + as String); @override - String get stackIcon => (super.noSuchMethod( - Invocation.getter(#stackIcon), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#stackIcon), - ), - ) as String); + String get stackIcon => + (super.noSuchMethod( + Invocation.getter(#stackIcon), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#stackIcon), + ), + ) + as String); @override - String get receive => (super.noSuchMethod( - Invocation.getter(#receive), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#receive), - ), - ) as String); + String get receive => + (super.noSuchMethod( + Invocation.getter(#receive), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#receive), + ), + ) + as String); @override - String get receivePending => (super.noSuchMethod( - Invocation.getter(#receivePending), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#receivePending), - ), - ) as String); + String get receivePending => + (super.noSuchMethod( + Invocation.getter(#receivePending), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#receivePending), + ), + ) + as String); @override - String get receiveCancelled => (super.noSuchMethod( - Invocation.getter(#receiveCancelled), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#receiveCancelled), - ), - ) as String); + String get receiveCancelled => + (super.noSuchMethod( + Invocation.getter(#receiveCancelled), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#receiveCancelled), + ), + ) + as String); @override - String get send => (super.noSuchMethod( - Invocation.getter(#send), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#send), - ), - ) as String); + String get send => + (super.noSuchMethod( + Invocation.getter(#send), + returnValue: _i8.dummyValue(this, Invocation.getter(#send)), + ) + as String); @override - String get sendPending => (super.noSuchMethod( - Invocation.getter(#sendPending), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#sendPending), - ), - ) as String); + String get sendPending => + (super.noSuchMethod( + Invocation.getter(#sendPending), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#sendPending), + ), + ) + as String); @override - String get sendCancelled => (super.noSuchMethod( - Invocation.getter(#sendCancelled), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#sendCancelled), - ), - ) as String); + String get sendCancelled => + (super.noSuchMethod( + Invocation.getter(#sendCancelled), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#sendCancelled), + ), + ) + as String); @override - String get themeSelector => (super.noSuchMethod( - Invocation.getter(#themeSelector), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#themeSelector), - ), - ) as String); + String get themeSelector => + (super.noSuchMethod( + Invocation.getter(#themeSelector), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#themeSelector), + ), + ) + as String); @override - String get themePreview => (super.noSuchMethod( - Invocation.getter(#themePreview), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#themePreview), - ), - ) as String); + String get themePreview => + (super.noSuchMethod( + Invocation.getter(#themePreview), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#themePreview), + ), + ) + as String); @override - String get txExchange => (super.noSuchMethod( - Invocation.getter(#txExchange), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#txExchange), - ), - ) as String); + String get txExchange => + (super.noSuchMethod( + Invocation.getter(#txExchange), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#txExchange), + ), + ) + as String); @override - String get txExchangePending => (super.noSuchMethod( - Invocation.getter(#txExchangePending), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#txExchangePending), - ), - ) as String); + String get txExchangePending => + (super.noSuchMethod( + Invocation.getter(#txExchangePending), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#txExchangePending), + ), + ) + as String); @override - String get txExchangeFailed => (super.noSuchMethod( - Invocation.getter(#txExchangeFailed), - returnValue: _i8.dummyValue( - this, - Invocation.getter(#txExchangeFailed), - ), - ) as String); + String get txExchangeFailed => + (super.noSuchMethod( + Invocation.getter(#txExchangeFailed), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#txExchangeFailed), + ), + ) + as String); } diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index cd442044ea..4ac1c8177d 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/transaction_card_test.dart. // Do not manually edit this file. @@ -8,7 +8,7 @@ import 'dart:typed_data' as _i25; import 'dart:ui' as _i16; import 'package:decimal/decimal.dart' as _i22; -import 'package:isar/isar.dart' as _i8; +import 'package:isar_community/isar.dart' as _i8; import 'package:logger/logger.dart' as _i19; import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/src/dummies.dart' as _i15; @@ -47,91 +47,53 @@ import 'package:tuple/tuple.dart' as _i29; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeNodeService_0 extends _i1.SmartFake implements _i2.NodeService { - _FakeNodeService_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeNodeService_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMainDB_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWallet_2 extends _i1.SmartFake implements _i5.Wallet { - _FakeWallet_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWallet_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFusionInfo_3 extends _i1.SmartFake implements _i6.FusionInfo { - _FakeFusionInfo_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFusionInfo_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDuration_4 extends _i1.SmartFake implements Duration { - _FakeDuration_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDuration_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeHTTP_5 extends _i1.SmartFake implements _i7.HTTP { - _FakeHTTP_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHTTP_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeIsar_6 extends _i1.SmartFake implements _i8.Isar { - _FakeIsar_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeIsar_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeQueryBuilder_7 extends _i1.SmartFake implements _i8.QueryBuilder { - _FakeQueryBuilder_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeQueryBuilder_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Wallets]. @@ -143,71 +105,60 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { } @override - _i2.NodeService get nodeService => (super.noSuchMethod( - Invocation.getter(#nodeService), - returnValue: _FakeNodeService_0( - this, - Invocation.getter(#nodeService), - ), - ) as _i2.NodeService); + _i2.NodeService get nodeService => + (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_0( + this, + Invocation.getter(#nodeService), + ), + ) + as _i2.NodeService); @override - set nodeService(_i2.NodeService? _nodeService) => super.noSuchMethod( - Invocation.setter( - #nodeService, - _nodeService, - ), - returnValueForMissingStub: null, - ); + _i3.MainDB get mainDB => + (super.noSuchMethod( + Invocation.getter(#mainDB), + returnValue: _FakeMainDB_1(this, Invocation.getter(#mainDB)), + ) + as _i3.MainDB); @override - _i3.MainDB get mainDB => (super.noSuchMethod( - Invocation.getter(#mainDB), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#mainDB), - ), - ) as _i3.MainDB); + List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => + (super.noSuchMethod( + Invocation.getter(#wallets), + returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], + ) + as List<_i5.Wallet<_i4.CryptoCurrency>>); @override - set mainDB(_i3.MainDB? _mainDB) => super.noSuchMethod( - Invocation.setter( - #mainDB, - _mainDB, - ), - returnValueForMissingStub: null, - ); + set nodeService(_i2.NodeService? value) => super.noSuchMethod( + Invocation.setter(#nodeService, value), + returnValueForMissingStub: null, + ); @override - List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => (super.noSuchMethod( - Invocation.getter(#wallets), - returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], - ) as List<_i5.Wallet<_i4.CryptoCurrency>>); + set mainDB(_i3.MainDB? value) => super.noSuchMethod( + Invocation.setter(#mainDB, value), + returnValueForMissingStub: null, + ); @override _i5.Wallet<_i4.CryptoCurrency> getWallet(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getWallet, - [walletId], - ), - returnValue: _FakeWallet_2<_i4.CryptoCurrency>( - this, - Invocation.method( - #getWallet, - [walletId], - ), - ), - ) as _i5.Wallet<_i4.CryptoCurrency>); + Invocation.method(#getWallet, [walletId]), + returnValue: _FakeWallet_2<_i4.CryptoCurrency>( + this, + Invocation.method(#getWallet, [walletId]), + ), + ) + as _i5.Wallet<_i4.CryptoCurrency>); @override void addWallet(_i5.Wallet<_i4.CryptoCurrency>? wallet) => super.noSuchMethod( - Invocation.method( - #addWallet, - [wallet], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addWallet, [wallet]), + returnValueForMissingStub: null, + ); @override _i10.Future deleteWallet( @@ -215,16 +166,11 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { _i12.SecureStorageInterface? secureStorage, ) => (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - info, - secureStorage, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#deleteWallet, [info, secureStorage]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future load( @@ -233,17 +179,11 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { bool? isDuress, ) => (super.noSuchMethod( - Invocation.method( - #load, - [ - prefs, - mainDB, - isDuress, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#load, [prefs, mainDB, isDuress]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future loadAfterStackRestore( @@ -252,17 +192,15 @@ class MockWallets extends _i1.Mock implements _i9.Wallets { bool? isDesktop, ) => (super.noSuchMethod( - Invocation.method( - #loadAfterStackRestore, - [ - prefs, - wallets, - isDesktop, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#loadAfterStackRestore, [ + prefs, + wallets, + isDesktop, + ]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); } /// A class which mocks [LocaleService]. @@ -274,66 +212,53 @@ class MockLocaleService extends _i1.Mock implements _i14.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [Prefs]. @@ -345,425 +270,421 @@ class MockPrefs extends _i1.Mock implements _i13.Prefs { } @override - bool get isInitialized => (super.noSuchMethod( - Invocation.getter(#isInitialized), - returnValue: false, - ) as bool); + 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); + 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, - ); + int get lastUnlocked => + (super.noSuchMethod(Invocation.getter(#lastUnlocked), returnValue: 0) + as int); @override - int get lastUnlocked => (super.noSuchMethod( - Invocation.getter(#lastUnlocked), - returnValue: 0, - ) as int); + int get currentNotificationId => + (super.noSuchMethod( + Invocation.getter(#currentNotificationId), + returnValue: 0, + ) + as int); @override - set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( - Invocation.setter( - #lastUnlocked, - lastUnlocked, - ), - returnValueForMissingStub: null, - ); + List get walletIdsSyncOnStartup => + (super.noSuchMethod( + Invocation.getter(#walletIdsSyncOnStartup), + returnValue: [], + ) + as List); @override - int get currentNotificationId => (super.noSuchMethod( - Invocation.getter(#currentNotificationId), - returnValue: 0, - ) as int); + _i17.SyncingType get syncType => + (super.noSuchMethod( + Invocation.getter(#syncType), + returnValue: _i17.SyncingType.currentWalletOnly, + ) + as _i17.SyncingType); @override - List get walletIdsSyncOnStartup => (super.noSuchMethod( - Invocation.getter(#walletIdsSyncOnStartup), - returnValue: [], - ) as List); + bool get wifiOnly => + (super.noSuchMethod(Invocation.getter(#wifiOnly), returnValue: false) + as bool); @override - set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => - super.noSuchMethod( - Invocation.setter( - #walletIdsSyncOnStartup, - walletIdsSyncOnStartup, - ), - returnValueForMissingStub: null, - ); + bool get showFavoriteWallets => + (super.noSuchMethod( + Invocation.getter(#showFavoriteWallets), + returnValue: false, + ) + as bool); @override - _i17.SyncingType get syncType => (super.noSuchMethod( - Invocation.getter(#syncType), - returnValue: _i17.SyncingType.currentWalletOnly, - ) as _i17.SyncingType); + String get language => + (super.noSuchMethod( + Invocation.getter(#language), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#language), + ), + ) + as String); @override - set syncType(_i17.SyncingType? syncType) => super.noSuchMethod( - Invocation.setter( - #syncType, - syncType, - ), - returnValueForMissingStub: null, - ); + String get currency => + (super.noSuchMethod( + Invocation.getter(#currency), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#currency), + ), + ) + as String); @override - bool get wifiOnly => (super.noSuchMethod( - Invocation.getter(#wifiOnly), - returnValue: false, - ) as bool); + bool get randomizePIN => + (super.noSuchMethod(Invocation.getter(#randomizePIN), returnValue: false) + as bool); @override - set wifiOnly(bool? wifiOnly) => super.noSuchMethod( - Invocation.setter( - #wifiOnly, - wifiOnly, - ), - returnValueForMissingStub: null, - ); + bool get useBiometrics => + (super.noSuchMethod(Invocation.getter(#useBiometrics), returnValue: false) + as bool); @override - bool get showFavoriteWallets => (super.noSuchMethod( - Invocation.getter(#showFavoriteWallets), - returnValue: false, - ) as bool); + bool get hasPin => + (super.noSuchMethod(Invocation.getter(#hasPin), returnValue: false) + as bool); @override - set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( - Invocation.setter( - #showFavoriteWallets, - showFavoriteWallets, - ), - returnValueForMissingStub: null, - ); + bool get hasDuressPin => + (super.noSuchMethod(Invocation.getter(#hasDuressPin), returnValue: false) + as bool); @override - String get language => (super.noSuchMethod( - Invocation.getter(#language), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#language), - ), - ) as String); + bool get biometricsDuress => + (super.noSuchMethod( + Invocation.getter(#biometricsDuress), + returnValue: false, + ) + as bool); @override - set language(String? newLanguage) => super.noSuchMethod( - Invocation.setter( - #language, - newLanguage, - ), - returnValueForMissingStub: null, - ); + int get familiarity => + (super.noSuchMethod(Invocation.getter(#familiarity), returnValue: 0) + as int); @override - String get currency => (super.noSuchMethod( - Invocation.getter(#currency), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#currency), - ), - ) as String); + bool get torKillSwitch => + (super.noSuchMethod(Invocation.getter(#torKillSwitch), returnValue: false) + as bool); @override - set currency(String? newCurrency) => super.noSuchMethod( - Invocation.setter( - #currency, - newCurrency, - ), - returnValueForMissingStub: null, - ); + bool get showTestNetCoins => + (super.noSuchMethod( + Invocation.getter(#showTestNetCoins), + returnValue: false, + ) + as bool); @override - bool get randomizePIN => (super.noSuchMethod( - Invocation.getter(#randomizePIN), - returnValue: false, - ) as bool); + bool get isAutoBackupEnabled => + (super.noSuchMethod( + Invocation.getter(#isAutoBackupEnabled), + returnValue: false, + ) + as bool); @override - set randomizePIN(bool? randomizePIN) => super.noSuchMethod( - Invocation.setter( - #randomizePIN, - randomizePIN, - ), - returnValueForMissingStub: null, - ); + _i18.BackupFrequencyType get backupFrequencyType => + (super.noSuchMethod( + Invocation.getter(#backupFrequencyType), + returnValue: _i18.BackupFrequencyType.everyTenMinutes, + ) + as _i18.BackupFrequencyType); @override - bool get useBiometrics => (super.noSuchMethod( - Invocation.getter(#useBiometrics), - returnValue: false, - ) as bool); + bool get hideBlockExplorerWarning => + (super.noSuchMethod( + Invocation.getter(#hideBlockExplorerWarning), + returnValue: false, + ) + as bool); @override - set useBiometrics(bool? useBiometrics) => super.noSuchMethod( - Invocation.setter( - #useBiometrics, - useBiometrics, - ), - returnValueForMissingStub: null, - ); + bool get gotoWalletOnStartup => + (super.noSuchMethod( + Invocation.getter(#gotoWalletOnStartup), + returnValue: false, + ) + as bool); @override - bool get hasPin => (super.noSuchMethod( - Invocation.getter(#hasPin), - returnValue: false, - ) as bool); + bool get externalCalls => + (super.noSuchMethod(Invocation.getter(#externalCalls), returnValue: false) + as bool); @override - set hasPin(bool? hasPin) => super.noSuchMethod( - Invocation.setter( - #hasPin, - hasPin, - ), - returnValueForMissingStub: null, - ); + bool get enableCoinControl => + (super.noSuchMethod( + Invocation.getter(#enableCoinControl), + returnValue: false, + ) + as bool); @override - bool get hasDuressPin => (super.noSuchMethod( - Invocation.getter(#hasDuressPin), - returnValue: false, - ) as bool); + bool get enableSystemBrightness => + (super.noSuchMethod( + Invocation.getter(#enableSystemBrightness), + returnValue: false, + ) + as bool); @override - set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( - Invocation.setter( - #hasDuressPin, - hasDuressPin, - ), - returnValueForMissingStub: null, - ); + String get themeId => + (super.noSuchMethod( + Invocation.getter(#themeId), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#themeId), + ), + ) + as String); @override - bool get biometricsDuress => (super.noSuchMethod( - Invocation.getter(#biometricsDuress), - returnValue: false, - ) as bool); + String get systemBrightnessLightThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessLightThemeId), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#systemBrightnessLightThemeId), + ), + ) + as String); @override - set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( - Invocation.setter( - #biometricsDuress, - biometricsDuress, - ), - returnValueForMissingStub: null, - ); + String get systemBrightnessDarkThemeId => + (super.noSuchMethod( + Invocation.getter(#systemBrightnessDarkThemeId), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#systemBrightnessDarkThemeId), + ), + ) + as String); @override - int get familiarity => (super.noSuchMethod( - Invocation.getter(#familiarity), - returnValue: 0, - ) as int); + bool get useTor => + (super.noSuchMethod(Invocation.getter(#useTor), returnValue: false) + as bool); @override - set familiarity(int? familiarity) => super.noSuchMethod( - Invocation.setter( - #familiarity, - familiarity, - ), - returnValueForMissingStub: null, - ); + bool get autoPin => + (super.noSuchMethod(Invocation.getter(#autoPin), returnValue: false) + as bool); @override - bool get torKillSwitch => (super.noSuchMethod( - Invocation.getter(#torKillSwitch), - returnValue: false, - ) as bool); + bool get enableExchange => + (super.noSuchMethod( + Invocation.getter(#enableExchange), + returnValue: false, + ) + as bool); @override - set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( - Invocation.setter( - #torKillSwitch, - torKillswitch, - ), - returnValueForMissingStub: null, - ); + bool get advancedFiroFeatures => + (super.noSuchMethod( + Invocation.getter(#advancedFiroFeatures), + returnValue: false, + ) + as bool); @override - bool get showTestNetCoins => (super.noSuchMethod( - Invocation.getter(#showTestNetCoins), - returnValue: false, - ) as bool); + _i19.Level get logLevel => + (super.noSuchMethod( + Invocation.getter(#logLevel), + returnValue: _i19.Level.all, + ) + as _i19.Level); @override - set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( - Invocation.setter( - #showTestNetCoins, - showTestNetCoins, - ), - returnValueForMissingStub: null, - ); + ({bool enabled, int minutes}) get autoLockInfo => + (super.noSuchMethod( + Invocation.getter(#autoLockInfo), + returnValue: (enabled: false, minutes: 0), + ) + as ({bool enabled, int minutes})); @override - bool get isAutoBackupEnabled => (super.noSuchMethod( - Invocation.getter(#isAutoBackupEnabled), - returnValue: false, - ) as bool); + set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + Invocation.setter(#lastUnlockedTimeout, lastUnlockedTimeout), + returnValueForMissingStub: null, + ); @override - set isAutoBackupEnabled(bool? isAutoBackupEnabled) => super.noSuchMethod( - Invocation.setter( - #isAutoBackupEnabled, - isAutoBackupEnabled, - ), - returnValueForMissingStub: null, - ); + set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + Invocation.setter(#lastUnlocked, lastUnlocked), + returnValueForMissingStub: null, + ); @override - set autoBackupLocation(String? autoBackupLocation) => super.noSuchMethod( - Invocation.setter( - #autoBackupLocation, - autoBackupLocation, - ), + set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => + super.noSuchMethod( + Invocation.setter(#walletIdsSyncOnStartup, walletIdsSyncOnStartup), returnValueForMissingStub: null, ); @override - _i18.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( - Invocation.getter(#backupFrequencyType), - returnValue: _i18.BackupFrequencyType.everyTenMinutes, - ) as _i18.BackupFrequencyType); + set syncType(_i17.SyncingType? syncType) => super.noSuchMethod( + Invocation.setter(#syncType, syncType), + returnValueForMissingStub: null, + ); @override - set backupFrequencyType(_i18.BackupFrequencyType? backupFrequencyType) => - super.noSuchMethod( - Invocation.setter( - #backupFrequencyType, - backupFrequencyType, - ), - returnValueForMissingStub: null, - ); + set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + Invocation.setter(#wifiOnly, wifiOnly), + returnValueForMissingStub: null, + ); @override - set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( - Invocation.setter( - #lastAutoBackup, - lastAutoBackup, - ), - returnValueForMissingStub: null, - ); + set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( + Invocation.setter(#showFavoriteWallets, showFavoriteWallets), + returnValueForMissingStub: null, + ); @override - bool get hideBlockExplorerWarning => (super.noSuchMethod( - Invocation.getter(#hideBlockExplorerWarning), - returnValue: false, - ) as bool); + set language(String? newLanguage) => super.noSuchMethod( + Invocation.setter(#language, newLanguage), + returnValueForMissingStub: null, + ); @override - set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => - super.noSuchMethod( - Invocation.setter( - #hideBlockExplorerWarning, - hideBlockExplorerWarning, - ), - returnValueForMissingStub: null, - ); + set currency(String? newCurrency) => super.noSuchMethod( + Invocation.setter(#currency, newCurrency), + returnValueForMissingStub: null, + ); @override - bool get gotoWalletOnStartup => (super.noSuchMethod( - Invocation.getter(#gotoWalletOnStartup), - returnValue: false, - ) as bool); + set randomizePIN(bool? randomizePIN) => super.noSuchMethod( + Invocation.setter(#randomizePIN, randomizePIN), + returnValueForMissingStub: null, + ); @override - set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( - Invocation.setter( - #gotoWalletOnStartup, - gotoWalletOnStartup, - ), - returnValueForMissingStub: null, - ); + set useBiometrics(bool? useBiometrics) => super.noSuchMethod( + Invocation.setter(#useBiometrics, useBiometrics), + returnValueForMissingStub: null, + ); @override - set startupWalletId(String? startupWalletId) => super.noSuchMethod( - Invocation.setter( - #startupWalletId, - startupWalletId, - ), - returnValueForMissingStub: null, - ); + set hasPin(bool? hasPin) => super.noSuchMethod( + Invocation.setter(#hasPin, hasPin), + returnValueForMissingStub: null, + ); @override - bool get externalCalls => (super.noSuchMethod( - Invocation.getter(#externalCalls), - returnValue: false, - ) as bool); + set hasDuressPin(bool? hasDuressPin) => super.noSuchMethod( + Invocation.setter(#hasDuressPin, hasDuressPin), + returnValueForMissingStub: null, + ); @override - set externalCalls(bool? externalCalls) => super.noSuchMethod( - Invocation.setter( - #externalCalls, - externalCalls, - ), - returnValueForMissingStub: null, - ); + set biometricsDuress(bool? biometricsDuress) => super.noSuchMethod( + Invocation.setter(#biometricsDuress, biometricsDuress), + returnValueForMissingStub: null, + ); @override - bool get enableCoinControl => (super.noSuchMethod( - Invocation.getter(#enableCoinControl), - returnValue: false, - ) as bool); + set familiarity(int? familiarity) => super.noSuchMethod( + Invocation.setter(#familiarity, familiarity), + returnValueForMissingStub: null, + ); @override - set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( - Invocation.setter( - #enableCoinControl, - enableCoinControl, - ), + set torKillSwitch(bool? torKillswitch) => super.noSuchMethod( + Invocation.setter(#torKillSwitch, torKillswitch), + returnValueForMissingStub: null, + ); + + @override + set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( + Invocation.setter(#showTestNetCoins, showTestNetCoins), + returnValueForMissingStub: null, + ); + + @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 + set backupFrequencyType(_i18.BackupFrequencyType? backupFrequencyType) => + super.noSuchMethod( + Invocation.setter(#backupFrequencyType, backupFrequencyType), returnValueForMissingStub: null, ); @override - bool get enableSystemBrightness => (super.noSuchMethod( - Invocation.getter(#enableSystemBrightness), - returnValue: false, - ) as bool); + set lastAutoBackup(DateTime? lastAutoBackup) => super.noSuchMethod( + Invocation.setter(#lastAutoBackup, lastAutoBackup), + returnValueForMissingStub: null, + ); @override - set enableSystemBrightness(bool? enableSystemBrightness) => + set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) => super.noSuchMethod( - Invocation.setter( - #enableSystemBrightness, - enableSystemBrightness, - ), + Invocation.setter(#hideBlockExplorerWarning, hideBlockExplorerWarning), returnValueForMissingStub: null, ); @override - String get themeId => (super.noSuchMethod( - Invocation.getter(#themeId), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#themeId), - ), - ) as String); + set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod( + Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup), + returnValueForMissingStub: null, + ); @override - set themeId(String? themeId) => super.noSuchMethod( - Invocation.setter( - #themeId, - themeId, - ), + set startupWalletId(String? startupWalletId) => super.noSuchMethod( + Invocation.setter(#startupWalletId, startupWalletId), + returnValueForMissingStub: null, + ); + + @override + set externalCalls(bool? externalCalls) => super.noSuchMethod( + Invocation.setter(#externalCalls, externalCalls), + returnValueForMissingStub: null, + ); + + @override + set enableCoinControl(bool? enableCoinControl) => super.noSuchMethod( + Invocation.setter(#enableCoinControl, enableCoinControl), + returnValueForMissingStub: null, + ); + + @override + set enableSystemBrightness(bool? enableSystemBrightness) => + super.noSuchMethod( + Invocation.setter(#enableSystemBrightness, enableSystemBrightness), returnValueForMissingStub: null, ); @override - String get systemBrightnessLightThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessLightThemeId), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#systemBrightnessLightThemeId), - ), - ) as String); + set themeId(String? themeId) => super.noSuchMethod( + Invocation.setter(#themeId, themeId), + returnValueForMissingStub: null, + ); @override set systemBrightnessLightThemeId(String? systemBrightnessLightThemeId) => @@ -775,15 +696,6 @@ class MockPrefs extends _i1.Mock implements _i13.Prefs { returnValueForMissingStub: null, ); - @override - String get systemBrightnessDarkThemeId => (super.noSuchMethod( - Invocation.getter(#systemBrightnessDarkThemeId), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#systemBrightnessDarkThemeId), - ), - ) as String); - @override set systemBrightnessDarkThemeId(String? systemBrightnessDarkThemeId) => super.noSuchMethod( @@ -794,280 +706,181 @@ class MockPrefs extends _i1.Mock implements _i13.Prefs { returnValueForMissingStub: null, ); - @override - bool get useTor => (super.noSuchMethod( - Invocation.getter(#useTor), - returnValue: false, - ) as bool); - @override set useTor(bool? useTor) => super.noSuchMethod( - Invocation.setter( - #useTor, - useTor, - ), - returnValueForMissingStub: null, - ); - - @override - bool get autoPin => (super.noSuchMethod( - Invocation.getter(#autoPin), - returnValue: false, - ) as bool); + Invocation.setter(#useTor, useTor), + returnValueForMissingStub: null, + ); @override set autoPin(bool? autoPin) => super.noSuchMethod( - Invocation.setter( - #autoPin, - autoPin, - ), - returnValueForMissingStub: null, - ); - - @override - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); + Invocation.setter(#autoPin, autoPin), + returnValueForMissingStub: null, + ); @override set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), - returnValueForMissingStub: null, - ); - - @override -<<<<<<< - bool get advancedFiroFeatures => (super.noSuchMethod( - Invocation.getter(#advancedFiroFeatures), - returnValue: false, - ) as bool); + Invocation.setter(#enableExchange, showExchange), + returnValueForMissingStub: null, + ); @override set advancedFiroFeatures(bool? advancedFiroFeatures) => super.noSuchMethod( - Invocation.setter( - #advancedFiroFeatures, - advancedFiroFeatures, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#advancedFiroFeatures, advancedFiroFeatures), + returnValueForMissingStub: null, + ); @override set logsPath(String? logsPath) => super.noSuchMethod( - Invocation.setter( - #logsPath, - logsPath, - ), - returnValueForMissingStub: null, - ); - - @override - _i19.Level get logLevel => (super.noSuchMethod( - Invocation.getter(#logLevel), - returnValue: _i19.Level.all, - ) as _i19.Level); + Invocation.setter(#logsPath, logsPath), + returnValueForMissingStub: null, + ); @override set logLevel(_i19.Level? logLevel) => super.noSuchMethod( - Invocation.setter( - #logLevel, - logLevel, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#logLevel, logLevel), + returnValueForMissingStub: null, + ); @override -======= - bool get enableExchange => (super.noSuchMethod( - Invocation.getter(#enableExchange), - returnValue: false, - ) as bool); - @override - set enableExchange(bool? showExchange) => super.noSuchMethod( - Invocation.setter( - #enableExchange, - showExchange, - ), + set autoLockInfo(({bool enabled, int minutes})? autoLockInfo) => + super.noSuchMethod( + Invocation.setter(#autoLockInfo, autoLockInfo), returnValueForMissingStub: null, ); - @override ->>>>>>> - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); @override - _i10.Future init() => (super.noSuchMethod( - Invocation.method( - #init, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i10.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( - Invocation.method( - #incrementCurrentNotificationIndex, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future init() => + (super.noSuchMethod( + Invocation.method(#init, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future isExternalCallsSet() => (super.noSuchMethod( - Invocation.method( - #isExternalCallsSet, - [], - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + _i10.Future incrementCurrentNotificationIndex() => + (super.noSuchMethod( + Invocation.method(#incrementCurrentNotificationIndex, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future saveUserID(String? userId) => (super.noSuchMethod( - Invocation.method( - #saveUserID, - [userId], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future isExternalCallsSet() => + (super.noSuchMethod( + Invocation.method(#isExternalCallsSet, []), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override - _i10.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( - Invocation.method( - #saveSignupEpoch, - [signupEpoch], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future saveUserID(String? userId) => + (super.noSuchMethod( + Invocation.method(#saveUserID, [userId]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i20.AmountUnit amountUnit(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #amountUnit, - [coin], - ), - returnValue: _i20.AmountUnit.normal, - ) as _i20.AmountUnit); + _i10.Future saveSignupEpoch(int? signupEpoch) => + (super.noSuchMethod( + Invocation.method(#saveSignupEpoch, [signupEpoch]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - void updateAmountUnit({ - required _i4.CryptoCurrency? coin, - required _i20.AmountUnit? amountUnit, - }) => - super.noSuchMethod( - Invocation.method( - #updateAmountUnit, - [], - { - #coin: coin, - #amountUnit: amountUnit, - }, - ), - returnValueForMissingStub: null, - ); + _i20.AmountUnit amountUnit(_i4.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#amountUnit, [coin]), + returnValue: _i20.AmountUnit.normal, + ) + as _i20.AmountUnit); + + @override + void updateAmountUnit({ + required _i4.CryptoCurrency? coin, + required _i20.AmountUnit? amountUnit, + }) => super.noSuchMethod( + Invocation.method(#updateAmountUnit, [], { + #coin: coin, + #amountUnit: amountUnit, + }), + returnValueForMissingStub: null, + ); @override - int maxDecimals(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #maxDecimals, - [coin], - ), - returnValue: 0, - ) as int); + int maxDecimals(_i4.CryptoCurrency? coin) => + (super.noSuchMethod( + Invocation.method(#maxDecimals, [coin]), + returnValue: 0, + ) + as int); @override void updateMaxDecimals({ required _i4.CryptoCurrency? coin, required int? maxDecimals, - }) => - super.noSuchMethod( - Invocation.method( - #updateMaxDecimals, - [], - { - #coin: coin, - #maxDecimals: maxDecimals, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#updateMaxDecimals, [], { + #coin: coin, + #maxDecimals: maxDecimals, + }), + returnValueForMissingStub: null, + ); @override _i6.FusionInfo getFusionServerInfo(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getFusionServerInfo, - [coin], - ), - returnValue: _FakeFusionInfo_3( - this, - Invocation.method( - #getFusionServerInfo, - [coin], - ), - ), - ) as _i6.FusionInfo); + Invocation.method(#getFusionServerInfo, [coin]), + returnValue: _FakeFusionInfo_3( + this, + Invocation.method(#getFusionServerInfo, [coin]), + ), + ) + as _i6.FusionInfo); @override void setFusionServerInfo( _i4.CryptoCurrency? coin, _i6.FusionInfo? fusionServerInfo, - ) => - super.noSuchMethod( - Invocation.method( - #setFusionServerInfo, - [ - coin, - fusionServerInfo, - ], - ), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#setFusionServerInfo, [coin, fusionServerInfo]), + returnValueForMissingStub: null, + ); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [PriceService]. @@ -1079,124 +892,104 @@ class MockPriceService extends _i1.Mock implements _i21.PriceService { } @override - String get baseTicker => (super.noSuchMethod( - Invocation.getter(#baseTicker), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#baseTicker), - ), - ) as String); + String get baseTicker => + (super.noSuchMethod( + Invocation.getter(#baseTicker), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#baseTicker), + ), + ) + as String); @override - set baseTicker(String? _baseTicker) => super.noSuchMethod( - Invocation.setter( - #baseTicker, - _baseTicker, - ), - returnValueForMissingStub: null, - ); + _i10.Future> get tokenContractAddressesToCheck => + (super.noSuchMethod( + Invocation.getter(#tokenContractAddressesToCheck), + returnValue: _i10.Future>.value({}), + ) + as _i10.Future>); @override - Duration get updateInterval => (super.noSuchMethod( - Invocation.getter(#updateInterval), - returnValue: _FakeDuration_4( - this, - Invocation.getter(#updateInterval), - ), - ) as Duration); + Duration get updateInterval => + (super.noSuchMethod( + Invocation.getter(#updateInterval), + returnValue: _FakeDuration_4( + this, + Invocation.getter(#updateInterval), + ), + ) + as Duration); @override - _i10.Future> get tokenContractAddressesToCheck => - (super.noSuchMethod( - Invocation.getter(#tokenContractAddressesToCheck), - returnValue: _i10.Future>.value({}), - ) as _i10.Future>); + set baseTicker(String? value) => super.noSuchMethod( + Invocation.setter(#baseTicker, value), + returnValueForMissingStub: null, + ); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override ({double change24h, _i22.Decimal value})? getPrice( - _i4.CryptoCurrency? coin) => - (super.noSuchMethod(Invocation.method( - #getPrice, - [coin], - )) as ({double change24h, _i22.Decimal value})?); + _i4.CryptoCurrency? coin, + ) => + (super.noSuchMethod(Invocation.method(#getPrice, [coin])) + as ({double change24h, _i22.Decimal value})?); @override ({double change24h, _i22.Decimal value})? getTokenPrice( - String? contractAddress) => - (super.noSuchMethod(Invocation.method( - #getTokenPrice, - [contractAddress], - )) as ({double change24h, _i22.Decimal value})?); + String? contractAddress, + ) => + (super.noSuchMethod(Invocation.method(#getTokenPrice, [contractAddress])) + as ({double change24h, _i22.Decimal value})?); @override - _i10.Future updatePrice() => (super.noSuchMethod( - Invocation.method( - #updatePrice, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future updatePrice() => + (super.noSuchMethod( + Invocation.method(#updatePrice, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override void cancel() => super.noSuchMethod( - Invocation.method( - #cancel, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#cancel, []), + returnValueForMissingStub: null, + ); @override void start(bool? rightAway) => super.noSuchMethod( - Invocation.method( - #start, - [rightAway], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#start, [rightAway]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [ThemeService]. @@ -1208,121 +1001,102 @@ class MockThemeService extends _i1.Mock implements _i23.ThemeService { } @override - _i7.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_5( - this, - Invocation.getter(#client), - ), - ) as _i7.HTTP); + _i3.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_1(this, Invocation.getter(#db)), + ) + as _i3.MainDB); @override - set client(_i7.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i7.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_5(this, Invocation.getter(#client)), + ) + as _i7.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i24.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i24.StackTheme>[], + ) + as List<_i24.StackTheme>); @override - List<_i24.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i24.StackTheme>[], - ) as List<_i24.StackTheme>); + set client(_i7.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i10.Future install({required _i25.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override _i10.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i10.Future>.value( - <_i23.StackThemeMetaData>[]), - ) as _i10.Future>); + Invocation.method(#fetchThemes, []), + returnValue: _i10.Future>.value( + <_i23.StackThemeMetaData>[], + ), + ) + as _i10.Future>); @override - _i10.Future<_i25.Uint8List> fetchTheme( - {required _i23.StackThemeMetaData? themeMetaData}) => + _i10.Future<_i25.Uint8List> fetchTheme({ + required _i23.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i10.Future<_i25.Uint8List>.value(_i25.Uint8List(0)), - ) as _i10.Future<_i25.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i10.Future<_i25.Uint8List>.value(_i25.Uint8List(0)), + ) + as _i10.Future<_i25.Uint8List>); @override _i24.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i24.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i24.StackTheme?); } /// A class which mocks [MainDB]. @@ -1334,179 +1108,150 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { } @override - _i8.Isar get isar => (super.noSuchMethod( - Invocation.getter(#isar), - returnValue: _FakeIsar_6( - this, - Invocation.getter(#isar), - ), - ) as _i8.Isar); + _i8.Isar get isar => + (super.noSuchMethod( + Invocation.getter(#isar), + returnValue: _FakeIsar_6(this, Invocation.getter(#isar)), + ) + as _i8.Isar); @override - _i10.Future initMainDB({_i8.Isar? mock}) => (super.noSuchMethod( - Invocation.method( - #initMainDB, - [], - {#mock: mock}, - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + _i10.Future initMainDB({_i8.Isar? mock}) => + (super.noSuchMethod( + Invocation.method(#initMainDB, [], {#mock: mock}), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override _i10.Future putWalletInfo(_i11.WalletInfo? walletInfo) => (super.noSuchMethod( - Invocation.method( - #putWalletInfo, - [walletInfo], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#putWalletInfo, [walletInfo]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future updateWalletInfo(_i11.WalletInfo? walletInfo) => (super.noSuchMethod( - Invocation.method( - #updateWalletInfo, - [walletInfo], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#updateWalletInfo, [walletInfo]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - List<_i26.ContactEntry> getContactEntries() => (super.noSuchMethod( - Invocation.method( - #getContactEntries, - [], - ), - returnValue: <_i26.ContactEntry>[], - ) as List<_i26.ContactEntry>); + List<_i26.ContactEntry> getContactEntries() => + (super.noSuchMethod( + Invocation.method(#getContactEntries, []), + returnValue: <_i26.ContactEntry>[], + ) + as List<_i26.ContactEntry>); @override _i10.Future deleteContactEntry({required String? id}) => (super.noSuchMethod( - Invocation.method( - #deleteContactEntry, - [], - {#id: id}, - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + Invocation.method(#deleteContactEntry, [], {#id: id}), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override _i10.Future isContactEntryExists({required String? id}) => (super.noSuchMethod( - Invocation.method( - #isContactEntryExists, - [], - {#id: id}, - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + Invocation.method(#isContactEntryExists, [], {#id: id}), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override _i26.ContactEntry? getContactEntry({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getContactEntry, - [], - {#id: id}, - )) as _i26.ContactEntry?); + (super.noSuchMethod(Invocation.method(#getContactEntry, [], {#id: id})) + as _i26.ContactEntry?); @override - _i10.Future putContactEntry( - {required _i26.ContactEntry? contactEntry}) => + _i10.Future putContactEntry({ + required _i26.ContactEntry? contactEntry, + }) => (super.noSuchMethod( - Invocation.method( - #putContactEntry, - [], - {#contactEntry: contactEntry}, - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + Invocation.method(#putContactEntry, [], { + #contactEntry: contactEntry, + }), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override - _i27.TransactionBlockExplorer? getTransactionBlockExplorer( - {required _i4.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod(Invocation.method( - #getTransactionBlockExplorer, - [], - {#cryptoCurrency: cryptoCurrency}, - )) as _i27.TransactionBlockExplorer?); + _i27.TransactionBlockExplorer? getTransactionBlockExplorer({ + required _i4.CryptoCurrency? cryptoCurrency, + }) => + (super.noSuchMethod( + Invocation.method(#getTransactionBlockExplorer, [], { + #cryptoCurrency: cryptoCurrency, + }), + ) + as _i27.TransactionBlockExplorer?); @override _i10.Future putTransactionBlockExplorer( - _i27.TransactionBlockExplorer? explorer) => + _i27.TransactionBlockExplorer? explorer, + ) => (super.noSuchMethod( - Invocation.method( - #putTransactionBlockExplorer, - [explorer], - ), - returnValue: _i10.Future.value(0), - ) as _i10.Future); + Invocation.method(#putTransactionBlockExplorer, [explorer]), + returnValue: _i10.Future.value(0), + ) + as _i10.Future); @override _i8.QueryBuilder<_i28.Address, _i28.Address, _i8.QAfterWhereClause> - getAddresses(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getAddresses, - [walletId], - ), - returnValue: _FakeQueryBuilder_7<_i28.Address, _i28.Address, - _i8.QAfterWhereClause>( - this, - Invocation.method( - #getAddresses, - [walletId], - ), - ), - ) as _i8 - .QueryBuilder<_i28.Address, _i28.Address, _i8.QAfterWhereClause>); - - @override - _i10.Future putAddress(_i28.Address? address) => (super.noSuchMethod( - Invocation.method( - #putAddress, - [address], - ), - returnValue: _i10.Future.value(0), - ) as _i10.Future); + getAddresses(String? walletId) => + (super.noSuchMethod( + Invocation.method(#getAddresses, [walletId]), + returnValue: + _FakeQueryBuilder_7< + _i28.Address, + _i28.Address, + _i8.QAfterWhereClause + >(this, Invocation.method(#getAddresses, [walletId])), + ) + as _i8.QueryBuilder< + _i28.Address, + _i28.Address, + _i8.QAfterWhereClause + >); + + @override + _i10.Future putAddress(_i28.Address? address) => + (super.noSuchMethod( + Invocation.method(#putAddress, [address]), + returnValue: _i10.Future.value(0), + ) + as _i10.Future); @override _i10.Future> putAddresses(List<_i28.Address>? addresses) => (super.noSuchMethod( - Invocation.method( - #putAddresses, - [addresses], - ), - returnValue: _i10.Future>.value([]), - ) as _i10.Future>); + Invocation.method(#putAddresses, [addresses]), + returnValue: _i10.Future>.value([]), + ) + as _i10.Future>); @override _i10.Future> updateOrPutAddresses(List<_i28.Address>? addresses) => (super.noSuchMethod( - Invocation.method( - #updateOrPutAddresses, - [addresses], - ), - returnValue: _i10.Future>.value([]), - ) as _i10.Future>); + Invocation.method(#updateOrPutAddresses, [addresses]), + returnValue: _i10.Future>.value([]), + ) + as _i10.Future>); @override - _i10.Future<_i28.Address?> getAddress( - String? walletId, - String? address, - ) => + _i10.Future<_i28.Address?> getAddress(String? walletId, String? address) => (super.noSuchMethod( - Invocation.method( - #getAddress, - [ - walletId, - address, - ], - ), - returnValue: _i10.Future<_i28.Address?>.value(), - ) as _i10.Future<_i28.Address?>); + Invocation.method(#getAddress, [walletId, address]), + returnValue: _i10.Future<_i28.Address?>.value(), + ) + as _i10.Future<_i28.Address?>); @override _i10.Future updateAddress( @@ -1514,54 +1259,46 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { _i28.Address? newAddress, ) => (super.noSuchMethod( - Invocation.method( - #updateAddress, - [ - oldAddress, - newAddress, - ], - ), - returnValue: _i10.Future.value(0), - ) as _i10.Future); + Invocation.method(#updateAddress, [oldAddress, newAddress]), + returnValue: _i10.Future.value(0), + ) + as _i10.Future); @override _i8.QueryBuilder<_i28.Transaction, _i28.Transaction, _i8.QAfterWhereClause> - getTransactions(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getTransactions, - [walletId], - ), - returnValue: _FakeQueryBuilder_7<_i28.Transaction, _i28.Transaction, - _i8.QAfterWhereClause>( - this, - Invocation.method( - #getTransactions, - [walletId], - ), - ), - ) as _i8.QueryBuilder<_i28.Transaction, _i28.Transaction, - _i8.QAfterWhereClause>); + getTransactions(String? walletId) => + (super.noSuchMethod( + Invocation.method(#getTransactions, [walletId]), + returnValue: + _FakeQueryBuilder_7< + _i28.Transaction, + _i28.Transaction, + _i8.QAfterWhereClause + >(this, Invocation.method(#getTransactions, [walletId])), + ) + as _i8.QueryBuilder< + _i28.Transaction, + _i28.Transaction, + _i8.QAfterWhereClause + >); @override _i10.Future putTransaction(_i28.Transaction? transaction) => (super.noSuchMethod( - Invocation.method( - #putTransaction, - [transaction], - ), - returnValue: _i10.Future.value(0), - ) as _i10.Future); + Invocation.method(#putTransaction, [transaction]), + returnValue: _i10.Future.value(0), + ) + as _i10.Future); @override _i10.Future> putTransactions( - List<_i28.Transaction>? transactions) => + List<_i28.Transaction>? transactions, + ) => (super.noSuchMethod( - Invocation.method( - #putTransactions, - [transactions], - ), - returnValue: _i10.Future>.value([]), - ) as _i10.Future>); + Invocation.method(#putTransactions, [transactions]), + returnValue: _i10.Future>.value([]), + ) + as _i10.Future>); @override _i10.Future<_i28.Transaction?> getTransaction( @@ -1569,15 +1306,10 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { String? txid, ) => (super.noSuchMethod( - Invocation.method( - #getTransaction, - [ - walletId, - txid, - ], - ), - returnValue: _i10.Future<_i28.Transaction?>.value(), - ) as _i10.Future<_i28.Transaction?>); + Invocation.method(#getTransaction, [walletId, txid]), + returnValue: _i10.Future<_i28.Transaction?>.value(), + ) + as _i10.Future<_i28.Transaction?>); @override _i10.Stream<_i28.Transaction?> watchTransaction({ @@ -1585,98 +1317,71 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { bool? fireImmediately = false, }) => (super.noSuchMethod( - Invocation.method( - #watchTransaction, - [], - { - #id: id, - #fireImmediately: fireImmediately, - }, - ), - returnValue: _i10.Stream<_i28.Transaction?>.empty(), - ) as _i10.Stream<_i28.Transaction?>); + Invocation.method(#watchTransaction, [], { + #id: id, + #fireImmediately: fireImmediately, + }), + returnValue: _i10.Stream<_i28.Transaction?>.empty(), + ) + as _i10.Stream<_i28.Transaction?>); @override _i8.QueryBuilder<_i28.UTXO, _i28.UTXO, _i8.QAfterWhereClause> getUTXOs( - String? walletId) => - (super.noSuchMethod( - Invocation.method( - #getUTXOs, - [walletId], - ), - returnValue: - _FakeQueryBuilder_7<_i28.UTXO, _i28.UTXO, _i8.QAfterWhereClause>( - this, - Invocation.method( - #getUTXOs, - [walletId], - ), - ), - ) as _i8.QueryBuilder<_i28.UTXO, _i28.UTXO, _i8.QAfterWhereClause>); - - @override - _i8.QueryBuilder<_i28.UTXO, _i28.UTXO, _i8.QAfterFilterCondition> - getUTXOsByAddress( String? walletId, - String? address, ) => - (super.noSuchMethod( - Invocation.method( - #getUTXOsByAddress, - [ - walletId, - address, - ], - ), - returnValue: _FakeQueryBuilder_7<_i28.UTXO, _i28.UTXO, - _i8.QAfterFilterCondition>( - this, - Invocation.method( - #getUTXOsByAddress, - [ - walletId, - address, - ], - ), - ), - ) as _i8 - .QueryBuilder<_i28.UTXO, _i28.UTXO, _i8.QAfterFilterCondition>); + (super.noSuchMethod( + Invocation.method(#getUTXOs, [walletId]), + returnValue: + _FakeQueryBuilder_7< + _i28.UTXO, + _i28.UTXO, + _i8.QAfterWhereClause + >(this, Invocation.method(#getUTXOs, [walletId])), + ) + as _i8.QueryBuilder<_i28.UTXO, _i28.UTXO, _i8.QAfterWhereClause>); @override - _i10.Future putUTXO(_i28.UTXO? utxo) => (super.noSuchMethod( - Invocation.method( - #putUTXO, - [utxo], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i8.QueryBuilder<_i28.UTXO, _i28.UTXO, _i8.QAfterFilterCondition> + getUTXOsByAddress(String? walletId, String? address) => + (super.noSuchMethod( + Invocation.method(#getUTXOsByAddress, [walletId, address]), + returnValue: + _FakeQueryBuilder_7< + _i28.UTXO, + _i28.UTXO, + _i8.QAfterFilterCondition + >( + this, + Invocation.method(#getUTXOsByAddress, [walletId, address]), + ), + ) + as _i8.QueryBuilder<_i28.UTXO, _i28.UTXO, _i8.QAfterFilterCondition>); + + @override + _i10.Future putUTXO(_i28.UTXO? utxo) => + (super.noSuchMethod( + Invocation.method(#putUTXO, [utxo]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future putUTXOs(List<_i28.UTXO>? utxos) => (super.noSuchMethod( - Invocation.method( - #putUTXOs, - [utxos], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + _i10.Future putUTXOs(List<_i28.UTXO>? utxos) => + (super.noSuchMethod( + Invocation.method(#putUTXOs, [utxos]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override - _i10.Future updateUTXOs( - String? walletId, - List<_i28.UTXO>? utxos, - ) => + _i10.Future updateUTXOs(String? walletId, List<_i28.UTXO>? utxos) => (super.noSuchMethod( - Invocation.method( - #updateUTXOs, - [ - walletId, - utxos, - ], - ), - returnValue: _i10.Future.value(false), - ) as _i10.Future); + Invocation.method(#updateUTXOs, [walletId, utxos]), + returnValue: _i10.Future.value(false), + ) + as _i10.Future); @override _i10.Stream<_i28.UTXO?> watchUTXO({ @@ -1684,59 +1389,55 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { bool? fireImmediately = false, }) => (super.noSuchMethod( - Invocation.method( - #watchUTXO, - [], - { - #id: id, - #fireImmediately: fireImmediately, - }, - ), - returnValue: _i10.Stream<_i28.UTXO?>.empty(), - ) as _i10.Stream<_i28.UTXO?>); - - @override - _i8.QueryBuilder<_i28.TransactionNote, _i28.TransactionNote, - _i8.QAfterWhereClause> getTransactionNotes( - String? walletId) => + Invocation.method(#watchUTXO, [], { + #id: id, + #fireImmediately: fireImmediately, + }), + returnValue: _i10.Stream<_i28.UTXO?>.empty(), + ) + as _i10.Stream<_i28.UTXO?>); + + @override + _i8.QueryBuilder< + _i28.TransactionNote, + _i28.TransactionNote, + _i8.QAfterWhereClause + > + getTransactionNotes(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getTransactionNotes, - [walletId], - ), - returnValue: _FakeQueryBuilder_7<_i28.TransactionNote, - _i28.TransactionNote, _i8.QAfterWhereClause>( - this, - Invocation.method( - #getTransactionNotes, - [walletId], - ), - ), - ) as _i8.QueryBuilder<_i28.TransactionNote, _i28.TransactionNote, - _i8.QAfterWhereClause>); + Invocation.method(#getTransactionNotes, [walletId]), + returnValue: + _FakeQueryBuilder_7< + _i28.TransactionNote, + _i28.TransactionNote, + _i8.QAfterWhereClause + >(this, Invocation.method(#getTransactionNotes, [walletId])), + ) + as _i8.QueryBuilder< + _i28.TransactionNote, + _i28.TransactionNote, + _i8.QAfterWhereClause + >); @override _i10.Future putTransactionNote(_i28.TransactionNote? transactionNote) => (super.noSuchMethod( - Invocation.method( - #putTransactionNote, - [transactionNote], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#putTransactionNote, [transactionNote]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future putTransactionNotes( - List<_i28.TransactionNote>? transactionNotes) => + List<_i28.TransactionNote>? transactionNotes, + ) => (super.noSuchMethod( - Invocation.method( - #putTransactionNotes, - [transactionNotes], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#putTransactionNotes, [transactionNotes]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future<_i28.TransactionNote?> getTransactionNote( @@ -1744,15 +1445,10 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { String? txid, ) => (super.noSuchMethod( - Invocation.method( - #getTransactionNote, - [ - walletId, - txid, - ], - ), - returnValue: _i10.Future<_i28.TransactionNote?>.value(), - ) as _i10.Future<_i28.TransactionNote?>); + Invocation.method(#getTransactionNote, [walletId, txid]), + returnValue: _i10.Future<_i28.TransactionNote?>.value(), + ) + as _i10.Future<_i28.TransactionNote?>); @override _i10.Stream<_i28.TransactionNote?> watchTransactionNote({ @@ -1760,65 +1456,56 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { bool? fireImmediately = false, }) => (super.noSuchMethod( - Invocation.method( - #watchTransactionNote, - [], - { - #id: id, - #fireImmediately: fireImmediately, - }, - ), - returnValue: _i10.Stream<_i28.TransactionNote?>.empty(), - ) as _i10.Stream<_i28.TransactionNote?>); + Invocation.method(#watchTransactionNote, [], { + #id: id, + #fireImmediately: fireImmediately, + }), + returnValue: _i10.Stream<_i28.TransactionNote?>.empty(), + ) + as _i10.Stream<_i28.TransactionNote?>); @override _i8.QueryBuilder<_i28.AddressLabel, _i28.AddressLabel, _i8.QAfterWhereClause> - getAddressLabels(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getAddressLabels, - [walletId], - ), - returnValue: _FakeQueryBuilder_7<_i28.AddressLabel, - _i28.AddressLabel, _i8.QAfterWhereClause>( - this, - Invocation.method( - #getAddressLabels, - [walletId], - ), - ), - ) as _i8.QueryBuilder<_i28.AddressLabel, _i28.AddressLabel, - _i8.QAfterWhereClause>); + getAddressLabels(String? walletId) => + (super.noSuchMethod( + Invocation.method(#getAddressLabels, [walletId]), + returnValue: + _FakeQueryBuilder_7< + _i28.AddressLabel, + _i28.AddressLabel, + _i8.QAfterWhereClause + >(this, Invocation.method(#getAddressLabels, [walletId])), + ) + as _i8.QueryBuilder< + _i28.AddressLabel, + _i28.AddressLabel, + _i8.QAfterWhereClause + >); @override _i10.Future putAddressLabel(_i28.AddressLabel? addressLabel) => (super.noSuchMethod( - Invocation.method( - #putAddressLabel, - [addressLabel], - ), - returnValue: _i10.Future.value(0), - ) as _i10.Future); + Invocation.method(#putAddressLabel, [addressLabel]), + returnValue: _i10.Future.value(0), + ) + as _i10.Future); @override int putAddressLabelSync(_i28.AddressLabel? addressLabel) => (super.noSuchMethod( - Invocation.method( - #putAddressLabelSync, - [addressLabel], - ), - returnValue: 0, - ) as int); + Invocation.method(#putAddressLabelSync, [addressLabel]), + returnValue: 0, + ) + as int); @override _i10.Future putAddressLabels(List<_i28.AddressLabel>? addressLabels) => (super.noSuchMethod( - Invocation.method( - #putAddressLabels, - [addressLabels], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#putAddressLabels, [addressLabels]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future<_i28.AddressLabel?> getAddressLabel( @@ -1826,28 +1513,20 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { String? addressString, ) => (super.noSuchMethod( - Invocation.method( - #getAddressLabel, - [ - walletId, - addressString, - ], - ), - returnValue: _i10.Future<_i28.AddressLabel?>.value(), - ) as _i10.Future<_i28.AddressLabel?>); + Invocation.method(#getAddressLabel, [walletId, addressString]), + returnValue: _i10.Future<_i28.AddressLabel?>.value(), + ) + as _i10.Future<_i28.AddressLabel?>); @override _i28.AddressLabel? getAddressLabelSync( String? walletId, String? addressString, ) => - (super.noSuchMethod(Invocation.method( - #getAddressLabelSync, - [ - walletId, - addressString, - ], - )) as _i28.AddressLabel?); + (super.noSuchMethod( + Invocation.method(#getAddressLabelSync, [walletId, addressString]), + ) + as _i28.AddressLabel?); @override _i10.Stream<_i28.AddressLabel?> watchAddressLabel({ @@ -1855,59 +1534,48 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { bool? fireImmediately = false, }) => (super.noSuchMethod( - Invocation.method( - #watchAddressLabel, - [], - { - #id: id, - #fireImmediately: fireImmediately, - }, - ), - returnValue: _i10.Stream<_i28.AddressLabel?>.empty(), - ) as _i10.Stream<_i28.AddressLabel?>); + Invocation.method(#watchAddressLabel, [], { + #id: id, + #fireImmediately: fireImmediately, + }), + returnValue: _i10.Stream<_i28.AddressLabel?>.empty(), + ) + as _i10.Stream<_i28.AddressLabel?>); @override _i10.Future updateAddressLabel(_i28.AddressLabel? addressLabel) => (super.noSuchMethod( - Invocation.method( - #updateAddressLabel, - [addressLabel], - ), - returnValue: _i10.Future.value(0), - ) as _i10.Future); + Invocation.method(#updateAddressLabel, [addressLabel]), + returnValue: _i10.Future.value(0), + ) + as _i10.Future); @override _i10.Future deleteWalletBlockchainData(String? walletId) => (super.noSuchMethod( - Invocation.method( - #deleteWalletBlockchainData, - [walletId], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#deleteWalletBlockchainData, [walletId]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future deleteAddressLabels(String? walletId) => (super.noSuchMethod( - Invocation.method( - #deleteAddressLabels, - [walletId], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#deleteAddressLabels, [walletId]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future deleteTransactionNotes(String? walletId) => (super.noSuchMethod( - Invocation.method( - #deleteTransactionNotes, - [walletId], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#deleteTransactionNotes, [walletId]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future addNewTransactionData( @@ -1915,83 +1583,70 @@ class MockMainDB extends _i1.Mock implements _i3.MainDB { String? walletId, ) => (super.noSuchMethod( - Invocation.method( - #addNewTransactionData, - [ - transactionsData, - walletId, - ], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#addNewTransactionData, [ + transactionsData, + walletId, + ]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); @override _i10.Future> updateOrPutTransactionV2s( - List<_i30.TransactionV2>? transactions) => + List<_i30.TransactionV2>? transactions, + ) => (super.noSuchMethod( - Invocation.method( - #updateOrPutTransactionV2s, - [transactions], - ), - returnValue: _i10.Future>.value([]), - ) as _i10.Future>); + Invocation.method(#updateOrPutTransactionV2s, [transactions]), + returnValue: _i10.Future>.value([]), + ) + as _i10.Future>); @override _i8.QueryBuilder<_i28.EthContract, _i28.EthContract, _i8.QWhere> - getEthContracts() => (super.noSuchMethod( - Invocation.method( - #getEthContracts, - [], - ), - returnValue: _FakeQueryBuilder_7<_i28.EthContract, _i28.EthContract, - _i8.QWhere>( - this, - Invocation.method( - #getEthContracts, - [], - ), - ), - ) as _i8 - .QueryBuilder<_i28.EthContract, _i28.EthContract, _i8.QWhere>); + getEthContracts() => + (super.noSuchMethod( + Invocation.method(#getEthContracts, []), + returnValue: + _FakeQueryBuilder_7< + _i28.EthContract, + _i28.EthContract, + _i8.QWhere + >(this, Invocation.method(#getEthContracts, [])), + ) + as _i8.QueryBuilder<_i28.EthContract, _i28.EthContract, _i8.QWhere>); @override _i10.Future<_i28.EthContract?> getEthContract(String? contractAddress) => (super.noSuchMethod( - Invocation.method( - #getEthContract, - [contractAddress], - ), - returnValue: _i10.Future<_i28.EthContract?>.value(), - ) as _i10.Future<_i28.EthContract?>); + Invocation.method(#getEthContract, [contractAddress]), + returnValue: _i10.Future<_i28.EthContract?>.value(), + ) + as _i10.Future<_i28.EthContract?>); @override _i28.EthContract? getEthContractSync(String? contractAddress) => - (super.noSuchMethod(Invocation.method( - #getEthContractSync, - [contractAddress], - )) as _i28.EthContract?); + (super.noSuchMethod( + Invocation.method(#getEthContractSync, [contractAddress]), + ) + as _i28.EthContract?); @override _i10.Future putEthContract(_i28.EthContract? contract) => (super.noSuchMethod( - Invocation.method( - #putEthContract, - [contract], - ), - returnValue: _i10.Future.value(0), - ) as _i10.Future); + Invocation.method(#putEthContract, [contract]), + returnValue: _i10.Future.value(0), + ) + as _i10.Future); @override _i10.Future putEthContracts(List<_i28.EthContract>? contracts) => (super.noSuchMethod( - Invocation.method( - #putEthContracts, - [contracts], - ), - returnValue: _i10.Future.value(), - returnValueForMissingStub: _i10.Future.value(), - ) as _i10.Future); + Invocation.method(#putEthContracts, [contracts]), + returnValue: _i10.Future.value(), + returnValueForMissingStub: _i10.Future.value(), + ) + as _i10.Future); } /// A class which mocks [IThemeAssets]. @@ -2003,164 +1658,197 @@ class MockIThemeAssets extends _i1.Mock implements _i24.IThemeAssets { } @override - String get bellNew => (super.noSuchMethod( - Invocation.getter(#bellNew), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#bellNew), - ), - ) as String); + String get bellNew => + (super.noSuchMethod( + Invocation.getter(#bellNew), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#bellNew), + ), + ) + as String); @override - String get buy => (super.noSuchMethod( - Invocation.getter(#buy), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#buy), - ), - ) as String); + String get buy => + (super.noSuchMethod( + Invocation.getter(#buy), + returnValue: _i15.dummyValue(this, Invocation.getter(#buy)), + ) + as String); @override - String get exchange => (super.noSuchMethod( - Invocation.getter(#exchange), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#exchange), - ), - ) as String); + String get exchange => + (super.noSuchMethod( + Invocation.getter(#exchange), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#exchange), + ), + ) + as String); @override - String get personaIncognito => (super.noSuchMethod( - Invocation.getter(#personaIncognito), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#personaIncognito), - ), - ) as String); + String get personaIncognito => + (super.noSuchMethod( + Invocation.getter(#personaIncognito), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#personaIncognito), + ), + ) + as String); @override - String get personaEasy => (super.noSuchMethod( - Invocation.getter(#personaEasy), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#personaEasy), - ), - ) as String); + String get personaEasy => + (super.noSuchMethod( + Invocation.getter(#personaEasy), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#personaEasy), + ), + ) + as String); @override - String get stack => (super.noSuchMethod( - Invocation.getter(#stack), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#stack), - ), - ) as String); + String get stack => + (super.noSuchMethod( + Invocation.getter(#stack), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#stack), + ), + ) + as String); @override - String get stackIcon => (super.noSuchMethod( - Invocation.getter(#stackIcon), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#stackIcon), - ), - ) as String); + String get stackIcon => + (super.noSuchMethod( + Invocation.getter(#stackIcon), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#stackIcon), + ), + ) + as String); @override - String get receive => (super.noSuchMethod( - Invocation.getter(#receive), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#receive), - ), - ) as String); + String get receive => + (super.noSuchMethod( + Invocation.getter(#receive), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#receive), + ), + ) + as String); @override - String get receivePending => (super.noSuchMethod( - Invocation.getter(#receivePending), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#receivePending), - ), - ) as String); + String get receivePending => + (super.noSuchMethod( + Invocation.getter(#receivePending), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#receivePending), + ), + ) + as String); @override - String get receiveCancelled => (super.noSuchMethod( - Invocation.getter(#receiveCancelled), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#receiveCancelled), - ), - ) as String); + String get receiveCancelled => + (super.noSuchMethod( + Invocation.getter(#receiveCancelled), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#receiveCancelled), + ), + ) + as String); @override - String get send => (super.noSuchMethod( - Invocation.getter(#send), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#send), - ), - ) as String); + String get send => + (super.noSuchMethod( + Invocation.getter(#send), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#send), + ), + ) + as String); @override - String get sendPending => (super.noSuchMethod( - Invocation.getter(#sendPending), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#sendPending), - ), - ) as String); + String get sendPending => + (super.noSuchMethod( + Invocation.getter(#sendPending), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#sendPending), + ), + ) + as String); @override - String get sendCancelled => (super.noSuchMethod( - Invocation.getter(#sendCancelled), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#sendCancelled), - ), - ) as String); + String get sendCancelled => + (super.noSuchMethod( + Invocation.getter(#sendCancelled), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#sendCancelled), + ), + ) + as String); @override - String get themeSelector => (super.noSuchMethod( - Invocation.getter(#themeSelector), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#themeSelector), - ), - ) as String); + String get themeSelector => + (super.noSuchMethod( + Invocation.getter(#themeSelector), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#themeSelector), + ), + ) + as String); @override - String get themePreview => (super.noSuchMethod( - Invocation.getter(#themePreview), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#themePreview), - ), - ) as String); + String get themePreview => + (super.noSuchMethod( + Invocation.getter(#themePreview), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#themePreview), + ), + ) + as String); @override - String get txExchange => (super.noSuchMethod( - Invocation.getter(#txExchange), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#txExchange), - ), - ) as String); + String get txExchange => + (super.noSuchMethod( + Invocation.getter(#txExchange), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#txExchange), + ), + ) + as String); @override - String get txExchangePending => (super.noSuchMethod( - Invocation.getter(#txExchangePending), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#txExchangePending), - ), - ) as String); + String get txExchangePending => + (super.noSuchMethod( + Invocation.getter(#txExchangePending), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#txExchangePending), + ), + ) + as String); @override - String get txExchangeFailed => (super.noSuchMethod( - Invocation.getter(#txExchangeFailed), - returnValue: _i15.dummyValue( - this, - Invocation.getter(#txExchangeFailed), - ), - ) as String); + String get txExchangeFailed => + (super.noSuchMethod( + Invocation.getter(#txExchangeFailed), + returnValue: _i15.dummyValue( + this, + Invocation.getter(#txExchangeFailed), + ), + ) + as String); } diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart index 1ba8ca158a..9feb9a1b99 100644 --- a/test/widget_tests/wallet_card_test.mocks.dart +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/wallet_card_test.dart. // Do not manually edit this file. @@ -32,50 +32,32 @@ import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeNodeService_0 extends _i1.SmartFake implements _i2.NodeService { - _FakeNodeService_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeNodeService_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMainDB_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWallet_2 extends _i1.SmartFake implements _i5.Wallet { - _FakeWallet_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWallet_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeHTTP_3 extends _i1.SmartFake implements _i6.HTTP { - _FakeHTTP_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHTTP_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Wallets]. @@ -87,71 +69,60 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { } @override - _i2.NodeService get nodeService => (super.noSuchMethod( - Invocation.getter(#nodeService), - returnValue: _FakeNodeService_0( - this, - Invocation.getter(#nodeService), - ), - ) as _i2.NodeService); + _i2.NodeService get nodeService => + (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_0( + this, + Invocation.getter(#nodeService), + ), + ) + as _i2.NodeService); @override - set nodeService(_i2.NodeService? _nodeService) => super.noSuchMethod( - Invocation.setter( - #nodeService, - _nodeService, - ), - returnValueForMissingStub: null, - ); + _i3.MainDB get mainDB => + (super.noSuchMethod( + Invocation.getter(#mainDB), + returnValue: _FakeMainDB_1(this, Invocation.getter(#mainDB)), + ) + as _i3.MainDB); @override - _i3.MainDB get mainDB => (super.noSuchMethod( - Invocation.getter(#mainDB), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#mainDB), - ), - ) as _i3.MainDB); + List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => + (super.noSuchMethod( + Invocation.getter(#wallets), + returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], + ) + as List<_i5.Wallet<_i4.CryptoCurrency>>); @override - set mainDB(_i3.MainDB? _mainDB) => super.noSuchMethod( - Invocation.setter( - #mainDB, - _mainDB, - ), - returnValueForMissingStub: null, - ); + set nodeService(_i2.NodeService? value) => super.noSuchMethod( + Invocation.setter(#nodeService, value), + returnValueForMissingStub: null, + ); @override - List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => (super.noSuchMethod( - Invocation.getter(#wallets), - returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], - ) as List<_i5.Wallet<_i4.CryptoCurrency>>); + set mainDB(_i3.MainDB? value) => super.noSuchMethod( + Invocation.setter(#mainDB, value), + returnValueForMissingStub: null, + ); @override _i5.Wallet<_i4.CryptoCurrency> getWallet(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getWallet, - [walletId], - ), - returnValue: _FakeWallet_2<_i4.CryptoCurrency>( - this, - Invocation.method( - #getWallet, - [walletId], - ), - ), - ) as _i5.Wallet<_i4.CryptoCurrency>); + Invocation.method(#getWallet, [walletId]), + returnValue: _FakeWallet_2<_i4.CryptoCurrency>( + this, + Invocation.method(#getWallet, [walletId]), + ), + ) + as _i5.Wallet<_i4.CryptoCurrency>); @override void addWallet(_i5.Wallet<_i4.CryptoCurrency>? wallet) => super.noSuchMethod( - Invocation.method( - #addWallet, - [wallet], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addWallet, [wallet]), + returnValueForMissingStub: null, + ); @override _i8.Future deleteWallet( @@ -159,16 +130,11 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { _i10.SecureStorageInterface? secureStorage, ) => (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - info, - secureStorage, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#deleteWallet, [info, secureStorage]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future load( @@ -177,17 +143,11 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { bool? isDuress, ) => (super.noSuchMethod( - Invocation.method( - #load, - [ - prefs, - mainDB, - isDuress, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#load, [prefs, mainDB, isDuress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadAfterStackRestore( @@ -196,17 +156,15 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { bool? isDesktop, ) => (super.noSuchMethod( - Invocation.method( - #loadAfterStackRestore, - [ - prefs, - wallets, - isDesktop, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadAfterStackRestore, [ + prefs, + wallets, + isDesktop, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [LocaleService]. @@ -218,66 +176,53 @@ class MockLocaleService extends _i1.Mock implements _i12.LocaleService { } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: _i13.dummyValue( - this, - Invocation.getter(#locale), - ), - ) as String); + String get locale => + (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: _i13.dummyValue( + this, + Invocation.getter(#locale), + ), + ) + as String); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i8.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future loadLocale({bool? notify = true}) => + (super.noSuchMethod( + Invocation.method(#loadLocale, [], {#notify: notify}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [ThemeService]. @@ -289,119 +234,100 @@ class MockThemeService extends _i1.Mock implements _i15.ThemeService { } @override - _i6.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_3( - this, - Invocation.getter(#client), - ), - ) as _i6.HTTP); + _i3.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_1(this, Invocation.getter(#db)), + ) + as _i3.MainDB); @override - set client(_i6.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i6.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_3(this, Invocation.getter(#client)), + ) + as _i6.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i16.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i16.StackTheme>[], + ) + as List<_i16.StackTheme>); @override - List<_i16.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i16.StackTheme>[], - ) as List<_i16.StackTheme>); + set client(_i6.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i8.Future install({required _i17.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i8.Future.value(false), - ) as _i8.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i8.Future.value(false), + ) + as _i8.Future); @override _i8.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i8.Future>.value( - <_i15.StackThemeMetaData>[]), - ) as _i8.Future>); + Invocation.method(#fetchThemes, []), + returnValue: _i8.Future>.value( + <_i15.StackThemeMetaData>[], + ), + ) + as _i8.Future>); @override - _i8.Future<_i17.Uint8List> fetchTheme( - {required _i15.StackThemeMetaData? themeMetaData}) => + _i8.Future<_i17.Uint8List> fetchTheme({ + required _i15.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i8.Future<_i17.Uint8List>.value(_i17.Uint8List(0)), - ) as _i8.Future<_i17.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i8.Future<_i17.Uint8List>.value(_i17.Uint8List(0)), + ) + as _i8.Future<_i17.Uint8List>); @override _i16.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i16.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i16.StackTheme?); } 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 d406a0c351..94f1c27403 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 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. @@ -27,51 +27,33 @@ import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeNodeService_0 extends _i1.SmartFake implements _i2.NodeService { - _FakeNodeService_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeNodeService_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMainDB_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWallet_2 extends _i1.SmartFake implements _i5.Wallet { - _FakeWallet_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWallet_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSecureStorageInterface_3 extends _i1.SmartFake implements _i6.SecureStorageInterface { - _FakeSecureStorageInterface_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Wallets]. @@ -83,71 +65,60 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { } @override - _i2.NodeService get nodeService => (super.noSuchMethod( - Invocation.getter(#nodeService), - returnValue: _FakeNodeService_0( - this, - Invocation.getter(#nodeService), - ), - ) as _i2.NodeService); + _i2.NodeService get nodeService => + (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_0( + this, + Invocation.getter(#nodeService), + ), + ) + as _i2.NodeService); @override - set nodeService(_i2.NodeService? _nodeService) => super.noSuchMethod( - Invocation.setter( - #nodeService, - _nodeService, - ), - returnValueForMissingStub: null, - ); + _i3.MainDB get mainDB => + (super.noSuchMethod( + Invocation.getter(#mainDB), + returnValue: _FakeMainDB_1(this, Invocation.getter(#mainDB)), + ) + as _i3.MainDB); @override - _i3.MainDB get mainDB => (super.noSuchMethod( - Invocation.getter(#mainDB), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#mainDB), - ), - ) as _i3.MainDB); + List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => + (super.noSuchMethod( + Invocation.getter(#wallets), + returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], + ) + as List<_i5.Wallet<_i4.CryptoCurrency>>); @override - set mainDB(_i3.MainDB? _mainDB) => super.noSuchMethod( - Invocation.setter( - #mainDB, - _mainDB, - ), - returnValueForMissingStub: null, - ); + set nodeService(_i2.NodeService? value) => super.noSuchMethod( + Invocation.setter(#nodeService, value), + returnValueForMissingStub: null, + ); @override - List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => (super.noSuchMethod( - Invocation.getter(#wallets), - returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], - ) as List<_i5.Wallet<_i4.CryptoCurrency>>); + set mainDB(_i3.MainDB? value) => super.noSuchMethod( + Invocation.setter(#mainDB, value), + returnValueForMissingStub: null, + ); @override _i5.Wallet<_i4.CryptoCurrency> getWallet(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getWallet, - [walletId], - ), - returnValue: _FakeWallet_2<_i4.CryptoCurrency>( - this, - Invocation.method( - #getWallet, - [walletId], - ), - ), - ) as _i5.Wallet<_i4.CryptoCurrency>); + Invocation.method(#getWallet, [walletId]), + returnValue: _FakeWallet_2<_i4.CryptoCurrency>( + this, + Invocation.method(#getWallet, [walletId]), + ), + ) + as _i5.Wallet<_i4.CryptoCurrency>); @override void addWallet(_i5.Wallet<_i4.CryptoCurrency>? wallet) => super.noSuchMethod( - Invocation.method( - #addWallet, - [wallet], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addWallet, [wallet]), + returnValueForMissingStub: null, + ); @override _i8.Future deleteWallet( @@ -155,16 +126,11 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { _i6.SecureStorageInterface? secureStorage, ) => (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - info, - secureStorage, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#deleteWallet, [info, secureStorage]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future load( @@ -173,17 +139,11 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { bool? isDuress, ) => (super.noSuchMethod( - Invocation.method( - #load, - [ - prefs, - mainDB, - isDuress, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#load, [prefs, mainDB, isDuress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadAfterStackRestore( @@ -192,17 +152,15 @@ class MockWallets extends _i1.Mock implements _i7.Wallets { bool? isDesktop, ) => (super.noSuchMethod( - Invocation.method( - #loadAfterStackRestore, - [ - prefs, - wallets, - isDesktop, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadAfterStackRestore, [ + prefs, + wallets, + isDesktop, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [NodeService]. @@ -214,41 +172,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { } @override - _i6.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_3( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i6.SecureStorageInterface); + _i6.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_3( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i6.SecureStorageInterface); @override - List<_i11.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i11.NodeModel>[], - ) as List<_i11.NodeModel>); + List<_i11.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i11.NodeModel>[], + ) + as List<_i11.NodeModel>); @override - List<_i11.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i11.NodeModel>[], - ) as List<_i11.NodeModel>); + List<_i11.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i11.NodeModel>[], + ) + as List<_i11.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i8.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setPrimaryNodeFor({ @@ -257,56 +219,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i11.NodeModel? getPrimaryNodeFor({required _i4.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i11.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i11.NodeModel?); @override List<_i11.NodeModel> getNodesFor(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i11.NodeModel>[], - ) as List<_i11.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i11.NodeModel>[], + ) + as List<_i11.NodeModel>); @override _i11.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i11.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i11.NodeModel?); @override - List<_i11.NodeModel> failoverNodesFor( - {required _i4.CryptoCurrency? currency}) => + List<_i11.NodeModel> failoverNodesFor({ + required _i4.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i11.NodeModel>[], - ) as List<_i11.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i11.NodeModel>[], + ) + as List<_i11.NodeModel>); @override _i8.Future save( @@ -315,34 +266,20 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + _i8.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setEnabledState( @@ -351,61 +288,46 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override void addListener(_i12.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i12.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } 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 6018c1f938..4aad121c69 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,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in stackwallet/test/widget_tests/wallet_info_row/wallet_info_row_test.dart. // Do not manually edit this file. @@ -31,61 +31,38 @@ import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +// ignore_for_file: invalid_use_of_internal_member class _FakeNodeService_0 extends _i1.SmartFake implements _i2.NodeService { - _FakeNodeService_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeNodeService_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB { - _FakeMainDB_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeMainDB_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWallet_2 extends _i1.SmartFake implements _i5.Wallet { - _FakeWallet_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWallet_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeHTTP_3 extends _i1.SmartFake implements _i6.HTTP { - _FakeHTTP_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHTTP_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSecureStorageInterface_4 extends _i1.SmartFake implements _i7.SecureStorageInterface { - _FakeSecureStorageInterface_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSecureStorageInterface_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [Wallets]. @@ -97,71 +74,60 @@ class MockWallets extends _i1.Mock implements _i8.Wallets { } @override - _i2.NodeService get nodeService => (super.noSuchMethod( - Invocation.getter(#nodeService), - returnValue: _FakeNodeService_0( - this, - Invocation.getter(#nodeService), - ), - ) as _i2.NodeService); + _i2.NodeService get nodeService => + (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_0( + this, + Invocation.getter(#nodeService), + ), + ) + as _i2.NodeService); @override - set nodeService(_i2.NodeService? _nodeService) => super.noSuchMethod( - Invocation.setter( - #nodeService, - _nodeService, - ), - returnValueForMissingStub: null, - ); + _i3.MainDB get mainDB => + (super.noSuchMethod( + Invocation.getter(#mainDB), + returnValue: _FakeMainDB_1(this, Invocation.getter(#mainDB)), + ) + as _i3.MainDB); @override - _i3.MainDB get mainDB => (super.noSuchMethod( - Invocation.getter(#mainDB), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#mainDB), - ), - ) as _i3.MainDB); + List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => + (super.noSuchMethod( + Invocation.getter(#wallets), + returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], + ) + as List<_i5.Wallet<_i4.CryptoCurrency>>); @override - set mainDB(_i3.MainDB? _mainDB) => super.noSuchMethod( - Invocation.setter( - #mainDB, - _mainDB, - ), - returnValueForMissingStub: null, - ); + set nodeService(_i2.NodeService? value) => super.noSuchMethod( + Invocation.setter(#nodeService, value), + returnValueForMissingStub: null, + ); @override - List<_i5.Wallet<_i4.CryptoCurrency>> get wallets => (super.noSuchMethod( - Invocation.getter(#wallets), - returnValue: <_i5.Wallet<_i4.CryptoCurrency>>[], - ) as List<_i5.Wallet<_i4.CryptoCurrency>>); + set mainDB(_i3.MainDB? value) => super.noSuchMethod( + Invocation.setter(#mainDB, value), + returnValueForMissingStub: null, + ); @override _i5.Wallet<_i4.CryptoCurrency> getWallet(String? walletId) => (super.noSuchMethod( - Invocation.method( - #getWallet, - [walletId], - ), - returnValue: _FakeWallet_2<_i4.CryptoCurrency>( - this, - Invocation.method( - #getWallet, - [walletId], - ), - ), - ) as _i5.Wallet<_i4.CryptoCurrency>); + Invocation.method(#getWallet, [walletId]), + returnValue: _FakeWallet_2<_i4.CryptoCurrency>( + this, + Invocation.method(#getWallet, [walletId]), + ), + ) + as _i5.Wallet<_i4.CryptoCurrency>); @override void addWallet(_i5.Wallet<_i4.CryptoCurrency>? wallet) => super.noSuchMethod( - Invocation.method( - #addWallet, - [wallet], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addWallet, [wallet]), + returnValueForMissingStub: null, + ); @override _i9.Future deleteWallet( @@ -169,16 +135,11 @@ class MockWallets extends _i1.Mock implements _i8.Wallets { _i7.SecureStorageInterface? secureStorage, ) => (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - info, - secureStorage, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#deleteWallet, [info, secureStorage]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future load( @@ -187,17 +148,11 @@ class MockWallets extends _i1.Mock implements _i8.Wallets { bool? isDuress, ) => (super.noSuchMethod( - Invocation.method( - #load, - [ - prefs, - mainDB, - isDuress, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#load, [prefs, mainDB, isDuress]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future loadAfterStackRestore( @@ -206,17 +161,15 @@ class MockWallets extends _i1.Mock implements _i8.Wallets { bool? isDesktop, ) => (super.noSuchMethod( - Invocation.method( - #loadAfterStackRestore, - [ - prefs, - wallets, - isDesktop, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#loadAfterStackRestore, [ + prefs, + wallets, + isDesktop, + ]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); } /// A class which mocks [ThemeService]. @@ -228,121 +181,102 @@ class MockThemeService extends _i1.Mock implements _i12.ThemeService { } @override - _i6.HTTP get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeHTTP_3( - this, - Invocation.getter(#client), - ), - ) as _i6.HTTP); + _i3.MainDB get db => + (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_1(this, Invocation.getter(#db)), + ) + as _i3.MainDB); @override - set client(_i6.HTTP? _client) => super.noSuchMethod( - Invocation.setter( - #client, - _client, - ), - returnValueForMissingStub: null, - ); + _i6.HTTP get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeHTTP_3(this, Invocation.getter(#client)), + ) + as _i6.HTTP); @override - _i3.MainDB get db => (super.noSuchMethod( - Invocation.getter(#db), - returnValue: _FakeMainDB_1( - this, - Invocation.getter(#db), - ), - ) as _i3.MainDB); + List<_i13.StackTheme> get installedThemes => + (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i13.StackTheme>[], + ) + as List<_i13.StackTheme>); @override - List<_i13.StackTheme> get installedThemes => (super.noSuchMethod( - Invocation.getter(#installedThemes), - returnValue: <_i13.StackTheme>[], - ) as List<_i13.StackTheme>); + set client(_i6.HTTP? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override void init(_i3.MainDB? db) => super.noSuchMethod( - Invocation.method( - #init, - [db], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#init, [db]), + returnValueForMissingStub: null, + ); @override _i9.Future install({required _i14.Uint8List? themeArchiveData}) => (super.noSuchMethod( - Invocation.method( - #install, - [], - {#themeArchiveData: themeArchiveData}, - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future remove({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #remove, - [], - {#themeId: themeId}, - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( - Invocation.method( - #checkDefaultThemesOnStartup, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#install, [], { + #themeArchiveData: themeArchiveData, + }), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); + + @override + _i9.Future remove({required String? themeId}) => + (super.noSuchMethod( + Invocation.method(#remove, [], {#themeId: themeId}), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); + + @override + _i9.Future checkDefaultThemesOnStartup() => + (super.noSuchMethod( + Invocation.method(#checkDefaultThemesOnStartup, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( - Invocation.method( - #verifyInstalled, - [], - {#themeId: themeId}, - ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + Invocation.method(#verifyInstalled, [], {#themeId: themeId}), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); @override _i9.Future> fetchThemes() => (super.noSuchMethod( - Invocation.method( - #fetchThemes, - [], - ), - returnValue: _i9.Future>.value( - <_i12.StackThemeMetaData>[]), - ) as _i9.Future>); + Invocation.method(#fetchThemes, []), + returnValue: _i9.Future>.value( + <_i12.StackThemeMetaData>[], + ), + ) + as _i9.Future>); @override - _i9.Future<_i14.Uint8List> fetchTheme( - {required _i12.StackThemeMetaData? themeMetaData}) => + _i9.Future<_i14.Uint8List> fetchTheme({ + required _i12.StackThemeMetaData? themeMetaData, + }) => (super.noSuchMethod( - Invocation.method( - #fetchTheme, - [], - {#themeMetaData: themeMetaData}, - ), - returnValue: _i9.Future<_i14.Uint8List>.value(_i14.Uint8List(0)), - ) as _i9.Future<_i14.Uint8List>); + Invocation.method(#fetchTheme, [], {#themeMetaData: themeMetaData}), + returnValue: _i9.Future<_i14.Uint8List>.value(_i14.Uint8List(0)), + ) + as _i9.Future<_i14.Uint8List>); @override _i13.StackTheme? getTheme({required String? themeId}) => - (super.noSuchMethod(Invocation.method( - #getTheme, - [], - {#themeId: themeId}, - )) as _i13.StackTheme?); + (super.noSuchMethod(Invocation.method(#getTheme, [], {#themeId: themeId})) + as _i13.StackTheme?); } /// A class which mocks [NodeService]. @@ -354,41 +288,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { } @override - _i7.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( - Invocation.getter(#secureStorageInterface), - returnValue: _FakeSecureStorageInterface_4( - this, - Invocation.getter(#secureStorageInterface), - ), - ) as _i7.SecureStorageInterface); + _i7.SecureStorageInterface get secureStorageInterface => + (super.noSuchMethod( + Invocation.getter(#secureStorageInterface), + returnValue: _FakeSecureStorageInterface_4( + this, + Invocation.getter(#secureStorageInterface), + ), + ) + as _i7.SecureStorageInterface); @override - List<_i15.NodeModel> get primaryNodes => (super.noSuchMethod( - Invocation.getter(#primaryNodes), - returnValue: <_i15.NodeModel>[], - ) as List<_i15.NodeModel>); + List<_i15.NodeModel> get primaryNodes => + (super.noSuchMethod( + Invocation.getter(#primaryNodes), + returnValue: <_i15.NodeModel>[], + ) + as List<_i15.NodeModel>); @override - List<_i15.NodeModel> get nodes => (super.noSuchMethod( - Invocation.getter(#nodes), - returnValue: <_i15.NodeModel>[], - ) as List<_i15.NodeModel>); + List<_i15.NodeModel> get nodes => + (super.noSuchMethod( + Invocation.getter(#nodes), + returnValue: <_i15.NodeModel>[], + ) + as List<_i15.NodeModel>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i9.Future updateDefaults() => (super.noSuchMethod( - Invocation.method( - #updateDefaults, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future updateDefaults() => + (super.noSuchMethod( + Invocation.method(#updateDefaults, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future setPrimaryNodeFor({ @@ -397,56 +335,45 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( - Invocation.method( - #setPrimaryNodeFor, - [], - { - #coin: coin, - #node: node, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#setPrimaryNodeFor, [], { + #coin: coin, + #node: node, + #shouldNotifyListeners: shouldNotifyListeners, + }), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i15.NodeModel? getPrimaryNodeFor({required _i4.CryptoCurrency? currency}) => - (super.noSuchMethod(Invocation.method( - #getPrimaryNodeFor, - [], - {#currency: currency}, - )) as _i15.NodeModel?); + (super.noSuchMethod( + Invocation.method(#getPrimaryNodeFor, [], {#currency: currency}), + ) + as _i15.NodeModel?); @override List<_i15.NodeModel> getNodesFor(_i4.CryptoCurrency? coin) => (super.noSuchMethod( - Invocation.method( - #getNodesFor, - [coin], - ), - returnValue: <_i15.NodeModel>[], - ) as List<_i15.NodeModel>); + Invocation.method(#getNodesFor, [coin]), + returnValue: <_i15.NodeModel>[], + ) + as List<_i15.NodeModel>); @override _i15.NodeModel? getNodeById({required String? id}) => - (super.noSuchMethod(Invocation.method( - #getNodeById, - [], - {#id: id}, - )) as _i15.NodeModel?); + (super.noSuchMethod(Invocation.method(#getNodeById, [], {#id: id})) + as _i15.NodeModel?); @override - List<_i15.NodeModel> failoverNodesFor( - {required _i4.CryptoCurrency? currency}) => + List<_i15.NodeModel> failoverNodesFor({ + required _i4.CryptoCurrency? currency, + }) => (super.noSuchMethod( - Invocation.method( - #failoverNodesFor, - [], - {#currency: currency}, - ), - returnValue: <_i15.NodeModel>[], - ) as List<_i15.NodeModel>); + Invocation.method(#failoverNodesFor, [], {#currency: currency}), + returnValue: <_i15.NodeModel>[], + ) + as List<_i15.NodeModel>); @override _i9.Future save( @@ -455,34 +382,20 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #save, - [ - node, - password, - shouldNotifyListeners, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future delete( - String? id, - bool? shouldNotifyListeners, - ) => + Invocation.method(#save, [node, password, shouldNotifyListeners]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); + + @override + _i9.Future delete(String? id, bool? shouldNotifyListeners) => (super.noSuchMethod( - Invocation.method( - #delete, - [ - id, - shouldNotifyListeners, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#delete, [id, shouldNotifyListeners]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future setEnabledState( @@ -491,61 +404,46 @@ class MockNodeService extends _i1.Mock implements _i2.NodeService { bool? shouldNotifyListeners, ) => (super.noSuchMethod( - Invocation.method( - #setEnabledState, - [ - id, - enabled, - shouldNotifyListeners, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future updateCommunityNodes() => (super.noSuchMethod( - Invocation.method( - #updateCommunityNodes, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#setEnabledState, [ + id, + enabled, + shouldNotifyListeners, + ]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); + + @override + _i9.Future updateCommunityNodes() => + (super.noSuchMethod( + Invocation.method(#updateCommunityNodes, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } From e1b455b8f5f608c4f24fb766438ee3004751bc6b Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 13:42:51 -0600 Subject: [PATCH 111/178] update frostdart --- crypto_plugins/frostdart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/frostdart b/crypto_plugins/frostdart index 1bfdd5b908..a8c2121925 160000 --- a/crypto_plugins/frostdart +++ b/crypto_plugins/frostdart @@ -1 +1 @@ -Subproject commit 1bfdd5b9085d83a7f4d877e538270636f3a87a5e +Subproject commit a8c21219259429299eb9c262510152e55ab05e67 From 8f13100fb2e4505e763a031e820fef905a619afc Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 13:53:01 -0600 Subject: [PATCH 112/178] get android building --- android/settings.gradle | 2 +- pubspec.lock | 6 +++--- scripts/app_config/templates/pubspec.template | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/settings.gradle b/android/settings.gradle index 02fb0cfb0f..04c37e5f2b 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -19,7 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version '8.7.0' apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false + id "org.jetbrains.kotlin.android" version "2.2.20" apply false } include ":app" diff --git a/pubspec.lock b/pubspec.lock index 9af81c8945..97570d485f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -374,11 +374,11 @@ packages: dependency: "direct main" description: path: compat - ref: b2b12cfeaf15d057ea18b14c196e04f3002de2da - resolved-ref: b2b12cfeaf15d057ea18b14c196e04f3002de2da + ref: "44b8c0f8e1cc7ddbfa33c0b3f11279e64646138" + resolved-ref: "44b8c0f8e1cc7ddbfa33c0b3f11279e646461386" url: "https://github.com/cypherstack/cs_monero" source: git - version: "1.0.0" + version: "2.0.0" connectivity_plus: dependency: "direct main" description: diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index c084b0723d..ce18a36f9e 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -42,7 +42,7 @@ dependencies: git: url: https://github.com/cypherstack/cs_monero path: compat - ref: b2b12cfeaf15d057ea18b14c196e04f3002de2da + ref: 44b8c0f8e1cc7ddbfa33c0b3f11279e64646138 flutter_libepiccash: path: ./crypto_plugins/flutter_libepiccash From e86d4fd07268b2dad5b749dd374ebafb89489a7b Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 14:36:15 -0600 Subject: [PATCH 113/178] update libsparkmobile --- pubspec.lock | 4 ++-- scripts/app_config/templates/pubspec.template | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 97570d485f..d5149c0fcf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -946,8 +946,8 @@ packages: dependency: "direct main" description: path: "." - ref: "5f0dde009c969bf6425da35382305b2c0b65bc46" - resolved-ref: "5f0dde009c969bf6425da35382305b2c0b65bc46" + ref: "84a139a25ab1691762002fafcae351e3d444a5c7" + resolved-ref: "84a139a25ab1691762002fafcae351e3d444a5c7" url: "https://github.com/cypherstack/flutter_libsparkmobile.git" source: git version: "0.1.0" diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index ce18a36f9e..5c17c94d76 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -35,7 +35,7 @@ dependencies: flutter_libsparkmobile: git: url: https://github.com/cypherstack/flutter_libsparkmobile.git - ref: 5f0dde009c969bf6425da35382305b2c0b65bc46 + ref: 84a139a25ab1691762002fafcae351e3d444a5c7 # cs_monero compat (unpublished) compat: From fdf9b5cd79dc6e11fc15ec265e8e65e6449b71a0 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 14:57:29 -0600 Subject: [PATCH 114/178] update coinlib --- pubspec.lock | 8 ++++---- scripts/app_config/templates/pubspec.template | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index d5149c0fcf..b2716c48da 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -348,8 +348,8 @@ packages: dependency: "direct overridden" description: path: coinlib - ref: da1b3659e296660ac2b36f81d155d2362a2b3195 - resolved-ref: da1b3659e296660ac2b36f81d155d2362a2b3195 + ref: d212a8f974bf30be82ce486bf60d7135d80eb6a2 + resolved-ref: d212a8f974bf30be82ce486bf60d7135d80eb6a2 url: "https://www.github.com/julian-CStack/coinlib" source: git version: "4.1.0" @@ -357,8 +357,8 @@ packages: dependency: "direct main" description: path: coinlib_flutter - ref: da1b3659e296660ac2b36f81d155d2362a2b3195 - resolved-ref: da1b3659e296660ac2b36f81d155d2362a2b3195 + ref: d212a8f974bf30be82ce486bf60d7135d80eb6a2 + resolved-ref: d212a8f974bf30be82ce486bf60d7135d80eb6a2 url: "https://www.github.com/julian-CStack/coinlib" source: git version: "4.0.0" diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index 5c17c94d76..e335456f09 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -176,7 +176,7 @@ dependencies: git: url: https://www.github.com/julian-CStack/coinlib path: coinlib_flutter - ref: da1b3659e296660ac2b36f81d155d2362a2b3195 + ref: d212a8f974bf30be82ce486bf60d7135d80eb6a2 electrum_adapter: git: url: https://github.com/cypherstack/electrum_adapter.git @@ -268,13 +268,13 @@ dependency_overrides: git: url: https://www.github.com/julian-CStack/coinlib path: coinlib - ref: da1b3659e296660ac2b36f81d155d2362a2b3195 + ref: d212a8f974bf30be82ce486bf60d7135d80eb6a2 coinlib_flutter: git: url: https://www.github.com/julian-CStack/coinlib path: coinlib_flutter - ref: da1b3659e296660ac2b36f81d155d2362a2b3195 + ref: d212a8f974bf30be82ce486bf60d7135d80eb6a2 bip47: git: From e11fa09bec8c148118806d54dda1873b05719a0b Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 14:58:28 -0600 Subject: [PATCH 115/178] remove duplicate and unused code --- test/services/node_service_test.dart | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/test/services/node_service_test.dart b/test/services/node_service_test.dart index 8d4d664a43..efae567278 100644 --- a/test/services/node_service_test.dart +++ b/test/services/node_service_test.dart @@ -166,28 +166,6 @@ void main() { clearnetEnabled: true, isPrimary: true, ); - final nodeD = NodeModel( - host: "host3", - port: 423, - name: "btcnode", - id: "pnodeID3", - useSSL: true, - enabled: true, - coinName: "mimblewimblecoin", - isFailover: true, - isDown: false, - ); - final nodeD = NodeModel( - host: "host3", - port: 423, - name: "btcnode", - id: "pnodeID3", - useSSL: true, - enabled: true, - coinName: "mimblewimblecoin", - isFailover: true, - isDown: false, - ); setUp(() async { await NodeService( From 639082bb42aefacecba57cbd407ef11588cc82e1 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 Sep 2025 17:43:26 -0600 Subject: [PATCH 116/178] update mwebd lib --- pubspec.lock | 4 ++-- scripts/app_config/templates/pubspec.template | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index b2716c48da..dd619b202f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -987,10 +987,10 @@ packages: dependency: "direct main" description: name: flutter_mwebd - sha256: "73b35b6eaccb6e1be7eb37e04bcc94f091244fa31b8aedc17e4119c580a7a747" + sha256: c5d1f628a037a12cd558c3c37fec46438c4d8d07e108a7f7cc8969806de13993 url: "https://pub.dev" source: hosted - version: "0.0.1-pre.7" + version: "0.0.1-pre.8" flutter_native_splash: dependency: "direct main" description: diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index e335456f09..03c8ac3495 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -223,7 +223,7 @@ dependencies: path: ^1.9.1 cs_salvium: ^1.2.1 cs_salvium_flutter_libs: ^1.0.4 - flutter_mwebd: ^0.0.1-pre.7 + flutter_mwebd: ^0.0.1-pre.8 mweb_client: ^0.2.0 fixnum: ^1.1.1 From fbbb108d4a2c602f894f77945bbde0d4a50ef9a7 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 25 Sep 2025 10:39:41 -0600 Subject: [PATCH 117/178] update tor lib --- android/.gitignore | 3 ++- pubspec.lock | 4 ++-- scripts/app_config/templates/pubspec.template | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/android/.gitignore b/android/.gitignore index bb7ef20812..d4a6340b42 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -7,4 +7,5 @@ gradle-wrapper.jar /key.properties app/upload-keystore-campfire.jks app/upload-keystore-stackwallet.jks -GeneratedPluginRegistrant.java \ No newline at end of file +GeneratedPluginRegistrant.java +/.kotlin/ diff --git a/pubspec.lock b/pubspec.lock index dd619b202f..f294896fa7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -2209,8 +2209,8 @@ packages: dependency: "direct main" description: path: "." - ref: "16c9e709e984ec89e8715ce378b038c93ad7add3" - resolved-ref: "16c9e709e984ec89e8715ce378b038c93ad7add3" + ref: "21077186e6bf773ec8a7cd57ef149b2cee5daa7b" + resolved-ref: "21077186e6bf773ec8a7cd57ef149b2cee5daa7b" url: "https://github.com/cypherstack/tor.git" source: git version: "0.0.1" diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index 03c8ac3495..06f48c23ff 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -68,7 +68,7 @@ dependencies: tor_ffi_plugin: git: url: https://github.com/cypherstack/tor.git - ref: 16c9e709e984ec89e8715ce378b038c93ad7add3 + ref: 21077186e6bf773ec8a7cd57ef149b2cee5daa7b fusiondart: git: From ac2e84ca9151627a98dc0da175c4de2ed52ba38b Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 25 Sep 2025 11:26:36 -0600 Subject: [PATCH 118/178] update xelis lib --- pubspec.lock | 6 +++--- scripts/app_config/templates/pubspec.template | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index f294896fa7..a1b9af3fea 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -2516,9 +2516,9 @@ packages: dependency: "direct main" description: path: "." - ref: "v0.1.1" - resolved-ref: ee7a5756f5f403e6a371990c2817f38eb21a97b2 - url: "https://github.com/xelis-project/xelis-flutter-ffi.git" + ref: "5dd5c50713160fa15fb06ff44886ae035eed62fd" + resolved-ref: "5dd5c50713160fa15fb06ff44886ae035eed62fd" + url: "https://github.com/cypherstack/xelis-flutter-ffi.git" source: git version: "0.1.1" xml: diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index 06f48c23ff..78f73adf66 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -29,8 +29,8 @@ dependencies: xelis_flutter: git: - url: https://github.com/xelis-project/xelis-flutter-ffi.git - ref: v0.1.1 + url: https://github.com/cypherstack/xelis-flutter-ffi.git + ref: 5dd5c50713160fa15fb06ff44886ae035eed62fd flutter_libsparkmobile: git: From 8855e5a605166dc12ef7a639477a45fddbe6e26a Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 2 Oct 2025 11:07:40 -0600 Subject: [PATCH 119/178] rename pubspec template file --- scripts/app_config/templates/configure_template_files.sh | 2 +- .../templates/{pubspec.template => pubspec.template.yaml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename scripts/app_config/templates/{pubspec.template => pubspec.template.yaml} (100%) diff --git a/scripts/app_config/templates/configure_template_files.sh b/scripts/app_config/templates/configure_template_files.sh index 35cb26219a..b4731683da 100755 --- a/scripts/app_config/templates/configure_template_files.sh +++ b/scripts/app_config/templates/configure_template_files.sh @@ -4,7 +4,7 @@ set -x -e export TEMPLATES_DIR="${APP_PROJECT_ROOT_DIR}/scripts/app_config/templates" -export T_PUBSPEC="${TEMPLATES_DIR}/pubspec.template" +export T_PUBSPEC="${TEMPLATES_DIR}/pubspec.template.yaml" export ACTUAL_PUBSPEC="${APP_PROJECT_ROOT_DIR}/pubspec.yaml" export ANDROID_TF_0="android/app/build.gradle" diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template.yaml similarity index 100% rename from scripts/app_config/templates/pubspec.template rename to scripts/app_config/templates/pubspec.template.yaml From 93ff3407a6ab757a2363a1172cf0e5265d45a07a Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 2 Oct 2025 15:02:54 -0600 Subject: [PATCH 120/178] WIP --- .gitignore | 3 + analysis_options.yaml | 2 + .../wallet/impl/mimblewimblecoin_wallet.dart | 159 ++++---- lib/wl_gen/interfaces/libmwc_interface.dart | 198 ++++++++++ scripts/app_config/configure_stack_wallet.sh | 25 ++ .../templates/pubspec.template.yaml | 6 +- tool/gen_interfaces.dart | 83 +++++ tool/process_pubspec_deps.dart | 96 +++++ .../MWC_libmwc_interface_impl.template.dart | 348 ++++++++++++++++++ 9 files changed, 829 insertions(+), 91 deletions(-) create mode 100644 lib/wl_gen/interfaces/libmwc_interface.dart create mode 100644 tool/gen_interfaces.dart create mode 100644 tool/process_pubspec_deps.dart create mode 100644 tool/wl_templates/MWC_libmwc_interface_impl.template.dart diff --git a/.gitignore b/.gitignore index 30fb5a6e17..e360da5157 100644 --- a/.gitignore +++ b/.gitignore @@ -112,3 +112,6 @@ crypto_plugins/cs_monero/built_outputs crypto_plugins/cs_monero/build crypto_plugins/*.diff /devtools_options.yaml + +# generated interfaces +lib/wl_gen/generated/ \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml index db030aa148..1252b9a85b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -18,6 +18,8 @@ analyzer: - "crypto_plugins/**" - "bin/cache/**" - "lib/generated_plugin_registrant.dart" + - "lib/wl_gen/generated/**" + - '**/*.template.dart' # For more information see: # https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks diff --git a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart index 8eec728dbe..3850cb7500 100644 --- a/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart +++ b/lib/wallets/wallet/impl/mimblewimblecoin_wallet.dart @@ -4,9 +4,6 @@ import 'dart:io'; import 'package:decimal/decimal.dart'; import 'package:flutter/foundation.dart'; -import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; -import 'package:flutter_libmwc/models/transaction.dart' - as mimblewimblecoin_models; import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; @@ -33,6 +30,7 @@ import '../../../utilities/flutter_secure_storage_interface.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; import '../../../utilities/test_mwcmqs_connection.dart'; +import '../../../wl_gen/interfaces/libmwc_interface.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../models/tx_data.dart'; import '../intermediate/bip39_wallet.dart'; @@ -109,10 +107,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (password == null) { throw Exception('Wallet password not found'); } - final opened = await mimblewimblecoin.Libmwc.openWallet( - config: config, - password: password, - ); + final opened = await libMwc.openWallet(config: config, password: password); await secureStorageInterface.write( key: '${walletId}_wallet', value: opened, @@ -123,10 +118,11 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Returns an empty String on success, error message on failure. Future cancelPendingTransactionAndPost(String txSlateId) async { try { - final String wallet = - (await secureStorageInterface.read(key: '${walletId}_wallet'))!; + final String wallet = (await secureStorageInterface.read( + key: '${walletId}_wallet', + ))!; - final result = await mimblewimblecoin.Libmwc.cancelTransaction( + final result = await libMwc.cancelTransaction( wallet: wallet, transactionId: txSlateId, ); @@ -177,7 +173,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final handle = await _ensureWalletOpen(); // Generate S1 slate JSON. - final s1Json = await mimblewimblecoin.Libmwc.txInit( + final s1Json = await libMwc.txInit( wallet: handle, amount: amount.raw.toInt(), minimumConfirmations: @@ -187,7 +183,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); // Encode to slatepack. - final encoded = await mimblewimblecoin.Libmwc.encodeSlatepack( + final encoded = await libMwc.encodeSlatepack( slateJson: s1Json, recipientAddress: recipientAddress, encrypt: encrypt, @@ -260,15 +256,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { final handle = await secureStorageInterface.read( key: '${walletId}_wallet', ); - final result = - handle != null - ? await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( - wallet: handle, - slatepack: slatepack, - ) - : await mimblewimblecoin.Libmwc.decodeSlatepack( - slatepack: slatepack, - ); + final result = handle != null + ? await libMwc.decodeSlatepackWithWallet( + wallet: handle, + slatepack: slatepack, + ) + : await libMwc.decodeSlatepack(slatepack: slatepack); return SlatepackDecodeResult( success: true, @@ -289,19 +282,19 @@ class MimblewimblecoinWallet extends Bip39Wallet { final handle = await _ensureWalletOpen(); // Decode to get slate JSON and sender address. - final decoded = await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( + final decoded = await libMwc.decodeSlatepackWithWallet( wallet: handle, slatepack: slatepack, ); // Receive and get updated slate JSON. - final received = await mimblewimblecoin.Libmwc.txReceiveDetailed( + final received = await libMwc.txReceiveDetailed( wallet: handle, slateJson: decoded.slateJson, ); // Encode response back to sender if address available. - final encoded = await mimblewimblecoin.Libmwc.encodeSlatepack( + final encoded = await libMwc.encodeSlatepack( slateJson: received.slateJson, recipientAddress: decoded.senderAddress, encrypt: decoded.senderAddress != null, @@ -328,13 +321,13 @@ class MimblewimblecoinWallet extends Bip39Wallet { final handle = await _ensureWalletOpen(); // Decode to get slate JSON. - final decoded = await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( + final decoded = await libMwc.decodeSlatepackWithWallet( wallet: handle, slatepack: slatepack, ); // Finalize transaction. - final finalized = await mimblewimblecoin.Libmwc.txFinalize( + final finalized = await libMwc.txFinalize( wallet: handle, slateJson: decoded.slateJson, ); @@ -358,7 +351,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final wallet = await secureStorageInterface.read( key: '${walletId}_wallet', ); - mimblewimblecoin.Libmwc.startMwcMqsListener( + libMwc.startMwcMqsListener( wallet: wallet!, mwcmqsConfig: mwcmqsConfig.toString(), ); @@ -371,7 +364,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Stop MWCMQS listener. Future stopSlatepackListener() async { try { - mimblewimblecoin.Libmwc.stopMwcMqsListener(); + libMwc.stopMwcMqsListener(); } catch (e, s) { Logging.instance.e('Failed to stop slatepack listener: $e\n$s'); } @@ -379,7 +372,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { /// Validate MWC address. bool validateMwcAddress(String address) { - return mimblewimblecoin.Libmwc.validateSendAddress(address: address); + return libMwc.validateSendAddress(address: address); } /// Detect if an address is a slatepack. @@ -422,15 +415,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); // Decode the slatepack - final decoded = - wallet != null - ? await mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( - wallet: wallet, - slatepack: slatepack, - ) - : await mimblewimblecoin.Libmwc.decodeSlatepack( - slatepack: slatepack, - ); + final decoded = wallet != null + ? await libMwc.decodeSlatepackWithWallet( + wallet: wallet, + slatepack: slatepack, + ) + : await libMwc.decodeSlatepack(slatepack: slatepack); // Parse the slate JSON to extract metadata final slateData = jsonDecode(decoded.slateJson); @@ -610,7 +600,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); try { final available = info.cachedBalance.spendable.raw.toInt(); - final transactionFees = await mimblewimblecoin.Libmwc.getTransactionFees( + final transactionFees = await libMwc.getTransactionFees( wallet: wallet!, amount: satoshiAmount, minimumConfirmations: cryptoCurrency.minConfirms, @@ -619,8 +609,9 @@ class MimblewimblecoinWallet extends Bip39Wallet { int realFee = 0; try { - realFee = - (Decimal.parse(transactionFees.fee.toString())).toBigInt().toInt(); + realFee = (Decimal.parse( + transactionFees.fee.toString(), + )).toBigInt().toInt(); } catch (e, s) { //todo: come back to this debugPrint("$e $s"); @@ -639,7 +630,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (!syncMutex.isLocked) { await syncMutex.protect(() async { // How does getWalletBalances start syncing???? - await mimblewimblecoin.Libmwc.getWalletBalances( + await libMwc.getWalletBalances( wallet: wallet!, refreshFromNode: refreshFromNode, minimumConfirmations: 10, @@ -661,7 +652,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { _allWalletBalances() async { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); const refreshFromNode = 0; - return await mimblewimblecoin.Libmwc.getWalletBalances( + return await libMwc.getWalletBalances( wallet: wallet!, refreshFromNode: refreshFromNode, minimumConfirmations: cryptoCurrency.minConfirms, @@ -729,7 +720,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ) async { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); - final walletAddress = await mimblewimblecoin.Libmwc.getAddressInfo( + final walletAddress = await libMwc.getAddressInfo( wallet: wallet!, index: index, ); @@ -752,7 +743,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Future _startScans() async { try { //First stop the current listener - mimblewimblecoin.Libmwc.stopMwcMqsListener(); + libMwc.stopMwcMqsListener(); final wallet = await secureStorageInterface.read( key: '${walletId}_wallet', ); @@ -774,7 +765,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { "chainHeight: $chainHeight, lastScannedBlock: $lastScannedBlock", ); - final int nextScannedBlock = await mimblewimblecoin.Libmwc.scanOutputs( + final int nextScannedBlock = await libMwc.scanOutputs( wallet: wallet!, startHeight: lastScannedBlock, numberOfBlocks: scanChunkSize, @@ -809,7 +800,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { Logging.instance.i("STARTING WALLET LISTENER ...."); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); - mimblewimblecoin.Libmwc.startMwcMqsListener( + libMwc.startMwcMqsListener( wallet: wallet!, mwcmqsConfig: mwcmqsConfig.toString(), ); @@ -877,7 +868,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String stringConfig = await _getConfig(); final MwcMqsConfigModel mwcmqsConfig = await getMwcMqsConfig(); //if (!_logsInitialized) { - // await mimblewimblecoin.Libmwc.initLogs(config: stringConfig); + // await libMwc.initLogs(config: stringConfig); // _logsInitialized = true; // Set flag to true after initializing // } await secureStorageInterface.write( @@ -895,7 +886,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { final String name = walletId; - await mimblewimblecoin.Libmwc.initializeNewWallet( + await libMwc.initializeNewWallet( config: stringConfig, mnemonic: mnemonicString, password: password, @@ -903,7 +894,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); //Open wallet - encodedWallet = await mimblewimblecoin.Libmwc.openWallet( + encodedWallet = await libMwc.openWallet( config: stringConfig, password: password, ); @@ -937,14 +928,14 @@ class MimblewimblecoinWallet extends Bip39Wallet { try { final config = await _getRealConfig(); //if (!_logsInitialized) { - // await mimblewimblecoin.Libmwc.initLogs(config: config); + // await libMwc.initLogs(config: config); // _logsInitialized = true; // Set flag to true after initializing //} final password = await secureStorageInterface.read( key: '${walletId}_password', ); - final walletOpen = await mimblewimblecoin.Libmwc.openWallet( + final walletOpen = await libMwc.openWallet( config: config, password: password!, ); @@ -991,7 +982,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { if (receiverAddress.startsWith("http://") || receiverAddress.startsWith("https://")) { - transaction = await mimblewimblecoin.Libmwc.txHttpSend( + transaction = await libMwc.txHttpSend( wallet: wallet!, selectionStrategyIsAll: 0, minimumConfirmations: cryptoCurrency.minConfirms, @@ -1000,7 +991,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { address: txData.recipients!.first.address, ); } else if (receiverAddress.startsWith("mwcmqs://")) { - transaction = await mimblewimblecoin.Libmwc.createTransaction( + transaction = await libMwc.createTransaction( wallet: wallet!, amount: txData.recipients!.first.amount.raw.toInt(), address: txData.recipients!.first.address, @@ -1129,7 +1120,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { value: mwcmqsConfig.toString(), ); - await mimblewimblecoin.Libmwc.recoverWallet( + await libMwc.recoverWallet( config: stringConfig, password: password, mnemonic: await getMnemonic(), @@ -1153,7 +1144,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); //Open Wallet - final walletOpen = await mimblewimblecoin.Libmwc.openWallet( + final walletOpen = await libMwc.openWallet( config: stringConfig, password: password, ); @@ -1331,20 +1322,19 @@ class MimblewimblecoinWallet extends Bip39Wallet { ); const refreshFromNode = 1; - final myAddresses = - await mainDB - .getAddresses(walletId) - .filter() - .typeEqualTo(AddressType.mimbleWimble) - .and() - .subTypeEqualTo(AddressSubType.receiving) - .and() - .valueIsNotEmpty() - .valueProperty() - .findAll(); + final myAddresses = await mainDB + .getAddresses(walletId) + .filter() + .typeEqualTo(AddressType.mimbleWimble) + .and() + .subTypeEqualTo(AddressSubType.receiving) + .and() + .valueIsNotEmpty() + .valueProperty() + .findAll(); final myAddressesSet = myAddresses.toSet(); - final transactions = await mimblewimblecoin.Libmwc.getTransactions( + final transactions = await libMwc.getTransactions( wallet: wallet!, refreshFromNode: refreshFromNode, ); @@ -1357,13 +1347,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { Logging.instance.i("tx: $tx"); final isIncoming = - tx.txType == mimblewimblecoin_models.TransactionType.TxReceived || - tx.txType == - mimblewimblecoin_models.TransactionType.TxReceivedCancelled; + libMwc.txTypeIsReceived(tx.txType) || + libMwc.txTypeIsReceiveCancelled(tx.txType); final slateId = tx.txSlateId; final commitId = slatesToCommits[slateId]?['commitId'] as String?; - final numberOfMessages = tx.messages?.messages.length; - final onChainNote = tx.messages?.messages[0].message; + final numberOfMessages = tx.messages?.length; + final onChainNote = tx.messages?.first.message; final addressFrom = slatesToCommits[slateId]?["from"] as String?; final addressTo = slatesToCommits[slateId]?["to"] as String?; @@ -1446,15 +1435,12 @@ class MimblewimblecoinWallet extends Bip39Wallet { "slateId": slateId, "onChainNote": onChainNote, "isCancelled": - tx.txType == - mimblewimblecoin_models.TransactionType.TxSentCancelled || - tx.txType == - mimblewimblecoin_models.TransactionType.TxReceivedCancelled, - "overrideFee": - Amount( - rawValue: BigInt.from(fee), - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), + libMwc.txTypeIsSentCancelled(tx.txType) || + libMwc.txTypeIsReceiveCancelled(tx.txType), + "overrideFee": Amount( + rawValue: BigInt.from(fee), + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), }; final txn = TransactionV2( @@ -1531,9 +1517,7 @@ class MimblewimblecoinWallet extends Bip39Wallet { @override Future updateChainHeight() async { final config = await _getRealConfig(); - final latestHeight = await mimblewimblecoin.Libmwc.getChainHeight( - config: config, - ); + final latestHeight = await libMwc.getChainHeight(config: config); await info.updateCachedChainHeight( newHeight: latestHeight, isar: mainDB.isar, @@ -1605,10 +1589,7 @@ Future deleteMimblewimblecoinWallet({ return "Tried to delete non existent mimblewimblecoin wallet file with walletId=$walletId"; } else { try { - return mimblewimblecoin.Libmwc.deleteWallet( - wallet: wallet, - config: config!, - ); + return libMwc.deleteWallet(wallet: wallet, config: config!); } catch (e, s) { Logging.instance.e("$e\n$s"); return "deleteMimblewimblecoinWallet($walletId) failed..."; diff --git a/lib/wl_gen/interfaces/libmwc_interface.dart b/lib/wl_gen/interfaces/libmwc_interface.dart new file mode 100644 index 0000000000..60536cfb96 --- /dev/null +++ b/lib/wl_gen/interfaces/libmwc_interface.dart @@ -0,0 +1,198 @@ +export '../generated/libmwc_interface_impl.dart'; + +abstract class LibMwcInterface { + const LibMwcInterface(); + + bool txTypeIsReceived(Enum value); + bool txTypeIsReceiveCancelled(Enum value); + bool txTypeIsSentCancelled(Enum value); + + Future initializeNewWallet({ + required String config, + required String mnemonic, + required String password, + required String name, + }); + + Future openWallet({required String config, required String password}); + + Future recoverWallet({ + required String config, + required String password, + required String mnemonic, + required String name, + }); + + Future<({String commitId, String slateId})> txHttpSend({ + required String wallet, + required int selectionStrategyIsAll, + required int minimumConfirmations, + required String message, + required int amount, + required String address, + }); + + Future<({String commitId, String slateId})> createTransaction({ + required String wallet, + required int amount, + required String address, + required int secretKeyIndex, + required String mwcmqsConfig, + required int minimumConfirmations, + required String note, + }); + + Future cancelTransaction({ + required String wallet, + required String transactionId, + }); + + Future txInit({ + required String wallet, + required int amount, + int minimumConfirmations = 1, + bool selectionStrategyIsAll = false, + String message = '', + }); + + Future> getTransactions({ + required String wallet, + required int refreshFromNode, + }); + + Future<({String? recipientAddress, String slatepack, bool wasEncrypted})> + encodeSlatepack({ + required String slateJson, + String? recipientAddress, + bool encrypt = false, + String? wallet, + }); + Future< + ({ + String? recipientAddress, + String? senderAddress, + String slateJson, + bool wasEncrypted, + }) + > + decodeSlatepackWithWallet({ + required String wallet, + required String slatepack, + }); + + Future< + ({ + String? recipientAddress, + String? senderAddress, + String slateJson, + bool wasEncrypted, + }) + > + decodeSlatepack({required String slatepack}); + + Future<({String commitId, String slateId, String slateJson})> + txReceiveDetailed({required String wallet, required String slateJson}); + + Future<({String commitId, String slateId})> txFinalize({ + required String wallet, + required String slateJson, + }); + + void startMwcMqsListener({ + required String wallet, + required String mwcmqsConfig, + }); + + void stopMwcMqsListener(); + + bool validateSendAddress({required String address}); + + Future<({int fee, bool strategyUseAll, int total})> getTransactionFees({ + required String wallet, + required int amount, + required int minimumConfirmations, + required int available, + }); + + Future< + ({ + double awaitingFinalization, + double pending, + double spendable, + double total, + }) + > + getWalletBalances({ + required String wallet, + required int refreshFromNode, + required int minimumConfirmations, + }); + + Future getAddressInfo({required String wallet, required int index}); + + Future scanOutputs({ + required String wallet, + required int startHeight, + required int numberOfBlocks, + }); + + Future getChainHeight({required String config}); + + Future deleteWallet({required String wallet, required String config}); +} + +class MwcTransaction { + final String parentKeyId; + final int id; + final String? txSlateId; + final Enum txType; + final String creationTs; + final String confirmationTs; + final bool confirmed; + final int numInputs; + final int numOutputs; + final String amountCredited; + final String amountDebited; + final String? fee; + final String? ttlCutoffHeight; + final List? messages; + final String? storedTx; + final String? kernelExcess; + final int? kernelLookupMinHeight; + final String? paymentProof; + + MwcTransaction({ + required this.parentKeyId, + required this.id, + this.txSlateId, + required this.txType, + required this.creationTs, + required this.confirmationTs, + required this.confirmed, + required this.numInputs, + required this.numOutputs, + required this.amountCredited, + required this.amountDebited, + this.fee, + this.ttlCutoffHeight, + this.messages, + this.storedTx, + this.kernelExcess, + this.kernelLookupMinHeight, + this.paymentProof, + }); +} + +class MwcMessage { + final String id; + final String publicKey; + final String? message; + final String? messageSig; + + MwcMessage({ + required this.id, + required this.publicKey, + this.message, + this.messageSig, + }); +} diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index b407b7d473..b4f503d346 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -23,6 +23,31 @@ else sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" fi +dart "${APP_PROJECT_ROOT_DIR}/tool/process_pubspec_deps.dart" \ + "${PUBSPEC_FILE}" \ + MWC \ + MWEBD \ + XMR \ + SAL \ + TOR \ + EPIC \ + FIRO \ + XEL \ + FROST + +dart "${APP_PROJECT_ROOT_DIR}/tool/gen_interfaces.dart" \ + "${APP_PROJECT_ROOT_DIR}/tool/wl_templates" \ + "${APP_PROJECT_ROOT_DIR}/lib/wl_gen/generated" \ + MWC \ + MWEBD \ + XMR \ + SAL \ + TOR \ + EPIC \ + FIRO \ + XEL \ + FROST + pushd "${APP_PROJECT_ROOT_DIR}" BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H") popd diff --git a/scripts/app_config/templates/pubspec.template.yaml b/scripts/app_config/templates/pubspec.template.yaml index 78f73adf66..98a63dbb86 100644 --- a/scripts/app_config/templates/pubspec.template.yaml +++ b/scripts/app_config/templates/pubspec.template.yaml @@ -47,8 +47,10 @@ dependencies: flutter_libepiccash: path: ./crypto_plugins/flutter_libepiccash - flutter_libmwc: - path: ./crypto_plugins/flutter_libmwc +# %%ENABLE_MWC%% +# flutter_libmwc: +# path: ./crypto_plugins/flutter_libmwc +# %%END_ENABLE_MWC%% bitcoindart: git: diff --git a/tool/gen_interfaces.dart b/tool/gen_interfaces.dart new file mode 100644 index 0000000000..fc48494555 --- /dev/null +++ b/tool/gen_interfaces.dart @@ -0,0 +1,83 @@ +import 'dart:io'; + +void main(List args) { + if (args.length < 2) { + print( + 'Usage: dart process_pubspec_deps.dart [marker2 ...]', + ); + exit(1); + } + + final generatedDir = Directory(args[1]); + if (!generatedDir.existsSync()) generatedDir.createSync(); + + final templatesDir = args[0]; + + final List onFilePrefixes = args.length > 2 ? args.sublist(2) : []; + + final templates = Directory(templatesDir).listSync().whereType(); + + print(templates.map((e) => e.uri.pathSegments.last)); + + for (final template in templates) { + final templateName = template.uri.pathSegments.last; + + final prefix = templateName.split("_").first; + + final outfileUri = generatedDir.uri.resolve( + templateName + .replaceFirst("${prefix}_", "") + .replaceFirst(".template.", "."), + ); + + _genFile( + outfileUri.toFilePath(), + template, + onFilePrefixes.contains(prefix), + ); + } +} + +void _genFile(String outputFilePath, File template, bool on) { + final lines = template.readAsLinesSync(); + + // add empty line and gen warning + + final List updatedLines = [ + "// GENERATED CODE - DO NOT MODIFY BY HAND", + "", + ]; + + final keepMarker = on ? "ON" : "OFF"; + final dropMarker = on ? "OFF" : "ON"; + + bool? keepLine; + + for (final line in lines) { + if (line.trim() == "//$keepMarker") { + keepLine = true; + continue; + } + + if (line.trim() == "//$dropMarker") { + keepLine = false; + continue; + } + + if (line.trim().startsWith("//END_")) { + keepLine = null; + continue; + } + + if (keepLine != false) { + updatedLines.add(line); + } + } + + // add empty line + if (updatedLines.last.isNotEmpty) updatedLines.add(""); + + File(outputFilePath).writeAsStringSync(updatedLines.join('\n')); + + print("Done gen of $template => $outputFilePath"); +} diff --git a/tool/process_pubspec_deps.dart b/tool/process_pubspec_deps.dart new file mode 100644 index 0000000000..279dfe26af --- /dev/null +++ b/tool/process_pubspec_deps.dart @@ -0,0 +1,96 @@ +import 'dart:io'; + +void main(List args) { + if (args.isEmpty) { + print( + 'Usage: dart process_pubspec_deps.dart [marker2 ...]', + ); + exit(1); + } + + if (args.length == 1) { + print('No markers specified. Nothing to do.'); + exit(0); + } + + _process(args[0], args.sublist(1)); +} + +void _process(final String filePath, final List enableCoinMarkers) { + final lines = File(filePath).readAsLinesSync(); + + String? activeMarker; + final List updatedLines = []; + + for (final line in lines) { + bool markerSet = false; + + // Check if line starts any marker block + for (final marker in enableCoinMarkers) { + if (line.contains('# %%ENABLE_$marker%%')) { + activeMarker = marker; + markerSet = true; + updatedLines.add(line); + break; + } + } + + if (markerSet) continue; + + // Check if line ends the active marker block + if (activeMarker != null && + line.contains('# %%END_ENABLE_$activeMarker%%')) { + activeMarker = null; + updatedLines.add(line); + continue; + } + + // If inside an active marker block, uncomment line + if (activeMarker != null) { + updatedLines.add(line.replaceFirst("#", "")); + } else { + updatedLines.add(line); + } + } + + File(filePath).writeAsStringSync(updatedLines.join('\n')); + print( + 'Updated pubspec.yaml with enabled blocks: ${enableCoinMarkers.join(", ")}', + ); +} + +void _genFile(String outputFilePath, String template, bool on) { + final lines = File(template).readAsLinesSync(); + + // add empty line and gen warning + + final List updatedLines = [ + "// GENERATED CODE - DO NOT MODIFY BY HAND", + "", + ]; + + final keepMarker = on ? "ON" : "OFF"; + + bool? keepLine; + + for (final line in lines) { + if (line.trim() == "//$keepMarker") { + keepLine = true; + continue; + } + + if (line.trim() == "//END_$keepMarker") { + keepLine = false; + continue; + } + + if (keepLine != false) { + updatedLines.add(line); + } + } + + // add empty line + if (updatedLines.last.isNotEmpty) updatedLines.add(""); + + File(outputFilePath).writeAsStringSync(updatedLines.join('\n')); +} diff --git a/tool/wl_templates/MWC_libmwc_interface_impl.template.dart b/tool/wl_templates/MWC_libmwc_interface_impl.template.dart new file mode 100644 index 0000000000..356c071ec9 --- /dev/null +++ b/tool/wl_templates/MWC_libmwc_interface_impl.template.dart @@ -0,0 +1,348 @@ +//ON +import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; +import 'package:flutter_libmwc/models/transaction.dart' + as mimblewimblecoin_models; + +//END_ON +import '../interfaces/libmwc_interface.dart'; + +LibMwcInterface get libMwc => _getLibMwc(); + +//OFF +LibMwcInterface _getLibMwc() => throw Exception("MWC not enabled!"); + +//END_OFF + +//ON +LibMwcInterface _getLibMwc() => const _LibMwcInterfaceImpl(); + +final class _LibMwcInterfaceImpl extends LibMwcInterface { + const _LibMwcInterfaceImpl(); + + @override + Future cancelTransaction({ + required String wallet, + required String transactionId, + }) { + return mimblewimblecoin.Libmwc.cancelTransaction( + wallet: wallet, + transactionId: transactionId, + ); + } + + @override + Future<({String commitId, String slateId})> createTransaction({ + required String wallet, + required int amount, + required String address, + required int secretKeyIndex, + required String mwcmqsConfig, + required int minimumConfirmations, + required String note, + }) { + return mimblewimblecoin.Libmwc.createTransaction( + wallet: wallet, + amount: amount, + address: address, + secretKeyIndex: secretKeyIndex, + mwcmqsConfig: mwcmqsConfig, + minimumConfirmations: minimumConfirmations, + note: note, + ); + } + + @override + Future< + ({ + String? recipientAddress, + String? senderAddress, + String slateJson, + bool wasEncrypted, + }) + > + decodeSlatepack({required String slatepack}) { + return mimblewimblecoin.Libmwc.decodeSlatepack(slatepack: slatepack); + } + + @override + Future< + ({ + String? recipientAddress, + String? senderAddress, + String slateJson, + bool wasEncrypted, + }) + > + decodeSlatepackWithWallet({ + required String wallet, + required String slatepack, + }) { + return mimblewimblecoin.Libmwc.decodeSlatepackWithWallet( + wallet: wallet, + slatepack: slatepack, + ); + } + + @override + Future deleteWallet({ + required String wallet, + required String config, + }) { + return mimblewimblecoin.Libmwc.deleteWallet(wallet: wallet, config: config); + } + + @override + Future<({String? recipientAddress, String slatepack, bool wasEncrypted})> + encodeSlatepack({ + required String slateJson, + String? recipientAddress, + bool encrypt = false, + String? wallet, + }) { + return mimblewimblecoin.Libmwc.encodeSlatepack( + slateJson: slateJson, + recipientAddress: recipientAddress, + encrypt: encrypt, + wallet: wallet, + ); + } + + @override + Future getAddressInfo({required String wallet, required int index}) { + return mimblewimblecoin.Libmwc.getAddressInfo(wallet: wallet, index: index); + } + + @override + Future getChainHeight({required String config}) { + return mimblewimblecoin.Libmwc.getChainHeight(config: config); + } + + @override + Future<({int fee, bool strategyUseAll, int total})> getTransactionFees({ + required String wallet, + required int amount, + required int minimumConfirmations, + required int available, + }) { + return mimblewimblecoin.Libmwc.getTransactionFees( + wallet: wallet, + amount: amount, + minimumConfirmations: minimumConfirmations, + available: available, + ); + } + + @override + Future> getTransactions({ + required String wallet, + required int refreshFromNode, + }) async { + final transactions = await mimblewimblecoin.Libmwc.getTransactions( + wallet: wallet, + refreshFromNode: refreshFromNode, + ); + + return transactions + .map( + (e) => MwcTransaction( + parentKeyId: e.parentKeyId, + id: e.id, + txType: e.txType, + creationTs: e.creationTs, + confirmationTs: e.confirmationTs, + confirmed: e.confirmed, + numInputs: e.numInputs, + numOutputs: e.numOutputs, + amountCredited: e.amountCredited, + amountDebited: e.amountDebited, + txSlateId: e.txSlateId, + fee: e.fee, + ttlCutoffHeight: e.ttlCutoffHeight, + messages: e.messages?.messages + .map( + (f) => MwcMessage( + id: f.id, + publicKey: f.publicKey, + message: f.message, + messageSig: f.messageSig, + ), + ) + .toList(), + storedTx: e.storedTx, + kernelExcess: e.kernelExcess, + kernelLookupMinHeight: e.kernelLookupMinHeight, + paymentProof: e.paymentProof, + ), + ) + .toList(); + } + + @override + Future< + ({ + double awaitingFinalization, + double pending, + double spendable, + double total, + }) + > + getWalletBalances({ + required String wallet, + required int refreshFromNode, + required int minimumConfirmations, + }) { + return mimblewimblecoin.Libmwc.getWalletBalances( + wallet: wallet, + refreshFromNode: refreshFromNode, + minimumConfirmations: minimumConfirmations, + ); + } + + @override + Future initializeNewWallet({ + required String config, + required String mnemonic, + required String password, + required String name, + }) { + return mimblewimblecoin.Libmwc.initializeNewWallet( + config: config, + mnemonic: mnemonic, + password: password, + name: name, + ); + } + + @override + Future openWallet({ + required String config, + required String password, + }) { + return mimblewimblecoin.Libmwc.openWallet( + config: config, + password: password, + ); + } + + @override + Future recoverWallet({ + required String config, + required String password, + required String mnemonic, + required String name, + }) { + return mimblewimblecoin.Libmwc.recoverWallet( + config: config, + password: password, + mnemonic: mnemonic, + name: name, + ); + } + + @override + Future scanOutputs({ + required String wallet, + required int startHeight, + required int numberOfBlocks, + }) { + return mimblewimblecoin.Libmwc.scanOutputs( + wallet: wallet, + startHeight: startHeight, + numberOfBlocks: numberOfBlocks, + ); + } + + @override + void startMwcMqsListener({ + required String wallet, + required String mwcmqsConfig, + }) { + return mimblewimblecoin.Libmwc.startMwcMqsListener( + wallet: wallet, + mwcmqsConfig: mwcmqsConfig, + ); + } + + @override + void stopMwcMqsListener() { + return mimblewimblecoin.Libmwc.stopMwcMqsListener(); + } + + @override + Future<({String commitId, String slateId})> txFinalize({ + required String wallet, + required String slateJson, + }) { + return mimblewimblecoin.Libmwc.txFinalize( + wallet: wallet, + slateJson: slateJson, + ); + } + + @override + Future<({String commitId, String slateId})> txHttpSend({ + required String wallet, + required int selectionStrategyIsAll, + required int minimumConfirmations, + required String message, + required int amount, + required String address, + }) { + return mimblewimblecoin.Libmwc.txHttpSend( + wallet: wallet, + selectionStrategyIsAll: selectionStrategyIsAll, + minimumConfirmations: minimumConfirmations, + message: message, + amount: amount, + address: address, + ); + } + + @override + Future txInit({ + required String wallet, + required int amount, + int minimumConfirmations = 1, + bool selectionStrategyIsAll = false, + String message = '', + }) { + return mimblewimblecoin.Libmwc.txInit( + wallet: wallet, + amount: amount, + message: message, + minimumConfirmations: minimumConfirmations, + selectionStrategyIsAll: selectionStrategyIsAll, + ); + } + + @override + Future<({String commitId, String slateId, String slateJson})> + txReceiveDetailed({required String wallet, required String slateJson}) { + return mimblewimblecoin.Libmwc.txReceiveDetailed( + wallet: wallet, + slateJson: slateJson, + ); + } + + @override + bool txTypeIsReceiveCancelled(Enum value) { + return value == mimblewimblecoin_models.TransactionType.TxReceivedCancelled; + } + + @override + bool txTypeIsReceived(Enum value) { + return value == mimblewimblecoin_models.TransactionType.TxReceived; + } + + @override + bool txTypeIsSentCancelled(Enum value) { + return value == mimblewimblecoin_models.TransactionType.TxSentCancelled; + } + + @override + bool validateSendAddress({required String address}) { + return mimblewimblecoin.Libmwc.validateSendAddress(address: address); + } +} + +//END_ON From a7861184617e9f77bf21cdf06876feda2a02fc9c Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 2 Oct 2025 16:19:30 -0600 Subject: [PATCH 121/178] prep config scripts --- scripts/app_config/configure_campfire.sh | 11 +++ scripts/app_config/configure_stack_duo.sh | 13 +++ .../templates/pubspec.template.yaml | 80 +++++++++++-------- 3 files changed, 72 insertions(+), 32 deletions(-) diff --git a/scripts/app_config/configure_campfire.sh b/scripts/app_config/configure_campfire.sh index 258058aae5..8f25938488 100755 --- a/scripts/app_config/configure_campfire.sh +++ b/scripts/app_config/configure_campfire.sh @@ -29,6 +29,17 @@ else sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" fi +dart "${APP_PROJECT_ROOT_DIR}/tool/process_pubspec_deps.dart" \ + "${PUBSPEC_FILE}" \ + TOR \ + FIRO + +dart "${APP_PROJECT_ROOT_DIR}/tool/gen_interfaces.dart" \ + "${APP_PROJECT_ROOT_DIR}/tool/wl_templates" \ + "${APP_PROJECT_ROOT_DIR}/lib/wl_gen/generated" \ + TOR \ + FIRO + pushd "${APP_PROJECT_ROOT_DIR}" BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H") popd diff --git a/scripts/app_config/configure_stack_duo.sh b/scripts/app_config/configure_stack_duo.sh index 4c871fff3c..17de39bd3a 100755 --- a/scripts/app_config/configure_stack_duo.sh +++ b/scripts/app_config/configure_stack_duo.sh @@ -23,6 +23,19 @@ else sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" fi +dart "${APP_PROJECT_ROOT_DIR}/tool/process_pubspec_deps.dart" \ + "${PUBSPEC_FILE}" \ + XMR \ + TOR \ + FROST + +dart "${APP_PROJECT_ROOT_DIR}/tool/gen_interfaces.dart" \ + "${APP_PROJECT_ROOT_DIR}/tool/wl_templates" \ + "${APP_PROJECT_ROOT_DIR}/lib/wl_gen/generated" \ + XMR \ + TOR \ + FROST + pushd "${APP_PROJECT_ROOT_DIR}" BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H") popd diff --git a/scripts/app_config/templates/pubspec.template.yaml b/scripts/app_config/templates/pubspec.template.yaml index 98a63dbb86..39da588390 100644 --- a/scripts/app_config/templates/pubspec.template.yaml +++ b/scripts/app_config/templates/pubspec.template.yaml @@ -24,18 +24,56 @@ dependencies: mutex: ^3.0.0 web_socket_channel: ^2.4.0 - frostdart: - path: ./crypto_plugins/frostdart +# %%ENABLE_FROST%% +# frostdart: +# path: ./crypto_plugins/frostdart +# %%END_ENABLE_FROST%% + +# %%ENABLE_XEL%% +# xelis_flutter: +# git: +# url: https://github.com/cypherstack/xelis-flutter-ffi.git +# ref: 5dd5c50713160fa15fb06ff44886ae035eed62fd +# %%END_ENABLE_XEL%% + +# %%ENABLE_FIRO%% +# flutter_libsparkmobile: +# git: +# url: https://github.com/cypherstack/flutter_libsparkmobile.git +# ref: 84a139a25ab1691762002fafcae351e3d444a5c7 +# %%END_ENABLE_FIRO%% + +# %%ENABLE_EPIC%% +# flutter_libepiccash: +# path: ./crypto_plugins/flutter_libepiccash +# %%END_ENABLE_EPIC%% - xelis_flutter: - git: - url: https://github.com/cypherstack/xelis-flutter-ffi.git - ref: 5dd5c50713160fa15fb06ff44886ae035eed62fd +# %%ENABLE_MWC%% +# flutter_libmwc: +# path: ./crypto_plugins/flutter_libmwc +# %%END_ENABLE_MWC%% - flutter_libsparkmobile: - git: - url: https://github.com/cypherstack/flutter_libsparkmobile.git - ref: 84a139a25ab1691762002fafcae351e3d444a5c7 +# %%ENABLE_TOR%% +# tor_ffi_plugin: +# git: +# url: https://github.com/cypherstack/tor.git +# ref: 21077186e6bf773ec8a7cd57ef149b2cee5daa7b +# %%END_ENABLE_TOR%% + +# %%ENABLE_XMR%% +# cs_monero: 1.0.0-pre.3 +# cs_monero_flutter_libs: 1.0.0-pre.0 +# monero_rpc: ^2.0.0 +# %%END_ENABLE_XMR%% + +# %%ENABLE_SAL%% +# cs_salvium: ^1.2.1 +# cs_salvium_flutter_libs: ^1.0.4 +# %%END_ENABLE_SAL%% + +# %%ENABLE_MWEB%% +# flutter_mwebd: ^0.0.1-pre.8 +# %%END_ENABLE_MWEB%% # cs_monero compat (unpublished) compat: @@ -44,14 +82,6 @@ dependencies: path: compat ref: 44b8c0f8e1cc7ddbfa33c0b3f11279e64646138 - flutter_libepiccash: - path: ./crypto_plugins/flutter_libepiccash - -# %%ENABLE_MWC%% -# flutter_libmwc: -# path: ./crypto_plugins/flutter_libmwc -# %%END_ENABLE_MWC%% - bitcoindart: git: url: https://github.com/cypherstack/bitcoindart.git @@ -67,11 +97,6 @@ dependencies: url: https://github.com/cypherstack/bip47.git ref: a6e7941b98a43a613708b1a12564bc17e712cfc7 - tor_ffi_plugin: - git: - url: https://github.com/cypherstack/tor.git - ref: 21077186e6bf773ec8a7cd57ef149b2cee5daa7b - fusiondart: git: url: https://github.com/cypherstack/fusiondart.git @@ -192,7 +217,6 @@ dependencies: calendar_date_picker2: ^1.0.2 sqlite3: 2.9.0 sqlite3_flutter_libs: 0.5.25 -# camera_linux: ^0.0.8 camera_linux: git: url: https://github.com/cypherstack/camera-linux @@ -207,11 +231,7 @@ dependencies: blockchain_utils: ^3.3.0 on_chain: ^4.0.1 cbor: ^6.3.3 - cs_monero: 1.0.0-pre.3 - cs_monero_flutter_libs: 1.0.0-pre.0 - monero_rpc: ^2.0.0 digest_auth: ^1.0.1 -# logger: ^2.5.0 logger: git: url: https://github.com/cypherstack/logger @@ -223,9 +243,6 @@ dependencies: drift: ^2.28.2 drift_flutter: ^0.2.7 path: ^1.9.1 - cs_salvium: ^1.2.1 - cs_salvium_flutter_libs: ^1.0.4 - flutter_mwebd: ^0.0.1-pre.8 mweb_client: ^0.2.0 fixnum: ^1.1.1 @@ -241,7 +258,6 @@ dev_dependencies: hive_test: ^1.0.1 mockito: ^5.4.6 mockingjay: ^0.2.0 -# lint: ^1.10.0 analyzer: ^8.2.2 import_sorter: ^4.6.0 flutter_lints: ^3.0.1 From 6ad4811e188a61aa077724f95831823bdc3e9ad9 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 2 Oct 2025 17:08:07 -0600 Subject: [PATCH 122/178] prep config scripts fixes --- .../templates/pubspec.template.yaml | 32 +++++++-------- tool/process_pubspec_deps.dart | 40 +------------------ 2 files changed, 18 insertions(+), 54 deletions(-) diff --git a/scripts/app_config/templates/pubspec.template.yaml b/scripts/app_config/templates/pubspec.template.yaml index 39da588390..71610671b9 100644 --- a/scripts/app_config/templates/pubspec.template.yaml +++ b/scripts/app_config/templates/pubspec.template.yaml @@ -24,56 +24,56 @@ dependencies: mutex: ^3.0.0 web_socket_channel: ^2.4.0 -# %%ENABLE_FROST%% +# %%ENABLE_FROST%% # frostdart: # path: ./crypto_plugins/frostdart -# %%END_ENABLE_FROST%% +# %%END_ENABLE_FROST%% -# %%ENABLE_XEL%% +# %%ENABLE_XEL%% # xelis_flutter: # git: # url: https://github.com/cypherstack/xelis-flutter-ffi.git # ref: 5dd5c50713160fa15fb06ff44886ae035eed62fd -# %%END_ENABLE_XEL%% +# %%END_ENABLE_XEL%% -# %%ENABLE_FIRO%% +# %%ENABLE_FIRO%% # flutter_libsparkmobile: # git: # url: https://github.com/cypherstack/flutter_libsparkmobile.git # ref: 84a139a25ab1691762002fafcae351e3d444a5c7 -# %%END_ENABLE_FIRO%% +# %%END_ENABLE_FIRO%% -# %%ENABLE_EPIC%% +# %%ENABLE_EPIC%% # flutter_libepiccash: # path: ./crypto_plugins/flutter_libepiccash -# %%END_ENABLE_EPIC%% +# %%END_ENABLE_EPIC%% # %%ENABLE_MWC%% # flutter_libmwc: # path: ./crypto_plugins/flutter_libmwc # %%END_ENABLE_MWC%% -# %%ENABLE_TOR%% +# %%ENABLE_TOR%% # tor_ffi_plugin: # git: # url: https://github.com/cypherstack/tor.git # ref: 21077186e6bf773ec8a7cd57ef149b2cee5daa7b -# %%END_ENABLE_TOR%% +# %%END_ENABLE_TOR%% -# %%ENABLE_XMR%% +# %%ENABLE_XMR%% # cs_monero: 1.0.0-pre.3 # cs_monero_flutter_libs: 1.0.0-pre.0 # monero_rpc: ^2.0.0 -# %%END_ENABLE_XMR%% +# %%END_ENABLE_XMR%% -# %%ENABLE_SAL%% +# %%ENABLE_SAL%% # cs_salvium: ^1.2.1 # cs_salvium_flutter_libs: ^1.0.4 -# %%END_ENABLE_SAL%% +# %%END_ENABLE_SAL%% -# %%ENABLE_MWEB%% +# %%ENABLE_MWEBD%% # flutter_mwebd: ^0.0.1-pre.8 -# %%END_ENABLE_MWEB%% +# %%END_ENABLE_MWEBD%% # cs_monero compat (unpublished) compat: diff --git a/tool/process_pubspec_deps.dart b/tool/process_pubspec_deps.dart index 279dfe26af..80110b748b 100644 --- a/tool/process_pubspec_deps.dart +++ b/tool/process_pubspec_deps.dart @@ -27,7 +27,7 @@ void _process(final String filePath, final List enableCoinMarkers) { // Check if line starts any marker block for (final marker in enableCoinMarkers) { - if (line.contains('# %%ENABLE_$marker%%')) { + if (line.trim() == "# %%ENABLE_$marker%%") { activeMarker = marker; markerSet = true; updatedLines.add(line); @@ -39,7 +39,7 @@ void _process(final String filePath, final List enableCoinMarkers) { // Check if line ends the active marker block if (activeMarker != null && - line.contains('# %%END_ENABLE_$activeMarker%%')) { + line.trim() == "# %%END_ENABLE_$activeMarker%%") { activeMarker = null; updatedLines.add(line); continue; @@ -58,39 +58,3 @@ void _process(final String filePath, final List enableCoinMarkers) { 'Updated pubspec.yaml with enabled blocks: ${enableCoinMarkers.join(", ")}', ); } - -void _genFile(String outputFilePath, String template, bool on) { - final lines = File(template).readAsLinesSync(); - - // add empty line and gen warning - - final List updatedLines = [ - "// GENERATED CODE - DO NOT MODIFY BY HAND", - "", - ]; - - final keepMarker = on ? "ON" : "OFF"; - - bool? keepLine; - - for (final line in lines) { - if (line.trim() == "//$keepMarker") { - keepLine = true; - continue; - } - - if (line.trim() == "//END_$keepMarker") { - keepLine = false; - continue; - } - - if (keepLine != false) { - updatedLines.add(line); - } - } - - // add empty line - if (updatedLines.last.isNotEmpty) updatedLines.add(""); - - File(outputFilePath).writeAsStringSync(updatedLines.join('\n')); -} From 2b7e404a098320495475daf5a80fdd21822e5db4 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 3 Oct 2025 10:13:21 -0600 Subject: [PATCH 123/178] implement mwebd ffi package optional import --- lib/services/mwebd_service.dart | 60 +++++++--------- .../interfaces/mwebd_server_interface.dart | 62 +++++++++++++++++ ..._mwebd_server_interface_impl.template.dart | 69 +++++++++++++++++++ 3 files changed, 155 insertions(+), 36 deletions(-) create mode 100644 lib/wl_gen/interfaces/mwebd_server_interface.dart create mode 100644 tool/wl_templates/MWEBD_mwebd_server_interface_impl.template.dart diff --git a/lib/services/mwebd_service.dart b/lib/services/mwebd_service.dart index cc5e6bdc0f..3c60a9ac9d 100644 --- a/lib/services/mwebd_service.dart +++ b/lib/services/mwebd_service.dart @@ -3,7 +3,6 @@ import 'dart:convert'; import 'dart:io'; import 'dart:math'; -import 'package:flutter_mwebd/flutter_mwebd.dart'; import 'package:mutex/mutex.dart'; import 'package:mweb_client/mweb_client.dart'; @@ -11,6 +10,7 @@ import '../utilities/logger.dart'; import '../utilities/prefs.dart'; import '../utilities/stack_file_system.dart'; import '../wallets/crypto_currency/crypto_currency.dart'; +import '../wl_gen/interfaces/mwebd_server_interface.dart'; import 'event_bus/events/global/tor_connection_status_changed_event.dart'; import 'event_bus/events/global/tor_status_changed_event.dart'; import 'event_bus/global_event_bus.dart'; @@ -24,8 +24,7 @@ final class MwebdService { CryptoCurrencyNetwork.test4 => throw UnimplementedError(), }; - final Map - _map = {}; + final Map _map = {}; late final StreamSubscription _torStatusListener; @@ -80,38 +79,30 @@ final class MwebdService { // update function called when Tor pref changed Future _update(({InternetAddress host, int port})? proxyInfo) async { await _updateLock.protect(() async { - final proxy = - proxyInfo == null - ? "" - : "socks5://${proxyInfo.host.address}:${proxyInfo.port}"; + final proxy = proxyInfo == null + ? "" + : "socks5://${proxyInfo.host.address}:${proxyInfo.port}"; final nets = _map.keys; for (final net in nets) { - final old = _map.remove(net)!; - - await old.client.cleanup(); - await old.server.stopServer(); + final oldClient = _map.remove(net)!; + await oldClient.cleanup(); + final oldServerInfo = await mwebdServerInterface.stopServer(net); final port = await _getRandomUnusedPort(); if (port == null) { throw Exception("Could not find an unused port for mwebd"); } - final newServer = MwebdServer( - chain: old.server.chain, - dataDir: old.server.dataDir, - peer: old.server.peer, + final serverPort = await mwebdServerInterface.createAndStartServer( + net, + chain: oldServerInfo.chain, + dataDir: oldServerInfo.dataDir, + peer: oldServerInfo.peer, proxy: proxy, serverPort: port, ); - await newServer.createServer(); - await newServer.startServer(); - - final newClient = MwebClient.fromHost( - "127.0.0.1", - newServer.serverPort, - ); - _map[net] = (server: newServer, client: newClient); + _map[net] = MwebClient.fromHost("127.0.0.1", serverPort); } }); } @@ -125,10 +116,10 @@ final class MwebdService { } if (_map.isNotEmpty) { - for (final old in _map.values) { + for (final net in _map.keys) { try { - await old.client.cleanup(); - await old.server.stopServer(); + await _map[net]?.cleanup(); + await mwebdServerInterface.stopServer(net); } catch (e, s) { Logging.instance.i( "Switching mwebd chain. Error likely expected here.", @@ -163,35 +154,32 @@ final class MwebdService { proxy = ""; } - final newServer = MwebdServer( + final serverPort = await mwebdServerInterface.createAndStartServer( + net, chain: chain, dataDir: dir.path, peer: defaultPeer(net), proxy: proxy, serverPort: port, ); - await newServer.createServer(); - await newServer.startServer(); - final newClient = MwebClient.fromHost("127.0.0.1", newServer.serverPort); - - _map[net] = (server: newServer, client: newClient); + _map[net] = MwebClient.fromHost("127.0.0.1", serverPort); Logging.instance.i("MwebdService init($net) completed!"); }); } /// Get server status. Returns null if no server was initialized. - Future getServerStatus(CryptoCurrencyNetwork net) async { - return await _updateLock.protect(() async { - return await _map[net]?.server.getStatus(); + Future getServerStatus(CryptoCurrencyNetwork net) { + return _updateLock.protect(() { + return mwebdServerInterface.getServerStatus(net); }); } /// Get client for network. Returns null if no server was initialized. Future getClient(CryptoCurrencyNetwork net) async { return await _updateLock.protect(() async { - return _map[net]?.client; + return _map[net]; }); } diff --git a/lib/wl_gen/interfaces/mwebd_server_interface.dart b/lib/wl_gen/interfaces/mwebd_server_interface.dart new file mode 100644 index 0000000000..08dc08f65d --- /dev/null +++ b/lib/wl_gen/interfaces/mwebd_server_interface.dart @@ -0,0 +1,62 @@ +import '../../wallets/crypto_currency/crypto_currency.dart'; + +export '../generated/mwebd_server_interface_impl.dart'; + +abstract class MwebdServerInterface { + Future createAndStartServer( + CryptoCurrencyNetwork net, { + required String chain, + required String dataDir, + required String peer, + String proxy = "", + required int serverPort, + }); + + Future<({String chain, String dataDir, String peer})> stopServer( + CryptoCurrencyNetwork net, + ); + + Future getServerStatus(CryptoCurrencyNetwork net); +} + +// local copy +class Status { + final int blockHeaderHeight; + final int mwebHeaderHeight; + final int mwebUtxosHeight; + final int blockTime; + + Status({ + required this.blockHeaderHeight, + required this.mwebHeaderHeight, + required this.mwebUtxosHeight, + required this.blockTime, + }); + + @override + String toString() { + return 'Status(' + 'blockHeaderHeight: $blockHeaderHeight, ' + 'mwebHeaderHeight: $mwebHeaderHeight, ' + 'mwebUtxosHeight: $mwebUtxosHeight, ' + 'blockTime: $blockTime' + ')'; + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Status && + blockHeaderHeight == other.blockHeaderHeight && + mwebHeaderHeight == other.mwebHeaderHeight && + mwebUtxosHeight == other.mwebUtxosHeight && + blockTime == other.blockTime; + + @override + int get hashCode => Object.hash( + blockHeaderHeight, + mwebHeaderHeight, + mwebUtxosHeight, + blockTime, + ); +} diff --git a/tool/wl_templates/MWEBD_mwebd_server_interface_impl.template.dart b/tool/wl_templates/MWEBD_mwebd_server_interface_impl.template.dart new file mode 100644 index 0000000000..bf3793e1b0 --- /dev/null +++ b/tool/wl_templates/MWEBD_mwebd_server_interface_impl.template.dart @@ -0,0 +1,69 @@ +//ON +import 'package:flutter_mwebd/flutter_mwebd.dart' hide Status; + +//END_ON +import '../../wallets/crypto_currency/crypto_currency.dart'; +import '../interfaces/mwebd_server_interface.dart'; + +MwebdServerInterface get mwebdServerInterface => _getInterface(); + +//OFF +MwebdServerInterface _getInterface() => throw Exception("MWEBD not enabled!"); + +//END_OFF +//ON +MwebdServerInterface _getInterface() => _MwebdServerInterfaceImpl(); + +class _MwebdServerInterfaceImpl extends MwebdServerInterface { + final Map _map = {}; + + @override + Future createAndStartServer( + CryptoCurrencyNetwork net, { + required String chain, + required String dataDir, + required String peer, + String proxy = "", + required int serverPort, + }) async { + if (_map[net] != null) { + throw Exception("Server for $net already exists"); + } + + final newServer = MwebdServer( + chain: chain, + dataDir: dataDir, + peer: peer, + proxy: proxy, + serverPort: serverPort, + ); + await newServer.createServer(); + await newServer.startServer(); + _map[net] = newServer; + return newServer.serverPort; + } + + @override + Future<({String chain, String dataDir, String peer})> stopServer( + CryptoCurrencyNetwork net, + ) async { + final server = _map.remove(net); + await server!.stopServer(); + return (chain: server.chain, dataDir: server.dataDir, peer: server.peer); + } + + @override + Future getServerStatus(CryptoCurrencyNetwork net) async { + final status = await _map[net]?.getStatus(); + if (status == null) return null; + + return Status( + blockHeaderHeight: status.blockHeaderHeight, + mwebHeaderHeight: status.mwebHeaderHeight, + mwebUtxosHeight: status.mwebUtxosHeight, + blockTime: status.blockTime, + ); + } +} + +//END_ON From 9c73ed9becec7931f0c58a039905eed9a1a75f1a Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 3 Oct 2025 16:30:35 -0600 Subject: [PATCH 124/178] implement xmr/wow ffi package optional import --- lib/main.dart | 200 ++- .../restore_wallet_view.dart | 349 +++-- lib/pages/send_view/send_view.dart | 1270 ++++++++--------- .../transaction_fee_selection_sheet.dart | 329 +++-- .../edit_refresh_height_view.dart | 99 +- .../sub_widgets/desktop_send_fee_form.dart | 338 +++-- lib/services/churning_service.dart | 50 +- lib/wallets/models/tx_data.dart | 22 +- lib/wallets/wallet/impl/monero_wallet.dart | 104 +- lib/wallets/wallet/impl/wownero_wallet.dart | 90 +- .../intermediate/lib_monero_wallet.dart | 404 +++--- lib/widgets/desktop/desktop_fee_dialog.dart | 110 +- .../interfaces/cs_monero_interface.dart | 380 +++++ ...XMR_cs_monero_interface_impl.template.dart | 541 +++++++ 14 files changed, 2538 insertions(+), 1748 deletions(-) create mode 100644 lib/wl_gen/interfaces/cs_monero_interface.dart create mode 100644 tool/wl_templates/XMR_cs_monero_interface_impl.template.dart diff --git a/lib/main.dart b/lib/main.dart index c750009507..c75941ecc2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -15,7 +15,6 @@ import 'dart:ui'; import 'package:coinlib_flutter/coinlib_flutter.dart'; import 'package:compat/compat.dart' as lib_monero_compat; -import 'package:cs_monero/cs_monero.dart' as lib_monero; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -79,6 +78,7 @@ import 'wallets/crypto_currency/crypto_currency.dart'; import 'wallets/isar/providers/all_wallets_info_provider.dart'; import 'wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import 'widgets/crypto_notifications.dart'; +import 'wl_gen/interfaces/cs_monero_interface.dart'; final openedFromSWBFileStringStateProvider = StateProvider( (ref) => null, @@ -189,7 +189,7 @@ void main(List args) async { DB.instance.hive.registerAdapter(lib_monero_compat.WalletTypeAdapter()); - lib_monero.Logging.useLogger = kDebugMode; + csMonero.setUseCsMoneroLoggerInternal(kDebugMode); DB.instance.hive.init( (await StackFileSystem.applicationHiveDirectory()).path, @@ -372,8 +372,9 @@ class _MaterialAppWithThemeState extends ConsumerState Constants.exchangeForExperiencedUsers(familiarity); if (Util.isDesktop) { - _desktopHasPassword = - await ref.read(storageCryptoHandlerProvider).hasPassword(); + _desktopHasPassword = await ref + .read(storageCryptoHandlerProvider) + .hasPassword(); } } @@ -480,14 +481,14 @@ class _MaterialAppWithThemeState extends ConsumerState final brightness = WidgetsBinding.instance.window.platformBrightness; switch (brightness) { case Brightness.dark: - themeId = - ref.read(prefsChangeNotifierProvider).systemBrightnessDarkThemeId; + themeId = ref + .read(prefsChangeNotifierProvider) + .systemBrightnessDarkThemeId; break; case Brightness.light: - themeId = - ref - .read(prefsChangeNotifierProvider) - .systemBrightnessLightThemeId; + themeId = ref + .read(prefsChangeNotifierProvider) + .systemBrightnessLightThemeId; break; } } else { @@ -506,8 +507,9 @@ class _MaterialAppWithThemeState extends ConsumerState ref.read(applicationThemesDirectoryPathProvider.notifier).state = StackFileSystem.themesDir!.path; - ref.read(themeProvider.state).state = - ref.read(pThemeService).getTheme(themeId: themeId)!; + ref.read(themeProvider.state).state = ref + .read(pThemeService) + .getTheme(themeId: themeId)!; if (Platform.isAndroid) { // fetch open file if it exists @@ -531,21 +533,22 @@ class _MaterialAppWithThemeState extends ConsumerState String themeId; switch (WidgetsBinding.instance.window.platformBrightness) { case Brightness.dark: - themeId = - ref.read(prefsChangeNotifierProvider).systemBrightnessDarkThemeId; + themeId = ref + .read(prefsChangeNotifierProvider) + .systemBrightnessDarkThemeId; break; case Brightness.light: - themeId = - ref - .read(prefsChangeNotifierProvider) - .systemBrightnessLightThemeId; + themeId = ref + .read(prefsChangeNotifierProvider) + .systemBrightnessLightThemeId; break; } WidgetsBinding.instance.addPostFrameCallback((_) { if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) { - ref.read(themeProvider.state).state = - ref.read(pThemeService).getTheme(themeId: themeId)!; + ref.read(themeProvider.state).state = ref + .read(pThemeService) + .getTheme(themeId: themeId)!; } }); }; @@ -673,17 +676,16 @@ class _MaterialAppWithThemeState extends ConsumerState ref.read(pNavKey).currentContext!, RouteGenerator.getRoute( shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, - builder: - (_) => LockscreenView( - showBackButton: true, - routeOnSuccess: RestoreFromEncryptedStringView.routeName, - routeOnSuccessArguments: encrypted, - biometricsCancelButtonString: "CANCEL", - biometricsLocalizedReason: - "Authenticate to restore ${AppConfig.appName} backup", - biometricsAuthenticationTitle: - "Restore ${AppConfig.prefix} backup", - ), + builder: (_) => LockscreenView( + showBackButton: true, + routeOnSuccess: RestoreFromEncryptedStringView.routeName, + routeOnSuccessArguments: encrypted, + biometricsCancelButtonString: "CANCEL", + biometricsLocalizedReason: + "Authenticate to restore ${AppConfig.appName} backup", + biometricsAuthenticationTitle: + "Restore ${AppConfig.prefix} backup", + ), settings: const RouteSettings(name: "/swbrestorelockscreen"), ), ), @@ -807,85 +809,79 @@ class _MaterialAppWithThemeState extends ConsumerState ), ), home: CryptoNotifications( - child: - Util.isDesktop - ? FutureBuilder( - future: loadShared(), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.done) { - if (_desktopHasPassword) { - String? startupWalletId; - if (ref + child: Util.isDesktop + ? FutureBuilder( + future: loadShared(), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + if (_desktopHasPassword) { + String? startupWalletId; + if (ref + .read(prefsChangeNotifierProvider) + .gotoWalletOnStartup) { + startupWalletId = ref .read(prefsChangeNotifierProvider) - .gotoWalletOnStartup) { - startupWalletId = - ref - .read(prefsChangeNotifierProvider) - .startupWalletId; - } - - return DesktopLoginView( - startupWalletId: startupWalletId, - load: () => load(true), - ); - } else { - return const IntroView(); + .startupWalletId; } + + return DesktopLoginView( + startupWalletId: startupWalletId, + load: () => load(true), + ); } else { - return const LoadingView(); + return const IntroView(); } - }, - ) - : FutureBuilder( - future: load(false), - builder: ( - BuildContext context, - AsyncSnapshot snapshot, - ) { - if (snapshot.connectionState == ConnectionState.done) { - // FlutterNativeSplash.remove(); - if (ref.read(pAllWalletsInfo).isNotEmpty || - ref.read(prefsChangeNotifierProvider).hasPin) { - // return HomeView(); - - String? startupWalletId; - if (ref + } else { + return const LoadingView(); + } + }, + ) + : FutureBuilder( + future: load(false), + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + // FlutterNativeSplash.remove(); + if (ref.read(pAllWalletsInfo).isNotEmpty || + ref.read(prefsChangeNotifierProvider).hasPin) { + // return HomeView(); + + String? startupWalletId; + if (ref + .read(prefsChangeNotifierProvider) + .gotoWalletOnStartup) { + startupWalletId = ref .read(prefsChangeNotifierProvider) - .gotoWalletOnStartup) { - startupWalletId = - ref - .read(prefsChangeNotifierProvider) - .startupWalletId; - } - - return LockscreenView( - isInitialAppLogin: true, - routeOnSuccess: HomeView.routeName, - routeOnSuccessArguments: startupWalletId, - biometricsAuthenticationTitle: - "Unlock ${AppConfig.prefix}", - biometricsLocalizedReason: - "Unlock your ${AppConfig.appName} using biometrics", - biometricsCancelButtonString: "Cancel", - ); - } else { - if (AppConfig.appName == "Campfire" && - !CampfireMigration.didRun && - CampfireMigration.hasOldWallets) { - return const CampfireMigrateView(); - } else { - return const IntroView(); - } + .startupWalletId; } + + return LockscreenView( + isInitialAppLogin: true, + routeOnSuccess: HomeView.routeName, + routeOnSuccessArguments: startupWalletId, + biometricsAuthenticationTitle: + "Unlock ${AppConfig.prefix}", + biometricsLocalizedReason: + "Unlock your ${AppConfig.appName} using biometrics", + biometricsCancelButtonString: "Cancel", + ); } else { - // CURRENTLY DISABLED as cannot be animated - // technically not needed as FlutterNativeSplash will overlay - // anything returned here until the future completes but - // FutureBuilder requires you to return something - return const LoadingView(); + if (AppConfig.appName == "Campfire" && + !CampfireMigration.didRun && + CampfireMigration.hasOldWallets) { + return const CampfireMigrateView(); + } else { + return const IntroView(); + } } - }, - ), + } else { + // CURRENTLY DISABLED as cannot be animated + // technically not needed as FlutterNativeSplash will overlay + // anything returned here until the future completes but + // FutureBuilder requires you to return something + return const LoadingView(); + } + }, + ), ), ); } 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 dceb76d80d..f1bf78b8ca 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 @@ -16,7 +16,6 @@ import 'dart:math'; import 'package:bip39/bip39.dart' as bip39; import 'package:bip39/src/wordlists/english.dart' as bip39wordlist; -import 'package:cs_monero/cs_monero.dart' as lib_monero; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -62,6 +61,7 @@ import '../../../widgets/icon_widgets/qrcode_icon.dart'; import '../../../widgets/table_view/table_view.dart'; import '../../../widgets/table_view/table_view_cell.dart'; import '../../../widgets/table_view/table_view_row.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; import '../../home_view/home_view.dart'; import '../add_token_view/edit_wallet_tokens_view.dart'; import '../select_wallet_for_token_view.dart'; @@ -153,10 +153,9 @@ class _RestoreWalletViewState extends ConsumerState { _seedWordCount = widget.seedWordsLength; isDesktop = Util.isDesktop; - textSelectionControls = - Platform.isIOS - ? CustomCupertinoTextSelectionControls(onPaste: onControlsPaste) - : CustomMaterialTextSelectionControls(onPaste: onControlsPaste); + textSelectionControls = Platform.isIOS + ? CustomCupertinoTextSelectionControls(onPaste: onControlsPaste) + : CustomMaterialTextSelectionControls(onPaste: onControlsPaste); for (int i = 0; i < _seedWordCount; i++) { _controllers.add(TextEditingController()); @@ -189,7 +188,7 @@ class _RestoreWalletViewState extends ConsumerState { // Salvium use's Monero's wordlists. switch (widget.seedWordsLength) { case 25: - return lib_monero.getMoneroWordList("English").contains(word); + return csMonero.getMoneroWordList("English").contains(word); case 16: return Monero.sixteenWordsWordList.contains(word); default: @@ -197,9 +196,9 @@ class _RestoreWalletViewState extends ConsumerState { } } if (widget.coin is Wownero) { - final wowneroWordList = lib_monero.getWowneroWordList( + final wowneroWordList = csMonero.getWowneroWordList( "English", - seedWordsLength: widget.seedWordsLength, + widget.seedWordsLength, ); return wowneroWordList.contains(word); } @@ -409,10 +408,8 @@ class _RestoreWalletViewState extends ConsumerState { ref .read(newEthWalletTriggerTempUntilHiveCompletelyDeleted.state) .state = !ref - .read( - newEthWalletTriggerTempUntilHiveCompletelyDeleted.state, - ) - .state; + .read(newEthWalletTriggerTempUntilHiveCompletelyDeleted.state) + .state; } if (mounted) { @@ -511,43 +508,42 @@ class _RestoreWalletViewState extends ConsumerState { case FormInputStatus.empty: color = Theme.of(context).extension()!.textFieldDefaultBG; prefixColor = Theme.of(context).extension()!.textSubtitle2; - borderColor = - Theme.of(context).extension()!.textFieldDefaultBG; + borderColor = Theme.of( + context, + ).extension()!.textFieldDefaultBG; break; case FormInputStatus.invalid: color = Theme.of(context).extension()!.textFieldErrorBG; - prefixColor = - Theme.of( - context, - ).extension()!.textFieldErrorSearchIconLeft; - borderColor = - Theme.of(context).extension()!.textFieldErrorBorder; + prefixColor = Theme.of( + context, + ).extension()!.textFieldErrorSearchIconLeft; + borderColor = Theme.of( + context, + ).extension()!.textFieldErrorBorder; suffixIcon = SvgPicture.asset( Assets.svg.alertCircle, width: 16, height: 16, - color: - Theme.of( - context, - ).extension()!.textFieldErrorSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldErrorSearchIconRight, ); break; case FormInputStatus.valid: color = Theme.of(context).extension()!.textFieldSuccessBG; - prefixColor = - Theme.of( - context, - ).extension()!.textFieldSuccessSearchIconLeft; - borderColor = - Theme.of(context).extension()!.textFieldSuccessBorder; + prefixColor = Theme.of( + context, + ).extension()!.textFieldSuccessSearchIconLeft; + borderColor = Theme.of( + context, + ).extension()!.textFieldSuccessBorder; suffixIcon = SvgPicture.asset( Assets.svg.checkCircle, width: 16, height: 16, - color: - Theme.of( - context, - ).extension()!.textFieldSuccessSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldSuccessSearchIconRight, ); break; } @@ -706,90 +702,85 @@ class _RestoreWalletViewState extends ConsumerState { final isDesktop = Util.isDesktop; return MasterScaffold( isDesktop: isDesktop, - appBar: - isDesktop - ? const DesktopAppBar( - isCompactHeight: false, - leading: AppBarBackButton(), - trailing: ExitToMyStackButton(), - ) - : AppBar( - leading: AppBarBackButton( - onPressed: () async { - if (FocusScope.of(context).hasFocus) { - FocusScope.of(context).unfocus(); - await Future.delayed( - const Duration(milliseconds: 50), - ); - } - if (context.mounted) { - Navigator.of(context).pop(); - } - }, - ), - actions: [ - Padding( - padding: const EdgeInsets.only( - top: 10, - bottom: 10, - right: 10, - ), - child: AspectRatio( - aspectRatio: 1, - child: AppBarIconButton( - semanticsLabel: - "View QR Code Button. Opens Camera To Scan QR Code For Restoring Wallet.", - key: const Key("restoreWalletViewQrCodeButton"), - size: 36, - shadows: const [], - color: - Theme.of( - context, - ).extension()!.background, - icon: QrCodeIcon( - width: 20, - height: 20, - color: - Theme.of( - context, - ).extension()!.accentColorDark, - ), - onPressed: scanMnemonicQr, + appBar: isDesktop + ? const DesktopAppBar( + isCompactHeight: false, + leading: AppBarBackButton(), + trailing: ExitToMyStackButton(), + ) + : AppBar( + leading: AppBarBackButton( + onPressed: () async { + if (FocusScope.of(context).hasFocus) { + FocusScope.of(context).unfocus(); + await Future.delayed( + const Duration(milliseconds: 50), + ); + } + if (context.mounted) { + Navigator.of(context).pop(); + } + }, + ), + actions: [ + Padding( + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + right: 10, + ), + child: AspectRatio( + aspectRatio: 1, + child: AppBarIconButton( + semanticsLabel: + "View QR Code Button. Opens Camera To Scan QR Code For Restoring Wallet.", + key: const Key("restoreWalletViewQrCodeButton"), + size: 36, + shadows: const [], + color: Theme.of( + context, + ).extension()!.background, + icon: QrCodeIcon( + width: 20, + height: 20, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), + onPressed: scanMnemonicQr, ), ), - Padding( - padding: const EdgeInsets.only( - top: 10, - bottom: 10, - right: 10, - ), - child: AspectRatio( - aspectRatio: 1, - child: AppBarIconButton( - semanticsLabel: - "Paste Button. Pastes From Clipboard For Restoring Wallet.", - key: const Key("restoreWalletPasteButton"), - size: 36, - shadows: const [], - color: - Theme.of( - context, - ).extension()!.background, - icon: ClipboardIcon( - width: 20, - height: 20, - color: - Theme.of( - context, - ).extension()!.accentColorDark, - ), - onPressed: pasteMnemonic, + ), + Padding( + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + right: 10, + ), + child: AspectRatio( + aspectRatio: 1, + child: AppBarIconButton( + semanticsLabel: + "Paste Button. Pastes From Clipboard For Restoring Wallet.", + key: const Key("restoreWalletPasteButton"), + size: 36, + shadows: const [], + color: Theme.of( + context, + ).extension()!.background, + icon: ClipboardIcon( + width: 20, + height: 20, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), + onPressed: pasteMnemonic, ), ), - ], - ), + ), + ], + ), body: Container( color: Theme.of(context).extension()!.background, child: Padding( @@ -810,18 +801,16 @@ class _RestoreWalletViewState extends ConsumerState { SizedBox(height: isDesktop ? 0 : 4), Text( "Recovery phrase", - style: - isDesktop - ? STextStyles.desktopH2(context) - : STextStyles.pageTitleH1(context), + style: isDesktop + ? STextStyles.desktopH2(context) + : STextStyles.pageTitleH1(context), ), SizedBox(height: isDesktop ? 16 : 8), Text( "Enter your $_seedWordCount-word recovery phrase.", - style: - isDesktop - ? STextStyles.desktopSubtitleH2(context) - : STextStyles.subtitle(context), + style: isDesktop + ? STextStyles.desktopSubtitleH2(context) + : STextStyles.subtitle(context), ), SizedBox(height: isDesktop ? 16 : 10), if (isDesktop) @@ -841,10 +830,9 @@ class _RestoreWalletViewState extends ConsumerState { Assets.svg.clipboard, width: 22, height: 22, - color: - Theme.of(context) - .extension()! - .buttonTextSecondary, + color: Theme.of( + context, + ).extension()!.buttonTextSecondary, ), const SizedBox(width: 8), Text( @@ -910,8 +898,8 @@ class _RestoreWalletViewState extends ConsumerState { .onUserInteraction, selectionControls: i * 4 + j - 1 == 1 - ? textSelectionControls - : null, + ? textSelectionControls + : null, // focusNode: // _focusNodes[i * 4 + j - 1], onChanged: (value) { @@ -957,18 +945,19 @@ class _RestoreWalletViewState extends ConsumerState { _controllers[i * 4 + j - 1], - style: STextStyles.field( - context, - ).copyWith( - color: - Theme.of(context) + style: + STextStyles.field( + context, + ).copyWith( + color: Theme.of(context) .extension< StackColors >()! .textRestore, - fontSize: - isDesktop ? 16 : 14, - ), + fontSize: isDesktop + ? 16 + : 14, + ), ), if (_inputStatuses[i * 4 + j - @@ -987,16 +976,19 @@ class _RestoreWalletViewState extends ConsumerState { "Please check spelling", textAlign: TextAlign.left, - style: STextStyles.label( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textError, - ), + style: + STextStyles.label( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textError, + ), ), ), ), @@ -1048,10 +1040,9 @@ class _RestoreWalletViewState extends ConsumerState { autovalidateMode: AutovalidateMode .onUserInteraction, - selectionControls: - i == 1 - ? textSelectionControls - : null, + selectionControls: i == 1 + ? textSelectionControls + : null, onChanged: (value) { final FormInputStatus formInputStatus; @@ -1078,18 +1069,19 @@ class _RestoreWalletViewState extends ConsumerState { }); }, controller: _controllers[i], - style: STextStyles.field( - context, - ).copyWith( - color: - Theme.of(context) + style: + STextStyles.field( + context, + ).copyWith( + color: Theme.of(context) .extension< StackColors >()! .overlay, - fontSize: - isDesktop ? 16 : 14, - ), + fontSize: isDesktop + ? 16 + : 14, + ), ), if (_inputStatuses[i] == FormInputStatus.invalid) @@ -1106,16 +1098,19 @@ class _RestoreWalletViewState extends ConsumerState { "Please check spelling", textAlign: TextAlign.left, - style: STextStyles.label( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textError, - ), + style: + STextStyles.label( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textError, + ), ), ), ), @@ -1181,8 +1176,9 @@ class _RestoreWalletViewState extends ConsumerState { ), autovalidateMode: AutovalidateMode.onUserInteraction, - selectionControls: - i == 1 ? textSelectionControls : null, + selectionControls: i == 1 + ? textSelectionControls + : null, // focusNode: _focusNodes[i - 1], onChanged: (value) { final FormInputStatus formInputStatus; @@ -1212,10 +1208,9 @@ class _RestoreWalletViewState extends ConsumerState { }, controller: _controllers[i - 1], style: STextStyles.field(context).copyWith( - color: - Theme.of(context) - .extension()! - .textRestore, + color: Theme.of( + context, + ).extension()!.textRestore, fontSize: isDesktop ? 16 : 14, ), ), @@ -1232,14 +1227,12 @@ class _RestoreWalletViewState extends ConsumerState { child: Text( "Please check spelling", textAlign: TextAlign.left, - style: STextStyles.label( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.label(context) + .copyWith( + color: Theme.of(context) .extension()! .textError, - ), + ), ), ), ), diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 1577e568e8..855d1bd889 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -11,7 +11,6 @@ import 'dart:async'; import 'dart:io'; -import 'package:cs_monero/cs_monero.dart' as lib_monero; import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -76,6 +75,7 @@ import '../../widgets/rounded_white_container.dart'; import '../../widgets/stack_dialog.dart'; import '../../widgets/stack_text_field.dart'; import '../../widgets/textfield_icon_button.dart'; +import '../../wl_gen/interfaces/cs_monero_interface.dart'; import '../address_book_views/address_book_view.dart'; import '../coin_control/coin_control_view.dart'; import 'confirm_transaction_view.dart'; @@ -345,18 +345,19 @@ class _SendViewState extends ConsumerState { ); final Amount? amount; if (baseAmount != null) { - final _price = - ref.read(priceAnd24hChangeNotifierProvider).getPrice(coin)?.value; + final _price = ref + .read(priceAnd24hChangeNotifierProvider) + .getPrice(coin) + ?.value; if (_price == null || _price == Decimal.zero) { amount = 0.toAmountAsRaw(fractionDigits: coin.fractionDigits); } else { - amount = - baseAmount <= Amount.zero - ? 0.toAmountAsRaw(fractionDigits: coin.fractionDigits) - : (baseAmount.decimal / _price) - .toDecimal(scaleOnInfinitePrecision: coin.fractionDigits) - .toAmount(fractionDigits: coin.fractionDigits); + amount = baseAmount <= Amount.zero + ? 0.toAmountAsRaw(fractionDigits: coin.fractionDigits) + : (baseAmount.decimal / _price) + .toDecimal(scaleOnInfinitePrecision: coin.fractionDigits) + .toAmount(fractionDigits: coin.fractionDigits); } if (_cachedAmountToSend != null && _cachedAmountToSend == amount) { return; @@ -397,8 +398,10 @@ class _SendViewState extends ConsumerState { } _cachedAmountToSend = amount; - final price = - ref.read(priceAnd24hChangeNotifierProvider).getPrice(coin)?.value; + final price = ref + .read(priceAnd24hChangeNotifierProvider) + .getPrice(coin) + ?.value; if (price != null && price > Decimal.zero) { baseAmountController.text = (amount.decimal * price) @@ -463,12 +466,11 @@ class _SendViewState extends ConsumerState { fee = fee.split(" ").first; } - final value = - fee.contains(",") - ? Decimal.parse( - fee.replaceFirst(",", "."), - ).toAmount(fractionDigits: coin.fractionDigits) - : Decimal.parse(fee).toAmount(fractionDigits: coin.fractionDigits); + final value = fee.contains(",") + ? Decimal.parse( + fee.replaceFirst(",", "."), + ).toAmount(fractionDigits: coin.fractionDigits) + : Decimal.parse(fee).toAmount(fractionDigits: coin.fractionDigits); if (shouldSetState) { setState(() => _currentFee = value); @@ -559,25 +561,22 @@ class _SendViewState extends ConsumerState { Amount fee; if (coin is Monero) { - lib_monero.TransactionPriority specialMoneroId; + final int specialMoneroId; switch (ref.read(feeRateTypeMobileStateProvider.state).state) { case FeeRateType.fast: - specialMoneroId = lib_monero.TransactionPriority.high; + specialMoneroId = csMonero.getTxPriorityHigh(); break; case FeeRateType.average: - specialMoneroId = lib_monero.TransactionPriority.medium; + specialMoneroId = csMonero.getTxPriorityMedium(); break; case FeeRateType.slow: - specialMoneroId = lib_monero.TransactionPriority.normal; + specialMoneroId = csMonero.getTxPriorityNormal(); break; default: throw ArgumentError("custom fee not available for monero"); } - fee = await wallet.estimateFeeFor( - amount, - BigInt.from(specialMoneroId.value), - ); + fee = await wallet.estimateFeeFor(amount, BigInt.from(specialMoneroId)); cachedFees[amount] = ref .read(pAmountFormatter(coin)) .format(fee, withUnitName: true, indicatePrecisionLoss: false); @@ -629,10 +628,9 @@ class _SendViewState extends ConsumerState { amount: amount, recipientAddress: null, // No specific recipient for manual slatepack. - message: - onChainNoteController.text.isNotEmpty == true - ? onChainNoteController.text - : null, + message: onChainNoteController.text.isNotEmpty == true + ? onChainNoteController.text + : null, encrypt: false, // No encryption without recipient address. ); } @@ -672,10 +670,9 @@ class _SendViewState extends ConsumerState { await showDialog( context: context, barrierDismissible: false, - builder: - (context) => StackDialogBase( - child: MwcSlatepackDialog(slatepackResult: slatepackResult), - ), + builder: (context) => StackDialogBase( + child: MwcSlatepackDialog(slatepackResult: slatepackResult), + ), ); // Clear form after slatepack dialog is closed. @@ -692,11 +689,10 @@ class _SendViewState extends ConsumerState { if (mounted) { await showDialog( context: context, - builder: - (context) => StackOkDialog( - title: "Slatepack Creation Failed", - message: e.toString(), - ), + builder: (context) => StackOkDialog( + title: "Slatepack Creation Failed", + message: e.toString(), + ), ); } } @@ -716,18 +712,18 @@ class _SendViewState extends ConsumerState { availableBalance = wallet.info.cachedBalance.spendable; break; case BalanceType.private: - availableBalance = - isFiro - ? wallet.info.cachedBalanceTertiary.spendable - : wallet.info.cachedBalanceSecondary.spendable; + availableBalance = isFiro + ? wallet.info.cachedBalanceTertiary.spendable + : wallet.info.cachedBalanceSecondary.spendable; break; } } else { availableBalance = ref.read(pWalletBalance(walletId)).spendable; } - final coinControlEnabled = - ref.read(prefsChangeNotifierProvider).enableCoinControl; + final coinControlEnabled = ref + .read(prefsChangeNotifierProvider) + .enableCoinControl; if (coin is! Ethereum && !(wallet is CoinControlInterface && coinControlEnabled) || @@ -754,10 +750,9 @@ class _SendViewState extends ConsumerState { child: Text( "Cancel", style: STextStyles.button(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), ), onPressed: () { @@ -833,10 +828,10 @@ class _SendViewState extends ConsumerState { feeRateType: feeRate, utxos: (wallet is CoinControlInterface && - coinControlEnabled && - selectedUTXOs.isNotEmpty) - ? selectedUTXOs - : null, + coinControlEnabled && + selectedUTXOs.isNotEmpty) + ? selectedUTXOs + : null, ), ); } else if (wallet is FiroWallet) { @@ -855,10 +850,9 @@ class _SendViewState extends ConsumerState { ], feeRateType: ref.read(feeRateTypeMobileStateProvider), satsPerVByte: isCustomFee.value ? customFeeRate : null, - utxos: - (coinControlEnabled && selectedUTXOs.isNotEmpty) - ? selectedUTXOs - : null, + utxos: (coinControlEnabled && selectedUTXOs.isNotEmpty) + ? selectedUTXOs + : null, ), ); } else { @@ -869,16 +863,16 @@ class _SendViewState extends ConsumerState { address: _address!, amount: amount, isChange: false, - addressType: - wallet.cryptoCurrency.getAddressType(_address!)!, + addressType: wallet.cryptoCurrency.getAddressType( + _address!, + )!, ), ], feeRateType: ref.read(feeRateTypeMobileStateProvider), satsPerVByte: isCustomFee.value ? customFeeRate : null, - utxos: - (coinControlEnabled && selectedUTXOs.isNotEmpty) - ? selectedUTXOs - : null, + utxos: (coinControlEnabled && selectedUTXOs.isNotEmpty) + ? selectedUTXOs + : null, ), ); } @@ -887,31 +881,28 @@ class _SendViewState extends ConsumerState { case BalanceType.private: txDataFuture = wallet.prepareSendSpark( txData: TxData( - recipients: - ref.read(pValidSparkSendToAddress) - ? null - : [ - TxRecipient( - address: _address!, - amount: amount, - isChange: false, - addressType: - wallet.cryptoCurrency.getAddressType( - _address!, - )!, - ), - ], - sparkRecipients: - ref.read(pValidSparkSendToAddress) - ? [ - ( - address: _address!, - amount: amount, - memo: memoController.text, - isChange: false, - ), - ] - : null, + recipients: ref.read(pValidSparkSendToAddress) + ? null + : [ + TxRecipient( + address: _address!, + amount: amount, + isChange: false, + addressType: wallet.cryptoCurrency.getAddressType( + _address!, + )!, + ), + ], + sparkRecipients: ref.read(pValidSparkSendToAddress) + ? [ + ( + address: _address!, + amount: amount, + memo: memoController.text, + isChange: false, + ), + ] + : null, ), ); break; @@ -959,10 +950,10 @@ class _SendViewState extends ConsumerState { ethEIP1559Fee: ethFee, utxos: (wallet is CoinControlInterface && - coinControlEnabled && - selectedUTXOs.isNotEmpty) - ? selectedUTXOs - : null, + coinControlEnabled && + selectedUTXOs.isNotEmpty) + ? selectedUTXOs + : null, ), ); } @@ -975,10 +966,9 @@ class _SendViewState extends ConsumerState { if (isPaynymSend) { txData = txData.copyWith( paynymAccountLite: widget.accountLite!, - note: - noteController.text.isNotEmpty - ? noteController.text - : "PayNym send", + note: noteController.text.isNotEmpty + ? noteController.text + : "PayNym send", ); } else { txData = txData.copyWith(note: noteController.text); @@ -992,13 +982,12 @@ class _SendViewState extends ConsumerState { Navigator.of(context).push( RouteGenerator.getRoute( shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, - builder: - (_) => ConfirmTransactionView( - txData: txData, - walletId: walletId, - isPaynymTransaction: isPaynymSend, - onSuccess: clearSendForm, - ), + builder: (_) => ConfirmTransactionView( + txData: txData, + walletId: walletId, + isPaynymTransaction: isPaynymSend, + onSuccess: clearSendForm, + ), settings: const RouteSettings( name: ConfirmTransactionView.routeName, ), @@ -1028,10 +1017,9 @@ class _SendViewState extends ConsumerState { child: Text( "Ok", style: STextStyles.button(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), ), onPressed: () { @@ -1089,10 +1077,9 @@ class _SendViewState extends ConsumerState { break; case BalanceType.private: - amount = - isFiro - ? ref.read(pWalletBalanceTertiary(walletId)).spendable - : ref.read(pWalletBalanceSecondary(walletId)).spendable; + amount = isFiro + ? ref.read(pWalletBalanceTertiary(walletId)).spendable + : ref.read(pWalletBalanceSecondary(walletId)).spendable; break; } } else { @@ -1153,32 +1140,32 @@ class _SendViewState extends ConsumerState { shape: const RoundedRectangleBorder( borderRadius: BorderRadius.vertical(top: Radius.circular(20)), ), - builder: - (_) => TransactionFeeSelectionSheet( - walletId: walletId, - amount: (Decimal.tryParse(cryptoAmountController.text) ?? + builder: (_) => TransactionFeeSelectionSheet( + walletId: walletId, + amount: + (Decimal.tryParse(cryptoAmountController.text) ?? ref.watch(pSendAmount)?.decimal ?? Decimal.zero) .toAmount(fractionDigits: coin.fractionDigits), - updateChosen: (String fee) { - if (fee == "custom") { - if (!isCustomFee.value) { - setState(() { - isCustomFee.value = true; - }); - } - return; - } - - _setCurrentFee(fee, true); + updateChosen: (String fee) { + if (fee == "custom") { + if (!isCustomFee.value) { setState(() { - _calculateFeesFuture = Future(() => fee); - if (isCustomFee.value) { - isCustomFee.value = false; - } + isCustomFee.value = true; }); - }, - ), + } + return; + } + + _setCurrentFee(fee, true); + setState(() { + _calculateFeesFuture = Future(() => fee); + if (isCustomFee.value) { + isCustomFee.value = false; + } + }); + }, + ), ); } @@ -1433,10 +1420,9 @@ class _SendViewState extends ConsumerState { children: [ Container( decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.popupBG, + color: Theme.of( + context, + ).extension()!.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -1489,38 +1475,31 @@ class _SendViewState extends ConsumerState { if (showPrivateBalance) { switch (balType) { case BalanceType.public: - amount = - ref - .read( - pWalletBalance( - walletId, - ), - ) - .spendable; + amount = ref + .read( + pWalletBalance(walletId), + ) + .spendable; break; case BalanceType.private: - amount = - ref - .read( - isMwebEnabled - ? pWalletBalanceSecondary( - walletId, - ) - : pWalletBalanceTertiary( - walletId, - ), - ) - .spendable; - break; - } - } else { - amount = - ref + amount = ref .read( - pWalletBalance(walletId), + isMwebEnabled + ? pWalletBalanceSecondary( + walletId, + ) + : pWalletBalanceTertiary( + walletId, + ), ) .spendable; + break; + } + } else { + amount = ref + .read(pWalletBalance(walletId)) + .spendable; } return GestureDetector( @@ -1672,95 +1651,103 @@ class _SendViewState extends ConsumerState { }, focusNode: _addressFocusNode, style: STextStyles.field(context), - decoration: standardInputDecoration( - isMwcSlatepack - ? "Enter ${coin.ticker} address (optional)" - : "Enter ${coin.ticker} address", - _addressFocusNode, - context, - ).copyWith( - contentPadding: const EdgeInsets.only( - left: 16, - top: 6, - bottom: 8, - right: 5, - ), - suffixIcon: Padding( - padding: - sendToController.text.isEmpty + decoration: + standardInputDecoration( + isMwcSlatepack + ? "Enter ${coin.ticker} address (optional)" + : "Enter ${coin.ticker} address", + _addressFocusNode, + context, + ).copyWith( + contentPadding: const EdgeInsets.only( + left: 16, + top: 6, + bottom: 8, + right: 5, + ), + suffixIcon: Padding( + padding: sendToController.text.isEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - children: [ - _addressToggleFlag - ? TextFieldIconButton( - semanticsLabel: - "Clear Button. Clears The Address Field Input.", - key: const Key( - "sendViewClearAddressFieldButtonKey", + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + _addressToggleFlag + ? TextFieldIconButton( + semanticsLabel: + "Clear Button. Clears The Address Field Input.", + key: const Key( + "sendViewClearAddressFieldButtonKey", + ), + onTap: () { + sendToController + .text = + ""; + _address = ""; + _setValidAddressProviders( + _address, + ); + setState(() { + _addressToggleFlag = + false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + semanticsLabel: + "Paste Button. Pastes From Clipboard To Address Field Input.", + key: const Key( + "sendViewPasteAddressFieldButtonKey", + ), + onTap: _pasteAddress, + child: + sendToController + .text + .isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + if (sendToController + .text + .isEmpty) + TextFieldIconButton( + semanticsLabel: + "Address Book Button. Opens Address Book For Address Field.", + key: const Key( + "sendViewAddressBookButtonKey", + ), + onTap: () { + Navigator.of( + context, + ).pushNamed( + AddressBookView + .routeName, + arguments: widget.coin, + ); + }, + child: + const AddressBookIcon(), ), - onTap: () { - sendToController.text = ""; - _address = ""; - _setValidAddressProviders( - _address, - ); - setState(() { - _addressToggleFlag = - false; - }); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - semanticsLabel: - "Paste Button. Pastes From Clipboard To Address Field Input.", - key: const Key( - "sendViewPasteAddressFieldButtonKey", + if (sendToController + .text + .isEmpty) + TextFieldIconButton( + semanticsLabel: + "Scan QR Button. Opens Camera For Scanning QR Code.", + key: const Key( + "sendViewScanQrButtonKey", + ), + onTap: _scanQr, + child: const QrCodeIcon(), ), - onTap: _pasteAddress, - child: - sendToController - .text - .isEmpty - ? const ClipboardIcon() - : const XIcon(), - ), - if (sendToController.text.isEmpty) - TextFieldIconButton( - semanticsLabel: - "Address Book Button. Opens Address Book For Address Field.", - key: const Key( - "sendViewAddressBookButtonKey", - ), - onTap: () { - Navigator.of( - context, - ).pushNamed( - AddressBookView.routeName, - arguments: widget.coin, - ); - }, - child: const AddressBookIcon(), - ), - if (sendToController.text.isEmpty) - TextFieldIconButton( - semanticsLabel: - "Scan QR Button. Opens Camera For Scanning QR Code.", - key: const Key( - "sendViewScanQrButtonKey", - ), - onTap: _scanQr, - child: const QrCodeIcon(), - ), - ], + ], + ), + ), ), ), - ), - ), ), ), const SizedBox(height: 10), @@ -1782,72 +1769,79 @@ class _SendViewState extends ConsumerState { onChanged: (_) { setState(() {}); }, - decoration: standardInputDecoration( - "Enter memo (optional)", - _memoFocus, - context, - ).copyWith( - counterText: '', - contentPadding: const EdgeInsets.only( - left: 16, - top: 6, - bottom: 8, - right: 5, - ), - suffixIcon: Padding( - padding: - memoController.text.isEmpty + decoration: + standardInputDecoration( + "Enter memo (optional)", + _memoFocus, + context, + ).copyWith( + counterText: '', + contentPadding: const EdgeInsets.only( + left: 16, + top: 6, + bottom: 8, + right: 5, + ), + suffixIcon: Padding( + padding: memoController.text.isEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - children: [ - memoController.text.isNotEmpty - ? TextFieldIconButton( - semanticsLabel: - "Clear Button. Clears The Memo Field Input.", - key: const Key( - "sendViewClearMemoFieldButtonKey", - ), - onTap: () { - memoController.text = ""; - setState(() {}); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - semanticsLabel: - "Paste Button. Pastes From Clipboard To Memo Field Input.", - key: const Key( - "sendViewPasteMemoFieldButtonKey", - ), - onTap: () async { - final ClipboardData? data = - await clipboard.getData( - Clipboard.kTextPlain, - ); - if (data?.text != null && - data! - .text! - .isNotEmpty) { - final String content = - data.text!.trim(); - - memoController.text = - content.trim(); - - setState(() {}); - } - }, - child: const ClipboardIcon(), - ), - ], + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + memoController.text.isNotEmpty + ? TextFieldIconButton( + semanticsLabel: + "Clear Button. Clears The Memo Field Input.", + key: const Key( + "sendViewClearMemoFieldButtonKey", + ), + onTap: () { + memoController.text = + ""; + setState(() {}); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + semanticsLabel: + "Paste Button. Pastes From Clipboard To Memo Field Input.", + key: const Key( + "sendViewPasteMemoFieldButtonKey", + ), + onTap: () async { + final ClipboardData? + data = await clipboard + .getData( + Clipboard + .kTextPlain, + ); + if (data?.text != + null && + data! + .text! + .isNotEmpty) { + final String + content = data.text! + .trim(); + + memoController + .text = content + .trim(); + + setState(() {}); + } + }, + child: + const ClipboardIcon(), + ), + ], + ), + ), ), ), - ), - ), ), ), Builder( @@ -1890,14 +1884,12 @@ class _SendViewState extends ConsumerState { child: Text( error, textAlign: TextAlign.left, - style: STextStyles.label( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.label(context) + .copyWith( + color: Theme.of(context) .extension()! .textError, - ), + ), ), ), ); @@ -1919,8 +1911,9 @@ class _SendViewState extends ConsumerState { children: [ TextField( autocorrect: Util.isDesktop ? false : true, - enableSuggestions: - Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop + ? false + : true, readOnly: true, textInputAction: TextInputAction.none, ), @@ -1929,10 +1922,9 @@ class _SendViewState extends ConsumerState { horizontal: 12, ), child: RawMaterialButton( - splashColor: - Theme.of( - context, - ).extension()!.highlight, + splashColor: Theme.of( + context, + ).extension()!.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -1947,8 +1939,8 @@ class _SendViewState extends ConsumerState { top: Radius.circular(20), ), ), - builder: - (_) => DualBalanceSelectionSheet( + builder: (_) => + DualBalanceSelectionSheet( walletId: walletId, ), ); @@ -1977,28 +1969,26 @@ class _SendViewState extends ConsumerState { ) .state) { case BalanceType.public: - amount = - ref - .watch( - pWalletBalance( - walletId, - ), - ) - .spendable; + amount = ref + .watch( + pWalletBalance( + walletId, + ), + ) + .spendable; break; case BalanceType.private: - amount = - ref - .watch( - isFiro - ? pWalletBalanceTertiary( - walletId, - ) - : pWalletBalanceSecondary( - walletId, - ), - ) - .spendable; + amount = ref + .watch( + isFiro + ? pWalletBalanceTertiary( + walletId, + ) + : pWalletBalanceSecondary( + walletId, + ), + ) + .spendable; break; } @@ -2023,10 +2013,9 @@ class _SendViewState extends ConsumerState { Assets.svg.chevronDown, width: 8, height: 4, - color: - Theme.of(context) - .extension()! - .textSubtitle2, + color: Theme.of(context) + .extension()! + .textSubtitle2, ), ], ), @@ -2049,8 +2038,8 @@ class _SendViewState extends ConsumerState { showCoinControl, selectedUTXOs, ), - onTap: - () => _sendAllTapped(showCoinControl), + onTap: () => + _sendAllTapped(showCoinControl), ), ], ), @@ -2059,23 +2048,21 @@ class _SendViewState extends ConsumerState { autocorrect: Util.isDesktop ? false : true, enableSuggestions: Util.isDesktop ? false : true, style: STextStyles.smallMed14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark, + color: Theme.of( + context, + ).extension()!.textDark, ), key: const Key( "amountInputFieldCryptoTextFieldKey", ), controller: cryptoAmountController, focusNode: _cryptoFocus, - keyboardType: - Util.isDesktop - ? null - : const TextInputType.numberWithOptions( - signed: false, - decimal: true, - ), + keyboardType: Util.isDesktop + ? null + : const TextInputType.numberWithOptions( + signed: false, + decimal: true, + ), textAlign: TextAlign.right, inputFormatters: [ AmountInputFormatter( @@ -2111,14 +2098,12 @@ class _SendViewState extends ConsumerState { ref .watch(pAmountUnit(coin)) .unitForCoin(coin), - style: STextStyles.smallMed14( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.smallMed14(context) + .copyWith( + color: Theme.of(context) .extension()! .accentColorDark, - ), + ), ), ), ), @@ -2129,26 +2114,25 @@ class _SendViewState extends ConsumerState { if (Prefs.instance.externalCalls) TextField( autocorrect: Util.isDesktop ? false : true, - enableSuggestions: - Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop + ? false + : true, style: STextStyles.smallMed14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark, + color: Theme.of( + context, + ).extension()!.textDark, ), key: const Key( "amountInputFieldFiatTextFieldKey", ), controller: baseAmountController, focusNode: _baseFocus, - keyboardType: - Util.isDesktop - ? null - : const TextInputType.numberWithOptions( - signed: false, - decimal: true, - ), + keyboardType: Util.isDesktop + ? null + : const TextInputType.numberWithOptions( + signed: false, + decimal: true, + ), textAlign: TextAlign.right, inputFormatters: [ AmountInputFormatter( @@ -2184,14 +2168,12 @@ class _SendViewState extends ConsumerState { (value) => value.currency, ), ), - style: STextStyles.smallMed14( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.smallMed14(context) + .copyWith( + color: Theme.of(context) .extension()! .accentColorDark, - ), + ), ), ), ), @@ -2206,20 +2188,17 @@ class _SendViewState extends ConsumerState { children: [ Text( "Coin control", - style: STextStyles.w500_14( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.w500_14(context) + .copyWith( + color: Theme.of(context) .extension()! .textSubtitle1, - ), + ), ), CustomTextButton( - text: - selectedUTXOs.isEmpty - ? "Select coins" - : "Selected coins (${selectedUTXOs.length})", + text: selectedUTXOs.isEmpty + ? "Select coins" + : "Selected coins (${selectedUTXOs.length})", onTap: () async { if (FocusScope.of(context).hasFocus) { FocusScope.of(context).unfocus(); @@ -2229,12 +2208,9 @@ class _SendViewState extends ConsumerState { } if (context.mounted) { - final spendable = - ref - .read( - pWalletBalance(walletId), - ) - .spendable; + final spendable = ref + .read(pWalletBalance(walletId)) + .spendable; Amount? amount; if (ref.read(pSendAmount) != null) { @@ -2247,28 +2223,26 @@ class _SendViewState extends ConsumerState { } } - final result = await Navigator.of( - context, - ).pushNamed( - CoinControlView.routeName, - arguments: Tuple4( - walletId, - CoinControlViewType.use, - amount, - selectedUTXOs - .map((e) => e.utxo) - .toSet(), - ), - ); + final result = + await Navigator.of( + context, + ).pushNamed( + CoinControlView.routeName, + arguments: Tuple4( + walletId, + CoinControlViewType.use, + amount, + selectedUTXOs + .map((e) => e.utxo) + .toSet(), + ), + ); if (result is Set) { setState(() { - selectedUTXOs = - result - .map( - (e) => StandardInput(e), - ) - .toSet(); + selectedUTXOs = result + .map((e) => StandardInput(e)) + .toSet(); }); } } @@ -2292,42 +2266,47 @@ class _SendViewState extends ConsumerState { ), child: TextField( autocorrect: Util.isDesktop ? false : true, - enableSuggestions: - Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop + ? false + : true, maxLength: 256, controller: onChainNoteController, focusNode: _onChainNoteFocusNode, style: STextStyles.field(context), onChanged: (_) => setState(() {}), - decoration: standardInputDecoration( - "Type something...", - _onChainNoteFocusNode, - context, - ).copyWith( - suffixIcon: - onChainNoteController.text.isNotEmpty + decoration: + standardInputDecoration( + "Type something...", + _onChainNoteFocusNode, + context, + ).copyWith( + suffixIcon: + onChainNoteController + .text + .isNotEmpty ? Padding( - padding: const EdgeInsets.only( - right: 0, - ), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - onChainNoteController - .text = ""; - }); - }, - ), - ], + padding: const EdgeInsets.only( + right: 0, ), - ), - ) + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + onChainNoteController + .text = + ""; + }); + }, + ), + ], + ), + ), + ) : null, - ), + ), ), ), if (coin is Epiccash || coin is Mimblewimblecoin) @@ -2348,41 +2327,44 @@ class _SendViewState extends ConsumerState { ), child: TextField( autocorrect: Util.isDesktop ? false : true, - enableSuggestions: - Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop + ? false + : true, controller: noteController, focusNode: _noteFocusNode, style: STextStyles.field(context), onChanged: (_) => setState(() {}), - decoration: standardInputDecoration( - "Type something...", - _noteFocusNode, - context, - ).copyWith( - suffixIcon: - noteController.text.isNotEmpty + decoration: + standardInputDecoration( + "Type something...", + _noteFocusNode, + context, + ).copyWith( + suffixIcon: + noteController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only( - right: 0, - ), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - noteController.text = - ""; - }); - }, - ), - ], + padding: const EdgeInsets.only( + right: 0, ), - ), - ) + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + noteController + .text = + ""; + }); + }, + ), + ], + ), + ), + ) : null, - ), + ), ), ), if (coin is Epiccash || coin is Mimblewimblecoin) @@ -2401,41 +2383,42 @@ class _SendViewState extends ConsumerState { ), child: TextField( autocorrect: Util.isDesktop ? false : true, - enableSuggestions: - Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop + ? false + : true, controller: noteController, focusNode: _noteFocusNode, style: STextStyles.field(context), onChanged: (_) => setState(() {}), - decoration: standardInputDecoration( - "Type something...", - _noteFocusNode, - context, - ).copyWith( - suffixIcon: - noteController.text.isNotEmpty + decoration: + standardInputDecoration( + "Type something...", + _noteFocusNode, + context, + ).copyWith( + suffixIcon: noteController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only( - right: 0, - ), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - noteController.text = - ""; - }); - }, - ), - ], + padding: const EdgeInsets.only( + right: 0, ), - ), - ) + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + noteController.text = + ""; + }); + }, + ), + ], + ), + ), + ) : null, - ), + ), ), ), const SizedBox(height: 12), @@ -2461,8 +2444,9 @@ class _SendViewState extends ConsumerState { children: [ TextField( autocorrect: Util.isDesktop ? false : true, - enableSuggestions: - Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop + ? false + : true, controller: feeController, readOnly: true, textInputAction: TextInputAction.none, @@ -2476,10 +2460,9 @@ class _SendViewState extends ConsumerState { horizontal: 12, ), child: RawMaterialButton( - splashColor: - Theme.of(context) - .extension()! - .highlight, + splashColor: Theme.of( + context, + ).extension()!.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -2487,138 +2470,128 @@ class _SendViewState extends ConsumerState { ), onPressed: isFiro && - ref - .watch( - publicPrivateBalanceStateProvider - .state, - ) - .state != - BalanceType.public - ? null - : _onFeeSelectPressed, + ref + .watch( + publicPrivateBalanceStateProvider + .state, + ) + .state != + BalanceType.public + ? null + : _onFeeSelectPressed, child: (isFiro && - ref - .watch( - publicPrivateBalanceStateProvider - .state, - ) - .state != - BalanceType.public) - ? Row( - children: [ - FutureBuilder( - future: - _calculateFeesFuture, - builder: ( - context, - snapshot, - ) { - if (snapshot.connectionState == - ConnectionState - .done && - snapshot.hasData) { - _setCurrentFee( - snapshot.data!, - false, - ); - return Text( - "~${snapshot.data!}", - style: - STextStyles.itemSubtitle( - context, - ), - ); - } else { - return AnimatedText( - stringsToLoopThrough: - stringsToLoopThrough, - style: - STextStyles.itemSubtitle( - context, - ), - ); - } - }, - ), - ], - ) - : Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Row( - children: [ - Text( - ref - .watch( - feeRateTypeMobileStateProvider - .state, - ) - .state - .prettyName, + ref + .watch( + publicPrivateBalanceStateProvider + .state, + ) + .state != + BalanceType.public) + ? Row( + children: [ + FutureBuilder( + future: + _calculateFeesFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState + .done && + snapshot.hasData) { + _setCurrentFee( + snapshot.data!, + false, + ); + return Text( + "~${snapshot.data!}", style: - STextStyles.itemSubtitle12( + STextStyles.itemSubtitle( context, ), - ), - const SizedBox( - width: 10, - ), - FutureBuilder( - future: - _calculateFeesFuture, - builder: ( - context, - snapshot, - ) { - if (snapshot.connectionState == - ConnectionState - .done && - snapshot - .hasData) { - _setCurrentFee( - snapshot.data!, - false, - ); - return Text( - isCustomFee - .value - ? "" - : "~${snapshot.data!}", - style: - STextStyles.itemSubtitle( - context, - ), - ); - } else { - return AnimatedText( - stringsToLoopThrough: - stringsToLoopThrough, - style: - STextStyles.itemSubtitle( - context, - ), - ); - } - }, - ), - ], - ), - SvgPicture.asset( - Assets.svg.chevronDown, - width: 8, - height: 4, - color: - Theme.of(context) - .extension< - StackColors - >()! - .textSubtitle2, - ), - ], - ), + ); + } else { + return AnimatedText( + stringsToLoopThrough: + stringsToLoopThrough, + style: + STextStyles.itemSubtitle( + context, + ), + ); + } + }, + ), + ], + ) + : Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Row( + children: [ + Text( + ref + .watch( + feeRateTypeMobileStateProvider + .state, + ) + .state + .prettyName, + style: + STextStyles.itemSubtitle12( + context, + ), + ), + const SizedBox(width: 10), + FutureBuilder( + future: + _calculateFeesFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState + .done && + snapshot + .hasData) { + _setCurrentFee( + snapshot.data!, + false, + ); + return Text( + isCustomFee.value + ? "" + : "~${snapshot.data!}", + style: + STextStyles.itemSubtitle( + context, + ), + ); + } else { + return AnimatedText( + stringsToLoopThrough: + stringsToLoopThrough, + style: + STextStyles.itemSubtitle( + context, + ), + ); + } + }, + ), + ], + ), + SvgPicture.asset( + Assets.svg.chevronDown, + width: 8, + height: 4, + color: Theme.of(context) + .extension< + StackColors + >()! + .textSubtitle2, + ), + ], + ), ), ), ), @@ -2649,23 +2622,18 @@ class _SendViewState extends ConsumerState { TextButton( onPressed: ref.watch(pPreviewTxButtonEnabled(coin)) - ? ref.watch( - pSelectedMwcTransactionMethod, - ) == - MwcTransactionMethod.slatepack - ? _createSlatepack - : _previewTransaction - : null, - style: - ref.watch(pPreviewTxButtonEnabled(coin)) - ? Theme.of(context) - .extension()! - .getPrimaryEnabledButtonStyle(context) - : Theme.of(context) - .extension()! - .getPrimaryDisabledButtonStyle( - context, - ), + ? ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack + ? _createSlatepack + : _previewTransaction + : null, + style: ref.watch(pPreviewTxButtonEnabled(coin)) + ? Theme.of(context) + .extension()! + .getPrimaryEnabledButtonStyle(context) + : Theme.of(context) + .extension()! + .getPrimaryDisabledButtonStyle(context), child: Text( ref.watch(pSelectedMwcTransactionMethod) == MwcTransactionMethod.slatepack 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 3ec7048a32..8c05fa973d 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 @@ -8,7 +8,6 @@ * */ -import 'package:cs_monero/cs_monero.dart' as lib_monero; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -29,6 +28,7 @@ import '../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../wallets/wallet/impl/firo_wallet.dart'; import '../../../wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart'; import '../../../widgets/animated_text.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; final feeSheetSessionCacheProvider = ChangeNotifierProvider((ref) { @@ -91,7 +91,7 @@ class _TransactionFeeSelectionSheetState if (coin is Monero || coin is Wownero) { final fee = await wallet.estimateFeeFor( amount, - BigInt.from(lib_monero.TransactionPriority.high.value), + BigInt.from(csMonero.getTxPriorityHigh()), ); ref.read(feeSheetSessionCacheProvider).fast[amount] = fee; } else if (coin is Firo) { @@ -128,7 +128,7 @@ class _TransactionFeeSelectionSheetState if (coin is Monero || coin is Wownero) { final fee = await wallet.estimateFeeFor( amount, - BigInt.from(lib_monero.TransactionPriority.medium.value), + BigInt.from(csMonero.getTxPriorityMedium()), ); ref.read(feeSheetSessionCacheProvider).average[amount] = fee; } else if (coin is Firo) { @@ -164,7 +164,7 @@ class _TransactionFeeSelectionSheetState if (coin is Monero || coin is Wownero) { final fee = await wallet.estimateFeeFor( amount, - BigInt.from(lib_monero.TransactionPriority.normal.value), + BigInt.from(csMonero.getTxPriorityNormal()), ); ref.read(feeSheetSessionCacheProvider).slow[amount] = fee; } else if (coin is Firo) { @@ -254,10 +254,9 @@ class _TransactionFeeSelectionSheetState Center( child: Container( decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -268,10 +267,9 @@ class _TransactionFeeSelectionSheetState ), const SizedBox(height: 36), FutureBuilder( - future: - widget.isToken - ? ref.read(pCurrentTokenWallet)!.fees - : wallet.fees, + future: widget.isToken + ? ref.read(pCurrentTokenWallet)!.fees + : wallet.fees, builder: (context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { @@ -289,10 +287,9 @@ class _TransactionFeeSelectionSheetState const SizedBox(height: 16), GestureDetector( onTap: () { - final state = - ref - .read(feeRateTypeMobileStateProvider.state) - .state; + final state = ref + .read(feeRateTypeMobileStateProvider.state) + .state; if (state != FeeRateType.fast) { ref.read(feeRateTypeMobileStateProvider.state).state = FeeRateType.fast; @@ -318,25 +315,23 @@ class _TransactionFeeSelectionSheetState width: 20, height: 20, child: Radio( - activeColor: - Theme.of(context) - .extension()! - .radioButtonIconEnabled, + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, value: FeeRateType.fast, - groupValue: - ref - .watch( - feeRateTypeMobileStateProvider - .state, - ) - .state, + groupValue: ref + .watch( + feeRateTypeMobileStateProvider.state, + ) + .state, onChanged: (x) { ref - .read( - feeRateTypeMobileStateProvider - .state, - ) - .state = FeeRateType.fast; + .read( + feeRateTypeMobileStateProvider + .state, + ) + .state = + FeeRateType.fast; Navigator.of(context).pop(); }, @@ -373,30 +368,33 @@ class _TransactionFeeSelectionSheetState feeRate: feeObject!.fast, amount: amount, ), - builder: ( - _, - AsyncSnapshot snapshot, - ) { - if (snapshot.connectionState == - ConnectionState.done && - snapshot.hasData) { - return Text( - "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})", - style: STextStyles.itemSubtitle( - context, - ), - textAlign: TextAlign.left, - ); - } else { - return AnimatedText( - stringsToLoopThrough: - stringsToLoopThrough, - style: STextStyles.itemSubtitle( - context, - ), - ); - } - }, + builder: + ( + _, + AsyncSnapshot snapshot, + ) { + if (snapshot.connectionState == + ConnectionState.done && + snapshot.hasData) { + return Text( + "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})", + style: + STextStyles.itemSubtitle( + context, + ), + textAlign: TextAlign.left, + ); + } else { + return AnimatedText( + stringsToLoopThrough: + stringsToLoopThrough, + style: + STextStyles.itemSubtitle( + context, + ), + ); + } + }, ), ], ), @@ -426,10 +424,9 @@ class _TransactionFeeSelectionSheetState const SizedBox(height: 16), GestureDetector( onTap: () { - final state = - ref - .read(feeRateTypeMobileStateProvider.state) - .state; + final state = ref + .read(feeRateTypeMobileStateProvider.state) + .state; if (state != FeeRateType.average) { ref.read(feeRateTypeMobileStateProvider.state).state = FeeRateType.average; @@ -454,25 +451,23 @@ class _TransactionFeeSelectionSheetState width: 20, height: 20, child: Radio( - activeColor: - Theme.of(context) - .extension()! - .radioButtonIconEnabled, + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, value: FeeRateType.average, - groupValue: - ref - .watch( - feeRateTypeMobileStateProvider - .state, - ) - .state, + groupValue: ref + .watch( + feeRateTypeMobileStateProvider.state, + ) + .state, onChanged: (x) { ref - .read( - feeRateTypeMobileStateProvider - .state, - ) - .state = FeeRateType.average; + .read( + feeRateTypeMobileStateProvider + .state, + ) + .state = + FeeRateType.average; Navigator.of(context).pop(); }, ), @@ -508,30 +503,33 @@ class _TransactionFeeSelectionSheetState feeRate: feeObject!.medium, amount: amount, ), - builder: ( - _, - AsyncSnapshot snapshot, - ) { - if (snapshot.connectionState == - ConnectionState.done && - snapshot.hasData) { - return Text( - "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})", - style: STextStyles.itemSubtitle( - context, - ), - textAlign: TextAlign.left, - ); - } else { - return AnimatedText( - stringsToLoopThrough: - stringsToLoopThrough, - style: STextStyles.itemSubtitle( - context, - ), - ); - } - }, + builder: + ( + _, + AsyncSnapshot snapshot, + ) { + if (snapshot.connectionState == + ConnectionState.done && + snapshot.hasData) { + return Text( + "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})", + style: + STextStyles.itemSubtitle( + context, + ), + textAlign: TextAlign.left, + ); + } else { + return AnimatedText( + stringsToLoopThrough: + stringsToLoopThrough, + style: + STextStyles.itemSubtitle( + context, + ), + ); + } + }, ), ], ), @@ -561,10 +559,9 @@ class _TransactionFeeSelectionSheetState const SizedBox(height: 16), GestureDetector( onTap: () { - final state = - ref - .read(feeRateTypeMobileStateProvider.state) - .state; + final state = ref + .read(feeRateTypeMobileStateProvider.state) + .state; if (state != FeeRateType.slow) { ref.read(feeRateTypeMobileStateProvider.state).state = FeeRateType.slow; @@ -586,25 +583,23 @@ class _TransactionFeeSelectionSheetState width: 20, height: 20, child: Radio( - activeColor: - Theme.of(context) - .extension()! - .radioButtonIconEnabled, + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, value: FeeRateType.slow, - groupValue: - ref - .watch( - feeRateTypeMobileStateProvider - .state, - ) - .state, + groupValue: ref + .watch( + feeRateTypeMobileStateProvider.state, + ) + .state, onChanged: (x) { ref - .read( - feeRateTypeMobileStateProvider - .state, - ) - .state = FeeRateType.slow; + .read( + feeRateTypeMobileStateProvider + .state, + ) + .state = + FeeRateType.slow; Navigator.of(context).pop(); }, ), @@ -640,30 +635,33 @@ class _TransactionFeeSelectionSheetState feeRate: feeObject!.slow, amount: amount, ), - builder: ( - _, - AsyncSnapshot snapshot, - ) { - if (snapshot.connectionState == - ConnectionState.done && - snapshot.hasData) { - return Text( - "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})", - style: STextStyles.itemSubtitle( - context, - ), - textAlign: TextAlign.left, - ); - } else { - return AnimatedText( - stringsToLoopThrough: - stringsToLoopThrough, - style: STextStyles.itemSubtitle( - context, - ), - ); - } - }, + builder: + ( + _, + AsyncSnapshot snapshot, + ) { + if (snapshot.connectionState == + ConnectionState.done && + snapshot.hasData) { + return Text( + "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})", + style: + STextStyles.itemSubtitle( + context, + ), + textAlign: TextAlign.left, + ); + } else { + return AnimatedText( + stringsToLoopThrough: + stringsToLoopThrough, + style: + STextStyles.itemSubtitle( + context, + ), + ); + } + }, ), ], ), @@ -694,14 +692,14 @@ class _TransactionFeeSelectionSheetState if (wallet is ElectrumXInterface || coin is Ethereum) GestureDetector( onTap: () { - final state = - ref - .read(feeRateTypeMobileStateProvider.state) - .state; + final state = ref + .read(feeRateTypeMobileStateProvider.state) + .state; if (state != FeeRateType.custom) { ref - .read(feeRateTypeMobileStateProvider.state) - .state = FeeRateType.custom; + .read(feeRateTypeMobileStateProvider.state) + .state = + FeeRateType.custom; } widget.updateChosen("custom"); @@ -718,25 +716,24 @@ class _TransactionFeeSelectionSheetState width: 20, height: 20, child: Radio( - activeColor: - Theme.of(context) - .extension()! - .radioButtonIconEnabled, + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, value: FeeRateType.custom, - groupValue: - ref - .watch( - feeRateTypeMobileStateProvider - .state, - ) - .state, + groupValue: ref + .watch( + feeRateTypeMobileStateProvider + .state, + ) + .state, onChanged: (x) { ref - .read( - feeRateTypeMobileStateProvider - .state, - ) - .state = FeeRateType.custom; + .read( + feeRateTypeMobileStateProvider + .state, + ) + .state = + FeeRateType.custom; Navigator.of(context).pop(); }, ), diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/edit_refresh_height_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/edit_refresh_height_view.dart index f1d0aa5f9a..47ce7d25c4 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/edit_refresh_height_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/edit_refresh_height_view.dart @@ -5,12 +5,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../notifications/show_flush_bar.dart'; import '../../../../providers/db/main_db_provider.dart'; -import '../../../../providers/global/wallets_provider.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/constants.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; -import '../../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; +import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../widgets/background.dart'; import '../../../../widgets/conditional_parent.dart'; import '../../../../widgets/custom_buttons/app_bar_icon_button.dart'; @@ -20,6 +19,7 @@ import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/icon_widgets/x_icon.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; +import '../../../../wl_gen/interfaces/cs_monero_interface.dart'; class EditRefreshHeightView extends ConsumerStatefulWidget { const EditRefreshHeightView({super.key, required this.walletId}); @@ -34,7 +34,6 @@ class EditRefreshHeightView extends ConsumerStatefulWidget { } class _EditRefreshHeightViewState extends ConsumerState { - late final LibMoneroWallet _wallet; late final TextEditingController _controller; final _focusNode = FocusNode(); @@ -48,11 +47,13 @@ class _EditRefreshHeightViewState extends ConsumerState { try { final newHeight = int.tryParse(_controller.text); if (newHeight != null && newHeight >= 0) { - await _wallet.info.updateRestoreHeight( - newRestoreHeight: newHeight, - isar: ref.read(mainDBProvider).isar, - ); - _wallet.libMoneroWallet!.setRefreshFromBlockHeight(newHeight); + await ref + .read(pWalletInfo(widget.walletId)) + .updateRestoreHeight( + newRestoreHeight: newHeight, + isar: ref.read(mainDBProvider).isar, + ); + csMonero.setRefreshFromBlockHeight(widget.walletId, newHeight); } else { errMessage = "Invalid height: ${_controller.text}"; } @@ -88,11 +89,8 @@ class _EditRefreshHeightViewState extends ConsumerState { @override void initState() { super.initState(); - _wallet = ref.read(pWallets).getWallet(widget.walletId) as LibMoneroWallet; - _controller = - TextEditingController() - ..text = - _wallet.libMoneroWallet!.getRefreshFromBlockHeight().toString(); + _controller = TextEditingController() + ..text = csMonero.getRefreshFromBlockHeight(widget.walletId).toString(); } @override @@ -118,8 +116,10 @@ class _EditRefreshHeightViewState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.end, children: [ DesktopDialogCloseButton( - onPressedOverride: - Navigator.of(context, rootNavigator: true).pop, + onPressedOverride: Navigator.of( + context, + rootNavigator: true, + ).pop, ), ], ), @@ -137,8 +137,9 @@ class _EditRefreshHeightViewState extends ConsumerState { builder: (child) { return Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of( + context, + ).extension()!.background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -167,51 +168,47 @@ class _EditRefreshHeightViewState extends ConsumerState { key: const Key("restoreHeightFieldKey"), controller: _controller, focusNode: _focusNode, - style: - Util.isDesktop - ? STextStyles.desktopTextMedium( - context, - ).copyWith(height: 2) - : STextStyles.field(context), + style: Util.isDesktop + ? STextStyles.desktopTextMedium(context).copyWith(height: 2) + : STextStyles.field(context), enableSuggestions: false, autocorrect: false, autofocus: true, onSubmitted: (_) => _save(), onChanged: (_) => setState(() {}), - decoration: standardInputDecoration( - "Restore height", - _focusNode, - context, - ).copyWith( - suffixIcon: - _controller.text.isNotEmpty + decoration: + standardInputDecoration( + "Restore height", + _focusNode, + context, + ).copyWith( + suffixIcon: _controller.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: ConditionalParent( - condition: Util.isDesktop, - builder: - (child) => - SizedBox(height: 70, child: child), - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - _controller.text = ""; - }); - }, - ), - ], + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: ConditionalParent( + condition: Util.isDesktop, + builder: (child) => + SizedBox(height: 70, child: child), + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + _controller.text = ""; + }); + }, + ), + ], + ), ), ), - ), - ) + ) : Util.isDesktop ? const SizedBox(height: 70) : null, - ), + ), ), ), Util.isDesktop ? const SizedBox(height: 32) : const Spacer(), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send_fee_form.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send_fee_form.dart index 69757ac7c7..462262d9cd 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send_fee_form.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send_fee_form.dart @@ -1,4 +1,3 @@ -import 'package:cs_monero/cs_monero.dart' as lib_monero; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -22,6 +21,7 @@ import '../../../../widgets/custom_buttons/blue_text_button.dart'; import '../../../../widgets/desktop/desktop_fee_dialog.dart'; import '../../../../widgets/eth_fee_form.dart'; import '../../../../widgets/fee_slider.dart'; +import '../../../../wl_gen/interfaces/cs_monero_interface.dart'; class DesktopSendFeeForm extends ConsumerStatefulWidget { const DesktopSendFeeForm({ @@ -86,47 +86,44 @@ class _DesktopSendFeeFormState extends ConsumerState { children: [ ConditionalParent( condition: canEditFees, - builder: - (child) => Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - child, - CustomTextButton( - text: "Edit", - onTap: () async { - feeSelectionResult = - await showDialog<(FeeRateType, String?, String?)?>( - context: context, - builder: - (_) => DesktopFeeDialog( - walletId: widget.walletId, - isToken: widget.isToken, - ), - ); + builder: (child) => Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + child, + CustomTextButton( + text: "Edit", + onTap: () async { + feeSelectionResult = + await showDialog<(FeeRateType, String?, String?)?>( + context: context, + builder: (_) => DesktopFeeDialog( + walletId: widget.walletId, + isToken: widget.isToken, + ), + ); - if (feeSelectionResult != null) { - if (_isCustomFee && - feeSelectionResult!.$1 != FeeRateType.custom) { - _isCustomFee = false; - } else if (!_isCustomFee && - feeSelectionResult!.$1 == FeeRateType.custom) { - _isCustomFee = true; - } - } + if (feeSelectionResult != null) { + if (_isCustomFee && + feeSelectionResult!.$1 != FeeRateType.custom) { + _isCustomFee = false; + } else if (!_isCustomFee && + feeSelectionResult!.$1 == FeeRateType.custom) { + _isCustomFee = true; + } + } - setState(() {}); - }, - ), - ], + setState(() {}); + }, ), + ], + ), child: Text( "Transaction fee" "${_isCustomFee ? "" : " (${isEth ? "max" : "estimated"})"}", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, ), textAlign: TextAlign.left, ), @@ -135,162 +132,155 @@ class _DesktopSendFeeFormState extends ConsumerState { if (!_isCustomFee) Padding( padding: const EdgeInsets.all(10), - child: - (feeSelectionResult?.$2 == null) - ? FutureBuilder( - future: ref.watch( - pWallets.select( - (value) => value.getWallet(widget.walletId).fees, - ), + child: (feeSelectionResult?.$2 == null) + ? FutureBuilder( + future: ref.watch( + pWallets.select( + (value) => value.getWallet(widget.walletId).fees, ), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - return DesktopFeeItem( - feeObject: snapshot.data, - feeRateType: FeeRateType.average, - walletId: widget.walletId, - isButton: false, - feeFor: ({ - required Amount amount, - required FeeRateType feeRateType, - required BigInt feeRate, - required CryptoCurrency coin, - }) async { - if (ref - .read( - widget.isToken - ? tokenFeeSessionCacheProvider - : feeSheetSessionCacheProvider, - ) - .average[amount] == - null) { - if (widget.isToken == false) { - final wallet = ref - .read(pWallets) - .getWallet(widget.walletId); + ), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return DesktopFeeItem( + feeObject: snapshot.data, + feeRateType: FeeRateType.average, + walletId: widget.walletId, + isButton: false, + feeFor: + ({ + required Amount amount, + required FeeRateType feeRateType, + required BigInt feeRate, + required CryptoCurrency coin, + }) async { + if (ref + .read( + widget.isToken + ? tokenFeeSessionCacheProvider + : feeSheetSessionCacheProvider, + ) + .average[amount] == + null) { + if (widget.isToken == false) { + final wallet = ref + .read(pWallets) + .getWallet(widget.walletId); - if (coin is Monero || coin is Wownero) { - final fee = await wallet.estimateFeeFor( - amount, - BigInt.from( - lib_monero - .TransactionPriority - .medium - .value, - ), - ); - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = - fee; - } else if ((coin is Firo) && + if (coin is Monero || coin is Wownero) { + final fee = await wallet.estimateFeeFor( + amount, + BigInt.from( + csMonero.getTxPriorityMedium(), + ), + ); ref + .read( + feeSheetSessionCacheProvider, + ) + .average[amount] = + fee; + } else if ((coin is Firo) && + ref + .read( + publicPrivateBalanceStateProvider + .state, + ) + .state != + BalanceType.public) { + final firoWallet = wallet as FiroWallet; + + if (ref .read( publicPrivateBalanceStateProvider .state, ) - .state != - BalanceType.public) { - final firoWallet = wallet as FiroWallet; - - if (ref - .read( - publicPrivateBalanceStateProvider - .state, - ) - .state == - BalanceType.private) { + .state == + BalanceType.private) { + ref + .read(feeSheetSessionCacheProvider) + .average[amount] = await firoWallet + .estimateFeeForSpark(amount); + } + } else { ref .read(feeSheetSessionCacheProvider) - .average[amount] = await firoWallet - .estimateFeeForSpark(amount); + .average[amount] = await wallet + .estimateFeeFor(amount, feeRate); } } else { - ref - .read(feeSheetSessionCacheProvider) - .average[amount] = await wallet + final tokenWallet = ref.read( + pCurrentTokenWallet, + )!; + final fee = await tokenWallet .estimateFeeFor(amount, feeRate); + ref + .read(tokenFeeSessionCacheProvider) + .average[amount] = + fee; } - } else { - final tokenWallet = - ref.read(pCurrentTokenWallet)!; - final fee = await tokenWallet.estimateFeeFor( - amount, - feeRate, - ); - ref - .read(tokenFeeSessionCacheProvider) - .average[amount] = - fee; } - } - return ref - .read( - widget.isToken - ? tokenFeeSessionCacheProvider - : feeSheetSessionCacheProvider, - ) - .average[amount]!; - }, - isSelected: true, - ); - } else { - return Row( - children: [ - AnimatedText( - stringsToLoopThrough: stringsToLoopThrough, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension()! - .textFieldActiveText, - ), - ), - ], - ); - } - }, - ) - : Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - feeSelectionResult?.$2 ?? "", - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveText, - ), - textAlign: TextAlign.left, - ), - Text( - feeSelectionResult?.$3 ?? "", - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, - ), - ), - ], - ), + return ref + .read( + widget.isToken + ? tokenFeeSessionCacheProvider + : feeSheetSessionCacheProvider, + ) + .average[amount]!; + }, + isSelected: true, + ); + } else { + return Row( + children: [ + AnimatedText( + stringsToLoopThrough: stringsToLoopThrough, + style: + STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveText, + ), + ), + ], + ); + } + }, + ) + : Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + feeSelectionResult?.$2 ?? "", + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of( + context, + ).extension()!.textFieldActiveText, + ), + textAlign: TextAlign.left, + ), + Text( + feeSelectionResult?.$3 ?? "", + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, + ), + ), + ], + ), ), if (_isCustomFee && isEth) EthFeeForm( - minGasLimit: - widget.isToken - ? kEthereumTokenMinGasLimit - : kEthereumMinGasLimit, - stateChanged: - (value) => widget.onCustomEip1559FeeOptionChanged?.call(value), + minGasLimit: widget.isToken + ? kEthereumTokenMinGasLimit + : kEthereumMinGasLimit, + stateChanged: (value) => + widget.onCustomEip1559FeeOptionChanged?.call(value), ), if (_isCustomFee && !isEth) Padding( diff --git a/lib/services/churning_service.dart b/lib/services/churning_service.dart index 0aecefe080..1e1885086f 100644 --- a/lib/services/churning_service.dart +++ b/lib/services/churning_service.dart @@ -1,18 +1,14 @@ import 'dart:async'; import 'dart:math'; -import 'package:cs_monero/cs_monero.dart'; import 'package:flutter/cupertino.dart'; import 'package:mutex/mutex.dart'; +import '../utilities/logger.dart'; import '../wallets/wallet/intermediate/lib_monero_wallet.dart'; +import '../wl_gen/interfaces/cs_monero_interface.dart'; -enum ChurnStatus { - waiting, - running, - failed, - success; -} +enum ChurnStatus { waiting, running, failed, success } class ChurningService extends ChangeNotifier { // stack only uses account 0 at this point in time @@ -21,7 +17,7 @@ class ChurningService extends ChangeNotifier { ChurningService({required this.wallet}); final LibMoneroWallet wallet; - Wallet get csWallet => wallet.libMoneroWallet!; + String get walletId => wallet.walletId; int rounds = 1; // default bool ignoreErrors = false; // default @@ -36,7 +32,9 @@ class ChurningService extends ChangeNotifier { Object? lastSeenError; bool _canChurn() { - if (csWallet.getUnlockedBalance(accountIndex: kAccount) > BigInt.zero) { + if (csMonero.walletInstanceExists(walletId) && + csMonero.getUnlockedBalance(walletId, accountIndex: kAccount)! > + BigInt.zero) { return true; } else { return false; @@ -50,7 +48,7 @@ class ChurningService extends ChangeNotifier { return; } - final outputs = await csWallet.getOutputs(refresh: true); + final outputs = await csMonero.getOutputs(walletId, refresh: true); final required = wallet.cryptoCurrency.minConfirms; int lowestNumberOfConfirms = required; @@ -127,14 +125,14 @@ class ChurningService extends ChangeNotifier { try { _stopConfirmsTimer(); - Logging.log?.i("Doing churn #${roundsCompleted + 1}"); + Logging.instance.i("Doing churn #${roundsCompleted + 1}"); await _churnTxSimple(); waitingForUnlockedBalance = ChurnStatus.success; makingChurnTransaction = ChurnStatus.success; roundsCompleted++; notifyListeners(); } catch (e, s) { - Logging.log?.e( + Logging.instance.e( "Churning round #${roundsCompleted + 1} failed", error: e, stackTrace: s, @@ -154,7 +152,7 @@ class ChurningService extends ChangeNotifier { } } } else { - Logging.log?.i("Can't churn yet, waiting..."); + Logging.instance.i("Can't churn yet, waiting..."); } if (!complete() && _running) { @@ -174,7 +172,7 @@ class ChurningService extends ChangeNotifier { done = true; _running = false; notifyListeners(); - Logging.log?.i("Churning complete"); + Logging.instance.i("Churning complete"); } void stopChurning() { @@ -184,24 +182,28 @@ class ChurningService extends ChangeNotifier { unpause(); } - Future _churnTxSimple({ - final TransactionPriority priority = TransactionPriority.normal, - }) async { - final address = csWallet.getAddress( + Future _churnTxSimple() async { + final address = csMonero.getAddress( + walletId, accountIndex: kAccount, addressIndex: 0, ); - final pending = await csWallet.createTx( - output: Recipient( - address: address.value, - amount: BigInt.zero, // Doesn't matter if `sweep` is true + final height = await wallet.chainHeight; + + final pending = await csMonero.createTx( + walletId, + output: CsRecipient( + address, + BigInt.zero, // Doesn't matter if `sweep` is true ), - priority: priority, + priority: csMonero.getTxPriorityNormal(), accountIndex: kAccount, sweep: true, + minConfirms: wallet.cryptoCurrency.minConfirms, + currentHeight: height, ); - await csWallet.commitTx(pending); + await csMonero.commitTx(walletId, pending); } } diff --git a/lib/wallets/models/tx_data.dart b/lib/wallets/models/tx_data.dart index 9a8dffd214..8ebed1e5e5 100644 --- a/lib/wallets/models/tx_data.dart +++ b/lib/wallets/models/tx_data.dart @@ -1,4 +1,3 @@ -import 'package:cs_monero/cs_monero.dart' as lib_monero; import 'package:cs_salvium/cs_salvium.dart' as lib_salvium; import 'package:tezart/tezart.dart' as tezart; import 'package:web3dart/web3dart.dart' as web3dart; @@ -10,6 +9,8 @@ import '../../models/paynym/paynym_account_lite.dart'; import '../../utilities/amount/amount.dart'; import '../../utilities/enums/fee_rate_type_enum.dart'; import '../../widgets/eth_fee_form.dart'; +import '../../wl_gen/interfaces/cs_monero_interface.dart' + show CsPendingTransaction; import '../isar/models/spark_coin.dart'; import 'name_op_state.dart'; import 'tx_recipient.dart'; @@ -67,7 +68,7 @@ class TxData { final int? nonce; final BigInt? chainId; // wownero and monero specific - final lib_monero.PendingTransaction? pendingTransaction; + final CsPendingTransaction? pendingTransaction; // salvium final lib_salvium.PendingTransaction? pendingSalviumTransaction; @@ -169,10 +170,10 @@ class TxData { Amount? get amountSpark => sparkRecipients != null && sparkRecipients!.isNotEmpty - ? sparkRecipients! - .map((e) => e.amount) - .reduce((total, amount) => total += amount) - : null; + ? sparkRecipients! + .map((e) => e.amount) + .reduce((total, amount) => total += amount) + : null; Amount? get amountWithoutChange { if (recipients != null && recipients!.isNotEmpty) { @@ -230,10 +231,9 @@ class TxData { } } - int? get estimatedSatsPerVByte => - fee != null && vSize != null - ? (fee!.raw ~/ BigInt.from(vSize!)).toInt() - : null; + int? get estimatedSatsPerVByte => fee != null && vSize != null + ? (fee!.raw ~/ BigInt.from(vSize!)).toInt() + : null; TxData copyWith({ FeeRateType? feeRateType, @@ -259,7 +259,7 @@ class TxData { web3dart.Transaction? web3dartTransaction, int? nonce, BigInt? chainId, - lib_monero.PendingTransaction? pendingTransaction, + CsPendingTransaction? pendingTransaction, lib_salvium.PendingTransaction? pendingSalviumTransaction, int? jMintValue, List? spendCoinIndexes, diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index 03bbfd5c38..e250192d77 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -1,9 +1,9 @@ import 'dart:async'; import 'package:compat/compat.dart' as lib_monero_compat; -import 'package:cs_monero/cs_monero.dart' as lib_monero; import '../../../utilities/amount/amount.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../intermediate/lib_monero_wallet.dart'; @@ -13,36 +13,17 @@ class MoneroWallet extends LibMoneroWallet { @override Future estimateFeeFor(Amount amount, BigInt feeRate) async { - if (libMoneroWallet == null || + if (!csMonero.walletInstanceExists(walletId) || syncStatus is! lib_monero_compat.SyncedSyncStatus) { return Amount.zeroWith(fractionDigits: cryptoCurrency.fractionDigits); } - lib_monero.TransactionPriority priority; - switch (feeRate.toInt()) { - case 1: - priority = lib_monero.TransactionPriority.low; - break; - case 2: - priority = lib_monero.TransactionPriority.medium; - break; - case 3: - priority = lib_monero.TransactionPriority.high; - break; - case 4: - priority = lib_monero.TransactionPriority.last; - break; - case 0: - default: - priority = lib_monero.TransactionPriority.normal; - break; - } - int approximateFee = 0; await estimateFeeMutex.protect(() async { - approximateFee = await libMoneroWallet!.estimateFee( - priority, - amount.raw.toInt(), + approximateFee = await csMonero.estimateFee( + feeRate.toInt(), + amount.raw, + walletId: walletId, ); }); @@ -53,76 +34,67 @@ class MoneroWallet extends LibMoneroWallet { } @override - bool walletExists(String path) => lib_monero.MoneroWallet.isWalletExist(path); + bool walletExists(String path) => + csMonero.walletExists(path, csCoin: CsCoin.monero); @override - Future loadWallet({ - required String path, - required String password, - }) async { - libMoneroWallet = await lib_monero.MoneroWallet.loadWallet( - path: path, - password: password, - ); - } + Future loadWallet({required String path, required String password}) => + csMonero.loadWallet( + walletId, + path: path, + password: password, + csCoin: CsCoin.monero, + ); @override - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - }) async { - final lib_monero.MoneroSeedType type; - switch (wordCount) { - case 16: - type = lib_monero.MoneroSeedType.sixteen; - break; - - case 25: - type = lib_monero.MoneroSeedType.twentyFive; - break; - - default: - throw Exception("Invalid mnemonic word count: $wordCount"); - } - - return await lib_monero.MoneroWallet.create( - path: path, - password: password, - seedType: type, - seedOffset: seedOffset, - ); - } + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, + }) => csMonero.getCreatedWallet( + csCoin: CsCoin.monero, + path: path, + password: password, + wordCount: wordCount, + seedOffset: seedOffset, + onCreated: onCreated, + ); @override - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, required String seedOffset, int height = 0, - }) async => await lib_monero.MoneroWallet.restoreWalletFromSeed( + }) => csMonero.getRestoredWallet( path: path, password: password, - seed: mnemonic, - restoreHeight: height, + mnemonic: mnemonic, + height: height, seedOffset: seedOffset, + csCoin: CsCoin.monero, + walletId: walletId, ); @override - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, required String privateViewKey, int height = 0, - }) async => lib_monero.MoneroWallet.createViewOnlyWallet( + }) => csMonero.getRestoredFromViewKeyWallet( + walletId: walletId, + csCoin: CsCoin.monero, path: path, password: password, address: address, - viewKey: privateViewKey, - restoreHeight: height, + privateViewKey: privateViewKey, + height: height, ); @override diff --git a/lib/wallets/wallet/impl/wownero_wallet.dart b/lib/wallets/wallet/impl/wownero_wallet.dart index a8d5e1c655..560597141a 100644 --- a/lib/wallets/wallet/impl/wownero_wallet.dart +++ b/lib/wallets/wallet/impl/wownero_wallet.dart @@ -1,11 +1,11 @@ import 'dart:async'; import 'package:compat/compat.dart' as lib_monero_compat; -import 'package:cs_monero/cs_monero.dart' as lib_monero; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../utilities/amount/amount.dart'; import '../../../utilities/enums/fee_rate_type_enum.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../models/tx_data.dart'; import '../intermediate/lib_monero_wallet.dart'; @@ -16,33 +16,27 @@ class WowneroWallet extends LibMoneroWallet { @override Future estimateFeeFor(Amount amount, BigInt feeRate) async { - if (libMoneroWallet == null || + if (!csMonero.walletInstanceExists(walletId) || syncStatus is! lib_monero_compat.SyncedSyncStatus) { return Amount.zeroWith(fractionDigits: cryptoCurrency.fractionDigits); } - lib_monero.TransactionPriority priority; FeeRateType feeRateType = FeeRateType.slow; switch (feeRate.toInt()) { case 1: - priority = lib_monero.TransactionPriority.low; feeRateType = FeeRateType.average; break; case 2: - priority = lib_monero.TransactionPriority.medium; feeRateType = FeeRateType.average; break; case 3: - priority = lib_monero.TransactionPriority.high; feeRateType = FeeRateType.fast; break; case 4: - priority = lib_monero.TransactionPriority.last; feeRateType = FeeRateType.fast; break; case 0: default: - priority = lib_monero.TransactionPriority.normal; feeRateType = FeeRateType.slow; break; } @@ -71,9 +65,10 @@ class WowneroWallet extends LibMoneroWallet { // unsure why this delay? await Future.delayed(const Duration(milliseconds: 500)); } catch (e) { - approximateFee = libMoneroWallet!.estimateFee( - priority, - amount.raw.toInt(), + approximateFee = await csMonero.estimateFee( + feeRate.toInt(), + amount.raw, + walletId: walletId, ); } } @@ -91,77 +86,66 @@ class WowneroWallet extends LibMoneroWallet { @override bool walletExists(String path) => - lib_monero.WowneroWallet.isWalletExist(path); + csMonero.walletExists(path, csCoin: CsCoin.wownero); @override - Future loadWallet({ - required String path, - required String password, - }) async { - libMoneroWallet = await lib_monero.WowneroWallet.loadWallet( - path: path, - password: password, - ); - } + Future loadWallet({required String path, required String password}) => + csMonero.loadWallet( + walletId, + path: path, + password: password, + csCoin: CsCoin.wownero, + ); @override - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - }) async { - final lib_monero.WowneroSeedType type; - switch (wordCount) { - case 16: - type = lib_monero.WowneroSeedType.sixteen; - break; - - case 25: - type = lib_monero.WowneroSeedType.twentyFive; - break; - - default: - throw Exception("Invalid mnemonic word count: $wordCount"); - } - - return await lib_monero.WowneroWallet.create( - path: path, - password: password, - seedType: type, - overrideDeprecated14WordSeedException: true, - seedOffset: seedOffset, - ); - } + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, + }) => csMonero.getCreatedWallet( + csCoin: CsCoin.wownero, + path: path, + password: password, + wordCount: wordCount, + seedOffset: seedOffset, + onCreated: onCreated, + ); @override - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, required String seedOffset, int height = 0, - }) async => await lib_monero.WowneroWallet.restoreWalletFromSeed( + }) => csMonero.getRestoredWallet( path: path, password: password, - seed: mnemonic, - restoreHeight: height, + mnemonic: mnemonic, + height: height, seedOffset: seedOffset, + csCoin: CsCoin.wownero, + walletId: walletId, ); @override - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, required String privateViewKey, int height = 0, - }) async => lib_monero.WowneroWallet.createViewOnlyWallet( + }) => csMonero.getRestoredFromViewKeyWallet( + walletId: walletId, + csCoin: CsCoin.wownero, path: path, password: password, address: address, - viewKey: privateViewKey, - restoreHeight: height, + privateViewKey: privateViewKey, + height: height, ); @override diff --git a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart index a25b236a91..943de13d23 100644 --- a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart @@ -4,7 +4,6 @@ import 'dart:io'; import 'dart:math'; import 'package:compat/compat.dart' as lib_monero_compat; -import 'package:cs_monero/cs_monero.dart' as lib_monero; import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; @@ -34,6 +33,7 @@ import '../../../utilities/amount/amount.dart'; import '../../../utilities/enums/fee_rate_type_enum.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; import '../../crypto_currency/intermediate/cryptonote_currency.dart'; import '../../isar/models/wallet_info.dart'; import '../../models/tx_data.dart'; @@ -99,14 +99,13 @@ abstract class LibMoneroWallet await onUTXOsChanged(utxos); await updateBalance(shouldUpdateUtxos: false); } catch (e, s) { - lib_monero.Logging.log?.i("_startInit", error: e, stackTrace: s); + Logging.instance.e("_startInit", error: e, stackTrace: s); } }); }); } final lib_monero_compat.WalletType compatType; - lib_monero.Wallet? libMoneroWallet; lib_monero_compat.SyncStatus? get syncStatus => _syncStatus; lib_monero_compat.SyncStatus? _syncStatus; @@ -137,14 +136,16 @@ abstract class LibMoneroWallet Future loadWallet({required String path, required String password}); - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, }); - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, @@ -152,7 +153,7 @@ abstract class LibMoneroWallet int height = 0, }); - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, @@ -165,16 +166,18 @@ abstract class LibMoneroWallet bool walletExists(String path); String getTxKeyFor({required String txid}) { - if (libMoneroWallet == null) { + if (!csMonero.walletInstanceExists(walletId)) { throw Exception("Cannot get tx key in uninitialized libMoneroWallet"); } - return libMoneroWallet!.getTxKey(txid); + return csMonero.getTxKey(walletId, txid); } void _setListener() { - if (libMoneroWallet != null && libMoneroWallet!.getListeners().isEmpty) { - libMoneroWallet?.addListener( - lib_monero.WalletListener( + if (csMonero.walletInstanceExists(walletId) && + !csMonero.hasListeners(walletId)) { + csMonero.addListener( + walletId, + CsMoneroWalletListener( onSyncingUpdate: onSyncingUpdate, onNewBlock: onNewBlock, onBalancesChanged: onBalancesChanged, @@ -190,17 +193,16 @@ abstract class LibMoneroWallet Future open() async { bool wasNull = false; - if (libMoneroWallet == null) { + if (!csMonero.walletInstanceExists(walletId)) { wasNull = true; // libMoneroWalletT?.close(); final path = await pathForWallet(name: walletId, type: compatType); final String password; try { - password = - (await secureStorageInterface.read( - key: lib_monero_compat.libMoneroWalletPasswordKey(walletId), - ))!; + password = (await secureStorageInterface.read( + key: lib_monero_compat.libMoneroWalletPasswordKey(walletId), + ))!; } catch (e, s) { throw Exception("Password not found $e, $s"); } @@ -227,15 +229,15 @@ abstract class LibMoneroWallet if (wasNull) { try { _setSyncStatus(lib_monero_compat.ConnectingSyncStatus()); - libMoneroWallet?.startSyncing(); + csMonero.startSyncing(walletId); } catch (_) { _setSyncStatus(lib_monero_compat.FailedSyncStatus()); // TODO log } } _setListener(); - libMoneroWallet?.startListeners(); - libMoneroWallet?.startAutoSaving(); + csMonero.startListeners(walletId); + csMonero.startAutoSaving(walletId); unawaited(refresh()); } @@ -260,16 +262,17 @@ abstract class LibMoneroWallet appRoot: appRoot, ); } - await libMoneroWallet!.save(); + await csMonero.save(walletId); } Address addressFor({required int index, int account = 0}) { - final address = libMoneroWallet!.getAddress( + final address = csMonero.getAddress( + walletId, accountIndex: account, addressIndex: index, ); - if (address.value.contains("111")) { + if (address.contains("111")) { throw Exception("111 address found!"); } @@ -277,7 +280,7 @@ abstract class LibMoneroWallet walletId: walletId, derivationIndex: index, derivationPath: null, - value: address.value, + value: address, publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -287,19 +290,18 @@ abstract class LibMoneroWallet } Future getKeys() async { - final base = libMoneroWallet; - final oldInfo = getLibMoneroWalletInfo(walletId); - if (base == null || (oldInfo != null && oldInfo.name != walletId)) { + if (!csMonero.walletInstanceExists(walletId) || + (oldInfo != null && oldInfo.name != walletId)) { return null; } try { return CWKeyData( walletId: walletId, - publicViewKey: base.getPublicViewKey(), - privateViewKey: base.getPrivateViewKey(), - publicSpendKey: base.getPublicSpendKey(), - privateSpendKey: base.getPrivateSpendKey(), + publicViewKey: csMonero.getPublicViewKey(walletId), + privateViewKey: csMonero.getPrivateViewKey(walletId), + publicSpendKey: csMonero.getPublicSpendKey(walletId), + privateSpendKey: csMonero.getPrivateSpendKey(walletId), ); } catch (e, s) { Logging.instance.f("getKeys failed: ", error: e, stackTrace: s); @@ -318,16 +320,17 @@ abstract class LibMoneroWallet final path = await pathForWallet(name: walletId, type: compatType); final String password; try { - password = - (await secureStorageInterface.read( - key: lib_monero_compat.libMoneroWalletPasswordKey(walletId), - ))!; + password = (await secureStorageInterface.read( + key: lib_monero_compat.libMoneroWalletPasswordKey(walletId), + ))!; } catch (e, s) { throw Exception("Password not found $e, $s"); } await loadWallet(path: path, password: password); - final wallet = libMoneroWallet!; - return (wallet.getAddress().value, wallet.getPrivateViewKey()); + return ( + csMonero.getAddress(walletId), + csMonero.getPrivateViewKey(walletId), + ); } @override @@ -343,17 +346,23 @@ abstract class LibMoneroWallet key: lib_monero_compat.libMoneroWalletPasswordKey(walletId), value: password, ); - final wallet = await getCreatedWallet( + + late final int refreshFromBlockHeight; + late final String seedPhrase; + + await getCreatedWallet( path: path, password: password, wordCount: wordCount, seedOffset: "", // default for non restored wallets for now + onCreated: (height, seed) { + refreshFromBlockHeight = height; + seedPhrase = seed; + }, ); - final height = wallet.getRefreshFromBlockHeight(); - await info.updateRestoreHeight( - newRestoreHeight: height, + newRestoreHeight: refreshFromBlockHeight, isar: mainDB.isar, ); @@ -361,7 +370,7 @@ abstract class LibMoneroWallet // before wallet.init() is called await secureStorageInterface.write( key: Wallet.mnemonicKey(walletId: walletId), - value: wallet.getSeed().trim(), + value: seedPhrase, ); await secureStorageInterface.write( key: Wallet.mnemonicPassphraseKey(walletId: walletId), @@ -384,8 +393,8 @@ abstract class LibMoneroWallet await mainDB.deleteWalletBlockchainData(walletId); highestPercentCached = 0; - unawaited(libMoneroWallet?.rescanBlockchain()); - libMoneroWallet?.startSyncing(); + unawaited(csMonero.rescanBlockchain(walletId)); + csMonero.startSyncing(walletId); // unawaited(save()); }); unawaited(refresh()); @@ -422,7 +431,12 @@ abstract class LibMoneroWallet key: lib_monero_compat.libMoneroWalletPasswordKey(walletId), value: password, ); - final wallet = await getRestoredWallet( + + if (!csMonero.walletInstanceExists(walletId)) { + await exit(); + } + + await getRestoredWallet( path: path, password: password, mnemonic: mnemonic, @@ -430,12 +444,6 @@ abstract class LibMoneroWallet seedOffset: seedOffset, ); - if (libMoneroWallet != null) { - await exit(); - } - - libMoneroWallet = wallet; - _setListener(); final newReceivingAddress = @@ -444,7 +452,7 @@ abstract class LibMoneroWallet walletId: walletId, derivationIndex: 0, derivationPath: null, - value: wallet.getAddress().value, + value: csMonero.getAddress(walletId), publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -463,12 +471,12 @@ abstract class LibMoneroWallet _setListener(); // libMoneroWallet?.setRecoveringFromSeed(isRecovery: true); - unawaited(libMoneroWallet?.rescanBlockchain()); - libMoneroWallet?.startSyncing(); + unawaited(csMonero.rescanBlockchain(walletId)); + csMonero.startSyncing(walletId); // await save(); - libMoneroWallet?.startListeners(); - libMoneroWallet?.startAutoSaving(); + csMonero.startListeners(walletId); + csMonero.startAutoSaving(walletId); } catch (e, s) { Logging.instance.e( "Exception rethrown from recoverFromMnemonic(): ", @@ -484,11 +492,11 @@ abstract class LibMoneroWallet bool _canPing = false; @override - Future pingCheck() async { + Future pingCheck() { if (_canPing) { - return (await libMoneroWallet?.isConnectedToDaemon()) ?? false; + return csMonero.isConnectedToDaemon(walletId); } else { - return false; + return Future.value(false); } } @@ -500,50 +508,50 @@ abstract class LibMoneroWallet throw Exception("TOR – clearnet mismatch"); } - final host = - node.host.endsWith(".onion") ? node.host : Uri.parse(node.host).host; + final host = node.host.endsWith(".onion") + ? node.host + : Uri.parse(node.host).host; ({InternetAddress host, int port})? proxy; - proxy = - prefs.useTor && !node.forceNoTor - ? TorService.sharedInstance.getProxyInfo() - : null; + proxy = prefs.useTor && !node.forceNoTor + ? TorService.sharedInstance.getProxyInfo() + : null; _setSyncStatus(lib_monero_compat.ConnectingSyncStatus()); try { if (_requireMutex) { await _torConnectingLock.protect(() async { - await libMoneroWallet?.connect( + await csMonero.connect( + walletId, daemonAddress: "$host:${node.port}", daemonUsername: node.loginName, daemonPassword: await node.getPassword(secureStorageInterface), trusted: node.trusted ?? false, useSSL: node.useSSL, - socksProxyAddress: - node.forceNoTor - ? null - : proxy == null - ? null - : "${proxy.host.address}:${proxy.port}", + socksProxyAddress: node.forceNoTor + ? null + : proxy == null + ? null + : "${proxy.host.address}:${proxy.port}", ); }); } else { - await libMoneroWallet?.connect( + await csMonero.connect( + walletId, daemonAddress: "$host:${node.port}", daemonUsername: node.loginName, daemonPassword: await node.getPassword(secureStorageInterface), trusted: node.trusted ?? false, useSSL: node.useSSL, - socksProxyAddress: - node.forceNoTor - ? null - : proxy == null - ? null - : "${proxy.host.address}:${proxy.port}", + socksProxyAddress: node.forceNoTor + ? null + : proxy == null + ? null + : "${proxy.host.address}:${proxy.port}", ); } - libMoneroWallet?.startSyncing(); - libMoneroWallet?.startListeners(); - libMoneroWallet?.startAutoSaving(); + csMonero.startSyncing(walletId); + csMonero.startListeners(walletId); + csMonero.startAutoSaving(walletId); _setSyncStatus(lib_monero_compat.ConnectedSyncStatus()); } catch (e, s) { @@ -560,22 +568,19 @@ abstract class LibMoneroWallet @override Future updateTransactions() async { - final base = libMoneroWallet; - - if (base == null) { + if (!csMonero.walletInstanceExists(walletId)) { return; } - final localTxids = - await mainDB.isar.transactionV2s - .where() - .walletIdEqualTo(walletId) - .filter() - .heightGreaterThan(0) - .txidProperty() - .findAll(); + final localTxids = await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .filter() + .heightGreaterThan(0) + .txidProperty() + .findAll(); - final allTxids = await base.getAllTxids(refresh: true); + final allTxids = await csMonero.getAllTxids(walletId, refresh: true); final txidsToFetch = allTxids.toSet().difference(localTxids.toSet()); @@ -583,9 +588,17 @@ abstract class LibMoneroWallet return; } - final transactions = await base.getTxs(txids: txidsToFetch, refresh: false); + final transactions = await csMonero.getTxs( + walletId, + txids: txidsToFetch, + refresh: false, + ); - final allOutputs = await base.getOutputs(includeSpent: true, refresh: true); + final allOutputs = await csMonero.getOutputs( + walletId, + includeSpent: true, + refresh: true, + ); // final cachedTransactions = // DB.instance.get(boxName: walletId, key: 'latest_tx_model') @@ -671,16 +684,14 @@ abstract class LibMoneroWallet type: type, subType: TransactionSubType.none, otherData: jsonEncode({ - TxV2OdKeys.overrideFee: - Amount( - rawValue: tx.fee, - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), - TxV2OdKeys.moneroAmount: - Amount( - rawValue: tx.amount, - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), + TxV2OdKeys.overrideFee: Amount( + rawValue: tx.fee, + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), + TxV2OdKeys.moneroAmount: Amount( + rawValue: tx.amount, + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), TxV2OdKeys.moneroAccountIndex: tx.accountIndex, TxV2OdKeys.isMoneroTransaction: true, }), @@ -695,7 +706,7 @@ abstract class LibMoneroWallet Future get availableBalance async { try { return Amount( - rawValue: libMoneroWallet!.getUnlockedBalance(), + rawValue: csMonero.getUnlockedBalance(walletId)!, fractionDigits: cryptoCurrency.fractionDigits, ); } catch (_) { @@ -705,14 +716,14 @@ abstract class LibMoneroWallet Future get totalBalance async { try { - final full = libMoneroWallet?.getBalance(); + final full = csMonero.getBalance(walletId); if (full != null) { return Amount( rawValue: full, fractionDigits: cryptoCurrency.fractionDigits, ); } else { - final transactions = await libMoneroWallet!.getAllTxs(refresh: true); + final transactions = await csMonero.getAllTxs(walletId, refresh: true); BigInt transactionBalance = BigInt.zero; for (final tx in transactions) { if (!tx.isSpend) { @@ -735,10 +746,10 @@ abstract class LibMoneroWallet @override Future exit() async { Logging.instance.i("exit called on $walletId"); - libMoneroWallet?.stopAutoSaving(); - libMoneroWallet?.stopListeners(); - libMoneroWallet?.stopSyncing(); - await libMoneroWallet?.save(); + csMonero.stopAutoSaving(walletId); + csMonero.stopListeners(walletId); + csMonero.stopSyncing(walletId); + await csMonero.save(walletId); } Future pathForWalletDir({ @@ -820,7 +831,7 @@ abstract class LibMoneroWallet final _utxosUpdateLock = Mutex(); Future onUTXOsChanged(List utxos) async { await _utxosUpdateLock.protect(() async { - final cwUtxos = await libMoneroWallet?.getOutputs(refresh: true) ?? []; + final cwUtxos = await csMonero.getOutputs(walletId, refresh: true); // bool changed = false; @@ -837,12 +848,12 @@ abstract class LibMoneroWallet if (u.isBlocked) { if (!cw.isFrozen) { - await libMoneroWallet?.freezeOutput(cw.keyImage); + await csMonero.freezeOutput(walletId, cw.keyImage); // changed = true; } } else { if (cw.isFrozen) { - await libMoneroWallet?.thawOutput(cw.keyImage); + await csMonero.thawOutput(walletId, cw.keyImage); // changed = true; } } @@ -999,9 +1010,9 @@ abstract class LibMoneroWallet if (mismatch) { _canPing = false; - libMoneroWallet?.stopAutoSaving(); - libMoneroWallet?.stopListeners(); - libMoneroWallet?.stopSyncing(); + csMonero.stopAutoSaving(walletId); + csMonero.stopListeners(walletId); + csMonero.stopSyncing(walletId); _setSyncStatus(lib_monero_compat.FailedSyncStatus()); } @@ -1019,27 +1030,23 @@ abstract class LibMoneroWallet @override Future updateUTXOs() async { final List outputArray = []; - final utxos = - await libMoneroWallet?.getOutputs(refresh: true) ?? - []; + final utxos = await csMonero.getOutputs(walletId, refresh: true); for (final rawUTXO in utxos) { if (!rawUTXO.spent) { - final current = - await mainDB.isar.utxos - .where() - .walletIdEqualTo(walletId) - .filter() - .voutEqualTo(rawUTXO.vout) - .and() - .txidEqualTo(rawUTXO.hash) - .findFirst(); - final tx = - await mainDB.isar.transactionV2s - .where() - .walletIdEqualTo(walletId) - .filter() - .txidEqualTo(rawUTXO.hash) - .findFirst(); + final current = await mainDB.isar.utxos + .where() + .walletIdEqualTo(walletId) + .filter() + .voutEqualTo(rawUTXO.vout) + .and() + .txidEqualTo(rawUTXO.hash) + .findFirst(); + final tx = await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .filter() + .txidEqualTo(rawUTXO.hash) + .findFirst(); final otherDataMap = { UTXOOtherDataKeys.keyImage: rawUTXO.keyImage, @@ -1112,7 +1119,7 @@ abstract class LibMoneroWallet // Slight possibility of race but should be irrelevant await refreshMutex.acquire(); - libMoneroWallet?.startSyncing(); + csMonero.startSyncing(walletId); _setSyncStatus(lib_monero_compat.StartingSyncStatus()); await updateTransactions(); @@ -1126,9 +1133,9 @@ abstract class LibMoneroWallet refreshMutex.release(); } - final synced = await libMoneroWallet?.isSynced(); + final synced = await csMonero.isSynced(walletId); - if (synced == true) { + if (synced) { _setSyncStatus(lib_monero_compat.SyncedSyncStatus()); } } @@ -1138,8 +1145,9 @@ abstract class LibMoneroWallet try { final currentReceiving = await getCurrentReceivingAddress(); - final newReceivingIndex = - currentReceiving == null ? 0 : currentReceiving.derivationIndex + 1; + final newReceivingIndex = currentReceiving == null + ? 0 + : currentReceiving.derivationIndex + 1; final newReceivingAddress = addressFor(index: newReceivingIndex); @@ -1174,17 +1182,14 @@ abstract class LibMoneroWallet try { int highestIndex = -1; - final entries = await libMoneroWallet?.getAllTxs(refresh: true); - if (entries != null) { - for (final element in entries) { - if (!element.isSpend) { - final int curAddressIndex = - element.addressIndexes.isEmpty - ? 0 - : element.addressIndexes.reduce(max); - if (curAddressIndex > highestIndex) { - highestIndex = curAddressIndex; - } + final entries = await csMonero.getAllTxs(walletId, refresh: true); + for (final element in entries) { + if (!element.isSpend) { + final int curAddressIndex = element.addressIndexes.isEmpty + ? 0 + : element.addressIndexes.reduce(max); + if (curAddressIndex > highestIndex) { + highestIndex = curAddressIndex; } } } @@ -1200,12 +1205,11 @@ abstract class LibMoneroWallet // Use new index to derive a new receiving address final newReceivingAddress = addressFor(index: newReceivingIndex); - final existing = - await mainDB - .getAddresses(walletId) - .filter() - .valueEqualTo(newReceivingAddress.value) - .findFirst(); + final existing = await mainDB + .getAddresses(walletId) + .filter() + .valueEqualTo(newReceivingAddress.value) + .findFirst(); if (existing == null) { // Add that new change address await mainDB.putAddress(newReceivingAddress); @@ -1241,9 +1245,9 @@ abstract class LibMoneroWallet numberOfBlocksFast: 10, numberOfBlocksAverage: 15, numberOfBlocksSlow: 20, - fast: BigInt.from(lib_monero.TransactionPriority.high.value), - medium: BigInt.from(lib_monero.TransactionPriority.medium.value), - slow: BigInt.from(lib_monero.TransactionPriority.normal.value), + fast: BigInt.from(csMonero.getTxPriorityHigh()), + medium: BigInt.from(csMonero.getTxPriorityMedium()), + slow: BigInt.from(csMonero.getTxPriorityNormal()), ); @override @@ -1269,16 +1273,16 @@ abstract class LibMoneroWallet try { final feeRate = txData.feeRateType; if (feeRate is FeeRateType) { - lib_monero.TransactionPriority feePriority; + final int feePriority; switch (feeRate) { case FeeRateType.fast: - feePriority = lib_monero.TransactionPriority.high; + feePriority = csMonero.getTxPriorityHigh(); break; case FeeRateType.average: - feePriority = lib_monero.TransactionPriority.medium; + feePriority = csMonero.getTxPriorityMedium(); break; case FeeRateType.slow: - feePriority = lib_monero.TransactionPriority.normal; + feePriority = csMonero.getTxPriorityNormal(); break; default: throw ArgumentError("Invalid use of custom fee"); @@ -1303,12 +1307,9 @@ abstract class LibMoneroWallet throw Exception("Send all not supported with multiple recipients"); } - final List outputs = []; + final List outputs = []; for (final recipient in txData.recipients!) { - final output = lib_monero.Recipient( - address: recipient.address, - amount: recipient.amount.raw, - ); + final output = CsRecipient(recipient.address, recipient.amount.raw); outputs.add(output); } @@ -1318,44 +1319,27 @@ abstract class LibMoneroWallet } final height = await chainHeight; - final inputs = - txData.utxos - ?.whereType() - .map( - (e) => lib_monero.Output( - address: e.address!, - hash: e.utxo.txid, - keyImage: e.utxo.keyImage!, - value: e.value, - isFrozen: e.utxo.isBlocked, - isUnlocked: - e.utxo.blockHeight != null && - (height - (e.utxo.blockHeight ?? 0)) >= - cryptoCurrency.minConfirms, - height: e.utxo.blockHeight ?? 0, - vout: e.utxo.vout, - spent: e.utxo.used ?? false, - spentHeight: null, // doesn't matter here - coinbase: e.utxo.isCoinbase, - ), - ) - .toList(); + final inputs = txData.utxos?.whereType().toList(); return await prepareSendMutex.protect(() async { - final lib_monero.PendingTransaction pendingTransaction; + final CsPendingTransaction pendingTransaction; if (outputs.length == 1) { - pendingTransaction = await libMoneroWallet!.createTx( + pendingTransaction = await csMonero.createTx( + walletId, + minConfirms: cryptoCurrency.minConfirms, + currentHeight: height, output: outputs.first, - paymentId: "", sweep: sweep, priority: feePriority, preferredInputs: inputs, accountIndex: 0, // sw only uses account 0 at this time ); } else { - pendingTransaction = await libMoneroWallet!.createTxMultiDest( + pendingTransaction = await csMonero.createTxMultiDest( + walletId, + minConfirms: cryptoCurrency.minConfirms, + currentHeight: height, outputs: outputs, - paymentId: "", priority: feePriority, preferredInputs: inputs, sweep: sweep, @@ -1398,7 +1382,7 @@ abstract class LibMoneroWallet Future confirmSend({required TxData txData}) async { try { try { - await libMoneroWallet!.commitTx(txData.pendingTransaction!); + await csMonero.commitTx(walletId, txData.pendingTransaction!); Logging.instance.d( "transaction ${txData.pendingTransaction!.txid} has been sent", @@ -1447,7 +1431,11 @@ abstract class LibMoneroWallet key: lib_monero_compat.libMoneroWalletPasswordKey(walletId), value: password, ); - final wallet = await getRestoredFromViewKeyWallet( + + if (csMonero.walletInstanceExists(walletId)) { + await exit(); + } + await getRestoredFromViewKeyWallet( path: path, password: password, address: data.address, @@ -1455,12 +1443,6 @@ abstract class LibMoneroWallet height: height, ); - if (libMoneroWallet != null) { - await exit(); - } - - libMoneroWallet = wallet; - _setListener(); final newReceivingAddress = @@ -1469,7 +1451,7 @@ abstract class LibMoneroWallet walletId: walletId, derivationIndex: 0, derivationPath: null, - value: wallet.getAddress().value, + value: csMonero.getAddress(walletId), publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -1484,12 +1466,12 @@ abstract class LibMoneroWallet await updateNode(); _setListener(); - unawaited(libMoneroWallet?.rescanBlockchain()); - libMoneroWallet?.startSyncing(); + unawaited(csMonero.rescanBlockchain(walletId)); + csMonero.startSyncing(walletId); // await save(); - libMoneroWallet?.startListeners(); - libMoneroWallet?.startAutoSaving(); + csMonero.startListeners(walletId); + csMonero.startAutoSaving(walletId); } catch (e, s) { Logging.instance.e( "Exception rethrown from recoverViewOnly(): ", diff --git a/lib/widgets/desktop/desktop_fee_dialog.dart b/lib/widgets/desktop/desktop_fee_dialog.dart index 82cc82e0bd..82f92a5a25 100644 --- a/lib/widgets/desktop/desktop_fee_dialog.dart +++ b/lib/widgets/desktop/desktop_fee_dialog.dart @@ -1,4 +1,3 @@ -import 'package:cs_monero/cs_monero.dart' as lib_monero; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -16,6 +15,7 @@ import '../../utilities/text_styles.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; import '../../wallets/isar/providers/eth/current_token_wallet_provider.dart'; import '../../wallets/wallet/impl/firo_wallet.dart'; +import '../../wl_gen/interfaces/cs_monero_interface.dart'; import '../animated_text.dart'; import '../conditional_parent.dart'; import 'desktop_dialog.dart'; @@ -63,7 +63,7 @@ class _DesktopFeeDialogState extends ConsumerState { if (coin is Monero || coin is Wownero) { final fee = await wallet.estimateFeeFor( amount, - BigInt.from(lib_monero.TransactionPriority.high.value), + BigInt.from(csMonero.getTxPriorityHigh()), ); ref.read(feeSheetSessionCacheProvider).fast[amount] = fee; } else if (coin is Firo) { @@ -113,7 +113,7 @@ class _DesktopFeeDialogState extends ConsumerState { if (coin is Monero || coin is Wownero) { final fee = await wallet.estimateFeeFor( amount, - BigInt.from(lib_monero.TransactionPriority.medium.value), + BigInt.from(csMonero.getTxPriorityMedium()), ); ref.read(feeSheetSessionCacheProvider).average[amount] = fee; } else if (coin is Firo) { @@ -163,7 +163,7 @@ class _DesktopFeeDialogState extends ConsumerState { if (coin is Monero || coin is Wownero) { final fee = await wallet.estimateFeeFor( amount, - BigInt.from(lib_monero.TransactionPriority.normal.value), + BigInt.from(csMonero.getTxPriorityNormal()), ); ref.read(feeSheetSessionCacheProvider).slow[amount] = fee; } else if (coin is Firo) { @@ -335,18 +335,17 @@ class _DesktopFeeItemState extends ConsumerState { return ConditionalParent( condition: widget.isButton, - builder: - (child) => MaterialButton( - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - onPressed: () { - ref.read(feeRateTypeDesktopStateProvider.state).state = - widget.feeRateType; - Navigator.of( - context, - ).pop((widget.feeRateType, feeString, timeString)); - }, - child: child, - ), + builder: (child) => MaterialButton( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onPressed: () { + ref.read(feeRateTypeDesktopStateProvider.state).state = + widget.feeRateType; + Navigator.of( + context, + ).pop((widget.feeRateType, feeString, timeString)); + }, + child: child, + ), child: Builder( builder: (_) { if (widget.feeRateType == FeeRateType.custom) { @@ -355,14 +354,12 @@ class _DesktopFeeItemState extends ConsumerState { children: [ Text( widget.feeRateType.prettyName, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of( context, ).extension()!.textFieldActiveText, - ), + ), textAlign: TextAlign.left, ), ], @@ -377,10 +374,9 @@ class _DesktopFeeItemState extends ConsumerState { return AnimatedText( stringsToLoopThrough: stringsToLoopThrough, style: STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveText, + color: Theme.of( + context, + ).extension()!.textFieldActiveText, ), ); } else { @@ -388,12 +384,11 @@ class _DesktopFeeItemState extends ConsumerState { future: widget.feeFor( coin: wallet.info.coin, feeRateType: widget.feeRateType, - feeRate: - widget.feeRateType == FeeRateType.fast - ? widget.feeObject!.fast - : widget.feeRateType == FeeRateType.slow - ? widget.feeObject!.slow - : widget.feeObject!.medium, + feeRate: widget.feeRateType == FeeRateType.fast + ? widget.feeObject!.fast + : widget.feeRateType == FeeRateType.slow + ? widget.feeObject!.slow + : widget.feeObject!.medium, amount: ref.watch(sendAmountProvider.state).state, ), builder: (_, AsyncSnapshot snapshot) { @@ -403,58 +398,51 @@ class _DesktopFeeItemState extends ConsumerState { "${widget.feeRateType.prettyName} " "(~${ref.watch(pAmountFormatter(wallet.info.coin)).format(snapshot.data!, indicatePrecisionLoss: false)})"; - timeString = - wallet.info.coin is Ethereum - ? "" - : estimatedTimeToBeIncludedInNextBlock( - wallet.info.coin.targetBlockTimeSeconds, - widget.feeRateType == FeeRateType.fast - ? widget.feeObject!.numberOfBlocksFast - : widget.feeRateType == FeeRateType.slow - ? widget.feeObject!.numberOfBlocksSlow - : widget.feeObject!.numberOfBlocksAverage, - ); + timeString = wallet.info.coin is Ethereum + ? "" + : estimatedTimeToBeIncludedInNextBlock( + wallet.info.coin.targetBlockTimeSeconds, + widget.feeRateType == FeeRateType.fast + ? widget.feeObject!.numberOfBlocksFast + : widget.feeRateType == FeeRateType.slow + ? widget.feeObject!.numberOfBlocksSlow + : widget.feeObject!.numberOfBlocksAverage, + ); return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( feeString!, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of( context, ).extension()!.textFieldActiveText, - ), + ), textAlign: TextAlign.left, ), if (widget.feeObject != null) Text( timeString!, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) .extension()! .textFieldActiveSearchIconRight, - ), + ), ), ], ); } else { return AnimatedText( stringsToLoopThrough: stringsToLoopThrough, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of( context, ).extension()!.textFieldActiveText, - ), + ), ); } }, diff --git a/lib/wl_gen/interfaces/cs_monero_interface.dart b/lib/wl_gen/interfaces/cs_monero_interface.dart new file mode 100644 index 0000000000..7622962396 --- /dev/null +++ b/lib/wl_gen/interfaces/cs_monero_interface.dart @@ -0,0 +1,380 @@ +import '../../models/input.dart'; + +export '../generated/cs_monero_interface_impl.dart'; + +abstract class CsMoneroInterface { + void setUseCsMoneroLoggerInternal(bool enable); + + // tx prio forwarding + int getTxPriorityHigh(); + int getTxPriorityMedium(); + int getTxPriorityNormal(); + + bool walletInstanceExists(String walletId); + + bool walletExists(String path, {required CsCoin csCoin}); + + Future estimateFee(int rate, BigInt amount, {required String walletId}); + + Future loadWallet( + String walletId, { + required CsCoin csCoin, + required String path, + required String password, + }); + + String getAddress( + String walletId, { + int accountIndex = 0, + int addressIndex = 0, + }); + + Future getCreatedWallet({ + required CsCoin csCoin, + required String path, + required String password, + required int wordCount, + required String seedOffset, + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, + }); + + Future getRestoredWallet({ + required String walletId, + required CsCoin csCoin, + required String path, + required String password, + required String mnemonic, + required String seedOffset, + int height = 0, + }); + + Future getRestoredFromViewKeyWallet({ + required String walletId, + required CsCoin csCoin, + required String path, + required String password, + required String address, + required String privateViewKey, + int height = 0, + }); + + String getTxKey(String walletId, String txid); + + Future save(String walletId); + + String getPublicViewKey(String walletId); + String getPrivateViewKey(String walletId); + String getPublicSpendKey(String walletId); + String getPrivateSpendKey(String walletId); + + Future isSynced(String walletId); + void startSyncing(String walletId); + void stopSyncing(String walletId); + + void startAutoSaving(String walletId); + void stopAutoSaving(String walletId); + + bool hasListeners(String walletId); + void addListener(String walletId, CsMoneroWalletListener listener); + void startListeners(String walletId); + void stopListeners(String walletId); + + Future rescanBlockchain(String walletId); + Future isConnectedToDaemon(String walletId); + + int getRefreshFromBlockHeight(String walletId); + void setRefreshFromBlockHeight(String walletId, int height); + + Future connect( + String walletId, { + required String daemonAddress, + required bool trusted, + String? daemonUsername, + String? daemonPassword, + bool useSSL = false, + bool isLightWallet = false, + String? socksProxyAddress, + }); + + Future> getAllTxids(String walletId, {bool refresh = false}); + + BigInt? getBalance(String walletId, {int accountIndex = 0}); + BigInt? getUnlockedBalance(String walletId, {int accountIndex = 0}); + + Future> getAllTxs( + String walletId, { + bool refresh = false, + }); + + Future> getTxs( + String walletId, { + required Set txids, + bool refresh = false, + }); + + Future createTx( + String walletId, { + required CsRecipient output, + required int priority, + required bool sweep, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }); + + Future createTxMultiDest( + String walletId, { + required List outputs, + required int priority, + required bool sweep, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }); + + Future commitTx(String walletId, CsPendingTransaction tx); + + Future> getOutputs( + String walletId, { + bool refresh = false, + bool includeSpent = false, + }); + + Future freezeOutput(String walletId, String keyImage); + Future thawOutput(String walletId, String keyImage); + + List getMoneroWordList(String language); + List getWowneroWordList(String language, int seedLength); +} + +enum CsCoin { monero, wownero } + +// forwarding class +final class CsMoneroWalletListener { + CsMoneroWalletListener({ + this.onSyncingUpdate, + this.onNewBlock, + this.onBalancesChanged, + this.onError, + }); + + /// Called when the wallet sync progress is updated. + /// + /// Parameters: + /// - [syncHeight]: The current syncing height of the wallet. + /// - [nodeHeight]: The height of the blockchain on the connected node. + /// - [message]: An optional message that may provide additional context. + final void Function({ + required int syncHeight, + required int nodeHeight, + String? message, + })? + onSyncingUpdate; + + /// Called when the daemon’s chain height changes, indicating new blocks. + /// + /// Parameters: + /// - [height]: The new height of the blockchain. + final void Function(int height)? onNewBlock; + + /// Called when the wallet balance or unlocked balance updates. + /// + /// Parameters: + /// - [newBalance]: The updated total wallet balance in atomic units. + /// - [newUnlockedBalance]: The updated unlocked balance in atomic units. + final void Function({ + required BigInt newBalance, + required BigInt newUnlockedBalance, + })? + onBalancesChanged; + + /// Called when an error occurs during synchronization/polling. + /// + /// Parameters: + /// - [error]: The error object describing what went wrong. + /// - [stackTrace]: The stack trace at the point where the error occurred. + final void Function(Object? error, StackTrace? stackTrace)? onError; +} + +// stupid +final class CsPendingTransaction { + /// should only ever be lib_monero.PendingTransaction but we can't strongly + /// type that because we cannot conditionally import in dart so now we have + /// this hack yay + final Object value; + + // stupid duplicates + final BigInt amount, fee; + + // stupid duplicate + final String txid; + + const CsPendingTransaction(this.value, this.amount, this.fee, this.txid); +} + +// forwarding class +final class CsTransaction { + CsTransaction({ + required this.displayLabel, + required this.description, + required this.fee, + required this.confirmations, + required this.blockHeight, + required this.accountIndex, + required this.addressIndexes, + required this.paymentId, + required this.amount, + required this.isSpend, + required this.hash, + required this.key, + required this.timeStamp, + required this.minConfirms, + }) { + if (fee.isNegative) throw Exception("negative fee"); + if (confirmations.isNegative) throw Exception("negative confirmations"); + if (accountIndex.isNegative) throw Exception("negative accountIndex"); + if (amount.isNegative) throw Exception("negative amount"); + } + + /// A label to display for the transaction, providing a human-readable identifier. + final String displayLabel; + + /// A description of the transaction, providing additional context or details. + final String description; + + /// The transaction fee in atomic units. + final BigInt fee; + + /// The number of confirmations this transaction has received. + final int confirmations; + + /// The block height at which this transaction was included. + final int blockHeight; + + /// A set of indexes corresponding to addresses associated with this transaction. + final Set addressIndexes; + + /// The index of the account associated with this transaction. + final int accountIndex; + + /// An optional payment identifier, used to associate this transaction with a payment. + final String paymentId; + + /// The amount of funds transferred in this transaction, represented in atomic units. + final BigInt amount; + + /// Flag indicating whether this transaction is a spend transaction. + final bool isSpend; + + /// The timestamp of when this transaction was created or recorded. + final DateTime timeStamp; + + /// The unique hash of this transaction (txid). + final String hash; + + /// A key used to prove a transaction was made and relayed and to verify its details. + final String key; + + /// The minimum number of confirmations required for this transaction. + final int minConfirms; + + /// Flag indicating whether the transaction is confirmed. + bool get isConfirmed => !isPending; + + /// Flag indicating whether the transaction is pending (i.e., not yet confirmed). + bool get isPending => confirmations < minConfirms; +} + +// forwarding class +final class CsRecipient { + final String address; + final BigInt amount; + + CsRecipient(this.address, this.amount); +} + +// forwarding class +final class CsOutput { + /// Creates an [CsOutput] with the specified Monero transaction details. NOTE: + /// No validation of any properties (besides a negative [value] or [vout], + /// and a non empty [keyImage]) occurs here. + /// + /// [address] is the receiving Monero address. + /// [hash] is the transaction hash of the output. + /// [keyImage] is the unique identifier of the output. + /// [value] represents the amount of Monero in atomic units. + /// [isFrozen] indicates if the output is currently frozen. + /// [isUnlocked] shows if the output is available for spending. + /// [height] is the blockchain height at which the output was created. + /// [spentHeight] is the blockchain height at which the output was spent, + /// or `null` if it is unspent. + /// [vout] represents the output index within the transaction. + /// [spent] indicates if the output has been spent. + /// [coinbase] identifies if the output is from a coinbase transaction. + CsOutput({ + required this.address, + required this.hash, + required this.keyImage, + required this.value, + required this.isFrozen, + required this.isUnlocked, + required this.height, + required this.spentHeight, + required this.vout, + required this.spent, + required this.coinbase, + }) : assert(!value.isNegative && !vout.isNegative && keyImage.isNotEmpty); + + /// The receiving Monero address. + final String address; + + /// The hash of the transaction in which this output was created. + final String hash; + + /// The value of the output, in atomic units. + final BigInt value; + + /// A unique identifier for this output. + /// See https://monero.stackexchange.com/questions/2883/what-is-a-key-image + final String keyImage; + + /// Whether this output is frozen, preventing it from being spent. + final bool isFrozen; + + /// Whether this output is unlocked and available for spending. + final bool isUnlocked; + + /// The blockchain height where this output was created. + final int height; + + /// The blockchain height where this output was spent, or `null` if unspent. + final int? spentHeight; + + /// The output index within the transaction. + final int vout; + + /// Whether this output has already been spent. + final bool spent; + + /// Whether this output originates from a coinbase transaction. + final bool coinbase; + + /// Returns a copy of this [Output] instance, with the [isFrozen] status + /// updated. + CsOutput copyWithFrozen(bool isFrozen) => CsOutput( + address: address, + hash: hash, + keyImage: keyImage, + value: value, + isFrozen: isFrozen, + isUnlocked: isUnlocked, + height: height, + spentHeight: spentHeight, + vout: vout, + spent: spent, + coinbase: coinbase, + ); +} diff --git a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart new file mode 100644 index 0000000000..a90a4dbb17 --- /dev/null +++ b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart @@ -0,0 +1,541 @@ +//ON +import 'package:cs_monero/cs_monero.dart' as lib_monero; + +//END_ON +import '../../models/input.dart'; +import '../interfaces/cs_monero_interface.dart'; + +CsMoneroInterface get csMonero => _getInterface(); + +//OFF +CsMoneroInterface _getInterface() => throw Exception("XMR/WOW not enabled!"); + +//END_OFF +//ON +CsMoneroInterface _getInterface() => _CsMoneroInterfaceImpl(); + +class _CsMoneroInterfaceImpl extends CsMoneroInterface { + final Map _wallets = {}; + + @override + void setUseCsMoneroLoggerInternal(bool enable) => + lib_monero.Logging.useLogger = enable; + + @override + bool walletInstanceExists(String walletId) => _wallets[walletId] != null; + + @override + bool walletExists(String path, {required CsCoin csCoin}) => switch (csCoin) { + CsCoin.monero => lib_monero.MoneroWallet.isWalletExist(path), + CsCoin.wownero => lib_monero.WowneroWallet.isWalletExist(path), + }; + + @override + Future estimateFee(int rate, BigInt amount, {required String walletId}) { + lib_monero.TransactionPriority priority; + switch (rate) { + case 1: + priority = lib_monero.TransactionPriority.low; + break; + case 2: + priority = lib_monero.TransactionPriority.medium; + break; + case 3: + priority = lib_monero.TransactionPriority.high; + break; + case 4: + priority = lib_monero.TransactionPriority.last; + break; + case 0: + default: + priority = lib_monero.TransactionPriority.normal; + break; + } + + return _wallets[walletId]!.estimateFee(priority, amount.toInt()); + } + + @override + Future loadWallet( + String walletId, { + required CsCoin csCoin, + required String path, + required String password, + }) async { + switch (csCoin) { + case CsCoin.monero: + _wallets[walletId] = await lib_monero.MoneroWallet.loadWallet( + path: path, + password: password, + ); + break; + + case CsCoin.wownero: + _wallets[walletId] = await lib_monero.WowneroWallet.loadWallet( + path: path, + password: password, + ); + break; + } + } + + @override + int getTxPriorityHigh() => lib_monero.TransactionPriority.high.value; + + @override + int getTxPriorityMedium() => lib_monero.TransactionPriority.medium.value; + + @override + int getTxPriorityNormal() => lib_monero.TransactionPriority.normal.value; + + @override + String getAddress( + String walletId, { + int accountIndex = 0, + int addressIndex = 0, + }) => _wallets[walletId]! + .getAddress(accountIndex: accountIndex, addressIndex: addressIndex) + .value; + + @override + Future getCreatedWallet({ + required CsCoin csCoin, + required String path, + required String password, + required int wordCount, + required String seedOffset, + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, + }) async { + final lib_monero.Wallet wallet; + + switch (csCoin) { + case CsCoin.monero: + final type = switch (wordCount) { + 16 => lib_monero.MoneroSeedType.sixteen, + 25 => lib_monero.MoneroSeedType.twentyFive, + _ => throw Exception("Invalid mnemonic word count: $wordCount"), + }; + + wallet = await lib_monero.MoneroWallet.create( + path: path, + password: password, + seedType: type, + seedOffset: seedOffset, + ); + break; + + case CsCoin.wownero: + final type = switch (wordCount) { + 16 => lib_monero.WowneroSeedType.sixteen, + 25 => lib_monero.WowneroSeedType.twentyFive, + _ => throw Exception("Invalid mnemonic word count: $wordCount"), + }; + + wallet = await lib_monero.WowneroWallet.create( + path: path, + password: password, + seedType: type, + seedOffset: seedOffset, + ); + break; + } + + onCreated( + wallet.getRefreshFromBlockHeight(), + wallet.getSeed(seedOffset: seedOffset).trim(), + ); + } + + @override + Future getRestoredWallet({ + required String walletId, + required CsCoin csCoin, + required String path, + required String password, + required String mnemonic, + required String seedOffset, + int height = 0, + }) async { + _wallets[walletId] = switch (csCoin) { + CsCoin.monero => + _wallets[walletId] = + await lib_monero.MoneroWallet.restoreWalletFromSeed( + path: path, + password: password, + seed: mnemonic, + restoreHeight: height, + seedOffset: seedOffset, + ), + + CsCoin.wownero => + _wallets[walletId] = + await lib_monero.WowneroWallet.restoreWalletFromSeed( + path: path, + password: password, + seed: mnemonic, + restoreHeight: height, + seedOffset: seedOffset, + ), + }; + } + + @override + Future getRestoredFromViewKeyWallet({ + required String walletId, + required CsCoin csCoin, + required String path, + required String password, + required String address, + required String privateViewKey, + int height = 0, + }) async { + _wallets[walletId] = switch (csCoin) { + CsCoin.monero => await lib_monero.MoneroWallet.createViewOnlyWallet( + path: path, + password: password, + address: address, + viewKey: privateViewKey, + restoreHeight: height, + ), + + CsCoin.wownero => await lib_monero.WowneroWallet.createViewOnlyWallet( + path: path, + password: password, + address: address, + viewKey: privateViewKey, + restoreHeight: height, + ), + }; + } + + @override + String getTxKey(String walletId, String txid) => + _wallets[walletId]!.getTxKey(txid); + + @override + Future save(String walletId) => _wallets[walletId]!.save(); + + @override + String getPublicViewKey(String walletId) => + _wallets[walletId]!.getPublicViewKey(); + + @override + String getPrivateViewKey(String walletId) => + _wallets[walletId]!.getPrivateViewKey(); + + @override + String getPublicSpendKey(String walletId) => + _wallets[walletId]!.getPublicSpendKey(); + + @override + String getPrivateSpendKey(String walletId) => + _wallets[walletId]!.getPrivateSpendKey(); + + @override + Future isSynced(String walletId) => + _wallets[walletId]?.isSynced() ?? Future.value(false); + + @override + void startSyncing(String walletId) => _wallets[walletId]?.startSyncing(); + + @override + void stopSyncing(String walletId) => _wallets[walletId]?.stopSyncing(); + + @override + void startAutoSaving(String walletId) => + _wallets[walletId]?.startAutoSaving(); + + @override + void stopAutoSaving(String walletId) => _wallets[walletId]?.stopAutoSaving(); + + @override + bool hasListeners(String walletId) => + _wallets[walletId]!.getListeners().isNotEmpty; + + @override + void addListener(String walletId, CsMoneroWalletListener listener) => + _wallets[walletId]?.addListener( + lib_monero.WalletListener( + onSyncingUpdate: listener.onSyncingUpdate, + onNewBlock: listener.onNewBlock, + onBalancesChanged: listener.onBalancesChanged, + onError: listener.onError, + ), + ); + + @override + void startListeners(String walletId) => _wallets[walletId]?.startListeners(); + + @override + void stopListeners(String walletId) => _wallets[walletId]?.stopListeners(); + + @override + int getRefreshFromBlockHeight(String walletId) => + _wallets[walletId]!.getRefreshFromBlockHeight(); + + @override + void setRefreshFromBlockHeight(String walletId, int height) => + _wallets[walletId]!.setRefreshFromBlockHeight(height); + + @override + Future rescanBlockchain(String walletId) => + _wallets[walletId]?.rescanBlockchain() ?? Future.value(false); + + @override + Future isConnectedToDaemon(String walletId) => + _wallets[walletId]?.isConnectedToDaemon() ?? Future.value(false); + + @override + Future connect( + String walletId, { + required String daemonAddress, + required bool trusted, + String? daemonUsername, + String? daemonPassword, + bool useSSL = false, + bool isLightWallet = false, + String? socksProxyAddress, + }) async { + await _wallets[walletId]?.connect( + daemonAddress: daemonAddress, + trusted: trusted, + daemonUsername: daemonUsername, + daemonPassword: daemonPassword, + useSSL: useSSL, + socksProxyAddress: socksProxyAddress, + isLightWallet: isLightWallet, + ); + } + + @override + Future> getAllTxids(String walletId, {bool refresh = false}) => + _wallets[walletId]!.getAllTxids(refresh: refresh); + + @override + BigInt? getBalance(String walletId, {int accountIndex = 0}) => + _wallets[walletId]?.getBalance(accountIndex: accountIndex); + + @override + BigInt? getUnlockedBalance(String walletId, {int accountIndex = 0}) => + _wallets[walletId]?.getUnlockedBalance(accountIndex: accountIndex); + + @override + Future> getAllTxs( + String walletId, { + bool refresh = false, + }) async { + final transactions = await _wallets[walletId]?.getAllTxs(refresh: refresh); + if (transactions == null) return []; + return transactions + .map( + (e) => CsTransaction( + displayLabel: e.displayLabel, + description: e.description, + fee: e.fee, + confirmations: e.confirmations, + blockHeight: e.blockHeight, + accountIndex: e.accountIndex, + addressIndexes: e.addressIndexes, + paymentId: e.paymentId, + amount: e.amount, + isSpend: e.isSpend, + hash: e.hash, + key: e.key, + timeStamp: e.timeStamp, + minConfirms: e.minConfirms.value, + ), + ) + .toList(); + } + + @override + Future> getTxs( + String walletId, { + required Set txids, + bool refresh = false, + }) async { + final transactions = await _wallets[walletId]?.getTxs( + txids: txids, + refresh: refresh, + ); + if (transactions == null) return []; + return transactions + .map( + (e) => CsTransaction( + displayLabel: e.displayLabel, + description: e.description, + fee: e.fee, + confirmations: e.confirmations, + blockHeight: e.blockHeight, + accountIndex: e.accountIndex, + addressIndexes: e.addressIndexes, + paymentId: e.paymentId, + amount: e.amount, + isSpend: e.isSpend, + hash: e.hash, + key: e.key, + timeStamp: e.timeStamp, + minConfirms: e.minConfirms.value, + ), + ) + .toList(); + } + + @override + Future createTx( + String walletId, { + required CsRecipient output, + required int priority, + required bool sweep, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }) async { + final pending = await _wallets[walletId]!.createTx( + output: lib_monero.Recipient( + address: output.address, + amount: output.amount, + ), + paymentId: "", + sweep: sweep, + priority: lib_monero.TransactionPriority.values.firstWhere( + (e) => e.value == priority, + ), + preferredInputs: preferredInputs + ?.map( + (e) => lib_monero.Output( + address: e.address!, + hash: e.utxo.txid, + keyImage: e.utxo.keyImage!, + value: e.value, + isFrozen: e.utxo.isBlocked, + isUnlocked: + e.utxo.blockHeight != null && + (currentHeight - (e.utxo.blockHeight ?? 0)) >= minConfirms, + height: e.utxo.blockHeight ?? 0, + vout: e.utxo.vout, + spent: e.utxo.used ?? false, + spentHeight: null, // doesn't matter here + coinbase: e.utxo.isCoinbase, + ), + ) + .toList(), + accountIndex: accountIndex, + ); + + return CsPendingTransaction( + pending, + pending.amount, + pending.fee, + pending.txid, + ); + } + + @override + Future createTxMultiDest( + String walletId, { + required List outputs, + required int priority, + required bool sweep, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }) async { + final pending = await _wallets[walletId]!.createTxMultiDest( + outputs: outputs + .map( + (e) => lib_monero.Recipient(address: e.address, amount: e.amount), + ) + .toList(), + paymentId: "", + sweep: sweep, + priority: lib_monero.TransactionPriority.values.firstWhere( + (e) => e.value == priority, + ), + preferredInputs: preferredInputs + ?.map( + (e) => lib_monero.Output( + address: e.address!, + hash: e.utxo.txid, + keyImage: e.utxo.keyImage!, + value: e.value, + isFrozen: e.utxo.isBlocked, + isUnlocked: + e.utxo.blockHeight != null && + (currentHeight - (e.utxo.blockHeight ?? 0)) >= minConfirms, + height: e.utxo.blockHeight ?? 0, + vout: e.utxo.vout, + spent: e.utxo.used ?? false, + spentHeight: null, // doesn't matter here + coinbase: e.utxo.isCoinbase, + ), + ) + .toList(), + accountIndex: accountIndex, + ); + + return CsPendingTransaction( + pending, + pending.amount, + pending.fee, + pending.txid, + ); + } + + @override + Future commitTx(String walletId, CsPendingTransaction tx) => + _wallets[walletId]!.commitTx(tx.value as lib_monero.PendingTransaction); + + @override + Future> getOutputs( + String walletId, { + bool refresh = false, + bool includeSpent = false, + }) async { + final outputs = await _wallets[walletId]?.getOutputs( + includeSpent: includeSpent, + refresh: refresh, + ); + + if (outputs == null) return []; + + return outputs + .map( + (e) => CsOutput( + address: e.address, + hash: e.hash, + keyImage: e.keyImage, + value: e.value, + isFrozen: e.isFrozen, + isUnlocked: e.isUnlocked, + height: e.height, + spentHeight: e.spentHeight, + vout: e.vout, + spent: e.spent, + coinbase: e.coinbase, + ), + ) + .toList(); + } + + @override + Future freezeOutput(String walletId, String keyImage) => + _wallets[walletId]!.freezeOutput(keyImage); + + @override + Future thawOutput(String walletId, String keyImage) => + _wallets[walletId]!.thawOutput(keyImage); + + @override + List getMoneroWordList(String language) => + lib_monero.getMoneroWordList(language); + + @override + List getWowneroWordList(String language, int seedLength) => + lib_monero.getWowneroWordList(language, seedWordsLength: seedLength); +} + +//END_ON From 8aa84f96df00401d9bc63c9e18f0cda433f68cf9 Mon Sep 17 00:00:00 2001 From: Hector Chu Date: Sat, 4 Oct 2025 14:41:42 +0000 Subject: [PATCH 125/178] Fix mweb fee override propagation --- .../wallet/wallet_mixin_interfaces/electrumx_interface.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart index 17120df8de..26106e6778 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart @@ -405,6 +405,7 @@ mixin ElectrumXInterface utxos: utxos, coinControl: coinControl, isSendAllCoinControlUtxos: isSendAllCoinControlUtxos, + overrideFeeAmount: overrideFeeAmount, ); } throw Exception("Insufficient balance to pay transaction fee"); From 6b5966c58cfc1991c94248196b2203ca7b0965fa Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Oct 2025 08:31:40 -0600 Subject: [PATCH 126/178] clean switch --- ...XMR_cs_monero_interface_impl.template.dart | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart index a90a4dbb17..5d6fbfc35c 100644 --- a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart +++ b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart @@ -158,25 +158,21 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { int height = 0, }) async { _wallets[walletId] = switch (csCoin) { - CsCoin.monero => - _wallets[walletId] = - await lib_monero.MoneroWallet.restoreWalletFromSeed( - path: path, - password: password, - seed: mnemonic, - restoreHeight: height, - seedOffset: seedOffset, - ), + CsCoin.monero => await lib_monero.MoneroWallet.restoreWalletFromSeed( + path: path, + password: password, + seed: mnemonic, + restoreHeight: height, + seedOffset: seedOffset, + ), - CsCoin.wownero => - _wallets[walletId] = - await lib_monero.WowneroWallet.restoreWalletFromSeed( - path: path, - password: password, - seed: mnemonic, - restoreHeight: height, - seedOffset: seedOffset, - ), + CsCoin.wownero => await lib_monero.WowneroWallet.restoreWalletFromSeed( + path: path, + password: password, + seed: mnemonic, + restoreHeight: height, + seedOffset: seedOffset, + ), }; } From be92e869e7f7cbb46234fe567213913a87e81e50 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Oct 2025 09:31:19 -0600 Subject: [PATCH 127/178] implement sal ffi package optional import and some xmr/wow fixes --- .../restore_options_view.dart | 563 +++++++++--------- .../verify_recovery_phrase_view.dart | 229 ++++--- lib/wallets/crypto_currency/coins/monero.dart | 13 +- .../crypto_currency/coins/salvium.dart | 13 +- .../crypto_currency/coins/wownero.dart | 13 +- lib/wallets/models/tx_data.dart | 5 +- lib/wallets/wallet/impl/salvium_wallet.dart | 98 +-- .../intermediate/lib_monero_wallet.dart | 2 +- .../intermediate/lib_salvium_wallet.dart | 401 ++++++------- .../interfaces/cs_monero_interface.dart | 10 +- .../interfaces/cs_salvium_interface.dart | 154 +++++ ...AL_cs_salvium_interface_impl.template.dart | 488 +++++++++++++++ ...XMR_cs_monero_interface_impl.template.dart | 24 +- 13 files changed, 1292 insertions(+), 721 deletions(-) create mode 100644 lib/wl_gen/interfaces/cs_salvium_interface.dart create mode 100644 tool/wl_templates/SAL_cs_salvium_interface_impl.template.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 c230578940..1972ae5d3a 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 @@ -8,8 +8,6 @@ * */ -import 'package:cs_monero/src/deprecated/get_height_by_date.dart' - as cs_monero_deprecated; import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -42,6 +40,8 @@ import '../../../../widgets/rounded_white_container.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; import '../../../../widgets/toggle.dart'; +import '../../../../wl_gen/interfaces/cs_monero_interface.dart'; +import '../../../../wl_gen/interfaces/cs_salvium_interface.dart'; import '../../create_or_restore_wallet_view/sub_widgets/coin_image.dart'; import '../restore_view_only_wallet_view.dart'; import '../restore_wallet_view.dart'; @@ -213,10 +213,15 @@ class _RestoreOptionsViewState extends ConsumerState { int height = 0; if (date != null) { if (widget.coin is Monero) { - height = cs_monero_deprecated.getMoneroHeightByDate(date: date); + height = csMonero.getHeightByDate(date, csCoin: CsCoin.monero); } if (widget.coin is Wownero) { - height = cs_monero_deprecated.getWowneroHeightByDate(date: date); + height = csMonero.getHeightByDate(date, csCoin: CsCoin.wownero); + } + if (widget.coin is Salvium) { + height = csSalvium.getHeightByDate( + DateTime.now().subtract(const Duration(days: 7)), + ); } if (height < 0) { height = 0; @@ -256,27 +261,26 @@ class _RestoreOptionsViewState extends ConsumerState { return MasterScaffold( isDesktop: isDesktop, - appBar: - isDesktop - ? const DesktopAppBar( - isCompactHeight: false, - leading: AppBarBackButton(), - trailing: ExitToMyStackButton(), - ) - : AppBar( - leading: AppBarBackButton( - onPressed: () { - if (textFieldFocusNode.hasFocus) { - textFieldFocusNode.unfocus(); - Future.delayed( - const Duration(milliseconds: 100), - ).then((value) => Navigator.of(context).pop()); - } else { - Navigator.of(context).pop(); - } - }, - ), + appBar: isDesktop + ? const DesktopAppBar( + isCompactHeight: false, + leading: AppBarBackButton(), + trailing: ExitToMyStackButton(), + ) + : AppBar( + leading: AppBarBackButton( + onPressed: () { + if (textFieldFocusNode.hasFocus) { + textFieldFocusNode.unfocus(); + Future.delayed( + const Duration(milliseconds: 100), + ).then((value) => Navigator.of(context).pop()); + } else { + Navigator.of(context).pop(); + } + }, ), + ), body: RestoreOptionsPlatformLayout( isDesktop: isDesktop, child: ConstrainedBox( @@ -292,10 +296,9 @@ class _RestoreOptionsViewState extends ConsumerState { Text( "Restore options", textAlign: TextAlign.center, - style: - isDesktop - ? STextStyles.desktopH2(context) - : STextStyles.pageTitleH1(context), + style: isDesktop + ? STextStyles.desktopH2(context) + : STextStyles.pageTitleH1(context), ), SizedBox(height: isDesktop ? 40 : 24), if (coin is ViewOnlyOptionCurrencyInterface) @@ -306,12 +309,12 @@ class _RestoreOptionsViewState extends ConsumerState { key: UniqueKey(), onText: "Seed", offText: "View Only", - onColor: - Theme.of(context).extension()!.popupBG, - offColor: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + onColor: Theme.of( + context, + ).extension()!.popupBG, + offColor: Theme.of( + context, + ).extension()!.textFieldDefaultBG, isOn: _showViewOnlyOption, onValueChanged: (value) { setState(() { @@ -330,32 +333,33 @@ class _RestoreOptionsViewState extends ConsumerState { SizedBox(height: isDesktop ? 40 : 24), _showViewOnlyOption ? ViewOnlyRestoreOption( - coin: coin, - dateController: _dateController, - dateChooserFunction: - isDesktop ? chooseDesktopDate : chooseDate, - blockHeightController: _blockHeightController, - blockHeightFocusNode: _blockHeightFocusNode, - ) + coin: coin, + dateController: _dateController, + dateChooserFunction: isDesktop + ? chooseDesktopDate + : chooseDate, + blockHeightController: _blockHeightController, + blockHeightFocusNode: _blockHeightFocusNode, + ) : SeedRestoreOption( - coin: coin, - dateController: _dateController, - blockHeightController: _blockHeightController, - blockHeightFocusNode: _blockHeightFocusNode, - pwController: passwordController, - pwFocusNode: passwordFocusNode, - dateChooserFunction: - isDesktop ? chooseDesktopDate : chooseDate, - chooseMnemonicLength: chooseMnemonicLength, - ), + coin: coin, + dateController: _dateController, + blockHeightController: _blockHeightController, + blockHeightFocusNode: _blockHeightFocusNode, + pwController: passwordController, + pwFocusNode: passwordFocusNode, + dateChooserFunction: isDesktop + ? chooseDesktopDate + : chooseDate, + chooseMnemonicLength: chooseMnemonicLength, + ), if (!isDesktop) const Spacer(flex: 3), SizedBox(height: isDesktop ? 32 : 12), RestoreOptionsNextButton( isDesktop: isDesktop, - onPressed: - ref.watch(_pIsUsingDate) || _hasBlockHeight - ? nextPressed - : null, + onPressed: ref.watch(_pIsUsingDate) || _hasBlockHeight + ? nextPressed + : null, ), if (isDesktop) const Spacer(flex: 15), ], @@ -427,24 +431,22 @@ class _SeedRestoreOptionState extends ConsumerState { children: [ Text( ref.watch(_pIsUsingDate) ? "Choose start date" : "Block height", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark3, - ) - : STextStyles.smallMed12(context), + style: Util.isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of( + context, + ).extension()!.textDark3, + ) + : STextStyles.smallMed12(context), textAlign: TextAlign.left, ), CustomTextButton( - text: - ref.watch(_pIsUsingDate) ? "Use block height" : "Use date", - onTap: - () => - ref.read(_pIsUsingDate.notifier).state = - !ref.read(_pIsUsingDate), + text: ref.watch(_pIsUsingDate) + ? "Use block height" + : "Use date", + onTap: () => ref.read(_pIsUsingDate.notifier).state = !ref.read( + _pIsUsingDate, + ), ), ], ), @@ -457,60 +459,59 @@ class _SeedRestoreOptionState extends ConsumerState { widget.coin is Mimblewimblecoin) ref.watch(_pIsUsingDate) ? RestoreFromDatePicker( - onTap: widget.dateChooserFunction, - controller: widget.dateController, - ) + onTap: widget.dateChooserFunction, + controller: widget.dateController, + ) : ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - child: TextField( - focusNode: widget.blockHeightFocusNode, - controller: widget.blockHeightController, - keyboardType: TextInputType.number, - inputFormatters: [FilteringTextInputFormatter.digitsOnly], - textInputAction: TextInputAction.done, - style: - Util.isDesktop - ? STextStyles.desktopTextMedium( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + focusNode: widget.blockHeightFocusNode, + controller: widget.blockHeightController, + keyboardType: TextInputType.number, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + textInputAction: TextInputAction.done, + style: Util.isDesktop + ? STextStyles.desktopTextMedium( context, ).copyWith(height: 2) - : STextStyles.field(context), - onChanged: (value) { - setState(() { - _blockFieldEmpty = value.isEmpty; - }); - }, - decoration: standardInputDecoration( - "Start scanning from...", - widget.blockHeightFocusNode, - context, - ).copyWith( - suffixIcon: UnconstrainedBox( - child: TextFieldIconButton( - child: Semantics( - label: - "Clear Block Height Field Button. Clears the block height field", - excludeSemantics: true, - child: - !_blockFieldEmpty - ? XIcon( - width: Util.isDesktop ? 24 : 16, - height: Util.isDesktop ? 24 : 16, - ) - : const SizedBox.shrink(), + : STextStyles.field(context), + onChanged: (value) { + setState(() { + _blockFieldEmpty = value.isEmpty; + }); + }, + decoration: + standardInputDecoration( + "Start scanning from...", + widget.blockHeightFocusNode, + context, + ).copyWith( + suffixIcon: UnconstrainedBox( + child: TextFieldIconButton( + child: Semantics( + label: + "Clear Block Height Field Button. Clears the block height field", + excludeSemantics: true, + child: !_blockFieldEmpty + ? XIcon( + width: Util.isDesktop ? 24 : 16, + height: Util.isDesktop ? 24 : 16, + ) + : const SizedBox.shrink(), + ), + onTap: () { + widget.blockHeightController.text = ""; + setState(() { + _blockFieldEmpty = true; + }); + }, + ), + ), ), - onTap: () { - widget.blockHeightController.text = ""; - setState(() { - _blockFieldEmpty = true; - }); - }, - ), - ), ), ), - ), if (isCnAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin) @@ -525,15 +526,13 @@ class _SeedRestoreOptionState extends ConsumerState { ref.watch(_pIsUsingDate) ? "Choose the date you made the wallet (approximate is fine)" : "Enter the initial block height of the wallet", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textSubtitle1, - ) - : STextStyles.smallMed12(context).copyWith(fontSize: 10), + style: Util.isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of( + context, + ).extension()!.textSubtitle1, + ) + : STextStyles.smallMed12(context).copyWith(fontSize: 10), ), ), ), @@ -543,13 +542,11 @@ class _SeedRestoreOptionState extends ConsumerState { SizedBox(height: Util.isDesktop ? 24 : 16), Text( "Choose recovery phrase length", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of(context).extension()!.textDark3, - ) - : STextStyles.smallMed12(context), + style: Util.isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of(context).extension()!.textDark3, + ) + : STextStyles.smallMed12(context), textAlign: TextAlign.left, ), SizedBox(height: Util.isDesktop ? 16 : 8), @@ -577,19 +574,17 @@ class _SeedRestoreOptionState extends ConsumerState { iconStyleData: IconStyleData( icon: ConditionalParent( condition: Util.isDesktop, - builder: - (child) => Padding( - padding: const EdgeInsets.only(right: 10), - child: child, - ), + builder: (child) => Padding( + padding: const EdgeInsets.only(right: 10), + child: child, + ), child: SvgPicture.asset( Assets.svg.chevronDown, width: 12, height: 6, - color: - Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, ), ), ), @@ -597,10 +592,9 @@ class _SeedRestoreOptionState extends ConsumerState { offset: const Offset(0, -10), elevation: 0, decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -637,17 +631,15 @@ class _SeedRestoreOptionState extends ConsumerState { children: [ Text( "Advanced", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall( + style: Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of( context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark3, - ) - : STextStyles.smallMed12(context), + ).extension()!.textDark3, + ) + : STextStyles.smallMed12(context), textAlign: TextAlign.left, ), SvgPicture.asset( @@ -656,10 +648,9 @@ class _SeedRestoreOptionState extends ConsumerState { : Assets.svg.chevronDown, width: 12, height: 6, - color: - Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, ), ], ), @@ -678,57 +669,56 @@ class _SeedRestoreOptionState extends ConsumerState { key: const Key("mnemonicPassphraseFieldKey1"), focusNode: widget.pwFocusNode, controller: widget.pwController, - style: - Util.isDesktop - ? STextStyles.desktopTextMedium( - context, - ).copyWith(height: 2) - : STextStyles.field(context), + style: Util.isDesktop + ? STextStyles.desktopTextMedium( + context, + ).copyWith(height: 2) + : STextStyles.field(context), obscureText: _hidePassword, enableSuggestions: false, autocorrect: false, - decoration: standardInputDecoration( - widget.coin is CryptonoteCurrency - ? "Seed Offset" - : "BIP39 passphrase", - widget.pwFocusNode, - context, - ).copyWith( - suffixIcon: UnconstrainedBox( - child: ConditionalParent( - condition: Util.isDesktop, - builder: - (child) => SizedBox(height: 70, child: child), - child: Row( - children: [ - SizedBox(width: Util.isDesktop ? 24 : 16), - GestureDetector( - key: const Key( - "mnemonicPassphraseFieldShowPasswordButtonKey", - ), - onTap: () async { - setState(() { - _hidePassword = !_hidePassword; - }); - }, - child: SvgPicture.asset( - _hidePassword - ? Assets.svg.eye - : Assets.svg.eyeSlash, - color: - Theme.of( + decoration: + standardInputDecoration( + widget.coin is CryptonoteCurrency + ? "Seed Offset" + : "BIP39 passphrase", + widget.pwFocusNode, + context, + ).copyWith( + suffixIcon: UnconstrainedBox( + child: ConditionalParent( + condition: Util.isDesktop, + builder: (child) => + SizedBox(height: 70, child: child), + child: Row( + children: [ + SizedBox(width: Util.isDesktop ? 24 : 16), + GestureDetector( + key: const Key( + "mnemonicPassphraseFieldShowPasswordButtonKey", + ), + onTap: () async { + setState(() { + _hidePassword = !_hidePassword; + }); + }, + child: SvgPicture.asset( + _hidePassword + ? Assets.svg.eye + : Assets.svg.eyeSlash, + color: Theme.of( context, ).extension()!.textDark3, - width: Util.isDesktop ? 24 : 16, - height: Util.isDesktop ? 24 : 16, - ), + width: Util.isDesktop ? 24 : 16, + height: Util.isDesktop ? 24 : 16, + ), + ), + const SizedBox(width: 12), + ], ), - const SizedBox(width: 12), - ], + ), ), ), - ), - ), ), ), const SizedBox(height: 8), @@ -737,23 +727,21 @@ class _SeedRestoreOptionState extends ConsumerState { child: Text( widget.coin is CryptonoteCurrency ? "(Optional) An offset used to derive a different " - "wallet from the given mnemonic, allowing recovery " - "of a hidden or alternate wallet based on the same " - "seed phrase." + "wallet from the given mnemonic, allowing recovery " + "of a hidden or alternate wallet based on the same " + "seed phrase." : "If the recovery phrase you are about to restore " - "was created with an optional BIP39 passphrase " - "you can enter it here.", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraSmall( + "was created with an optional BIP39 passphrase " + "you can enter it here.", + style: Util.isDesktop + ? STextStyles.desktopTextExtraSmall( + context, + ).copyWith( + color: Theme.of( context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textSubtitle1, - ) - : STextStyles.itemSubtitle(context), + ).extension()!.textSubtitle1, + ) + : STextStyles.itemSubtitle(context), ), ), ), @@ -810,25 +798,23 @@ class _ViewOnlyRestoreOptionState extends ConsumerState { children: [ Text( ref.watch(_pIsUsingDate) ? "Choose start date" : "Block height", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall( + style: Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context).copyWith( + color: Theme.of( context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark3, - ) - : STextStyles.smallMed12(context), + ).extension()!.textDark3, + ) + : STextStyles.smallMed12(context), textAlign: TextAlign.left, ), CustomTextButton( - text: - ref.watch(_pIsUsingDate) ? "Use block height" : "Use date", + text: ref.watch(_pIsUsingDate) + ? "Use block height" + : "Use date", onTap: () { - ref.read(_pIsUsingDate.notifier).state = - !ref.read(_pIsUsingDate); + ref.read(_pIsUsingDate.notifier).state = !ref.read( + _pIsUsingDate, + ); }, ), ], @@ -837,60 +823,59 @@ class _ViewOnlyRestoreOptionState extends ConsumerState { if (showDateOption) ref.watch(_pIsUsingDate) ? RestoreFromDatePicker( - onTap: widget.dateChooserFunction, - controller: widget.dateController, - ) + onTap: widget.dateChooserFunction, + controller: widget.dateController, + ) : ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - child: TextField( - focusNode: widget.blockHeightFocusNode, - controller: widget.blockHeightController, - keyboardType: TextInputType.number, - inputFormatters: [FilteringTextInputFormatter.digitsOnly], - textInputAction: TextInputAction.done, - style: - Util.isDesktop - ? STextStyles.desktopTextMedium( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + child: TextField( + focusNode: widget.blockHeightFocusNode, + controller: widget.blockHeightController, + keyboardType: TextInputType.number, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + textInputAction: TextInputAction.done, + style: Util.isDesktop + ? STextStyles.desktopTextMedium( context, ).copyWith(height: 2) - : STextStyles.field(context), - onChanged: (value) { - setState(() { - _blockFieldEmpty = value.isEmpty; - }); - }, - decoration: standardInputDecoration( - "Start scanning from...", - widget.blockHeightFocusNode, - context, - ).copyWith( - suffixIcon: UnconstrainedBox( - child: TextFieldIconButton( - child: Semantics( - label: - "Clear Block Height Field Button. Clears the block height field", - excludeSemantics: true, - child: - !_blockFieldEmpty - ? XIcon( - width: Util.isDesktop ? 24 : 16, - height: Util.isDesktop ? 24 : 16, - ) - : const SizedBox.shrink(), + : STextStyles.field(context), + onChanged: (value) { + setState(() { + _blockFieldEmpty = value.isEmpty; + }); + }, + decoration: + standardInputDecoration( + "Start scanning from...", + widget.blockHeightFocusNode, + context, + ).copyWith( + suffixIcon: UnconstrainedBox( + child: TextFieldIconButton( + child: Semantics( + label: + "Clear Block Height Field Button. Clears the block height field", + excludeSemantics: true, + child: !_blockFieldEmpty + ? XIcon( + width: Util.isDesktop ? 24 : 16, + height: Util.isDesktop ? 24 : 16, + ) + : const SizedBox.shrink(), + ), + onTap: () { + widget.blockHeightController.text = ""; + setState(() { + _blockFieldEmpty = true; + }); + }, + ), + ), ), - onTap: () { - widget.blockHeightController.text = ""; - setState(() { - _blockFieldEmpty = true; - }); - }, - ), - ), ), ), - ), if (showDateOption) const SizedBox(height: 8), if (showDateOption) RoundedWhiteContainer( @@ -899,17 +884,13 @@ class _ViewOnlyRestoreOptionState extends ConsumerState { ref.watch(_pIsUsingDate) ? "Choose the date you made the wallet (approximate is fine)" : "Enter the initial block height of the wallet", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textSubtitle1, - ) - : STextStyles.smallMed12( + style: Util.isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of( context, - ).copyWith(fontSize: 10), + ).extension()!.textSubtitle1, + ) + : STextStyles.smallMed12(context).copyWith(fontSize: 10), ), ), ), 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 9d79a315eb..9494b6630f 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 @@ -12,10 +12,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:math'; -import 'package:cs_monero/src/deprecated/get_height_by_date.dart' - as cs_monero_deprecated; -import 'package:cs_salvium/src/deprecated/get_height_by_date.dart' - as cs_salvium_deprecated; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -50,6 +46,8 @@ import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../../widgets/desktop/desktop_app_bar.dart'; import '../../../widgets/desktop/desktop_scaffold.dart'; import '../../../widgets/stack_dialog.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; +import '../../../wl_gen/interfaces/cs_salvium_interface.dart'; import '../../home_view/home_view.dart'; import '../add_token_view/edit_wallet_tokens_view.dart'; import '../new_wallet_options/new_wallet_options_view.dart'; @@ -116,18 +114,20 @@ class _VerifyRecoveryPhraseViewState } else if (widget.wallet is LibMoneroWallet || widget.wallet is LibSalviumWallet) { if (widget.wallet.cryptoCurrency is Monero) { - height = cs_monero_deprecated.getMoneroHeightByDate( - date: DateTime.now().subtract(const Duration(days: 7)), + height = csMonero.getHeightByDate( + DateTime.now().subtract(const Duration(days: 7)), + csCoin: CsCoin.monero, ); } if (widget.wallet.cryptoCurrency is Wownero) { - height = cs_monero_deprecated.getWowneroHeightByDate( - date: DateTime.now().subtract(const Duration(days: 7)), + height = csMonero.getHeightByDate( + DateTime.now().subtract(const Duration(days: 7)), + csCoin: CsCoin.wownero, ); } if (widget.wallet.cryptoCurrency is Salvium) { - height = cs_salvium_deprecated.getSalviumHeightByDate( - date: DateTime.now().subtract(const Duration(days: 7)), + height = csSalvium.getHeightByDate( + DateTime.now().subtract(const Duration(days: 7)), ); } if (height < 0) height = 0; @@ -151,8 +151,8 @@ class _VerifyRecoveryPhraseViewState final ViewOnlyWalletData viewOnlyData; if (widget.wallet is ExtendedKeysInterface) { - final extendedKeyInfo = - await (widget.wallet as ExtendedKeysInterface).getXPubs(); + final extendedKeyInfo = await (widget.wallet as ExtendedKeysInterface) + .getXPubs(); final testPath = (_coin as Bip39HDCurrency).constructDerivePath( derivePathType: (_coin as Bip39HDCurrency).defaultDerivePathType, chain: 0, @@ -178,9 +178,8 @@ class _VerifyRecoveryPhraseViewState } else if (widget.wallet is LibMoneroWallet) { final w = widget.wallet as LibMoneroWallet; - final info = - await w - .hackToCreateNewViewOnlyWalletDataFromNewlyCreatedWalletThisFunctionShouldNotBeCalledUnlessYouKnowWhatYouAreDoing(); + final info = await w + .hackToCreateNewViewOnlyWalletDataFromNewlyCreatedWalletThisFunctionShouldNotBeCalledUnlessYouKnowWhatYouAreDoing(); final address = info.$1; final privateViewKey = info.$2; @@ -194,9 +193,8 @@ class _VerifyRecoveryPhraseViewState } else if (widget.wallet is LibSalviumWallet) { final w = widget.wallet as LibSalviumWallet; - final info = - await w - .hackToCreateNewViewOnlyWalletDataFromNewlyCreatedWalletThisFunctionShouldNotBeCalledUnlessYouKnowWhatYouAreDoing(); + final info = await w + .hackToCreateNewViewOnlyWalletDataFromNewlyCreatedWalletThisFunctionShouldNotBeCalledUnlessYouKnowWhatYouAreDoing(); final address = info.$1; final privateViewKey = info.$2; @@ -310,8 +308,8 @@ class _VerifyRecoveryPhraseViewState ref .read(newEthWalletTriggerTempUntilHiveCompletelyDeleted.state) .state = !ref - .read(newEthWalletTriggerTempUntilHiveCompletelyDeleted.state) - .state; + .read(newEthWalletTriggerTempUntilHiveCompletelyDeleted.state) + .state; } if (mounted && @@ -338,11 +336,10 @@ class _VerifyRecoveryPhraseViewState if (mounted) { await showDialog( context: context, - builder: - (_) => StackOkDialog( - title: e.toString(), - desktopPopRootNavigator: Util.isDesktop, - ), + builder: (_) => StackOkDialog( + title: e.toString(), + desktopPopRootNavigator: Util.isDesktop, + ), ); } @@ -485,53 +482,54 @@ class _VerifyRecoveryPhraseViewState @override Widget build(BuildContext context) { debugPrint("BUILD: $runtimeType"); - final correctIndex = - ref.watch(verifyMnemonicWordIndexStateProvider.state).state; + final correctIndex = ref + .watch(verifyMnemonicWordIndexStateProvider.state) + .state; return WillPopScope( onWillPop: onWillPop, child: MasterScaffold( isDesktop: isDesktop, - appBar: - isDesktop - ? DesktopAppBar( - isCompactHeight: false, - leading: AppBarBackButton( - onPressed: () async { - Navigator.of(context).popUntil( - ModalRoute.withName( - NewWalletRecoveryPhraseView.routeName, - ), - ); - }, - ), - trailing: ExitToMyStackButton( - onPressed: () async { - await delete(); - if (context.mounted) { - Navigator.of(context).popUntil( - ModalRoute.withName(DesktopHomeView.routeName), - ); - } - }, - ), - ) - : AppBar( - leading: AppBarBackButton( - onPressed: () async { + appBar: isDesktop + ? DesktopAppBar( + isCompactHeight: false, + leading: AppBarBackButton( + onPressed: () async { + Navigator.of(context).popUntil( + ModalRoute.withName( + NewWalletRecoveryPhraseView.routeName, + ), + ); + }, + ), + trailing: ExitToMyStackButton( + onPressed: () async { + await delete(); + if (context.mounted) { Navigator.of(context).popUntil( - ModalRoute.withName( - NewWalletRecoveryPhraseView.routeName, - ), + ModalRoute.withName(DesktopHomeView.routeName), ); - }, - ), + } + }, + ), + ) + : AppBar( + leading: AppBarBackButton( + onPressed: () async { + Navigator.of(context).popUntil( + ModalRoute.withName( + NewWalletRecoveryPhraseView.routeName, + ), + ); + }, ), + ), body: SizedBox( width: isDesktop ? 410 : null, child: Padding( - padding: - isDesktop ? const EdgeInsets.all(0) : const EdgeInsets.all(16), + padding: isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -540,27 +538,24 @@ class _VerifyRecoveryPhraseViewState Text( "Verify recovery phrase", textAlign: TextAlign.center, - style: - isDesktop - ? STextStyles.desktopH2(context) - : STextStyles.label(context).copyWith(fontSize: 12), + style: isDesktop + ? STextStyles.desktopH2(context) + : STextStyles.label(context).copyWith(fontSize: 12), ), SizedBox(height: isDesktop ? 16 : 4), Text( isDesktop ? "Select word number" : "Tap word number ", textAlign: TextAlign.center, - style: - isDesktop - ? STextStyles.desktopSubtitleH1(context) - : STextStyles.pageTitleH1(context), + style: isDesktop + ? STextStyles.desktopSubtitleH1(context) + : STextStyles.pageTitleH1(context), ), SizedBox(height: isDesktop ? 16 : 12), Container( decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -591,61 +586,51 @@ class _VerifyRecoveryPhraseViewState Expanded( child: Consumer( builder: (_, ref, __) { - final selectedWord = - ref - .watch( - verifyMnemonicSelectedWordStateProvider - .state, - ) - .state; - final correctWord = - ref - .watch( - verifyMnemonicCorrectWordStateProvider - .state, - ) - .state; + final selectedWord = ref + .watch( + verifyMnemonicSelectedWordStateProvider.state, + ) + .state; + final correctWord = ref + .watch( + verifyMnemonicCorrectWordStateProvider.state, + ) + .state; return ConstrainedBox( constraints: BoxConstraints( minHeight: isDesktop ? 70 : 0, ), child: TextButton( - onPressed: - selectedWord.isNotEmpty - ? () async { - await _continue( - correctWord == selectedWord, - ); - } - : null, - style: - selectedWord.isNotEmpty - ? Theme.of(context) - .extension()! - .getPrimaryEnabledButtonStyle(context) - : Theme.of(context) - .extension()! - .getPrimaryDisabledButtonStyle( - context, - ), - child: - isDesktop - ? Text( - "Verify", - style: - selectedWord.isNotEmpty - ? STextStyles.desktopButtonEnabled( - context, - ) - : STextStyles.desktopButtonDisabled( - context, - ), - ) - : Text( - "Continue", - style: STextStyles.button(context), - ), + onPressed: selectedWord.isNotEmpty + ? () async { + await _continue( + correctWord == selectedWord, + ); + } + : null, + style: selectedWord.isNotEmpty + ? Theme.of(context) + .extension()! + .getPrimaryEnabledButtonStyle(context) + : Theme.of(context) + .extension()! + .getPrimaryDisabledButtonStyle(context), + child: isDesktop + ? Text( + "Verify", + style: selectedWord.isNotEmpty + ? STextStyles.desktopButtonEnabled( + context, + ) + : STextStyles.desktopButtonDisabled( + context, + ), + ) + : Text( + "Continue", + style: STextStyles.button(context), + ), ), ); }, diff --git a/lib/wallets/crypto_currency/coins/monero.dart b/lib/wallets/crypto_currency/coins/monero.dart index 4d1535179d..3a983cf9fe 100644 --- a/lib/wallets/crypto_currency/coins/monero.dart +++ b/lib/wallets/crypto_currency/coins/monero.dart @@ -1,9 +1,7 @@ -import 'package:cs_monero/src/ffi_bindings/monero_wallet_bindings.dart' - as xmr_wallet_ffi; - import '../../../models/node_model.dart'; import '../../../utilities/default_nodes.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; import '../crypto_currency.dart'; import '../intermediate/cryptonote_currency.dart'; @@ -54,7 +52,7 @@ class Monero extends CryptonoteCurrency { } switch (network) { case CryptoCurrencyNetwork.main: - return xmr_wallet_ffi.validateAddress(address, 0); + return csMonero.validateAddress(address, 0, csCoin: CsCoin.monero); default: throw Exception("Unsupported network: $network"); } @@ -107,10 +105,9 @@ class Monero extends CryptonoteCurrency { int get targetBlockTimeSeconds => 120; @override - DerivePathType get defaultDerivePathType => - throw UnsupportedError( - "$runtimeType does not use bitcoin style derivation paths", - ); + DerivePathType get defaultDerivePathType => throw UnsupportedError( + "$runtimeType does not use bitcoin style derivation paths", + ); @override Uri defaultBlockExplorer(String txid) { diff --git a/lib/wallets/crypto_currency/coins/salvium.dart b/lib/wallets/crypto_currency/coins/salvium.dart index db794dc53a..931208c6ad 100644 --- a/lib/wallets/crypto_currency/coins/salvium.dart +++ b/lib/wallets/crypto_currency/coins/salvium.dart @@ -1,9 +1,7 @@ -import 'package:cs_salvium/src/ffi_bindings/salvium_wallet_bindings.dart' - as sal_wallet_ffi; - import '../../../models/node_model.dart'; import '../../../utilities/default_nodes.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; +import '../../../wl_gen/interfaces/cs_salvium_interface.dart'; import '../crypto_currency.dart'; import '../intermediate/cryptonote_currency.dart'; @@ -54,7 +52,7 @@ class Salvium extends CryptonoteCurrency { } switch (network) { case CryptoCurrencyNetwork.main: - return sal_wallet_ffi.validateAddress(address, 0); + return csSalvium.validateAddress(address, 0); default: throw Exception("Unsupported network: $network"); } @@ -107,10 +105,9 @@ class Salvium extends CryptonoteCurrency { int get targetBlockTimeSeconds => 120; @override - DerivePathType get defaultDerivePathType => - throw UnsupportedError( - "$runtimeType does not use bitcoin style derivation paths", - ); + DerivePathType get defaultDerivePathType => throw UnsupportedError( + "$runtimeType does not use bitcoin style derivation paths", + ); @override Uri defaultBlockExplorer(String txid) { diff --git a/lib/wallets/crypto_currency/coins/wownero.dart b/lib/wallets/crypto_currency/coins/wownero.dart index 0c702af40a..66d27c3e08 100644 --- a/lib/wallets/crypto_currency/coins/wownero.dart +++ b/lib/wallets/crypto_currency/coins/wownero.dart @@ -1,9 +1,7 @@ -import 'package:cs_monero/src/ffi_bindings/wownero_wallet_bindings.dart' - as wow_wallet_ffi; - import '../../../models/node_model.dart'; import '../../../utilities/default_nodes.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; import '../crypto_currency.dart'; import '../intermediate/cryptonote_currency.dart'; @@ -54,7 +52,7 @@ class Wownero extends CryptonoteCurrency { } switch (network) { case CryptoCurrencyNetwork.main: - return wow_wallet_ffi.validateAddress(address, 0); + return csMonero.validateAddress(address, 0, csCoin: CsCoin.wownero); default: throw Exception("Unsupported network: $network"); } @@ -107,10 +105,9 @@ class Wownero extends CryptonoteCurrency { int get targetBlockTimeSeconds => 120; @override - DerivePathType get defaultDerivePathType => - throw UnsupportedError( - "$runtimeType does not use bitcoin style derivation paths", - ); + DerivePathType get defaultDerivePathType => throw UnsupportedError( + "$runtimeType does not use bitcoin style derivation paths", + ); @override Uri defaultBlockExplorer(String txid) { diff --git a/lib/wallets/models/tx_data.dart b/lib/wallets/models/tx_data.dart index 8ebed1e5e5..68ba7b7223 100644 --- a/lib/wallets/models/tx_data.dart +++ b/lib/wallets/models/tx_data.dart @@ -1,4 +1,3 @@ -import 'package:cs_salvium/cs_salvium.dart' as lib_salvium; import 'package:tezart/tezart.dart' as tezart; import 'package:web3dart/web3dart.dart' as web3dart; @@ -71,7 +70,7 @@ class TxData { final CsPendingTransaction? pendingTransaction; // salvium - final lib_salvium.PendingTransaction? pendingSalviumTransaction; + final CsPendingTransaction? pendingSalviumTransaction; // tezos specific final tezart.OperationsList? tezosOperationsList; @@ -260,7 +259,7 @@ class TxData { int? nonce, BigInt? chainId, CsPendingTransaction? pendingTransaction, - lib_salvium.PendingTransaction? pendingSalviumTransaction, + CsPendingTransaction? pendingSalviumTransaction, int? jMintValue, List? spendCoinIndexes, int? height, diff --git a/lib/wallets/wallet/impl/salvium_wallet.dart b/lib/wallets/wallet/impl/salvium_wallet.dart index f340776bea..94aef46f86 100644 --- a/lib/wallets/wallet/impl/salvium_wallet.dart +++ b/lib/wallets/wallet/impl/salvium_wallet.dart @@ -1,48 +1,26 @@ import 'dart:async'; -import 'package:compat/compat.dart' as lib_monero_compat; -import 'package:cs_salvium/cs_salvium.dart' as lib_salvium; - import '../../../utilities/amount/amount.dart'; +import '../../../wl_gen/generated/cs_salvium_interface_impl.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../intermediate/lib_salvium_wallet.dart'; class SalviumWallet extends LibSalviumWallet { - SalviumWallet(CryptoCurrencyNetwork network) - : super(Salvium(network)); + SalviumWallet(CryptoCurrencyNetwork network) : super(Salvium(network)); @override Future estimateFeeFor(Amount amount, BigInt feeRate) async { - if (libSalviumWallet == null /*|| - syncStatus is! lib_monero_compat.SyncedSyncStatus*/) { + if (!csSalvium.walletInstanceExists(walletId) /*|| + syncStatus is! lib_monero_compat.SyncedSyncStatus*/ ) { return Amount.zeroWith(fractionDigits: cryptoCurrency.fractionDigits); } - lib_salvium.TransactionPriority priority; - switch (feeRate.toInt()) { - case 1: - priority = lib_salvium.TransactionPriority.low; - break; - case 2: - priority = lib_salvium.TransactionPriority.medium; - break; - case 3: - priority = lib_salvium.TransactionPriority.high; - break; - case 4: - priority = lib_salvium.TransactionPriority.last; - break; - case 0: - default: - priority = lib_salvium.TransactionPriority.normal; - break; - } - int approximateFee = 0; await estimateFeeMutex.protect(() async { - approximateFee = await libSalviumWallet!.estimateFee( - priority, - amount.raw.toInt(), + approximateFee = await csSalvium.estimateFee( + feeRate.toInt(), + amount.raw, + walletId: walletId, ); }); @@ -53,72 +31,58 @@ class SalviumWallet extends LibSalviumWallet { } @override - bool walletExists(String path) => lib_salvium.SalviumWallet.isWalletExist(path); + bool walletExists(String path) => csSalvium.walletExists(path); @override - Future loadWallet({ - required String path, - required String password, - }) async { - libSalviumWallet = await lib_salvium.SalviumWallet.loadWallet( - path: path, - password: password, - ); - } + Future loadWallet({required String path, required String password}) => + csSalvium.loadWallet(walletId, path: path, password: password); @override - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - }) async { - final lib_salvium.SalviumSeedType type; - switch (wordCount) { - case 25: - type = lib_salvium.SalviumSeedType.twentyFive; - break; - - default: - throw Exception("Invalid mnemonic word count: $wordCount"); - } - - return await lib_salvium.SalviumWallet.create( - path: path, - password: password, - seedType: type, - seedOffset: seedOffset, - ); - } + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, + }) => csSalvium.getCreatedWallet( + path: path, + password: password, + wordCount: wordCount, + seedOffset: seedOffset, + onCreated: onCreated, + ); @override - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, required String seedOffset, int height = 0, - }) async => await lib_salvium.SalviumWallet.restoreWalletFromSeed( + }) async => await csSalvium.getRestoredWallet( path: path, password: password, - seed: mnemonic, - restoreHeight: height, + mnemonic: mnemonic, + height: height, seedOffset: seedOffset, + walletId: walletId, ); @override - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, required String privateViewKey, int height = 0, - }) async => lib_salvium.SalviumWallet.createViewOnlyWallet( + }) async => csSalvium.getRestoredFromViewKeyWallet( + walletId: walletId, path: path, password: password, address: address, - viewKey: privateViewKey, - restoreHeight: height, + privateViewKey: privateViewKey, + height: height, ); @override diff --git a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart index 943de13d23..1d8a5da7bd 100644 --- a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart @@ -177,7 +177,7 @@ abstract class LibMoneroWallet !csMonero.hasListeners(walletId)) { csMonero.addListener( walletId, - CsMoneroWalletListener( + CsWalletListener( onSyncingUpdate: onSyncingUpdate, onNewBlock: onNewBlock, onBalancesChanged: onBalancesChanged, diff --git a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart index afc15e547a..784e12c51d 100644 --- a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart @@ -3,7 +3,6 @@ import 'dart:convert'; import 'dart:io'; import 'dart:math'; -import 'package:cs_salvium/cs_salvium.dart' as lib_salvium; import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; @@ -32,6 +31,8 @@ import '../../../utilities/amount/amount.dart'; import '../../../utilities/enums/fee_rate_type_enum.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; +import '../../../wl_gen/interfaces/cs_monero_interface.dart'; +import '../../../wl_gen/interfaces/cs_salvium_interface.dart'; import '../../crypto_currency/intermediate/cryptonote_currency.dart'; import '../../isar/models/wallet_info.dart'; import '../../models/tx_data.dart'; @@ -97,14 +98,12 @@ abstract class LibSalviumWallet await onUTXOsChanged(utxos); await updateBalance(shouldUpdateUtxos: false); } catch (e, s) { - lib_salvium.Logging.log?.i("_startInit", error: e, stackTrace: s); + Logging.instance.e("_startInit", error: e, stackTrace: s); } }); }); } - lib_salvium.Wallet? libSalviumWallet; - SyncStatus? get syncStatus => _syncStatus; SyncStatus? _syncStatus; int _syncedCount = 0; @@ -134,14 +133,16 @@ abstract class LibSalviumWallet Future loadWallet({required String path, required String password}); - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, }); - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, @@ -149,7 +150,7 @@ abstract class LibSalviumWallet int height = 0, }); - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, @@ -162,16 +163,18 @@ abstract class LibSalviumWallet bool walletExists(String path); String getTxKeyFor({required String txid}) { - if (libSalviumWallet == null) { + if (!csSalvium.walletInstanceExists(walletId)) { throw Exception("Cannot get tx key in uninitialized libSalviumWallet"); } - return libSalviumWallet!.getTxKey(txid); + return csSalvium.getTxKey(walletId, txid); } void _setListener() { - if (libSalviumWallet != null && libSalviumWallet!.getListeners().isEmpty) { - libSalviumWallet?.addListener( - lib_salvium.WalletListener( + if (csSalvium.walletInstanceExists(walletId) && + !csSalvium.hasListeners(walletId)) { + csSalvium.addListener( + walletId, + CsWalletListener( onSyncingUpdate: onSyncingUpdate, onNewBlock: onNewBlock, onBalancesChanged: onBalancesChanged, @@ -187,17 +190,16 @@ abstract class LibSalviumWallet Future open() async { bool wasNull = false; - if (libSalviumWallet == null) { + if (!csSalvium.walletInstanceExists(walletId)) { wasNull = true; // await libSalviumWallet?.close(); final path = await pathForWallet(name: walletId); final String password; try { - password = - (await secureStorageInterface.read( - key: _libSalviumWalletPasswordKey(walletId.toUpperCase()), - ))!; + password = (await secureStorageInterface.read( + key: _libSalviumWalletPasswordKey(walletId.toUpperCase()), + ))!; } catch (e, s) { throw Exception("Password not found $e, $s"); } @@ -224,15 +226,15 @@ abstract class LibSalviumWallet if (wasNull) { try { _setSyncStatus(ConnectingSyncStatus()); - libSalviumWallet?.startSyncing(); + csSalvium.startSyncing(walletId); } catch (_) { _setSyncStatus(FailedSyncStatus()); // TODO log } } _setListener(); - libSalviumWallet?.startListeners(); - libSalviumWallet?.startAutoSaving(); + csSalvium.startListeners(walletId); + csSalvium.startAutoSaving(walletId); unawaited(refresh()); } @@ -242,16 +244,17 @@ abstract class LibSalviumWallet final appRoot = await StackFileSystem.applicationRootDirectory(); await _backupWalletFiles(name: walletId, appRoot: appRoot); } - await libSalviumWallet!.save(); + await csSalvium.save(walletId); } Address addressFor({required int index, int account = 0}) { - final address = libSalviumWallet!.getAddress( + final address = csSalvium.getAddress( + walletId, accountIndex: account, addressIndex: index, ); - if (address.value.contains("111")) { + if (address.contains("111")) { throw Exception("111 address found!"); } @@ -259,7 +262,7 @@ abstract class LibSalviumWallet walletId: walletId, derivationIndex: index, derivationPath: null, - value: address.value, + value: address, publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -269,18 +272,16 @@ abstract class LibSalviumWallet } Future getKeys() async { - final base = libSalviumWallet; - - if (base == null) { + if (!csSalvium.walletInstanceExists(walletId)) { return null; } try { return CWKeyData( walletId: walletId, - publicViewKey: base.getPublicViewKey(), - privateViewKey: base.getPrivateViewKey(), - publicSpendKey: base.getPublicSpendKey(), - privateSpendKey: base.getPrivateSpendKey(), + publicViewKey: csSalvium.getPublicViewKey(walletId), + privateViewKey: csSalvium.getPrivateViewKey(walletId), + publicSpendKey: csSalvium.getPublicSpendKey(walletId), + privateSpendKey: csSalvium.getPrivateSpendKey(walletId), ); } catch (e, s) { Logging.instance.f("getKeys failed: ", error: e, stackTrace: s); @@ -299,16 +300,17 @@ abstract class LibSalviumWallet final path = await pathForWallet(name: walletId); final String password; try { - password = - (await secureStorageInterface.read( - key: _libSalviumWalletPasswordKey(walletId), - ))!; + password = (await secureStorageInterface.read( + key: _libSalviumWalletPasswordKey(walletId), + ))!; } catch (e, s) { throw Exception("Password not found $e, $s"); } await loadWallet(path: path, password: password); - final wallet = libSalviumWallet!; - return (wallet.getAddress().value, wallet.getPrivateViewKey()); + return ( + csSalvium.getAddress(walletId), + csSalvium.getPrivateViewKey(walletId), + ); } @override @@ -322,17 +324,23 @@ abstract class LibSalviumWallet key: _libSalviumWalletPasswordKey(walletId), value: password, ); - final wallet = await getCreatedWallet( + + late final int refreshFromBlockHeight; + late final String seedPhrase; + + await getCreatedWallet( path: path, password: password, wordCount: wordCount, seedOffset: "", // default for non restored wallets for now + onCreated: (height, seed) { + refreshFromBlockHeight = height; + seedPhrase = seed; + }, ); - final height = wallet.getRefreshFromBlockHeight(); - await info.updateRestoreHeight( - newRestoreHeight: height, + newRestoreHeight: refreshFromBlockHeight, isar: mainDB.isar, ); @@ -340,7 +348,7 @@ abstract class LibSalviumWallet // before wallet.init() is called await secureStorageInterface.write( key: Wallet.mnemonicKey(walletId: walletId), - value: wallet.getSeed().trim(), + value: seedPhrase, ); await secureStorageInterface.write( key: Wallet.mnemonicPassphraseKey(walletId: walletId), @@ -363,8 +371,8 @@ abstract class LibSalviumWallet await mainDB.deleteWalletBlockchainData(walletId); highestPercentCached = 0; - unawaited(libSalviumWallet?.rescanBlockchain()); - libSalviumWallet?.startSyncing(); + unawaited(csSalvium.rescanBlockchain(walletId)); + csSalvium.startSyncing(walletId); // unawaited(save()); }); unawaited(refresh()); @@ -401,7 +409,12 @@ abstract class LibSalviumWallet key: _libSalviumWalletPasswordKey(walletId), value: password, ); - final wallet = await getRestoredWallet( + + if (!csSalvium.walletInstanceExists(walletId)) { + await exit(); + } + + await getRestoredWallet( path: path, password: password, mnemonic: mnemonic, @@ -409,12 +422,6 @@ abstract class LibSalviumWallet seedOffset: seedOffset, ); - if (libSalviumWallet != null) { - await exit(); - } - - libSalviumWallet = wallet; - _setListener(); final newReceivingAddress = @@ -423,7 +430,7 @@ abstract class LibSalviumWallet walletId: walletId, derivationIndex: 0, derivationPath: null, - value: wallet.getAddress().value, + value: csSalvium.getAddress(walletId), publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -442,12 +449,12 @@ abstract class LibSalviumWallet _setListener(); // libSalviumWallet?.setRecoveringFromSeed(isRecovery: true); - unawaited(libSalviumWallet?.rescanBlockchain()); - libSalviumWallet?.startSyncing(); + unawaited(csSalvium.rescanBlockchain(walletId)); + csSalvium.startSyncing(walletId); // await save(); - libSalviumWallet?.startListeners(); - libSalviumWallet?.startAutoSaving(); + csSalvium.startListeners(walletId); + csSalvium.startAutoSaving(walletId); } catch (e, s) { Logging.instance.e( "Exception rethrown from recoverFromMnemonic(): ", @@ -464,7 +471,7 @@ abstract class LibSalviumWallet @override Future pingCheck() async { if (_canPing) { - return (await libSalviumWallet?.isConnectedToDaemon()) ?? false; + return csSalvium.isConnectedToDaemon(walletId); } else { return false; } @@ -478,50 +485,50 @@ abstract class LibSalviumWallet throw Exception("TOR – clearnet mismatch"); } - final host = - node.host.endsWith(".onion") ? node.host : Uri.parse(node.host).host; + final host = node.host.endsWith(".onion") + ? node.host + : Uri.parse(node.host).host; ({InternetAddress host, int port})? proxy; - proxy = - prefs.useTor && !node.forceNoTor - ? TorService.sharedInstance.getProxyInfo() - : null; + proxy = prefs.useTor && !node.forceNoTor + ? TorService.sharedInstance.getProxyInfo() + : null; _setSyncStatus(ConnectingSyncStatus()); try { if (_requireMutex) { await _torConnectingLock.protect(() async { - await libSalviumWallet?.connect( + await csSalvium.connect( + walletId, daemonAddress: "$host:${node.port}", daemonUsername: node.loginName, daemonPassword: await node.getPassword(secureStorageInterface), trusted: node.trusted ?? false, useSSL: node.useSSL, - socksProxyAddress: - node.forceNoTor - ? null - : proxy == null - ? null - : "${proxy.host.address}:${proxy.port}", + socksProxyAddress: node.forceNoTor + ? null + : proxy == null + ? null + : "${proxy.host.address}:${proxy.port}", ); }); } else { - await libSalviumWallet?.connect( + await csSalvium.connect( + walletId, daemonAddress: "$host:${node.port}", daemonUsername: node.loginName, daemonPassword: await node.getPassword(secureStorageInterface), trusted: node.trusted ?? false, useSSL: node.useSSL, - socksProxyAddress: - node.forceNoTor - ? null - : proxy == null - ? null - : "${proxy.host.address}:${proxy.port}", + socksProxyAddress: node.forceNoTor + ? null + : proxy == null + ? null + : "${proxy.host.address}:${proxy.port}", ); } - libSalviumWallet?.startSyncing(); - libSalviumWallet?.startListeners(); - libSalviumWallet?.startAutoSaving(); + csSalvium.startSyncing(walletId); + csSalvium.startListeners(walletId); + csSalvium.startAutoSaving(walletId); // _setSyncStatus(ConnectedSyncStatus()); } catch (e, s) { @@ -538,22 +545,19 @@ abstract class LibSalviumWallet @override Future updateTransactions() async { - final base = libSalviumWallet; - - if (base == null) { + if (!csSalvium.walletInstanceExists(walletId)) { return; } - final localTxids = - await mainDB.isar.transactionV2s - .where() - .walletIdEqualTo(walletId) - .filter() - .heightGreaterThan(0) - .txidProperty() - .findAll(); + final localTxids = await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .filter() + .heightGreaterThan(0) + .txidProperty() + .findAll(); - final allTxids = await base.getAllTxids(refresh: true); + final allTxids = await csSalvium.getAllTxids(walletId, refresh: true); final txidsToFetch = allTxids.toSet().difference(localTxids.toSet()); @@ -561,9 +565,17 @@ abstract class LibSalviumWallet return; } - final transactions = await base.getTxs(txids: txidsToFetch, refresh: false); + final transactions = await csSalvium.getTxs( + walletId, + txids: txidsToFetch, + refresh: false, + ); - final allOutputs = await base.getOutputs(includeSpent: true, refresh: true); + final allOutputs = await csSalvium.getOutputs( + walletId, + includeSpent: true, + refresh: true, + ); // final cachedTransactions = // DB.instance.get(boxName: walletId, key: 'latest_tx_model') @@ -649,16 +661,14 @@ abstract class LibSalviumWallet type: type, subType: TransactionSubType.none, otherData: jsonEncode({ - TxV2OdKeys.overrideFee: - Amount( - rawValue: tx.fee, - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), - TxV2OdKeys.moneroAmount: - Amount( - rawValue: tx.amount, - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), + TxV2OdKeys.overrideFee: Amount( + rawValue: tx.fee, + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), + TxV2OdKeys.moneroAmount: Amount( + rawValue: tx.amount, + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), TxV2OdKeys.moneroAccountIndex: tx.accountIndex, TxV2OdKeys.isMoneroTransaction: true, }), @@ -673,7 +683,7 @@ abstract class LibSalviumWallet Future get availableBalance async { try { return Amount( - rawValue: libSalviumWallet!.getUnlockedBalance(), + rawValue: csSalvium.getUnlockedBalance(walletId)!, fractionDigits: cryptoCurrency.fractionDigits, ); } catch (_) { @@ -683,14 +693,14 @@ abstract class LibSalviumWallet Future get totalBalance async { try { - final full = libSalviumWallet?.getBalance(); + final full = csSalvium.getBalance(walletId); if (full != null) { return Amount( rawValue: full, fractionDigits: cryptoCurrency.fractionDigits, ); } else { - final transactions = await libSalviumWallet!.getAllTxs(refresh: true); + final transactions = await csSalvium.getAllTxs(walletId, refresh: true); BigInt transactionBalance = BigInt.zero; for (final tx in transactions) { if (!tx.isSpend) { @@ -713,10 +723,10 @@ abstract class LibSalviumWallet @override Future exit() async { Logging.instance.i("exit called on $walletId"); - libSalviumWallet?.stopAutoSaving(); - libSalviumWallet?.stopListeners(); - libSalviumWallet?.stopSyncing(); - await libSalviumWallet?.save(); + csSalvium.stopAutoSaving(walletId); + csSalvium.stopListeners(walletId); + csSalvium.stopSyncing(walletId); + await csSalvium.save(walletId); } Future pathForWalletDir({required String name}) async { @@ -786,7 +796,7 @@ abstract class LibSalviumWallet final _utxosUpdateLock = Mutex(); Future onUTXOsChanged(List utxos) async { await _utxosUpdateLock.protect(() async { - final cwUtxos = await libSalviumWallet?.getOutputs(refresh: true) ?? []; + final cwUtxos = await csSalvium.getOutputs(walletId, refresh: true); // bool changed = false; @@ -803,12 +813,12 @@ abstract class LibSalviumWallet if (u.isBlocked) { if (!cw.isFrozen) { - await libSalviumWallet?.freezeOutput(cw.keyImage); + await csSalvium.freezeOutput(walletId, cw.keyImage); // changed = true; } } else { if (cw.isFrozen) { - await libSalviumWallet?.thawOutput(cw.keyImage); + await csSalvium.thawOutput(walletId, cw.keyImage); // changed = true; } } @@ -964,9 +974,9 @@ abstract class LibSalviumWallet if (mismatch) { _canPing = false; - libSalviumWallet?.stopAutoSaving(); - libSalviumWallet?.stopListeners(); - libSalviumWallet?.stopSyncing(); + csSalvium.stopAutoSaving(walletId); + csSalvium.stopListeners(walletId); + csSalvium.stopSyncing(walletId); _setSyncStatus(FailedSyncStatus()); } @@ -984,27 +994,23 @@ abstract class LibSalviumWallet @override Future updateUTXOs() async { final List outputArray = []; - final utxos = - await libSalviumWallet?.getOutputs(refresh: true) ?? - []; + final utxos = await csSalvium.getOutputs(walletId, refresh: true); for (final rawUTXO in utxos) { if (!rawUTXO.spent) { - final current = - await mainDB.isar.utxos - .where() - .walletIdEqualTo(walletId) - .filter() - .voutEqualTo(rawUTXO.vout) - .and() - .txidEqualTo(rawUTXO.hash) - .findFirst(); - final tx = - await mainDB.isar.transactionV2s - .where() - .walletIdEqualTo(walletId) - .filter() - .txidEqualTo(rawUTXO.hash) - .findFirst(); + final current = await mainDB.isar.utxos + .where() + .walletIdEqualTo(walletId) + .filter() + .voutEqualTo(rawUTXO.vout) + .and() + .txidEqualTo(rawUTXO.hash) + .findFirst(); + final tx = await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .filter() + .txidEqualTo(rawUTXO.hash) + .findFirst(); final otherDataMap = { UTXOOtherDataKeys.keyImage: rawUTXO.keyImage, @@ -1077,7 +1083,7 @@ abstract class LibSalviumWallet // Slight possibility of race but should be irrelevant await refreshMutex.acquire(); - libSalviumWallet?.startSyncing(); + csSalvium.startSyncing(walletId); _setSyncStatus(StartingSyncStatus()); await updateTransactions(); @@ -1091,7 +1097,7 @@ abstract class LibSalviumWallet refreshMutex.release(); } - final synced = await libSalviumWallet?.isSynced(); + final synced = await csSalvium.isSynced(walletId); if (synced == true) { _setSyncStatus(SyncedSyncStatus()); @@ -1103,8 +1109,9 @@ abstract class LibSalviumWallet try { final currentReceiving = await getCurrentReceivingAddress(); - final newReceivingIndex = - currentReceiving == null ? 0 : currentReceiving.derivationIndex + 1; + final newReceivingIndex = currentReceiving == null + ? 0 + : currentReceiving.derivationIndex + 1; final newReceivingAddress = addressFor(index: newReceivingIndex); @@ -1139,17 +1146,15 @@ abstract class LibSalviumWallet try { int highestIndex = -1; - final entries = await libSalviumWallet?.getAllTxs(refresh: true); - if (entries != null) { - for (final element in entries) { - if (!element.isSpend) { - final int curAddressIndex = - element.addressIndexes.isEmpty - ? 0 - : element.addressIndexes.reduce(max); - if (curAddressIndex > highestIndex) { - highestIndex = curAddressIndex; - } + final entries = await csSalvium.getAllTxs(walletId, refresh: true); + + for (final element in entries) { + if (!element.isSpend) { + final int curAddressIndex = element.addressIndexes.isEmpty + ? 0 + : element.addressIndexes.reduce(max); + if (curAddressIndex > highestIndex) { + highestIndex = curAddressIndex; } } } @@ -1165,12 +1170,11 @@ abstract class LibSalviumWallet // Use new index to derive a new receiving address final newReceivingAddress = addressFor(index: newReceivingIndex); - final existing = - await mainDB - .getAddresses(walletId) - .filter() - .valueEqualTo(newReceivingAddress.value) - .findFirst(); + final existing = await mainDB + .getAddresses(walletId) + .filter() + .valueEqualTo(newReceivingAddress.value) + .findFirst(); if (existing == null) { // Add that new change address await mainDB.putAddress(newReceivingAddress); @@ -1206,9 +1210,9 @@ abstract class LibSalviumWallet numberOfBlocksFast: 10, numberOfBlocksAverage: 15, numberOfBlocksSlow: 20, - fast: BigInt.from(lib_salvium.TransactionPriority.high.value), - medium: BigInt.from(lib_salvium.TransactionPriority.medium.value), - slow: BigInt.from(lib_salvium.TransactionPriority.normal.value), + fast: BigInt.from(csSalvium.getTxPriorityHigh()), + medium: BigInt.from(csSalvium.getTxPriorityMedium()), + slow: BigInt.from(csSalvium.getTxPriorityNormal()), ); @override @@ -1234,16 +1238,16 @@ abstract class LibSalviumWallet try { final feeRate = txData.feeRateType; if (feeRate is FeeRateType) { - lib_salvium.TransactionPriority feePriority; + final int feePriority; switch (feeRate) { case FeeRateType.fast: - feePriority = lib_salvium.TransactionPriority.high; + feePriority = csSalvium.getTxPriorityHigh(); break; case FeeRateType.average: - feePriority = lib_salvium.TransactionPriority.medium; + feePriority = csSalvium.getTxPriorityMedium(); break; case FeeRateType.slow: - feePriority = lib_salvium.TransactionPriority.normal; + feePriority = csSalvium.getTxPriorityNormal(); break; default: throw ArgumentError("Invalid use of custom fee"); @@ -1268,12 +1272,9 @@ abstract class LibSalviumWallet throw Exception("Send all not supported with multiple recipients"); } - final List outputs = []; + final List outputs = []; for (final recipient in txData.recipients!) { - final output = lib_salvium.Recipient( - address: recipient.address, - amount: recipient.amount.raw, - ); + final output = CsRecipient(recipient.address, recipient.amount.raw); outputs.add(output); } @@ -1283,44 +1284,27 @@ abstract class LibSalviumWallet } final height = await chainHeight; - final inputs = - txData.utxos - ?.whereType() - .map( - (e) => lib_salvium.Output( - address: e.utxo.address!, - hash: e.utxo.txid, - keyImage: e.utxo.keyImage!, - value: e.value, - isFrozen: e.utxo.isBlocked, - isUnlocked: - e.utxo.blockHeight != null && - (height - (e.utxo.blockHeight ?? 0)) >= - cryptoCurrency.minConfirms, - height: e.utxo.blockHeight ?? 0, - vout: e.utxo.vout, - spent: e.utxo.used ?? false, - spentHeight: null, // doesn't matter here - coinbase: e.utxo.isCoinbase, - ), - ) - .toList(); + final inputs = txData.utxos?.whereType().toList(); return await prepareSendMutex.protect(() async { - final lib_salvium.PendingTransaction pendingTransaction; + final CsPendingTransaction pendingTransaction; if (outputs.length == 1) { - pendingTransaction = await libSalviumWallet!.createTx( + pendingTransaction = await csSalvium.createTx( + walletId, output: outputs.first, - paymentId: "", + minConfirms: cryptoCurrency.minConfirms, + currentHeight: height, sweep: sweep, priority: feePriority, preferredInputs: inputs, accountIndex: 0, // sw only uses account 0 at this time ); } else { - pendingTransaction = await libSalviumWallet!.createTxMultiDest( + pendingTransaction = await csSalvium.createTxMultiDest( + walletId, outputs: outputs, - paymentId: "", + minConfirms: cryptoCurrency.minConfirms, + currentHeight: height, priority: feePriority, preferredInputs: inputs, sweep: sweep, @@ -1363,7 +1347,7 @@ abstract class LibSalviumWallet Future confirmSend({required TxData txData}) async { try { try { - await libSalviumWallet!.commitTx(txData.pendingSalviumTransaction!); + await csSalvium.commitTx(walletId, txData.pendingSalviumTransaction!); Logging.instance.d( "transaction ${txData.pendingSalviumTransaction!.txid} has been sent", @@ -1412,7 +1396,12 @@ abstract class LibSalviumWallet key: _libSalviumWalletPasswordKey(walletId.toUpperCase()), value: password, ); - final wallet = await getRestoredFromViewKeyWallet( + + if (csSalvium.walletInstanceExists(walletId)) { + await exit(); + } + + await getRestoredFromViewKeyWallet( path: path, password: password, address: data.address, @@ -1420,12 +1409,6 @@ abstract class LibSalviumWallet height: height, ); - if (libSalviumWallet != null) { - await exit(); - } - - libSalviumWallet = wallet; - _setListener(); final newReceivingAddress = @@ -1434,7 +1417,7 @@ abstract class LibSalviumWallet walletId: walletId, derivationIndex: 0, derivationPath: null, - value: wallet.getAddress().value, + value: csSalvium.getAddress(walletId), publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -1449,12 +1432,12 @@ abstract class LibSalviumWallet await updateNode(); _setListener(); - unawaited(libSalviumWallet?.rescanBlockchain()); - libSalviumWallet?.startSyncing(); + unawaited(csSalvium.rescanBlockchain(walletId)); + csSalvium.startSyncing(walletId); // await save(); - libSalviumWallet?.startListeners(); - libSalviumWallet?.startAutoSaving(); + csSalvium.startListeners(walletId); + csSalvium.startAutoSaving(walletId); } catch (e, s) { Logging.instance.e( "Exception rethrown from recoverViewOnly(): ", diff --git a/lib/wl_gen/interfaces/cs_monero_interface.dart b/lib/wl_gen/interfaces/cs_monero_interface.dart index 7622962396..9ed2bb4163 100644 --- a/lib/wl_gen/interfaces/cs_monero_interface.dart +++ b/lib/wl_gen/interfaces/cs_monero_interface.dart @@ -76,7 +76,7 @@ abstract class CsMoneroInterface { void stopAutoSaving(String walletId); bool hasListeners(String walletId); - void addListener(String walletId, CsMoneroWalletListener listener); + void addListener(String walletId, CsWalletListener listener); void startListeners(String walletId); void stopListeners(String walletId); @@ -148,13 +148,17 @@ abstract class CsMoneroInterface { List getMoneroWordList(String language); List getWowneroWordList(String language, int seedLength); + + int getHeightByDate(DateTime date, {required CsCoin csCoin}); + + bool validateAddress(String address, int network, {required CsCoin csCoin}); } enum CsCoin { monero, wownero } // forwarding class -final class CsMoneroWalletListener { - CsMoneroWalletListener({ +final class CsWalletListener { + CsWalletListener({ this.onSyncingUpdate, this.onNewBlock, this.onBalancesChanged, diff --git a/lib/wl_gen/interfaces/cs_salvium_interface.dart b/lib/wl_gen/interfaces/cs_salvium_interface.dart new file mode 100644 index 0000000000..108ff166b2 --- /dev/null +++ b/lib/wl_gen/interfaces/cs_salvium_interface.dart @@ -0,0 +1,154 @@ +import '../../models/input.dart'; +import 'cs_monero_interface.dart'; + +export '../generated/cs_salvium_interface_impl.dart'; + +abstract class CsSalviumInterface { + void setUseCsSalviumLoggerInternal(bool enable); + + // tx prio forwarding + int getTxPriorityHigh(); + int getTxPriorityMedium(); + int getTxPriorityNormal(); + + bool walletInstanceExists(String walletId); + + bool walletExists(String path); + + Future estimateFee(int rate, BigInt amount, {required String walletId}); + + Future loadWallet( + String walletId, { + + required String path, + required String password, + }); + + String getAddress( + String walletId, { + int accountIndex = 0, + int addressIndex = 0, + }); + + Future getCreatedWallet({ + required String path, + required String password, + required int wordCount, + required String seedOffset, + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, + }); + + Future getRestoredWallet({ + required String walletId, + + required String path, + required String password, + required String mnemonic, + required String seedOffset, + int height = 0, + }); + + Future getRestoredFromViewKeyWallet({ + required String walletId, + + required String path, + required String password, + required String address, + required String privateViewKey, + int height = 0, + }); + + String getTxKey(String walletId, String txid); + + Future save(String walletId); + + String getPublicViewKey(String walletId); + String getPrivateViewKey(String walletId); + String getPublicSpendKey(String walletId); + String getPrivateSpendKey(String walletId); + + Future isSynced(String walletId); + void startSyncing(String walletId); + void stopSyncing(String walletId); + + void startAutoSaving(String walletId); + void stopAutoSaving(String walletId); + + bool hasListeners(String walletId); + void addListener(String walletId, CsWalletListener listener); + void startListeners(String walletId); + void stopListeners(String walletId); + + Future rescanBlockchain(String walletId); + Future isConnectedToDaemon(String walletId); + + int getRefreshFromBlockHeight(String walletId); + void setRefreshFromBlockHeight(String walletId, int height); + + Future connect( + String walletId, { + required String daemonAddress, + required bool trusted, + String? daemonUsername, + String? daemonPassword, + bool useSSL = false, + bool isLightWallet = false, + String? socksProxyAddress, + }); + + Future> getAllTxids(String walletId, {bool refresh = false}); + + BigInt? getBalance(String walletId, {int accountIndex = 0}); + BigInt? getUnlockedBalance(String walletId, {int accountIndex = 0}); + + Future> getAllTxs( + String walletId, { + bool refresh = false, + }); + + Future> getTxs( + String walletId, { + required Set txids, + bool refresh = false, + }); + + Future createTx( + String walletId, { + required CsRecipient output, + required int priority, + required bool sweep, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }); + + Future createTxMultiDest( + String walletId, { + required List outputs, + required int priority, + required bool sweep, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }); + + Future commitTx(String walletId, CsPendingTransaction tx); + + Future> getOutputs( + String walletId, { + bool refresh = false, + bool includeSpent = false, + }); + + Future freezeOutput(String walletId, String keyImage); + Future thawOutput(String walletId, String keyImage); + + List getSalviumWordList(String language); + + int getHeightByDate(DateTime date); + + bool validateAddress(String address, int network); +} diff --git a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart new file mode 100644 index 0000000000..6d56cb075e --- /dev/null +++ b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart @@ -0,0 +1,488 @@ +//ON +import 'package:cs_salvium/cs_salvium.dart' as lib_salvium; +import 'package:cs_salvium/src/deprecated/get_height_by_date.dart' + as cs_salvium_deprecated; +import 'package:cs_salvium/src/ffi_bindings/salvium_wallet_bindings.dart' + as sal_wallet_ffi; + +//END_ON +import '../../models/input.dart'; +import '../interfaces/cs_monero_interface.dart'; +import '../interfaces/cs_salvium_interface.dart'; + +CsSalviumInterface get csSalvium => _getInterface(); + +//OFF +CsSalviumInterface _getInterface() => throw Exception("XMR/WOW not enabled!"); + +//END_OFF +//ON +CsSalviumInterface _getInterface() => _CsSalviumInterfaceImpl(); + +class _CsSalviumInterfaceImpl extends CsSalviumInterface { + final Map _wallets = {}; + + @override + void setUseCsSalviumLoggerInternal(bool enable) => + lib_salvium.Logging.useLogger = enable; + + @override + bool walletInstanceExists(String walletId) => _wallets[walletId] != null; + + @override + bool walletExists(String path) => + lib_salvium.SalviumWallet.isWalletExist(path); + + @override + Future estimateFee(int rate, BigInt amount, {required String walletId}) { + lib_salvium.TransactionPriority priority; + switch (rate) { + case 1: + priority = lib_salvium.TransactionPriority.low; + break; + case 2: + priority = lib_salvium.TransactionPriority.medium; + break; + case 3: + priority = lib_salvium.TransactionPriority.high; + break; + case 4: + priority = lib_salvium.TransactionPriority.last; + break; + case 0: + default: + priority = lib_salvium.TransactionPriority.normal; + break; + } + + return _wallets[walletId]!.estimateFee(priority, amount.toInt()); + } + + @override + Future loadWallet( + String walletId, { + required String path, + required String password, + }) async { + _wallets[walletId] = await lib_salvium.SalviumWallet.loadWallet( + path: path, + password: password, + ); + } + + @override + int getTxPriorityHigh() => lib_salvium.TransactionPriority.high.value; + + @override + int getTxPriorityMedium() => lib_salvium.TransactionPriority.medium.value; + + @override + int getTxPriorityNormal() => lib_salvium.TransactionPriority.normal.value; + + @override + String getAddress( + String walletId, { + int accountIndex = 0, + int addressIndex = 0, + }) => _wallets[walletId]! + .getAddress(accountIndex: accountIndex, addressIndex: addressIndex) + .value; + + @override + Future getCreatedWallet({ + required String path, + required String password, + required int wordCount, + required String seedOffset, + required final void Function(int refreshFromBlockHeight, String seed) + onCreated, + }) async { + final type = switch (wordCount) { + 16 => lib_salvium.SalviumSeedType.sixteen, + 25 => lib_salvium.SalviumSeedType.twentyFive, + _ => throw Exception("Invalid mnemonic word count: $wordCount"), + }; + + final wallet = await lib_salvium.SalviumWallet.create( + path: path, + password: password, + seedType: type, + seedOffset: seedOffset, + ); + + onCreated( + wallet.getRefreshFromBlockHeight(), + wallet.getSeed(seedOffset: seedOffset).trim(), + ); + } + + @override + Future getRestoredWallet({ + required String walletId, + required String path, + required String password, + required String mnemonic, + required String seedOffset, + int height = 0, + }) async { + _wallets[walletId] = await lib_salvium.SalviumWallet.restoreWalletFromSeed( + path: path, + password: password, + seed: mnemonic, + restoreHeight: height, + seedOffset: seedOffset, + ); + } + + @override + Future getRestoredFromViewKeyWallet({ + required String walletId, + required String path, + required String password, + required String address, + required String privateViewKey, + int height = 0, + }) async { + _wallets[walletId] = await lib_salvium.SalviumWallet.createViewOnlyWallet( + path: path, + password: password, + address: address, + viewKey: privateViewKey, + restoreHeight: height, + ); + } + + @override + String getTxKey(String walletId, String txid) => + _wallets[walletId]!.getTxKey(txid); + + @override + Future save(String walletId) => _wallets[walletId]!.save(); + + @override + String getPublicViewKey(String walletId) => + _wallets[walletId]!.getPublicViewKey(); + + @override + String getPrivateViewKey(String walletId) => + _wallets[walletId]!.getPrivateViewKey(); + + @override + String getPublicSpendKey(String walletId) => + _wallets[walletId]!.getPublicSpendKey(); + + @override + String getPrivateSpendKey(String walletId) => + _wallets[walletId]!.getPrivateSpendKey(); + + @override + Future isSynced(String walletId) => + _wallets[walletId]?.isSynced() ?? Future.value(false); + + @override + void startSyncing(String walletId) => _wallets[walletId]?.startSyncing(); + + @override + void stopSyncing(String walletId) => _wallets[walletId]?.stopSyncing(); + + @override + void startAutoSaving(String walletId) => + _wallets[walletId]?.startAutoSaving(); + + @override + void stopAutoSaving(String walletId) => _wallets[walletId]?.stopAutoSaving(); + + @override + bool hasListeners(String walletId) => + _wallets[walletId]!.getListeners().isNotEmpty; + + @override + void addListener(String walletId, CsWalletListener listener) => + _wallets[walletId]?.addListener( + lib_salvium.WalletListener( + onSyncingUpdate: listener.onSyncingUpdate, + onNewBlock: listener.onNewBlock, + onBalancesChanged: listener.onBalancesChanged, + onError: listener.onError, + ), + ); + + @override + void startListeners(String walletId) => _wallets[walletId]?.startListeners(); + + @override + void stopListeners(String walletId) => _wallets[walletId]?.stopListeners(); + + @override + int getRefreshFromBlockHeight(String walletId) => + _wallets[walletId]!.getRefreshFromBlockHeight(); + + @override + void setRefreshFromBlockHeight(String walletId, int height) => + _wallets[walletId]!.setRefreshFromBlockHeight(height); + + @override + Future rescanBlockchain(String walletId) => + _wallets[walletId]?.rescanBlockchain() ?? Future.value(false); + + @override + Future isConnectedToDaemon(String walletId) => + _wallets[walletId]?.isConnectedToDaemon() ?? Future.value(false); + + @override + Future connect( + String walletId, { + required String daemonAddress, + required bool trusted, + String? daemonUsername, + String? daemonPassword, + bool useSSL = false, + bool isLightWallet = false, + String? socksProxyAddress, + }) async { + await _wallets[walletId]?.connect( + daemonAddress: daemonAddress, + trusted: trusted, + daemonUsername: daemonUsername, + daemonPassword: daemonPassword, + useSSL: useSSL, + socksProxyAddress: socksProxyAddress, + isLightWallet: isLightWallet, + ); + } + + @override + Future> getAllTxids(String walletId, {bool refresh = false}) => + _wallets[walletId]!.getAllTxids(refresh: refresh); + + @override + BigInt? getBalance(String walletId, {int accountIndex = 0}) => + _wallets[walletId]?.getBalance(accountIndex: accountIndex); + + @override + BigInt? getUnlockedBalance(String walletId, {int accountIndex = 0}) => + _wallets[walletId]?.getUnlockedBalance(accountIndex: accountIndex); + + @override + Future> getAllTxs( + String walletId, { + bool refresh = false, + }) async { + final transactions = await _wallets[walletId]?.getAllTxs(refresh: refresh); + if (transactions == null) return []; + return transactions + .map( + (e) => CsTransaction( + displayLabel: e.displayLabel, + description: e.description, + fee: e.fee, + confirmations: e.confirmations, + blockHeight: e.blockHeight, + accountIndex: e.accountIndex, + addressIndexes: e.addressIndexes, + paymentId: e.paymentId, + amount: e.amount, + isSpend: e.isSpend, + hash: e.hash, + key: e.key, + timeStamp: e.timeStamp, + minConfirms: e.minConfirms.value, + ), + ) + .toList(); + } + + @override + Future> getTxs( + String walletId, { + required Set txids, + bool refresh = false, + }) async { + final transactions = await _wallets[walletId]?.getTxs( + txids: txids, + refresh: refresh, + ); + if (transactions == null) return []; + return transactions + .map( + (e) => CsTransaction( + displayLabel: e.displayLabel, + description: e.description, + fee: e.fee, + confirmations: e.confirmations, + blockHeight: e.blockHeight, + accountIndex: e.accountIndex, + addressIndexes: e.addressIndexes, + paymentId: e.paymentId, + amount: e.amount, + isSpend: e.isSpend, + hash: e.hash, + key: e.key, + timeStamp: e.timeStamp, + minConfirms: e.minConfirms.value, + ), + ) + .toList(); + } + + @override + Future createTx( + String walletId, { + required CsRecipient output, + required int priority, + required bool sweep, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }) async { + final pending = await _wallets[walletId]!.createTx( + output: lib_salvium.Recipient( + address: output.address, + amount: output.amount, + ), + paymentId: "", + sweep: sweep, + priority: lib_salvium.TransactionPriority.values.firstWhere( + (e) => e.value == priority, + ), + preferredInputs: preferredInputs + ?.map( + (e) => lib_salvium.Output( + address: e.address!, + hash: e.utxo.txid, + keyImage: e.utxo.keyImage!, + value: e.value, + isFrozen: e.utxo.isBlocked, + isUnlocked: + e.utxo.blockHeight != null && + (currentHeight - (e.utxo.blockHeight ?? 0)) >= minConfirms, + height: e.utxo.blockHeight ?? 0, + vout: e.utxo.vout, + spent: e.utxo.used ?? false, + spentHeight: null, // doesn't matter here + coinbase: e.utxo.isCoinbase, + ), + ) + .toList(), + accountIndex: accountIndex, + ); + + return CsPendingTransaction( + pending, + pending.amount, + pending.fee, + pending.txid, + ); + } + + @override + Future createTxMultiDest( + String walletId, { + required List outputs, + required int priority, + required bool sweep, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }) async { + final pending = await _wallets[walletId]!.createTxMultiDest( + outputs: outputs + .map( + (e) => lib_salvium.Recipient(address: e.address, amount: e.amount), + ) + .toList(), + paymentId: "", + sweep: sweep, + priority: lib_salvium.TransactionPriority.values.firstWhere( + (e) => e.value == priority, + ), + preferredInputs: preferredInputs + ?.map( + (e) => lib_salvium.Output( + address: e.address!, + hash: e.utxo.txid, + keyImage: e.utxo.keyImage!, + value: e.value, + isFrozen: e.utxo.isBlocked, + isUnlocked: + e.utxo.blockHeight != null && + (currentHeight - (e.utxo.blockHeight ?? 0)) >= minConfirms, + height: e.utxo.blockHeight ?? 0, + vout: e.utxo.vout, + spent: e.utxo.used ?? false, + spentHeight: null, // doesn't matter here + coinbase: e.utxo.isCoinbase, + ), + ) + .toList(), + accountIndex: accountIndex, + ); + + return CsPendingTransaction( + pending, + pending.amount, + pending.fee, + pending.txid, + ); + } + + @override + Future commitTx(String walletId, CsPendingTransaction tx) => + _wallets[walletId]!.commitTx(tx.value as lib_salvium.PendingTransaction); + + @override + Future> getOutputs( + String walletId, { + bool refresh = false, + bool includeSpent = false, + }) async { + final outputs = await _wallets[walletId]?.getOutputs( + includeSpent: includeSpent, + refresh: refresh, + ); + + if (outputs == null) return []; + + return outputs + .map( + (e) => CsOutput( + address: e.address, + hash: e.hash, + keyImage: e.keyImage, + value: e.value, + isFrozen: e.isFrozen, + isUnlocked: e.isUnlocked, + height: e.height, + spentHeight: e.spentHeight, + vout: e.vout, + spent: e.spent, + coinbase: e.coinbase, + ), + ) + .toList(); + } + + @override + Future freezeOutput(String walletId, String keyImage) => + _wallets[walletId]!.freezeOutput(keyImage); + + @override + Future thawOutput(String walletId, String keyImage) => + _wallets[walletId]!.thawOutput(keyImage); + + @override + List getSalviumWordList(String language) => + lib_salvium.getSalviumWordList(language); + + @override + int getHeightByDate(DateTime date) => + cs_salvium_deprecated.getSalviumHeightByDate(date: date); + + @override + bool validateAddress(String address, int network) => + sal_wallet_ffi.validateAddress(address, network); +} + +//END_ON diff --git a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart index 5d6fbfc35c..3ca3909e74 100644 --- a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart +++ b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart @@ -1,5 +1,11 @@ //ON import 'package:cs_monero/cs_monero.dart' as lib_monero; +import 'package:cs_monero/src/deprecated/get_height_by_date.dart' + as cs_monero_deprecated; +import 'package:cs_monero/src/ffi_bindings/monero_wallet_bindings.dart' + as xmr_wallet_ffi; +import 'package:cs_monero/src/ffi_bindings/wownero_wallet_bindings.dart' + as wow_wallet_ffi; //END_ON import '../../models/input.dart'; @@ -250,7 +256,7 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { _wallets[walletId]!.getListeners().isNotEmpty; @override - void addListener(String walletId, CsMoneroWalletListener listener) => + void addListener(String walletId, CsWalletListener listener) => _wallets[walletId]?.addListener( lib_monero.WalletListener( onSyncingUpdate: listener.onSyncingUpdate, @@ -532,6 +538,22 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { @override List getWowneroWordList(String language, int seedLength) => lib_monero.getWowneroWordList(language, seedWordsLength: seedLength); + + @override + int getHeightByDate(DateTime date, {required CsCoin csCoin}) => + switch (csCoin) { + CsCoin.monero => cs_monero_deprecated.getMoneroHeightByDate(date: date), + CsCoin.wownero => cs_monero_deprecated.getWowneroHeightByDate( + date: date, + ), + }; + + @override + bool validateAddress(String address, int network, {required CsCoin csCoin}) => + switch (csCoin) { + CsCoin.monero => xmr_wallet_ffi.validateAddress(address, network), + CsCoin.wownero => wow_wallet_ffi.validateAddress(address, network), + }; } //END_ON From fef43fb0a2fb224cd3c0e9462cc2f1903b8ea48d Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Oct 2025 10:18:56 -0600 Subject: [PATCH 128/178] mwc git version --- lib/utilities/git_status.dart | 5 ++--- lib/wl_gen/interfaces/libmwc_interface.dart | 2 ++ tool/wl_templates/MWC_libmwc_interface_impl.template.dart | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/utilities/git_status.dart b/lib/utilities/git_status.dart index 2b19e334e6..9efade7c9a 100644 --- a/lib/utilities/git_status.dart +++ b/lib/utilities/git_status.dart @@ -2,13 +2,13 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_libepiccash/git_versions.dart' as epic_versions; -import 'package:flutter_libmwc/git_versions.dart' as mimblewimblecoin_versions; import 'package:http/http.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/text_styles.dart'; import '../app_config.dart'; +import '../wl_gen/interfaces/libmwc_interface.dart'; const kGithubAPI = "https://api.github.com"; const kGithubSearch = "/search/commits"; @@ -19,8 +19,7 @@ enum CommitStatus { isHead, isOldCommit, notACommit, notLoaded } abstract class GitStatus { static String get epicCashCommit => epic_versions.getPluginVersion(); // static String get moneroCommit => monero_versions.getPluginVersion(); - static String get mimblewimblecoinCommit => - mimblewimblecoin_versions.getPluginVersion(); + static String get mimblewimblecoinCommit => libMwc.getPluginVersion(); static String get appCommitHash => AppConfig.commitHash; diff --git a/lib/wl_gen/interfaces/libmwc_interface.dart b/lib/wl_gen/interfaces/libmwc_interface.dart index 60536cfb96..acd5b2d795 100644 --- a/lib/wl_gen/interfaces/libmwc_interface.dart +++ b/lib/wl_gen/interfaces/libmwc_interface.dart @@ -139,6 +139,8 @@ abstract class LibMwcInterface { Future getChainHeight({required String config}); Future deleteWallet({required String wallet, required String config}); + + String getPluginVersion(); } class MwcTransaction { diff --git a/tool/wl_templates/MWC_libmwc_interface_impl.template.dart b/tool/wl_templates/MWC_libmwc_interface_impl.template.dart index 356c071ec9..0262cc5e35 100644 --- a/tool/wl_templates/MWC_libmwc_interface_impl.template.dart +++ b/tool/wl_templates/MWC_libmwc_interface_impl.template.dart @@ -1,4 +1,5 @@ //ON +import 'package:flutter_libmwc/git_versions.dart' as mimblewimblecoin_versions; import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; import 'package:flutter_libmwc/models/transaction.dart' as mimblewimblecoin_models; @@ -12,7 +13,6 @@ LibMwcInterface get libMwc => _getLibMwc(); LibMwcInterface _getLibMwc() => throw Exception("MWC not enabled!"); //END_OFF - //ON LibMwcInterface _getLibMwc() => const _LibMwcInterfaceImpl(); @@ -343,6 +343,9 @@ final class _LibMwcInterfaceImpl extends LibMwcInterface { bool validateSendAddress({required String address}) { return mimblewimblecoin.Libmwc.validateSendAddress(address: address); } + + @override + String getPluginVersion() => mimblewimblecoin_versions.getPluginVersion(); } //END_ON From 490a8fbd5fe41bf99b14f17f289ee3252e5c7b64 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Oct 2025 10:21:23 -0600 Subject: [PATCH 129/178] implement epiccash optional ffi package import --- .../send_view/confirm_transaction_view.dart | 658 +++++++++--------- lib/utilities/git_status.dart | 4 +- .../crypto_currency/coins/epiccash.dart | 12 +- lib/wallets/wallet/impl/epiccash_wallet.dart | 95 ++- .../interfaces/libepiccash_interface.dart | 160 +++++ ...C_libepiccash_interface_impl.template.dart | 274 ++++++++ 6 files changed, 800 insertions(+), 403 deletions(-) create mode 100644 lib/wl_gen/interfaces/libepiccash_interface.dart create mode 100644 tool/wl_templates/EPIC_libepiccash_interface_impl.template.dart diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index 93a6f052ad..5cb12e02a6 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -14,7 +14,6 @@ import 'dart:io'; import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_libepiccash/lib.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -55,6 +54,7 @@ import '../../widgets/rounded_white_container.dart'; import '../../widgets/stack_dialog.dart'; import '../../widgets/stack_text_field.dart'; import '../../widgets/textfield_icon_button.dart'; +import '../../wl_gen/interfaces/libepiccash_interface.dart'; import '../pinpad_views/lock_screen_view.dart'; import '../wallet_view/wallet_view.dart'; import 'sub_widgets/mwc_slatepack_dialog.dart'; @@ -121,16 +121,15 @@ class _ConfirmTransactionViewState // Create slatepack. final slatepackResult = await wallet.createSlatepack( amount: recipient.amount, - recipientAddress: - recipient.address.isNotEmpty ? recipient.address : null, - message: - onChainNoteController.text.isNotEmpty - ? onChainNoteController.text - : null, - encrypt: - recipient - .address - .isNotEmpty, // Encrypt if we have a recipient address. + recipientAddress: recipient.address.isNotEmpty + ? recipient.address + : null, + message: onChainNoteController.text.isNotEmpty + ? onChainNoteController.text + : null, + encrypt: recipient + .address + .isNotEmpty, // Encrypt if we have a recipient address. ); if (!slatepackResult.success || slatepackResult.slatepack == null) { @@ -142,8 +141,8 @@ class _ConfirmTransactionViewState await showDialog( context: context, barrierDismissible: false, - builder: - (context) => MwcSlatepackDialog(slatepackResult: slatepackResult), + builder: (context) => + MwcSlatepackDialog(slatepackResult: slatepackResult), ); // After slatepack dialog is closed, navigate back to wallet. @@ -171,17 +170,16 @@ class _ConfirmTransactionViewState await showDialog( context: context, - builder: - (context) => AlertDialog( - title: const Text('Slatepack Creation Failed'), - content: Text('Failed to create slatepack: $e'), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: const Text('OK'), - ), - ], + builder: (context) => AlertDialog( + title: const Text('Slatepack Creation Failed'), + content: Text('Failed to create slatepack: $e'), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: const Text('OK'), ), + ], + ), ); } } @@ -245,10 +243,9 @@ class _ConfirmTransactionViewState } else { if (coin is Mimblewimblecoin) { // Check if this is a slatepack transaction (manual exchange). - final otherDataMap = - widget.txData.otherData != null - ? jsonDecode(widget.txData.otherData!) - : null; + final otherDataMap = widget.txData.otherData != null + ? jsonDecode(widget.txData.otherData!) + : null; final transactionMethod = otherDataMap?['transactionMethod'] as String?; @@ -321,7 +318,7 @@ class _ConfirmTransactionViewState widget.onSuccessInsteadOfRouteOnSuccess!.call(); } } - } on BadEpicHttpAddressException catch (_) { + } on BadHttpAddressException catch (_) { if (context.mounted) { // pop building dialog Navigator.of(context).pop(); @@ -394,10 +391,9 @@ class _ConfirmTransactionViewState child: Text( "Ok", style: STextStyles.button(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), ), onPressed: () { @@ -492,81 +488,76 @@ class _ConfirmTransactionViewState return ConditionalParent( condition: !isDesktop, - builder: - (child) => Background( - child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, - appBar: AppBar( - backgroundColor: - Theme.of(context).extension()!.background, - leading: AppBarBackButton( - onPressed: () async { - // if (FocusScope.of(context).hasFocus) { - // FocusScope.of(context).unfocus(); - // await Future.delayed(Duration(milliseconds: 50)); - // } - Navigator.of(context).pop(); - }, - ), - title: Text( - "Confirm transaction", - style: STextStyles.navBarTitle(context), - ), - ), - body: SafeArea( - child: LayoutBuilder( - builder: (builderContext, constraints) { - return Padding( - padding: const EdgeInsets.only( - left: 12, - top: 12, - right: 12, + builder: (child) => Background( + child: Scaffold( + backgroundColor: Theme.of( + context, + ).extension()!.background, + appBar: AppBar( + backgroundColor: Theme.of( + context, + ).extension()!.background, + leading: AppBarBackButton( + onPressed: () async { + // if (FocusScope.of(context).hasFocus) { + // FocusScope.of(context).unfocus(); + // await Future.delayed(Duration(milliseconds: 50)); + // } + Navigator.of(context).pop(); + }, + ), + title: Text( + "Confirm transaction", + style: STextStyles.navBarTitle(context), + ), + ), + body: SafeArea( + child: LayoutBuilder( + builder: (builderContext, constraints) { + return Padding( + padding: const EdgeInsets.only(left: 12, top: 12, right: 12), + child: SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight - 24, ), - child: SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: constraints.maxHeight - 24, - ), - child: IntrinsicHeight( - child: Padding( - padding: const EdgeInsets.all(4), - child: child, - ), - ), + child: IntrinsicHeight( + child: Padding( + padding: const EdgeInsets.all(4), + child: child, ), ), - ); - }, - ), - ), + ), + ), + ); + }, ), ), + ), + ), child: ConditionalParent( condition: isDesktop, - builder: - (child) => Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisSize: MainAxisSize.min, + builder: (child) => Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: [ + Row( children: [ - Row( - children: [ - AppBarBackButton( - size: 40, - iconSize: 24, - onPressed: - () => - Navigator.of(context, rootNavigator: true).pop(), - ), - Text( - "Confirm $unit transaction", - style: STextStyles.desktopH3(context), - ), - ], + AppBarBackButton( + size: 40, + iconSize: 24, + onPressed: () => + Navigator.of(context, rootNavigator: true).pop(), + ), + Text( + "Confirm $unit transaction", + style: STextStyles.desktopH3(context), ), - Flexible(child: SingleChildScrollView(child: child)), ], ), + Flexible(child: SingleChildScrollView(child: child)), + ], + ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: isDesktop ? MainAxisSize.min : MainAxisSize.max, @@ -592,7 +583,11 @@ class _ConfirmTransactionViewState widget.isPaynymTransaction ? widget.txData.paynymAccountLite!.nymName : widget.txData.recipients?.first.address ?? - widget.txData.sparkRecipients!.first.address, + widget + .txData + .sparkRecipients! + .first + .address, style: STextStyles.itemSubtitle12(context), ), ], @@ -609,12 +604,11 @@ class _ConfirmTransactionViewState .watch(pAmountFormatter(coin)) .format( amountWithoutChange, - ethContract: - widget.isTokenTx - ? ref - .watch(pCurrentTokenWallet)! - .tokenContract - : null, + ethContract: widget.isTokenTx + ? ref + .watch(pCurrentTokenWallet)! + .tokenContract + : null, ), style: STextStyles.itemSubtitle12(context), textAlign: TextAlign.right, @@ -728,18 +722,18 @@ class _ConfirmTransactionViewState ), child: RoundedWhiteContainer( padding: const EdgeInsets.all(0), - borderColor: - Theme.of(context).extension()!.background, + borderColor: Theme.of( + context, + ).extension()!.background, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Container( decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, borderRadius: BorderRadius.only( topLeft: Radius.circular( Constants.size.circularBorderRadius, @@ -799,37 +793,35 @@ class _ConfirmTransactionViewState String fiatAmount = "N/A"; if (externalCalls) { - final price = - widget.isTokenTx - ? ref - .read( - priceAnd24hChangeNotifierProvider, - ) - .getTokenPrice( - ref - .read(pCurrentTokenWallet)! - .tokenContract - .address, - ) - ?.value - : ref - .read( - priceAnd24hChangeNotifierProvider, - ) - .getPrice(coin) - ?.value; - if (price != null && price > Decimal.zero) { - fiatAmount = (amountWithoutChange.decimal * - price) - .toAmount(fractionDigits: 2) - .fiatString( - locale: + final price = widget.isTokenTx + ? ref + .read( + priceAnd24hChangeNotifierProvider, + ) + .getTokenPrice( ref + .read(pCurrentTokenWallet)! + .tokenContract + .address, + ) + ?.value + : ref + .read( + priceAnd24hChangeNotifierProvider, + ) + .getPrice(coin) + ?.value; + if (price != null && price > Decimal.zero) { + fiatAmount = + (amountWithoutChange.decimal * price) + .toAmount(fractionDigits: 2) + .fiatString( + locale: ref .read( localeServiceChangeNotifierProvider, ) .locale, - ); + ); } } @@ -840,23 +832,21 @@ class _ConfirmTransactionViewState .watch(pAmountFormatter(coin)) .format( amountWithoutChange, - ethContract: - widget.isTokenTx - ? ref - .watch( - pCurrentTokenWallet, - )! - .tokenContract - : null, + ethContract: widget.isTokenTx + ? ref + .watch( + pCurrentTokenWallet, + )! + .tokenContract + : null, ), style: STextStyles.desktopTextExtraExtraSmall( context, ).copyWith( - color: - Theme.of(context) - .extension()! - .textDark, + color: Theme.of(context) + .extension()! + .textDark, ), ), if (externalCalls) @@ -884,10 +874,9 @@ class _ConfirmTransactionViewState ), Container( height: 1, - color: - Theme.of( - context, - ).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, ), Padding( padding: const EdgeInsets.all(12), @@ -909,19 +898,19 @@ class _ConfirmTransactionViewState widget.isPaynymTransaction ? widget.txData.paynymAccountLite!.nymName : widget.txData.recipients?.first.address ?? - widget - .txData - .sparkRecipients! - .first - .address, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( + widget + .txData + .sparkRecipients! + .first + .address, + style: + STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of( context, ).extension()!.textDark, - ), + ), ), ], ), @@ -929,10 +918,9 @@ class _ConfirmTransactionViewState if (widget.isPaynymTransaction) Container( height: 1, - color: - Theme.of( - context, - ).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, ), if (widget.isPaynymTransaction) Padding( @@ -950,14 +938,14 @@ class _ConfirmTransactionViewState const SizedBox(height: 2), SelectableText( ref.watch(pAmountFormatter(coin)).format(fee!), - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( + style: + STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of( context, ).extension()!.textDark, - ), + ), ), ], ), @@ -965,10 +953,9 @@ class _ConfirmTransactionViewState if (coin is Ethereum) Container( height: 1, - color: - Theme.of( - context, - ).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, ), if (coin is Ethereum) Padding( @@ -986,14 +973,14 @@ class _ConfirmTransactionViewState const SizedBox(height: 2), SelectableText( widget.txData.nonce.toString(), - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( + style: + STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of( context, ).extension()!.textDark, - ), + ), ), ], ), @@ -1063,33 +1050,36 @@ class _ConfirmTransactionViewState focusNode: _onChainNoteFocusNode, style: STextStyles.field(context), onChanged: (_) => setState(() {}), - decoration: standardInputDecoration( - "Type something...", - _onChainNoteFocusNode, - context, - ).copyWith( - suffixIcon: - onChainNoteController.text.isNotEmpty + decoration: + standardInputDecoration( + "Type something...", + _onChainNoteFocusNode, + context, + ).copyWith( + suffixIcon: + onChainNoteController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - onChainNoteController.text = - ""; - }); - }, - ), - ], + padding: const EdgeInsets.only( + right: 0, ), - ), - ) + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + onChainNoteController.text = + ""; + }); + }, + ), + ], + ), + ), + ) : null, - ), + ), ), ), if (coin is Epiccash || coin is Mimblewimblecoin) @@ -1098,14 +1088,12 @@ class _ConfirmTransactionViewState (coin is Epiccash || coin is Mimblewimblecoin) ? "Local Note (optional)" : "Note (optional)", - style: STextStyles.desktopTextExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) .extension()! .textFieldActiveSearchIconRight, - ), + ), textAlign: TextAlign.left, ), const SizedBox(height: 10), @@ -1120,49 +1108,48 @@ class _ConfirmTransactionViewState enableSuggestions: isDesktop ? false : true, controller: noteController, focusNode: _noteFocusNode, - style: STextStyles.desktopTextExtraSmall( - context, - ).copyWith( - color: - Theme.of( + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of( context, ).extension()!.textFieldActiveText, - height: 1.8, - ), + height: 1.8, + ), onChanged: (_) => setState(() {}), - decoration: standardInputDecoration( - "Type something...", - _noteFocusNode, - context, - desktopMed: true, - ).copyWith( - contentPadding: const EdgeInsets.only( - left: 16, - top: 11, - bottom: 12, - right: 5, - ), - suffixIcon: - noteController.text.isNotEmpty + decoration: + standardInputDecoration( + "Type something...", + _noteFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.only( + left: 16, + top: 11, + bottom: 12, + right: 5, + ), + suffixIcon: noteController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState( - () => noteController.text = "", - ); - }, - ), - ], + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState( + () => + noteController.text = "", + ); + }, + ), + ], + ), ), - ), - ) + ) : null, - ), + ), ), ), const SizedBox(height: 20), @@ -1185,10 +1172,9 @@ class _ConfirmTransactionViewState horizontal: 16, vertical: 18, ), - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, child: SelectableText( ref.watch(pAmountFormatter(coin)).format(fee!), style: STextStyles.itemSubtitle(context), @@ -1217,10 +1203,9 @@ class _ConfirmTransactionViewState horizontal: 16, vertical: 18, ), - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, child: SelectableText( "~${fee!.raw.toInt() ~/ widget.txData.vSize!}", style: STextStyles.itemSubtitle(context), @@ -1231,64 +1216,52 @@ class _ConfirmTransactionViewState SizedBox(height: isDesktop ? 23 : 12), if (!widget.isTokenTx) Padding( - padding: - isDesktop - ? const EdgeInsets.symmetric(horizontal: 32) - : const EdgeInsets.all(0), + padding: isDesktop + ? const EdgeInsets.symmetric(horizontal: 32) + : const EdgeInsets.all(0), child: RoundedContainer( - padding: - isDesktop - ? const EdgeInsets.symmetric( - horizontal: 16, - vertical: 18, - ) - : const EdgeInsets.all(12), - color: - Theme.of( - context, - ).extension()!.snackBarBackSuccess, + padding: isDesktop + ? const EdgeInsets.symmetric(horizontal: 16, vertical: 18) + : const EdgeInsets.all(12), + color: Theme.of( + context, + ).extension()!.snackBarBackSuccess, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( isDesktop ? "Total amount to send" : "Total amount", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension()! - .textConfirmTotalAmount, - ) - : STextStyles.titleBold12(context).copyWith( - color: - Theme.of(context) - .extension()! - .textConfirmTotalAmount, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textConfirmTotalAmount, + ) + : STextStyles.titleBold12(context).copyWith( + color: Theme.of(context) + .extension()! + .textConfirmTotalAmount, + ), ), SelectableText( ref .watch(pAmountFormatter(coin)) .format(amountWithoutChange + fee!), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension()! - .textConfirmTotalAmount, - ) - : STextStyles.itemSubtitle12(context).copyWith( - color: - Theme.of(context) - .extension()! - .textConfirmTotalAmount, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textConfirmTotalAmount, + ) + : STextStyles.itemSubtitle12(context).copyWith( + color: Theme.of(context) + .extension()! + .textConfirmTotalAmount, + ), textAlign: TextAlign.right, ), ], @@ -1297,10 +1270,9 @@ class _ConfirmTransactionViewState ), SizedBox(height: isDesktop ? 28 : 16), Padding( - padding: - isDesktop - ? const EdgeInsets.symmetric(horizontal: 32) - : const EdgeInsets.all(0), + padding: isDesktop + ? const EdgeInsets.symmetric(horizontal: 32) + : const EdgeInsets.all(0), child: PrimaryButton( label: "Send", buttonHeight: isDesktop ? ButtonHeight.l : null, @@ -1308,28 +1280,27 @@ class _ConfirmTransactionViewState if (isDesktop) { final unlocked = await showDialog( context: context, - builder: - (context) => DesktopDialog( - maxWidth: 580, - maxHeight: double.infinity, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - const Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [DesktopDialogCloseButton()], - ), - Padding( - padding: const EdgeInsets.only( - left: 32, - right: 32, - bottom: 32, - ), - child: DesktopAuthSend(coin: coin), - ), - ], + builder: (context) => DesktopDialog( + maxWidth: 580, + maxHeight: double.infinity, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [DesktopDialogCloseButton()], ), - ), + Padding( + padding: const EdgeInsets.only( + left: 32, + right: 32, + bottom: 32, + ), + child: DesktopAuthSend(coin: coin), + ), + ], + ), + ), ); if (context.mounted && unlocked is bool) { if (unlocked) { @@ -1350,18 +1321,16 @@ class _ConfirmTransactionViewState RouteGenerator.getRoute( shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, - builder: - (_) => const LockscreenView( - showBackButton: true, - popOnSuccess: true, - routeOnSuccessArguments: true, - routeOnSuccess: "", - biometricsCancelButtonString: "CANCEL", - biometricsLocalizedReason: - "Authenticate to send transaction", - biometricsAuthenticationTitle: - "Confirm Transaction", - ), + builder: (_) => const LockscreenView( + showBackButton: true, + popOnSuccess: true, + routeOnSuccessArguments: true, + routeOnSuccess: "", + biometricsCancelButtonString: "CANCEL", + biometricsLocalizedReason: + "Authenticate to send transaction", + biometricsAuthenticationTitle: "Confirm Transaction", + ), settings: const RouteSettings( name: "/confirmsendlockscreen", ), @@ -1375,10 +1344,9 @@ class _ConfirmTransactionViewState unawaited( showFloatingFlushBar( type: FlushBarType.warning, - message: - Util.isDesktop - ? "Invalid passphrase" - : "Invalid PIN", + message: Util.isDesktop + ? "Invalid passphrase" + : "Invalid PIN", context: context, ), ); diff --git a/lib/utilities/git_status.dart b/lib/utilities/git_status.dart index 9efade7c9a..a6d79f3863 100644 --- a/lib/utilities/git_status.dart +++ b/lib/utilities/git_status.dart @@ -1,13 +1,13 @@ import 'dart:convert'; import 'package:flutter/material.dart'; -import 'package:flutter_libepiccash/git_versions.dart' as epic_versions; import 'package:http/http.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/text_styles.dart'; import '../app_config.dart'; +import '../wl_gen/generated/libepiccash_interface_impl.dart'; import '../wl_gen/interfaces/libmwc_interface.dart'; const kGithubAPI = "https://api.github.com"; @@ -17,7 +17,7 @@ const kGithubHead = "/repos"; enum CommitStatus { isHead, isOldCommit, notACommit, notLoaded } abstract class GitStatus { - static String get epicCashCommit => epic_versions.getPluginVersion(); + static String get epicCashCommit => libEpic.getPluginVersion(); // static String get moneroCommit => monero_versions.getPluginVersion(); static String get mimblewimblecoinCommit => libMwc.getPluginVersion(); diff --git a/lib/wallets/crypto_currency/coins/epiccash.dart b/lib/wallets/crypto_currency/coins/epiccash.dart index b715f9623b..e60f90f6d2 100644 --- a/lib/wallets/crypto_currency/coins/epiccash.dart +++ b/lib/wallets/crypto_currency/coins/epiccash.dart @@ -1,9 +1,8 @@ -import 'package:flutter_libepiccash/lib.dart' as epic; - import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/node_model.dart'; import '../../../utilities/default_nodes.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; +import '../../../wl_gen/interfaces/libepiccash_interface.dart'; import '../crypto_currency.dart'; import '../intermediate/bip39_currency.dart'; @@ -63,7 +62,7 @@ class Epiccash extends Bip39Currency { } } - return epic.LibEpiccash.validateSendAddress(address: address); + return libEpic.validateSendAddress(address: address); } @override @@ -115,10 +114,9 @@ class Epiccash extends Bip39Currency { int get targetBlockTimeSeconds => 60; @override - DerivePathType get defaultDerivePathType => - throw UnsupportedError( - "$runtimeType does not use bitcoin style derivation paths", - ); + DerivePathType get defaultDerivePathType => throw UnsupportedError( + "$runtimeType does not use bitcoin style derivation paths", + ); @override Uri defaultBlockExplorer(String txid) { diff --git a/lib/wallets/wallet/impl/epiccash_wallet.dart b/lib/wallets/wallet/impl/epiccash_wallet.dart index 6f961e2983..a734626f42 100644 --- a/lib/wallets/wallet/impl/epiccash_wallet.dart +++ b/lib/wallets/wallet/impl/epiccash_wallet.dart @@ -3,8 +3,6 @@ import 'dart:convert'; import 'dart:io'; import 'package:decimal/decimal.dart'; -import 'package:flutter_libepiccash/lib.dart' as epiccash; -import 'package:flutter_libepiccash/models/transaction.dart' as epic_models; import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; @@ -33,6 +31,7 @@ import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; import '../../../utilities/test_epic_box_connection.dart'; import '../../../utilities/tor_plain_net_option_enum.dart'; +import '../../../wl_gen/interfaces/libepiccash_interface.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../models/tx_data.dart'; import '../intermediate/bip39_wallet.dart'; @@ -86,10 +85,11 @@ class EpiccashWallet extends Bip39Wallet { Future cancelPendingTransactionAndPost(String txSlateId) async { try { _hackedCheckTorNodePrefs(); - final String wallet = - (await secureStorageInterface.read(key: '${walletId}_wallet'))!; + final String wallet = (await secureStorageInterface.read( + key: '${walletId}_wallet', + ))!; - final result = await epiccash.LibEpiccash.cancelTransaction( + final result = await libEpic.cancelTransaction( wallet: wallet, transactionId: txSlateId, ); @@ -178,7 +178,7 @@ class EpiccashWallet extends Bip39Wallet { _hackedCheckTorNodePrefs(); final available = info.cachedBalance.spendable.raw.toInt(); - final transactionFees = await epiccash.LibEpiccash.getTransactionFees( + final transactionFees = await libEpic.getTransactionFees( wallet: wallet!, amount: satoshiAmount, minimumConfirmations: cryptoCurrency.minConfirms, @@ -187,8 +187,9 @@ class EpiccashWallet extends Bip39Wallet { int realFee = 0; try { - realFee = - (Decimal.parse(transactionFees.fee.toString())).toBigInt().toInt(); + realFee = (Decimal.parse( + transactionFees.fee.toString(), + )).toBigInt().toInt(); } catch (e, s) { //todo: come back to this Logging.instance.e("Error getting fees", error: e, stackTrace: s); @@ -208,7 +209,7 @@ class EpiccashWallet extends Bip39Wallet { if (!syncMutex.isLocked) { await syncMutex.protect(() async { // How does getWalletBalances start syncing???? - await epiccash.LibEpiccash.getWalletBalances( + await libEpic.getWalletBalances( wallet: wallet!, refreshFromNode: refreshFromNode, minimumConfirmations: 10, @@ -231,7 +232,7 @@ class EpiccashWallet extends Bip39Wallet { _hackedCheckTorNodePrefs(); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); const refreshFromNode = 0; - return await epiccash.LibEpiccash.getWalletBalances( + return await libEpic.getWalletBalances( wallet: wallet!, refreshFromNode: refreshFromNode, minimumConfirmations: cryptoCurrency.minConfirms, @@ -329,7 +330,7 @@ class EpiccashWallet extends Bip39Wallet { ) async { final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); - final walletAddress = await epiccash.LibEpiccash.getAddressInfo( + final walletAddress = await libEpic.getAddressInfo( wallet: wallet!, index: index, epicboxConfig: epicboxConfig.toString(), @@ -353,7 +354,7 @@ class EpiccashWallet extends Bip39Wallet { Future _startScans() async { try { //First stop the current listener - epiccash.LibEpiccash.stopEpicboxListener(); + libEpic.stopEpicboxListener(); final wallet = await secureStorageInterface.read( key: '${walletId}_wallet', ); @@ -375,7 +376,7 @@ class EpiccashWallet extends Bip39Wallet { "chainHeight: $chainHeight, lastScannedBlock: $lastScannedBlock", ); - final int nextScannedBlock = await epiccash.LibEpiccash.scanOutputs( + final int nextScannedBlock = await libEpic.scanOutputs( wallet: wallet!, startHeight: lastScannedBlock, numberOfBlocks: scanChunkSize, @@ -408,7 +409,7 @@ class EpiccashWallet extends Bip39Wallet { Logging.instance.d("STARTING WALLET LISTENER ...."); final wallet = await secureStorageInterface.read(key: '${walletId}_wallet'); final EpicBoxConfigModel epicboxConfig = await getEpicBoxConfig(); - epiccash.LibEpiccash.startEpicboxListener( + libEpic.startEpicboxListener( wallet: wallet!, epicboxConfig: epicboxConfig.toString(), ); @@ -492,7 +493,7 @@ class EpiccashWallet extends Bip39Wallet { final String name = walletId; - await epiccash.LibEpiccash.initializeNewWallet( + await libEpic.initializeNewWallet( config: stringConfig, mnemonic: mnemonicString, password: password, @@ -500,7 +501,7 @@ class EpiccashWallet extends Bip39Wallet { ); //Open wallet - encodedWallet = await epiccash.LibEpiccash.openWallet( + encodedWallet = await libEpic.openWallet( config: stringConfig, password: password, ); @@ -542,7 +543,7 @@ class EpiccashWallet extends Bip39Wallet { key: '${walletId}_password', ); - final walletOpen = await epiccash.LibEpiccash.openWallet( + final walletOpen = await libEpic.openWallet( config: config, password: password!, ); @@ -591,7 +592,7 @@ class EpiccashWallet extends Bip39Wallet { if (receiverAddress.startsWith("http://") || receiverAddress.startsWith("https://")) { - transaction = await epiccash.LibEpiccash.txHttpSend( + transaction = await libEpic.txHttpSend( wallet: wallet!, selectionStrategyIsAll: 0, minimumConfirmations: cryptoCurrency.minConfirms, @@ -600,7 +601,7 @@ class EpiccashWallet extends Bip39Wallet { address: txData.recipients!.first.address, ); } else { - transaction = await epiccash.LibEpiccash.createTransaction( + transaction = await libEpic.createTransaction( wallet: wallet!, amount: txData.recipients!.first.amount.raw.toInt(), address: txData.recipients!.first.address, @@ -694,7 +695,7 @@ class EpiccashWallet extends Bip39Wallet { value: epicboxConfig.toString(), ); - await epiccash.LibEpiccash.recoverWallet( + await libEpic.recoverWallet( config: stringConfig, password: password, mnemonic: await getMnemonic(), @@ -717,7 +718,7 @@ class EpiccashWallet extends Bip39Wallet { ); //Open Wallet - final walletOpen = await epiccash.LibEpiccash.openWallet( + final walletOpen = await libEpic.openWallet( config: stringConfig, password: password, ); @@ -905,20 +906,19 @@ class EpiccashWallet extends Bip39Wallet { ); const refreshFromNode = 1; - final myAddresses = - await mainDB - .getAddresses(walletId) - .filter() - .typeEqualTo(AddressType.mimbleWimble) - .and() - .subTypeEqualTo(AddressSubType.receiving) - .and() - .valueIsNotEmpty() - .valueProperty() - .findAll(); + final myAddresses = await mainDB + .getAddresses(walletId) + .filter() + .typeEqualTo(AddressType.mimbleWimble) + .and() + .subTypeEqualTo(AddressSubType.receiving) + .and() + .valueIsNotEmpty() + .valueProperty() + .findAll(); final myAddressesSet = myAddresses.toSet(); - final transactions = await epiccash.LibEpiccash.getTransactions( + final transactions = await libEpic.getTransactions( wallet: wallet!, refreshFromNode: refreshFromNode, ); @@ -929,12 +929,12 @@ class EpiccashWallet extends Bip39Wallet { for (final tx in transactions) { final isIncoming = - tx.txType == epic_models.TransactionType.TxReceived || - tx.txType == epic_models.TransactionType.TxReceivedCancelled; + libEpic.txTypeIsReceived(tx.txType) || + libEpic.txTypeIsReceiveCancelled(tx.txType); final slateId = tx.txSlateId; final commitId = slatesToCommits[slateId]?['commitId'] as String?; - final numberOfMessages = tx.messages?.messages.length; - final onChainNote = tx.messages?.messages[0].message; + final numberOfMessages = tx.messages?.length; + final onChainNote = tx.messages?.first.message; final addressFrom = slatesToCommits[slateId]?["from"] as String?; final addressTo = slatesToCommits[slateId]?["to"] as String?; @@ -994,13 +994,12 @@ class EpiccashWallet extends Bip39Wallet { "slateId": slateId, "onChainNote": onChainNote, "isCancelled": - tx.txType == epic_models.TransactionType.TxSentCancelled || - tx.txType == epic_models.TransactionType.TxReceivedCancelled, - "overrideFee": - Amount( - rawValue: BigInt.from(fee), - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), + libEpic.txTypeIsSentCancelled(tx.txType) || + libEpic.txTypeIsReceiveCancelled(tx.txType), + "overrideFee": Amount( + rawValue: BigInt.from(fee), + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), }; final txn = TransactionV2( @@ -1087,9 +1086,7 @@ class EpiccashWallet extends Bip39Wallet { Future updateChainHeight() async { _hackedCheckTorNodePrefs(); final config = await _getRealConfig(); - final latestHeight = await epiccash.LibEpiccash.getChainHeight( - config: config, - ); + final latestHeight = await libEpic.getChainHeight(config: config); await info.updateCachedChainHeight( newHeight: latestHeight, isar: mainDB.isar, @@ -1132,7 +1129,7 @@ class EpiccashWallet extends Bip39Wallet { @override Future exit() async { - epiccash.LibEpiccash.stopEpicboxListener(); + libEpic.stopEpicboxListener(); timer?.cancel(); timer = null; await super.exit(); @@ -1185,7 +1182,7 @@ Future deleteEpicWallet({ return "Tried to delete non existent epic wallet file with walletId=$walletId"; } else { try { - return epiccash.LibEpiccash.deleteWallet(wallet: wallet, config: config!); + return libEpic.deleteWallet(wallet: wallet, config: config!); } catch (e, s) { Logging.instance.e("$e\n$s", error: e, stackTrace: s); return "deleteEpicWallet($walletId) failed..."; diff --git a/lib/wl_gen/interfaces/libepiccash_interface.dart b/lib/wl_gen/interfaces/libepiccash_interface.dart new file mode 100644 index 0000000000..af5e65375b --- /dev/null +++ b/lib/wl_gen/interfaces/libepiccash_interface.dart @@ -0,0 +1,160 @@ +export '../generated/libepiccash_interface_impl.dart'; + +abstract class LibEpicCashInterface { + const LibEpicCashInterface(); + + bool txTypeIsReceived(Enum value); + bool txTypeIsReceiveCancelled(Enum value); + bool txTypeIsSentCancelled(Enum value); + + Future initializeNewWallet({ + required String config, + required String mnemonic, + required String password, + required String name, + }); + + Future openWallet({required String config, required String password}); + + Future recoverWallet({ + required String config, + required String password, + required String mnemonic, + required String name, + }); + + Future<({String commitId, String slateId})> txHttpSend({ + required String wallet, + required int selectionStrategyIsAll, + required int minimumConfirmations, + required String message, + required int amount, + required String address, + }); + + Future<({String commitId, String slateId})> createTransaction({ + required String wallet, + required int amount, + required String address, + required int secretKeyIndex, + required String epicboxConfig, + required int minimumConfirmations, + required String note, + }); + + Future cancelTransaction({ + required String wallet, + required String transactionId, + }); + + Future> getTransactions({ + required String wallet, + required int refreshFromNode, + }); + + void startEpicboxListener({ + required String wallet, + required String epicboxConfig, + }); + + void stopEpicboxListener(); + + bool validateSendAddress({required String address}); + + Future<({int fee, bool strategyUseAll, int total})> getTransactionFees({ + required String wallet, + required int amount, + required int minimumConfirmations, + required int available, + }); + + Future< + ({ + double awaitingFinalization, + double pending, + double spendable, + double total, + }) + > + getWalletBalances({ + required String wallet, + required int refreshFromNode, + required int minimumConfirmations, + }); + + Future getAddressInfo({ + required String wallet, + required int index, + required String epicboxConfig, + }); + + Future scanOutputs({ + required String wallet, + required int startHeight, + required int numberOfBlocks, + }); + + Future getChainHeight({required String config}); + + Future deleteWallet({required String wallet, required String config}); + + String getPluginVersion(); +} + +class EpicTransaction { + final String parentKeyId; + final int id; + final String? txSlateId; + final Enum txType; + final String creationTs; + final String confirmationTs; + final bool confirmed; + final int numInputs; + final int numOutputs; + final String amountCredited; + final String amountDebited; + final String? fee; + final String? ttlCutoffHeight; + final List? messages; + final String? storedTx; + final String? kernelExcess; + final int? kernelLookupMinHeight; + final String? paymentProof; + + EpicTransaction({ + required this.parentKeyId, + required this.id, + this.txSlateId, + required this.txType, + required this.creationTs, + required this.confirmationTs, + required this.confirmed, + required this.numInputs, + required this.numOutputs, + required this.amountCredited, + required this.amountDebited, + this.fee, + this.ttlCutoffHeight, + this.messages, + this.storedTx, + this.kernelExcess, + this.kernelLookupMinHeight, + this.paymentProof, + }); +} + +class EpicMessage { + final String id; + final String publicKey; + final String? message; + final String? messageSig; + + EpicMessage({ + required this.id, + required this.publicKey, + this.message, + this.messageSig, + }); +} + +class BadHttpAddressException implements Exception {} diff --git a/tool/wl_templates/EPIC_libepiccash_interface_impl.template.dart b/tool/wl_templates/EPIC_libepiccash_interface_impl.template.dart new file mode 100644 index 0000000000..579c322878 --- /dev/null +++ b/tool/wl_templates/EPIC_libepiccash_interface_impl.template.dart @@ -0,0 +1,274 @@ +//ON +import 'package:flutter_libepiccash/git_versions.dart' as epic_versions; +import 'package:flutter_libepiccash/lib.dart'; +import 'package:flutter_libepiccash/models/transaction.dart'; + +//END_ON +import '../interfaces/libepiccash_interface.dart'; + +LibEpicCashInterface get libEpic => _getLib(); + +//OFF +LibEpicCashInterface _getLib() => throw Exception("EPIC not enabled!"); + +//END_OFF +//ON +LibEpicCashInterface _getLib() => const _LibEpicCashInterfaceImpl(); + +final class _LibEpicCashInterfaceImpl extends LibEpicCashInterface { + const _LibEpicCashInterfaceImpl(); + + @override + Future cancelTransaction({ + required String wallet, + required String transactionId, + }) { + return LibEpiccash.cancelTransaction( + wallet: wallet, + transactionId: transactionId, + ); + } + + @override + Future<({String commitId, String slateId})> createTransaction({ + required String wallet, + required int amount, + required String address, + required int secretKeyIndex, + required String epicboxConfig, + required int minimumConfirmations, + required String note, + }) { + return LibEpiccash.createTransaction( + wallet: wallet, + amount: amount, + address: address, + secretKeyIndex: secretKeyIndex, + epicboxConfig: epicboxConfig, + minimumConfirmations: minimumConfirmations, + note: note, + ); + } + + @override + Future deleteWallet({ + required String wallet, + required String config, + }) { + return LibEpiccash.deleteWallet(wallet: wallet, config: config); + } + + @override + Future getAddressInfo({ + required String wallet, + required int index, + required String epicboxConfig, + }) { + return LibEpiccash.getAddressInfo( + wallet: wallet, + index: index, + epicboxConfig: epicboxConfig, + ); + } + + @override + Future getChainHeight({required String config}) { + return LibEpiccash.getChainHeight(config: config); + } + + @override + Future<({int fee, bool strategyUseAll, int total})> getTransactionFees({ + required String wallet, + required int amount, + required int minimumConfirmations, + required int available, + }) { + return LibEpiccash.getTransactionFees( + wallet: wallet, + amount: amount, + minimumConfirmations: minimumConfirmations, + available: available, + ); + } + + @override + Future> getTransactions({ + required String wallet, + required int refreshFromNode, + }) async { + final transactions = await LibEpiccash.getTransactions( + wallet: wallet, + refreshFromNode: refreshFromNode, + ); + + return transactions + .map( + (e) => EpicTransaction( + parentKeyId: e.parentKeyId, + id: e.id, + txType: e.txType, + creationTs: e.creationTs, + confirmationTs: e.confirmationTs, + confirmed: e.confirmed, + numInputs: e.numInputs, + numOutputs: e.numOutputs, + amountCredited: e.amountCredited, + amountDebited: e.amountDebited, + txSlateId: e.txSlateId, + fee: e.fee, + ttlCutoffHeight: e.ttlCutoffHeight, + messages: e.messages?.messages + .map( + (f) => EpicMessage( + id: f.id, + publicKey: f.publicKey, + message: f.message, + messageSig: f.messageSig, + ), + ) + .toList(), + storedTx: e.storedTx, + kernelExcess: e.kernelExcess, + kernelLookupMinHeight: e.kernelLookupMinHeight, + paymentProof: e.paymentProof, + ), + ) + .toList(); + } + + @override + Future< + ({ + double awaitingFinalization, + double pending, + double spendable, + double total, + }) + > + getWalletBalances({ + required String wallet, + required int refreshFromNode, + required int minimumConfirmations, + }) { + return LibEpiccash.getWalletBalances( + wallet: wallet, + refreshFromNode: refreshFromNode, + minimumConfirmations: minimumConfirmations, + ); + } + + @override + Future initializeNewWallet({ + required String config, + required String mnemonic, + required String password, + required String name, + }) { + return LibEpiccash.initializeNewWallet( + config: config, + mnemonic: mnemonic, + password: password, + name: name, + ); + } + + @override + Future openWallet({ + required String config, + required String password, + }) { + return LibEpiccash.openWallet(config: config, password: password); + } + + @override + Future recoverWallet({ + required String config, + required String password, + required String mnemonic, + required String name, + }) { + return LibEpiccash.recoverWallet( + config: config, + password: password, + mnemonic: mnemonic, + name: name, + ); + } + + @override + Future scanOutputs({ + required String wallet, + required int startHeight, + required int numberOfBlocks, + }) { + return LibEpiccash.scanOutputs( + wallet: wallet, + startHeight: startHeight, + numberOfBlocks: numberOfBlocks, + ); + } + + @override + void startEpicboxListener({ + required String wallet, + required String epicboxConfig, + }) { + return LibEpiccash.startEpicboxListener( + wallet: wallet, + epicboxConfig: epicboxConfig, + ); + } + + @override + void stopEpicboxListener() { + return LibEpiccash.stopEpicboxListener(); + } + + @override + Future<({String commitId, String slateId})> txHttpSend({ + required String wallet, + required int selectionStrategyIsAll, + required int minimumConfirmations, + required String message, + required int amount, + required String address, + }) { + try { + return LibEpiccash.txHttpSend( + wallet: wallet, + selectionStrategyIsAll: selectionStrategyIsAll, + minimumConfirmations: minimumConfirmations, + message: message, + amount: amount, + address: address, + ); + } on BadEpicHttpAddressException catch (_) { + throw BadHttpAddressException(); + } + } + + @override + bool txTypeIsReceiveCancelled(Enum value) { + return value == TransactionType.TxReceivedCancelled; + } + + @override + bool txTypeIsReceived(Enum value) { + return value == TransactionType.TxReceived; + } + + @override + bool txTypeIsSentCancelled(Enum value) { + return value == TransactionType.TxSentCancelled; + } + + @override + bool validateSendAddress({required String address}) { + return LibEpiccash.validateSendAddress(address: address); + } + + @override + String getPluginVersion() => epic_versions.getPluginVersion(); +} + +//END_ON From df966bd28538d0c698c913e9bc1ca3209428faae Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Oct 2025 11:01:23 -0600 Subject: [PATCH 130/178] fix mwc usage --- .../crypto_currency/coins/mimblewimblecoin.dart | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart index 6d670d5ff6..c9d57878a0 100644 --- a/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart +++ b/lib/wallets/crypto_currency/coins/mimblewimblecoin.dart @@ -1,10 +1,9 @@ -import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin; - import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/node_model.dart'; import '../../../utilities/default_nodes.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; import '../../../utilities/enums/mwc_transaction_method.dart'; +import '../../../wl_gen/interfaces/libmwc_interface.dart'; import '../crypto_currency.dart'; import '../intermediate/bip39_currency.dart'; @@ -54,7 +53,7 @@ class Mimblewimblecoin extends Bip39Currency { @override bool validateAddress(String address) { // Use libmwc for address validation. - return mimblewimblecoin.Libmwc.validateSendAddress(address: address); + return libMwc.validateSendAddress(address: address); } /// Check if data is a slatepack. @@ -134,10 +133,9 @@ class Mimblewimblecoin extends Bip39Currency { int get targetBlockTimeSeconds => 60; @override - DerivePathType get defaultDerivePathType => - throw UnsupportedError( - "$runtimeType does not use bitcoin style derivation paths", - ); + DerivePathType get defaultDerivePathType => throw UnsupportedError( + "$runtimeType does not use bitcoin style derivation paths", + ); @override Uri defaultBlockExplorer(String txid) { From c51e78427f13c43dc3f8e57ee32fb93e7c70f64a Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Oct 2025 11:01:42 -0600 Subject: [PATCH 131/178] fix package import --- .../transaction_details_view.dart | 1508 ++++++++--------- 1 file changed, 699 insertions(+), 809 deletions(-) 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 e1b2c89f0e..1e3aa7c729 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -16,7 +16,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:stackwallet/wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import 'package:tuple/tuple.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -39,6 +38,7 @@ import '../../../wallets/crypto_currency/crypto_currency.dart'; import '../../../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; +import '../../../wallets/wallet/impl/mimblewimblecoin_wallet.dart'; import '../../../widgets/background.dart'; import '../../../widgets/conditional_parent.dart'; import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; @@ -100,12 +100,11 @@ class _TransactionDetailsViewState isTokenTx = _transaction.subType == TransactionSubType.ethToken; walletId = widget.walletId; - minConfirms = - ref - .read(pWallets) - .getWallet(widget.walletId) - .cryptoCurrency - .minConfirms; + minConfirms = ref + .read(pWallets) + .getWallet(widget.walletId) + .cryptoCurrency + .minConfirms; coin = widget.coin; amount = _transaction.realAmount; fee = _transaction.fee.toAmountAsRaw(fractionDigits: coin.fractionDigits); @@ -116,12 +115,9 @@ class _TransactionDetailsViewState amountPrefix = _transaction.type == TransactionType.outgoing ? "-" : "+"; } - ethContract = - isTokenTx - ? ref - .read(mainDBProvider) - .getEthContractSync(_transaction.otherData!) - : null; + ethContract = isTokenTx + ? ref.read(mainDBProvider).getEthContractSync(_transaction.otherData!) + : null; unit = isTokenTx ? ethContract!.symbol : coin.ticker; @@ -217,10 +213,9 @@ class _TransactionDetailsViewState .read(addressBookServiceProvider) .contacts .where( - (element) => - element.addresses - .where((element) => element.address == address) - .isNotEmpty, + (element) => element.addresses + .where((element) => element.address == address) + .isNotEmpty, ); if (contacts.isNotEmpty) { return contacts.first.name; @@ -256,8 +251,9 @@ class _TransactionDetailsViewState onChanged: (value) { if (value is bool) { ref - .read(prefsChangeNotifierProvider) - .hideBlockExplorerWarning = value; + .read(prefsChangeNotifierProvider) + .hideBlockExplorerWarning = + value; setState(() {}); } }, @@ -277,10 +273,9 @@ class _TransactionDetailsViewState child: Text( "Cancel", style: STextStyles.button(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), ), ), @@ -319,8 +314,9 @@ class _TransactionDetailsViewState onChanged: (value) { if (value is bool) { ref - .read(prefsChangeNotifierProvider) - .hideBlockExplorerWarning = value; + .read(prefsChangeNotifierProvider) + .hideBlockExplorerWarning = + value; setState(() {}); } }, @@ -383,10 +379,9 @@ class _TransactionDetailsViewState )) { price = ref.watch( priceAnd24hChangeNotifierProvider.select( - (value) => - isTokenTx - ? value.getTokenPrice(_transaction.otherData!)?.value - : value.getPrice(coin)?.value, + (value) => isTokenTx + ? value.getTokenPrice(_transaction.otherData!)?.value + : value.getPrice(coin)?.value, ), ); } @@ -395,38 +390,36 @@ class _TransactionDetailsViewState condition: !isDesktop, builder: (child) => Background(child: child), child: Scaffold( - backgroundColor: - isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.background, - appBar: - isDesktop - ? null - : AppBar( - backgroundColor: - Theme.of(context).extension()!.background, - leading: AppBarBackButton( - onPressed: () async { - // if (FocusScope.of(context).hasFocus) { - // FocusScope.of(context).unfocus(); - // await Future.delayed(Duration(milliseconds: 50)); - // } - Navigator.of(context).pop(); - }, - ), - title: Text( - "Transaction details", - style: STextStyles.navBarTitle(context), - ), + backgroundColor: isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.background, + appBar: isDesktop + ? null + : AppBar( + backgroundColor: Theme.of( + context, + ).extension()!.background, + leading: AppBarBackButton( + onPressed: () async { + // if (FocusScope.of(context).hasFocus) { + // FocusScope.of(context).unfocus(); + // await Future.delayed(Duration(milliseconds: 50)); + // } + Navigator.of(context).pop(); + }, + ), + title: Text( + "Transaction details", + style: STextStyles.navBarTitle(context), ), + ), body: ConditionalParent( condition: !isDesktop, builder: (child) => SafeArea(child: child), child: Padding( - padding: - isDesktop - ? const EdgeInsets.only(left: 32) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.only(left: 32) + : const EdgeInsets.all(12), child: Column( children: [ if (isDesktop) @@ -442,20 +435,18 @@ class _TransactionDetailsViewState ), Expanded( child: Padding( - padding: - isDesktop - ? const EdgeInsets.only(right: 32, bottom: 32) - : const EdgeInsets.all(0), + padding: isDesktop + ? const EdgeInsets.only(right: 32, bottom: 32) + : const EdgeInsets.all(0), child: ConditionalParent( condition: isDesktop, builder: (child) { return RoundedWhiteContainer( - borderColor: - isDesktop - ? Theme.of( - context, - ).extension()!.backgroundAppBar - : null, + borderColor: isDesktop + ? Theme.of( + context, + ).extension()!.backgroundAppBar + : null, padding: const EdgeInsets.all(0), child: child, ); @@ -463,40 +454,35 @@ class _TransactionDetailsViewState child: SingleChildScrollView( primary: isDesktop ? false : null, child: Padding( - padding: - isDesktop - ? const EdgeInsets.all(0) - : const EdgeInsets.all(4), + padding: isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(4), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(0) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(12), child: Container( - decoration: - isDesktop - ? BoxDecoration( - color: - Theme.of(context) - .extension()! - .backgroundAppBar, - borderRadius: BorderRadius.vertical( - top: Radius.circular( - Constants - .size - .circularBorderRadius, - ), + decoration: isDesktop + ? BoxDecoration( + color: Theme.of(context) + .extension()! + .backgroundAppBar, + borderRadius: BorderRadius.vertical( + top: Radius.circular( + Constants + .size + .circularBorderRadius, ), - ) - : null, + ), + ) + : null, child: Padding( - padding: - isDesktop - ? const EdgeInsets.all(12) - : const EdgeInsets.all(0), + padding: isDesktop + ? const EdgeInsets.all(12) + : const EdgeInsets.all(0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -513,12 +499,12 @@ class _TransactionDetailsViewState SelectableText( _transaction.isCancelled ? coin is Ethereum - ? "Failed" - : "Cancelled" + ? "Failed" + : "Cancelled" : whatIsIt( - _transaction, - currentHeight, - ), + _transaction, + currentHeight, + ), style: STextStyles.desktopTextMedium( context, @@ -527,41 +513,37 @@ class _TransactionDetailsViewState ], ), Column( - crossAxisAlignment: - isDesktop - ? CrossAxisAlignment.end - : CrossAxisAlignment.start, + crossAxisAlignment: isDesktop + ? CrossAxisAlignment.end + : CrossAxisAlignment.start, children: [ SelectableText( "$amountPrefix${ref.watch(pAmountFormatter(coin)).format(amount, ethContract: ethContract)}", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.titleBold12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.titleBold12( + context, + ), ), const SizedBox(height: 2), if (price != null) SelectableText( "$amountPrefix${(amount.decimal * price).toAmount(fractionDigits: 2).fiatString(locale: ref.watch(localeServiceChangeNotifierProvider.select((value) => value.locale)))} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), ], ), @@ -581,24 +563,20 @@ class _TransactionDetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "Status", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle(context), ), // Flexible( // child: FittedBox( @@ -607,35 +585,31 @@ class _TransactionDetailsViewState SelectableText( _transaction.isCancelled ? coin is Ethereum - ? "Failed" - : "Cancelled" + ? "Failed" + : "Cancelled" : whatIsIt( - _transaction, - currentHeight, - ), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - _transaction.type == - TransactionType - .outgoing - ? Theme.of(context) - .extension< - StackColors - >()! - .accentColorOrange - : Theme.of(context) - .extension< - StackColors - >()! - .accentColorGreen, - ) - : STextStyles.itemSubtitle12( - context, - ), + _transaction, + currentHeight, + ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + _transaction.type == + TransactionType.outgoing + ? Theme.of(context) + .extension< + StackColors + >()! + .accentColorOrange + : Theme.of(context) + .extension< + StackColors + >()! + .accentColorGreen, + ) + : STextStyles.itemSubtitle12(context), ), // ), // ), @@ -658,10 +632,9 @@ class _TransactionDetailsViewState _transaction.subType == TransactionSubType.mint)) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -688,24 +661,19 @@ class _TransactionDetailsViewState if (isDesktop) { showDialog( context: context, - builder: - ( - _, - ) => DesktopDialog( - maxHeight: - double - .infinity, - child: AddressDetailsView( - addressId: - _transaction - .address - .value! - .id, - walletId: - widget - .walletId, - ), - ), + builder: (_) => DesktopDialog( + maxHeight: double + .infinity, + child: AddressDetailsView( + addressId: + _transaction + .address + .value! + .id, + walletId: widget + .walletId, + ), + ), ); } else { Navigator.of( @@ -732,74 +700,70 @@ class _TransactionDetailsViewState TransactionType.outgoing ? "Sent to" : "Receiving address", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), ), const SizedBox(height: 8), _transaction.type == TransactionType.incoming ? FutureBuilder( - future: fetchContactNameFor( - _transaction - .address - .value! - .value, - ), - builder: ( - builderContext, - AsyncSnapshot - snapshot, - ) { - String - addressOrContactName = - _transaction - .address - .value! - .value; - if (snapshot.connectionState == - ConnectionState - .done && - snapshot.hasData) { - addressOrContactName = - snapshot.data!; - } - return SelectableText( - addressOrContactName, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) + future: fetchContactNameFor( + _transaction + .address + .value! + .value, + ), + builder: + ( + builderContext, + AsyncSnapshot + snapshot, + ) { + String + addressOrContactName = + _transaction + .address + .value! + .value; + if (snapshot.connectionState == + ConnectionState + .done && + snapshot + .hasData) { + addressOrContactName = + snapshot.data!; + } + return SelectableText( + addressOrContactName, + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) .extension< StackColors >()! .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), - ); - }, - ) + ) + : STextStyles.itemSubtitle12( + context, + ), + ); + }, + ) : SelectableText( - _transaction - .address - .value! - .value, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( + _transaction + .address + .value! + .value, + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( context, ).copyWith( color: @@ -811,10 +775,10 @@ class _TransactionDetailsViewState >()! .textDark, ) - : STextStyles.itemSubtitle12( + : STextStyles.itemSubtitle12( context, ), - ), + ), ], ), ), @@ -832,10 +796,9 @@ class _TransactionDetailsViewState : const SizedBox(height: 12), if (coin is Epiccash) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -849,33 +812,30 @@ class _TransactionDetailsViewState children: [ Text( "On chain note", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), const SizedBox(height: 8), SelectableText( _transaction.otherData ?? "", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -891,10 +851,9 @@ class _TransactionDetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -906,66 +865,67 @@ class _TransactionDetailsViewState (coin is Epiccash) ? "Local Note" : "Note ", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), isDesktop ? IconPencilButton( - onPressed: () { - showDialog( - context: context, - builder: (context) { - return DesktopDialog( - maxWidth: 580, - maxHeight: 360, - child: EditNoteView( - txid: _transaction.txid, - walletId: walletId, - ), - ); - }, - ); - }, - ) + onPressed: () { + showDialog( + context: context, + builder: (context) { + return DesktopDialog( + maxWidth: 580, + maxHeight: 360, + child: EditNoteView( + txid: + _transaction.txid, + walletId: walletId, + ), + ); + }, + ); + }, + ) : GestureDetector( - onTap: () { - Navigator.of(context).pushNamed( - EditNoteView.routeName, - arguments: Tuple2( - _transaction.txid, - walletId, - ), - ); - }, - child: Row( - children: [ - SvgPicture.asset( - Assets.svg.pencil, - width: 10, - height: 10, - color: - Theme.of(context) - .extension< - StackColors - >()! - .infoItemIcons, - ), - const SizedBox(width: 4), - Text( - "Edit", - style: STextStyles.link2( - context, + onTap: () { + Navigator.of( + context, + ).pushNamed( + EditNoteView.routeName, + arguments: Tuple2( + _transaction.txid, + walletId, ), - ), - ], + ); + }, + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.pencil, + width: 10, + height: 10, + color: Theme.of(context) + .extension< + StackColors + >()! + .infoItemIcons, + ), + const SizedBox(width: 4), + Text( + "Edit", + style: STextStyles.link2( + context, + ), + ), + ], + ), ), - ), ], ), const SizedBox(height: 8), @@ -979,21 +939,15 @@ class _TransactionDetailsViewState ) ?.value ?? "", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12(context), ), ], ), @@ -1002,10 +956,9 @@ class _TransactionDetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -1017,14 +970,13 @@ class _TransactionDetailsViewState children: [ Text( "Date", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1033,21 +985,19 @@ class _TransactionDetailsViewState Format.extractDateFrom( _transaction.timestamp, ), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1056,21 +1006,17 @@ class _TransactionDetailsViewState Format.extractDateFrom( _transaction.timestamp, ), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton( @@ -1087,19 +1033,17 @@ class _TransactionDetailsViewState : const SizedBox(height: 12), if (coin is! NanoCurrency) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Builder( builder: (context) { - final String feeString = - showFeePending - ? _transaction.isConfirmed( - currentHeight, - minConfirms, - ) - ? ref + final String feeString = showFeePending + ? _transaction.isConfirmed( + currentHeight, + minConfirms, + ) + ? ref .watch( pAmountFormatter(coin), ) @@ -1107,13 +1051,13 @@ class _TransactionDetailsViewState fee, withUnitName: isTokenTx, ) - : "Pending" - : ref - .watch(pAmountFormatter(coin)) - .format( - fee, - withUnitName: isTokenTx, - ); + : "Pending" + : ref + .watch(pAmountFormatter(coin)) + .format( + fee, + withUnitName: isTokenTx, + ); return Row( mainAxisAlignment: @@ -1127,58 +1071,52 @@ class _TransactionDetailsViewState children: [ Text( "Transaction fee", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), - ), - if (isDesktop) - const SizedBox(height: 2), - if (isDesktop) + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + 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, - ), + 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< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: feeString), @@ -1201,9 +1139,9 @@ class _TransactionDetailsViewState widget.coin is Ecash) { height = _transaction.height != null && - _transaction.height! > 0 - ? "${_transaction.height!}" - : "Pending"; + _transaction.height! > 0 + ? "${_transaction.height!}" + : "Pending"; confirmations = confirms.toString(); } else if (widget.coin is Epiccash && _transaction.slateId == null) { @@ -1218,10 +1156,9 @@ class _TransactionDetailsViewState height = "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; } else { - height = - confirms > 0 - ? "${_transaction.height}" - : "Pending"; + height = confirms > 0 + ? "${_transaction.height}" + : "Pending"; } confirmations = confirms.toString(); @@ -1230,10 +1167,9 @@ class _TransactionDetailsViewState return Column( children: [ RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -1246,58 +1182,54 @@ class _TransactionDetailsViewState children: [ Text( "Block height", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), if (isDesktop) SelectableText( height, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), if (!isDesktop) SelectableText( height, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: height), @@ -1308,10 +1240,9 @@ class _TransactionDetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -1324,58 +1255,54 @@ class _TransactionDetailsViewState children: [ Text( "Confirmations", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), if (isDesktop) SelectableText( confirmations, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), if (!isDesktop) SelectableText( confirmations, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: height), @@ -1392,10 +1319,9 @@ class _TransactionDetailsViewState : const SizedBox(height: 12), if (coin is Ethereum) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -1404,32 +1330,25 @@ class _TransactionDetailsViewState children: [ Text( "Nonce", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle(context), ), SelectableText( _transaction.nonce.toString(), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1440,10 +1359,9 @@ class _TransactionDetailsViewState : const SizedBox(height: 12), if (kDebugMode) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -1452,32 +1370,25 @@ class _TransactionDetailsViewState children: [ Text( "Tx sub type", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle(context), ), SelectableText( _transaction.subType.toString(), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1486,10 +1397,9 @@ class _TransactionDetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: @@ -1502,14 +1412,13 @@ class _TransactionDetailsViewState children: [ Text( "Transaction ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), const SizedBox(height: 8), // Flexible( @@ -1518,21 +1427,19 @@ class _TransactionDetailsViewState // child: SelectableText( _transaction.txid, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (coin is! Epiccash) const SizedBox(height: 8), @@ -1570,28 +1477,24 @@ class _TransactionDetailsViewState try { await launchUrl( uri, - mode: - LaunchMode - .externalApplication, + mode: LaunchMode + .externalApplication, ); } catch (_) { if (context.mounted) { unawaited( showDialog( context: context, - builder: - ( - _, - ) => StackOkDialog( - title: - "Could not open in block explorer", - message: - "Failed to open \"${uri.toString()}\"", - maxWidth: - Util.isDesktop - ? 400 - : null, - ), + builder: (_) => StackOkDialog( + title: + "Could not open in block explorer", + message: + "Failed to open \"${uri.toString()}\"", + maxWidth: + Util.isDesktop + ? 400 + : null, + ), ), ); } @@ -1701,10 +1604,9 @@ class _TransactionDetailsViewState : const SizedBox(height: 12), if (coin is Epiccash) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -1717,14 +1619,13 @@ class _TransactionDetailsViewState children: [ Text( "Slate ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), // Flexible( // child: FittedBox( @@ -1732,21 +1633,19 @@ class _TransactionDetailsViewState // child: SelectableText( _transaction.slateId ?? "Unknown", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), // ), // ), @@ -1776,165 +1675,154 @@ class _TransactionDetailsViewState floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: ((coin is Epiccash || coin is Mimblewimblecoin) && - _transaction.getConfirmations(currentHeight) < 1 && - _transaction.isCancelled == false) - ? ConditionalParent( - condition: isDesktop, - builder: - (child) => Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 16, - ), - child: child, - ), - child: SizedBox( - width: MediaQuery.of(context).size.width - 32, - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Theme.of(context).extension()!.textError, - ), + _transaction.getConfirmations(currentHeight) < 1 && + _transaction.isCancelled == false) + ? ConditionalParent( + condition: isDesktop, + builder: (child) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: 32, + vertical: 16, + ), + child: child, + ), + child: SizedBox( + width: MediaQuery.of(context).size.width - 32, + child: TextButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + Theme.of(context).extension()!.textError, ), - onPressed: () async { - final wallet = ref.read(pWallets).getWallet(walletId); - - if (wallet is EpiccashWallet) { - final String? id = _transaction.slateId; - if (id == null) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Could not find Epic transaction ID", - context: context, - ), - ); - return; - } + ), + onPressed: () async { + final wallet = ref.read(pWallets).getWallet(walletId); + if (wallet is EpiccashWallet) { + final String? id = _transaction.slateId; + if (id == null) { unawaited( - showDialog( - barrierDismissible: false, + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Could not find Epic transaction ID", context: context, - builder: - (_) => - const CancellingTransactionProgressDialog(), ), ); + return; + } - final result = await wallet - .cancelPendingTransactionAndPost(id); + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: (_) => + const CancellingTransactionProgressDialog(), + ), + ); - if (context.mounted) { - // pop progress dialog - Navigator.of(context).pop(); + final result = await wallet + .cancelPendingTransactionAndPost(id); - if (result.isEmpty) { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Transaction cancelled", - maxWidth: Util.isDesktop ? 400 : null, - onOkPressed: (_) { - Navigator.of(context).popUntil( - ModalRoute.withName( - WalletView.routeName, - ), - ); - }, - ), - ); - } else { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Failed to cancel transaction", - message: result, - maxWidth: Util.isDesktop ? 400 : null, - ), - ); - } - } - } else if (wallet is MimblewimblecoinWallet) { - final String? id = _transaction.slateId; - if (id == null) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Could not find MWC transaction ID", - context: context, + if (context.mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Transaction cancelled", + maxWidth: Util.isDesktop ? 400 : null, + onOkPressed: (_) { + Navigator.of(context).popUntil( + ModalRoute.withName(WalletView.routeName), + ); + }, ), ); - return; - } - - unawaited( - showDialog( - barrierDismissible: false, + } else { + await showDialog( context: context, - builder: - (_) => - const CancellingTransactionProgressDialog(), - ), - ); - - final result = await wallet - .cancelPendingTransactionAndPost(id); - - if (context.mounted) { - // pop progress dialog - Navigator.of(context).pop(); - - if (result.isEmpty) { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Transaction cancelled", - maxWidth: Util.isDesktop ? 400 : null, - onOkPressed: (_) { - Navigator.of(context).popUntil( - ModalRoute.withName( - WalletView.routeName, - ), - ); - }, - ), - ); - } else { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Failed to cancel transaction", - message: result, - maxWidth: Util.isDesktop ? 400 : null, - ), - ); - } + builder: (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + maxWidth: Util.isDesktop ? 400 : null, + ), + ); } - } else { + } + } else if (wallet is MimblewimblecoinWallet) { + final String? id = _transaction.slateId; + if (id == null) { unawaited( showFloatingFlushBar( type: FlushBarType.warning, - message: - "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", + message: "Could not find MWC transaction ID", context: context, ), ); return; } - }, - child: Text( - "Cancel Transaction", - style: STextStyles.button(context), - ), + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = await wallet + .cancelPendingTransactionAndPost(id); + + if (context.mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Transaction cancelled", + maxWidth: Util.isDesktop ? 400 : null, + onOkPressed: (_) { + Navigator.of(context).popUntil( + ModalRoute.withName(WalletView.routeName), + ); + }, + ), + ); + } else { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + maxWidth: Util.isDesktop ? 400 : null, + ), + ); + } + } + } else { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: + "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", + context: context, + ), + ); + return; + } + }, + child: Text( + "Cancel Transaction", + style: STextStyles.button(context), ), ), - ) - : null, + ), + ) + : null, ), ); } @@ -1963,8 +1851,9 @@ class IconCopyButton extends StatelessWidget { height: 26, width: 26, child: RawMaterialButton( - fillColor: - Theme.of(context).extension()!.buttonBackSecondary, + fillColor: Theme.of( + context, + ).extension()!.buttonBackSecondary, elevation: 0, hoverElevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), @@ -2004,8 +1893,9 @@ class IconPencilButton extends StatelessWidget { height: 26, width: 26, child: RawMaterialButton( - fillColor: - Theme.of(context).extension()!.buttonBackSecondary, + fillColor: Theme.of( + context, + ).extension()!.buttonBackSecondary, elevation: 0, hoverElevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), From 69d143c26c4f25de3253de527955b7d60af65614 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Oct 2025 14:49:28 -0600 Subject: [PATCH 132/178] implement optional import of frostdart --- .../new/create_new_frost_ms_wallet_view.dart | 98 +-- .../new/steps/frost_create_step_1a.dart | 89 +- .../new/steps/frost_create_step_1b.dart | 48 +- .../new/steps/frost_create_step_2.dart | 55 +- .../new/steps/frost_create_step_3.dart | 34 +- .../new/steps/frost_create_step_5.dart | 44 +- .../reshare/frost_reshare_step_1a.dart | 91 +- .../reshare/frost_reshare_step_1b.dart | 49 +- .../reshare/frost_reshare_step_2abd.dart | 55 +- .../reshare/frost_reshare_step_2c.dart | 21 +- .../reshare/frost_reshare_step_3abd.dart | 54 +- .../reshare/frost_reshare_step_4.dart | 64 +- .../restore/restore_frost_ms_wallet_view.dart | 375 +++++---- .../send_steps/frost_send_step_1b.dart | 66 +- .../send_steps/frost_send_step_2.dart | 102 +-- .../send_steps/frost_send_step_3.dart | 44 +- .../helpers/restore_create_backup.dart | 101 ++- .../complete_reshare_config_view.dart | 120 ++- .../frost_wallet/frost_wallet_providers.dart | 87 +- .../wallet/impl/bitcoin_frost_wallet.dart | 334 ++++---- lib/wl_gen/interfaces/frost_interface.dart | 237 ++++++ .../FROST_frost_interface_impl.template.dart | 796 ++++++++++-------- 22 files changed, 1496 insertions(+), 1468 deletions(-) create mode 100644 lib/wl_gen/interfaces/frost_interface.dart rename lib/services/frost.dart => tool/wl_templates/FROST_frost_interface_impl.template.dart (64%) diff --git a/lib/pages/add_wallet_views/frost_ms/new/create_new_frost_ms_wallet_view.dart b/lib/pages/add_wallet_views/frost_ms/new/create_new_frost_ms_wallet_view.dart index a97c7b7859..74c31d872b 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/create_new_frost_ms_wallet_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/create_new_frost_ms_wallet_view.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; + import '../../../../frost_route_generator.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../services/frost.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; @@ -20,6 +20,7 @@ import '../../../../widgets/frost_mascot.dart'; import '../../../../widgets/frost_scaffold.dart'; import '../../../../widgets/rounded_white_container.dart'; import '../../../../widgets/stack_dialog.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; class CreateNewFrostMsWalletView extends ConsumerStatefulWidget { const CreateNewFrostMsWalletView({ @@ -114,31 +115,22 @@ class _NewFrostMsWalletViewState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "What is a threshold?", - style: STextStyles.w600_20(context), - ), - const SizedBox( - height: 12, - ), + Text("What is a threshold?", style: STextStyles.w600_20(context)), + const SizedBox(height: 12), Text( "A threshold is the amount of people required to perform an " "action. This does not have to be the same number as the " "total number in the group.", style: STextStyles.w400_16(context), ), - const SizedBox( - height: 6, - ), + const SizedBox(height: 6), Text( "For example, if you have 3 people in the group, but a threshold " "of 2, then you only need 2 out of the 3 people to sign for an " "action to take place.", style: STextStyles.w400_16(context), ), - const SizedBox( - height: 6, - ), + const SizedBox(height: 6), Text( "Conversely if you have a group of 3 AND a threshold of 3, you " "will need all 3 people in the group to sign to approve any " @@ -177,17 +169,15 @@ class _NewFrostMsWalletViewState 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', ), ), - body: SizedBox( - width: 480, - child: child, - ), + body: SizedBox(width: 480, child: child), ), child: ConditionalParent( condition: !Util.isDesktop, builder: (child) => Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of( + context, + ).extension()!.background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -229,8 +219,9 @@ class _NewFrostMsWalletViewState Text( "Threshold", style: STextStyles.w500_14(context).copyWith( - color: - Theme.of(context).extension()!.textDark3, + color: Theme.of( + context, + ).extension()!.textDark3, ), ), CustomTextButton( @@ -239,9 +230,7 @@ class _NewFrostMsWalletViewState ), ], ), - const SizedBox( - height: 10, - ), + const SizedBox(height: 10), TextField( keyboardType: TextInputType.number, inputFormatters: [FilteringTextInputFormatter.digitsOnly], @@ -251,18 +240,14 @@ class _NewFrostMsWalletViewState hintStyle: STextStyles.fieldLabel(context), ), ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), Text( "Number of participants", style: STextStyles.w500_14(context).copyWith( color: Theme.of(context).extension()!.textDark3, ), ), - const SizedBox( - height: 10, - ), + const SizedBox(height: 10), Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, @@ -277,9 +262,7 @@ class _NewFrostMsWalletViewState hintStyle: STextStyles.fieldLabel(context), ), ), - const SizedBox( - height: 6, - ), + const SizedBox(height: 6), Row( children: [ Expanded( @@ -294,9 +277,7 @@ class _NewFrostMsWalletViewState ), ], ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), if (controllers.isNotEmpty) Text( "My name", @@ -304,10 +285,7 @@ class _NewFrostMsWalletViewState color: Theme.of(context).extension()!.textDark3, ), ), - if (controllers.isNotEmpty) - const SizedBox( - height: 10, - ), + if (controllers.isNotEmpty) const SizedBox(height: 10), if (controllers.isNotEmpty) Column( mainAxisSize: MainAxisSize.min, @@ -320,9 +298,7 @@ class _NewFrostMsWalletViewState hintStyle: STextStyles.fieldLabel(context), ), ), - const SizedBox( - height: 6, - ), + const SizedBox(height: 6), Row( children: [ Expanded( @@ -337,10 +313,7 @@ class _NewFrostMsWalletViewState ), ], ), - if (controllers.length > 1) - const SizedBox( - height: 16, - ), + if (controllers.length > 1) const SizedBox(height: 16), if (controllers.length > 1) Column( mainAxisSize: MainAxisSize.min, @@ -349,13 +322,12 @@ class _NewFrostMsWalletViewState Text( "Remaining participants", style: STextStyles.w500_14(context).copyWith( - color: - Theme.of(context).extension()!.textDark3, + color: Theme.of( + context, + ).extension()!.textDark3, ), ), - const SizedBox( - height: 6, - ), + const SizedBox(height: 6), Row( children: [ Expanded( @@ -375,9 +347,7 @@ class _NewFrostMsWalletViewState children: [ for (int i = 1; i < controllers.length; i++) Padding( - padding: const EdgeInsets.only( - top: 10, - ), + padding: const EdgeInsets.only(top: 10), child: TextField( controller: controllers[i], decoration: InputDecoration( @@ -389,9 +359,7 @@ class _NewFrostMsWalletViewState ], ), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Create new group", onPressed: () async { @@ -411,14 +379,14 @@ class _NewFrostMsWalletViewState ); } - final config = Frost.createMultisigConfig( + final config = frostInterface.createMultisigConfig( name: controllers.first.text.trim(), threshold: int.parse(_thresholdController.text), participants: controllers.map((e) => e.text.trim()).toList(), ); - ref.read(pFrostMyName.notifier).state = - controllers.first.text.trim(); + ref.read(pFrostMyName.notifier).state = controllers.first.text + .trim(); ref.read(pFrostMultisigConfig.notifier).state = config; ref.read(pFrostScaffoldArgs.state).state = ( @@ -434,9 +402,9 @@ class _NewFrostMsWalletViewState callerRouteName: CreateNewFrostMsWalletView.routeName, ); - await Navigator.of(context).pushNamed( - FrostStepScaffold.routeName, - ); + await Navigator.of( + context, + ).pushNamed(FrostStepScaffold.routeName); }, ), ], diff --git a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_1a.dart b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_1a.dart index 7b9efb7aa8..5273014115 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_1a.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_1a.dart @@ -4,7 +4,6 @@ import 'package:flutter_svg/flutter_svg.dart'; import '../../../../../frost_route_generator.dart'; import '../../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../../services/frost.dart'; import '../../../../../themes/stack_colors.dart'; import '../../../../../utilities/assets.dart'; import '../../../../../utilities/text_styles.dart'; @@ -17,6 +16,7 @@ import '../../../../../widgets/detail_item.dart'; import '../../../../../widgets/dialogs/simple_mobile_dialog.dart'; import '../../../../../widgets/frost_step_user_steps.dart'; import '../../../../../widgets/qr.dart'; +import '../../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../../wallet_view/transaction_views/transaction_details_view.dart'; class FrostCreateStep1a extends ConsumerStatefulWidget { @@ -41,7 +41,7 @@ class _FrostCreateStep1aState extends ConsumerState { bool _userVerifyContinue = false; void _showParticipantsDialog() { - final participants = Frost.getParticipants( + final participants = frostInterface.getParticipants( multisigConfig: ref.read(pFrostMultisigConfig.state).state!, ); @@ -53,9 +53,7 @@ class _FrostCreateStep1aState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Padding( padding: const EdgeInsets.symmetric(horizontal: 24), child: Text( @@ -63,9 +61,7 @@ class _FrostCreateStep1aState extends ConsumerState { style: STextStyles.w600_20(context), ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), Padding( padding: const EdgeInsets.symmetric(horizontal: 24), child: Text( @@ -75,9 +71,7 @@ class _FrostCreateStep1aState extends ConsumerState { ), ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), for (final participant in participants) Column( mainAxisSize: MainAxisSize.min, @@ -85,12 +79,11 @@ class _FrostCreateStep1aState extends ConsumerState { Container( width: double.infinity, height: 1.5, - color: - Theme.of(context).extension()!.background, - ), - const SizedBox( - height: 12, + color: Theme.of( + context, + ).extension()!.background, ), + const SizedBox(height: 12), Padding( padding: const EdgeInsets.symmetric(horizontal: 24), child: Row( @@ -99,12 +92,10 @@ class _FrostCreateStep1aState extends ConsumerState { width: 26, height: 26, decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldActiveBG, - borderRadius: BorderRadius.circular( - 200, - ), + color: Theme.of( + context, + ).extension()!.textFieldActiveBG, + borderRadius: BorderRadius.circular(200), ), child: Center( child: SvgPicture.asset( @@ -114,32 +105,22 @@ class _FrostCreateStep1aState extends ConsumerState { ), ), ), - const SizedBox( - width: 8, - ), + const SizedBox(width: 8), Expanded( child: Text( participant, style: STextStyles.w500_14(context), ), ), - const SizedBox( - width: 8, - ), - IconCopyButton( - data: participant, - ), + const SizedBox(width: 8), + IconCopyButton(data: participant), ], ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), ], ), ), @@ -152,12 +133,8 @@ class _FrostCreateStep1aState extends ConsumerState { padding: const EdgeInsets.all(16), child: Column( children: [ - const FrostStepUserSteps( - userSteps: info, - ), - const SizedBox( - height: 20, - ), + const FrostStepUserSteps(userSteps: info), + const SizedBox(height: 20), SizedBox( height: 220, child: Row( @@ -170,9 +147,7 @@ class _FrostCreateStep1aState extends ConsumerState { ], ), ), - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), DetailItem( title: "Encoded config", detail: ref.watch(pFrostMultisigConfig.state).state ?? "Error", @@ -186,9 +161,7 @@ class _FrostCreateStep1aState extends ConsumerState { ref.watch(pFrostMultisigConfig.state).state ?? "Error", ), ), - SizedBox( - height: Util.isDesktop ? 64 : 16, - ), + SizedBox(height: Util.isDesktop ? 64 : 16), Row( children: [ Expanded( @@ -199,13 +172,8 @@ class _FrostCreateStep1aState extends ConsumerState { ), ], ), - if (!Util.isDesktop) - const Spacer( - flex: 2, - ), - const SizedBox( - height: 16, - ), + if (!Util.isDesktop) const Spacer(flex: 2), + const SizedBox(height: 16), CheckboxTextButton( label: "I have verified that everyone has joined the group", onChanged: (value) { @@ -214,15 +182,14 @@ class _FrostCreateStep1aState extends ConsumerState { }); }, ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Start key generation", enabled: _userVerifyContinue, onPressed: () async { - ref.read(pFrostStartKeyGenData.notifier).state = - Frost.startKeyGeneration( + ref + .read(pFrostStartKeyGenData.notifier) + .state = frostInterface.startKeyGeneration( multisigConfig: ref.watch(pFrostMultisigConfig.state).state!, myName: ref.read(pFrostMyName.state).state!, ); diff --git a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_1b.dart b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_1b.dart index 59597c659f..3661e853a9 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_1b.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_1b.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; + import '../../../../../frost_route_generator.dart'; import '../../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../../services/frost.dart'; import '../../../../../utilities/text_styles.dart'; import '../../../../../utilities/util.dart'; import '../../../../../widgets/custom_buttons/checkbox_text_button.dart'; @@ -11,6 +11,7 @@ import '../../../../../widgets/frost_step_user_steps.dart'; import '../../../../../widgets/rounded_white_container.dart'; import '../../../../../widgets/stack_dialog.dart'; import '../../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../../wl_gen/interfaces/frost_interface.dart'; class FrostCreateStep1b extends ConsumerStatefulWidget { const FrostCreateStep1b({super.key}); @@ -62,12 +63,8 @@ class _FrostCreateStep1bState extends ConsumerState { padding: const EdgeInsets.all(16), child: Column( children: [ - const FrostStepUserSteps( - userSteps: info, - ), - const SizedBox( - height: 16, - ), + const FrostStepUserSteps(userSteps: info), + const SizedBox(height: 16), FrostStepField( controller: configFieldController, focusNode: configFocusNode, @@ -80,9 +77,7 @@ class _FrostCreateStep1bState extends ConsumerState { }); }, ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), FrostStepField( controller: myNameFieldController, focusNode: myNameFocusNode, @@ -95,9 +90,7 @@ class _FrostCreateStep1bState extends ConsumerState { }); }, ), - const SizedBox( - height: 6, - ), + const SizedBox(height: 6), Row( children: [ Expanded( @@ -111,13 +104,9 @@ class _FrostCreateStep1bState extends ConsumerState { ), ], ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), CheckboxTextButton( label: "I have verified that everyone has joined the group", onChanged: (value) { @@ -126,9 +115,7 @@ class _FrostCreateStep1bState extends ConsumerState { }); }, ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Start key generation", enabled: _userVerifyContinue && !_nameEmpty && !_configEmpty, @@ -139,7 +126,9 @@ class _FrostCreateStep1bState extends ConsumerState { final config = configFieldController.text; - if (!Frost.validateEncodedMultisigConfig(encodedConfig: config)) { + if (!frostInterface.validateEncodedMultisigConfig( + encodedConfig: config, + )) { return await showDialog( context: context, builder: (_) => StackOkDialog( @@ -149,7 +138,8 @@ class _FrostCreateStep1bState extends ConsumerState { ); } - if (!Frost.getParticipants(multisigConfig: config) + if (!frostInterface + .getParticipants(multisigConfig: config) .contains(myNameFieldController.text)) { return await showDialog( context: context, @@ -163,11 +153,11 @@ class _FrostCreateStep1bState extends ConsumerState { ref.read(pFrostMyName.state).state = myNameFieldController.text; ref.read(pFrostMultisigConfig.notifier).state = config; - ref.read(pFrostStartKeyGenData.state).state = - Frost.startKeyGeneration( - multisigConfig: ref.read(pFrostMultisigConfig.state).state!, - myName: ref.read(pFrostMyName.state).state!, - ); + ref.read(pFrostStartKeyGenData.state).state = frostInterface + .startKeyGeneration( + multisigConfig: ref.read(pFrostMultisigConfig.state).state!, + myName: ref.read(pFrostMyName.state).state!, + ); ref.read(pFrostCreateCurrentStep.state).state = 2; await Navigator.of(context).pushNamed( ref diff --git a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_2.dart b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_2.dart index d8aae6d6d5..9bef38d226 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_2.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_2.dart @@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../../frost_route_generator.dart'; import '../../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../../services/frost.dart'; import '../../../../../utilities/logger.dart'; import '../../../../../utilities/util.dart'; import '../../../../../widgets/custom_buttons/checkbox_text_button.dart'; @@ -15,12 +14,11 @@ import '../../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../../widgets/frost_step_user_steps.dart'; import '../../../../../widgets/stack_dialog.dart'; import '../../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart'; class FrostCreateStep2 extends ConsumerStatefulWidget { - const FrostCreateStep2({ - super.key, - }); + const FrostCreateStep2({super.key}); static const String routeName = "/frostCreateStep2"; static const String title = "Commitments"; @@ -47,7 +45,7 @@ class _FrostCreateStep2State extends ConsumerState { @override void initState() { - participants = Frost.getParticipants( + participants = frostInterface.getParticipants( multisigConfig: ref.read(pFrostMultisigConfig.state).state!, ); myIndex = participants.indexOf(ref.read(pFrostMyName.state).state!); @@ -81,9 +79,7 @@ class _FrostCreateStep2State extends ConsumerState { padding: const EdgeInsets.all(16), child: Column( children: [ - const FrostStepUserSteps( - userSteps: info, - ), + const FrostStepUserSteps(userSteps: info), const SizedBox(height: 12), DetailItem( title: "My name", @@ -94,17 +90,11 @@ class _FrostCreateStep2State extends ConsumerState { title: "My commitment", detail: myCommitment, button: Util.isDesktop - ? IconCopyButton( - data: myCommitment, - ) - : SimpleCopyButton( - data: myCommitment, - ), + ? IconCopyButton(data: myCommitment) + : SimpleCopyButton(data: myCommitment), ), const SizedBox(height: 12), - FrostQrDialogPopupButton( - data: myCommitment, - ), + FrostQrDialogPopupButton(data: myCommitment), const SizedBox(height: 12), for (int i = 0; i < participants.length; i++) Padding( @@ -135,7 +125,8 @@ class _FrostCreateStep2State extends ConsumerState { const SizedBox(height: 12), PrimaryButton( label: "Generate shares", - enabled: _userVerifyContinue && + enabled: + _userVerifyContinue && !fieldIsEmptyFlags.reduce((v, e) => v |= e), onPressed: () async { // check for empty commitments @@ -156,19 +147,19 @@ class _FrostCreateStep2State extends ConsumerState { commitments.insert(myIndex, myCommitment); try { - ref.read(pFrostSecretSharesData.notifier).state = - Frost.generateSecretShares( - multisigConfigWithNamePtr: ref - .read(pFrostStartKeyGenData.state) - .state! - .multisigConfigWithNamePtr, - mySeed: ref.read(pFrostStartKeyGenData.state).state!.seed, - secretShareMachineWrapperPtr: ref - .read(pFrostStartKeyGenData.state) - .state! - .secretShareMachineWrapperPtr, - commitments: commitments, - ); + ref.read(pFrostSecretSharesData.notifier).state = frostInterface + .generateSecretShares( + multisigConfigWithNamePtr: ref + .read(pFrostStartKeyGenData.state) + .state! + .multisigConfigWithNamePtr, + mySeed: ref.read(pFrostStartKeyGenData.state).state!.seed, + secretShareMachineWrapperPtr: ref + .read(pFrostStartKeyGenData.state) + .state! + .secretShareMachineWrapperPtr, + commitments: commitments, + ); ref.read(pFrostCreateCurrentStep.state).state = 3; await Navigator.of(context).pushNamed( @@ -178,7 +169,7 @@ class _FrostCreateStep2State extends ConsumerState { .routeName, ); } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (context.mounted) { return await showDialog( context: context, diff --git a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_3.dart b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_3.dart index ec565cb597..1b2ba0c6ac 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_3.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_3.dart @@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../../frost_route_generator.dart'; import '../../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../../services/frost.dart'; import '../../../../../utilities/logger.dart'; import '../../../../../utilities/util.dart'; import '../../../../../widgets/custom_buttons/checkbox_text_button.dart'; @@ -15,6 +14,7 @@ import '../../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../../widgets/frost_step_user_steps.dart'; import '../../../../../widgets/stack_dialog.dart'; import '../../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart'; class FrostCreateStep3 extends ConsumerStatefulWidget { @@ -46,7 +46,7 @@ class _FrostCreateStep3State extends ConsumerState { @override void initState() { - participants = Frost.getParticipants( + participants = frostInterface.getParticipants( multisigConfig: ref.read(pFrostMultisigConfig.state).state!, ); myIndex = participants.indexOf(ref.read(pFrostMyName.state).state!); @@ -80,9 +80,7 @@ class _FrostCreateStep3State extends ConsumerState { padding: const EdgeInsets.all(16), child: Column( children: [ - const FrostStepUserSteps( - userSteps: info, - ), + const FrostStepUserSteps(userSteps: info), const SizedBox(height: 12), DetailItem( title: "My name", @@ -93,17 +91,11 @@ class _FrostCreateStep3State extends ConsumerState { title: "My share", detail: myShare, button: Util.isDesktop - ? IconCopyButton( - data: myShare, - ) - : SimpleCopyButton( - data: myShare, - ), + ? IconCopyButton(data: myShare) + : SimpleCopyButton(data: myShare), ), const SizedBox(height: 12), - FrostQrDialogPopupButton( - data: myShare, - ), + FrostQrDialogPopupButton(data: myShare), const SizedBox(height: 12), for (int i = 0; i < participants.length; i++) Padding( @@ -131,12 +123,11 @@ class _FrostCreateStep3State extends ConsumerState { }); }, ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Generate", - enabled: _userVerifyContinue && + enabled: + _userVerifyContinue && !fieldIsEmptyFlags.reduce((v, e) => v |= e), onPressed: () async { // check for empty commitments @@ -157,8 +148,9 @@ class _FrostCreateStep3State extends ConsumerState { shares.insert(myIndex, myShare); try { - ref.read(pFrostCompletedKeyGenData.notifier).state = - Frost.completeKeyGeneration( + ref + .read(pFrostCompletedKeyGenData.notifier) + .state = frostInterface.completeKeyGeneration( multisigConfigWithNamePtr: ref .read(pFrostStartKeyGenData.state) .state! @@ -178,7 +170,7 @@ class _FrostCreateStep3State extends ConsumerState { .routeName, ); } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (context.mounted) { return await showDialog( diff --git a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_5.dart b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_5.dart index 0d7c53e8b0..6516690760 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_5.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/steps/frost_create_step_5.dart @@ -11,7 +11,6 @@ import '../../../../../pages_desktop_specific/desktop_home_view.dart'; import '../../../../../providers/frost_wallet/frost_wallet_providers.dart'; import '../../../../../providers/global/secure_store_provider.dart'; import '../../../../../providers/providers.dart'; -import '../../../../../services/frost.dart'; import '../../../../../themes/stack_colors.dart'; import '../../../../../utilities/assets.dart'; import '../../../../../utilities/logger.dart'; @@ -26,6 +25,7 @@ import '../../../../../widgets/desktop/primary_button.dart'; import '../../../../../widgets/detail_item.dart'; import '../../../../../widgets/loading_indicator.dart'; import '../../../../../widgets/rounded_container.dart'; +import '../../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../../home_view/home_view.dart'; import '../../../../wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart' as tvd; @@ -56,10 +56,14 @@ class _FrostCreateStep5State extends ConsumerState { @override void initState() { seed = ref.read(pFrostStartKeyGenData.state).state!.seed; - serializedKeys = - ref.read(pFrostCompletedKeyGenData.state).state!.serializedKeys; - recoveryString = - ref.read(pFrostCompletedKeyGenData.state).state!.recoveryString; + serializedKeys = ref + .read(pFrostCompletedKeyGenData.state) + .state! + .serializedKeys; + recoveryString = ref + .read(pFrostCompletedKeyGenData.state) + .state! + .recoveryString; multisigConfig = ref.read(pFrostMultisigConfig.state).state!; multisigId = ref.read(pFrostCompletedKeyGenData.state).state!.multisigId; @@ -73,15 +77,15 @@ class _FrostCreateStep5State extends ConsumerState { child: Column( children: [ RoundedContainer( - color: - Theme.of(context).extension()!.warningBackground, + color: Theme.of( + context, + ).extension()!.warningBackground, child: Text( _warning, style: STextStyles.w500_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.warningForeground, + color: Theme.of( + context, + ).extension()!.warningForeground, ), ), ), @@ -89,19 +93,17 @@ class _FrostCreateStep5State extends ConsumerState { DetailItem( title: "Multisig Config", detail: multisigConfig, - button: - Util.isDesktop - ? tvd.IconCopyButton(data: multisigConfig) - : SimpleCopyButton(data: multisigConfig), + button: Util.isDesktop + ? tvd.IconCopyButton(data: multisigConfig) + : SimpleCopyButton(data: multisigConfig), ), const SizedBox(height: 12), DetailItem( title: "Keys", detail: serializedKeys, - button: - Util.isDesktop - ? tvd.IconCopyButton(data: serializedKeys) - : SimpleCopyButton(data: serializedKeys), + button: Util.isDesktop + ? tvd.IconCopyButton(data: serializedKeys) + : SimpleCopyButton(data: serializedKeys), ), if (!Util.isDesktop) const Spacer(), const SizedBox(height: 12), @@ -156,10 +158,10 @@ class _FrostCreateStep5State extends ConsumerState { serializedKeys: serializedKeys, multisigId: multisigId, myName: ref.read(pFrostMyName.state).state!, - participants: Frost.getParticipants( + participants: frostInterface.getParticipants( multisigConfig: ref.read(pFrostMultisigConfig.state).state!, ), - threshold: Frost.getThreshold( + threshold: frostInterface.getThreshold( multisigConfig: ref.read(pFrostMultisigConfig.state).state!, ), ); diff --git a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_1a.dart b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_1a.dart index 740baafc3a..9fe973bce6 100644 --- a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_1a.dart +++ b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_1a.dart @@ -6,7 +6,6 @@ import '../../../../frost_route_generator.dart'; import '../../../../providers/db/main_db_provider.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; import '../../../../providers/global/wallets_provider.dart'; -import '../../../../services/frost.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/logger.dart'; @@ -23,6 +22,7 @@ import '../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../widgets/dialogs/simple_mobile_dialog.dart'; import '../../../../widgets/frost_step_user_steps.dart'; import '../../../../widgets/qr.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../wallet_view/transaction_views/transaction_details_view.dart'; class FrostReshareStep1a extends ConsumerStatefulWidget { @@ -63,9 +63,9 @@ class _FrostReshareStep1aState extends ConsumerState { final serializedKeys = await wallet.getSerializedKeys(); if (mounted) { - final result = Frost.beginResharer( + final result = frostInterface.beginResharer( serializedKeys: serializedKeys!, - config: Frost.decodeRConfig( + config: frostInterface.decodeRConfig( ref.read(pFrostResharingData).resharerRConfig!, ), ); @@ -81,14 +81,12 @@ class _FrostReshareStep1aState extends ConsumerState { ); } } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (mounted) { await showDialog( context: context, - builder: (_) => FrostErrorDialog( - title: e.toString(), - ), + builder: (_) => FrostErrorDialog(title: e.toString()), ); } } finally { @@ -97,8 +95,10 @@ class _FrostReshareStep1aState extends ConsumerState { } void _showParticipantsDialog() { - final participants = - ref.read(pFrostResharingData).configData!.newParticipants; + final participants = ref + .read(pFrostResharingData) + .configData! + .newParticipants; showDialog( context: context, @@ -108,9 +108,7 @@ class _FrostReshareStep1aState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Padding( padding: const EdgeInsets.symmetric(horizontal: 24), child: Text( @@ -118,9 +116,7 @@ class _FrostReshareStep1aState extends ConsumerState { style: STextStyles.w600_20(context), ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), Padding( padding: const EdgeInsets.symmetric(horizontal: 24), child: Text( @@ -130,9 +126,7 @@ class _FrostReshareStep1aState extends ConsumerState { ), ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), for (final participant in participants) Column( mainAxisSize: MainAxisSize.min, @@ -140,12 +134,11 @@ class _FrostReshareStep1aState extends ConsumerState { Container( width: double.infinity, height: 1.5, - color: - Theme.of(context).extension()!.background, - ), - const SizedBox( - height: 12, + color: Theme.of( + context, + ).extension()!.background, ), + const SizedBox(height: 12), Padding( padding: const EdgeInsets.symmetric(horizontal: 24), child: Row( @@ -154,12 +147,10 @@ class _FrostReshareStep1aState extends ConsumerState { width: 26, height: 26, decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .textFieldActiveBG, - borderRadius: BorderRadius.circular( - 200, - ), + color: Theme.of( + context, + ).extension()!.textFieldActiveBG, + borderRadius: BorderRadius.circular(200), ), child: Center( child: SvgPicture.asset( @@ -169,32 +160,22 @@ class _FrostReshareStep1aState extends ConsumerState { ), ), ), - const SizedBox( - width: 8, - ), + const SizedBox(width: 8), Expanded( child: Text( participant, style: STextStyles.w500_14(context), ), ), - const SizedBox( - width: 8, - ), - IconCopyButton( - data: participant, - ), + const SizedBox(width: 8), + IconCopyButton(data: participant), ], ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), ], ), ), @@ -227,9 +208,7 @@ class _FrostReshareStep1aState extends ConsumerState { padding: const EdgeInsets.all(16), child: Column( children: [ - const FrostStepUserSteps( - userSteps: info, - ), + const FrostStepUserSteps(userSteps: info), const SizedBox(height: 20), SizedBox( height: 220, @@ -243,9 +222,7 @@ class _FrostReshareStep1aState extends ConsumerState { ], ), ), - const SizedBox( - height: 32, - ), + const SizedBox(height: 32), DetailItem( title: "Config", detail: ref.watch(pFrostResharingData).resharerRConfig!, @@ -257,9 +234,7 @@ class _FrostReshareStep1aState extends ConsumerState { data: ref.watch(pFrostResharingData).resharerRConfig!, ), ), - SizedBox( - height: Util.isDesktop ? 64 : 16, - ), + SizedBox(height: Util.isDesktop ? 64 : 16), Row( children: [ Expanded( @@ -271,10 +246,7 @@ class _FrostReshareStep1aState extends ConsumerState { ], ), if (iAmInvolved && !Util.isDesktop) const Spacer(), - if (iAmInvolved) - const SizedBox( - height: 16, - ), + if (iAmInvolved) const SizedBox(height: 16), if (iAmInvolved) CheckboxTextButton( label: "I have verified that everyone has imported the config", @@ -284,10 +256,7 @@ class _FrostReshareStep1aState extends ConsumerState { }); }, ), - if (iAmInvolved) - const SizedBox( - height: 16, - ), + if (iAmInvolved) const SizedBox(height: 16), if (iAmInvolved) PrimaryButton( label: "Start resharing", diff --git a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_1b.dart b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_1b.dart index 7224e2acb0..b4971d6f5e 100644 --- a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_1b.dart +++ b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_1b.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:frostdart/frostdart.dart'; + +// import 'package:frostdart/frostdart.dart'; import '../../../../frost_route_generator.dart'; import '../../../../providers/db/main_db_provider.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; import '../../../../providers/global/secure_store_provider.dart'; -import '../../../../services/frost.dart'; import '../../../../utilities/format.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/util.dart'; @@ -16,11 +16,10 @@ import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../widgets/frost_step_user_steps.dart'; import '../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; class FrostReshareStep1b extends ConsumerStatefulWidget { - const FrostReshareStep1b({ - super.key, - }); + const FrostReshareStep1b({super.key}); static const String routeName = "/frostReshareStep1b"; static const String title = "Import reshare config"; @@ -70,8 +69,8 @@ class _FrostReshareStep1bState extends ConsumerState { String? salt; try { salt = Format.uint8listToString( - resharerSalt( - resharerConfig: Frost.decodeRConfig( + frostInterface.getResharerSalt( + resharerConfig: frostInterface.decodeRConfig( ref.read(pFrostResharingData).resharerRConfig!, ), ), @@ -95,13 +94,13 @@ class _FrostReshareStep1bState extends ConsumerState { }); } - final serializedKeys = await ref.read(secureStoreProvider).read( - key: "{$walletId}_serializedFROSTKeys", - ); + final serializedKeys = await ref + .read(secureStoreProvider) + .read(key: "{$walletId}_serializedFROSTKeys"); if (mounted) { - final result = Frost.beginResharer( + final result = frostInterface.beginResharer( serializedKeys: serializedKeys!, - config: Frost.decodeRConfig( + config: frostInterface.decodeRConfig( ref.read(pFrostResharingData).resharerRConfig!, ), ); @@ -117,14 +116,12 @@ class _FrostReshareStep1bState extends ConsumerState { ); } } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (mounted) { await showDialog( context: context, - builder: (_) => FrostErrorDialog( - title: e.toString(), - ), + builder: (_) => FrostErrorDialog(title: e.toString()), ); } } finally { @@ -153,12 +150,8 @@ class _FrostReshareStep1bState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox( - height: 16, - ), - const FrostStepUserSteps( - userSteps: info, - ), + const SizedBox(height: 16), + const FrostStepUserSteps(userSteps: info), const SizedBox(height: 20), FrostStepField( controller: configFieldController, @@ -172,13 +165,9 @@ class _FrostReshareStep1bState extends ConsumerState { }); }, ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), CheckboxTextButton( label: "I have verified that everyone has imported the config", onChanged: (value) { @@ -187,9 +176,7 @@ class _FrostReshareStep1bState extends ConsumerState { }); }, ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Start resharing", enabled: !_configEmpty && _userVerifyContinue, diff --git a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_2abd.dart b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_2abd.dart index b54b6041b3..7cc2ce539a 100644 --- a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_2abd.dart +++ b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_2abd.dart @@ -6,7 +6,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../frost_route_generator.dart'; import '../../../../providers/db/main_db_provider.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../services/frost.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/util.dart'; import '../../../../wallets/isar/models/frost_wallet_info.dart'; @@ -17,6 +16,7 @@ import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/detail_item.dart'; import '../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../wallet_view/transaction_views/transaction_details_view.dart'; class FrostReshareStep2abd extends ConsumerStatefulWidget { @@ -60,9 +60,9 @@ class _FrostReshareStep2abdState extends ConsumerState { resharerStarts.insert(myResharerIndexIndex, myResharerStart); } - final result = Frost.beginReshared( + final result = frostInterface.beginReshared( myName: ref.read(pFrostResharingData).myName!, - resharerConfig: Frost.decodeRConfig( + resharerConfig: frostInterface.decodeRConfig( ref.read(pFrostResharingData).resharerRConfig!, ), resharerStarts: resharerStarts, @@ -79,15 +79,13 @@ class _FrostReshareStep2abdState extends ConsumerState { .routeName, ); } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (mounted) { await showDialog( context: context, - builder: (_) => FrostErrorDialog( - title: "Error", - message: e.toString(), - ), + builder: (_) => + FrostErrorDialog(title: "Error", message: e.toString()), ); } } finally { @@ -103,11 +101,14 @@ class _FrostReshareStep2abdState extends ConsumerState { .isar .frostWalletInfo .getByWalletIdSync(ref.read(pFrostScaffoldArgs)!.walletId!)!; - final myOldIndex = - frostInfo.participants.indexOf(ref.read(pFrostResharingData).myName!); + final myOldIndex = frostInfo.participants.indexOf( + ref.read(pFrostResharingData).myName!, + ); - myResharerStart = - ref.read(pFrostResharingData).startResharerData!.resharerStart; + myResharerStart = ref + .read(pFrostResharingData) + .startResharerData! + .resharerStart; resharers = ref.read(pFrostResharingData).configData!.resharers; myResharerIndexIndex = resharers.values.toList().indexOf(myOldIndex); @@ -151,20 +152,12 @@ class _FrostReshareStep2abdState extends ConsumerState { title: "My resharer", detail: myResharerStart, button: Util.isDesktop - ? IconCopyButton( - data: myResharerStart, - ) - : SimpleCopyButton( - data: myResharerStart, - ), + ? IconCopyButton(data: myResharerStart) + : SimpleCopyButton(data: myResharerStart), ), const SizedBox(height: 12), - FrostQrDialogPopupButton( - data: myResharerStart, - ), - const SizedBox( - height: 12, - ), + FrostQrDialogPopupButton(data: myResharerStart), + const SizedBox(height: 12), Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -175,7 +168,8 @@ class _FrostReshareStep2abdState extends ConsumerState { focusNode: focusNodes[i], showQrScanOption: true, label: resharers.keys.elementAt(i), - hint: "Enter " + hint: + "Enter " "${resharers.keys.elementAt(i)}" "'s resharer", onChanged: (_) { @@ -187,9 +181,7 @@ class _FrostReshareStep2abdState extends ConsumerState { ], ), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), CheckboxTextButton( label: "I have verified that everyone has my resharer", onChanged: (value) { @@ -198,12 +190,11 @@ class _FrostReshareStep2abdState extends ConsumerState { }); }, ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Continue", - enabled: _userVerifyContinue && + enabled: + _userVerifyContinue && (amOutgoingParticipant || !fieldIsEmptyFlags.fold(false, (v, e) => v || e)), onPressed: _onPressed, diff --git a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_2c.dart b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_2c.dart index 92a3a195b4..3717188fd9 100644 --- a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_2c.dart +++ b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_2c.dart @@ -5,12 +5,12 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../frost_route_generator.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../services/frost.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/util.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; class FrostReshareStep2c extends ConsumerStatefulWidget { const FrostReshareStep2c({super.key}); @@ -41,9 +41,9 @@ class _FrostReshareStep2cState extends ConsumerState { // collect resharer strings final resharerStarts = controllers.map((e) => e.text).toList(); - final result = Frost.beginReshared( + final result = frostInterface.beginReshared( myName: ref.read(pFrostResharingData).myName!, - resharerConfig: Frost.decodeRConfig( + resharerConfig: frostInterface.decodeRConfig( ref.read(pFrostResharingData).resharerRConfig!, ), resharerStarts: resharerStarts, @@ -59,15 +59,13 @@ class _FrostReshareStep2cState extends ConsumerState { .routeName, ); } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (mounted) { await showDialog( context: context, - builder: (_) => FrostErrorDialog( - title: "Error", - message: e.toString(), - ), + builder: (_) => + FrostErrorDialog(title: "Error", message: e.toString()), ); } } finally { @@ -116,7 +114,8 @@ class _FrostReshareStep2cState extends ConsumerState { focusNode: focusNodes[i], showQrScanOption: true, label: resharers.keys.elementAt(i), - hint: "Enter " + hint: + "Enter " "${resharers.keys.elementAt(i)}" "'s resharer", onChanged: (_) { @@ -129,9 +128,7 @@ class _FrostReshareStep2cState extends ConsumerState { ], ), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Continue", enabled: !fieldIsEmptyFlags.reduce((v, e) => v |= e), diff --git a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_3abd.dart b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_3abd.dart index d4fc876c12..edd5d5140c 100644 --- a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_3abd.dart +++ b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_3abd.dart @@ -1,11 +1,8 @@ -import 'dart:ffi'; - import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../frost_route_generator.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../services/frost.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/util.dart'; import '../../../../widgets/custom_buttons/checkbox_text_button.dart'; @@ -15,6 +12,7 @@ import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/detail_item.dart'; import '../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../wallet_view/transaction_views/transaction_details_view.dart'; class FrostReshareStep3abd extends ConsumerStatefulWidget { @@ -55,8 +53,8 @@ class _FrostReshareStep3abdState extends ConsumerState { encryptionKeys.insert(myIndex, myEncryptionKey!); } - final result = Frost.finishResharer( - machine: ref.read(pFrostResharingData).startResharerData!.machine.ref, + final result = frostInterface.finishResharer( + machine: ref.read(pFrostResharingData).startResharerData!.machine, encryptionKeysOfResharedTo: encryptionKeys, ); @@ -70,14 +68,12 @@ class _FrostReshareStep3abdState extends ConsumerState { .routeName, ); } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (mounted) { await showDialog( context: context, - builder: (_) => FrostErrorDialog( - title: "Error", - message: e.toString(), - ), + builder: (_) => + FrostErrorDialog(title: "Error", message: e.toString()), ); } } finally { @@ -87,8 +83,10 @@ class _FrostReshareStep3abdState extends ConsumerState { @override void initState() { - myEncryptionKey = - ref.read(pFrostResharingData).startResharedData?.resharedStart; + myEncryptionKey = ref + .read(pFrostResharingData) + .startResharedData + ?.resharedStart; newParticipants = ref.read(pFrostResharingData).configData!.newParticipants; myIndex = newParticipants.indexOf(ref.read(pFrostResharingData).myName!); @@ -136,22 +134,13 @@ class _FrostReshareStep3abdState extends ConsumerState { title: "My encryption key", detail: myEncryptionKey!, button: Util.isDesktop - ? IconCopyButton( - data: myEncryptionKey!, - ) - : SimpleCopyButton( - data: myEncryptionKey!, - ), + ? IconCopyButton(data: myEncryptionKey!) + : SimpleCopyButton(data: myEncryptionKey!), ), if (!amOutgoingParticipant) const SizedBox(height: 12), if (!amOutgoingParticipant) - FrostQrDialogPopupButton( - data: myEncryptionKey!, - ), - if (!amOutgoingParticipant) - const SizedBox( - height: 12, - ), + FrostQrDialogPopupButton(data: myEncryptionKey!), + if (!amOutgoingParticipant) const SizedBox(height: 12), Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -164,7 +153,8 @@ class _FrostReshareStep3abdState extends ConsumerState { focusNode: focusNodes[i], showQrScanOption: true, label: newParticipants[i], - hint: "Enter " + hint: + "Enter " "${newParticipants[i]}" "'s encryption key", onChanged: (_) { @@ -177,10 +167,7 @@ class _FrostReshareStep3abdState extends ConsumerState { ], ), if (!Util.isDesktop) const Spacer(), - if (!amOutgoingParticipant) - const SizedBox( - height: 12, - ), + if (!amOutgoingParticipant) const SizedBox(height: 12), if (!amOutgoingParticipant) CheckboxTextButton( label: "I have verified that everyone has my encryption key", @@ -190,12 +177,11 @@ class _FrostReshareStep3abdState extends ConsumerState { }); }, ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Continue", - enabled: (amOutgoingParticipant || _userVerifyContinue) && + enabled: + (amOutgoingParticipant || _userVerifyContinue) && !fieldIsEmptyFlags.reduce((v, e) => v |= e), onPressed: _onPressed, ), diff --git a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_4.dart b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_4.dart index dd081d121b..00765f9212 100644 --- a/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_4.dart +++ b/lib/pages/add_wallet_views/frost_ms/reshare/frost_reshare_step_4.dart @@ -1,5 +1,3 @@ -import 'dart:ffi'; - import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -7,7 +5,6 @@ import '../../../../frost_route_generator.dart'; import '../../../../pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart'; import '../../../../providers/db/main_db_provider.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; -import '../../../../services/frost.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/util.dart'; import '../../../../wallets/isar/models/frost_wallet_info.dart'; @@ -18,6 +15,7 @@ import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/detail_item.dart'; import '../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../wallet_view/transaction_views/transaction_details_view.dart'; import '../../../wallet_view/wallet_view.dart'; @@ -58,7 +56,10 @@ class _FrostReshareStep4State extends ConsumerState { if (amOutgoingParticipant) { ref.read(pFrostResharingData).reset(); ref.read(pFrostScaffoldCanPopDesktop.notifier).state = true; - ref.read(pFrostScaffoldArgs)?.parentNav.popUntil( + ref + .read(pFrostScaffoldArgs) + ?.parentNav + .popUntil( ModalRoute.withName( Util.isDesktop ? DesktopWalletView.routeName @@ -72,8 +73,8 @@ class _FrostReshareStep4State extends ConsumerState { resharerCompletes.insert(myResharerIndexIndex!, myResharerComplete!); } - final data = Frost.finishReshared( - prior: ref.read(pFrostResharingData).startResharedData!.prior.ref, + final data = frostInterface.finishReshared( + prior: ref.read(pFrostResharingData).startResharedData!.prior, resharerCompletes: resharerCompletes, ); @@ -88,14 +89,12 @@ class _FrostReshareStep4State extends ConsumerState { ); } } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (mounted) { await showDialog( context: context, - builder: (_) => FrostErrorDialog( - title: "Error", - message: e.toString(), - ), + builder: (_) => + FrostErrorDialog(title: "Error", message: e.toString()), ); } } finally { @@ -107,9 +106,9 @@ class _FrostReshareStep4State extends ConsumerState { void initState() { amNewParticipant = ref.read(pFrostResharingData).startResharerData == null && - ref.read(pFrostResharingData).incompleteWallet != null && - ref.read(pFrostResharingData).incompleteWallet?.walletId == - ref.read(pFrostScaffoldArgs)!.walletId!; + ref.read(pFrostResharingData).incompleteWallet != null && + ref.read(pFrostResharingData).incompleteWallet?.walletId == + ref.read(pFrostScaffoldArgs)!.walletId!; myName = ref.read(pFrostResharingData).myName!; @@ -127,8 +126,9 @@ class _FrostReshareStep4State extends ConsumerState { .isar .frostWalletInfo .getByWalletIdSync(ref.read(pFrostScaffoldArgs)!.walletId!)!; - final myOldIndex = - frostInfo.participants.indexOf(ref.read(pFrostResharingData).myName!); + final myOldIndex = frostInfo.participants.indexOf( + ref.read(pFrostResharingData).myName!, + ); myResharerIndexIndex = resharers.values.toList().indexOf(myOldIndex); if (myResharerIndexIndex! >= 0) { @@ -173,22 +173,13 @@ class _FrostReshareStep4State extends ConsumerState { title: "My resharer complete", detail: myResharerComplete!, button: Util.isDesktop - ? IconCopyButton( - data: myResharerComplete!, - ) - : SimpleCopyButton( - data: myResharerComplete!, - ), + ? IconCopyButton(data: myResharerComplete!) + : SimpleCopyButton(data: myResharerComplete!), ), if (myResharerComplete != null) const SizedBox(height: 12), if (myResharerComplete != null) - FrostQrDialogPopupButton( - data: myResharerComplete!, - ), - if (!amOutgoingParticipant) - const SizedBox( - height: 16, - ), + FrostQrDialogPopupButton(data: myResharerComplete!), + if (!amOutgoingParticipant) const SizedBox(height: 16), if (!amOutgoingParticipant) Column( mainAxisSize: MainAxisSize.min, @@ -202,7 +193,8 @@ class _FrostReshareStep4State extends ConsumerState { focusNode: focusNodes[i], showQrScanOption: true, label: resharers.keys.elementAt(i), - hint: "Enter " + hint: + "Enter " "${resharers.keys.elementAt(i)}" "'s resharer", onChanged: (_) { @@ -215,9 +207,7 @@ class _FrostReshareStep4State extends ConsumerState { ], ), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), if (!amNewParticipant) CheckboxTextButton( label: "I have verified that everyone has my resharer complete", @@ -227,13 +217,11 @@ class _FrostReshareStep4State extends ConsumerState { }); }, ), - if (!amNewParticipant) - const SizedBox( - height: 16, - ), + if (!amNewParticipant) const SizedBox(height: 16), PrimaryButton( label: amOutgoingParticipant ? "Done" : "Complete", - enabled: (amNewParticipant || _userVerifyContinue) && + enabled: + (amNewParticipant || _userVerifyContinue) && (amOutgoingParticipant || !fieldIsEmptyFlags.fold(false, (v, e) => v || e)), onPressed: _onPressed, diff --git a/lib/pages/add_wallet_views/frost_ms/restore/restore_frost_ms_wallet_view.dart b/lib/pages/add_wallet_views/frost_ms/restore/restore_frost_ms_wallet_view.dart index facaeed444..33eddc54b8 100644 --- a/lib/pages/add_wallet_views/frost_ms/restore/restore_frost_ms_wallet_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/restore/restore_frost_ms_wallet_view.dart @@ -4,13 +4,13 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:frostdart/frostdart.dart' as frost; + +// import 'package:frostdart/frostdart.dart' as frost; import '../../../../notifications/show_flush_bar.dart'; import '../../../../pages_desktop_specific/desktop_home_view.dart'; import '../../../../providers/global/secure_store_provider.dart'; import '../../../../providers/providers.dart'; -import '../../../../services/frost.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/barcode_scanner_interface.dart'; @@ -38,6 +38,7 @@ import '../../../../widgets/icon_widgets/x_icon.dart'; import '../../../../widgets/stack_dialog.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../home_view/home_view.dart'; class RestoreFrostMsWalletView extends ConsumerStatefulWidget { @@ -70,8 +71,10 @@ class _RestoreFrostMsWalletViewState final keys = keysFieldController.text; final config = configFieldController.text; - final myNameIndex = frost.getParticipantIndexFromKeys(serializedKeys: keys); - final participants = Frost.getParticipants(multisigConfig: config); + final myNameIndex = frostInterface.participantIndexFromKeys( + serializedKeys: keys, + ); + final participants = frostInterface.getParticipants(multisigConfig: config); final myName = participants[myNameIndex]; final info = WalletInfo.createNew( @@ -92,7 +95,7 @@ class _RestoreFrostMsWalletViewState knownSalts: [], participants: participants, myName: myName, - threshold: frost.multisigThreshold(multisigConfig: config), + threshold: frostInterface.getMultisigThreshold(multisigConfig: config), ); await ref.read(mainDBProvider).isar.writeTxn(() async { @@ -173,12 +176,11 @@ class _RestoreFrostMsWalletViewState if (mounted) { await showDialog( context: context, - builder: - (_) => StackOkDialog( - title: "Failed to restore", - message: e.toString(), - desktopPopRootNavigator: Util.isDesktop, - ), + builder: (_) => StackOkDialog( + title: "Failed to restore", + message: e.toString(), + desktopPopRootNavigator: Util.isDesktop, + ), ); } } finally { @@ -265,60 +267,59 @@ class _RestoreFrostMsWalletViewState Widget build(BuildContext context) { return ConditionalParent( condition: Util.isDesktop, - builder: - (child) => DesktopScaffold( - background: Theme.of(context).extension()!.background, - appBar: const DesktopAppBar( - isCompactHeight: false, - leading: AppBarBackButton(), - // TODO: [prio=high] get rid of placeholder text?? - trailing: FrostMascot( - title: 'Lorem ipsum', - body: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', - ), - ), - body: SizedBox(width: 480, child: child), + builder: (child) => DesktopScaffold( + background: Theme.of(context).extension()!.background, + appBar: const DesktopAppBar( + isCompactHeight: false, + leading: AppBarBackButton(), + // TODO: [prio=high] get rid of placeholder text?? + trailing: FrostMascot( + title: 'Lorem ipsum', + body: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', ), + ), + body: SizedBox(width: 480, 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( - "Restore FROST multisig wallet", - style: STextStyles.navBarTitle(context), - ), - ), - body: SafeArea( - child: LayoutBuilder( - builder: (context, constraints) { - return SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: constraints.maxHeight, - ), - child: IntrinsicHeight( - child: Padding( - padding: const EdgeInsets.all(16), - child: child, - ), - ), + builder: (child) => Background( + child: Scaffold( + backgroundColor: Theme.of( + context, + ).extension()!.background, + appBar: AppBar( + leading: AppBarBackButton( + onPressed: () { + Navigator.of(context).pop(); + }, + ), + title: Text( + "Restore FROST multisig wallet", + style: STextStyles.navBarTitle(context), + ), + ), + body: SafeArea( + child: LayoutBuilder( + builder: (context, constraints) { + return SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight, + ), + child: IntrinsicHeight( + child: Padding( + padding: const EdgeInsets.all(16), + child: child, ), - ); - }, - ), - ), + ), + ), + ); + }, ), ), + ), + ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -340,78 +341,79 @@ class _RestoreFrostMsWalletViewState autocorrect: false, enableSuggestions: false, style: STextStyles.field(context), - decoration: standardInputDecoration( - "Enter config", - configFocusNode, - context, - ).copyWith( - contentPadding: const EdgeInsets.only( - left: 16, - top: 6, - bottom: 8, - right: 5, - ), - suffixIcon: Padding( - padding: - _configEmpty + decoration: + standardInputDecoration( + "Enter config", + configFocusNode, + context, + ).copyWith( + contentPadding: const EdgeInsets.only( + left: 16, + top: 6, + bottom: 8, + right: 5, + ), + suffixIcon: Padding( + padding: _configEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - !_configEmpty - ? TextFieldIconButton( - semanticsLabel: - "Clear Button. Clears The Config Field.", - key: const Key("frConfigClearButtonKey"), - onTap: () { - configFieldController.text = ""; - - setState(() { - _configEmpty = true; - }); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - semanticsLabel: - "Paste Button. Pastes From Clipboard To Config Field Input.", - key: const Key("frConfigPasteButtonKey"), - onTap: () async { - final ClipboardData? data = - await Clipboard.getData( - Clipboard.kTextPlain, - ); - if (data?.text != null && - data!.text!.isNotEmpty) { - configFieldController.text = - data.text!.trim(); - } - - setState(() { - _configEmpty = - configFieldController.text.isEmpty; - }); - }, - child: - _configEmpty - ? const ClipboardIcon() - : const XIcon(), - ), - if (_configEmpty) - TextFieldIconButton( - semanticsLabel: - "Scan QR Button. Opens Camera For Scanning QR Code.", - key: const Key("frConfigScanQrButtonKey"), - onTap: scanQr, - child: const QrCodeIcon(), - ), - ], + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + !_configEmpty + ? TextFieldIconButton( + semanticsLabel: + "Clear Button. Clears The Config Field.", + key: const Key("frConfigClearButtonKey"), + onTap: () { + configFieldController.text = ""; + + setState(() { + _configEmpty = true; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + semanticsLabel: + "Paste Button. Pastes From Clipboard To Config Field Input.", + key: const Key("frConfigPasteButtonKey"), + onTap: () async { + final ClipboardData? data = + await Clipboard.getData( + Clipboard.kTextPlain, + ); + if (data?.text != null && + data!.text!.isNotEmpty) { + configFieldController.text = data + .text! + .trim(); + } + + setState(() { + _configEmpty = configFieldController + .text + .isEmpty; + }); + }, + child: _configEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + if (_configEmpty) + TextFieldIconButton( + semanticsLabel: + "Scan QR Button. Opens Camera For Scanning QR Code.", + key: const Key("frConfigScanQrButtonKey"), + onTap: scanQr, + child: const QrCodeIcon(), + ), + ], + ), + ), ), ), - ), - ), ), ), const SizedBox(height: 16), @@ -432,70 +434,69 @@ class _RestoreFrostMsWalletViewState autocorrect: false, enableSuggestions: false, style: STextStyles.field(context), - decoration: standardInputDecoration( - "Keys", - keysFocusNode, - context, - ).copyWith( - contentPadding: const EdgeInsets.only( - left: 16, - top: 6, - bottom: 8, - right: 5, - ), - suffixIcon: Padding( - padding: - _keysEmpty + decoration: + standardInputDecoration( + "Keys", + keysFocusNode, + context, + ).copyWith( + contentPadding: const EdgeInsets.only( + left: 16, + top: 6, + bottom: 8, + right: 5, + ), + suffixIcon: Padding( + padding: _keysEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - !_keysEmpty - ? TextFieldIconButton( - semanticsLabel: - "Clear Button. Clears The Keys Field.", - key: const Key("frMyNameClearButtonKey"), - onTap: () { - keysFieldController.text = ""; - - setState(() { - _keysEmpty = true; - }); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - semanticsLabel: - "Paste Button. Pastes From Clipboard To Keys Field.", - key: const Key("frKeysPasteButtonKey"), - onTap: () async { - final ClipboardData? data = - await Clipboard.getData( - Clipboard.kTextPlain, - ); - if (data?.text != null && - data!.text!.isNotEmpty) { - keysFieldController.text = - data.text!.trim(); - } - - setState(() { - _keysEmpty = - keysFieldController.text.isEmpty; - }); - }, - child: - _keysEmpty - ? const ClipboardIcon() - : const XIcon(), - ), - ], + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + !_keysEmpty + ? TextFieldIconButton( + semanticsLabel: + "Clear Button. Clears The Keys Field.", + key: const Key("frMyNameClearButtonKey"), + onTap: () { + keysFieldController.text = ""; + + setState(() { + _keysEmpty = true; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + semanticsLabel: + "Paste Button. Pastes From Clipboard To Keys Field.", + key: const Key("frKeysPasteButtonKey"), + onTap: () async { + final ClipboardData? data = + await Clipboard.getData( + Clipboard.kTextPlain, + ); + if (data?.text != null && + data!.text!.isNotEmpty) { + keysFieldController.text = data.text! + .trim(); + } + + setState(() { + _keysEmpty = + keysFieldController.text.isEmpty; + }); + }, + child: _keysEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + ], + ), + ), ), ), - ), - ), ), ), const SizedBox(height: 16), diff --git a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_1b.dart b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_1b.dart index f7e6d0b438..2ce537697f 100644 --- a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_1b.dart +++ b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_1b.dart @@ -8,7 +8,6 @@ import '../../../../models/isar/models/isar_models.dart'; import '../../../../providers/db/main_db_provider.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; import '../../../../providers/global/wallets_provider.dart'; -import '../../../../services/frost.dart'; import '../../../../utilities/format.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/util.dart'; @@ -19,6 +18,7 @@ import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/frost_step_user_steps.dart'; import '../../../../widgets/stack_dialog.dart'; import '../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; class FrostSendStep1b extends ConsumerStatefulWidget { const FrostSendStep1b({super.key}); @@ -65,43 +65,40 @@ class _FrostSendStep1bState extends ConsumerState { ref.read(pWallets).getWallet(ref.read(pFrostScaffoldArgs)!.walletId!) as BitcoinFrostWallet; - final data = Frost.extractDataFromSignConfig( + final data = frostInterface.extractDataFromSignConfig( signConfig: config, coin: wallet.cryptoCurrency, serializedKeys: (await wallet.getSerializedKeys())!, ); - final utxos = - await ref - .read(mainDBProvider) - .getUTXOs(wallet.walletId) - .filter() - .anyOf( - data.inputs, - (q, e) => q - .txidEqualTo(Format.uint8listToString(e.hash)) - .and() - .valueEqualTo(e.value) - .and() - .voutEqualTo(e.vout), - ) - .findAll(); + final utxos = await ref + .read(mainDBProvider) + .getUTXOs(wallet.walletId) + .filter() + .anyOf( + data.inputs, + (q, e) => q + .txidEqualTo(Format.uint8listToString(e.hash)) + .and() + .valueEqualTo(e.value) + .and() + .voutEqualTo(e.vout), + ) + .findAll(); // TODO add more data from 'data' and display to user ? ref.read(pFrostTxData.notifier).state = TxData( frostMSConfig: config, - recipients: - data.recipients - .map( - (e) => TxRecipient( - address: e.address, - amount: e.amount, - isChange: false, - addressType: - wallet.cryptoCurrency.getAddressType(e.address)!, - ), - ) - .toList(), + recipients: data.recipients + .map( + (e) => TxRecipient( + address: e.address, + amount: e.amount, + isChange: false, + addressType: wallet.cryptoCurrency.getAddressType(e.address)!, + ), + ) + .toList(), utxos: utxos.map((e) => StandardInput(e)).toSet(), ); @@ -123,12 +120,11 @@ class _FrostSendStep1bState extends ConsumerState { if (mounted) { await showDialog( context: context, - builder: - (_) => StackOkDialog( - title: "Import and attempt sign config failed", - message: e.toString(), - desktopPopRootNavigator: Util.isDesktop, - ), + builder: (_) => StackOkDialog( + title: "Import and attempt sign config failed", + message: e.toString(), + desktopPopRootNavigator: Util.isDesktop, + ), ); } } finally { diff --git a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_2.dart b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_2.dart index febae8b540..b0a5c66957 100644 --- a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_2.dart +++ b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_2.dart @@ -4,7 +4,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../frost_route_generator.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; import '../../../../providers/global/wallets_provider.dart'; -import '../../../../services/frost.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/text_styles.dart'; @@ -17,6 +16,7 @@ import '../../../../widgets/detail_item.dart'; import '../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../widgets/rounded_white_container.dart'; import '../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../wallet_view/transaction_views/transaction_details_view.dart'; class FrostSendStep2 extends ConsumerStatefulWidget { @@ -56,15 +56,16 @@ class _FrostSendStep2State extends ConsumerState { @override void initState() { - final wallet = ref.read(pWallets).getWallet( - ref.read(pFrostScaffoldArgs)!.walletId!, - ) as BitcoinFrostWallet; + final wallet = + ref.read(pWallets).getWallet(ref.read(pFrostScaffoldArgs)!.walletId!) + as BitcoinFrostWallet; final frostInfo = wallet.frostInfo; myName = frostInfo.myName; threshold = frostInfo.threshold; - participantsWithoutMe = - List.from(frostInfo.participants); // Copy so it isn't fixed-length. + participantsWithoutMe = List.from( + frostInfo.participants, + ); // Copy so it isn't fixed-length. myIndex = participantsWithoutMe.indexOf(frostInfo.myName); myPreprocess = ref.read(pFrostAttemptSignData.state).state!.preprocess; @@ -103,13 +104,8 @@ class _FrostSendStep2State extends ConsumerState { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "1.", - style: STextStyles.w500_12(context), - ), - const SizedBox( - width: 4, - ), + Text("1.", style: STextStyles.w500_12(context)), + const SizedBox(width: 4), Expanded( child: Text( "Share your preprocess with other signing group members.", @@ -118,19 +114,12 @@ class _FrostSendStep2State extends ConsumerState { ), ], ), - const SizedBox( - height: 4, - ), + const SizedBox(height: 4), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "2.", - style: STextStyles.w500_12(context), - ), - const SizedBox( - width: 4, - ), + Text("2.", style: STextStyles.w500_12(context)), + const SizedBox(width: 4), Expanded( child: RichText( text: TextSpan( @@ -141,7 +130,8 @@ class _FrostSendStep2State extends ConsumerState { style: STextStyles.w500_12(context), ), TextSpan( - text: "You must have the threshold number of " + text: + "You must have the threshold number of " "preprocesses (including yours) to send this transaction.", style: STextStyles.w600_12(context).copyWith( color: Theme.of(context) @@ -158,58 +148,38 @@ class _FrostSendStep2State extends ConsumerState { ], ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), DetailItem( title: "Threshold", detail: "$threshold signatures", horizontal: true, ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), DetailItem( title: "My name", detail: myName, button: Util.isDesktop - ? IconCopyButton( - data: myName, - ) - : SimpleCopyButton( - data: myName, - ), - ), - const SizedBox( - height: 12, + ? IconCopyButton(data: myName) + : SimpleCopyButton(data: myName), ), + const SizedBox(height: 12), DetailItem( title: "My preprocess", detail: myPreprocess, button: Util.isDesktop - ? IconCopyButton( - data: myPreprocess, - ) - : SimpleCopyButton( - data: myPreprocess, - ), + ? IconCopyButton(data: myPreprocess) + : SimpleCopyButton(data: myPreprocess), ), const SizedBox(height: 12), - FrostQrDialogPopupButton( - data: myPreprocess, - ), - const SizedBox( - height: 12, - ), + FrostQrDialogPopupButton(data: myPreprocess), + const SizedBox(height: 12), RoundedWhiteContainer( child: Text( "You need to obtain ${threshold - 1} preprocess from signing members to send this transaction.", style: STextStyles.label(context), ), ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), Builder( builder: (context) { final count = countPreprocesses(); @@ -224,9 +194,7 @@ class _FrostSendStep2State extends ConsumerState { ); }, ), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -247,9 +215,7 @@ class _FrostSendStep2State extends ConsumerState { ], ), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 12, - ), + const SizedBox(height: 12), PrimaryButton( label: "Generate shares", enabled: countPreprocesses() >= threshold, @@ -271,12 +237,14 @@ class _FrostSendStep2State extends ConsumerState { preprocesses.insert(myIndex, ""); try { - ref.read(pFrostContinueSignData.notifier).state = - Frost.continueSigning( - machinePtr: - ref.read(pFrostAttemptSignData.state).state!.machinePtr, - preprocesses: preprocesses, - ); + ref.read(pFrostContinueSignData.notifier).state = frostInterface + .continueSigning( + machinePtr: ref + .read(pFrostAttemptSignData.state) + .state! + .machinePtr, + preprocesses: preprocesses, + ); ref.read(pFrostCreateCurrentStep.state).state = 3; await Navigator.of(context).pushNamed( @@ -291,7 +259,7 @@ class _FrostSendStep2State extends ConsumerState { // arguments: widget.walletId, // ); } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (context.mounted) { return await showDialog( diff --git a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_3.dart b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_3.dart index f3ddc90cc9..d3e9f91a29 100644 --- a/lib/pages/send_view/frost_ms/send_steps/frost_send_step_3.dart +++ b/lib/pages/send_view/frost_ms/send_steps/frost_send_step_3.dart @@ -5,7 +5,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../frost_route_generator.dart'; import '../../../../providers/frost_wallet/frost_wallet_providers.dart'; import '../../../../providers/global/wallets_provider.dart'; -import '../../../../services/frost.dart'; import '../../../../utilities/amount/amount.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/util.dart'; @@ -18,6 +17,7 @@ import '../../../../widgets/detail_item.dart'; import '../../../../widgets/dialogs/frost/frost_error_dialog.dart'; import '../../../../widgets/frost_step_user_steps.dart'; import '../../../../widgets/textfields/frost_step_field.dart'; +import '../../../../wl_gen/interfaces/frost_interface.dart'; import '../../../wallet_view/transaction_views/transaction_details_view.dart'; class FrostSendStep3 extends ConsumerStatefulWidget { @@ -62,13 +62,12 @@ class _FrostSendStep3State extends ConsumerState { myIndex = frostInfo.participants.indexOf(frostInfo.myName); myShare = ref.read(pFrostContinueSignData.state).state!.share; - participantsWithoutMe = - frostInfo.participants - .toSet() - .intersection( - ref.read(pFrostSelectParticipantsUnordered.state).state!.toSet(), - ) - .toList(); + participantsWithoutMe = frostInfo.participants + .toSet() + .intersection( + ref.read(pFrostSelectParticipantsUnordered.state).state!.toSet(), + ) + .toList(); participantsWithoutMe.remove(myName); @@ -104,19 +103,17 @@ class _FrostSendStep3State extends ConsumerState { DetailItem( title: "My name", detail: myName, - button: - Util.isDesktop - ? IconCopyButton(data: myName) - : SimpleCopyButton(data: myName), + button: Util.isDesktop + ? IconCopyButton(data: myName) + : SimpleCopyButton(data: myName), ), const SizedBox(height: 12), DetailItem( title: "My share", detail: myShare, - button: - Util.isDesktop - ? IconCopyButton(data: myShare) - : SimpleCopyButton(data: myShare), + button: Util.isDesktop + ? IconCopyButton(data: myShare) + : SimpleCopyButton(data: myShare), ), const SizedBox(height: 12), FrostQrDialogPopupButton(data: myShare), @@ -172,9 +169,11 @@ class _FrostSendStep3State extends ConsumerState { } try { - final rawTx = Frost.completeSigning( - machinePtr: - ref.read(pFrostContinueSignData.state).state!.machinePtr, + final rawTx = frostInterface.completeSigning( + machinePtr: ref + .read(pFrostContinueSignData.state) + .state! + .machinePtr, shares: shares, ); @@ -216,10 +215,9 @@ class _FrostSendStep3State extends ConsumerState { if (context.mounted) { return await showDialog( context: context, - builder: - (_) => const FrostErrorDialog( - title: "Failed to complete signing process", - ), + builder: (_) => const FrostErrorDialog( + title: "Failed to complete signing process", + ), ); } } 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 4069f06f6e..355fc6643a 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 @@ -13,7 +13,6 @@ import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; -import 'package:frostdart/frostdart.dart' as frost; import 'package:isar_community/isar.dart'; import 'package:stack_wallet_backup/stack_wallet_backup.dart'; import 'package:tuple/tuple.dart'; @@ -33,7 +32,6 @@ import '../../../../../models/stack_restoring_ui_state.dart'; import '../../../../../models/trade_wallet_lookup.dart'; import '../../../../../models/wallet_restore_state.dart'; import '../../../../../services/address_book_service.dart'; -import '../../../../../services/frost.dart'; import '../../../../../services/node_service.dart'; import '../../../../../services/trade_notes_service.dart'; import '../../../../../services/trade_sent_from_stack_service.dart'; @@ -62,6 +60,7 @@ import '../../../../../wallets/wallet/wallet.dart'; import '../../../../../wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart'; import '../../../../../wallets/wallet/wallet_mixin_interfaces/private_key_interface.dart'; import '../../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; +import '../../../../../wl_gen/interfaces/frost_interface.dart'; class PreRestoreState { final Set walletIds; @@ -243,12 +242,11 @@ abstract class SWB { Logging.instance.i("...createStackWalletJSON DB.instance.mutex acquired"); Logging.instance.i("SWB backing up nodes"); try { - final nodesFuture = - nodeService.nodes.map((e) async { - final map = e.toMap(); - map["password"] = await e.getPassword(_secureStore); - return map; - }).toList(); + final nodesFuture = nodeService.nodes.map((e) async { + final map = e.toMap(); + map["password"] = await e.getPassword(_secureStore); + return map; + }).toList(); final nodes = await Future.wait(nodesFuture); backupJson['nodes'] = nodes; } catch (e, s) { @@ -280,8 +278,9 @@ abstract class SWB { final AddressBookService addressBookService = AddressBookService(); final addresses = addressBookService.contacts; - backupJson['addressBookEntries'] = - addresses.map((e) => e.toMap()).toList(); + backupJson['addressBookEntries'] = addresses + .map((e) => e.toMap()) + .toList(); Logging.instance.d("SWB backing up wallets"); @@ -298,8 +297,8 @@ abstract class SWB { (await wallet.getViewOnlyWalletData()).toJsonEncodedString(); } else if (wallet is MnemonicInterface) { backupWallet['mnemonic'] = await wallet.getMnemonic(); - backupWallet['mnemonicPassphrase'] = - await wallet.getMnemonicPassphrase(); + backupWallet['mnemonicPassphrase'] = await wallet + .getMnemonicPassphrase(); } else if (wallet is PrivateKeyInterface) { backupWallet['privateKey'] = await wallet.getPrivateKey(); } else if (wallet is BitcoinFrostWallet) { @@ -332,11 +331,10 @@ abstract class SWB { backupWallet['restoreHeight'] = wallet.info.restoreHeight; - final isarNotes = - await MainDB.instance.isar.transactionNotes - .where() - .walletIdEqualTo(wallet.walletId) - .findAll(); + final isarNotes = await MainDB.instance.isar.transactionNotes + .where() + .walletIdEqualTo(wallet.walletId) + .findAll(); final notes = isarNotes.asMap().map( (key, value) => MapEntry(value.txid, value.value), @@ -359,8 +357,9 @@ abstract class SWB { // back up trade history lookup data for trades send from stack wallet final tradeTxidLookupDataService = TradeSentFromStackService(); - final lookupData = - tradeTxidLookupDataService.all.map((e) => e.toMap()).toList(); + final lookupData = tradeTxidLookupDataService.all + .map((e) => e.toMap()) + .toList(); backupJson["tradeTxidLookupData"] = lookupData; Logging.instance.d("SWB backing up trade notes"); @@ -439,10 +438,10 @@ abstract class SWB { serializedKeys = frostData["keys"] as String; multisigConfig = frostData["config"] as String; - final myNameIndex = frost.getParticipantIndexFromKeys( + final myNameIndex = frostInterface.participantIndexFromKeys( serializedKeys: serializedKeys, ); - final participants = Frost.getParticipants( + final participants = frostInterface.getParticipants( multisigConfig: multisigConfig, ); final myName = participants[myNameIndex]; @@ -452,7 +451,9 @@ abstract class SWB { knownSalts: [], participants: participants, myName: myName, - threshold: frost.multisigThreshold(multisigConfig: multisigConfig), + threshold: frostInterface.getMultisigThreshold( + multisigConfig: multisigConfig, + ), ); await MainDB.instance.isar.writeTxn(() async { @@ -693,11 +694,10 @@ abstract class SWB { ); Logging.instance.d("SWB temp backup created"); - final List _currentWalletIds = - await MainDB.instance.isar.walletInfo - .where() - .walletIdProperty() - .findAll(); + final List _currentWalletIds = await MainDB.instance.isar.walletInfo + .where() + .walletIdProperty() + .findAll(); final preRestoreState = PreRestoreState( _currentWalletIds.toSet(), @@ -926,12 +926,11 @@ abstract class SWB { // ensure this contact's data matches the pre restore state final List addresses = []; for (final address in (contact['addresses'] as List)) { - final entry = - ContactAddressEntry() - ..coinName = address['coin'] as String - ..address = address['address'] as String - ..label = address['label'] as String - ..other = address['other'] as String?; + final entry = ContactAddressEntry() + ..coinName = address['coin'] as String + ..address = address['address'] as String + ..label = address['label'] as String + ..other = address['other'] as String?; try { entry.coin; @@ -1107,12 +1106,11 @@ abstract class SWB { _prefs.language = prefs['language'] as String; _prefs.showFavoriteWallets = prefs['showFavoriteWallets'] as bool; _prefs.wifiOnly = prefs['wifiOnly'] as bool; - _prefs.syncType = - prefs['syncType'] == "currentWalletOnly" - ? SyncingType.currentWalletOnly - : prefs['syncType'] == "selectedWalletsAtStartup" - ? SyncingType.currentWalletOnly - : SyncingType.allWalletsOnStartup; // + _prefs.syncType = prefs['syncType'] == "currentWalletOnly" + ? SyncingType.currentWalletOnly + : prefs['syncType'] == "selectedWalletsAtStartup" + ? SyncingType.currentWalletOnly + : SyncingType.allWalletsOnStartup; // _prefs.walletIdsSyncOnStartup = (prefs['walletIdsSyncOnStartup'] as List) .map((e) => e as String) @@ -1136,12 +1134,11 @@ abstract class SWB { for (final contact in addressBookEntries) { final List addresses = []; for (final address in (contact['addresses'] as List)) { - final entry = - ContactAddressEntry() - ..coinName = address['coin'] as String - ..address = address['address'] as String - ..label = address['label'] as String - ..other = address['other'] as String?; + final entry = ContactAddressEntry() + ..coinName = address['coin'] as String + ..address = address['address'] as String + ..label = address['label'] as String + ..other = address['other'] as String?; try { entry.coin; @@ -1175,11 +1172,10 @@ abstract class SWB { secureStorageInterface: secureStorageInterface, ); if (nodes != null) { - final primaryIds = - primaryNodes - ?.map((e) => e["id"] as String?) - .whereType() - .toSet(); + final primaryIds = primaryNodes + ?.map((e) => e["id"] as String?) + .whereType() + .toSet(); for (final node in nodes) { final id = node['id'] as String; @@ -1250,8 +1246,9 @@ abstract class SWB { final json = Map.from(tradeTxidLookupData[i] as Map); TradeWalletLookup lookup = TradeWalletLookup.fromJson(json); // update walletIds - final List walletIds = - lookup.walletIds.map((e) => oldToNewWalletIdMap[e]!).toList(); + final List walletIds = lookup.walletIds + .map((e) => oldToNewWalletIdMap[e]!) + .toList(); lookup = lookup.copyWith(walletIds: walletIds); final oldLookup = DB.instance.get( diff --git a/lib/pages/settings_views/wallet_settings_view/frost_ms/initiate_resharing/complete_reshare_config_view.dart b/lib/pages/settings_views/wallet_settings_view/frost_ms/initiate_resharing/complete_reshare_config_view.dart index afc48647d2..1198e59b88 100644 --- a/lib/pages/settings_views/wallet_settings_view/frost_ms/initiate_resharing/complete_reshare_config_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/frost_ms/initiate_resharing/complete_reshare_config_view.dart @@ -3,14 +3,14 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:frostdart/frostdart.dart'; + +// import 'package:frostdart/frostdart.dart'; import '../../../../../frost_route_generator.dart'; import '../../../../../pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; import '../../../../../providers/db/main_db_provider.dart'; import '../../../../../providers/frost_wallet/frost_wallet_providers.dart'; import '../../../../../providers/global/wallets_provider.dart'; -import '../../../../../services/frost.dart'; import '../../../../../themes/stack_colors.dart'; import '../../../../../utilities/format.dart'; import '../../../../../utilities/logger.dart'; @@ -27,6 +27,7 @@ import '../../../../../widgets/desktop/primary_button.dart'; import '../../../../../widgets/frost_scaffold.dart'; import '../../../../../widgets/rounded_white_container.dart'; import '../../../../../widgets/stack_dialog.dart'; +import '../../../../../wl_gen/interfaces/frost_interface.dart'; final class CompleteReshareConfigView extends ConsumerStatefulWidget { const CompleteReshareConfigView({ @@ -84,20 +85,21 @@ class _CompleteReshareConfigViewState ); } - final List newParticipants = - controllers.map((e) => e.text.trim()).toList(); + final List newParticipants = controllers + .map((e) => e.text.trim()) + .toList(); if (_includeMeInReshare) { newParticipants.insert(0, myName); } - final config = Frost.createResharerConfig( + final config = frostInterface.createResharerConfig( newThreshold: int.parse(_newThresholdController.text), resharers: widget.resharers.values.toList(), newParticipants: newParticipants, ); final salt = Format.uint8listToString( - resharerSalt(resharerConfig: config), + frostInterface.getResharerSalt(resharerConfig: config), ); if (frostInfo.knownSalts.contains(salt)) { @@ -122,10 +124,8 @@ class _CompleteReshareConfigViewState } ref.read(pFrostResharingData).myName = myName; - ref.read(pFrostResharingData).resharerRConfig = Frost.encodeRConfig( - config, - widget.resharers, - ); + ref.read(pFrostResharingData).resharerRConfig = frostInterface + .encodeRConfig(config, widget.resharers); final wallet = ref.read(pWallets).getWallet(widget.walletId) as BitcoinFrostWallet; @@ -143,12 +143,10 @@ class _CompleteReshareConfigViewState callerRouteName: CompleteReshareConfigView.routeName, ); - await Navigator.of(context).pushNamed( - FrostStepScaffold.routeName, - ); + await Navigator.of(context).pushNamed(FrostStepScaffold.routeName); } } catch (e, s) { - Logging.instance.f("$e\n$s", error: e, stackTrace: s,); + Logging.instance.f("$e\n$s", error: e, stackTrace: s); if (mounted) { await showDialog( context: context, @@ -269,17 +267,15 @@ class _CompleteReshareConfigViewState leading: AppBarBackButton(), trailing: ExitToMyStackButton(), ), - body: SizedBox( - width: 480, - child: child, - ), + body: SizedBox(width: 480, child: child), ), child: ConditionalParent( condition: !Util.isDesktop, builder: (child) => Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of( + context, + ).extension()!.background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -318,9 +314,7 @@ class _CompleteReshareConfigViewState ? CrossAxisAlignment.start : CrossAxisAlignment.stretch, children: [ - const SizedBox( - height: 8, - ), + const SizedBox(height: 8), GestureDetector( onTap: () { setState(() { @@ -340,18 +334,14 @@ class _CompleteReshareConfigViewState materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, value: _includeMeInReshare, onChanged: (value) { - setState( - () => _includeMeInReshare = value == true, - ); + setState(() => _includeMeInReshare = value == true); _participantsCountChanged( _newParticipantsCountController.text, ); }, ), ), - const SizedBox( - width: 12, - ), + const SizedBox(width: 12), Expanded( child: Text( "I will be a signer in the new config", @@ -362,19 +352,16 @@ class _CompleteReshareConfigViewState ), ), ), - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), Text( "New threshold", style: STextStyles.w500_14(context).copyWith( - color: - Theme.of(context).extension()!.textSubtitle1, + color: Theme.of( + context, + ).extension()!.textSubtitle1, ), ), - const SizedBox( - height: 10, - ), + const SizedBox(height: 10), TextField( keyboardType: TextInputType.number, inputFormatters: [FilteringTextInputFormatter.digitsOnly], @@ -384,31 +371,27 @@ class _CompleteReshareConfigViewState hintStyle: STextStyles.fieldLabel(context), ), ), - const SizedBox( - height: 6, - ), + const SizedBox(height: 6), RoundedWhiteContainer( child: Text( "Enter number of signatures required for fund management.", style: STextStyles.w500_12(context).copyWith( - color: - Theme.of(context).extension()!.textSubtitle2, + color: Theme.of( + context, + ).extension()!.textSubtitle2, ), ), ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), Text( "New number of participants", style: STextStyles.w500_14(context).copyWith( - color: - Theme.of(context).extension()!.textSubtitle1, + color: Theme.of( + context, + ).extension()!.textSubtitle1, ), ), - const SizedBox( - height: 10, - ), + const SizedBox(height: 10), TextField( keyboardType: TextInputType.number, inputFormatters: [FilteringTextInputFormatter.digitsOnly], @@ -419,42 +402,37 @@ class _CompleteReshareConfigViewState hintStyle: STextStyles.fieldLabel(context), ), ), - const SizedBox( - height: 6, - ), + const SizedBox(height: 6), RoundedWhiteContainer( child: Text( "The number of participants must be equal to or greater than the" " number of required signatures.", style: STextStyles.w500_12(context).copyWith( - color: - Theme.of(context).extension()!.textSubtitle2, + color: Theme.of( + context, + ).extension()!.textSubtitle2, ), ), ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), if (controllers.isNotEmpty) Text( "Participants", style: STextStyles.w500_14(context).copyWith( - color: - Theme.of(context).extension()!.textSubtitle1, + color: Theme.of( + context, + ).extension()!.textSubtitle1, ), ), - if (controllers.isNotEmpty) - const SizedBox( - height: 10, - ), + if (controllers.isNotEmpty) const SizedBox(height: 10), if (controllers.isNotEmpty) RoundedWhiteContainer( child: Text( "Type each name in one word without spaces.", style: STextStyles.w500_12(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle2, + color: Theme.of( + context, + ).extension()!.textSubtitle2, ), ), ), @@ -463,9 +441,7 @@ class _CompleteReshareConfigViewState children: [ for (int i = 0; i < controllers.length; i++) Padding( - padding: const EdgeInsets.only( - top: 10, - ), + padding: const EdgeInsets.only(top: 10), child: TextField( controller: controllers[i], decoration: InputDecoration( @@ -477,9 +453,7 @@ class _CompleteReshareConfigViewState ], ), if (!Util.isDesktop) const Spacer(), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), PrimaryButton( label: "Generate config", onPressed: () async { diff --git a/lib/providers/frost_wallet/frost_wallet_providers.dart b/lib/providers/frost_wallet/frost_wallet_providers.dart index c5b934e8ee..bee42aa284 100644 --- a/lib/providers/frost_wallet/frost_wallet_providers.dart +++ b/lib/providers/frost_wallet/frost_wallet_providers.dart @@ -1,55 +1,50 @@ -import 'dart:ffi'; import 'dart:typed_data'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:frostdart/frostdart_bindings_generated.dart'; -import '../../services/frost.dart'; + import '../../wallets/models/incomplete_frost_wallet.dart'; import '../../wallets/models/tx_data.dart'; +import '../../wl_gen/interfaces/frost_interface.dart'; // =================== wallet creation ========================================= final pFrostMultisigConfig = StateProvider((ref) => null); final pFrostMyName = StateProvider((ref) => null); -final pFrostStartKeyGenData = StateProvider< - ({ - String seed, - String commitments, - Pointer multisigConfigWithNamePtr, - Pointer secretShareMachineWrapperPtr, - })?>((_) => null); - -final pFrostSecretSharesData = StateProvider< - ({ - String share, - Pointer secretSharesResPtr, - })?>((ref) => null); - -final pFrostCompletedKeyGenData = StateProvider< - ({ - Uint8List multisigId, - String recoveryString, - String serializedKeys, - })?>((ref) => null); +final pFrostStartKeyGenData = + StateProvider< + ({ + String seed, + String commitments, + OpaqueWrapper multisigConfigWithNamePtr, + OpaqueWrapper secretShareMachineWrapperPtr, + })? + >((_) => null); + +final pFrostSecretSharesData = + StateProvider<({String share, OpaqueWrapper secretSharesResPtr})?>( + (ref) => null, + ); + +final pFrostCompletedKeyGenData = + StateProvider< + ({Uint8List multisigId, String recoveryString, String serializedKeys})? + >((ref) => null); // ================= transaction creation ====================================== final pFrostTxData = StateProvider((ref) => null); -final pFrostAttemptSignData = StateProvider< - ({ - Pointer machinePtr, - String preprocess, - })?>((ref) => null); +final pFrostAttemptSignData = + StateProvider<({OpaqueWrapper machinePtr, String preprocess})?>( + (ref) => null, + ); -final pFrostContinueSignData = StateProvider< - ({ - Pointer machinePtr, - String share, - })?>((ref) => null); +final pFrostContinueSignData = + StateProvider<({OpaqueWrapper machinePtr, String share})?>((ref) => null); // ===================== shared/util =========================================== -final pFrostSelectParticipantsUnordered = - StateProvider?>((ref) => null); +final pFrostSelectParticipantsUnordered = StateProvider?>( + (ref) => null, +); // ========================= resharing ========================================= final pFrostResharingData = Provider((ref) => _ResharingData()); @@ -66,31 +61,23 @@ class _ResharingData { int newThreshold, Map resharers, List newParticipants, - })? get configData => resharerRConfig != null - ? Frost.extractResharerConfigData(rConfig: resharerRConfig!) + })? + get configData => resharerRConfig != null + ? frostInterface.extractResharerConfigData(rConfig: resharerRConfig!) : null; // resharer start string (for sharing) and machine - ({ - String resharerStart, - Pointer machine, - })? startResharerData; + ({String resharerStart, OpaqueWrapper machine})? startResharerData; // reshared start string (for sharing) and machine - ({ - String resharedStart, - Pointer prior, - })? startResharedData; + ({String resharedStart, OpaqueWrapper prior})? startResharedData; // resharer complete string (for sharing) String? resharerComplete; // new keys and config with an ID - ({ - String multisigConfig, - String serializedKeys, - String resharedId, - })? newWalletData; + ({String multisigConfig, String serializedKeys, String resharedId})? + newWalletData; // reset/clear all data void reset() { diff --git a/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart b/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart index dc0561429f..00537b12b8 100644 --- a/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart +++ b/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart @@ -1,11 +1,10 @@ import 'dart:async'; -import 'dart:ffi'; import 'dart:math'; import 'package:flutter/foundation.dart'; -import 'package:frostdart/frostdart.dart' as frost; -import 'package:frostdart/frostdart_bindings_generated.dart'; -import 'package:frostdart/util.dart'; +// import 'package:frostdart/frostdart.dart' as frost; +// import 'package:frostdart/frostdart_bindings_generated.dart'; +// import 'package:frostdart/util.dart'; import 'package:isar_community/isar.dart'; import '../../../electrumx_rpc/cached_electrumx_client.dart'; @@ -21,10 +20,10 @@ import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; import '../../../models/paymint/fee_object_model.dart'; import '../../../services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import '../../../services/event_bus/global_event_bus.dart'; -import '../../../services/frost.dart'; import '../../../utilities/amount/amount.dart'; import '../../../utilities/extensions/extensions.dart'; import '../../../utilities/logger.dart'; +import '../../../wl_gen/interfaces/frost_interface.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../crypto_currency/intermediate/frost_currency.dart'; import '../../isar/models/frost_wallet_info.dart'; @@ -40,11 +39,10 @@ class BitcoinFrostWallet extends Wallet BitcoinFrostWallet(CryptoCurrencyNetwork network) : super(BitcoinFrost(network) as T); - FrostWalletInfo get frostInfo => - mainDB.isar.frostWalletInfo - .where() - .walletIdEqualTo(walletId) - .findFirstSync()!; + FrostWalletInfo get frostInfo => mainDB.isar.frostWalletInfo + .where() + .walletIdEqualTo(walletId) + .findFirstSync()!; late ElectrumXClient electrumXClient; late CachedElectrumXClient electrumXCachedClient; @@ -61,7 +59,9 @@ class BitcoinFrostWallet extends Wallet Logging.instance.i("Generating new FROST wallet."); try { - final salt = frost.multisigSalt(multisigConfig: multisigConfig).toHex; + final salt = frostInterface + .getMultisigSalt(multisigConfig: multisigConfig) + .toHex; final FrostWalletInfo frostWalletInfo = FrostWalletInfo( walletId: info.walletId, @@ -90,14 +90,10 @@ class BitcoinFrostWallet extends Wallet serializedKeys: serializedKeys, secure: true, ); - } on FrostdartException catch (e) { - if (e.errorCode == 72) { - // rust doesn't like the addressDerivationData - index++; - continue; - } else { - rethrow; - } + } on FrostBadIndexException catch (_) { + // rust doesn't like the addressDerivationData + index++; + continue; } } @@ -125,24 +121,22 @@ class BitcoinFrostWallet extends Wallet .map((e) => e.amount) .reduce((value, e) => value += e); - final utxos = - await mainDB - .getUTXOs(walletId) - .filter() - .isBlockedEqualTo(false) - .findAll(); + final utxos = await mainDB + .getUTXOs(walletId) + .filter() + .isBlockedEqualTo(false) + .findAll(); if (utxos.isEmpty) { throw Exception("No UTXOs found"); } else { final currentHeight = await chainHeight; utxos.removeWhere( - (e) => - !e.isConfirmed( - currentHeight, - cryptoCurrency.minConfirms, - cryptoCurrency.minCoinbaseConfirms, - ), + (e) => !e.isConfirmed( + currentHeight, + cryptoCurrency.minConfirms, + cryptoCurrency.minCoinbaseConfirms, + ), ); if (utxos.isEmpty) { throw Exception("No confirmed UTXOs found"); @@ -174,10 +168,9 @@ class BitcoinFrostWallet extends Wallet } } - final int network = - cryptoCurrency.network == CryptoCurrencyNetwork.main - ? Network.Mainnet - : Network.Testnet; + final int network = cryptoCurrency.network == CryptoCurrencyNetwork.main + ? frostInterface.mainnet + : frostInterface.testnet; final List< ({ @@ -208,7 +201,7 @@ class BitcoinFrostWallet extends Wallet while (config == null) { try { - config = Frost.createSignConfig( + config = frostInterface.createSignConfig( network: network, inputs: inputs, outputs: txData.recipients!, @@ -216,9 +209,8 @@ class BitcoinFrostWallet extends Wallet feePerWeight: feePerWeight, serializedKeys: (await getSerializedKeys())!, ); - } on FrostdartException catch (e) { - if (e.errorCode == NOT_ENOUGH_FUNDS_ERROR && - utxosRemaining.isNotEmpty) { + } on FrostInsufficientFundsException catch (_) { + if (utxosRemaining.isNotEmpty) { // add extra utxo final utxo = utxosRemaining.take(1).first; final dData = await getDerivationData(utxo.address); @@ -281,17 +273,14 @@ class BitcoinFrostWallet extends Wallet } } - Future< - ({Pointer machinePtr, String preprocess}) - > + Future<({OpaqueWrapper machinePtr, String preprocess})> frostAttemptSignConfig({required String config}) async { - final int network = - cryptoCurrency.network == CryptoCurrencyNetwork.main - ? Network.Mainnet - : Network.Testnet; + final int network = cryptoCurrency.network == CryptoCurrencyNetwork.main + ? frostInterface.mainnet + : frostInterface.testnet; final serializedKeys = await getSerializedKeys(); - return Frost.attemptSignConfig( + return frostInterface.attemptSignConfig( network: network, config: config, serializedKeys: serializedKeys!, @@ -307,13 +296,15 @@ class BitcoinFrostWallet extends Wallet await _saveMultisigConfig(multisigConfig); await _updateThreshold( - frost.getThresholdFromKeys(serializedKeys: serializedKeys), + frostInterface.thresholdFromKeys(serializedKeys: serializedKeys), ); - final myNameIndex = frost.getParticipantIndexFromKeys( + final myNameIndex = frostInterface.participantIndexFromKeys( serializedKeys: serializedKeys, ); - final participants = Frost.getParticipants(multisigConfig: multisigConfig); + final participants = frostInterface.getParticipants( + multisigConfig: multisigConfig, + ); final myName = participants[myNameIndex]; await _updateParticipants(participants); @@ -409,16 +400,14 @@ class BitcoinFrostWallet extends Wallet await _fetchAddressesForElectrumXScan(); // Separate receiving and change addresses. - final Set receivingAddresses = - allAddressesOld - .where((e) => e.subType == AddressSubType.receiving) - .map((e) => e.value) - .toSet(); - final Set changeAddresses = - allAddressesOld - .where((e) => e.subType == AddressSubType.change) - .map((e) => e.value) - .toSet(); + final Set receivingAddresses = allAddressesOld + .where((e) => e.subType == AddressSubType.receiving) + .map((e) => e.value) + .toSet(); + final Set changeAddresses = allAddressesOld + .where((e) => e.subType == AddressSubType.change) + .map((e) => e.value) + .toSet(); // Remove duplicates. final allAddressesSet = {...receivingAddresses, ...changeAddresses}; @@ -433,13 +422,12 @@ class BitcoinFrostWallet extends Wallet final List> allTransactions = []; for (final txHash in allTxHashes) { - final storedTx = - await mainDB.isar.transactionV2s - .where() - .walletIdEqualTo(walletId) - .filter() - .txidEqualTo(txHash["tx_hash"] as String) - .findFirst(); + final storedTx = await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .filter() + .txidEqualTo(txHash["tx_hash"] as String) + .findFirst(); if (storedTx == null || !storedTx.isConfirmed( @@ -766,21 +754,18 @@ class BitcoinFrostWallet extends Wallet numberOfBlocksFast: f, numberOfBlocksAverage: m, numberOfBlocksSlow: s, - fast: - Amount.fromDecimal( - fast, - fractionDigits: cryptoCurrency.fractionDigits, - ).raw, - medium: - Amount.fromDecimal( - medium, - fractionDigits: cryptoCurrency.fractionDigits, - ).raw, - slow: - Amount.fromDecimal( - slow, - fractionDigits: cryptoCurrency.fractionDigits, - ).raw, + fast: Amount.fromDecimal( + fast, + fractionDigits: cryptoCurrency.fractionDigits, + ).raw, + medium: Amount.fromDecimal( + medium, + fractionDigits: cryptoCurrency.fractionDigits, + ).raw, + slow: Amount.fromDecimal( + slow, + fractionDigits: cryptoCurrency.fractionDigits, + ).raw, ); Logging.instance.i("fetched fees: $feeObject"); @@ -827,8 +812,9 @@ class BitcoinFrostWallet extends Wallet try { await refreshMutex.protect(() async { if (!isRescan) { - final salt = - frost.multisigSalt(multisigConfig: multisigConfig!).toHex; + final salt = frostInterface + .getMultisigSalt(multisigConfig: multisigConfig!) + .toHex; final knownSalts = _getKnownSalts(); if (knownSalts.contains(salt)) { throw Exception("Known frost multisig salt found!"); @@ -1211,12 +1197,11 @@ class BitcoinFrostWallet extends Wallet // =================== DB ==================================================== - List _getKnownSalts() => - mainDB.isar.frostWalletInfo - .where() - .walletIdEqualTo(walletId) - .knownSaltsProperty() - .findFirstSync()!; + List _getKnownSalts() => mainDB.isar.frostWalletInfo + .where() + .walletIdEqualTo(walletId) + .knownSaltsProperty() + .findFirstSync()!; Future _updateKnownSalts(List knownSalts) async { final info = frostInfo; @@ -1229,12 +1214,11 @@ class BitcoinFrostWallet extends Wallet }); } - List _getParticipants() => - mainDB.isar.frostWalletInfo - .where() - .walletIdEqualTo(walletId) - .participantsProperty() - .findFirstSync()!; + List _getParticipants() => mainDB.isar.frostWalletInfo + .where() + .walletIdEqualTo(walletId) + .participantsProperty() + .findFirstSync()!; Future _updateParticipants(List participants) async { final info = frostInfo; @@ -1247,12 +1231,11 @@ class BitcoinFrostWallet extends Wallet }); } - int _getThreshold() => - mainDB.isar.frostWalletInfo - .where() - .walletIdEqualTo(walletId) - .thresholdProperty() - .findFirstSync()!; + int _getThreshold() => mainDB.isar.frostWalletInfo + .where() + .walletIdEqualTo(walletId) + .thresholdProperty() + .findFirstSync()!; Future _updateThreshold(int threshold) async { final info = frostInfo; @@ -1265,12 +1248,11 @@ class BitcoinFrostWallet extends Wallet }); } - String _getMyName() => - mainDB.isar.frostWalletInfo - .where() - .walletIdEqualTo(walletId) - .myNameProperty() - .findFirstSync()!; + String _getMyName() => mainDB.isar.frostWalletInfo + .where() + .walletIdEqualTo(walletId) + .myNameProperty() + .findFirstSync()!; Future _updateMyName(String myName) async { final info = frostInfo; @@ -1299,21 +1281,20 @@ class BitcoinFrostWallet extends Wallet // TODO [prio=low]: Use ElectrumXInterface method. Future _updateElectrumX() async { - final failovers = - nodeService - .failoverNodesFor(currency: cryptoCurrency) - .map( - (e) => ElectrumXNode( - address: e.host, - port: e.port, - name: e.name, - id: e.id, - useSSL: e.useSSL, - torEnabled: e.torEnabled, - clearnetEnabled: e.clearnetEnabled, - ), - ) - .toList(); + final failovers = nodeService + .failoverNodesFor(currency: cryptoCurrency) + .map( + (e) => ElectrumXNode( + address: e.host, + port: e.port, + name: e.name, + id: e.id, + useSSL: e.useSSL, + torEnabled: e.torEnabled, + clearnetEnabled: e.clearnetEnabled, + ), + ) + .toList(); final newNode = await _getCurrentElectrumXNode(); try { @@ -1477,10 +1458,9 @@ class BitcoinFrostWallet extends Wallet @override Future generateNewChangeAddress() async { final current = await getCurrentChangeAddress(); - int index = - current == null - ? kFrostSecureStartingIndex - : current.derivationIndex + 1; + int index = current == null + ? kFrostSecureStartingIndex + : current.derivationIndex + 1; const chain = 1; // change address final serializedKeys = (await getSerializedKeys())!; @@ -1494,14 +1474,10 @@ class BitcoinFrostWallet extends Wallet serializedKeys: serializedKeys, secure: true, ); - } on FrostdartException catch (e) { - if (e.errorCode == 72) { - // rust doesn't like the addressDerivationData - index++; - continue; - } else { - rethrow; - } + } on FrostBadIndexException catch (_) { + // rust doesn't like the addressDerivationData + index++; + continue; } } @@ -1511,10 +1487,9 @@ class BitcoinFrostWallet extends Wallet @override Future generateNewReceivingAddress() async { final current = await getCurrentReceivingAddress(); - int index = - current == null - ? kFrostSecureStartingIndex - : current.derivationIndex + 1; + int index = current == null + ? kFrostSecureStartingIndex + : current.derivationIndex + 1; const chain = 0; // receiving address final serializedKeys = (await getSerializedKeys())!; @@ -1528,14 +1503,10 @@ class BitcoinFrostWallet extends Wallet serializedKeys: serializedKeys, secure: true, ); - } on FrostdartException catch (e) { - if (e.errorCode == 72) { - // rust doesn't like the addressDerivationData - index++; - continue; - } else { - rethrow; - } + } on FrostBadIndexException catch (_) { + // rust doesn't like the addressDerivationData + index++; + continue; } } @@ -1627,14 +1598,10 @@ class BitcoinFrostWallet extends Wallet serializedKeys: serializedKeys, secure: true, ); - } on FrostdartException catch (e) { - if (e.errorCode == 72) { - // rust doesn't like the addressDerivationData - startingIndex++; - continue; - } else { - rethrow; - } + } on FrostBadIndexException catch (_) { + // rust doesn't like the addressDerivationData + startingIndex++; + continue; } } @@ -1657,13 +1624,12 @@ class BitcoinFrostWallet extends Wallet secure: secure, ); - final keys = frost.deserializeKeys(keys: serializedKeys); + final keys = frostInterface.getDeserializedKeys(keys: serializedKeys); - final addressString = frost.addressForKeys( - network: - cryptoCurrency.network == CryptoCurrencyNetwork.main - ? Network.Mainnet - : Network.Testnet, + final addressString = frostInterface.getAddressForKeys( + network: cryptoCurrency.network == CryptoCurrencyNetwork.main + ? frostInterface.mainnet + : frostInterface.testnet, keys: keys, addressDerivationData: addressDerivationData, secure: secure, @@ -1675,12 +1641,11 @@ class BitcoinFrostWallet extends Wallet publicKey: cryptoCurrency.addressToPubkey(address: addressString), derivationIndex: index, derivationPath: DerivationPath()..value = "$account/$change/$index", - subType: - change == 0 - ? AddressSubType.receiving - : change == 1 - ? AddressSubType.change - : AddressSubType.unknown, + subType: change == 0 + ? AddressSubType.receiving + : change == 1 + ? AddressSubType.change + : AddressSubType.unknown, type: AddressType.frostMS, zSafeFrost: secure && index >= kFrostSecureStartingIndex, ); @@ -1708,14 +1673,10 @@ class BitcoinFrostWallet extends Wallet serializedKeys: serializedKeys, secure: secure, ); - } on FrostdartException catch (e) { - if (e.errorCode == 72) { - // rust doesn't like the addressDerivationData - index++; - continue; - } else { - rethrow; - } + } on FrostBadIndexException catch (_) { + // rust doesn't like the addressDerivationData + index++; + continue; } } @@ -1746,18 +1707,17 @@ class BitcoinFrostWallet extends Wallet } Future> _fetchAddressesForElectrumXScan() async { - final allAddresses = - await mainDB - .getAddresses(walletId) - .filter() - .not() - .group( - (q) => q - .typeEqualTo(AddressType.nonWallet) - .or() - .subTypeEqualTo(AddressSubType.nonWallet), - ) - .findAll(); + final allAddresses = await mainDB + .getAddresses(walletId) + .filter() + .not() + .group( + (q) => q + .typeEqualTo(AddressType.nonWallet) + .or() + .subTypeEqualTo(AddressSubType.nonWallet), + ) + .findAll(); return allAddresses; } diff --git a/lib/wl_gen/interfaces/frost_interface.dart b/lib/wl_gen/interfaces/frost_interface.dart new file mode 100644 index 0000000000..affbda0d22 --- /dev/null +++ b/lib/wl_gen/interfaces/frost_interface.dart @@ -0,0 +1,237 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../models/isar/models/blockchain_data/utxo.dart'; +import '../../utilities/amount/amount.dart'; +import '../../utilities/extensions/extensions.dart'; +import '../../wallets/crypto_currency/crypto_currency.dart'; +import '../../wallets/models/tx_recipient.dart'; + +export '../generated/frost_interface_impl.dart'; + +abstract class FrostInterface { + const FrostInterface(); + + //==================== utility =============================================== + List getParticipants({required String multisigConfig}); + + bool validateEncodedMultisigConfig({required String encodedConfig}); + + int getThreshold({required String multisigConfig}); + + ({ + List<({String address, Amount amount})> recipients, + String changeAddress, + int feePerWeight, + List inputs, + }) + extractDataFromSignConfig({ + required String serializedKeys, + required String signConfig, + required CryptoCurrency coin, + }); + + //==================== wallet creation ======================================= + + String createMultisigConfig({ + required String name, + required int threshold, + required List participants, + }); + + ({ + String seed, + String commitments, + // Pointer multisigConfigWithNamePtr, + OpaqueWrapper multisigConfigWithNamePtr, + // Pointer secretShareMachineWrapperPtr, + OpaqueWrapper secretShareMachineWrapperPtr, + }) + startKeyGeneration({required String multisigConfig, required String myName}); + + // ({String share, Pointer secretSharesResPtr}) + ({String share, OpaqueWrapper secretSharesResPtr}) generateSecretShares({ + // required Pointer multisigConfigWithNamePtr, + required OpaqueWrapper multisigConfigWithNamePtr, + required String mySeed, + // required Pointer secretShareMachineWrapperPtr, + required OpaqueWrapper secretShareMachineWrapperPtr, + required List commitments, + }); + + ({Uint8List multisigId, String recoveryString, String serializedKeys}) + completeKeyGeneration({ + // required Pointer multisigConfigWithNamePtr, + required OpaqueWrapper multisigConfigWithNamePtr, + // required Pointer secretSharesResPtr, + required OpaqueWrapper secretSharesResPtr, + required List shares, + }); + + //=================== transaction creation =================================== + + String createSignConfig({ + required String serializedKeys, + required int network, + required List< + ({ + UTXO utxo, + Uint8List scriptPubKey, + FrostAddressDerivationData addressDerivationData, + }) + > + inputs, + required List outputs, + required String changeAddress, + required int feePerWeight, + }); + + // ({Pointer machinePtr, String preprocess}) + ({OpaqueWrapper machinePtr, String preprocess}) attemptSignConfig({ + required int network, + required String config, + required String serializedKeys, + }); + + // ({Pointer machinePtr, String share}) + ({OpaqueWrapper machinePtr, String share}) continueSigning({ + // required Pointer machinePtr, + required OpaqueWrapper machinePtr, + required List preprocesses, + }); + + String completeSigning({ + // required Pointer machinePtr, + required OpaqueWrapper machinePtr, + required List shares, + }); + + // Pointer decodedSignConfig({ + OpaqueWrapper decodedSignConfig({ + required String serializedKeys, + required String encodedConfig, + required int network, + }); + + //========================== resharing ======================================= + + String createResharerConfig({ + required int newThreshold, + required List resharers, + required List newParticipants, + }); + + // ({String resharerStart, Pointer machine}) beginResharer({ + ({String resharerStart, OpaqueWrapper machine}) beginResharer({ + required String serializedKeys, + required String config, + }); + + /// expects [resharerStarts] of length equal to resharers. + // ({String resharedStart, Pointer prior}) beginReshared({ + ({String resharedStart, OpaqueWrapper prior}) beginReshared({ + required String myName, + required String resharerConfig, + required List resharerStarts, + }); + + /// expects [encryptionKeysOfResharedTo] of length equal to new participants + String finishResharer({ + // required StartResharerRes machine, + required OpaqueWrapper machine, + required List encryptionKeysOfResharedTo, + }); + + /// expects [resharerCompletes] of length equal to resharers + ({String multisigConfig, String serializedKeys, String resharedId}) + finishReshared({ + // required StartResharedRes prior, + required OpaqueWrapper prior, + required List resharerCompletes, + }); + + // Pointer decodedResharerConfig({ + OpaqueWrapper decodedResharerConfig({required String resharerConfig}); + + ({int newThreshold, Map resharers, List newParticipants}) + extractResharerConfigData({required String rConfig}); + + Uint8List getMultisigSalt({required String multisigConfig}); + int participantIndexFromKeys({required String serializedKeys}); + int getMultisigThreshold({required String multisigConfig}); + int thresholdFromKeys({required String serializedKeys}); + Uint8List getResharerSalt({required String resharerConfig}); + + OpaqueWrapper getDeserializedKeys({required String keys}); + String getAddressForKeys({ + required OpaqueWrapper keys, + required int network, + required FrostAddressDerivationData addressDerivationData, + required bool secure, + }); + + int get mainnet; + int get testnet; + + String encodeRConfig(String config, Map resharers) { + return base64Encode("$config@${jsonEncode(resharers)}".toUint8ListFromUtf8); + } + + String decodeRConfig(String rConfig) { + return base64Decode(rConfig).toUtf8String.split("@").first; + } +} + +final class FrostInsufficientFundsException implements Exception {} + +final class FrostBadIndexException implements Exception {} + +final class OpaqueWrapper { + final Object _value; + + const OpaqueWrapper(this._value); + + T getValue() { + if (_value is T) return _value as T; + throw Exception( + "OpaqueWrapper.getValue type of ${_value.runtimeType} is not ${T.runtimeType}", + ); + } + + @override + String toString() => "OpaqueWrapper(${_value.runtimeType})"; +} + +typedef FrostAddressDerivationData = ({ + int account, + bool change, + int index, + bool secure, +}); + +class FrostOutput { + final Uint8List hash; + final int vout; + final int value; + final Uint8List scriptPubKey; + + final FrostAddressDerivationData? addressDerivationData; + + FrostOutput({ + required this.hash, + required this.vout, + required this.value, + required this.scriptPubKey, + required this.addressDerivationData, + }); + + @override + String toString() => + 'FrostOutput{' + 'hash: $hash, ' + 'vout: $vout, ' + 'value: $value, ' + 'scriptPubKey: $scriptPubKey, ' + 'addressDerivationData: $addressDerivationData' + '}'; +} diff --git a/lib/services/frost.dart b/tool/wl_templates/FROST_frost_interface_impl.template.dart similarity index 64% rename from lib/services/frost.dart rename to tool/wl_templates/FROST_frost_interface_impl.template.dart index 33066de925..072af512d3 100644 --- a/lib/services/frost.dart +++ b/tool/wl_templates/FROST_frost_interface_impl.template.dart @@ -1,3 +1,4 @@ +//ON import 'dart:convert'; import 'dart:ffi'; import 'dart:typed_data'; @@ -7,238 +8,105 @@ import 'package:frostdart/frostdart_bindings_generated.dart'; import 'package:frostdart/output.dart'; import 'package:frostdart/util.dart'; -import '../models/isar/models/blockchain_data/utxo.dart'; -import '../utilities/amount/amount.dart'; -import '../utilities/extensions/extensions.dart'; -import '../utilities/logger.dart'; -import '../wallets/crypto_currency/crypto_currency.dart'; -import '../wallets/models/tx_recipient.dart'; +import '../../models/isar/models/blockchain_data/utxo.dart'; +import '../../utilities/amount/amount.dart'; +import '../../utilities/extensions/extensions.dart'; +import '../../utilities/logger.dart'; +import '../../wallets/crypto_currency/crypto_currency.dart'; +import '../../wallets/models/tx_recipient.dart'; +//END_ON +import '../interfaces/frost_interface.dart'; -abstract class Frost { - //==================== utility =============================================== - static List getParticipants({required String multisigConfig}) { - try { - final numberOfParticipants = multisigParticipants( - multisigConfig: multisigConfig, - ); - - final List participants = []; - for (int i = 0; i < numberOfParticipants; i++) { - participants.add( - multisigParticipant(multisigConfig: multisigConfig, index: i), - ); - } - - return participants; - } catch (e, s) { - Logging.instance.f("getParticipants failed: ", error: e, stackTrace: s); - rethrow; - } - } - - static bool validateEncodedMultisigConfig({required String encodedConfig}) { - try { - decodeMultisigConfig(multisigConfig: encodedConfig); - return true; - } catch (e, s) { - Logging.instance.f( - "validateEncodedMultisigConfig failed: ", - error: e, - stackTrace: s, - ); - return false; - } - } +FrostInterface get frostInterface => _getInterface(); - static int getThreshold({required String multisigConfig}) { - try { - final threshold = multisigThreshold(multisigConfig: multisigConfig); +//OFF +FrostInterface _getInterface() => throw Exception("FROST not enabled!"); - return threshold; - } catch (e, s) { - Logging.instance.f("getThreshold failed: ", error: e, stackTrace: s); - rethrow; - } - } +//END_OFF +//ON +FrostInterface _getInterface() => _FrostInterfaceImpl(); - static ({ - List<({String address, Amount amount})> recipients, - String changeAddress, - int feePerWeight, - List inputs, - }) - extractDataFromSignConfig({ +final class _FrostInterfaceImpl extends FrostInterface { + @override + ({OpaqueWrapper machinePtr, String preprocess}) attemptSignConfig({ + required int network, + required String config, required String serializedKeys, - required String signConfig, - required CryptoCurrency coin, }) { try { - final network = - coin.network.isTestNet ? Network.Testnet : Network.Mainnet; - final signConfigPointer = decodedSignConfig( - encodedConfig: signConfig, - network: network, - serializedKeys: serializedKeys, - ); + final keys = deserializeKeys(keys: serializedKeys); - // get various data from config - final feePerWeight = signFeePerWeight( - signConfigPointer: signConfigPointer, - ); - final changeAddress = signChange(signConfigPointer: signConfigPointer); - final recipientsCount = signPayments( - signConfigPointer: signConfigPointer, + final attemptSignRes = attemptSign( + thresholdKeysWrapperPointer: keys, + network: network, + signConfig: config, ); - // get tx recipient info - final List<({String address, Amount amount})> recipients = []; - for (int i = 0; i < recipientsCount; i++) { - final String address = signPaymentAddress( - signConfigPointer: signConfigPointer, - index: i, - ); - final int amount = signPaymentAmount( - signConfigPointer: signConfigPointer, - index: i, - ); - recipients.add(( - address: address, - amount: Amount( - rawValue: BigInt.from(amount), - fractionDigits: coin.fractionDigits, - ), - )); - } - - // get utxos - final count = signInputs(signConfigPointer: signConfigPointer); - final List outputs = []; - for (int i = 0; i < count; i++) { - final output = signInput( - thresholdKeysWrapperPointer: deserializeKeys(keys: serializedKeys), - signConfig: signConfig, - index: i, - network: network, - ); - - outputs.add(output); - } - return ( - recipients: recipients, - changeAddress: changeAddress, - feePerWeight: feePerWeight, - inputs: outputs, + preprocess: attemptSignRes.ref.preprocess.toDartString(), + machinePtr: OpaqueWrapper(attemptSignRes.ref.machine), ); } catch (e, s) { - Logging.instance.f( - "extractDataFromSignConfig failed: ", - error: e, - stackTrace: s, - ); + Logging.instance.f("attemptSignConfig failed: ", error: e, stackTrace: s); rethrow; } } - //==================== wallet creation ======================================= - - static String createMultisigConfig({ - required String name, - required int threshold, - required List participants, + @override + ({OpaqueWrapper prior, String resharedStart}) beginReshared({ + required String myName, + required String resharerConfig, + required List resharerStarts, }) { try { - final config = newMultisigConfig( - name: name, - threshold: threshold, - participants: participants, - ); - - return config; - } catch (e, s) { - Logging.instance.f( - "createMultisigConfig failed: ", - error: e, - stackTrace: s, - ); - rethrow; - } - } - - static ({ - String seed, - String commitments, - Pointer multisigConfigWithNamePtr, - Pointer secretShareMachineWrapperPtr, - }) - startKeyGeneration({required String multisigConfig, required String myName}) { - try { - final startKeyGenResPtr = startKeyGen( - multisigConfig: multisigConfig, + final result = startReshared( + newMultisigName: 'unused_property', myName: myName, - language: Language.english, + resharerConfig: resharerConfig, + resharerStarts: resharerStarts, ); - - final seed = startKeyGenResPtr.ref.seed.toDartString(); - final commitments = startKeyGenResPtr.ref.commitments.toDartString(); - final configWithNamePtr = startKeyGenResPtr.ref.config; - final machinePtr = startKeyGenResPtr.ref.machine; - return ( - seed: seed, - commitments: commitments, - multisigConfigWithNamePtr: configWithNamePtr, - secretShareMachineWrapperPtr: machinePtr, + resharedStart: result.encoded, + prior: OpaqueWrapper(result.machine), ); } catch (e, s) { - Logging.instance.f( - "startKeyGeneration failed: ", - error: e, - stackTrace: s, - ); + Logging.instance.f("beginReshared failed: ", error: e, stackTrace: s); rethrow; } } - static ({String share, Pointer secretSharesResPtr}) - generateSecretShares({ - required Pointer multisigConfigWithNamePtr, - required String mySeed, - required Pointer secretShareMachineWrapperPtr, - required List commitments, + @override + ({OpaqueWrapper machine, String resharerStart}) beginResharer({ + required String serializedKeys, + required String config, }) { try { - final secretSharesResPtr = getSecretShares( - multisigConfigWithName: multisigConfigWithNamePtr, - seed: mySeed, - language: Language.english, - machine: secretShareMachineWrapperPtr, - commitments: commitments, + final result = startResharer( + serializedKeys: serializedKeys, + config: config, ); - final share = secretSharesResPtr.ref.shares.toDartString(); - - return (share: share, secretSharesResPtr: secretSharesResPtr); - } catch (e, s) { - Logging.instance.f( - "generateSecretShares failed: ", - error: e, - stackTrace: s, + return ( + resharerStart: result.encoded, + machine: OpaqueWrapper(result.machine), ); + } catch (e, s) { + Logging.instance.f("beginResharer failed: ", error: e, stackTrace: s); rethrow; } } - static ({Uint8List multisigId, String recoveryString, String serializedKeys}) + @override + ({Uint8List multisigId, String recoveryString, String serializedKeys}) completeKeyGeneration({ - required Pointer multisigConfigWithNamePtr, - required Pointer secretSharesResPtr, + required OpaqueWrapper multisigConfigWithNamePtr, + required OpaqueWrapper secretSharesResPtr, required List shares, }) { try { final keyGenResPtr = completeKeyGen( - multisigConfigWithName: multisigConfigWithNamePtr, - machineAndCommitments: secretSharesResPtr, + multisigConfigWithName: multisigConfigWithNamePtr.getValue(), + machineAndCommitments: secretSharesResPtr.getValue(), shares: shares, ); @@ -268,97 +136,38 @@ abstract class Frost { } } - //=================== transaction creation =================================== - - static String createSignConfig({ - required String serializedKeys, - required int network, - required List< - ({ - UTXO utxo, - Uint8List scriptPubKey, - AddressDerivationData addressDerivationData, - }) - > - inputs, - required List outputs, - required String changeAddress, - required int feePerWeight, - }) { - try { - final signConfig = newSignConfig( - thresholdKeysWrapperPointer: deserializeKeys(keys: serializedKeys), - network: network, - outputs: - inputs - .map( - (e) => Output( - hash: e.utxo.txid.toUint8ListFromHex, - vout: e.utxo.vout, - value: e.utxo.value, - scriptPubKey: e.scriptPubKey, - addressDerivationData: e.addressDerivationData, - ), - ) - .toList(), - paymentAddresses: outputs.map((e) => e.address).toList(), - paymentAmounts: outputs.map((e) => e.amount.raw.toInt()).toList(), - change: changeAddress, - feePerWeight: feePerWeight, - ); - - return signConfig; - } catch (e, s) { - Logging.instance.f("createSignConfig failed: ", error: e, stackTrace: s); - rethrow; - } - } - - static ({ - Pointer machinePtr, - String preprocess, - }) - attemptSignConfig({ - required int network, - required String config, - required String serializedKeys, + @override + String completeSigning({ + required OpaqueWrapper machinePtr, + required List shares, }) { try { - final keys = deserializeKeys(keys: serializedKeys); - - final attemptSignRes = attemptSign( - thresholdKeysWrapperPointer: keys, - network: network, - signConfig: config, + final rawTransaction = completeSign( + machine: machinePtr.getValue(), + shares: shares, ); - return ( - preprocess: attemptSignRes.ref.preprocess.toDartString(), - machinePtr: attemptSignRes.ref.machine, - ); + return rawTransaction; } catch (e, s) { - Logging.instance.f("attemptSignConfig failed: ", error: e, stackTrace: s); + Logging.instance.f("completeSigning failed: ", error: e, stackTrace: s); rethrow; } } - static ({ - Pointer machinePtr, - String share, - }) - continueSigning({ - required Pointer machinePtr, + @override + ({OpaqueWrapper machinePtr, String share}) continueSigning({ + required OpaqueWrapper machinePtr, required List preprocesses, }) { try { final continueSignRes = continueSign( - machine: machinePtr, + machine: machinePtr.getValue(), preprocesses: preprocesses, ); return ( share: continueSignRes.ref.preprocess.toDartString(), - machinePtr: continueSignRes.ref.machine, + machinePtr: OpaqueWrapper(continueSignRes.ref.machine), ); } catch (e, s) { Logging.instance.f("continueSigning failed: ", error: e, stackTrace: s); @@ -366,41 +175,32 @@ abstract class Frost { } } - static String completeSigning({ - required Pointer machinePtr, - required List shares, + @override + String createMultisigConfig({ + required String name, + required int threshold, + required List participants, }) { try { - final rawTransaction = completeSign(machine: machinePtr, shares: shares); + final config = newMultisigConfig( + name: name, + threshold: threshold, + participants: participants, + ); - return rawTransaction; + return config; } catch (e, s) { - Logging.instance.f("completeSigning failed: ", error: e, stackTrace: s); - rethrow; - } - } - - static Pointer decodedSignConfig({ - required String serializedKeys, - required String encodedConfig, - required int network, - }) { - try { - final configPtr = decodeSignConfig( - thresholdKeysWrapperPointer: deserializeKeys(keys: serializedKeys), - encodedSignConfig: encodedConfig, - network: network, + Logging.instance.f( + "createMultisigConfig failed: ", + error: e, + stackTrace: s, ); - return configPtr; - } catch (e, s) { - Logging.instance.f("decodedSignConfig failed: ", error: e, stackTrace: s); rethrow; } } - //========================== resharing ======================================= - - static String createResharerConfig({ + @override + String createResharerConfig({ required int newThreshold, required List resharers, required List newParticipants, @@ -423,87 +223,176 @@ abstract class Frost { } } - static ({String resharerStart, Pointer machine}) - beginResharer({required String serializedKeys, required String config}) { + @override + String createSignConfig({ + required String serializedKeys, + required int network, + required List< + ({ + Uint8List scriptPubKey, + UTXO utxo, + FrostAddressDerivationData addressDerivationData, + }) + > + inputs, + required List outputs, + required String changeAddress, + required int feePerWeight, + }) { try { - final result = startResharer( - serializedKeys: serializedKeys, - config: config, + final signConfig = newSignConfig( + thresholdKeysWrapperPointer: deserializeKeys(keys: serializedKeys), + network: network, + outputs: inputs + .map( + (e) => Output( + hash: e.utxo.txid.toUint8ListFromHex, + vout: e.utxo.vout, + value: e.utxo.value, + scriptPubKey: e.scriptPubKey, + addressDerivationData: e.addressDerivationData, + ), + ) + .toList(), + paymentAddresses: outputs.map((e) => e.address).toList(), + paymentAmounts: outputs.map((e) => e.amount.raw.toInt()).toList(), + change: changeAddress, + feePerWeight: feePerWeight, ); - return (resharerStart: result.encoded, machine: result.machine); + return signConfig; } catch (e, s) { - Logging.instance.f("beginResharer failed: ", error: e, stackTrace: s); + Logging.instance.f("createSignConfig failed: ", error: e, stackTrace: s); + + if (e is FrostdartException && e.errorCode == NOT_ENOUGH_FUNDS_ERROR) { + throw FrostInsufficientFundsException(); + } + rethrow; } } - /// expects [resharerStarts] of length equal to resharers. - static ({String resharedStart, Pointer prior}) - beginReshared({ - required String myName, - required String resharerConfig, - required List resharerStarts, - }) { + @override + OpaqueWrapper decodedResharerConfig({required String resharerConfig}) { try { - final result = startReshared( - newMultisigName: 'unused_property', - myName: myName, - resharerConfig: resharerConfig, - resharerStarts: resharerStarts, - ); - return (resharedStart: result.encoded, prior: result.machine); + final config = decodeResharerConfig(resharerConfig: resharerConfig); + + return OpaqueWrapper(config); } catch (e, s) { - Logging.instance.f("beginReshared failed: ", error: e, stackTrace: s); + Logging.instance.f( + "decodedResharerConfig failed: ", + error: e, + stackTrace: s, + ); rethrow; } } - /// expects [encryptionKeysOfResharedTo] of length equal to new participants - static String finishResharer({ - required StartResharerRes machine, - required List encryptionKeysOfResharedTo, + @override + OpaqueWrapper decodedSignConfig({ + required String serializedKeys, + required String encodedConfig, + required int network, }) { try { - final result = completeResharer( - machine: machine, - encryptionKeysOfResharedTo: encryptionKeysOfResharedTo, + final configPtr = decodeSignConfig( + thresholdKeysWrapperPointer: deserializeKeys(keys: serializedKeys), + encodedSignConfig: encodedConfig, + network: network, ); - return result; + return OpaqueWrapper(configPtr); } catch (e, s) { - Logging.instance.f("finishResharer failed: ", error: e, stackTrace: s); + Logging.instance.f("decodedSignConfig failed: ", error: e, stackTrace: s); rethrow; } } - /// expects [resharerCompletes] of length equal to resharers - static ({String multisigConfig, String serializedKeys, String resharedId}) - finishReshared({ - required StartResharedRes prior, - required List resharerCompletes, + @override + ({ + String changeAddress, + int feePerWeight, + List inputs, + List<({String address, Amount amount})> recipients, + }) + extractDataFromSignConfig({ + required String serializedKeys, + required String signConfig, + required CryptoCurrency coin, }) { try { - final result = completeReshared( - prior: prior, - resharerCompletes: resharerCompletes, + final network = coin.network.isTestNet + ? Network.Testnet + : Network.Mainnet; + final signConfigPointer = decodedSignConfig( + encodedConfig: signConfig, + network: network, + serializedKeys: serializedKeys, ); - return result; - } catch (e, s) { - Logging.instance.f("finishReshared failed: ", error: e, stackTrace: s); - rethrow; - } - } - static Pointer decodedResharerConfig({ - required String resharerConfig, - }) { - try { - final config = decodeResharerConfig(resharerConfig: resharerConfig); + // get various data from config + final feePerWeight = signFeePerWeight( + signConfigPointer: signConfigPointer.getValue(), + ); + final changeAddress = signChange( + signConfigPointer: signConfigPointer.getValue(), + ); + final recipientsCount = signPayments( + signConfigPointer: signConfigPointer.getValue(), + ); - return config; + // get tx recipient info + final List<({String address, Amount amount})> recipients = []; + for (int i = 0; i < recipientsCount; i++) { + final String address = signPaymentAddress( + signConfigPointer: signConfigPointer.getValue(), + index: i, + ); + final int amount = signPaymentAmount( + signConfigPointer: signConfigPointer.getValue(), + index: i, + ); + recipients.add(( + address: address, + amount: Amount( + rawValue: BigInt.from(amount), + fractionDigits: coin.fractionDigits, + ), + )); + } + + // get utxos + final count = signInputs(signConfigPointer: signConfigPointer.getValue()); + final List outputs = []; + for (int i = 0; i < count; i++) { + final output = signInput( + thresholdKeysWrapperPointer: deserializeKeys(keys: serializedKeys), + signConfig: signConfig, + index: i, + network: network, + ); + + outputs.add(output); + } + + return ( + recipients: recipients, + changeAddress: changeAddress, + feePerWeight: feePerWeight, + inputs: outputs + .map( + (e) => FrostOutput( + hash: e.hash, + vout: e.vout, + value: e.value, + scriptPubKey: e.scriptPubKey, + addressDerivationData: e.addressDerivationData, + ), + ) + .toList(), + ); } catch (e, s) { Logging.instance.f( - "decodedResharerConfig failed: ", + "extractDataFromSignConfig failed: ", error: e, stackTrace: s, ); @@ -511,11 +400,8 @@ abstract class Frost { } } - static ({ - int newThreshold, - Map resharers, - List newParticipants, - }) + @override + ({List newParticipants, int newThreshold, Map resharers}) extractResharerConfigData({required String rConfig}) { final decoded = _decodeRConfigWithResharers(rConfig); final resharerConfig = decoded.config; @@ -524,13 +410,13 @@ abstract class Frost { final newThreshold = resharerNewThreshold( resharerConfigPointer: decodedResharerConfig( resharerConfig: resharerConfig, - ), + ).getValue(), ); final resharersCount = resharerResharers( resharerConfigPointer: decodedResharerConfig( resharerConfig: resharerConfig, - ), + ).getValue(), ); final List resharers = []; for (int i = 0; i < resharersCount; i++) { @@ -538,7 +424,7 @@ abstract class Frost { resharerResharer( resharerConfigPointer: decodedResharerConfig( resharerConfig: resharerConfig, - ), + ).getValue(), index: i, ), ); @@ -547,7 +433,7 @@ abstract class Frost { final newParticipantsCount = resharerNewParticipants( resharerConfigPointer: decodedResharerConfig( resharerConfig: resharerConfig, - ), + ).getValue(), ); final List newParticipants = []; for (int i = 0; i < newParticipantsCount; i++) { @@ -555,7 +441,7 @@ abstract class Frost { resharerNewParticipant( resharerConfigPointer: decodedResharerConfig( resharerConfig: resharerConfig, - ), + ).getValue(), index: i, ), ); @@ -585,16 +471,210 @@ abstract class Frost { } } - static String encodeRConfig(String config, Map resharers) { - return base64Encode("$config@${jsonEncode(resharers)}".toUint8ListFromUtf8); + @override + ({String multisigConfig, String resharedId, String serializedKeys}) + finishReshared({ + required OpaqueWrapper prior, + required List resharerCompletes, + }) { + try { + final result = completeReshared( + prior: prior.getValue(), + resharerCompletes: resharerCompletes, + ); + return result; + } catch (e, s) { + Logging.instance.f("finishReshared failed: ", error: e, stackTrace: s); + rethrow; + } + } + + @override + String finishResharer({ + required OpaqueWrapper machine, + required List encryptionKeysOfResharedTo, + }) { + try { + final result = completeResharer( + machine: machine.getValue(), + encryptionKeysOfResharedTo: encryptionKeysOfResharedTo, + ); + return result; + } catch (e, s) { + Logging.instance.f("finishResharer failed: ", error: e, stackTrace: s); + rethrow; + } + } + + @override + ({OpaqueWrapper secretSharesResPtr, String share}) generateSecretShares({ + required OpaqueWrapper multisigConfigWithNamePtr, + required String mySeed, + required OpaqueWrapper secretShareMachineWrapperPtr, + required List commitments, + }) { + try { + final secretSharesResPtr = getSecretShares( + multisigConfigWithName: multisigConfigWithNamePtr.getValue(), + seed: mySeed, + language: Language.english, + machine: secretShareMachineWrapperPtr.getValue(), + commitments: commitments, + ); + + final share = secretSharesResPtr.ref.shares.toDartString(); + + return ( + share: share, + secretSharesResPtr: OpaqueWrapper(secretSharesResPtr), + ); + } catch (e, s) { + Logging.instance.f( + "generateSecretShares failed: ", + error: e, + stackTrace: s, + ); + rethrow; + } + } + + @override + List getParticipants({required String multisigConfig}) { + try { + final numberOfParticipants = multisigParticipants( + multisigConfig: multisigConfig, + ); + + final List participants = []; + for (int i = 0; i < numberOfParticipants; i++) { + participants.add( + multisigParticipant(multisigConfig: multisigConfig, index: i), + ); + } + + return participants; + } catch (e, s) { + Logging.instance.f("getParticipants failed: ", error: e, stackTrace: s); + rethrow; + } + } + + @override + int getThreshold({required String multisigConfig}) { + try { + final threshold = multisigThreshold(multisigConfig: multisigConfig); + + return threshold; + } catch (e, s) { + Logging.instance.f("getThreshold failed: ", error: e, stackTrace: s); + rethrow; + } + } + + @override + ({ + String commitments, + OpaqueWrapper multisigConfigWithNamePtr, + OpaqueWrapper secretShareMachineWrapperPtr, + String seed, + }) + startKeyGeneration({required String multisigConfig, required String myName}) { + try { + final startKeyGenResPtr = startKeyGen( + multisigConfig: multisigConfig, + myName: myName, + language: Language.english, + ); + + final seed = startKeyGenResPtr.ref.seed.toDartString(); + final commitments = startKeyGenResPtr.ref.commitments.toDartString(); + final configWithNamePtr = startKeyGenResPtr.ref.config; + final machinePtr = startKeyGenResPtr.ref.machine; + + return ( + seed: seed, + commitments: commitments, + multisigConfigWithNamePtr: OpaqueWrapper(configWithNamePtr), + secretShareMachineWrapperPtr: OpaqueWrapper(machinePtr), + ); + } catch (e, s) { + Logging.instance.f( + "startKeyGeneration failed: ", + error: e, + stackTrace: s, + ); + rethrow; + } + } + + @override + bool validateEncodedMultisigConfig({required String encodedConfig}) { + try { + decodeMultisigConfig(multisigConfig: encodedConfig); + return true; + } catch (e, s) { + Logging.instance.f( + "validateEncodedMultisigConfig failed: ", + error: e, + stackTrace: s, + ); + return false; + } } - static String decodeRConfig(String rConfig) { - return base64Decode(rConfig).toUtf8String.split("@").first; + @override + Uint8List getMultisigSalt({required String multisigConfig}) => + multisigSalt(multisigConfig: multisigConfig); + + @override + int participantIndexFromKeys({required String serializedKeys}) => + getParticipantIndexFromKeys(serializedKeys: serializedKeys); + + @override + int getMultisigThreshold({required String multisigConfig}) => + multisigThreshold(multisigConfig: multisigConfig); + + @override + int thresholdFromKeys({required String serializedKeys}) => + getThresholdFromKeys(serializedKeys: serializedKeys); + + @override + Uint8List getResharerSalt({required String resharerConfig}) => + resharerSalt(resharerConfig: resharerConfig); + + @override + OpaqueWrapper getDeserializedKeys({required String keys}) => + OpaqueWrapper(deserializeKeys(keys: keys)); + + @override + String getAddressForKeys({ + required OpaqueWrapper keys, + required int network, + required FrostAddressDerivationData addressDerivationData, + required bool secure, + }) { + try { + return addressForKeys( + network: network, + keys: keys.getValue(), + addressDerivationData: addressDerivationData, + secure: secure, + ); + } on FrostdartException catch (e) { + if (e.errorCode == 72) throw FrostBadIndexException(); + rethrow; + } } - static ({Map resharers, String config}) - _decodeRConfigWithResharers(String rConfig) { + @override + int get mainnet => Network.Mainnet; + + @override + int get testnet => Network.Testnet; + + ({Map resharers, String config}) _decodeRConfigWithResharers( + String rConfig, + ) { final parts = base64Decode(rConfig).toUtf8String.split("@"); final config = parts[0]; @@ -603,3 +683,5 @@ abstract class Frost { return (resharers: resharers, config: config); } } + +//END_ON From 5f12db243881eaf298712516626d4bf95691c174 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Oct 2025 15:56:00 -0600 Subject: [PATCH 133/178] implement optional import of flutter_libsparkmobile --- lib/db/sqlite/firo_cache.dart | 10 +- lib/db/sqlite/firo_cache_writer.dart | 7 +- .../spark_names/buy_spark_name_view.dart | 238 +++--- .../buy_spark_name_option_widget.dart | 138 ++-- lib/utilities/logger.dart | 30 +- .../spark_interface.dart | 687 ++++++++---------- .../interfaces/lib_spark_interface.dart | 252 +++++++ pubspec.lock | 4 +- ...IRO_lib_spark_interface_impl.template.dart | 290 ++++++++ 9 files changed, 1047 insertions(+), 609 deletions(-) create mode 100644 lib/wl_gen/interfaces/lib_spark_interface.dart create mode 100644 tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart diff --git a/lib/db/sqlite/firo_cache.dart b/lib/db/sqlite/firo_cache.dart index 4478f421f4..9a0d83f6a2 100644 --- a/lib/db/sqlite/firo_cache.dart +++ b/lib/db/sqlite/firo_cache.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'dart:io'; import 'dart:isolate'; -import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart'; import 'package:mutex/mutex.dart'; import 'package:sqlite3/sqlite3.dart'; import 'package:uuid/uuid.dart'; @@ -13,6 +12,7 @@ import '../../utilities/extensions/extensions.dart'; import '../../utilities/logger.dart'; import '../../utilities/stack_file_system.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; +import '../../wl_gen/interfaces/lib_spark_interface.dart'; part 'firo_cache_coordinator.dart'; part 'firo_cache_reader.dart'; @@ -30,12 +30,12 @@ abstract class _FiroCache { static String sparkSetCacheFileName(CryptoCurrencyNetwork network) => network == CryptoCurrencyNetwork.main - ? "spark_set_v$_setCacheVersion.sqlite3" - : "spark_set_v${_setCacheVersion}_${network.name}.sqlite3"; + ? "spark_set_v$_setCacheVersion.sqlite3" + : "spark_set_v${_setCacheVersion}_${network.name}.sqlite3"; static String sparkUsedTagsCacheFileName(CryptoCurrencyNetwork network) => network == CryptoCurrencyNetwork.main - ? "spark_tags_v$_tagsCacheVersion.sqlite3" - : "spark_tags_v${_tagsCacheVersion}_${network.name}.sqlite3"; + ? "spark_tags_v$_tagsCacheVersion.sqlite3" + : "spark_tags_v${_tagsCacheVersion}_${network.name}.sqlite3"; static final Map _setCacheDB = {}; static final Map _usedTagsCacheDB = {}; diff --git a/lib/db/sqlite/firo_cache_writer.dart b/lib/db/sqlite/firo_cache_writer.dart index 09383601ea..fadc3eb91c 100644 --- a/lib/db/sqlite/firo_cache_writer.dart +++ b/lib/db/sqlite/firo_cache_writer.dart @@ -15,10 +15,9 @@ class FCResult { /// returns true if successful, otherwise some exception FCResult _updateSparkUsedTagsWith(Database db, List> tags) { // hash the tags here since this function is called in a background isolate - final hashedTags = - LibSpark.hashTags( - base64Tags: tags.map((e) => e[0] as String).toList(), - ).toList(); + final hashedTags = hashTags( + base64Tags: tags.map((e) => e[0] as String).toList(), + ).toList(); if (hashedTags.isEmpty) { // nothing to add, return early return FCResult(success: true); diff --git a/lib/pages/spark_names/buy_spark_name_view.dart b/lib/pages/spark_names/buy_spark_name_view.dart index b05d6b2260..478893dc84 100644 --- a/lib/pages/spark_names/buy_spark_name_view.dart +++ b/lib/pages/spark_names/buy_spark_name_view.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:decimal/decimal.dart'; import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:isar_community/isar.dart'; @@ -32,6 +31,7 @@ import '../../widgets/custom_buttons/app_bar_icon_button.dart'; import '../../widgets/custom_buttons/blue_text_button.dart'; import '../../widgets/dialogs/s_dialog.dart'; import '../../widgets/rounded_white_container.dart'; +import '../../wl_gen/interfaces/lib_spark_interface.dart'; import 'confirm_spark_name_transaction_view.dart'; class BuySparkNameView extends ConsumerStatefulWidget { @@ -108,16 +108,15 @@ class _BuySparkNameViewState extends ConsumerState { throw Exception("Invalid Spark address selected"); } - final myAddresses = - await wallet.mainDB.isar.addresses - .where() - .walletIdEqualTo(widget.walletId) - .filter() - .typeEqualTo(AddressType.spark) - .and() - .subTypeEqualTo(AddressSubType.receiving) - .valueProperty() - .findAll(); + final myAddresses = await wallet.mainDB.isar.addresses + .where() + .walletIdEqualTo(widget.walletId) + .filter() + .typeEqualTo(AddressType.spark) + .and() + .subTypeEqualTo(AddressSubType.receiving) + .valueProperty() + .findAll(); if (!myAddresses.contains(chosenAddress)) { throw Exception("Selected Spark address does not belong to this wallet"); @@ -137,30 +136,28 @@ class _BuySparkNameViewState extends ConsumerState { if (_preRegLock) return; _preRegLock = true; try { - final txData = - (await showLoading( - whileFuture: _preRegFuture(), - context: context, - message: "Preparing transaction...", - onException: (e) { - throw e; - }, - ))!; + final txData = (await showLoading( + whileFuture: _preRegFuture(), + context: context, + message: "Preparing transaction...", + onException: (e) { + throw e; + }, + ))!; if (mounted) { if (Util.isDesktop) { await showDialog( context: context, - builder: - (context) => SDialog( - child: SizedBox( - width: 580, - child: ConfirmSparkNameTransactionView( - txData: txData, - walletId: widget.walletId, - ), - ), + builder: (context) => SDialog( + child: SizedBox( + width: 580, + child: ConfirmSparkNameTransactionView( + txData: txData, + walletId: widget.walletId, ), + ), + ), ); } else { await Navigator.of(context).pushNamed( @@ -180,13 +177,12 @@ class _BuySparkNameViewState extends ConsumerState { await showDialog( context: context, - builder: - (_) => StackOkDialog( - title: "Error", - message: err, - desktopPopRootNavigator: Util.isDesktop, - maxWidth: Util.isDesktop ? 600 : null, - ), + builder: (_) => StackOkDialog( + title: "Error", + message: err, + desktopPopRootNavigator: Util.isDesktop, + maxWidth: Util.isDesktop ? 600 : null, + ), ); } } finally { @@ -260,10 +256,9 @@ class _BuySparkNameViewState extends ConsumerState { ); }, child: Column( - crossAxisAlignment: - Util.isDesktop - ? CrossAxisAlignment.start - : CrossAxisAlignment.stretch, + crossAxisAlignment: Util.isDesktop + ? CrossAxisAlignment.start + : CrossAxisAlignment.stretch, children: [ RoundedWhiteContainer( padding: EdgeInsets.all(Util.isDesktop ? 0 : 12), @@ -272,27 +267,23 @@ class _BuySparkNameViewState extends ConsumerState { children: [ Text( "Name", - style: - Util.isDesktop - ? STextStyles.w500_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ) - : STextStyles.w500_12(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ), + style: Util.isDesktop + ? STextStyles.w500_14(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ) + : STextStyles.w500_12(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ), ), Text( widget.name, - style: - Util.isDesktop - ? STextStyles.w500_14(context) - : STextStyles.w500_12(context), + style: Util.isDesktop + ? STextStyles.w500_14(context) + : STextStyles.w500_12(context), ), ], ), @@ -307,20 +298,17 @@ class _BuySparkNameViewState extends ConsumerState { children: [ Text( "Spark address", - style: - Util.isDesktop - ? STextStyles.w500_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ) - : STextStyles.w500_12(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ), + style: Util.isDesktop + ? STextStyles.w500_14(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ) + : STextStyles.w500_12(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ), ), CustomTextButton( text: "Use current", @@ -361,20 +349,17 @@ class _BuySparkNameViewState extends ConsumerState { children: [ Text( "Additional info", - style: - Util.isDesktop - ? STextStyles.w500_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ) - : STextStyles.w500_12(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ), + style: Util.isDesktop + ? STextStyles.w500_14(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ) + : STextStyles.w500_12(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ), ), ], ), @@ -410,20 +395,17 @@ class _BuySparkNameViewState extends ConsumerState { children: [ Text( "${isRenewal ? "Renew" : "Register"} for", - style: - Util.isDesktop - ? STextStyles.w500_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ) - : STextStyles.w500_12(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ), + style: Util.isDesktop + ? STextStyles.w500_14(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ) + : STextStyles.w500_12(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ), ), SizedBox( width: Util.isDesktop ? 180 : 140, @@ -451,10 +433,9 @@ class _BuySparkNameViewState extends ConsumerState { isExpanded: true, buttonStyleData: ButtonStyleData( decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -467,10 +448,9 @@ class _BuySparkNameViewState extends ConsumerState { Assets.svg.chevronDown, width: 12, height: 6, - color: - Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, ), ), ), @@ -479,10 +459,9 @@ class _BuySparkNameViewState extends ConsumerState { elevation: 0, maxHeight: 250, decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -508,20 +487,17 @@ class _BuySparkNameViewState extends ConsumerState { children: [ Text( "Cost", - style: - Util.isDesktop - ? STextStyles.w500_14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ) - : STextStyles.w500_12(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemLabel, - ), + style: Util.isDesktop + ? STextStyles.w500_14(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ) + : STextStyles.w500_12(context).copyWith( + color: Theme.of( + context, + ).extension()!.infoItemLabel, + ), ), Text( ref @@ -529,15 +505,15 @@ class _BuySparkNameViewState extends ConsumerState { .format( Amount.fromDecimal( Decimal.fromInt( - kStandardSparkNamesFee[widget.name.length] * _years, + libSpark.standardSparkNamesFee[widget.name.length] * + _years, ), fractionDigits: coin.fractionDigits, ), ), - style: - Util.isDesktop - ? STextStyles.w500_14(context) - : STextStyles.w500_12(context), + style: Util.isDesktop + ? STextStyles.w500_14(context) + : STextStyles.w500_12(context), ), ], ), diff --git a/lib/pages/spark_names/sub_widgets/buy_spark_name_option_widget.dart b/lib/pages/spark_names/sub_widgets/buy_spark_name_option_widget.dart index cc7fcfa0e6..61c35fe937 100644 --- a/lib/pages/spark_names/sub_widgets/buy_spark_name_option_widget.dart +++ b/lib/pages/spark_names/sub_widgets/buy_spark_name_option_widget.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:drift/drift.dart' as drift; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -22,6 +21,7 @@ import '../../../widgets/desktop/secondary_button.dart'; import '../../../widgets/dialogs/s_dialog.dart'; import '../../../widgets/rounded_white_container.dart'; import '../../../widgets/stack_dialog.dart'; +import '../../../wl_gen/interfaces/lib_spark_interface.dart'; import '../buy_spark_name_view.dart'; class BuySparkNameOptionWidget extends ConsumerStatefulWidget { @@ -57,9 +57,9 @@ class _BuySparkNameWidgetState extends ConsumerState { rethrow; } final db = ref.read(pDrift(widget.walletId)); - final results = - await (db.select(db.sparkNames) - ..where((e) => e.name.lower().equals(name))).get(); + final results = await (db.select( + db.sparkNames, + )..where((e) => e.name.lower().equals(name))).get(); if (results.isNotEmpty) { return false; @@ -109,12 +109,11 @@ class _BuySparkNameWidgetState extends ConsumerState { if (mounted) { await showDialog( context: context, - builder: - (_) => StackOkDialog( - title: message, - desktopPopRootNavigator: Util.isDesktop, - maxWidth: Util.isDesktop ? 600 : null, - ), + builder: (_) => StackOkDialog( + title: message, + desktopPopRootNavigator: Util.isDesktop, + maxWidth: Util.isDesktop ? 600 : null, + ), ); } } finally { @@ -142,8 +141,9 @@ class _BuySparkNameWidgetState extends ConsumerState { @override Widget build(BuildContext context) { return Column( - crossAxisAlignment: - Util.isDesktop ? CrossAxisAlignment.start : CrossAxisAlignment.center, + crossAxisAlignment: Util.isDesktop + ? CrossAxisAlignment.start + : CrossAxisAlignment.center, children: [ SizedBox( height: 48, @@ -154,10 +154,9 @@ class _BuySparkNameWidgetState extends ConsumerState { height: 48, width: 100, decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, borderRadius: BorderRadius.all( Radius.circular(Constants.size.circularBorderRadius), ), @@ -168,7 +167,9 @@ class _BuySparkNameWidgetState extends ConsumerState { Expanded( child: TextField( inputFormatters: [ - LengthLimitingTextInputFormatter(kMaxNameLength), + LengthLimitingTextInputFormatter( + libSpark.maxNameLength, + ), ], textInputAction: TextInputAction.search, focusNode: _nameFieldFocus, @@ -183,10 +184,9 @@ class _BuySparkNameWidgetState extends ConsumerState { Assets.svg.search, width: 20, height: 20, - color: - Theme.of(context) - .extension()! - .textFieldDefaultSearchIconLeft, + color: Theme.of(context) + .extension()! + .textFieldDefaultSearchIconLeft, ), ), fillColor: Colors.transparent, @@ -206,7 +206,9 @@ class _BuySparkNameWidgetState extends ConsumerState { setState(() { _isInvalidCharacters = value.isNotEmpty && - !RegExp(kNameRegexString).hasMatch(value); + !RegExp( + libSpark.nameRegexString, + ).hasMatch(value); }); }, ), @@ -220,10 +222,9 @@ class _BuySparkNameWidgetState extends ConsumerState { ), const SizedBox(height: 4), Row( - mainAxisAlignment: - _isInvalidCharacters - ? MainAxisAlignment.spaceBetween - : MainAxisAlignment.end, + mainAxisAlignment: _isInvalidCharacters + ? MainAxisAlignment.spaceBetween + : MainAxisAlignment.end, children: [ if (_isInvalidCharacters) Text( @@ -238,12 +239,11 @@ class _BuySparkNameWidgetState extends ConsumerState { builder: (context) { final length = _nameController.text.length; return Text( - "$length/$kMaxNameLength", + "$length/${libSpark.maxNameLength}", style: STextStyles.w500_10(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textSubtitle2, + color: Theme.of( + context, + ).extension()!.textSubtitle2, ), ); }, @@ -256,7 +256,7 @@ class _BuySparkNameWidgetState extends ConsumerState { label: "Lookup", enabled: _nameController.text.isNotEmpty && - RegExp(kNameRegexString).hasMatch(_nameController.text), + RegExp(libSpark.nameRegexString).hasMatch(_nameController.text), buttonHeight: Util.isDesktop ? ButtonHeight.l : null, onPressed: _lookup, ), @@ -287,15 +287,13 @@ class _NameCard extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final availability = isAvailable ? "Available" : "Unavailable"; - final color = - isAvailable - ? Theme.of(context).extension()!.accentColorGreen - : Theme.of(context).extension()!.accentColorRed; + final color = isAvailable + ? Theme.of(context).extension()!.accentColorGreen + : Theme.of(context).extension()!.accentColorRed; - final style = - (Util.isDesktop - ? STextStyles.w500_16(context) - : STextStyles.w500_12(context)); + final style = (Util.isDesktop + ? STextStyles.w500_16(context) + : STextStyles.w500_12(context)); return RoundedWhiteContainer( padding: EdgeInsets.all(Util.isDesktop ? 24 : 16), @@ -321,51 +319,49 @@ class _NameCard extends ConsumerWidget { PrimaryButton( label: "Buy name", enabled: isAvailable, - buttonHeight: - Util.isDesktop ? ButtonHeight.m : ButtonHeight.l, + buttonHeight: Util.isDesktop + ? ButtonHeight.m + : ButtonHeight.l, width: Util.isDesktop ? 140 : 120, onPressed: () async { if (context.mounted) { if (Util.isDesktop) { await showDialog( context: context, - builder: - (context) => SDialog( - child: SizedBox( - width: 580, - child: Column( + builder: (context) => SDialog( + child: SizedBox( + width: 580, + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 32, - ), - child: Text( - "Buy name", - style: STextStyles.desktopH3( - context, - ), - ), - ), - const DesktopDialogCloseButton(), - ], - ), Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, + padding: const EdgeInsets.only( + left: 32, ), - child: BuySparkNameView( - walletId: walletId, - name: name, + child: Text( + "Buy name", + style: STextStyles.desktopH3(context), ), ), + const DesktopDialogCloseButton(), ], ), - ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 32, + ), + child: BuySparkNameView( + walletId: walletId, + name: name, + ), + ), + ], ), + ), + ), ); } else { await Navigator.of(context).pushNamed( diff --git a/lib/utilities/logger.dart b/lib/utilities/logger.dart index d4cc03dcfa..b5ae5f00dc 100644 --- a/lib/utilities/logger.dart +++ b/lib/utilities/logger.dart @@ -14,7 +14,6 @@ import 'dart:core'; import 'dart:isolate'; import 'dart:ui'; -import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart' as spark; import 'package:logger/logger.dart'; import 'util.dart'; @@ -23,26 +22,6 @@ export 'enums/log_level_enum.dart'; const _kLoggerPortName = "logger_port"; -// convenience conversion for spark -extension LoggingLevelExt on spark.LoggingLevel { - Level getLoggerLevel() { - switch (this) { - case spark.LoggingLevel.info: - return Level.info; - case spark.LoggingLevel.warning: - return Level.warning; - case spark.LoggingLevel.error: - return Level.error; - case spark.LoggingLevel.fatal: - return Level.fatal; - case spark.LoggingLevel.debug: - return Level.debug; - case spark.LoggingLevel.trace: - return Level.trace; - } - } -} - class Logging { Logging._(); static final Logging _instance = Logging._(); @@ -82,8 +61,9 @@ class Logging { PrettyPrinter prettyPrinter(bool toFile) => PrettyPrinter( printEmojis: false, methodCount: 0, - dateTimeFormat: - toFile ? DateTimeFormat.none : DateTimeFormat.dateAndTime, + dateTimeFormat: toFile + ? DateTimeFormat.none + : DateTimeFormat.dateAndTime, colors: !toFile, noBoxingByDefault: toFile, ); @@ -132,8 +112,8 @@ class Logging { String _stringifyMessage(dynamic message) => !(message is Map || message is Iterable) - ? message.toString() - : JsonEncoder.withIndent(' ', (o) => o.toString()).convert(message); + ? message.toString() + : JsonEncoder.withIndent(' ', (o) => o.toString()).convert(message); void log( Level level, diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart index a008d1b24a..d9059a5bb1 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart @@ -5,10 +5,6 @@ import 'dart:math'; import 'package:bitcoindart/bitcoindart.dart' as btc; import 'package:decimal/decimal.dart'; import 'package:flutter/foundation.dart'; -import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart' - as spark - show Log; -import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart'; import 'package:isar_community/isar.dart'; import 'package:logger/logger.dart'; @@ -28,6 +24,7 @@ import '../../../utilities/enums/derive_path_type_enum.dart'; import '../../../utilities/extensions/extensions.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/prefs.dart'; +import '../../../wl_gen/interfaces/lib_spark_interface.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../crypto_currency/interfaces/electrumx_currency_interface.dart'; import '../../isar/models/spark_coin.dart'; @@ -55,25 +52,11 @@ String _hashTag(String tag) { final x = components[0].substring(1); final y = components[1].substring(0, components[1].length - 1); - final hash = LibSpark.hashTag(x, y); + final hash = libSpark.hashTag(x, y); return hash; } -void initSparkLogging(Level level) { - final levels = Level.values.where((e) => e >= level).map((e) => e.name); - spark.Log.levels.addAll( - LoggingLevel.values.where((e) => levels.contains(e.name)), - ); - spark.Log.onLog = (level, value, {error, stackTrace, required time}) { - Logging.instance.log( - level.getLoggerLevel(), - value, - error: error, - stackTrace: stackTrace, - time: time, - ); - }; -} +void initSparkLogging(Level level) => libSpark.initSparkLogging(level); abstract class _SparkIsolate { static Isolate? _isolate; @@ -135,7 +118,7 @@ mixin SparkInterface static bool validateSparkAddress({ required String address, required bool isTestNet, - }) => LibSpark.validateAddress(address: address, isTestNet: isTestNet); + }) => libSpark.validateAddress(address: address, isTestNet: isTestNet); Future hashTag(String tag) async { try { @@ -174,16 +157,17 @@ mixin SparkInterface final String derivationPath; if (cryptoCurrency.network.isTestNet) { derivationPath = - "$kSparkBaseDerivationPathTestnet$kDefaultSparkIndex"; + "${libSpark.sparkBaseDerivationPathTestnet}$kDefaultSparkIndex"; } else { - derivationPath = "$kSparkBaseDerivationPath$kDefaultSparkIndex"; + derivationPath = + "${libSpark.sparkBaseDerivationPath}$kDefaultSparkIndex"; } final keys = root.derivePath(derivationPath); - _sparkChangeAddressCached = await LibSpark.getAddress( + _sparkChangeAddressCached = await libSpark.getAddress( privateKey: keys.privateKey.data, index: kDefaultSparkIndex, - diversifier: kSparkChange, + diversifier: libSpark.sparkChange, isTestNet: cryptoCurrency.network.isTestNet, ); } @@ -202,20 +186,19 @@ mixin SparkInterface @override Future> fetchAddressesForElectrumXScan() async { - final allAddresses = - await mainDB - .getAddresses(walletId) - .filter() - .not() - .group( - (q) => q - .typeEqualTo(AddressType.spark) - .or() - .typeEqualTo(AddressType.nonWallet) - .or() - .subTypeEqualTo(AddressSubType.nonWallet), - ) - .findAll(); + final allAddresses = await mainDB + .getAddresses(walletId) + .filter() + .not() + .group( + (q) => q + .typeEqualTo(AddressType.spark) + .or() + .typeEqualTo(AddressType.nonWallet) + .or() + .subTypeEqualTo(AddressSubType.nonWallet), + ) + .findAll(); return allAddresses; } @@ -236,20 +219,21 @@ mixin SparkInterface // default to starting at 1 if none found int diversifier = (highestStoredDiversifier ?? 0) + 1; // change address check - if (diversifier == kSparkChange) { + if (diversifier == libSpark.sparkChange) { diversifier++; } final root = await getRootHDNode(); final String derivationPath; if (cryptoCurrency.network.isTestNet) { - derivationPath = "$kSparkBaseDerivationPathTestnet$kDefaultSparkIndex"; + derivationPath = + "${libSpark.sparkBaseDerivationPathTestnet}$kDefaultSparkIndex"; } else { - derivationPath = "$kSparkBaseDerivationPath$kDefaultSparkIndex"; + derivationPath = "${libSpark.sparkBaseDerivationPath}$kDefaultSparkIndex"; } final keys = root.derivePath(derivationPath); - final String addressString = await LibSpark.getAddress( + final String addressString = await libSpark.getAddress( privateKey: keys.privateKey.data, index: kDefaultSparkIndex, diversifier: diversifier, @@ -276,18 +260,17 @@ mixin SparkInterface ); } else { // fetch spendable spark coins - final coins = - await mainDB.isar.sparkCoins - .where() - .walletIdEqualToAnyLTagHash(walletId) - .filter() - .isUsedEqualTo(false) - .and() - .heightIsNotNull() - .and() - .not() - .valueIntStringEqualTo("0") - .findAll(); + final coins = await mainDB.isar.sparkCoins + .where() + .walletIdEqualToAnyLTagHash(walletId) + .filter() + .isUsedEqualTo(false) + .and() + .heightIsNotNull() + .and() + .not() + .valueIntStringEqualTo("0") + .findAll(); final available = coins .map((e) => e.value) @@ -301,24 +284,25 @@ mixin SparkInterface } // prepare coin data for ffi - final serializedCoins = - coins - .map( - (e) => ( - serializedCoin: e.serializedCoinB64!, - serializedCoinContext: e.contextB64!, - groupId: e.groupId, - height: e.height!, - ), - ) - .toList(); + final serializedCoins = coins + .map( + (e) => ( + serializedCoin: e.serializedCoinB64!, + serializedCoinContext: e.contextB64!, + groupId: e.groupId, + height: e.height!, + ), + ) + .toList(); final root = await getRootHDNode(); final String derivationPath; if (cryptoCurrency.network.isTestNet) { - derivationPath = "$kSparkBaseDerivationPathTestnet$kDefaultSparkIndex"; + derivationPath = + "${libSpark.sparkBaseDerivationPathTestnet}$kDefaultSparkIndex"; } else { - derivationPath = "$kSparkBaseDerivationPath$kDefaultSparkIndex"; + derivationPath = + "${libSpark.sparkBaseDerivationPath}$kDefaultSparkIndex"; } final privateKey = root.derivePath(derivationPath).privateKey.data; int estimate = await _asyncSparkFeesWrapper( @@ -393,18 +377,17 @@ mixin SparkInterface final txAmount = transparentSumOut + sparkSumOut; // fetch spendable spark coins - final coins = - await mainDB.isar.sparkCoins - .where() - .walletIdEqualToAnyLTagHash(walletId) - .filter() - .isUsedEqualTo(false) - .and() - .heightIsNotNull() - .and() - .not() - .valueIntStringEqualTo("0") - .findAll(); + final coins = await mainDB.isar.sparkCoins + .where() + .walletIdEqualToAnyLTagHash(walletId) + .filter() + .isUsedEqualTo(false) + .and() + .heightIsNotNull() + .and() + .not() + .valueIntStringEqualTo("0") + .findAll(); final available = info.cachedBalanceTertiary.spendable; @@ -415,17 +398,16 @@ mixin SparkInterface final bool isSendAll = available == txAmount; // prepare coin data for ffi - final serializedCoins = - coins - .map( - (e) => ( - serializedCoin: e.serializedCoinB64!, - serializedCoinContext: e.contextB64!, - groupId: e.groupId, - height: e.height!, - ), - ) - .toList(); + final serializedCoins = coins + .map( + (e) => ( + serializedCoin: e.serializedCoinB64!, + serializedCoinContext: e.contextB64!, + groupId: e.groupId, + height: e.height!, + ), + ) + .toList(); final currentId = await electrumXClient.getSparkLatestCoinId(); final List> setMaps = []; @@ -451,8 +433,9 @@ mixin SparkInterface "blockHash": info.blockHash, "setHash": info.setHash, "coinGroupID": i, - "coins": - resultSet.map((e) => [e.serialized, e.txHash, e.context]).toList(), + "coins": resultSet + .map((e) => [e.serialized, e.txHash, e.context]) + .toList(), }; setData["coinGroupID"] = i; @@ -463,31 +446,28 @@ mixin SparkInterface )); } - final allAnonymitySets = - setMaps - .map( - (e) => ( - setId: e["coinGroupID"] as int, - setHash: e["setHash"] as String, - set: - (e["coins"] as List) - .map( - (e) => ( - serializedCoin: e[0] as String, - txHash: e[1] as String, - ), - ) - .toList(), - ), - ) - .toList(); + final allAnonymitySets = setMaps + .map( + (e) => ( + setId: e["coinGroupID"] as int, + setHash: e["setHash"] as String, + set: (e["coins"] as List) + .map( + (e) => + (serializedCoin: e[0] as String, txHash: e[1] as String), + ) + .toList(), + ), + ) + .toList(); final root = await getRootHDNode(); final String derivationPath; if (cryptoCurrency.network.isTestNet) { - derivationPath = "$kSparkBaseDerivationPathTestnet$kDefaultSparkIndex"; + derivationPath = + "${libSpark.sparkBaseDerivationPathTestnet}$kDefaultSparkIndex"; } else { - derivationPath = "$kSparkBaseDerivationPath$kDefaultSparkIndex"; + derivationPath = "${libSpark.sparkBaseDerivationPath}$kDefaultSparkIndex"; } final privateKey = root.derivePath(derivationPath).privateKey.data; @@ -500,7 +480,7 @@ mixin SparkInterface sparkRecipientsWithFeeSubtracted; final recipientCount = (txData.recipients?.where((e) => e.amount.raw > BigInt.zero).length ?? - 0); + 0); final totalRecipientCount = recipientCount + (txData.sparkRecipients?.length ?? 0); final BigInt estimatedFee; @@ -620,7 +600,7 @@ mixin SparkInterface ({Uint8List script, int size})? noProofNameTxData; if (txData.sparkNameInfo != null) { - noProofNameTxData = LibSpark.createSparkNameScript( + noProofNameTxData = libSpark.createSparkNameScript( sparkNameValidityBlocks: txData.sparkNameInfo!.validBlocks, name: txData.sparkNameInfo!.name, additionalInfo: txData.sparkNameInfo!.additionalInfo, @@ -662,15 +642,13 @@ mixin SparkInterface [], serializedCoins: serializedCoins, allAnonymitySets: allAnonymitySets, - idAndBlockHashes: - idAndBlockHashes - .map( - (e) => (setId: e.groupId, blockHash: base64Decode(e.blockHash)), - ) - .toList(), + idAndBlockHashes: idAndBlockHashes + .map((e) => (setId: e.groupId, blockHash: base64Decode(e.blockHash))) + .toList(), txHash: extractedTx.getHash(), - additionalTxSize: - txData.sparkNameInfo == null ? 0 : noProofNameTxData!.size, + additionalTxSize: txData.sparkNameInfo == null + ? 0 + : noProofNameTxData!.size, )); for (final outputScript in spend.outputScripts) { @@ -695,7 +673,7 @@ mixin SparkInterface int hashFailSafe = 0; while (nameScriptData == null) { try { - nameScriptData = LibSpark.createSparkNameScript( + nameScriptData = libSpark.createSparkNameScript( sparkNameValidityBlocks: txData.sparkNameInfo!.validBlocks, name: txData.sparkNameInfo!.name, additionalInfo: txData.sparkNameInfo!.additionalInfo, @@ -745,11 +723,10 @@ mixin SparkInterface sequence: 0xffffffff, outpoint: null, addresses: [], - valueStringSats: - tempOutputs - .map((e) => e.value) - .fold(fee.raw, (p, e) => p + e) - .toString(), + valueStringSats: tempOutputs + .map((e) => e.value) + .fold(fee.raw, (p, e) => p + e) + .toString(), witness: null, innerRedeemScriptAsm: null, coinbase: null, @@ -792,10 +769,9 @@ mixin SparkInterface timestamp: DateTime.timestamp().millisecondsSinceEpoch ~/ 1000, inputs: List.unmodifiable(tempInputs), outputs: List.unmodifiable(tempOutputs), - type: - tempOutputs.map((e) => e.walletOwns).fold(true, (p, e) => p &= e) - ? TransactionType.sentToSelf - : TransactionType.outgoing, + type: tempOutputs.map((e) => e.walletOwns).fold(true, (p, e) => p &= e) + ? TransactionType.sentToSelf + : TransactionType.outgoing, subType: TransactionSubType.sparkSpend, otherData: jsonEncode({"overrideFee": fee.toJsonString()}), height: null, @@ -962,10 +938,9 @@ mixin SparkInterface + 1; // update balance - final percentIncrement = - refreshProgressRange == null - ? null - : (refreshProgressRange.$2 - refreshProgressRange.$1) / steps; + final percentIncrement = refreshProgressRange == null + ? null + : (refreshProgressRange.$2 - refreshProgressRange.$1) / steps; double currentPercent = refreshProgressRange?.$1 ?? 0; // fetch and update process for each set groupId as required @@ -1025,10 +1000,9 @@ mixin SparkInterface afterBlockHash: lastCheckedHash, network: cryptoCurrency.network, ); - final coinsRaw = - anonymitySetResult - .map((e) => [e.serialized, e.txHash, e.context]) - .toList(); + final coinsRaw = anonymitySetResult + .map((e) => [e.serialized, e.txHash, e.context]) + .toList(); if (coinsRaw.isNotEmpty) { rawCoinsBySetId[i] = coinsRaw; @@ -1044,25 +1018,19 @@ mixin SparkInterface // get address(es) to get the private key hex strings required for // identifying spark coins - final sparkAddresses = - await mainDB.isar.addresses - .where() - .walletIdEqualTo(walletId) - .filter() - .typeEqualTo(AddressType.spark) - .findAll(); + final sparkAddresses = await mainDB.isar.addresses + .where() + .walletIdEqualTo(walletId) + .filter() + .typeEqualTo(AddressType.spark) + .findAll(); final root = await getRootHDNode(); - final Set privateKeyHexSet = - sparkAddresses - .map( - (e) => - root - .derivePath(e.derivationPath!.value) - .privateKey - .data - .toHex, - ) - .toSet(); + final Set privateKeyHexSet = sparkAddresses + .map( + (e) => + root.derivePath(e.derivationPath!.value).privateKey.data.toHex, + ) + .toSet(); // try to identify any coins in the unchecked set data final List newlyIdCoins = []; @@ -1108,15 +1076,14 @@ mixin SparkInterface } // get unused and or unconfirmed coins from db - final coinsToCheck = - await mainDB.isar.sparkCoins - .where() - .walletIdEqualToAnyLTagHash(walletId) - .filter() - .heightIsNull() - .or() - .isUsedEqualTo(false) - .findAll(); + final coinsToCheck = await mainDB.isar.sparkCoins + .where() + .walletIdEqualToAnyLTagHash(walletId) + .filter() + .heightIsNull() + .or() + .isUsedEqualTo(false) + .findAll(); List? spentCoinTags; // only fetch tags from db if we need them to compare against any items @@ -1147,10 +1114,9 @@ mixin SparkInterface checked = coin; } } else { - checked = - spentCoinTags!.contains(coin.lTagHash) - ? coin.copyWith(isUsed: true) - : coin; + checked = spentCoinTags!.contains(coin.lTagHash) + ? coin.copyWith(isUsed: true) + : coin; } checkedCoins.add(checked); @@ -1170,13 +1136,12 @@ mixin SparkInterface final currentHeight = await chainHeight; // get all unused coins to update wallet spark balance - final unusedCoins = - await mainDB.isar.sparkCoins - .where() - .walletIdEqualToAnyLTagHash(walletId) - .filter() - .isUsedEqualTo(false) - .findAll(); + final unusedCoins = await mainDB.isar.sparkCoins + .where() + .walletIdEqualToAnyLTagHash(walletId) + .filter() + .isUsedEqualTo(false) + .findAll(); final sparkNamesUpdateFuture = refreshSparkNames(); @@ -1229,14 +1194,13 @@ mixin SparkInterface } Future> getSparkSpendTransactionIds() async { - final tags = - await mainDB.isar.sparkCoins - .where() - .walletIdEqualToAnyLTagHash(walletId) - .filter() - .isUsedEqualTo(true) - .lTagHashProperty() - .findAll(); + final tags = await mainDB.isar.sparkCoins + .where() + .walletIdEqualToAnyLTagHash(walletId) + .filter() + .isUsedEqualTo(true) + .lTagHashProperty() + .findAll(); final pairs = await FiroCacheCoordinator.getUsedCoinTxidsFor( tags: tags, @@ -1272,8 +1236,9 @@ mixin SparkInterface Logging.instance.i("Refreshing spark names for $walletId ${info.name}"); final db = Drift.get(walletId); - final myNameStrings = - await db.managers.sparkNames.map((e) => e.name).get(); + final myNameStrings = await db.managers.sparkNames + .map((e) => e.name) + .get(); final names = await electrumXClient.getSparkNames(); // start update shared cache of all names @@ -1304,9 +1269,11 @@ mixin SparkInterface final root = await getRootHDNode(); final String derivationPath; if (cryptoCurrency.network.isTestNet) { - derivationPath = "$kSparkBaseDerivationPathTestnet$kDefaultSparkIndex"; + derivationPath = + "${libSpark.sparkBaseDerivationPathTestnet}$kDefaultSparkIndex"; } else { - derivationPath = "$kSparkBaseDerivationPath$kDefaultSparkIndex"; + derivationPath = + "${libSpark.sparkBaseDerivationPath}$kDefaultSparkIndex"; } final keys = root.derivePath(derivationPath); @@ -1317,10 +1284,10 @@ mixin SparkInterface while (diversifier < maxDiversifier) { // change address check - if (diversifier == kSparkChange) { + if (diversifier == libSpark.sparkChange) { diversifier++; } - final addressString = await LibSpark.getAddress( + final addressString = await libSpark.getAddress( privateKey: keys.privateKey.data, index: kDefaultSparkIndex, diversifier: diversifier, @@ -1415,10 +1382,9 @@ mixin SparkInterface // setup some vars int nChangePosInOut = -1; final int nChangePosRequest = nChangePosInOut; - List outputs_ = - outputs - .map((e) => MutableSparkRecipient(e.address, e.value, e.memo)) - .toList(); // deep copy + List outputs_ = outputs + .map((e) => MutableSparkRecipient(e.address, e.value, e.memo)) + .toList(); // deep copy final feesObject = await fees; final currentHeight = await chainHeight; final random = Random.secure(); @@ -1427,10 +1393,9 @@ mixin SparkInterface valueAndUTXOs.shuffle(random); while (valueAndUTXOs.isNotEmpty) { - final lockTime = - random.nextInt(10) == 0 - ? max(0, currentHeight - random.nextInt(100)) - : currentHeight; + final lockTime = random.nextInt(10) == 0 + ? max(0, currentHeight - random.nextInt(100)) + : currentHeight; const txVersion = 1; final List vin = []; final List<(dynamic, int, String?)> vout = []; @@ -1477,10 +1442,9 @@ mixin SparkInterface setCoins.clear(); // deep copy - final remainingOutputs = - outputs_ - .map((e) => MutableSparkRecipient(e.address, e.value, e.memo)) - .toList(); + final remainingOutputs = outputs_ + .map((e) => MutableSparkRecipient(e.address, e.value, e.memo)) + .toList(); final List singleTxOutputs = []; if (autoMintAll) { @@ -1540,17 +1504,13 @@ mixin SparkInterface } // Generate dummy mint coins to save time - final dummyRecipients = LibSpark.createSparkMintRecipients( - outputs: - singleTxOutputs - .map( - (e) => ( - sparkAddress: e.address, - value: e.value.toInt(), - memo: "", - ), - ) - .toList(), + final dummyRecipients = libSpark.createSparkMintRecipients( + outputs: singleTxOutputs + .map( + (e) => + (sparkAddress: e.address, value: e.value.toInt(), memo: ""), + ) + .toList(), serialContext: Uint8List(0), generate: false, ); @@ -1623,40 +1583,36 @@ mixin SparkInterface switch (sd.derivePathType) { case DerivePathType.bip44: - data = - btc - .P2PKH( - data: btc.PaymentData(pubkey: pubKey), - network: _bitcoinDartNetwork, - ) - .data; + data = btc + .P2PKH( + data: btc.PaymentData(pubkey: pubKey), + network: _bitcoinDartNetwork, + ) + .data; break; case DerivePathType.bip49: - final p2wpkh = - btc - .P2WPKH( - data: btc.PaymentData(pubkey: pubKey), - network: _bitcoinDartNetwork, - ) - .data; - data = - btc - .P2SH( - data: btc.PaymentData(redeem: p2wpkh), - network: _bitcoinDartNetwork, - ) - .data; + final p2wpkh = btc + .P2WPKH( + data: btc.PaymentData(pubkey: pubKey), + network: _bitcoinDartNetwork, + ) + .data; + data = btc + .P2SH( + data: btc.PaymentData(redeem: p2wpkh), + network: _bitcoinDartNetwork, + ) + .data; break; case DerivePathType.bip84: - data = - btc - .P2WPKH( - data: btc.PaymentData(pubkey: pubKey), - network: _bitcoinDartNetwork, - ) - .data; + data = btc + .P2WPKH( + data: btc.PaymentData(pubkey: pubKey), + network: _bitcoinDartNetwork, + ) + .data; break; case DerivePathType.bip86: @@ -1715,20 +1671,19 @@ mixin SparkInterface } // Generate real mint coins - final serialContext = LibSpark.serializeMintContext( + final serialContext = libSpark.serializeMintContext( inputs: setCoins.map((e) => (e.utxo.txid, e.utxo.vout)).toList(), ); - final recipients = LibSpark.createSparkMintRecipients( - outputs: - singleTxOutputs - .map( - (e) => ( - sparkAddress: e.address, - memo: e.memo, - value: e.value.toInt(), - ), - ) - .toList(), + final recipients = libSpark.createSparkMintRecipients( + outputs: singleTxOutputs + .map( + (e) => ( + sparkAddress: e.address, + memo: e.memo, + value: e.value.toInt(), + ), + ) + .toList(), serialContext: serialContext, generate: true, ); @@ -1753,10 +1708,9 @@ mixin SparkInterface } // deep copy - outputs_ = - remainingOutputs - .map((e) => MutableSparkRecipient(e.address, e.value, e.memo)) - .toList(); + outputs_ = remainingOutputs + .map((e) => MutableSparkRecipient(e.address, e.value, e.memo)) + .toList(); break; // Done, enough fee included. } @@ -1784,40 +1738,36 @@ mixin SparkInterface switch (input.derivePathType) { case DerivePathType.bip44: - data = - btc - .P2PKH( - data: btc.PaymentData(pubkey: pubKey), - network: _bitcoinDartNetwork, - ) - .data; + data = btc + .P2PKH( + data: btc.PaymentData(pubkey: pubKey), + network: _bitcoinDartNetwork, + ) + .data; break; case DerivePathType.bip49: - final p2wpkh = - btc - .P2WPKH( - data: btc.PaymentData(pubkey: pubKey), - network: _bitcoinDartNetwork, - ) - .data; - data = - btc - .P2SH( - data: btc.PaymentData(redeem: p2wpkh), - network: _bitcoinDartNetwork, - ) - .data; + final p2wpkh = btc + .P2WPKH( + data: btc.PaymentData(pubkey: pubKey), + network: _bitcoinDartNetwork, + ) + .data; + data = btc + .P2SH( + data: btc.PaymentData(redeem: p2wpkh), + network: _bitcoinDartNetwork, + ) + .data; break; case DerivePathType.bip84: - data = - btc - .P2WPKH( - data: btc.PaymentData(pubkey: pubKey), - network: _bitcoinDartNetwork, - ) - .data; + data = btc + .P2WPKH( + data: btc.PaymentData(pubkey: pubKey), + network: _bitcoinDartNetwork, + ) + .data; break; case DerivePathType.bip86: @@ -1862,8 +1812,9 @@ mixin SparkInterface tempOutputs.add( OutputV2.isarCantDoRequiredInDefaultConstructor( - scriptPubKeyHex: - addressOrScript is Uint8List ? addressOrScript.toHex : "000000", + scriptPubKeyHex: addressOrScript is Uint8List + ? addressOrScript.toHex + : "000000", valueStringSats: value.toString(), addresses: [ if (addressOrScript is String) addressOrScript.toString(), @@ -1914,24 +1865,22 @@ mixin SparkInterface assert(outputs.length == 1); final data = TxData( - sparkRecipients: - vout - .where((e) => e.$1 is Uint8List) // ignore change - .map( - (e) => ( - address: - outputs - .first - .address, // for display purposes on confirm tx screen. See todos above - memo: "", - amount: Amount( - rawValue: BigInt.from(e.$2), - fractionDigits: cryptoCurrency.fractionDigits, - ), - isChange: false, // ok? - ), - ) - .toList(), + sparkRecipients: vout + .where((e) => e.$1 is Uint8List) // ignore change + .map( + (e) => ( + address: outputs + .first + .address, // for display purposes on confirm tx screen. See todos above + memo: "", + amount: Amount( + rawValue: BigInt.from(e.$2), + fractionDigits: cryptoCurrency.fractionDigits, + ), + isChange: false, // ok? + ), + ) + .toList(), vSize: builtTx.virtualSize(), txid: builtTx.getId(), raw: builtTx.toHex(), @@ -1950,8 +1899,8 @@ mixin SparkInterface outputs: List.unmodifiable(tempOutputs), type: tempOutputs.map((e) => e.walletOwns).fold(true, (p, e) => p &= e) - ? TransactionType.sentToSelf - : TransactionType.outgoing, + ? TransactionType.sentToSelf + : TransactionType.outgoing, subType: TransactionSubType.sparkMint, otherData: null, height: null, @@ -2018,25 +1967,23 @@ mixin SparkInterface const subtractFeeFromAmount = true; // must be true for mint all final currentHeight = await chainHeight; - final spendableUtxos = - await mainDB.isar.utxos - .where() - .walletIdEqualTo(walletId) - .filter() - .isBlockedEqualTo(false) - .and() - .group((q) => q.usedEqualTo(false).or().usedIsNull()) - .and() - .valueGreaterThan(0) - .findAll(); + final spendableUtxos = await mainDB.isar.utxos + .where() + .walletIdEqualTo(walletId) + .filter() + .isBlockedEqualTo(false) + .and() + .group((q) => q.usedEqualTo(false).or().usedIsNull()) + .and() + .valueGreaterThan(0) + .findAll(); spendableUtxos.removeWhere( - (e) => - !e.isConfirmed( - currentHeight, - cryptoCurrency.minConfirms, - cryptoCurrency.minCoinbaseConfirms, - ), + (e) => !e.isConfirmed( + currentHeight, + cryptoCurrency.minConfirms, + cryptoCurrency.minCoinbaseConfirms, + ), ); if (spendableUtxos.isEmpty) { @@ -2077,12 +2024,9 @@ mixin SparkInterface if (txData.sparkRecipients?.isNotEmpty != true) { throw Exception("Missing spark recipients."); } - final recipients = - txData.sparkRecipients! - .map( - (e) => MutableSparkRecipient(e.address, e.amount.raw, e.memo), - ) - .toList(); + final recipients = txData.sparkRecipients! + .map((e) => MutableSparkRecipient(e.address, e.amount.raw, e.memo)) + .toList(); final total = recipients .map((e) => e.value) @@ -2094,16 +2038,17 @@ mixin SparkInterface throw Exception("Attempted send of zero amount"); } - final utxos = - txData.utxos?.whereType().map((e) => e.utxo).toList(); + final utxos = txData.utxos + ?.whereType() + .map((e) => e.utxo) + .toList(); final bool coinControl = utxos != null; - final utxosTotal = - coinControl - ? utxos - .map((e) => e.value) - .fold(BigInt.zero, (p, e) => p + BigInt.from(e)) - : null; + final utxosTotal = coinControl + ? utxos + .map((e) => e.value) + .fold(BigInt.zero, (p, e) => p + BigInt.from(e)) + : null; if (coinControl && utxosTotal! < total) { throw Exception("Insufficient selected UTXOs!"); @@ -2128,18 +2073,17 @@ mixin SparkInterface final canCPFP = this is CpfpInterface && coinControl; - final spendableUtxos = - availableOutputs - .where( - (e) => - canCPFP || - e.isConfirmed( - currentHeight, - cryptoCurrency.minConfirms, - cryptoCurrency.minCoinbaseConfirms, - ), - ) - .toList(); + final spendableUtxos = availableOutputs + .where( + (e) => + canCPFP || + e.isConfirmed( + currentHeight, + cryptoCurrency.minConfirms, + cryptoCurrency.minCoinbaseConfirms, + ), + ) + .toList(); if (spendableUtxos.isEmpty) { throw Exception("No available UTXOs found to anonymize"); @@ -2197,21 +2141,21 @@ mixin SparkInterface } } - if (years < 1 || years > kMaxNameRegistrationLengthYears) { + if (years < 1 || years > libSpark.maxNameRegistrationLengthYears) { throw Exception("Invalid spark name registration period years: $years"); } - if (name.isEmpty || name.length > kMaxNameLength) { + if (name.isEmpty || name.length > libSpark.maxNameLength) { throw Exception("Invalid spark name length: ${name.length}"); } - if (!RegExp(kNameRegexString).hasMatch(name)) { + if (!RegExp(libSpark.nameRegexString).hasMatch(name)) { throw Exception("Invalid symbols found in spark name: $name"); } if (additionalInfo.toUint8ListFromUtf8.length > - kMaxAdditionalInfoLengthBytes) { + libSpark.maxAdditionalInfoLengthBytes) { throw Exception( - "Additional info exceeds $kMaxAdditionalInfoLengthBytes bytes.", + "Additional info exceeds ${libSpark.maxAdditionalInfoLengthBytes} bytes.", ); } @@ -2233,11 +2177,11 @@ mixin SparkInterface final String destinationAddress; switch (cryptoCurrency.network) { case CryptoCurrencyNetwork.main: - destinationAddress = kStage3DevelopmentFundAddressMainNet; + destinationAddress = libSpark.stage3DevelopmentFundAddressMainNet; break; case CryptoCurrencyNetwork.test: - destinationAddress = kStage3DevelopmentFundAddressTestNet; + destinationAddress = libSpark.stage3DevelopmentFundAddressTestNet; break; default: @@ -2253,7 +2197,9 @@ mixin SparkInterface TxRecipient( address: destinationAddress, amount: Amount.fromDecimal( - Decimal.fromInt(kStandardSparkNamesFee[name.length] * years), + Decimal.fromInt( + libSpark.standardSparkNamesFee[name.length] * years, + ), fractionDigits: cryptoCurrency.fractionDigits, ), isChange: false, @@ -2347,7 +2293,7 @@ _createSparkSend( }) args, ) async { - final spend = LibSpark.createSparkSendTransaction( + final spend = libSpark.createSparkSendTransaction( privateKeyHex: args.privateKeyHex, index: args.index, recipients: args.recipients, @@ -2387,7 +2333,7 @@ Future> _identifyCoins( final txHash = data[1].toHexReversedFromBase64; final contextB64 = data[2]; - final coin = LibSpark.identifyAndRecoverCoin( + final coin = libSpark.identifyAndRecoverCoin( serializedCoinB64, privateKeyHex: privateKeyHex, index: kDefaultSparkIndex, @@ -2460,13 +2406,12 @@ class MutableSparkRecipient { } } -typedef SerializedCoinData = - ({ - int groupId, - int height, - String serializedCoin, - String serializedCoinContext, - }); +typedef SerializedCoinData = ({ + int groupId, + int height, + String serializedCoin, + String serializedCoinContext, +}); Future _asyncSparkFeesWrapper({ required String privateKeyHex, @@ -2503,7 +2448,7 @@ int _estSparkFeeComputeFunc( }) args, ) { - final est = LibSpark.estimateSparkFee( + final est = libSpark.estimateSparkFee( privateKeyHex: args.privateKeyHex, index: args.index, sendAmount: args.sendAmount, diff --git a/lib/wl_gen/interfaces/lib_spark_interface.dart b/lib/wl_gen/interfaces/lib_spark_interface.dart new file mode 100644 index 0000000000..5f24277857 --- /dev/null +++ b/lib/wl_gen/interfaces/lib_spark_interface.dart @@ -0,0 +1,252 @@ +import 'dart:typed_data'; + +import 'package:logger/logger.dart'; + +export '../generated/lib_spark_interface_impl.dart'; + +abstract class LibSparkInterface { + const LibSparkInterface(); + + String get sparkBaseDerivationPath; + String get sparkBaseDerivationPathTestnet; + int get sparkChange; + int get maxNameRegistrationLengthYears; + int get maxNameLength; + int get maxAdditionalInfoLengthBytes; + String get nameRegexString; + String get stage3DevelopmentFundAddressMainNet; + String get stage3DevelopmentFundAddressTestNet; + List get standardSparkNamesFee; + + void initSparkLogging(Level level); + + String hashTag(String x, String y); + + bool validateAddress({required String address, required bool isTestNet}); + + Future getAddress({ + required Uint8List privateKey, + required int index, + required int diversifier, + bool isTestNet = false, + }); + + ({Uint8List script, int size}) createSparkNameScript({ + required int sparkNameValidityBlocks, + required String name, + required String additionalInfo, + required String scalarHex, + required String privateKeyHex, + required int spendKeyIndex, + required int diversifier, + required bool isTestNet, + required int hashFailSafe, + required bool ignoreProof, + }); + + List<({Uint8List scriptPubKey, int amount, bool subtractFeeFromAmount})> + createSparkMintRecipients({ + required List<({String sparkAddress, int value, String memo})> outputs, + required Uint8List serialContext, + bool generate = false, + }); + + Uint8List serializeMintContext({required List<(String, int)> inputs}); + + WrappedLibSparkCoin? identifyAndRecoverCoin( + final String serializedCoin, { + required final String privateKeyHex, + required final int index, + required final Uint8List context, + final bool isTestNet = false, + }); + + ({ + Uint8List serializedSpendPayload, + List outputScripts, + int fee, + List< + ({ + String serializedCoin, + String serializedCoinContext, + int groupId, + int height, + }) + > + usedCoins, + }) + createSparkSendTransaction({ + required String privateKeyHex, + int index = 1, + required List<({String address, int amount, bool subtractFeeFromAmount})> + recipients, + required List< + ({ + String sparkAddress, + int amount, + bool subtractFeeFromAmount, + String memo, + }) + > + privateRecipients, + required List< + ({ + String serializedCoin, + String serializedCoinContext, + int groupId, + int height, + }) + > + serializedCoins, + required List< + ({ + int setId, + String setHash, + List<({String serializedCoin, String txHash})> set, + }) + > + allAnonymitySets, + required List<({int setId, Uint8List blockHash})> idAndBlockHashes, + required Uint8List txHash, + required int additionalTxSize, + }); + + int estimateSparkFee({ + required String privateKeyHex, + int index = 1, + required int sendAmount, + required bool subtractFeeFromAmount, + required List< + ({ + String serializedCoin, + String serializedCoinContext, + int groupId, + int height, + }) + > + serializedCoins, + required int privateRecipientsCount, + required int utxoNum, + required int additionalTxSize, + }); +} + +// stupid +enum WrappedLibSparkCoinType { + mint(0), + spend(1); + + const WrappedLibSparkCoinType(this.value); + final int value; +} + +// stupid +final class WrappedLibSparkCoin { + final WrappedLibSparkCoinType type; + + final int? id; + final int? height; + + final bool? isUsed; + + final String? nonceHex; + + final String? address; + + final BigInt? value; + + final String? memo; + + final Uint8List? txHash; + + final Uint8List? serialContext; + + final BigInt? diversifier; + final Uint8List? encryptedDiversifier; + + final Uint8List? serial; + final Uint8List? tag; + + final String? lTagHash; + + final String? serializedCoin; + + WrappedLibSparkCoin({ + required this.type, + this.id, + this.height, + this.isUsed, + this.nonceHex, + this.address, + this.value, + this.memo, + this.txHash, + this.serialContext, + this.diversifier, + this.encryptedDiversifier, + this.serial, + this.tag, + this.lTagHash, + this.serializedCoin, + }); + + WrappedLibSparkCoin copyWith({ + WrappedLibSparkCoinType? type, + int? id, + int? height, + bool? isUsed, + String? nonceHex, + String? address, + BigInt? value, + String? memo, + Uint8List? txHash, + Uint8List? serialContext, + BigInt? diversifier, + Uint8List? encryptedDiversifier, + Uint8List? serial, + Uint8List? tag, + String? lTagHash, + String? serializedCoin, + }) { + return WrappedLibSparkCoin( + type: type ?? this.type, + id: id ?? this.id, + height: height ?? this.height, + isUsed: isUsed ?? this.isUsed, + nonceHex: nonceHex ?? this.nonceHex, + address: address ?? this.address, + value: value ?? this.value, + memo: memo ?? this.memo, + txHash: txHash ?? this.txHash, + serialContext: serialContext ?? this.serialContext, + diversifier: diversifier ?? this.diversifier, + encryptedDiversifier: encryptedDiversifier ?? this.encryptedDiversifier, + serial: serial ?? this.serial, + tag: tag ?? this.tag, + lTagHash: lTagHash ?? this.lTagHash, + serializedCoin: serializedCoin ?? this.serializedCoin, + ); + } + + @override + String toString() { + return 'WrappedLibSparkCoin(' + ', type: $type' + ', id: $id' + ', height: $height' + ', isUsed: $isUsed' + ', k: $nonceHex' + ', address: $address' + ', value: $value' + ', memo: $memo' + ', txHash: $txHash' + ', serialContext: $serialContext' + ', diversifier: $diversifier' + ', encryptedDiversifier: $encryptedDiversifier' + ', serial: $serial' + ', tag: $tag' + ', lTagHash: $lTagHash' + ', serializedCoin: $serializedCoin' + ')'; + } +} diff --git a/pubspec.lock b/pubspec.lock index a1b9af3fea..6318fed7b0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -178,10 +178,10 @@ packages: dependency: transitive description: name: build_cli_annotations - sha256: b59d2769769efd6c9ff6d4c4cede0be115a566afc591705c2040b707534b1172 + sha256: e563c2e01de8974566a1998410d3f6f03521788160a02503b0b1f1a46c7b3d95 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build_config: dependency: transitive description: diff --git a/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart b/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart new file mode 100644 index 0000000000..2403a81c42 --- /dev/null +++ b/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart @@ -0,0 +1,290 @@ +//ON +import 'dart:typed_data'; + +import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart'; +import 'package:logger/logger.dart'; + +import '../../utilities/logger.dart'; +//END_ON +import '../interfaces/lib_spark_interface.dart'; + +LibSparkInterface get libSpark => _getInterface(); + +//OFF +LibSparkInterface _getInterface() => throw Exception("FIRO not enabled!"); + +List hashTags({required List base64Tags}) => + throw Exception("FIRO not enabled!"); + +//END_OFF +//ON +LibSparkInterface _getInterface() => _LibSparkInterfaceImpl(); + +List hashTags({required List base64Tags}) => + LibSpark.hashTags(base64Tags: base64Tags); + +class _LibSparkInterfaceImpl extends LibSparkInterface { + @override + String get sparkBaseDerivationPath => kSparkBaseDerivationPath; + + @override + String get sparkBaseDerivationPathTestnet => kSparkBaseDerivationPathTestnet; + + @override + int get sparkChange => kSparkChange; + + @override + int get maxAdditionalInfoLengthBytes => kMaxAdditionalInfoLengthBytes; + + @override + int get maxNameLength => kMaxNameLength; + + @override + int get maxNameRegistrationLengthYears => kMaxNameRegistrationLengthYears; + + @override + String get nameRegexString => kNameRegexString; + + @override + String get stage3DevelopmentFundAddressMainNet => + kStage3DevelopmentFundAddressMainNet; + + @override + String get stage3DevelopmentFundAddressTestNet => + kStage3DevelopmentFundAddressTestNet; + + @override + List get standardSparkNamesFee => + List.unmodifiable(kStandardSparkNamesFee); + + @override + void initSparkLogging(Level level) { + final levels = Level.values.where((e) => e >= level).map((e) => e.name); + Log.levels.addAll( + LoggingLevel.values.where((e) => levels.contains(e.name)), + ); + Log.onLog = (level, value, {error, stackTrace, required time}) { + Logging.instance.log( + level.getLoggerLevel(), + value, + error: error, + stackTrace: stackTrace, + time: time, + ); + }; + } + + @override + String hashTag(String x, String y) => LibSpark.hashTag(x, y); + + @override + bool validateAddress({required String address, required bool isTestNet}) => + LibSpark.validateAddress(address: address, isTestNet: isTestNet); + + @override + Future getAddress({ + required Uint8List privateKey, + required int index, + required int diversifier, + bool isTestNet = false, + }) => LibSpark.getAddress( + privateKey: privateKey, + index: index, + diversifier: diversifier, + isTestNet: isTestNet, + ); + + @override + ({Uint8List script, int size}) createSparkNameScript({ + required int sparkNameValidityBlocks, + required String name, + required String additionalInfo, + required String scalarHex, + required String privateKeyHex, + required int spendKeyIndex, + required int diversifier, + required bool isTestNet, + required int hashFailSafe, + required bool ignoreProof, + }) => LibSpark.createSparkNameScript( + sparkNameValidityBlocks: sparkNameValidityBlocks, + name: name, + additionalInfo: additionalInfo, + scalarHex: scalarHex, + privateKeyHex: privateKeyHex, + spendKeyIndex: spendKeyIndex, + diversifier: diversifier, + isTestNet: isTestNet, + hashFailSafe: hashFailSafe, + ignoreProof: ignoreProof, + ); + + @override + List<({int amount, Uint8List scriptPubKey, bool subtractFeeFromAmount})> + createSparkMintRecipients({ + required List<({String memo, String sparkAddress, int value})> outputs, + required Uint8List serialContext, + bool generate = false, + }) => LibSpark.createSparkMintRecipients( + outputs: outputs, + serialContext: serialContext, + generate: generate, + ); + + @override + Uint8List serializeMintContext({required List<(String, int)> inputs}) => + LibSpark.serializeMintContext(inputs: inputs); + + @override + WrappedLibSparkCoin? identifyAndRecoverCoin( + String serializedCoin, { + required String privateKeyHex, + required int index, + required Uint8List context, + bool isTestNet = false, + }) { + final coin = LibSpark.identifyAndRecoverCoin( + serializedCoin, + privateKeyHex: privateKeyHex, + index: index, + context: context, + isTestNet: isTestNet, + ); + + if (coin == null) return null; + + return WrappedLibSparkCoin( + type: WrappedLibSparkCoinType.values.firstWhere( + (e) => e.value == coin.type.value, + ), + + id: coin.id, + height: coin.height, + isUsed: coin.isUsed, + nonceHex: coin.nonceHex, + address: coin.address, + value: coin.value, + serial: coin.serial, + memo: coin.memo, + txHash: coin.txHash, + serialContext: coin.serialContext, + diversifier: coin.diversifier, + encryptedDiversifier: coin.encryptedDiversifier, + tag: coin.tag, + lTagHash: coin.lTagHash, + serializedCoin: coin.serializedCoin, + ); + } + + @override + ({ + int fee, + List outputScripts, + Uint8List serializedSpendPayload, + List< + ({ + int groupId, + int height, + String serializedCoin, + String serializedCoinContext, + }) + > + usedCoins, + }) + createSparkSendTransaction({ + required String privateKeyHex, + int index = 1, + required List<({String address, int amount, bool subtractFeeFromAmount})> + recipients, + required List< + ({ + int amount, + String memo, + String sparkAddress, + bool subtractFeeFromAmount, + }) + > + privateRecipients, + required List< + ({ + int groupId, + int height, + String serializedCoin, + String serializedCoinContext, + }) + > + serializedCoins, + required List< + ({ + List<({String serializedCoin, String txHash})> set, + String setHash, + int setId, + }) + > + allAnonymitySets, + required List<({Uint8List blockHash, int setId})> idAndBlockHashes, + required Uint8List txHash, + required int additionalTxSize, + }) => LibSpark.createSparkSendTransaction( + index: index, + privateKeyHex: privateKeyHex, + recipients: recipients, + privateRecipients: privateRecipients, + serializedCoins: serializedCoins, + allAnonymitySets: allAnonymitySets, + idAndBlockHashes: idAndBlockHashes, + txHash: txHash, + additionalTxSize: additionalTxSize, + ); + + @override + int estimateSparkFee({ + required String privateKeyHex, + int index = 1, + required int sendAmount, + required bool subtractFeeFromAmount, + required List< + ({ + int groupId, + int height, + String serializedCoin, + String serializedCoinContext, + }) + > + serializedCoins, + required int privateRecipientsCount, + required int utxoNum, + required int additionalTxSize, + }) => LibSpark.estimateSparkFee( + privateKeyHex: privateKeyHex, + sendAmount: sendAmount, + subtractFeeFromAmount: subtractFeeFromAmount, + serializedCoins: serializedCoins, + privateRecipientsCount: privateRecipientsCount, + utxoNum: utxoNum, + additionalTxSize: additionalTxSize, + index: index, + ); +} + +// convenience conversion for spark +extension _LoggingLevelExt on LoggingLevel { + Level getLoggerLevel() { + switch (this) { + case LoggingLevel.info: + return Level.info; + case LoggingLevel.warning: + return Level.warning; + case LoggingLevel.error: + return Level.error; + case LoggingLevel.fatal: + return Level.fatal; + case LoggingLevel.debug: + return Level.debug; + case LoggingLevel.trace: + return Level.trace; + } + } +} + +//END_ON From f7de74223c5aa82278b60fe1f8a81995018eb050 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 7 Oct 2025 08:10:03 -0600 Subject: [PATCH 134/178] implement optional import of xelis ffi package --- lib/main.dart | 38 +- .../restore_wallet_view.dart | 11 +- .../xelis_table_progress_provider.dart | 36 +- lib/wallets/crypto_currency/coins/xelis.dart | 5 +- lib/wallets/wallet/impl/xelis_wallet.dart | 220 +++++----- .../wallet/intermediate/lib_xelis_wallet.dart | 211 +-------- .../interfaces/lib_xelis_interface.dart | 317 ++++++++++++++ ...XEL_lib_xelis_interface_impl.template.dart | 411 ++++++++++++++++++ 8 files changed, 855 insertions(+), 394 deletions(-) create mode 100644 lib/wl_gen/interfaces/lib_xelis_interface.dart create mode 100644 tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart diff --git a/lib/main.dart b/lib/main.dart index c75941ecc2..481e398ca8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,9 +25,6 @@ import 'package:keyboard_dismisser/keyboard_dismisser.dart'; import 'package:logger/logger.dart'; import 'package:path_provider/path_provider.dart'; import 'package:window_size/window_size.dart'; -import 'package:xelis_flutter/src/api/api.dart' as xelis_api; -import 'package:xelis_flutter/src/api/logger.dart' as xelis_logging; -import 'package:xelis_flutter/src/frb_generated.dart' as xelis_rust; import 'app_config.dart'; import 'db/db_version_migration.dart'; @@ -79,45 +76,18 @@ import 'wallets/isar/providers/all_wallets_info_provider.dart'; import 'wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import 'widgets/crypto_notifications.dart'; import 'wl_gen/interfaces/cs_monero_interface.dart'; +import 'wl_gen/interfaces/lib_xelis_interface.dart'; final openedFromSWBFileStringStateProvider = StateProvider( (ref) => null, ); -void startListeningToRustLogs() { - xelis_api.createLogStream().listen( - (logEntry) { - final Level level; - switch (logEntry.level) { - case xelis_logging.Level.error: - level = Level.error; - case xelis_logging.Level.warn: - level = Level.warning; - case xelis_logging.Level.info: - level = Level.info; - case xelis_logging.Level.debug: - level = Level.debug; - case xelis_logging.Level.trace: - level = Level.trace; - } - - Logging.instance.log( - level, - "[Xelis Rust Log] ${logEntry.tag}: ${logEntry.msg}", - ); - }, - onError: (dynamic e) { - Logging.instance.e("Error receiving Xelis Rust logs: $e"); - }, - ); -} - // main() is the entry point to the app. It initializes Hive (local database), // runs the MyApp widget and checks for new users, caching the value in the // miscellaneous box for later use void main(List args) async { // talker.info('initializing Rust lib ...'); - await xelis_rust.RustLib.init(); + await libXelis.initRustLib(); WidgetsFlutterBinding.ensureInitialized(); if (Util.isDesktop && args.length == 2 && args.first == "-d") { @@ -205,8 +175,8 @@ void main(List args) async { debugConsoleLevel: kDebugMode ? Level.trace : null, ); - await xelis_api.setUpRustLogger(); - startListeningToRustLogs(); + await libXelis.setupRustLogger(); + libXelis.startListeningToRustLogs(); // setup lib spark logging initSparkLogging(Prefs.instance.logLevel); 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 f1bf78b8ca..50df152020 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 @@ -21,7 +21,6 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:wakelock_plus/wakelock_plus.dart'; -import 'package:xelis_flutter/src/api/seed_search_engine.dart' as x_seed; import '../../../notifications/show_flush_bar.dart'; import '../../../pages_desktop_specific/desktop_home_view.dart'; @@ -62,6 +61,7 @@ import '../../../widgets/table_view/table_view.dart'; import '../../../widgets/table_view/table_view_cell.dart'; import '../../../widgets/table_view/table_view_row.dart'; import '../../../wl_gen/interfaces/cs_monero_interface.dart'; +import '../../../wl_gen/interfaces/lib_xelis_interface.dart'; import '../../home_view/home_view.dart'; import '../add_token_view/edit_wallet_tokens_view.dart'; import '../select_wallet_for_token_view.dart'; @@ -101,7 +101,6 @@ class _RestoreWalletViewState extends ConsumerState { late final int _seedWordCount; late final bool isDesktop; - x_seed.SearchEngine? _xelisSeedSearch; final HashSet _wordListHashSet = HashSet.from(bip39wordlist.WORDLIST); final ScrollController controller = ScrollController(); @@ -163,12 +162,6 @@ class _RestoreWalletViewState extends ConsumerState { // _focusNodes.add(FocusNode()); } - if (widget.coin is Xelis) { - _xelisSeedSearch = x_seed.SearchEngine.init( - languageIndex: BigInt.from(0), - ); - } - super.initState(); } @@ -203,7 +196,7 @@ class _RestoreWalletViewState extends ConsumerState { return wowneroWordList.contains(word); } if (widget.coin is Xelis) { - return _xelisSeedSearch!.search(query: word).length > 0; + return libXelis.validateSeedWord(word); } return _wordListHashSet.contains(word); } diff --git a/lib/providers/progress_report/xelis_table_progress_provider.dart b/lib/providers/progress_report/xelis_table_progress_provider.dart index cbebe82243..82a6b353ef 100644 --- a/lib/providers/progress_report/xelis_table_progress_provider.dart +++ b/lib/providers/progress_report/xelis_table_progress_provider.dart @@ -1,8 +1,6 @@ -import 'package:xelis_flutter/src/api/api.dart' as xelis_api; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter/foundation.dart'; -import 'dart:math' as math; +import '../../wl_gen/interfaces/lib_xelis_interface.dart'; enum XelisTableGenerationStep { t1PointsGeneration, @@ -47,32 +45,6 @@ class XelisTableProgressState { } } -final xelisTableProgressProvider = StreamProvider((ref) { - double lastPrintedProgress = 0.0; - return xelis_api.createProgressReportStream().map((report) { - return report.when( - tableGeneration: (progress, step, _) { - final currentStep = XelisTableGenerationStep.fromString(step); - final stepIndex = switch(currentStep) { - XelisTableGenerationStep.t1PointsGeneration => 0, - XelisTableGenerationStep.t1CuckooSetup => 1, - XelisTableGenerationStep.t2Table => 2, - XelisTableGenerationStep.unknown => 0, - }; - - if ((progress - lastPrintedProgress).abs() >= 0.05 || - currentStep != XelisTableGenerationStep.fromString(step) || - progress >= 0.99) { - debugPrint("Xelis Table Generation: $step - ${progress*100.0}%"); - lastPrintedProgress = progress; - } - - return XelisTableProgressState( - tableProgress: progress, - currentStep: currentStep, - ); - }, - misc: (_) => const XelisTableProgressState(), - ); - }); -}); \ No newline at end of file +final xelisTableProgressProvider = StreamProvider( + (ref) => libXelis.createProgressReportStream(), +); diff --git a/lib/wallets/crypto_currency/coins/xelis.dart b/lib/wallets/crypto_currency/coins/xelis.dart index 62b33326b2..e036c24427 100644 --- a/lib/wallets/crypto_currency/coins/xelis.dart +++ b/lib/wallets/crypto_currency/coins/xelis.dart @@ -1,9 +1,8 @@ -import 'package:xelis_flutter/src/api/utils.dart' as x_utils; - import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/node_model.dart'; import '../../../utilities/default_nodes.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; +import '../../../wl_gen/interfaces/lib_xelis_interface.dart'; import '../crypto_currency.dart'; import '../intermediate/electrum_currency.dart'; @@ -94,7 +93,7 @@ class Xelis extends ElectrumCurrency { @override bool validateAddress(String address) { try { - return x_utils.isAddressValid(strAddress: address); + return libXelis.isAddressValid(address: address); } catch (_) { return false; } diff --git a/lib/wallets/wallet/impl/xelis_wallet.dart b/lib/wallets/wallet/impl/xelis_wallet.dart index 71f5f38949..d36b8310c0 100644 --- a/lib/wallets/wallet/impl/xelis_wallet.dart +++ b/lib/wallets/wallet/impl/xelis_wallet.dart @@ -5,8 +5,6 @@ import 'dart:math'; import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; -import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; -import 'package:xelis_flutter/src/api/wallet.dart' as x_wallet; import '../../../models/balance.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; @@ -20,6 +18,7 @@ import '../../../services/event_bus/global_event_bus.dart'; import '../../../utilities/amount/amount.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; +import '../../../wl_gen/interfaces/lib_xelis_interface.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../../models/tx_data.dart'; import '../intermediate/lib_xelis_wallet.dart'; @@ -44,29 +43,28 @@ class XelisWallet extends LibXelisWallet { key: Wallet.mnemonicPassphraseKey(walletId: info.walletId), ); - final mnemonic = await getMnemonic(); - final seedLength = mnemonic.trim().split(" ").length; + final mnemonic = (await getMnemonic()).trim(); + final seedLength = mnemonic.split(" ").length; invalidSeedLengthCheck(seedLength); Logging.instance.i("Xelis: recovering wallet"); - final wallet = await x_wallet.createXelisWallet( + await libXelis.createXelisWallet( + walletId, name: name, directory: directory, password: password!, - seed: mnemonic.trim(), - network: cryptoCurrency.network.xelisNetwork, + seed: mnemonic, + network: cryptoCurrency.network, precomputedTablesPath: tablePath, l1Low: tableState.currentSize.isLow, ); await secureStorageInterface.write( key: Wallet.mnemonicKey(walletId: walletId), - value: mnemonic.trim(), + value: mnemonic, ); - libXelisWallet = wallet; - await _finishInit(); } @@ -84,23 +82,22 @@ class XelisWallet extends LibXelisWallet { value: password, ); - final wallet = await x_wallet.createXelisWallet( + await libXelis.createXelisWallet( + walletId, name: name, directory: directory, password: password, - network: cryptoCurrency.network.xelisNetwork, + network: cryptoCurrency.network, precomputedTablesPath: tablePath, l1Low: tableState.currentSize.isLow, ); - final mnemonic = await wallet.getSeed(); + final mnemonic = await libXelis.getSeed(walletId); await secureStorageInterface.write( key: Wallet.mnemonicKey(walletId: walletId), value: mnemonic.trim(), ); - libXelisWallet = wallet; - await _finishInit(); } @@ -115,11 +112,12 @@ class XelisWallet extends LibXelisWallet { key: Wallet.mnemonicPassphraseKey(walletId: info.walletId), ); - libXelisWallet = await x_wallet.openXelisWallet( + await libXelis.openXelisWallet( + walletId, name: name, directory: directory, password: password!, - network: cryptoCurrency.network.xelisNetwork, + network: cryptoCurrency.network, precomputedTablesPath: tablePath, l1Low: tableState.currentSize.isLow, ); @@ -138,7 +136,7 @@ class XelisWallet extends LibXelisWallet { walletId: walletId, derivationIndex: 0, derivationPath: null, - value: libXelisWallet!.getAddressStr(), + value: libXelis.getAddress(walletId), publicKey: [], type: AddressType.xelis, subType: AddressSubType.receiving, @@ -170,7 +168,7 @@ class XelisWallet extends LibXelisWallet { walletId, ); - if (libXelisWallet == null) { + if (!libXelis.walletInstanceExists(walletId)) { if (isRestore == true) { await _restoreWallet(); } else { @@ -226,7 +224,7 @@ class XelisWallet extends LibXelisWallet { @override Future pingCheck() async { try { - await libXelisWallet!.getDaemonInfo(); + await libXelis.getDaemonInfo(walletId); await handleOnline(); return true; } catch (_) { @@ -241,12 +239,12 @@ class XelisWallet extends LibXelisWallet { Future updateBalance({int? newBalance}) async { await _balanceUpdateMutex.protect(() async { try { - if (await libXelisWallet!.hasXelisBalance()) { - final BigInt xelBalance = - newBalance != null - ? BigInt.from(newBalance) - : await libXelisWallet! - .getXelisBalanceRaw(); // in the future, use getAssetBalances and handle each + if (await libXelis.hasXelisBalance(walletId)) { + final BigInt xelBalance = newBalance != null + ? BigInt.from(newBalance) + : await libXelis.getXelisBalanceRaw( + walletId, + ); // in the future, use getAssetBalances and handle each final balance = Balance( total: Amount( rawValue: xelBalance, @@ -276,9 +274,9 @@ class XelisWallet extends LibXelisWallet { } Future _fetchChainHeight() async { - final infoString = await libXelisWallet!.getDaemonInfo(); - final Map nodeInfo = - (json.decode(infoString) as Map).cast(); + final infoString = await libXelis.getDaemonInfo(walletId); + final Map nodeInfo = (json.decode(infoString) as Map) + .cast(); pruningHeight = int.tryParse(nodeInfo['pruned_topoheight']?.toString() ?? '0') ?? 0; @@ -306,9 +304,9 @@ class XelisWallet extends LibXelisWallet { @override Future updateNode() async { try { - final bool online = await libXelisWallet!.isOnline(); + final bool online = await libXelis.isOnline(walletId); if (online == true) { - await libXelisWallet!.offlineMode(); + await libXelis.offlineMode(walletId); } await super.connect(); } catch (e, s) { @@ -324,7 +322,7 @@ class XelisWallet extends LibXelisWallet { @override Future> updateTransactions({ bool isRescan = false, - List? objTransactions, + List? objTransactions, int? topoheight, }) async { checkInitialized(); @@ -335,7 +333,7 @@ class XelisWallet extends LibXelisWallet { walletId: walletId, derivationIndex: 0, derivationPath: null, - value: libXelisWallet!.getAddressStr(), + value: libXelis.getAddress(walletId), publicKey: [], type: AddressType.xelis, subType: AddressSubType.receiving, @@ -358,36 +356,20 @@ class XelisWallet extends LibXelisWallet { firstBlock -= 10; } } else { - await libXelisWallet!.rescan(topoheight: BigInt.from(pruningHeight)); - } - - xelis_sdk.TransactionEntry _checkDecodeJsonStringTxEntry( - String jsonString, - ) { - final json = jsonDecode(jsonString); - if (json is Map) { - return xelis_sdk.TransactionEntry.fromJson(json.cast()); - } - - throw Exception("Not a Map on jsonDecode($jsonString)"); + await libXelis.rescan(walletId, topoheight: BigInt.from(pruningHeight)); } - final txList = - objTransactions ?? - (await libXelisWallet!.allHistory()) - .map(_checkDecodeJsonStringTxEntry) - .toList(); + final txList = objTransactions ?? (await libXelis.allHistory(walletId)); final List txns = []; for (final transactionEntry in txList) { try { // Check for duplicates - final storedTx = - await mainDB.isar.transactionV2s - .where() - .txidWalletIdEqualTo(transactionEntry.hash, walletId) - .findFirst(); + final storedTx = await mainDB.isar.transactionV2s + .where() + .txidWalletIdEqualTo(transactionEntry.hash, walletId) + .findFirst(); if (storedTx != null && storedTx.height != null && @@ -406,14 +388,15 @@ class XelisWallet extends LibXelisWallet { ); final Map otherData = {}; - final entryType = transactionEntry.txEntryType; + final entryType = transactionEntry.entryType; - if (entryType is xelis_sdk.CoinbaseEntry) { + if (entryType is CoinbaseEntryWrapper) { final coinbase = entryType; txType = TransactionType.incoming; - final int decimals = await libXelisWallet!.getAssetDecimals( - asset: xelis_sdk.xelisAsset, + final int decimals = await libXelis.getAssetDecimals( + walletId, + asset: libXelis.xelisAsset, ); fee = Amount( @@ -430,11 +413,12 @@ class XelisWallet extends LibXelisWallet { ), ); otherData['overrideFee'] = fee.toJsonString(); - } else if (entryType is xelis_sdk.BurnEntry) { + } else if (entryType is BurnEntryWrapper) { final burn = entryType; txType = TransactionType.outgoing; - final int decimals = await libXelisWallet!.getAssetDecimals( + final int decimals = await libXelis.getAssetDecimals( + walletId, asset: burn.asset, ); @@ -468,15 +452,15 @@ class XelisWallet extends LibXelisWallet { ); otherData['burnAsset'] = burn.asset; - } else if (entryType is xelis_sdk.IncomingEntry) { + } else if (entryType is IncomingEntryWrapper) { final incoming = entryType; - txType = - incoming.from == thisAddress - ? TransactionType.sentToSelf - : TransactionType.incoming; + txType = incoming.from == thisAddress + ? TransactionType.sentToSelf + : TransactionType.incoming; for (final transfer in incoming.transfers) { - final int decimals = await libXelisWallet!.getAssetDecimals( + final int decimals = await libXelis.getAssetDecimals( + walletId, asset: transfer.asset, ); @@ -496,12 +480,11 @@ class XelisWallet extends LibXelisWallet { otherData['asset_${transfer.asset}'] = transfer.amount.toString(); if (transfer.extraData != null) { - otherData['extraData_${transfer.asset}'] = - transfer.extraData!.toJson(); + otherData['extraData_${transfer.asset}'] = transfer.extraData!; } otherData['overrideFee'] = fee.toJsonString(); } - } else if (entryType is xelis_sdk.OutgoingEntry) { + } else if (entryType is OutgoingEntryWrapper) { final outgoing = entryType; txType = TransactionType.outgoing; nonce = outgoing.nonce; @@ -551,11 +534,10 @@ class XelisWallet extends LibXelisWallet { ), ); - otherData['asset_${transfer.asset}_amount'] = - transfer.amount.toString(); + otherData['asset_${transfer.asset}_amount'] = transfer.amount + .toString(); if (transfer.extraData != null) { - otherData['extraData_${transfer.asset}'] = - transfer.extraData!.toJson(); + otherData['extraData_${transfer.asset}'] = transfer.extraData!; } } } else { @@ -639,14 +621,13 @@ class XelisWallet extends LibXelisWallet { try { checkInitialized(); - final recipients = - txData.recipients?.isNotEmpty == true - ? txData.recipients! - : throw ArgumentError( - 'Address cannot be empty.', - ); // in the future, support for multiple recipients will work. + final recipients = txData.recipients?.isNotEmpty == true + ? txData.recipients! + : throw ArgumentError( + 'Address cannot be empty.', + ); // in the future, support for multiple recipients will work. - final asset = assetId ?? xelis_sdk.xelisAsset; + final asset = assetId ?? libXelis.xelisAsset; // Calculate total send amount final totalSendAmount = recipients.fold( @@ -658,7 +639,7 @@ class XelisWallet extends LibXelisWallet { ); // Check balance using raw method - final xelBalance = await libXelisWallet!.getXelisBalanceRaw(); + final xelBalance = await libXelis.getXelisBalanceRaw(walletId); final balance = Amount( rawValue: xelBalance, fractionDigits: cryptoCurrency.fractionDigits, @@ -675,12 +656,14 @@ class XelisWallet extends LibXelisWallet { // Check if we have enough for both transfers and fee if (totalSendAmount + boostedFee > balance) { - final requiredAmt = await libXelisWallet!.formatCoin( + final requiredAmt = await libXelis.formatCoin( + walletId, atomicAmount: (totalSendAmount + boostedFee).raw, assetHash: asset, ); - final availableAmt = await libXelisWallet!.formatCoin( + final availableAmt = await libXelis.formatCoin( + walletId, atomicAmount: xelBalance, assetHash: asset, ); @@ -714,37 +697,37 @@ class XelisWallet extends LibXelisWallet { }) async { try { checkInitialized(); - final asset = assetId ?? xelis_sdk.xelisAsset; + final asset = assetId ?? libXelis.xelisAsset; // Default values for a new wallet or when estimation fails final defaultDecimals = cryptoCurrency.fractionDigits; final defaultFee = BigInt.from(0); // Use default address if recipients list is empty to ensure basic fee estimates are readily available - final effectiveRecipients = - recipients.isNotEmpty - ? recipients - : [ - TxRecipient( - address: - 'xel:xz9574c80c4xegnvurazpmxhw5dlg2n0g9qm60uwgt75uqyx3pcsqzzra9m', - amount: amount, - isChange: false, - addressType: AddressType.xelis, - ), - ]; + final effectiveRecipients = recipients.isNotEmpty + ? recipients + : [ + TxRecipient( + address: + 'xel:xz9574c80c4xegnvurazpmxhw5dlg2n0g9qm60uwgt75uqyx3pcsqzzra9m', + amount: amount, + isChange: false, + addressType: AddressType.xelis, + ), + ]; try { final transfers = await Future.wait( effectiveRecipients.map((recipient) async { try { final amt = double.parse( - await libXelisWallet!.formatCoin( + await libXelis.formatCoin( + walletId, atomicAmount: recipient.amount.raw, assetHash: asset, ), ); - return x_wallet.Transfer( + return WrappedTransfer( floatAmount: amt, strAddress: recipient.address, assetHash: asset, @@ -760,7 +743,7 @@ class XelisWallet extends LibXelisWallet { final rawAmount = recipient.amount.raw; final floatAmount = rawAmount / BigInt.from(10).pow(defaultDecimals); - return x_wallet.Transfer( + return WrappedTransfer( floatAmount: floatAmount.toDouble(), strAddress: recipient.address, assetHash: asset, @@ -770,9 +753,12 @@ class XelisWallet extends LibXelisWallet { }), ); - final decimals = await libXelisWallet!.getAssetDecimals(asset: asset); + final decimals = await libXelis.getAssetDecimals( + walletId, + asset: asset, + ); final estimatedFee = double.parse( - await libXelisWallet!.estimateFees(transfers: transfers), + await libXelis.estimateFees(walletId, transfers: transfers), ); final rawFee = (estimatedFee * pow(10, decimals)).round(); return Amount( @@ -817,19 +803,21 @@ class XelisWallet extends LibXelisWallet { ? jsonDecode(txData.otherData!) : null)?['asset'] as String? ?? - xelis_sdk.xelisAsset; + libXelis.xelisAsset; final amt = double.parse( - await libXelisWallet!.formatCoin( + await libXelis.formatCoin( + walletId, atomicAmount: sendAmount.raw, assetHash: asset, ), ); // Create a transfer transaction - final txJson = await libXelisWallet!.createTransfersTransaction( + final txJson = await libXelis.createTransfersTransaction( + walletId, transfers: [ - x_wallet.Transfer( + WrappedTransfer( floatAmount: amt, strAddress: recipient.address, assetHash: asset, @@ -842,7 +830,7 @@ class XelisWallet extends LibXelisWallet { final txHash = txMap['hash'] as String; // Broadcast the transaction - await libXelisWallet!.broadcastTransaction(txHash: txHash); + await libXelis.broadcastTransaction(walletId, txHash: txHash); return await updateSentCachedTxData( txData: txData.copyWith(txid: txHash), @@ -862,11 +850,11 @@ class XelisWallet extends LibXelisWallet { switch (event) { case NewTopoheight(:final height): await handleNewTopoHeight(height); - case NewAsset(:final asset): - await handleNewAsset(asset); + case NewAsset(): + await handleNewAsset(event); case NewTransaction(:final transaction): await handleNewTransaction(transaction); - case BalanceChanged(:final event): + case BalanceChanged(): await handleBalanceChanged(event); case Rescan(:final startTopoheight): await handleRescan(startTopoheight); @@ -892,7 +880,7 @@ class XelisWallet extends LibXelisWallet { } @override - Future handleNewTransaction(xelis_sdk.TransactionEntry tx) async { + Future handleNewTransaction(TransactionEntryWrapper tx) async { try { final txList = [tx]; final newTxIds = await updateTransactions( @@ -916,10 +904,10 @@ class XelisWallet extends LibXelisWallet { } @override - Future handleBalanceChanged(xelis_sdk.BalanceChangedEvent event) async { + Future handleBalanceChanged(BalanceChanged event) async { try { - final asset = event.assetHash; - if (asset == xelis_sdk.xelisAsset) { + final asset = event.asset; + if (asset == libXelis.xelisAsset) { await updateBalance(newBalance: event.balance); } @@ -983,7 +971,7 @@ class XelisWallet extends LibXelisWallet { } @override - Future handleNewAsset(xelis_sdk.AssetData asset) async { + Future handleNewAsset(NewAsset asset) async { // TODO: Store asset information if needed // TODO: Update UI/state for new asset Logging.instance.d("New xelis asset detected: $asset"); @@ -993,7 +981,7 @@ class XelisWallet extends LibXelisWallet { Future refresh({int? topoheight}) async { await refreshMutex.protect(() async { try { - final bool online = await libXelisWallet!.isOnline(); + final bool online = await libXelis.isOnline(walletId); if (online == true) { await updateChainHeight(topoheight: topoheight); await updateBalance(); diff --git a/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart b/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart index e9604eafd6..4cec5e1f4e 100644 --- a/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart @@ -1,149 +1,18 @@ import 'dart:async'; -import 'dart:convert'; import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; -import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; -import 'package:xelis_flutter/src/api/network.dart' as x_network; -import 'package:xelis_flutter/src/api/wallet.dart' as x_wallet; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; -import '../../crypto_currency/crypto_currency.dart'; +import '../../../wl_gen/interfaces/lib_xelis_interface.dart'; import '../../crypto_currency/intermediate/electrum_currency.dart'; import '../wallet_mixin_interfaces/mnemonic_interface.dart'; import 'external_wallet.dart'; -enum XelisTableSize { - low, - full; - - bool get isLow => this == XelisTableSize.low; - - static XelisTableSize get platformDefault { - if (kIsWeb) { - return XelisTableSize.low; - } - return XelisTableSize.full; - } -} - -class XelisTableState { - final bool isGenerating; - final XelisTableSize currentSize; - final XelisTableSize _desiredSize; - - XelisTableSize get desiredSize { - if (kIsWeb) { - return XelisTableSize.low; - } - return _desiredSize; - } - - const XelisTableState({ - this.isGenerating = false, - this.currentSize = XelisTableSize.low, - XelisTableSize desiredSize = XelisTableSize.full, - }) : _desiredSize = desiredSize; - - XelisTableState copyWith({ - bool? isGenerating, - XelisTableSize? currentSize, - XelisTableSize? desiredSize, - }) { - return XelisTableState( - isGenerating: isGenerating ?? this.isGenerating, - currentSize: currentSize ?? this.currentSize, - desiredSize: kIsWeb ? XelisTableSize.low : (desiredSize ?? _desiredSize), - ); - } - - factory XelisTableState.fromJson(Map json) { - return XelisTableState( - isGenerating: json['isGenerating'] as bool, - currentSize: XelisTableSize.values[json['currentSize'] as int], - desiredSize: XelisTableSize.values[json['desiredSize'] as int], - ); - } - - Map toJson() => { - 'isGenerating': isGenerating, - 'currentSize': currentSize.index, - 'desiredSize': _desiredSize.index, - }; -} - -extension XelisNetworkConversion on CryptoCurrencyNetwork { - x_network.Network get xelisNetwork { - switch (this) { - case CryptoCurrencyNetwork.main: - return x_network.Network.mainnet; - case CryptoCurrencyNetwork.test: - return x_network.Network.testnet; - default: - throw ArgumentError('Unsupported network type for Xelis: $this'); - } - } -} - -extension CryptoCurrencyNetworkConversion on x_network.Network { - CryptoCurrencyNetwork get cryptoCurrencyNetwork { - switch (this) { - case x_network.Network.mainnet: - return CryptoCurrencyNetwork.main; - case x_network.Network.testnet: - return CryptoCurrencyNetwork.test; - default: - throw ArgumentError('Unsupported Xelis network type: $this'); - } - } -} - -sealed class Event { - const Event(); -} - -final class NewTopoheight extends Event { - final int height; - const NewTopoheight(this.height); -} - -final class NewAsset extends Event { - final xelis_sdk.AssetData asset; - const NewAsset(this.asset); -} - -final class NewTransaction extends Event { - final xelis_sdk.TransactionEntry transaction; - const NewTransaction(this.transaction); -} - -final class BalanceChanged extends Event { - final xelis_sdk.BalanceChangedEvent event; - const BalanceChanged(this.event); -} - -final class Rescan extends Event { - final int startTopoheight; - const Rescan(this.startTopoheight); -} - -final class Online extends Event { - const Online(); -} - -final class Offline extends Event { - const Offline(); -} - -final class HistorySynced extends Event { - final int topoheight; - const HistorySynced(this.topoheight); -} - abstract class LibXelisWallet extends ExternalWallet with MnemonicInterface { @@ -155,19 +24,10 @@ abstract class LibXelisWallet static final _tableGenerationMutex = Mutex(); static Completer? _tableGenerationCompleter; - x_wallet.XelisWallet? libXelisWallet; int pruningHeight = 0; - x_wallet.XelisWallet? get wallet => libXelisWallet; - set wallet(x_wallet.XelisWallet? newWallet) { - if (newWallet == null && libXelisWallet != null) { - throw StateError('Cannot set wallet to null after initialization'); - } - libXelisWallet = newWallet; - } - void checkInitialized() { - if (libXelisWallet == null) { + if (!libXelis.walletInstanceExists(walletId)) { throw StateError('libXelisWallet not initialized'); } } @@ -216,66 +76,15 @@ abstract class LibXelisWallet ); } - Stream convertRawEvents() async* { - checkInitialized(); - final rawEventStream = libXelisWallet!.eventsStream(); - - await for (final rawData in rawEventStream) { - final json = jsonDecode(rawData); - try { - final eventType = xelis_sdk.WalletEvent.fromStr( - json['event'] as String, - ); - switch (eventType) { - case xelis_sdk.WalletEvent.newTopoHeight: - yield NewTopoheight(json['data']['topoheight'] as int); - case xelis_sdk.WalletEvent.newAsset: - yield NewAsset( - xelis_sdk.AssetData.fromJson( - json['data'] as Map, - ), - ); - case xelis_sdk.WalletEvent.newTransaction: - yield NewTransaction( - xelis_sdk.TransactionEntry.fromJson( - json['data'] as Map, - ), - ); - case xelis_sdk.WalletEvent.balanceChanged: - yield BalanceChanged( - xelis_sdk.BalanceChangedEvent.fromJson( - json['data'] as Map, - ), - ); - case xelis_sdk.WalletEvent.rescan: - yield Rescan(json['data']['start_topoheight'] as int); - case xelis_sdk.WalletEvent.online: - yield const Online(); - case xelis_sdk.WalletEvent.offline: - yield const Offline(); - case xelis_sdk.WalletEvent.historySynced: - yield HistorySynced(json['data']['topoheight'] as int); - } - } catch (e, s) { - Logging.instance.e( - "Error processing xelis wallet event: $rawData", - error: e, - stackTrace: s, - ); - continue; - } - } - } - Future handleEvent(Event event) async {} Future handleNewTopoHeight(int height); - Future handleNewTransaction(xelis_sdk.TransactionEntry tx); - Future handleBalanceChanged(xelis_sdk.BalanceChangedEvent event); + Future handleNewTransaction(TransactionEntryWrapper tx); + Future handleBalanceChanged(BalanceChanged event); Future handleRescan(int startTopoheight) async {} Future handleOnline() async {} Future handleOffline() async {} Future handleHistorySynced(int topoheight) async {} - Future handleNewAsset(xelis_sdk.AssetData asset) async {} + Future handleNewAsset(NewAsset asset) async {} @override Future refresh({int? topoheight}); @@ -283,10 +92,12 @@ abstract class LibXelisWallet Future connect() async { final node = getCurrentNode(); try { - _eventSubscription = convertRawEvents().listen(handleEvent); + checkInitialized(); + _eventSubscription = libXelis.eventsStream(walletId).listen(handleEvent); Logging.instance.i("Connecting to node: ${node.host}:${node.port}"); - await libXelisWallet!.onlineMode( + await libXelis.onlineMode( + walletId, daemonAddress: "${node.host}:${node.port}", ); await super.refresh(); @@ -356,7 +167,7 @@ abstract class LibXelisWallet await _eventSubscription?.cancel(); _eventSubscription = null; - await libXelisWallet?.offlineMode(); + await libXelis.offlineMode(walletId); await super.exit(); }); } finally { @@ -413,7 +224,7 @@ extension XelisTableManagement on LibXelisWallet { Logging.instance.i("Xelis: Generating large tables in background"); final tablePath = await getPrecomputedTablesPath(); - await x_wallet.updateTables( + await libXelis.updateTables( precomputedTablesPath: tablePath, l1Low: state.desiredSize.isLow, ); diff --git a/lib/wl_gen/interfaces/lib_xelis_interface.dart b/lib/wl_gen/interfaces/lib_xelis_interface.dart new file mode 100644 index 0000000000..533b90f901 --- /dev/null +++ b/lib/wl_gen/interfaces/lib_xelis_interface.dart @@ -0,0 +1,317 @@ +import 'package:flutter/foundation.dart'; + +import '../../providers/progress_report/xelis_table_progress_provider.dart'; +import '../../wallets/crypto_currency/crypto_currency.dart'; + +export '../generated/lib_xelis_interface_impl.dart'; + +abstract class LibXelisInterface { + String get xelisAsset; + + bool walletInstanceExists(String walletId); + + Future initRustLib(); + + Future setupRustLogger(); + + void startListeningToRustLogs(); + + Stream createProgressReportStream(); + + bool isAddressValid({required String address}); + + bool validateSeedWord(String word); + + Stream eventsStream(String walletId); + + Future onlineMode(String walletId, {required String daemonAddress}); + Future offlineMode(String walletId); + + Future updateTables({ + required String precomputedTablesPath, + required bool l1Low, + }); + + Future getSeed(String walletId); + + Future createXelisWallet( + String walletId, { + required String name, + required String directory, + required String password, + required CryptoCurrencyNetwork network, + String? seed, + String? privateKey, + String? precomputedTablesPath, + bool? l1Low, + }); + + Future openXelisWallet( + String walletId, { + required String name, + required String directory, + required String password, + required CryptoCurrencyNetwork network, + String? precomputedTablesPath, + bool? l1Low, + }); + + String getAddress(String walletId); + + Future getDaemonInfo(String walletId); + + Future isOnline(String walletId); + + Future rescan(String walletId, {required BigInt topoheight}); + + Future> allHistory(String walletId); + + Future broadcastTransaction(String walletId, {required String txHash}); + + Future estimateFees( + String walletId, { + required List transfers, + }); + + Future createTransfersTransaction( + String walletId, { + required List transfers, + }); + + Future formatCoin( + String walletId, { + required BigInt atomicAmount, + String? assetHash, + }); + + Future getAssetDecimals(String walletId, {required String asset}); + + Future getXelisBalanceRaw(String walletId); + + Future hasXelisBalance(String walletId); +} + +// ============================================================================= +// ============== stupid ======================================================= +class WrappedTransfer { + final double floatAmount; + final String strAddress; + final String assetHash; + final String? extraData; + + const WrappedTransfer({ + required this.floatAmount, + required this.strAddress, + required this.assetHash, + this.extraData, + }); + + @override + int get hashCode => + floatAmount.hashCode ^ + strAddress.hashCode ^ + assetHash.hashCode ^ + extraData.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is WrappedTransfer && + runtimeType == other.runtimeType && + floatAmount == other.floatAmount && + strAddress == other.strAddress && + assetHash == other.assetHash && + extraData == other.extraData; +} + +class TransactionEntryWrapper { + final Object _value; + + final EntryWrapper entryType; + + final String hash; + final DateTime? timestamp; + final int topoheight; + + TransactionEntryWrapper( + this._value, { + required this.entryType, + required this.hash, + required this.timestamp, + required this.topoheight, + }); + + T getValue() => _value is T + ? _value as T + : throw Exception( + "Type mismatch: ${_value.runtimeType} is not ${T.runtimeType}", + ); +} + +sealed class EntryWrapper { + const EntryWrapper(); +} + +class CoinbaseEntryWrapper extends EntryWrapper { + final int reward; + const CoinbaseEntryWrapper({required this.reward}); +} + +class BurnEntryWrapper extends EntryWrapper { + final int amount; + final int fee; + final String asset; + + const BurnEntryWrapper({ + required this.amount, + required this.fee, + required this.asset, + }); +} + +class IncomingEntryWrapper extends EntryWrapper { + final String from; + final List<({int amount, String asset, Map? extraData})> + transfers; + + const IncomingEntryWrapper({required this.from, required this.transfers}); +} + +class OutgoingEntryWrapper extends EntryWrapper { + final int nonce; + final int fee; + final List< + ({ + String destination, + int amount, + String asset, + Map? extraData, + }) + > + transfers; + + const OutgoingEntryWrapper({ + required this.nonce, + required this.fee, + required this.transfers, + }); +} + +class UnknownEntryWrapper extends EntryWrapper {} + +// ============================================================================= + +// ============================================================================= +// ============== moved from lib_xelis_wallet.dart ============================= +enum XelisTableSize { + low, + full; + + bool get isLow => this == XelisTableSize.low; + + static XelisTableSize get platformDefault { + if (kIsWeb) { + return XelisTableSize.low; + } + return XelisTableSize.full; + } +} + +class XelisTableState { + final bool isGenerating; + final XelisTableSize currentSize; + final XelisTableSize _desiredSize; + + XelisTableSize get desiredSize { + if (kIsWeb) { + return XelisTableSize.low; + } + return _desiredSize; + } + + const XelisTableState({ + this.isGenerating = false, + this.currentSize = XelisTableSize.low, + XelisTableSize desiredSize = XelisTableSize.full, + }) : _desiredSize = desiredSize; + + XelisTableState copyWith({ + bool? isGenerating, + XelisTableSize? currentSize, + XelisTableSize? desiredSize, + }) { + return XelisTableState( + isGenerating: isGenerating ?? this.isGenerating, + currentSize: currentSize ?? this.currentSize, + desiredSize: kIsWeb ? XelisTableSize.low : (desiredSize ?? _desiredSize), + ); + } + + factory XelisTableState.fromJson(Map json) { + return XelisTableState( + isGenerating: json['isGenerating'] as bool, + currentSize: XelisTableSize.values[json['currentSize'] as int], + desiredSize: XelisTableSize.values[json['desiredSize'] as int], + ); + } + + Map toJson() => { + 'isGenerating': isGenerating, + 'currentSize': currentSize.index, + 'desiredSize': _desiredSize.index, + }; +} + +sealed class Event { + const Event(); +} + +final class NewTopoheight extends Event { + final int height; + + const NewTopoheight(this.height); +} + +final class NewAsset extends Event { + // final xelis_sdk.AssetData asset; + final String name; + final int decimals; + final int? maxSupply; + + NewAsset(this.name, this.decimals, this.maxSupply); +} + +final class NewTransaction extends Event { + // final xelis_sdk.TransactionEntry transaction; + final TransactionEntryWrapper transaction; + const NewTransaction(this.transaction); +} + +final class BalanceChanged extends Event { + // final xelis_sdk.BalanceChangedEvent event; + final String asset; + final int balance; + + const BalanceChanged(this.asset, this.balance); +} + +final class Rescan extends Event { + final int startTopoheight; + + const Rescan(this.startTopoheight); +} + +final class Online extends Event { + const Online(); +} + +final class Offline extends Event { + const Offline(); +} + +final class HistorySynced extends Event { + final int topoheight; + const HistorySynced(this.topoheight); +} + +// ============================================================================= diff --git a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart new file mode 100644 index 0000000000..08f1f9b4aa --- /dev/null +++ b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart @@ -0,0 +1,411 @@ +//ON +import 'dart:convert'; + +import 'package:logger/logger.dart'; +import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; +import 'package:xelis_flutter/src/api/api.dart' as xelis_api; +import 'package:xelis_flutter/src/api/logger.dart' as xelis_logging; +import 'package:xelis_flutter/src/api/network.dart' as x_network; +import 'package:xelis_flutter/src/api/seed_search_engine.dart' as x_seed; +import 'package:xelis_flutter/src/api/utils.dart' as x_utils; +import 'package:xelis_flutter/src/api/wallet.dart' as x_wallet; +import 'package:xelis_flutter/src/frb_generated.dart' as xelis_rust; + +import '../../providers/progress_report/xelis_table_progress_provider.dart'; +import '../../utilities/logger.dart'; +import '../../wallets/crypto_currency/crypto_currency.dart'; +//END_ON +import '../interfaces/lib_xelis_interface.dart'; + +LibXelisInterface get libXelis => _getInterface(); + +//OFF +LibXelisInterface _getInterface() => throw Exception("XEL not enabled!"); + +//END_OFF +//ON +LibXelisInterface _getInterface() => _MwebdServerInterfaceImpl(); + +final class _MwebdServerInterfaceImpl extends LibXelisInterface { + final Map _wallets = {}; + + @override + String get xelisAsset => xelis_sdk.xelisAsset; + + @override + bool walletInstanceExists(String walletId) => _wallets[walletId] != null; + + @override + Future initRustLib() => xelis_rust.RustLib.init(); + + @override + Future setupRustLogger() => xelis_api.setUpRustLogger(); + + @override + void startListeningToRustLogs() => xelis_api.createLogStream().listen( + (logEntry) { + final Level level; + switch (logEntry.level) { + case xelis_logging.Level.error: + level = Level.error; + case xelis_logging.Level.warn: + level = Level.warning; + case xelis_logging.Level.info: + level = Level.info; + case xelis_logging.Level.debug: + level = Level.debug; + case xelis_logging.Level.trace: + level = Level.trace; + } + + Logging.instance.log( + level, + "[Xelis Rust Log] ${logEntry.tag}: ${logEntry.msg}", + ); + }, + onError: (dynamic e) { + Logging.instance.e("Error receiving Xelis Rust logs: $e"); + }, + ); + + @override + Stream createProgressReportStream() { + double lastPrintedProgress = 0.0; + return xelis_api.createProgressReportStream().map((report) { + return report.when( + tableGeneration: (progress, step, _) { + final currentStep = XelisTableGenerationStep.fromString(step); + if ((progress - lastPrintedProgress).abs() >= 0.05 || + currentStep != XelisTableGenerationStep.fromString(step) || + progress >= 0.99) { + Logging.instance.d( + "Xelis Table Generation: $step - ${progress * 100.0}%", + ); + lastPrintedProgress = progress; + } + + return XelisTableProgressState( + tableProgress: progress, + currentStep: currentStep, + ); + }, + misc: (_) => const XelisTableProgressState(), + ); + }); + } + + @override + bool isAddressValid({required String address}) => + x_utils.isAddressValid(strAddress: address); + + x_seed.SearchEngine? _xelisSeedSearch; + @override + bool validateSeedWord(String word) { + _xelisSeedSearch ??= x_seed.SearchEngine.init( + languageIndex: BigInt.from(0), + ); + + return _xelisSeedSearch!.search(query: word).isNotEmpty; + } + + @override + Stream eventsStream(String walletId) async* { + final rawEventStream = _wallets[walletId]!.eventsStream(); + + await for (final rawData in rawEventStream) { + final json = jsonDecode(rawData); + try { + final eventType = xelis_sdk.WalletEvent.fromStr( + json['event'] as String, + ); + switch (eventType) { + case xelis_sdk.WalletEvent.newTopoHeight: + yield NewTopoheight(json['data']['topoheight'] as int); + case xelis_sdk.WalletEvent.newAsset: + final data = xelis_sdk.AssetData.fromJson( + json['data'] as Map, + ); + + yield NewAsset(data.name, data.decimals, data.maxSupply); + case xelis_sdk.WalletEvent.newTransaction: + final tx = xelis_sdk.TransactionEntry.fromJson( + json['data'] as Map, + ); + yield NewTransaction( + TransactionEntryWrapper( + tx, + entryType: _entryTypeConversion(tx.txEntryType), + hash: tx.hash, + timestamp: tx.timestamp, + topoheight: tx.topoheight, + ), + ); + case xelis_sdk.WalletEvent.balanceChanged: + final data = xelis_sdk.BalanceChangedEvent.fromJson( + json['data'] as Map, + ); + yield BalanceChanged(data.assetHash, data.balance); + case xelis_sdk.WalletEvent.rescan: + yield Rescan(json['data']['start_topoheight'] as int); + case xelis_sdk.WalletEvent.online: + yield const Online(); + case xelis_sdk.WalletEvent.offline: + yield const Offline(); + case xelis_sdk.WalletEvent.historySynced: + yield HistorySynced(json['data']['topoheight'] as int); + } + } catch (e, s) { + Logging.instance.e( + "Error processing xelis wallet event: $rawData", + error: e, + stackTrace: s, + ); + continue; + } + } + } + + @override + Future onlineMode(String walletId, {required String daemonAddress}) => + _wallets[walletId]!.onlineMode(daemonAddress: daemonAddress); + + @override + Future offlineMode(String walletId) => + _wallets[walletId]?.offlineMode() ?? Future.value(); + + @override + Future updateTables({ + required String precomputedTablesPath, + required bool l1Low, + }) => x_wallet.updateTables( + precomputedTablesPath: precomputedTablesPath, + l1Low: l1Low, + ); + + @override + Future getSeed(String walletId) => _wallets[walletId]!.getSeed(); + + @override + Future createXelisWallet( + String walletId, { + required String name, + required String directory, + required String password, + required CryptoCurrencyNetwork network, + String? seed, + String? privateKey, + String? precomputedTablesPath, + bool? l1Low, + }) async { + if (walletInstanceExists(walletId)) { + throw Exception( + "Attempted overwrite of existing wallet in cache on create", + ); + } + + _wallets[walletId] = await x_wallet.createXelisWallet( + name: name, + directory: directory, + password: password, + privateKey: privateKey, + seed: seed, + network: network.xelisNetwork, + precomputedTablesPath: precomputedTablesPath, + l1Low: l1Low, + ); + } + + @override + Future openXelisWallet( + String walletId, { + required String name, + required String directory, + required String password, + required CryptoCurrencyNetwork network, + String? precomputedTablesPath, + bool? l1Low, + }) async { + if (walletInstanceExists(walletId)) { + throw Exception( + "Attempted overwrite of existing wallet in cache on open", + ); + } + + _wallets[walletId] = await x_wallet.openXelisWallet( + name: name, + directory: directory, + password: password, + network: network.xelisNetwork, + precomputedTablesPath: precomputedTablesPath, + l1Low: l1Low, + ); + } + + @override + String getAddress(String walletId) => _wallets[walletId]!.getAddressStr(); + + @override + Future getDaemonInfo(String walletId) => + _wallets[walletId]!.getDaemonInfo(); + + @override + Future isOnline(String walletId) => _wallets[walletId]!.isOnline(); + + @override + Future rescan(String walletId, {required BigInt topoheight}) => + _wallets[walletId]!.rescan(topoheight: topoheight); + + @override + Future> allHistory(String walletId) async => + (await _wallets[walletId]!.allHistory()).map((e) { + final tx = _checkDecodeJsonStringTxEntry(e); + return TransactionEntryWrapper( + tx, + entryType: _entryTypeConversion(tx.txEntryType), + hash: tx.hash, + timestamp: tx.timestamp, + topoheight: tx.topoheight, + ); + }).toList(); + + @override + Future broadcastTransaction( + String walletId, { + required String txHash, + }) => _wallets[walletId]!.broadcastTransaction(txHash: txHash); + + @override + Future createTransfersTransaction( + String walletId, { + required List transfers, + }) => _wallets[walletId]!.createTransfersTransaction( + transfers: transfers + .map( + (e) => x_wallet.Transfer( + floatAmount: e.floatAmount, + strAddress: e.strAddress, + assetHash: e.assetHash, + extraData: e.extraData, + ), + ) + .toList(), + ); + + @override + Future estimateFees( + String walletId, { + required List transfers, + }) => _wallets[walletId]!.estimateFees( + transfers: transfers + .map( + (e) => x_wallet.Transfer( + floatAmount: e.floatAmount, + strAddress: e.strAddress, + assetHash: e.assetHash, + extraData: e.extraData, + ), + ) + .toList(), + ); + + @override + Future formatCoin( + String walletId, { + required BigInt atomicAmount, + String? assetHash, + }) => _wallets[walletId]!.formatCoin( + atomicAmount: atomicAmount, + assetHash: assetHash, + ); + + @override + Future getAssetDecimals(String walletId, {required String asset}) => + _wallets[walletId]!.getAssetDecimals(asset: asset); + + @override + Future getXelisBalanceRaw(String walletId) => + _wallets[walletId]!.getXelisBalanceRaw(); + + @override + Future hasXelisBalance(String walletId) => + _wallets[walletId]!.hasXelisBalance(); +} + +extension _XelisNetworkConversion on CryptoCurrencyNetwork { + x_network.Network get xelisNetwork { + switch (this) { + case CryptoCurrencyNetwork.main: + return x_network.Network.mainnet; + case CryptoCurrencyNetwork.test: + return x_network.Network.testnet; + default: + throw ArgumentError('Unsupported network type for Xelis: $this'); + } + } +} + +extension _CryptoCurrencyNetworkConversion on x_network.Network { + CryptoCurrencyNetwork get cryptoCurrencyNetwork { + switch (this) { + case x_network.Network.mainnet: + return CryptoCurrencyNetwork.main; + case x_network.Network.testnet: + return CryptoCurrencyNetwork.test; + default: + throw ArgumentError('Unsupported Xelis network type: $this'); + } + } +} + +EntryWrapper _entryTypeConversion(xelis_sdk.TransactionEntryType entryType) { + if (entryType is xelis_sdk.CoinbaseEntry) { + return CoinbaseEntryWrapper(reward: entryType.reward); + } else if (entryType is xelis_sdk.BurnEntry) { + return BurnEntryWrapper( + amount: entryType.amount, + fee: entryType.fee, + asset: entryType.asset, + ); + } else if (entryType is xelis_sdk.IncomingEntry) { + return IncomingEntryWrapper( + from: entryType.from, + transfers: entryType.transfers + .map( + (e) => ( + amount: e.amount, + asset: e.asset, + extraData: e.extraData?.toJson(), + ), + ) + .toList(), + ); + } else if (entryType is xelis_sdk.OutgoingEntry) { + return OutgoingEntryWrapper( + nonce: entryType.nonce, + fee: entryType.fee, + transfers: entryType.transfers + .map( + (e) => ( + destination: e.destination, + amount: e.amount, + asset: e.asset, + extraData: e.extraData?.toJson(), + ), + ) + .toList(), + ); + } else { + return UnknownEntryWrapper(); + } +} + +xelis_sdk.TransactionEntry _checkDecodeJsonStringTxEntry(String jsonString) { + final json = jsonDecode(jsonString); + if (json is Map) { + return xelis_sdk.TransactionEntry.fromJson(json.cast()); + } + + throw Exception("Not a Map on jsonDecode($jsonString)"); +} + +//END_ON From b127e8e7ae99470d7056dbfacd4fe160a3128576 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 7 Oct 2025 09:13:35 -0600 Subject: [PATCH 135/178] fix xmr rpc import --- scripts/app_config/templates/pubspec.template.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/app_config/templates/pubspec.template.yaml b/scripts/app_config/templates/pubspec.template.yaml index 71610671b9..0374094789 100644 --- a/scripts/app_config/templates/pubspec.template.yaml +++ b/scripts/app_config/templates/pubspec.template.yaml @@ -63,7 +63,6 @@ dependencies: # %%ENABLE_XMR%% # cs_monero: 1.0.0-pre.3 # cs_monero_flutter_libs: 1.0.0-pre.0 -# monero_rpc: ^2.0.0 # %%END_ENABLE_XMR%% # %%ENABLE_SAL%% @@ -75,6 +74,8 @@ dependencies: # flutter_mwebd: ^0.0.1-pre.8 # %%END_ENABLE_MWEBD%% + monero_rpc: ^2.0.0 + # cs_monero compat (unpublished) compat: git: From ce22845a51f2c7f8feb26be43da6e9cdd8c01e6c Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 7 Oct 2025 09:39:05 -0600 Subject: [PATCH 136/178] add tor optino to app config --- lib/app_config.dart | 9 ++++----- scripts/app_config/configure_campfire.sh | 1 + scripts/app_config/configure_stack_duo.sh | 1 + scripts/app_config/configure_stack_wallet.sh | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/app_config.dart b/lib/app_config.dart index 5f9b37ab77..3004413d2a 100644 --- a/lib/app_config.dart +++ b/lib/app_config.dart @@ -6,7 +6,7 @@ import 'wallets/crypto_currency/intermediate/frost_currency.dart'; part 'app_config.g.dart'; -enum AppFeature { themeSelection, buy, swap } +enum AppFeature { themeSelection, buy, swap, tor } abstract class AppConfig { static const appName = _prefix + _separator + suffix; @@ -77,10 +77,9 @@ abstract class AppConfig { static CryptoCurrency getCryptoCurrencyByPrettyName(final String prettyName) { // trocador hack const hackSplitter = " (Mainnet"; - final name = - prettyName.contains(hackSplitter) - ? prettyName.split(hackSplitter).first.toLowerCase() - : prettyName.replaceAll(" ", "").toLowerCase(); + final name = prettyName.contains(hackSplitter) + ? prettyName.split(hackSplitter).first.toLowerCase() + : prettyName.replaceAll(" ", "").toLowerCase(); try { return coins.firstWhere( diff --git a/scripts/app_config/configure_campfire.sh b/scripts/app_config/configure_campfire.sh index 8f25938488..c5e49296ac 100755 --- a/scripts/app_config/configure_campfire.sh +++ b/scripts/app_config/configure_campfire.sh @@ -61,6 +61,7 @@ const _shortDescriptionText = "Your privacy. Your wallet. Your Firo."; const _commitHash = "$BUILT_COMMIT_HASH"; const Set _features = { + AppFeature.tor, AppFeature.swap }; diff --git a/scripts/app_config/configure_stack_duo.sh b/scripts/app_config/configure_stack_duo.sh index 17de39bd3a..7a839ae3c0 100755 --- a/scripts/app_config/configure_stack_duo.sh +++ b/scripts/app_config/configure_stack_duo.sh @@ -59,6 +59,7 @@ const _commitHash = "$BUILT_COMMIT_HASH"; const Set _features = { AppFeature.themeSelection, AppFeature.buy, + AppFeature.tor, AppFeature.swap }; diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index b4f503d346..e976821c8e 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -71,6 +71,7 @@ const _commitHash = "$BUILT_COMMIT_HASH"; const Set _features = { AppFeature.themeSelection, AppFeature.buy, + AppFeature.tor, AppFeature.swap }; From 0e17f1e4107af9561079c1ebebdf6339901db7fc Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 7 Oct 2025 09:42:11 -0600 Subject: [PATCH 137/178] only build imported/used packages --- scripts/android/build_all_campfire.sh | 6 ------ scripts/android/build_all_duo.sh | 5 ----- scripts/ios/build_all_campfire.sh | 6 ------ scripts/ios/build_all_duo.sh | 4 ---- scripts/linux/build_all_campfire.sh | 6 ------ scripts/linux/build_all_duo.sh | 4 ---- scripts/macos/build_all_campfire.sh | 6 ------ scripts/macos/build_all_duo.sh | 4 ---- scripts/windows/build_all_campfire.sh | 6 ------ scripts/windows/build_all_duo.sh | 4 ---- 10 files changed, 51 deletions(-) diff --git a/scripts/android/build_all_campfire.sh b/scripts/android/build_all_campfire.sh index dc904e95dd..fd10e418fa 100755 --- a/scripts/android/build_all_campfire.sh +++ b/scripts/android/build_all_campfire.sh @@ -9,13 +9,7 @@ PLUGINS_DIR=../../crypto_plugins # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh ) -(cd "${PLUGINS_DIR}"/flutter_libmwc/scripts/android && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else -(cd "${PLUGINS_DIR}"/frostdart/scripts/android && ./build_all.sh ) - wait echo "Done building" diff --git a/scripts/android/build_all_duo.sh b/scripts/android/build_all_duo.sh index 1a0d6058f9..dcfc24427a 100755 --- a/scripts/android/build_all_duo.sh +++ b/scripts/android/build_all_duo.sh @@ -9,12 +9,7 @@ mkdir -p build PLUGINS_DIR=../../crypto_plugins -# libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh ) -(cd "${PLUGINS_DIR}"/flutter_libmwc/scripts/android && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else (cd "${PLUGINS_DIR}"/frostdart/scripts/android && ./build_all.sh ) diff --git a/scripts/ios/build_all_campfire.sh b/scripts/ios/build_all_campfire.sh index 83177db5c2..994b682446 100755 --- a/scripts/ios/build_all_campfire.sh +++ b/scripts/ios/build_all_campfire.sh @@ -12,14 +12,8 @@ rustup target add x86_64-apple-ios # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else -(cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) - wait echo "Done building" diff --git a/scripts/ios/build_all_duo.sh b/scripts/ios/build_all_duo.sh index 0b560202b6..c09b3528fa 100755 --- a/scripts/ios/build_all_duo.sh +++ b/scripts/ios/build_all_duo.sh @@ -14,10 +14,6 @@ rustup target add x86_64-apple-ios # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else (cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh ) diff --git a/scripts/linux/build_all_campfire.sh b/scripts/linux/build_all_campfire.sh index 50490b1979..d1e1de71a1 100755 --- a/scripts/linux/build_all_campfire.sh +++ b/scripts/linux/build_all_campfire.sh @@ -11,14 +11,8 @@ mkdir -p build # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else -(cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) - ./build_secp256k1.sh wait diff --git a/scripts/linux/build_all_duo.sh b/scripts/linux/build_all_duo.sh index a29947f4f6..3e2ee5b5b1 100755 --- a/scripts/linux/build_all_duo.sh +++ b/scripts/linux/build_all_duo.sh @@ -14,10 +14,6 @@ mkdir -p build # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else (cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) diff --git a/scripts/macos/build_all_campfire.sh b/scripts/macos/build_all_campfire.sh index 2bc4aaf4bb..e1b4216bc0 100755 --- a/scripts/macos/build_all_campfire.sh +++ b/scripts/macos/build_all_campfire.sh @@ -5,13 +5,7 @@ set -x -e # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else -(cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) - wait echo "Done building" diff --git a/scripts/macos/build_all_duo.sh b/scripts/macos/build_all_duo.sh index 29a0d82420..a618eeebb7 100755 --- a/scripts/macos/build_all_duo.sh +++ b/scripts/macos/build_all_duo.sh @@ -7,10 +7,6 @@ set -x -e # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/macos && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_libmwc/scripts/macos && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else (cd ../../crypto_plugins/frostdart/scripts/macos && ./build_all.sh ) diff --git a/scripts/windows/build_all_campfire.sh b/scripts/windows/build_all_campfire.sh index 6d7395bbf3..e74572b457 100755 --- a/scripts/windows/build_all_campfire.sh +++ b/scripts/windows/build_all_campfire.sh @@ -6,14 +6,8 @@ mkdir -p build # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else -(cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) - ./build_secp256k1_wsl.sh wait diff --git a/scripts/windows/build_all_duo.sh b/scripts/windows/build_all_duo.sh index 6a19b94f52..42ff340c37 100755 --- a/scripts/windows/build_all_duo.sh +++ b/scripts/windows/build_all_duo.sh @@ -8,10 +8,6 @@ mkdir -p build # libepiccash requires old rust source ../rust_version.sh -set_rust_version_for_libepiccash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) -(cd ../../crypto_plugins/flutter_libmwc/scripts/windows && ./build_all.sh ) -# set rust (back) to a more recent stable release after building epiccash set_rust_to_everything_else (cd ../../crypto_plugins/frostdart/scripts/windows && ./build_all.sh ) From 3664871ddf1be60e0de04164b0ac2b4cefea5871 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 7 Oct 2025 12:03:14 -0600 Subject: [PATCH 138/178] tor ffi package optional import config --- lib/electrumx_rpc/electrumx_client.dart | 110 ++-- lib/main.dart | 23 +- lib/pages/buy_view/buy_view.dart | 33 +- lib/pages/home_view/home_view.dart | 184 +++--- lib/pages/ordinals/ordinal_details_view.dart | 62 +- lib/pages/paynym/subwidgets/paynym_bot.dart | 10 +- .../tor_settings/tor_settings_view.dart | 53 +- .../wallet_network_settings_view.dart | 585 ++++++++--------- lib/pages/wallet_view/wallet_view.dart | 426 ++++++------- .../desktop_buy/desktop_buy_view.dart | 46 +- lib/pages_desktop_specific/desktop_menu.dart | 92 ++- .../sub_widgets/desktop_wallet_features.dart | 226 ++++--- .../desktop_ordinal_details_view.dart | 72 +-- lib/route_generator.dart | 601 ++++++++---------- lib/services/buy/simplex/simplex_api.dart | 122 ++-- lib/services/coins/tezos/api/tezos_api.dart | 41 +- .../coins/tezos/api/tezos_rpc_api.dart | 14 +- lib/services/ethereum/ethereum_api.dart | 73 ++- .../exchange/change_now/change_now_api.dart | 26 +- .../exchange/nanswap/nanswap_api.dart | 19 +- .../exchange/simpleswap/simpleswap_api.dart | 153 ++--- .../exchange/trocador/trocador_api.dart | 15 +- lib/services/fusion_tor_service.dart | 55 +- lib/services/litescribe_api.dart | 5 +- lib/services/monkey_service.dart | 15 +- lib/services/nano_api.dart | 22 +- lib/services/price.dart | 25 +- lib/services/tor_service.dart | 115 +--- lib/themes/theme_service.dart | 54 +- .../electrum_connection_check.dart | 39 +- lib/utilities/paynym_is_api.dart | 37 +- lib/utilities/test_epic_box_connection.dart | 9 +- lib/utilities/test_mwcmqs_connection.dart | 10 +- lib/utilities/test_node_connection.dart | 22 +- .../test_stellar_node_connection.dart | 5 +- lib/wallets/api/tezos/tezos_api.dart | 41 +- lib/wallets/api/tezos/tezos_rpc_api.dart | 14 +- lib/wallets/wallet/impl/cardano_wallet.dart | 86 ++- lib/wallets/wallet/impl/solana_wallet.dart | 35 +- lib/wallets/wallet/impl/stellar_wallet.dart | 3 +- lib/wallets/wallet/impl/tezos_wallet.dart | 26 +- .../intermediate/lib_monero_wallet.dart | 5 +- .../intermediate/lib_salvium_wallet.dart | 5 +- .../cash_fusion_interface.dart | 127 ++-- .../nano_interface.dart | 99 +-- .../TOR_tor_service_impl.template.dart | 185 ++++++ 46 files changed, 1961 insertions(+), 2064 deletions(-) create mode 100644 tool/wl_templates/TOR_tor_service_impl.template.dart diff --git a/lib/electrumx_rpc/electrumx_client.dart b/lib/electrumx_rpc/electrumx_client.dart index c0d497a9e2..2ef2791cbe 100644 --- a/lib/electrumx_rpc/electrumx_client.dart +++ b/lib/electrumx_rpc/electrumx_client.dart @@ -20,6 +20,7 @@ import 'package:event_bus/event_bus.dart'; import 'package:mutex/mutex.dart'; import 'package:stream_channel/stream_channel.dart'; +import '../app_config.dart'; import '../exceptions/electrumx/no_such_transaction.dart'; import '../models/electrumx_response/spark_models.dart'; import '../services/event_bus/events/global/tor_connection_status_changed_event.dart'; @@ -220,46 +221,47 @@ class ElectrumXClient { Future checkElectrumAdapter() async { ({InternetAddress host, int port})? proxyInfo; - // If we're supposed to use Tor... - if (_prefs.useTor) { - // But Tor isn't running... - if (_torService.status != TorConnectionStatus.connected) { - // And the killswitch isn't set... - if (!_prefs.torKillSwitch) { - // Then we'll just proceed and connect to ElectrumX through - // clearnet at the bottom of this function. - Logging.instance.w( - "Tor preference set but Tor is not enabled, killswitch not set," - " connecting to Electrum adapter through clearnet", - ); + if (AppConfig.hasFeature(AppFeature.tor)) { + // If we're supposed to use Tor... + if (_prefs.useTor) { + // But Tor isn't running... + if (_torService.status != TorConnectionStatus.connected) { + // And the killswitch isn't set... + if (!_prefs.torKillSwitch) { + // Then we'll just proceed and connect to ElectrumX through + // clearnet at the bottom of this function. + Logging.instance.w( + "Tor preference set but Tor is not enabled, killswitch not set," + " connecting to Electrum adapter through clearnet", + ); + } else { + // ... But if the killswitch is set, then we throw an exception. + throw Exception( + "Tor preference and killswitch set but Tor is not enabled, " + "not connecting to Electrum adapter", + ); + // TODO [prio=low]: Try to start Tor. + } } else { - // ... But if the killswitch is set, then we throw an exception. - throw Exception( - "Tor preference and killswitch set but Tor is not enabled, " - "not connecting to Electrum adapter", + // Get the proxy info from the TorService. + proxyInfo = _torService.getProxyInfo(); + } + + if (netType == TorPlainNetworkOption.clear) { + _electrumAdapterChannel = null; + await ClientManager.sharedInstance.remove( + cryptoCurrency: cryptoCurrency, ); - // TODO [prio=low]: Try to start Tor. } } else { - // Get the proxy info from the TorService. - proxyInfo = _torService.getProxyInfo(); - } - - if (netType == TorPlainNetworkOption.clear) { - _electrumAdapterChannel = null; - await ClientManager.sharedInstance.remove( - cryptoCurrency: cryptoCurrency, - ); - } - } else { - if (netType == TorPlainNetworkOption.tor) { - _electrumAdapterChannel = null; - await ClientManager.sharedInstance.remove( - cryptoCurrency: cryptoCurrency, - ); + if (netType == TorPlainNetworkOption.tor) { + _electrumAdapterChannel = null; + await ClientManager.sharedInstance.remove( + cryptoCurrency: cryptoCurrency, + ); + } } } - // If the current ElectrumAdapterClient is closed, create a new one. if (getElectrumAdapter() != null && getElectrumAdapter()!.peer.isClosed) { _electrumAdapterChannel = null; @@ -847,9 +849,9 @@ class ElectrumXClient { }) async { Logging.instance.d("attempting to fetch lelantus.getanonymityset..."); await checkElectrumAdapter(); - final Map response = await (getElectrumAdapter() - as FiroElectrumClient) - .getLelantusAnonymitySet(groupId: groupId, blockHash: blockhash); + final Map response = + await (getElectrumAdapter() as FiroElectrumClient) + .getLelantusAnonymitySet(groupId: groupId, blockHash: blockhash); Logging.instance.d("Fetching lelantus.getanonymityset finished"); return response; } @@ -900,8 +902,8 @@ class ElectrumXClient { Future getLelantusLatestCoinId({String? requestID}) async { Logging.instance.d("attempting to fetch lelantus.getlatestcoinid..."); await checkElectrumAdapter(); - final int response = - await (getElectrumAdapter() as FiroElectrumClient).getLatestCoinId(); + final int response = await (getElectrumAdapter() as FiroElectrumClient) + .getLatestCoinId(); Logging.instance.d("Fetching lelantus.getlatestcoinid finished"); return response; } @@ -929,12 +931,12 @@ class ElectrumXClient { try { final start = DateTime.now(); await checkElectrumAdapter(); - final Map response = await (getElectrumAdapter() - as FiroElectrumClient) - .getSparkAnonymitySet( - coinGroupId: coinGroupId, - startBlockHash: startBlockHash, - ); + final Map response = + await (getElectrumAdapter() as FiroElectrumClient) + .getSparkAnonymitySet( + coinGroupId: coinGroupId, + startBlockHash: startBlockHash, + ); Logging.instance.d( "Finished ElectrumXClient.getSparkAnonymitySet(coinGroupId" "=$coinGroupId, startBlockHash=$startBlockHash). " @@ -1025,9 +1027,8 @@ class ElectrumXClient { try { Logging.instance.d("attempting to fetch spark.getsparklatestcoinid..."); await checkElectrumAdapter(); - final int response = - await (getElectrumAdapter() as FiroElectrumClient) - .getSparkLatestCoinId(); + final int response = await (getElectrumAdapter() as FiroElectrumClient) + .getSparkLatestCoinId(); Logging.instance.d("Fetching spark.getsparklatestcoinid finished"); return response; } catch (e, s) { @@ -1045,10 +1046,9 @@ class ElectrumXClient { command: "spark.getmempoolsparktxids", ); - final txids = - List.from( - response as List, - ).map((e) => e.toHexReversedFromBase64).toSet(); + final txids = List.from( + response as List, + ).map((e) => e.toHexReversedFromBase64).toSet(); Logging.instance.d( "Finished ElectrumXClient.getMempoolTxids(). " @@ -1158,10 +1158,8 @@ class ElectrumXClient { return response .map( - (e) => ( - name: e["name"] as String, - address: e["address"] as String, - ), + (e) => + (name: e["name"] as String, address: e["address"] as String), ) .toList(); } else if (response["error"] != null) { diff --git a/lib/main.dart b/lib/main.dart index 481e398ca8..4de72171e0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -206,18 +206,19 @@ void main(List args) async { ); } - // TODO: - // This should be moved to happen during the loading animation instead of - // showing a blank screen for 4-10 seconds. - // Some refactoring will need to be done here to make sure we don't make any - // network calls before starting up tor - if (Prefs.instance.useTor) { - TorService.sharedInstance.init( - torDataDirPath: (await StackFileSystem.applicationTorDirectory()).path, - ); - await TorService.sharedInstance.start(); + if (AppConfig.hasFeature(AppFeature.tor)) { + // TODO: + // This should be moved to happen during the loading animation instead of + // showing a blank screen for 4-10 seconds. + // Some refactoring will need to be done here to make sure we don't make any + // network calls before starting up tor + if (Prefs.instance.useTor) { + TorService.sharedInstance.init( + torDataDirPath: (await StackFileSystem.applicationTorDirectory()).path, + ); + await TorService.sharedInstance.start(); + } } - await StackFileSystem.initThemesDir(); await FiroCacheCoordinator.init(); diff --git a/lib/pages/buy_view/buy_view.dart b/lib/pages/buy_view/buy_view.dart index 9589621cc9..552a8457ed 100644 --- a/lib/pages/buy_view/buy_view.dart +++ b/lib/pages/buy_view/buy_view.dart @@ -10,21 +10,19 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../app_config.dart'; import '../../models/isar/models/ethereum/eth_contract.dart'; -import 'buy_form.dart'; import '../../services/event_bus/events/global/tor_connection_status_changed_event.dart'; import '../../services/tor_service.dart'; import '../../themes/stack_colors.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; import '../../widgets/stack_dialog.dart'; import '../../widgets/tor_subscription.dart'; +import 'buy_form.dart'; class BuyView extends ConsumerStatefulWidget { - const BuyView({ - super.key, - this.coin, - this.tokenContract, - }); + const BuyView({super.key, this.coin, this.tokenContract}); final CryptoCurrency? coin; final EthContract? tokenContract; @@ -46,8 +44,9 @@ class _BuyViewState extends ConsumerState { coin = widget.coin; tokenContract = widget.tokenContract; - torEnabled = - ref.read(pTorService).status != TorConnectionStatus.disconnected; + torEnabled = AppConfig.hasFeature(AppFeature.tor) + ? ref.read(pTorService).status != TorConnectionStatus.disconnected + : false; super.initState(); } @@ -66,23 +65,15 @@ class _BuyViewState extends ConsumerState { children: [ SafeArea( child: Padding( - padding: const EdgeInsets.only( - left: 16, - right: 16, - top: 16, - ), - child: BuyForm( - coin: coin, - tokenContract: tokenContract, - ), + padding: const EdgeInsets.only(left: 16, right: 16, top: 16), + child: BuyForm(coin: coin, tokenContract: tokenContract), ), ), if (torEnabled) Container( - color: Theme.of(context) - .extension()! - .overlay - .withOpacity(0.7), + color: Theme.of( + context, + ).extension()!.overlay.withOpacity(0.7), height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, child: const StackDialog( diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index 223c3d9c14..9c5af137cf 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -80,17 +80,16 @@ class _HomeViewState extends ConsumerState { context, RouteGenerator.getRoute( shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, - builder: - (_) => const LockscreenView( - showBackButton: false, - popOnSuccess: true, - routeOnSuccessArguments: true, - routeOnSuccess: "", - biometricsCancelButtonString: "CANCEL", - biometricsLocalizedReason: - "Authenticate to unlock ${AppConfig.appName}", - biometricsAuthenticationTitle: "Unlock ${AppConfig.appName}", - ), + builder: (_) => const LockscreenView( + showBackButton: false, + popOnSuccess: true, + routeOnSuccessArguments: true, + routeOnSuccess: "", + biometricsCancelButtonString: "CANCEL", + biometricsLocalizedReason: + "Authenticate to unlock ${AppConfig.appName}", + biometricsAuthenticationTitle: "Unlock ${AppConfig.appName}", + ), settings: const RouteSettings(name: "/unlockTimedOutAppScreen"), ), ); @@ -136,14 +135,13 @@ class _HomeViewState extends ConsumerState { await showDialog( context: context, barrierDismissible: false, - builder: - (_) => WillPopScope( - onWillPop: () async { - _exitEnabled = true; - return true; - }, - child: const StackDialog(title: "Tap back again to exit"), - ), + builder: (_) => WillPopScope( + onWillPop: () async { + _exitEnabled = true; + return true; + }, + child: const StackDialog(title: "Tap back again to exit"), + ), ).timeout( timeout, onTimeout: () { @@ -300,8 +298,9 @@ class _HomeViewState extends ConsumerState { key: _key, appBar: AppBar( automaticallyImplyLeading: false, - backgroundColor: - Theme.of(context).extension()!.backgroundAppBar, + backgroundColor: Theme.of( + context, + ).extension()!.backgroundAppBar, title: Row( children: [ GestureDetector( @@ -321,10 +320,11 @@ class _HomeViewState extends ConsumerState { ], ), actions: [ - const Padding( - padding: EdgeInsets.only(top: 10, bottom: 10, right: 10), - child: AspectRatio(aspectRatio: 1, child: SmallTorIcon()), - ), + if (AppConfig.hasFeature(AppFeature.tor)) + const Padding( + padding: EdgeInsets.only(top: 10, bottom: 10, right: 10), + child: AspectRatio(aspectRatio: 1, child: SmallTorIcon()), + ), Padding( padding: const EdgeInsets.only(top: 10, bottom: 10, right: 10), child: AspectRatio( @@ -335,54 +335,51 @@ class _HomeViewState extends ConsumerState { key: const Key("walletsViewAlertsButton"), size: 36, shadows: const [], - color: - Theme.of( - context, - ).extension()!.backgroundAppBar, + color: Theme.of( + context, + ).extension()!.backgroundAppBar, icon: ref.watch( - notificationsProvider.select( - (value) => value.hasUnreadNotifications, - ), - ) - ? SvgPicture.file( - File( - ref.watch( - themeProvider.select( - (value) => value.assets.bellNew, - ), + notificationsProvider.select( + (value) => value.hasUnreadNotifications, + ), + ) + ? SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.bellNew, ), ), - width: 20, - height: 20, - color: - ref.watch( - notificationsProvider.select( - (value) => - value.hasUnreadNotifications, - ), - ) - ? null - : Theme.of(context) - .extension()! - .topNavIconPrimary, - ) - : SvgPicture.asset( - Assets.svg.bell, - width: 20, - height: 20, - color: - ref.watch( - notificationsProvider.select( - (value) => - value.hasUnreadNotifications, - ), - ) - ? null - : Theme.of(context) - .extension()! - .topNavIconPrimary, ), + width: 20, + height: 20, + color: + ref.watch( + notificationsProvider.select( + (value) => value.hasUnreadNotifications, + ), + ) + ? null + : Theme.of( + context, + ).extension()!.topNavIconPrimary, + ) + : SvgPicture.asset( + Assets.svg.bell, + width: 20, + height: 20, + color: + ref.watch( + notificationsProvider.select( + (value) => value.hasUnreadNotifications, + ), + ) + ? null + : Theme.of( + context, + ).extension()!.topNavIconPrimary, + ), onPressed: () { // reset unread state ref.refresh(unreadNotificationsStateProvider); @@ -390,10 +387,9 @@ class _HomeViewState extends ConsumerState { Navigator.of( context, ).pushNamed(NotificationsView.routeName).then((_) { - final Set unreadNotificationIds = - ref - .read(unreadNotificationsStateProvider.state) - .state; + final Set unreadNotificationIds = ref + .read(unreadNotificationsStateProvider.state) + .state; if (unreadNotificationIds.isEmpty) return; final List> futures = []; @@ -433,16 +429,14 @@ class _HomeViewState extends ConsumerState { key: const Key("walletsViewSettingsButton"), size: 36, shadows: const [], - color: - Theme.of( - context, - ).extension()!.backgroundAppBar, + color: Theme.of( + context, + ).extension()!.backgroundAppBar, icon: SvgPicture.asset( Assets.svg.gear, - color: - Theme.of( - context, - ).extension()!.topNavIconPrimary, + color: Theme.of( + context, + ).extension()!.topNavIconPrimary, width: 20, height: 20, ), @@ -465,21 +459,20 @@ class _HomeViewState extends ConsumerState { ref.watch(prefsChangeNotifierProvider).enableExchange) Container( decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.backgroundAppBar, + color: Theme.of( + context, + ).extension()!.backgroundAppBar, boxShadow: Theme.of(context) - .extension()! - .homeViewButtonBarBoxShadow != - null - ? [ - Theme.of(context) - .extension()! - .homeViewButtonBarBoxShadow!, - ] - : null, + .extension()! + .homeViewButtonBarBoxShadow != + null + ? [ + Theme.of(context) + .extension()! + .homeViewButtonBarBoxShadow!, + ] + : null, ), child: const Padding( padding: EdgeInsets.only( @@ -516,8 +509,9 @@ class _HomeViewState extends ConsumerState { onPageChanged: (pageIndex) { if (!_lock) { ref - .read(homeViewPageIndexStateProvider.state) - .state = pageIndex; + .read(homeViewPageIndexStateProvider.state) + .state = + pageIndex; } }, ); diff --git a/lib/pages/ordinals/ordinal_details_view.dart b/lib/pages/ordinals/ordinal_details_view.dart index 05d7eb227c..996f20db67 100644 --- a/lib/pages/ordinals/ordinal_details_view.dart +++ b/lib/pages/ordinals/ordinal_details_view.dart @@ -8,6 +8,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:path/path.dart' as path; import 'package:path_provider/path_provider.dart'; +import '../../app_config.dart'; import '../../models/isar/models/blockchain_data/utxo.dart'; import '../../models/isar/ordinal.dart'; import '../../networking/http.dart'; @@ -64,8 +65,9 @@ class _OrdinalDetailsViewState extends ConsumerState { child: Scaffold( backgroundColor: Theme.of(context).extension()!.background, appBar: AppBar( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of( + context, + ).extension()!.background, leading: const AppBarBackButton(), title: Text( "Ordinal details", @@ -104,17 +106,16 @@ class _OrdinalDetailsViewState extends ConsumerState { const SizedBox(height: _spacing), _DetailsItemWCopy( title: "Amount", - data: - utxo == null - ? "ERROR" - : ref - .watch(pAmountFormatter(coin)) - .format( - Amount( - rawValue: BigInt.from(utxo!.value), - fractionDigits: coin.fractionDigits, - ), + data: utxo == null + ? "ERROR" + : ref + .watch(pAmountFormatter(coin)) + .format( + Amount( + rawValue: BigInt.from(utxo!.value), + fractionDigits: coin.fractionDigits, ), + ), ), const SizedBox(height: _spacing), _DetailsItemWCopy( @@ -170,20 +171,18 @@ class _DetailsItemWCopy extends StatelessWidget { children: [ SvgPicture.asset( Assets.svg.copy, - color: - Theme.of( - context, - ).extension()!.infoItemIcons, + color: Theme.of( + context, + ).extension()!.infoItemIcons, width: 12, ), const SizedBox(width: 6), Text( "Copy", style: STextStyles.infoSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.infoItemIcons, + color: Theme.of( + context, + ).extension()!.infoItemIcons, ), ), ], @@ -216,10 +215,11 @@ class _OrdinalImageGroup extends ConsumerWidget { final response = await client.get( url: Uri.parse(ordinal.content), - proxyInfo: - ref.read(prefsChangeNotifierProvider).useTor - ? ref.read(pTorService).getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : ref.read(prefsChangeNotifierProvider).useTor + ? ref.read(pTorService).getProxyInfo() + : null, ); if (response.code != 200) { @@ -230,10 +230,9 @@ class _OrdinalImageGroup extends ConsumerWidget { final bytes = response.bodyBytes; - final dir = - Platform.isAndroid - ? await StackFileSystem.wtfAndroidDocumentsPath() - : await getApplicationDocumentsDirectory(); + final dir = Platform.isAndroid + ? await StackFileSystem.wtfAndroidDocumentsPath() + : await getApplicationDocumentsDirectory(); final filePath = path.join( dir.path, "ordinal_${ordinal.inscriptionNumber}.png", @@ -289,10 +288,9 @@ class _OrdinalImageGroup extends ConsumerWidget { Assets.svg.arrowDown, width: 10, height: 12, - color: - Theme.of( - context, - ).extension()!.buttonTextSecondary, + color: Theme.of( + context, + ).extension()!.buttonTextSecondary, ), buttonHeight: ButtonHeight.l, iconSpacing: 4, diff --git a/lib/pages/paynym/subwidgets/paynym_bot.dart b/lib/pages/paynym/subwidgets/paynym_bot.dart index 384e471e53..3307665a40 100644 --- a/lib/pages/paynym/subwidgets/paynym_bot.dart +++ b/lib/pages/paynym/subwidgets/paynym_bot.dart @@ -12,6 +12,7 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; +import '../../../app_config.dart'; import '../../../networking/http.dart'; import '../../../services/tor_service.dart'; import '../../../utilities/paynym_is_api.dart'; @@ -52,12 +53,15 @@ class PayNymBot extends StatelessWidget { Future _fetchImage() async { final HTTP client = HTTP(); - final Uri uri = - Uri.parse("${PaynymIsApi.baseURL}/$paymentCodeString/avatar"); + final Uri uri = Uri.parse( + "${PaynymIsApi.baseURL}/$paymentCodeString/avatar", + ); final response = await client.get( url: uri, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); diff --git a/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart b/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart index 24800936d0..ea8461b0fc 100644 --- a/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart @@ -50,8 +50,9 @@ class _TorSettingsViewState extends ConsumerState { backgroundColor: Colors.transparent, appBar: AppBar( automaticallyImplyLeading: false, - backgroundColor: - Theme.of(context).extension()!.backgroundAppBar, + backgroundColor: Theme.of( + context, + ).extension()!.backgroundAppBar, leading: AppBarBackButton( onPressed: () { Navigator.of(context).pop(); @@ -98,12 +99,12 @@ class _TorSettingsViewState extends ConsumerState { children: [ Padding( padding: EdgeInsets.all(10.0), - child: TorAnimatedButton(), + child: _TorAnimatedButton(), ), ], ), const SizedBox(height: 30), - const TorButton(), + const _TorButton(), const SizedBox(height: 8), RoundedWhiteContainer( child: Consumer( @@ -144,8 +145,9 @@ class _TorSettingsViewState extends ConsumerState { " connection is disrupted or compromised.", rightButton: SecondaryButton( label: "Close", - onPressed: - Navigator.of(context).pop, + onPressed: Navigator.of( + context, + ).pop, ), ); }, @@ -155,10 +157,9 @@ class _TorSettingsViewState extends ConsumerState { Assets.svg.circleInfo, height: 16, width: 16, - color: - Theme.of(context) - .extension()! - .infoItemLabel, + color: Theme.of( + context, + ).extension()!.infoItemLabel, ), ), ], @@ -174,8 +175,9 @@ class _TorSettingsViewState extends ConsumerState { ), onValueChanged: (newValue) { ref - .read(prefsChangeNotifierProvider) - .torKillSwitch = newValue; + .read(prefsChangeNotifierProvider) + .torKillSwitch = + newValue; }, ), ), @@ -195,14 +197,14 @@ class _TorSettingsViewState extends ConsumerState { } } -class TorAnimatedButton extends ConsumerStatefulWidget { - const TorAnimatedButton({super.key}); +class _TorAnimatedButton extends ConsumerStatefulWidget { + const _TorAnimatedButton({super.key}); @override - ConsumerState createState() => _TorAnimatedButtonState(); + ConsumerState<_TorAnimatedButton> createState() => _TorAnimatedButtonState(); } -class _TorAnimatedButtonState extends ConsumerState +class _TorAnimatedButtonState extends ConsumerState<_TorAnimatedButton> with SingleTickerProviderStateMixin { late final AnimationController controller1; @@ -224,7 +226,6 @@ class _TorAnimatedButtonState extends ConsumerState case TorConnectionStatus.connected: await disconnectTor(ref, context); - break; case TorConnectionStatus.connecting: @@ -365,7 +366,7 @@ class _TorAnimatedButtonState extends ConsumerState }, ), ), - const UpperCaseTorText(), + const _UpperCaseTorText(), ], ), ), @@ -373,14 +374,14 @@ class _TorAnimatedButtonState extends ConsumerState } } -class TorButton extends ConsumerStatefulWidget { - const TorButton({super.key}); +class _TorButton extends ConsumerStatefulWidget { + const _TorButton({super.key}); @override - ConsumerState createState() => _TorButtonState(); + ConsumerState<_TorButton> createState() => _TorButtonState(); } -class _TorButtonState extends ConsumerState { +class _TorButtonState extends ConsumerState<_TorButton> { late TorConnectionStatus _status; Color _color(TorConnectionStatus status, StackColors colors) { @@ -483,14 +484,14 @@ class _TorButtonState extends ConsumerState { } } -class UpperCaseTorText extends ConsumerStatefulWidget { - const UpperCaseTorText({super.key}); +class _UpperCaseTorText extends ConsumerStatefulWidget { + const _UpperCaseTorText({super.key}); @override - ConsumerState createState() => _UpperCaseTorTextState(); + ConsumerState<_UpperCaseTorText> createState() => _UpperCaseTorTextState(); } -class _UpperCaseTorTextState extends ConsumerState { +class _UpperCaseTorTextState extends ConsumerState<_UpperCaseTorText> { late TorConnectionStatus _status; Color _color(TorConnectionStatus status, StackColors colors) { 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 75b121ff36..2e3ffbb5af 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 @@ -18,6 +18,7 @@ import 'package:flutter_svg/svg.dart'; import 'package:tuple/tuple.dart'; import 'package:wakelock_plus/wakelock_plus.dart'; +import '../../../../app_config.dart'; import '../../../../providers/providers.dart'; import '../../../../route_generator.dart'; import '../../../../services/event_bus/events/global/blocks_remaining_event.dart'; @@ -158,31 +159,26 @@ class _WalletNetworkSettingsViewState context: context, useSafeArea: false, barrierDismissible: true, - builder: - (context) => ConditionalParent( - condition: isDesktop, - builder: - (child) => DesktopDialog( - maxHeight: 150, - maxWidth: 500, - child: child, - ), - child: StackDialog( - title: "Rescan completed", - rightButton: TextButton( - style: Theme.of(context) - .extension()! - .getSecondaryEnabledButtonStyle(context), - child: Text( - "Ok", - style: STextStyles.itemSubtitle12(context), - ), - onPressed: () { - Navigator.of(context, rootNavigator: isDesktop).pop(); - }, - ), + builder: (context) => ConditionalParent( + condition: isDesktop, + builder: (child) => + DesktopDialog(maxHeight: 150, maxWidth: 500, child: child), + child: StackDialog( + title: "Rescan completed", + rightButton: TextButton( + style: Theme.of(context) + .extension()! + .getSecondaryEnabledButtonStyle(context), + child: Text( + "Ok", + style: STextStyles.itemSubtitle12(context), ), + onPressed: () { + Navigator.of(context, rootNavigator: isDesktop).pop(); + }, ), + ), + ), ); } } catch (e) { @@ -197,23 +193,19 @@ class _WalletNetworkSettingsViewState context: context, useSafeArea: false, barrierDismissible: true, - builder: - (context) => StackDialog( - title: "Rescan failed", - message: e.toString(), - rightButton: TextButton( - style: Theme.of(context) - .extension()! - .getSecondaryEnabledButtonStyle(context), - child: Text( - "Ok", - style: STextStyles.itemSubtitle12(context), - ), - onPressed: () { - Navigator.of(context, rootNavigator: isDesktop).pop(); - }, - ), - ), + builder: (context) => StackDialog( + title: "Rescan failed", + message: e.toString(), + rightButton: TextButton( + style: Theme.of(context) + .extension()! + .getSecondaryEnabledButtonStyle(context), + child: Text("Ok", style: STextStyles.itemSubtitle12(context)), + onPressed: () { + Navigator.of(context, rootNavigator: isDesktop).pop(); + }, + ), + ), ); } } @@ -249,8 +241,9 @@ class _WalletNetworkSettingsViewState _blocksRemaining = -1; } - eventBus = - widget.eventBus != null ? widget.eventBus! : GlobalEventBus.instance; + eventBus = widget.eventBus != null + ? widget.eventBus! + : GlobalEventBus.instance; _syncStatusSubscription = eventBus .on() @@ -334,10 +327,9 @@ class _WalletNetworkSettingsViewState Widget build(BuildContext context) { final screenWidth = MediaQuery.of(context).size.width; - final progressLength = - isDesktop - ? 430.0 - : screenWidth - (_padding * 2) - (_boxPadding * 3) - _iconSize; + final progressLength = isDesktop + ? 430.0 + : screenWidth - (_padding * 2) - (_boxPadding * 3) - _iconSize; final coin = ref.watch(pWalletCoin(widget.walletId)); @@ -384,8 +376,9 @@ class _WalletNetworkSettingsViewState builder: (child) { return Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of( + context, + ).extension()!.background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -413,16 +406,14 @@ class _WalletNetworkSettingsViewState ), size: 36, shadows: const [], - color: - Theme.of( - context, - ).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, icon: SvgPicture.asset( Assets.svg.verticalEllipsis, - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, width: 20, height: 20, ), @@ -439,10 +430,9 @@ class _WalletNetworkSettingsViewState right: 10, child: Container( decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.popupBG, + color: Theme.of( + context, + ).extension()!.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -520,10 +510,9 @@ class _WalletNetworkSettingsViewState Text( "Blockchain status", textAlign: TextAlign.left, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.smallMed12(context), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.smallMed12(context), ), CustomTextButton( text: "Resync", @@ -536,14 +525,12 @@ class _WalletNetworkSettingsViewState SizedBox(height: isDesktop ? 12 : 9), if (_currentSyncStatus == WalletSyncStatus.synced) RoundedWhiteContainer( - borderColor: - isDesktop - ? Theme.of(context).extension()!.background - : null, - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + borderColor: isDesktop + ? Theme.of(context).extension()!.background + : null, + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( children: [ Container( @@ -561,10 +548,9 @@ class _WalletNetworkSettingsViewState Assets.svg.radio, height: isDesktop ? 19 : 14, width: isDesktop ? 19 : 14, - color: - Theme.of( - context, - ).extension()!.accentColorGreen, + color: Theme.of( + context, + ).extension()!.accentColorGreen, ), ), ), @@ -587,14 +573,12 @@ class _WalletNetworkSettingsViewState ProgressBar( width: progressLength, height: 5, - fillColor: - Theme.of( - context, - ).extension()!.accentColorGreen, - backgroundColor: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + fillColor: Theme.of( + context, + ).extension()!.accentColorGreen, + backgroundColor: Theme.of( + context, + ).extension()!.textFieldDefaultBG, percent: 1, ), ], @@ -604,14 +588,12 @@ class _WalletNetworkSettingsViewState ), if (_currentSyncStatus == WalletSyncStatus.syncing) RoundedWhiteContainer( - borderColor: - isDesktop - ? Theme.of(context).extension()!.background - : null, - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + borderColor: isDesktop + ? Theme.of(context).extension()!.background + : null, + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( children: [ Container( @@ -629,10 +611,9 @@ class _WalletNetworkSettingsViewState Assets.svg.radioSyncing, height: 14, width: 14, - color: - Theme.of( - context, - ).extension()!.accentColorYellow, + color: Theme.of( + context, + ).extension()!.accentColorYellow, ), ), ), @@ -657,14 +638,12 @@ class _WalletNetworkSettingsViewState children: [ Text( _percentString(_percent), - style: STextStyles.syncPercent( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.syncPercent(context) + .copyWith( + color: Theme.of(context) .extension()! .accentColorYellow, - ), + ), ), if (coin is Monero || coin is Wownero || @@ -679,14 +658,12 @@ class _WalletNetworkSettingsViewState ))) Text( " (Blocks to go: ${_blocksRemaining == -1 ? "?" : _blocksRemaining})", - style: STextStyles.syncPercent( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.syncPercent(context) + .copyWith( + color: Theme.of(context) .extension()! .accentColorYellow, - ), + ), ), ], ), @@ -697,14 +674,12 @@ class _WalletNetworkSettingsViewState ProgressBar( width: progressLength, height: 5, - fillColor: - Theme.of( - context, - ).extension()!.accentColorYellow, - backgroundColor: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + fillColor: Theme.of( + context, + ).extension()!.accentColorYellow, + backgroundColor: Theme.of( + context, + ).extension()!.textFieldDefaultBG, percent: _percent, ), ], @@ -714,14 +689,12 @@ class _WalletNetworkSettingsViewState ), if (_currentSyncStatus == WalletSyncStatus.unableToSync) RoundedWhiteContainer( - borderColor: - isDesktop - ? Theme.of(context).extension()!.background - : null, - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + borderColor: isDesktop + ? Theme.of(context).extension()!.background + : null, + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( children: [ Container( @@ -739,10 +712,9 @@ class _WalletNetworkSettingsViewState Assets.svg.radioProblem, height: 14, width: 14, - color: - Theme.of( - context, - ).extension()!.accentColorRed, + color: Theme.of( + context, + ).extension()!.accentColorRed, ), ), ), @@ -757,19 +729,17 @@ class _WalletNetworkSettingsViewState Text( "Unable to synchronize", style: STextStyles.w600_12(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorRed, + color: Theme.of( + context, + ).extension()!.accentColorRed, ), ), Text( "0%", style: STextStyles.syncPercent(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorRed, + color: Theme.of( + context, + ).extension()!.accentColorRed, ), ), ], @@ -779,14 +749,12 @@ class _WalletNetworkSettingsViewState ProgressBar( width: progressLength, height: 5, - fillColor: - Theme.of( - context, - ).extension()!.accentColorRed, - backgroundColor: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + fillColor: Theme.of( + context, + ).extension()!.accentColorRed, + backgroundColor: Theme.of( + context, + ).extension()!.textFieldDefaultBG, percent: 0, ), ], @@ -798,39 +766,36 @@ class _WalletNetworkSettingsViewState Padding( padding: const EdgeInsets.only(top: 12), child: RoundedContainer( - color: - Theme.of( - context, - ).extension()!.warningBackground, + color: Theme.of( + context, + ).extension()!.warningBackground, child: Text( "Please check your internet connection and make sure your current node is not having issues.", style: STextStyles.baseXS(context).copyWith( - color: - Theme.of( - context, - ).extension()!.warningForeground, + color: Theme.of( + context, + ).extension()!.warningForeground, ), ), ), ), SizedBox(height: isDesktop ? 12 : 9), RoundedWhiteContainer( - borderColor: - isDesktop - ? Theme.of(context).extension()!.background - : null, - padding: - isDesktop ? const EdgeInsets.all(16) : const EdgeInsets.all(12), + borderColor: isDesktop + ? Theme.of(context).extension()!.background + : null, + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "Current height", textAlign: TextAlign.left, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.smallMed12(context), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.smallMed12(context), ), Text( ref.watch(pWalletChainHeight(widget.walletId)).toString(), @@ -839,140 +804,140 @@ class _WalletNetworkSettingsViewState ], ), ), - SizedBox(height: isDesktop ? 32 : 20), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Tor status", - textAlign: TextAlign.left, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.smallMed12(context), - ), - CustomTextButton( - text: - ref.watch( - prefsChangeNotifierProvider.select( - (value) => value.useTor, - ), - ) - ? "Disconnect" - : "Connect", - onTap: onTorTapped, - ), - ], - ), - SizedBox(height: isDesktop ? 12 : 9), - RoundedWhiteContainer( - borderColor: - isDesktop - ? Theme.of(context).extension()!.background - : null, - padding: - isDesktop ? const EdgeInsets.all(16) : const EdgeInsets.all(12), - child: Row( + if (AppConfig.hasFeature(AppFeature.tor)) + SizedBox(height: isDesktop ? 32 : 20), + if (AppConfig.hasFeature(AppFeature.tor)) + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if (ref.watch( - prefsChangeNotifierProvider.select((value) => value.useTor), - )) - Container( - width: _iconSize, - height: _iconSize, - decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .accentColorGreen - .withOpacity(0.2), - borderRadius: BorderRadius.circular(_iconSize), - ), - child: Center( - child: SvgPicture.asset( - Assets.svg.tor, - height: isDesktop ? 19 : 14, - width: isDesktop ? 19 : 14, - color: - Theme.of( - context, - ).extension()!.accentColorGreen, + Text( + "Tor status", + textAlign: TextAlign.left, + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.smallMed12(context), + ), + CustomTextButton( + text: + ref.watch( + prefsChangeNotifierProvider.select( + (value) => value.useTor, + ), + ) + ? "Disconnect" + : "Connect", + onTap: onTorTapped, + ), + ], + ), + if (AppConfig.hasFeature(AppFeature.tor)) + SizedBox(height: isDesktop ? 12 : 9), + if (AppConfig.hasFeature(AppFeature.tor)) + RoundedWhiteContainer( + borderColor: isDesktop + ? Theme.of(context).extension()!.background + : null, + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Row( + children: [ + if (ref.watch( + prefsChangeNotifierProvider.select((value) => value.useTor), + )) + Container( + width: _iconSize, + height: _iconSize, + decoration: BoxDecoration( + color: Theme.of(context) + .extension()! + .accentColorGreen + .withOpacity(0.2), + borderRadius: BorderRadius.circular(_iconSize), ), - ), - ), - if (!ref.watch( - prefsChangeNotifierProvider.select((value) => value.useTor), - )) - Container( - width: _iconSize, - height: _iconSize, - decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.textDark.withOpacity(0.08), - borderRadius: BorderRadius.circular(_iconSize), - ), - child: Center( - child: SvgPicture.asset( - Assets.svg.tor, - height: isDesktop ? 19 : 14, - width: isDesktop ? 19 : 14, - color: - Theme.of( - context, - ).extension()!.textDark, + child: Center( + child: SvgPicture.asset( + Assets.svg.tor, + height: isDesktop ? 19 : 14, + width: isDesktop ? 19 : 14, + color: Theme.of( + context, + ).extension()!.accentColorGreen, + ), ), ), - ), - SizedBox(width: _boxPadding), - TorSubscription( - onTorStatusChanged: (status) { - setState(() { - _torConnectionStatus = status; - }); - }, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Tor status", - style: STextStyles.desktopTextExtraExtraSmall( + if (!ref.watch( + prefsChangeNotifierProvider.select((value) => value.useTor), + )) + Container( + width: _iconSize, + height: _iconSize, + decoration: BoxDecoration( + color: Theme.of( context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark, - ), + ).extension()!.textDark.withOpacity(0.08), + borderRadius: BorderRadius.circular(_iconSize), ), - if (_torConnectionStatus == TorConnectionStatus.connected) - Text( - "Connected", - style: STextStyles.desktopTextExtraExtraSmall( + child: Center( + child: SvgPicture.asset( + Assets.svg.tor, + height: isDesktop ? 19 : 14, + width: isDesktop ? 19 : 14, + color: Theme.of( context, - ), + ).extension()!.textDark, ), - if (_torConnectionStatus == - TorConnectionStatus.connecting) + ), + ), + SizedBox(width: _boxPadding), + TorSubscription( + onTorStatusChanged: (status) { + setState(() { + _torConnectionStatus = status; + }); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Text( - "Connecting...", - style: STextStyles.desktopTextExtraExtraSmall( - context, - ), + "Tor status", + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of( + context, + ).extension()!.textDark, + ), ), - if (_torConnectionStatus == - TorConnectionStatus.disconnected) - Text( - "Disconnected", - style: STextStyles.desktopTextExtraExtraSmall( - context, + if (_torConnectionStatus == + TorConnectionStatus.connected) + Text( + "Connected", + style: STextStyles.desktopTextExtraExtraSmall( + context, + ), ), - ), - ], + if (_torConnectionStatus == + TorConnectionStatus.connecting) + Text( + "Connecting...", + style: STextStyles.desktopTextExtraExtraSmall( + context, + ), + ), + if (_torConnectionStatus == + TorConnectionStatus.disconnected) + Text( + "Disconnected", + style: STextStyles.desktopTextExtraExtraSmall( + context, + ), + ), + ], + ), ), - ), - ], + ], + ), ), - ), SizedBox(height: isDesktop ? 32 : 20), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -980,10 +945,9 @@ class _WalletNetworkSettingsViewState Text( "${ref.watch(pWalletCoin(widget.walletId)).prettyName} nodes", textAlign: TextAlign.left, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.smallMed12(context), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.smallMed12(context), ), CustomTextButton( text: "Add new node", @@ -1030,14 +994,12 @@ class _WalletNetworkSettingsViewState ref.watch(pWalletCoin(widget.walletId)) is! Epiccash && ref.watch(pWalletCoin(widget.walletId)) is! Mimblewimblecoin) RoundedWhiteContainer( - borderColor: - isDesktop - ? Theme.of(context).extension()!.background - : null, - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + borderColor: isDesktop + ? Theme.of(context).extension()!.background + : null, + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Expandable( onExpandChanged: (state) { setState(() { @@ -1053,20 +1015,18 @@ class _WalletNetworkSettingsViewState width: _iconSize, height: _iconSize, decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, borderRadius: BorderRadius.circular(_iconSize), ), child: Center( child: SvgPicture.asset( Assets.svg.networkWired, width: 24, - color: - Theme.of( - context, - ).extension()!.textDark, + color: Theme.of( + context, + ).extension()!.textDark, ), ), ), @@ -1077,14 +1037,14 @@ class _WalletNetworkSettingsViewState children: [ Text( "Advanced", - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( + style: + STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of( context, ).extension()!.textDark, - ), + ), ), Text( "Rescan blockchain", @@ -1102,10 +1062,9 @@ class _WalletNetworkSettingsViewState : Assets.svg.chevronDown, width: 12, height: 6, - color: - Theme.of( - context, - ).extension()!.textSubtitle1, + color: Theme.of( + context, + ).extension()!.textSubtitle1, ), ], ), diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index 32c565e3df..c8971e6067 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -183,8 +183,9 @@ class _WalletViewState extends ConsumerState { } } - eventBus = - widget.eventBus != null ? widget.eventBus! : GlobalEventBus.instance; + eventBus = widget.eventBus != null + ? widget.eventBus! + : GlobalEventBus.instance; _syncStatusSubscription = eventBus .on() @@ -354,27 +355,24 @@ class _WalletViewState extends ConsumerState { if (coin.network.isTestNet) { await showDialog( context: context, - builder: - (_) => const StackOkDialog( - title: "Exchange not available for test net coins", - ), + builder: (_) => const StackOkDialog( + title: "Exchange not available for test net coins", + ), ); } else { Future _future; final isar = await ExchangeDataLoadingService.instance.isar; try { - _future = - isar.currencies - .where() - .tickerEqualToAnyExchangeNameName(coin.ticker) - .findFirst(); + _future = isar.currencies + .where() + .tickerEqualToAnyExchangeNameName(coin.ticker) + .findFirst(); } catch (_) { _future = ExchangeDataLoadingService.instance.loadAll().then( - (_) => - isar.currencies - .where() - .tickerEqualToAnyExchangeNameName(coin.ticker) - .findFirst(), + (_) => isar.currencies + .where() + .tickerEqualToAnyExchangeNameName(coin.ticker) + .findFirst(), ); } @@ -404,18 +402,17 @@ class _WalletViewState extends ConsumerState { if (coin.network.isTestNet) { await showDialog( context: context, - builder: - (_) => const StackOkDialog( - title: "Buy not available for test net coins", - ), + builder: (_) => + const StackOkDialog(title: "Buy not available for test net coins"), ); } else { if (mounted) { unawaited( Navigator.of(context).pushNamed( BuyInWalletView.routeName, - arguments: - coin.hasBuySupport ? coin : Bitcoin(CryptoCurrencyNetwork.main), + arguments: coin.hasBuySupport + ? coin + : Bitcoin(CryptoCurrencyNetwork.main), ), ); } @@ -427,14 +424,13 @@ class _WalletViewState extends ConsumerState { unawaited( showDialog( context: context, - builder: - (context) => WillPopScope( - child: const CustomLoadingOverlay( - message: "Anonymizing balance", - eventBus: null, - ), - onWillPop: () async => shouldPop, - ), + builder: (context) => WillPopScope( + child: const CustomLoadingOverlay( + message: "Anonymizing balance", + eventBus: null, + ), + onWillPop: () async => shouldPop, + ), ), ); final wallet = ref.read(pWallets).getWallet(walletId); @@ -484,11 +480,10 @@ class _WalletViewState extends ConsumerState { ).popUntil(ModalRoute.withName(WalletView.routeName)); await showDialog( context: context, - builder: - (_) => StackOkDialog( - title: "Privatize all failed", - message: "Reason: $e", - ), + builder: (_) => StackOkDialog( + title: "Privatize all failed", + message: "Reason: $e", + ), ); } } @@ -521,40 +516,36 @@ class _WalletViewState extends ConsumerState { "Migration in progress\nThis could take a while\nPlease don't leave this screen", subMessage: "This only needs to run once per wallet", eventBus: null, - textColor: - Theme.of(context).extension()!.textDark, + textColor: Theme.of( + context, + ).extension()!.textDark, actionButton: SecondaryButton( label: "Cancel", onPressed: () async { await showDialog( context: context, - builder: - (context) => StackDialog( - title: "Warning!", - message: - "Skipping this process can completely" - " break your wallet. It is only meant to be done in" - " emergency situations where the migration fails" - " and will not let you continue. Still skip?", - leftButton: SecondaryButton( - label: "Cancel", - onPressed: - Navigator.of( - context, - rootNavigator: true, - ).pop, - ), - rightButton: SecondaryButton( - label: "Ok", - onPressed: () { - Navigator.of( - context, - rootNavigator: true, - ).pop(); - setState(() => _rescanningOnOpen = false); - }, - ), - ), + builder: (context) => StackDialog( + title: "Warning!", + message: + "Skipping this process can completely" + " break your wallet. It is only meant to be done in" + " emergency situations where the migration fails" + " and will not let you continue. Still skip?", + leftButton: SecondaryButton( + label: "Cancel", + onPressed: Navigator.of( + context, + rootNavigator: true, + ).pop, + ), + rightButton: SecondaryButton( + label: "Ok", + onPressed: () { + Navigator.of(context, rootNavigator: true).pop(); + setState(() => _rescanningOnOpen = false); + }, + ), + ), ); }, ), @@ -570,8 +561,9 @@ class _WalletViewState extends ConsumerState { child: Stack( children: [ Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of( + context, + ).extension()!.background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -598,10 +590,18 @@ class _WalletViewState extends ConsumerState { ], ), actions: [ - const Padding( - padding: EdgeInsets.only(top: 10, bottom: 10, right: 10), - child: AspectRatio(aspectRatio: 1, child: SmallTorIcon()), - ), + if (AppConfig.hasFeature(AppFeature.tor)) + const Padding( + padding: EdgeInsets.only( + top: 10, + bottom: 10, + right: 10, + ), + child: AspectRatio( + aspectRatio: 1, + child: SmallTorIcon(), + ), + ), Padding( padding: const EdgeInsets.only( top: 10, @@ -616,10 +616,9 @@ class _WalletViewState extends ConsumerState { key: const Key("walletViewRadioButton"), size: 36, shadows: const [], - color: - Theme.of( - context, - ).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, icon: _buildNetworkIcon(_currentSyncStatus), onPressed: () { Navigator.of(context).pushNamed( @@ -648,59 +647,58 @@ class _WalletViewState extends ConsumerState { key: const Key("walletViewAlertsButton"), size: 36, shadows: const [], - color: - Theme.of( - context, - ).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, icon: ref.watch( - notificationsProvider.select( - (value) => value - .hasUnreadNotificationsFor(walletId), - ), - ) - ? SvgPicture.file( - File( - ref.watch( - themeProvider.select( - (value) => value.assets.bellNew, - ), + notificationsProvider.select( + (value) => + value.hasUnreadNotificationsFor(walletId), + ), + ) + ? SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.bellNew, ), ), - width: 20, - height: 20, - color: - ref.watch( - notificationsProvider.select( - (value) => value - .hasUnreadNotificationsFor( - walletId, - ), + ), + width: 20, + height: 20, + color: + ref.watch( + notificationsProvider.select( + (value) => + value.hasUnreadNotificationsFor( + walletId, ), - ) - ? null - : Theme.of(context) - .extension()! - .topNavIconPrimary, - ) - : SvgPicture.asset( - Assets.svg.bell, - width: 20, - height: 20, - color: - ref.watch( - notificationsProvider.select( - (value) => value - .hasUnreadNotificationsFor( - walletId, - ), + ), + ) + ? null + : Theme.of(context) + .extension()! + .topNavIconPrimary, + ) + : SvgPicture.asset( + Assets.svg.bell, + width: 20, + height: 20, + color: + ref.watch( + notificationsProvider.select( + (value) => + value.hasUnreadNotificationsFor( + walletId, ), - ) - ? null - : Theme.of(context) - .extension()! - .topNavIconPrimary, - ), + ), + ) + ? null + : Theme.of(context) + .extension()! + .topNavIconPrimary, + ), onPressed: () { // reset unread state ref.refresh(unreadNotificationsStateProvider); @@ -711,13 +709,11 @@ class _WalletViewState extends ConsumerState { arguments: walletId, ) .then((_) { - final Set unreadNotificationIds = - ref - .read( - unreadNotificationsStateProvider - .state, - ) - .state; + final Set unreadNotificationIds = ref + .read( + unreadNotificationsStateProvider.state, + ) + .state; if (unreadNotificationIds.isEmpty) return; final List> futures = []; @@ -765,16 +761,14 @@ class _WalletViewState extends ConsumerState { key: const Key("walletViewSettingsButton"), size: 36, shadows: const [], - color: - Theme.of( - context, - ).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, icon: SvgPicture.asset( Assets.svg.bars, - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, width: 20, height: 20, ), @@ -798,8 +792,9 @@ class _WalletViewState extends ConsumerState { ), body: SafeArea( child: Container( - color: - Theme.of(context).extension()!.background, + color: Theme.of( + context, + ).extension()!.background, child: Column( children: [ const SizedBox(height: 10), @@ -811,12 +806,12 @@ class _WalletViewState extends ConsumerState { aspectRatio: 1.75, initialSyncStatus: ref - .watch(pWallets) - .getWallet(walletId) - .refreshMutex - .isLocked - ? WalletSyncStatus.syncing - : WalletSyncStatus.synced, + .watch(pWallets) + .getWallet(walletId) + .refreshMutex + .isLocked + ? WalletSyncStatus.syncing + : WalletSyncStatus.synced, ), ), ), @@ -839,60 +834,55 @@ class _WalletViewState extends ConsumerState { onPressed: () async { await showDialog( context: context, - builder: - (context) => StackDialog( - title: "Attention!", - message: - "You're about to privatize all of your public funds.", - leftButton: TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text( - "Cancel", - style: STextStyles.button( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .accentColorDark, + builder: (context) => StackDialog( + title: "Attention!", + message: + "You're about to privatize all of your public funds.", + leftButton: TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text( + "Cancel", + style: STextStyles.button(context) + .copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .accentColorDark, ), - ), - ), - rightButton: TextButton( - onPressed: () async { - Navigator.of(context).pop(); + ), + ), + rightButton: TextButton( + onPressed: () async { + Navigator.of(context).pop(); - unawaited(attemptAnonymize()); - }, - style: Theme.of(context) - .extension()! - .getPrimaryEnabledButtonStyle( - context, - ), - child: Text( - "Continue", - style: STextStyles.button( - context, - ), + unawaited(attemptAnonymize()); + }, + style: Theme.of(context) + .extension()! + .getPrimaryEnabledButtonStyle( + context, ), + child: Text( + "Continue", + style: STextStyles.button( + context, ), ), + ), + ), ); }, child: Text( "Privatize funds", - style: STextStyles.button( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.button(context) + .copyWith( + color: Theme.of(context) .extension()! .buttonTextSecondary, - ), + ), ), ), ), @@ -907,14 +897,12 @@ class _WalletViewState extends ConsumerState { children: [ Text( "Transactions", - style: STextStyles.itemSubtitle( - context, - ).copyWith( - color: - Theme.of( + style: STextStyles.itemSubtitle(context) + .copyWith( + color: Theme.of( context, ).extension()!.textDark3, - ), + ), ), CustomTextButton( text: "See all", @@ -976,18 +964,16 @@ class _WalletViewState extends ConsumerState { Expanded( child: ref - .read(pWallets) - .getWallet( - widget.walletId, - ) - .isarTransactionVersion == - 2 - ? TransactionsV2List( - walletId: widget.walletId, - ) - : TransactionsList( - walletId: walletId, - ), + .read(pWallets) + .getWallet(widget.walletId) + .isarTransactionVersion == + 2 + ? TransactionsV2List( + walletId: widget.walletId, + ) + : TransactionsList( + walletId: walletId, + ), ), ], ), @@ -1102,11 +1088,10 @@ class _WalletViewState extends ConsumerState { moreItems: [ if (ref.watch( pWallets.select( - (value) => - value - .getWallet(widget.walletId) - .cryptoCurrency - .hasTokenSupport, + (value) => value + .getWallet(widget.walletId) + .cryptoCurrency + .hasTokenSupport, ), )) WalletNavigationBarItemData( @@ -1125,10 +1110,9 @@ class _WalletViewState extends ConsumerState { Assets.svg.monkey, height: 20, width: 20, - color: - Theme.of( - context, - ).extension()!.bottomNavIconIcon, + color: Theme.of( + context, + ).extension()!.bottomNavIconIcon, ), label: "MonKey", onTap: () { @@ -1192,9 +1176,8 @@ class _WalletViewState extends ConsumerState { unawaited( showDialog( context: context, - builder: - (context) => - const LoadingIndicator(width: 100), + builder: (context) => + const LoadingIndicator(width: 100), ), ); @@ -1224,8 +1207,9 @@ class _WalletViewState extends ConsumerState { // account.value!.segwit ) { ref - .read(myPaynymAccountStateProvider.state) - .state = account.value!; + .read(myPaynymAccountStateProvider.state) + .state = + account.value!; await Navigator.of(context).pushNamed( PaynymHomeView.routeName, @@ -1257,7 +1241,9 @@ class _WalletViewState extends ConsumerState { ); }, ), - if (wallet is CashFusionInterface && !viewOnly) + if (AppConfig.hasFeature(AppFeature.tor) && + wallet is CashFusionInterface && + !viewOnly) WalletNavigationBarItemData( label: "Fusion", icon: const FusionNavIcon(), 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 6c5d2dc2db..77781396a0 100644 --- a/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart +++ b/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart @@ -10,6 +10,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../app_config.dart'; import '../../pages/buy_view/buy_form.dart'; import '../../services/event_bus/events/global/tor_connection_status_changed_event.dart'; import '../../services/tor_service.dart'; @@ -35,8 +37,9 @@ class _DesktopBuyViewState extends ConsumerState { @override void initState() { - torEnabled = - ref.read(pTorService).status != TorConnectionStatus.disconnected; + torEnabled = AppConfig.hasFeature(AppFeature.tor) + ? ref.read(pTorService).status != TorConnectionStatus.disconnected + : false; super.initState(); } @@ -54,9 +57,7 @@ class _DesktopBuyViewState extends ConsumerState { appBar: DesktopAppBar( isCompactHeight: true, leading: Padding( - padding: const EdgeInsets.only( - left: 24, - ), + padding: const EdgeInsets.only(left: 24), child: Text( "Buy crypto", style: STextStyles.desktopH3(context), @@ -64,11 +65,7 @@ class _DesktopBuyViewState extends ConsumerState { ), ), body: const Padding( - padding: EdgeInsets.only( - left: 24, - right: 24, - bottom: 24, - ), + padding: EdgeInsets.only(left: 24, right: 24, bottom: 24), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -77,9 +74,7 @@ class _DesktopBuyViewState extends ConsumerState { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, - ), + SizedBox(height: 16), RoundedWhiteContainer( padding: EdgeInsets.all(24), child: BuyForm(), @@ -87,9 +82,7 @@ class _DesktopBuyViewState extends ConsumerState { ], ), ), - SizedBox( - width: 16, - ), + SizedBox(width: 16), // Expanded( // child: Row( // children: const [ @@ -105,19 +98,16 @@ class _DesktopBuyViewState extends ConsumerState { ), if (torEnabled) Container( - color: Theme.of(context) - .extension()! - .overlay - .withOpacity(0.7), + color: Theme.of( + context, + ).extension()!.overlay.withOpacity(0.7), height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, child: DesktopDialog( maxHeight: 200, maxWidth: 350, child: Padding( - padding: const EdgeInsets.all( - 15.0, - ), + padding: const EdgeInsets.all(15.0), child: Column( // crossAxisAlignment: CrossAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center, @@ -127,16 +117,14 @@ class _DesktopBuyViewState extends ConsumerState { textAlign: TextAlign.center, style: STextStyles.pageTitleH1(context), ), - const SizedBox( - height: 30, - ), + const SizedBox(height: 30), Text( "Purchasing not available while Tor is enabled", textAlign: TextAlign.center, style: STextStyles.desktopTextMedium(context).copyWith( - color: Theme.of(context) - .extension()! - .infoItemLabel, + color: Theme.of( + context, + ).extension()!.infoItemLabel, ), ), ], diff --git a/lib/pages_desktop_specific/desktop_menu.dart b/lib/pages_desktop_specific/desktop_menu.dart index 9c9b9cc1d4..c0cbf107f5 100644 --- a/lib/pages_desktop_specific/desktop_menu.dart +++ b/lib/pages_desktop_specific/desktop_menu.dart @@ -126,19 +126,13 @@ class _DesktopMenuState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - const SizedBox( - height: 25, - ), + const SizedBox(height: 25), AnimatedContainer( duration: duration, width: _width == expandedWidth ? 70 : 32, - child: LivingStackIcon( - onPressed: toggleMinimize, - ), - ), - const SizedBox( - height: 10, + child: LivingStackIcon(onPressed: toggleMinimize), ), + const SizedBox(height: 10), AnimatedOpacity( duration: duration, opacity: _width == expandedWidth ? 1 : 0, @@ -146,40 +140,40 @@ class _DesktopMenuState extends ConsumerState { height: 28, child: Text( AppConfig.appName, - style: STextStyles.desktopH2(context).copyWith( - fontSize: 18, - height: 23.4 / 18, - ), + style: STextStyles.desktopH2( + context, + ).copyWith(fontSize: 18, height: 23.4 / 18), ), ), ), - const SizedBox( - height: 5, - ), - AnimatedContainer( - duration: duration, - width: _width == expandedWidth - ? _width - 32 // 16 padding on either side - : _width - 16, // 8 padding on either side - child: DesktopTorStatusButton( - transitionDuration: duration, - controller: torButtonController, - onPressed: () { - ref.read(currentDesktopMenuItemProvider.state).state = - DesktopMenuItemId.settings; - ref.read(selectedSettingsMenuItemStateProvider.state).state = - 4; - }, + if (AppConfig.hasFeature(AppFeature.tor)) const SizedBox(height: 5), + if (AppConfig.hasFeature(AppFeature.tor)) + AnimatedContainer( + duration: duration, + width: _width == expandedWidth + ? _width - + 32 // 16 padding on either side + : _width - 16, // 8 padding on either side + child: DesktopTorStatusButton( + transitionDuration: duration, + controller: torButtonController, + onPressed: () { + ref.read(currentDesktopMenuItemProvider.state).state = + DesktopMenuItemId.settings; + ref + .read(selectedSettingsMenuItemStateProvider.state) + .state = + 4; + }, + ), ), - ), - const SizedBox( - height: 40, - ), + const SizedBox(height: 40), Expanded( child: AnimatedContainer( duration: duration, width: _width == expandedWidth - ? _width - 32 // 16 padding on either side + ? _width - + 32 // 16 padding on either side : _width - 16, // 8 padding on either side child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, @@ -196,9 +190,7 @@ class _DesktopMenuState extends ConsumerState { ), if (AppConfig.hasFeature(AppFeature.swap) && showExchange) ...[ - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), DesktopMenuItem( key: const ValueKey('swap'), duration: duration, @@ -212,9 +204,7 @@ class _DesktopMenuState extends ConsumerState { ], if (AppConfig.hasFeature(AppFeature.buy) && showExchange) ...[ - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), DesktopMenuItem( key: const ValueKey('buy'), duration: duration, @@ -226,9 +216,7 @@ class _DesktopMenuState extends ConsumerState { isExpandedInitially: !_isMinimized, ), ], - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), DesktopMenuItem( key: const ValueKey('notifications'), duration: duration, @@ -239,9 +227,7 @@ class _DesktopMenuState extends ConsumerState { controller: controllers[3], isExpandedInitially: !_isMinimized, ), - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), DesktopMenuItem( key: const ValueKey('addressBook'), duration: duration, @@ -252,9 +238,7 @@ class _DesktopMenuState extends ConsumerState { controller: controllers[4], isExpandedInitially: !_isMinimized, ), - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), DesktopMenuItem( key: const ValueKey('settings'), duration: duration, @@ -265,9 +249,7 @@ class _DesktopMenuState extends ConsumerState { controller: controllers[5], isExpandedInitially: !_isMinimized, ), - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), DesktopMenuItem( key: const ValueKey('support'), duration: duration, @@ -278,9 +260,7 @@ class _DesktopMenuState extends ConsumerState { controller: controllers[6], isExpandedInitially: !_isMinimized, ), - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), DesktopMenuItem( key: const ValueKey('about'), duration: duration, 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 e5b05270f9..c5e5428f45 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 @@ -126,9 +126,8 @@ class _DesktopWalletFeaturesState extends ConsumerState { ) async { await showDialog( context: context, - builder: - (_) => - MoreFeaturesDialog(walletId: widget.walletId, options: options), + builder: (_) => + MoreFeaturesDialog(walletId: widget.walletId, options: options), ); } @@ -154,49 +153,48 @@ class _DesktopWalletFeaturesState extends ConsumerState { await showDialog( context: context, barrierDismissible: false, - builder: - (context) => DesktopDialog( - maxWidth: 500, - maxHeight: double.infinity, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 20), - child: Column( + builder: (context) => DesktopDialog( + maxWidth: 500, + maxHeight: double.infinity, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 20), + child: Column( + children: [ + Text("Attention!", style: STextStyles.desktopH2(context)), + const SizedBox(height: 16), + Text( + "You're about to privatize all of your public funds.", + style: STextStyles.desktopTextSmall(context), + ), + const SizedBox(height: 32), + Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ - Text("Attention!", style: STextStyles.desktopH2(context)), - const SizedBox(height: 16), - Text( - "You're about to privatize all of your public funds.", - style: STextStyles.desktopTextSmall(context), + SecondaryButton( + width: 200, + buttonHeight: ButtonHeight.l, + label: "Cancel", + onPressed: () { + Navigator.of(context).pop(); + }, ), - const SizedBox(height: 32), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SecondaryButton( - width: 200, - buttonHeight: ButtonHeight.l, - label: "Cancel", - onPressed: () { - Navigator.of(context).pop(); - }, - ), - const SizedBox(width: 20), - PrimaryButton( - width: 200, - buttonHeight: ButtonHeight.l, - label: "Continue", - onPressed: () { - Navigator.of(context).pop(); - - unawaited(_attemptAnonymize()); - }, - ), - ], + const SizedBox(width: 20), + PrimaryButton( + width: 200, + buttonHeight: ButtonHeight.l, + label: "Continue", + onPressed: () { + Navigator.of(context).pop(); + + unawaited(_attemptAnonymize()); + }, ), ], ), - ), + ], ), + ), + ), ); } @@ -205,14 +203,13 @@ class _DesktopWalletFeaturesState extends ConsumerState { unawaited( showDialog( context: context, - builder: - (context) => WillPopScope( - child: const CustomLoadingOverlay( - message: "Privatizing balance", - eventBus: null, - ), - onWillPop: () async => shouldPop, - ), + builder: (context) => WillPopScope( + child: const CustomLoadingOverlay( + message: "Privatizing balance", + eventBus: null, + ), + onWillPop: () async => shouldPop, + ), ), ); @@ -265,46 +262,44 @@ class _DesktopWalletFeaturesState extends ConsumerState { ).popUntil(ModalRoute.withName(DesktopWalletView.routeName)); await showDialog( context: context, - builder: - (_) => DesktopDialog( - maxWidth: 400, - maxHeight: 300, - child: Padding( - padding: const EdgeInsets.all(24), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + builder: (_) => DesktopDialog( + maxWidth: 400, + maxHeight: 300, + child: Padding( + padding: const EdgeInsets.all(24), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Privatize all failed", + style: STextStyles.desktopH3(context), + ), + const Spacer(flex: 1), + Text( + "Reason: $e", + style: STextStyles.desktopTextSmall(context), + ), + const Spacer(flex: 2), + Row( children: [ - Text( - "Privatize all failed", - style: STextStyles.desktopH3(context), - ), - const Spacer(flex: 1), - Text( - "Reason: $e", - style: STextStyles.desktopTextSmall(context), - ), - const Spacer(flex: 2), - Row( - children: [ - const Spacer(), - const SizedBox(width: 16), - Expanded( - child: PrimaryButton( - label: "Ok", - buttonHeight: ButtonHeight.l, - onPressed: - Navigator.of( - context, - rootNavigator: true, - ).pop, - ), - ), - ], + const Spacer(), + const SizedBox(width: 16), + Expanded( + child: PrimaryButton( + label: "Ok", + buttonHeight: ButtonHeight.l, + onPressed: Navigator.of( + context, + rootNavigator: true, + ).pop, + ), ), ], ), - ), + ], ), + ), + ), ); } } @@ -447,7 +442,9 @@ class _DesktopWalletFeaturesState extends ConsumerState { if (wallet.info.coin is Banano) (WalletFeature.monkey, Assets.svg.monkey, _onMonkeyPressed), - if (!isViewOnly && wallet is CashFusionInterface) + if (AppConfig.hasFeature(AppFeature.tor) && + !isViewOnly && + wallet is CashFusionInterface) (WalletFeature.fusion, Assets.svg.cashFusion, _onFusionPressed), if (!isViewOnly && @@ -493,8 +490,8 @@ class _DesktopWalletFeaturesState extends ConsumerState { canGen = (wallet is MultiAddressInterface || - wallet is SparkInterface || - supportsMweb); + wallet is SparkInterface || + supportsMweb); } final showMwebOption = wallet is MwebInterface && !wallet.isViewOnly; @@ -523,16 +520,14 @@ class _DesktopWalletFeaturesState extends ConsumerState { Assets.svg.bars, height: 20, width: 20, - color: - Theme.of( - context, - ).extension()!.buttonTextSecondary, + color: Theme.of( + context, + ).extension()!.buttonTextSecondary, ), - onPressed: - () => _onMorePressed([ - ...options.sublist(options.length - count), - ...extraOptions, - ]), + onPressed: () => _onMorePressed([ + ...options.sublist(options.length - count), + ...extraOptions, + ]), ), ); }, @@ -545,30 +540,27 @@ class _DesktopWalletFeaturesState extends ConsumerState { label: option.$1.label, padding: const EdgeInsets.symmetric(horizontal: 16), buttonHeight: ButtonHeight.l, - icon: - option.$1 == WalletFeature.buy - ? SvgPicture.file( - File( - ref.watch( - themeProvider.select((value) => value.assets.buy), - ), + icon: option.$1 == WalletFeature.buy + ? SvgPicture.file( + File( + ref.watch( + themeProvider.select((value) => value.assets.buy), ), - height: 20, - width: 20, - color: - Theme.of( - context, - ).extension()!.buttonTextSecondary, - ) - : SvgPicture.asset( - option.$2, - height: 20, - width: 20, - color: - Theme.of( - context, - ).extension()!.buttonTextSecondary, ), + height: 20, + width: 20, + color: Theme.of( + context, + ).extension()!.buttonTextSecondary, + ) + : SvgPicture.asset( + option.$2, + height: 20, + width: 20, + color: Theme.of( + context, + ).extension()!.buttonTextSecondary, + ), onPressed: () => option.$3(), ), ), diff --git a/lib/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart b/lib/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart index aea4a8f021..6c2a12e1d3 100644 --- a/lib/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart +++ b/lib/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart @@ -6,6 +6,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:path/path.dart' as path; import 'package:path_provider/path_provider.dart'; +import '../../app_config.dart'; import '../../models/isar/models/blockchain_data/utxo.dart'; import '../../models/isar/ordinal.dart'; import '../../networking/http.dart'; @@ -57,10 +58,11 @@ class _DesktopOrdinalDetailsViewState final response = await client.get( url: Uri.parse(widget.ordinal.content), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); if (response.code != 200) { @@ -71,10 +73,9 @@ class _DesktopOrdinalDetailsViewState final bytes = response.bodyBytes; - final dir = - Platform.isAndroid - ? await StackFileSystem.wtfAndroidDocumentsPath() - : await getApplicationDocumentsDirectory(); + final dir = Platform.isAndroid + ? await StackFileSystem.wtfAndroidDocumentsPath() + : await getApplicationDocumentsDirectory(); final filePath = path.join( dir.path, @@ -109,19 +110,17 @@ class _DesktopOrdinalDetailsViewState const SizedBox(width: 32), AppBarIconButton( size: 32, - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, shadows: const [], icon: SvgPicture.asset( Assets.svg.arrowLeft, width: 18, height: 18, - color: - Theme.of( - context, - ).extension()!.topNavIconPrimary, + color: Theme.of( + context, + ).extension()!.topNavIconPrimary, ), onPressed: Navigator.of(context).pop, ), @@ -213,10 +212,9 @@ class _DesktopOrdinalDetailsViewState Assets.svg.arrowDown, width: 13, height: 18, - color: - Theme.of(context) - .extension()! - .buttonTextSecondary, + color: Theme.of( + context, + ).extension()!.buttonTextSecondary, ), buttonHeight: ButtonHeight.l, iconSpacing: 8, @@ -276,28 +274,26 @@ class _DesktopOrdinalDetailsViewState const _Divider(), Consumer( builder: (context, ref, _) { - final coin = - ref - .watch(pWallets) - .getWallet(widget.walletId) - .info - .coin; + final coin = ref + .watch(pWallets) + .getWallet(widget.walletId) + .info + .coin; return _DetailsItemWCopy( title: "Amount", - data: - utxo == null - ? "ERROR" - : ref - .watch(pAmountFormatter(coin)) - .format( - Amount( - rawValue: BigInt.from( - utxo!.value, - ), - fractionDigits: - coin.fractionDigits, + data: utxo == null + ? "ERROR" + : ref + .watch(pAmountFormatter(coin)) + .format( + Amount( + rawValue: BigInt.from( + utxo!.value, ), + fractionDigits: + coin.fractionDigits, ), + ), ); }, ), diff --git a/lib/route_generator.dart b/lib/route_generator.dart index 79c7ec4f5a..4775dadaab 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -13,6 +13,7 @@ import 'package:flutter/material.dart'; import 'package:isar_community/isar.dart'; import 'package:tuple/tuple.dart'; +import 'app_config.dart'; import 'db/drift/database.dart'; import 'models/add_wallet_list_entity/add_wallet_list_entity.dart'; import 'models/add_wallet_list_entity/sub_classes/eth_token_entity.dart'; @@ -289,12 +290,11 @@ class RouteGenerator { if (args is Tuple3) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => ChooseCoinView( - title: args.item1, - coinAdditional: args.item2, - nextRouteName: args.item3, - ), + builder: (_) => ChooseCoinView( + title: args.item1, + coinAdditional: args.item2, + nextRouteName: args.item3, + ), settings: RouteSettings(name: settings.name), ); } @@ -344,11 +344,10 @@ class RouteGenerator { } else if (args is Tuple2>) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => EditWalletTokensView( - walletId: args.item1, - contractsToMarkSelected: args.item2, - ), + builder: (_) => EditWalletTokensView( + walletId: args.item1, + contractsToMarkSelected: args.item2, + ), settings: RouteSettings(name: settings.name), ); } @@ -395,11 +394,10 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => TokenContractDetailsView( - contractAddress: args.item1, - walletId: args.item2, - ), + builder: (_) => TokenContractDetailsView( + contractAddress: args.item1, + walletId: args.item2, + ), settings: RouteSettings(name: settings.name), ); } @@ -409,11 +407,10 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => SingleFieldEditView( - initialValue: args.item1, - label: args.item2, - ), + builder: (_) => SingleFieldEditView( + initialValue: args.item1, + label: args.item2, + ), settings: RouteSettings(name: settings.name), ); } @@ -433,11 +430,10 @@ class RouteGenerator { if (args is ({String walletName, FrostCurrency frostCurrency})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => CreateNewFrostMsWalletView( - walletName: args.walletName, - frostCurrency: args.frostCurrency, - ), + builder: (_) => CreateNewFrostMsWalletView( + walletName: args.walletName, + frostCurrency: args.frostCurrency, + ), settings: RouteSettings(name: settings.name), ); } @@ -447,11 +443,10 @@ class RouteGenerator { if (args is ({String walletName, FrostCurrency frostCurrency})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => RestoreFrostMsWalletView( - walletName: args.walletName, - frostCurrency: args.frostCurrency, - ), + builder: (_) => RestoreFrostMsWalletView( + walletName: args.walletName, + frostCurrency: args.frostCurrency, + ), settings: RouteSettings(name: settings.name), ); } @@ -461,11 +456,10 @@ class RouteGenerator { if (args is ({String walletName, FrostCurrency frostCurrency})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => SelectNewFrostImportTypeView( - walletName: args.walletName, - frostCurrency: args.frostCurrency, - ), + builder: (_) => SelectNewFrostImportTypeView( + walletName: args.walletName, + frostCurrency: args.frostCurrency, + ), settings: RouteSettings(name: settings.name), ); } @@ -512,11 +506,10 @@ class RouteGenerator { if (args is ({String walletId, Map resharers})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => CompleteReshareConfigView( - walletId: args.walletId, - resharers: args.resharers, - ), + builder: (_) => CompleteReshareConfigView( + walletId: args.walletId, + resharers: args.resharers, + ), settings: RouteSettings(name: settings.name), ); } @@ -526,8 +519,8 @@ class RouteGenerator { if (args is ({String walletId, CryptoCurrency coin})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => FrostSendView(walletId: args.walletId, coin: args.coin), + builder: (_) => + FrostSendView(walletId: args.walletId, coin: args.coin), settings: RouteSettings(name: settings.name), ); } @@ -552,21 +545,20 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => CoinControlView(walletId: args.item1, type: args.item2), + builder: (_) => + CoinControlView(walletId: args.item1, type: args.item2), settings: RouteSettings(name: settings.name), ); } else if (args is Tuple4?>) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => CoinControlView( - walletId: args.item1, - type: args.item2, - requestedTotal: args.item3, - selectedUTXOs: args.item4, - ), + builder: (_) => CoinControlView( + walletId: args.item1, + type: args.item2, + requestedTotal: args.item3, + selectedUTXOs: args.item4, + ), settings: RouteSettings(name: settings.name), ); } @@ -596,11 +588,10 @@ class RouteGenerator { if (args is ({Ordinal ordinal, String walletId})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => OrdinalDetailsView( - walletId: args.walletId, - ordinal: args.ordinal, - ), + builder: (_) => OrdinalDetailsView( + walletId: args.walletId, + ordinal: args.ordinal, + ), settings: RouteSettings(name: settings.name), ); } @@ -610,11 +601,10 @@ class RouteGenerator { if (args is ({Ordinal ordinal, String walletId})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => DesktopOrdinalDetailsView( - walletId: args.walletId, - ordinal: args.ordinal, - ), + builder: (_) => DesktopOrdinalDetailsView( + walletId: args.walletId, + ordinal: args.ordinal, + ), settings: RouteSettings(name: settings.name), ); } @@ -631,9 +621,8 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => - UtxoDetailsView(walletId: args.item2, utxoId: args.item1), + builder: (_) => + UtxoDetailsView(walletId: args.item2, utxoId: args.item1), settings: RouteSettings(name: settings.name), ); } @@ -683,7 +672,9 @@ class RouteGenerator { if (args is String) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: (_) => CashFusionView(walletId: args), + builder: (_) => AppConfig.hasFeature(AppFeature.tor) + ? CashFusionView(walletId: args) + : throw Exception("Tor not configured in prebuild setup"), settings: RouteSettings(name: settings.name), ); } @@ -703,9 +694,8 @@ class RouteGenerator { if (args is ({String walletId, UTXO utxo})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => - ManageDomainView(walletId: args.walletId, utxo: args.utxo), + builder: (_) => + ManageDomainView(walletId: args.walletId, utxo: args.utxo), settings: RouteSettings(name: settings.name), ); } @@ -825,21 +815,19 @@ class RouteGenerator { if (args is ({String walletId, String name})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => - BuySparkNameView(walletId: args.walletId, name: args.name), + builder: (_) => + BuySparkNameView(walletId: args.walletId, name: args.name), settings: RouteSettings(name: settings.name), ); } else if (args is ({String walletId, String name, SparkName? nameToRenew})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => BuySparkNameView( - walletId: args.walletId, - name: args.name, - nameToRenew: args.nameToRenew, - ), + builder: (_) => BuySparkNameView( + walletId: args.walletId, + name: args.name, + nameToRenew: args.nameToRenew, + ), settings: RouteSettings(name: settings.name), ); } @@ -849,11 +837,10 @@ class RouteGenerator { if (args is ({String walletId, TxData txData})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => ConfirmSparkNameTransactionView( - walletId: args.walletId, - txData: args.txData, - ), + builder: (_) => ConfirmSparkNameTransactionView( + walletId: args.walletId, + txData: args.txData, + ), settings: RouteSettings(name: settings.name), ); } @@ -863,11 +850,8 @@ class RouteGenerator { if (args is ({String walletId, SparkName name})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => SparkNameDetailsView( - walletId: args.walletId, - name: args.name, - ), + builder: (_) => + SparkNameDetailsView(walletId: args.walletId, name: args.name), settings: RouteSettings(name: settings.name), ); } @@ -877,7 +861,9 @@ class RouteGenerator { if (args is String) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: (_) => FusionProgressView(walletId: args), + builder: (_) => AppConfig.hasFeature(AppFeature.tor) + ? FusionProgressView(walletId: args) + : throw Exception("Tor not configured in prebuild setup"), settings: RouteSettings(name: settings.name), ); } @@ -1024,14 +1010,18 @@ class RouteGenerator { case TorSettingsView.routeName: return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: (_) => const TorSettingsView(), + builder: (_) => AppConfig.hasFeature(AppFeature.tor) + ? const TorSettingsView() + : throw Exception("Tor not configured in prebuild setup"), settings: RouteSettings(name: settings.name), ); case TorSettings.routeName: return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: (_) => const TorSettings(), + builder: (_) => AppConfig.hasFeature(AppFeature.tor) + ? const TorSettings() + : throw Exception("Tor not configured in prebuild setup"), settings: RouteSettings(name: settings.name), ); @@ -1208,12 +1198,11 @@ class RouteGenerator { if (args is Tuple3) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => NodeDetailsView( - coin: args.item1, - nodeId: args.item2, - popRouteName: args.item3, - ), + builder: (_) => NodeDetailsView( + coin: args.item1, + nodeId: args.item2, + popRouteName: args.item3, + ), settings: RouteSettings(name: settings.name), ); } @@ -1223,8 +1212,8 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => EditNoteView(txid: args.item1, walletId: args.item2), + builder: (_) => + EditNoteView(txid: args.item1, walletId: args.item2), settings: RouteSettings(name: settings.name), ); } @@ -1244,8 +1233,8 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => EditTradeNoteView(tradeId: args.item1, note: args.item2), + builder: (_) => + EditTradeNoteView(tradeId: args.item1, note: args.item2), settings: RouteSettings(name: settings.name), ); } @@ -1256,13 +1245,12 @@ class RouteGenerator { is Tuple4) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => AddEditNodeView( - viewType: args.item1, - coin: args.item2, - nodeId: args.item3, - routeOnSuccessOrDelete: args.item4, - ), + builder: (_) => AddEditNodeView( + viewType: args.item1, + coin: args.item2, + nodeId: args.item3, + routeOnSuccessOrDelete: args.item4, + ), settings: RouteSettings(name: settings.name), ); } @@ -1302,11 +1290,10 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => EditContactAddressView( - contactId: args.item1, - addressEntry: args.item2, - ), + builder: (_) => EditContactAddressView( + contactId: args.item1, + addressEntry: args.item2, + ), settings: RouteSettings(name: settings.name), ); } @@ -1323,12 +1310,11 @@ class RouteGenerator { if (args is Tuple3) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => WalletNetworkSettingsView( - walletId: args.item1, - initialSyncStatus: args.item2, - initialNodeStatus: args.item3, - ), + builder: (_) => WalletNetworkSettingsView( + walletId: args.item1, + initialSyncStatus: args.item2, + initialNodeStatus: args.item3, + ), settings: RouteSettings(name: settings.name), ); } @@ -1338,11 +1324,10 @@ class RouteGenerator { if (args is ({String walletId, List mnemonic})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => WalletBackupView( - walletId: args.walletId, - mnemonic: args.mnemonic, - ), + builder: (_) => WalletBackupView( + walletId: args.walletId, + mnemonic: args.mnemonic, + ), settings: RouteSettings(name: settings.name), ); } else if (args @@ -1359,12 +1344,11 @@ class RouteGenerator { })) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => WalletBackupView( - walletId: args.walletId, - mnemonic: args.mnemonic, - frostWalletData: args.frostWalletData, - ), + builder: (_) => WalletBackupView( + walletId: args.walletId, + mnemonic: args.mnemonic, + frostWalletData: args.frostWalletData, + ), settings: RouteSettings(name: settings.name), ); } else if (args @@ -1375,12 +1359,11 @@ class RouteGenerator { })) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => WalletBackupView( - walletId: args.walletId, - mnemonic: args.mnemonic, - keyData: args.keyData, - ), + builder: (_) => WalletBackupView( + walletId: args.walletId, + mnemonic: args.mnemonic, + keyData: args.keyData, + ), settings: RouteSettings(name: settings.name), ); } else if (args @@ -1398,13 +1381,12 @@ class RouteGenerator { })) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => WalletBackupView( - walletId: args.walletId, - mnemonic: args.mnemonic, - frostWalletData: args.frostWalletData, - keyData: args.keyData, - ), + builder: (_) => WalletBackupView( + walletId: args.walletId, + mnemonic: args.mnemonic, + frostWalletData: args.frostWalletData, + keyData: args.keyData, + ), settings: RouteSettings(name: settings.name), ); } @@ -1414,11 +1396,10 @@ class RouteGenerator { if (args is ({String walletId, KeyDataInterface keyData})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => MobileKeyDataView( - walletId: args.walletId, - keyData: args.keyData, - ), + builder: (_) => MobileKeyDataView( + walletId: args.walletId, + keyData: args.keyData, + ), settings: RouteSettings(name: settings.name), ); } @@ -1468,11 +1449,8 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => NameYourWalletView( - addWalletType: args.item1, - coin: args.item2, - ), + builder: (_) => + NameYourWalletView(addWalletType: args.item1, coin: args.item2), settings: RouteSettings(name: settings.name), ); } @@ -1482,11 +1460,10 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => NewWalletRecoveryPhraseWarningView( - walletName: args.item1, - coin: args.item2, - ), + builder: (_) => NewWalletRecoveryPhraseWarningView( + walletName: args.item1, + coin: args.item2, + ), settings: RouteSettings(name: settings.name), ); } @@ -1496,11 +1473,8 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => RestoreOptionsView( - walletName: args.item1, - coin: args.item2, - ), + builder: (_) => + RestoreOptionsView(walletName: args.item1, coin: args.item2), settings: RouteSettings(name: settings.name), ); } @@ -1510,11 +1484,8 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => NewWalletOptionsView( - walletName: args.item1, - coin: args.item2, - ), + builder: (_) => + NewWalletOptionsView(walletName: args.item1, coin: args.item2), settings: RouteSettings(name: settings.name), ); } @@ -1524,14 +1495,13 @@ class RouteGenerator { if (args is Tuple5) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => RestoreWalletView( - walletName: args.item1, - coin: args.item2, - seedWordsLength: args.item3, - restoreBlockHeight: args.item4, - mnemonicPassphrase: args.item5, - ), + builder: (_) => RestoreWalletView( + walletName: args.item1, + coin: args.item2, + seedWordsLength: args.item3, + restoreBlockHeight: args.item4, + mnemonicPassphrase: args.item5, + ), settings: RouteSettings(name: settings.name), ); } @@ -1546,12 +1516,11 @@ class RouteGenerator { })) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => RestoreViewOnlyWalletView( - walletName: args.walletName, - coin: args.coin, - restoreBlockHeight: args.restoreBlockHeight, - ), + builder: (_) => RestoreViewOnlyWalletView( + walletName: args.walletName, + coin: args.coin, + restoreBlockHeight: args.restoreBlockHeight, + ), settings: RouteSettings(name: settings.name), ); } @@ -1561,11 +1530,10 @@ class RouteGenerator { if (args is Tuple2>) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => NewWalletRecoveryPhraseView( - wallet: args.item1, - mnemonic: args.item2, - ), + builder: (_) => NewWalletRecoveryPhraseView( + wallet: args.item1, + mnemonic: args.item2, + ), settings: RouteSettings(name: settings.name), ); } @@ -1575,11 +1543,10 @@ class RouteGenerator { if (args is Tuple2>) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => VerifyRecoveryPhraseView( - wallet: args.item1, - mnemonic: args.item2, - ), + builder: (_) => VerifyRecoveryPhraseView( + wallet: args.item1, + mnemonic: args.item2, + ), settings: RouteSettings(name: settings.name), ); } @@ -1605,12 +1572,11 @@ class RouteGenerator { if (args is Tuple3) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => TransactionDetailsView( - transaction: args.item1, - coin: args.item2, - walletId: args.item3, - ), + builder: (_) => TransactionDetailsView( + transaction: args.item1, + coin: args.item2, + walletId: args.item3, + ), settings: RouteSettings(name: settings.name), ); } @@ -1621,12 +1587,11 @@ class RouteGenerator { is ({TransactionV2 tx, CryptoCurrency coin, String walletId})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => tvd.TransactionV2DetailsView( - transaction: args.tx, - coin: args.coin, - walletId: args.walletId, - ), + builder: (_) => tvd.TransactionV2DetailsView( + transaction: args.tx, + coin: args.coin, + walletId: args.walletId, + ), settings: RouteSettings(name: settings.name), ); } @@ -1641,12 +1606,11 @@ class RouteGenerator { })) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => FusionGroupDetailsView( - transactions: args.transactions, - coin: args.coin, - walletId: args.walletId, - ), + builder: (_) => FusionGroupDetailsView( + transactions: args.transactions, + coin: args.coin, + walletId: args.walletId, + ), settings: RouteSettings(name: settings.name), ); } @@ -1673,11 +1637,10 @@ class RouteGenerator { if (args is ({String walletId, String contractAddress})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => AllTransactionsV2View( - walletId: args.walletId, - contractAddress: args.contractAddress, - ), + builder: (_) => AllTransactionsV2View( + walletId: args.walletId, + contractAddress: args.contractAddress, + ), settings: RouteSettings(name: settings.name), ); } @@ -1703,11 +1666,8 @@ class RouteGenerator { } else if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => ReceiveView( - walletId: args.item1, - tokenContract: args.item2, - ), + builder: (_) => + ReceiveView(walletId: args.item1, tokenContract: args.item2), settings: RouteSettings(name: settings.name), ); } @@ -1737,11 +1697,8 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => AddressDetailsView( - walletId: args.item2, - addressId: args.item1, - ), + builder: (_) => + AddressDetailsView(walletId: args.item2, addressId: args.item1), settings: RouteSettings(name: settings.name), ); } @@ -1758,23 +1715,21 @@ class RouteGenerator { is Tuple3) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => SendView( - walletId: args.item1, - coin: args.item2, - autoFillData: args.item3, - ), + builder: (_) => SendView( + walletId: args.item1, + coin: args.item2, + autoFillData: args.item3, + ), settings: RouteSettings(name: settings.name), ); } else if (args is Tuple3) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => SendView( - walletId: args.item1, - coin: args.item2, - accountLite: args.item3, - ), + builder: (_) => SendView( + walletId: args.item1, + coin: args.item2, + accountLite: args.item3, + ), settings: RouteSettings(name: settings.name), ); } else if (args is ({CryptoCurrency coin, String walletId})) { @@ -1791,12 +1746,11 @@ class RouteGenerator { if (args is Tuple3) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => TokenSendView( - walletId: args.item1, - coin: args.item2, - tokenContract: args.item3, - ), + builder: (_) => TokenSendView( + walletId: args.item1, + coin: args.item2, + tokenContract: args.item3, + ), settings: RouteSettings(name: settings.name), ); } @@ -1806,12 +1760,11 @@ class RouteGenerator { if (args is (TxData, String, VoidCallback)) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => ConfirmTransactionView( - txData: args.$1, - walletId: args.$2, - onSuccess: args.$3, - ), + builder: (_) => ConfirmTransactionView( + txData: args.$1, + walletId: args.$2, + onSuccess: args.$3, + ), settings: RouteSettings(name: settings.name), ); } @@ -1821,11 +1774,8 @@ class RouteGenerator { if (args is (TxData, String)) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => ConfirmNameTransactionView( - txData: args.$1, - walletId: args.$2, - ), + builder: (_) => + ConfirmNameTransactionView(txData: args.$1, walletId: args.$2), settings: RouteSettings(name: settings.name), ); } @@ -1835,37 +1785,35 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => Stack( - children: [ - WalletInitiatedExchangeView( - walletId: args.item1, - coin: args.item2, - ), - // ExchangeLoadingOverlayView( - // unawaitedLoad: args.item3, - // ), - ], + builder: (_) => Stack( + children: [ + WalletInitiatedExchangeView( + walletId: args.item1, + coin: args.item2, ), + // ExchangeLoadingOverlayView( + // unawaitedLoad: args.item3, + // ), + ], + ), settings: RouteSettings(name: settings.name), ); } if (args is Tuple3) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => Stack( - children: [ - WalletInitiatedExchangeView( - walletId: args.item1, - coin: args.item2, - contract: args.item3, - ), - // ExchangeLoadingOverlayView( - // unawaitedLoad: args.item3, - // ), - ], + builder: (_) => Stack( + children: [ + WalletInitiatedExchangeView( + walletId: args.item1, + coin: args.item2, + contract: args.item3, ), + // ExchangeLoadingOverlayView( + // unawaitedLoad: args.item3, + // ), + ], + ), settings: RouteSettings(name: settings.name), ); } @@ -1891,13 +1839,12 @@ class RouteGenerator { >) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => WalletSettingsView( - walletId: args.item1, - coin: args.item2, - initialSyncStatus: args.item3, - initialNodeStatus: args.item4, - ), + builder: (_) => WalletSettingsView( + walletId: args.item1, + coin: args.item2, + initialSyncStatus: args.item3, + initialNodeStatus: args.item4, + ), settings: RouteSettings(name: settings.name), ); } @@ -1907,11 +1854,10 @@ class RouteGenerator { if (args is ({String walletId, List mnemonicWords})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => DeleteWalletRecoveryPhraseView( - mnemonic: args.mnemonicWords, - walletId: args.walletId, - ), + builder: (_) => DeleteWalletRecoveryPhraseView( + mnemonic: args.mnemonicWords, + walletId: args.walletId, + ), settings: RouteSettings(name: settings.name), ); } else if (args @@ -1928,12 +1874,11 @@ class RouteGenerator { })) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => DeleteWalletRecoveryPhraseView( - mnemonic: args.mnemonicWords, - walletId: args.walletId, - frostWalletData: args.frostWalletData, - ), + builder: (_) => DeleteWalletRecoveryPhraseView( + mnemonic: args.mnemonicWords, + walletId: args.walletId, + frostWalletData: args.frostWalletData, + ), settings: RouteSettings(name: settings.name), ); } @@ -1943,11 +1888,10 @@ class RouteGenerator { if (args is ({String walletId, ViewOnlyWalletData data})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => DeleteViewOnlyWalletKeysView( - data: args.data, - walletId: args.walletId, - ), + builder: (_) => DeleteViewOnlyWalletKeysView( + data: args.data, + walletId: args.walletId, + ), settings: RouteSettings(name: settings.name), ); } @@ -1999,13 +1943,12 @@ class RouteGenerator { if (args is Tuple4) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => TradeDetailsView( - tradeId: args.item1, - transactionIfSentFromStack: args.item2, - walletId: args.item3, - walletName: args.item4, - ), + builder: (_) => TradeDetailsView( + tradeId: args.item1, + transactionIfSentFromStack: args.item2, + walletId: args.item3, + walletName: args.item4, + ), settings: RouteSettings(name: settings.name), ); } @@ -2025,13 +1968,12 @@ class RouteGenerator { if (args is Tuple4) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => SendFromView( - coin: args.item1, - amount: args.item2, - trade: args.item4, - address: args.item3, - ), + builder: (_) => SendFromView( + coin: args.item1, + amount: args.item2, + trade: args.item4, + address: args.item3, + ), settings: RouteSettings(name: settings.name), ); } @@ -2041,11 +1983,10 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => GenerateUriQrCodeView( - coin: args.item1, - receivingAddress: args.item2, - ), + builder: (_) => GenerateUriQrCodeView( + coin: args.item1, + receivingAddress: args.item2, + ), settings: RouteSettings(name: settings.name), ); } @@ -2095,11 +2036,10 @@ class RouteGenerator { if (args is ({String walletId, String domainName})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => BuyDomainView( - walletId: args.walletId, - domainName: args.domainName, - ), + builder: (_) => BuyDomainView( + walletId: args.walletId, + domainName: args.domainName, + ), settings: RouteSettings(name: settings.name), ); } @@ -2183,8 +2123,8 @@ class RouteGenerator { if (args is Tuple2) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => BuyInWalletView(coin: args.item1, contract: args.item2), + builder: (_) => + BuyInWalletView(coin: args.item1, contract: args.item2), settings: RouteSettings(name: settings.name), ); } @@ -2546,11 +2486,10 @@ class RouteGenerator { } else if (args is ({String walletId, bool popPrevious})) { return getRoute( shouldUseMaterialRoute: useMaterialPageRoute, - builder: - (_) => TokenView( - walletId: args.walletId, - popPrevious: args.popPrevious, - ), + builder: (_) => TokenView( + walletId: args.walletId, + popPrevious: args.popPrevious, + ), settings: RouteSettings(name: settings.name), ); } diff --git a/lib/services/buy/simplex/simplex_api.dart b/lib/services/buy/simplex/simplex_api.dart index eed33ea1b0..8fff4972cb 100644 --- a/lib/services/buy/simplex/simplex_api.dart +++ b/lib/services/buy/simplex/simplex_api.dart @@ -51,15 +51,15 @@ class SimplexAPI { final Map headers = { 'Content-Type': 'application/x-www-form-urlencoded', }; - final Map data = { - 'ROUTE': 'supported_cryptos', - }; + final Map data = {'ROUTE': 'supported_cryptos'}; final Uri url = _buildUri('api.php', data); final res = await client.post( url: url, headers: headers, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -78,10 +78,7 @@ class SimplexAPI { stackTrace: s, ); return BuyResponse( - exception: BuyException( - e.toString(), - BuyExceptionType.generic, - ), + exception: BuyException(e.toString(), BuyExceptionType.generic), ); } } @@ -107,16 +104,9 @@ class SimplexAPI { return BuyResponse(value: cryptos); } catch (e, s) { - Logging.instance.e( - "_parseSupported exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("_parseSupported exception", error: e, stackTrace: s); return BuyResponse( - exception: BuyException( - e.toString(), - BuyExceptionType.generic, - ), + exception: BuyException(e.toString(), BuyExceptionType.generic), ); } } @@ -126,15 +116,15 @@ class SimplexAPI { final Map headers = { 'Content-Type': 'application/x-www-form-urlencoded', }; - final Map data = { - 'ROUTE': 'supported_fiats', - }; + final Map data = {'ROUTE': 'supported_fiats'}; final Uri url = _buildUri('api.php', data); final res = await client.post( url: url, headers: headers, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -147,13 +137,13 @@ class SimplexAPI { return _parseSupportedFiats(jsonArray); } catch (e, s) { - Logging.instance - .e("getAvailableCurrencies exception: ", error: e, stackTrace: s); + Logging.instance.e( + "getAvailableCurrencies exception: ", + error: e, + stackTrace: s, + ); return BuyResponse( - exception: BuyException( - e.toString(), - BuyExceptionType.generic, - ), + exception: BuyException(e.toString(), BuyExceptionType.generic), ); } } @@ -169,8 +159,9 @@ class SimplexAPI { fiats.add( Fiat.fromJson({ 'ticker': "${fiat['ticker_symbol']}", - 'name': fiatFromTickerCaseInsensitive("${fiat['ticker_symbol']}") - .prettyName, + 'name': fiatFromTickerCaseInsensitive( + "${fiat['ticker_symbol']}", + ).prettyName, 'minAmount': "${fiat['min_amount']}", 'maxAmount': "${fiat['max_amount']}", 'image': "", @@ -181,16 +172,9 @@ class SimplexAPI { return BuyResponse(value: fiats); } catch (e, s) { - Logging.instance.e( - "_parseSupported exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("_parseSupported exception", error: e, stackTrace: s); return BuyResponse( - exception: BuyException( - e.toString(), - BuyExceptionType.generic, - ), + exception: BuyException(e.toString(), BuyExceptionType.generic), ); } } @@ -222,7 +206,9 @@ class SimplexAPI { final res = await client.get( url: url, headers: headers, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -241,16 +227,9 @@ class SimplexAPI { return _parseQuote(jsonArray); } catch (e, s) { - Logging.instance.e( - "getQuote exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("getQuote exception", error: e, stackTrace: s); return BuyResponse( - exception: BuyException( - e.toString(), - BuyExceptionType.generic, - ), + exception: BuyException(e.toString(), BuyExceptionType.generic), ); } } @@ -280,8 +259,9 @@ class SimplexAPI { youPayFiatPrice: quote.buyWithFiat ? quote.youPayFiatPrice : Decimal.parse("${jsonArray['fiat_money']['base_amount']}"), - youReceiveCryptoAmount: - Decimal.parse("${jsonArray['digital_money']['amount']}"), + youReceiveCryptoAmount: Decimal.parse( + "${jsonArray['digital_money']['amount']}", + ), id: jsonArray['quote_id'] as String, receivingAddress: quote.receivingAddress, buyWithFiat: quote.buyWithFiat, @@ -289,16 +269,9 @@ class SimplexAPI { return BuyResponse(value: _quote); } catch (e, s) { - Logging.instance.e( - "_parseQuote exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("_parseQuote exception", error: e, stackTrace: s); return BuyResponse( - exception: BuyException( - e.toString(), - BuyExceptionType.generic, - ), + exception: BuyException(e.toString(), BuyExceptionType.generic), ); } } @@ -329,8 +302,9 @@ class SimplexAPI { data['USER_ID'] = userID; } if (signupEpoch != null && signupEpoch != 0) { - final DateTime date = - DateTime.fromMillisecondsSinceEpoch(signupEpoch * 1000); + final DateTime date = DateTime.fromMillisecondsSinceEpoch( + signupEpoch * 1000, + ); data['SIGNUP_TIMESTAMP'] = date.toIso8601String() + timeZoneFormatter(date.timeZoneOffset); } @@ -339,7 +313,9 @@ class SimplexAPI { final res = await client.get( url: url, headers: headers, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -362,16 +338,9 @@ class SimplexAPI { return BuyResponse(value: _order); } catch (e, s) { - Logging.instance.e( - "newOrder exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("newOrder exception", error: e, stackTrace: s); return BuyResponse( - exception: BuyException( - e.toString(), - BuyExceptionType.generic, - ), + exception: BuyException(e.toString(), BuyExceptionType.generic), ); } } @@ -394,16 +363,9 @@ class SimplexAPI { return BuyResponse(value: status); } catch (e, s) { - Logging.instance.e( - "newOrder exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("newOrder exception", error: e, stackTrace: s); return BuyResponse( - exception: BuyException( - e.toString(), - BuyExceptionType.generic, - ), + exception: BuyException(e.toString(), BuyExceptionType.generic), ); } } diff --git a/lib/services/coins/tezos/api/tezos_api.dart b/lib/services/coins/tezos/api/tezos_api.dart index 6c21935775..a85e6b25d1 100644 --- a/lib/services/coins/tezos/api/tezos_api.dart +++ b/lib/services/coins/tezos/api/tezos_api.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import '../../../../app_config.dart'; import '../../../../networking/http.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/prefs.dart'; @@ -17,7 +18,9 @@ abstract final class TezosAPI { final response = await _client.get( url: Uri.parse(uriString), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -25,7 +28,11 @@ abstract final class TezosAPI { final result = jsonDecode(response.body); return result as int; } catch (e, s) { - Logging.instance.e("Error occurred in TezosAPI while getting counter for $address: ", error: e, stackTrace: s); + Logging.instance.e( + "Error occurred in TezosAPI while getting counter for $address: ", + error: e, + stackTrace: s, + ); rethrow; } } @@ -39,7 +46,9 @@ abstract final class TezosAPI { final response = await _client.get( url: Uri.parse(uriString), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -50,7 +59,11 @@ abstract final class TezosAPI { return account; } catch (e, s) { - Logging.instance.e("Error occurred in TezosAPI while getting account for $address: ", error: e, stackTrace: s); + Logging.instance.e( + "Error occurred in TezosAPI while getting account for $address: ", + error: e, + stackTrace: s, + ); rethrow; } } @@ -63,7 +76,9 @@ abstract final class TezosAPI { final response = await _client.get( url: Uri.parse(transactionsCall), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -78,9 +93,10 @@ abstract final class TezosAPI { hash: tx["hash"] as String, type: tx["type"] as String, height: tx["level"] as int, - timestamp: DateTime.parse(tx["timestamp"].toString()) - .toUtc() - .millisecondsSinceEpoch ~/ + timestamp: + DateTime.parse( + tx["timestamp"].toString(), + ).toUtc().millisecondsSinceEpoch ~/ 1000, cycle: tx["cycle"] as int?, counter: tx["counter"] as int, @@ -91,7 +107,8 @@ abstract final class TezosAPI { gasUsed: tx["gasUsed"] as int, storageLimit: tx["storageLimit"] as int?, amountInMicroTez: tx["amount"] as int, - feeInMicroTez: (tx["bakerFee"] as int? ?? 0) + + feeInMicroTez: + (tx["bakerFee"] as int? ?? 0) + (tx["storageFee"] as int? ?? 0) + (tx["allocationFee"] as int? ?? 0), burnedAmountInMicroTez: tx["burned"] as int?, @@ -103,7 +120,11 @@ abstract final class TezosAPI { } return txs; } catch (e, s) { - Logging.instance.e("Error occurred in TezosAPI while getting transactions for $address: ", error: e, stackTrace: s); + Logging.instance.e( + "Error occurred in TezosAPI while getting transactions for $address: ", + error: e, + stackTrace: s, + ); rethrow; } } diff --git a/lib/services/coins/tezos/api/tezos_rpc_api.dart b/lib/services/coins/tezos/api/tezos_rpc_api.dart index 688d9f68e5..67316c20ac 100644 --- a/lib/services/coins/tezos/api/tezos_rpc_api.dart +++ b/lib/services/coins/tezos/api/tezos_rpc_api.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import '../../../../app_config.dart'; import '../../../../networking/http.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/prefs.dart'; @@ -19,13 +20,16 @@ abstract final class TezosRpcAPI { final response = await _client.get( url: Uri.parse(balanceCall), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); - final balance = - BigInt.parse(response.body.substring(1, response.body.length - 2)); + final balance = BigInt.parse( + response.body.substring(1, response.body.length - 2), + ); return balance; } catch (e, s) { Logging.instance.e( @@ -47,7 +51,9 @@ abstract final class TezosRpcAPI { final response = await _client.get( url: Uri.parse(api), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); diff --git a/lib/services/ethereum/ethereum_api.dart b/lib/services/ethereum/ethereum_api.dart index fd644944a0..efffc5105b 100644 --- a/lib/services/ethereum/ethereum_api.dart +++ b/lib/services/ethereum/ethereum_api.dart @@ -10,6 +10,7 @@ import 'dart:convert'; +import '../../app_config.dart'; import '../../dto/ethereum/eth_token_tx_dto.dart'; import '../../dto/ethereum/eth_tx_dto.dart'; import '../../models/isar/models/ethereum/eth_contract.dart'; @@ -57,10 +58,11 @@ abstract class EthereumAPI { url: Uri.parse( "$stackBaseServer/export?addrs=$address&firstBlock=$firstBlock&unripe=true", ), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); if (response.code == 200) { @@ -110,10 +112,11 @@ abstract class EthereumAPI { url: Uri.parse( "$stackBaseServer/export?addrs=$address&emitter=$tokenContractAddress&logs=true", ), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); if (response.code == 200) { @@ -164,10 +167,11 @@ abstract class EthereumAPI { ); final response = await client.get( url: uri, - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); if (response.code == 200) { @@ -203,10 +207,11 @@ abstract class EthereumAPI { try { final response = await client.get( url: Uri.parse("$stackBaseServer/gas-prices"), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); if (response.code == 200) { @@ -267,10 +272,11 @@ abstract class EthereumAPI { url: Uri.parse( "$stackBaseServer/names?terms=$contractAddress&autoname=$contractAddress&all", ), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); } @@ -284,10 +290,11 @@ abstract class EthereumAPI { // "$stackBaseServer/tokens?addrs=$contractAddress&parts=all", "$stackBaseServer/names?terms=$contractAddress&all", ), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); if (response.code == 200) { @@ -371,10 +378,11 @@ abstract class EthereumAPI { url: Uri.parse( "$stackBaseServer/abis?addrs=$contractAddress&verbose=true", ), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); if (response.code == 200) { @@ -408,10 +416,11 @@ abstract class EthereumAPI { url: Uri.parse( "$stackBaseServer/state?addrs=$contractAddress&parts=proxy", ), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); if (response.code == 200) { final json = jsonDecode(response.body); diff --git a/lib/services/exchange/change_now/change_now_api.dart b/lib/services/exchange/change_now/change_now_api.dart index 7b5cd07375..870287448c 100644 --- a/lib/services/exchange/change_now/change_now_api.dart +++ b/lib/services/exchange/change_now/change_now_api.dart @@ -13,6 +13,7 @@ import 'dart:convert'; import 'package:decimal/decimal.dart'; import 'package:flutter/foundation.dart'; +import '../../../app_config.dart'; import '../../../exceptions/exchange/exchange_exception.dart'; import '../../../exceptions/exchange/pair_unavailable_exception.dart'; import '../../../external_api_keys.dart'; @@ -73,10 +74,11 @@ class ChangeNowAPI { "Content-Type": "application/json", "x-changenow-api-key": apiKey, }, - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final data = response.body; @@ -103,10 +105,11 @@ class ChangeNowAPI { "x-changenow-api-key": apiKey, }, body: jsonEncode(body), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); String? data; @@ -209,10 +212,9 @@ class ChangeNowAPI { currencies.add( Currency.fromJson( map, - rateType: - (map["supportsFixedRate"] as bool) - ? SupportedRateType.both - : SupportedRateType.estimated, + rateType: (map["supportsFixedRate"] as bool) + ? SupportedRateType.both + : SupportedRateType.estimated, exchangeName: ChangeNowExchange.exchangeName, ), ); diff --git a/lib/services/exchange/nanswap/nanswap_api.dart b/lib/services/exchange/nanswap/nanswap_api.dart index 6e2848586d..00aea8d212 100644 --- a/lib/services/exchange/nanswap/nanswap_api.dart +++ b/lib/services/exchange/nanswap/nanswap_api.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; +import '../../../app_config.dart'; import '../../../exceptions/exchange/exchange_exception.dart'; import '../../../external_api_keys.dart'; import '../../../networking/http.dart'; @@ -34,10 +35,11 @@ class NanswapAPI { final response = await _client.get( url: uri, headers: {'Accept': 'application/json'}, - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); code = response.code; @@ -66,10 +68,11 @@ class NanswapAPI { 'Accept': 'application/json', }, body: jsonEncode(body), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); code = response.code; diff --git a/lib/services/exchange/simpleswap/simpleswap_api.dart b/lib/services/exchange/simpleswap/simpleswap_api.dart index 0a532822d5..d7440121fe 100644 --- a/lib/services/exchange/simpleswap/simpleswap_api.dart +++ b/lib/services/exchange/simpleswap/simpleswap_api.dart @@ -15,6 +15,7 @@ import 'package:flutter/foundation.dart'; import 'package:tuple/tuple.dart'; import 'package:uuid/uuid.dart'; +import '../../../app_config.dart'; import '../../../exceptions/exchange/exchange_exception.dart'; import '../../../external_api_keys.dart'; import '../../../models/exchange/response_objects/fixed_rate_market.dart'; @@ -48,7 +49,9 @@ class SimpleSwapAPI { try { final response = await client.get( url: uri, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -59,22 +62,24 @@ class SimpleSwapAPI { return parsed; } catch (e, s) { - Logging.instance - .e("_makeRequest($uri) HTTP:$code threw: ", error: e, stackTrace: s); + Logging.instance.e( + "_makeRequest($uri) HTTP:$code threw: ", + error: e, + stackTrace: s, + ); rethrow; } } - Future _makePostRequest( - Uri uri, - Map body, - ) async { + Future _makePostRequest(Uri uri, Map body) async { try { final response = await client.post( url: uri, headers: {'Content-Type': 'application/json'}, body: jsonEncode(body), - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -86,11 +91,7 @@ class SimpleSwapAPI { throw Exception("response: ${response.body}"); } catch (e, s) { - Logging.instance.e( - "_makeRequest($uri) threw", - error: e, - stackTrace: s, - ); + Logging.instance.e("_makeRequest($uri) threw", error: e, stackTrace: s); rethrow; } } @@ -117,8 +118,9 @@ class SimpleSwapAPI { "extraIdTo": extraIdTo, }; - final uri = - _buildUri("/create_exchange", {"api_key": apiKey ?? kSimpleSwapApiKey}); + final uri = _buildUri("/create_exchange", { + "api_key": apiKey ?? kSimpleSwapApiKey, + }); try { final jsonObject = await _makePostRequest(uri, body); @@ -150,8 +152,11 @@ class SimpleSwapAPI { ); return ExchangeResponse(value: trade, exception: null); } catch (e, s) { - Logging.instance - .e("getAvailableCurrencies exception: ", error: e, stackTrace: s); + Logging.instance.e( + "getAvailableCurrencies exception: ", + error: e, + stackTrace: s, + ); return ExchangeResponse( exception: ExchangeException( e.toString(), @@ -166,18 +171,20 @@ class SimpleSwapAPI { String? apiKey, required bool fixedRate, }) async { - final uri = _buildUri( - "/get_all_currencies", - {"api_key": apiKey ?? kSimpleSwapApiKey}, - ); + final uri = _buildUri("/get_all_currencies", { + "api_key": apiKey ?? kSimpleSwapApiKey, + }); try { final jsonArray = await _makeGetRequest(uri); return await compute(_parseAvailableCurrenciesJson, jsonArray as List); } catch (e, s) { - Logging.instance - .e("getAvailableCurrencies exception: ", error: e, stackTrace: s); + Logging.instance.e( + "getAvailableCurrencies exception: ", + error: e, + stackTrace: s, + ); return ExchangeResponse( exception: ExchangeException( e.toString(), @@ -195,8 +202,9 @@ class SimpleSwapAPI { for (final json in jsonArray) { try { - currencies - .add(SPCurrency.fromJson(Map.from(json as Map))); + currencies.add( + SPCurrency.fromJson(Map.from(json as Map)), + ); } catch (_) { return ExchangeResponse( exception: ExchangeException( @@ -227,13 +235,10 @@ class SimpleSwapAPI { required String symbol, String? apiKey, }) async { - final uri = _buildUri( - "/get_currency", - { - "api_key": apiKey ?? kSimpleSwapApiKey, - "symbol": symbol, - }, - ); + final uri = _buildUri("/get_currency", { + "api_key": apiKey ?? kSimpleSwapApiKey, + "symbol": symbol, + }); try { final jsonObject = await _makeGetRequest(uri); @@ -244,11 +249,7 @@ class SimpleSwapAPI { ), ); } catch (e, s) { - Logging.instance.e( - "getCurrency exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("getCurrency exception", error: e, stackTrace: s); return ExchangeResponse( exception: ExchangeException( e.toString(), @@ -264,13 +265,10 @@ class SimpleSwapAPI { required bool isFixedRate, String? apiKey, }) async { - final uri = _buildUri( - "/get_all_pairs", - { - "api_key": apiKey ?? kSimpleSwapApiKey, - "fixed": isFixedRate.toString(), - }, - ); + final uri = _buildUri("/get_all_pairs", { + "api_key": apiKey ?? kSimpleSwapApiKey, + "fixed": isFixedRate.toString(), + }); try { final jsonObject = await _makeGetRequest(uri); @@ -280,11 +278,7 @@ class SimpleSwapAPI { ); return result; } catch (e, s) { - Logging.instance.e( - "getAllPairs exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("getAllPairs exception", error: e, stackTrace: s); return ExchangeResponse( exception: ExchangeException( e.toString(), @@ -347,27 +341,20 @@ class SimpleSwapAPI { required String amount, String? apiKey, }) async { - final uri = _buildUri( - "/get_estimated", - { - "api_key": apiKey ?? kSimpleSwapApiKey, - "fixed": isFixedRate.toString(), - "currency_from": currencyFrom, - "currency_to": currencyTo, - "amount": amount, - }, - ); + final uri = _buildUri("/get_estimated", { + "api_key": apiKey ?? kSimpleSwapApiKey, + "fixed": isFixedRate.toString(), + "currency_from": currencyFrom, + "currency_to": currencyTo, + "amount": amount, + }); try { final jsonObject = await _makeGetRequest(uri); return ExchangeResponse(value: jsonObject as String); } catch (e, s) { - Logging.instance.e( - "getEstimated exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("getEstimated exception", error: e, stackTrace: s); return ExchangeResponse( exception: ExchangeException( e.toString(), @@ -383,13 +370,10 @@ class SimpleSwapAPI { String? apiKey, Trade? oldTrade, }) async { - final uri = _buildUri( - "/get_exchange", - { - "api_key": apiKey ?? kSimpleSwapApiKey, - "id": exchangeId, - }, - ); + final uri = _buildUri("/get_exchange", { + "api_key": apiKey ?? kSimpleSwapApiKey, + "id": exchangeId, + }); try { final jsonObject = await _makeGetRequest(uri); @@ -423,11 +407,7 @@ class SimpleSwapAPI { return ExchangeResponse(value: trade); } catch (e, s) { - Logging.instance.e( - "getExchange exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("getExchange exception", error: e, stackTrace: s); return ExchangeResponse( exception: ExchangeException( e.toString(), @@ -444,15 +424,12 @@ class SimpleSwapAPI { required String currencyTo, String? apiKey, }) async { - final uri = _buildUri( - "/get_ranges", - { - "api_key": apiKey ?? kSimpleSwapApiKey, - "fixed": isFixedRate.toString(), - "currency_from": currencyFrom, - "currency_to": currencyTo, - }, - ); + final uri = _buildUri("/get_ranges", { + "api_key": apiKey ?? kSimpleSwapApiKey, + "fixed": isFixedRate.toString(), + "currency_from": currencyFrom, + "currency_to": currencyTo, + }); try { final jsonObject = await _makeGetRequest(uri); @@ -465,11 +442,7 @@ class SimpleSwapAPI { ), ); } catch (e, s) { - Logging.instance.e( - "getRange exception", - error: e, - stackTrace: s, - ); + Logging.instance.e("getRange exception", error: e, stackTrace: s); return ExchangeResponse( exception: ExchangeException( e.toString(), diff --git a/lib/services/exchange/trocador/trocador_api.dart b/lib/services/exchange/trocador/trocador_api.dart index 917fee3f3c..2869cef7a3 100644 --- a/lib/services/exchange/trocador/trocador_api.dart +++ b/lib/services/exchange/trocador/trocador_api.dart @@ -12,6 +12,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; +import '../../../app_config.dart'; import '../../../exceptions/exchange/exchange_exception.dart'; import '../../../networking/http.dart'; import '../../../utilities/extensions/extensions.dart'; @@ -56,10 +57,11 @@ abstract class TrocadorAPI { "Content-Type": "application/json", "API-KEY": kTrocadorApiKey, }, - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); code = response.code; @@ -99,8 +101,9 @@ abstract class TrocadorAPI { if (json is List) { final list = List>.from(json); - final List coins = - list.map((e) => TrocadorCoin.fromMap(e)).toList(); + final List coins = list + .map((e) => TrocadorCoin.fromMap(e)) + .toList(); return ExchangeResponse(value: coins); } else { diff --git a/lib/services/fusion_tor_service.dart b/lib/services/fusion_tor_service.dart index caa0ec2ee6..1ad9beb4fa 100644 --- a/lib/services/fusion_tor_service.dart +++ b/lib/services/fusion_tor_service.dart @@ -1,49 +1,18 @@ import 'dart:io'; -import 'package:tor_ffi_plugin/tor_ffi_plugin.dart'; +import '../wl_gen/generated/tor_service_impl.dart'; -import '../utilities/logger.dart'; - -class FusionTorService { - Tor? _tor; - String? _torDataDirPath; - - TorStatus get status => _tor!.status; - - /// Singleton instance of the TorService. - /// - /// Use this to access the TorService and its properties. - static final sharedInstance = FusionTorService._(); - - // private constructor for singleton - FusionTorService._(); +abstract class FusionTorService { + static FusionTorService get sharedInstance => fusionTorService; /// Getter for the proxyInfo. /// /// Throws if Tor is not connected. - ({ - InternetAddress host, - int port, - }) getProxyInfo() { - try { - return ( - host: InternetAddress.loopbackIPv4, - port: _tor!.port, - ); - } catch (_) { - throw Exception("Tor proxy info fetched while not connected!"); - } - } + ({InternetAddress host, int port}) getProxyInfo(); /// Initialize the tor ffi lib instance if it hasn't already been set. Nothing /// changes if _tor is already been set. - void init({ - required String torDataDirPath, - Tor? mockableOverride, - }) { - _tor ??= mockableOverride ?? Tor.instance; - _torDataDirPath ??= torDataDirPath; - } + void init({required String torDataDirPath}); /// Start the Tor service. /// @@ -53,17 +22,5 @@ class FusionTorService { /// service fails to start. /// /// Returns a Future that completes when the Tor service has started. - Future start() async { - if (_tor == null || _torDataDirPath == null) { - throw Exception("FusionTorService.init has not been called!"); - } - - // Start the Tor service. - try { - await _tor!.start(torDataDirPath: _torDataDirPath!); - } catch (e, s) { - Logging.instance.w("FusionTorService.start failed: ", error: e, stackTrace: s); - rethrow; - } - } + Future start(); } diff --git a/lib/services/litescribe_api.dart b/lib/services/litescribe_api.dart index 9a41f4f2b9..244043f9af 100644 --- a/lib/services/litescribe_api.dart +++ b/lib/services/litescribe_api.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import '../app_config.dart'; import '../dto/ordinals/inscription_data.dart'; import '../dto/ordinals/litescribe_response.dart'; import '../networking/http.dart'; @@ -22,7 +23,9 @@ class LitescribeAPI { Future _getResponse(String endpoint) async { final response = await client.get( url: Uri.parse('$baseUrl$endpoint'), - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); diff --git a/lib/services/monkey_service.dart b/lib/services/monkey_service.dart index 0ae745d349..bbdd49ac36 100644 --- a/lib/services/monkey_service.dart +++ b/lib/services/monkey_service.dart @@ -2,6 +2,7 @@ import 'dart:typed_data'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import '../app_config.dart'; import '../networking/http.dart'; import '../utilities/logger.dart'; import '../utilities/prefs.dart'; @@ -26,7 +27,9 @@ class MonKeyService { final response = await client.get( url: Uri.parse(url), - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -34,12 +37,14 @@ class MonKeyService { if (response.code == 200) { return Uint8List.fromList(response.bodyBytes); } else { - throw Exception( - "statusCode=${response.code} body=${response.body}", - ); + throw Exception("statusCode=${response.code} body=${response.body}"); } } catch (e, s) { - Logging.instance.e("Failed fetchMonKey($address): ", error: e, stackTrace: s); + Logging.instance.e( + "Failed fetchMonKey($address): ", + error: e, + stackTrace: s, + ); rethrow; } } diff --git a/lib/services/nano_api.dart b/lib/services/nano_api.dart index 8627b67b3f..9e425dd14b 100644 --- a/lib/services/nano_api.dart +++ b/lib/services/nano_api.dart @@ -2,16 +2,14 @@ import 'dart:convert'; import 'package:nanodart/nanodart.dart'; +import '../app_config.dart'; import '../networking/http.dart'; import '../utilities/prefs.dart'; import 'tor_service.dart'; class NanoAPI { - static Future< - ({ - NAccountInfo? accountInfo, - Exception? exception, - })> getAccountInfo({ + static Future<({NAccountInfo? accountInfo, Exception? exception})> + getAccountInfo({ required Uri server, required bool representative, required String account, @@ -31,7 +29,9 @@ class NanoAPI { "representative": "true", "account": account, }), - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -99,11 +99,7 @@ class NanoAPI { block["signature"] = signature; - final map = await postBlock( - server: server, - block: block, - headers: headers, - ); + final map = await postBlock(server: server, block: block, headers: headers); if (map is Map && map["error"] != null) { throw Exception(map["error"].toString()); @@ -129,7 +125,9 @@ class NanoAPI { "subtype": "change", "block": block, }), - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); diff --git a/lib/services/price.dart b/lib/services/price.dart index 7748271281..ee08952eeb 100644 --- a/lib/services/price.dart +++ b/lib/services/price.dart @@ -148,10 +148,11 @@ class PriceAPI { final coinGeckoResponse = await client.get( url: uri, headers: {'Content-Type': 'application/json'}, - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final coinGeckoData = jsonDecode(coinGeckoResponse.body) as List; @@ -162,10 +163,9 @@ class PriceAPI { try { final price = Decimal.parse(map["current_price"].toString()); - final change24h = - map["price_change_percentage_24h"] != null - ? double.parse(map["price_change_percentage_24h"].toString()) - : 0.0; + final change24h = map["price_change_percentage_24h"] != null + ? double.parse(map["price_change_percentage_24h"].toString()) + : 0.0; result[coin] = (value: price, change24h: change24h); } catch (_) { @@ -204,10 +204,11 @@ class PriceAPI { final response = await client.get( url: uri, headers: {'Content-Type': 'application/json'}, - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final json = jsonDecode(response.body) as List; diff --git a/lib/services/tor_service.dart b/lib/services/tor_service.dart index 542032df74..a4d43c1cf0 100644 --- a/lib/services/tor_service.dart +++ b/lib/services/tor_service.dart @@ -1,56 +1,26 @@ import 'dart:io'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:tor_ffi_plugin/tor_ffi_plugin.dart'; -import '../utilities/logger.dart'; +import '../wl_gen/generated/tor_service_impl.dart'; import 'event_bus/events/global/tor_connection_status_changed_event.dart'; -import 'event_bus/global_event_bus.dart'; -final pTorService = Provider((_) => TorService.sharedInstance); +final pTorService = Provider((_) => torService); -class TorService { - Tor? _tor; - String? _torDataDirPath; +abstract class TorService { + static TorService get sharedInstance => torService; /// Current status. Same as that fired on the event bus. - TorConnectionStatus get status => _status; - TorConnectionStatus _status = TorConnectionStatus.disconnected; - - /// Singleton instance of the TorService. - /// - /// Use this to access the TorService and its properties. - static final sharedInstance = TorService._(); - - // private constructor for singleton - TorService._(); + TorConnectionStatus get status; /// Getter for the proxyInfo. /// /// Throws if Tor is not connected. - ({ - InternetAddress host, - int port, - }) getProxyInfo() { - if (status == TorConnectionStatus.connected) { - return ( - host: InternetAddress.loopbackIPv4, - port: _tor!.port, - ); - } else { - throw Exception("Tor proxy info fetched while not connected!"); - } - } + ({InternetAddress host, int port}) getProxyInfo(); /// Initialize the tor ffi lib instance if it hasn't already been set. Nothing /// changes if _tor is already been set. - void init({ - required String torDataDirPath, - Tor? mockableOverride, - }) { - _tor ??= mockableOverride ?? Tor.instance; - _torDataDirPath ??= torDataDirPath; - } + void init({required String torDataDirPath}); /// Start the Tor service. /// @@ -60,75 +30,8 @@ class TorService { /// service fails to start. /// /// Returns a Future that completes when the Tor service has started. - Future start() async { - if (_tor == null || _torDataDirPath == null) { - throw Exception("TorService.init has not been called!"); - } - - // Start the Tor service. - try { - _updateStatusAndFireEvent( - status: TorConnectionStatus.connecting, - message: "TorService.start call in progress", - ); - - await _tor!.start(torDataDirPath: _torDataDirPath!); - - // no exception or error so we can (probably?) assume tor - // has started successfully - // Fire a TorConnectionStatusChangedEvent on the event bus. - _updateStatusAndFireEvent( - status: TorConnectionStatus.connected, - message: "TorService.start call success", - ); - - // Complete the future. - return; - } catch (e, s) { - Logging.instance.w("TorService.start failed: ", error: e, stackTrace: s); - // _enabled should already be false - - // Fire a TorConnectionStatusChangedEvent on the event bus. - _updateStatusAndFireEvent( - status: TorConnectionStatus.disconnected, - message: "TorService.start call failed", - ); - rethrow; - } - } + Future start(); /// Disable Tor. - Future disable() async { - if (_tor == null) { - throw Exception("TorService.init has not been called!"); - } - - // No need to update status and fire event if status won't change. - if (_status == TorConnectionStatus.disconnected) { - return; - } - - _tor!.disable(); - await _tor?.stop(); - - _updateStatusAndFireEvent( - status: TorConnectionStatus.disconnected, - message: "TorService.disable call success", - ); - - return; - } - - void _updateStatusAndFireEvent({ - required TorConnectionStatus status, - required String message, - }) { - _status = status; - GlobalEventBus.instance.fire( - TorConnectionStatusChangedEvent( - _status, - message, - ), - ); - } + Future disable(); } diff --git a/lib/themes/theme_service.dart b/lib/themes/theme_service.dart index 47d25a0227..04e32f6de2 100644 --- a/lib/themes/theme_service.dart +++ b/lib/themes/theme_service.dart @@ -92,12 +92,11 @@ class ThemeService { Future remove({required String themeId}) async { final themesDir = StackFileSystem.themesDir!; - final isarId = - await db.isar.stackThemes - .where() - .themeIdEqualTo(themeId) - .idProperty() - .findFirst(); + final isarId = await db.isar.stackThemes + .where() + .themeIdEqualTo(themeId) + .idProperty() + .findFirst(); if (isarId != null) { await db.isar.writeTxn(() async { await db.isar.stackThemes.delete(isarId); @@ -149,8 +148,10 @@ class ThemeService { // TODO more thorough check/verification of theme Future verifyInstalled({required String themeId}) async { - final theme = - await db.isar.stackThemes.where().themeIdEqualTo(themeId).findFirst(); + final theme = await db.isar.stackThemes + .where() + .themeIdEqualTo(themeId) + .findFirst(); if (theme != null) { try { theme.assets; @@ -159,10 +160,12 @@ class ThemeService { } final themesDir = StackFileSystem.themesDir!; - final jsonFileExists = - await File("${themesDir.path}/$themeId/theme.json").exists(); - final assetsDirExists = - await Directory("${themesDir.path}/$themeId/assets").exists(); + final jsonFileExists = await File( + "${themesDir.path}/$themeId/theme.json", + ).exists(); + final assetsDirExists = await Directory( + "${themesDir.path}/$themeId/assets", + ).exists(); if (!jsonFileExists || !assetsDirExists) { Logging.instance.w( @@ -181,19 +184,19 @@ class ThemeService { try { final response = await client.get( url: Uri.parse("$baseServerUrl/themes"), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final jsonList = jsonDecode(response.body) as List; - final result = - List>.from(jsonList) - .map((e) => StackThemeMetaData.fromMap(e)) - .where((e) => e.id != "light" && e.id != "dark") - .toList(); + final result = List>.from(jsonList) + .map((e) => StackThemeMetaData.fromMap(e)) + .where((e) => e.id != "light" && e.id != "dark") + .toList(); return result; } catch (e, s) { @@ -212,10 +215,11 @@ class ThemeService { try { final response = await client.get( url: Uri.parse("$baseServerUrl/theme/${themeMetaData.id}"), - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final bytes = Uint8List.fromList(response.bodyBytes); diff --git a/lib/utilities/connection_check/electrum_connection_check.dart b/lib/utilities/connection_check/electrum_connection_check.dart index 325cfa059e..478d5e5b3a 100644 --- a/lib/utilities/connection_check/electrum_connection_check.dart +++ b/lib/utilities/connection_check/electrum_connection_check.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:electrum_adapter/electrum_adapter.dart'; +import '../../app_config.dart'; import '../../services/event_bus/events/global/tor_connection_status_changed_event.dart'; import '../../services/tor_service.dart'; import '../logger.dart'; @@ -15,13 +16,12 @@ Future checkElectrumServer({ TorService? overrideTorService, }) async { final _prefs = overridePrefs ?? Prefs.instance; - final _torService = overrideTorService ?? TorService.sharedInstance; ({InternetAddress host, int port})? proxyInfo; try { - // If we're supposed to use Tor... - if (_prefs.useTor) { + if (AppConfig.hasFeature(AppFeature.tor) && _prefs.useTor) { + final _torService = overrideTorService ?? TorService.sharedInstance; // But Tor isn't running... if (_torService.status != TorConnectionStatus.connected) { // And the killswitch isn't set... @@ -43,29 +43,26 @@ Future checkElectrumServer({ } } - final client = await ElectrumClient.connect( - host: host, - port: port, - useSSL: useSSL && !host.endsWith('.onion'), - proxyInfo: proxyInfo, - ).timeout( + final client = + await ElectrumClient.connect( + host: host, + port: port, + useSSL: useSSL && !host.endsWith('.onion'), + proxyInfo: proxyInfo, + ).timeout( + Duration(seconds: (proxyInfo == null ? 5 : 30)), + onTimeout: () => throw Exception( + "The checkElectrumServer connect() call timed out.", + ), + ); + + await client.ping().timeout( Duration(seconds: (proxyInfo == null ? 5 : 30)), - onTimeout: () => throw Exception( - "The checkElectrumServer connect() call timed out.", - ), ); - await client - .ping() - .timeout(Duration(seconds: (proxyInfo == null ? 5 : 30))); - return true; } catch (e, s) { - Logging.instance.e( - "$e\n$s", - error: e, - stackTrace: s, - ); + Logging.instance.e("$e\n$s", error: e, stackTrace: s); return false; } } diff --git a/lib/utilities/paynym_is_api.dart b/lib/utilities/paynym_is_api.dart index f81fc855a6..9285fef7f6 100644 --- a/lib/utilities/paynym_is_api.dart +++ b/lib/utilities/paynym_is_api.dart @@ -12,6 +12,7 @@ import 'dart:convert'; import 'package:tuple/tuple.dart'; +import '../app_config.dart'; import '../models/paynym/created_paynym.dart'; import '../models/paynym/paynym_account.dart'; import '../models/paynym/paynym_claim.dart'; @@ -44,14 +45,16 @@ class PaynymIsApi { final headers = { 'Content-Type': 'application/json; charset=UTF-8', - 'content-length': - contentLength.toString(), // Set the Content-Length header. + 'content-length': contentLength + .toString(), // Set the Content-Length header. }..addAll(additionalHeaders); final response = await client.post( url: uri, headers: headers, body: jsonEncode(body), - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -414,13 +417,8 @@ class PaynymIsApi { ) async { final result = await _post( "/follow", - { - "target": target, - "signature": signature, - }, - { - "auth-token": token, - }, + {"target": target, "signature": signature}, + {"auth-token": token}, ); String message; @@ -495,13 +493,8 @@ class PaynymIsApi { ) async { final result = await _post( "/unfollow", - { - "target": target, - "signature": signature, - }, - { - "auth-token": token, - }, + {"target": target, "signature": signature}, + {"auth-token": token}, ); String message; @@ -579,14 +572,8 @@ class PaynymIsApi { ) async { final result = await _post( "/nym/add", - { - "nym": nym, - "code": code, - "signature": signature, - }, - { - "auth-token": token, - }, + {"nym": nym, "code": code, "signature": signature}, + {"auth-token": token}, ); String message; diff --git a/lib/utilities/test_epic_box_connection.dart b/lib/utilities/test_epic_box_connection.dart index 1c39390e25..89eefd4421 100644 --- a/lib/utilities/test_epic_box_connection.dart +++ b/lib/utilities/test_epic_box_connection.dart @@ -10,6 +10,7 @@ import 'dart:convert'; +import '../app_config.dart'; import '../networking/http.dart'; import '../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; import '../services/tor_service.dart'; @@ -24,7 +25,9 @@ Future _testEpicBoxNodeConnection(Uri uri) async { .get( url: uri, headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ) @@ -41,7 +44,7 @@ Future _testEpicBoxNodeConnection(Uri uri) async { return false; } } catch (e, s) { - Logging.instance.w("$e\n$s", error: e, stackTrace: s,); + Logging.instance.w("$e\n$s", error: e, stackTrace: s); return false; } } @@ -87,7 +90,7 @@ Future testEpicNodeConnection(NodeFormData data) async { return null; } } catch (e, s) { - Logging.instance.w("$e\n$s", error: e, stackTrace: s,); + Logging.instance.w("$e\n$s", error: e, stackTrace: s); return null; } } diff --git a/lib/utilities/test_mwcmqs_connection.dart b/lib/utilities/test_mwcmqs_connection.dart index c0615b25da..c199afcbf3 100644 --- a/lib/utilities/test_mwcmqs_connection.dart +++ b/lib/utilities/test_mwcmqs_connection.dart @@ -10,6 +10,7 @@ import 'dart:convert'; +import '../app_config.dart'; import '../networking/http.dart'; import '../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; import '../services/tor_service.dart'; @@ -31,10 +32,11 @@ Future _testMwcMqsNodeConnection(Uri uri) async { .get( url: uri, headers: headers, - proxyInfo: - Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ) .timeout( const Duration(milliseconds: 2000), diff --git a/lib/utilities/test_node_connection.dart b/lib/utilities/test_node_connection.dart index 8491ca3db5..b849d2ddf2 100644 --- a/lib/utilities/test_node_connection.dart +++ b/lib/utilities/test_node_connection.dart @@ -8,6 +8,7 @@ import 'package:on_chain/ada/ada.dart'; import 'package:socks5_proxy/socks.dart'; import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; +import '../app_config.dart'; import '../networking/http.dart'; import '../pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; import '../providers/global/prefs_provider.dart'; @@ -144,10 +145,11 @@ Future testNodeConnection({ case CryptonoteCurrency(): try { - final proxyInfo = - ref.read(prefsChangeNotifierProvider).useTor - ? ref.read(pTorService).getProxyInfo() - : null; + final proxyInfo = !AppConfig.hasFeature(AppFeature.tor) + ? null + : ref.read(prefsChangeNotifierProvider).useTor + ? ref.read(pTorService).getProxyInfo() + : null; final url = formData.host!; final uri = Uri.tryParse(url); @@ -232,10 +234,11 @@ Future testNodeConnection({ url: uri, headers: {"Content-Type": "application/json"}, body: jsonEncode({"action": "version"}), - proxyInfo: - ref.read(prefsChangeNotifierProvider).useTor - ? ref.read(pTorService).getProxyInfo() - : null, + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : ref.read(prefsChangeNotifierProvider).useTor + ? ref.read(pTorService).getProxyInfo() + : null, ); testPassed = response.code == 200; @@ -271,7 +274,8 @@ Future testNodeConnection({ case Cardano(): try { final client = HttpClient(); - if (ref.read(prefsChangeNotifierProvider).useTor) { + if (AppConfig.hasFeature(AppFeature.tor) && + ref.read(prefsChangeNotifierProvider).useTor) { final proxyInfo = TorService.sharedInstance.getProxyInfo(); final proxySettings = ProxySettings(proxyInfo.host, proxyInfo.port); SocksTCPClient.assignToHttpClient(client, [proxySettings]); diff --git a/lib/utilities/test_stellar_node_connection.dart b/lib/utilities/test_stellar_node_connection.dart index 2fd2f9fcc0..3af380f633 100644 --- a/lib/utilities/test_stellar_node_connection.dart +++ b/lib/utilities/test_stellar_node_connection.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:stellar_flutter_sdk/stellar_flutter_sdk.dart'; +import '../app_config.dart'; import '../networking/http.dart' as http; import '../services/tor_service.dart'; import 'prefs.dart'; @@ -14,7 +15,9 @@ Future testStellarNodeConnection(String host, int port) async { .get( url: uri, headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ) diff --git a/lib/wallets/api/tezos/tezos_api.dart b/lib/wallets/api/tezos/tezos_api.dart index 49065433e5..6bd7496cdd 100644 --- a/lib/wallets/api/tezos/tezos_api.dart +++ b/lib/wallets/api/tezos/tezos_api.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import '../../../app_config.dart'; import '../../../networking/http.dart'; import '../../../services/tor_service.dart'; import '../../../utilities/logger.dart'; @@ -17,7 +18,9 @@ abstract final class TezosAPI { final response = await _client.get( url: Uri.parse(uriString), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -25,7 +28,11 @@ abstract final class TezosAPI { final result = jsonDecode(response.body); return result as int; } catch (e, s) { - Logging.instance.e("Error occurred in TezosAPI while getting counter for $address: ", error: e, stackTrace: s); + Logging.instance.e( + "Error occurred in TezosAPI while getting counter for $address: ", + error: e, + stackTrace: s, + ); rethrow; } } @@ -39,7 +46,9 @@ abstract final class TezosAPI { final response = await _client.get( url: Uri.parse(uriString), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -50,7 +59,11 @@ abstract final class TezosAPI { return account; } catch (e, s) { - Logging.instance.e("Error occurred in TezosAPI while getting account for $address: ", error: e, stackTrace: s); + Logging.instance.e( + "Error occurred in TezosAPI while getting account for $address: ", + error: e, + stackTrace: s, + ); rethrow; } } @@ -63,7 +76,9 @@ abstract final class TezosAPI { final response = await _client.get( url: Uri.parse(transactionsCall), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); @@ -78,9 +93,10 @@ abstract final class TezosAPI { hash: tx["hash"] as String, type: tx["type"] as String, height: tx["level"] as int, - timestamp: DateTime.parse(tx["timestamp"].toString()) - .toUtc() - .millisecondsSinceEpoch ~/ + timestamp: + DateTime.parse( + tx["timestamp"].toString(), + ).toUtc().millisecondsSinceEpoch ~/ 1000, cycle: tx["cycle"] as int?, counter: tx["counter"] as int, @@ -91,7 +107,8 @@ abstract final class TezosAPI { gasUsed: tx["gasUsed"] as int, storageLimit: tx["storageLimit"] as int?, amountInMicroTez: tx["amount"] as int, - feeInMicroTez: (tx["bakerFee"] as int? ?? 0) + + feeInMicroTez: + (tx["bakerFee"] as int? ?? 0) + (tx["storageFee"] as int? ?? 0) + (tx["allocationFee"] as int? ?? 0), burnedAmountInMicroTez: tx["burned"] as int?, @@ -103,7 +120,11 @@ abstract final class TezosAPI { } return txs; } catch (e, s) { - Logging.instance.e("Error occurred in TezosAPI while getting transactions for $address: ", error: e, stackTrace: s); + Logging.instance.e( + "Error occurred in TezosAPI while getting transactions for $address: ", + error: e, + stackTrace: s, + ); rethrow; } } diff --git a/lib/wallets/api/tezos/tezos_rpc_api.dart b/lib/wallets/api/tezos/tezos_rpc_api.dart index 4f9c71fe85..721d8b0fa6 100644 --- a/lib/wallets/api/tezos/tezos_rpc_api.dart +++ b/lib/wallets/api/tezos/tezos_rpc_api.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import '../../../app_config.dart'; import '../../../networking/http.dart'; import '../../../services/tor_service.dart'; import '../../../utilities/logger.dart'; @@ -19,13 +20,16 @@ abstract final class TezosRpcAPI { final response = await _client.get( url: Uri.parse(balanceCall), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); - final balance = - BigInt.parse(response.body.substring(1, response.body.length - 2)); + final balance = BigInt.parse( + response.body.substring(1, response.body.length - 2), + ); return balance; } catch (e, s) { Logging.instance.e( @@ -47,7 +51,9 @@ abstract final class TezosRpcAPI { final response = await _client.get( url: Uri.parse(api), headers: {'Content-Type': 'application/json'}, - proxyInfo: Prefs.instance.useTor + proxyInfo: !AppConfig.hasFeature(AppFeature.tor) + ? null + : Prefs.instance.useTor ? TorService.sharedInstance.getProxyInfo() : null, ); diff --git a/lib/wallets/wallet/impl/cardano_wallet.dart b/lib/wallets/wallet/impl/cardano_wallet.dart index 93430b77bf..1583123a2b 100644 --- a/lib/wallets/wallet/impl/cardano_wallet.dart +++ b/lib/wallets/wallet/impl/cardano_wallet.dart @@ -11,6 +11,7 @@ import 'package:on_chain/ada/ada.dart'; import 'package:socks5_proxy/socks.dart'; import 'package:tuple/tuple.dart'; +import '../../../app_config.dart'; import '../../../exceptions/wallet/node_tor_mismatch_config_exception.dart'; import '../../../models/balance.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; @@ -50,11 +51,10 @@ class CardanoWallet extends Bip39Wallet { ).change(Bip44Changes.chainExt).addressIndex(0); final paymentPublicKey = shelley.bip44.publicKey.compressed; final stakePublicKey = shelley.bip44Sk.publicKey.compressed; - final addressStr = - ADABaseAddress.fromPublicKey( - basePubkeyBytes: paymentPublicKey, - stakePubkeyBytes: stakePublicKey, - ).address; + final addressStr = ADABaseAddress.fromPublicKey( + basePubkeyBytes: paymentPublicKey, + stakePubkeyBytes: stakePublicKey, + ).address; return Address( walletId: walletId, value: addressStr, @@ -214,15 +214,14 @@ class CardanoWallet extends Bip39Wallet { } final body = TransactionBody( - inputs: - listOfUtxosToBeUsed - .map( - (e) => TransactionInput( - transactionId: TransactionHash.fromHex(e.txHash), - index: e.outputIndex, - ), - ) - .toList(), + inputs: listOfUtxosToBeUsed + .map( + (e) => TransactionInput( + transactionId: TransactionHash.fromHex(e.txHash), + index: e.outputIndex, + ), + ) + .toList(), outputs: [ change, TransactionOutput( @@ -363,15 +362,14 @@ class CardanoWallet extends Bip39Wallet { ]; } final body = TransactionBody( - inputs: - listOfUtxosToBeUsed - .map( - (e) => TransactionInput( - transactionId: TransactionHash.fromHex(e.txHash), - index: e.outputIndex, - ), - ) - .toList(), + inputs: listOfUtxosToBeUsed + .map( + (e) => TransactionInput( + transactionId: TransactionHash.fromHex(e.txHash), + index: e.outputIndex, + ), + ) + .toList(), outputs: outputs, fee: txData.fee!.raw, ); @@ -582,11 +580,10 @@ class CardanoWallet extends Bip39Wallet { type: txType, subType: isar.TransactionSubType.none, amount: amount, - amountString: - Amount( - rawValue: BigInt.from(amount), - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), + amountString: Amount( + rawValue: BigInt.from(amount), + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), fee: int.parse(txInfo.fees), height: txInfo.blockHeight, isCancelled: false, @@ -606,10 +603,9 @@ class CardanoWallet extends Bip39Wallet { derivationIndex: 0, derivationPath: DerivationPath()..value = _addressDerivationPath, type: AddressType.cardanoShelley, - subType: - txType == isar.TransactionType.outgoing - ? AddressSubType.unknown - : AddressSubType.receiving, + subType: txType == isar.TransactionType.outgoing + ? AddressSubType.unknown + : AddressSubType.receiving, ); parsedTxsList.add(Tuple2(transaction, txAddress)); @@ -637,7 +633,7 @@ class CardanoWallet extends Bip39Wallet { final currentNode = getCurrentNode(); final client = HttpClient(); - if (prefs.useTor) { + if (AppConfig.hasFeature(AppFeature.tor) && prefs.useTor) { final proxyInfo = TorService.sharedInstance.getProxyInfo(); final proxySettings = ProxySettings(proxyInfo.host, proxyInfo.port); SocksTCPClient.assignToHttpClient(client, [proxySettings]); @@ -667,17 +663,19 @@ class CustomBlockForestProvider extends BlockforestProvider { BlockforestRequestParam request, [ Duration? timeout, ]) async { - if (prefs.useTor) { - if (netOption == TorPlainNetworkOption.clear) { - throw NodeTorMismatchConfigException( - message: "TOR enabled but node set to clearnet only", - ); - } - } else { - if (netOption == TorPlainNetworkOption.tor) { - throw NodeTorMismatchConfigException( - message: "TOR off but node set to TOR only", - ); + if (AppConfig.hasFeature(AppFeature.tor)) { + if (prefs.useTor) { + if (netOption == TorPlainNetworkOption.clear) { + throw NodeTorMismatchConfigException( + message: "TOR enabled but node set to clearnet only", + ); + } + } else { + if (netOption == TorPlainNetworkOption.tor) { + throw NodeTorMismatchConfigException( + message: "TOR off but node set to TOR only", + ); + } } } diff --git a/lib/wallets/wallet/impl/solana_wallet.dart b/lib/wallets/wallet/impl/solana_wallet.dart index ad88d57b90..c88d995624 100644 --- a/lib/wallets/wallet/impl/solana_wallet.dart +++ b/lib/wallets/wallet/impl/solana_wallet.dart @@ -9,6 +9,7 @@ import 'package:solana/dto.dart'; import 'package:solana/solana.dart'; import 'package:tuple/tuple.dart'; +import '../../../app_config.dart'; import '../../../exceptions/wallet/node_tor_mismatch_config_exception.dart'; import '../../../models/balance.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart' as isar; @@ -66,18 +67,19 @@ class SolanaWallet extends Bip39Wallet { final latestBlockhash = await _rpcClient?.getLatestBlockhash(); final pubKey = (await _getKeyPair()).publicKey; - final compiledMessage = Message( - instructions: [ - SystemInstruction.transfer( - fundingAccount: pubKey, - recipientAccount: pubKey, - lamports: transferAmount.raw.toInt(), - ), - ], - ).compile( - recentBlockhash: latestBlockhash!.value.blockhash, - feePayer: pubKey, - ); + final compiledMessage = + Message( + instructions: [ + SystemInstruction.transfer( + fundingAccount: pubKey, + recipientAccount: pubKey, + lamports: transferAmount.raw.toInt(), + ), + ], + ).compile( + recentBlockhash: latestBlockhash!.value.blockhash, + feePayer: pubKey, + ); final estimate = await _rpcClient?.getFeeForMessage( base64Encode(compiledMessage.toByteArray().toList()), @@ -456,10 +458,9 @@ class SolanaWallet extends Bip39Wallet { derivationIndex: 0, derivationPath: DerivationPath()..value = _addressDerivationPath, type: AddressType.solana, - subType: - txType == isar.TransactionType.outgoing - ? AddressSubType.unknown - : AddressSubType.receiving, + subType: txType == isar.TransactionType.outgoing + ? AddressSubType.unknown + : AddressSubType.receiving, ); txsList.add(Tuple2(transaction, txAddress)); @@ -526,7 +527,7 @@ class SolanaWallet extends Bip39Wallet { ) { HttpClient? httpClient; - if (prefs.useTor) { + if (AppConfig.hasFeature(AppFeature.tor) && prefs.useTor) { // Make proxied HttpClient. final proxyInfo = torService.getProxyInfo(); diff --git a/lib/wallets/wallet/impl/stellar_wallet.dart b/lib/wallets/wallet/impl/stellar_wallet.dart index dbfda5ee9e..86cc1aa026 100644 --- a/lib/wallets/wallet/impl/stellar_wallet.dart +++ b/lib/wallets/wallet/impl/stellar_wallet.dart @@ -7,6 +7,7 @@ import 'package:mutex/mutex.dart'; import 'package:socks5_proxy/socks.dart'; import 'package:stellar_flutter_sdk/stellar_flutter_sdk.dart' as stellar; +import '../../../app_config.dart'; import '../../../exceptions/wallet/node_tor_mismatch_config_exception.dart'; import '../../../models/balance.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; @@ -138,7 +139,7 @@ class StellarWallet extends Bip39Wallet { final currentNode = getCurrentNode(); HttpClient? _httpClient; - if (prefs.useTor) { + if (AppConfig.hasFeature(AppFeature.tor) && prefs.useTor) { final ({InternetAddress host, int port}) proxyInfo = TorService.sharedInstance.getProxyInfo(); diff --git a/lib/wallets/wallet/impl/tezos_wallet.dart b/lib/wallets/wallet/impl/tezos_wallet.dart index 129ade324a..5ce5bef625 100644 --- a/lib/wallets/wallet/impl/tezos_wallet.dart +++ b/lib/wallets/wallet/impl/tezos_wallet.dart @@ -5,6 +5,7 @@ import 'package:isar_community/isar.dart'; import 'package:tezart/tezart.dart' as tezart; import 'package:tuple/tuple.dart'; +import '../../../app_config.dart'; import '../../../exceptions/wallet/node_tor_mismatch_config_exception.dart'; import '../../../models/balance.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; @@ -51,8 +52,9 @@ class TezosWallet extends Bip39Wallet { // TODO: some kind of better check to see if the address has been used - final hasHistory = - (await TezosAPI.getTransactions(ks.address)).isNotEmpty; + final hasHistory = (await TezosAPI.getTransactions( + ks.address, + )).isNotEmpty; if (hasHistory) { return path; @@ -113,13 +115,14 @@ class TezosWallet extends Bip39Wallet { // print("customFee: $customFee"); // } final ({InternetAddress host, int port})? proxyInfo = - prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null; + AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null; final tezartClient = tezart.TezartClient( server, - proxy: - proxyInfo != null - ? "socks5://${proxyInfo.host}:${proxyInfo.port};" - : null, + proxy: proxyInfo != null + ? "socks5://${proxyInfo.host}:${proxyInfo.port};" + : null, ); final opList = await tezartClient.transferOperation( @@ -595,11 +598,10 @@ class TezosWallet extends Bip39Wallet { type: txType, subType: TransactionSubType.none, amount: theTx.amountInMicroTez, - amountString: - Amount( - rawValue: BigInt.from(theTx.amountInMicroTez), - fractionDigits: cryptoCurrency.fractionDigits, - ).toJsonString(), + amountString: Amount( + rawValue: BigInt.from(theTx.amountInMicroTez), + fractionDigits: cryptoCurrency.fractionDigits, + ).toJsonString(), fee: theTx.feeInMicroTez, height: theTx.height, isCancelled: false, diff --git a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart index 1d8a5da7bd..e0f17630e9 100644 --- a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart @@ -8,6 +8,7 @@ import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; +import '../../../app_config.dart'; import '../../../db/hive/db.dart'; import '../../../models/balance.dart'; import '../../../models/input.dart'; @@ -511,8 +512,8 @@ abstract class LibMoneroWallet final host = node.host.endsWith(".onion") ? node.host : Uri.parse(node.host).host; - ({InternetAddress host, int port})? proxy; - proxy = prefs.useTor && !node.forceNoTor + final ({InternetAddress host, int port})? proxy = + AppConfig.hasFeature(AppFeature.tor) && prefs.useTor && !node.forceNoTor ? TorService.sharedInstance.getProxyInfo() : null; diff --git a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart index 784e12c51d..4aa05989e6 100644 --- a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart @@ -7,6 +7,7 @@ import 'package:isar_community/isar.dart'; import 'package:mutex/mutex.dart'; import 'package:stack_wallet_backup/generate_password.dart'; +import '../../../app_config.dart'; import '../../../models/balance.dart'; import '../../../models/input.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; @@ -488,8 +489,8 @@ abstract class LibSalviumWallet final host = node.host.endsWith(".onion") ? node.host : Uri.parse(node.host).host; - ({InternetAddress host, int port})? proxy; - proxy = prefs.useTor && !node.forceNoTor + final ({InternetAddress host, int port})? proxy = + AppConfig.hasFeature(AppFeature.tor) && prefs.useTor && !node.forceNoTor ? TorService.sharedInstance.getProxyInfo() : null; diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart index 618c2b1c79..7fe44bf81e 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart @@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart'; import 'package:fusiondart/fusiondart.dart' as fusion; import 'package:isar_community/isar.dart'; +import '../../../app_config.dart'; import '../../../models/fusion_progress_ui_state.dart'; import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/transaction.dart'; @@ -340,8 +341,10 @@ mixin CashFusionInterface Future>> _getTransactionsByAddress( String address, ) async { - final txidList = - await mainDB.getTransactions(walletId).txidProperty().findAll(); + final txidList = await mainDB + .getTransactions(walletId) + .txidProperty() + .findAll(); final futures = txidList.map( (e) => electrumXCachedClient.getTransaction( @@ -391,10 +394,9 @@ mixin CashFusionInterface return []; } - final updatedAddresses = - addresses - .map((e) => e.copyWith(otherData: kReservedFusionAddress)) - .toList(); + final updatedAddresses = addresses + .map((e) => e.copyWith(otherData: kReservedFusionAddress)) + .toList(); await mainDB.isar.writeTxn(() async { for (final newAddress in updatedAddresses) { @@ -441,10 +443,9 @@ mixin CashFusionInterface ); // Initialize a list of unused reserved change addresses. - final List

unusedReservedAddresses = - unusedChangeAddresses - .where((e) => e.otherData == kReservedFusionAddress) - .toList(); + final List
unusedReservedAddresses = unusedChangeAddresses + .where((e) => e.otherData == kReservedFusionAddress) + .toList(); unusedReservedAddresses.addAll( await _reserveAddresses( @@ -476,24 +477,17 @@ mixin CashFusionInterface ); } - final changeAddresses = - await mainDB.isar.addresses - .buildQuery
( - whereClauses: [ - IndexWhereClause.equalTo( - indexName: r"walletId", - value: [walletId], - ), - ], - filter: changeAddressFilterOperation, - sortBy: [ - const SortProperty( - property: r"derivationIndex", - sort: Sort.desc, - ), - ], - ) - .findAll(); + final changeAddresses = await mainDB.isar.addresses + .buildQuery
( + whereClauses: [ + IndexWhereClause.equalTo(indexName: r"walletId", value: [walletId]), + ], + filter: changeAddressFilterOperation, + sortBy: [ + const SortProperty(property: r"derivationIndex", sort: Sort.desc), + ], + ) + .findAll(); final List
unused = []; @@ -527,12 +521,11 @@ mixin CashFusionInterface } Future _isUnused(String address) async { - final txCountInDB = - await mainDB - .getTransactions(walletId) - .filter() - .address((q) => q.valueEqualTo(address)) - .count(); + final txCountInDB = await mainDB + .getTransactions(walletId) + .filter() + .address((q) => q.valueEqualTo(address)) + .count(); if (txCountInDB == 0) { // double check via electrumx // _getTxCountForAddress can throw! @@ -603,6 +596,10 @@ mixin CashFusionInterface Future fuse({required FusionInfo fusionInfo}) async { // Initial attempt for CashFusion integration goes here. + if (!AppConfig.hasFeature(AppFeature.tor)) { + throw Exception("AppConfig has no Tor"); + } + try { _updateStatus(status: fusion.FusionStatus.reset); _updateStatus( @@ -632,15 +629,11 @@ mixin CashFusionInterface getChainHeight: fetchChainHeight, updateStatusCallback: _updateStatus, checkUtxoExists: _checkUtxoExists, - getTransactionJson: - (String txid) async => await electrumXCachedClient.getTransaction( - cryptoCurrency: info.coin, - txHash: txid, - ), + getTransactionJson: (String txid) async => await electrumXCachedClient + .getTransaction(cryptoCurrency: info.coin, txHash: txid), getPrivateKeyForPubKey: _getPrivateKeyForPubKey, - broadcastTransaction: - (String txHex) => - electrumXClient.broadcastTransaction(rawTx: txHex), + broadcastTransaction: (String txHex) => + electrumXClient.broadcastTransaction(rawTx: txHex), unReserveAddresses: (List addresses) async { final List> futures = []; for (final addr in addresses) { @@ -692,14 +685,13 @@ mixin CashFusionInterface await updateUTXOs(); // Add unfrozen stack UTXOs. - final List walletUtxos = - await mainDB - .getUTXOs(walletId) - .filter() - .isBlockedEqualTo(false) - .and() - .addressIsNotNull() - .findAll(); + final List walletUtxos = await mainDB + .getUTXOs(walletId) + .filter() + .isBlockedEqualTo(false) + .and() + .addressIsNotNull() + .findAll(); final List coinList = []; // Loop through UTXOs, checking and adding valid ones. @@ -719,24 +711,23 @@ mixin CashFusionInterface } // Fetch address to get pubkey - final addr = - await mainDB - .getAddresses(walletId) - .filter() - .anyOf< - String, - QueryBuilder - >(possibleAddresses, (q, e) => q.valueEqualTo(e)) - .and() - .group( - (q) => q - .subTypeEqualTo(AddressSubType.change) - .or() - .subTypeEqualTo(AddressSubType.receiving), - ) - .and() - .typeEqualTo(AddressType.p2pkh) - .findFirst(); + final addr = await mainDB + .getAddresses(walletId) + .filter() + .anyOf< + String, + QueryBuilder + >(possibleAddresses, (q, e) => q.valueEqualTo(e)) + .and() + .group( + (q) => q + .subTypeEqualTo(AddressSubType.change) + .or() + .subTypeEqualTo(AddressSubType.receiving), + ) + .and() + .typeEqualTo(AddressType.p2pkh) + .findFirst(); // depending on the address type in the query above this can be null if (addr == null) { diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart index f5215ed95a..b08b6bb426 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart @@ -5,6 +5,7 @@ import 'package:isar_community/isar.dart'; import 'package:nanodart/nanodart.dart'; import 'package:tuple/tuple.dart'; +import '../../../app_config.dart'; import '../../../exceptions/wallet/node_tor_mismatch_config_exception.dart'; import '../../../external_api_keys.dart'; import '../../../models/balance.dart'; @@ -53,8 +54,9 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(_kWorkServer), // this should be a headers: _buildHeaders(_kWorkServer), body: json.encode({"action": "work_generate", "hash": hash}), - proxyInfo: - prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ) .then((_httpClient) { if (_httpClient.code == 200) { @@ -119,7 +121,9 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(node.host), headers: _buildHeaders(node.host), body: infoBody, - proxyInfo: prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final infoData = jsonDecode(infoResponse.body); @@ -138,7 +142,9 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(node.host), headers: _buildHeaders(node.host), body: balanceBody, - proxyInfo: prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final balanceData = jsonDecode(balanceResponse.body); @@ -168,10 +174,9 @@ mixin NanoInterface on Bip39Wallet { final Map receiveBlock = { "type": "state", "account": publicAddress, - "previous": - openBlock - ? "0000000000000000000000000000000000000000000000000000000000000000" - : frontier, + "previous": openBlock + ? "0000000000000000000000000000000000000000000000000000000000000000" + : frontier, "representative": representative, "balance": balanceAfterTx.toString(), "link": link, @@ -216,7 +221,9 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(node.host), headers: _buildHeaders(node.host), body: processBody, - proxyInfo: prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final Map decoded = @@ -237,7 +244,9 @@ mixin NanoInterface on Bip39Wallet { "source": "true", "account": accountAddress, }), - proxyInfo: prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final receivableData = await jsonDecode(receivableResponse.body); @@ -369,7 +378,9 @@ mixin NanoInterface on Bip39Wallet { url: uri, headers: _buildHeaders(node.host), body: jsonEncode({"action": "version"}), - proxyInfo: prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); return response.code == 200; @@ -419,14 +430,17 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(node.host), headers: _buildHeaders(node.host), body: infoBody, - proxyInfo: - prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); - final String frontier = - jsonDecode(infoResponse.body)["frontier"].toString(); - final String representative = - jsonDecode(infoResponse.body)["representative"].toString(); + final String frontier = jsonDecode( + infoResponse.body, + )["frontier"].toString(); + final String representative = jsonDecode( + infoResponse.body, + )["representative"].toString(); // link = destination address: final String linkAsAccount = txData.recipients!.first.address; final String link = NanoAccounts.extractPublicKey(linkAsAccount); @@ -473,8 +487,9 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(node.host), headers: _buildHeaders(node.host), body: processBody, - proxyInfo: - prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final Map decoded = @@ -533,7 +548,9 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(node.host), headers: _buildHeaders(node.host), body: jsonEncode(body), - proxyInfo: prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); // this should really have proper type checking and error propagation but I'm out of time @@ -566,10 +583,9 @@ mixin NanoInterface on Bip39Wallet { final data = await _fetchAll(publicAddress, null, null); - final transactions = - data["history"] is List - ? data["history"] as List - : []; + final transactions = data["history"] is List + ? data["history"] as List + : []; if (transactions.isEmpty) { return; } else { @@ -607,18 +623,17 @@ mixin NanoInterface on Bip39Wallet { numberOfMessages: null, ); - final Address address = - transactionType == TransactionType.incoming - ? receivingAddress - : Address( - walletId: walletId, - publicKey: [], - value: tx["account"].toString(), - derivationIndex: 0, - derivationPath: null, - type: info.mainAddressType, - subType: AddressSubType.nonWallet, - ); + final Address address = transactionType == TransactionType.incoming + ? receivingAddress + : Address( + walletId: walletId, + publicKey: [], + value: tx["account"].toString(), + derivationIndex: 0, + derivationPath: null, + type: info.mainAddressType, + subType: AddressSubType.nonWallet, + ); final Tuple2 tuple = Tuple2(transaction, address); transactionList.add(tuple); } @@ -643,15 +658,16 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(node.host), headers: _buildHeaders(node.host), body: body, - proxyInfo: - prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final data = jsonDecode(response.body); final balance = Balance( total: Amount( rawValue: (BigInt.parse(data["balance"].toString()) + - BigInt.parse(data["receivable"].toString())), + BigInt.parse(data["receivable"].toString())), fractionDigits: cryptoCurrency.fractionDigits, ), spendable: Amount( @@ -695,8 +711,9 @@ mixin NanoInterface on Bip39Wallet { url: Uri.parse(node.host), headers: _buildHeaders(node.host), body: infoBody, - proxyInfo: - prefs.useTor ? TorService.sharedInstance.getProxyInfo() : null, + proxyInfo: AppConfig.hasFeature(AppFeature.tor) && prefs.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final infoData = jsonDecode(infoResponse.body); diff --git a/tool/wl_templates/TOR_tor_service_impl.template.dart b/tool/wl_templates/TOR_tor_service_impl.template.dart new file mode 100644 index 0000000000..3e26cafa2c --- /dev/null +++ b/tool/wl_templates/TOR_tor_service_impl.template.dart @@ -0,0 +1,185 @@ +//ON +import 'dart:io'; + +import 'package:tor_ffi_plugin/tor_ffi_plugin.dart'; + +import '../../services/event_bus/events/global/tor_connection_status_changed_event.dart'; +import '../../services/event_bus/global_event_bus.dart'; +//END_ON +import '../../services/fusion_tor_service.dart'; +import '../../services/tor_service.dart'; +//ON +import '../../utilities/logger.dart'; +//END_ON + +TorService get torService => _getInterface(); +FusionTorService get fusionTorService => _getFusionInterface(); + +//OFF +TorService _getInterface() => throw Exception("TOR not enabled!"); +FusionTorService _getFusionInterface() => throw Exception("TOR not enabled!"); + +//END_OFF +//ON +TorService _getInterface() => _TorServiceImpl(); +FusionTorService _getFusionInterface() => _FusionTorServiceImpl(); + +class _TorServiceImpl extends TorService { + Tor? _tor; + String? _torDataDirPath; + TorConnectionStatus _status = TorConnectionStatus.disconnected; + + @override + TorConnectionStatus get status => _status; + + /// Getter for the proxyInfo. + /// + /// Throws if Tor is not connected. + @override + ({InternetAddress host, int port}) getProxyInfo() { + if (status == TorConnectionStatus.connected) { + return (host: InternetAddress.loopbackIPv4, port: _tor!.port); + } else { + throw Exception("Tor proxy info fetched while not connected!"); + } + } + + /// Initialize the tor ffi lib instance if it hasn't already been set. Nothing + /// changes if _tor is already been set. + @override + void init({required String torDataDirPath, Tor? mockableOverride}) { + _tor ??= mockableOverride ?? Tor.instance; + _torDataDirPath ??= torDataDirPath; + } + + /// Start the Tor service. + /// + /// This will start the Tor service and establish a Tor circuit. + /// + /// Throws an exception if the Tor library was not inited or if the Tor + /// service fails to start. + /// + /// Returns a Future that completes when the Tor service has started. + @override + Future start() async { + if (_tor == null || _torDataDirPath == null) { + throw Exception("TorService.init has not been called!"); + } + + // Start the Tor service. + try { + _updateStatusAndFireEvent( + status: TorConnectionStatus.connecting, + message: "TorService.start call in progress", + ); + + await _tor!.start(torDataDirPath: _torDataDirPath!); + + // no exception or error so we can (probably?) assume tor + // has started successfully + // Fire a TorConnectionStatusChangedEvent on the event bus. + _updateStatusAndFireEvent( + status: TorConnectionStatus.connected, + message: "TorService.start call success", + ); + + // Complete the future. + return; + } catch (e, s) { + Logging.instance.w("TorService.start failed: ", error: e, stackTrace: s); + // _enabled should already be false + + // Fire a TorConnectionStatusChangedEvent on the event bus. + _updateStatusAndFireEvent( + status: TorConnectionStatus.disconnected, + message: "TorService.start call failed", + ); + rethrow; + } + } + + /// Disable Tor. + @override + Future disable() async { + if (_tor == null) { + throw Exception("TorService.init has not been called!"); + } + + // No need to update status and fire event if status won't change. + if (_status == TorConnectionStatus.disconnected) { + return; + } + + _tor!.disable(); + await _tor?.stop(); + + _updateStatusAndFireEvent( + status: TorConnectionStatus.disconnected, + message: "TorService.disable call success", + ); + } + + void _updateStatusAndFireEvent({ + required TorConnectionStatus status, + required String message, + }) { + _status = status; + GlobalEventBus.instance.fire( + TorConnectionStatusChangedEvent(_status, message), + ); + } +} + +class _FusionTorServiceImpl extends FusionTorService { + Tor? _tor; + String? _torDataDirPath; + + /// Getter for the proxyInfo. + /// + /// Throws if Tor is not connected. + @override + ({InternetAddress host, int port}) getProxyInfo() { + try { + return (host: InternetAddress.loopbackIPv4, port: _tor!.port); + } catch (_) { + throw Exception("Tor proxy info fetched while not connected!"); + } + } + + /// Initialize the tor ffi lib instance if it hasn't already been set. Nothing + /// changes if _tor is already been set. + @override + void init({required String torDataDirPath, Tor? mockableOverride}) { + _tor ??= mockableOverride ?? Tor.instance; + _torDataDirPath ??= torDataDirPath; + } + + /// Start the Tor service. + /// + /// This will start the Tor service and establish a Tor circuit. + /// + /// Throws an exception if the Tor library was not inited or if the Tor + /// service fails to start. + /// + /// Returns a Future that completes when the Tor service has started. + @override + Future start() async { + if (_tor == null || _torDataDirPath == null) { + throw Exception("FusionTorService.init has not been called!"); + } + + // Start the Tor service. + try { + await _tor!.start(torDataDirPath: _torDataDirPath!); + } catch (e, s) { + Logging.instance.w( + "FusionTorService.start failed: ", + error: e, + stackTrace: s, + ); + rethrow; + } + } +} + +//END_ON From cef53858e5cc14991c099e94b6b094d8d1a1f666 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 7 Oct 2025 12:10:28 -0600 Subject: [PATCH 139/178] remove unused code --- .../coins/tezos/api/tezos_account.dart | 58 -------- lib/services/coins/tezos/api/tezos_api.dart | 131 ------------------ .../coins/tezos/api/tezos_rpc_api.dart | 79 ----------- .../coins/tezos/api/tezos_transaction.dart | 43 ------ 4 files changed, 311 deletions(-) delete mode 100644 lib/services/coins/tezos/api/tezos_account.dart delete mode 100644 lib/services/coins/tezos/api/tezos_api.dart delete mode 100644 lib/services/coins/tezos/api/tezos_rpc_api.dart delete mode 100644 lib/services/coins/tezos/api/tezos_transaction.dart diff --git a/lib/services/coins/tezos/api/tezos_account.dart b/lib/services/coins/tezos/api/tezos_account.dart deleted file mode 100644 index 8bf9a9f64d..0000000000 --- a/lib/services/coins/tezos/api/tezos_account.dart +++ /dev/null @@ -1,58 +0,0 @@ -class TezosAccount { - final int id; - final String type; - final String address; - final String? publicKey; - final bool revealed; - final int balance; - final int counter; - - TezosAccount({ - required this.id, - required this.type, - required this.address, - required this.publicKey, - required this.revealed, - required this.balance, - required this.counter, - }); - - TezosAccount copyWith({ - int? id, - String? type, - String? address, - String? publicKey, - bool? revealed, - int? balance, - int? counter, - }) { - return TezosAccount( - id: id ?? this.id, - type: type ?? this.type, - address: address ?? this.address, - publicKey: publicKey ?? this.publicKey, - revealed: revealed ?? this.revealed, - balance: balance ?? this.balance, - counter: counter ?? this.counter, - ); - } - - factory TezosAccount.fromMap(Map map) { - return TezosAccount( - id: map['id'] as int, - type: map['type'] as String, - address: map['address'] as String, - publicKey: map['publicKey'] as String?, - revealed: map['revealed'] as bool, - balance: map['balance'] as int, - counter: map['counter'] as int, - ); - } - - @override - String toString() { - return 'UserData{id: $id, type: $type, address: $address, ' - 'publicKey: $publicKey, revealed: $revealed,' - ' balance: $balance, counter: $counter}'; - } -} diff --git a/lib/services/coins/tezos/api/tezos_api.dart b/lib/services/coins/tezos/api/tezos_api.dart deleted file mode 100644 index a85e6b25d1..0000000000 --- a/lib/services/coins/tezos/api/tezos_api.dart +++ /dev/null @@ -1,131 +0,0 @@ -import 'dart:convert'; - -import '../../../../app_config.dart'; -import '../../../../networking/http.dart'; -import '../../../../utilities/logger.dart'; -import '../../../../utilities/prefs.dart'; -import '../../../tor_service.dart'; -import 'tezos_account.dart'; -import 'tezos_transaction.dart'; - -abstract final class TezosAPI { - static final HTTP _client = HTTP(); - static const String _baseURL = 'https://api.tzkt.io'; - - static Future getCounter(String address) async { - try { - final uriString = "$_baseURL/v1/accounts/$address/counter"; - final response = await _client.get( - url: Uri.parse(uriString), - headers: {'Content-Type': 'application/json'}, - proxyInfo: !AppConfig.hasFeature(AppFeature.tor) - ? null - : Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, - ); - - final result = jsonDecode(response.body); - return result as int; - } catch (e, s) { - Logging.instance.e( - "Error occurred in TezosAPI while getting counter for $address: ", - error: e, - stackTrace: s, - ); - rethrow; - } - } - - static Future getAccount( - String address, { - String type = "user", - }) async { - try { - final uriString = "$_baseURL/v1/accounts/$address?legacy=false"; - final response = await _client.get( - url: Uri.parse(uriString), - headers: {'Content-Type': 'application/json'}, - proxyInfo: !AppConfig.hasFeature(AppFeature.tor) - ? null - : Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, - ); - - final result = jsonDecode(response.body) as Map; - - final account = TezosAccount.fromMap(Map.from(result)); - - return account; - } catch (e, s) { - Logging.instance.e( - "Error occurred in TezosAPI while getting account for $address: ", - error: e, - stackTrace: s, - ); - rethrow; - } - } - - static Future> getTransactions(String address) async { - try { - final transactionsCall = - "$_baseURL/v1/accounts/$address/operations?type=transaction"; - - final response = await _client.get( - url: Uri.parse(transactionsCall), - headers: {'Content-Type': 'application/json'}, - proxyInfo: !AppConfig.hasFeature(AppFeature.tor) - ? null - : Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, - ); - - final result = jsonDecode(response.body) as List; - - final List txs = []; - for (final tx in result) { - if (tx["type"] == "transaction") { - final theTx = TezosTransaction( - id: tx["id"] as int, - hash: tx["hash"] as String, - type: tx["type"] as String, - height: tx["level"] as int, - timestamp: - DateTime.parse( - tx["timestamp"].toString(), - ).toUtc().millisecondsSinceEpoch ~/ - 1000, - cycle: tx["cycle"] as int?, - counter: tx["counter"] as int, - opN: tx["op_n"] as int?, - opP: tx["op_p"] as int?, - status: tx["status"] as String, - gasLimit: tx["gasLimit"] as int, - gasUsed: tx["gasUsed"] as int, - storageLimit: tx["storageLimit"] as int?, - amountInMicroTez: tx["amount"] as int, - feeInMicroTez: - (tx["bakerFee"] as int? ?? 0) + - (tx["storageFee"] as int? ?? 0) + - (tx["allocationFee"] as int? ?? 0), - burnedAmountInMicroTez: tx["burned"] as int?, - senderAddress: tx["sender"]["address"] as String, - receiverAddress: tx["target"]["address"] as String, - ); - txs.add(theTx); - } - } - return txs; - } catch (e, s) { - Logging.instance.e( - "Error occurred in TezosAPI while getting transactions for $address: ", - error: e, - stackTrace: s, - ); - rethrow; - } - } -} diff --git a/lib/services/coins/tezos/api/tezos_rpc_api.dart b/lib/services/coins/tezos/api/tezos_rpc_api.dart deleted file mode 100644 index 67316c20ac..0000000000 --- a/lib/services/coins/tezos/api/tezos_rpc_api.dart +++ /dev/null @@ -1,79 +0,0 @@ -import 'dart:convert'; - -import '../../../../app_config.dart'; -import '../../../../networking/http.dart'; -import '../../../../utilities/logger.dart'; -import '../../../../utilities/prefs.dart'; -import '../../../tor_service.dart'; - -abstract final class TezosRpcAPI { - static final HTTP _client = HTTP(); - - static Future getBalance({ - required ({String host, int port}) nodeInfo, - required String address, - }) async { - try { - final String balanceCall = - "${nodeInfo.host}:${nodeInfo.port}/chains/main/blocks/head/context/contracts/$address/balance"; - - final response = await _client.get( - url: Uri.parse(balanceCall), - headers: {'Content-Type': 'application/json'}, - proxyInfo: !AppConfig.hasFeature(AppFeature.tor) - ? null - : Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, - ); - - final balance = BigInt.parse( - response.body.substring(1, response.body.length - 2), - ); - return balance; - } catch (e, s) { - Logging.instance.e( - "Error occurred in tezos_rpc_api.dart while getting balance for $address", - error: e, - stackTrace: s, - ); - } - return null; - } - - static Future getChainHeight({ - required ({String host, int port}) nodeInfo, - }) async { - try { - final api = - "${nodeInfo.host}:${nodeInfo.port}/chains/main/blocks/head/header/shell"; - - final response = await _client.get( - url: Uri.parse(api), - headers: {'Content-Type': 'application/json'}, - proxyInfo: !AppConfig.hasFeature(AppFeature.tor) - ? null - : Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, - ); - - final jsonParsedResponse = jsonDecode(response.body); - return int.parse(jsonParsedResponse["level"].toString()); - } catch (e, s) { - Logging.instance.e( - "Error occurred in tezos_rpc_api.dart while getting chain height for tezos", - error: e, - stackTrace: s, - ); - } - return null; - } - - static Future testNetworkConnection({ - required ({String host, int port}) nodeInfo, - }) async { - final result = await getChainHeight(nodeInfo: nodeInfo); - return result != null; - } -} diff --git a/lib/services/coins/tezos/api/tezos_transaction.dart b/lib/services/coins/tezos/api/tezos_transaction.dart deleted file mode 100644 index e1e6bc88b8..0000000000 --- a/lib/services/coins/tezos/api/tezos_transaction.dart +++ /dev/null @@ -1,43 +0,0 @@ -class TezosTransaction { - final int? id; - final String hash; - final String? type; - final int height; - final int timestamp; - final int? cycle; - final int? counter; - final int? opN; - final int? opP; - final String? status; - final bool? isSuccess; - final int? gasLimit; - final int? gasUsed; - final int? storageLimit; - final int amountInMicroTez; - final int feeInMicroTez; - final int? burnedAmountInMicroTez; - final String senderAddress; - final String receiverAddress; - - TezosTransaction({ - this.id, - required this.hash, - this.type, - required this.height, - required this.timestamp, - this.cycle, - this.counter, - this.opN, - this.opP, - this.status, - this.isSuccess, - this.gasLimit, - this.gasUsed, - this.storageLimit, - required this.amountInMicroTez, - required this.feeInMicroTez, - this.burnedAmountInMicroTez, - required this.senderAddress, - required this.receiverAddress, - }); -} From 661e3f8668e0a99b2726c24ed5758497faf7b969 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 7 Oct 2025 12:42:29 -0600 Subject: [PATCH 140/178] fix missed xelis import --- lib/utilities/test_node_connection.dart | 21 +++++-------------- .../interfaces/lib_xelis_interface.dart | 2 ++ ...XEL_lib_xelis_interface_impl.template.dart | 18 ++++++++++++++++ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/lib/utilities/test_node_connection.dart b/lib/utilities/test_node_connection.dart index b849d2ddf2..c6b5ee00dd 100644 --- a/lib/utilities/test_node_connection.dart +++ b/lib/utilities/test_node_connection.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:on_chain/ada/ada.dart'; import 'package:socks5_proxy/socks.dart'; -import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk; import '../app_config.dart'; import '../networking/http.dart'; @@ -20,6 +19,7 @@ import '../wallets/crypto_currency/interfaces/electrumx_currency_interface.dart' import '../wallets/crypto_currency/intermediate/cryptonote_currency.dart'; import '../wallets/crypto_currency/intermediate/nano_currency.dart'; import '../wallets/wallet/impl/solana_wallet.dart'; +import '../wl_gen/interfaces/lib_xelis_interface.dart'; import 'connection_check/electrum_connection_check.dart'; import 'logger.dart'; import 'test_epic_box_connection.dart'; @@ -301,22 +301,11 @@ Future testNodeConnection({ case Xelis(): try { - final daemon = xelis_sdk.DaemonClient( - endPoint: "${formData.host!}:${formData.port!}", - secureWebSocket: formData.useSSL ?? false, - timeout: 5000, - ); - daemon.connect(); - - final xelis_sdk.GetInfoResult networkInfo = await daemon.getInfo(); - testPassed = networkInfo.height != null; - - daemon.disconnect(); - - Logging.instance.i( - "Xelis testNodeConnection result: \"${networkInfo.toString()}\"", + testPassed = await libXelis.testDaemonConnection( + "${formData.host!}:${formData.port!}", + formData.useSSL ?? false, ); - } catch (e, s) { + } catch (_) { testPassed = false; } break; diff --git a/lib/wl_gen/interfaces/lib_xelis_interface.dart b/lib/wl_gen/interfaces/lib_xelis_interface.dart index 533b90f901..1fc28f8d59 100644 --- a/lib/wl_gen/interfaces/lib_xelis_interface.dart +++ b/lib/wl_gen/interfaces/lib_xelis_interface.dart @@ -89,6 +89,8 @@ abstract class LibXelisInterface { Future getXelisBalanceRaw(String walletId); Future hasXelisBalance(String walletId); + + Future testDaemonConnection(String endPoint, bool useSSL); } // ============================================================================= diff --git a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart index 08f1f9b4aa..8115f82493 100644 --- a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart +++ b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart @@ -329,6 +329,24 @@ final class _MwebdServerInterfaceImpl extends LibXelisInterface { @override Future hasXelisBalance(String walletId) => _wallets[walletId]!.hasXelisBalance(); + + @override + Future testDaemonConnection(String endPoint, bool useSSL) async { + final daemon = xelis_sdk.DaemonClient( + endPoint: endPoint, + secureWebSocket: useSSL, + timeout: 5000, + ); + daemon.connect(); + final xelis_sdk.GetInfoResult networkInfo = await daemon.getInfo(); + daemon.disconnect(); + + Logging.instance.i( + "Xelis testNodeConnection result: \"${networkInfo.toString()}\"", + ); + + return networkInfo.height != null; + } } extension _XelisNetworkConversion on CryptoCurrencyNetwork { From 747d753c5ab9242359f94f826829b7b891f5b57b Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 7 Oct 2025 13:49:59 -0600 Subject: [PATCH 141/178] fix missing coin checks in main.dart --- lib/main.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 4de72171e0..968d595765 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -87,7 +87,9 @@ final openedFromSWBFileStringStateProvider = StateProvider( // miscellaneous box for later use void main(List args) async { // talker.info('initializing Rust lib ...'); - await libXelis.initRustLib(); + if (AppConfig.coins.whereType().isNotEmpty) { + await libXelis.initRustLib(); + } WidgetsFlutterBinding.ensureInitialized(); if (Util.isDesktop && args.length == 2 && args.first == "-d") { @@ -159,7 +161,10 @@ void main(List args) async { DB.instance.hive.registerAdapter(lib_monero_compat.WalletTypeAdapter()); - csMonero.setUseCsMoneroLoggerInternal(kDebugMode); + if (AppConfig.coins.whereType().isNotEmpty || + AppConfig.coins.whereType().isNotEmpty) { + csMonero.setUseCsMoneroLoggerInternal(kDebugMode); + } DB.instance.hive.init( (await StackFileSystem.applicationHiveDirectory()).path, @@ -175,8 +180,10 @@ void main(List args) async { debugConsoleLevel: kDebugMode ? Level.trace : null, ); - await libXelis.setupRustLogger(); - libXelis.startListeningToRustLogs(); + if (AppConfig.coins.whereType().isNotEmpty) { + await libXelis.setupRustLogger(); + libXelis.startListeningToRustLogs(); + } // setup lib spark logging initSparkLogging(Prefs.instance.logLevel); From 9fd474dc1d36eefc0c32823127a8149423907d12 Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 7 Oct 2025 14:02:31 -0600 Subject: [PATCH 142/178] update ios build files --- ios/.gitignore | 1 + ios/Podfile.lock | 257 ------------------ .../xcshareddata/xcschemes/Runner.xcscheme | 2 + ios/Runner/AppDelegate.swift | 2 - ios/Runner/Runner-Bridging-Header.h | 3 +- .../ios/Runner.xcodeproj/project.pbxproj | 34 --- 6 files changed, 4 insertions(+), 295 deletions(-) delete mode 100644 ios/Podfile.lock diff --git a/ios/.gitignore b/ios/.gitignore index c079131814..09ddc3777c 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -26,6 +26,7 @@ Flutter/flutter_assets/ Flutter/flutter_export_environment.sh ServiceDefinitions.json Runner/GeneratedPluginRegistrant.* +Podfile.lock # Exceptions to above rules. !default.mode1v3 diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 3f6bee8e73..0000000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,257 +0,0 @@ -PODS: - - barcode_scan2 (0.0.1): - - Flutter - - MTBBarcodeScanner - - SwiftProtobuf - - coinlib_flutter (0.5.0): - - Flutter - - FlutterMacOS - - connectivity_plus (0.0.1): - - Flutter - - ReachabilitySwift - - cs_monero_flutter_libs_ios (0.0.1): - - Flutter - - cs_salvium_flutter_libs_ios (0.0.1): - - Flutter - - device_info_plus (0.0.1): - - Flutter - - devicelocale (0.0.1): - - Flutter - - DKImagePickerController/Core (4.3.4): - - DKImagePickerController/ImageDataManager - - DKImagePickerController/Resource - - DKImagePickerController/ImageDataManager (4.3.4) - - DKImagePickerController/PhotoGallery (4.3.4): - - DKImagePickerController/Core - - DKPhotoGallery - - DKImagePickerController/Resource (4.3.4) - - DKPhotoGallery (0.0.17): - - DKPhotoGallery/Core (= 0.0.17) - - DKPhotoGallery/Model (= 0.0.17) - - DKPhotoGallery/Preview (= 0.0.17) - - DKPhotoGallery/Resource (= 0.0.17) - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Core (0.0.17): - - DKPhotoGallery/Model - - DKPhotoGallery/Preview - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Model (0.0.17): - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Preview (0.0.17): - - DKPhotoGallery/Model - - DKPhotoGallery/Resource - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Resource (0.0.17): - - SDWebImage - - SwiftyGif - - file_picker (0.0.1): - - DKImagePickerController/PhotoGallery - - Flutter - - Flutter (1.0.0) - - flutter_libepiccash (0.0.1): - - Flutter - - flutter_libsparkmobile (0.0.1): - - Flutter - - flutter_local_notifications (0.0.1): - - Flutter - - flutter_native_splash (0.0.1): - - Flutter - - flutter_secure_storage (6.0.0): - - Flutter - - frostdart (0.0.1) - - integration_test (0.0.1): - - Flutter - - isar_flutter_libs (1.0.0): - - Flutter - - local_auth_darwin (0.0.1): - - Flutter - - FlutterMacOS - - MTBBarcodeScanner (5.0.11) - - package_info_plus (0.4.5): - - Flutter - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - permission_handler_apple (9.3.0): - - Flutter - - ReachabilitySwift (5.0.0) - - SDWebImage (5.13.2): - - SDWebImage/Core (= 5.13.2) - - SDWebImage/Core (5.13.2) - - share_plus (0.0.1): - - Flutter - - "sqlite3 (3.46.0+1)": - - "sqlite3/common (= 3.46.0+1)" - - "sqlite3/common (3.46.0+1)" - - "sqlite3/dbstatvtab (3.46.0+1)": - - sqlite3/common - - "sqlite3/fts5 (3.46.0+1)": - - sqlite3/common - - "sqlite3/perf-threadsafe (3.46.0+1)": - - sqlite3/common - - "sqlite3/rtree (3.46.0+1)": - - sqlite3/common - - sqlite3_flutter_libs (0.0.1): - - Flutter - - "sqlite3 (~> 3.46.0+1)" - - sqlite3/dbstatvtab - - sqlite3/fts5 - - sqlite3/perf-threadsafe - - sqlite3/rtree - - stack_wallet_backup (0.0.1): - - Flutter - - SwiftProtobuf (1.19.0) - - SwiftyGif (5.4.3) - - tor_ffi_plugin (0.0.1): - - Flutter - - url_launcher_ios (0.0.1): - - Flutter - - wakelock_plus (0.0.1): - - Flutter - - xelis_flutter (0.0.1): - - Flutter - -DEPENDENCIES: - - barcode_scan2 (from `.symlinks/plugins/barcode_scan2/ios`) - - coinlib_flutter (from `.symlinks/plugins/coinlib_flutter/darwin`) - - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - - cs_monero_flutter_libs_ios (from `.symlinks/plugins/cs_monero_flutter_libs_ios/ios`) - - cs_salvium_flutter_libs_ios (from `.symlinks/plugins/cs_salvium_flutter_libs_ios/ios`) - - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - - devicelocale (from `.symlinks/plugins/devicelocale/ios`) - - file_picker (from `.symlinks/plugins/file_picker/ios`) - - Flutter (from `Flutter`) - - flutter_libepiccash (from `.symlinks/plugins/flutter_libepiccash/ios`) - - flutter_libsparkmobile (from `.symlinks/plugins/flutter_libsparkmobile/ios`) - - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - - frostdart (from `.symlinks/plugins/frostdart/ios`) - - integration_test (from `.symlinks/plugins/integration_test/ios`) - - isar_flutter_libs (from `.symlinks/plugins/isar_flutter_libs/ios`) - - local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`) - - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - - share_plus (from `.symlinks/plugins/share_plus/ios`) - - sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`) - - stack_wallet_backup (from `.symlinks/plugins/stack_wallet_backup/ios`) - - tor_ffi_plugin (from `.symlinks/plugins/tor_ffi_plugin/ios`) - - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`) - - xelis_flutter (from `.symlinks/plugins/xelis_flutter/ios`) - -SPEC REPOS: - trunk: - - DKImagePickerController - - DKPhotoGallery - - MTBBarcodeScanner - - ReachabilitySwift - - SDWebImage - - sqlite3 - - SwiftProtobuf - - SwiftyGif - -EXTERNAL SOURCES: - barcode_scan2: - :path: ".symlinks/plugins/barcode_scan2/ios" - coinlib_flutter: - :path: ".symlinks/plugins/coinlib_flutter/darwin" - connectivity_plus: - :path: ".symlinks/plugins/connectivity_plus/ios" - cs_monero_flutter_libs_ios: - :path: ".symlinks/plugins/cs_monero_flutter_libs_ios/ios" - cs_salvium_flutter_libs_ios: - :path: ".symlinks/plugins/cs_salvium_flutter_libs_ios/ios" - device_info_plus: - :path: ".symlinks/plugins/device_info_plus/ios" - devicelocale: - :path: ".symlinks/plugins/devicelocale/ios" - file_picker: - :path: ".symlinks/plugins/file_picker/ios" - Flutter: - :path: Flutter - flutter_libepiccash: - :path: ".symlinks/plugins/flutter_libepiccash/ios" - flutter_libsparkmobile: - :path: ".symlinks/plugins/flutter_libsparkmobile/ios" - flutter_local_notifications: - :path: ".symlinks/plugins/flutter_local_notifications/ios" - flutter_native_splash: - :path: ".symlinks/plugins/flutter_native_splash/ios" - flutter_secure_storage: - :path: ".symlinks/plugins/flutter_secure_storage/ios" - frostdart: - :path: ".symlinks/plugins/frostdart/ios" - integration_test: - :path: ".symlinks/plugins/integration_test/ios" - isar_flutter_libs: - :path: ".symlinks/plugins/isar_flutter_libs/ios" - local_auth_darwin: - :path: ".symlinks/plugins/local_auth_darwin/darwin" - package_info_plus: - :path: ".symlinks/plugins/package_info_plus/ios" - path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/darwin" - permission_handler_apple: - :path: ".symlinks/plugins/permission_handler_apple/ios" - share_plus: - :path: ".symlinks/plugins/share_plus/ios" - sqlite3_flutter_libs: - :path: ".symlinks/plugins/sqlite3_flutter_libs/ios" - stack_wallet_backup: - :path: ".symlinks/plugins/stack_wallet_backup/ios" - tor_ffi_plugin: - :path: ".symlinks/plugins/tor_ffi_plugin/ios" - url_launcher_ios: - :path: ".symlinks/plugins/url_launcher_ios/ios" - wakelock_plus: - :path: ".symlinks/plugins/wakelock_plus/ios" - xelis_flutter: - :path: ".symlinks/plugins/xelis_flutter/ios" - -SPEC CHECKSUMS: - barcode_scan2: 0af2bb63c81b4565aab6cd78278e4c0fa136dbb0 - coinlib_flutter: 9275e8255ef67d3da33beb6e117d09ced4f46eb5 - connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a - cs_monero_flutter_libs_ios: fd353631682247f72a36493ff060d4328d6f720d - cs_salvium_flutter_libs_ios: f9d6ce540cb34d8cb8641822cf02fa0695a8d405 - device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d - devicelocale: 35ba84dc7f45f527c3001535d8c8d104edd5d926 - DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac - DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 - file_picker: b159e0c068aef54932bb15dc9fd1571818edaf49 - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - flutter_libepiccash: 36241aa7d3126f6521529985ccb3dc5eaf7bb317 - flutter_libsparkmobile: 6373955cc3327a926d17059e7405dde2fb12f99f - flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 - flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef - flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be - frostdart: 4c72b69ccac2f13ede744107db046a125acce597 - integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573 - isar_flutter_libs: fdf730ca925d05687f36d7f1d355e482529ed097 - local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3 - MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb - package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4 - path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 - ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - SDWebImage: 72f86271a6f3139cc7e4a89220946489d4b9a866 - share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5 - sqlite3: 292c3e1bfe89f64e51ea7fc7dab9182a017c8630 - sqlite3_flutter_libs: c00457ebd31e59fa6bb830380ddba24d44fbcd3b - stack_wallet_backup: 5b8563aba5d8ffbf2ce1944331ff7294a0ec7c03 - SwiftProtobuf: 6ef3f0e422ef90d6605ca20b21a94f6c1324d6b3 - SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780 - tor_ffi_plugin: d80e291b649379c8176e1be739e49be007d4ef93 - url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe - wakelock_plus: 373cfe59b235a6dd5837d0fb88791d2f13a90d56 - xelis_flutter: a6a1ee1f1e47f5aeb42dc4a5889358b79d8d90fc - -PODFILE CHECKSUM: 57c8aed26fba39d3ec9424816221f294a07c58eb - -COCOAPODS: 1.16.2 diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c53e2b314e..9c12df59c6 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> Bool { - let dummy = get_mnemonic() - print(dummy) var flutter_native_splash = 1 UIApplication.shared.isStatusBarHidden = false diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h index d95502a5f1..7335fdf900 100644 --- a/ios/Runner/Runner-Bridging-Header.h +++ b/ios/Runner/Runner-Bridging-Header.h @@ -1,2 +1 @@ -#import "GeneratedPluginRegistrant.h" -#import "libepic_cash_wallet.h" \ No newline at end of file +#import "GeneratedPluginRegistrant.h" \ No newline at end of file diff --git a/scripts/app_config/templates/ios/Runner.xcodeproj/project.pbxproj b/scripts/app_config/templates/ios/Runner.xcodeproj/project.pbxproj index 300249f377..febbbb8af7 100644 --- a/scripts/app_config/templates/ios/Runner.xcodeproj/project.pbxproj +++ b/scripts/app_config/templates/ios/Runner.xcodeproj/project.pbxproj @@ -10,8 +10,6 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 7E1603B5288D73EA002F7A6F /* libepic_cash_wallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E8A4F06288D5A9300F18717 /* libepic_cash_wallet.a */; }; - 7E729AE82893C1B1009BBD65 /* flutter_libepiccash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E1603B3288D734C002F7A6F /* flutter_libepiccash.framework */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -28,15 +26,6 @@ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7E1603B3288D734C002F7A6F /* flutter_libepiccash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = flutter_libepiccash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7E8A4F02288D57DE00F18717 /* flutter_libepiccash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = flutter_libepiccash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7E8A4F06288D5A9300F18717 /* libepic_cash_wallet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libepic_cash_wallet.a; path = ../crypto_plugins/flutter_libepiccash/ios/libs/libepic_cash_wallet.a; sourceTree = ""; }; - 7E8A4F09288D5E8F00F18717 /* flutter_libepiccash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = flutter_libepiccash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7E8A4F0D288D5F3900F18717 /* flutter_libepiccash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = flutter_libepiccash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7E8A4F10288D602C00F18717 /* flutter_libepiccash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = flutter_libepiccash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7E8A4F15288D645200F18717 /* flutter_libepiccash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = flutter_libepiccash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7E8A4F19288D721300F18717 /* flutter_libepiccash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = flutter_libepiccash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7E8A4F1D288D72D100F18717 /* flutter_libepiccash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = flutter_libepiccash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -55,8 +44,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7E1603B5288D73EA002F7A6F /* libepic_cash_wallet.a in Frameworks */, - 7E729AE82893C1B1009BBD65 /* flutter_libepiccash.framework in Frameworks */, B49D91439948369648AB0603 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -77,15 +64,6 @@ 911C8C3F49E7889A970A9600 /* Frameworks */ = { isa = PBXGroup; children = ( - 7E1603B3288D734C002F7A6F /* flutter_libepiccash.framework */, - 7E8A4F1D288D72D100F18717 /* flutter_libepiccash.framework */, - 7E8A4F19288D721300F18717 /* flutter_libepiccash.framework */, - 7E8A4F15288D645200F18717 /* flutter_libepiccash.framework */, - 7E8A4F10288D602C00F18717 /* flutter_libepiccash.framework */, - 7E8A4F0D288D5F3900F18717 /* flutter_libepiccash.framework */, - 7E8A4F09288D5E8F00F18717 /* flutter_libepiccash.framework */, - 7E8A4F06288D5A9300F18717 /* libepic_cash_wallet.a */, - 7E8A4F02288D57DE00F18717 /* flutter_libepiccash.framework */, 51604430FD0FD1FA5C4767A0 /* Pods_Runner.framework */, ); name = Frameworks; @@ -493,7 +471,6 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity/connectivity.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/cryptography_flutter/cryptography_flutter.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale/devicelocale.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash/flutter_libepiccash.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libmonero/flutter_libmonero.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications/flutter_local_notifications.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_native_splash/flutter_native_splash.framework/Headers\"", @@ -508,7 +485,6 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup/stack_wallet_backup.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_ios/url_launcher_ios.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock/wakelock.framework/Headers\"", - "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/include", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -519,7 +495,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", - "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; ONLY_ACTIVE_ARCH = NO; @@ -530,7 +505,6 @@ STRIP_STYLE = "non-global"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; - SYSTEM_HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/linclude/\""; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_WORKSPACE = NO; VERSIONING_SYSTEM = "apple-generic"; @@ -673,7 +647,6 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity/connectivity.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/cryptography_flutter/cryptography_flutter.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale/devicelocale.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash/flutter_libepiccash.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libmonero/flutter_libmonero.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications/flutter_local_notifications.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_native_splash/flutter_native_splash.framework/Headers\"", @@ -688,7 +661,6 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup/stack_wallet_backup.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_ios/url_launcher_ios.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock/wakelock.framework/Headers\"", - "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/include", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -699,7 +671,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", - "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; ONLY_ACTIVE_ARCH = NO; @@ -711,7 +682,6 @@ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - SYSTEM_HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/linclude/\""; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_WORKSPACE = NO; VERSIONING_SYSTEM = "apple-generic"; @@ -745,7 +715,6 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity/connectivity.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/cryptography_flutter/cryptography_flutter.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale/devicelocale.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash/flutter_libepiccash.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libmonero/flutter_libmonero.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications/flutter_local_notifications.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_native_splash/flutter_native_splash.framework/Headers\"", @@ -760,7 +729,6 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup/stack_wallet_backup.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_ios/url_launcher_ios.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock/wakelock.framework/Headers\"", - "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/include", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -771,7 +739,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", - "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; ONLY_ACTIVE_ARCH = NO; @@ -782,7 +749,6 @@ STRIP_STYLE = "non-global"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; - SYSTEM_HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/linclude/\""; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_WORKSPACE = NO; VERSIONING_SYSTEM = "apple-generic"; From a734654c0af5b81441daa2496decdf4f9fcdf6df Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 7 Oct 2025 14:14:00 -0600 Subject: [PATCH 143/178] update gitignore --- .gitignore | 9 ++- linux/flutter/generated_plugin_registrant.cc | 59 ------------------- linux/flutter/generated_plugins.cmake | 42 ------------- macos/Flutter/GeneratedPluginRegistrant.swift | 56 ------------------ .../flutter/generated_plugin_registrant.cc | 59 ------------------- windows/flutter/generated_plugins.cmake | 45 -------------- 6 files changed, 8 insertions(+), 262 deletions(-) delete mode 100644 linux/flutter/generated_plugin_registrant.cc delete mode 100644 linux/flutter/generated_plugins.cmake delete mode 100644 macos/Flutter/GeneratedPluginRegistrant.swift delete mode 100644 windows/flutter/generated_plugin_registrant.cc delete mode 100644 windows/flutter/generated_plugins.cmake diff --git a/.gitignore b/.gitignore index e360da5157..0a8db4dcc3 100644 --- a/.gitignore +++ b/.gitignore @@ -114,4 +114,11 @@ crypto_plugins/*.diff /devtools_options.yaml # generated interfaces -lib/wl_gen/generated/ \ No newline at end of file +lib/wl_gen/generated/ + +# normally these aren't ignored but WL changes them... +/linux/flutter/generated_plugin_registrant.cc +/windows/flutter/generated_plugin_registrant.cc +/linux/flutter/generated_plugins.cmake +/windows/flutter/generated_plugins.cmake +/macos/Flutter/GeneratedPluginRegistrant.swift diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 6203e1d8ff..0000000000 --- a/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,59 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) cs_monero_flutter_libs_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "CsMoneroFlutterLibsLinuxPlugin"); - cs_monero_flutter_libs_linux_plugin_register_with_registrar(cs_monero_flutter_libs_linux_registrar); - g_autoptr(FlPluginRegistrar) cs_salvium_flutter_libs_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "CsSalviumFlutterLibsLinuxPlugin"); - cs_salvium_flutter_libs_linux_plugin_register_with_registrar(cs_salvium_flutter_libs_linux_registrar); - g_autoptr(FlPluginRegistrar) desktop_drop_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopDropPlugin"); - desktop_drop_plugin_register_with_registrar(desktop_drop_registrar); - g_autoptr(FlPluginRegistrar) devicelocale_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "DevicelocalePlugin"); - devicelocale_plugin_register_with_registrar(devicelocale_registrar); - g_autoptr(FlPluginRegistrar) flutter_libepiccash_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLibepiccashPlugin"); - flutter_libepiccash_plugin_register_with_registrar(flutter_libepiccash_registrar); - g_autoptr(FlPluginRegistrar) flutter_libmwc_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLibmwcPlugin"); - flutter_libmwc_plugin_register_with_registrar(flutter_libmwc_registrar); - g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); - flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); - g_autoptr(FlPluginRegistrar) isar_community_flutter_libs_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin"); - isar_flutter_libs_plugin_register_with_registrar(isar_community_flutter_libs_registrar); - g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); - sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); - g_autoptr(FlPluginRegistrar) stack_wallet_backup_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "StackWalletBackupPlugin"); - stack_wallet_backup_plugin_register_with_registrar(stack_wallet_backup_registrar); - g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); - url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); - g_autoptr(FlPluginRegistrar) window_size_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin"); - window_size_plugin_register_with_registrar(window_size_registrar); -} diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake deleted file mode 100644 index cb793bf5b0..0000000000 --- a/linux/flutter/generated_plugins.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - cs_monero_flutter_libs_linux - cs_salvium_flutter_libs_linux - desktop_drop - devicelocale - flutter_libepiccash - flutter_libmwc - flutter_secure_storage_linux - isar_community_flutter_libs - sqlite3_flutter_libs - stack_wallet_backup - url_launcher_linux - window_size -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST - camera_linux - coinlib_flutter - flutter_libsparkmobile - flutter_mwebd - frostdart - tor_ffi_plugin - xelis_flutter -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index bee29fdb75..0000000000 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - -import camera_macos -import connectivity_plus -import cs_monero_flutter_libs_macos -import cs_salvium_flutter_libs_macos -import desktop_drop -import device_info_plus -import devicelocale -import file_picker -import flutter_libepiccash -import flutter_libmwc -import flutter_local_notifications -import flutter_secure_storage_macos -import isar_community_flutter_libs -import local_auth_darwin -import mobile_scanner -import package_info_plus -import path_provider_foundation -import share_plus -import sqlite3_flutter_libs -import stack_wallet_backup -import url_launcher_macos -import wakelock_plus -import window_size - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - CameraMacosPlugin.register(with: registry.registrar(forPlugin: "CameraMacosPlugin")) - ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) - CsMoneroFlutterLibsMacosPlugin.register(with: registry.registrar(forPlugin: "CsMoneroFlutterLibsMacosPlugin")) - CsSalviumFlutterLibsMacosPlugin.register(with: registry.registrar(forPlugin: "CsSalviumFlutterLibsMacosPlugin")) - DesktopDropPlugin.register(with: registry.registrar(forPlugin: "DesktopDropPlugin")) - DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) - DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin")) - FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) - FlutterLibepiccashPlugin.register(with: registry.registrar(forPlugin: "FlutterLibepiccashPlugin")) - FlutterLibmwcPlugin.register(with: registry.registrar(forPlugin: "FlutterLibmwcPlugin")) - FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) - FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) - IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) - LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin")) - MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin")) - FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) - Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) - StackWalletBackupPlugin.register(with: registry.registrar(forPlugin: "StackWalletBackupPlugin")) - UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) - WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin")) - WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin")) -} diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 9a0db709f5..0000000000 --- a/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,59 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void RegisterPlugins(flutter::PluginRegistry* registry) { - CameraWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("CameraWindows")); - ConnectivityPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); - CsMoneroFlutterLibsWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("CsMoneroFlutterLibsWindowsPluginCApi")); - CsSalviumFlutterLibsWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("CsSalviumFlutterLibsWindowsPluginCApi")); - DesktopDropPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("DesktopDropPlugin")); - FlutterLibepiccashPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterLibepiccashPluginCApi")); - FlutterLibmwcPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterLibmwcPluginCApi")); - FlutterSecureStorageWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); - IsarFlutterLibsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("IsarFlutterLibsPlugin")); - LocalAuthPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("LocalAuthPlugin")); - PermissionHandlerWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); - SharePlusWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); - Sqlite3FlutterLibsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin")); - StackWalletBackupPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("StackWalletBackupPluginCApi")); - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); - WindowSizePluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("WindowSizePlugin")); -} diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake deleted file mode 100644 index 1f19a41f02..0000000000 --- a/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - camera_windows - connectivity_plus - cs_monero_flutter_libs_windows - cs_salvium_flutter_libs_windows - desktop_drop - flutter_libepiccash - flutter_libmwc - flutter_secure_storage_windows - isar_community_flutter_libs - local_auth_windows - permission_handler_windows - share_plus - sqlite3_flutter_libs - stack_wallet_backup - url_launcher_windows - window_size -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST - coinlib_flutter - flutter_libsparkmobile - flutter_mwebd - frostdart - tor_ffi_plugin - xelis_flutter -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) From bbba8faa06760f18f7c48046a8777dae7fd9a489 Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 7 Oct 2025 15:09:17 -0600 Subject: [PATCH 144/178] update flutter_libmwc with macos xcfw fix --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index a692b7d685..f06b15071d 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit a692b7d6859445791f6ba4270e4cf7e897506d78 +Subproject commit f06b15071dd6d9f2bb75d2373b410338762744e4 From 41f94a1c335003db91a65399ba91406141045be1 Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 7 Oct 2025 15:21:59 -0600 Subject: [PATCH 145/178] update macos build files --- macos/.gitignore | 2 + macos/Podfile | 2 +- macos/Podfile.lock | 199 ------------------ .../macos/Runner.xcodeproj/project.pbxproj | 41 ---- 4 files changed, 3 insertions(+), 241 deletions(-) delete mode 100644 macos/Podfile.lock diff --git a/macos/.gitignore b/macos/.gitignore index 746adbb6b9..08148cce59 100644 --- a/macos/.gitignore +++ b/macos/.gitignore @@ -5,3 +5,5 @@ # Xcode-related **/dgph **/xcuserdata/ + +Podfile.lock diff --git a/macos/Podfile b/macos/Podfile index c795730db8..b52666a103 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.14' +platform :osx, '10.15' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/macos/Podfile.lock b/macos/Podfile.lock deleted file mode 100644 index 64b655098e..0000000000 --- a/macos/Podfile.lock +++ /dev/null @@ -1,199 +0,0 @@ -PODS: - - camera_macos (0.0.1): - - FlutterMacOS - - coinlib_flutter (0.5.0): - - Flutter - - FlutterMacOS - - connectivity_plus (0.0.1): - - FlutterMacOS - - ReachabilitySwift - - cs_monero_flutter_libs_macos (0.0.1): - - FlutterMacOS - - cs_salvium_flutter_libs_macos (0.0.1): - - FlutterMacOS - - desktop_drop (0.0.1): - - FlutterMacOS - - device_info_plus (0.0.1): - - FlutterMacOS - - devicelocale (0.0.1): - - FlutterMacOS - - file_picker (0.0.1): - - FlutterMacOS - - flutter_libepiccash (0.0.1): - - FlutterMacOS - - flutter_libsparkmobile (0.0.1): - - FlutterMacOS - - flutter_local_notifications (0.0.1): - - FlutterMacOS - - flutter_secure_storage_macos (6.1.1): - - FlutterMacOS - - FlutterMacOS (1.0.0) - - frostdart (0.0.1): - - FlutterMacOS - - isar_flutter_libs (1.0.0): - - FlutterMacOS - - local_auth_darwin (0.0.1): - - Flutter - - FlutterMacOS - - package_info_plus (0.0.1): - - FlutterMacOS - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - ReachabilitySwift (5.2.3) - - share_plus (0.0.1): - - FlutterMacOS - - "sqlite3 (3.46.0+1)": - - "sqlite3/common (= 3.46.0+1)" - - "sqlite3/common (3.46.0+1)" - - "sqlite3/dbstatvtab (3.46.0+1)": - - sqlite3/common - - "sqlite3/fts5 (3.46.0+1)": - - sqlite3/common - - "sqlite3/perf-threadsafe (3.46.0+1)": - - sqlite3/common - - "sqlite3/rtree (3.46.0+1)": - - sqlite3/common - - sqlite3_flutter_libs (0.0.1): - - FlutterMacOS - - "sqlite3 (~> 3.46.0+1)" - - sqlite3/dbstatvtab - - sqlite3/fts5 - - sqlite3/perf-threadsafe - - sqlite3/rtree - - stack_wallet_backup (0.0.1): - - FlutterMacOS - - tor_ffi_plugin (0.0.1) - - url_launcher_macos (0.0.1): - - FlutterMacOS - - wakelock_plus (0.0.1): - - FlutterMacOS - - window_size (0.0.2): - - FlutterMacOS - - xelis_flutter (0.0.1): - - FlutterMacOS - -DEPENDENCIES: - - camera_macos (from `Flutter/ephemeral/.symlinks/plugins/camera_macos/macos`) - - coinlib_flutter (from `Flutter/ephemeral/.symlinks/plugins/coinlib_flutter/darwin`) - - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`) - - cs_monero_flutter_libs_macos (from `Flutter/ephemeral/.symlinks/plugins/cs_monero_flutter_libs_macos/macos`) - - cs_salvium_flutter_libs_macos (from `Flutter/ephemeral/.symlinks/plugins/cs_salvium_flutter_libs_macos/macos`) - - desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`) - - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - - devicelocale (from `Flutter/ephemeral/.symlinks/plugins/devicelocale/macos`) - - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`) - - flutter_libepiccash (from `Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos`) - - flutter_libsparkmobile (from `Flutter/ephemeral/.symlinks/plugins/flutter_libsparkmobile/macos`) - - flutter_local_notifications (from `Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos`) - - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`) - - FlutterMacOS (from `Flutter/ephemeral`) - - frostdart (from `Flutter/ephemeral/.symlinks/plugins/frostdart/macos`) - - isar_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos`) - - local_auth_darwin (from `Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin`) - - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) - - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`) - - stack_wallet_backup (from `Flutter/ephemeral/.symlinks/plugins/stack_wallet_backup/macos`) - - tor_ffi_plugin (from `Flutter/ephemeral/.symlinks/plugins/tor_ffi_plugin/macos`) - - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - - wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`) - - window_size (from `Flutter/ephemeral/.symlinks/plugins/window_size/macos`) - - xelis_flutter (from `Flutter/ephemeral/.symlinks/plugins/xelis_flutter/macos`) - -SPEC REPOS: - trunk: - - ReachabilitySwift - - sqlite3 - -EXTERNAL SOURCES: - camera_macos: - :path: Flutter/ephemeral/.symlinks/plugins/camera_macos/macos - coinlib_flutter: - :path: Flutter/ephemeral/.symlinks/plugins/coinlib_flutter/darwin - connectivity_plus: - :path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos - cs_monero_flutter_libs_macos: - :path: Flutter/ephemeral/.symlinks/plugins/cs_monero_flutter_libs_macos/macos - cs_salvium_flutter_libs_macos: - :path: Flutter/ephemeral/.symlinks/plugins/cs_salvium_flutter_libs_macos/macos - desktop_drop: - :path: Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos - device_info_plus: - :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos - devicelocale: - :path: Flutter/ephemeral/.symlinks/plugins/devicelocale/macos - file_picker: - :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos - flutter_libepiccash: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos - flutter_libsparkmobile: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_libsparkmobile/macos - flutter_local_notifications: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos - flutter_secure_storage_macos: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos - FlutterMacOS: - :path: Flutter/ephemeral - frostdart: - :path: Flutter/ephemeral/.symlinks/plugins/frostdart/macos - isar_flutter_libs: - :path: Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos - local_auth_darwin: - :path: Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin - package_info_plus: - :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos - path_provider_foundation: - :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin - share_plus: - :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos - sqlite3_flutter_libs: - :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos - stack_wallet_backup: - :path: Flutter/ephemeral/.symlinks/plugins/stack_wallet_backup/macos - tor_ffi_plugin: - :path: Flutter/ephemeral/.symlinks/plugins/tor_ffi_plugin/macos - url_launcher_macos: - :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos - wakelock_plus: - :path: Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos - window_size: - :path: Flutter/ephemeral/.symlinks/plugins/window_size/macos - xelis_flutter: - :path: Flutter/ephemeral/.symlinks/plugins/xelis_flutter/macos - -SPEC CHECKSUMS: - camera_macos: c2603f5eed16f05076cf17e12030d2ce55a77839 - coinlib_flutter: 9275e8255ef67d3da33beb6e117d09ced4f46eb5 - connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747 - cs_monero_flutter_libs_macos: b901f94d39d1338f706312b026aba928d23582d4 - cs_salvium_flutter_libs_macos: 3c7b30fb8c82ee0fb0195280ddcc10c65ab5e082 - desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898 - device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720 - devicelocale: 9f0f36ac651cabae2c33f32dcff4f32b61c38225 - file_picker: e716a70a9fe5fd9e09ebc922d7541464289443af - flutter_libepiccash: be1560a04150c5cc85bcf08d236ec2b3d1f5d8da - flutter_libsparkmobile: df2d36af1691379c81249e7be7b68be3c81d388b - flutter_local_notifications: 4b427ffabf278fc6ea9484c97505e231166927a5 - flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9 - FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - frostdart: e6bf3119527ccfbcec1b8767da6ede5bb4c4f716 - isar_flutter_libs: 43385c99864c168fadba7c9adeddc5d38838ca6a - local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3 - package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b - path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - ReachabilitySwift: 7f151ff156cea1481a8411701195ac6a984f4979 - share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7 - sqlite3: 292c3e1bfe89f64e51ea7fc7dab9182a017c8630 - sqlite3_flutter_libs: 5ca46c1a04eddfbeeb5b16566164aa7ad1616e7b - stack_wallet_backup: 6ebc60b1bdcf11cf1f1cbad9aa78332e1e15778c - tor_ffi_plugin: 2566c1ed174688cca560fa0c64b7a799c66f07cb - url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404 - wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269 - window_size: 339dafa0b27a95a62a843042038fa6c3c48de195 - xelis_flutter: 34e05f3621e46381fb1b10d7c11f63764d3f7a80 - -PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 - -COCOAPODS: 1.16.2 diff --git a/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj b/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj index c0fe37d8ac..6769f9c249 100644 --- a/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj +++ b/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj @@ -29,9 +29,6 @@ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; B98151842A674143009D013C /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B98151832A674143009D013C /* libsqlite3.0.tbd */; }; BFD0376C00E1FFD46376BB9D /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */; }; - F1FA2C4E2BA4B49F00BDA1BB /* frostdart.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F1FA2C4D2BA4B49F00BDA1BB /* frostdart.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - F1FA2C502BA4B4CA00BDA1BB /* frostdart.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F1FA2C4F2BA4B4CA00BDA1BB /* frostdart.dylib */; }; - F1FA2C512BA4B51E00BDA1BB /* frostdart.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = F1FA2C4D2BA4B49F00BDA1BB /* frostdart.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; F653CA022D33E8B60E11A9F3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ @@ -52,20 +49,6 @@ }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - F1FA2C512BA4B51E00BDA1BB /* frostdart.dylib in Bundle Framework */, - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 0FA914E59929120BA65E8403 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 174539D042E7AC2AB25A83EB /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; @@ -94,8 +77,6 @@ B98151832A674143009D013C /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; }; BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F1FA2C4D2BA4B49F00BDA1BB /* frostdart.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = frostdart.dylib; path = ../crypto_plugins/frostdart/macos/frostdart.dylib; sourceTree = ""; }; - F1FA2C4F2BA4B4CA00BDA1BB /* frostdart.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = frostdart.dylib; path = ../crypto_plugins/frostdart/macos/frostdart.dylib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -112,7 +93,6 @@ buildActionMask = 2147483647; files = ( B98151842A674143009D013C /* libsqlite3.0.tbd in Frameworks */, - F1FA2C4E2BA4B49F00BDA1BB /* frostdart.dylib in Frameworks */, F653CA022D33E8B60E11A9F3 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -142,7 +122,6 @@ 33CC10E42044A3C60003C045 = { isa = PBXGroup; children = ( - F1FA2C4F2BA4B4CA00BDA1BB /* frostdart.dylib */, 33FAB671232836740065AC1E /* Runner */, 33CEB47122A05771004F2AC0 /* Flutter */, 331C80D6294CF71000263BE5 /* RunnerTests */, @@ -199,7 +178,6 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - F1FA2C4D2BA4B49F00BDA1BB /* frostdart.dylib */, B98151832A674143009D013C /* libsqlite3.0.tbd */, E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */, 9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */, @@ -328,7 +306,6 @@ files = ( 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - F1FA2C502BA4B4CA00BDA1BB /* frostdart.dylib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -592,16 +569,13 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"", ); INFOPLIST_FILE = Runner/Info.plist; @@ -612,10 +586,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}\"", - "\"${PODS_ROOT}/../Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos/libs\"", - "\"${PODS_ROOT}/../Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos\"", /usr/lib/swift, - "$(PATH)/crypto_plugins/frostdart/macos\n", ); PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; @@ -748,16 +719,13 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"", ); INFOPLIST_FILE = Runner/Info.plist; @@ -768,10 +736,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}\"", - "\"${PODS_ROOT}/../Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos/libs\"", - "\"${PODS_ROOT}/../Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos\"", /usr/lib/swift, - "$(PATH)/crypto_plugins/frostdart/macos\n", ); PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -795,16 +760,13 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"", ); INFOPLIST_FILE = Runner/Info.plist; @@ -815,10 +777,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}\"", - "\"${PODS_ROOT}/../Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos/libs\"", - "\"${PODS_ROOT}/../Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos\"", /usr/lib/swift, - "$(PATH)/crypto_plugins/frostdart/macos\n", ); PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; From da07f0de534d85aba3693fe4aa57b0178868c2ff Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 7 Oct 2025 15:27:14 -0600 Subject: [PATCH 146/178] class name fix --- tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart index 8115f82493..5380ddf256 100644 --- a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart +++ b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart @@ -24,9 +24,9 @@ LibXelisInterface _getInterface() => throw Exception("XEL not enabled!"); //END_OFF //ON -LibXelisInterface _getInterface() => _MwebdServerInterfaceImpl(); +LibXelisInterface _getInterface() => _LibXelisInterfaceImpl(); -final class _MwebdServerInterfaceImpl extends LibXelisInterface { +final class _LibXelisInterfaceImpl extends LibXelisInterface { final Map _wallets = {}; @override From 34cb2b53635962671094b6655cb3e1684e3ba640 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 8 Oct 2025 08:13:52 -0600 Subject: [PATCH 147/178] stupid hack. One day epic and mwc will be proper libraries... --- scripts/app_config/configure_campfire.sh | 3 +++ scripts/app_config/configure_stack_duo.sh | 3 +++ scripts/app_config/configure_stack_wallet.sh | 3 +++ .../app_config/platforms/linux/platform_config.sh | 4 +++- .../platforms/windows/platform_config.sh | 4 +++- scripts/app_config/templates/linux/CMakeLists.txt | 15 +++++++++++---- .../app_config/templates/windows/CMakeLists.txt | 15 +++++++++++---- 7 files changed, 37 insertions(+), 10 deletions(-) diff --git a/scripts/app_config/configure_campfire.sh b/scripts/app_config/configure_campfire.sh index c5e49296ac..04054b9ec4 100755 --- a/scripts/app_config/configure_campfire.sh +++ b/scripts/app_config/configure_campfire.sh @@ -40,6 +40,9 @@ dart "${APP_PROJECT_ROOT_DIR}/tool/gen_interfaces.dart" \ TOR \ FIRO +export INCLUDE_EPIC_SO="OFF" +export INCLUDE_MWC_SO="OFF" + pushd "${APP_PROJECT_ROOT_DIR}" BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H") popd diff --git a/scripts/app_config/configure_stack_duo.sh b/scripts/app_config/configure_stack_duo.sh index 7a839ae3c0..148775aa3e 100755 --- a/scripts/app_config/configure_stack_duo.sh +++ b/scripts/app_config/configure_stack_duo.sh @@ -36,6 +36,9 @@ dart "${APP_PROJECT_ROOT_DIR}/tool/gen_interfaces.dart" \ TOR \ FROST +export INCLUDE_EPIC_SO="OFF" +export INCLUDE_MWC_SO="OFF" + pushd "${APP_PROJECT_ROOT_DIR}" BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H") popd diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index e976821c8e..f468180d87 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -48,6 +48,9 @@ dart "${APP_PROJECT_ROOT_DIR}/tool/gen_interfaces.dart" \ XEL \ FROST +export INCLUDE_EPIC_SO="ON" +export INCLUDE_MWC_SO="ON" + pushd "${APP_PROJECT_ROOT_DIR}" BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H") popd diff --git a/scripts/app_config/platforms/linux/platform_config.sh b/scripts/app_config/platforms/linux/platform_config.sh index 018f80def7..61dfdfb8bd 100755 --- a/scripts/app_config/platforms/linux/platform_config.sh +++ b/scripts/app_config/platforms/linux/platform_config.sh @@ -12,6 +12,8 @@ for (( i=0; i<=1; i++ )); do fi done -# Configure Linux for Duo. +# Configure Linux sed -i "s/${APP_BASIC_NAME_PLACEHOLDER}/${NEW_BASIC_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${LINUX_TF_0}" sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${LINUX_TF_1}" +sed -i "s/INCLUDE_EPIC_SO_FLAG/${INCLUDE_EPIC_SO}/g" "${APP_PROJECT_ROOT_DIR}/${LINUX_TF_0}" +sed -i "s/INCLUDE_MWC_SO_FLAG/${INCLUDE_MWC_SO}/g" "${APP_PROJECT_ROOT_DIR}/${LINUX_TF_0}" \ No newline at end of file diff --git a/scripts/app_config/platforms/windows/platform_config.sh b/scripts/app_config/platforms/windows/platform_config.sh index 4a0158c80e..cbce1d8108 100755 --- a/scripts/app_config/platforms/windows/platform_config.sh +++ b/scripts/app_config/platforms/windows/platform_config.sh @@ -12,7 +12,9 @@ for (( i=0; i<=2; i++ )); do fi done -# Configure Windows for Duo. +# Configure Windows sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${WIN_TF_0}" sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${WIN_TF_1}" sed -i "s/${APP_BASIC_NAME_PLACEHOLDER}/${NEW_BASIC_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${WIN_TF_2}" +sed -i "s/INCLUDE_EPIC_SO_FLAG/${INCLUDE_EPIC_SO}/g" "${APP_PROJECT_ROOT_DIR}/${WIN_TF_2}" +sed -i "s/INCLUDE_MWC_SO_FLAG/${INCLUDE_MWC_SO}/g" "${APP_PROJECT_ROOT_DIR}/${WIN_TF_2}" diff --git a/scripts/app_config/templates/linux/CMakeLists.txt b/scripts/app_config/templates/linux/CMakeLists.txt index 4c140a4b95..4b0e69d628 100644 --- a/scripts/app_config/templates/linux/CMakeLists.txt +++ b/scripts/app_config/templates/linux/CMakeLists.txt @@ -9,6 +9,9 @@ set(BINARY_NAME "place_holder") # https://wiki.gnome.org/HowDoI/ChooseApplicationID set(APPLICATION_ID "com.place.holder") +set(INCLUDE_EPIC_SO INCLUDE_EPIC_SO_FLAG) +set(INCLUDE_MWC_SO INCLUDE_EPIC_SO_FLAG) + # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(SET CMP0063 NEW) @@ -134,11 +137,15 @@ 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/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libepic_cash_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) +if(INCLUDE_EPIC_SO) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libepic_cash_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmwc/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) +if(INCLUDE_MWC_SO) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmwc/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libmwc_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so.1.7.4" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) diff --git a/scripts/app_config/templates/windows/CMakeLists.txt b/scripts/app_config/templates/windows/CMakeLists.txt index 7226cf1378..02532aa15e 100644 --- a/scripts/app_config/templates/windows/CMakeLists.txt +++ b/scripts/app_config/templates/windows/CMakeLists.txt @@ -6,6 +6,9 @@ project(place_holder LANGUAGES CXX) # the on-disk name of your application. set(BINARY_NAME "place_holder") +set(INCLUDE_EPIC_SO INCLUDE_EPIC_SO_FLAG) +set(INCLUDE_MWC_SO INCLUDE_EPIC_SO_FLAG) + # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(SET CMP0063 NEW) @@ -80,11 +83,15 @@ 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) +if(INCLUDE_EPIC_SO) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/windows/build/libepic_cash_wallet.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmwc/scripts/windows/build/libmwc_cash_wallet.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) +if(INCLUDE_MWC_SO) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmwc/scripts/windows/build/libmwc_cash_wallet.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" From 4bf95c6293b9462671a0928b2b5e901296c07d02 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 8 Oct 2025 09:01:34 -0600 Subject: [PATCH 148/178] update frostdart with macos xcframework --- crypto_plugins/frostdart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/frostdart b/crypto_plugins/frostdart index a8c2121925..acf903869a 160000 --- a/crypto_plugins/frostdart +++ b/crypto_plugins/frostdart @@ -1 +1 @@ -Subproject commit a8c21219259429299eb9c262510152e55ab05e67 +Subproject commit acf903869ae9ddc9e3f78501d7eac50a8a626439 From 183380a072da76ddeeb68a627b8df40976a38017 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 8 Oct 2025 09:09:50 -0600 Subject: [PATCH 149/178] no spark logging without firo --- lib/main.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 968d595765..7bfba70f00 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -185,8 +185,10 @@ void main(List args) async { libXelis.startListeningToRustLogs(); } - // setup lib spark logging - initSparkLogging(Prefs.instance.logLevel); + if (AppConfig.coins.whereType().isNotEmpty) { + // setup lib spark logging + initSparkLogging(Prefs.instance.logLevel); + } if (AppConfig.appName == "Campfire" && !Util.isDesktop && From 3375632aaadc18c0d48c27b85d56b5815e69db07 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 10:26:38 -0600 Subject: [PATCH 150/178] fix salvium interface and add salvium staking tx call --- lib/wallets/models/tx_data.dart | 3 + lib/wallets/wallet/impl/salvium_wallet.dart | 22 +- .../intermediate/lib_salvium_wallet.dart | 207 ++++++++++------- .../interfaces/cs_monero_interface.dart | 6 +- .../interfaces/cs_salvium_interface.dart | 109 +++++---- ...AL_cs_salvium_interface_impl.template.dart | 218 +++++++++++------- 6 files changed, 339 insertions(+), 226 deletions(-) diff --git a/lib/wallets/models/tx_data.dart b/lib/wallets/models/tx_data.dart index 68ba7b7223..5db6d94835 100644 --- a/lib/wallets/models/tx_data.dart +++ b/lib/wallets/models/tx_data.dart @@ -100,6 +100,8 @@ class TxData { final TxType type; + final bool salviumStakeTx; + TxData({ this.feeRateType, this.feeRateAmount, @@ -135,6 +137,7 @@ class TxData { this.opNameState, this.sparkNameInfo, this.type = TxType.regular, + this.salviumStakeTx = false, }); Amount? get amount { diff --git a/lib/wallets/wallet/impl/salvium_wallet.dart b/lib/wallets/wallet/impl/salvium_wallet.dart index 94aef46f86..c345fb01bb 100644 --- a/lib/wallets/wallet/impl/salvium_wallet.dart +++ b/lib/wallets/wallet/impl/salvium_wallet.dart @@ -1,7 +1,7 @@ import 'dart:async'; import '../../../utilities/amount/amount.dart'; -import '../../../wl_gen/generated/cs_salvium_interface_impl.dart'; +import '../../../wl_gen/interfaces/cs_salvium_interface.dart'; import '../../crypto_currency/crypto_currency.dart'; import '../intermediate/lib_salvium_wallet.dart'; @@ -10,7 +10,8 @@ class SalviumWallet extends LibSalviumWallet { @override Future estimateFeeFor(Amount amount, BigInt feeRate) async { - if (!csSalvium.walletInstanceExists(walletId) /*|| + if (wallet == + null /*|| syncStatus is! lib_monero_compat.SyncedSyncStatus*/ ) { return Amount.zeroWith(fractionDigits: cryptoCurrency.fractionDigits); } @@ -20,7 +21,7 @@ class SalviumWallet extends LibSalviumWallet { approximateFee = await csSalvium.estimateFee( feeRate.toInt(), amount.raw, - walletId: walletId, + wallet: wallet!, ); }); @@ -34,27 +35,26 @@ class SalviumWallet extends LibSalviumWallet { bool walletExists(String path) => csSalvium.walletExists(path); @override - Future loadWallet({required String path, required String password}) => - csSalvium.loadWallet(walletId, path: path, password: password); + Future loadWallet({ + required String path, + required String password, + }) => csSalvium.loadWallet(walletId, path: path, password: password); @override - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }) => csSalvium.getCreatedWallet( path: path, password: password, wordCount: wordCount, seedOffset: seedOffset, - onCreated: onCreated, ); @override - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, @@ -70,7 +70,7 @@ class SalviumWallet extends LibSalviumWallet { ); @override - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, diff --git a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart index 4aa05989e6..c3da08809b 100644 --- a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart @@ -49,6 +49,8 @@ abstract class LibSalviumWallet @override int get isarTransactionVersion => 2; + WrappedWallet? wallet; + LibSalviumWallet(super.currency) { final bus = GlobalEventBus.instance; @@ -132,18 +134,19 @@ abstract class LibSalviumWallet int currentKnownChainHeight = 0; double highestPercentCached = 0; - Future loadWallet({required String path, required String password}); + Future loadWallet({ + required String path, + required String password, + }); - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }); - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, @@ -151,7 +154,7 @@ abstract class LibSalviumWallet int height = 0, }); - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, @@ -164,17 +167,16 @@ abstract class LibSalviumWallet bool walletExists(String path); String getTxKeyFor({required String txid}) { - if (!csSalvium.walletInstanceExists(walletId)) { + if (wallet == null) { throw Exception("Cannot get tx key in uninitialized libSalviumWallet"); } - return csSalvium.getTxKey(walletId, txid); + return csSalvium.getTxKey(wallet!, txid); } void _setListener() { - if (csSalvium.walletInstanceExists(walletId) && - !csSalvium.hasListeners(walletId)) { + if (wallet != null && !csSalvium.hasListeners(wallet!)) { csSalvium.addListener( - walletId, + wallet!, CsWalletListener( onSyncingUpdate: onSyncingUpdate, onNewBlock: onNewBlock, @@ -191,7 +193,7 @@ abstract class LibSalviumWallet Future open() async { bool wasNull = false; - if (!csSalvium.walletInstanceExists(walletId)) { + if (wallet == null) { wasNull = true; // await libSalviumWallet?.close(); final path = await pathForWallet(name: walletId); @@ -205,7 +207,7 @@ abstract class LibSalviumWallet throw Exception("Password not found $e, $s"); } - await loadWallet(path: path, password: password); + wallet = await loadWallet(path: path, password: password); _setListener(); @@ -227,15 +229,15 @@ abstract class LibSalviumWallet if (wasNull) { try { _setSyncStatus(ConnectingSyncStatus()); - csSalvium.startSyncing(walletId); + csSalvium.startSyncing(wallet!); } catch (_) { _setSyncStatus(FailedSyncStatus()); // TODO log } } _setListener(); - csSalvium.startListeners(walletId); - csSalvium.startAutoSaving(walletId); + csSalvium.startListeners(wallet!); + csSalvium.startAutoSaving(wallet!); unawaited(refresh()); } @@ -245,12 +247,12 @@ abstract class LibSalviumWallet final appRoot = await StackFileSystem.applicationRootDirectory(); await _backupWalletFiles(name: walletId, appRoot: appRoot); } - await csSalvium.save(walletId); + await csSalvium.save(wallet!); } Address addressFor({required int index, int account = 0}) { final address = csSalvium.getAddress( - walletId, + wallet!, accountIndex: account, addressIndex: index, ); @@ -273,16 +275,16 @@ abstract class LibSalviumWallet } Future getKeys() async { - if (!csSalvium.walletInstanceExists(walletId)) { + if (wallet == null) { return null; } try { return CWKeyData( walletId: walletId, - publicViewKey: csSalvium.getPublicViewKey(walletId), - privateViewKey: csSalvium.getPrivateViewKey(walletId), - publicSpendKey: csSalvium.getPublicSpendKey(walletId), - privateSpendKey: csSalvium.getPrivateSpendKey(walletId), + publicViewKey: csSalvium.getPublicViewKey(wallet!), + privateViewKey: csSalvium.getPrivateViewKey(wallet!), + publicSpendKey: csSalvium.getPublicSpendKey(wallet!), + privateSpendKey: csSalvium.getPrivateSpendKey(wallet!), ); } catch (e, s) { Logging.instance.f("getKeys failed: ", error: e, stackTrace: s); @@ -307,10 +309,10 @@ abstract class LibSalviumWallet } catch (e, s) { throw Exception("Password not found $e, $s"); } - await loadWallet(path: path, password: password); + wallet = await loadWallet(path: path, password: password); return ( - csSalvium.getAddress(walletId), - csSalvium.getPrivateViewKey(walletId), + csSalvium.getAddress(wallet!), + csSalvium.getPrivateViewKey(wallet!), ); } @@ -326,22 +328,15 @@ abstract class LibSalviumWallet value: password, ); - late final int refreshFromBlockHeight; - late final String seedPhrase; - - await getCreatedWallet( + final wallet = await getCreatedWallet( path: path, password: password, wordCount: wordCount, seedOffset: "", // default for non restored wallets for now - onCreated: (height, seed) { - refreshFromBlockHeight = height; - seedPhrase = seed; - }, ); await info.updateRestoreHeight( - newRestoreHeight: refreshFromBlockHeight, + newRestoreHeight: csSalvium.getRefreshFromBlockHeight(wallet), isar: mainDB.isar, ); @@ -349,7 +344,7 @@ abstract class LibSalviumWallet // before wallet.init() is called await secureStorageInterface.write( key: Wallet.mnemonicKey(walletId: walletId), - value: seedPhrase, + value: csSalvium.getSeed(wallet), ); await secureStorageInterface.write( key: Wallet.mnemonicPassphraseKey(walletId: walletId), @@ -372,8 +367,8 @@ abstract class LibSalviumWallet await mainDB.deleteWalletBlockchainData(walletId); highestPercentCached = 0; - unawaited(csSalvium.rescanBlockchain(walletId)); - csSalvium.startSyncing(walletId); + unawaited(csSalvium.rescanBlockchain(wallet!)); + csSalvium.startSyncing(wallet!); // unawaited(save()); }); unawaited(refresh()); @@ -411,11 +406,7 @@ abstract class LibSalviumWallet value: password, ); - if (!csSalvium.walletInstanceExists(walletId)) { - await exit(); - } - - await getRestoredWallet( + final wallet = await getRestoredWallet( path: path, password: password, mnemonic: mnemonic, @@ -423,6 +414,12 @@ abstract class LibSalviumWallet seedOffset: seedOffset, ); + if (this.wallet != null) { + await exit(); + } + + this.wallet = wallet; + _setListener(); final newReceivingAddress = @@ -431,7 +428,7 @@ abstract class LibSalviumWallet walletId: walletId, derivationIndex: 0, derivationPath: null, - value: csSalvium.getAddress(walletId), + value: csSalvium.getAddress(this.wallet!), publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -450,12 +447,12 @@ abstract class LibSalviumWallet _setListener(); // libSalviumWallet?.setRecoveringFromSeed(isRecovery: true); - unawaited(csSalvium.rescanBlockchain(walletId)); - csSalvium.startSyncing(walletId); + unawaited(csSalvium.rescanBlockchain(wallet!)); + csSalvium.startSyncing(wallet!); // await save(); - csSalvium.startListeners(walletId); - csSalvium.startAutoSaving(walletId); + csSalvium.startListeners(wallet!); + csSalvium.startAutoSaving(wallet!); } catch (e, s) { Logging.instance.e( "Exception rethrown from recoverFromMnemonic(): ", @@ -472,7 +469,7 @@ abstract class LibSalviumWallet @override Future pingCheck() async { if (_canPing) { - return csSalvium.isConnectedToDaemon(walletId); + return csSalvium.isConnectedToDaemon(wallet!); } else { return false; } @@ -499,7 +496,7 @@ abstract class LibSalviumWallet if (_requireMutex) { await _torConnectingLock.protect(() async { await csSalvium.connect( - walletId, + wallet!, daemonAddress: "$host:${node.port}", daemonUsername: node.loginName, daemonPassword: await node.getPassword(secureStorageInterface), @@ -514,7 +511,7 @@ abstract class LibSalviumWallet }); } else { await csSalvium.connect( - walletId, + wallet!, daemonAddress: "$host:${node.port}", daemonUsername: node.loginName, daemonPassword: await node.getPassword(secureStorageInterface), @@ -527,9 +524,9 @@ abstract class LibSalviumWallet : "${proxy.host.address}:${proxy.port}", ); } - csSalvium.startSyncing(walletId); - csSalvium.startListeners(walletId); - csSalvium.startAutoSaving(walletId); + csSalvium.startSyncing(wallet!); + csSalvium.startListeners(wallet!); + csSalvium.startAutoSaving(wallet!); // _setSyncStatus(ConnectedSyncStatus()); } catch (e, s) { @@ -546,7 +543,7 @@ abstract class LibSalviumWallet @override Future updateTransactions() async { - if (!csSalvium.walletInstanceExists(walletId)) { + if (wallet == null) { return; } @@ -558,7 +555,7 @@ abstract class LibSalviumWallet .txidProperty() .findAll(); - final allTxids = await csSalvium.getAllTxids(walletId, refresh: true); + final allTxids = await csSalvium.getAllTxids(wallet!, refresh: true); final txidsToFetch = allTxids.toSet().difference(localTxids.toSet()); @@ -567,13 +564,13 @@ abstract class LibSalviumWallet } final transactions = await csSalvium.getTxs( - walletId, + wallet!, txids: txidsToFetch, refresh: false, ); final allOutputs = await csSalvium.getOutputs( - walletId, + wallet!, includeSpent: true, refresh: true, ); @@ -684,7 +681,7 @@ abstract class LibSalviumWallet Future get availableBalance async { try { return Amount( - rawValue: csSalvium.getUnlockedBalance(walletId)!, + rawValue: csSalvium.getUnlockedBalance(wallet!)!, fractionDigits: cryptoCurrency.fractionDigits, ); } catch (_) { @@ -694,14 +691,14 @@ abstract class LibSalviumWallet Future get totalBalance async { try { - final full = csSalvium.getBalance(walletId); + final full = csSalvium.getBalance(wallet!); if (full != null) { return Amount( rawValue: full, fractionDigits: cryptoCurrency.fractionDigits, ); } else { - final transactions = await csSalvium.getAllTxs(walletId, refresh: true); + final transactions = await csSalvium.getAllTxs(wallet!, refresh: true); BigInt transactionBalance = BigInt.zero; for (final tx in transactions) { if (!tx.isSpend) { @@ -724,10 +721,12 @@ abstract class LibSalviumWallet @override Future exit() async { Logging.instance.i("exit called on $walletId"); - csSalvium.stopAutoSaving(walletId); - csSalvium.stopListeners(walletId); - csSalvium.stopSyncing(walletId); - await csSalvium.save(walletId); + if (wallet != null) { + csSalvium.stopAutoSaving(wallet!); + csSalvium.stopListeners(wallet!); + csSalvium.stopSyncing(wallet!); + await csSalvium.save(wallet!); + } } Future pathForWalletDir({required String name}) async { @@ -797,7 +796,7 @@ abstract class LibSalviumWallet final _utxosUpdateLock = Mutex(); Future onUTXOsChanged(List utxos) async { await _utxosUpdateLock.protect(() async { - final cwUtxos = await csSalvium.getOutputs(walletId, refresh: true); + final cwUtxos = await csSalvium.getOutputs(wallet!, refresh: true); // bool changed = false; @@ -814,12 +813,12 @@ abstract class LibSalviumWallet if (u.isBlocked) { if (!cw.isFrozen) { - await csSalvium.freezeOutput(walletId, cw.keyImage); + await csSalvium.freezeOutput(wallet!, cw.keyImage); // changed = true; } } else { if (cw.isFrozen) { - await csSalvium.thawOutput(walletId, cw.keyImage); + await csSalvium.thawOutput(wallet!, cw.keyImage); // changed = true; } } @@ -975,9 +974,11 @@ abstract class LibSalviumWallet if (mismatch) { _canPing = false; - csSalvium.stopAutoSaving(walletId); - csSalvium.stopListeners(walletId); - csSalvium.stopSyncing(walletId); + if (wallet != null) { + csSalvium.stopAutoSaving(wallet!); + csSalvium.stopListeners(wallet!); + csSalvium.stopSyncing(wallet!); + } _setSyncStatus(FailedSyncStatus()); } @@ -995,7 +996,9 @@ abstract class LibSalviumWallet @override Future updateUTXOs() async { final List outputArray = []; - final utxos = await csSalvium.getOutputs(walletId, refresh: true); + final utxos = wallet == null + ? [] + : await csSalvium.getOutputs(wallet!, refresh: true); for (final rawUTXO in utxos) { if (!rawUTXO.spent) { final current = await mainDB.isar.utxos @@ -1084,7 +1087,7 @@ abstract class LibSalviumWallet // Slight possibility of race but should be irrelevant await refreshMutex.acquire(); - csSalvium.startSyncing(walletId); + csSalvium.startSyncing(wallet!); _setSyncStatus(StartingSyncStatus()); await updateTransactions(); @@ -1098,7 +1101,7 @@ abstract class LibSalviumWallet refreshMutex.release(); } - final synced = await csSalvium.isSynced(walletId); + final synced = wallet != null && await csSalvium.isSynced(wallet!); if (synced == true) { _setSyncStatus(SyncedSyncStatus()); @@ -1147,7 +1150,7 @@ abstract class LibSalviumWallet try { int highestIndex = -1; - final entries = await csSalvium.getAllTxs(walletId, refresh: true); + final entries = await csSalvium.getAllTxs(wallet!, refresh: true); for (final element in entries) { if (!element.isSpend) { @@ -1273,6 +1276,20 @@ abstract class LibSalviumWallet throw Exception("Send all not supported with multiple recipients"); } + if (txData.salviumStakeTx) { + if (sweep) { + throw Exception("Send all not supported for stake transactions"); + } + if (txData.recipients!.length != 1) { + throw Exception("Stake transactions require one output only"); + } + + final mainAddress = csSalvium.getAddress(wallet!); + if (txData.recipients!.first.address != mainAddress) { + throw Exception("Stake transactions should use your own address"); + } + } + final List outputs = []; for (final recipient in txData.recipients!) { final output = CsRecipient(recipient.address, recipient.amount.raw); @@ -1289,9 +1306,19 @@ abstract class LibSalviumWallet return await prepareSendMutex.protect(() async { final CsPendingTransaction pendingTransaction; - if (outputs.length == 1) { + + if (txData.salviumStakeTx) { + pendingTransaction = await csSalvium.createStakeTx( + wallet!, + output: outputs.first, + priority: feePriority, + accountIndex: 0, // sw only uses account 0 at this time + minConfirms: cryptoCurrency.minConfirms, + currentHeight: height, + ); + } else if (outputs.length == 1) { pendingTransaction = await csSalvium.createTx( - walletId, + wallet!, output: outputs.first, minConfirms: cryptoCurrency.minConfirms, currentHeight: height, @@ -1302,7 +1329,7 @@ abstract class LibSalviumWallet ); } else { pendingTransaction = await csSalvium.createTxMultiDest( - walletId, + wallet!, outputs: outputs, minConfirms: cryptoCurrency.minConfirms, currentHeight: height, @@ -1348,7 +1375,7 @@ abstract class LibSalviumWallet Future confirmSend({required TxData txData}) async { try { try { - await csSalvium.commitTx(walletId, txData.pendingSalviumTransaction!); + await csSalvium.commitTx(wallet!, txData.pendingSalviumTransaction!); Logging.instance.d( "transaction ${txData.pendingSalviumTransaction!.txid} has been sent", @@ -1398,11 +1425,7 @@ abstract class LibSalviumWallet value: password, ); - if (csSalvium.walletInstanceExists(walletId)) { - await exit(); - } - - await getRestoredFromViewKeyWallet( + final wallet = await getRestoredFromViewKeyWallet( path: path, password: password, address: data.address, @@ -1410,6 +1433,12 @@ abstract class LibSalviumWallet height: height, ); + if (this.wallet != null) { + await exit(); + } + + this.wallet = wallet; + _setListener(); final newReceivingAddress = @@ -1418,7 +1447,7 @@ abstract class LibSalviumWallet walletId: walletId, derivationIndex: 0, derivationPath: null, - value: csSalvium.getAddress(walletId), + value: csSalvium.getAddress(this.wallet!), publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -1433,12 +1462,12 @@ abstract class LibSalviumWallet await updateNode(); _setListener(); - unawaited(csSalvium.rescanBlockchain(walletId)); - csSalvium.startSyncing(walletId); + unawaited(csSalvium.rescanBlockchain(this.wallet!)); + csSalvium.startSyncing(this.wallet!); // await save(); - csSalvium.startListeners(walletId); - csSalvium.startAutoSaving(walletId); + csSalvium.startListeners(this.wallet!); + csSalvium.startAutoSaving(this.wallet!); } catch (e, s) { Logging.instance.e( "Exception rethrown from recoverViewOnly(): ", diff --git a/lib/wl_gen/interfaces/cs_monero_interface.dart b/lib/wl_gen/interfaces/cs_monero_interface.dart index 9ed2bb4163..4589a714bf 100644 --- a/lib/wl_gen/interfaces/cs_monero_interface.dart +++ b/lib/wl_gen/interfaces/cs_monero_interface.dart @@ -221,7 +221,7 @@ final class CsPendingTransaction { // forwarding class final class CsTransaction { - CsTransaction({ + CsTransaction( { required this.displayLabel, required this.description, required this.fee, @@ -236,6 +236,7 @@ final class CsTransaction { required this.key, required this.timeStamp, required this.minConfirms, + this.salviumData, }) { if (fee.isNegative) throw Exception("negative fee"); if (confirmations.isNegative) throw Exception("negative confirmations"); @@ -290,6 +291,9 @@ final class CsTransaction { /// Flag indicating whether the transaction is pending (i.e., not yet confirmed). bool get isPending => confirmations < minConfirms; + + final ({int type, String asset})? salviumData; + } // forwarding class diff --git a/lib/wl_gen/interfaces/cs_salvium_interface.dart b/lib/wl_gen/interfaces/cs_salvium_interface.dart index 108ff166b2..0b7a509055 100644 --- a/lib/wl_gen/interfaces/cs_salvium_interface.dart +++ b/lib/wl_gen/interfaces/cs_salvium_interface.dart @@ -11,37 +11,35 @@ abstract class CsSalviumInterface { int getTxPriorityMedium(); int getTxPriorityNormal(); - bool walletInstanceExists(String walletId); - bool walletExists(String path); - Future estimateFee(int rate, BigInt amount, {required String walletId}); + Future estimateFee( + int rate, + BigInt amount, { + required WrappedWallet wallet, + }); - Future loadWallet( + Future loadWallet( String walletId, { - required String path, required String password, }); String getAddress( - String walletId, { + WrappedWallet wallet, { int accountIndex = 0, int addressIndex = 0, }); - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }); - Future getRestoredWallet({ + Future getRestoredWallet({ required String walletId, - required String path, required String password, required String mnemonic, @@ -49,9 +47,8 @@ abstract class CsSalviumInterface { int height = 0, }); - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String walletId, - required String path, required String password, required String address, @@ -59,35 +56,35 @@ abstract class CsSalviumInterface { int height = 0, }); - String getTxKey(String walletId, String txid); + String getTxKey(WrappedWallet wallet, String txid); - Future save(String walletId); + Future save(WrappedWallet wallet); - String getPublicViewKey(String walletId); - String getPrivateViewKey(String walletId); - String getPublicSpendKey(String walletId); - String getPrivateSpendKey(String walletId); + String getPublicViewKey(WrappedWallet wallet); + String getPrivateViewKey(WrappedWallet wallet); + String getPublicSpendKey(WrappedWallet wallet); + String getPrivateSpendKey(WrappedWallet wallet); - Future isSynced(String walletId); - void startSyncing(String walletId); - void stopSyncing(String walletId); + Future isSynced(WrappedWallet wallet); + void startSyncing(WrappedWallet wallet); + void stopSyncing(WrappedWallet wallet); - void startAutoSaving(String walletId); - void stopAutoSaving(String walletId); + void startAutoSaving(WrappedWallet wallet); + void stopAutoSaving(WrappedWallet wallet); - bool hasListeners(String walletId); - void addListener(String walletId, CsWalletListener listener); - void startListeners(String walletId); - void stopListeners(String walletId); + bool hasListeners(WrappedWallet wallet); + void addListener(WrappedWallet wallet, CsWalletListener listener); + void startListeners(WrappedWallet wallet); + void stopListeners(WrappedWallet wallet); - Future rescanBlockchain(String walletId); - Future isConnectedToDaemon(String walletId); + Future rescanBlockchain(WrappedWallet wallet); + Future isConnectedToDaemon(WrappedWallet wallet); - int getRefreshFromBlockHeight(String walletId); - void setRefreshFromBlockHeight(String walletId, int height); + int getRefreshFromBlockHeight(WrappedWallet wallet); + void setRefreshFromBlockHeight(WrappedWallet wallet, int height); Future connect( - String walletId, { + WrappedWallet wallet, { required String daemonAddress, required bool trusted, String? daemonUsername, @@ -97,24 +94,27 @@ abstract class CsSalviumInterface { String? socksProxyAddress, }); - Future> getAllTxids(String walletId, {bool refresh = false}); + Future> getAllTxids( + WrappedWallet wallet, { + bool refresh = false, + }); - BigInt? getBalance(String walletId, {int accountIndex = 0}); - BigInt? getUnlockedBalance(String walletId, {int accountIndex = 0}); + BigInt? getBalance(WrappedWallet wallet, {int accountIndex = 0}); + BigInt? getUnlockedBalance(WrappedWallet wallet, {int accountIndex = 0}); Future> getAllTxs( - String walletId, { + WrappedWallet wallet, { bool refresh = false, }); Future> getTxs( - String walletId, { + WrappedWallet wallet, { required Set txids, bool refresh = false, }); Future createTx( - String walletId, { + WrappedWallet wallet, { required CsRecipient output, required int priority, required bool sweep, @@ -124,8 +124,18 @@ abstract class CsSalviumInterface { required int currentHeight, }); + Future createStakeTx( + WrappedWallet wallet, { + required CsRecipient output, + required int priority, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }); + Future createTxMultiDest( - String walletId, { + WrappedWallet wallet, { required List outputs, required int priority, required bool sweep, @@ -135,20 +145,31 @@ abstract class CsSalviumInterface { required int currentHeight, }); - Future commitTx(String walletId, CsPendingTransaction tx); + Future commitTx(WrappedWallet wallet, CsPendingTransaction tx); Future> getOutputs( - String walletId, { + WrappedWallet wallet, { bool refresh = false, bool includeSpent = false, }); - Future freezeOutput(String walletId, String keyImage); - Future thawOutput(String walletId, String keyImage); + Future freezeOutput(WrappedWallet wallet, String keyImage); + Future thawOutput(WrappedWallet wallet, String keyImage); List getSalviumWordList(String language); int getHeightByDate(DateTime date); bool validateAddress(String address, int network); + + String getSeed(WrappedWallet wallet); +} + +// lol... +class WrappedWallet { + final Object _wallet; + + const WrappedWallet(this._wallet); + + T get() => _wallet as T; } diff --git a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart index 6d56cb075e..b3e88da21d 100644 --- a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart +++ b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart @@ -19,22 +19,25 @@ CsSalviumInterface _getInterface() => throw Exception("XMR/WOW not enabled!"); //ON CsSalviumInterface _getInterface() => _CsSalviumInterfaceImpl(); -class _CsSalviumInterfaceImpl extends CsSalviumInterface { - final Map _wallets = {}; +extension _WrappedWalletExt on WrappedWallet { + lib_salvium.SalviumWallet get actual => get(); +} +class _CsSalviumInterfaceImpl extends CsSalviumInterface { @override void setUseCsSalviumLoggerInternal(bool enable) => lib_salvium.Logging.useLogger = enable; - @override - bool walletInstanceExists(String walletId) => _wallets[walletId] != null; - @override bool walletExists(String path) => lib_salvium.SalviumWallet.isWalletExist(path); @override - Future estimateFee(int rate, BigInt amount, {required String walletId}) { + Future estimateFee( + int rate, + BigInt amount, { + required WrappedWallet wallet, + }) { lib_salvium.TransactionPriority priority; switch (rate) { case 1: @@ -55,19 +58,20 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { break; } - return _wallets[walletId]!.estimateFee(priority, amount.toInt()); + return wallet.actual.estimateFee(priority, amount.toInt()); } @override - Future loadWallet( + Future loadWallet( String walletId, { required String path, required String password, }) async { - _wallets[walletId] = await lib_salvium.SalviumWallet.loadWallet( + final wallet = await lib_salvium.SalviumWallet.loadWallet( path: path, password: password, ); + return WrappedWallet(wallet); } @override @@ -81,21 +85,19 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { @override String getAddress( - String walletId, { + WrappedWallet wallet, { int accountIndex = 0, int addressIndex = 0, - }) => _wallets[walletId]! + }) => wallet.actual .getAddress(accountIndex: accountIndex, addressIndex: addressIndex) .value; @override - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }) async { final type = switch (wordCount) { 16 => lib_salvium.SalviumSeedType.sixteen, @@ -110,14 +112,11 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { seedOffset: seedOffset, ); - onCreated( - wallet.getRefreshFromBlockHeight(), - wallet.getSeed(seedOffset: seedOffset).trim(), - ); + return WrappedWallet(wallet); } @override - Future getRestoredWallet({ + Future getRestoredWallet({ required String walletId, required String path, required String password, @@ -125,17 +124,19 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { required String seedOffset, int height = 0, }) async { - _wallets[walletId] = await lib_salvium.SalviumWallet.restoreWalletFromSeed( + final wallet = await lib_salvium.SalviumWallet.restoreWalletFromSeed( path: path, password: password, seed: mnemonic, restoreHeight: height, seedOffset: seedOffset, ); + + return WrappedWallet(wallet); } @override - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String walletId, required String path, required String password, @@ -143,62 +144,63 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { required String privateViewKey, int height = 0, }) async { - _wallets[walletId] = await lib_salvium.SalviumWallet.createViewOnlyWallet( + final wallet = await lib_salvium.SalviumWallet.createViewOnlyWallet( path: path, password: password, address: address, viewKey: privateViewKey, restoreHeight: height, ); + + return WrappedWallet(wallet); } @override - String getTxKey(String walletId, String txid) => - _wallets[walletId]!.getTxKey(txid); + String getTxKey(WrappedWallet wallet, String txid) => + wallet.actual.getTxKey(txid); @override - Future save(String walletId) => _wallets[walletId]!.save(); + Future save(WrappedWallet wallet) => wallet.actual.save(); @override - String getPublicViewKey(String walletId) => - _wallets[walletId]!.getPublicViewKey(); + String getPublicViewKey(WrappedWallet wallet) => + wallet.actual.getPublicViewKey(); @override - String getPrivateViewKey(String walletId) => - _wallets[walletId]!.getPrivateViewKey(); + String getPrivateViewKey(WrappedWallet wallet) => + wallet.actual.getPrivateViewKey(); @override - String getPublicSpendKey(String walletId) => - _wallets[walletId]!.getPublicSpendKey(); + String getPublicSpendKey(WrappedWallet wallet) => + wallet.actual.getPublicSpendKey(); @override - String getPrivateSpendKey(String walletId) => - _wallets[walletId]!.getPrivateSpendKey(); + String getPrivateSpendKey(WrappedWallet wallet) => + wallet.actual.getPrivateSpendKey(); @override - Future isSynced(String walletId) => - _wallets[walletId]?.isSynced() ?? Future.value(false); + Future isSynced(WrappedWallet wallet) => + wallet.actual.isSynced() ?? Future.value(false); @override - void startSyncing(String walletId) => _wallets[walletId]?.startSyncing(); + void startSyncing(WrappedWallet wallet) => wallet.actual.startSyncing(); @override - void stopSyncing(String walletId) => _wallets[walletId]?.stopSyncing(); + void stopSyncing(WrappedWallet wallet) => wallet.actual.stopSyncing(); @override - void startAutoSaving(String walletId) => - _wallets[walletId]?.startAutoSaving(); + void startAutoSaving(WrappedWallet wallet) => wallet.actual.startAutoSaving(); @override - void stopAutoSaving(String walletId) => _wallets[walletId]?.stopAutoSaving(); + void stopAutoSaving(WrappedWallet wallet) => wallet.actual.stopAutoSaving(); @override - bool hasListeners(String walletId) => - _wallets[walletId]!.getListeners().isNotEmpty; + bool hasListeners(WrappedWallet wallet) => + wallet.actual.getListeners().isNotEmpty; @override - void addListener(String walletId, CsWalletListener listener) => - _wallets[walletId]?.addListener( + void addListener(WrappedWallet wallet, CsWalletListener listener) => + wallet.actual.addListener( lib_salvium.WalletListener( onSyncingUpdate: listener.onSyncingUpdate, onNewBlock: listener.onNewBlock, @@ -208,30 +210,30 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { ); @override - void startListeners(String walletId) => _wallets[walletId]?.startListeners(); + void startListeners(WrappedWallet wallet) => wallet.actual.startListeners(); @override - void stopListeners(String walletId) => _wallets[walletId]?.stopListeners(); + void stopListeners(WrappedWallet wallet) => wallet.actual.stopListeners(); @override - int getRefreshFromBlockHeight(String walletId) => - _wallets[walletId]!.getRefreshFromBlockHeight(); + int getRefreshFromBlockHeight(WrappedWallet wallet) => + wallet.actual.getRefreshFromBlockHeight(); @override - void setRefreshFromBlockHeight(String walletId, int height) => - _wallets[walletId]!.setRefreshFromBlockHeight(height); + void setRefreshFromBlockHeight(WrappedWallet wallet, int height) => + wallet.actual.setRefreshFromBlockHeight(height); @override - Future rescanBlockchain(String walletId) => - _wallets[walletId]?.rescanBlockchain() ?? Future.value(false); + Future rescanBlockchain(WrappedWallet wallet) => + wallet.actual.rescanBlockchain() ?? Future.value(false); @override - Future isConnectedToDaemon(String walletId) => - _wallets[walletId]?.isConnectedToDaemon() ?? Future.value(false); + Future isConnectedToDaemon(WrappedWallet wallet) => + wallet.actual.isConnectedToDaemon() ?? Future.value(false); @override Future connect( - String walletId, { + WrappedWallet wallet, { required String daemonAddress, required bool trusted, String? daemonUsername, @@ -240,7 +242,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { bool isLightWallet = false, String? socksProxyAddress, }) async { - await _wallets[walletId]?.connect( + await wallet.actual.connect( daemonAddress: daemonAddress, trusted: trusted, daemonUsername: daemonUsername, @@ -252,23 +254,25 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { } @override - Future> getAllTxids(String walletId, {bool refresh = false}) => - _wallets[walletId]!.getAllTxids(refresh: refresh); + Future> getAllTxids( + WrappedWallet wallet, { + bool refresh = false, + }) => wallet.actual.getAllTxids(refresh: refresh); @override - BigInt? getBalance(String walletId, {int accountIndex = 0}) => - _wallets[walletId]?.getBalance(accountIndex: accountIndex); + BigInt? getBalance(WrappedWallet wallet, {int accountIndex = 0}) => + wallet.actual.getBalance(accountIndex: accountIndex); @override - BigInt? getUnlockedBalance(String walletId, {int accountIndex = 0}) => - _wallets[walletId]?.getUnlockedBalance(accountIndex: accountIndex); + BigInt? getUnlockedBalance(WrappedWallet wallet, {int accountIndex = 0}) => + wallet.actual.getUnlockedBalance(accountIndex: accountIndex); @override Future> getAllTxs( - String walletId, { + WrappedWallet wallet, { bool refresh = false, }) async { - final transactions = await _wallets[walletId]?.getAllTxs(refresh: refresh); + final transactions = await wallet.actual.getAllTxs(refresh: refresh); if (transactions == null) return []; return transactions .map( @@ -287,6 +291,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { key: e.key, timeStamp: e.timeStamp, minConfirms: e.minConfirms.value, + salviumData: (asset: e.asset, type: e.type), ), ) .toList(); @@ -294,15 +299,15 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { @override Future> getTxs( - String walletId, { + WrappedWallet wallet, { required Set txids, bool refresh = false, }) async { - final transactions = await _wallets[walletId]?.getTxs( + final transactions = await wallet.actual.getTxs( txids: txids, refresh: refresh, ); - if (transactions == null) return []; + return transactions .map( (e) => CsTransaction( @@ -320,6 +325,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { key: e.key, timeStamp: e.timeStamp, minConfirms: e.minConfirms.value, + salviumData: (asset: e.asset, type: e.type), ), ) .toList(); @@ -327,7 +333,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { @override Future createTx( - String walletId, { + WrappedWallet wallet, { required CsRecipient output, required int priority, required bool sweep, @@ -336,7 +342,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { required int minConfirms, required int currentHeight, }) async { - final pending = await _wallets[walletId]!.createTx( + final pending = await wallet.actual.createTx( output: lib_salvium.Recipient( address: output.address, amount: output.amount, @@ -376,9 +382,58 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { ); } + @override + Future createStakeTx( + WrappedWallet wallet, { + required CsRecipient output, + required int priority, + List? preferredInputs, + required int accountIndex, + required int minConfirms, + required int currentHeight, + }) async { + final pending = await wallet.actual.createStakeTx( + output: lib_salvium.Recipient( + address: output.address, + amount: output.amount, + ), + paymentId: "", + priority: lib_salvium.TransactionPriority.values.firstWhere( + (e) => e.value == priority, + ), + preferredInputs: preferredInputs + ?.map( + (e) => lib_salvium.Output( + address: e.address!, + hash: e.utxo.txid, + keyImage: e.utxo.keyImage!, + value: e.value, + isFrozen: e.utxo.isBlocked, + isUnlocked: + e.utxo.blockHeight != null && + (currentHeight - (e.utxo.blockHeight ?? 0)) >= minConfirms, + height: e.utxo.blockHeight ?? 0, + vout: e.utxo.vout, + spent: e.utxo.used ?? false, + spentHeight: null, // doesn't matter here + coinbase: e.utxo.isCoinbase, + ), + ) + .toList(), + accountIndex: accountIndex, + ); + + return CsPendingTransaction( + pending, + pending.amount, + pending.fee, + pending.txid, + ); + } + @override Future createTxMultiDest( - String walletId, { + WrappedWallet wallet, { required List outputs, required int priority, required bool sweep, @@ -387,7 +442,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { required int minConfirms, required int currentHeight, }) async { - final pending = await _wallets[walletId]!.createTxMultiDest( + final pending = await wallet.actual.createTxMultiDest( outputs: outputs .map( (e) => lib_salvium.Recipient(address: e.address, amount: e.amount), @@ -429,22 +484,20 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { } @override - Future commitTx(String walletId, CsPendingTransaction tx) => - _wallets[walletId]!.commitTx(tx.value as lib_salvium.PendingTransaction); + Future commitTx(WrappedWallet wallet, CsPendingTransaction tx) => + wallet.actual.commitTx(tx.value as lib_salvium.PendingTransaction); @override Future> getOutputs( - String walletId, { + WrappedWallet wallet, { bool refresh = false, bool includeSpent = false, }) async { - final outputs = await _wallets[walletId]?.getOutputs( + final outputs = await wallet.actual.getOutputs( includeSpent: includeSpent, refresh: refresh, ); - if (outputs == null) return []; - return outputs .map( (e) => CsOutput( @@ -465,12 +518,12 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { } @override - Future freezeOutput(String walletId, String keyImage) => - _wallets[walletId]!.freezeOutput(keyImage); + Future freezeOutput(WrappedWallet wallet, String keyImage) => + wallet.actual.freezeOutput(keyImage); @override - Future thawOutput(String walletId, String keyImage) => - _wallets[walletId]!.thawOutput(keyImage); + Future thawOutput(WrappedWallet wallet, String keyImage) => + wallet.actual.thawOutput(keyImage); @override List getSalviumWordList(String language) => @@ -483,6 +536,9 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { @override bool validateAddress(String address, int network) => sal_wallet_ffi.validateAddress(address, network); + + @override + String getSeed(WrappedWallet wallet) => wallet.actual.getSeed(); } //END_ON From 7ca1698039dbeb6e873cc699fabe44f99ab01e2f Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 10:36:11 -0600 Subject: [PATCH 151/178] const constructors --- lib/wl_gen/interfaces/cs_salvium_interface.dart | 2 ++ tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart | 4 +++- tool/wl_templates/FROST_frost_interface_impl.template.dart | 4 +++- tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/wl_gen/interfaces/cs_salvium_interface.dart b/lib/wl_gen/interfaces/cs_salvium_interface.dart index 0b7a509055..3ed43f7135 100644 --- a/lib/wl_gen/interfaces/cs_salvium_interface.dart +++ b/lib/wl_gen/interfaces/cs_salvium_interface.dart @@ -4,6 +4,8 @@ import 'cs_monero_interface.dart'; export '../generated/cs_salvium_interface_impl.dart'; abstract class CsSalviumInterface { + const CsSalviumInterface(); + void setUseCsSalviumLoggerInternal(bool enable); // tx prio forwarding diff --git a/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart b/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart index 2403a81c42..0842a48e7c 100644 --- a/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart +++ b/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart @@ -18,12 +18,14 @@ List hashTags({required List base64Tags}) => //END_OFF //ON -LibSparkInterface _getInterface() => _LibSparkInterfaceImpl(); +LibSparkInterface _getInterface() => const _LibSparkInterfaceImpl(); List hashTags({required List base64Tags}) => LibSpark.hashTags(base64Tags: base64Tags); class _LibSparkInterfaceImpl extends LibSparkInterface { + const _LibSparkInterfaceImpl(); + @override String get sparkBaseDerivationPath => kSparkBaseDerivationPath; diff --git a/tool/wl_templates/FROST_frost_interface_impl.template.dart b/tool/wl_templates/FROST_frost_interface_impl.template.dart index 072af512d3..e26d96692b 100644 --- a/tool/wl_templates/FROST_frost_interface_impl.template.dart +++ b/tool/wl_templates/FROST_frost_interface_impl.template.dart @@ -24,9 +24,11 @@ FrostInterface _getInterface() => throw Exception("FROST not enabled!"); //END_OFF //ON -FrostInterface _getInterface() => _FrostInterfaceImpl(); +FrostInterface _getInterface() => const _FrostInterfaceImpl(); final class _FrostInterfaceImpl extends FrostInterface { + const _FrostInterfaceImpl(); + @override ({OpaqueWrapper machinePtr, String preprocess}) attemptSignConfig({ required int network, diff --git a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart index b3e88da21d..d86c41ea3f 100644 --- a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart +++ b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart @@ -17,13 +17,15 @@ CsSalviumInterface _getInterface() => throw Exception("XMR/WOW not enabled!"); //END_OFF //ON -CsSalviumInterface _getInterface() => _CsSalviumInterfaceImpl(); +CsSalviumInterface _getInterface() => const _CsSalviumInterfaceImpl(); extension _WrappedWalletExt on WrappedWallet { lib_salvium.SalviumWallet get actual => get(); } class _CsSalviumInterfaceImpl extends CsSalviumInterface { + const _CsSalviumInterfaceImpl(); + @override void setUseCsSalviumLoggerInternal(bool enable) => lib_salvium.Logging.useLogger = enable; From 015ce8a45416260fe2296c4c2dcfa8223d8a6c33 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 11:25:08 -0600 Subject: [PATCH 152/178] fix xmr/wow interfaces --- .../edit_refresh_height_view.dart | 23 +- lib/services/churning_service.dart | 14 +- lib/wallets/wallet/impl/monero_wallet.dart | 32 +-- lib/wallets/wallet/impl/wownero_wallet.dart | 32 +-- .../intermediate/lib_monero_wallet.dart | 184 ++++++++-------- .../interfaces/cs_monero_interface.dart | 93 ++++---- ...XMR_cs_monero_interface_impl.template.dart | 203 +++++++++--------- 7 files changed, 309 insertions(+), 272 deletions(-) diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/edit_refresh_height_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/edit_refresh_height_view.dart index 47ce7d25c4..f6f6b156c1 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/edit_refresh_height_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/edit_refresh_height_view.dart @@ -5,11 +5,13 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../../../notifications/show_flush_bar.dart'; import '../../../../providers/db/main_db_provider.dart'; +import '../../../../providers/global/wallets_provider.dart'; import '../../../../themes/stack_colors.dart'; import '../../../../utilities/constants.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; +import '../../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../../../widgets/background.dart'; import '../../../../widgets/conditional_parent.dart'; import '../../../../widgets/custom_buttons/app_bar_icon_button.dart'; @@ -53,7 +55,11 @@ class _EditRefreshHeightViewState extends ConsumerState { newRestoreHeight: newHeight, isar: ref.read(mainDBProvider).isar, ); - csMonero.setRefreshFromBlockHeight(widget.walletId, newHeight); + final wallet = + ref.read(pWallets).getWallet(widget.walletId) as LibMoneroWallet?; + if (wallet?.wallet != null) { + csMonero.setRefreshFromBlockHeight(wallet!.wallet!, newHeight); + } } else { errMessage = "Invalid height: ${_controller.text}"; } @@ -89,8 +95,19 @@ class _EditRefreshHeightViewState extends ConsumerState { @override void initState() { super.initState(); - _controller = TextEditingController() - ..text = csMonero.getRefreshFromBlockHeight(widget.walletId).toString(); + _controller = TextEditingController(); + final wallet = + ref.read(pWallets).getWallet(widget.walletId) as LibMoneroWallet?; + if (wallet?.wallet != null) { + _controller.text = csMonero + .getRefreshFromBlockHeight(wallet!.wallet!) + .toString(); + } else { + _controller.text = ref + .read(pWalletInfo(widget.walletId)) + .restoreHeight + .toString(); + } } @override diff --git a/lib/services/churning_service.dart b/lib/services/churning_service.dart index 1e1885086f..b1449fd688 100644 --- a/lib/services/churning_service.dart +++ b/lib/services/churning_service.dart @@ -32,8 +32,8 @@ class ChurningService extends ChangeNotifier { Object? lastSeenError; bool _canChurn() { - if (csMonero.walletInstanceExists(walletId) && - csMonero.getUnlockedBalance(walletId, accountIndex: kAccount)! > + if (wallet.wallet != null && + csMonero.getUnlockedBalance(wallet.wallet!, accountIndex: kAccount)! > BigInt.zero) { return true; } else { @@ -48,7 +48,9 @@ class ChurningService extends ChangeNotifier { return; } - final outputs = await csMonero.getOutputs(walletId, refresh: true); + final outputs = wallet.wallet == null + ? [] + : await csMonero.getOutputs(wallet.wallet!, refresh: true); final required = wallet.cryptoCurrency.minConfirms; int lowestNumberOfConfirms = required; @@ -184,7 +186,7 @@ class ChurningService extends ChangeNotifier { Future _churnTxSimple() async { final address = csMonero.getAddress( - walletId, + wallet.wallet!, accountIndex: kAccount, addressIndex: 0, ); @@ -192,7 +194,7 @@ class ChurningService extends ChangeNotifier { final height = await wallet.chainHeight; final pending = await csMonero.createTx( - walletId, + wallet.wallet!, output: CsRecipient( address, BigInt.zero, // Doesn't matter if `sweep` is true @@ -204,6 +206,6 @@ class ChurningService extends ChangeNotifier { currentHeight: height, ); - await csMonero.commitTx(walletId, pending); + await csMonero.commitTx(wallet.wallet!, pending); } } diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index e250192d77..876bec9bf0 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -4,6 +4,8 @@ import 'package:compat/compat.dart' as lib_monero_compat; import '../../../utilities/amount/amount.dart'; import '../../../wl_gen/interfaces/cs_monero_interface.dart'; +import '../../../wl_gen/interfaces/cs_salvium_interface.dart' + show WrappedWallet; import '../../crypto_currency/crypto_currency.dart'; import '../intermediate/lib_monero_wallet.dart'; @@ -13,8 +15,7 @@ class MoneroWallet extends LibMoneroWallet { @override Future estimateFeeFor(Amount amount, BigInt feeRate) async { - if (!csMonero.walletInstanceExists(walletId) || - syncStatus is! lib_monero_compat.SyncedSyncStatus) { + if (wallet == null || syncStatus is! lib_monero_compat.SyncedSyncStatus) { return Amount.zeroWith(fractionDigits: cryptoCurrency.fractionDigits); } @@ -23,7 +24,7 @@ class MoneroWallet extends LibMoneroWallet { approximateFee = await csMonero.estimateFee( feeRate.toInt(), amount.raw, - walletId: walletId, + wallet: wallet!, ); }); @@ -38,33 +39,32 @@ class MoneroWallet extends LibMoneroWallet { csMonero.walletExists(path, csCoin: CsCoin.monero); @override - Future loadWallet({required String path, required String password}) => - csMonero.loadWallet( - walletId, - path: path, - password: password, - csCoin: CsCoin.monero, - ); + Future loadWallet({ + required String path, + required String password, + }) => csMonero.loadWallet( + walletId, + path: path, + password: password, + csCoin: CsCoin.monero, + ); @override - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }) => csMonero.getCreatedWallet( csCoin: CsCoin.monero, path: path, password: password, wordCount: wordCount, seedOffset: seedOffset, - onCreated: onCreated, ); @override - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, @@ -81,7 +81,7 @@ class MoneroWallet extends LibMoneroWallet { ); @override - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, diff --git a/lib/wallets/wallet/impl/wownero_wallet.dart b/lib/wallets/wallet/impl/wownero_wallet.dart index 560597141a..691f601266 100644 --- a/lib/wallets/wallet/impl/wownero_wallet.dart +++ b/lib/wallets/wallet/impl/wownero_wallet.dart @@ -6,6 +6,8 @@ import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../utilities/amount/amount.dart'; import '../../../utilities/enums/fee_rate_type_enum.dart'; import '../../../wl_gen/interfaces/cs_monero_interface.dart'; +import '../../../wl_gen/interfaces/cs_salvium_interface.dart' + show WrappedWallet; import '../../crypto_currency/crypto_currency.dart'; import '../../models/tx_data.dart'; import '../intermediate/lib_monero_wallet.dart'; @@ -16,8 +18,7 @@ class WowneroWallet extends LibMoneroWallet { @override Future estimateFeeFor(Amount amount, BigInt feeRate) async { - if (!csMonero.walletInstanceExists(walletId) || - syncStatus is! lib_monero_compat.SyncedSyncStatus) { + if (wallet == null || syncStatus is! lib_monero_compat.SyncedSyncStatus) { return Amount.zeroWith(fractionDigits: cryptoCurrency.fractionDigits); } @@ -68,7 +69,7 @@ class WowneroWallet extends LibMoneroWallet { approximateFee = await csMonero.estimateFee( feeRate.toInt(), amount.raw, - walletId: walletId, + wallet: wallet!, ); } } @@ -89,33 +90,32 @@ class WowneroWallet extends LibMoneroWallet { csMonero.walletExists(path, csCoin: CsCoin.wownero); @override - Future loadWallet({required String path, required String password}) => - csMonero.loadWallet( - walletId, - path: path, - password: password, - csCoin: CsCoin.wownero, - ); + Future loadWallet({ + required String path, + required String password, + }) => csMonero.loadWallet( + walletId, + path: path, + password: password, + csCoin: CsCoin.wownero, + ); @override - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }) => csMonero.getCreatedWallet( csCoin: CsCoin.wownero, path: path, password: password, wordCount: wordCount, seedOffset: seedOffset, - onCreated: onCreated, ); @override - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, @@ -132,7 +132,7 @@ class WowneroWallet extends LibMoneroWallet { ); @override - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, diff --git a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart index e0f17630e9..9f88a62769 100644 --- a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart @@ -35,6 +35,7 @@ import '../../../utilities/enums/fee_rate_type_enum.dart'; import '../../../utilities/logger.dart'; import '../../../utilities/stack_file_system.dart'; import '../../../wl_gen/interfaces/cs_monero_interface.dart'; +import '../../../wl_gen/interfaces/cs_salvium_interface.dart'; import '../../crypto_currency/intermediate/cryptonote_currency.dart'; import '../../isar/models/wallet_info.dart'; import '../../models/tx_data.dart'; @@ -50,6 +51,8 @@ abstract class LibMoneroWallet @override int get isarTransactionVersion => 2; + WrappedWallet? wallet; + LibMoneroWallet(super.currency, this.compatType) { final bus = GlobalEventBus.instance; @@ -135,18 +138,19 @@ abstract class LibMoneroWallet int currentKnownChainHeight = 0; double highestPercentCached = 0; - Future loadWallet({required String path, required String password}); + Future loadWallet({ + required String path, + required String password, + }); - Future getCreatedWallet({ + Future getCreatedWallet({ required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }); - Future getRestoredWallet({ + Future getRestoredWallet({ required String path, required String password, required String mnemonic, @@ -154,7 +158,7 @@ abstract class LibMoneroWallet int height = 0, }); - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String path, required String password, required String address, @@ -167,17 +171,16 @@ abstract class LibMoneroWallet bool walletExists(String path); String getTxKeyFor({required String txid}) { - if (!csMonero.walletInstanceExists(walletId)) { + if (wallet == null) { throw Exception("Cannot get tx key in uninitialized libMoneroWallet"); } - return csMonero.getTxKey(walletId, txid); + return csMonero.getTxKey(wallet!, txid); } void _setListener() { - if (csMonero.walletInstanceExists(walletId) && - !csMonero.hasListeners(walletId)) { + if (wallet != null && !csMonero.hasListeners(wallet!)) { csMonero.addListener( - walletId, + wallet!, CsWalletListener( onSyncingUpdate: onSyncingUpdate, onNewBlock: onNewBlock, @@ -194,7 +197,7 @@ abstract class LibMoneroWallet Future open() async { bool wasNull = false; - if (!csMonero.walletInstanceExists(walletId)) { + if (wallet == null) { wasNull = true; // libMoneroWalletT?.close(); final path = await pathForWallet(name: walletId, type: compatType); @@ -208,7 +211,7 @@ abstract class LibMoneroWallet throw Exception("Password not found $e, $s"); } - await loadWallet(path: path, password: password); + wallet = await loadWallet(path: path, password: password); _setListener(); @@ -230,15 +233,15 @@ abstract class LibMoneroWallet if (wasNull) { try { _setSyncStatus(lib_monero_compat.ConnectingSyncStatus()); - csMonero.startSyncing(walletId); + csMonero.startSyncing(wallet!); } catch (_) { _setSyncStatus(lib_monero_compat.FailedSyncStatus()); // TODO log } } _setListener(); - csMonero.startListeners(walletId); - csMonero.startAutoSaving(walletId); + csMonero.startListeners(wallet!); + csMonero.startAutoSaving(wallet!); unawaited(refresh()); } @@ -263,12 +266,12 @@ abstract class LibMoneroWallet appRoot: appRoot, ); } - await csMonero.save(walletId); + await csMonero.save(wallet!); } Address addressFor({required int index, int account = 0}) { final address = csMonero.getAddress( - walletId, + wallet!, accountIndex: account, addressIndex: index, ); @@ -292,17 +295,16 @@ abstract class LibMoneroWallet Future getKeys() async { final oldInfo = getLibMoneroWalletInfo(walletId); - if (!csMonero.walletInstanceExists(walletId) || - (oldInfo != null && oldInfo.name != walletId)) { + if (wallet == null || (oldInfo != null && oldInfo.name != walletId)) { return null; } try { return CWKeyData( walletId: walletId, - publicViewKey: csMonero.getPublicViewKey(walletId), - privateViewKey: csMonero.getPrivateViewKey(walletId), - publicSpendKey: csMonero.getPublicSpendKey(walletId), - privateSpendKey: csMonero.getPrivateSpendKey(walletId), + publicViewKey: csMonero.getPublicViewKey(wallet!), + privateViewKey: csMonero.getPrivateViewKey(wallet!), + publicSpendKey: csMonero.getPublicSpendKey(wallet!), + privateSpendKey: csMonero.getPrivateSpendKey(wallet!), ); } catch (e, s) { Logging.instance.f("getKeys failed: ", error: e, stackTrace: s); @@ -327,11 +329,8 @@ abstract class LibMoneroWallet } catch (e, s) { throw Exception("Password not found $e, $s"); } - await loadWallet(path: path, password: password); - return ( - csMonero.getAddress(walletId), - csMonero.getPrivateViewKey(walletId), - ); + wallet = await loadWallet(path: path, password: password); + return (csMonero.getAddress(wallet!), csMonero.getPrivateViewKey(wallet!)); } @override @@ -348,22 +347,15 @@ abstract class LibMoneroWallet value: password, ); - late final int refreshFromBlockHeight; - late final String seedPhrase; - - await getCreatedWallet( + final wallet = await getCreatedWallet( path: path, password: password, wordCount: wordCount, seedOffset: "", // default for non restored wallets for now - onCreated: (height, seed) { - refreshFromBlockHeight = height; - seedPhrase = seed; - }, ); await info.updateRestoreHeight( - newRestoreHeight: refreshFromBlockHeight, + newRestoreHeight: csMonero.getRefreshFromBlockHeight(wallet), isar: mainDB.isar, ); @@ -371,7 +363,7 @@ abstract class LibMoneroWallet // before wallet.init() is called await secureStorageInterface.write( key: Wallet.mnemonicKey(walletId: walletId), - value: seedPhrase, + value: csMonero.getSeed(wallet), ); await secureStorageInterface.write( key: Wallet.mnemonicPassphraseKey(walletId: walletId), @@ -394,8 +386,8 @@ abstract class LibMoneroWallet await mainDB.deleteWalletBlockchainData(walletId); highestPercentCached = 0; - unawaited(csMonero.rescanBlockchain(walletId)); - csMonero.startSyncing(walletId); + unawaited(csMonero.rescanBlockchain(wallet!)); + csMonero.startSyncing(wallet!); // unawaited(save()); }); unawaited(refresh()); @@ -433,11 +425,7 @@ abstract class LibMoneroWallet value: password, ); - if (!csMonero.walletInstanceExists(walletId)) { - await exit(); - } - - await getRestoredWallet( + final wallet = await getRestoredWallet( path: path, password: password, mnemonic: mnemonic, @@ -445,6 +433,12 @@ abstract class LibMoneroWallet seedOffset: seedOffset, ); + if (this.wallet != null) { + await exit(); + } + + this.wallet = wallet; + _setListener(); final newReceivingAddress = @@ -453,7 +447,7 @@ abstract class LibMoneroWallet walletId: walletId, derivationIndex: 0, derivationPath: null, - value: csMonero.getAddress(walletId), + value: csMonero.getAddress(this.wallet!), publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -472,12 +466,12 @@ abstract class LibMoneroWallet _setListener(); // libMoneroWallet?.setRecoveringFromSeed(isRecovery: true); - unawaited(csMonero.rescanBlockchain(walletId)); - csMonero.startSyncing(walletId); + unawaited(csMonero.rescanBlockchain(wallet!)); + csMonero.startSyncing(wallet!); // await save(); - csMonero.startListeners(walletId); - csMonero.startAutoSaving(walletId); + csMonero.startListeners(wallet!); + csMonero.startAutoSaving(wallet!); } catch (e, s) { Logging.instance.e( "Exception rethrown from recoverFromMnemonic(): ", @@ -495,7 +489,7 @@ abstract class LibMoneroWallet @override Future pingCheck() { if (_canPing) { - return csMonero.isConnectedToDaemon(walletId); + return csMonero.isConnectedToDaemon(wallet!); } else { return Future.value(false); } @@ -522,7 +516,7 @@ abstract class LibMoneroWallet if (_requireMutex) { await _torConnectingLock.protect(() async { await csMonero.connect( - walletId, + wallet!, daemonAddress: "$host:${node.port}", daemonUsername: node.loginName, daemonPassword: await node.getPassword(secureStorageInterface), @@ -537,7 +531,7 @@ abstract class LibMoneroWallet }); } else { await csMonero.connect( - walletId, + wallet!, daemonAddress: "$host:${node.port}", daemonUsername: node.loginName, daemonPassword: await node.getPassword(secureStorageInterface), @@ -550,9 +544,9 @@ abstract class LibMoneroWallet : "${proxy.host.address}:${proxy.port}", ); } - csMonero.startSyncing(walletId); - csMonero.startListeners(walletId); - csMonero.startAutoSaving(walletId); + csMonero.startSyncing(wallet!); + csMonero.startListeners(wallet!); + csMonero.startAutoSaving(wallet!); _setSyncStatus(lib_monero_compat.ConnectedSyncStatus()); } catch (e, s) { @@ -569,7 +563,7 @@ abstract class LibMoneroWallet @override Future updateTransactions() async { - if (!csMonero.walletInstanceExists(walletId)) { + if (wallet == null) { return; } @@ -581,7 +575,7 @@ abstract class LibMoneroWallet .txidProperty() .findAll(); - final allTxids = await csMonero.getAllTxids(walletId, refresh: true); + final allTxids = await csMonero.getAllTxids(wallet!, refresh: true); final txidsToFetch = allTxids.toSet().difference(localTxids.toSet()); @@ -590,13 +584,13 @@ abstract class LibMoneroWallet } final transactions = await csMonero.getTxs( - walletId, + wallet!, txids: txidsToFetch, refresh: false, ); final allOutputs = await csMonero.getOutputs( - walletId, + wallet!, includeSpent: true, refresh: true, ); @@ -707,7 +701,7 @@ abstract class LibMoneroWallet Future get availableBalance async { try { return Amount( - rawValue: csMonero.getUnlockedBalance(walletId)!, + rawValue: csMonero.getUnlockedBalance(wallet!)!, fractionDigits: cryptoCurrency.fractionDigits, ); } catch (_) { @@ -717,14 +711,14 @@ abstract class LibMoneroWallet Future get totalBalance async { try { - final full = csMonero.getBalance(walletId); + final full = csMonero.getBalance(wallet!); if (full != null) { return Amount( rawValue: full, fractionDigits: cryptoCurrency.fractionDigits, ); } else { - final transactions = await csMonero.getAllTxs(walletId, refresh: true); + final transactions = await csMonero.getAllTxs(wallet!, refresh: true); BigInt transactionBalance = BigInt.zero; for (final tx in transactions) { if (!tx.isSpend) { @@ -746,11 +740,13 @@ abstract class LibMoneroWallet @override Future exit() async { - Logging.instance.i("exit called on $walletId"); - csMonero.stopAutoSaving(walletId); - csMonero.stopListeners(walletId); - csMonero.stopSyncing(walletId); - await csMonero.save(walletId); + Logging.instance.i("exit called on $wallet!"); + if (wallet != null) { + csMonero.stopAutoSaving(wallet!); + csMonero.stopListeners(wallet!); + csMonero.stopSyncing(wallet!); + await csMonero.save(wallet!); + } } Future pathForWalletDir({ @@ -832,7 +828,7 @@ abstract class LibMoneroWallet final _utxosUpdateLock = Mutex(); Future onUTXOsChanged(List utxos) async { await _utxosUpdateLock.protect(() async { - final cwUtxos = await csMonero.getOutputs(walletId, refresh: true); + final cwUtxos = await csMonero.getOutputs(wallet!, refresh: true); // bool changed = false; @@ -849,12 +845,12 @@ abstract class LibMoneroWallet if (u.isBlocked) { if (!cw.isFrozen) { - await csMonero.freezeOutput(walletId, cw.keyImage); + await csMonero.freezeOutput(wallet!, cw.keyImage); // changed = true; } } else { if (cw.isFrozen) { - await csMonero.thawOutput(walletId, cw.keyImage); + await csMonero.thawOutput(wallet!, cw.keyImage); // changed = true; } } @@ -1011,9 +1007,11 @@ abstract class LibMoneroWallet if (mismatch) { _canPing = false; - csMonero.stopAutoSaving(walletId); - csMonero.stopListeners(walletId); - csMonero.stopSyncing(walletId); + if (wallet != null) { + csMonero.stopAutoSaving(wallet!); + csMonero.stopListeners(wallet!); + csMonero.stopSyncing(wallet!); + } _setSyncStatus(lib_monero_compat.FailedSyncStatus()); } @@ -1031,7 +1029,9 @@ abstract class LibMoneroWallet @override Future updateUTXOs() async { final List outputArray = []; - final utxos = await csMonero.getOutputs(walletId, refresh: true); + final utxos = wallet == null + ? [] + : await csMonero.getOutputs(wallet!, refresh: true); for (final rawUTXO in utxos) { if (!rawUTXO.spent) { final current = await mainDB.isar.utxos @@ -1120,7 +1120,7 @@ abstract class LibMoneroWallet // Slight possibility of race but should be irrelevant await refreshMutex.acquire(); - csMonero.startSyncing(walletId); + csMonero.startSyncing(wallet!); _setSyncStatus(lib_monero_compat.StartingSyncStatus()); await updateTransactions(); @@ -1134,7 +1134,7 @@ abstract class LibMoneroWallet refreshMutex.release(); } - final synced = await csMonero.isSynced(walletId); + final synced = wallet != null && await csMonero.isSynced(wallet!); if (synced) { _setSyncStatus(lib_monero_compat.SyncedSyncStatus()); @@ -1183,7 +1183,7 @@ abstract class LibMoneroWallet try { int highestIndex = -1; - final entries = await csMonero.getAllTxs(walletId, refresh: true); + final entries = await csMonero.getAllTxs(wallet!, refresh: true); for (final element in entries) { if (!element.isSpend) { final int curAddressIndex = element.addressIndexes.isEmpty @@ -1326,7 +1326,7 @@ abstract class LibMoneroWallet final CsPendingTransaction pendingTransaction; if (outputs.length == 1) { pendingTransaction = await csMonero.createTx( - walletId, + wallet!, minConfirms: cryptoCurrency.minConfirms, currentHeight: height, output: outputs.first, @@ -1337,7 +1337,7 @@ abstract class LibMoneroWallet ); } else { pendingTransaction = await csMonero.createTxMultiDest( - walletId, + wallet!, minConfirms: cryptoCurrency.minConfirms, currentHeight: height, outputs: outputs, @@ -1383,7 +1383,7 @@ abstract class LibMoneroWallet Future confirmSend({required TxData txData}) async { try { try { - await csMonero.commitTx(walletId, txData.pendingTransaction!); + await csMonero.commitTx(wallet!, txData.pendingTransaction!); Logging.instance.d( "transaction ${txData.pendingTransaction!.txid} has been sent", @@ -1433,10 +1433,7 @@ abstract class LibMoneroWallet value: password, ); - if (csMonero.walletInstanceExists(walletId)) { - await exit(); - } - await getRestoredFromViewKeyWallet( + final wallet = await getRestoredFromViewKeyWallet( path: path, password: password, address: data.address, @@ -1444,6 +1441,11 @@ abstract class LibMoneroWallet height: height, ); + if (this.wallet == null) { + await exit(); + } + this.wallet = wallet; + _setListener(); final newReceivingAddress = @@ -1452,7 +1454,7 @@ abstract class LibMoneroWallet walletId: walletId, derivationIndex: 0, derivationPath: null, - value: csMonero.getAddress(walletId), + value: csMonero.getAddress(this.wallet!), publicKey: [], type: AddressType.cryptonote, subType: AddressSubType.receiving, @@ -1467,12 +1469,12 @@ abstract class LibMoneroWallet await updateNode(); _setListener(); - unawaited(csMonero.rescanBlockchain(walletId)); - csMonero.startSyncing(walletId); + unawaited(csMonero.rescanBlockchain(this.wallet!)); + csMonero.startSyncing(this.wallet!); // await save(); - csMonero.startListeners(walletId); - csMonero.startAutoSaving(walletId); + csMonero.startListeners(this.wallet!); + csMonero.startAutoSaving(this.wallet!); } catch (e, s) { Logging.instance.e( "Exception rethrown from recoverViewOnly(): ", diff --git a/lib/wl_gen/interfaces/cs_monero_interface.dart b/lib/wl_gen/interfaces/cs_monero_interface.dart index 4589a714bf..8987508436 100644 --- a/lib/wl_gen/interfaces/cs_monero_interface.dart +++ b/lib/wl_gen/interfaces/cs_monero_interface.dart @@ -1,8 +1,11 @@ import '../../models/input.dart'; +import 'cs_salvium_interface.dart' show WrappedWallet; export '../generated/cs_monero_interface_impl.dart'; abstract class CsMoneroInterface { + const CsMoneroInterface(); + void setUseCsMoneroLoggerInternal(bool enable); // tx prio forwarding @@ -10,13 +13,15 @@ abstract class CsMoneroInterface { int getTxPriorityMedium(); int getTxPriorityNormal(); - bool walletInstanceExists(String walletId); - bool walletExists(String path, {required CsCoin csCoin}); - Future estimateFee(int rate, BigInt amount, {required String walletId}); + Future estimateFee( + int rate, + BigInt amount, { + required WrappedWallet wallet, + }); - Future loadWallet( + Future loadWallet( String walletId, { required CsCoin csCoin, required String path, @@ -24,22 +29,20 @@ abstract class CsMoneroInterface { }); String getAddress( - String walletId, { + WrappedWallet wallet, { int accountIndex = 0, int addressIndex = 0, }); - Future getCreatedWallet({ + Future getCreatedWallet({ required CsCoin csCoin, required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }); - Future getRestoredWallet({ + Future getRestoredWallet({ required String walletId, required CsCoin csCoin, required String path, @@ -49,7 +52,7 @@ abstract class CsMoneroInterface { int height = 0, }); - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String walletId, required CsCoin csCoin, required String path, @@ -59,35 +62,35 @@ abstract class CsMoneroInterface { int height = 0, }); - String getTxKey(String walletId, String txid); + String getTxKey(WrappedWallet wallet, String txid); - Future save(String walletId); + Future save(WrappedWallet wallet); - String getPublicViewKey(String walletId); - String getPrivateViewKey(String walletId); - String getPublicSpendKey(String walletId); - String getPrivateSpendKey(String walletId); + String getPublicViewKey(WrappedWallet wallet); + String getPrivateViewKey(WrappedWallet wallet); + String getPublicSpendKey(WrappedWallet wallet); + String getPrivateSpendKey(WrappedWallet wallet); - Future isSynced(String walletId); - void startSyncing(String walletId); - void stopSyncing(String walletId); + Future isSynced(WrappedWallet wallet); + void startSyncing(WrappedWallet wallet); + void stopSyncing(WrappedWallet wallet); - void startAutoSaving(String walletId); - void stopAutoSaving(String walletId); + void startAutoSaving(WrappedWallet wallet); + void stopAutoSaving(WrappedWallet wallet); - bool hasListeners(String walletId); - void addListener(String walletId, CsWalletListener listener); - void startListeners(String walletId); - void stopListeners(String walletId); + bool hasListeners(WrappedWallet wallet); + void addListener(WrappedWallet wallet, CsWalletListener listener); + void startListeners(WrappedWallet wallet); + void stopListeners(WrappedWallet wallet); - Future rescanBlockchain(String walletId); - Future isConnectedToDaemon(String walletId); + Future rescanBlockchain(WrappedWallet wallet); + Future isConnectedToDaemon(WrappedWallet wallet); - int getRefreshFromBlockHeight(String walletId); - void setRefreshFromBlockHeight(String walletId, int height); + int getRefreshFromBlockHeight(WrappedWallet wallet); + void setRefreshFromBlockHeight(WrappedWallet wallet, int height); Future connect( - String walletId, { + WrappedWallet wallet, { required String daemonAddress, required bool trusted, String? daemonUsername, @@ -97,24 +100,27 @@ abstract class CsMoneroInterface { String? socksProxyAddress, }); - Future> getAllTxids(String walletId, {bool refresh = false}); + Future> getAllTxids( + WrappedWallet wallet, { + bool refresh = false, + }); - BigInt? getBalance(String walletId, {int accountIndex = 0}); - BigInt? getUnlockedBalance(String walletId, {int accountIndex = 0}); + BigInt? getBalance(WrappedWallet wallet, {int accountIndex = 0}); + BigInt? getUnlockedBalance(WrappedWallet wallet, {int accountIndex = 0}); Future> getAllTxs( - String walletId, { + WrappedWallet wallet, { bool refresh = false, }); Future> getTxs( - String walletId, { + WrappedWallet wallet, { required Set txids, bool refresh = false, }); Future createTx( - String walletId, { + WrappedWallet wallet, { required CsRecipient output, required int priority, required bool sweep, @@ -125,7 +131,7 @@ abstract class CsMoneroInterface { }); Future createTxMultiDest( - String walletId, { + WrappedWallet wallet, { required List outputs, required int priority, required bool sweep, @@ -135,16 +141,16 @@ abstract class CsMoneroInterface { required int currentHeight, }); - Future commitTx(String walletId, CsPendingTransaction tx); + Future commitTx(WrappedWallet wallet, CsPendingTransaction tx); Future> getOutputs( - String walletId, { + WrappedWallet wallet, { bool refresh = false, bool includeSpent = false, }); - Future freezeOutput(String walletId, String keyImage); - Future thawOutput(String walletId, String keyImage); + Future freezeOutput(WrappedWallet wallet, String keyImage); + Future thawOutput(WrappedWallet wallet, String keyImage); List getMoneroWordList(String language); List getWowneroWordList(String language, int seedLength); @@ -152,6 +158,8 @@ abstract class CsMoneroInterface { int getHeightByDate(DateTime date, {required CsCoin csCoin}); bool validateAddress(String address, int network, {required CsCoin csCoin}); + + String getSeed(WrappedWallet wallet); } enum CsCoin { monero, wownero } @@ -221,7 +229,7 @@ final class CsPendingTransaction { // forwarding class final class CsTransaction { - CsTransaction( { + CsTransaction({ required this.displayLabel, required this.description, required this.fee, @@ -293,7 +301,6 @@ final class CsTransaction { bool get isPending => confirmations < minConfirms; final ({int type, String asset})? salviumData; - } // forwarding class diff --git a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart index 3ca3909e74..adcd9518ef 100644 --- a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart +++ b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart @@ -18,18 +18,15 @@ CsMoneroInterface _getInterface() => throw Exception("XMR/WOW not enabled!"); //END_OFF //ON -CsMoneroInterface _getInterface() => _CsMoneroInterfaceImpl(); +CsMoneroInterface _getInterface() => const _CsMoneroInterfaceImpl(); class _CsMoneroInterfaceImpl extends CsMoneroInterface { - final Map _wallets = {}; + const _CsMoneroInterfaceImpl(); @override void setUseCsMoneroLoggerInternal(bool enable) => lib_monero.Logging.useLogger = enable; - @override - bool walletInstanceExists(String walletId) => _wallets[walletId] != null; - @override bool walletExists(String path, {required CsCoin csCoin}) => switch (csCoin) { CsCoin.monero => lib_monero.MoneroWallet.isWalletExist(path), @@ -37,7 +34,11 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { }; @override - Future estimateFee(int rate, BigInt amount, {required String walletId}) { + Future estimateFee( + int rate, + BigInt amount, { + required WrappedWallet wallet, + }) { lib_monero.TransactionPriority priority; switch (rate) { case 1: @@ -58,31 +59,30 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { break; } - return _wallets[walletId]!.estimateFee(priority, amount.toInt()); + return wallet.get().estimateFee( + priority, + amount.toInt(), + ); } @override - Future loadWallet( + Future loadWallet( String walletId, { required CsCoin csCoin, required String path, required String password, }) async { - switch (csCoin) { - case CsCoin.monero: - _wallets[walletId] = await lib_monero.MoneroWallet.loadWallet( - path: path, - password: password, - ); - break; + return WrappedWallet(switch (csCoin) { + CsCoin.monero => await lib_monero.MoneroWallet.loadWallet( + path: path, + password: password, + ), - case CsCoin.wownero: - _wallets[walletId] = await lib_monero.WowneroWallet.loadWallet( - path: path, - password: password, - ); - break; - } + CsCoin.wownero => await lib_monero.WowneroWallet.loadWallet( + path: path, + password: password, + ), + }); } @override @@ -96,22 +96,21 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { @override String getAddress( - String walletId, { + WrappedWallet wallet, { int accountIndex = 0, int addressIndex = 0, - }) => _wallets[walletId]! + }) => wallet + .get() .getAddress(accountIndex: accountIndex, addressIndex: addressIndex) .value; @override - Future getCreatedWallet({ + Future getCreatedWallet({ required CsCoin csCoin, required String path, required String password, required int wordCount, required String seedOffset, - required final void Function(int refreshFromBlockHeight, String seed) - onCreated, }) async { final lib_monero.Wallet wallet; @@ -147,14 +146,11 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { break; } - onCreated( - wallet.getRefreshFromBlockHeight(), - wallet.getSeed(seedOffset: seedOffset).trim(), - ); + return WrappedWallet(wallet); } @override - Future getRestoredWallet({ + Future getRestoredWallet({ required String walletId, required CsCoin csCoin, required String path, @@ -163,7 +159,7 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { required String seedOffset, int height = 0, }) async { - _wallets[walletId] = switch (csCoin) { + return WrappedWallet(switch (csCoin) { CsCoin.monero => await lib_monero.MoneroWallet.restoreWalletFromSeed( path: path, password: password, @@ -179,11 +175,11 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { restoreHeight: height, seedOffset: seedOffset, ), - }; + }); } @override - Future getRestoredFromViewKeyWallet({ + Future getRestoredFromViewKeyWallet({ required String walletId, required CsCoin csCoin, required String path, @@ -192,7 +188,7 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { required String privateViewKey, int height = 0, }) async { - _wallets[walletId] = switch (csCoin) { + return WrappedWallet(switch (csCoin) { CsCoin.monero => await lib_monero.MoneroWallet.createViewOnlyWallet( path: path, password: password, @@ -208,56 +204,60 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { viewKey: privateViewKey, restoreHeight: height, ), - }; + }); } @override - String getTxKey(String walletId, String txid) => - _wallets[walletId]!.getTxKey(txid); + String getTxKey(WrappedWallet wallet, String txid) => + wallet.get().getTxKey(txid); @override - Future save(String walletId) => _wallets[walletId]!.save(); + Future save(WrappedWallet wallet) => + wallet.get().save(); @override - String getPublicViewKey(String walletId) => - _wallets[walletId]!.getPublicViewKey(); + String getPublicViewKey(WrappedWallet wallet) => + wallet.get().getPublicViewKey(); @override - String getPrivateViewKey(String walletId) => - _wallets[walletId]!.getPrivateViewKey(); + String getPrivateViewKey(WrappedWallet wallet) => + wallet.get().getPrivateViewKey(); @override - String getPublicSpendKey(String walletId) => - _wallets[walletId]!.getPublicSpendKey(); + String getPublicSpendKey(WrappedWallet wallet) => + wallet.get().getPublicSpendKey(); @override - String getPrivateSpendKey(String walletId) => - _wallets[walletId]!.getPrivateSpendKey(); + String getPrivateSpendKey(WrappedWallet wallet) => + wallet.get().getPrivateSpendKey(); @override - Future isSynced(String walletId) => - _wallets[walletId]?.isSynced() ?? Future.value(false); + Future isSynced(WrappedWallet wallet) => + wallet.get().isSynced(); @override - void startSyncing(String walletId) => _wallets[walletId]?.startSyncing(); + void startSyncing(WrappedWallet wallet) => + wallet.get().startSyncing(); @override - void stopSyncing(String walletId) => _wallets[walletId]?.stopSyncing(); + void stopSyncing(WrappedWallet wallet) => + wallet.get().stopSyncing(); @override - void startAutoSaving(String walletId) => - _wallets[walletId]?.startAutoSaving(); + void startAutoSaving(WrappedWallet wallet) => + wallet.get().startAutoSaving(); @override - void stopAutoSaving(String walletId) => _wallets[walletId]?.stopAutoSaving(); + void stopAutoSaving(WrappedWallet wallet) => + wallet.get().stopAutoSaving(); @override - bool hasListeners(String walletId) => - _wallets[walletId]!.getListeners().isNotEmpty; + bool hasListeners(WrappedWallet wallet) => + wallet.get().getListeners().isNotEmpty; @override - void addListener(String walletId, CsWalletListener listener) => - _wallets[walletId]?.addListener( + void addListener(WrappedWallet wallet, CsWalletListener listener) => + wallet.get().addListener( lib_monero.WalletListener( onSyncingUpdate: listener.onSyncingUpdate, onNewBlock: listener.onNewBlock, @@ -267,30 +267,32 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { ); @override - void startListeners(String walletId) => _wallets[walletId]?.startListeners(); + void startListeners(WrappedWallet wallet) => + wallet.get().startListeners(); @override - void stopListeners(String walletId) => _wallets[walletId]?.stopListeners(); + void stopListeners(WrappedWallet wallet) => + wallet.get().stopListeners(); @override - int getRefreshFromBlockHeight(String walletId) => - _wallets[walletId]!.getRefreshFromBlockHeight(); + int getRefreshFromBlockHeight(WrappedWallet wallet) => + wallet.get().getRefreshFromBlockHeight(); @override - void setRefreshFromBlockHeight(String walletId, int height) => - _wallets[walletId]!.setRefreshFromBlockHeight(height); + void setRefreshFromBlockHeight(WrappedWallet wallet, int height) => + wallet.get().setRefreshFromBlockHeight(height); @override - Future rescanBlockchain(String walletId) => - _wallets[walletId]?.rescanBlockchain() ?? Future.value(false); + Future rescanBlockchain(WrappedWallet wallet) => + wallet.get().rescanBlockchain(); @override - Future isConnectedToDaemon(String walletId) => - _wallets[walletId]?.isConnectedToDaemon() ?? Future.value(false); + Future isConnectedToDaemon(WrappedWallet wallet) => + wallet.get().isConnectedToDaemon(); @override Future connect( - String walletId, { + WrappedWallet wallet, { required String daemonAddress, required bool trusted, String? daemonUsername, @@ -299,7 +301,7 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { bool isLightWallet = false, String? socksProxyAddress, }) async { - await _wallets[walletId]?.connect( + await wallet.get().connect( daemonAddress: daemonAddress, trusted: trusted, daemonUsername: daemonUsername, @@ -311,24 +313,29 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { } @override - Future> getAllTxids(String walletId, {bool refresh = false}) => - _wallets[walletId]!.getAllTxids(refresh: refresh); + Future> getAllTxids( + WrappedWallet wallet, { + bool refresh = false, + }) => wallet.get().getAllTxids(refresh: refresh); @override - BigInt? getBalance(String walletId, {int accountIndex = 0}) => - _wallets[walletId]?.getBalance(accountIndex: accountIndex); + BigInt? getBalance(WrappedWallet wallet, {int accountIndex = 0}) => + wallet.get().getBalance(accountIndex: accountIndex); @override - BigInt? getUnlockedBalance(String walletId, {int accountIndex = 0}) => - _wallets[walletId]?.getUnlockedBalance(accountIndex: accountIndex); + BigInt? getUnlockedBalance(WrappedWallet wallet, {int accountIndex = 0}) => + wallet.get().getUnlockedBalance( + accountIndex: accountIndex, + ); @override Future> getAllTxs( - String walletId, { + WrappedWallet wallet, { bool refresh = false, }) async { - final transactions = await _wallets[walletId]?.getAllTxs(refresh: refresh); - if (transactions == null) return []; + final transactions = await wallet.get().getAllTxs( + refresh: refresh, + ); return transactions .map( (e) => CsTransaction( @@ -353,15 +360,14 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { @override Future> getTxs( - String walletId, { + WrappedWallet wallet, { required Set txids, bool refresh = false, }) async { - final transactions = await _wallets[walletId]?.getTxs( + final transactions = await wallet.get().getTxs( txids: txids, refresh: refresh, ); - if (transactions == null) return []; return transactions .map( (e) => CsTransaction( @@ -386,7 +392,7 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { @override Future createTx( - String walletId, { + WrappedWallet wallet, { required CsRecipient output, required int priority, required bool sweep, @@ -395,7 +401,7 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { required int minConfirms, required int currentHeight, }) async { - final pending = await _wallets[walletId]!.createTx( + final pending = await wallet.get().createTx( output: lib_monero.Recipient( address: output.address, amount: output.amount, @@ -437,7 +443,7 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { @override Future createTxMultiDest( - String walletId, { + WrappedWallet wallet, { required List outputs, required int priority, required bool sweep, @@ -446,7 +452,7 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { required int minConfirms, required int currentHeight, }) async { - final pending = await _wallets[walletId]!.createTxMultiDest( + final pending = await wallet.get().createTxMultiDest( outputs: outputs .map( (e) => lib_monero.Recipient(address: e.address, amount: e.amount), @@ -488,22 +494,21 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { } @override - Future commitTx(String walletId, CsPendingTransaction tx) => - _wallets[walletId]!.commitTx(tx.value as lib_monero.PendingTransaction); + Future commitTx(WrappedWallet wallet, CsPendingTransaction tx) => wallet + .get() + .commitTx(tx.value as lib_monero.PendingTransaction); @override Future> getOutputs( - String walletId, { + WrappedWallet wallet, { bool refresh = false, bool includeSpent = false, }) async { - final outputs = await _wallets[walletId]?.getOutputs( + final outputs = await wallet.get().getOutputs( includeSpent: includeSpent, refresh: refresh, ); - if (outputs == null) return []; - return outputs .map( (e) => CsOutput( @@ -524,12 +529,12 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { } @override - Future freezeOutput(String walletId, String keyImage) => - _wallets[walletId]!.freezeOutput(keyImage); + Future freezeOutput(WrappedWallet wallet, String keyImage) => + wallet.get().freezeOutput(keyImage); @override - Future thawOutput(String walletId, String keyImage) => - _wallets[walletId]!.thawOutput(keyImage); + Future thawOutput(WrappedWallet wallet, String keyImage) => + wallet.get().thawOutput(keyImage); @override List getMoneroWordList(String language) => @@ -554,6 +559,10 @@ class _CsMoneroInterfaceImpl extends CsMoneroInterface { CsCoin.monero => xmr_wallet_ffi.validateAddress(address, network), CsCoin.wownero => wow_wallet_ffi.validateAddress(address, network), }; + + @override + String getSeed(WrappedWallet wallet) => + wallet.get().getSeed(); } //END_ON From 957e02c58fc53c78b285c37fb8586c166a7eeb46 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 14:20:35 -0600 Subject: [PATCH 153/178] basic salvium stake transaction ui --- .../salvium_create_stake_view.dart | 414 ++++++++++++++++++ lib/pages/wallet_view/wallet_view.dart | 12 + .../sub_widgets/desktop_wallet_features.dart | 43 ++ lib/route_generator.dart | 11 + 4 files changed, 480 insertions(+) create mode 100644 lib/pages/salvium_stake/salvium_create_stake_view.dart diff --git a/lib/pages/salvium_stake/salvium_create_stake_view.dart b/lib/pages/salvium_stake/salvium_create_stake_view.dart new file mode 100644 index 0000000000..58a9a5af4d --- /dev/null +++ b/lib/pages/salvium_stake/salvium_create_stake_view.dart @@ -0,0 +1,414 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../../pages_desktop_specific/desktop_home_view.dart'; +import '../../providers/global/locale_provider.dart'; +import '../../providers/global/wallets_provider.dart'; +import '../../route_generator.dart'; +import '../../themes/stack_colors.dart'; +import '../../utilities/amount/amount.dart'; +import '../../utilities/amount/amount_formatter.dart'; +import '../../utilities/amount/amount_input_formatter.dart'; +import '../../utilities/amount/amount_unit.dart'; +import '../../utilities/enums/fee_rate_type_enum.dart'; +import '../../utilities/logger.dart'; +import '../../utilities/text_styles.dart'; +import '../../utilities/util.dart'; +import '../../wallets/isar/providers/wallet_info_provider.dart'; +import '../../wallets/models/tx_data.dart'; +import '../../wallets/wallet/impl/salvium_wallet.dart'; +import '../../widgets/background.dart'; +import '../../widgets/conditional_parent.dart'; +import '../../widgets/custom_buttons/app_bar_icon_button.dart'; +import '../../widgets/desktop/desktop_dialog.dart'; +import '../../widgets/desktop/desktop_dialog_close_button.dart'; +import '../../widgets/desktop/primary_button.dart'; +import '../../widgets/desktop/secondary_button.dart'; +import '../../widgets/stack_dialog.dart'; +import '../../wl_gen/interfaces/cs_salvium_interface.dart'; +import '../send_view/confirm_transaction_view.dart'; +import '../send_view/sub_widgets/building_transaction_dialog.dart'; + +class SalviumCreateStakeView extends ConsumerStatefulWidget { + const SalviumCreateStakeView({super.key, required this.walletId}); + + final String walletId; + + static const routeName = "/salviumCreateStakeView"; + + @override + ConsumerState createState() => + _SalviumCreateStakeViewState(); +} + +class _SalviumCreateStakeViewState + extends ConsumerState { + final _amountController = TextEditingController(); + final _amountFocus = FocusNode(); + + Amount? _amount; + + void _clearSendForm() { + if (mounted) { + _amountController.text = ""; + } + } + + void _parseAmount(String string) { + final cryptoAmount = ref + .read(pAmountFormatter(ref.read(pWalletCoin(widget.walletId)))) + .tryParse(string); + + if (_amount != cryptoAmount) { + setState(() { + _amount = cryptoAmount; + }); + } + } + + bool _lock = false; + Future _previewPressed() async { + if (_lock) return; + _lock = true; + + try { + bool wasCancelled = false; + + unawaited( + showDialog( + context: context, + useSafeArea: false, + barrierDismissible: false, + builder: (context) { + return ConditionalParent( + condition: Util.isDesktop, + builder: (child) => DesktopDialog( + maxWidth: 400, + maxHeight: double.infinity, + child: Padding(padding: const EdgeInsets.all(32), child: child), + ), + child: BuildingTransactionDialog( + coin: ref.read(pWalletCoin(widget.walletId)), + isSpark: false, + onCancel: () { + wasCancelled = true; + Navigator.of(context).pop(); + }, + ), + ); + }, + ), + ); + + final wallet = + ref.read(pWallets).getWallet(widget.walletId) as SalviumWallet; + + final address = csSalvium.getAddress(wallet.wallet!); + + final time = Future.delayed(const Duration(milliseconds: 2500)); + + final txDataFuture = wallet.prepareSend( + txData: TxData( + recipients: [ + TxRecipient( + address: address, + amount: _amount!, + isChange: false, + addressType: wallet.cryptoCurrency.getAddressType(address)!, + ), + ], + feeRateType: FeeRateType.average, + note: "Stake transaction", + salviumStakeTx: true, + ), + ); + + final results = await Future.wait([txDataFuture, time]); + final txData = results.first as TxData; + + if (!wasCancelled && mounted) { + // pop building dialog + Navigator.of(context, rootNavigator: Util.isDesktop).pop(); + + if (Util.isDesktop) { + unawaited( + showDialog( + context: context, + builder: (context) => DesktopDialog( + maxHeight: MediaQuery.of(context).size.height - 64, + maxWidth: 580, + child: ConfirmTransactionView( + txData: txData, + walletId: widget.walletId, + onSuccess: _clearSendForm, + routeOnSuccessName: DesktopHomeView.routeName, + ), + ), + ), + ); + } else { + unawaited( + Navigator.of(context).push( + RouteGenerator.getRoute( + shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, + builder: (_) => ConfirmTransactionView( + txData: txData, + walletId: widget.walletId, + onSuccess: _clearSendForm, + ), + settings: const RouteSettings( + name: ConfirmTransactionView.routeName, + ), + ), + ), + ); + } + } + } catch (e, s) { + Logging.instance.e("Salvium stake preview: ", error: e, stackTrace: s); + + if (mounted) { + // pop building dialog + Navigator.of(context, rootNavigator: Util.isDesktop).pop(); + + unawaited( + showDialog( + context: context, + useSafeArea: false, + barrierDismissible: true, + builder: (context) { + return Util.isDesktop + ? DesktopDialog( + maxWidth: 450, + maxHeight: double.infinity, + child: Padding( + padding: const EdgeInsets.only(left: 32, bottom: 32), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Transaction failed", + style: STextStyles.desktopH3(context), + ), + const DesktopDialogCloseButton(), + ], + ), + const SizedBox(height: 12), + Padding( + padding: const EdgeInsets.only(right: 32), + child: Text( + e.toString(), + textAlign: TextAlign.left, + style: STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith(fontSize: 18), + ), + ), + const SizedBox(height: 40), + Row( + children: [ + Expanded( + child: SecondaryButton( + buttonHeight: ButtonHeight.l, + label: "Ok", + onPressed: () { + Navigator.of( + context, + rootNavigator: true, + ).pop(); + }, + ), + ), + const SizedBox(width: 32), + ], + ), + ], + ), + ), + ) + : StackDialog( + title: "Transaction failed", + message: e.toString(), + rightButton: TextButton( + style: Theme.of(context) + .extension()! + .getSecondaryEnabledButtonStyle(context), + child: Text( + "Ok", + style: STextStyles.button(context).copyWith( + color: Theme.of( + context, + ).extension()!.accentColorDark, + ), + ), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ); + }, + ), + ); + } + } finally { + _lock = false; + } + } + + @override + void initState() { + super.initState(); + _amountController.addListener(() { + if (mounted) { + _parseAmount(_amountController.text); + } + }); + + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) { + _amountFocus.requestFocus(); + } + }); + } + + @override + void dispose() { + _amountController.dispose(); + _amountFocus.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final coin = ref.watch(pWalletCoin(widget.walletId)); + final locale = ref.watch( + localeServiceChangeNotifierProvider.select((s) => s.locale), + ); + + return ConditionalParent( + condition: !Util.isDesktop, + builder: (child) => Background( + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.transparent, + // Theme.of(context).extension()!.background, + leading: const AppBarBackButton(), + title: Text( + "Stake transaction", + style: STextStyles.navBarTitle(context), + ), + ), + body: SafeArea( + child: LayoutBuilder( + builder: (context, constraints) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight, + ), + child: IntrinsicHeight(child: child), + ), + ), + ); + }, + ), + ), + ), + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Amount", + style: STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, + ), + textAlign: TextAlign.left, + ), + ], + ), + const SizedBox(height: 10), + TextField( + autocorrect: Util.isDesktop ? false : true, + enableSuggestions: Util.isDesktop ? false : true, + style: STextStyles.smallMed14(context).copyWith( + color: Theme.of(context).extension()!.textDark, + ), + key: const Key("amountStakingInputFieldCryptoTextFieldKey"), + controller: _amountController, + focusNode: _amountFocus, + keyboardType: Util.isDesktop + ? null + : const TextInputType.numberWithOptions( + signed: false, + decimal: true, + ), + textAlign: TextAlign.right, + inputFormatters: [ + AmountInputFormatter( + decimals: coin.fractionDigits, + unit: ref.watch(pAmountUnit(coin)), + locale: locale, + ), + ], + decoration: InputDecoration( + contentPadding: Util.isDesktop + ? const EdgeInsets.only(top: 22, right: 12, bottom: 22) + : const EdgeInsets.only(top: 12, right: 12), + hintText: "0", + hintStyle: Util.isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of( + context, + ).extension()!.textFieldDefaultText, + ) + : STextStyles.fieldLabel(context).copyWith(fontSize: 14), + prefixIcon: FittedBox( + fit: BoxFit.scaleDown, + child: Padding( + padding: const EdgeInsets.all(12), + child: Text( + ref.watch(pAmountUnit(coin)).unitForCoin(coin), + style: STextStyles.smallMed14(context).copyWith( + color: Theme.of( + context, + ).extension()!.accentColorDark, + ), + ), + ), + ), + ), + ), + const SizedBox(height: 32), + if (!Util.isDesktop) const Spacer(), + ConditionalParent( + condition: Util.isDesktop, + builder: (child) => Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [child], + ), + child: PrimaryButton( + width: Util.isDesktop ? 200 : null, + buttonHeight: Util.isDesktop ? ButtonHeight.l : null, + label: "Preview", + onPressed: _amount == null ? null : _previewPressed, + enabled: _amount != null, + ), + ), + if (!Util.isDesktop) const SizedBox(height: 16), + ], + ), + ); + } +} diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index c8971e6067..209df99f3a 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -98,6 +98,7 @@ import '../ordinals/ordinals_view.dart'; import '../paynym/paynym_claim_view.dart'; import '../paynym/paynym_home_view.dart'; import '../receive_view/receive_view.dart'; +import '../salvium_stake/salvium_create_stake_view.dart'; import '../send_view/frost_ms/frost_send_view.dart'; import '../send_view/send_view.dart'; import '../settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart'; @@ -1254,6 +1255,17 @@ class _WalletViewState extends ConsumerState { ); }, ), + if (wallet is LibSalviumWallet) + WalletNavigationBarItemData( + label: "Staking", + icon: const PaynymNavIcon(), + onTap: () { + Navigator.of(context).pushNamed( + SalviumCreateStakeView.routeName, + arguments: widget.walletId, + ); + }, + ), if ((wallet is LibMoneroWallet || wallet is LibSalviumWallet) && !viewOnly) 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 c5e5428f45..8d14c789d9 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 @@ -24,6 +24,7 @@ import '../../../../pages/monkey/monkey_view.dart'; import '../../../../pages/namecoin_names/namecoin_names_home_view.dart'; import '../../../../pages/paynym/paynym_claim_view.dart'; import '../../../../pages/paynym/paynym_home_view.dart'; +import '../../../../pages/salvium_stake/salvium_create_stake_view.dart'; import '../../../../pages/spark_names/spark_names_home_view.dart'; import '../../../../providers/desktop/current_desktop_menu_item.dart'; import '../../../../providers/global/paynym_api_provider.dart'; @@ -54,6 +55,7 @@ import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart' import '../../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart'; import '../../../../widgets/custom_loading_overlay.dart'; import '../../../../widgets/desktop/desktop_dialog.dart'; +import '../../../../widgets/desktop/desktop_dialog_close_button.dart'; import '../../../../widgets/desktop/primary_button.dart'; import '../../../../widgets/desktop/secondary_button.dart'; import '../../../../widgets/loading_indicator.dart'; @@ -85,6 +87,7 @@ enum WalletFeature { churn("Churn", "Churning"), namecoinName("Domains", "Namecoin DNS"), sparkNames("Names", "Spark names"), + salviumStaking("Staking", "Staking"), // special cases clearSparkCache("", ""), @@ -381,6 +384,39 @@ class _DesktopWalletFeaturesState extends ConsumerState { ).pushNamed(SparkNamesHomeView.routeName, arguments: widget.walletId); } + Future _onSalviumStakePressed() async { + await showDialog( + context: context, + builder: (context) => DesktopDialog( + maxWidth: 500, + maxHeight: double.infinity, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Create stake transaction", + style: STextStyles.desktopH3(context), + ), + ), + const DesktopDialogCloseButton(), + ], + ), + const SizedBox(height: 20), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 32), + child: SalviumCreateStakeView(walletId: widget.walletId), + ), + const SizedBox(height: 32), + ], + ), + ), + ); + } + List<(WalletFeature, String, FutureOr Function())> _getOptions( Wallet wallet, bool showExchange, @@ -412,6 +448,13 @@ class _DesktopWalletFeaturesState extends ConsumerState { if (showExchange && AppConfig.hasFeature(AppFeature.buy)) (WalletFeature.buy, Assets.svg.swap, _onBuyPressed), + if (wallet is LibSalviumWallet) + ( + WalletFeature.salviumStaking, + Assets.svg.recycle, + _onSalviumStakePressed, + ), + if (showCoinControl) ( WalletFeature.coinControl, diff --git a/lib/route_generator.dart b/lib/route_generator.dart index 4775dadaab..b44550bafc 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -93,6 +93,7 @@ import 'pages/receive_view/addresses/edit_address_label_view.dart'; import 'pages/receive_view/addresses/wallet_addresses_view.dart'; import 'pages/receive_view/generate_receiving_uri_qr_code_view.dart'; import 'pages/receive_view/receive_view.dart'; +import 'pages/salvium_stake/salvium_create_stake_view.dart'; import 'pages/send_view/confirm_transaction_view.dart'; import 'pages/send_view/frost_ms/frost_send_view.dart'; import 'pages/send_view/send_view.dart'; @@ -690,6 +691,16 @@ class RouteGenerator { } return _routeError("${settings.name} invalid args: ${args.toString()}"); + case SalviumCreateStakeView.routeName: + if (args is String) { + return getRoute( + shouldUseMaterialRoute: useMaterialPageRoute, + builder: (_) => SalviumCreateStakeView(walletId: args), + settings: RouteSettings(name: settings.name), + ); + } + return _routeError("${settings.name} invalid args: ${args.toString()}"); + case ManageDomainView.routeName: if (args is ({String walletId, UTXO utxo})) { return getRoute( From 63e6fbf1c8e3c571bcfeef356f79e45d7d67a0e3 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 14:32:06 -0600 Subject: [PATCH 154/178] fix preview button label (refactor mwc tx type provider) --- lib/pages/send_view/send_view.dart | 11 +- .../sub_widgets/desktop_receive.dart | 419 +++++----- .../wallet_view/sub_widgets/desktop_send.dart | 721 +++++++++--------- .../ui/preview_tx_button_state_provider.dart | 10 + 4 files changed, 553 insertions(+), 608 deletions(-) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 855d1bd889..52f44deccc 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -41,7 +41,6 @@ import '../../utilities/barcode_scanner_interface.dart'; import '../../utilities/clipboard_interface.dart'; import '../../utilities/constants.dart'; import '../../utilities/enums/fee_rate_type_enum.dart'; -import '../../utilities/enums/mwc_transaction_method.dart'; import '../../utilities/eth_commons.dart'; import '../../utilities/extensions/extensions.dart'; import '../../utilities/logger.dart'; @@ -1377,9 +1376,7 @@ class _SendViewState extends ConsumerState { } final isMwcSlatepack = - coin is Mimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack; + coin is Mimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId)); return Background( child: Scaffold( @@ -2622,8 +2619,7 @@ class _SendViewState extends ConsumerState { TextButton( onPressed: ref.watch(pPreviewTxButtonEnabled(coin)) - ? ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack + ? ref.watch(pIsSlatepack(widget.walletId)) ? _createSlatepack : _previewTransaction : null, @@ -2635,8 +2631,7 @@ class _SendViewState extends ConsumerState { .extension()! .getPrimaryDisabledButtonStyle(context), child: Text( - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack + ref.watch(pIsSlatepack(widget.walletId)) ? "Create slatepack" : "Preview", style: STextStyles.button(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 27d9f75eee..607bf3f9c5 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 @@ -32,7 +32,6 @@ import '../../../../utilities/assets.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; import '../../../../utilities/enums/derive_path_type_enum.dart'; -import '../../../../utilities/enums/mwc_transaction_method.dart'; import '../../../../utilities/show_loading.dart'; import '../../../../utilities/text_styles.dart'; import '../../../../utilities/util.dart'; @@ -128,14 +127,12 @@ class _DesktopReceiveState extends ConsumerState { await showDialog( context: context, useRootNavigator: true, - builder: - (context) => StackOkDialog( - desktopPopRootNavigator: true, - title: "Slatepack receive error", - message: - ex?.toString() ?? "Unexpected result without exception", - maxWidth: 400, - ), + builder: (context) => StackOkDialog( + desktopPopRootNavigator: true, + title: "Slatepack receive error", + message: ex?.toString() ?? "Unexpected result without exception", + maxWidth: 400, + ), ); } return; @@ -145,30 +142,28 @@ class _DesktopReceiveState extends ConsumerState { final response = await showDialog<({String responseSlatepack, bool wasEncrypted})>( context: context, - builder: - (context) => SDialog( - child: SizedBox( - width: 700, - child: MwcSlatepackImportDialog( - walletId: widget.walletId, - clipboard: widget.clipboard, - rawSlatepack: result.raw, - decoded: result.result, - slatepackType: result.type, - ), - ), + builder: (context) => SDialog( + child: SizedBox( + width: 700, + child: MwcSlatepackImportDialog( + walletId: widget.walletId, + clipboard: widget.clipboard, + rawSlatepack: result.raw, + decoded: result.result, + slatepackType: result.type, ), + ), + ), ); if (mounted && response != null) { await showDialog( context: context, barrierDismissible: false, - builder: - (context) => SlatepackResponseDialog( - responseSlatepack: response.responseSlatepack, - wasEncrypted: response.wasEncrypted, - ), + builder: (context) => SlatepackResponseDialog( + responseSlatepack: response.responseSlatepack, + wasEncrypted: response.wasEncrypted, + ), ); } } @@ -517,94 +512,85 @@ class _DesktopReceiveState extends ConsumerState { ), ), ), - if (!(isMimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack)) + if (!(isMimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId)))) const SizedBox(height: 20), - if (!(isMimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack)) + if (!(isMimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId)))) ConditionalParent( condition: showMultiType, - builder: - (child) => Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - DropdownButtonHideUnderline( - child: DropdownButton2( - value: _currentIndex, - items: [ - for (int i = 0; i < _walletAddressTypes.length; i++) - DropdownMenuItem( - value: i, - child: Text( - supportsSpark && - _walletAddressTypes[i] == - AddressType.p2pkh - ? "Transparent address" - : "${_walletAddressTypes[i].readableName} address", - style: STextStyles.w500_14(context), - ), - ), - ], - onChanged: (value) { - if (value != null && value != _currentIndex) { - setState(() { - _currentIndex = value; - }); - } - }, - isExpanded: true, - iconStyleData: IconStyleData( - icon: Padding( - padding: const EdgeInsets.only(right: 10), - child: SvgPicture.asset( - Assets.svg.chevronDown, - width: 12, - height: 6, - color: - Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, - ), + builder: (child) => Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + DropdownButtonHideUnderline( + child: DropdownButton2( + value: _currentIndex, + items: [ + for (int i = 0; i < _walletAddressTypes.length; i++) + DropdownMenuItem( + value: i, + child: Text( + supportsSpark && + _walletAddressTypes[i] == AddressType.p2pkh + ? "Transparent address" + : "${_walletAddressTypes[i].readableName} address", + style: STextStyles.w500_14(context), ), ), - buttonStyleData: ButtonStyleData( - decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - ), + ], + onChanged: (value) { + if (value != null && value != _currentIndex) { + setState(() { + _currentIndex = value; + }); + } + }, + isExpanded: true, + iconStyleData: IconStyleData( + icon: Padding( + padding: const EdgeInsets.only(right: 10), + child: 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, - ), - ), + ), + ), + buttonStyleData: ButtonStyleData( + decoration: BoxDecoration( + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, ), - menuItemStyleData: const MenuItemStyleData( - padding: EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), + ), + ), + dropdownStyleData: DropdownStyleData( + offset: const Offset(0, -10), + elevation: 0, + decoration: BoxDecoration( + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, ), ), ), - const SizedBox(height: 12), - child, - ], + menuItemStyleData: const MenuItemStyleData( + padding: EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, + ), + ), + ), ), + const SizedBox(height: 12), + child, + ], + ), child: MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( @@ -620,10 +606,9 @@ class _DesktopReceiveState extends ConsumerState { child: Container( decoration: BoxDecoration( border: Border.all( - color: - Theme.of( - context, - ).extension()!.backgroundAppBar, + color: Theme.of( + context, + ).extension()!.backgroundAppBar, width: 1, ), borderRadius: BorderRadius.circular( @@ -646,10 +631,9 @@ class _DesktopReceiveState extends ConsumerState { Assets.svg.copy, width: 15, height: 15, - color: - Theme.of( - context, - ).extension()!.infoItemIcons, + color: Theme.of( + context, + ).extension()!.infoItemIcons, ), const SizedBox(width: 4), Text("Copy", style: STextStyles.link2(context)), @@ -663,14 +647,14 @@ class _DesktopReceiveState extends ConsumerState { Expanded( child: Text( address, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( + style: + STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of( context, ).extension()!.textDark, - ), + ), ), ), ], @@ -690,18 +674,16 @@ class _DesktopReceiveState extends ConsumerState { buttonHeight: ButtonHeight.l, onPressed: supportsMweb && - _walletAddressTypes[_currentIndex] == AddressType.mweb - ? generateNewMwebAddress - : supportsSpark && - _walletAddressTypes[_currentIndex] == AddressType.spark - ? generateNewSparkAddress - : generateNewAddress, + _walletAddressTypes[_currentIndex] == AddressType.mweb + ? generateNewMwebAddress + : supportsSpark && + _walletAddressTypes[_currentIndex] == AddressType.spark + ? generateNewSparkAddress + : generateNewAddress, label: "Generate new address", ), const SizedBox(height: 20), - if (isMimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack) + if (isMimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId))) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -709,10 +691,9 @@ class _DesktopReceiveState extends ConsumerState { Text( "Receive Slatepack", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of(context) - .extension()! - .textFieldActiveSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, ), textAlign: TextAlign.left, ), @@ -743,61 +724,60 @@ class _DesktopReceiveState extends ConsumerState { }, focusNode: _slateFocusNode, style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveText, + color: Theme.of( + context, + ).extension()!.textFieldActiveText, height: 1.8, ), - decoration: standardInputDecoration( - "Enter Slatepack Message", - _slateFocusNode, - context, - desktopMed: true, - ).copyWith( - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: - 12, // Adjust vertical padding for better alignment - ), - suffixIcon: Padding( - padding: - _receiveSlateController.text.isEmpty + decoration: + standardInputDecoration( + "Enter Slatepack Message", + _slateFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: + 12, // Adjust vertical padding for better alignment + ), + suffixIcon: Padding( + padding: _receiveSlateController.text.isEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - _slateToggleFlag - ? TextFieldIconButton( - key: const Key( - "receiveViewClearSlatepackFieldButtonKey", - ), - onTap: () { - _receiveSlateController.text = ""; - _slate = ""; - setState(() { - _slateToggleFlag = false; - }); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - key: const Key( - "receiveViewPasteSlatepackFieldButtonKey", - ), - onTap: _pasteSlatepack, - child: - _receiveSlateController.text.isEmpty - ? const ClipboardIcon() - : const XIcon(), - ), - ], + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _slateToggleFlag + ? TextFieldIconButton( + key: const Key( + "receiveViewClearSlatepackFieldButtonKey", + ), + onTap: () { + _receiveSlateController.text = ""; + _slate = ""; + setState(() { + _slateToggleFlag = false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + key: const Key( + "receiveViewPasteSlatepackFieldButtonKey", + ), + onTap: _pasteSlatepack, + child: + _receiveSlateController.text.isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + ], + ), + ), ), ), - ), - ), ), ), ], @@ -834,9 +814,7 @@ class _DesktopReceiveState extends ConsumerState { // TODO: create transparent button class to account for hover // Conditional logic for 'Submit' button or QR code - if (isMimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack) + if (isMimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId))) Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: PrimaryButton( @@ -852,38 +830,36 @@ class _DesktopReceiveState extends ConsumerState { if (Util.isDesktop) { await showDialog( context: context, - builder: - (context) => DesktopDialog( - maxHeight: double.infinity, - maxWidth: 580, - child: Column( + builder: (context) => DesktopDialog( + maxHeight: double.infinity, + maxWidth: 580, + child: Column( + children: [ + Row( children: [ - Row( - children: [ - const AppBarBackButton(size: 40, iconSize: 24), - Text( - "Generate QR code", - style: STextStyles.desktopH3(context), - ), - ], - ), - IntrinsicHeight( - child: Navigator( - onGenerateRoute: RouteGenerator.generateRoute, - onGenerateInitialRoutes: - (_, __) => [ - RouteGenerator.generateRoute( - RouteSettings( - name: GenerateUriQrCodeView.routeName, - arguments: Tuple2(coin, address), - ), - ), - ], - ), + const AppBarBackButton(size: 40, iconSize: 24), + Text( + "Generate QR code", + style: STextStyles.desktopH3(context), ), ], ), - ), + IntrinsicHeight( + child: Navigator( + onGenerateRoute: RouteGenerator.generateRoute, + onGenerateInitialRoutes: (_, __) => [ + RouteGenerator.generateRoute( + RouteSettings( + name: GenerateUriQrCodeView.routeName, + arguments: Tuple2(coin, address), + ), + ), + ], + ), + ), + ], + ), + ), ); } else { unawaited( @@ -891,11 +867,10 @@ class _DesktopReceiveState extends ConsumerState { RouteGenerator.getRoute( shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, - builder: - (_) => GenerateUriQrCodeView( - coin: coin, - receivingAddress: address, - ), + builder: (_) => GenerateUriQrCodeView( + coin: coin, + receivingAddress: address, + ), settings: const RouteSettings( name: GenerateUriQrCodeView.routeName, ), @@ -914,19 +889,17 @@ class _DesktopReceiveState extends ConsumerState { Assets.svg.qrcode, width: 14, height: 16, - color: - Theme.of( - context, - ).extension()!.accentColorBlue, + color: Theme.of( + context, + ).extension()!.accentColorBlue, ), const SizedBox(width: 8), Text( "Create new QR code", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorBlue, + color: Theme.of( + context, + ).extension()!.accentColorBlue, ), ), ], 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 ac30df24ea..c476879db0 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 @@ -42,7 +42,6 @@ import '../../../../utilities/amount/amount_unit.dart'; import '../../../../utilities/assets.dart'; import '../../../../utilities/clipboard_interface.dart'; import '../../../../utilities/constants.dart'; -import '../../../../utilities/enums/mwc_transaction_method.dart'; import '../../../../utilities/logger.dart'; import '../../../../utilities/prefs.dart'; import '../../../../utilities/show_loading.dart'; @@ -220,12 +219,11 @@ class _DesktopSendState extends ConsumerState { await showDialog( context: context, barrierDismissible: false, - builder: - (context) => DesktopDialog( - maxHeight: double.infinity, - maxWidth: 700, - child: MwcSlatepackDialog(slatepackResult: slatepackResult), - ), + builder: (context) => DesktopDialog( + maxHeight: double.infinity, + maxWidth: 700, + child: MwcSlatepackDialog(slatepackResult: slatepackResult), + ), ); // Clear form after slatepack dialog is closed. @@ -241,55 +239,54 @@ class _DesktopSendState extends ConsumerState { if (mounted) { await showDialog( context: context, - builder: - (context) => DesktopDialog( - maxWidth: 450, - maxHeight: double.infinity, - child: Padding( - padding: const EdgeInsets.only(left: 32, bottom: 32), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + builder: (context) => DesktopDialog( + maxWidth: 450, + maxHeight: double.infinity, + child: Padding( + padding: const EdgeInsets.only(left: 32, bottom: 32), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - 'Slatepack Creation Failed', - style: STextStyles.desktopH3(context), - ), - const DesktopDialogCloseButton(), - ], - ), - const SizedBox(height: 12), - Padding( - padding: const EdgeInsets.only(right: 32), - child: Text( - 'Failed to create slatepack: $e', - textAlign: TextAlign.left, - style: STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith(fontSize: 18), - ), - ), - const SizedBox(height: 40), - Padding( - padding: const EdgeInsets.only(right: 32), - child: Row( - children: [ - Expanded( - child: PrimaryButton( - buttonHeight: ButtonHeight.l, - label: 'OK', - onPressed: () => Navigator.of(context).pop(), - ), - ), - ], - ), + Text( + 'Slatepack Creation Failed', + style: STextStyles.desktopH3(context), ), + const DesktopDialogCloseButton(), ], ), - ), + const SizedBox(height: 12), + Padding( + padding: const EdgeInsets.only(right: 32), + child: Text( + 'Failed to create slatepack: $e', + textAlign: TextAlign.left, + style: STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith(fontSize: 18), + ), + ), + const SizedBox(height: 40), + Padding( + padding: const EdgeInsets.only(right: 32), + child: Row( + children: [ + Expanded( + child: PrimaryButton( + buttonHeight: ButtonHeight.l, + label: 'OK', + onPressed: () => Navigator.of(context).pop(), + ), + ), + ], + ), + ), + ], ), + ), + ), ); } } @@ -299,9 +296,7 @@ class _DesktopSendState extends ConsumerState { final wallet = ref.read(pWallets).getWallet(walletId); // Handle MWC slatepack transactions directly. - if (isMimblewimblecoin && - ref.read(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack) { + if (isMimblewimblecoin && ref.read(pIsSlatepack(widget.walletId))) { await _handleDesktopSlatepackCreation(wallet as MimblewimblecoinWallet); return; } @@ -314,18 +309,18 @@ class _DesktopSendState extends ConsumerState { availableBalance = wallet.info.cachedBalance.spendable; break; case BalanceType.private: - availableBalance = - coin is Firo - ? wallet.info.cachedBalanceTertiary.spendable - : wallet.info.cachedBalanceSecondary.spendable; + availableBalance = coin is Firo + ? wallet.info.cachedBalanceTertiary.spendable + : wallet.info.cachedBalanceSecondary.spendable; break; } } else { availableBalance = wallet.info.cachedBalance.spendable; } - final coinControlEnabled = - ref.read(prefsChangeNotifierProvider).enableCoinControl; + final coinControlEnabled = ref + .read(prefsChangeNotifierProvider) + .enableCoinControl; if (!(wallet is CoinControlInterface && coinControlEnabled) || (coinControlEnabled && ref.read(desktopUseUTXOs).isEmpty)) { @@ -466,10 +461,10 @@ class _DesktopSendState extends ConsumerState { feeRateType: feeRate, utxos: (wallet is CoinControlInterface && - coinControlEnabled && - ref.read(pDesktopUseUTXOs).isNotEmpty) - ? ref.read(pDesktopUseUTXOs) - : null, + coinControlEnabled && + ref.read(pDesktopUseUTXOs).isNotEmpty) + ? ref.read(pDesktopUseUTXOs) + : null, ), ); } else if (wallet is FiroWallet) { @@ -490,9 +485,9 @@ class _DesktopSendState extends ConsumerState { satsPerVByte: isCustomFee ? customFeeRate : null, utxos: (coinControlEnabled && - ref.read(pDesktopUseUTXOs).isNotEmpty) - ? ref.read(pDesktopUseUTXOs) - : null, + ref.read(pDesktopUseUTXOs).isNotEmpty) + ? ref.read(pDesktopUseUTXOs) + : null, ), ); } else { @@ -503,17 +498,18 @@ class _DesktopSendState extends ConsumerState { address: _address!, amount: amount, isChange: false, - addressType: - wallet.cryptoCurrency.getAddressType(_address!)!, + addressType: wallet.cryptoCurrency.getAddressType( + _address!, + )!, ), ], feeRateType: ref.read(feeRateTypeDesktopStateProvider), satsPerVByte: isCustomFee ? customFeeRate : null, utxos: (coinControlEnabled && - ref.read(pDesktopUseUTXOs).isNotEmpty) - ? ref.read(pDesktopUseUTXOs) - : null, + ref.read(pDesktopUseUTXOs).isNotEmpty) + ? ref.read(pDesktopUseUTXOs) + : null, ), ); } @@ -522,31 +518,28 @@ class _DesktopSendState extends ConsumerState { case BalanceType.private: txDataFuture = wallet.prepareSendSpark( txData: TxData( - recipients: - ref.read(pValidSparkSendToAddress) - ? null - : [ - TxRecipient( - address: _address!, - amount: amount, - isChange: false, - addressType: - wallet.cryptoCurrency.getAddressType( - _address!, - )!, - ), - ], - sparkRecipients: - ref.read(pValidSparkSendToAddress) - ? [ - ( - address: _address!, - amount: amount, - memo: memoController.text, - isChange: false, - ), - ] - : null, + recipients: ref.read(pValidSparkSendToAddress) + ? null + : [ + TxRecipient( + address: _address!, + amount: amount, + isChange: false, + addressType: wallet.cryptoCurrency.getAddressType( + _address!, + )!, + ), + ], + sparkRecipients: ref.read(pValidSparkSendToAddress) + ? [ + ( + address: _address!, + amount: amount, + memo: memoController.text, + isChange: false, + ), + ] + : null, ), ); break; @@ -590,16 +583,15 @@ class _DesktopSendState extends ConsumerState { memo: memo, feeRateType: ref.read(feeRateTypeDesktopStateProvider), satsPerVByte: isCustomFee ? customFeeRate : null, - nonce: - wallet.cryptoCurrency is Ethereum - ? int.tryParse(nonceController.text) - : null, + nonce: wallet.cryptoCurrency is Ethereum + ? int.tryParse(nonceController.text) + : null, utxos: (wallet is CoinControlInterface && - coinControlEnabled && - ref.read(pDesktopUseUTXOs).isNotEmpty) - ? ref.read(pDesktopUseUTXOs) - : null, + coinControlEnabled && + ref.read(pDesktopUseUTXOs).isNotEmpty) + ? ref.read(pDesktopUseUTXOs) + : null, ethEIP1559Fee: ethFee, ), ); @@ -630,18 +622,17 @@ class _DesktopSendState extends ConsumerState { unawaited( showDialog( context: context, - builder: - (context) => DesktopDialog( - maxHeight: MediaQuery.of(context).size.height - 64, - maxWidth: 580, - child: ConfirmTransactionView( - txData: txData, - walletId: walletId, - onSuccess: clearSendForm, - isPaynymTransaction: isPaynymSend, - routeOnSuccessName: DesktopHomeView.routeName, - ), - ), + builder: (context) => DesktopDialog( + maxHeight: MediaQuery.of(context).size.height - 64, + maxWidth: 580, + child: ConfirmTransactionView( + txData: txData, + walletId: walletId, + onSuccess: clearSendForm, + isPaynymTransaction: isPaynymSend, + routeOnSuccessName: DesktopHomeView.routeName, + ), + ), ), ); } @@ -740,8 +731,10 @@ class _DesktopSendState extends ConsumerState { _cachedAmountToSend = amount; - final price = - ref.read(priceAnd24hChangeNotifierProvider).getPrice(coin)?.value; + final price = ref + .read(priceAnd24hChangeNotifierProvider) + .getPrice(coin) + ?.value; if (price != null && price > Decimal.zero) { final String fiatAmountString = (amount.decimal * price) @@ -979,18 +972,19 @@ class _DesktopSendState extends ConsumerState { ); final Amount? amount; if (baseAmount != null) { - final _price = - ref.read(priceAnd24hChangeNotifierProvider).getPrice(coin)?.value; + final _price = ref + .read(priceAnd24hChangeNotifierProvider) + .getPrice(coin) + ?.value; if (_price == null || _price == Decimal.zero) { amount = Decimal.zero.toAmount(fractionDigits: coin.fractionDigits); } else { - amount = - baseAmount <= Amount.zero - ? Decimal.zero.toAmount(fractionDigits: coin.fractionDigits) - : (baseAmount.decimal / _price) - .toDecimal(scaleOnInfinitePrecision: coin.fractionDigits) - .toAmount(fractionDigits: coin.fractionDigits); + amount = baseAmount <= Amount.zero + ? Decimal.zero.toAmount(fractionDigits: coin.fractionDigits) + : (baseAmount.decimal / _price) + .toDecimal(scaleOnInfinitePrecision: coin.fractionDigits) + .toAmount(fractionDigits: coin.fractionDigits); } if (_cachedAmountToSend != null && _cachedAmountToSend == amount) { return; @@ -1042,10 +1036,9 @@ class _DesktopSendState extends ConsumerState { amount = ref.read(pWalletBalance(walletId)).spendable; break; case BalanceType.private: - amount = - coin is Firo - ? ref.read(pWalletBalanceTertiary(walletId)).spendable - : ref.read(pWalletBalanceSecondary(walletId)).spendable; + amount = coin is Firo + ? ref.read(pWalletBalanceTertiary(walletId)).spendable + : ref.read(pWalletBalanceSecondary(walletId)).spendable; break; } } else { @@ -1061,11 +1054,10 @@ class _DesktopSendState extends ConsumerState { final amount = ref.read(pSendAmount); await showDialog( context: context, - builder: - (context) => DesktopCoinControlUseDialog( - walletId: widget.walletId, - amountToSend: amount, - ), + builder: (context) => DesktopCoinControlUseDialog( + walletId: widget.walletId, + amountToSend: amount, + ), ); } @@ -1261,10 +1253,9 @@ class _DesktopSendState extends ConsumerState { Text( "Send from", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, ), textAlign: TextAlign.left, ), @@ -1345,10 +1336,9 @@ class _DesktopSendState extends ConsumerState { offset: const Offset(0, -10), elevation: 0, decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of( + context, + ).extension()!.textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -1390,10 +1380,9 @@ class _DesktopSendState extends ConsumerState { Text( "Amount", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, ), textAlign: TextAlign.left, ), @@ -1417,13 +1406,12 @@ class _DesktopSendState extends ConsumerState { key: const Key("amountInputFieldCryptoTextFieldKey"), controller: cryptoAmountController, focusNode: _cryptoFocus, - keyboardType: - Util.isDesktop - ? null - : const TextInputType.numberWithOptions( - signed: false, - decimal: true, - ), + keyboardType: Util.isDesktop + ? null + : const TextInputType.numberWithOptions( + signed: false, + decimal: true, + ), textAlign: TextAlign.right, inputFormatters: [ AmountInputFormatter( @@ -1447,10 +1435,9 @@ class _DesktopSendState extends ConsumerState { ), hintText: "0", hintStyle: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultText, + color: Theme.of( + context, + ).extension()!.textFieldDefaultText, ), prefixIcon: FittedBox( fit: BoxFit.scaleDown, @@ -1459,10 +1446,9 @@ class _DesktopSendState extends ConsumerState { child: Text( ref.watch(pAmountUnit(coin)).unitForCoin(coin), style: STextStyles.smallMed14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), ), ), @@ -1480,13 +1466,12 @@ class _DesktopSendState extends ConsumerState { key: const Key("amountInputFieldFiatTextFieldKey"), controller: baseAmountController, focusNode: _baseFocus, - keyboardType: - Util.isDesktop - ? null - : const TextInputType.numberWithOptions( - signed: false, - decimal: true, - ), + keyboardType: Util.isDesktop + ? null + : const TextInputType.numberWithOptions( + signed: false, + decimal: true, + ), textAlign: TextAlign.right, inputFormatters: [ AmountInputFormatter(decimals: 2, locale: locale), @@ -1506,10 +1491,9 @@ class _DesktopSendState extends ConsumerState { ), hintText: "0", hintStyle: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldDefaultText, + color: Theme.of( + context, + ).extension()!.textFieldDefaultText, ), prefixIcon: FittedBox( fit: BoxFit.scaleDown, @@ -1522,10 +1506,9 @@ class _DesktopSendState extends ConsumerState { ), ), style: STextStyles.smallMed14(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), ), ), @@ -1536,8 +1519,9 @@ class _DesktopSendState extends ConsumerState { if (showCoinControl) RoundedContainer( color: Colors.transparent, - borderColor: - Theme.of(context).extension()!.textFieldDefaultBG, + borderColor: Theme.of( + context, + ).extension()!.textFieldDefaultBG, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -1546,10 +1530,9 @@ class _DesktopSendState extends ConsumerState { style: STextStyles.desktopTextExtraExtraSmall(context), ), CustomTextButton( - text: - ref.watch(desktopUseUTXOs.state).state.isEmpty - ? "Select coins" - : "Selected coins (${ref.watch(desktopUseUTXOs.state).state.length})", + text: ref.watch(desktopUseUTXOs.state).state.isEmpty + ? "Select coins" + : "Selected coins (${ref.watch(desktopUseUTXOs.state).state.length})", onTap: _showDesktopCoinControl, ), ], @@ -1557,28 +1540,21 @@ class _DesktopSendState extends ConsumerState { ), const SizedBox(height: 20), if (!isPaynymSend && - !(isMimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack)) + !(isMimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId)))) Text( "Send to", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, ), textAlign: TextAlign.left, ), if (!isPaynymSend && - !(isMimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack)) + !(isMimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId)))) const SizedBox(height: 10), if (!isPaynymSend && - !(isMimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack)) + !(isMimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId)))) ClipRRect( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -1629,138 +1605,135 @@ class _DesktopSendState extends ConsumerState { }, focusNode: _addressFocusNode, style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveText, + color: Theme.of( + context, + ).extension()!.textFieldActiveText, height: 1.8, ), - decoration: standardInputDecoration( - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack - ? "Enter ${coin.ticker} address (optional)" - : "Enter ${coin.ticker} address", - _addressFocusNode, - context, - desktopMed: true, - ).copyWith( - contentPadding: const EdgeInsets.only( - left: 16, - top: 11, - bottom: 12, - right: 5, - ), - suffixIcon: Padding( - padding: - sendToController.text.isEmpty + decoration: + standardInputDecoration( + ref.watch(pIsSlatepack(widget.walletId)) + ? "Enter ${coin.ticker} address (optional)" + : "Enter ${coin.ticker} address", + _addressFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.only( + left: 16, + top: 11, + bottom: 12, + right: 5, + ), + suffixIcon: Padding( + padding: sendToController.text.isEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - _addressToggleFlag - ? TextFieldIconButton( - key: const Key( - "sendViewClearAddressFieldButtonKey", - ), - onTap: () { - sendToController.text = ""; - _address = ""; - _setValidAddressProviders(_address); - setState(() { - _addressToggleFlag = false; - }); - }, - child: const XIcon(), - ) - : TextFieldIconButton( - key: const Key( - "sendViewPasteAddressFieldButtonKey", - ), - onTap: pasteAddress, - child: - sendToController.text.isEmpty - ? const ClipboardIcon() - : const XIcon(), - ), - if (sendToController.text.isEmpty) - TextFieldIconButton( - key: const Key("sendViewAddressBookButtonKey"), - onTap: () async { - final entry = await showDialog< - ContactAddressEntry? - >( - context: context, - builder: - (context) => DesktopDialog( - maxWidth: 696, - maxHeight: 600, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _addressToggleFlag + ? TextFieldIconButton( + key: const Key( + "sendViewClearAddressFieldButtonKey", + ), + onTap: () { + sendToController.text = ""; + _address = ""; + _setValidAddressProviders(_address); + setState(() { + _addressToggleFlag = false; + }); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + key: const Key( + "sendViewPasteAddressFieldButtonKey", + ), + onTap: pasteAddress, + child: sendToController.text.isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + if (sendToController.text.isEmpty) + TextFieldIconButton( + key: const Key("sendViewAddressBookButtonKey"), + onTap: () async { + final entry = + await showDialog( + context: context, + builder: (context) => DesktopDialog( + maxWidth: 696, + maxHeight: 600, + child: Column( + mainAxisSize: MainAxisSize.min, children: [ - Padding( - padding: const EdgeInsets.only( - left: 32, - ), - child: Text( - "Address book", - style: STextStyles.desktopH3( - context, + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Padding( + padding: + const EdgeInsets.only( + left: 32, + ), + child: Text( + "Address book", + style: + STextStyles.desktopH3( + context, + ), + ), ), - ), + const DesktopDialogCloseButton(), + ], + ), + Expanded( + child: + AddressBookAddressChooser( + coin: coin, + ), ), - const DesktopDialogCloseButton(), ], ), - Expanded( - child: AddressBookAddressChooser( - coin: coin, - ), - ), - ], - ), - ), - ); + ), + ); - if (entry != null) { - sendToController.text = - entry.other ?? entry.label; + if (entry != null) { + sendToController.text = + entry.other ?? entry.label; - _address = entry.address; + _address = entry.address; - _setValidAddressProviders(_address); + _setValidAddressProviders(_address); - setState(() { - _addressToggleFlag = true; - }); - } - }, - child: const AddressBookIcon(), - ), - if (sendToController.text.isEmpty) - TextFieldIconButton( - semanticsLabel: - "Scan QR Button. Opens Camera For Scanning QR Code.", - key: const Key("sendViewScanQrButtonKey"), - onTap: scanWebcam, - child: const QrCodeIcon(), - ), - ], + setState(() { + _addressToggleFlag = true; + }); + } + }, + child: const AddressBookIcon(), + ), + if (sendToController.text.isEmpty) + TextFieldIconButton( + semanticsLabel: + "Scan QR Button. Opens Camera For Scanning QR Code.", + key: const Key("sendViewScanQrButtonKey"), + onTap: scanWebcam, + child: const QrCodeIcon(), + ), + ], + ), + ), ), ), - ), - ), ), ), if (!isPaynymSend && - !(isMimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack)) + !(isMimblewimblecoin && ref.watch(pIsSlatepack(widget.walletId)))) Builder( builder: (_) { final String? error; @@ -1780,8 +1753,7 @@ class _DesktopSendState extends ConsumerState { if (_data != null && _data.contactLabel == _address) { error = null; } else if (coin is Mimblewimblecoin && - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack) { + ref.watch(pIsSlatepack(widget.walletId))) { // For MWC slatepack transactions, address validation is not required. // TODO: When implementing encrypted slatepacks, address validation will be required. error = null; @@ -1803,10 +1775,9 @@ class _DesktopSendState extends ConsumerState { error, textAlign: TextAlign.left, style: STextStyles.label(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textError, + color: Theme.of( + context, + ).extension()!.textError, ), ), ), @@ -1835,47 +1806,45 @@ class _DesktopSendState extends ConsumerState { setState(() {}); }, style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveText, + color: Theme.of( + context, + ).extension()!.textFieldActiveText, height: 1.8, ), - decoration: standardInputDecoration( - "Enter memo (optional)", - _memoFocus, - context, - desktopMed: true, - ).copyWith( - counterText: '', - contentPadding: const EdgeInsets.only( - left: 16, - top: 11, - bottom: 12, - right: 5, - ), - suffixIcon: Padding( - padding: - memoController.text.isEmpty + decoration: + standardInputDecoration( + "Enter memo (optional)", + _memoFocus, + context, + desktopMed: true, + ).copyWith( + counterText: '', + contentPadding: const EdgeInsets.only( + left: 16, + top: 11, + bottom: 12, + right: 5, + ), + suffixIcon: Padding( + padding: memoController.text.isEmpty ? const EdgeInsets.only(right: 8) : const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - TextFieldIconButton( - key: const Key("sendViewPasteMemoButtonKey"), - onTap: pasteMemo, - child: - memoController.text.isEmpty + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + TextFieldIconButton( + key: const Key("sendViewPasteMemoButtonKey"), + onTap: pasteMemo, + child: memoController.text.isEmpty ? const ClipboardIcon() : const XIcon(), + ), + ], ), - ], + ), ), ), - ), - ), ), ), if (!isPaynymSend) const SizedBox(height: 20), @@ -1899,10 +1868,9 @@ class _DesktopSendState extends ConsumerState { Text( "Nonce", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveSearchIconRight, + color: Theme.of( + context, + ).extension()!.textFieldActiveSearchIconRight, ), textAlign: TextAlign.left, ), @@ -1923,38 +1891,37 @@ class _DesktopSendState extends ConsumerState { keyboardType: const TextInputType.numberWithOptions(), focusNode: _nonceFocusNode, style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveText, + color: Theme.of( + context, + ).extension()!.textFieldActiveText, height: 1.8, ), - decoration: standardInputDecoration( - "Leave empty to auto select nonce", - _nonceFocusNode, - context, - desktopMed: true, - ).copyWith( - contentPadding: const EdgeInsets.only( - left: 16, - top: 11, - bottom: 12, - right: 5, - ), - ), + decoration: + standardInputDecoration( + "Leave empty to auto select nonce", + _nonceFocusNode, + context, + desktopMed: true, + ).copyWith( + contentPadding: const EdgeInsets.only( + left: 16, + top: 11, + bottom: 12, + right: 5, + ), + ), ), ), const SizedBox(height: 36), PrimaryButton( buttonHeight: ButtonHeight.l, - label: - ref.watch(pSelectedMwcTransactionMethod) == - MwcTransactionMethod.slatepack - ? "Create slatepack" - : "Preview send", + label: ref.watch(pIsSlatepack(widget.walletId)) + ? "Create slatepack" + : "Preview send", enabled: ref.watch(pPreviewTxButtonEnabled(coin)), - onPressed: - ref.watch(pPreviewTxButtonEnabled(coin)) ? previewSend : null, + onPressed: ref.watch(pPreviewTxButtonEnabled(coin)) + ? previewSend + : null, ), ], ); diff --git a/lib/providers/ui/preview_tx_button_state_provider.dart b/lib/providers/ui/preview_tx_button_state_provider.dart index de20131e11..e800869f0a 100644 --- a/lib/providers/ui/preview_tx_button_state_provider.dart +++ b/lib/providers/ui/preview_tx_button_state_provider.dart @@ -13,6 +13,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../utilities/amount/amount.dart'; import '../../utilities/enums/mwc_transaction_method.dart'; import '../../wallets/crypto_currency/crypto_currency.dart'; +import '../../wallets/isar/providers/wallet_info_provider.dart'; import '../wallet/public_private_balance_state_provider.dart'; final pSendAmount = StateProvider.autoDispose((_) => null); @@ -26,6 +27,15 @@ final pSelectedMwcTransactionMethod = StateProvider( (_) => MwcTransactionMethod.slatepack, ); +final pIsSlatepack = Provider.family((ref, walletId) { + if (ref.watch(pWalletCoin(walletId)) is Mimblewimblecoin) { + return ref.watch(pSelectedMwcTransactionMethod) == + MwcTransactionMethod.slatepack; + } + + return false; +}); + final pPreviewTxButtonEnabled = Provider.autoDispose .family((ref, coin) { final amount = ref.watch(pSendAmount) ?? Amount.zero; From 98386347856f8549770e9b893fb1bdfaf3cf3af6 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 15:41:29 -0600 Subject: [PATCH 155/178] must've been some merge artefact...? --- lib/pages/send_view/send_view.dart | 58 ------------------------------ 1 file changed, 58 deletions(-) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 52f44deccc..e7fcea3336 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -2308,64 +2308,6 @@ class _SendViewState extends ConsumerState { ), if (coin is Epiccash || coin is Mimblewimblecoin) const SizedBox(height: 12), - Text( - (coin is Epiccash) - ? "Local Note (optional)" - : "Note (optional)", - style: STextStyles.smallMed12(context), - textAlign: TextAlign.left, - ), - if (coin is Epiccash || coin is Mimblewimblecoin) - const SizedBox(height: 8), - if (coin is Epiccash || coin is Mimblewimblecoin) - ClipRRect( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - child: TextField( - autocorrect: Util.isDesktop ? false : true, - enableSuggestions: Util.isDesktop - ? false - : true, - controller: noteController, - focusNode: _noteFocusNode, - style: STextStyles.field(context), - onChanged: (_) => setState(() {}), - decoration: - standardInputDecoration( - "Type something...", - _noteFocusNode, - context, - ).copyWith( - suffixIcon: - noteController.text.isNotEmpty - ? Padding( - padding: const EdgeInsets.only( - right: 0, - ), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - noteController - .text = - ""; - }); - }, - ), - ], - ), - ), - ) - : null, - ), - ), - ), - if (coin is Epiccash || coin is Mimblewimblecoin) - const SizedBox(height: 12), Text( (coin is Epiccash || coin is Mimblewimblecoin) ? "Local Note (optional)" From 9c43f13c6a88d5e6f4e2558a5b691c0474072297 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 16:41:08 -0600 Subject: [PATCH 156/178] clean up sal related --- .../SAL_cs_salvium_interface_impl.template.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart index d86c41ea3f..dd6f39829e 100644 --- a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart +++ b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart @@ -13,7 +13,7 @@ import '../interfaces/cs_salvium_interface.dart'; CsSalviumInterface get csSalvium => _getInterface(); //OFF -CsSalviumInterface _getInterface() => throw Exception("XMR/WOW not enabled!"); +CsSalviumInterface _getInterface() => throw Exception("Sal not enabled!"); //END_OFF //ON @@ -181,8 +181,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { wallet.actual.getPrivateSpendKey(); @override - Future isSynced(WrappedWallet wallet) => - wallet.actual.isSynced() ?? Future.value(false); + Future isSynced(WrappedWallet wallet) => wallet.actual.isSynced(); @override void startSyncing(WrappedWallet wallet) => wallet.actual.startSyncing(); @@ -227,11 +226,11 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { @override Future rescanBlockchain(WrappedWallet wallet) => - wallet.actual.rescanBlockchain() ?? Future.value(false); + wallet.actual.rescanBlockchain(); @override Future isConnectedToDaemon(WrappedWallet wallet) => - wallet.actual.isConnectedToDaemon() ?? Future.value(false); + wallet.actual.isConnectedToDaemon(); @override Future connect( @@ -275,7 +274,6 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { bool refresh = false, }) async { final transactions = await wallet.actual.getAllTxs(refresh: refresh); - if (transactions == null) return []; return transactions .map( (e) => CsTransaction( @@ -293,7 +291,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { key: e.key, timeStamp: e.timeStamp, minConfirms: e.minConfirms.value, - salviumData: (asset: e.asset, type: e.type), + salviumData: (asset: e.asset, type: e.type.value), ), ) .toList(); @@ -327,7 +325,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { key: e.key, timeStamp: e.timeStamp, minConfirms: e.minConfirms.value, - salviumData: (asset: e.asset, type: e.type), + salviumData: (asset: e.asset, type: e.type.value), ), ) .toList(); From cf74749b8d6244dce48a67baf5d504f67f9a5d49 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 16:41:30 -0600 Subject: [PATCH 157/178] sal testnet support using localhost --- .../crypto_currency/coins/salvium.dart | 22 +++++++++++++++++++ lib/wallets/wallet/impl/salvium_wallet.dart | 10 ++++++++- .../interfaces/cs_salvium_interface.dart | 4 ++++ scripts/app_config/configure_stack_wallet.sh | 1 + ...AL_cs_salvium_interface_impl.template.dart | 8 +++++++ 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/lib/wallets/crypto_currency/coins/salvium.dart b/lib/wallets/crypto_currency/coins/salvium.dart index 931208c6ad..ab0f1b56e1 100644 --- a/lib/wallets/crypto_currency/coins/salvium.dart +++ b/lib/wallets/crypto_currency/coins/salvium.dart @@ -14,6 +14,10 @@ class Salvium extends CryptonoteCurrency { _id = _idMain; _name = "Salvium"; _ticker = "SAL"; + case CryptoCurrencyNetwork.test: + _id = "${_idMain}TestNet"; + _name = "tSalvium"; + _ticker = "tSAL"; default: throw Exception("Unsupported network: $network"); } @@ -53,6 +57,8 @@ class Salvium extends CryptonoteCurrency { switch (network) { case CryptoCurrencyNetwork.main: return csSalvium.validateAddress(address, 0); + case CryptoCurrencyNetwork.test: + return csSalvium.validateAddress(address, 1); default: throw Exception("Unsupported network: $network"); } @@ -77,6 +83,22 @@ class Salvium extends CryptonoteCurrency { clearnetEnabled: true, isPrimary: isPrimary, ); + case CryptoCurrencyNetwork.test: + return NodeModel( + host: "http://127.0.0.1", + port: 29081, + name: DefaultNodes.defaultName, + id: DefaultNodes.buildId(this), + useSSL: false, + enabled: true, + coinName: identifier, + isFailover: true, + isDown: false, + trusted: true, + torEnabled: true, + clearnetEnabled: true, + isPrimary: isPrimary, + ); default: throw UnimplementedError(); diff --git a/lib/wallets/wallet/impl/salvium_wallet.dart b/lib/wallets/wallet/impl/salvium_wallet.dart index c345fb01bb..68d04d41f0 100644 --- a/lib/wallets/wallet/impl/salvium_wallet.dart +++ b/lib/wallets/wallet/impl/salvium_wallet.dart @@ -38,7 +38,12 @@ class SalviumWallet extends LibSalviumWallet { Future loadWallet({ required String path, required String password, - }) => csSalvium.loadWallet(walletId, path: path, password: password); + }) => csSalvium.loadWallet( + walletId, + path: path, + password: password, + network: cryptoCurrency.network == CryptoCurrencyNetwork.main ? 0 : 1, + ); @override Future getCreatedWallet({ @@ -51,6 +56,7 @@ class SalviumWallet extends LibSalviumWallet { password: password, wordCount: wordCount, seedOffset: seedOffset, + network: cryptoCurrency.network == CryptoCurrencyNetwork.main ? 0 : 1, ); @override @@ -66,6 +72,7 @@ class SalviumWallet extends LibSalviumWallet { mnemonic: mnemonic, height: height, seedOffset: seedOffset, + network: cryptoCurrency.network == CryptoCurrencyNetwork.main ? 0 : 1, walletId: walletId, ); @@ -83,6 +90,7 @@ class SalviumWallet extends LibSalviumWallet { address: address, privateViewKey: privateViewKey, height: height, + network: cryptoCurrency.network == CryptoCurrencyNetwork.main ? 0 : 1, ); @override diff --git a/lib/wl_gen/interfaces/cs_salvium_interface.dart b/lib/wl_gen/interfaces/cs_salvium_interface.dart index 3ed43f7135..53ad91b7bb 100644 --- a/lib/wl_gen/interfaces/cs_salvium_interface.dart +++ b/lib/wl_gen/interfaces/cs_salvium_interface.dart @@ -25,6 +25,7 @@ abstract class CsSalviumInterface { String walletId, { required String path, required String password, + int network = 0, }); String getAddress( @@ -38,6 +39,7 @@ abstract class CsSalviumInterface { required String password, required int wordCount, required String seedOffset, + int network = 0, }); Future getRestoredWallet({ @@ -47,6 +49,7 @@ abstract class CsSalviumInterface { required String mnemonic, required String seedOffset, int height = 0, + int network = 0, }); Future getRestoredFromViewKeyWallet({ @@ -56,6 +59,7 @@ abstract class CsSalviumInterface { required String address, required String privateViewKey, int height = 0, + int network = 0, }); String getTxKey(WrappedWallet wallet, String txid); diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index f468180d87..cbcead4841 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -115,6 +115,7 @@ final List _supportedCoins = List.unmodifiable([ Firo(CryptoCurrencyNetwork.test), Litecoin(CryptoCurrencyNetwork.test), Peercoin(CryptoCurrencyNetwork.test), + Salvium(CryptoCurrencyNetwork.test), Stellar(CryptoCurrencyNetwork.test), Xelis(CryptoCurrencyNetwork.test), ]); diff --git a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart index dd6f39829e..e6d83033aa 100644 --- a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart +++ b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart @@ -68,10 +68,12 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { String walletId, { required String path, required String password, + int network = 0, }) async { final wallet = await lib_salvium.SalviumWallet.loadWallet( path: path, password: password, + networkType: network, ); return WrappedWallet(wallet); } @@ -100,6 +102,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { required String password, required int wordCount, required String seedOffset, + int network = 0, }) async { final type = switch (wordCount) { 16 => lib_salvium.SalviumSeedType.sixteen, @@ -112,6 +115,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { password: password, seedType: type, seedOffset: seedOffset, + networkType: network, ); return WrappedWallet(wallet); @@ -124,6 +128,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { required String password, required String mnemonic, required String seedOffset, + int network = 0, int height = 0, }) async { final wallet = await lib_salvium.SalviumWallet.restoreWalletFromSeed( @@ -132,6 +137,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { seed: mnemonic, restoreHeight: height, seedOffset: seedOffset, + networkType: network, ); return WrappedWallet(wallet); @@ -145,6 +151,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { required String address, required String privateViewKey, int height = 0, + int network = 0, }) async { final wallet = await lib_salvium.SalviumWallet.createViewOnlyWallet( path: path, @@ -152,6 +159,7 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { address: address, viewKey: privateViewKey, restoreHeight: height, + networkType: network, ); return WrappedWallet(wallet); From b173841a6136b355f268b4b2abb1fabc8f9843ea Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 9 Oct 2025 17:01:11 -0600 Subject: [PATCH 158/178] display salvium tx type in transaction details --- .../blockchain_data/v2/transaction_v2.dart | 6 + .../tx_v2/transaction_v2_details_view.dart | 2336 ++++++++--------- .../intermediate/lib_salvium_wallet.dart | 2 + .../interfaces/cs_monero_interface.dart | 2 +- ...AL_cs_salvium_interface_impl.template.dart | 12 +- 5 files changed, 1146 insertions(+), 1212 deletions(-) diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart index 44fbaf3f94..a507ba8fe7 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart @@ -406,6 +406,10 @@ class TransactionV2 { bool get isInstantLock => _getFromOtherData(key: TxV2OdKeys.isInstantLock) == true; + @ignore + String? get salviumTypeString => + _getFromOtherData(key: TxV2OdKeys.salviumTypeString) as String?; + @override String toString() { return 'TransactionV2(\n' @@ -441,4 +445,6 @@ abstract final class TxV2OdKeys { static const moneroAccountIndex = "moneroAccountIndex"; static const isMoneroTransaction = "isMoneroTransaction"; static const isInstantLock = "isInstantLock"; + static const salviumTypeInt = "salviumTypeInt"; + static const salviumTypeString = "salviumTypeString"; } diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart index 13c0b1fc4d..21d76faaf8 100644 --- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart @@ -135,36 +135,33 @@ class _TransactionV2DetailsViewState if (mounted) { await showDialog( context: context, - builder: - (context) => DesktopDialog( - maxHeight: null, - maxWidth: 580, - child: Column( - mainAxisSize: MainAxisSize.min, + builder: (context) => DesktopDialog( + maxHeight: null, + maxWidth: 580, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only(left: 32), - child: Text( - "Boost transaction", - style: STextStyles.desktopH3(context), - ), - ), - const DesktopDialogCloseButton(), - ], - ), - Flexible( - child: SingleChildScrollView( - child: BoostTransactionView( - transaction: _transaction, - ), + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Boost transaction", + style: STextStyles.desktopH3(context), ), ), + const DesktopDialogCloseButton(), ], ), - ), + Flexible( + child: SingleChildScrollView( + child: BoostTransactionView(transaction: _transaction), + ), + ), + ], + ), + ), ); } } else { @@ -214,8 +211,11 @@ class _TransactionV2DetailsViewState unit = coin.ticker; } - minConfirms = - ref.read(pWallets).getWallet(walletId).cryptoCurrency.minConfirms; + minConfirms = ref + .read(pWallets) + .getWallet(walletId) + .cryptoCurrency + .minConfirms; final fractionDigits = ethContract?.decimals ?? coin.fractionDigits; @@ -245,35 +245,33 @@ class _TransactionV2DetailsViewState ); break; } - data = - _transaction.outputs - .map( - (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) - .toList(); + data = _transaction.outputs + .map( + (e) => ( + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) + .toList(); } else if (_transaction.subType == TransactionSubType.cashFusion) { amount = _transaction.getAmountReceivedInThisWallet( fractionDigits: fractionDigits, ); - data = - _transaction.outputs - .where((e) => e.walletOwns) - .map( - (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) - .toList(); + data = _transaction.outputs + .where((e) => e.walletOwns) + .map( + (e) => ( + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) + .toList(); } else if (_transaction.isMimblewimblecoinTransaction) { switch (_transaction.type) { case TransactionType.outgoing: @@ -291,8 +289,26 @@ class _TransactionV2DetailsViewState ); break; } - data = - _transaction.outputs + data = _transaction.outputs + .map( + (e) => ( + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) + .toList(); + } else { + switch (_transaction.type) { + case TransactionType.outgoing: + amount = _transaction.getAmountSentFromThisWallet( + fractionDigits: fractionDigits, + subtractFee: coin is! Ethereum, + ); + data = _transaction.outputs + .where((e) => !e.walletOwns) .map( (e) => ( addresses: e.addresses, @@ -303,57 +319,36 @@ class _TransactionV2DetailsViewState ), ) .toList(); - } else { - switch (_transaction.type) { - case TransactionType.outgoing: - amount = _transaction.getAmountSentFromThisWallet( - fractionDigits: fractionDigits, - subtractFee: coin is! Ethereum, - ); - data = - _transaction.outputs - .where((e) => !e.walletOwns) - .map( - (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) - .toList(); break; case TransactionType.incoming: case TransactionType.sentToSelf: if (_transaction.subType == TransactionSubType.sparkMint || _transaction.subType == TransactionSubType.sparkSpend) { - _sparkMemo = - ref - .read(mainDBProvider) - .isar - .sparkCoins - .where() - .walletIdEqualToAnyLTagHash(walletId) - .filter() - .memoIsNotEmpty() - .and() - .heightEqualTo(_transaction.height) - .anyOf( - _transaction.outputs - .where( - (e) => - e.walletOwns && - e.addresses.isEmpty && - e.scriptPubKeyHex.length >= 488, - ) - .map((e) => e.scriptPubKeyHex.substring(2, 488)) - .toList(), - (q, element) => q.serializedCoinB64StartsWith(element), - ) - .memoProperty() - .findFirstSync(); + _sparkMemo = ref + .read(mainDBProvider) + .isar + .sparkCoins + .where() + .walletIdEqualToAnyLTagHash(walletId) + .filter() + .memoIsNotEmpty() + .and() + .heightEqualTo(_transaction.height) + .anyOf( + _transaction.outputs + .where( + (e) => + e.walletOwns && + e.addresses.isEmpty && + e.scriptPubKeyHex.length >= 488, + ) + .map((e) => e.scriptPubKeyHex.substring(2, 488)) + .toList(), + (q, element) => q.serializedCoinB64StartsWith(element), + ) + .memoProperty() + .findFirstSync(); } if (_transaction.subType == TransactionSubType.sparkMint) { @@ -377,19 +372,18 @@ class _TransactionV2DetailsViewState fractionDigits: fractionDigits, ); } - data = - _transaction.outputs - .where((e) => e.walletOwns) - .map( - (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) - .toList(); + data = _transaction.outputs + .where((e) => e.walletOwns) + .map( + (e) => ( + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) + .toList(); break; case TransactionType.unknown: @@ -397,19 +391,18 @@ class _TransactionV2DetailsViewState fractionDigits: fractionDigits, subtractFee: coin is! Ethereum, ); - data = - _transaction.inputs - .where((e) => e.walletOwns) - .map( - (e) => ( - addresses: e.addresses, - amount: Amount( - rawValue: e.value, - fractionDigits: coin.fractionDigits, - ), - ), - ) - .toList(); + data = _transaction.inputs + .where((e) => e.walletOwns) + .map( + (e) => ( + addresses: e.addresses, + amount: Amount( + rawValue: e.value, + fractionDigits: coin.fractionDigits, + ), + ), + ) + .toList(); break; } } @@ -425,12 +418,11 @@ class _TransactionV2DetailsViewState String whatIsIt(TransactionV2 tx, int height) => tx.statusLabel( currentChainHeight: height, minConfirms: minConfirms, - minCoinbaseConfirms: - ref - .read(pWallets) - .getWallet(walletId) - .cryptoCurrency - .minCoinbaseConfirms, + minCoinbaseConfirms: ref + .read(pWallets) + .getWallet(walletId) + .cryptoCurrency + .minCoinbaseConfirms, ); Future fetchContactNameFor(String address) async { @@ -442,10 +434,9 @@ class _TransactionV2DetailsViewState .read(addressBookServiceProvider) .contacts .where( - (element) => - element.addresses - .where((element) => element.address == address) - .isNotEmpty, + (element) => element.addresses + .where((element) => element.address == address) + .isNotEmpty, ); if (contacts.isNotEmpty) { return contacts.first.name; @@ -481,8 +472,9 @@ class _TransactionV2DetailsViewState onChanged: (value) { if (value is bool) { ref - .read(prefsChangeNotifierProvider) - .hideBlockExplorerWarning = value; + .read(prefsChangeNotifierProvider) + .hideBlockExplorerWarning = + value; setState(() {}); } }, @@ -502,10 +494,9 @@ class _TransactionV2DetailsViewState child: Text( "Cancel", style: STextStyles.button(context).copyWith( - color: - Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of( + context, + ).extension()!.accentColorDark, ), ), ), @@ -544,8 +535,9 @@ class _TransactionV2DetailsViewState onChanged: (value) { if (value is bool) { ref - .read(prefsChangeNotifierProvider) - .hideBlockExplorerWarning = value; + .read(prefsChangeNotifierProvider) + .hideBlockExplorerWarning = + value; setState(() {}); } }, @@ -628,10 +620,9 @@ class _TransactionV2DetailsViewState )) { price = ref.watch( priceAnd24hChangeNotifierProvider.select( - (value) => - isTokenTx - ? value.getTokenPrice(_transaction.contractAddress!)?.value - : value.getPrice(coin)?.value, + (value) => isTokenTx + ? value.getTokenPrice(_transaction.contractAddress!)?.value + : value.getPrice(coin)?.value, ), ); } @@ -640,38 +631,36 @@ class _TransactionV2DetailsViewState condition: !isDesktop, builder: (child) => Background(child: child), child: Scaffold( - backgroundColor: - isDesktop - ? Colors.transparent - : Theme.of(context).extension()!.background, - appBar: - isDesktop - ? null - : AppBar( - backgroundColor: - Theme.of(context).extension()!.background, - leading: AppBarBackButton( - onPressed: () async { - // if (FocusScope.of(context).hasFocus) { - // FocusScope.of(context).unfocus(); - // await Future.delayed(Duration(milliseconds: 50)); - // } - Navigator.of(context).pop(); - }, - ), - title: Text( - "Transaction details", - style: STextStyles.navBarTitle(context), - ), + backgroundColor: isDesktop + ? Colors.transparent + : Theme.of(context).extension()!.background, + appBar: isDesktop + ? null + : AppBar( + backgroundColor: Theme.of( + context, + ).extension()!.background, + leading: AppBarBackButton( + onPressed: () async { + // if (FocusScope.of(context).hasFocus) { + // FocusScope.of(context).unfocus(); + // await Future.delayed(Duration(milliseconds: 50)); + // } + Navigator.of(context).pop(); + }, + ), + title: Text( + "Transaction details", + style: STextStyles.navBarTitle(context), ), + ), body: ConditionalParent( condition: !isDesktop, builder: (child) => SafeArea(child: child), child: Padding( - padding: - isDesktop - ? const EdgeInsets.only(left: 32) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.only(left: 32) + : const EdgeInsets.all(12), child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -688,20 +677,18 @@ class _TransactionV2DetailsViewState ), Flexible( child: Padding( - padding: - isDesktop - ? const EdgeInsets.only(right: 32, bottom: 32) - : const EdgeInsets.all(0), + padding: isDesktop + ? const EdgeInsets.only(right: 32, bottom: 32) + : const EdgeInsets.all(0), child: ConditionalParent( condition: isDesktop, builder: (child) { return RoundedWhiteContainer( - borderColor: - isDesktop - ? Theme.of( - context, - ).extension()!.backgroundAppBar - : null, + borderColor: isDesktop + ? Theme.of( + context, + ).extension()!.backgroundAppBar + : null, padding: const EdgeInsets.all(0), child: child, ); @@ -709,41 +696,36 @@ class _TransactionV2DetailsViewState child: SingleChildScrollView( primary: isDesktop ? false : null, child: Padding( - padding: - isDesktop - ? const EdgeInsets.all(0) - : const EdgeInsets.all(4), + padding: isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(4), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(0) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(0) + : const EdgeInsets.all(12), child: Container( - decoration: - isDesktop - ? BoxDecoration( - color: - Theme.of(context) - .extension()! - .backgroundAppBar, - borderRadius: BorderRadius.vertical( - top: Radius.circular( - Constants - .size - .circularBorderRadius, - ), + decoration: isDesktop + ? BoxDecoration( + color: Theme.of(context) + .extension()! + .backgroundAppBar, + borderRadius: BorderRadius.vertical( + top: Radius.circular( + Constants + .size + .circularBorderRadius, ), - ) - : null, + ), + ) + : null, child: Padding( - padding: - isDesktop - ? const EdgeInsets.all(12) - : const EdgeInsets.all(0), + padding: isDesktop + ? const EdgeInsets.all(12) + : const EdgeInsets.all(0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -770,28 +752,25 @@ class _TransactionV2DetailsViewState ], ), Column( - crossAxisAlignment: - isDesktop - ? CrossAxisAlignment.end - : CrossAxisAlignment.start, + crossAxisAlignment: isDesktop + ? CrossAxisAlignment.end + : CrossAxisAlignment.start, children: [ SelectableText( "$amountPrefix${ref.watch(pAmountFormatter(coin)).format(amount, ethContract: ethContract)}", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.titleBold12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.titleBold12( + context, + ), ), const SizedBox(height: 2), if (price != null) @@ -807,9 +786,8 @@ class _TransactionV2DetailsViewState locale: ref.watch( localeServiceChangeNotifierProvider .select( - (value) => - value - .locale, + (value) => value + .locale, ), ), ); @@ -822,14 +800,13 @@ class _TransactionV2DetailsViewState ); return SelectableText( "$amountPrefix$formatted $ticker", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ); }, ), @@ -851,24 +828,20 @@ class _TransactionV2DetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "Status", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle(context), ), // Flexible( // child: FittedBox( @@ -876,33 +849,29 @@ class _TransactionV2DetailsViewState // child: SelectableText( whatIsIt(_transaction, currentHeight), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - _transaction.type == - TransactionType - .outgoing && - _transaction - .subType != - TransactionSubType - .cashFusion - ? Theme.of(context) - .extension< - StackColors - >()! - .accentColorOrange - : Theme.of(context) - .extension< - StackColors - >()! - .accentColorGreen, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + _transaction.type == + TransactionType + .outgoing && + _transaction.subType != + TransactionSubType + .cashFusion + ? Theme.of(context) + .extension< + StackColors + >()! + .accentColorOrange + : Theme.of(context) + .extension< + StackColors + >()! + .accentColorGreen, + ) + : STextStyles.itemSubtitle12(context), ), // ), // ), @@ -925,10 +894,9 @@ class _TransactionV2DetailsViewState _transaction.subType == TransactionSubType.mint)) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -995,14 +963,13 @@ class _TransactionV2DetailsViewState }, child: Text( outputLabel, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), ), const SizedBox(height: 8), @@ -1023,45 +990,43 @@ class _TransactionV2DetailsViewState .addresses .first, ), - builder: ( - builderContext, - AsyncSnapshot - snapshot, - ) { - String - addressOrContactName = - data - .first - .addresses - .first; - if (snapshot.connectionState == - ConnectionState - .done && - snapshot.hasData) { - addressOrContactName = - snapshot.data!; - } - return SelectableText( - addressOrContactName, - style: - isDesktop + builder: + ( + builderContext, + AsyncSnapshot + snapshot, + ) { + String + addressOrContactName = + data + .first + .addresses + .first; + if (snapshot.connectionState == + ConnectionState + .done && + snapshot + .hasData) { + addressOrContactName = + snapshot.data!; + } + return SelectableText( + addressOrContactName, + style: isDesktop ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) : STextStyles.itemSubtitle12( - context, - ), - ); - }, + context, + ), + ); + }, ) else for ( @@ -1071,16 +1036,15 @@ class _TransactionV2DetailsViewState ) ConditionalParent( condition: i > 0, - builder: - (child) => Column( - crossAxisAlignment: - CrossAxisAlignment - .stretch, - children: [ - const _Divider(), - child, - ], - ), + builder: (child) => Column( + crossAxisAlignment: + CrossAxisAlignment + .stretch, + children: [ + const _Divider(), + child, + ], + ), child: Padding( padding: const EdgeInsets.all( @@ -1099,37 +1063,36 @@ class _TransactionV2DetailsViewState fetchContactNameFor( e, ), - builder: ( - builderContext, - AsyncSnapshot< - String - > - snapshot, - ) { - final String - addressOrContactName; - if (snapshot.connectionState == - ConnectionState - .done && - snapshot - .hasData) { - addressOrContactName = - snapshot - .data!; - } else { - addressOrContactName = - e; - } - - return OutputCard( - address: - addressOrContactName, - amount: - data[i] - .amount, - coin: coin, - ); - }, + builder: + ( + builderContext, + AsyncSnapshot< + String + > + snapshot, + ) { + final String + addressOrContactName; + if (snapshot.connectionState == + ConnectionState.done && + snapshot + .hasData) { + addressOrContactName = + snapshot.data!; + } else { + addressOrContactName = + e; + } + + return OutputCard( + address: + addressOrContactName, + amount: + data[i].amount, + coin: + coin, + ); + }, ); }), ], @@ -1154,10 +1117,9 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), if (coin is Epiccash || coin is Mimblewimblecoin) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -1171,33 +1133,30 @@ class _TransactionV2DetailsViewState children: [ Text( "On chain note", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), const SizedBox(height: 8), SelectableText( _transaction.onChainNote ?? "", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1213,10 +1172,9 @@ class _TransactionV2DetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -1229,100 +1187,95 @@ class _TransactionV2DetailsViewState coin is Mimblewimblecoin) ? "Local Note" : "Note ", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), isDesktop ? IconPencilButton( - onPressed: () { - showDialog( - context: context, - builder: (context) { - return DesktopDialog( - maxWidth: 580, - maxHeight: 360, - child: EditNoteView( - txid: _transaction.txid, - walletId: walletId, - ), - ); - }, - ); - }, - ) + onPressed: () { + showDialog( + context: context, + builder: (context) { + return DesktopDialog( + maxWidth: 580, + maxHeight: 360, + child: EditNoteView( + txid: + _transaction.txid, + walletId: walletId, + ), + ); + }, + ); + }, + ) : GestureDetector( - onTap: () { - Navigator.of(context).pushNamed( - EditNoteView.routeName, - arguments: Tuple2( - _transaction.txid, - walletId, - ), - ); - }, - child: Row( - children: [ - SvgPicture.asset( - Assets.svg.pencil, - width: 10, - height: 10, - color: - Theme.of(context) - .extension< - StackColors - >()! - .infoItemIcons, - ), - const SizedBox(width: 4), - Text( - "Edit", - style: STextStyles.link2( - context, + onTap: () { + Navigator.of( + context, + ).pushNamed( + EditNoteView.routeName, + arguments: Tuple2( + _transaction.txid, + walletId, ), - ), - ], - ), - ), - ], - ), - const SizedBox(height: 8), - SelectableText( - ref - .watch( - pTransactionNote(( - txid: + ); + }, + child: Row( + children: [ + SvgPicture.asset( + Assets.svg.pencil, + width: 10, + height: 10, + color: Theme.of(context) + .extension< + StackColors + >()! + .infoItemIcons, + ), + const SizedBox(width: 4), + Text( + "Edit", + style: STextStyles.link2( + context, + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: 8), + SelectableText( + ref + .watch( + pTransactionNote(( + txid: (coin is Epiccash || - coin - is Mimblewimblecoin) - ? _transaction.slateId - .toString() - : _transaction.txid, + coin + is Mimblewimblecoin) + ? _transaction.slateId + .toString() + : _transaction.txid, walletId: walletId, )), ) ?.value ?? "", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12(context), ), ], ), @@ -1333,10 +1286,9 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), if (_sparkMemo != null) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1345,35 +1297,30 @@ class _TransactionV2DetailsViewState children: [ Text( "Memo", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), ], ), const SizedBox(height: 8), SelectableText( _sparkMemo!, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1382,10 +1329,9 @@ class _TransactionV2DetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -1397,14 +1343,13 @@ class _TransactionV2DetailsViewState children: [ Text( "Date", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), @@ -1413,21 +1358,19 @@ class _TransactionV2DetailsViewState Format.extractDateFrom( _transaction.timestamp, ), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1436,21 +1379,17 @@ class _TransactionV2DetailsViewState Format.extractDateFrom( _transaction.timestamp, ), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton( @@ -1473,28 +1412,26 @@ class _TransactionV2DetailsViewState _transaction.type == TransactionType.incoming)) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Builder( builder: (context) { - final String feeString = - showFeePending - ? _transaction.isConfirmed( - currentHeight, - minConfirms, - coin.minCoinbaseConfirms, - ) - ? ref + final String feeString = showFeePending + ? _transaction.isConfirmed( + currentHeight, + minConfirms, + coin.minCoinbaseConfirms, + ) + ? ref .watch( pAmountFormatter(coin), ) .format(fee) - : "Pending" - : ref - .watch(pAmountFormatter(coin)) - .format(fee); + : "Pending" + : ref + .watch(pAmountFormatter(coin)) + .format(fee); return Row( mainAxisAlignment: @@ -1508,37 +1445,33 @@ class _TransactionV2DetailsViewState children: [ Text( "Transaction fee", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + 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, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (supportsRbf && !confirmedTxn) const SizedBox(height: 8), @@ -1552,21 +1485,19 @@ class _TransactionV2DetailsViewState if (!isDesktop) SelectableText( feeString, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: feeString), @@ -1589,9 +1520,9 @@ class _TransactionV2DetailsViewState widget.coin is Ecash) { height = _transaction.height != null && - _transaction.height! > 0 - ? "${_transaction.height!}" - : "Pending"; + _transaction.height! > 0 + ? "${_transaction.height!}" + : "Pending"; confirmations = confirms.toString(); } else if (widget.coin is Epiccash && _transaction.slateId == null) { @@ -1607,10 +1538,9 @@ class _TransactionV2DetailsViewState height = "${_transaction.height == 0 ? "Unknown" : _transaction.height}"; } else { - height = - confirms > 0 - ? "${_transaction.height}" - : "Pending"; + height = confirms > 0 + ? "${_transaction.height}" + : "Pending"; } confirmations = confirms.toString(); @@ -1619,10 +1549,9 @@ class _TransactionV2DetailsViewState return Column( children: [ RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -1635,58 +1564,54 @@ class _TransactionV2DetailsViewState children: [ Text( "Block height", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), if (isDesktop) SelectableText( height, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), if (!isDesktop) SelectableText( height, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: height), @@ -1697,10 +1622,9 @@ class _TransactionV2DetailsViewState ? const _Divider() : const SizedBox(height: 12), RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -1713,58 +1637,54 @@ class _TransactionV2DetailsViewState children: [ Text( "Confirmations", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), if (isDesktop) const SizedBox(height: 2), if (isDesktop) SelectableText( confirmations, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of( - context, - ) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: + Theme.of( + context, + ) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), if (!isDesktop) SelectableText( confirmations, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), if (isDesktop) IconCopyButton(data: height), @@ -1783,10 +1703,9 @@ class _TransactionV2DetailsViewState if (coin is Ethereum && _transaction.type != TransactionType.incoming) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -1795,32 +1714,72 @@ class _TransactionV2DetailsViewState children: [ Text( "Nonce", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle(context), ), SelectableText( _transaction.nonce.toString(), - style: - isDesktop + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), + ), + ], + ), + ), + if (coin is Salvium && + _transaction.salviumTypeString != null) + isDesktop + ? const _Divider() + : const SizedBox(height: 12), + if (coin is Salvium && + _transaction.salviumTypeString != null) + RoundedWhiteContainer( + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "Type", + style: isDesktop ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + context, + ) + : STextStyles.itemSubtitle( + context, + ), + ), + ], + ), + const SizedBox(height: 8), + SelectableText( + _transaction.salviumTypeString!, + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1831,10 +1790,9 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), if (kDebugMode) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -1843,32 +1801,25 @@ class _TransactionV2DetailsViewState children: [ Text( "Tx sub type", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle(context), ), SelectableText( _transaction.subType.toString(), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), ], ), @@ -1890,58 +1841,54 @@ class _TransactionV2DetailsViewState _transaction.subType == TransactionSubType.mweb ? RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ConditionalParent( - condition: !isDesktop, - builder: - (child) => Row( - children: [ - Expanded(child: child), - SimpleCopyButton( - data: _transaction - .txid - .replaceFirst( - "mweb_outputId_", - "", - ), - ), - ], - ), - child: Text( - "MWEB Output ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ConditionalParent( + condition: !isDesktop, + builder: (child) => Row( + children: [ + Expanded(child: child), + SimpleCopyButton( + data: _transaction.txid + .replaceFirst( + "mweb_outputId_", + "", + ), + ), + ], + ), + child: Text( + "MWEB Output ID", + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( context, ) - : STextStyles.itemSubtitle( + : STextStyles.itemSubtitle( context, ), + ), ), - ), - const SizedBox(height: 8), - SelectableText( - _transaction.txid.replaceFirst( - "mweb_outputId_", - "", - ), - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( + const SizedBox(height: 8), + SelectableText( + _transaction.txid + .replaceFirst( + "mweb_outputId_", + "", + ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( context, ).copyWith( color: @@ -1951,142 +1898,137 @@ class _TransactionV2DetailsViewState >()! .textDark, ) - : STextStyles.itemSubtitle12( + : STextStyles.itemSubtitle12( context, ), - ), - // if (coin is Litecoin && - // coin.network == - // CryptoCurrencyNetwork - // .main) - // const SizedBox(height: 8), - // if (coin is Litecoin && - // coin.network == - // CryptoCurrencyNetwork - // .main) - // CustomTextButton( - // text: - // "Open in block explorer", - // onTap: () async { - // final uri = - // getBlockExplorerTransactionUrlFor( - // coin: coin, - // txid: _transaction - // .txid - // .replaceFirst( - // "mweb_outputId_", - // "", - // ), - // ); - // - // if (ref - // .read( - // prefsChangeNotifierProvider, - // ) - // .hideBlockExplorerWarning == - // false) { - // final shouldContinue = - // await showExplorerWarning( - // "${uri.scheme}://${uri.host}", - // ); - // - // if (!shouldContinue) { - // return; - // } - // } - // try { - // await launchUrl( - // uri, - // mode: - // LaunchMode - // .externalApplication, - // ); - // } catch (_) { - // if (context.mounted) { - // unawaited( - // showDialog( - // context: context, - // builder: - // ( - // _, - // ) => StackOkDialog( - // title: - // "Could not open in block explorer", - // message: - // "Failed to open \"${uri.toString()}\"", - // ), - // ), - // ); - // } - // } - // }, - // ), - ], - ), - ), - if (isDesktop) - const SizedBox(width: 12), - if (isDesktop) - IconCopyButton( - data: _transaction.txid - .replaceFirst( - "mweb_outputId_", - "", ), + // if (coin is Litecoin && + // coin.network == + // CryptoCurrencyNetwork + // .main) + // const SizedBox(height: 8), + // if (coin is Litecoin && + // coin.network == + // CryptoCurrencyNetwork + // .main) + // CustomTextButton( + // text: + // "Open in block explorer", + // onTap: () async { + // final uri = + // getBlockExplorerTransactionUrlFor( + // coin: coin, + // txid: _transaction + // .txid + // .replaceFirst( + // "mweb_outputId_", + // "", + // ), + // ); + // + // if (ref + // .read( + // prefsChangeNotifierProvider, + // ) + // .hideBlockExplorerWarning == + // false) { + // final shouldContinue = + // await showExplorerWarning( + // "${uri.scheme}://${uri.host}", + // ); + // + // if (!shouldContinue) { + // return; + // } + // } + // try { + // await launchUrl( + // uri, + // mode: + // LaunchMode + // .externalApplication, + // ); + // } catch (_) { + // if (context.mounted) { + // unawaited( + // showDialog( + // context: context, + // builder: + // ( + // _, + // ) => StackOkDialog( + // title: + // "Could not open in block explorer", + // message: + // "Failed to open \"${uri.toString()}\"", + // ), + // ), + // ); + // } + // } + // }, + // ), + ], + ), ), - ], - ), - ) + if (isDesktop) + const SizedBox(width: 12), + if (isDesktop) + IconCopyButton( + data: _transaction.txid + .replaceFirst( + "mweb_outputId_", + "", + ), + ), + ], + ), + ) : RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ConditionalParent( - condition: !isDesktop, - builder: - (child) => Row( - children: [ - Expanded(child: child), - SimpleCopyButton( - data: - _transaction.txid, - ), - ], - ), - child: Text( - "Transaction ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ConditionalParent( + condition: !isDesktop, + builder: (child) => Row( + children: [ + Expanded(child: child), + SimpleCopyButton( + data: _transaction.txid, + ), + ], + ), + child: Text( + "Transaction ID", + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( context, ) - : STextStyles.itemSubtitle( + : STextStyles.itemSubtitle( context, ), + ), ), - ), - const SizedBox(height: 8), - // Flexible( - // child: FittedBox( - // fit: BoxFit.scaleDown, - // child: - SelectableText( - _transaction.txid, - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( + const SizedBox(height: 8), + // Flexible( + // child: FittedBox( + // fit: BoxFit.scaleDown, + // child: + SelectableText( + _transaction.txid, + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( context, ).copyWith( color: @@ -2096,101 +2038,97 @@ class _TransactionV2DetailsViewState >()! .textDark, ) - : STextStyles.itemSubtitle12( + : STextStyles.itemSubtitle12( context, ), - ), - if (coin is! Epiccash && - coin is! Mimblewimblecoin) - const SizedBox(height: 8), - if (coin is! Epiccash && - coin is! Mimblewimblecoin) - CustomTextButton( - text: - "Open in block explorer", - onTap: () async { - final uri = - getBlockExplorerTransactionUrlFor( - coin: coin, - txid: - _transaction.txid, - ); - - if (ref - .read( - prefsChangeNotifierProvider, - ) - .hideBlockExplorerWarning == - false) { - final shouldContinue = - await showExplorerWarning( - "${uri.scheme}://${uri.host}", + ), + if (coin is! Epiccash && + coin is! Mimblewimblecoin) + const SizedBox(height: 8), + if (coin is! Epiccash && + coin is! Mimblewimblecoin) + CustomTextButton( + text: + "Open in block explorer", + onTap: () async { + final uri = + getBlockExplorerTransactionUrlFor( + coin: coin, + txid: _transaction + .txid, ); - if (!shouldContinue) { - return; + if (ref + .read( + prefsChangeNotifierProvider, + ) + .hideBlockExplorerWarning == + false) { + final shouldContinue = + await showExplorerWarning( + "${uri.scheme}://${uri.host}", + ); + + if (!shouldContinue) { + return; + } } - } - - // ref - // .read( - // shouldShowLockscreenOnResumeStateProvider - // .state) - // .state = false; - try { - await launchUrl( - uri, - mode: - LaunchMode - .externalApplication, - ); - } catch (_) { - if (context.mounted) { - unawaited( - showDialog( - context: context, - builder: - ( - _, - ) => StackOkDialog( - title: - "Could not open in block explorer", - message: - "Failed to open \"${uri.toString()}\"", - maxWidth: - Util.isDesktop - ? 400 - : null, - ), - ), + + // ref + // .read( + // shouldShowLockscreenOnResumeStateProvider + // .state) + // .state = false; + try { + await launchUrl( + uri, + mode: LaunchMode + .externalApplication, ); + } catch (_) { + if (context.mounted) { + unawaited( + showDialog( + context: context, + builder: (_) => StackOkDialog( + title: + "Could not open in block explorer", + message: + "Failed to open \"${uri.toString()}\"", + maxWidth: + Util.isDesktop + ? 400 + : null, + ), + ), + ); + } + } finally { + // Future.delayed( + // const Duration(seconds: 1), + // () => ref + // .read( + // shouldShowLockscreenOnResumeStateProvider + // .state) + // .state = true, + // ); } - } finally { - // Future.delayed( - // const Duration(seconds: 1), - // () => ref - // .read( - // shouldShowLockscreenOnResumeStateProvider - // .state) - // .state = true, - // ); - } - }, - ), - // ), - // ), - ], - ), - ), - if (isDesktop) - const SizedBox(width: 12), - if (isDesktop) - IconCopyButton( - data: _transaction.txid, + }, + ), + // ), + // ), + ], + ), ), - ], + if (isDesktop) + const SizedBox(width: 12), + if (isDesktop) + IconCopyButton( + data: _transaction.txid, + ), + ], + ), ), - ), // if ((coin is FiroTestNet || coin is Firo) && // _transaction.subType == "mint") // const SizedBox( @@ -2274,10 +2212,9 @@ class _TransactionV2DetailsViewState : const SizedBox(height: 12), if (coin is Epiccash || coin is Mimblewimblecoin) RoundedWhiteContainer( - padding: - isDesktop - ? const EdgeInsets.all(16) - : const EdgeInsets.all(12), + padding: isDesktop + ? const EdgeInsets.all(16) + : const EdgeInsets.all(12), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -2290,14 +2227,13 @@ class _TransactionV2DetailsViewState children: [ Text( "Slate ID", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ) - : STextStyles.itemSubtitle( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ) + : STextStyles.itemSubtitle( + context, + ), ), // Flexible( // child: FittedBox( @@ -2305,21 +2241,19 @@ class _TransactionV2DetailsViewState // child: SelectableText( _transaction.slateId ?? "Unknown", - style: - isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith( - color: - Theme.of(context) - .extension< - StackColors - >()! - .textDark, - ) - : STextStyles.itemSubtitle12( - context, - ), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension< + StackColors + >()! + .textDark, + ) + : STextStyles.itemSubtitle12( + context, + ), ), // ), // ), @@ -2363,165 +2297,154 @@ class _TransactionV2DetailsViewState floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: ((coin is Epiccash || coin is Mimblewimblecoin) && - _transaction.getConfirmations(currentHeight) < 1 && - _transaction.isCancelled == false) - ? ConditionalParent( - condition: isDesktop, - builder: - (child) => Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 16, - ), - child: child, - ), - child: SizedBox( - width: MediaQuery.of(context).size.width - 32, - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Theme.of(context).extension()!.textError, - ), + _transaction.getConfirmations(currentHeight) < 1 && + _transaction.isCancelled == false) + ? ConditionalParent( + condition: isDesktop, + builder: (child) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: 32, + vertical: 16, + ), + child: child, + ), + child: SizedBox( + width: MediaQuery.of(context).size.width - 32, + child: TextButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + Theme.of(context).extension()!.textError, ), - onPressed: () async { - final wallet = ref.read(pWallets).getWallet(walletId); - - if (wallet is EpiccashWallet) { - final String? id = _transaction.slateId; - if (id == null) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Could not find Epic transaction ID", - context: context, - ), - ); - return; - } + ), + onPressed: () async { + final wallet = ref.read(pWallets).getWallet(walletId); + if (wallet is EpiccashWallet) { + final String? id = _transaction.slateId; + if (id == null) { unawaited( - showDialog( - barrierDismissible: false, + showFloatingFlushBar( + type: FlushBarType.warning, + message: "Could not find Epic transaction ID", context: context, - builder: - (_) => - const CancellingTransactionProgressDialog(), ), ); + return; + } - final result = await wallet - .cancelPendingTransactionAndPost(id); - if (context.mounted) { - // Pop progress dialog. - Navigator.of(context).pop(); - - if (result.isEmpty) { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Transaction cancelled", - onOkPressed: (_) { - Navigator.of(context).popUntil( - ModalRoute.withName( - WalletView.routeName, - ), - ); - }, - maxWidth: Util.isDesktop ? 400 : null, - ), - ); - unawaited(wallet.refresh()); - } else { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Failed to cancel transaction", - message: result, - maxWidth: Util.isDesktop ? 400 : null, - ), - ); - } - } - } else if (wallet is MimblewimblecoinWallet) { - final String? id = _transaction.slateId; - if (id == null) { - unawaited( - showFloatingFlushBar( - type: FlushBarType.warning, - message: "Could not find MWC transaction ID", - context: context, + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = await wallet + .cancelPendingTransactionAndPost(id); + if (context.mounted) { + // Pop progress dialog. + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + Navigator.of(context).popUntil( + ModalRoute.withName(WalletView.routeName), + ); + }, + maxWidth: Util.isDesktop ? 400 : null, ), ); - return; - } - - unawaited( - showDialog( - barrierDismissible: false, + unawaited(wallet.refresh()); + } else { + await showDialog( context: context, - builder: - (_) => - const CancellingTransactionProgressDialog(), - ), - ); - - final result = await wallet - .cancelPendingTransactionAndPost(id); - if (context.mounted) { - // pop progress dialog - Navigator.of(context).pop(); - - if (result.isEmpty) { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Transaction cancelled", - onOkPressed: (_) { - Navigator.of(context).popUntil( - ModalRoute.withName( - WalletView.routeName, - ), - ); - }, - maxWidth: Util.isDesktop ? 400 : null, - ), - ); - unawaited(wallet.refresh()); - } else { - await showDialog( - context: context, - builder: - (_) => StackOkDialog( - title: "Failed to cancel transaction", - message: result, - maxWidth: Util.isDesktop ? 400 : null, - ), - ); - } + builder: (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + maxWidth: Util.isDesktop ? 400 : null, + ), + ); } - } else { + } + } else if (wallet is MimblewimblecoinWallet) { + final String? id = _transaction.slateId; + if (id == null) { unawaited( showFloatingFlushBar( type: FlushBarType.warning, - message: - "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", + message: "Could not find MWC transaction ID", context: context, ), ); return; } - }, - child: Text( - "Cancel Transaction", - style: STextStyles.button(context), - ), + + unawaited( + showDialog( + barrierDismissible: false, + context: context, + builder: (_) => + const CancellingTransactionProgressDialog(), + ), + ); + + final result = await wallet + .cancelPendingTransactionAndPost(id); + if (context.mounted) { + // pop progress dialog + Navigator.of(context).pop(); + + if (result.isEmpty) { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Transaction cancelled", + onOkPressed: (_) { + Navigator.of(context).popUntil( + ModalRoute.withName(WalletView.routeName), + ); + }, + maxWidth: Util.isDesktop ? 400 : null, + ), + ); + unawaited(wallet.refresh()); + } else { + await showDialog( + context: context, + builder: (_) => StackOkDialog( + title: "Failed to cancel transaction", + message: result, + maxWidth: Util.isDesktop ? 400 : null, + ), + ); + } + } + } else { + unawaited( + showFloatingFlushBar( + type: FlushBarType.warning, + message: + "ERROR: Wallet type is not Epic Cash or MimbleWimbleCoin", + context: context, + ), + ); + return; + } + }, + child: Text( + "Cancel Transaction", + style: STextStyles.button(context), ), ), - ) - : null, + ), + ) + : null, ), ); } @@ -2546,19 +2469,17 @@ class OutputCard extends ConsumerWidget { children: [ Text( "Address", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.itemSubtitle(context), + style: Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.itemSubtitle(context), ), SelectableText( address, - style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context).extension()!.textDark, - ) - : STextStyles.itemSubtitle12(context), + style: Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context).copyWith( + color: Theme.of(context).extension()!.textDark, + ) + : STextStyles.itemSubtitle12(context), ), const SizedBox(height: 10), Row( @@ -2566,24 +2487,19 @@ class OutputCard extends ConsumerWidget { children: [ Text( "Amount", - style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.itemSubtitle(context), + style: Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.itemSubtitle(context), ), SelectableText( ref.watch(pAmountFormatter(coin)).format(amount), - style: - Util.isDesktop - ? STextStyles.desktopTextExtraExtraSmall( + style: Util.isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context).copyWith( + color: Theme.of( context, - ).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark, - ) - : STextStyles.itemSubtitle12(context), + ).extension()!.textDark, + ) + : STextStyles.itemSubtitle12(context), ), ], ), @@ -2615,8 +2531,9 @@ class IconCopyButton extends StatelessWidget { height: 26, width: 26, child: RawMaterialButton( - fillColor: - Theme.of(context).extension()!.buttonBackSecondary, + fillColor: Theme.of( + context, + ).extension()!.buttonBackSecondary, elevation: 0, hoverElevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), @@ -2656,8 +2573,9 @@ class IconPencilButton extends StatelessWidget { height: 26, width: 26, child: RawMaterialButton( - fillColor: - Theme.of(context).extension()!.buttonBackSecondary, + fillColor: Theme.of( + context, + ).extension()!.buttonBackSecondary, elevation: 0, hoverElevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), diff --git a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart index c3da08809b..89c9b305ef 100644 --- a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart @@ -669,6 +669,8 @@ abstract class LibSalviumWallet ).toJsonString(), TxV2OdKeys.moneroAccountIndex: tx.accountIndex, TxV2OdKeys.isMoneroTransaction: true, + TxV2OdKeys.salviumTypeInt: tx.salviumData?.type, + TxV2OdKeys.salviumTypeString: tx.salviumData?.typeDisplay, }), ); diff --git a/lib/wl_gen/interfaces/cs_monero_interface.dart b/lib/wl_gen/interfaces/cs_monero_interface.dart index 8987508436..a676bd169e 100644 --- a/lib/wl_gen/interfaces/cs_monero_interface.dart +++ b/lib/wl_gen/interfaces/cs_monero_interface.dart @@ -300,7 +300,7 @@ final class CsTransaction { /// Flag indicating whether the transaction is pending (i.e., not yet confirmed). bool get isPending => confirmations < minConfirms; - final ({int type, String asset})? salviumData; + final ({int type, String typeDisplay, String asset})? salviumData; } // forwarding class diff --git a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart index e6d83033aa..fb13045843 100644 --- a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart +++ b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart @@ -299,7 +299,11 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { key: e.key, timeStamp: e.timeStamp, minConfirms: e.minConfirms.value, - salviumData: (asset: e.asset, type: e.type.value), + salviumData: ( + asset: e.asset, + type: e.type.value, + typeDisplay: e.type.displayName, + ), ), ) .toList(); @@ -333,7 +337,11 @@ class _CsSalviumInterfaceImpl extends CsSalviumInterface { key: e.key, timeStamp: e.timeStamp, minConfirms: e.minConfirms.value, - salviumData: (asset: e.asset, type: e.type.value), + salviumData: ( + asset: e.asset, + type: e.type.value, + typeDisplay: e.type.displayName, + ), ), ) .toList(); From 372931413009c0d5a424727934a4fa722895d368 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 10 Oct 2025 06:26:54 -0600 Subject: [PATCH 159/178] do not show anonymize all button in view only wallets --- lib/pages/wallet_view/wallet_view.dart | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index 209df99f3a..417ad227dd 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -816,11 +816,17 @@ class _WalletViewState extends ConsumerState { ), ), ), - if (isSparkWallet || - ref.watch(pWalletInfo(walletId)).isMwebEnabled) + if ((isSparkWallet || + ref + .watch(pWalletInfo(walletId)) + .isMwebEnabled) && + !viewOnly) const SizedBox(height: 10), - if (isSparkWallet || - ref.watch(pWalletInfo(walletId)).isMwebEnabled) + if ((isSparkWallet || + ref + .watch(pWalletInfo(walletId)) + .isMwebEnabled) && + !viewOnly) Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Row( From f26047ab8ec296d39ab1a6f2ceb1826628ba4768 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 10 Oct 2025 07:58:39 -0600 Subject: [PATCH 160/178] downgrade errors to warnings --- lib/wallets/wallet/intermediate/lib_monero_wallet.dart | 9 +++++++++ lib/wallets/wallet/intermediate/lib_salvium_wallet.dart | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart index 9f88a62769..e5f91c4ff8 100644 --- a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart @@ -827,6 +827,15 @@ abstract class LibMoneroWallet final _utxosUpdateLock = Mutex(); Future onUTXOsChanged(List utxos) async { + if (wallet == null) { + Logging.instance.w( + "onUTXOsChanged triggered while cs_monero wallet is null. If this " + "occurs while not in a monero/wownero wallet this warning can be " + "ignored.", + ); + return; + } + await _utxosUpdateLock.protect(() async { final cwUtxos = await csMonero.getOutputs(wallet!, refresh: true); diff --git a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart index 89c9b305ef..4081c9012b 100644 --- a/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_salvium_wallet.dart @@ -797,6 +797,14 @@ abstract class LibSalviumWallet final _utxosUpdateLock = Mutex(); Future onUTXOsChanged(List utxos) async { + if (wallet == null) { + Logging.instance.w( + "onUTXOsChanged triggered while cs_salvium wallet is null. If this " + "occurs while not in a salvium wallet this warning can be ignored.", + ); + return; + } + await _utxosUpdateLock.protect(() async { final cwUtxos = await csSalvium.getOutputs(wallet!, refresh: true); From f7784c879c6a0e29a7aff0f7ee2fd93970b9bc38 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 10 Oct 2025 08:19:39 -0600 Subject: [PATCH 161/178] const mwebd interface constructor --- lib/services/mwebd_service.dart | 34 ++++++++++++------- .../interfaces/mwebd_server_interface.dart | 16 +++++++-- ..._mwebd_server_interface_impl.template.dart | 34 +++++++++++-------- 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/lib/services/mwebd_service.dart b/lib/services/mwebd_service.dart index 3c60a9ac9d..2462257505 100644 --- a/lib/services/mwebd_service.dart +++ b/lib/services/mwebd_service.dart @@ -24,7 +24,11 @@ final class MwebdService { CryptoCurrencyNetwork.test4 => throw UnimplementedError(), }; - final Map _map = {}; + final Map< + CryptoCurrencyNetwork, + ({OpaqueMwebdServer server, MwebClient client}) + > + _map = {}; late final StreamSubscription _torStatusListener; @@ -84,16 +88,16 @@ final class MwebdService { : "socks5://${proxyInfo.host.address}:${proxyInfo.port}"; final nets = _map.keys; for (final net in nets) { - final oldClient = _map.remove(net)!; - await oldClient.cleanup(); - final oldServerInfo = await mwebdServerInterface.stopServer(net); + final old = _map.remove(net)!; + await old.client.cleanup(); + final oldServerInfo = await mwebdServerInterface.stopServer(old.server); final port = await _getRandomUnusedPort(); if (port == null) { throw Exception("Could not find an unused port for mwebd"); } - final serverPort = await mwebdServerInterface.createAndStartServer( + final serverData = await mwebdServerInterface.createAndStartServer( net, chain: oldServerInfo.chain, dataDir: oldServerInfo.dataDir, @@ -102,7 +106,9 @@ final class MwebdService { serverPort: port, ); - _map[net] = MwebClient.fromHost("127.0.0.1", serverPort); + final newClient = MwebClient.fromHost("127.0.0.1", serverData.port); + + _map[net] = (server: serverData.server, client: newClient); } }); } @@ -116,10 +122,10 @@ final class MwebdService { } if (_map.isNotEmpty) { - for (final net in _map.keys) { + for (final old in _map.values) { try { - await _map[net]?.cleanup(); - await mwebdServerInterface.stopServer(net); + await old.client.cleanup(); + await mwebdServerInterface.stopServer(old.server); } catch (e, s) { Logging.instance.i( "Switching mwebd chain. Error likely expected here.", @@ -154,7 +160,7 @@ final class MwebdService { proxy = ""; } - final serverPort = await mwebdServerInterface.createAndStartServer( + final serverData = await mwebdServerInterface.createAndStartServer( net, chain: chain, dataDir: dir.path, @@ -163,7 +169,9 @@ final class MwebdService { serverPort: port, ); - _map[net] = MwebClient.fromHost("127.0.0.1", serverPort); + final newClient = MwebClient.fromHost("127.0.0.1", serverData.port); + + _map[net] = (server: serverData.server, client: newClient); Logging.instance.i("MwebdService init($net) completed!"); }); @@ -172,14 +180,14 @@ final class MwebdService { /// Get server status. Returns null if no server was initialized. Future getServerStatus(CryptoCurrencyNetwork net) { return _updateLock.protect(() { - return mwebdServerInterface.getServerStatus(net); + return mwebdServerInterface.getServerStatus(_map[net]?.server); }); } /// Get client for network. Returns null if no server was initialized. Future getClient(CryptoCurrencyNetwork net) async { return await _updateLock.protect(() async { - return _map[net]; + return _map[net]?.client; }); } diff --git a/lib/wl_gen/interfaces/mwebd_server_interface.dart b/lib/wl_gen/interfaces/mwebd_server_interface.dart index 08dc08f65d..8b597d0771 100644 --- a/lib/wl_gen/interfaces/mwebd_server_interface.dart +++ b/lib/wl_gen/interfaces/mwebd_server_interface.dart @@ -3,7 +3,9 @@ import '../../wallets/crypto_currency/crypto_currency.dart'; export '../generated/mwebd_server_interface_impl.dart'; abstract class MwebdServerInterface { - Future createAndStartServer( + const MwebdServerInterface(); + + Future<({OpaqueMwebdServer server, int port})> createAndStartServer( CryptoCurrencyNetwork net, { required String chain, required String dataDir, @@ -13,10 +15,10 @@ abstract class MwebdServerInterface { }); Future<({String chain, String dataDir, String peer})> stopServer( - CryptoCurrencyNetwork net, + OpaqueMwebdServer server, ); - Future getServerStatus(CryptoCurrencyNetwork net); + Future getServerStatus(OpaqueMwebdServer? server); } // local copy @@ -60,3 +62,11 @@ class Status { blockTime, ); } + +final class OpaqueMwebdServer { + final Object _value; + + const OpaqueMwebdServer(this._value); + + T get() => _value as T; +} diff --git a/tool/wl_templates/MWEBD_mwebd_server_interface_impl.template.dart b/tool/wl_templates/MWEBD_mwebd_server_interface_impl.template.dart index bf3793e1b0..55ba2c630a 100644 --- a/tool/wl_templates/MWEBD_mwebd_server_interface_impl.template.dart +++ b/tool/wl_templates/MWEBD_mwebd_server_interface_impl.template.dart @@ -12,13 +12,17 @@ MwebdServerInterface _getInterface() => throw Exception("MWEBD not enabled!"); //END_OFF //ON -MwebdServerInterface _getInterface() => _MwebdServerInterfaceImpl(); +MwebdServerInterface _getInterface() => const _MwebdServerInterfaceImpl(); + +extension _OpaqueMwebdServerExt on OpaqueMwebdServer { + MwebdServer get value => get(); +} class _MwebdServerInterfaceImpl extends MwebdServerInterface { - final Map _map = {}; + const _MwebdServerInterfaceImpl(); @override - Future createAndStartServer( + Future<({OpaqueMwebdServer server, int port})> createAndStartServer( CryptoCurrencyNetwork net, { required String chain, required String dataDir, @@ -26,10 +30,6 @@ class _MwebdServerInterfaceImpl extends MwebdServerInterface { String proxy = "", required int serverPort, }) async { - if (_map[net] != null) { - throw Exception("Server for $net already exists"); - } - final newServer = MwebdServer( chain: chain, dataDir: dataDir, @@ -39,22 +39,26 @@ class _MwebdServerInterfaceImpl extends MwebdServerInterface { ); await newServer.createServer(); await newServer.startServer(); - _map[net] = newServer; - return newServer.serverPort; + return (server: OpaqueMwebdServer(newServer), port: newServer.serverPort); } @override Future<({String chain, String dataDir, String peer})> stopServer( - CryptoCurrencyNetwork net, + OpaqueMwebdServer server, ) async { - final server = _map.remove(net); - await server!.stopServer(); - return (chain: server.chain, dataDir: server.dataDir, peer: server.peer); + final actual = server.value; + final data = ( + chain: actual.chain, + dataDir: actual.dataDir, + peer: actual.peer, + ); + await actual.stopServer(); + return data; } @override - Future getServerStatus(CryptoCurrencyNetwork net) async { - final status = await _map[net]?.getStatus(); + Future getServerStatus(OpaqueMwebdServer? server) async { + final status = await server?.value.getStatus(); if (status == null) return null; return Status( From 7dcbef7a44ae3795c50fdf39c173ee0595896afd Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 10 Oct 2025 08:45:09 -0600 Subject: [PATCH 162/178] const xelis interface constructor --- lib/wallets/wallet/impl/xelis_wallet.dart | 63 +++---- .../wallet/intermediate/lib_xelis_wallet.dart | 12 +- .../interfaces/lib_xelis_interface.dart | 56 ++++--- ...XEL_lib_xelis_interface_impl.template.dart | 157 +++++++++--------- 4 files changed, 156 insertions(+), 132 deletions(-) diff --git a/lib/wallets/wallet/impl/xelis_wallet.dart b/lib/wallets/wallet/impl/xelis_wallet.dart index d36b8310c0..9a4fd10c76 100644 --- a/lib/wallets/wallet/impl/xelis_wallet.dart +++ b/lib/wallets/wallet/impl/xelis_wallet.dart @@ -49,7 +49,7 @@ class XelisWallet extends LibXelisWallet { invalidSeedLengthCheck(seedLength); Logging.instance.i("Xelis: recovering wallet"); - await libXelis.createXelisWallet( + final wallet = await libXelis.createXelisWallet( walletId, name: name, directory: directory, @@ -65,6 +65,8 @@ class XelisWallet extends LibXelisWallet { value: mnemonic, ); + this.wallet = wallet; + await _finishInit(); } @@ -82,7 +84,7 @@ class XelisWallet extends LibXelisWallet { value: password, ); - await libXelis.createXelisWallet( + final wallet = await libXelis.createXelisWallet( walletId, name: name, directory: directory, @@ -92,12 +94,14 @@ class XelisWallet extends LibXelisWallet { l1Low: tableState.currentSize.isLow, ); - final mnemonic = await libXelis.getSeed(walletId); + final mnemonic = await libXelis.getSeed(wallet); await secureStorageInterface.write( key: Wallet.mnemonicKey(walletId: walletId), value: mnemonic.trim(), ); + this.wallet = wallet; + await _finishInit(); } @@ -112,7 +116,7 @@ class XelisWallet extends LibXelisWallet { key: Wallet.mnemonicPassphraseKey(walletId: info.walletId), ); - await libXelis.openXelisWallet( + wallet = await libXelis.openXelisWallet( walletId, name: name, directory: directory, @@ -136,7 +140,7 @@ class XelisWallet extends LibXelisWallet { walletId: walletId, derivationIndex: 0, derivationPath: null, - value: libXelis.getAddress(walletId), + value: libXelis.getAddress(wallet!), publicKey: [], type: AddressType.xelis, subType: AddressSubType.receiving, @@ -168,7 +172,7 @@ class XelisWallet extends LibXelisWallet { walletId, ); - if (!libXelis.walletInstanceExists(walletId)) { + if (wallet == null) { if (isRestore == true) { await _restoreWallet(); } else { @@ -224,7 +228,7 @@ class XelisWallet extends LibXelisWallet { @override Future pingCheck() async { try { - await libXelis.getDaemonInfo(walletId); + await libXelis.getDaemonInfo(wallet!); await handleOnline(); return true; } catch (_) { @@ -239,11 +243,11 @@ class XelisWallet extends LibXelisWallet { Future updateBalance({int? newBalance}) async { await _balanceUpdateMutex.protect(() async { try { - if (await libXelis.hasXelisBalance(walletId)) { + if (await libXelis.hasXelisBalance(wallet!)) { final BigInt xelBalance = newBalance != null ? BigInt.from(newBalance) : await libXelis.getXelisBalanceRaw( - walletId, + wallet!, ); // in the future, use getAssetBalances and handle each final balance = Balance( total: Amount( @@ -274,7 +278,7 @@ class XelisWallet extends LibXelisWallet { } Future _fetchChainHeight() async { - final infoString = await libXelis.getDaemonInfo(walletId); + final infoString = await libXelis.getDaemonInfo(wallet!); final Map nodeInfo = (json.decode(infoString) as Map) .cast(); @@ -304,9 +308,9 @@ class XelisWallet extends LibXelisWallet { @override Future updateNode() async { try { - final bool online = await libXelis.isOnline(walletId); + final bool online = await libXelis.isOnline(wallet!); if (online == true) { - await libXelis.offlineMode(walletId); + await libXelis.offlineMode(wallet!); } await super.connect(); } catch (e, s) { @@ -333,7 +337,7 @@ class XelisWallet extends LibXelisWallet { walletId: walletId, derivationIndex: 0, derivationPath: null, - value: libXelis.getAddress(walletId), + value: libXelis.getAddress(wallet!), publicKey: [], type: AddressType.xelis, subType: AddressSubType.receiving, @@ -356,10 +360,10 @@ class XelisWallet extends LibXelisWallet { firstBlock -= 10; } } else { - await libXelis.rescan(walletId, topoheight: BigInt.from(pruningHeight)); + await libXelis.rescan(wallet!, topoheight: BigInt.from(pruningHeight)); } - final txList = objTransactions ?? (await libXelis.allHistory(walletId)); + final txList = objTransactions ?? (await libXelis.allHistory(wallet!)); final List txns = []; @@ -395,7 +399,7 @@ class XelisWallet extends LibXelisWallet { txType = TransactionType.incoming; final int decimals = await libXelis.getAssetDecimals( - walletId, + wallet!, asset: libXelis.xelisAsset, ); @@ -418,7 +422,7 @@ class XelisWallet extends LibXelisWallet { txType = TransactionType.outgoing; final int decimals = await libXelis.getAssetDecimals( - walletId, + wallet!, asset: burn.asset, ); @@ -460,7 +464,7 @@ class XelisWallet extends LibXelisWallet { for (final transfer in incoming.transfers) { final int decimals = await libXelis.getAssetDecimals( - walletId, + wallet!, asset: transfer.asset, ); @@ -639,7 +643,7 @@ class XelisWallet extends LibXelisWallet { ); // Check balance using raw method - final xelBalance = await libXelis.getXelisBalanceRaw(walletId); + final xelBalance = await libXelis.getXelisBalanceRaw(wallet!); final balance = Amount( rawValue: xelBalance, fractionDigits: cryptoCurrency.fractionDigits, @@ -657,13 +661,13 @@ class XelisWallet extends LibXelisWallet { // Check if we have enough for both transfers and fee if (totalSendAmount + boostedFee > balance) { final requiredAmt = await libXelis.formatCoin( - walletId, + wallet!, atomicAmount: (totalSendAmount + boostedFee).raw, assetHash: asset, ); final availableAmt = await libXelis.formatCoin( - walletId, + wallet!, atomicAmount: xelBalance, assetHash: asset, ); @@ -722,7 +726,7 @@ class XelisWallet extends LibXelisWallet { try { final amt = double.parse( await libXelis.formatCoin( - walletId, + wallet!, atomicAmount: recipient.amount.raw, assetHash: asset, ), @@ -753,12 +757,9 @@ class XelisWallet extends LibXelisWallet { }), ); - final decimals = await libXelis.getAssetDecimals( - walletId, - asset: asset, - ); + final decimals = await libXelis.getAssetDecimals(wallet!, asset: asset); final estimatedFee = double.parse( - await libXelis.estimateFees(walletId, transfers: transfers), + await libXelis.estimateFees(wallet!, transfers: transfers), ); final rawFee = (estimatedFee * pow(10, decimals)).round(); return Amount( @@ -807,7 +808,7 @@ class XelisWallet extends LibXelisWallet { final amt = double.parse( await libXelis.formatCoin( - walletId, + wallet!, atomicAmount: sendAmount.raw, assetHash: asset, ), @@ -815,7 +816,7 @@ class XelisWallet extends LibXelisWallet { // Create a transfer transaction final txJson = await libXelis.createTransfersTransaction( - walletId, + wallet!, transfers: [ WrappedTransfer( floatAmount: amt, @@ -830,7 +831,7 @@ class XelisWallet extends LibXelisWallet { final txHash = txMap['hash'] as String; // Broadcast the transaction - await libXelis.broadcastTransaction(walletId, txHash: txHash); + await libXelis.broadcastTransaction(wallet!, txHash: txHash); return await updateSentCachedTxData( txData: txData.copyWith(txid: txHash), @@ -981,7 +982,7 @@ class XelisWallet extends LibXelisWallet { Future refresh({int? topoheight}) async { await refreshMutex.protect(() async { try { - final bool online = await libXelis.isOnline(walletId); + final bool online = await libXelis.isOnline(wallet!); if (online == true) { await updateChainHeight(topoheight: topoheight); await updateBalance(); diff --git a/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart b/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart index 4cec5e1f4e..6b276c21a7 100644 --- a/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_xelis_wallet.dart @@ -26,8 +26,10 @@ abstract class LibXelisWallet int pruningHeight = 0; + OpaqueXelisWallet? wallet; + void checkInitialized() { - if (!libXelis.walletInstanceExists(walletId)) { + if (wallet == null) { throw StateError('libXelisWallet not initialized'); } } @@ -93,11 +95,11 @@ abstract class LibXelisWallet final node = getCurrentNode(); try { checkInitialized(); - _eventSubscription = libXelis.eventsStream(walletId).listen(handleEvent); + _eventSubscription = libXelis.eventsStream(wallet!).listen(handleEvent); Logging.instance.i("Connecting to node: ${node.host}:${node.port}"); await libXelis.onlineMode( - walletId, + wallet!, daemonAddress: "${node.host}:${node.port}", ); await super.refresh(); @@ -167,7 +169,9 @@ abstract class LibXelisWallet await _eventSubscription?.cancel(); _eventSubscription = null; - await libXelis.offlineMode(walletId); + if (wallet != null) { + await libXelis.offlineMode(wallet!); + } await super.exit(); }); } finally { diff --git a/lib/wl_gen/interfaces/lib_xelis_interface.dart b/lib/wl_gen/interfaces/lib_xelis_interface.dart index 1fc28f8d59..ecf76a435d 100644 --- a/lib/wl_gen/interfaces/lib_xelis_interface.dart +++ b/lib/wl_gen/interfaces/lib_xelis_interface.dart @@ -6,9 +6,9 @@ import '../../wallets/crypto_currency/crypto_currency.dart'; export '../generated/lib_xelis_interface_impl.dart'; abstract class LibXelisInterface { - String get xelisAsset; + const LibXelisInterface(); - bool walletInstanceExists(String walletId); + String get xelisAsset; Future initRustLib(); @@ -22,19 +22,22 @@ abstract class LibXelisInterface { bool validateSeedWord(String word); - Stream eventsStream(String walletId); + Stream eventsStream(OpaqueXelisWallet wallet); - Future onlineMode(String walletId, {required String daemonAddress}); - Future offlineMode(String walletId); + Future onlineMode( + OpaqueXelisWallet wallet, { + required String daemonAddress, + }); + Future offlineMode(OpaqueXelisWallet wallet); Future updateTables({ required String precomputedTablesPath, required bool l1Low, }); - Future getSeed(String walletId); + Future getSeed(OpaqueXelisWallet wallet); - Future createXelisWallet( + Future createXelisWallet( String walletId, { required String name, required String directory, @@ -46,7 +49,7 @@ abstract class LibXelisInterface { bool? l1Low, }); - Future openXelisWallet( + Future openXelisWallet( String walletId, { required String name, required String directory, @@ -56,45 +59,58 @@ abstract class LibXelisInterface { bool? l1Low, }); - String getAddress(String walletId); + String getAddress(OpaqueXelisWallet wallet); - Future getDaemonInfo(String walletId); + Future getDaemonInfo(OpaqueXelisWallet wallet); - Future isOnline(String walletId); + Future isOnline(OpaqueXelisWallet wallet); - Future rescan(String walletId, {required BigInt topoheight}); + Future rescan(OpaqueXelisWallet wallet, {required BigInt topoheight}); - Future> allHistory(String walletId); + Future> allHistory(OpaqueXelisWallet wallet); - Future broadcastTransaction(String walletId, {required String txHash}); + Future broadcastTransaction( + OpaqueXelisWallet wallet, { + required String txHash, + }); Future estimateFees( - String walletId, { + OpaqueXelisWallet wallet, { required List transfers, }); Future createTransfersTransaction( - String walletId, { + OpaqueXelisWallet wallet, { required List transfers, }); Future formatCoin( - String walletId, { + OpaqueXelisWallet wallet, { required BigInt atomicAmount, String? assetHash, }); - Future getAssetDecimals(String walletId, {required String asset}); + Future getAssetDecimals( + OpaqueXelisWallet wallet, { + required String asset, + }); - Future getXelisBalanceRaw(String walletId); + Future getXelisBalanceRaw(OpaqueXelisWallet wallet); - Future hasXelisBalance(String walletId); + Future hasXelisBalance(OpaqueXelisWallet wallet); Future testDaemonConnection(String endPoint, bool useSSL); } // ============================================================================= // ============== stupid ======================================================= + +final class OpaqueXelisWallet { + final Object _value; + const OpaqueXelisWallet(this._value); + T get() => _value as T; +} + class WrappedTransfer { final double floatAmount; final String strAddress; diff --git a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart index 5380ddf256..75941a3908 100644 --- a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart +++ b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart @@ -24,17 +24,18 @@ LibXelisInterface _getInterface() => throw Exception("XEL not enabled!"); //END_OFF //ON -LibXelisInterface _getInterface() => _LibXelisInterfaceImpl(); +LibXelisInterface _getInterface() => const _LibXelisInterfaceImpl(); + +extension _OpaqueXelisWalletExt on OpaqueXelisWallet { + x_wallet.XelisWallet get actual => get(); +} final class _LibXelisInterfaceImpl extends LibXelisInterface { - final Map _wallets = {}; + const _LibXelisInterfaceImpl(); @override String get xelisAsset => xelis_sdk.xelisAsset; - @override - bool walletInstanceExists(String walletId) => _wallets[walletId] != null; - @override Future initRustLib() => xelis_rust.RustLib.init(); @@ -98,19 +99,16 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { bool isAddressValid({required String address}) => x_utils.isAddressValid(strAddress: address); - x_seed.SearchEngine? _xelisSeedSearch; @override bool validateSeedWord(String word) { - _xelisSeedSearch ??= x_seed.SearchEngine.init( + return x_seed.SearchEngine.init( languageIndex: BigInt.from(0), - ); - - return _xelisSeedSearch!.search(query: word).isNotEmpty; + ).search(query: word).isNotEmpty; } @override - Stream eventsStream(String walletId) async* { - final rawEventStream = _wallets[walletId]!.eventsStream(); + Stream eventsStream(OpaqueXelisWallet wallet) async* { + final rawEventStream = wallet.actual.eventsStream(); await for (final rawData in rawEventStream) { final json = jsonDecode(rawData); @@ -166,12 +164,14 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { } @override - Future onlineMode(String walletId, {required String daemonAddress}) => - _wallets[walletId]!.onlineMode(daemonAddress: daemonAddress); + Future onlineMode( + OpaqueXelisWallet wallet, { + required String daemonAddress, + }) => wallet.actual.onlineMode(daemonAddress: daemonAddress); @override - Future offlineMode(String walletId) => - _wallets[walletId]?.offlineMode() ?? Future.value(); + Future offlineMode(OpaqueXelisWallet wallet) => + wallet.actual.offlineMode(); @override Future updateTables({ @@ -183,10 +183,10 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { ); @override - Future getSeed(String walletId) => _wallets[walletId]!.getSeed(); + Future getSeed(OpaqueXelisWallet wallet) => wallet.actual.getSeed(); @override - Future createXelisWallet( + Future createXelisWallet( String walletId, { required String name, required String directory, @@ -197,13 +197,7 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { String? precomputedTablesPath, bool? l1Low, }) async { - if (walletInstanceExists(walletId)) { - throw Exception( - "Attempted overwrite of existing wallet in cache on create", - ); - } - - _wallets[walletId] = await x_wallet.createXelisWallet( + final wallet = await x_wallet.createXelisWallet( name: name, directory: directory, password: password, @@ -213,10 +207,12 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { precomputedTablesPath: precomputedTablesPath, l1Low: l1Low, ); + + return OpaqueXelisWallet(wallet); } @override - Future openXelisWallet( + Future openXelisWallet( String walletId, { required String name, required String directory, @@ -225,13 +221,7 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { String? precomputedTablesPath, bool? l1Low, }) async { - if (walletInstanceExists(walletId)) { - throw Exception( - "Attempted overwrite of existing wallet in cache on open", - ); - } - - _wallets[walletId] = await x_wallet.openXelisWallet( + final wallet = await x_wallet.openXelisWallet( name: name, directory: directory, password: password, @@ -239,46 +229,49 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { precomputedTablesPath: precomputedTablesPath, l1Low: l1Low, ); + + return OpaqueXelisWallet(wallet); } @override - String getAddress(String walletId) => _wallets[walletId]!.getAddressStr(); + String getAddress(OpaqueXelisWallet wallet) => wallet.actual.getAddressStr(); @override - Future getDaemonInfo(String walletId) => - _wallets[walletId]!.getDaemonInfo(); + Future getDaemonInfo(OpaqueXelisWallet wallet) => + wallet.actual.getDaemonInfo(); @override - Future isOnline(String walletId) => _wallets[walletId]!.isOnline(); + Future isOnline(OpaqueXelisWallet wallet) => wallet.actual.isOnline(); @override - Future rescan(String walletId, {required BigInt topoheight}) => - _wallets[walletId]!.rescan(topoheight: topoheight); + Future rescan(OpaqueXelisWallet wallet, {required BigInt topoheight}) => + wallet.actual.rescan(topoheight: topoheight); @override - Future> allHistory(String walletId) async => - (await _wallets[walletId]!.allHistory()).map((e) { - final tx = _checkDecodeJsonStringTxEntry(e); - return TransactionEntryWrapper( - tx, - entryType: _entryTypeConversion(tx.txEntryType), - hash: tx.hash, - timestamp: tx.timestamp, - topoheight: tx.topoheight, - ); - }).toList(); + Future> allHistory( + OpaqueXelisWallet wallet, + ) async => (await wallet.actual.allHistory()).map((e) { + final tx = _checkDecodeJsonStringTxEntry(e); + return TransactionEntryWrapper( + tx, + entryType: _entryTypeConversion(tx.txEntryType), + hash: tx.hash, + timestamp: tx.timestamp, + topoheight: tx.topoheight, + ); + }).toList(); @override Future broadcastTransaction( - String walletId, { + OpaqueXelisWallet wallet, { required String txHash, - }) => _wallets[walletId]!.broadcastTransaction(txHash: txHash); + }) => wallet.actual.broadcastTransaction(txHash: txHash); @override Future createTransfersTransaction( - String walletId, { + OpaqueXelisWallet wallet, { required List transfers, - }) => _wallets[walletId]!.createTransfersTransaction( + }) => wallet.actual.createTransfersTransaction( transfers: transfers .map( (e) => x_wallet.Transfer( @@ -293,9 +286,9 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { @override Future estimateFees( - String walletId, { + OpaqueXelisWallet wallet, { required List transfers, - }) => _wallets[walletId]!.estimateFees( + }) => wallet.actual.estimateFees( transfers: transfers .map( (e) => x_wallet.Transfer( @@ -310,42 +303,52 @@ final class _LibXelisInterfaceImpl extends LibXelisInterface { @override Future formatCoin( - String walletId, { + OpaqueXelisWallet wallet, { required BigInt atomicAmount, String? assetHash, - }) => _wallets[walletId]!.formatCoin( + }) => wallet.actual.formatCoin( atomicAmount: atomicAmount, assetHash: assetHash, ); @override - Future getAssetDecimals(String walletId, {required String asset}) => - _wallets[walletId]!.getAssetDecimals(asset: asset); + Future getAssetDecimals( + OpaqueXelisWallet wallet, { + required String asset, + }) => wallet.actual.getAssetDecimals(asset: asset); @override - Future getXelisBalanceRaw(String walletId) => - _wallets[walletId]!.getXelisBalanceRaw(); + Future getXelisBalanceRaw(OpaqueXelisWallet wallet) => + wallet.actual.getXelisBalanceRaw(); @override - Future hasXelisBalance(String walletId) => - _wallets[walletId]!.hasXelisBalance(); + Future hasXelisBalance(OpaqueXelisWallet wallet) => + wallet.actual.hasXelisBalance(); @override Future testDaemonConnection(String endPoint, bool useSSL) async { - final daemon = xelis_sdk.DaemonClient( - endPoint: endPoint, - secureWebSocket: useSSL, - timeout: 5000, - ); - daemon.connect(); - final xelis_sdk.GetInfoResult networkInfo = await daemon.getInfo(); - daemon.disconnect(); - - Logging.instance.i( - "Xelis testNodeConnection result: \"${networkInfo.toString()}\"", - ); + try { + final daemon = xelis_sdk.DaemonClient( + endPoint: endPoint, + secureWebSocket: useSSL, + timeout: 5000, + ); + daemon.connect(); + final xelis_sdk.GetInfoResult networkInfo = await daemon.getInfo(); + daemon.disconnect(); - return networkInfo.height != null; + Logging.instance.i( + "Xelis testNodeConnection result: \"${networkInfo.toString()}\"", + ); + return true; + } catch (e, s) { + Logging.instance.w( + "xelis daemon connection test failed, returning false.", + error: e, + stackTrace: s, + ); + return false; + } } } From a0cb036adb04976b5f332b77e221945428cb0852 Mon Sep 17 00:00:00 2001 From: Julian Date: Fri, 10 Oct 2025 15:01:42 -0600 Subject: [PATCH 163/178] xmr/wow and salvium package version bump --- scripts/app_config/templates/pubspec.template.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/app_config/templates/pubspec.template.yaml b/scripts/app_config/templates/pubspec.template.yaml index 0374094789..2fa772b6b8 100644 --- a/scripts/app_config/templates/pubspec.template.yaml +++ b/scripts/app_config/templates/pubspec.template.yaml @@ -61,13 +61,13 @@ dependencies: # %%END_ENABLE_TOR%% # %%ENABLE_XMR%% -# cs_monero: 1.0.0-pre.3 -# cs_monero_flutter_libs: 1.0.0-pre.0 +# cs_monero: 1.1.0 +# cs_monero_flutter_libs: 1.1.0 # %%END_ENABLE_XMR%% # %%ENABLE_SAL%% -# cs_salvium: ^1.2.1 -# cs_salvium_flutter_libs: ^1.0.4 +# cs_salvium: ^2.0.0 +# cs_salvium_flutter_libs: ^2.0.0 # %%END_ENABLE_SAL%% # %%ENABLE_MWEBD%% From 90142c1c49586dd569df14dd2db981117c1b463d Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 10 Oct 2025 16:49:02 -0600 Subject: [PATCH 164/178] xmr/wow tweaks --- scripts/app_config/templates/pubspec.template.yaml | 4 ++-- tool/wl_templates/XMR_cs_monero_interface_impl.template.dart | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/app_config/templates/pubspec.template.yaml b/scripts/app_config/templates/pubspec.template.yaml index 2fa772b6b8..5649487960 100644 --- a/scripts/app_config/templates/pubspec.template.yaml +++ b/scripts/app_config/templates/pubspec.template.yaml @@ -61,8 +61,8 @@ dependencies: # %%END_ENABLE_TOR%% # %%ENABLE_XMR%% -# cs_monero: 1.1.0 -# cs_monero_flutter_libs: 1.1.0 +# cs_monero: 1.1.1 +# cs_monero_flutter_libs: 1.1.1 # %%END_ENABLE_XMR%% # %%ENABLE_SAL%% diff --git a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart index adcd9518ef..af0016e6a6 100644 --- a/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart +++ b/tool/wl_templates/XMR_cs_monero_interface_impl.template.dart @@ -10,6 +10,7 @@ import 'package:cs_monero/src/ffi_bindings/wownero_wallet_bindings.dart' //END_ON import '../../models/input.dart'; import '../interfaces/cs_monero_interface.dart'; +import '../interfaces/cs_salvium_interface.dart' show WrappedWallet; CsMoneroInterface get csMonero => _getInterface(); From 5b39925328482048330bf548b35b1079b370e324 Mon Sep 17 00:00:00 2001 From: NyanCatTW1 <17372086+NyanCatTW1@users.noreply.github.com> Date: Mon, 13 Oct 2025 13:59:18 +0800 Subject: [PATCH 165/178] FACT0RN: Update default ElectrumX host --- lib/wallets/crypto_currency/coins/fact0rn.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wallets/crypto_currency/coins/fact0rn.dart b/lib/wallets/crypto_currency/coins/fact0rn.dart index a168c9dec4..20c17fe16f 100644 --- a/lib/wallets/crypto_currency/coins/fact0rn.dart +++ b/lib/wallets/crypto_currency/coins/fact0rn.dart @@ -175,7 +175,7 @@ class Fact0rn extends Bip39HDCurrency with ElectrumXCurrencyInterface { switch (network) { case CryptoCurrencyNetwork.main: return NodeModel( - host: "electrumx.fact0rn.io", + host: "electrumx1.projectfactor.io", port: 50002, name: DefaultNodes.defaultName, id: DefaultNodes.buildId(this), From 85c7091fe96ba1c6e63ce1d33972fb9472071061 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 15 Oct 2025 10:23:55 -0600 Subject: [PATCH 166/178] macos exclude arch --- .../templates/macos/Runner.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj b/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj index 6769f9c249..d6cb54f868 100644 --- a/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj +++ b/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj @@ -562,6 +562,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_ARCHS = x86_64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"", @@ -712,6 +713,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_ARCHS = x86_64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"", @@ -753,6 +755,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + EXCLUDED_ARCHS = x86_64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"", From 6e878e0ae9658a8a5a26ca4ee6f323ae527b1548 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 15 Oct 2025 10:47:56 -0600 Subject: [PATCH 167/178] macos specify only arm64 in podfile --- macos/Podfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/macos/Podfile b/macos/Podfile index b52666a103..3936acf0c5 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -39,5 +39,9 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_macos_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['ARCHS'] = 'arm64' + config.build_settings['VALID_ARCHS'] = 'arm64' + end end end From 9038ac1ccd1a8b56416de3b4f2a16e9800237342 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 15 Oct 2025 11:17:20 -0600 Subject: [PATCH 168/178] fix merge conflict bug --- .../restore_options_view.dart | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) 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 1972ae5d3a..1686eba71b 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 @@ -519,23 +519,22 @@ class _SeedRestoreOptionState extends ConsumerState { if (isCnAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin) - SizedBox(height: Util.isDesktop ? 16 : 8), - RoundedWhiteContainer( - child: Center( - child: Text( - ref.watch(_pIsUsingDate) - ? "Choose the date you made the wallet (approximate is fine)" - : "Enter the initial block height of the wallet", - style: Util.isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of( - context, - ).extension()!.textSubtitle1, - ) - : STextStyles.smallMed12(context).copyWith(fontSize: 10), + RoundedWhiteContainer( + child: Center( + child: Text( + ref.watch(_pIsUsingDate) + ? "Choose the date you made the wallet (approximate is fine)" + : "Enter the initial block height of the wallet", + style: Util.isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of( + context, + ).extension()!.textSubtitle1, + ) + : STextStyles.smallMed12(context).copyWith(fontSize: 10), + ), ), ), - ), if (isCnAnd25 || widget.coin is Epiccash || widget.coin is Mimblewimblecoin) From 14d1a1548a730df0349f03f2f8336aebde334584 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 15 Oct 2025 13:10:50 -0500 Subject: [PATCH 169/178] fix(mwc): fix ios and windows --- crypto_plugins/flutter_libmwc | 2 +- scripts/app_config/templates/windows/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index f06b15071d..8ef552711a 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit f06b15071dd6d9f2bb75d2373b410338762744e4 +Subproject commit 8ef552711a3c6afc631078b7106c1d6c762b5635 diff --git a/scripts/app_config/templates/windows/CMakeLists.txt b/scripts/app_config/templates/windows/CMakeLists.txt index 02532aa15e..edc7b5a5b7 100644 --- a/scripts/app_config/templates/windows/CMakeLists.txt +++ b/scripts/app_config/templates/windows/CMakeLists.txt @@ -89,7 +89,7 @@ if(INCLUDE_EPIC_SO) endif() if(INCLUDE_MWC_SO) - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmwc/scripts/windows/build/libmwc_cash_wallet.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmwc/scripts/windows/build/libmwc_wallet.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() From f808032b01a6d29ffb73f4373d89e5a24d10b516 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 15 Oct 2025 16:12:50 -0500 Subject: [PATCH 170/178] fix(frostdart): add WSL-compatible frostdart build script --- crypto_plugins/frostdart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/frostdart b/crypto_plugins/frostdart index acf903869a..39171c0f24 160000 --- a/crypto_plugins/frostdart +++ b/crypto_plugins/frostdart @@ -1 +1 @@ -Subproject commit acf903869ae9ddc9e3f78501d7eac50a8a626439 +Subproject commit 39171c0f24af01780a14b969051aa1a574961f85 From e41cc6a8096b030e5d753f1912778204710544ed Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 16 Oct 2025 12:57:28 -0500 Subject: [PATCH 171/178] fix(epic): remove unnecessary DLL bundling on Windows --- crypto_plugins/flutter_libepiccash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libepiccash b/crypto_plugins/flutter_libepiccash index ada6254ee8..d29ecaec69 160000 --- a/crypto_plugins/flutter_libepiccash +++ b/crypto_plugins/flutter_libepiccash @@ -1 +1 @@ -Subproject commit ada6254ee8bab4a50e0d45bb6206a970dbac960d +Subproject commit d29ecaec6937a8e5d0b68cdecf47c9d90ed0b2f3 From eda39dd72cde8ad997c23cbcd8479559597e73d2 Mon Sep 17 00:00:00 2001 From: Julian Date: Thu, 16 Oct 2025 13:44:49 -0600 Subject: [PATCH 172/178] update win epic win build script --- crypto_plugins/flutter_libepiccash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libepiccash b/crypto_plugins/flutter_libepiccash index d29ecaec69..5a705486d0 160000 --- a/crypto_plugins/flutter_libepiccash +++ b/crypto_plugins/flutter_libepiccash @@ -1 +1 @@ -Subproject commit d29ecaec6937a8e5d0b68cdecf47c9d90ed0b2f3 +Subproject commit 5a705486d07f13ef0c5a044e7b9588dea4c989ff From 899a8ce1c7960f9db0888e08fe6a5f7c3686c0a6 Mon Sep 17 00:00:00 2001 From: Julian Date: Thu, 16 Oct 2025 13:55:49 -0600 Subject: [PATCH 173/178] update win mwc win build script --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 8ef552711a..4f9510eaa1 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 8ef552711a3c6afc631078b7106c1d6c762b5635 +Subproject commit 4f9510eaa10496b4f58f385a0601643c02adddcc From b8861234e2517c8616f82837c40ef52b91f1ca8a Mon Sep 17 00:00:00 2001 From: Julian Date: Fri, 17 Oct 2025 10:03:26 -0600 Subject: [PATCH 174/178] update mwc with windows changes --- crypto_plugins/flutter_libmwc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmwc b/crypto_plugins/flutter_libmwc index 4f9510eaa1..9df2771253 160000 --- a/crypto_plugins/flutter_libmwc +++ b/crypto_plugins/flutter_libmwc @@ -1 +1 @@ -Subproject commit 4f9510eaa10496b4f58f385a0601643c02adddcc +Subproject commit 9df27712534c7cccedb19376cb0768b6f538cacb From f996eb060fe64a47154f5e80782ff6d973dd5109 Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 18 Oct 2025 13:00:38 -0600 Subject: [PATCH 175/178] copy list to ensure underlying is not modified --- lib/pages/wallets_view/wallets_overview.dart | 217 +++++++++---------- 1 file changed, 106 insertions(+), 111 deletions(-) diff --git a/lib/pages/wallets_view/wallets_overview.dart b/lib/pages/wallets_view/wallets_overview.dart index bd1dfe5be9..d0cc2d12da 100644 --- a/lib/pages/wallets_view/wallets_overview.dart +++ b/lib/pages/wallets_view/wallets_overview.dart @@ -73,14 +73,13 @@ class _EthWalletsOverviewState extends ConsumerState { List _filter(String searchTerm) { // clean out deleted wallets - final existingWalletIds = - ref - .read(mainDBProvider) - .isar - .walletInfo - .where() - .walletIdProperty() - .findAllSync(); + final existingWalletIds = ref + .read(mainDBProvider) + .isar + .walletInfo + .where() + .walletIdProperty() + .findAllSync(); wallets.removeWhere((k, v) => !existingWalletIds.contains(k)); if (searchTerm.isEmpty) { @@ -128,7 +127,7 @@ class _EthWalletsOverviewState extends ConsumerState { } void updateWallets() { - final walletsData = ref.read(pAllWalletsInfo); + final walletsData = ref.read(pAllWalletsInfo).toList(); walletsData.removeWhere((e) => e.coin != widget.coin); @@ -205,45 +204,44 @@ class _EthWalletsOverviewState extends ConsumerState { Widget build(BuildContext context) { return ConditionalParent( condition: !isDesktop && !AppConfig.isSingleCoinApp, - builder: - (child) => Background( - child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, - appBar: AppBar( - leading: const AppBarBackButton(), - title: Text( - "${widget.coin.prettyName} (${widget.coin.ticker}) wallets", - style: STextStyles.navBarTitle(context), - ), - actions: [ - AspectRatio( - aspectRatio: 1, - child: AppBarIconButton( - icon: SvgPicture.asset( - Assets.svg.plus, - width: 18, - height: 18, - color: - Theme.of( - context, - ).extension()!.topNavIconPrimary, - ), - onPressed: () { - Navigator.of(context).pushNamed( - CreateOrRestoreWalletView.routeName, - arguments: CoinEntity(widget.coin), - ); - }, - ), + builder: (child) => Background( + child: Scaffold( + backgroundColor: Theme.of( + context, + ).extension()!.background, + appBar: AppBar( + leading: const AppBarBackButton(), + title: Text( + "${widget.coin.prettyName} (${widget.coin.ticker}) wallets", + style: STextStyles.navBarTitle(context), + ), + actions: [ + AspectRatio( + aspectRatio: 1, + child: AppBarIconButton( + icon: SvgPicture.asset( + Assets.svg.plus, + width: 18, + height: 18, + color: Theme.of( + context, + ).extension()!.topNavIconPrimary, ), - ], - ), - body: SafeArea( - child: Padding(padding: const EdgeInsets.all(16), child: child), + onPressed: () { + Navigator.of(context).pushNamed( + CreateOrRestoreWalletView.routeName, + arguments: CoinEntity(widget.coin), + ); + }, + ), ), - ), + ], + ), + body: SafeArea( + child: Padding(padding: const EdgeInsets.all(16), child: child), ), + ), + ), child: Column( children: [ ClipRRect( @@ -260,55 +258,53 @@ class _EthWalletsOverviewState extends ConsumerState { _searchString = value; }); }, - style: - isDesktop - ? STextStyles.desktopTextExtraSmall(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFieldActiveText, - height: 1.8, - ) - : STextStyles.field(context), - decoration: standardInputDecoration( - "Search...", - searchFieldFocusNode, - context, - desktopMed: isDesktop, - ).copyWith( - prefixIcon: Padding( - padding: EdgeInsets.symmetric( - horizontal: isDesktop ? 12 : 10, - vertical: isDesktop ? 18 : 16, - ), - child: SvgPicture.asset( - Assets.svg.search, - width: isDesktop ? 20 : 16, - height: isDesktop ? 20 : 16, - ), - ), - suffixIcon: - _searchController.text.isNotEmpty + style: isDesktop + ? STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of( + context, + ).extension()!.textFieldActiveText, + height: 1.8, + ) + : STextStyles.field(context), + decoration: + standardInputDecoration( + "Search...", + searchFieldFocusNode, + context, + desktopMed: isDesktop, + ).copyWith( + prefixIcon: Padding( + padding: EdgeInsets.symmetric( + horizontal: isDesktop ? 12 : 10, + vertical: isDesktop ? 18 : 16, + ), + child: SvgPicture.asset( + Assets.svg.search, + width: isDesktop ? 20 : 16, + height: isDesktop ? 20 : 16, + ), + ), + suffixIcon: _searchController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - _searchController.text = ""; - _searchString = ""; - }); - }, - ), - ], + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + _searchController.text = ""; + _searchString = ""; + }); + }, + ), + ], + ), ), - ), - ) + ) : null, - ), + ), ), ), const SizedBox(height: 16), @@ -340,34 +336,33 @@ class _EthWalletsOverviewState extends ConsumerState { return ConditionalParent( key: Key(wallet.walletId), condition: isDesktop, - builder: - (child) => RoundedWhiteContainer( - padding: const EdgeInsets.symmetric( - vertical: 14, - horizontal: 20, - ), - borderColor: - Theme.of( - context, - ).extension()!.backgroundAppBar, - child: child, - ), + builder: (child) => RoundedWhiteContainer( + padding: const EdgeInsets.symmetric( + vertical: 14, + horizontal: 20, + ), + borderColor: Theme.of( + context, + ).extension()!.backgroundAppBar, + child: child, + ), child: SimpleWalletCard( walletId: wallet.walletId, popPrevious: widget.overrideSimpleWalletCardPopPreviousValueWith == - null - ? isDesktop - : widget - .overrideSimpleWalletCardPopPreviousValueWith!, - desktopNavigatorState: - isDesktop ? widget.navigatorState : null, + null + ? isDesktop + : widget + .overrideSimpleWalletCardPopPreviousValueWith!, + desktopNavigatorState: isDesktop + ? widget.navigatorState + : null, ), ); } }, - separatorBuilder: - (_, __) => SizedBox(height: isDesktop ? 10 : 8), + separatorBuilder: (_, __) => + SizedBox(height: isDesktop ? 10 : 8), itemCount: data.length, ); }, From 772ec1e95b3d9ed1d6cce0ff8aad950c75ceefd3 Mon Sep 17 00:00:00 2001 From: julian Date: Sun, 19 Oct 2025 08:54:02 -0600 Subject: [PATCH 176/178] clean up unseen address error --- lib/wallets/wallet/impl/cardano_wallet.dart | 57 ++++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/lib/wallets/wallet/impl/cardano_wallet.dart b/lib/wallets/wallet/impl/cardano_wallet.dart index 1583123a2b..46544139e3 100644 --- a/lib/wallets/wallet/impl/cardano_wallet.dart +++ b/lib/wallets/wallet/impl/cardano_wallet.dart @@ -8,6 +8,7 @@ import 'package:blockchain_utils/bip/cardano/mnemonic/cardano_icarus_seed_genera import 'package:blockchain_utils/bip/cardano/shelley/cardano_shelley.dart'; import 'package:isar_community/isar.dart'; import 'package:on_chain/ada/ada.dart'; +import 'package:on_chain/ada/src/provider/exception/blockfrost_api_error.dart'; import 'package:socks5_proxy/socks.dart'; import 'package:tuple/tuple.dart'; @@ -418,19 +419,45 @@ class CardanoWallet extends Bip39Wallet { }); } + Future _checkAddressIsFound() async { + try { + await blockfrostProvider!.request( + BlockfrostRequestSpecificAddress( + ADAAddress.fromAddress((await getCurrentReceivingAddress())!.value), + ), + ); + return true; + } on BlockfrostError catch (e, s) { + if (e.statusCode == 404 && e.error == "Not found") { + Logging.instance.i( + "Ada address not seen on network yet", + error: e, + stackTrace: s, + ); + return false; + } else { + rethrow; + } + } + } + @override Future updateBalance() async { try { await updateProvider(); - final addressUtxos = await blockfrostProvider!.request( - BlockfrostRequestAddressUTXOsOfAGivenAsset( - address: ADAAddress.fromAddress( - (await getCurrentReceivingAddress())!.value, - ), - asset: "lovelace", - ), - ); + final addressExists = await _checkAddressIsFound(); + + final addressUtxos = addressExists + ? await blockfrostProvider!.request( + BlockfrostRequestAddressUTXOsOfAGivenAsset( + address: ADAAddress.fromAddress( + (await getCurrentReceivingAddress())!.value, + ), + asset: "lovelace", + ), + ) + : []; BigInt totalBalanceInLovelace = BigInt.parse("0"); for (final utxo in addressUtxos) { @@ -498,13 +525,17 @@ class CardanoWallet extends Bip39Wallet { try { await updateProvider(); + final addressExists = await _checkAddressIsFound(); + final currentAddr = (await getCurrentReceivingAddress())!.value; - final txsList = await blockfrostProvider!.request( - BlockfrostRequestAddressTransactions( - ADAAddress.fromAddress(currentAddr), - ), - ); + final txsList = addressExists + ? await blockfrostProvider!.request( + BlockfrostRequestAddressTransactions( + ADAAddress.fromAddress(currentAddr), + ), + ) + : []; final parsedTxsList = List>.empty( growable: true, From cbb3fc3d1c8dba589c07b45cdbfa0a144cc22f8a Mon Sep 17 00:00:00 2001 From: julian Date: Sun, 19 Oct 2025 09:00:11 -0600 Subject: [PATCH 177/178] optimize some db calls to prevent creating a write transaction if no data will be written --- lib/db/isar/main_db.dart | 96 ++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/lib/db/isar/main_db.dart b/lib/db/isar/main_db.dart index d951a1a6b1..94f27e1f8b 100644 --- a/lib/db/isar/main_db.dart +++ b/lib/db/isar/main_db.dart @@ -92,11 +92,10 @@ class MainDB { Future updateWalletInfo(WalletInfo walletInfo) async { try { await isar.writeTxn(() async { - final info = - await isar.walletInfo - .where() - .walletIdEqualTo(walletInfo.walletId) - .findFirst(); + final info = await isar.walletInfo + .where() + .walletIdEqualTo(walletInfo.walletId) + .findFirst(); if (info == null) { throw Exception( "updateWalletInfo() called with new WalletInfo." @@ -189,6 +188,7 @@ class MainDB { } Future> putAddresses(List
addresses) async { + if (addresses.isEmpty) return []; try { return await isar.writeTxn(() async { return await isar.addresses.putAll(addresses); @@ -199,6 +199,7 @@ class MainDB { } Future> updateOrPutAddresses(List
addresses) async { + if (addresses.isEmpty) return []; try { final List ids = []; await isar.writeTxn(() async { @@ -269,6 +270,7 @@ class MainDB { } Future> putTransactions(List transactions) async { + if (transactions.isEmpty) return []; try { return await isar.writeTxn(() async { return await isar.transactions.putAll(transactions); @@ -306,9 +308,11 @@ class MainDB { await isar.utxos.put(utxo); }); - Future putUTXOs(List utxos) => isar.writeTxn(() async { - await isar.utxos.putAll(utxos); - }); + Future putUTXOs(List utxos) => utxos.isEmpty + ? Future.value() + : isar.writeTxn(() async { + await isar.utxos.putAll(utxos); + }); Future updateUTXOs(String walletId, List utxos) async { bool newUTXO = false; @@ -317,11 +321,10 @@ class MainDB { final set = utxos.toSet(); for (final utxo in utxos) { // check if utxo exists in db and update accordingly - final storedUtxo = - await isar.utxos - .where() - .txidWalletIdVoutEqualTo(utxo.txid, utxo.walletId, utxo.vout) - .findFirst(); + final storedUtxo = await isar.utxos + .where() + .txidWalletIdVoutEqualTo(utxo.txid, utxo.walletId, utxo.vout) + .findFirst(); if (storedUtxo != null) { // update @@ -441,8 +444,10 @@ class MainDB { // Future deleteWalletBlockchainData(String walletId) async { final transactionCount = await getTransactions(walletId).count(); - final transactionCountV2 = - await isar.transactionV2s.where().walletIdEqualTo(walletId).count(); + final transactionCountV2 = await isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .count(); final addressCount = await getAddresses(walletId).count(); final utxoCount = await getUTXOs(walletId).count(); // final lelantusCoinCount = @@ -453,41 +458,37 @@ class MainDB { // transactions for (int i = 0; i < transactionCount; i += paginateLimit) { - final txnIds = - await getTransactions( - walletId, - ).offset(i).limit(paginateLimit).idProperty().findAll(); + final txnIds = await getTransactions( + walletId, + ).offset(i).limit(paginateLimit).idProperty().findAll(); await isar.transactions.deleteAll(txnIds); } // transactions V2 for (int i = 0; i < transactionCountV2; i += paginateLimit) { - final txnIds = - await isar.transactionV2s - .where() - .walletIdEqualTo(walletId) - .offset(i) - .limit(paginateLimit) - .idProperty() - .findAll(); + final txnIds = await isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .offset(i) + .limit(paginateLimit) + .idProperty() + .findAll(); await isar.transactionV2s.deleteAll(txnIds); } // addresses for (int i = 0; i < addressCount; i += paginateLimit) { - final addressIds = - await getAddresses( - walletId, - ).offset(i).limit(paginateLimit).idProperty().findAll(); + final addressIds = await getAddresses( + walletId, + ).offset(i).limit(paginateLimit).idProperty().findAll(); await isar.addresses.deleteAll(addressIds); } // utxos for (int i = 0; i < utxoCount; i += paginateLimit) { - final utxoIds = - await getUTXOs( - walletId, - ).offset(i).limit(paginateLimit).idProperty().findAll(); + final utxoIds = await getUTXOs( + walletId, + ).offset(i).limit(paginateLimit).idProperty().findAll(); await isar.utxos.deleteAll(utxoIds); } @@ -504,10 +505,9 @@ class MainDB { await isar.writeTxn(() async { const paginateLimit = 50; for (int i = 0; i < addressLabelCount; i += paginateLimit) { - final labelIds = - await getAddressLabels( - walletId, - ).offset(i).limit(paginateLimit).idProperty().findAll(); + final labelIds = await getAddressLabels( + walletId, + ).offset(i).limit(paginateLimit).idProperty().findAll(); await isar.addressLabels.deleteAll(labelIds); } }); @@ -518,10 +518,9 @@ class MainDB { await isar.writeTxn(() async { const paginateLimit = 50; for (int i = 0; i < noteCount; i += paginateLimit) { - final labelIds = - await getTransactionNotes( - walletId, - ).offset(i).limit(paginateLimit).idProperty().findAll(); + final labelIds = await getTransactionNotes( + walletId, + ).offset(i).limit(paginateLimit).idProperty().findAll(); await isar.transactionNotes.deleteAll(labelIds); } }); @@ -531,6 +530,7 @@ class MainDB { List> transactionsData, String walletId, ) async { + if (transactionsData.isEmpty) return; try { await isar.writeTxn(() async { for (final data in transactionsData) { @@ -570,15 +570,15 @@ class MainDB { Future> updateOrPutTransactionV2s( List transactions, ) async { + if (transactions.isEmpty) return []; try { final List ids = []; await isar.writeTxn(() async { for (final tx in transactions) { - final storedTx = - await isar.transactionV2s - .where() - .txidWalletIdEqualTo(tx.txid, tx.walletId) - .findFirst(); + final storedTx = await isar.transactionV2s + .where() + .txidWalletIdEqualTo(tx.txid, tx.walletId) + .findFirst(); Id id; if (storedTx == null) { From 5e385cdb73c96e81be16a219c000dfe074894f1d Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 20 Oct 2025 10:53:38 -0600 Subject: [PATCH 178/178] xelis send all fee subtraction --- lib/wallets/wallet/impl/xelis_wallet.dart | 65 ++++++++++++------ pubspec.lock | 84 +++++++++++------------ 2 files changed, 85 insertions(+), 64 deletions(-) diff --git a/lib/wallets/wallet/impl/xelis_wallet.dart b/lib/wallets/wallet/impl/xelis_wallet.dart index 9a4fd10c76..9423b06973 100644 --- a/lib/wallets/wallet/impl/xelis_wallet.dart +++ b/lib/wallets/wallet/impl/xelis_wallet.dart @@ -631,16 +631,23 @@ class XelisWallet extends LibXelisWallet { 'Address cannot be empty.', ); // in the future, support for multiple recipients will work. + // but for now, no + // Validate recipients + if (recipients.length != 1) { + throw Exception("$runtimeType confirmSend requires 1 recipient"); + } + final asset = assetId ?? libXelis.xelisAsset; // Calculate total send amount - final totalSendAmount = recipients.fold( - Amount( - rawValue: BigInt.zero, - fractionDigits: cryptoCurrency.fractionDigits, - ), - (sum, recipient) => sum + recipient.amount, - ); + final totalSendAmount = recipients.first.amount; + // final totalSendAmount = recipients.fold( + // Amount( + // rawValue: BigInt.zero, + // fractionDigits: cryptoCurrency.fractionDigits, + // ), + // (sum, recipient) => sum + recipient.amount, + // ); // Check balance using raw method final xelBalance = await libXelis.getXelisBalanceRaw(wallet!); @@ -658,24 +665,38 @@ class XelisWallet extends LibXelisWallet { assetId: asset, ); - // Check if we have enough for both transfers and fee - if (totalSendAmount + boostedFee > balance) { - final requiredAmt = await libXelis.formatCoin( - wallet!, - atomicAmount: (totalSendAmount + boostedFee).raw, - assetHash: asset, + final isSendAll = xelBalance == totalSendAmount.raw; + if (isSendAll) { + txData = txData.copyWith( + recipients: [ + TxRecipient( + address: recipients.first.address, + amount: recipients.first.amount - boostedFee, + isChange: recipients.first.isChange, + addressType: recipients.first.addressType, + ), + ], ); + } else { + // Check if we have enough for both transfers and fee + if (totalSendAmount + boostedFee > balance) { + final requiredAmt = await libXelis.formatCoin( + wallet!, + atomicAmount: (totalSendAmount + boostedFee).raw, + assetHash: asset, + ); - final availableAmt = await libXelis.formatCoin( - wallet!, - atomicAmount: xelBalance, - assetHash: asset, - ); + final availableAmt = await libXelis.formatCoin( + wallet!, + atomicAmount: xelBalance, + assetHash: asset, + ); - throw Exception( - "Insufficient balance to cover transfers and fees. " - "Required: $requiredAmt, Available: $availableAmt", - ); + throw Exception( + "Insufficient balance to cover transfers and fees. " + "Required: $requiredAmt, Available: $availableAmt", + ); + } } return txData.copyWith( diff --git a/pubspec.lock b/pubspec.lock index 6318fed7b0..fd2dde3709 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -439,162 +439,162 @@ packages: dependency: "direct main" description: name: cs_monero - sha256: f48495ed6744a47598b36eaf28adc1e9e55f0d4ea3c18fe42eda0d3d8f714206 + sha256: "7cfbcd25135a0710ad096678160d7668abed8979838165f06975adbe6bbec215" url: "https://pub.dev" source: hosted - version: "1.0.0-pre.3" + version: "1.1.1" cs_monero_flutter_libs: dependency: "direct main" description: name: cs_monero_flutter_libs - sha256: ccfd2c80e3f283f447602ecc548c9922b526002928a0fa1d34f1d6d74f73952e + sha256: "47d716adc7b668653e359df785702d1213245f2fab6efa930a70b87e4cba23ae" url: "https://pub.dev" source: hosted - version: "1.0.0-pre.0" + version: "1.1.1" cs_monero_flutter_libs_android: dependency: transitive description: name: cs_monero_flutter_libs_android - sha256: "8a03a93b84a091a6c09be2a3504002885af5e3e8e316b2776544271e9509d352" + sha256: "4b9d1117e63352d27bd0cb7115fc20d6212bd02a7e6ec3cd8ab2b37fddfb21eb" url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.1.0" cs_monero_flutter_libs_android_arm64_v8a: dependency: transitive description: name: cs_monero_flutter_libs_android_arm64_v8a - sha256: a412c30e8f72aefc2671f2ed76b50fdb70fc9eaa697f8c7050e0ede941f5863e + sha256: cbb8704dcc1d02581a820b99188c97acaa140eaefedee9ce7d17910e24e5530f url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.1.0" cs_monero_flutter_libs_android_armeabi_v7a: dependency: transitive description: name: cs_monero_flutter_libs_android_armeabi_v7a - sha256: "2177af9a62ca9c2997f88af09d54c784dc1ee49a3540abe73c0271d25eb8dadb" + sha256: dc276544b169553a8a63855beaa6c2cf8180af68fb335ab1b629f2fa9370e123 url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.1.0" cs_monero_flutter_libs_android_x86_64: dependency: transitive description: name: cs_monero_flutter_libs_android_x86_64 - sha256: ac5e03624c86438bbe47c986dab5bfe1fb3060a0b4bdb5dd8eea09795a5fc2c8 + sha256: fb02563c07d3fb4804925ec66446e26389ca2d92659493b72a6cf106765fa321 url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.1.0" cs_monero_flutter_libs_ios: dependency: transitive description: name: cs_monero_flutter_libs_ios - sha256: ec2e5b9b3ae3100f390deeff6114ffe3259a0701fafdc0f1028996e0da78b17b + sha256: "6fbe1590b0633f42c906dfada1db8e3ce4f8899eae8728a4bb9b696dc7fb5155" url: "https://pub.dev" source: hosted - version: "1.0.0-pre.0" + version: "1.1.1" cs_monero_flutter_libs_linux: dependency: transitive description: name: cs_monero_flutter_libs_linux - sha256: "65651535e028211d4c535dac53fdfec940935f1037f0a01bfdf4f6cf8b904362" + sha256: "394a58f4efefd3857f1f3da03f21e33f1c2ca5141936db7a843e77286ffaa89e" url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.1.0" cs_monero_flutter_libs_macos: dependency: transitive description: name: cs_monero_flutter_libs_macos - sha256: "609586b4e4524452698b4877ff886ad9aafd721373cddebba45d9d8a63a8cfc9" + sha256: e00616ab86a0ea18b3360dbae8d862b83fa450b1a83355647e34e8c64696a6c7 url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.1.0" cs_monero_flutter_libs_platform_interface: dependency: transitive description: name: cs_monero_flutter_libs_platform_interface - sha256: "9df4ced42f5746c85c008f504f70b39efd05aa409bb82eaf4b2058d8454e0bb7" + sha256: "7c832ed033257b82e2c30f1fc764f68fa4e4a780d4836a4f94384aaf9cd44ee7" url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.0.0" cs_monero_flutter_libs_windows: dependency: transitive description: name: cs_monero_flutter_libs_windows - sha256: "4294f62e40ba2f155c52fccfdbb12029ed5c856ea8a546aebb3ebc94bc856e43" + sha256: de265ed544a4edb9e778e88b56ccee098a1ad38cd4c4536a985f05d3dde95a23 url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.1.0" cs_salvium: dependency: "direct main" description: name: cs_salvium - sha256: "838a2f21b0ad567f68a5294360c4c96727b722037ae7bfdc26651c99d6c26bd3" + sha256: e040a407bb485b177130a86dd6cd817b8cea933bbfae149a73c57a681deaa4a5 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "2.0.0" cs_salvium_flutter_libs: dependency: "direct main" description: name: cs_salvium_flutter_libs - sha256: d1e49ed67632f77d863ad3eafc78db8867f155cf9decf156345ec75c92e0d026 + sha256: "2aea1bbb6e6b69ac0a8e4dace2efc50507a10651ad9bec862f6a5ccd06a76578" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.0" cs_salvium_flutter_libs_android: dependency: transitive description: name: cs_salvium_flutter_libs_android - sha256: "63603fc4c94d609e13c8e8064c742ac628ef006d3af9990e2c585489bde9b96d" + sha256: ad9537942f7c1416fbb3432cb154d641262bd18c56471c4f62dd1d2e7e23f125 url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.0.0" cs_salvium_flutter_libs_android_arm64_v8a: dependency: transitive description: name: cs_salvium_flutter_libs_android_arm64_v8a - sha256: "5ced9fe6d71dd22f90865600b8dff1ed07ce480db6c9de1a8d56e63318000e97" + sha256: "4c307cd3276c7aa2a461ebcfc726adf9b4d9427dbdbad120dbe50f54d3690b4e" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.0.0" cs_salvium_flutter_libs_android_armeabi_v7a: dependency: transitive description: name: cs_salvium_flutter_libs_android_armeabi_v7a - sha256: "2fb718dff22918e72b138c191dbd887d8d241f03a34add11e8d699c48b657b47" + sha256: "9491e0cdd4452c9c907e137acd2d08f76d33efc7a9d4b86fbfab69224bc9f473" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.0.0" cs_salvium_flutter_libs_android_x86_64: dependency: transitive description: name: cs_salvium_flutter_libs_android_x86_64 - sha256: "85134ab635a4dddec5735fdd8f3971a1c33e3aaa1c8aa88e54f0b3d5e0d0caab" + sha256: "0b87ccd86bd9b0eeb659dade948d076cddf908d535fe803b769030da8ff406dc" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.0.0" cs_salvium_flutter_libs_ios: dependency: transitive description: name: cs_salvium_flutter_libs_ios - sha256: "54d18fbac60c8a602e4d0f967ea7d02fab71bff3e032f9576e159229ce372534" + sha256: "4dc2447255f1c8997b6d26e72577e30ceab7f4622620549dc9de9eb8dccac35c" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "2.0.0" cs_salvium_flutter_libs_linux: dependency: transitive description: name: cs_salvium_flutter_libs_linux - sha256: "0cb2f545ea4aa45c819a0656540d022a9c73a43681e50f1d2a5e72eaf1bc500e" + sha256: "8adc16e9d0fb8dc439475ddb2eaa4fcde8433fa2cb6e14ce814b1a40965eda5c" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "2.0.0" cs_salvium_flutter_libs_macos: dependency: transitive description: name: cs_salvium_flutter_libs_macos - sha256: "9df0818299a5ddadd41eb4c94de2cd8e519d1e9f4aa6166657397200397f402f" + sha256: "428e4eead3d507112cb6f0b70f69bc43430b3db60f0b4d731e0d6a6fab0b69bb" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.0.0" cs_salvium_flutter_libs_platform_interface: dependency: transitive description: @@ -607,10 +607,10 @@ packages: dependency: transitive description: name: cs_salvium_flutter_libs_windows - sha256: "824966223a32bfe4d99c634d3b8d81917806d06ad878007552597e2070c25a02" + sha256: "934a1eeb95619df9e23eff13a6a6a356322297abfa6ab871283cdf665cc32c7f" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "2.0.0" csslib: dependency: transitive description: