EatTheBlocks Forum

Your 2cents please

Hi guys,

I’m building a dApp;

Once a user creates an account a wallet is auto-created

User click pay with crypto a page appears with the amount of crypto in the Users wallet with options to buy, deposit, use an external wallet(metamask).

User clicks deposit a page appears telling the user to deposit ETH with information on the amount of ETH and the wallet address.

Would appreciate any logic to achieve this specially how to auto-create a wallet upon register thanks.

Kind regards.

You 'll have to define a state in your react application, and depending on the value of this state (has registered, had done this, has done that…) you will display or not different sub-components and/or render differently the html.

To generate new addresses you can use web3 create() method. But that will not be managed by Metamask or the wallet of the user.

If you want to create a new address with Metamask, you have to check if the api of Metamask allows it.