Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Add support for eth_signTypedData_v4 #607

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/statemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions lib/subproviders/geth_api_double.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down