Gets the details of a transaction.
This action will return transaction details for all transactions that are confirmed on the blockchain, even if they have not reached finality.
Parameters:
-
transaction_hash
(Optional[QueryTransactionHash], default:
None
)
–
The hash of a transaction. It is generated when a transaction is created.
-
transaction_id
(Optional[QueryTransactionId], default:
None
)
–
The identifier of a Bitcoin transaction. It is generated when a transaction is created.
transactionId is only supported on the Bitcoin networks.
-
network
(QueryNetwork)
–
The blockchain network where the transaction occurred.
Raises:
-
AccessDeniedException
–
The Amazon Web Services account doesn’t have access to this resource.
-
InternalServerException
–
The request processing has failed because of an internal error in the service.
-
ResourceNotFoundException
–
The resource was not found.
-
ServiceQuotaExceededException
–
The service quota has been exceeded for this resource.
-
ThrottlingException
–
The request or operation couldn't be performed because a service is throttling requests. The most common source of throttling errors is when you create resources that exceed your service limit for this resource type. Request a limit increase or delete unused resources, if possible.
-
ValidationException
–
The resource passed is invalid.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_managedblockchain_query/_services/managed_blockchain_query.py
| def get_transaction(
self,
network: "capo_managedblockchain_query.types.query_network.QueryNetwork",
*,
config_overrides: Optional[ManagedBlockchainQueryClientConfig] = None,
transaction_hash: Optional[
"capo_managedblockchain_query.types.query_transaction_hash.QueryTransactionHash"
] = None,
transaction_id: Optional[
"capo_managedblockchain_query.types.query_transaction_id.QueryTransactionId"
] = None,
) -> (
"capo_managedblockchain_query.types.get_transaction_output.GetTransactionOutput"
):
"""<p>Gets the details of a transaction.</p> <note> <p>This action will return transaction details for all transactions that are <i>confirmed</i> on the blockchain, even if they have not reached <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ambq-dg/key-concepts.html#finality">finality</a>. </p> </note>
Args:
transaction_hash: <p>The hash of a transaction. It is generated when a transaction is created.</p>
transaction_id: <p>The identifier of a Bitcoin transaction. It is generated when a transaction is created.</p> <note> <p> <code>transactionId</code> is only supported on the Bitcoin networks.</p> </note>
network: <p>The blockchain network where the transaction occurred.</p>
Raises:
capo_managedblockchain_query.errors.access_denied_exception.AccessDeniedException: <p>The Amazon Web Services account doesn’t have access to this resource. </p>
capo_managedblockchain_query.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an internal error in the service.</p>
capo_managedblockchain_query.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found.</p>
capo_managedblockchain_query.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded for this resource.</p>
capo_managedblockchain_query.errors.throttling_exception.ThrottlingException: <p>The request or operation couldn't be performed because a service is throttling requests. The most common source of throttling errors is when you create resources that exceed your service limit for this resource type. Request a limit increase or delete unused resources, if possible.</p>
capo_managedblockchain_query.errors.validation_exception.ValidationException: <p>The resource passed is invalid.</p>
capo_managedblockchain_query.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_managedblockchain_query.types.get_transaction_input.GetTransactionInput]",
) -> OperationResponse[
"capo_managedblockchain_query.types.get_transaction_output.GetTransactionOutput"
]:
import capo_managedblockchain_query._operations.tieton_chain_query_service.get_transaction
output, http_response = (
capo_managedblockchain_query._operations.tieton_chain_query_service.get_transaction.get_transaction(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetTransaction")
)
input_: capo_managedblockchain_query.types.get_transaction_input.GetTransactionInput = {
"network": network
}
if transaction_hash is not None:
input_["transaction_hash"] = transaction_hash
if transaction_id is not None:
input_["transaction_id"] = transaction_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|