getTransactionReceipt method
Get transaction receipt Returns the receipt of a transaction by transaction hash. Note That the receipt is not available for pending transactions. Hash of a transaction Returns a transaction receipt object, or null when no receipt was found:
Implementation
Future<EthereumTransactionReceipt?> getTransactionReceipt(
EthereumData? transactionHash) async {
if (transactionHash == null) {
throw ArgumentError.notNull(
'Ethereum::getTransactionReceipt - transactionHash');
}
final dynamic params = <String?>[transactionHash.asString];
const method = EthereumRpcMethods.getTransactionReceipt;
final dynamic res = await _client.rpcClient.request(method, params);
if (res != null && res.containsKey(EthereumConstants.ethResultKey)) {
return EthereumTransactionReceipt.fromMap(
res[EthereumConstants.ethResultKey]);
}
_client.processError(method, res);
return null;
}