<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_transfer_role(chain_state: ChainState, secrethash: SecretHash) -> Optional[str]: """ Returns 'initiator', 'mediator' or 'target' to signify the role the node has in a transfer. If a transfer task is not found for the secrethash then the function returns None """

    task = chain_state.payment_mapping.secrethashes_to_task.get(secrethash)
    if not task:
        return None
    return role_from_transfer_task(task)