Skip to content

Instantly share code, notes, and snippets.

@backus
Created April 19, 2018 02:05
Show Gist options
  • Save backus/908f4ea72cadcd67f970737128973701 to your computer and use it in GitHub Desktop.
Save backus/908f4ea72cadcd67f970737128973701 to your computer and use it in GitHub Desktop.
Example #2 for "How to make a user friendly Ethereum dApp"
const user = web3.eth.accounts[0];
const sigInput = [
{ type: "string", name: "Action", value: "Create Account" },
{ type: "address", name: "Address", value: user }
];
web3.currentProvider.sendAsync(
{ method: "eth_signTypedData", params: [sigInput, user], from: user },
handleSignature
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment