Skip to content

Commit

Permalink
Use web3.eth.personal to sign messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gabmontes committed Jul 19, 2022
1 parent 9f2e4f7 commit 623e22e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions site/pages/sign-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ const SignMessageForm = function () {
const signButton = {
disabled: !active || !message,
onClick() {
web3.eth.sign(message, account, function (err, _signature) {
if (err) {
web3.eth.personal
.sign(message, account)
.then(function (_signature) {
setSignature(_signature)
setFeedback('success', 'Signed successfully')
})
.catch(function (err) {
setSignature()
setFeedback('error', err.message)
return
}
setSignature(_signature)
setFeedback('success', 'Signed successfully')
})
})
}
}

Expand Down

0 comments on commit 623e22e

Please sign in to comment.