Exporting accounts from Unity for trading in the Web Marketplace
Allow Unity users to view, buy, and sell their assets in the Freeverse Customizable Marketplace
Last updated
Allow Unity users to view, buy, and sell their assets in the Freeverse Customizable Marketplace
Last updated
freeverse.io
While it is possible to allow users to trade assets directly within the game, they can also trade in Freeverse's fully featured, customizable web marketplace.
Having followed the tutorial on creating web3 wallets in Unity, or downloaded the complete project from Github.
A sandbox universe provided by Freeverse, and an associated marketplace web application (please get in touch to activated these).
Open the Unity project from the web3 wallets tutorial and run the application from the Unity Editor. If this is the first time you execute the application, it will create a new private key and store it using AES encryption (using the password "testPassword").
However, running the application again will not generate a new wallet, it will recover the encrypted wallet stored in the user's data path, and print the details out to the Console.
Make a note of the long string of characters in the first line of the console output - the Original encrypted ID. This is what we need to import the account into the Marketplace.
You can present this ID to the user in any way you wish within the interface of your game. Alternatively, you can re-encrypt the private key with a new password of the user's choosing. Either way, the user will need the copy and paste the encrypted ID string to use the marketplace
Redirect your user to the marketplace application (url provided by Freeverse so that they can login with any email they choose. Once logged in, they should go to the setting page, accessed by clicking on the user profile icon in the top right of the screen:
From there, click on Account Management to access the following screen:
Then click on the green Add New account button. Then Import account via Encrypted ID.
Finally, the user can paste the encrypted ID, type their password, and add an alias to the account:
After clicking Import, the wallet is imported and selected by default, and the user can view and trade their assets: