sold an apartment building with a loan as an incentive to buy.

I sold an apartment building in 2022 with 100% seller financing from me.    To get the price that I was asking for I also gave a loan to the Buyer to do improvements on the building that he wanted to do and used the building as collateral for this loan too, plus a Personal Guaranty from the Buyer who happens to own an apartment building beside this building that I sold to him.

Since this loan was part of the deal to get my full asking price can this loan be used anywhere on my tax return as part of the transaction to sell the property  For example as a selling costs to complete the transaction.

Thanks, Rick