getTransaction method

Future<GetTransactionOutput> getTransaction({
  1. required QueryNetwork network,
  2. String? transactionHash,
  3. String? transactionId,
})

Gets the details of a transaction.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter network : The blockchain network where the transaction occurred.

Parameter transactionHash : The hash of a transaction. It is generated when a transaction is created.

Parameter transactionId : The identifier of a Bitcoin transaction. It is generated when a transaction is created.

Implementation

Future<GetTransactionOutput> getTransaction({
  required QueryNetwork network,
  String? transactionHash,
  String? transactionId,
}) async {
  final $payload = <String, dynamic>{
    'network': network.value,
    if (transactionHash != null) 'transactionHash': transactionHash,
    if (transactionId != null) 'transactionId': transactionId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/get-transaction',
    exceptionFnMap: _exceptionFns,
  );
  return GetTransactionOutput.fromJson(response);
}