from typing import Dict


def encode_internal_tx(internal_tx: Dict) -> bytes:
    """
    Creates bytes representation of internal transaction data.

    args:
        internal_tx: Dictionary containing the internal transaction data.

    returns:
        Bytes to be saved as internal value in DB.
    """
    internal_tx_str = ''
    internal_tx_str += internal_tx['from'] + '\0'
    internal_tx_str += internal_tx['to'] + '\0'
    internal_tx_str += internal_tx['value'] + '\0'
    internal_tx_str += internal_tx['input'] + '\0'
    internal_tx_str += internal_tx['output'] + '\0'
    internal_tx_str += internal_tx['traceType'] + '\0'
    internal_tx_str += internal_tx['callType'] + '\0'
    internal_tx_str += internal_tx['rewardType'] + '\0'
    internal_tx_str += internal_tx['gas'] + '\0'
    internal_tx_str += internal_tx['gasUsed'] + '\0'
    internal_tx_str += internal_tx['transactionHash'] + '\0'
    internal_tx_str += internal_tx['timestamp'] + '\0'
    internal_tx_str += internal_tx['error'] + '\0'

    return internal_tx_str.encode()