Sign typed data
Use the signTypedData
method exported from the useSignTypedData
hook to sign a message with an Ethereum embedded wallet.
Usage
Parameters
The typed data object to sign with the wallet, with the properties defined in EIP-712.
Response
The signature produced by the wallet.
Callbacks
Configure callbacks for signTypedData
with the useSignTypedData
hook.
As parameters to useSignTypedData
, you may include an onSuccess
callback and/or an onError
callback.
While this component is mounted, any invocation of signTypedData
will trigger the onSuccess
callback or onError
callback on completion, depending on if the data was successfully signed or not.
onSuccess
If set, the onSuccess
callback will execute after a user has successfully signed the message. Within this callback, you can access a signature
parameter, which is the signature
string value generated by the wallet to sign the data.
onError
If set, the onError
callback will execute after a user attempts to sign the typed data and there is an error, or if the user exits the signature flow prematurely. Within this callback, you may access an error
code with more information about the error.
Was this page helpful?