Prerequisites
- Ensure you have a wallet created.
- API Key: Ensure you have an API key with the scopes:
wallets:signatures.create.
Signing a Message
- React
- Node.js
- React Native
- Swift
- REST
Copy
Ask AI
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!" });
Parameters
The message to sign.
Returns
The signature of the message.
Copy
Ask AI
import { CrossmintWallets, createCrossmint, EVMWallet } from "@crossmint/wallets-sdk";
const crossmint = createCrossmint({
apiKey: "<your-server-api-key>",
});
const crossmintWallets = CrossmintWallets.from(crossmint);
const wallet = await crossmintWallets.getWallet(
"email:[email protected]:evm",
{ chain: "base-sepolia", signer: { type: "email" } }
);
const evmWallet = EVMWallet.from(wallet);
const signedMessage = await evmWallet.signMessage({ message: "Hello, world!" });
Parameters
The message to sign.
Returns
The signature of the message.
Copy
Ask AI
import { useWallet, EVMWallet } from '@crossmint/client-sdk-react-native-ui';
const { wallet } = useWallet();
const evmWallet = EVMWallet.from(wallet);
const signedMessage = await evmWallet.signMessage({ message: "Hello, world!" });
Parameters
The message to sign.
Returns
The signature of the message.
Copy
Ask AI
import CrossmintClient
import Wallet
let sdk = CrossmintSDK.shared
let wallet = try await sdk.crossmintWallets.getOrCreateWallet(
chain: .baseSepolia,
signer: .email("[email protected]")
)
let evmWallet = try EVMWallet.from(wallet: wallet)
let signature = try await evmWallet.signMessage("Hello, world!")
Parameters
The message to sign.
Returns
The signature of the message.
Signatures must be approved by one of the wallet’s signers.
The SDK handles this automatically, but with the REST API you must approve the signature to complete it.Sign the approval message field returned in the response inside
1
Create the signature
Call the create signature endpoint.See the API reference for more details.
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets/email:[email protected]:evm/signatures \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"type": "message",
"params": {
"message": "Hello, world!",
"signer": "email:[email protected]",
"chain": "base-sepolia"
}
}'
2
Sign the approval returned in the response
If you are using an
api-key as the admin signer you can skip the following steps.signature.approvals using the signer.3
Approve the signature
Call the approve signature endpoint using the signature from the previous step and the signature id returned in the call from Step 1.See the API reference for more details.
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets/email:[email protected]:evm/signatures/91e90094-9fe0-43a7-bab6-e5725767a3ad/approvals \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"approvals": [{
"signer": "email:[email protected]",
"signature": "0x1234567890abcdef..."
}]
}'
Signing Typed Data
- React
- Node.js
- React Native
- Swift
- REST
Copy
Ask AI
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);
Parameters
The typed data to sign.
Returns
The signature of the message.
Copy
Ask AI
import { CrossmintWallets, createCrossmint, EVMWallet } from "@crossmint/wallets-sdk";
const crossmint = createCrossmint({
apiKey: "<your-server-api-key>",
});
const crossmintWallets = CrossmintWallets.from(crossmint);
const wallet = await crossmintWallets.getWallet(
"email:[email protected]:evm",
{ chain: "base-sepolia", signer: { type: "email" } }
);
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);
Copy
Ask AI
import { useWallet, EVMWallet } from '@crossmint/client-sdk-react-native-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);
Copy
Ask AI
import CrossmintClient
import Wallet
let sdk = CrossmintSDK.shared
let wallet = try await sdk.crossmintWallets.getOrCreateWallet(
chain: .baseSepolia,
signer: .email("[email protected]")
)
let evmWallet = try EVMWallet.from(wallet: wallet)
let signature = try await evmWallet.signTypedData(typedData)
Parameters
The typed data to sign.
Returns
The signature of the message.
Signatures must be approved by one of the wallet’s signers.
The SDK handles this automatically, but with the REST API you must approve the signature to complete it.Sign the approval message field returned in the response inside
1
Create the signature
Call the create signature endpoint.See the API reference for more details.
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets/email:[email protected]:evm/signatures \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"type": "typed-data",
"params": {
"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!"
}
},
"signer": "email:[email protected]",
"chain": "base-sepolia"
}
}'
2
Sign the approval returned in the response
If you are using an
api-key as the admin signer you can skip the following steps.signature.approvals using the signer.3
Approve the signature
Call the approve signature endpoint using the signature from the previous step and the signature id returned in the call from Step 1.See the API reference for more details.
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets/email:[email protected]:evm/signatures/91e90094-9fe0-43a7-bab6-e5725767a3ad/approvals \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"approvals": [{
"signer": "email:[email protected]",
"signature": "0x1234567890abcdef..."
}]
}'

