Remove haven (#2085)

* 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

* Remove Haven Wallet

* Remove haven scripts

* minor fixes [skip ci]

* decred: Get slip44 addrs before sync completes. (#2092)

* - Fix loading wallet more than one time
- Fix minor UI issue

* fix merge issue

* fix merge 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>
This commit is contained in:
Omar Hatem
2025-03-21 04:52:05 +02:00
committed by GitHub
co-authored by JoeGruffins Wisdom Arerosuoghene Philemon Ukane Czarek Nakamoto
parent 0ba54fa602
commit a34cf24897
128 changed files with 52 additions and 22310 deletions
@@ -32,7 +32,6 @@ import 'package:cake_wallet/view_model/dashboard/order_list_item.dart';
import 'package:cake_wallet/view_model/dashboard/trade_list_item.dart';
import 'package:cake_wallet/view_model/dashboard/transaction_list_item.dart';
import 'package:cake_wallet/view_model/settings/sync_mode.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
import 'package:cryptography/cryptography.dart';
import 'package:cw_core/balance.dart';
import 'package:cw_core/cake_hive.dart';
@@ -70,8 +69,8 @@ abstract class DashboardViewModelBase with Store {
required this.anonpayTransactionsStore,
required this.sharedPreferences,
required this.keyService})
: hasTradeAction = false,
hasSwapAction = false,
: hasTradeAction = true,
hasSwapAction = true,
isShowFirstYatIntroduction = false,
isShowSecondYatIntroduction = false,
isShowThirdYatIntroduction = false,
@@ -176,7 +175,6 @@ abstract class DashboardViewModelBase with Store {
isShowFirstYatIntroduction = false;
isShowSecondYatIntroduction = false;
isShowThirdYatIntroduction = false;
updateActions();
final _wallet = wallet;
@@ -664,7 +662,6 @@ abstract class DashboardViewModelBase with Store {
this.wallet = wallet;
type = wallet.type;
name = wallet.name;
updateActions();
if (wallet.type == WalletType.monero) {
subname = monero!.getCurrentAccount(wallet).label;
@@ -800,11 +797,6 @@ abstract class DashboardViewModelBase with Store {
}
}
void updateActions() {
hasSwapAction = !isHaven;
hasTradeAction = !isHaven;
}
@computed
SyncMode get syncMode => settingsStore.currentSyncMode;
@@ -16,7 +16,6 @@ import 'package:cw_core/transaction_info.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/entities/calculate_fiat_amount_raw.dart';
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
@@ -172,13 +171,6 @@ class TransactionListItem extends ActionListItem with Keyable {
cryptoAmount: bitcoin!.formatterBitcoinAmountToDouble(amount: transaction.amount),
price: price);
break;
case WalletType.haven:
final asset = haven!.assetOfTransaction(transaction);
final price = balanceViewModel.fiatConvertationStore.prices[asset];
amount = calculateFiatAmountRaw(
cryptoAmount: haven!.formatterMoneroAmountToDouble(amount: transaction.amount),
price: price);
break;
case WalletType.ethereum:
final asset = ethereum!.assetOfTransaction(balanceViewModel.wallet, transaction);
final price = balanceViewModel.fiatConvertationStore.prices[asset];
@@ -234,6 +226,7 @@ class TransactionListItem extends ActionListItem with Keyable {
break;
case WalletType.none:
case WalletType.banano:
case WalletType.haven:
break;
}
@@ -1,11 +1,9 @@
import 'package:cake_wallet/wownero/wownero.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:flutter/foundation.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart';
part 'monero_account_edit_or_create_view_model.g.dart';
@@ -14,7 +12,7 @@ class MoneroAccountEditOrCreateViewModel = MoneroAccountEditOrCreateViewModelBas
with _$MoneroAccountEditOrCreateViewModel;
abstract class MoneroAccountEditOrCreateViewModelBase with Store {
MoneroAccountEditOrCreateViewModelBase(this._moneroAccountList, this._wowneroAccountList, this._havenAccountList,
MoneroAccountEditOrCreateViewModelBase(this._moneroAccountList, this._wowneroAccountList,
{required WalletBase wallet, AccountListItem? accountListItem})
: state = InitialExecutionState(),
isEdit = accountListItem != null,
@@ -32,7 +30,6 @@ abstract class MoneroAccountEditOrCreateViewModelBase with Store {
final MoneroAccountList _moneroAccountList;
final WowneroAccountList? _wowneroAccountList;
final HavenAccountList? _havenAccountList;
final AccountListItem? _accountListItem;
final WalletBase _wallet;
@@ -41,10 +38,6 @@ abstract class MoneroAccountEditOrCreateViewModelBase with Store {
await saveMonero();
}
if (_wallet.type == WalletType.haven) {
await saveHaven();
}
if (_wallet.type == WalletType.wownero) {
await saveWownero();
}
@@ -57,7 +50,7 @@ abstract class MoneroAccountEditOrCreateViewModelBase with Store {
if (_accountListItem != null) {
await _moneroAccountList.setLabelAccount(
_wallet,
accountIndex: _accountListItem!.id,
accountIndex: _accountListItem.id,
label: label);
} else {
await _moneroAccountList.addAccount(
@@ -72,32 +65,6 @@ abstract class MoneroAccountEditOrCreateViewModelBase with Store {
}
}
Future<void> saveHaven() async {
if (!(_wallet.type == WalletType.haven)) {
return;
}
try {
state = IsExecutingState();
if (_accountListItem != null) {
await _havenAccountList!.setLabelAccount(
_wallet,
accountIndex: _accountListItem!.id,
label: label);
} else {
await _havenAccountList!.addAccount(
_wallet,
label: label);
}
await _wallet.save();
state = ExecutedSuccessfullyState();
} catch (e) {
state = FailureState(e.toString());
}
}
Future<void> saveWownero() async {
try {
state = IsExecutingState();
@@ -105,7 +72,7 @@ abstract class MoneroAccountEditOrCreateViewModelBase with Store {
if (_accountListItem != null) {
await _wowneroAccountList?.setLabelAccount(
_wallet,
accountIndex: _accountListItem!.id,
accountIndex: _accountListItem.id,
label: label);
} else {
await _wowneroAccountList?.addAccount(
@@ -5,7 +5,6 @@ import 'package:mobx/mobx.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/haven/haven.dart';
part 'monero_account_list_view_model.g.dart';
@@ -27,16 +26,6 @@ abstract class MoneroAccountListViewModelBase with Store {
@computed
List<AccountListItem> get accounts {
if (_wallet.type == WalletType.haven) {
return haven
!.getAccountList(_wallet)
.accounts.map((acc) => AccountListItem(
label: acc.label,
id: acc.id,
isSelected: acc.id == haven!.getCurrentAccount(_wallet).id))
.toList();
}
if (_wallet.type == WalletType.monero) {
return monero
!.getAccountList(_wallet)
@@ -82,12 +71,5 @@ abstract class MoneroAccountListViewModelBase with Store {
item.balance,
);
}
if (_wallet.type == WalletType.haven) {
haven!.setCurrentAccount(
_wallet,
item.id,
item.label);
}
}
}
+6 -9
View File
@@ -4,7 +4,6 @@ import 'package:cake_wallet/entities/calculate_fiat_amount_raw.dart';
import 'package:cake_wallet/entities/parse_address_from_domain.dart';
import 'package:cake_wallet/entities/parsed_address.dart';
import 'package:cake_wallet/ethereum/ethereum.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/polygon/polygon.dart';
import 'package:cake_wallet/reactions/wallet_connect.dart';
import 'package:cake_wallet/solana/solana.dart';
@@ -105,9 +104,6 @@ abstract class OutputBase with Store {
case WalletType.decred:
_amount = decred!.formatterStringDoubleToDecredAmount(_cryptoAmount);
break;
case WalletType.haven:
_amount = haven!.formatterMoneroParseAmount(amount: _cryptoAmount);
break;
case WalletType.ethereum:
_amount = ethereum!.formatterEthereumParseAmount(_cryptoAmount);
break;
@@ -120,7 +116,12 @@ abstract class OutputBase with Store {
case WalletType.zano:
_amount = zano!.formatterParseAmount(amount: _cryptoAmount, currency: cryptoCurrencyHandler());
break;
default:
case WalletType.none:
case WalletType.haven:
case WalletType.nano:
case WalletType.banano:
case WalletType.solana:
case WalletType.tron:
break;
}
@@ -177,10 +178,6 @@ abstract class OutputBase with Store {
return wownero!.formatterWowneroAmountToDouble(amount: fee);
}
if (_wallet.type == WalletType.haven) {
return haven!.formatterMoneroAmountToDouble(amount: fee);
}
if (_wallet.type == WalletType.ethereum) {
return ethereum!.formatterEthereumAmountToDouble(amount: BigInt.from(fee));
}
-8
View File
@@ -1,6 +1,5 @@
import 'package:cake_wallet/entities/contact.dart';
import 'package:cake_wallet/entities/evm_transaction_error_fees_handler.dart';
import 'package:cake_wallet/entities/priority_for_wallet_type.dart';
import 'package:cake_wallet/entities/transaction_description.dart';
import 'package:cake_wallet/ethereum/ethereum.dart';
import 'package:cake_wallet/exchange/provider/exchange_provider.dart';
@@ -25,7 +24,6 @@ import 'package:cake_wallet/wownero/wownero.dart';
import 'package:cake_wallet/zano/zano.dart';
import 'package:cw_core/exceptions.dart';
import 'package:cw_core/transaction_info.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:cw_core/unspent_coin_type.dart';
import 'package:cake_wallet/view_model/send/output.dart';
import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
@@ -49,9 +47,7 @@ import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/view_model/send/send_view_model_state.dart';
import 'package:cake_wallet/entities/parsed_address.dart';
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:collection/collection.dart';
part 'send_view_model.g.dart';
@@ -521,10 +517,6 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
return wownero!
.createWowneroTransactionCreationCredentials(outputs: outputs, priority: priority!);
case WalletType.haven:
return haven!.createHavenTransactionCreationCredentials(
outputs: outputs, priority: priority!, assetType: selectedCryptoCurrency.title);
case WalletType.ethereum:
return ethereum!.createEthereumTransactionCredentials(outputs,
priority: priority!, currency: selectedCryptoCurrency);
@@ -4,7 +4,6 @@ import 'package:mobx/mobx.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/decred/decred.dart';
import 'package:cw_core/wallet_type.dart';
@@ -105,13 +104,6 @@ abstract class WalletAddressEditOrCreateViewModelBase with Store {
wallet.walletAddresses.manualAddresses.add(addr);
await wallet.save();
}
if (wallet.type == WalletType.haven) {
await haven!
.getSubaddressList(wallet)
.addSubaddress(wallet, accountIndex: haven!.getCurrentAccount(wallet).id, label: label);
await wallet.save();
}
}
Future<void> _update() async {
@@ -137,11 +129,6 @@ abstract class WalletAddressEditOrCreateViewModelBase with Store {
accountIndex: wownero!.getCurrentAccount(wallet).id, addressIndex: index, label: label);
await wallet.save();
}
if (wallet.type == WalletType.haven) {
await haven!.getSubaddressList(wallet).setLabelSubaddress(wallet,
accountIndex: haven!.getCurrentAccount(wallet).id, addressIndex: index, label: label);
await wallet.save();
}
}
}
}
@@ -8,7 +8,6 @@ import 'package:cake_wallet/entities/fiat_api_mode.dart';
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/ethereum/ethereum.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/polygon/polygon.dart';
import 'package:cake_wallet/solana/solana.dart';
@@ -27,7 +26,6 @@ import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_i
import 'package:cake_wallet/wownero/wownero.dart';
import 'package:cw_core/amount_converter.dart';
import 'package:cw_core/currency.dart';
import 'package:cw_core/utils/print_verbose.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:intl/intl.dart';
import 'package:mobx/mobx.dart';
@@ -377,20 +375,6 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
addressList.addAll(addressItems);
}
if (wallet.type == WalletType.haven) {
final primaryAddress = haven!.getSubaddressList(wallet).subaddresses.first;
final addressItems = haven!.getSubaddressList(wallet).subaddresses.map((subaddress) {
final isPrimary = subaddress == primaryAddress;
return WalletAddressListItem(
id: subaddress.id,
isPrimary: isPrimary,
name: subaddress.label,
address: subaddress.address);
});
addressList.addAll(addressItems);
}
if (isElectrumWallet) {
if (bitcoin!.hasSelectedSilentPayments(wallet)) {
final addressItems = bitcoin!.getSilentPaymentAddresses(wallet).map((address) {
@@ -556,10 +540,6 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
wownero!
.getSubaddressList(wallet)
.update(wallet, accountIndex: wownero!.getCurrentAccount(wallet).id);
} else if (wallet.type == WalletType.haven) {
haven!
.getSubaddressList(wallet)
.update(wallet, accountIndex: haven!.getCurrentAccount(wallet).id);
}
}
@@ -573,8 +553,6 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
return monero!.getCurrentAccount(wallet).label;
case WalletType.wownero:
wownero!.getCurrentAccount(wallet).label;
case WalletType.haven:
return haven!.getCurrentAccount(wallet).label;
default:
return '';
}
+1 -11
View File
@@ -1,5 +1,4 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart';
import 'package:cake_wallet/store/app_store.dart';
@@ -116,9 +115,6 @@ abstract class WalletKeysViewModelBase with Store {
case WalletType.monero:
keys = monero!.getKeys(_wallet);
break;
case WalletType.haven:
keys = haven!.getKeys(_wallet);
break;
case WalletType.wownero:
keys = wownero!.getKeys(_wallet);
break;
@@ -166,6 +162,7 @@ abstract class WalletKeysViewModelBase with Store {
case WalletType.litecoin:
case WalletType.bitcoinCash:
case WalletType.none:
case WalletType.haven:
// final keys = bitcoin!.getWalletKeys(_appStore.wallet!);
//
// items.addAll([
@@ -215,9 +212,6 @@ abstract class WalletKeysViewModelBase with Store {
}
Future<int?> _currentHeight() async {
if (_wallet.type == WalletType.haven) {
return await haven!.getCurrentHeight();
}
if (_wallet.type == WalletType.monero) {
return await monero!.getCurrentHeight();
}
@@ -307,8 +301,6 @@ abstract class WalletKeysViewModelBase with Store {
List<TransactionInfo> _getWalletTransactions(WalletBase wallet) {
if (wallet.type == WalletType.monero) {
return monero!.getTransactionHistory(wallet).transactions.values.toList();
} else if (wallet.type == WalletType.haven) {
return haven!.getTransactionHistory(wallet).transactions.values.toList();
} else if (wallet.type == WalletType.wownero) {
return wownero!.getTransactionHistory(wallet).transactions.values.toList();
}
@@ -318,8 +310,6 @@ abstract class WalletKeysViewModelBase with Store {
int _getRestoreHeightByTransactions(WalletType type, DateTime date) {
if (type == WalletType.monero) {
return monero!.getHeightByDate(date: date);
} else if (type == WalletType.haven) {
return haven!.getHeightByDate(date: date);
} else if (type == WalletType.wownero) {
return wownero!.getHeightByDate(date: date);
}
+1 -11
View File
@@ -5,29 +5,21 @@ import 'package:cake_wallet/bitcoin_cash/bitcoin_cash.dart';
import 'package:cake_wallet/solana/solana.dart';
import 'package:cake_wallet/tron/tron.dart';
import 'package:cake_wallet/wownero/wownero.dart';
import 'package:cake_wallet/zano/zano.dart';
import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/bitcoin_cash/bitcoin_cash.dart';
import 'package:cake_wallet/core/wallet_creation_service.dart';
import 'package:cake_wallet/entities/seed_type.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/nano/nano.dart';
import 'package:cake_wallet/solana/solana.dart';
import 'package:cake_wallet/store/app_store.dart';
import 'package:cake_wallet/tron/tron.dart';
import 'package:cake_wallet/view_model/seed_settings_view_model.dart';
import 'package:cake_wallet/view_model/wallet_creation_vm.dart';
import 'package:cake_wallet/wownero/wownero.dart';
import 'package:cake_wallet/decred/decred.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cw_core/wallet_credentials.dart';
import 'package:cw_core/wallet_info.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart';
import '../polygon/polygon.dart';
import 'advanced_privacy_settings_view_model.dart';
@@ -113,9 +105,6 @@ abstract class WalletNewVMBase extends WalletCreationVM with Store {
passphrase: passphrase,
mnemonic: newWalletArguments!.mnemonic,
);
case WalletType.haven:
return haven!.createHavenNewWalletCredentials(
name: name, language: options!.first as String, password: walletPassword);
case WalletType.ethereum:
return ethereum!.createEthereumNewWalletCredentials(
name: name,
@@ -176,6 +165,7 @@ abstract class WalletNewVMBase extends WalletCreationVM with Store {
case WalletType.decred:
return decred!.createDecredNewWalletCredentials(name: name);
case WalletType.none:
case WalletType.haven:
throw Exception('Unexpected type: ${type.toString()}');
}
}
+1 -15
View File
@@ -4,7 +4,6 @@ import 'package:cake_wallet/core/generate_wallet_password.dart';
import 'package:cake_wallet/core/wallet_creation_service.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/ethereum/ethereum.dart';
import 'package:cake_wallet/haven/haven.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/nano/nano.dart';
import 'package:cake_wallet/polygon/polygon.dart';
@@ -117,9 +116,6 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
derivationType: derivationInfo!.derivationType!,
derivationPath: derivationInfo.derivationPath!,
);
case WalletType.haven:
return haven!.createHavenRestoreWalletFromSeedCredentials(
name: name, height: height, mnemonic: seed, password: password);
case WalletType.ethereum:
return ethereum!.createEthereumRestoreWalletFromSeedCredentials(
name: name,
@@ -187,6 +183,7 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
password: password,
);
case WalletType.none:
case WalletType.haven:
break;
}
}
@@ -208,17 +205,6 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
language: 'English',
);
case WalletType.haven:
return haven!.createHavenRestoreWalletFromKeysCredentials(
name: name,
height: height,
spendKey: spendKey!,
viewKey: viewKey!,
address: address!,
password: password,
language: 'English',
);
case WalletType.ethereum:
return ethereum!.createEthereumRestoreWalletFromPrivateKey(
name: name,