getTransactionByHash method
Get transaction by hash Returns the information about a transaction requested by transaction hash. Hash of a transaction Returns a transaction object, or null when no transaction was found:
Implementation
Future<EthereumTransaction?> getTransactionByHash(EthereumData? hash) async {
if (hash == null) {
throw ArgumentError.notNull('Ethereum::getTransactionByHash - hash');
}
final dynamic params = <String?>[hash.asString];
const method = EthereumRpcMethods.getTransactionByHash;
final dynamic res = await _client.rpcClient.request(method, params);
if (res != null && res.containsKey(EthereumConstants.ethResultKey)) {
return EthereumTransaction.fromMap(res[EthereumConstants.ethResultKey]);
}
_client.processError(method, res);
return null;
}