Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt

Use this file to discover all available pages before exploring further.

This page has been updated for Wallets SDK V1. If you are using the previous version, see the previous version of this page or the V1 migration guide.

Prerequisites

  • Ensure you have a wallet created.
  • API Key: Ensure you have an API key with the scopes: wallets:signatures.create.
If you are signing with an operational signer, the wallet must have executed at least one transaction before signatures will work. This is because the wallet needs to be deployed onchain first.

Signing a Message

import { useWallet, EVMWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

const evmWallet = EVMWallet.from(wallet);

const signedMessage = await evmWallet.signMessage({ message: "Hello, world!" });
See the React SDK reference for more details.

Signing Typed Data

import { useWallet, EVMWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

const evmWallet = EVMWallet.from(wallet);
const typedData = {
    "types": {
        "EIP712Domain": [{
            "name": "name",
            "type": "string"
        }],
    },
    "primaryType": "Mail",
    "domain": {
        "name": "example.com",
        "version": "1"
    },
    "message": {
        "from": {
            "name": "John Doe"
        },
        "to": {
            "name": "Jane Doe"
        },
        "contents": "Hello, world!"
    }
};
const signedMessage = await evmWallet.signTypedData(typedData);
See the React SDK reference for more details.