The Messenger of Allah ﷺ forbade selling palm dates until they begin to ripen and grain until it whitens and is safe from blight. He forbade this to both the seller and the buyer.
أخبرنا علي بن حجر قال حدثنا إسمعيل عن أيوب عن نافع
أن رسول الله ﷺ نهى عن بيع النخلة حتى تزهو وعن السنبل حتى يبيض ويأمن العاهة نهى البائع والمشتري
Muslim narrated it, in the Book of Sales, chapter on the prohibition of selling fruits before their ripeness becomes apparent without a condition of picking, hadith no. 1535, from Ali bin Hajar with the same wording, and it is also in Al-Kubra, hadith no. 6143.