mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Generic fixes (#1348)
* Change order of currencies in currency picker * Disable Background sync until implemented properly * remove ability to use device pin in bio auth * Fix condition * Minor fix [skip ci] * make notifications red dot go when opened * Update Frozen coin text color * Update Frozen coin text color * Fetch internal transactions for eth and polygon * Remove debug prints [skip ci] * Fix Camera permission on iOS [skip ci] --------- Co-authored-by: tuxsudo <tuxsudo@tux.pizza>
This commit is contained in:
parent
fd9018bcc4
commit
698c222291
15 changed files with 87 additions and 30 deletions
|
@ -27,6 +27,8 @@ abstract class EVMChainClient {
|
|||
Future<List<EVMChainTransactionModel>> fetchTransactions(String address,
|
||||
{String? contractAddress});
|
||||
|
||||
Future<List<EVMChainTransactionModel>> fetchInternalTransactions(String address);
|
||||
|
||||
Uint8List prepareSignedTransactionForSending(Uint8List signedTransaction);
|
||||
|
||||
//! Common methods across all child classes
|
||||
|
|
|
@ -32,15 +32,15 @@ class EVMChainTransactionModel {
|
|||
factory EVMChainTransactionModel.fromJson(Map<String, dynamic> json, String defaultSymbol) =>
|
||||
EVMChainTransactionModel(
|
||||
date: DateTime.fromMillisecondsSinceEpoch(int.parse(json["timeStamp"]) * 1000),
|
||||
hash: json["hash"],
|
||||
from: json["from"],
|
||||
to: json["to"],
|
||||
amount: BigInt.parse(json["value"]),
|
||||
gasUsed: int.parse(json["gasUsed"]),
|
||||
gasPrice: BigInt.parse(json["gasPrice"]),
|
||||
contractAddress: json["contractAddress"],
|
||||
confirmations: int.parse(json["confirmations"]),
|
||||
blockNumber: int.parse(json["blockNumber"]),
|
||||
hash: json["hash"] ?? "",
|
||||
from: json["from"] ?? "",
|
||||
to: json["to"] ?? "",
|
||||
amount: BigInt.parse(json["value"] ?? "0"),
|
||||
gasUsed: int.parse(json["gasUsed"] ?? "0"),
|
||||
gasPrice: BigInt.parse(json["gasPrice"] ?? "0"),
|
||||
contractAddress: json["contractAddress"] ?? "",
|
||||
confirmations: int.parse(json["confirmations"] ?? "0"),
|
||||
blockNumber: int.parse(json["blockNumber"] ?? "0"),
|
||||
tokenSymbol: json["tokenSymbol"] ?? defaultSymbol,
|
||||
tokenDecimal: int.tryParse(json["tokenDecimal"] ?? ""),
|
||||
isError: json["isError"] == "1",
|
||||
|
|
|
@ -318,6 +318,7 @@ abstract class EVMChainWalletBase
|
|||
Future<Map<String, EVMChainTransactionInfo>> fetchTransactions() async {
|
||||
final address = _evmChainPrivateKey.address.hex;
|
||||
final transactions = await _client.fetchTransactions(address);
|
||||
final internalTransactions = await _client.fetchInternalTransactions(address);
|
||||
|
||||
final List<Future<List<EVMChainTransactionModel>>> erc20TokensTransactions = [];
|
||||
|
||||
|
@ -332,6 +333,7 @@ abstract class EVMChainWalletBase
|
|||
|
||||
final tokensTransaction = await Future.wait(erc20TokensTransactions);
|
||||
transactions.addAll(tokensTransaction.expand((element) => element));
|
||||
transactions.addAll(internalTransactions);
|
||||
|
||||
final Map<String, EVMChainTransactionInfo> result = {};
|
||||
|
||||
|
@ -492,7 +494,7 @@ abstract class EVMChainWalletBase
|
|||
_transactionsUpdateTimer!.cancel();
|
||||
}
|
||||
|
||||
_transactionsUpdateTimer = Timer.periodic(const Duration(seconds: 10), (_) {
|
||||
_transactionsUpdateTimer = Timer.periodic(const Duration(seconds: 15), (_) {
|
||||
_updateTransactions();
|
||||
_updateBalance();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue