Skip to content

Commit

Permalink
Fix eth_signTypedData_v4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
peachbits committed Apr 22, 2023
1 parent e268c38 commit 9d13fed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/modals/WcSmartContractModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { IconTile } from '../tiles/IconTile'

interface WcRpcPayload {
id: string | number
method: 'personal_sign' | 'eth_sign' | 'eth_signTypedData' | 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_sendRawTransaction'
method: 'personal_sign' | 'eth_sign' | 'eth_signTypedData' | 'eth_signTypedData_v4' | 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_sendRawTransaction'
params: any[]
}

Expand Down Expand Up @@ -192,8 +192,9 @@ async function wcRequestResponse(wallet: EdgeCurrencyWallet, uri: string, approv
switch (payload.method) {
case 'personal_sign':
case 'eth_sign':
case 'eth_signTypedData': {
const typedData = payload.method === 'eth_signTypedData'
case 'eth_signTypedData':
case 'eth_signTypedData_v4': {
const typedData = payload.method === 'eth_signTypedData' || payload.method === 'eth_signTypedData_v4'
const result = await wallet.signMessage(payload.params[1], { otherParams: { typedData } })
await wallet.otherMethods.wcApproveRequest(uri, payload, result)
break
Expand Down

0 comments on commit 9d13fed

Please sign in to comment.