Sign messages
To request signatures or transactions from a connected wallet, you can either:
- use the wallet's EIP-1193 provider to send JSON-RPC requests to the wallet directly.
- pass the wallet to a library like
viem
,ethers
, orwagmi
. - for the embedded signer specifically, use Openfort's native
signMessage
andsendTypedMessage
methods.
The guide below explains how to request signatures and transactions via the Openfort native methods.
Signing messages#
To request a signature from a user, use the signMessage
method.
When invoked, signMessage
will request an EIP-191 personal_sign signature from the embedded signer, and returns a Promise for the user's signature as a string.
Signing typed data#
To have a user sign an EIP-712 typed data signature, use the signTypedData
method.
When invoked, signTypedData
will request an EIP-721 eth_signTypedData_v4 signature from the embedded signer, and returns a Promise for the user's signature as a string.