mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
tx-confirmation-options-on-dev [cw-1463] (#3289)
* add note and contact options to tx confirmation screen * fix closing animation for confirm sheet * fix note button for lightning * sizing fix * add local tx info for evm/sol/trx * fix for xmr/zec * merge * fixes
This commit is contained in:
@@ -938,6 +938,7 @@ import 'package:cw_core/wallet_credentials.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:cw_core/wallet_service.dart';
|
||||
import 'package:cw_core/spl_token.dart';
|
||||
import 'package:cw_core/transaction_direction.dart';
|
||||
|
||||
""";
|
||||
const solanaCWHeaders = """
|
||||
@@ -1033,6 +1034,23 @@ abstract class Solana {
|
||||
});
|
||||
|
||||
Future<void> discoverAndAddWalletTokens(WalletBase wallet);
|
||||
|
||||
TransactionInfo getTransactionInfo(
|
||||
{
|
||||
required String id,
|
||||
required DateTime blockTime,
|
||||
required String to,
|
||||
required String from,
|
||||
String? tokenSymbol,
|
||||
required TransactionDirection direction,
|
||||
required double solAmount,
|
||||
required bool isPending,
|
||||
required double txFee,
|
||||
}
|
||||
);
|
||||
|
||||
double getPendingTransactionAmount(PendingTransaction tx);
|
||||
double getPendingTransactionFee(PendingTransaction tx);
|
||||
}
|
||||
|
||||
class JupiterSwapFailedException implements Exception {
|
||||
@@ -1076,6 +1094,7 @@ Future<void> generateTron(bool hasImplementation) async {
|
||||
const tronCommonHeaders = """
|
||||
import 'package:cake_wallet/view_model/send/output.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/pending_transaction.dart';
|
||||
import 'package:cw_core/output_info.dart';
|
||||
import 'package:cw_core/transaction_info.dart';
|
||||
import 'package:cw_core/wallet_base.dart';
|
||||
@@ -1084,6 +1103,7 @@ import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:cw_core/wallet_service.dart';
|
||||
import 'package:cw_core/tron_token.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:cw_core/transaction_direction.dart';
|
||||
|
||||
""";
|
||||
const tronCWHeaders = """
|
||||
@@ -1091,6 +1111,7 @@ import 'package:cw_evm/evm_chain_mnemonics.dart';
|
||||
import 'package:cw_tron/tron_transaction_credentials.dart';
|
||||
import 'package:cw_tron/tron_transaction_info.dart';
|
||||
import 'package:cw_tron/tron_wallet_creation_credentials.dart';
|
||||
import 'package:cw_tron/pending_tron_transaction.dart';
|
||||
|
||||
import 'package:cw_tron/tron_client.dart';
|
||||
import 'package:cw_tron/tron_wallet.dart';
|
||||
@@ -1131,6 +1152,19 @@ abstract class Tron {
|
||||
List<String> getDefaultTokenContractAddresses();
|
||||
List<String> getDefaultTokenSymbols();
|
||||
bool isTokenAlreadyAdded(WalletBase wallet, String contractAddress);
|
||||
TransactionInfo getTransactionInfo({
|
||||
required String id,
|
||||
required BigInt tronAmount,
|
||||
int? txFee,
|
||||
String? tokenSymbol,
|
||||
required TransactionDirection direction,
|
||||
required DateTime blockTime,
|
||||
String? to,
|
||||
String? from,
|
||||
required bool isPending,
|
||||
});
|
||||
String getPendingTransactionFee(PendingTransaction tx);
|
||||
String getPendingTransactionAmount(PendingTransaction tx);
|
||||
}
|
||||
""";
|
||||
|
||||
@@ -1361,6 +1395,7 @@ Future<void> generateEVM(bool hasImplementation) async {
|
||||
import 'dart:math' as math;
|
||||
import 'package:cake_wallet/core/utilities.dart';
|
||||
import 'package:cake_wallet/view_model/send/output.dart';
|
||||
import 'package:cw_core/pending_transaction.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/erc20_token.dart';
|
||||
import 'package:cw_core/hardware/hardware_account_data.dart';
|
||||
@@ -1379,6 +1414,7 @@ import 'package:ledger_flutter_plus/ledger_flutter_plus.dart' as ledger;
|
||||
import 'package:bitbox_flutter/bitbox_flutter.dart' as bitbox;
|
||||
import 'package:trezor_connect/trezor_connect.dart' as trezor;
|
||||
import 'package:web3dart/web3dart.dart';
|
||||
import 'package:cw_core/transaction_direction.dart';
|
||||
|
||||
""";
|
||||
const evmCWHeaders = """
|
||||
@@ -1389,6 +1425,7 @@ import 'package:cake_wallet/entities/fiat_currency.dart';
|
||||
import 'package:cake_wallet/store/settings_store.dart';
|
||||
import 'package:cw_evm/utils/evm_chain_formatter.dart';
|
||||
import 'package:cw_evm/evm_chain_mnemonics.dart';
|
||||
import 'package:cw_evm/pending_evm_chain_transaction.dart';
|
||||
import 'package:cw_evm/evm_chain_registry.dart';
|
||||
import 'package:cw_evm/evm_erc20_balance.dart';
|
||||
import 'package:cw_evm/evm_chain_transaction_credentials.dart';
|
||||
@@ -1608,6 +1645,28 @@ abstract class EVM {
|
||||
WalletBase wallet,
|
||||
TransactionPriority priority,
|
||||
);
|
||||
|
||||
TransactionInfo getTransactionInfo(
|
||||
{
|
||||
required String id,
|
||||
required int height,
|
||||
required BigInt ethAmount,
|
||||
required BigInt ethFee,
|
||||
required String tokenSymbol,
|
||||
int exponent = 18,
|
||||
required TransactionDirection direction,
|
||||
required bool isPending,
|
||||
required DateTime date,
|
||||
required int confirmations,
|
||||
String? to,
|
||||
String? from,
|
||||
String? evmSignatureName,
|
||||
String? contractAddress,
|
||||
required int chainId,
|
||||
}
|
||||
);
|
||||
BigInt getPendingTransactionFee(PendingTransaction tx);
|
||||
String getPendingTransactionAmount(PendingTransaction tx);
|
||||
|
||||
Future<void> discoverAndAddWalletTokens(WalletBase wallet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user