diff --git a/lib/statemanager.js b/lib/statemanager.js index 470074a973..c0e613835d 100644 --- a/lib/statemanager.js +++ b/lib/statemanager.js @@ -505,6 +505,10 @@ StateManager.prototype.sign = function(address, dataToSign) { }; StateManager.prototype.signTypedData = function(address, typedDataToSign) { + if (typeof typedDataToSign === 'string') { + typedDataToSign = JSON.parse(typedDataToSign); + } + var account = this.accounts[to.hex(address).toLowerCase()]; if (!account) { throw new Error("cannot sign data; no private key"); diff --git a/lib/subproviders/geth_api_double.js b/lib/subproviders/geth_api_double.js index 1e4dfb3f3e..720e397d76 100644 --- a/lib/subproviders/geth_api_double.js +++ b/lib/subproviders/geth_api_double.js @@ -320,6 +320,7 @@ GethApiDouble.prototype.eth_signTypedData = function(address, typedDataToSign, c callback(error, result); }; +GethApiDouble.prototype.eth_signTypedData_v4 = GethApiDouble.prototype.eth_signTypedData; GethApiDouble.prototype.eth_sendTransaction = function(txData, callback) { this.state.queueTransaction("eth_sendTransaction", txData, null, callback);