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.
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.
Request a message signature on the wallets Ethereum provider.
Usage
Parameters
The method for the wallet request. For signing messages, this is 'eth_signTypedData_v4'
.
Returns
The signature produced by the wallet.
To request an EIP712 signature from a user’s embedded wallet, send an eth_signTypedData_v4
JSON-RPC request to the wallet’s EIP1193 provider.
Parameters
The method for the wallet request. For signing messages, this is 'personal_sign'
.
Returns
The signature produced by the wallet.
HD wallets
Ethereum embedded wallets are hierarchical deterministic (HD) wallets, and a user’s seed entropy can support multiple separate embedded wallets.
HD wallets are only supported on Ethereum. allowAdditional
is not supported for Solana wallets.
Send a request with the new wallet
To send a request to an embedded wallet not at the 0-index, pass the desired wallet address as an optional second parameter to provider.request
.
Parameters
The method for the wallet request. For signing messages, this is 'eth_signTypedData_v4'
.
Returns
The signature produced by the wallet.
Parameters
The method for the wallet request. For signing messages, this is 'eth_signTypedData_v4'
.
Returns
The signature produced by the wallet.
Parameters
The method for the wallet request. For signing typed data, this is 'eth_signTypedData_v4'
.
Returns
The RPC method executed with the wallet.
Outputs for the RPC method executed with the wallet.
Use the signTypedData
method on the Ethereum client to sign a message with an Ethereum wallet.
Usage
Parameters
Unique ID of the wallet to take actions with.
Idempotency key to identify a unique request.
The typed data object to sign with the wallet, with the properties defined in EIP-712.
Returns
An encoded string serializing the signature produced by the user’s wallet.
The encoding format for the returned signature
. Currently, only 'hex'
is supported for
Ethereum.
To sign typed data make a POST request to
Parameters
RPC method to execute with the wallet.
Parameters for the RPC method to execute with the wallet.
Returns
The RPC method executed with the wallet.
Outputs for the RPC method executed with the wallet.