CW-432-Add-Bitcoin-Cash-BCH (#1041)

* initial commit

* creating and restoring a wallet

* [skip ci] add transaction priority

* fix send and unspent screen

* fix transaction priority type

* replace Unspend with BitcoinUnspent

* add transaction creation

* fix transaction details screen

* minor fix

* fix create side wallet

* basic transaction creation flow

* fix fiat amount calculation

* edit wallet

* minor fix

* fix address book parsing

* merge commit fixes

* minor fixes

* Update gradle.properties

* fix bch unspent coins

* minor fix

* fix BitcoinCashTransactionPriority

* Fetch tags first before switching to one of them

* Update build_haven.sh

* Update build_haven.sh

* Update build_haven.sh

* Update build_haven.sh

* update transaction build function

* Update build_haven.sh

* add ability to rename and delete

* fix address format

* Update pubspec.lock

* Revert "fix address format"

This reverts commit 1549bf4d8c3bdb0addbd6e3c5f049ebc3799ff8f.

* fix address format for exange

* restore from qr

* Update configure.dart

* [skip ci] minor fix

* fix default fee rate

* Update onramper_buy_provider.dart

* Update wallet_address_list_view_model.dart

* PR comments fixes

* Update exchange_view_model.dart

* fix merge conflict

* Update address_validator.dart

* merge fixes

* update initialMigrationVersion

* move cw_bitbox to Cake tech

* PR fixes

* PR fixes

* Fix configure.dart brackets

* update the new version text after macos 

* dummy change to run workflow

* Fix Nano restore from QR issue
Fix Conflicts with main

* PR fixes

* Update app_config.sh 

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Serhii
2023-10-13 01:50:16 +03:00
committed by GitHub
co-authored by Omar Hatem
parent acb0517871
commit 66301ff247
88 changed files with 1685 additions and 416 deletions
@@ -33,6 +33,7 @@ class _DesktopWalletSelectionDropDownState extends State<DesktopWalletSelectionD
final litecoinIcon = Image.asset('assets/images/litecoin_icon.png', height: 24, width: 24);
final havenIcon = Image.asset('assets/images/haven_logo.png', height: 24, width: 24);
final ethereumIcon = Image.asset('assets/images/eth_icon.png', height: 24, width: 24);
final bitcoinCashIcon = Image.asset('assets/images/bch_icon.png', height: 24, width: 24);
final nanoIcon = Image.asset('assets/images/nano_icon.png', height: 24, width: 24);
final bananoIcon = Image.asset('assets/images/nano_icon.png', height: 24, width: 24);
final nonWalletTypeIcon = Image.asset('assets/images/close.png', height: 24, width: 24);
@@ -143,6 +144,8 @@ class _DesktopWalletSelectionDropDownState extends State<DesktopWalletSelectionD
return havenIcon;
case WalletType.ethereum:
return ethereumIcon;
case WalletType.bitcoinCash:
return bitcoinCashIcon;
case WalletType.nano:
return nanoIcon;
case WalletType.banano:
@@ -31,7 +31,8 @@ class MenuWidgetState extends State<MenuWidget> {
this.havenIcon = Image.asset('assets/images/haven_menu.png'),
this.ethereumIcon = Image.asset('assets/images/eth_icon.png'),
this.nanoIcon = Image.asset('assets/images/nano_icon.png'),
this.bananoIcon = Image.asset('assets/images/nano_icon.png');
this.bananoIcon = Image.asset('assets/images/nano_icon.png'),
this.bitcoinCashIcon = Image.asset('assets/images/bch_icon.png');
final largeScreen = 731;
@@ -50,10 +51,10 @@ class MenuWidgetState extends State<MenuWidget> {
Image litecoinIcon;
Image havenIcon;
Image ethereumIcon;
Image bitcoinCashIcon;
Image nanoIcon;
Image bananoIcon;
@override
void initState() {
menuWidth = 0;
@@ -212,6 +213,8 @@ class MenuWidgetState extends State<MenuWidget> {
return havenIcon;
case WalletType.ethereum:
return ethereumIcon;
case WalletType.bitcoinCash:
return bitcoinCashIcon;
case WalletType.nano:
return nanoIcon;
case WalletType.banano:
+1
View File
@@ -73,6 +73,7 @@ class PreSeedPage extends BasePage {
case WalletType.monero:
return 25;
case WalletType.ethereum:
case WalletType.bitcoinCash:
return 12;
default:
return 24;
@@ -1,8 +1,10 @@
import 'package:cake_wallet/bitcoin_cash/bitcoin_cash.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_list_view_model.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
@@ -79,6 +81,9 @@ class UnspentCoinsListFormState extends State<UnspentCoinsListForm> {
itemBuilder: (_, int index) {
return Observer(builder: (_) {
final item = unspentCoinsListViewModel.items[index];
final address = unspentCoinsListViewModel.wallet.type == WalletType.bitcoinCash
? bitcoinCash!.getCashAddrFormat(item.address)
: item.address;
return GestureDetector(
onTap: () =>
@@ -88,7 +93,7 @@ class UnspentCoinsListFormState extends State<UnspentCoinsListForm> {
child: UnspentCoinsListItem(
note: item.note,
amount: item.amount,
address: item.address,
address: address,
isSending: item.isSending,
isFrozen: item.isFrozen,
onCheckBoxTap: item.isFrozen
@@ -48,6 +48,7 @@ class WalletListBodyState extends State<WalletListBody> {
final nonWalletTypeIcon = Image.asset('assets/images/close.png', height: 24, width: 24);
final havenIcon = Image.asset('assets/images/haven_logo.png', height: 24, width: 24);
final ethereumIcon = Image.asset('assets/images/eth_icon.png', height: 24, width: 24);
final bitcoinCashIcon = Image.asset('assets/images/bch_icon.png', height: 24, width: 24);
final nanoIcon = Image.asset('assets/images/nano_icon.png', height: 24, width: 24);
final scrollController = ScrollController();
final double tileHeight = 60;
@@ -243,6 +244,8 @@ class WalletListBodyState extends State<WalletListBody> {
return havenIcon;
case WalletType.ethereum:
return ethereumIcon;
case WalletType.bitcoinCash:
return bitcoinCashIcon;
case WalletType.nano:
return nanoIcon;
default: