mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Cw 870 ethereum enhancements (#1951)
* fix evm balance display issues * fix adding token * fix tab controller issue * Update cw_evm/lib/evm_chain_client.dart [skip ci] --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
f35c20203e
commit
7cc9e36016
6 changed files with 60 additions and 24 deletions
|
@ -634,14 +634,21 @@ abstract class EVMChainWalletBase
|
|||
|
||||
final newToken = createNewErc20TokenObject(token, iconPath);
|
||||
|
||||
await evmChainErc20TokensBox.put(newToken.contractAddress, newToken);
|
||||
|
||||
if (newToken.enabled) {
|
||||
balance[newToken] = await _client.fetchERC20Balances(
|
||||
_evmChainPrivateKey.address,
|
||||
newToken.contractAddress,
|
||||
);
|
||||
try {
|
||||
final erc20Balance = await _client.fetchERC20Balances(
|
||||
_evmChainPrivateKey.address,
|
||||
newToken.contractAddress,
|
||||
);
|
||||
|
||||
balance[newToken] = erc20Balance;
|
||||
|
||||
await evmChainErc20TokensBox.put(newToken.contractAddress, newToken);
|
||||
} on Exception catch (_) {
|
||||
rethrow;
|
||||
}
|
||||
} else {
|
||||
await evmChainErc20TokensBox.put(newToken.contractAddress, newToken);
|
||||
balance.remove(newToken);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue