code: def get_transfer_role(chain_state: ChainState, secrethash: SecretHash) -> Optional[str]:
      
      task = chain_state.payment_mapping.secrethashes_to_task.get(secrethash)
      if not task:
          return None
      return role_from_transfer_task(task)
docs: 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