Merge branch 'main' of https://github.com/cake-tech/cake_wallet into CW-565-sign-messages

This commit is contained in:
Matthew Fosse 2024-05-09 08:36:26 -07:00
commit 66194ac2ba
5 changed files with 9 additions and 69 deletions

View file

@ -130,11 +130,6 @@ class TronClient {
final energyInSun = chainParams.getEnergyFee!; final energyInSun = chainParams.getEnergyFee!;
log('Energy In Sun: $energyInSun'); log('Energy In Sun: $energyInSun');
log(
'Create Account Fee In System Contract for Chain: ${chainParams.getCreateNewAccountFeeInSystemContract!}',
);
log('Create Account Fee for Chain: ${chainParams.getCreateAccountFee}');
final fakeTransaction = Transaction( final fakeTransaction = Transaction(
rawData: rawTransaction, rawData: rawTransaction,
signature: [Uint8List(65)], signature: [Uint8List(65)],
@ -185,17 +180,6 @@ class TronClient {
totalBurn += chainParams.getMemoFee!; totalBurn += chainParams.getMemoFee!;
} }
// Check if receiver's account is active
final receiverAccountInfo =
await _provider!.request(TronRequestGetAccount(address: receiverAddress));
/// Calculate the resources required to create a new account.
if (receiverAccountInfo == null) {
totalBurn += chainParams.getCreateNewAccountFeeInSystemContract!;
totalBurn += (chainParams.getCreateAccountFee! * bandWidthInSun);
}
log('Final total burn: $totalBurn'); log('Final total burn: $totalBurn');
return totalBurn; return totalBurn;

View file

@ -127,7 +127,6 @@ import 'package:cake_wallet/src/screens/support/support_page.dart';
import 'package:cake_wallet/src/screens/support_chat/support_chat_page.dart'; import 'package:cake_wallet/src/screens/support_chat/support_chat_page.dart';
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart'; import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
import 'package:cake_wallet/src/screens/trade_details/trade_details_page.dart'; import 'package:cake_wallet/src/screens/trade_details/trade_details_page.dart';
import 'package:cake_wallet/src/screens/transaction_details/rbf_details_page.dart';
import 'package:cake_wallet/src/screens/transaction_details/transaction_details_page.dart'; import 'package:cake_wallet/src/screens/transaction_details/transaction_details_page.dart';
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_details_page.dart'; import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_details_page.dart';
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_list_page.dart'; import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_list_page.dart';
@ -226,7 +225,6 @@ import 'package:cake_wallet/view_model/wallet_seed_view_model.dart';
import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/nano_account.dart'; import 'package:cw_core/nano_account.dart';
import 'package:cw_core/node.dart'; import 'package:cw_core/node.dart';
import 'package:cw_core/receive_page_option.dart';
import 'package:cw_core/transaction_info.dart'; import 'package:cw_core/transaction_info.dart';
import 'package:cw_core/unspent_coins_info.dart'; import 'package:cw_core/unspent_coins_info.dart';
import 'package:cw_core/wallet_info.dart'; import 'package:cw_core/wallet_info.dart';
@ -234,37 +232,11 @@ import 'package:cw_core/wallet_service.dart';
import 'package:cw_core/wallet_type.dart'; import 'package:cw_core/wallet_type.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:cake_wallet/core/secure_storage.dart'; import 'package:cake_wallet/core/secure_storage.dart';
import 'package:cake_wallet/core/wallet_creation_service.dart';
import 'package:cake_wallet/store/app_store.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/view_model/wallet_new_vm.dart';
import 'package:cake_wallet/store/authentication_store.dart';
import 'package:cake_wallet/store/dashboard/trades_store.dart';
import 'package:cake_wallet/store/dashboard/trade_filter_store.dart';
import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart';
import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
import 'package:cake_wallet/store/templates/send_template_store.dart';
import 'package:cake_wallet/store/templates/exchange_template_store.dart';
import 'package:cake_wallet/entities/template.dart';
import 'package:cake_wallet/exchange/exchange_template.dart';
import 'package:cake_wallet/.secrets.g.dart' as secrets;
import 'package:cake_wallet/src/screens/dashboard/pages/address_page.dart';
import 'package:cake_wallet/anypay/anypay_api.dart';
import 'package:cake_wallet/view_model/ionia/ionia_gift_card_details_view_model.dart';
import 'package:cake_wallet/src/screens/ionia/cards/ionia_payment_status_page.dart';
import 'package:cake_wallet/view_model/ionia/ionia_payment_status_view_model.dart';
import 'package:cake_wallet/anypay/any_pay_payment_committed_info.dart';
import 'package:cake_wallet/ionia/ionia_any_pay_payment_info.dart';
import 'package:cake_wallet/src/screens/receive/fullscreen_qr_page.dart';
import 'package:cake_wallet/core/wallet_loading_service.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:cake_wallet/entities/qr_view_data.dart';
import 'buy/dfx/dfx_buy_provider.dart'; import 'buy/dfx/dfx_buy_provider.dart';
import 'core/totp_request_details.dart'; import 'core/totp_request_details.dart';

View file

@ -53,7 +53,7 @@ class DashboardPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenHeight = MediaQuery.of(context).size.height; final screenHeight = MediaQuery.of(context).size.height;
return Scaffold( return Scaffold(
body: Observer( body: Builder(
builder: (_) { builder: (_) {
final dashboardPageView = RefreshIndicator( final dashboardPageView = RefreshIndicator(
displacement: screenHeight * 0.1, displacement: screenHeight * 0.1,

View file

@ -138,6 +138,7 @@ dependency_overrides:
git: git:
url: https://github.com/cake-tech/web3dart.git url: https://github.com/cake-tech/web3dart.git
ref: cake ref: cake
flutter_secure_storage_platform_interface: 1.0.2
flutter_icons: flutter_icons:
image_path: "assets/images/app_logo.png" image_path: "assets/images/app_logo.png"

View file

@ -1175,8 +1175,8 @@ Future<void> generatePubspec(
git: git:
url: https://github.com/cake-tech/flutter_secure_storage.git url: https://github.com/cake-tech/flutter_secure_storage.git
path: flutter_secure_storage path: flutter_secure_storage
ref: cake-9.0.0 ref: cake-8.0.0
version: 9.0.0 version: 8.0.0
"""; """;
const cwEthereum = """ const cwEthereum = """
cw_ethereum: cw_ethereum:
@ -1392,29 +1392,12 @@ class DefaultSecureStorage extends SecureStorage {
@override @override
Future<String?> readNoIOptions({required String key}) async => await _readInternal(key, true); Future<String?> readNoIOptions({required String key}) async => await _readInternal(key, true);
Future<String?> _readInternal(String key, bool useNoIOptions) async { Future<String?> _readInternal(String key, bool useNoIOptions) async {
String? result; return await _secureStorage.read(
key: key,
const maxWait = Duration(seconds: 3); iOptions: useNoIOptions ? IOSOptions() : null,
const checkInterval = Duration(milliseconds: 200); );
DateTime start = DateTime.now();
while (result == null && DateTime.now().difference(start) < maxWait) {
result = await _secureStorage.read(
key: key,
iOptions: useNoIOptions ? IOSOptions() : null,
);
if (result != null) {
break;
}
await Future.delayed(checkInterval);
}
return result;
} }
}"""; }""";
const fakeSecureStorage = """ const fakeSecureStorage = """