:doc:`ManagedBlockchainQuery <../../managedblockchain-query>` / Client / get_transaction

***************
get_transaction
***************



.. py:method:: ManagedBlockchainQuery.Client.get_transaction(**kwargs)

  

  Gets the details of a transaction.

   

  .. note::

    

    This action will return transaction details for all transactions that are *confirmed* on the blockchain, even if they have not reached `finality <https://docs.aws.amazon.com/managed-blockchain/latest/ambq-dg/key-concepts.html#finality>`__.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetTransaction>`_  


  **Request Syntax**
  ::

    response = client.get_transaction(
        transactionHash='string',
        transactionId='string',
        network='ETHEREUM_MAINNET'|'ETHEREUM_SEPOLIA_TESTNET'|'BITCOIN_MAINNET'|'BITCOIN_TESTNET'
    )
    
  :type transactionHash: string
  :param transactionHash: 

    The hash of a transaction. It is generated when a transaction is created.

    

  
  :type transactionId: string
  :param transactionId: 

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

     

    .. note::

      

      ``transactionId`` is only supported on the Bitcoin networks.

      

    

  
  :type network: string
  :param network: **[REQUIRED]** 

    The blockchain network where the transaction occurred.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'transaction': {
              'network': 'ETHEREUM_MAINNET'|'ETHEREUM_SEPOLIA_TESTNET'|'BITCOIN_MAINNET'|'BITCOIN_TESTNET',
              'blockHash': 'string',
              'transactionHash': 'string',
              'blockNumber': 'string',
              'transactionTimestamp': datetime(2015, 1, 1),
              'transactionIndex': 123,
              'numberOfTransactions': 123,
              'to': 'string',
              'from': 'string',
              'contractAddress': 'string',
              'gasUsed': 'string',
              'cumulativeGasUsed': 'string',
              'effectiveGasPrice': 'string',
              'signatureV': 123,
              'signatureR': 'string',
              'signatureS': 'string',
              'transactionFee': 'string',
              'transactionId': 'string',
              'confirmationStatus': 'FINAL'|'NONFINAL',
              'executionStatus': 'FAILED'|'SUCCEEDED'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **transaction** *(dict) --* 

        Contains the details of the transaction.

        
        

        - **network** *(string) --* 

          The blockchain network where the transaction occurred.

          
        

        - **blockHash** *(string) --* 

          The block hash is a unique identifier for a block. It is a fixed-size string that is calculated by using the information in the block. The block hash is used to verify the integrity of the data in the block.

          
        

        - **transactionHash** *(string) --* 

          The hash of a transaction. It is generated when a transaction is created.

          
        

        - **blockNumber** *(string) --* 

          The block number in which the transaction is recorded.

          
        

        - **transactionTimestamp** *(datetime) --* 

          The ``Timestamp`` of the transaction.

          
        

        - **transactionIndex** *(integer) --* 

          The index of the transaction within a blockchain.

          
        

        - **numberOfTransactions** *(integer) --* 

          The number of transactions in the block.

          
        

        - **to** *(string) --* 

          The identifier of the transaction. It is generated whenever a transaction is verified and added to the blockchain.

          
        

        - **from** *(string) --* 

          The initiator of the transaction. It is either in the form a public key or a contract address.

          
        

        - **contractAddress** *(string) --* 

          The blockchain address for the contract.

          
        

        - **gasUsed** *(string) --* 

          The amount of gas used for the transaction.

          
        

        - **cumulativeGasUsed** *(string) --* 

          The amount of gas used up to the specified point in the block.

          
        

        - **effectiveGasPrice** *(string) --* 

          The effective gas price.

          
        

        - **signatureV** *(integer) --* 

          The signature of the transaction. The Z coordinate of a point V.

          
        

        - **signatureR** *(string) --* 

          The signature of the transaction. The X coordinate of a point R.

          
        

        - **signatureS** *(string) --* 

          The signature of the transaction. The Y coordinate of a point S.

          
        

        - **transactionFee** *(string) --* 

          The transaction fee.

          
        

        - **transactionId** *(string) --* 

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

          
        

        - **confirmationStatus** *(string) --* 

          Specifies whether the transaction has reached Finality.

          
        

        - **executionStatus** *(string) --* 

          Identifies whether the transaction has succeeded or failed.

          
    
  
  **Exceptions**
  
  *   :py:class:`ManagedBlockchainQuery.Client.exceptions.ThrottlingException`

  
  *   :py:class:`ManagedBlockchainQuery.Client.exceptions.ValidationException`

  
  *   :py:class:`ManagedBlockchainQuery.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`ManagedBlockchainQuery.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`ManagedBlockchainQuery.Client.exceptions.InternalServerException`

  
  *   :py:class:`ManagedBlockchainQuery.Client.exceptions.ServiceQuotaExceededException`

  