When the Messenger of Allah ﷺ arrived in Medina, he gave orders for the mosque to be built. He said, "Children of Najjar, name me a price for this walled garden of yours."They replied, "No, by Allah, we will seek its price from none but Allah."
لما قدم رسول الله ﷺ المدينة أمر بالمسجد، وقال: يا بني النجار، ثامنوني بحائطكم هذا. قالوا: لا، والله، لا نطلب ثمنه إلا إلى الله.
Bukhari related it in the Book of Wills (2774), and Muslim in the Book of Mosques (524), both from the hadith of Abdul-Warith, from Abu Tayah Dubai, who said, "Anas bin Malik narrated it to me," and he mentioned it. The wording given is that of Bukhari, and the wording of Muslim is similar.