diff --git a/lib/services/coins/ethereum/ethereum_wallet.dart b/lib/services/coins/ethereum/ethereum_wallet.dart index 06c7ea41c..265e39ec2 100644 --- a/lib/services/coins/ethereum/ethereum_wallet.dart +++ b/lib/services/coins/ethereum/ethereum_wallet.dart @@ -220,29 +220,6 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { await updateCachedBalance(_balance!); } - @override - Future confirmSend({required Map txData}) async { - web3.Web3Client client = getEthClient(); - 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), - ); - - final tx = web3.Transaction( - to: web3.EthereumAddress.fromHex(txData['address'] as String), - gasPrice: web3.EtherAmount.fromUnitAndValue( - web3.EtherUnit.wei, txData['feeInWei']), - maxGas: _gasLimit, - value: web3.EtherAmount.inWei(bigIntAmount)); - final transaction = await client.sendTransaction(_credentials, tx, - chainId: chainId.toInt()); - - return transaction; - } - @override Future estimateFeeFor(int satoshiAmount, int feeRate) async { final fee = estimateFee(feeRate, _gasLimit, coin.decimals); @@ -484,6 +461,29 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { return txData; } + @override + Future confirmSend({required Map txData}) async { + web3.Web3Client client = getEthClient(); + 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), + ); + + final tx = web3.Transaction( + to: web3.EthereumAddress.fromHex(txData['address'] as String), + gasPrice: web3.EtherAmount.fromUnitAndValue( + web3.EtherUnit.wei, txData['feeInWei']), + maxGas: _gasLimit, + value: web3.EtherAmount.inWei(bigIntAmount)); + final txid = await client.sendTransaction(_credentials, tx, + chainId: chainId.toInt()); + + return txid; + } + @override Future recoverFromMnemonic({ required String mnemonic,