I am trying to execute a group with an asset create in the beginning and automatically opt-in a user.
I was hoping I could do it with a LogicSig but couldn't find a way to reference the created asset id. I tried to make simple application with GeneratedID which I call and issue an inner transaction to opt them in referencing that GeneratedID. But it seems like it will only work if I actually rekey their account - it says unauthorized.
I think I can use my LogicSig but it will need to wait 5-8 seconds because I can't get the created asset id before that, and so the creation won't be in the group. Unless there is another way to issue transactions in a group that reference an asset creation in the first transaction (without using an app).
Anyone have any ideas?