**UPDATE: Got it!! ** 🎊 🚀 🎊 🚀 🎊 🚀
Look at this beauty! (screenshot)
My main objective was to run the multi swap demo in the following way:
A. All accounts authorize their own swaps without knowing any of the other users' swap intentions
B. Multi swap gets all user swaps and their auth entries and sorts out the matches and then, triggers the atomic swap for these
I was initially having trouble to generate each account authorization because I had the wrong understanding I would have to generate those manually and not be able to simulate the atomic swap without knowing the other pair beforehand. It all clicked when going thorough the simulations and noticing that the authorization entry generated from it was already covering only the necessary authorization for that account involvement in the transaction, so it was all about the workflow.
In this example I did the following:
- Setup 7 accounts and prepare their own random swap parameters.
- For each one of those I simulate their individual atomic swap with a dummy account that won't be involved in the actual swaps. It is just to run a valid swap simulation.
- Extract the auth entry from this simulation and sign
- Bundle all random accounts swaps and authorization and trigger the multi swap
- Let the magic happen!
It is really nice to see how everything is handled graciously in the batch execution!