fix for building monero.com

This commit is contained in:
Matthew Fosse 2024-07-24 12:02:04 -05:00
parent 9b33e682f4
commit 93f6dd4cee
3 changed files with 7 additions and 3 deletions

View file

@ -248,6 +248,9 @@ class CWBitcoin extends Bitcoin {
@override
List<ReceivePageOption> getBitcoinReceivePageOptions() => BitcoinReceivePageOption.all;
@override
List<ReceivePageOption> getLitecoinReceivePageOptions() => BitcoinReceivePageOption.allLitecoin;
@override
BitcoinAddressType getBitcoinAddressType(ReceivePageOption option) {
switch (option) {

View file

@ -1,5 +1,4 @@
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cw_bitcoin/bitcoin_receive_page_option.dart';
import 'package:cw_core/receive_page_option.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cw_core/wallet_type.dart';
@ -17,7 +16,8 @@ abstract class ReceiveOptionViewModelBase with Store {
? bitcoin!.getSelectedAddressType(_wallet)
: ReceivePageOption.mainnet),
_options = [] {
switch (_wallet.type) {
final walletType = _wallet.type;
switch (walletType) {
case WalletType.bitcoin:
_options = [
...bitcoin!.getBitcoinReceivePageOptions(),
@ -26,7 +26,7 @@ abstract class ReceiveOptionViewModelBase with Store {
break;
case WalletType.litecoin:
_options = [
...BitcoinReceivePageOption.allLitecoin,
...bitcoin!.getLitecoinReceivePageOptions()
...ReceivePageOptions.where((element) => element != ReceivePageOption.mainnet)
];
break;

View file

@ -196,6 +196,7 @@ abstract class Bitcoin {
Future<void> setAddressType(Object wallet, dynamic option);
ReceivePageOption getSelectedAddressType(Object wallet);
List<ReceivePageOption> getBitcoinReceivePageOptions();
List<ReceivePageOption> getLitecoinReceivePageOptions();
BitcoinAddressType getBitcoinAddressType(ReceivePageOption option);
bool hasSelectedSilentPayments(Object wallet);
bool isBitcoinReceivePageOption(ReceivePageOption option);