Skip to content

Documentation / react-auth / useSignTypedData

Function: useSignTypedData()

useSignTypedData(callbacks?): Object

Use this hook to sign typed data using the embedded wallet, and to attach callbacks for success and errors.

Parameters

callbacks?: Object

callbacks.onError?: CallbackError

Callback that will execute in the case of a non-successful signTypedData.

Param [PrivyErrorCode]([object Object]) - the corresponding error code

callbacks.onSuccess?: (signature) => void

Callback that will execute once a successful signTypedData completes.

Param the signature (type string) of the embedded wallet used to sign

Returns

Object

signTypedData - prompts the user to sign typed data with their embedded wallet

signTypedData

signTypedData: (typedData, uiOptions?) => Promise<string>

Parameters

typedData: SignTypedDataParams

uiOptions?: SignMessageModalUIOptions

Returns

Promise<string>