diff --git a/app/core/WalletConnect.js b/app/core/WalletConnect.js index ca12322017f..17375ec58f5 100644 --- a/app/core/WalletConnect.js +++ b/app/core/WalletConnect.js @@ -209,7 +209,7 @@ class WalletConnect { error, }); } - } else if (payload.method && payload.method === 'eth_signTypedData') { + } else if (payload.method === 'eth_signTypedData' || payload.method === 'eth_signTypedData_v3') { const { TypedMessageManager } = Engine.context; try { const rawSig = await TypedMessageManager.addUnapprovedMessageAsync( @@ -226,6 +226,33 @@ class WalletConnect { 'V3' ); + this.walletConnector.approveRequest({ + id: payload.id, + result: rawSig, + }); + } catch (error) { + this.walletConnector.rejectRequest({ + id: payload.id, + error, + }); + } + } else if (payload.method === 'eth_signTypedData_v4') { + const { TypedMessageManager } = Engine.context; + try { + const rawSig = await TypedMessageManager.addUnapprovedMessageAsync( + { + data: payload.params[1], + from: payload.params[0], + meta: { + title: meta && meta.name, + url: meta && meta.url, + icon: meta && meta.icons && meta.icons[0], + }, + origin: WALLET_CONNECT_ORIGIN, + }, + 'V4' + ); + this.walletConnector.approveRequest({ id: payload.id, result: rawSig,