Sign Messages
Sodium Wallet can sign any message
Simple Sign
This simply signs a plain string message
It gets a Signer instance from the wallet, passes the message string to the signMessage() method, and logs the resulting signature.
Sign with EIP712
This signs a more complex EIP712 typed data object:
The typedData object describes:
The domain (contract, chain, version)
The types of data (Person in this case)
The actual message to be signed
It then passes these to the signer's signTypedData() method to generate a signature for the typed data object.
This shows how wallet SDKs can be used to:
Obtain a Signer instance
Call signMessage() to sign plain strings
Call signTypedData() to sign more complex EIP712 typed data structures
Log the resulting signatures
Last updated