Skip to content

Commit affc26d

Browse files
fix: signer correctly set for eth_signTypedData (#4)
* fix: eth sign typed data now sends signature * release: bumped version to 0.7.2
1 parent 5beb2b2 commit affc26d

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Wallet Guard: Browse Web3 Securely",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"description": "A browser extension for detecting phishing attacks on crypto wallets",
55
"main": "index.js",
66
"scripts": {

src/injected/injectWalletGuard.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,16 @@ const addWalletGuardProxy = (provider: any) => {
105105
const params = JSON.parse(request.params[1]);
106106
log.info({ params }, 'Request being sent');
107107

108+
let signer = params[0];
109+
110+
if (!signer) {
111+
signer = request.params[0];
112+
}
113+
108114
// Sending response.
109115
response = await REQUEST_MANAGER.request({
110116
chainId: await provider.request({ method: 'eth_chainId' }),
111-
signer: params[0],
117+
signer: signer,
112118
domain: params['domain'],
113119
message: params['message'],
114120
primaryType: params['primaryType'],
@@ -250,12 +256,18 @@ const addWalletGuardProxy = (provider: any) => {
250256
const params = JSON.parse(request.params[1]);
251257
log.info({ params }, 'Request being sent');
252258

259+
let signer = params[0];
260+
261+
if (!signer) {
262+
signer = request.params[0];
263+
}
264+
253265
provider
254266
.request({ method: 'eth_chainId' })
255267
.then((chainId: any) => {
256268
return REQUEST_MANAGER.request({
257269
chainId,
258-
signer: params[0],
270+
signer: signer,
259271
domain: params['domain'],
260272
message: params['message'],
261273
primaryType: params['primaryType'],

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Wallet Guard: Browse Web3 Securely",
44
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0SMGNwLFsP2k1jAD54vtDqLJuIpeZWCc9gdvo2N8hzE1qIkOt29ynU1VgkJbtfuWHqWSyOCo1ljs2MjbqqFjG4qz5o3ZrEAMwmEbWGCuPddUIIiWIK0oF+BkwZiRpRS2nw/i9Dmeusf0eOlxxLYD0NpKszX73lqGt4LBIY8Wva7vmqdnKPa1F6+DDZviXcBRa8CLCzqDujTjON37o+NvQOq2u49UzVXr/DcePFrUTnnjdNkKTQkLlH00lwvxUUJl0g5IVdlxNgZXPY/C6P39YIIxsBFJH0rXvQrLgED6NGR17CBnLhOmmYghku17yoUGg3KrT4aeh8+uG5NrQZuqGwIDAQAB",
55
"description": "Wallet Guard acts as a security companion to your crypto wallet of choice, so you can browse at ease.",
6-
"version": "0.7.1",
6+
"version": "0.7.2",
77
"icons": {
88
"128": "images/wg_logos/logo_128x128.png"
99
},

0 commit comments

Comments
 (0)