Prerequisites

  • Ensure you have a wallet created.
  • API Key: Ensure you have an API key with the scopes: wallets:signatures.create.

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);

Parameters

message
string
required

The message to sign.

Returns

signature
string

The signature of the message.

Signing Typed Data

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

const { wallet } = useWallet();

const evmWallet = EVMWallet.from(wallet);

const signedMessage = await evmWallet.signTypedData(typedData);

Parameters

typedData
TypedData
required

The typed data to sign.

Returns

signature
string

The signature of the message.