getMempoolEntry method

Future<MempoolEntry> getMempoolEntry({
  1. required String txId,
  2. bool includeOrphanPool = true,
  3. bool filterTransactionPool = true,
})

Implementation

Future<MempoolEntry> getMempoolEntry({
  required String txId,
  bool includeOrphanPool = true,
  bool filterTransactionPool = true,
}) async {
  final message = KaspadMessage(
    getMempoolEntryRequest: GetMempoolEntryRequestMessage(
      txId: txId,
      includeOrphanPool: includeOrphanPool,
      filterTransactionPool: filterTransactionPool,
    ),
  );

  final result = await _singleRequest(message);
  final error = result.getMempoolEntryResponse.error;
  if (error.message.isNotEmpty) {
    throw RpcException(error);
  }

  return result.getMempoolEntryResponse.entry;
}