getPoolTransaction function

Future<PoolTransaction> getPoolTransaction(
  1. String transactionId
)

GET request to the /transactions-pool/:transactionId endpoint. Returns a specific unforged transaction @param {string} transactionId - The ID for the specific transaction @returns {object} Response data with the transaction

Implementation

Future<PoolTransaction> getPoolTransaction(String transactionId) async {
  final response =
      await get(baseApiUrl, TRANSACTIONS_POOL_URL + '/' + transactionId);
  if (response.statusCode == 200) {
    final jsonResponse = await extractJSON(response);
    final PoolTransaction poolTransaction =
        PoolTransaction.fromJson(json.decode(jsonResponse));
    return poolTransaction;
  } else {
    throw ('Error: $response.statusCode');
  }
}