question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] SDK's `signTypedData` calls for Ledger Wallets are broken

See original GitHub issue

Expected Behavior

signTypedData calls for Ledger Wallets works in the SDK.

Current Behavior

Discord Link describing this issue.

it looks like contractkit 1.0.1+ has broken signTypedData calls for Ledger Wallets.

The reason is because this call, doesn’t actually exist in hw-app-eth version ~5.11, which you had to revert to because of the other bug.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bowdcommented, Mar 19, 2021

Yup great catch looks like we got the API wrong there. That’s what you get when you don’t have typescript declaration files for some plugins 😅.

Luckily the fix looks pretty simple easy but we need to do some testing on it to make sure that it actually works this time, and as luck would have it I actually have access to a ledger now 🎉

1reaction
zviadmcommented, Mar 19, 2021

The problem is pretty obvious in hindsight, the call is completely broken. Code looks like this:

      const domainSeparator = structHash('EIP712Domain', typedData.domain, typedData.types)
      const hashStructMessage = structHash(
        typedData.primaryType,
        typedData.message,
        typedData.types
      )

      const sig = await this.ledger!.signEIP712HashedMessage(
        await this.getValidatedDerivationPath(),
        domainSeparator,
        hashStructMessage
      )

structHash returns a ‘Buffer’ type.

https://www.npmjs.com/package/@ledgerhq/hw-app-eth?activeTab=readme#signeip712hashedmessage

signEIP712HashedMessage takes in strings not Buffers as arguments.

(cc: @bowd )

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ledger Support
No information is available for this page.
Read more >
Solve a synchronization error - Ledger Support
A synchronization error may occur in Ledger Live when there is or has been ... During the outage, you can use the third-party...
Read more >
Solving a MetaMask connection issue - Ledger Support
Open the Ethereum (ETH) app on your Ledger device before starting the "Connect Hardware Wallet > Ledger > Continue" sequence in Metamask.
Read more >
Fix USB connection issues with Ledger Live
Please make sure all applications and browser extensions are fully closed when attempting to connect. This includes third party wallets ( ...
Read more >
Ledger + MetaMask common error messages
Open the Ethereum (ETH) app on your Ledger device before you click Connect Hardware Wallet in MetaMask. Wait until the device displays The ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found