worldwide-asset-exchange / waxjs

Javascript API for integration with the WAX Cloud Wallet.
MIT License
127 stars 103 forks source link

Sending WAX to activate a temporary account only creates the account on chain but does not set permissions. #161

Closed rahul-webd closed 1 year ago

rahul-webd commented 1 year ago

I tried creating an account on behalf of a user. The flow is - The user logs in and gets a temporary account and then on the app he can request for his account to get activated. The problem occurs when a backend service has sent the 5 WAX for the wallet to be activated. The account gets created but the permissions are not set. I have tried doing this many times, but the same happens.

callmenemo491 commented 1 year ago

Join the wax discord, and ask in the get-help channel.

rahul-webd commented 1 year ago

I simply followed up the instructions on the readme for how to set up the system. So, I believe this is the right place to ask.

https://github.com/worldwide-asset-exchange/waxjs#create-blockchain-account-on-behalf-of-the-user

niksad8 commented 1 year ago

hi there the problem with the permissions is that the user needs to login atleast once for the permissions to be activated for the user. When the person transfers 5 wax to activate the account, the account is created but not permissioned till they atleast login once with the wallet.

rahul-webd commented 1 year ago

Sorry for the late reply. I tested the way you said, logging in at least once after transferring the WAX, but the permissions are still not set and this happens every time an account is created. Is there some service, which is triggered after the WAX is sent?

niksad8 commented 1 year ago

when the person logs in to WCW the wallet is responsible for making sure the managed account is setup properly. That is why you need to login atleast once, if you are getting problems with wallets not being setup properly please provide a few wallet names and i can check them out

rahul-webd commented 1 year ago

This is not just a problem with a few wallets as I said earlier. Is there a working example somewhere of how to 'create accounts on someone else' behalf', It might be better to just go through the example than back and fro here. If not an open-source example then maybe a link to a project which is using this approach can be helpful too.

niksad8 commented 1 year ago

i just did this twice with two different accounts and both activated when they logged in. when it comes to creating accounts

the transfer of 5 wax was meant for users who want to create there account on behalf of others. then the new user logs in and everything is setup for them. there is also a system where using the backend people can activate the account using activation codes. You can buy activation codes from the support team. the cost the same really. using codes the account gets setup and the permissions get setup also.

I have seen fully integrated work flow but they use the following work flow :

give this a try, make sure the user is relogging properly, even reloading is enough for temp accounts.

rahul-webd commented 1 year ago

When you tried creating accounts, did you keep the popup opened or closed? It works if the popup is open, but not if the popup is closed which happens in my case i.e. user gets a temporary account and the popup is closed. I believe when the popup is open it is actually triggering a service in the backend which sets the permissions. So, when the WAX is sent in my case, It does not trigger that service and hence the permissions are not set.

Try using this site - https://reptilium.io and creating an account with WCW. It will return a temporary account, then send 5 WAX to newuser.wax for that account. The permissions will not be set.

niksad8 commented 1 year ago

this is what i did :

rahul-webd commented 1 year ago

Did you wait on the paywall screen at all?

rahul-webd commented 1 year ago

It seems that using the activation codes is the best way here. And with that, I am closing this issue.