explicit frm in signTypedData_v3

This commit is contained in:
Oskar Thoren 2021-01-27 13:33:10 +08:00
parent 2793612893
commit 818d7516fa
No known key found for this signature in database
GPG Key ID: BDB55C8C0EF29911
1 changed files with 5 additions and 1 deletions

View File

@ -238,13 +238,17 @@ App = {
// If we omit "_v3" we get:
// MetaMask - RPC Error: Invalid parameters: must provide an Ethereum address.
// Can problably solve by reading https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md more
// See: https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v1
signTypedData: async function(eip712data, signee) {
var json_data = JSON.stringify(eip712data)
var from = signee
return new Promise((resolve, reject) =>
// XXX can also do sendAsync hree
web3.currentProvider.send({
method: 'eth_signTypedData_v3',
params: [signee, json_data]
params: [signee, json_data],
from: from
}, function (err, resp) {
if (err) {
console.log("Error", err)