mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
* decred: Add decred. (#1322) * multi: Add initial decred screens. (#1165) Use a mock libwallet for now. * cw_decred: add libdcrwallet dependency and link library for android, ios and macos (#1240) * change cw_decred from package to plugin * add libdcrwallet dependency and link library for android, ios and macos * remove spvwallet, make some libdcrwallet fns async, light refactor * libdcrwallet: use json payload returns * use specific libwallet commit hash * decred: fix Rename wallet. --------- Co-authored-by: JoeGruff <joegruffins@gmail.com> * decred: Add sync. * decred: Add send transaction. * decred: Fix fee estimation. * decred: List transactions. * decred: Add rescan. * decred: Sign message. * decred: Add new addr and addrs. * decred: Add change wallet pass. * decred: Add restore from seed. * decred: Add watching only wallets. * decred: Enable mainnet. * decred: Allow using blank node address. This allows a persistent peer to be unset, falling back to decred seeders. * decred: Rescan from wallet birthday. * add and update macos build scripts, update build readme, gitignore macos project.pbxproj Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com> * multi: hide decred rescan page if it's not ready - move hasRescan method to WalletBase and implement for decred Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com> * cw_decred: fix bug where decred wallets are not loaded after app restart Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com> * add buy and sell for decred via onramp Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com> * bug-fix: account for other send outputs that are part of the same tx Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com> * decred: Return address with no peers. * decred: Update pubspec. * decred: Add verify message. * upgrade hive_generator dep in cw_decred * decred: Clean up code. --------- Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com> Co-authored-by: Wisdom Arerosuoghene <wisdom.arerosuoghene@gmail.com> Co-authored-by: Philemon Ukane <ukanephilemon@gmail.com> * fix extracted addresses not used fix conflicts with main * remove print [skip ci] * minor formatting * fix initial migration version * add build decred script to workflow * install go before build decred fix switch cases * trial 2 to fix decred build * re-install go * revert build script change * refactor/clean nodes functions * Fix address book issue Fix send ALL (to be continued with the fees point) * Fix transactions display issues Add missing file * Fix unconfirmed balance not displayed Change Wallet order Minor cleanup * Fix workflow * Fix workflow * Fix workflow * test * hardcode path for now * fix + cleanup decred build script to work on mac and linux * Update decred build script * Run actions on pull requests, extract commit message * run after checkout * add safe directory * Get commit message from base.sha instead of last commit * base -> head * Do not merge main branch into pr * [skip slack] [run tests] clone by sha * Proper name for decred library in the build script * Throw an error when ANDROID_HOME or ANDROID_NDK_VERSION is missing * Fix conflicts with main * minor code enhancement * decred: Add used address history. (#1941) * decred: Update pubspec. * decred testnet * decred: Add used address history. * decred: Remove default node list. * populate transaction history before sync begins * decred: Add some awaits. * decred: Fix send all. * decred: Add clang export to build script. * decred: Update logo colors. * cleanup cw_decred.dart * make decred wallet addresses selectable in receive page * decred: Always set default addr when used. * decred: Add back default node list. * decred: Allow creating addresses manually. --------- Co-authored-by: Wisdom Arerosuoghene <wisdom.arerosuoghene@gmail.com> Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * minor fixes and cleanup * minor fix, feel free to test now * - Fix transaction details - Fix Nodes - Add processing sync status * Add decred info card * push missing file * Add missing text for decred info card * minor: change docs link [skip ci] * decred: Update derivation info. (#2013) * decred: Update derivation info. * decred: Allow unsynced unused addresses. * decred: Update dcrwallet dep to 4.3.0. * Merge main and fix conflicts * Merge main and fix conflicts * decred: Fix background sync panic. (#2080) * decred: Run libwallet in isolate. (#2077) * decred: Fix contact save inquiry. (#2083) Also fix tx time and the fee shown on pending transactions. * Disable send button in view only decred wallets * - Fix frozen coins - Add URI support - Fix fees in tx details - Handle empty coins send - Handle wallets in address book * Merge main * remove print [skip ci] * Fix restore from QR * minor improvement for QR restore * minor fixes [skip ci] * decred: Get slip44 addrs before sync completes. (#2092) * - Fix loading wallet more than one time - Fix minor UI issue --------- Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com> Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com> Co-authored-by: Wisdom Arerosuoghene <wisdom.arerosuoghene@gmail.com> Co-authored-by: Philemon Ukane <ukanephilemon@gmail.com> Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
177 lines
5.3 KiB
Dart
177 lines
5.3 KiB
Dart
import 'package:cake_wallet/entities/auto_generate_subaddress_status.dart';
|
|
import 'package:cake_wallet/entities/exchange_api_mode.dart';
|
|
import 'package:cake_wallet/ethereum/ethereum.dart';
|
|
import 'package:cake_wallet/polygon/polygon.dart';
|
|
import 'package:cake_wallet/store/settings_store.dart';
|
|
import 'package:cake_wallet/tron/tron.dart';
|
|
import 'package:cw_core/balance.dart';
|
|
import 'package:cw_core/transaction_history.dart';
|
|
import 'package:cw_core/transaction_info.dart';
|
|
import 'package:cw_core/wallet_base.dart';
|
|
import 'package:cw_core/wallet_type.dart';
|
|
import 'package:mobx/mobx.dart';
|
|
import 'package:cake_wallet/entities/fiat_api_mode.dart';
|
|
|
|
part 'privacy_settings_view_model.g.dart';
|
|
|
|
class PrivacySettingsViewModel = PrivacySettingsViewModelBase with _$PrivacySettingsViewModel;
|
|
|
|
abstract class PrivacySettingsViewModelBase with Store {
|
|
PrivacySettingsViewModelBase(this._settingsStore, this._wallet);
|
|
|
|
final SettingsStore _settingsStore;
|
|
final WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo> _wallet;
|
|
|
|
@computed
|
|
ExchangeApiMode get exchangeStatus => _settingsStore.exchangeStatus;
|
|
|
|
@computed
|
|
bool get isAutoGenerateSubaddressesEnabled =>
|
|
_settingsStore.autoGenerateSubaddressStatus != AutoGenerateSubaddressStatus.disabled;
|
|
|
|
@action
|
|
void setAutoGenerateSubaddresses(bool value) {
|
|
_wallet.isEnabledAutoGenerateSubaddress = value;
|
|
if (value) {
|
|
_settingsStore.autoGenerateSubaddressStatus = AutoGenerateSubaddressStatus.enabled;
|
|
} else {
|
|
_settingsStore.autoGenerateSubaddressStatus = AutoGenerateSubaddressStatus.disabled;
|
|
}
|
|
}
|
|
|
|
bool get isAutoGenerateSubaddressesVisible =>
|
|
_wallet.type == WalletType.monero ||
|
|
_wallet.type == WalletType.wownero ||
|
|
_wallet.type == WalletType.bitcoin ||
|
|
_wallet.type == WalletType.litecoin ||
|
|
_wallet.type == WalletType.bitcoinCash ||
|
|
_wallet.type == WalletType.decred;
|
|
|
|
bool get isMoneroWallet => _wallet.type == WalletType.monero;
|
|
|
|
@computed
|
|
bool get shouldSaveRecipientAddress => _settingsStore.shouldSaveRecipientAddress;
|
|
|
|
@computed
|
|
FiatApiMode get fiatApiMode => _settingsStore.fiatApiMode;
|
|
|
|
@computed
|
|
bool get isAppSecure => _settingsStore.isAppSecure;
|
|
|
|
@computed
|
|
bool get disableTradeOption => _settingsStore.disableTradeOption;
|
|
|
|
@computed
|
|
bool get disableBulletin => _settingsStore.disableBulletin;
|
|
|
|
@computed
|
|
bool get useEtherscan => _settingsStore.useEtherscan;
|
|
|
|
@computed
|
|
bool get usePolygonScan => _settingsStore.usePolygonScan;
|
|
|
|
@computed
|
|
bool get useTronGrid => _settingsStore.useTronGrid;
|
|
|
|
@computed
|
|
bool get useMempoolFeeAPI => _settingsStore.useMempoolFeeAPI;
|
|
|
|
@computed
|
|
bool get lookupTwitter => _settingsStore.lookupsTwitter;
|
|
|
|
@computed
|
|
bool get lookupsZanoAlias => _settingsStore.lookupsZanoAlias;
|
|
|
|
@computed
|
|
bool get looksUpMastodon => _settingsStore.lookupsMastodon;
|
|
|
|
@computed
|
|
bool get looksUpYatService => _settingsStore.lookupsYatService;
|
|
|
|
@computed
|
|
bool get looksUpUnstoppableDomains => _settingsStore.lookupsUnstoppableDomains;
|
|
|
|
@computed
|
|
bool get looksUpOpenAlias => _settingsStore.lookupsOpenAlias;
|
|
|
|
@computed
|
|
bool get looksUpENS => _settingsStore.lookupsENS;
|
|
|
|
@computed
|
|
bool get looksUpWellKnown => _settingsStore.lookupsWellKnown;
|
|
|
|
bool get canUseEtherscan => _wallet.type == WalletType.ethereum;
|
|
|
|
bool get canUsePolygonScan => _wallet.type == WalletType.polygon;
|
|
|
|
bool get canUseTronGrid => _wallet.type == WalletType.tron;
|
|
|
|
bool get canUseMempoolFeeAPI => _wallet.type == WalletType.bitcoin;
|
|
|
|
@action
|
|
void setShouldSaveRecipientAddress(bool value) =>
|
|
_settingsStore.shouldSaveRecipientAddress = value;
|
|
|
|
@action
|
|
void setExchangeApiMode(ExchangeApiMode value) => _settingsStore.exchangeStatus = value;
|
|
|
|
@action
|
|
void setFiatMode(FiatApiMode fiatApiMode) => _settingsStore.fiatApiMode = fiatApiMode;
|
|
|
|
@action
|
|
void setIsAppSecure(bool value) => _settingsStore.isAppSecure = value;
|
|
|
|
@action
|
|
void setDisableTradeOption(bool value) => _settingsStore.disableTradeOption = value;
|
|
|
|
@action
|
|
void setDisableBulletin(bool value) => _settingsStore.disableBulletin = value;
|
|
|
|
@action
|
|
void setLookupsTwitter(bool value) => _settingsStore.lookupsTwitter = value;
|
|
|
|
@action
|
|
void setLookupsZanoAlias(bool value) => _settingsStore.lookupsZanoAlias = value;
|
|
|
|
@action
|
|
void setLookupsMastodon(bool value) => _settingsStore.lookupsMastodon = value;
|
|
|
|
@action
|
|
void setLookupsENS(bool value) => _settingsStore.lookupsENS = value;
|
|
|
|
@action
|
|
void setLookupsWellKnown(bool value) => _settingsStore.lookupsWellKnown = value;
|
|
|
|
@action
|
|
void setLookupsYatService(bool value) => _settingsStore.lookupsYatService = value;
|
|
|
|
@action
|
|
void setLookupsUnstoppableDomains(bool value) => _settingsStore.lookupsUnstoppableDomains = value;
|
|
|
|
@action
|
|
void setLookupsOpenAlias(bool value) => _settingsStore.lookupsOpenAlias = value;
|
|
|
|
@action
|
|
void setUseEtherscan(bool value) {
|
|
_settingsStore.useEtherscan = value;
|
|
ethereum!.updateEtherscanUsageState(_wallet, value);
|
|
}
|
|
|
|
@action
|
|
void setUsePolygonScan(bool value) {
|
|
_settingsStore.usePolygonScan = value;
|
|
polygon!.updatePolygonScanUsageState(_wallet, value);
|
|
}
|
|
|
|
@action
|
|
void setUseTronGrid(bool value) {
|
|
_settingsStore.useTronGrid = value;
|
|
tron!.updateTronGridUsageState(_wallet, value);
|
|
}
|
|
|
|
@action
|
|
void setUseMempoolFeeAPI(bool value) {
|
|
_settingsStore.useMempoolFeeAPI = value;
|
|
}
|
|
}
|