Skip to content

Commit

Permalink
fix: signer correctly set for eth_signTypedData (#4)
Browse files Browse the repository at this point in the history
* fix: eth sign typed data now sends signature

* release: bumped version to 0.7.2
  • Loading branch information
AugmentedMode authored Mar 2, 2023
1 parent 5beb2b2 commit affc26d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Wallet Guard: Browse Web3 Securely",
"version": "0.7.1",
"version": "0.7.2",
"description": "A browser extension for detecting phishing attacks on crypto wallets",
"main": "index.js",
"scripts": {
Expand Down
16 changes: 14 additions & 2 deletions src/injected/injectWalletGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,16 @@ const addWalletGuardProxy = (provider: any) => {
const params = JSON.parse(request.params[1]);
log.info({ params }, 'Request being sent');

let signer = params[0];

if (!signer) {
signer = request.params[0];
}

// Sending response.
response = await REQUEST_MANAGER.request({
chainId: await provider.request({ method: 'eth_chainId' }),
signer: params[0],
signer: signer,
domain: params['domain'],
message: params['message'],
primaryType: params['primaryType'],
Expand Down Expand Up @@ -250,12 +256,18 @@ const addWalletGuardProxy = (provider: any) => {
const params = JSON.parse(request.params[1]);
log.info({ params }, 'Request being sent');

let signer = params[0];

if (!signer) {
signer = request.params[0];
}

provider
.request({ method: 'eth_chainId' })
.then((chainId: any) => {
return REQUEST_MANAGER.request({
chainId,
signer: params[0],
signer: signer,
domain: params['domain'],
message: params['message'],
primaryType: params['primaryType'],
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Wallet Guard: Browse Web3 Securely",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0SMGNwLFsP2k1jAD54vtDqLJuIpeZWCc9gdvo2N8hzE1qIkOt29ynU1VgkJbtfuWHqWSyOCo1ljs2MjbqqFjG4qz5o3ZrEAMwmEbWGCuPddUIIiWIK0oF+BkwZiRpRS2nw/i9Dmeusf0eOlxxLYD0NpKszX73lqGt4LBIY8Wva7vmqdnKPa1F6+DDZviXcBRa8CLCzqDujTjON37o+NvQOq2u49UzVXr/DcePFrUTnnjdNkKTQkLlH00lwvxUUJl0g5IVdlxNgZXPY/C6P39YIIxsBFJH0rXvQrLgED6NGR17CBnLhOmmYghku17yoUGg3KrT4aeh8+uG5NrQZuqGwIDAQAB",
"description": "Wallet Guard acts as a security companion to your crypto wallet of choice, so you can browse at ease.",
"version": "0.7.1",
"version": "0.7.2",
"icons": {
"128": "images/wg_logos/logo_128x128.png"
},
Expand Down

0 comments on commit affc26d

Please sign in to comment.