Management API Reference

Wallets

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, or wagmi.
  • for the embedded signer specifically, use Openfort's native signMessage and sendTypedMessage 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.

client.tsx
openfortConfig.ts

_10
import openfort from "./openfortConfig"
_10
_10
// This example assumes you have already checked that Openfort 'embeddedState' is
_10
// `ready` and the user is `authenticated`
_10
async function signMessageButton(message:string) {
_10
await openfort.signMessage(message);
_10
}

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.

client.tsx
openfortConfig.ts

_10
import openfort from "./openfortConfig"
_10
_10
// This example assumes you have already checked that Openfort 'embeddedState' is
_10
// `ready` and the user is `authenticated`
_10
async function signTypedMessageButton(domain: any, types: any, value: any) {
_10
await openfort.signTypedData(domain, types, value);
_10
}

Examples#