Knowledge of the unseen has degrees and it is totally with Allah (SWA) and He grants parts of it to whom He Gifts from His best servants. Allah (SWT) stated is Quran that He Grants to His accepted servants parts from the Knowledge of the unseen. No Prophet had the total knowledge of the unseen like Allah, nor any Infallible Imam, but they had whatever Allah (SWT) Had Gifted them. Imams were unaware about the poison which was given to them despite having great deal of the knowledge of the unseen in other matters. Allah (SWT) Grants whatever He Wants to whomsoever He wants.
'Wassalam.