The detriment caused by the breach of an agreement to convey an estate in real property is deemed to be the price paid, and the expenses properly incurred in examining the title and preparing the necessary papers, with interest thereon; but adding thereto, in case of bad faith, the difference between the price agreed to be paid, and the value of the estate agreed to be conveyed, at the time of the breach, and the expenses properly incurred in preparing to enter upon the land.
SDCL 21-2-3