Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
fix(wc): work with all versions of the EIP-712 (#1851)
Browse files Browse the repository at this point in the history
The 712 specification has evolved over time. The current accepted
version in the community is `eth_signTypedData_v4`. That's why we have to
check any method `eth_signTypedData` called with a version parameter.
  • Loading branch information
qd-qd authored and lambertkevin committed Apr 21, 2022
1 parent 188d15d commit 973ac23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/walletconnect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export const parseCallRequest: Parser = async (account, payload) => {
data: payload.params[0],
};

case "eth_signTypedData":
// @dev: Today, `eth_signTypedData` is versionned. We can't only check `eth_signTypedData`
// This regex matches `eth_signTypedData` and `eth_signTypedData_v[0-9]`
case payload.method.match(/eth_signTypedData(_v.)?$/)?.input:
message = JSON.parse(payload.params[1]);
hashes = {
// $FlowFixMe
Expand Down

0 comments on commit 973ac23

Please sign in to comment.