from typing import Dict


def encode_token_tx(token_tx: Dict) -> bytes:
    """
    Creates bytes representation of token transaction data.

    args:
        token_tx: Dictionary containing the token transaction data.

    returns:
        Bytes to be saved as token value in DB.
    """
    token_tx_str = ''
    token_tx_str += token_tx['tokenAddress'] + '\0'
    token_tx_str += token_tx['addressFrom'] + '\0'
    token_tx_str += token_tx['addressTo'] + '\0'
    token_tx_str += token_tx['value'] + '\0'
    token_tx_str += token_tx['transactionHash'] + '\0'
    token_tx_str += token_tx['timestamp'] + '\0'

    return token_tx_str.encode()