diff --git a/lib/services/coins/ethereum/ethereum_wallet.dart b/lib/services/coins/ethereum/ethereum_wallet.dart index 37c79dc5c..ff8a47bba 100644 --- a/lib/services/coins/ethereum/ethereum_wallet.dart +++ b/lib/services/coins/ethereum/ethereum_wallet.dart @@ -173,9 +173,9 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { @override Future confirmSend({required Map txData}) async { web3.Web3Client client = getEthClient(); - final int chainId = await client.getNetworkId(); - final amount = txData['recipientAmt']; - final decimalAmount = Format.satoshisToAmount(amount as int, coin: coin); + final chainId = await client.getChainId(); + final amount = txData['recipientAmt'] as int; + final decimalAmount = Format.satoshisToAmount(amount, coin: coin); final bigIntAmount = amountToBigInt( decimalAmount.toDouble(), Constants.decimalPlacesForCoin(coin), @@ -187,8 +187,8 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { web3.EtherUnit.wei, txData['feeInWei']), maxGas: _gasLimit, value: web3.EtherAmount.inWei(bigIntAmount)); - final transaction = - await client.sendTransaction(_credentials, tx, chainId: chainId); + final transaction = await client.sendTransaction(_credentials, tx, + chainId: chainId.toInt()); return transaction; } @@ -773,8 +773,8 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { Future testNetworkConnection() async { web3.Web3Client client = getEthClient(); try { - final result = await client.isListeningForNetwork(); - return result; + await client.getBlockNumber(); + return true; } catch (_) { return false; }