sendTransaction method
Implementation
Future<String> sendTransaction(String toAddress, String amount) async {
final transaction = Transaction(
to: EthereumAddress.fromHex(toAddress),
from: EthereumAddress.fromHex(account!),
value: EtherAmount.fromUnitAndValue(
EtherUnit.wei,
BigInt.from(double.parse(amount) * pow(10, 18)),
),
);
var httpClient = Client();
Credentials cred = CustomCredentials(walletConnect);
var ethClient = Web3Client(apiUrl, httpClient);
final txBytes = await ethClient.sendTransaction(cred, transaction);
return txBytes;
}