Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate web3 so that users don't have to type in their ETH address when shapeshifting #26

Open
coopermaruyama opened this issue Jun 24, 2017 · 8 comments

Comments

@coopermaruyama
Copy link
Member

No description provided.

@jamesyoung
Copy link

FYI web3/web3.js#905

@youfoundron
Copy link
Contributor

youfoundron commented Jun 27, 2017

These seems like a fun one. New to web3 so I'll be getting some education. 🎓

@youfoundron
Copy link
Contributor

youfoundron commented Jun 28, 2017

Seems like our little exchange form is submitting on successful wallet address validation which is fired in a debounced onchange handler.

Since there is no submit button, the web3 enabled user will be stuck experiencing one of two scenarios:

  1. A user's wallet address is prepopulated on componentWillMount, but they need to trigger an onchange for it to validate (triggering submission).
  2. A user's wallet address is preopulated and immediately validated on componentWillMount, triggering submit before they have the chance to enter an amount of ETH to send.

To address this we can:

  1. Add a submit button and force the user to manually submit.
  2. Fire validation for every onblur of either input, and trigger submit if both pass validation.
  3. Do something else?

I'm personally prone to option 2, but am open to any suggestions.

@coopermaruyama
Copy link
Member Author

Hmmmm... Honestly if they don't have to type or copy-paste then I think both of those interactions are kind of awkward. My vote is that we stick to the conventions we're already used to seeing on web3 sites - the input box becomes a dropdown list.

If the user has web3, we should also be triggering the transaction for them to send to the deposit address. Basically right now, people have to type in ETH address, then copy the deposit address, then go open their wallet and manually enter the transaction.

For web3 users, we have all the APIs available so that they can simply:

  1. choose from their saved addresses on a dropdown.
  2. Transaction is auto-generated in metamask (or similar) and they just click 'Accept' and sign the transaction.

Thoughts? And yeah, this should be a really fun one!

@youfoundron
Copy link
Contributor

@cooper care to show me an example of this user flow in the wild? Thanks! 😁

@coopermaruyama
Copy link
Member Author

coopermaruyama commented Jun 29, 2017

Yeah, examples off the top of my head are etheroll.com and etherdelta.github.io

Etherdelta has a dropdown to choose an address. Etheroll just chooses the first one for you.

Also, on Etheroll, when you place a bet, its creating an ETH transaction pre-filled for you with the right data, and then asks you to sign it via web3. we could do the same.

@youfoundron
Copy link
Contributor

Looking at these two sites I'm thinking we should always do dropdown.

My reasoning being that selecting an address will act as the submit action, triggering address validation and transaction prefilling. Seem good?

@coopermaruyama
Copy link
Member Author

Yeah, exactly what I had in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants