I have had some second toughts, and changed a few bits and added some more details
1394:
Eager to end the exhausting stalemate in the Baltic, the Hanseatic League comes forward with a wish for a compromise. At the castle of Bohus, Albrecht who have had enough of his captivity and Queen Margrethe I who have come to the conclusion that prolonged imprisonment will get her nowhere, agrees.
In February the Treaty of Bohus is signed, and Albrecht is released for a hefty ransom. As a guarantee for the ransom, the Hanseatic League is left in control of Stockholm. If Albrecht cannot pay within two years, Stockholm will be surrendered to King Olav IV. Albrecht does not waver his title, but retreats anyhow to Mecklenburg. Also the question regarding trade privileges is resolved. The Hanseatic League finally retains their old exclusive trade privileges, but an important exception is the right for local merchants to compete. The League is not pleased, but the deal at least shuts out the English and Dutch merchants and local competition at this time is more or less negligible.
In wake of the treaty, the Swedish Privy council acknowledges the Treaty of Dalaborg, making King Olav IV de facto king of Sweden.
With the ending of hostilities, the Victual Brothers becomes open prey to everyone. In August an army from the Teutonic Knights lands at Gotland and evicts the pirates from the island. They do not leave. Even tough the coherence of the brotherhood after this is broken, piracy will continue to threat maritime trade in the Baltic for years.
With the succession now in place, Queen Margrethe I starts a relentless process of buying vacant landed estates for the crown and buying out pawned provinces.
1395:
In June The Uppsala Wedding takes place. As Margareta Karlsdotter turns 14, the wedding with King Olav IV takes place. The wedding is held in Uppsala, the city where Sweden’s archbishop is located. Present at the wedding are the most numerous assembly of Scandinavian dignitaries seen in a long time; The Archbishops of Lund, Uppsala & Trondheim, 9 Bishops, 29 Norwegian, 28 Danish, 40 Swedish and 15 German nobles.
All the present dignitaries are signatories of The Uppsala Recess, a collection of laws that institutes the New Leidang and the Reduction.
The Reduction concerns crown land that have been lost during the turbulent time from 1363 in Sweden and 1368 in Denmark. Matters older than those dates are not affected. According to the law, both pawned and other provinces had to be restored to the crown. Landed estates bought also have to be returned. Peasants that had become nobility should loose their stand.
The New Leidang is a maritime law. Depending on its size all trading cities has to equip and maintain a number of ships. In peacetime they should be deployed as merchant vessels, but in wartime they are to be at the kings disposal. Failure to follow this law will result in a loss of trading rights. This actually forces the Hanseatic League to support the cities in following the law, or else the city will not be eligible for trading.
Later this year King Olav IV charters his own trading company. Two ships are acquired and will serve like the Leidang ships.
1396:
In February the time limit for Albrecht’s ransom is reached. He is unable to comply and King Olav IV quickly demands the control of Stockholm. Initially the Hanseatic League tries to tie this to changes in the trading privilege. But King Olav IV does not budge. By referring to the Treaty of Bohus and threatening to ask the Holy Roman Emperor for meditation, the Hanseatic League reluctantly yields the city in late May.
Even tough King Olav IV already have achieved the status as de facto king in all the three kingdoms, a formal coronation have yet not taken place. With the last missing piece of land (besides Gotland) now secured, the time has come.