on master help sign in
roller: use same solution for personal signing as getMetamaskAuthToken
f941cfaHunter Miller
src/lib/utils/roller.ts+13−1
@@ -66,7 +66,19 @@ export const generateHashAndSign = async (
66) => {
66) => {
67 if (walletType === WALLET_TYPES.METAMASK) {
67 if (walletType === WALLET_TYPES.METAMASK) {
68 const hash = await api.prepareForSigning(nonce, from, type, data);
68 const hash = await api.prepareForSigning(nonce, from, type, data);
69+ let sig;
70+
71+ // same issue as seen in getMetamaskAuthToken
72+ if (window.ethereum) {
73+ sig = window.ethereum.request({
74+ method: 'personal_sign',
75+ params: [hash, wallet.address],
76+ from: wallet.address,
77+ });
78+ } else {
69− const sig = await web3.eth.personal.sign(hash, wallet.address, '');
79+ sig = await web3.eth.personal.sign(hash, wallet.address, '');
80+ }
81+
70 return sig;
82 return sig;
71 } else if (walletType === WALLET_TYPES.WALLET_CONNECT) {
83 } else if (walletType === WALLET_TYPES.WALLET_CONNECT) {
72 if (!connector || !connector.connected) {
84 if (!connector || !connector.connected) {