on master help sign in
2 files changed+5−4
since splitsnapshots
unifiedsplit
package.json+1−1 src/lib/authToken.ts+4−3
package.json+1−1
@@ -1,6 +1,6 @@
11{
22 "name": "bridge",
3− "version": "3.3.0",
3+ "version": "3.3.1",
44 "description": "An application for interacting with Azimuth",
55 "repository": {
66 "type": "git",
src/lib/authToken.ts+4−3
@@ -1,7 +1,7 @@
11import { crypto } from 'bitcoinjs-lib';
22import { ecdsaSign } from 'secp256k1';
33import Web3 from 'web3';
4−import { hexToBytes } from 'web3-utils';
4+import { hexToBytes, utf8ToHex } from 'web3-utils';
55import { hashPersonalMessage } from '@ethereumjs/util';
66import { WALLET_TYPES } from './constants';
77import BridgeWallet from './types/BridgeWallet';
@@ -76,10 +76,11 @@ const getMetamaskAuthToken = ({ address, web3 }: MetamaskAuthTokenArgs) => {
7676 // but web3.eth.personal.sign hits it semi-reliably?
7777 // no idea what's going on, we should figure it out,
7878 // but we apply this bandaid to hopefully stop the bleeding.
79+ //NOTE personal_sign expects hex-encoded data; signing the hex of
80+ // MESSAGE yields the same signature as the other wallet types
7981 return window.ethereum.request({
8082 method: 'personal_sign',
81− params: [MESSAGE, address],
82− from: address,
83+ params: [utf8ToHex(MESSAGE), address],
8384 });
8485 } else {
8586 return web3.eth.personal.sign(MESSAGE, address, '');