mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
Monero.com fixes
This commit is contained in:
parent
bac9093b87
commit
17eddde1d7
6 changed files with 43 additions and 35 deletions
|
@ -234,7 +234,7 @@ class CWBitcoin extends Bitcoin {
|
|||
}
|
||||
|
||||
@override
|
||||
BitcoinReceivePageOption getSelectedAddressType(Object wallet) {
|
||||
ReceivePageOption getSelectedAddressType(Object wallet) {
|
||||
final bitcoinWallet = wallet as ElectrumWallet;
|
||||
return BitcoinReceivePageOption.fromType(bitcoinWallet.walletAddresses.addressPageType);
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ class CWBitcoin extends Bitcoin {
|
|||
}
|
||||
|
||||
@override
|
||||
List<BitcoinReceivePageOption> getBitcoinReceivePageOptions() => BitcoinReceivePageOption.all;
|
||||
List<ReceivePageOption> getBitcoinReceivePageOptions() => BitcoinReceivePageOption.all;
|
||||
|
||||
@override
|
||||
BitcoinAddressType getBitcoinAddressType(ReceivePageOption option) {
|
||||
|
@ -465,18 +465,32 @@ class CWBitcoin extends Bitcoin {
|
|||
}
|
||||
|
||||
@override
|
||||
List<BitcoinSilentPaymentAddressRecord> getSilentPaymentAddresses(Object wallet) {
|
||||
List<ElectrumSubAddress> getSilentPaymentAddresses(Object wallet) {
|
||||
final bitcoinWallet = wallet as ElectrumWallet;
|
||||
return bitcoinWallet.walletAddresses.silentAddresses
|
||||
.where((addr) => addr.type != SegwitAddresType.p2tr)
|
||||
.map((addr) => ElectrumSubAddress(
|
||||
id: addr.index,
|
||||
name: addr.name,
|
||||
address: addr.address,
|
||||
txCount: addr.txCount,
|
||||
balance: addr.balance,
|
||||
isChange: addr.isHidden))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
List<BitcoinSilentPaymentAddressRecord> getSilentPaymentReceivedAddresses(Object wallet) {
|
||||
List<ElectrumSubAddress> getSilentPaymentReceivedAddresses(Object wallet) {
|
||||
final bitcoinWallet = wallet as ElectrumWallet;
|
||||
return bitcoinWallet.walletAddresses.silentAddresses
|
||||
.where((addr) => addr.type == SegwitAddresType.p2tr)
|
||||
.map((addr) => ElectrumSubAddress(
|
||||
id: addr.index,
|
||||
name: addr.name,
|
||||
address: addr.address,
|
||||
txCount: addr.txCount,
|
||||
balance: addr.balance,
|
||||
isChange: addr.isHidden))
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
|
|
@ -336,17 +336,17 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
|
|||
if (isElectrumWallet) {
|
||||
if (bitcoin!.hasSelectedSilentPayments(wallet)) {
|
||||
final addressItems = bitcoin!.getSilentPaymentAddresses(wallet).map((address) {
|
||||
final isPrimary = address.index == 0;
|
||||
final isPrimary = address.id == 0;
|
||||
|
||||
return WalletAddressListItem(
|
||||
id: address.index,
|
||||
id: address.id,
|
||||
isPrimary: isPrimary,
|
||||
name: address.name,
|
||||
address: address.address,
|
||||
txCount: address.txCount,
|
||||
balance: AmountConverter.amountIntToString(
|
||||
walletTypeToCryptoCurrency(type), address.balance),
|
||||
isChange: address.isHidden,
|
||||
isChange: address.isChange,
|
||||
);
|
||||
});
|
||||
addressList.addAll(addressItems);
|
||||
|
@ -355,14 +355,14 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
|
|||
final receivedAddressItems =
|
||||
bitcoin!.getSilentPaymentReceivedAddresses(wallet).map((address) {
|
||||
return WalletAddressListItem(
|
||||
id: address.index,
|
||||
id: address.id,
|
||||
isPrimary: false,
|
||||
name: address.name,
|
||||
address: address.address,
|
||||
txCount: address.txCount,
|
||||
balance: AmountConverter.amountIntToString(
|
||||
walletTypeToCryptoCurrency(type), address.balance),
|
||||
isChange: address.isHidden,
|
||||
isChange: address.isChange,
|
||||
isOneTimeReceiveAddress: true,
|
||||
);
|
||||
});
|
||||
|
|
|
@ -15,15 +15,15 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
|
|||
APP_ANDROID_TYPE=$1
|
||||
|
||||
MONERO_COM_NAME="Monero.com"
|
||||
MONERO_COM_VERSION="1.14.0"
|
||||
MONERO_COM_BUILD_NUMBER=89
|
||||
MONERO_COM_VERSION="1.15.0"
|
||||
MONERO_COM_BUILD_NUMBER=90
|
||||
MONERO_COM_BUNDLE_ID="com.monero.app"
|
||||
MONERO_COM_PACKAGE="com.monero.app"
|
||||
MONERO_COM_SCHEME="monero.com"
|
||||
|
||||
CAKEWALLET_NAME="Cake Wallet"
|
||||
CAKEWALLET_VERSION="4.17.0"
|
||||
CAKEWALLET_BUILD_NUMBER=215
|
||||
CAKEWALLET_VERSION="4.18.0"
|
||||
CAKEWALLET_BUILD_NUMBER=216
|
||||
CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet"
|
||||
CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet"
|
||||
CAKEWALLET_SCHEME="cakewallet"
|
||||
|
|
|
@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
|
|||
APP_IOS_TYPE=$1
|
||||
|
||||
MONERO_COM_NAME="Monero.com"
|
||||
MONERO_COM_VERSION="1.14.0"
|
||||
MONERO_COM_BUILD_NUMBER=87
|
||||
MONERO_COM_VERSION="1.15.0"
|
||||
MONERO_COM_BUILD_NUMBER=88
|
||||
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
|
||||
|
||||
CAKEWALLET_NAME="Cake Wallet"
|
||||
CAKEWALLET_VERSION="4.18.0"
|
||||
CAKEWALLET_BUILD_NUMBER=247
|
||||
CAKEWALLET_BUILD_NUMBER=248
|
||||
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
|
||||
|
||||
HAVEN_NAME="Haven"
|
||||
|
|
|
@ -16,13 +16,13 @@ if [ -n "$1" ]; then
|
|||
fi
|
||||
|
||||
MONERO_COM_NAME="Monero.com"
|
||||
MONERO_COM_VERSION="1.4.0"
|
||||
MONERO_COM_BUILD_NUMBER=20
|
||||
MONERO_COM_VERSION="1.5.0"
|
||||
MONERO_COM_BUILD_NUMBER=21
|
||||
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
|
||||
|
||||
CAKEWALLET_NAME="Cake Wallet"
|
||||
CAKEWALLET_VERSION="1.10.0"
|
||||
CAKEWALLET_BUILD_NUMBER=77
|
||||
CAKEWALLET_VERSION="1.11.0"
|
||||
CAKEWALLET_BUILD_NUMBER=78
|
||||
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
|
||||
|
||||
if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then
|
||||
|
|
|
@ -71,30 +71,26 @@ Future<void> generateBitcoin(bool hasImplementation) async {
|
|||
final outputFile = File(bitcoinOutputPath);
|
||||
const bitcoinCommonHeaders = """
|
||||
import 'dart:typed_data';
|
||||
import 'package:cw_core/node.dart';
|
||||
import 'package:bitcoin_base/bitcoin_base.dart';
|
||||
import 'package:cake_wallet/view_model/hardware_wallet/ledger_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/send/output.dart';
|
||||
import 'package:cw_core/hardware/hardware_account_data.dart';
|
||||
import 'package:cw_core/node.dart';
|
||||
import 'package:cw_core/output_info.dart';
|
||||
import 'package:cw_core/pending_transaction.dart';
|
||||
import 'package:cw_core/receive_page_option.dart';
|
||||
import 'package:cw_core/transaction_priority.dart';
|
||||
import 'package:cw_core/unspent_coins_info.dart';
|
||||
import 'package:cw_core/unspent_transaction_output.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/transaction_priority.dart';
|
||||
import 'package:cw_core/output_info.dart';
|
||||
import 'package:cw_core/unspent_coins_info.dart';
|
||||
import 'package:cw_core/wallet_service.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:cake_wallet/view_model/send/output.dart';
|
||||
import 'package:cake_wallet/store/settings_store.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:ledger_flutter/ledger_flutter.dart';
|
||||
import 'package:bitcoin_base/bitcoin_base.dart';
|
||||
import 'package:bitcoin_flutter/bitcoin_flutter.dart' as btc;
|
||||
import 'package:bip32/bip32.dart' as bip32;
|
||||
import 'package:bip39/bip39.dart' as bip39;
|
||||
import 'package:hive/hive.dart';
|
||||
""";
|
||||
const bitcoinCWHeaders = """
|
||||
import 'package:cw_bitcoin/utils.dart';
|
||||
|
@ -115,9 +111,7 @@ import 'package:cw_bitcoin/bitcoin_address_record.dart';
|
|||
import 'package:cw_bitcoin/bitcoin_transaction_credentials.dart';
|
||||
import 'package:cw_bitcoin/litecoin_wallet_service.dart';
|
||||
import 'package:cw_core/get_height_by_date.dart';
|
||||
import 'package:cw_core/node.dart';
|
||||
import 'package:cw_bitcoin/script_hash.dart';
|
||||
import 'package:cw_bitcoin/pending_bitcoin_transaction.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_hardware_wallet_service.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
""";
|
||||
|
@ -167,8 +161,8 @@ abstract class Bitcoin {
|
|||
Object createBitcoinTransactionCredentialsRaw(List<OutputInfo> outputs, {TransactionPriority? priority, required int feeRate});
|
||||
|
||||
String getAddress(Object wallet);
|
||||
List<BitcoinSilentPaymentAddressRecord> getSilentPaymentAddresses(Object wallet);
|
||||
List<BitcoinSilentPaymentAddressRecord> getSilentPaymentReceivedAddresses(Object wallet);
|
||||
List<ElectrumSubAddress> getSilentPaymentAddresses(Object wallet);
|
||||
List<ElectrumSubAddress> getSilentPaymentReceivedAddresses(Object wallet);
|
||||
|
||||
Future<int> estimateFakeSendAllTxAmount(Object wallet, TransactionPriority priority);
|
||||
List<ElectrumSubAddress> getSubAddresses(Object wallet);
|
||||
|
@ -193,8 +187,8 @@ abstract class Bitcoin {
|
|||
Future<List<DerivationInfo>> getDerivationsFromMnemonic(
|
||||
{required String mnemonic, required Node node, String? passphrase});
|
||||
Future<void> setAddressType(Object wallet, dynamic option);
|
||||
BitcoinReceivePageOption getSelectedAddressType(Object wallet);
|
||||
List<BitcoinReceivePageOption> getBitcoinReceivePageOptions();
|
||||
ReceivePageOption getSelectedAddressType(Object wallet);
|
||||
List<ReceivePageOption> getBitcoinReceivePageOptions();
|
||||
BitcoinAddressType getBitcoinAddressType(ReceivePageOption option);
|
||||
bool hasSelectedSilentPayments(Object wallet);
|
||||
bool isBitcoinReceivePageOption(ReceivePageOption option);
|
||||
|
|
Loading…
Reference in a new issue