Giter Site home page Giter Site logo

eth_signTypedData example about web3x HOT 6 OPEN

xf00f avatar xf00f commented on May 21, 2024
eth_signTypedData example

from web3x.

Comments (6)

xf00f avatar xf00f commented on May 21, 2024

@alko89 Could this be due to the provider you are using not supporting eth_signTypedData? Usage should be as simple as calling it with TypedSigningData as per the function signature. If you can provide an example of what you're trying that would help diagnose.

from web3x.

alko89 avatar alko89 commented on May 21, 2024

Yes I think this was also the case. I ended up calling the providers send function directly.

However when looking at the code I noticed dataToSign type is defined as dataToSign: { type: string; name: string; value: string }[] which would make it incompatible with EIPs structure (I might be wrong since I'm new to ts).
You can have a look at the sample structure in EIP712 example: https://github.com/ethereum/EIPs/blob/master/assets/eip-712/Example.js

from web3x.

xf00f avatar xf00f commented on May 21, 2024

@alko89 To be honest I implemented this very quickly to get it working in MetaMask a few months back. I wouldn't be surprised if it's now broken.

I will leave the issue open but will probably not get round to doing a proper job on this for a few weeks. I'll gladly accept a PR if you have the time yourself.

from web3x.

hickscorp avatar hickscorp commented on May 21, 2024

Is there any movement on this issue? We're trying to understand how to sign data using Web3x.

from web3x.

alko89 avatar alko89 commented on May 21, 2024

Unfortunately I'm not working on the project I have been using web3x for and am currently not involved in Ethereum development.

from web3x.

hickscorp avatar hickscorp commented on May 21, 2024

We were able to get this to work:

// Here, eth is an instance of Web3x/Eth.
// data is an instance of Web3x/Eth/TypedSigningData.
eth.signTypedData(state.account, data)

from web3x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.