Skip to content

Instantly share code, notes, and snippets.

@backus
Created April 19, 2018 02:05
Show Gist options
  • Select an option

  • Save backus/908f4ea72cadcd67f970737128973701 to your computer and use it in GitHub Desktop.

Select an option

Save backus/908f4ea72cadcd67f970737128973701 to your computer and use it in GitHub Desktop.

Revisions

  1. backus created this gist Apr 19, 2018.
    11 changes: 11 additions & 0 deletions signTypedData.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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
    );