In California, it's customary for the seller to pay for the installation of smoke alarm detectors, carbon monoxide and water heater bracing.
If required by local law, the seller is to provide written statements of compliance for such items along with any other minimum requirements such as government inspections, reports and retrofit standards before the close of escrow.
It is advisable to verify what are the mandatory government requirements for the specific location of the property and negotiate such items in the purchase agreement to confirm they will be done at closing.