We know that
the Bifrost Observatory on Asgard pulls energy from the center of Asgard to generate a Bifrost Bridge:
"Using his sword, Heimdall can direct the Bifrost energy to a desired location, typically one of the other Nine Realms including Earth. The energy is drawn from the center of Asgard to the observatory where it is directed towards a destination and acts as a means of precise transportation."
I don't believe we have enough information to know for sure how this energy ended up in the center of Asgard, but it can apparently be found and harnessed elsewhere, suggesting that the energy was somehow harvested and stored in Asgard. Asgard's supply of energy seems to be quite large however. What we do know is that the
Bifrost can generate High 6-A levels of energy per second, and there is no mention or indication that Asgard would run out of power keeping the bridge open long enough for Jotunheim to be completely destroyed. The entire supply of stored energy being released all at once when Asgard is destroyed should logically be much,
much higher than the High 6-A value. It is unclear how much so without further information, but it being enough to kill Odin and Surtur doesn't seem far fetched.