Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Update URI parameters to match ERC spec better & work with tokens #283

Closed
jzu opened this issue Nov 20, 2016 · 6 comments
Closed

Update URI parameters to match ERC spec better & work with tokens #283

jzu opened this issue Nov 20, 2016 · 6 comments
Assignees
Milestone

Comments

@jzu
Copy link
Contributor

jzu commented Nov 20, 2016

Bitcoin has a bitcoin: scheme (BIP 21), and btw it launches Armory on my Debian with Chrome (FF only launches Chrome by default. Oh well.) Alex Van de Sande has proposed ERC: Standard URI scheme with metadata, value and byte code, but it isn't ready yet.

In the meantime, I propose extending the MEW URI syntax with arguments for simple Ethereum transfers. Going to
https://www.myetherwallet.com/?address=0x01234567897e9457a371e2cce3d29ba5685d0b1e&amount=1.5&data=Some%delivery%20address#send-transaction
would give more or less:

  • MyEtherWallet appears on the "Send Ether & Tokens" page.
  • "Select the format of your private key", etc.
  • "To Address:" and "Amount to Send:" are pre-filled with the address and amount values - nothing to do.
  • Generate the transaction (including the hex-encoded data parameter value), and send it.

Now combine this with a Ledger Nano S - not exactly a 1-click buy dream, but a radically improved UX nevertheless.

@tayvano
Copy link
Contributor

tayvano commented Nov 20, 2016

The send page already has URIs implemented. Docs need to be updated but:

Example of a custom link w/ data: A transaction with a gas limit of 23000, some data, to our donation address, for 0.5ETH:

https://www.myetherwallet.com/?gaslimit=23000&data=5468616e6b20796f752c204d455720322e30&to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=0.5#send-transaction

  • gaslimit=[number]

  • data=[hex data]

  • to=[address]

  • value=[number]

  • sendmode=0 | 1 | 2 | 4 (not working yet)

  • tokensymbol = ARC | ICN | MKR ...... (not working yet)

    "sendmode" and tokenSymbol isn't working

  • sendmode=0 is ETH (Standard Transaction)

  • sendmode=1 is Only ETH

  • sendmode= 2 is Only ETC

  • sendmode=4 is Token (only useful if combined with tokenSymbol)

Also no idea where sendMode=3 went. That must have been a late night.


todo list for @kvhnuke

  1. Make sendmode= work
  2. Make tokensymbol= work.
    • Should toLowercase them. Special cases for unicorns and beercoin.
    • If sendmode=4 but no tokensymbol provided, use first token.
    • If no sendmode is provided but tokensymbol is provided, use tokensymbol. (you shouldn't need to declare both sendmode and tokensymbol.)
    • If sendmode!=4 and a token symbol IS provided, use to token symbol and ignore sendmode. (token symbol is higher priority than sendmode)
  3. There can only be data for sendmode=1, display error message to user if there is both a sendmode!=1 AND data is provided. You can only include data if sending using "ETH (Standard Transaction)". We have changed the method of sending to "ETH (Standard Transaction) to preserve your data.
  4. Accept gas= as an alternative to gaslimit=
  5. Bug. If you have a data value and a sendmode, the data field is still hidden. ie: https://www.myetherwallet.com/?gaslimit=23000&to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=0.5&sendMode=1&data=234234#send-transaction

@tayvano tayvano changed the title Add URI parameters to populate #send-transaction fields Update URI parameters to match ERC spec better & work with tokens Nov 20, 2016
@jzu
Copy link
Contributor Author

jzu commented Nov 20, 2016

Simply great, thanks.

@tayvano tayvano added this to the V3.3.0 milestone Nov 20, 2016
@tayvano
Copy link
Contributor

tayvano commented Nov 21, 2016

Tests

  1. ?gaslimit=23000#send-transaction ☑

  2. ?gas=23000#send-transaction ☑

  3. ?data=5468616e6b20796f752c204d455720322e30#send-transaction ☑

  4. ?to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8#send-transaction ☑

  5. ?value=0.5#send-transaction ☑

  6. ?sendMode=0#send-transaction ☑

  7. ?sendMode=1#send-transaction ☑

  8. ?sendMode=2#send-transaction ☑

  9. ?sendMode=3#send-transaction ☑

  10. ?sendMode=4#send-transaction ☑

  11. ?sendMode=0&tokenSymbol=BeerCoin#send-transaction ☑

  12. ?sendmode=0&tokensymbol=beercoin#send-transaction ☑

  13. ?sendMode=2&tokenSymbol=BeerCoin#send-transaction ☑

  14. ?sendMode=4&tokenSymbol=BeerCoin#send-transaction ☑

  15. ?gaslimit=23000&data=5468616e6b20796f752c204d455720322e30&to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=0.5#send-transaction ☑

  16. ?gaslimit=23000&data=5468616e6b20796f752c204d455720322e30&to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=0.5&tokenSymbol=BeerCoin&sendMode=2#send-transaction ☑

  17. ?gaslimit=23000&data=5468616e6b20796f752c204d455720322e30&to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=0.5&tokenSymbol=BeerCoin&sendMode=4#send-transaction ☑

  18. ?gaslimit=23000&data=5468616e6b20796f752c204d455720322e30&to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=0.5&tokenSymbol=BeerCoin#send-transaction ☑

  19. ?to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=0.5&tokenSymbol=BeerCoin&sendMode=2#send-transaction ☑

  20. ?to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=0.5&tokenSymbol=BeerCoin#send-transactionn ☑

  21. ?tokenSymbol=ARC#send-transaction ☑

  22. ?tokenSymbol=SNGLS#send-transaction ☑

  23. ?tokenSymbol=Unicorn#send-transaction ☑

  24. ?tokenSymbol=XAUR#send-transaction ☑

  25. ?tokenSymbol=DGDb#send-transaction ☑

  26. ?tokenSymbol=DAO_extraBalance#send-transaction ☑

@tayvano
Copy link
Contributor

tayvano commented Nov 21, 2016

Done. Commits: 81c7bb1 331719d a80dd24 5ef87ae a560d76


Final options:

  • to=[address]
    • default is empty
  • value=[number]
    • default is empty
  • sendMode=0 | 1 | 2 | 4
    • default is 0
  • tokenSymbol = ARC | ICN | MKR | ....
    • default is whatever the first token in the list is if sendMode is set to 4
    • BeerCoin and Unicorn are those words, sans emoji
  • gasLimit=[number] OR gas=[number]
    • default is 21000 and then estimated when a value is inserted
  • data=[hex data]
    • default is empty

Notes:

  • Nothing is case sensitive.
  • All fields are optional.
  • Token Symbol takes priority over sendMode. So no need to include sendMode if you have a tokenSymbol
  • gasLimit takes priority over gas if both are included
  • Data can only be included in a standard transaction (sendMode=0). If another sendMode is specified, a warning displays for the user.

Example Links:

@tayvano tayvano closed this as completed Nov 21, 2016
@tayvano
Copy link
Contributor

tayvano commented Nov 21, 2016

Shoot.

In the next couple weeks we will revisit this as the send modes will be:

ETH
ONLY ETC
TOKENS

or we may drop ETC completely.

hackmod pushed a commit to hackmod/etherwallet that referenced this issue May 1, 2019
@danimoh
Copy link

danimoh commented Aug 18, 2019

Is this still supported?

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

No branches or pull requests

4 participants