Web3JS Online
Viem Online
Webhooks, Alerts, and a simple API.
The verifyTypedData function is a utility function in the viem library that verifies whether a given address generated a signature for a typed data message. The function takes in several parameters:
Here are the parameters of the verifyTypedData function:
The function returns a boolean value indicating whether the provided address generated the signature. Here are some examples of how to use the verifyTypedData function:
In this example, we create a domain object that defines the typed data domain, and a types object that defines the types of the message. We also create a message object that contains the values of the message fields, and a signature string that represents the signature of the typed data message. Finally, we call the verifyTypedData function with these parameters and log the result to the console.
Output will appear here. You can scroll the text if it becomes too long.