signTransaction method
Implementation
@override
Future<String> signTransaction(TxParam ethTxParam) async {
final key = await _getKey();
final from = EthereumAddress.fromHex(
ethAddressFromPublicKey(key.publicKey).toLowerCase());
final to = EthereumAddress.fromHex(ethTxParam.to.toLowerCase());
final gasPrice = EtherAmount.inWei(BigInt.parse(ethTxParam.gasPrice));
final value = EtherAmount.inWei(BigInt.parse(ethTxParam.value));
final tx = Transaction(
from: from,
to: to,
nonce: ethTxParam.nonce,
data: ethTxParam.data,
maxGas: ethTxParam.gasLimit,
gasPrice: gasPrice,
value: value,
);
final privateKey = EthPrivateKey.fromHex(HEX.encode(key.privateKey!));
return await wallet.web3
.signTransaction(privateKey, tx, ethTxParam.chainId);
}