Drunk Apricot Shito (Ghanaian Hot Pepper Sauce)

4 oz. dried apricots
¼ cup dark rum or arrack
1 Tbsp. unsalted butter
¼ tsp. ground cinnamon
3 Tbsp. plus 1 tsp. coconut sugar or dark brown sugar
2 grains of selim pods
½ tsp. cubeb pepper or Ashanti pepper (uziza)
½ cup peanut oil or vegetable oil
1 medium white onion, finely chopped
1 small red onion, thinly sliced
2 garlic cloves, coarsely chopped
1 1" piece ginger, peeled, finely grated (unpeeled if organic)
1 Tbsp. crushed red pepper flakes
1 tsp. chopped rosemary
1 tsp. chopped thyme
¾ tsp. dried prawn or shrimp powder
1 tsp. okra salt or kosher salt, plus more
2 Tbsp. tomato purée
3–4 Tbsp. dried chile powder
2/3 cups low-sodium chicken broth
1 Scotch bonnet or habanero chile, pierced a few times with a knife (optional)

Place apricots in a small bowl and pour in hot water to cover. Let sit 20 minutes, then drain and coarsely chop. Return apricots to same bowl and add rum; stir to coat. Chill at least 30 minutes and up to 1 day. Drain into a mesh sieve set over another small bowl or container. Reserve apricots and rum separately.
Melt butter in a medium saucepan over medium heat. Add cinnamon, 3 Tbsp. coconut sugar, and reserved apricots. Cook, stirring occasionally, until apricots are slightly softened and coated in caramel, 6–8 minutes. Add reserved rum and cook, stirring often, until thickened and syrupy, about 5 minutes. Let cool slightly. (Just FYI: You can eat these drunk apricots right away over vanilla ice cream and be very happy.)
Toast grains of selim pods and cubeb peppers in a small skillet over medium-low heat, shaking occasionally, until fragrant, about 3 minutes. Transfer to a spice mill or mortar and pestle and let cool. Grind as well as you can. The grains of selim won’t completely break up, so cracked open but mostly whole is okay—you just want to release some of their flavor.
Heat oil in a large Dutch oven or other heavy pot over medium. Cook white and red onions, stirring occasionally, until softened and just starting brown, 20–25 minutes. Stir in ground grains of selim and cubeb pepper, garlic, ginger, and remaining 1 tsp. coconut sugar. Cook, stirring occasionally, 5 minutes. Add red pepper flakes, rosemary, thyme, prawn powder, and 1 tsp. salt to pot and cook, stirring occasionally, about 2 minutes. Add drunk apricots along with any syrup and cook, stirring often, about 2 minutes.
Add tomato purée to pot and cook, stirring occasionally, 4 minutes, then stir in chile powder. Add broth and fresh chile. Cover pot and cook, stirring occasionally to prevent sticking, until a loose dark brown paste forms, 30–40 minutes. The oil will rise to the surface when the sauce is ready. Remove from heat; taste and season with more salt if needed. If you like texture, leave as is, or blend with an immersion blender (or let it cool slightly and blend it in a blender) to make it smooth. Let cool completely.
Spoon into jars or an airtight container with at least a ¼" layer of oil on top.