Generic fixes (#1274)

* Display fees currency as wallet currency not the selected one

* remove unused code
catch balance network issues

* pop send screen when send completes successfully

* revert change [skip ci]

* Enable restoring haven wallets

* verify context is mounted before showing snackbar [skip ci]

* Update privacy [skip ci]

* Add user consent popup to inapp webview permission request
This commit is contained in:
Omar Hatem 2024-01-27 00:51:21 +02:00 committed by GitHub
parent aed60a7282
commit 89fdc0f4d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 134 additions and 86 deletions

View file

@ -190,11 +190,15 @@ I/flutter ( 4474): Gas Used: 53000
Future<ERC20Balance> fetchERC20Balances(
EthereumAddress userAddress, String contractAddress) async {
final erc20 = ERC20(address: EthereumAddress.fromHex(contractAddress), client: _client!);
final balance = await erc20.balanceOf(userAddress);
try {
final balance = await erc20.balanceOf(userAddress);
int exponent = (await erc20.decimals()).toInt();
int exponent = (await erc20.decimals()).toInt();
return ERC20Balance(balance, exponent: exponent);
return ERC20Balance(balance, exponent: exponent);
} catch (_) {
return ERC20Balance(BigInt.zero);
}
}
Future<Erc20Token?> getErc20Token(String contractAddress) async {